PageSourceSearch

https://senpa.io/web/assets/main-CYoq09wt.js

js senpa.io collected 2026-10-02 15:25:24 UTC 1,237,417 bytes, 1,266 lines download raw bytes

1var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),d=o((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),f=o((e=>{var t=u(),n=d(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>
vendor: 20,365 bytes, line 1
1i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return p(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return m(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(ve(e,ArrayBuffer)||e&&ve(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(ve(e,SharedArrayBuffer)||e&&ve(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function f(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return f(e,t,n)};function p(e){return l(e),o(e<0?0:y(e)|0)}s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)};function m(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(ve(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function v(e){if(s.isBuffer(e)){let t=y(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||ye(e.length)?o(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(ve(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),ve(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(ve(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ve(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return me(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return ge(e).length;default:if(i)return r?-1:me(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return L(this,t,n);case`utf8`:case`utf-8`:return M(this,t,n);case`ascii`:return F(this,t,n);case`latin1`:case`binary`:return I(this,t,n);case`base64`:return j(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ee(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?M(this,0,e):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(ve(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,ye(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(ye(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return _e(me(t,e.length-n),e,n,r)}function O(e,t,n,r){return _e(V(t),e,n,r)}function k(e,t,n,r){return _e(ge(t),e,n,r)}function A(e,t,n,r){return _e(he(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return k(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return A(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function M(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return P(r)}var N=4096;function P(e){let t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}function F(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function I(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function L(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=be[e[r]];return i}function ee(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function R(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=xe(function(e){e>>>=0,B(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=xe(function(e){e>>>=0,B(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=xe(function(e){e>>>=0,B(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=xe(function(e){e>>>=0,B(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!1,52,8)};function z(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;z(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;z(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function te(e,t,n,r,i){ue(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function ne(e,t,n,r,i){ue(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=xe(function(e,t=0){return te(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=xe(function(e,t=0){return ne(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);z(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);z(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=xe(function(e,t=0){return te(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=xe(function(e,t=0){return ne(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function re(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function ie(e,t,r,i,a){return t=+t,r>>>=0,a||re(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return ie(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return ie(this,e,t,!1,n)};function ae(e,t,r,i,a){return t=+t,r>>>=0,a||re(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return ae(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return ae(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;
1if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var oe={};function se(e,t,n){oe[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}se(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),se(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),se(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ce(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ce(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ce(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function le(e,t,n){B(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&de(t,e.length-(n+1))}function ue(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new oe.ERR_OUT_OF_RANGE(`value`,i,e)}le(r,i,a)}function B(e,t){if(typeof e!=`number`)throw new oe.ERR_INVALID_ARG_TYPE(t,`number`,e)}function de(e,t,n){throw Math.floor(e)===e?t<0?new oe.ERR_BUFFER_OUT_OF_BOUNDS:new oe.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(B(e,n),new oe.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var fe=/[^+/0-9A-Za-z-_]/g;function pe(e){if(e=e.split(`=`)[0],e=e.trim().replace(fe,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function me(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function V(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function he(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function ge(e){return t.toByteArray(pe(e))}function _e(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ve(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ye(e){return e!==e}var be=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function xe(e){return typeof BigInt>`u`?Se:e}function Se(){throw Error(`BigInt not supported`)}}))(),p=`_afc_uid`,m=/^[a-f0-9]{32}$/;function h(){let e=document.cookie.match(/(?:^|;\s*)_afc_uid=([a-f0-9]{32})(?:;|$)/);return e?e[1]:``}function g(){return[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}var _=``;function v(){return _||=g(),_}function y(){try{let e=localStorage.getItem(p)||``,t=m.test(e)?e:h();m.test(t)||(t=g()),localStorage.setItem(p,t);let n=location.hostname.toLowerCase(),r=n===`senpa.io`||n.endsWith(`.senpa.io`)?`;domain=.senpa.io`:``,i=location.protocol===`https:`?`;Secure`:``;document.cookie=`${p}=${t};path=/${r};max-age=31536000;SameSite=Lax${i}`}catch{}}var b=c(o(((e,t)=>{(function(){function e(e,t,n){return e.call.apply(e.bind,arguments)}function n(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function r(t,i,a){return r=Function.prototype.bind&&Function.prototype.bind.toString().indexOf(`native code`)!=-1?e:n,r.apply(null,arguments)}var i=Date.now||function(){return+new Date};function a(e,t){this.a=e,this.o=t||e,this.c=this.o.document}var o=!!window.FontFace;function s(e,t,n,r){if(t=e.c.createElement(t),n)for(var i in n)n.hasOwnProperty(i)&&(i==`style`?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r&&t.appendChild(e.c.createTextNode(r)),t}
1function c(e,t,n){e=e.c.getElementsByTagName(t)[0],e||=document.documentElement,e.insertBefore(n,e.lastChild)}function l(e){e.parentNode&&e.parentNode.removeChild(e)}function u(e,t,n){t||=[],n||=[];for(var r=e.className.split(/\s+/),i=0;i<t.length;i+=1){for(var a=!1,o=0;o<r.length;o+=1)if(t[i]===r[o]){a=!0;break}a||r.push(t[i])}for(t=[],i=0;i<r.length;i+=1){for(a=!1,o=0;o<n.length;o+=1)if(r[i]===n[o]){a=!0;break}a||t.push(r[i])}e.className=t.join(` `).replace(/\s+/g,` `).replace(/^\s+|\s+$/,``)}function d(e,t){for(var n=e.className.split(/\s+/),r=0,i=n.length;r<i;r++)if(n[r]==t)return!0;return!1}function f(e){return e.o.location.hostname||e.a.location.hostname}function p(e,t,n){function r(){u&&i&&a&&(u(l),u=null)}t=s(e,`link`,{rel:`stylesheet`,href:t,media:`all`});var i=!1,a=!0,l=null,u=n||null;o?(t.onload=function(){i=!0,r()},t.onerror=function(){i=!0,l=Error(`Stylesheet failed to load`),r()}):setTimeout(function(){i=!0,r()},0),c(e,`head`,t)}function m(e,t,n,r){var i=e.c.getElementsByTagName(`head`)[0];if(i){var a=s(e,`script`,{src:t}),o=!1;return a.onload=a.onreadystatechange=function(){o||this.readyState&&this.readyState!=`loaded`&&this.readyState!=`complete`||(o=!0,n&&n(null),a.onload=a.onreadystatechange=null,a.parentNode.tagName==`HEAD`&&i.removeChild(a))},i.appendChild(a),setTimeout(function(){o||(o=!0,n&&n(Error(`Script load timeout`)))},r||5e3),a}return null}function h(){this.a=0,this.c=null}function g(e){return e.a++,function(){e.a--,v(e)}}function _(e,t){e.c=t,v(e)}function v(e){e.a==0&&e.c&&(e.c(),e.c=null)}function y(e){this.a=e||`-`}y.prototype.c=function(e){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n].replace(/[\W_]+/g,``).toLowerCase());return t.join(this.a)};function b(e,t){this.c=e,this.f=4,this.a=`n`;var n=(t||`n4`).match(/^([nio])([1-9])$/i);n&&(this.a=n[1],this.f=parseInt(n[2],10))}function x(e){return w(e)+` `+(e.f+`00`)+` 300px `+S(e.c)}function S(e){var t=[];e=e.split(/,\s*/);for(var n=0;n<e.length;n++){var r=e[n].replace(/['"]/g,``);r.indexOf(` `)!=-1||/^\d/.test(r)?t.push(`'`+r+`'`):t.push(r)}return t.join(`,`)}function C(e){return e.a+e.f}function w(e){var t=`normal`;return e.a===`o`?t=`oblique`:e.a===`i`&&(t=`italic`),t}function T(e){var t=4,n=`n`,r=null;return e&&((r=e.match(/(normal|oblique|italic)/i))&&r[1]&&(n=r[1].substr(0,1).toLowerCase()),(r=e.match(/([1-9]00|normal|bold)/i))&&r[1]&&(/bold/i.test(r[1])?t=7:/[1-9]00/.test(r[1])&&(t=parseInt(r[1].substr(0,1),10)))),n+t}function E(e,t){this.c=e,this.f=e.o.document.documentElement,this.h=t,this.a=new y(`-`),this.j=!1!==t.events,this.g=!1!==t.classes}function D(e){e.g&&u(e.f,[e.a.c(`wf`,`loading`)]),k(e,`loading`)}function O(e){if(e.g){var t=d(e.f,e.a.c(`wf`,`active`)),n=[],r=[e.a.c(`wf`,`loading`)];t||n.push(e.a.c(`wf`,`inactive`)),u(e.f,n,r)}k(e,`inactive`)}function k(e,t,n){e.j&&e.h[t]&&(n?e.h[t](n.c,C(n)):e.h[t]())}function A(){this.c={}}function j(e,t,n){var r=[],i;for(i in t)if(t.hasOwnProperty(i)){var a=e.c[i];a&&r.push(a(t[i],n))}return r}function M(e,t){this.c=e,this.f=t,this.a=s(this.c,`span`,{"aria-hidden":`true`},this.f)}function N(e){c(e.c,`body`,e.a)}function P(e){return`display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:`+S(e.c)+`;`+(`font-style:`+w(e)+`;font-weight:`+(e.f+`00`)+`;`)}function F(e,t,n,r,i,a){this.g=e,this.j=t,this.a=r,this.c=n,this.f=i||3e3,this.h=a||void 0}F.prototype.start=function(){var e=this.c.o.document,t=this,n=i(),r=new Promise(function(r,a){function o(){i()-n>=t.f?a():e.fonts.load(x(t.a),t.h).then(function(e){1<=e.length?r():setTimeout(o,25)},function(){a()})}o()}),a=null,o=new Promise(function(e,n){a=setTimeout(n,t.f)});Promise.race([o,r]).then(function(){a&&=(clearTimeout(a),null),t.g(t.a)},function(){t.j(t.a)})};function I(e,t,n,r,i,a,o){this.v=e,this.B=t,this.c=n,this.a=r,this.s=o||`BESbswy`,this.f={},this.w=i||3e3,this.u=a||null,this.m=this.j=this.h=this.g=null,this.g=new M(this.c,this.s),this.h=new M(this.c,this.s),this.j=new M(this.c,this.s),this.m=new M(this.c,this.s),e=new b(this.a.c+`,serif`,C(this.a)),e=P(e),this.g.a.style.cssText=e,e=new b(this.a.c+`,sans-serif`,C(this.a)),e=P(e),this.h.a.style.cssText=e,e=new b(`serif`,C(this.a)),e=P(e),this.j.a.style.cssText=e,e=new b(`sans-serif`,C(this.a)),e=P(e),this.m.a.style.cssText=e,N(this.g),N(this.h),N(this.j),N(this.m)}var L={D:`serif`,C:`sans-serif`},ee=null;
1function R(){if(ee===null){var e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);ee=!!e&&(536>parseInt(e[1],10)||parseInt(e[1],10)===536&&11>=parseInt(e[2],10))}return ee}I.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f[`sans-serif`]=this.m.a.offsetWidth,this.A=i(),te(this)};function z(e,t,n){for(var r in L)if(L.hasOwnProperty(r)&&t===e.f[L[r]]&&n===e.f[L[r]])return!0;return!1}function te(e){var t=e.g.a.offsetWidth,n=e.h.a.offsetWidth,r;(r=t===e.f.serif&&n===e.f[`sans-serif`])||(r=R()&&z(e,t,n)),r?i()-e.A>=e.w?R()&&z(e,t,n)&&(e.u===null||e.u.hasOwnProperty(e.a.c))?re(e,e.v):re(e,e.B):ne(e):re(e,e.v)}function ne(e){setTimeout(r(function(){te(this)},e),50)}function re(e,t){setTimeout(r(function(){l(this.g.a),l(this.h.a),l(this.j.a),l(this.m.a),t(this.a)},e),0)}function ie(e,t,n){this.c=e,this.a=t,this.f=0,this.m=this.j=!1,this.s=n}var ae=null;ie.prototype.g=function(e){var t=this.a;t.g&&u(t.f,[t.a.c(`wf`,e.c,C(e).toString(),`active`)],[t.a.c(`wf`,e.c,C(e).toString(),`loading`),t.a.c(`wf`,e.c,C(e).toString(),`inactive`)]),k(t,`fontactive`,e),this.m=!0,oe(this)},ie.prototype.h=function(e){var t=this.a;if(t.g){var n=d(t.f,t.a.c(`wf`,e.c,C(e).toString(),`active`)),r=[],i=[t.a.c(`wf`,e.c,C(e).toString(),`loading`)];n||r.push(t.a.c(`wf`,e.c,C(e).toString(),`inactive`)),u(t.f,r,i)}k(t,`fontinactive`,e),oe(this)};function oe(e){--e.f==0&&e.j&&(e.m?(e=e.a,e.g&&u(e.f,[e.a.c(`wf`,`active`)],[e.a.c(`wf`,`loading`),e.a.c(`wf`,`inactive`)]),k(e,`active`)):O(e.a))}function se(e){this.j=e,this.a=new A,this.h=0,this.f=this.g=!0}se.prototype.load=function(e){this.c=new a(this.j,e.context||this.j),this.g=!1!==e.events,this.f=!1!==e.classes,le(this,new E(this.c,e),e)};function ce(e,t,n,i,a){var o=--e.h==0;(e.f||e.g)&&setTimeout(function(){var e=a||null,s=i||{};if(n.length===0&&o)O(t.a);else{t.f+=n.length,o&&(t.j=o);var c,l=[];for(c=0;c<n.length;c++){var d=n[c],f=s[d.c],p=t.a,m=d;if(p.g&&u(p.f,[p.a.c(`wf`,m.c,C(m).toString(),`loading`)]),k(p,`fontloading`,m),p=null,ae===null)if(window.FontFace){var m=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),h=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);ae=m?42<parseInt(m[1],10):!h}else ae=!1;p=ae?new F(r(t.g,t),r(t.h,t),t.c,d,t.s,f):new I(r(t.g,t),r(t.h,t),t.c,d,t.s,e,f),l.push(p)}for(c=0;c<l.length;c++)l[c].start()}},0)}function le(e,t,n){var r=[],i=n.timeout;D(t);var r=j(e.a,n,e.c),a=new ie(e.c,t,i);for(e.h=r.length,t=0,n=r.length;t<n;t++)r[t].load(function(t,n,r){ce(e,a,t,n,r)})}function ue(e,t){this.c=e,this.a=t}ue.prototype.load=function(e){function t(){if(a[`__mti_fntLst`+r]){var n=a[`__mti_fntLst`+r](),i=[],o;if(n)for(var s=0;s<n.length;s++){var c=n[s].fontfamily;n[s].fontStyle!=null&&n[s].fontWeight!=null?(o=n[s].fontStyle+n[s].fontWeight,i.push(new b(c,o))):i.push(new b(c))}e(i)}else setTimeout(function(){t()},50)}var n=this,r=n.a.projectId,i=n.a.version;if(r){var a=n.c.o;m(this.c,(n.a.api||`https://fast.fonts.net/jsapi`)+`/`+r+`.js`+(i?`?v=`+i:``),function(i){i?e([]):(a[`__MonotypeConfiguration__`+r]=function(){return n.a},t())}).id=`__MonotypeAPIScript__`+r}else e([])};function B(e,t){this.c=e,this.a=t}B.prototype.load=function(e){var t,n,r=this.a.urls||[],i=this.a.families||[],a=this.a.testStrings||{},o=new h;for(t=0,n=r.length;t<n;t++)p(this.c,r[t],g(o));var s=[];for(t=0,n=i.length;t<n;t++)if(r=i[t].split(`:`),r[1])for(var c=r[1].split(`,`),l=0;l<c.length;l+=1)s.push(new b(r[0],c[l]));else s.push(new b(r[0]));_(o,function(){e(s,a)})};function de(e,t){e?this.c=e:this.c=fe,this.a=[],this.f=[],this.g=t||``}var fe=`https://fonts.googleapis.com/css`;function pe(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r].split(`:`);i.length==3&&e.f.push(i.pop());var a=``;i.length==2&&i[1]!=``&&(a=`:`),e.a.push(i.join(a))}}function me(e){if(e.a.length==0)throw Error(`No fonts to load!`);if(e.c.indexOf(`kit=`)!=-1)return e.c;for(var t=e.a.length,n=[],r=0;r<t;r++)n.push(e.a[r].replace(/ /g,`+`));return t=e.c+`?family=`+n.join(`%7C`),0<e.f.length&&(t+=`&subset=`+e.f.join(`,`)),0<e.g.length&&(t+=`&text=`+encodeURIComponent(e.g)),t}function V(e){this.f=e,this.a=[],this.c={}}var he={latin:`BESbswy`,"latin-ext":`çöüğş`,cyrillic:`йяЖ`,greek:`αβΣ`,khmer:`កខគ`,Hanuman:`កខគ`},ge={thin:`1`,extralight:`2`,"extra-light":`2`,ultralight:`2`,"ultra-light":`2`,light:`3`,regular:`4`,book:`4`,medium:`5`,"semi-bold":`6`,semibold:`6`,"demi-bold":`6`,demibold:`6`,bold:`7`,"extra-bold":`8`,extrabold:`8`,"ultra-bold":`8`,ultrabold:`8`,black:`9`,heavy:`9`,l:`3`,r:`4`,b:`7`},_e={i:`i`,italic:`i`,n:`n`,normal:`n`},ve=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function ye(e){for(var t=e.f.length,n=0;n<t;n++){var r=e.f[n].split(`:`),i=r[0].replace(/\+/g,` `),a=[`n4`];if(2<=r.length){var o,s=r[1];if(o=[],s)for(var s=s.split(`,`),c=s.length,l=0;l<c;l++){var u=s[l];if(u.match(/^[\w-]+$/)){var d=ve.exec(u.toLowerCase());if(d==null)u=``;else{if(u=d[2],u=u==null||u==``?`n`:_e[u],d=d[1],d==null||d==``)d=`4`;else var f=ge[d],d=f||(isNaN(d)?`4`:d.substr(0,1));u=[u,d].join(``)}}else u=``;u&&o.push(u)}0<o.length&&(a=o),r.length==3&&(r=r[2],o=[],r=r?r.split(`,`):o,0<r.length&&(r=he[r[0]])&&(e.c[i]=r))}for(e.c[i]||(r=he[i])&&(e.c[i]=r),r=0;r<a.length;r+=1)e.a.push(new b(i,a[r]))}}function be(e,t){this.c=e,this.a=t}var xe={Arimo:!0,Cousine:!0,Tinos:!0};be.prototype.load=function(e){var t=new h,n=this.c,r=new de(this.a.api,this.a.text),i=this.a.families;pe(r,i);var a=new V(i);ye(a),p(n,me(r),g(t)),_(t,function(){e(a.a,a.c,xe)})};function Se(e,t){this.c=e,this.a=t}Se.prototype.load=function(e){var t=this.a.id,n=this.c.o;t?m(this.c,(this.a.api||`https://use.typekit.net`)+`/`+t+`.js`,function(t){if(t)e([]);else if(n.Typekit&&n.Typekit.config&&n.Typekit.config.fn){t=n.Typekit.config.fn;for(var r=[],i=0;i<t.length;i+=2)for(var a=t[i],o=t[i+1],s=0;s<o.length;s++)r.push(new b(a,o[s]));try{n.Typekit.load({events:!1,classes:!1,async:!0})}catch{}e(r)}},2e3):e([])};function Ce(e,t){this.c=e,this.f=t,this.a=[]}Ce.prototype.load=function(e){var t=this.f.id,n=this.c.o,r=this;t?(n.__webfontfontdeckmodule__||={},n.__webfontfontdeckmodule__[t]=function(t,n){for(var i=0,a=n.fonts.length;i<a;++i){var o=n.fonts[i];r.a.push(new b(o.name,T(`font-weight:`+o.weight+`;font-style:`+o.style)))}e(r.a)},m(this.c,(this.f.api||`https://f.fontdeck.com/s/css/js/`)+f(this.c)+`/`+t+`.js`,function(t){t&&e([])})):e([])};var we=new se(window);we.a.c.custom=function(e,t){return new B(t,e)},we.a.c.fontdeck=function(e,t){return new Ce(t,e)},we.a.c.monotype=function(e,t){return new ue(t,e)},we.a.c.typekit=function(e,t){return new Se(t,e)},we.a.c.google=function(e,t){return new be(t,e)};var Te={load:r(we.load,we)};typeof define==`function`&&define.amd?define(function(){return Te}):t!==void 0&&t.exports?t.exports=Te:(window.WebFont=Te,window.WebFontConfig&&we.load(window.WebFontConfig))})()}))(),1),x=new ArrayBuffer(0),S=64,C=8192,w=class{constructor(e=x){this.reset(e)}reset(e){return this.view=new DataView(e),this.index=0,this.maxIndex=e.byteLength,this}readInt8(){let e=this.view.getInt8(this.index,!0);return this.index+=1,e}readUInt8(){let e=this.view.getUint8(this.index,!0);return this.index+=1,e}readInt16(){let e=this.view.getInt16(this.index,!0);return this.index+=2,e}readUInt16(){let e=this.view.getUint16(this.index,!0);return this.index+=2,e}readInt32(){let e=this.view.getInt32(this.index,!0);return this.index+=4,e}readUInt32(){let e=this.view.getUint32(this.index,!0);return this.index+=4,e}readFloat(){let e=this.view.getFloat32(this.index,!0);return this.index+=4,e}readDouble(){let e=this.view.getFloat64(this.index,!0);return this.index+=8,e}readString8(){return this.readBytesAsString(this.readUInt8())}readLongString8(){return this.readBytesAsString(this.readUInt16())}readString16(){return this.readCodeUnitsAsString(this.readUInt8())}readLongString16(){return this.readCodeUnitsAsString(this.readUInt16())}readBytesAsString(e){if(e<=S){let t=``;for(let n=0;n<e&&!this.end;n++)t+=String.fromCharCode(this.readUInt8());return t}let t=Math.min(e,this.bytesLeft);if(t===0)return``;let n=new Uint8Array(this.view.buffer,this.view.byteOffset+this.index,t);if(this.index+=t,t<=C)return String.fromCharCode.apply(null,n);let r=[];for(let e=0;e<t;e+=C)r.push(String.fromCharCode.apply(null,n.subarray(e,e+C)));return r.join(``)}readCodeUnitsAsString(e){if(e<=S){let t=``;for(let n=0;n<e&&!this.end;n++)t+=String.fromCharCode(this.readUInt16());return t}let t=Math.min(e,Math.floor(this.bytesLeft/2));if(t===0)return e>0&&!this.end&&this.readUInt16(),``;let n=[],r=this.index+t*2;for(;this.index<r;){let e=Math.min(C,(r-this.index)/2),t=Array(e);for(let n=0;n<e;n++)t[n]=this.readUInt16();n.push(String.fromCharCode.apply(null,t))}return t<e&&!this.end&&this.readUInt16(),n.join(``)}decodeString(e){return decodeURI(e)}get bytesLeft(){return Math.max(0,this.maxIndex-this.index)}get end(){return this.index>=this.maxIndex}},T=new class{constructor(){this.left=0,this.top=0,this.right=14e3,this.bottom=14e3,this.width=14142,this.height=14142}update(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r,this.width=n-e,this.height=r-t}},E={},D=class{constructor(e=-1,t=!1,n=``,r=``,i=`#ffffff`,a=0,o=0,s=0,c=!1,l=``){this.id=e,this.isBot=t,this.nick=n,this.tag=r,this.teamColor=i,this.r=a,this.g=o,this.b=s,this.hasReservedName=c,this.clanTag=l,this.emojiUrl=``,this.emojiStartedAt=0,this.emojiUntil=0}},O=class{constructor(e=-1,t=-1,n=`#858585`,r=``,i=0,a=0,o=0,s=0){this.id=e,this.parentClientID=t,this.parentClient=new D,this.color=n,this.skinURL=r,this.r=i,this.g=a,this.b=o,this.hatId=s}},k=class e{static rgb2hex(e,t,n){return`#`+(16777216|e<<16|t<<8|n).toString(16).substring(1)}static randomColor(){let t=[255,Math.random()*100|0,Math.random()*256|0];return t.sort(()=>Math.random()-.5),e.rgb2hex(...t)}static hexCache=new Map;static toNumber(t){if(isNaN(t)){let n=e.hexCache.get(t);return n===void 0&&(n=parseInt(t.replace(`#`,`0x`)),e.hexCache.set(t,n)),n}return t}},A=new class{constructor(){let e=0,t=()=>`e`+e++;this.Chat_ToggleMode=t(),this.Chat_Toggle=t(),this.Notify_ShowNotification=t(),this.Notify_TagChange=t
1(),this.Player_Tag=t(),this.LeaderBoard_TitleChanged=t(),this.Toggle_SpectatePlayContinue_Buttons=t(),this.ClanWars_Update=t(),this.ClanWars_Toggle=t(),this.RoomStats_Update=t(),this.ServerStats_Update=t(),this.PlayerStats_Update=t(),this.Server_Message_Update=t(),this.Update_Nickname=t(),this.LeaderBoard_Update=t(),this.Teamlist_Update=t(),this.Player_Died=t(),this.Player_Spawned=t(),this.OwnTab_Died=t(),this.Socket_Cleanup=t(),this.Socket_Blocked=t(),this.Settings=t(),this.Clear_Notifications=t(),this.Replays=t(),this.Replay_Bar=t(),this.Show_Menu=t(),this.Show_HUD=t(),this.Server_Time=t(),this.Custom_Games=t(),this.Custom_Games_List=t(),this.Request_Captcha=t(),this.Emoji_Cooldown=t(),this.Assign_PlayerInfo=t(),this.Request_Connect=t(),this.Request_Play=t(),this.Request_Spectate=t(),this.Request_Settings=t(),this.Request_Continue=t(),this.Replay_Action=t(),this.Chat_Mode_Toggled=t(),this.ClanWars_UpdatePlayer=t(),this.ClanWars_RequestUpdate=t(),this.Send_Chat=t(),this.Send_Nick=t(),this.Send_Tag=t(),this.Reload_Account=t(),this.Hide_Modals=t(),this.Render_Ad=t(),this.Input_Move=t(),this.Input_Release=t(),this.Input_Split=t(),this.Input_Feed=t(),this.Input_ToggleTab=t(),this.Input_Zoom=t(),this.Input_Stop=t(),this.Input_Emoji=t(),this.Tabs_Update=t(),this.Request_Menu=t(),this.Socket_Connected=t()}},j=new class{log(e){console.log(e)}info(e){console.info(e)}warn(e){console.warn(e)}},M=new class{constructor(){this.enabled=!1,this.direction={x:0,y:0},this.throwDistance=150,this.aim={x:0,y:0},this.lastTabCount=-1,this.lastActiveTab=-1}setDirection(e,t){this.enabled=!0,this.direction.x=e,this.direction.y=t}release(e){e&&(this.direction.x=0,this.direction.y=0)}activeCenter(){let e=Y.myCells[B.activeTab];if(e===void 0||e.size===0)return V.spectatePoint;let t=0,n=0;for(let r of e.values())t+=r.x,n+=r.y;return{x:t/e.size,y:n/e.size}}activeCenterOnScreen(){let e=this.activeCenter();return{x:(self.innerWidth>>1)+(e.x-V.x)*V.zoom,y:(self.innerHeight>>1)+(e.y-V.y)*V.zoom}}aimFrom(e){let t=this.throwDistance/V.zoom;return this.aim.x=e.x+this.direction.x*t,this.aim.y=e.y+this.direction.y*t,this.aim}sendCursor(){if(B.isStopped||!X.connected||!Ly.handshakeDone)return;let e=this.aimFrom(this.activeCenter());Ly.cursor(e.x,e.y,B.activeTab)}notifyTabs(){let e=Y.myPlayerIDs.length,t=B.activeTab;e===this.lastTabCount&&t===this.lastActiveTab||(this.lastTabCount=e,this.lastActiveTab=t,q.dispatch(A.Tabs_Update,{count:e,active:t}))}},N=o(((e,t)=>{(function(n){if(typeof e==`object`&&t!==void 0)t.exports=n();else if(typeof define==`function`&&define.amd)define([],n);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.localforage=n()}})(function(){return(function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o<r.length;o++)i(r[o]);return i})({1:[function(e,t,n){(function(e){var n=e.MutationObserver||e.WebKitMutationObserver,r;if(n){var i=0,a=new n(u),o=e.document.createTextNode(``);a.observe(o,{characterData:!0}),r=function(){o.data=i=++i%2}}else if(!e.setImmediate&&e.MessageChannel!==void 0){var s=new e.MessageChannel;s.port1.onmessage=u,r=function(){s.port2.postMessage(0)}}else r=`document`in e&&`onreadystatechange`in e.document.createElement(`script`)?function(){var t=e.document.createElement(`script`);t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};var c,l=[];function u(){c=!0;for(var e,t,n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}c=!1}t.exports=d;function d(e){l.push(e)===1&&!c&&r()}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var a={},o=[`REJECTED`],s=[`FULFILLED`],c=[`PENDING`];t.exports=l;function l(e){if(typeof e!=`function`)throw TypeError(`resolver must be a function`);this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if(typeof e!=`function`&&this.state===s||t
vendor: 7,136 bytes, line 1
1ypeof t!=`function`&&this.state===o)return this;var n=new this.constructor(i);return this.state===c?this.queue.push(new u(n,e,t)):d(n,this.state===s?e:t,this.outcome),n};function u(e,t,n){this.promise=e,typeof t==`function`&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof n==`function`&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}u.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){a.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)};function d(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,TypeError(`Cannot resolve promise with itself`)):a.resolve(e,r)})}a.resolve=function(e,t){var n=m(f,t);if(n.status===`error`)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e};function f(e){var t=e&&e.then;if(e&&(typeof e==`object`||typeof e==`function`)&&typeof t==`function`)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}function o(){t(i,r)}var s=m(o);s.status===`error`&&r(s.value)}function m(e,t){var n={};try{n.value=e(t),n.status=`success`}catch(e){n.status=`error`,n.value=e}return n}l.resolve=h;function h(e){return e instanceof this?e:a.resolve(new this(i),e)}l.reject=g;function g(e){var t=new this(i);return a.reject(t,e)}l.all=_;function _(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=Array(n),s=0,c=-1,l=new this(i);++c<n;)u(e[c],c);return l;function u(e,i){t.resolve(e).then(c,function(e){r||(r=!0,a.reject(l,e))});function c(e){o[i]=e,++s===n&&!r&&(r=!0,a.resolve(l,o))}}}l.race=v;function v(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c(e[o]);return s;function c(e){t.resolve(e).then(function(e){r||(r=!0,a.resolve(s,e))},function(e){r||(r=!0,a.reject(s,e))})}}},{1:1}],3:[function(e,t,n){(function(t){typeof t.Promise!=`function`&&(t.Promise=e(2))}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{2:2}],4:[function(e,t,n){var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(){try{if(typeof indexedDB<`u`)return indexedDB;if(typeof webkitIndexedDB<`u`)return webkitIndexedDB;if(typeof mozIndexedDB<`u`)return mozIndexedDB;if(typeof OIndexedDB<`u`)return OIndexedDB;if(typeof msIndexedDB<`u`)return msIndexedDB}catch{return}}var o=a();function s(){try{if(!o||!o.open)return!1;var e=typeof openDatabase<`u`&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t=typeof fetch==`function`&&fetch.toString().indexOf(`[native code`)!==-1;return(!e||t)&&typeof indexedDB<`u`&&typeof IDBKeyRange<`u`}catch{return!1}}function c(e,t){e||=[],t||={};try{return new Blob(e,t)}catch(i){if(i.name!==`TypeError`)throw i;for(var n=new(typeof BlobBuilder<`u`?BlobBuilder:typeof MSBlobBuilder<`u`?MSBlobBuilder:typeof MozBlobBuilder<`u`?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}typeof Promise>`u`&&e(3);var l=Promise;function u(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function d(e,t,n){typeof t==`function`&&e.then(t),typeof n==`function`&&e.catch(n)}function f(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function p(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var m=`local-forage-detect-blob-support`,h=void 0,g={},_=Object.prototype.toString,v=`readonly`,y=`readwrite`;function b(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}function x(e){return new l(function(t){var n=e.transaction(m,y),r=c([``]);n.objectStore(m).put(r,`key`),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/);t(navigator.userAgent.match(/Edge\//)||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}function S(e){return typeof h==`boolean`?l.resolve(h):x(e).then(function(e){return h=e,h})}function C(e){var t=g[e.name],n={};n.promise=new l(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function w(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function T(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function E(e,t){return new l(function(n,r){if(g[e.name]=g[e.name]||I(),e.db)if(t)C(e),e.db.close();else return n(e.db);var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(m)}catch(n){if(n.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+t.oldVersion+` to version `+t.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw n}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),w(e)}})}function D(e){return E(e,!1)}function O(e){return E(e,!0)}function k(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function A(e){return new l(function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){t({__local_forage_encoded_blob:!0,data:btoa(n.target.result||``),type:e.type})},r.readAsBinaryString(e)})}function j(e){return c([b(atob(e.data))],{type:e.type})}function M(e){return e&&e.__local_forage_encoded_blob}function N(e){var t=this,n=t._initReady().then(function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return d(n,e,e),n}function P(e){C(e);for(var t=g[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,D(e).then(function(t){return e.db=t,k(e)?O(e):t}).then(function(r){e.db=t.db=r;
1for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r}).catch(function(t){throw T(e,t),t})}function F(e,t,n,r){r===void 0&&(r=1);try{n(null,e.db.transaction(e.storeName,t))}catch(i){if(r>0&&(!e.db||i.name===`InvalidStateError`||i.name===`NotFoundError`))return l.resolve().then(function(){if(!e.db||i.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),O(e)}).then(function(){return P(e).then(function(){F(e,t,n,r-1)})}).catch(n);n(i)}}function I(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=g[n.name];i||(i=I(),g[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var a=[];function o(){return l.resolve()}for(var s=0;s<i.forages.length;s++){var c=i.forages[s];c!==t&&a.push(c._initReady().catch(o))}var u=i.forages.slice(0);return l.all(a).then(function(){return n.db=i.db,D(n)}).then(function(e){return n.db=e,k(n,t._defaultConfig.version)?O(n):e}).then(function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<u.length;r++){var a=u[r];a!==t&&(a._dbInfo.db=n.db,a._dbInfo.version=n.version)}})}function ee(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){F(n._dbInfo,v,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;e===void 0&&(e=null),M(e)&&(e=j(e)),t(e)},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function R(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){F(n._dbInfo,v,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var n=o.result;if(n){var r=n.value;M(r)&&(r=j(r));var i=e(r,n.key,s++);i===void 0?n.continue():t(i)}else t()},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function z(e,t,n){var r=this;e=f(e);var i=new l(function(n,i){var a;r.ready().then(function(){return a=r._dbInfo,_.call(t)===`[object Blob]`?S(a.db).then(function(e){return e?t:A(t)}):t}).then(function(t){F(r._dbInfo,y,function(a,o){if(a)return i(a);try{var s=o.objectStore(r._dbInfo.storeName);t===null&&(t=void 0);var c=s.put(t,e);o.oncomplete=function(){t===void 0&&(t=null),n(t)},o.onabort=o.onerror=function(){i(c.error?c.error:c.transaction.error)}}catch(e){i(e)}})}).catch(i)});return u(i,n),i}function te(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){F(n._dbInfo,y,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){r(o.error)},a.onabort=function(){r(o.error?o.error:o.transaction.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function ne(e){var t=this,n=new l(function(e,n){t.ready().then(function(){F(t._dbInfo,y,function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){n(a.error?a.error:a.transaction.error)}}catch(e){n(e)}})}).catch(n)});return u(n,e),n}function re(e){var t=this,n=new l(function(e,n){t.ready().then(function(){F(t._dbInfo,v,function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return u(n,e),n}function ie(e,t){var n=this,r=new l(function(t,r){if(e<0){t(null);return}n.ready().then(function(){F(n._dbInfo,v,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName),s=!1,c=o.openKeyCursor();c.onsuccess=function(){var n=c.result;if(!n){t(null);return}e===0||s?t(n.key):(s=!0,n.advance(e))},c.onerror=function(){r(c.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function ae(e){var t=this,n=new l(function(e,n){t.ready().then(function(){F(t._dbInfo,v,function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];a.onsuccess=function(){var t=a.result;if(!t){e(o);return}o.push(t.key),t.continue()},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return u(n,e),n}function oe(e,t){t=p.apply(this,arguments);var n=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r=this,i;if(!e.name)i=l.reject(`Invalid arguments`);else{var a=e.name===n.name&&r._dbInfo.db?l.resolve(r._dbInfo.db):D(e).then(function(t){var n=g[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t});i=e.storeName?a.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.ver
1sion+1;C(e);var r=g[e.name],i=r.forages;t.close();for(var a=0;a<i.length;a++){var s=i[a];s._dbInfo.db=null,s._dbInfo.version=n}return new l(function(t,r){var i=o.open(e.name,n);i.onerror=function(e){i.result.close(),r(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<i.length;t++){var n=i[t];n._dbInfo.db=e,w(n._dbInfo)}}).catch(function(t){throw(T(e,t)||l.resolve()).catch(function(){}),t})}}):a.then(function(t){C(e);var n=g[e.name],r=n.forages;t.close();for(var i=0;i<r.length;i++){var a=r[i];a._dbInfo.db=null}return new l(function(t,n){var r=o.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn(`dropInstance blocked for database "`+e.name+`" until all open connections are closed`)},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}).then(function(e){n.db=e;for(var t=0;t<r.length;t++){var i=r[t];w(i._dbInfo)}}).catch(function(t){throw(T(e,t)||l.resolve()).catch(function(){}),t})})}return u(i,t),i}var se={_driver:`asyncStorage`,_initStorage:L,_support:s(),iterate:R,getItem:ee,setItem:z,removeItem:te,clear:ne,length:re,key:ie,keys:ae,dropInstance:oe};function ce(){return typeof openDatabase==`function`}var le=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ue=`~~local_forage_type~`,B=/^~~local_forage_type~([^~]+)~/,de=`__lfsc__:`,fe=de.length,pe=`arbf`,me=`blob`,V=`si08`,he=`ui08`,ge=`uic8`,_e=`si16`,ve=`si32`,ye=`ur16`,be=`ui32`,xe=`fl32`,Se=`fl64`,Ce=fe+pe.length,we=Object.prototype.toString;function Te(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=le.indexOf(e[r]),o=le.indexOf(e[r+1]),s=le.indexOf(e[r+2]),c=le.indexOf(e[r+3]),u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}function Ee(e){var t=new Uint8Array(e),n=``,r;for(r=0;r<t.length;r+=3)n+=le[t[r]>>2],n+=le[(t[r]&3)<<4|t[r+1]>>4],n+=le[(t[r+1]&15)<<2|t[r+2]>>6],n+=le[t[r+2]&63];return t.length%3==2?n=n.substring(0,n.length-1)+`=`:t.length%3==1&&(n=n.substring(0,n.length-2)+`==`),n}function De(e,t){var n=``;if(e&&(n=we.call(e)),e&&(n===`[object ArrayBuffer]`||e.buffer&&we.call(e.buffer)===`[object ArrayBuffer]`)){var r,i=de;e instanceof ArrayBuffer?(r=e,i+=pe):(r=e.buffer,n===`[object Int8Array]`?i+=V:n===`[object Uint8Array]`?i+=he:n===`[object Uint8ClampedArray]`?i+=ge:n===`[object Int16Array]`?i+=_e:n===`[object Uint16Array]`?i+=ye:n===`[object Int32Array]`?i+=ve:n===`[object Uint32Array]`?i+=be:n===`[object Float32Array]`?i+=xe:n===`[object Float64Array]`?i+=Se:t(Error(`Failed to get type for BinaryArray`))),t(i+Ee(r))}else if(n===`[object Blob]`){var a=new FileReader;a.onload=function(){var n=ue+e.type+`~`+Ee(this.result);t(de+me+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error(`Couldn't convert value into a JSON string: `,e),t(null,n)}}function Oe(e){if(e.substring(0,fe)!==de)return JSON.parse(e);var t=e.substring(Ce),n=e.substring(fe,Ce),r;if(n===me&&B.test(t)){var i=t.match(B);r=i[1],t=t.substring(i[0].length)}var a=Te(t);switch(n){case pe:return a;case me:return c([a],{type:r});case V:return new Int8Array(a);case he:return new Uint8Array(a);case ge:return new Uint8ClampedArray(a);case _e:return new Int16Array(a);case ye:return new Uint16Array(a);case ve:return new Int32Array(a);case be:return new Uint32Array(a);case xe:return new Float32Array(a);case Se:return new Float64Array(a);default:throw Error(`Unkown type: `+n)}}var ke={serialize:De,deserialize:Oe,stringToBuffer:Te,bufferToString:Ee};function Ae(e,t,n,r){e.executeSql(`CREATE TABLE IF NOT EXISTS `+t.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],n,r)}function je(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=typeof e[r]==`string`?e[r]:e[r].toString();var i=new l(function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(i){Ae(i,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)});
1return n.serializer=ke,i}function Me(e,t,n,r,i,a){e.executeSql(n,r,i,function(e,o){o.code===o.SYNTAX_ERR?e.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[t.storeName],function(e,s){s.rows.length?a(e,o):Ae(e,t,function(){e.executeSql(n,r,i,a)},a)},a):a(e,o)},a)}function Ne(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Me(n,i,`SELECT * FROM `+i.storeName+` WHERE key = ? LIMIT 1`,[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&=i.serializer.deserialize(r),t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Pe(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Me(n,i,`SELECT * FROM `+i.storeName,[],function(n,r){for(var a=r.rows,o=a.length,s=0;s<o;s++){var c=a.item(s),l=c.value;if(l&&=i.serializer.deserialize(l),l=e(l,c.key,s+1),l!==void 0){t(l);return}}t()},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Fe(e,t,n,r){var i=this;e=f(e);var a=new l(function(a,o){i.ready().then(function(){t===void 0&&(t=null);var s=t,c=i._dbInfo;c.serializer.serialize(t,function(t,l){l?o(l):c.db.transaction(function(n){Me(n,c,`INSERT OR REPLACE INTO `+c.storeName+` (key, value) VALUES (?, ?)`,[e,t],function(){a(s)},function(e,t){o(t)})},function(t){if(t.code===t.QUOTA_ERR){if(r>0){a(Fe.apply(i,[e,s,n,r-1]));return}o(t)}})})}).catch(o)});return u(a,n),a}function Ie(e,t,n){return Fe.apply(this,[e,t,n,1])}function Le(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Me(n,i,`DELETE FROM `+i.storeName+` WHERE key = ?`,[e],function(){t()},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Re(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Me(t,r,`DELETE FROM `+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function ze(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Me(t,r,`SELECT COUNT(key) as c FROM `+r.storeName,[],function(t,n){var r=n.rows.item(0).c;e(r)},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Be(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Me(n,i,`SELECT key FROM `+i.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(e,n){t(n.rows.length?n.rows.item(0).key:null)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Ve(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Me(t,r,`SELECT key FROM `+r.storeName,[],function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function He(e){return new l(function(t,n){e.transaction(function(r){r.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'`,[],function(n,r){for(var i=[],a=0;a<r.rows.length;a++)i.push(r.rows.item(a).name);t({db:e,storeNames:i})},function(e,t){n(t)})},function(e){n(e)})})}function Ue(e,t){t=p.apply(this,arguments);var n=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r=this,i=e.name?new l(function(t){var i=e.name===n.name?r._dbInfo.db:openDatabase(e.name,``,``,0);e.storeName?t({db:i,storeNames:[e.storeName]}):t(He(i))}).then(function(e){return new l(function(t,n){e.db.transaction(function(r){function i(e){return new l(function(t,n){r.executeSql(`DROP TABLE IF EXISTS `+e,[],function(){t()},function(e,t){n(t)})})}for(var a=[],o=0,s=e.storeNames.length;o<s;o++)a.push(i(e.storeNames[o]));l.all(a).then(function(){t()}).catch(function(e){n(e)})},function(e){n(e)})})}):l.reject(`Invalid arguments`);return u(i,t),i}var We={_driver:`webSQLStorage`,_initStorage:je,_support:ce(),iterate:Pe,getItem:Ne,setItem:Ie,removeItem:Le,clear:Re,length:ze,key:Be,keys:Ve,dropInstance:Ue};function Ge(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return!1}}function Ke(e,t){var n=e.name+`/`;return e.storeName!==t.storeName&&(n+=e.storeName+`/`),n}function qe(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function Je(){return!qe()||localStorage.length>0}function Ye(e){var t=this,n={};if(e)for(var r in e)n[r]=e[r];return n.keyPrefix=Ke(e,t._defaultConfig),Je()?(t._dbInfo=n,n.serializer
1=ke,l.resolve()):l.reject()}function Xe(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);r.indexOf(e)===0&&localStorage.removeItem(r)}});return u(n,e),n}function Ze(e,t){var n=this;e=f(e);var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&=t.serializer.deserialize(r),r});return u(r,t),r}function Qe(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s<a;s++){var c=localStorage.key(s);if(c.indexOf(r)===0){var l=localStorage.getItem(c);if(l&&=t.serializer.deserialize(l),l=e(l,c.substring(i),o++),l!==void 0)return l}}});return u(r,t),r}function $e(e,t){var n=this,r=n.ready().then(function(){var t=n._dbInfo,r;try{r=localStorage.key(e)}catch{r=null}return r&&=r.substring(t.keyPrefix.length),r});return u(r,t),r}function et(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var a=localStorage.key(i);a.indexOf(e.keyPrefix)===0&&r.push(a.substring(e.keyPrefix.length))}return r});return u(n,e),n}function tt(e){var t=this.keys().then(function(e){return e.length});return u(t,e),t}function nt(e,t){var n=this;e=f(e);var r=n.ready().then(function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return u(r,t),r}function rt(e,t,n){var r=this;e=f(e);var i=r.ready().then(function(){t===void 0&&(t=null);var n=t;return new l(function(i,a){var o=r._dbInfo;o.serializer.serialize(t,function(t,r){if(r)a(r);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){(e.name===`QuotaExceededError`||e.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&a(e),a(e)}})})});return u(i,n),i}function it(e,t){if(t=p.apply(this,arguments),e=typeof e!=`function`&&e||{},!e.name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r=this,i=e.name?new l(function(t){e.storeName?t(Ke(e,r._defaultConfig)):t(e.name+`/`)}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);n.indexOf(e)===0&&localStorage.removeItem(n)}}):l.reject(`Invalid arguments`);return u(i,t),i}var at={_driver:`localStorageWrapper`,_initStorage:Ye,_support:Ge(),iterate:Qe,getItem:Ze,setItem:rt,removeItem:nt,clear:Xe,length:tt,key:$e,keys:et,dropInstance:it},ot=function(e,t){return e===t||typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)},st=function(e,t){for(var n=e.length,r=0;r<n;){if(ot(e[r],t))return!0;r++}return!1},ct=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},lt={},ut={},dt={INDEXEDDB:se,WEBSQL:We,LOCALSTORAGE:at},ft=[dt.INDEXEDDB._driver,dt.WEBSQL._driver,dt.LOCALSTORAGE._driver],pt=[`dropInstance`],mt=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(pt),ht={description:``,driver:ft.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function gt(e,t){e[t]=function(){var n=arguments;return e.ready().then(function(){return e[t].apply(e,n)})}}function _t(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(ct(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}t.exports=new(function(){function e(t){for(var n in i(this,e),dt)if(dt.hasOwnProperty(n)){var r=dt[n],a=r._driver;this[n]=a,lt[a]||this.defineDriver(r)}this._defaultConfig=_t({},ht),this._config=_t({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if((e===void 0?`undefined`:r(e))===`object`){if(this._ready)return Error(`Can't call config() after localforage has been used.`);for(var t in e){if(t===`storeName`&&(e[t]=e[t].replace(/\W/g,`_`)),t===`version`&&typeof e[t]!=`number`)return Error(`Database version must be a number.`);this._config[t]=e[t]}return`driver`in e&&e.driver?this.setDriver(this._config.driver):!0}else if(typeof e==`string`)return this._config[e];else return this._config},e.prototype.defineDriver=function(e,t,n){var r=new l(function(t,n){try{var r=e._driver,i=Error(`Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver`);if(!e._driver){n(i);return}for(var a=mt.concat(`_initStorage`),o=0,s=a.length;o<s;o++){var c=a[o];if((!st(pt,c)||e[c])&&typeof e[c]!=`function`){n(i);return}}(function(){for(var t=function(e){return function(){var t=Error(`Method `+e+` is not implemented by the current driver`),n=l.reject(t);return u(n,arguments[arguments.length-1]),n}},n=0,r=pt.length;n<r;n++){var i=pt[n];e[i]||(e[i]=t(i))}})();var d=function(n){lt[r]&&console.info(`Redefining LocalForage driver: `+r),lt[r]=e,ut[r]=n,t()};`_support`in e?e._support&&typeof e._support==`function`?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}});return d(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=lt[e]?l.resolve(lt[e]):l.reject(Error(`Driver not found.`));return d(r,t,n),r}
1,e.prototype.getSerializer=function(e){var t=l.resolve(ke);return d(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return d(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;ct(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){r._config.driver=r.driver()}function o(e){return r._extend(e),a(),r._ready=r._initStorage(r._config),r._ready}function s(e){return function(){var t=0;function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(o).catch(n)}a();var s=Error(`No available storage method found.`);return r._driverSet=l.reject(s),r._driverSet}return n()}}var c=this._driverSet===null?l.resolve():this._driverSet.catch(function(){return l.resolve()});return this._driverSet=c.then(function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then(function(e){r._driver=e._driver,a(),r._wrapLibraryMethodsWithReady(),r._initDriver=s(i)})}).catch(function(){a();var e=Error(`No available storage method found.`);return r._driverSet=l.reject(e),r._driverSet}),d(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ut[e]},e.prototype._extend=function(e){_t(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=mt.length;e<t;e++)gt(this,mt[e])},e.prototype.createInstance=function(t){return new e(t)},e}())},{3:3}]},{},[4])(4)})})),P=o(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);
1t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})})),F=o(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o<r.length;o++)i(r[o]);return i
vendor: 58,341 bytes, lines 1-2
1}({1:[function(e,t,n){var r=e(`./utils`),i=e(`./support`),a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;n.encode=function(e){for(var t,n,i,o,s,c,l,u=[],d=0,f=e.length,p=f,m=r.getTypeOf(e)!==`string`;d<e.length;)p=f-d,i=m?(t=e[d++],n=d<f?e[d++]:0,d<f?e[d++]:0):(t=e.charCodeAt(d++),n=d<f?e.charCodeAt(d++):0,d<f?e.charCodeAt(d++):0),o=t>>2,s=(3&t)<<4|n>>4,c=1<p?(15&n)<<2|i>>6:64,l=2<p?63&i:64,u.push(a.charAt(o)+a.charAt(s)+a.charAt(c)+a.charAt(l));return u.join(``)},n.decode=function(e){var t,n,r,o,s,c,l=0,u=0,d=`data:`;if(e.substr(0,d.length)===d)throw Error(`Invalid base64 input, it looks like a data url.`);var f,p=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,``)).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&p--,e.charAt(e.length-2)===a.charAt(64)&&p--,p%1!=0)throw Error(`Invalid base64 input, bad content length.`);for(f=i.uint8array?new Uint8Array(0|p):Array(0|p);l<e.length;)t=a.indexOf(e.charAt(l++))<<2|(o=a.indexOf(e.charAt(l++)))>>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=`
2\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,i=function(e,t,n,i,o){var s=a.transformTo(`string`,o(i));return l.CENTRAL_DIRECTORY_END+`\0\0\0\0`+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on(`error`,function(e){t.error(e)}),this},u.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch{}return!0},u.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){var r=e(`../compressions`),i=e(`./ZipFileWorker`);n.generateWorker=function(e,t,n){var a=new i(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach(function(e,n){o++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw Error(n+` is not a valid compression method !`);return i}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},c=n.dir,l=n.date;n._compressWorker(i,s).withStreamInfo(`file`,{name:e,dir:c,date:l,comment:n.comment||``,unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(a)}),a.entriesCount=o}catch(e){a.error(e)}return a}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw Error(`The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.`);this.files=Object.create(null),this.comment=null,this.root=``,this.clone=function(){var e=new r;for(var t in this)typeof this[t]!=`function`&&(e[t]=this[t]);return e}}(r.prototype=e(`./object`)).loadAsync=e(`./load`),r.support=e(`./support`),r.defaults=e(`./defaults`),r.version=`3.10.1`,r.loadAsync=function(e,t){return new r().loadAsync(e,t)},r.external=e(`./external`),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){var r=e(`./utils`),i=e(`./external`),a=e(`./utf8`),o=e(`./zipEntries`),s=e(`./stream/Crc32Probe`),c=e(`./nodejsUtils`);function l(e){return new i.Promise(function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on(`error`,function(e){n(e)}).on(`end`,function(){r.streamInfo.crc32===e.decompressed.crc32?t():n(Error(`Corrupted zip : CRC32 mismatch`))}).resume()})}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),c.isNode&&c.isStream(e)?i.Promise.reject(Error(`JSZip can't accept a stream when loading a zip file.`)):r.prepareContent(`the loaded zip file`,e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new o(t);return n.load(e),n}).then(function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var a=0;a<r.length;a++)n.push(l(r[a]));return i.Promise.all(n)}).then(function(e){for(var i=e.shift(),a=i.files,o=0;o<a.length;o++){var s=a[o],c=s.fileNameStr,l=r.resolve(s.fileNameStr);n.file(l,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(l).unsafeOriginalName=c)}return i.zipComment.length&&(n.comment=i.zipComment),n})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){var r=e(`../utils`),i=e(`../stream/GenericWorker`);function a(e,t){i.call(this,`Nodejs stream input adapter for `+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(a,i),a.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on(`data`,function(e){t.push({data:e,meta:{percent:0}})}).on(`error`,function(e){t.isPaused?this.generatedError=e:t.error(e)}).on(`end`,function(){t.isPaused?t._upstreamEnded=!0:t.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){var r=e(`readable-stream`).Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on(`data`,function(e,t){i.push(e)||i._helper.pause(),n&&n(t)}).on(`error`,function(e){i.emit(`error`,e)}).on(`end`,function(){i.push(null)})}e(`../utils`).inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){t.exports={isNode:typeof Buffer<`u`,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e==`number`)throw Error(`The "data" argument must not be a number`);return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on==`function`&&typeof e.pause==`function`&&typeof e.resume==`function`}}},{}],15:[function(e,t,n){function r(e,t,n){var r,i=a.getTypeOf(t),s=a.extend(n||{},c);s.date=s.date||new Date,s.compression!==null&&(s.compression=s.compression.toUpperCase()),typeof s.unixPermissions==`string`&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=h(e)),s.createFolders&&(r=m(e))&&g.call(this,r,!0);var d=i===`string`&&!1===s.binary&&!1===s.base64;n&&n.binary!==void 0||(s.binary=!d),(t instanceof l&&t.uncompressedSize===0||s.dir||!t||t.length===0)&&(s.base64=!1,s.binary=!0,t=``,s.compression=`STORE`,i=`string`);var _=null;_=t instanceof l||t instanceof o?t:f.isNode&&f.isStream(t)?new p(e,t):a.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new u(e,_,s);this.files[e]=v}var i=e(`./utf8`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=e(`./stream/StreamHelper`),c=e(`./defaults`),l=e(`./compressedObject`),u=e(`./zipObject`),d=e(`./generate`),f=e(`./nodejsUtils`),p=e(`./nodejs/NodejsStreamInputAdapter`),m=function(e){e.slice(-1)===`/`&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf(`/`);return 0<t?e.substring(0,t):``},h=function(e){return e.slice(-1)!==`/`&&(e+=`/`),e},g=function(e,t){return t=t===void 0?c.createFolders:t,e=h(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function _(e){return Object.prototype.toString.call(e)===`[object RegExp]`}t.exports={load:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t},file:function(e,t,n){if(arguments.length!==1)return e=this.root+e,r.call(this,e,t,n),this;if(_(e)){var i=e;return this.filter(function(e,t){return!t.dir&&i.test(e)})}var a=this.files[this.root+e];return a&&!a.dir?a:null},folder:function(e){if(!e)return this;if(_(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||=(e.slice(-1)!==`/`&&(e+=`/`),this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},generateInternalStream:function(e){var t,n={};try{if((n=a.extend(e||{},{streamFiles:!1,compression:`STORE`,compressionOptions:null,type:``,platform:`DOS`,comment:null,mimeType:`application/zip`,encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),n.type===`binarystring`&&(n.type=`string`),!n.type)throw Error(`No output type specified.`);a.checkSupport(n.type),n.platform!==`darwin`&&n.platform!==`freebsd`&&n.platform!==`linux`&&n.platform!==`sunos`||(n.platform=`UNIX`),n.platform===`win32`&&(n.platform=`DOS`);var r=n.comment||this.comment||``;t=d.generateWorker(this,n,r)}catch(e){(t=new o(`error`)).error(e)}return new s(t,n.type||`string`,n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e||={}).type||(e.type=`nodebuffer`),this.generateInternalStream(e).toNodejsStream(t)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){t.exports=e(`stream`)},{stream:void 0}],17:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;0<=a;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===r&&this.data[a+3]===i)return a-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&r===a[2]&&i===a[3]},i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){var r=e(`../utils`);function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw Error(`End of data reached (data length = `+this.length+`, asked index = `+e+`). Corrupted zip ?`)},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER=`PK��`,n.CENTRAL_FILE_HEADER=`PK��`,n.CENTRAL_DIRECTORY_END=`PK��`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK�\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK��`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.end()}),e.on(`error`,function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e=`Worker `+this.name;return this.previous?this.previous+` -> `+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n<t.length;n++)a+=t[n].length;switch(e){case`string`:return t.join(``);case`array`:return Array.prototype.concat.apply([],t);case`uint8array`:for(i=new Uint8Array(a),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case`nodebuffer`:return Buffer.concat(t);default:throw Error(`concat : unsupported type '`+e+`'`)}}(s,a),l))}catch(e){i(e)}a=[]}).resume()})}function d(e,t,n){var o=t;switch(t){case`blob`:case`arraybuffer`:o=`uint8array`;break;case`base64`:o=`string`}try{this._internalType=o,this._outputType=t,this._mimeType=n,r.checkSupport(o),this._worker=e.pipe(new i(o)),e.lock()}catch(e){this._worker=new a(`error`),this._worker.error(e)}}d.prototype={accumulate:function(e){return u(this,e)},on:function(e,t){var n=this;return e===`data`?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){r.delay(t,arguments,n)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport(`nodestream`),this._outputType!==`nodebuffer`)throw Error(this._outputType+` is not supported by this method`);return new l(this,{objectMode:this._outputType!==`nodebuffer`},e)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`,n.nodebuffer=typeof Buffer<`u`,n.uint8array=typeof Uint8Array<`u`,typeof ArrayBuffer>`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(c):Array(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t<o;)if((i=e[t++])<128)c[n++]=i;else if(4<(a=s[i]))c[n++]=65533,t+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&t<o;)i=i<<6|63&e[t++],a--;1<a?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e(`setimmediate`),n.newBlob=function(e,t){n.checkSupport(`blob`);try{return new Blob([e],{type:t})}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch{throw Error(`Bug : can't construct the Blob.`)}}};var l={stringifyByChunk:function(e,t,n){var r=[],i=0,a=e.length;if(a<=n)return String.fromCharCode.apply(null,e);for(;i<a;)t===`array`||t===`nodebuffer`?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,a)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,a)))),i+=n;return r.join(``)},stringifyByChar:function(e){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function u(e){var t=65536,r=n.getTypeOf(e),i=!0;if(r===`uint8array`?i=l.applyCanBeUsed.uint8array:r===`nodebuffer`&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2)}return l.stringifyByChar(e)}function d(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=u;var f={};f.string={string:s,array:function(e){return c(e,Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,a.allocBuffer(e.length))}},f.array={string:u,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(e)}},f.arraybuffer={string:function(e){return u(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return a.newBufferFrom(e)}},f.nodebuffer={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){return t||=``,e?(n.checkSupport(e),f[n.getTypeOf(t)][e](t)):t},n.resolve=function(e){for(var t=e.split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];i===`.`||i===``&&r!==0&&r!==t.length-1||(i===`..`?n.pop():n.push(i))}return n.join(`/`)},n.getTypeOf=function(e){return typeof e==`string`?`string`:Object.prototype.toString.call(e)===`[object Array]`?`array`:r.nodebuffer&&a.isBuffer(e)?`nodebuffer`:r.uint8array&&e instanceof Uint8Array?`uint8array`:r.arraybuffer&&e instanceof ArrayBuffer?`arraybuffer`:void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw Error(e+` is not supported by this platform`)},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r=``;for(n=0;n<(e||``).length;n++)r+=`\\x`+((t=e.charCodeAt(n))<16?`0`:``)+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&n[t]===void 0&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,a,s,l){return o.Promise.resolve(t).then(function(e){return r.blob&&(e instanceof Blob||[`[object File]`,`[object Blob]`].indexOf(Object.prototype.toString.call(e))!==-1)&&typeof FileReader<`u`?new o.Promise(function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)}):e}).then(function(t){var u=n.getTypeOf(t);return u?(u===`arraybuffer`?t=n.transformTo(`uint8array`,t):u===`string`&&(l?t=i.decode(t):a&&!0!==s&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):Array(e.length))}(t))),t):o.Promise.reject(Error(`Can't read the data of '`+e+`'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./signature`),o=e(`./zipEntry`),s=e(`./support`);function c(e){this.files=[],this.loadOptions=e}c.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error(`Corrupted zip or bug: unexpected signature (`+i.pretty(t)+`, expected `+i.pretty(e)+`)`)}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?`uint8array`:`array`,n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw Error(`Multi-volumes zip are not supported`)},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw Error(`Corrupted zip or bug: expected `+this.centralDirRecords+` records in central dir, got `+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?Error(`Corrupted zip: can't find end of central directory`):Error(`Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html`);this.reader.setIndex(e);var t=e;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw Error(`Corrupted zip: can't find the ZIP64 end of central directory locator`);if(this.reader.setIndex(e),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw Error(`Corrupted zip: can't find the ZIP64 end of central directory`);this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,a.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw Error(`Corrupted zip: missing `+Math.abs(r)+` bytes.`)},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./compressedObject`),o=e(`./crc32`),s=e(`./utf8`),c=e(`./compressions`),l=e(`./support`);function u(e,t){this.options=e,this.loadOptions=t}u.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw Error(`Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)`);if((t=function(e){for(var t in c)if(Object.prototype.hasOwnProperty.call(c,t)&&c[t].magic===e)return c[t];return null}(this.compressionMethod))===null)throw Error(`Corrupted zip : compression `+i.pretty(this.compressionMethod)+` unknown (inner file : `+i.transformTo(`string`,this.fileName)+`)`);this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error(`Encrypted zip are not supported`);e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=l.uint8array?`uint8array`:`array`;if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(r!==null)this.fileCommentStr=r;else{var a=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileName)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileComment)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null}},t.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e(`./stream/StreamHelper`),a=e(`./stream/DataWorker`),o=e(`./utf8`),s=e(`./compressedObject`),c=e(`./stream/GenericWorker`);r.prototype={internalStream:function(e){var t=null,n=`string`;try{if(!e)throw Error(`No output type specified.`);var r=(n=e.toLowerCase())===`string`||n===`text`;n!==`binarystring`&&n!==`text`||(n=`string`),t=this._decompressWorker();var a=!this._dataBinary;a&&!r&&(t=t.pipe(new o.Utf8EncodeWorker)),!a&&r&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new c(`error`)).error(e)}return new i(t,n,``)},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||`nodebuffer`).toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof c?this._data:new a(this._data)}};for(var l=[`asText`,`asBinary`,`asNodeBuffer`,`asUint8Array`,`asArrayBuffer`],u=function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},d=0;d<l.length;d++)r.prototype[l[d]]=u;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var a=0,o=new i(u),s=e.document.createTextNode(``);o.observe(s,{characterData:!0}),n=function(){s.data=a=++a%2}}else if(e.setImmediate||e.MessageChannel===void 0)n=`document`in e&&`onreadystatechange`in e.document.createElement(`script`)?function(){var t=e.document.createElement(`script`);t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;r=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}r=!1}t.exports=function(e){l.push(e)!==1||r||n()}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}],37:[function(e,t,n){var r=e(`immediate`);function i(){}var a={},o=[`REJECTED`],s=[`FULFILLED`],c=[`PENDING`];function l(e){if(typeof e!=`function`)throw TypeError(`resolver must be a function`);this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function u(e,t,n){this.promise=e,typeof t==`function`&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof n==`function`&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,TypeError(`Cannot resolve promise with itself`)):a.resolve(e,r)})}function f(e){var t=e&&e.then;if(e&&(typeof e==`object`||typeof e==`function`)&&typeof t==`function`)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=m(function(){t(i,r)});o.status===`error`&&r(o.value)}function m(e,t){var n={};try{n.value=e(t),n.status=`success`}catch(e){n.status=`error`,n.value=e}return n}(t.exports=l).prototype.finally=function(e){if(typeof e!=`function`)return this;var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if(typeof e!=`function`&&this.state===s||typeof t!=`function`&&this.state===o)return this;var n=new this.constructor(i);return this.state===c?this.queue.push(new u(n,e,t)):d(n,this.state===s?e:t,this.outcome),n},u.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){a.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=m(f,t);if(n.status===`error`)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return a.reject(t,e)},l.all=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=Array(n),s=0,c=-1,l=new this(i);++c<n;)u(e[c],c);return l;function u(e,i){t.resolve(e).then(function(e){o[i]=e,++s!==n||r||(r=!0,a.resolve(l,o))},function(e){r||(r=!0,a.reject(l,e))})}},l.race=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c=e[o],t.resolve(c).then(function(e){r||(r=!0,a.resolve(s,e))},function(e){r||(r=!0,a.reject(s,e))});var c;return s}},{immediate:36}],38:[function(e,t,n){var r={};(0,e(`./lib/utils/common`).assign)(r,e(`./lib/deflate`),e(`./lib/inflate`),e(`./lib/zlib/constants`)),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){var r=e(`./zlib/deflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/messages`),s=e(`./zlib/zstream`),c=Object.prototype.toString,l=0,u=-1,d=0,f=8;function p(e){if(!(this instanceof p))return new p(e);this.options=i.assign({level:u,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:``},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==l)throw Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var m;if(m=typeof t.dictionary==`string`?a.string2buf(t.dictionary):c.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,m))!==l)throw Error(o[n]);this._dict_set=!0}}function m(e,t){var n=new p(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}p.prototype.push=function(e,t){var n,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,typeof e==`string`?s.input=a.string2buf(e):c.call(e)===`[object ArrayBuffer]`?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(s.avail_out===0&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),(n=r.deflate(s,o))!==1&&n!==l)return this.onEnd(n),!(this.ended=!0);s.avail_out!==0&&(s.avail_in!==0||o!==4&&o!==2)||(this.options.to===`string`?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||s.avail_out===0)&&n!==1);return o===4?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):o!==2||(this.onEnd(l),!(s.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===l&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=p,n.deflate=m,n.deflateRaw=function(e,t){return(t||={}).raw=!0,m(e,t)},n.gzip=function(e,t){return(t||={}).gzip=!0,m(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){var r=e(`./zlib/inflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/constants`),s=e(`./zlib/messages`),c=e(`./zlib/zstream`),l=e(`./zlib/gzheader`),u=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:``},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw Error(s[n]);this.header=new l,r.inflateGetHeader(this.strm,this.header)}function f(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}d.prototype.push=function(e,t){var n,s,c,l,d,f,p=this.strm,m=this.options.chunkSize,h=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,typeof e==`string`?p.input=a.binstring2buf(e):u.call(e)===`[object ArrayBuffer]`?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new i.Buf8(m),p.next_out=0,p.avail_out=m),(n=r.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&h&&(f=typeof h==`string`?a.string2buf(h):u.call(h)===`[object ArrayBuffer]`?new Uint8Array(h):h,n=r.inflateSetDictionary(this.strm,f)),n===o.Z_BUF_ERROR&&!0===g&&(n=o.Z_OK,g=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(p.avail_out!==0&&n!==o.Z_STREAM_END&&(p.avail_in!==0||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||(this.options.to===`string`?(c=a.utf8border(p.output,p.next_out),l=p.next_out-c,d=a.buf2string(p.output,c),p.next_out=l,p.avail_out=m-l,l&&i.arraySet(p.output,p.output,c,l,0),this.onData(d)):this.onData(i.shrinkBuf(p.output,p.next_out)))),p.avail_in===0&&p.avail_out===0&&(g=!0)}while((0<p.avail_in||p.avail_out===0)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(p.avail_out=0))},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=d,n.inflate=f,n.inflateRaw=function(e,t){return(t||={}).raw=!0,f(e,t)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,o;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],42:[function(e,t,n){var r=e(`./common`),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function c(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n=``,o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,a,s=t||e.length,l=Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)l[r++]=i;else if(4<(a=o[i]))l[r++]=65533,n+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&n<s;)i=i<<6|63&e[n++],a--;1<a?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3<n?2e3:n;a=a+(i=i+t[r++]|0)|0,--o;);i%=65521,a%=65521}return i|a<<16|0}},{}],44:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4<e?9:0)}function P(e){for(var t=e.length;0<=--t;)e[t]=0}function F(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function I(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function 
vendor: 2,532 bytes, line 2
2ee(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function R(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&a<f);if(r=w-(f-a),a=f-w,o<r){if(e.match_start=t,s<=(o=r))break;p=l[a+o-1],m=l[a+o]}}while((t=d[t&u])>c&&--i!=0);return o<=e.lookahead?o:e.lookahead}function z(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f<p&&(p=f),n=p===0?0:(l.avail_in-=p,i.arraySet(u,l.input,l.next_in,p,d),l.state.wrap===1?l.adler=o(l.adler,u,p,d):l.state.wrap===2&&(l.adler=s(l.adler,u,p,d)),l.next_in+=p,l.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+C-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<C)););}while(e.lookahead<T&&e.strm.avail_in!==0)}function te(e,t){for(var n,r;;){if(e.lookahead<T){if(z(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-T&&(e.match_length=R(e,n)),e.match_length>=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,--e.match_length!=0;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;
vendor: 10,569 bytes, line 2
2else r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function ne(e,t){for(var n,r,i;;){if(e.lookahead<T){if(z(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=C-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-T&&(e.match_length=R(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===C&&4096<e.strstart-e.match_start)&&(e.match_length=C-1)),e.prev_length>=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),--e.prev_length!=0;);if(e.match_available=0,e.match_length=C-1,e.strstart++,r&&(I(e,!1),e.strm.avail_out===0))return O}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&I(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return O}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=a._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function re(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function ie(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*x),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*b+1)),P(this.dyn_ltree),P(this.dyn_dtree),P(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(S+1),this.heap=new i.Buf16(2*v+1),P(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),P(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ae(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:D,e.adler=t.wrap===2?0:1,t.last_flush=l,a._tr_init(t),d):M(e,f)}function oe(e){var t=ae(e);return t===d&&function(e){e.window_size=2*e.w_size,P(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=C-1,e.match_available=0,e.ins_h=0}(e.state),t}function se(e,t,n,r,a,o){if(!e)return f;var s=1;if(t===p&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),a<1||_<a||n!==g||r<8||15<r||t<0||9<t||o<0||m<o)return M(e,f);r===8&&(r=9);var c=new ie;return(e.state=c).strm=e,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+C-1)/C),c.window=new i.Buf8(2*c.w_size),c.head=new i.Buf16(c.hash_size),c.prev=new i.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new i.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=n,oe(e)}r=[new re(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(z(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new re(4,4,8,4,te),new re(4,5,16,8,te),new re(4,6,32,32,te),new re(4,4,16,16,ne),new re(8,16,32,32,ne),new re(8,16,128,128,ne),new re(8,32,128,256,ne),new re(32,128,258,1024,ne),new re(32,258,258,4096,ne)],n.deflateInit=function(e,t){return se(e,t,g,15,8,0)},n.deflateInit2=se,n.deflateReset=oe,n.deflateResetKeep=ae,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5<t||t<0)return e?M(e,f):f;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===666&&t!==u)return M(e,e.avail_out===0?-5:f);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===E)if(i.wrap===2)e.adler=0,L(i,31),L(i,139),L(i,8),i.gzhead?(L(i,+!!i.gzhead.text+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),L(i,255&i.gzhead.time),L(i,i.gzhead.time>>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,ee(i,p),i.strstart!==0&&(ee(i,e.adler>>>16),ee(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,L(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,L(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(z(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(z(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=e.strstart+w;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=w-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(ee(i,e.adler>>>16),ee(i,65535&e.adler)),F(e),0<i.wrap&&(i.wrap=-i.wrap),i.pending===0?1:d):d},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&t!==69&&t!==73&&t!==91&&t!==103&&t!==D&&t!==666?M(e,f):(e.state=null,t===D?M(e,-3):d):f},n.deflateSetDictionary=function(e,t){var n,r,a,s,c,l,u,p,m=t.length;if(!e||!e.state||(s=(n=e.state).wrap)===2||s===1&&n.status!==E||n.lookahead)return f;for(s===1&&(e.adler=o(e.adler,t,m,0)),n.wrap=0,m>=n.w_size&&(s===0&&(P(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,z(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+C-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--a;);n.strstart=r,n.lookahead=C-1,z
vendor: 4,638 bytes, line 2
2(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=C-1,n.match_available=0,e.next_in=l,e.input=u,e.avail_in=c,n.wrap=s,d},n.deflateInfo=`pako deflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){t.exports=function(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];t:for(;;){if(p>>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<<b)-1)];continue t}if(32&b){n.mode=12;break e}e.msg=`invalid literal/length code`,n.mode=30;break e}x=65535&y,(b&=15)&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];r:for(;;){if(p>>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<<b)-1)];continue r}e.msg=`invalid distance code`,n.mode=30;break e}if(S=65535&y,m<(b&=15)&&(p+=T[r++]<<m,(m+=8)<b&&(p+=T[r++]<<m,m+=8)),c<(S+=p&(1<<b)-1)){e.msg=`invalid distance too far back`,n.mode=30;break e}if(p>>>=b,m-=b,(b=a-o)<S){if(u<(b=S-b)&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break e}if(w=f,(C=0)===d){if(C+=l-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,(b-=d)<x){for(x-=b;E[a++]=f[C++],--b;);if(C=0,d<x){for(x-=b=d;E[a++]=f[C++],--b;);C=a-S,w=E}}}else if(C+=d-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}for(;2<x;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],1<x&&(E[a++]=w[C++]))}else{for(C=a-S;E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],2<(x-=3););x&&(E[a++]=E[C++],1<x&&(E[a++]=E[C++]))}break}}break}}while(r<i&&a<s);r-=x=m>>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=a<s?s-a+257:257-(a-s),n.hold=p,n.bits=m}},{}],49:[function(e,t,n){var r=e(`../utils/common`),i=e(`./adler32`),a=e(`./crc32`),o=e(`./inffast`),s=e(`./inftrees`),c=1,l=2,u=0,d=-2,f=1,p=852,m=592;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?d:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,v(e))):d}function b(e,t){var n,r;return e?(r=new g,(e.state=r).window=null,(n=y(e,t))!==u&&(e.state=null),n):d}var x,S,C=!0;function w(e){if(C){var t;for(x=new r.Buf32(512),S=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(c,e.lens,0,288,x,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(l,e.lens,0,32,S,0,e.work,{bits:5}),C=!1}e.lencode=x,e.lenbits=9,e.distcode=S,e.distbits=5}function T(e,t,n,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),i>=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}n.inflateReset=v,n.inflateReset2=y,n.inflateResetKeep=_,n.inflateInit=function(e){return b(e,15)},n.inflateInit2=b,n.inflate=function(e,t){var n,p,m,g,_,v,y,b,x,S,C,E,D,O,k,A,j,M,N,P,F,I,L,
vendor: 18,054 bytes, line 2
2ee,R=0,z=new r.Buf8(4),te=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return d;(n=e.state).mode===12&&(n.mode=13),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,S=v,C=y,I=u;e:for(;;)switch(n.mode){case f:if(n.wrap===0){n.mode=13;break}for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(2&n.wrap&&b===35615){z[n.check=0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<<F,e.adler=n.check=1,n.mode=512&b?10:12,x=b=0;break;case 2:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.flags=b,(255&n.flags)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(57344&n.flags){e.msg=`unknown header flags set`,n.mode=30;break}n.head&&(n.head.text=b>>8&1),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.time=b),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,z[2]=b>>>16&255,z[3]=b>>>24&255,n.check=a(n.check,z,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.xflags=255&b,n.head.os=b>>8),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length=b,n.head&&(n.head.extra_len=b),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,F)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;F=p[g+E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(v===0)break e;for(E=0;F=p[g+E++],n.head&&F&&n.length<65536&&(n.head.comment+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(65535&n.check)){e.msg=`header crc mismatch`,n.mode=30;break}x=b=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}e.adler=n.check=h(b),x=b=0,n.mode=11;case 11:if(n.havedict===0)return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,2;e.adler=n.check=1,n.mode=12;case 12:if(t===5||t===6)break e;case 13:if(n.last){b>>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}switch(n.last=1&b,--x,3&(b>>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if((65535&b)!=(b>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v<E&&(E=v),y<E&&(E=y),E===0)break e;r.arraySet(m,p,g,E,_),v-=E,g+=E,y-=E,_+=E,n.length-=E;break}n.mode=12;break;case 17:for(;x<14;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.nlen=257+(31&b),b>>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286<n.nlen||30<n.ndist){e.msg=`too many length or distance symbols`,n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.lens[te[n.have++]]=7&b,b>>>=3,x-=3}for(;n.have<19;)n.lens[te[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;A=(R=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&R,!((k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(j<16)b>>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(ee=k+2;x<ee;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b>>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(ee=k+3;x<ee;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=3+(7&(b>>>=k)),b>>>=3,x-=3}else{for(ee=k+7;x<ee;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=11+(127&(b>>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=F}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(R=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&R,!((k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(A&&!(240&A)){for(M=k,N=A,P=j;A=(R=n.lencode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&R,!(M+(k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(ee=n.extra;x<ee;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(R=n.distcode[b&(1<<n.distbits)-1])>>>16&255,j=65535&R,!((k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(!(240&A)){for(M=k,N=A,P=j;A=(R=n.distcode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&R,!(M+(k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(ee=n.extra;x<ee;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.offset+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(y<E&&(E=y),y-=E,n.length-=E;m[_++]=O[D++],--E;);n.length===0&&(n.mode=21);break;case 26:if(y===0)break e;m[_++]=n.length,y--,n.mode=21;break;case 27:if(n.wrap){for(;x<32;){if(v===0)break e;v--,b|=p[g++]<<x,x+=8}if(C-=y,e.total_out+=C,n.total+=C,C&&(e.adler=n.check=n.flags?a(n.check,m,C,_-C):i(n.check,m,C,_-C)),C=y,(n.flags?b:h(b))!==n.check){e.msg=`incorrect data check`,n.mode=30;break}x=b=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(4294967295&n.total)){e.msg=`incorrect length check`,n.mode=30;break}x=b=0}n.mode=29;case 29:I=1;break e;case 30:I=-3;break e;case 31:return-4;case 32:default:return d}return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,(n.wsize||C!==e.avail_out&&n.mode<30&&(n.mode<27||t!==4))&&T(e,e.output,e.next_out,C-e.avail_out)?(n.mode=31,-4):(S-=e.avail_in,C-=e.avail_out,e.total_in+=S,e.total_out+=C,n.total+=C,n.wrap&&C&&(e.adler=n.check=n.flags?a(n.check,m,C,e.next_out-C):i(n.check,m,C,e.next_out-C)),e.data_type=n.bits+(n.last?64:0)+(n.mode===12?128:0)+(n.mode===20||n.mode===15?256:0),(S==0&&C===0||t===4)&&I===u&&(I=-5),I)},n.inflateEnd=function(e){if(!e||!e.state)return d;var t=e.state;return t.window&&=null,e.state=null,u},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?((n.head=t).done=!1,u):d},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?(n=e.state).wrap!==0&&n.mode!==11?d:n.mode===11&&i(1,t,r,0)!==n.check?-3:T(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,u):d},n.inflateInfo=`pako inflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){var r=e(`../utils/common`),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,c,l,u,d,f){var p,m,h,g,_,v,y,b,x,S=f.bits,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=null,P=0,F=new r.Buf16(16),I=new r.Buf16(16),L=null,ee=0;for(C=0;C<=15;C++)F[C]=0;for(w=0;w<c;w++)F[t[n+w]]++;for(D=S,E=15;1<=E&&F[E]===0;E--);if(E<D&&(D=E),E===0)return l[u++]=20971520,l[u++]=20971520,f.bits=1,0;for(T=1;T<E&&F[T]===0;T++);for(D<T&&(D=T),C=A=1;C<=15;C++)if(A<<=1,(A-=F[C])<0)return-1;if(0<A&&(e===0||E!==1))return-1;for(I[1]=0,C=1;C<15;C++)I[C+1]=I[C]+F[C];for(w=0;w<c;w++)t[n+w]!==0&&(d[I[t[n+w]]++]=w);if(v=e===0?(N=L=d,19):e===1?(N=i,P-=257,L=a,ee-=257,256):(N=o,L=s,-1),C=T,_=u,k=w=M=0,h=-1,g=(j=1<<(O=D))-1,e===1&&852<j||e===2&&592<j)return 1;for(;;){for(y=C-k,x=d[w]<v?(b=0,d[w]):d[w]>v?(b=L[ee+d[w]],N[P+d[w]]):(b=96,0),p=1<<C-k,T=m=1<<O;l[_+(M>>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<<C-1;M&p;)p>>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D<C&&(M&g)!==h){for(k===0&&(k=D),_+=T,A=1<<(O=C-k);O+k<E&&!((A-=F[O+k])<=0);)O++,A<<=1;if(j+=1<<O,e===1&&852<j||e===2&&592<j)return 1;l[h=M&g]=D<<24|O<<16|_-u|0}}return M!==0&&(l[_+M]=C-k<<24|4194304),f.bits=D,0}},{"../utils/common":41}],51:[function(e,t,n){t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}},{}],52:[function(e,t,n){var r=e(`../utils/common`),i=0,a=1;function o(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,c=29,l=256,u=l+1+c,d=30,f=19,p=2*u+1,m=15,h=16,g=7,_=256,v=16,y=17,b=18,x=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=Array(2*(u+2));o(T);var E=Array(2*d);o(E);var D=Array(512);o(D);var O=Array(256);o(O);var k=Array(c);o(k);var A,j,M,N=Array(d);function P(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function I(e){return e<256?D[e]:D[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function ee(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<<e.bi_valid&65535,L(e,e.bi_buf),e.bi_buf=t>>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function R(e,t,n){ee(e,n[2*t],n[2*t+1])}function z(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function te(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=z(a[s]++,s))}}function ne(e){var t;for(t=0;t<u;t++)e.dyn_ltree[2*t]=0;for(t=0;t<d;t++)e.dyn_dtree[2*t]=0;for(t=0;t<f;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*_]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function re(e){8<e.bi_valid?L(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ie(e,t,n,r){var i=2*t,a=2*n;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function ae(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&ie(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ie(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function oe(e,t,n){var r,i,a,o,s=0;if(e.last_lit!==0)for(;r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,r===0?R(e,i,t):(R(e,(a=O[i])+l+1,t),(o=x[a])!==0&&ee(e,i-=k[a],o),R(e,a=I(--r),n),(o=S[a])!==0&&ee(e,r-=N[a],o)),s<e.last_lit;);R(e,_,t)}function se(e,t){var n,r,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=p,n=0;n<c;n++)a[2*n]===0?a[2*n+1]=0:(e.heap[++e.heap_len]=l=n,e.depth[n]=0);for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=l,n=e.heap_len>>1;1<=n;n--)ae(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ae(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ae(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<p;n++)g<(a=c[2*c[2*(r=e.heap[n])+1]+1]+1)&&(a=g,_++),c[2*r+1]=a,l<r||(e.bl_count[a]++,o=0,h<=r&&(o=f[r-h]),s=c[2*r],e.opt_len+=s*(a+o),d&&(e.static_len+=s*(u[2*r+1]+o)));if(_!==0){do{for(a=g-1;e.bl_count[a]===0;)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[g]--,_-=2}while(0<_);for(a=g;a!==0;a--)for(r=e.bl_count[a];r!==0;)l<(i=e.heap[--n])||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),r--)}}(e,t),te(a,l,e.bl_count)}function ce(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++s<c&&i===o||(s<l?e.bl_tree[2*i]+=s:i===0?s<=10?e.bl_tree[2*y]++:e.bl_tree[2*b]++:(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*v]++),a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4))}function le(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(i=o,o=t[2*(r+1)+1],!(++s<c&&i===o)){if(s<l)for(;R(e,i,e.bl_tree),--s!=0;);else i===0?s<=10?(R(e,y,e.bl_tree),ee(e,s-3,3)):(R(e,b,e.bl_tree),ee(e,s-11,7)):(i!==a&&(R(e,i,e.bl_tree),s--),R(e,v,e.bl_tree),ee(e,s-3,2));a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4)}}o(N);var ue=!1;function B(e,t,n,i){ee(e,(s<<1)+ +!!i,3),function(e,t,n,i){re(e),i&&(L(e,n),L(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}n._tr_init=function(e){ue||=(function(){var e,t,n,r,i,a=Array(m+1);for(r=n=0;r<c-1;r++)for(k[r]=n,e=0;e<1<<x[r];e++)O[n++]=r;for(O[n-1]=r,r=i=0;r<16;r++)for(N[r]=i,e=0;e<1<<S[r];e++)D[i++]=r;for(i>>=7;r<d;r++)for(N[r]=i<<7,e=0;e<1<<S[r]-7;e++)D[256+i++]=r;for(t=0;t<=m;t++)a[t]=0;for(e=0;e<=143;)T[2*e+1]=8,e++,a[8]++;for(;e<=255;)T[2*e+1]=9,e++,a[9]++;for(;e<=279;)T[2*e+1]=7,e++,a[7]++;for(;e<=287;)T[2*e+1]=8,e++,a[8]++;for(te(T,u+1,a),e=0;e<d;e++)E[2*e+1]=5,E[2*e]=z(e,5);A=new P(T,x,l+1,u,m),j=new P(E,S,0,d,m),M=new P([],C,0,f,g)}(),!0),e.l_desc=new F(e.dyn_ltree,A),e.d_desc=new F(e.dyn_dtree,j),e.bl_desc=new F(e.bl_tree,M),e.bi_buf=0,e.bi_valid=0,ne(e)},n._tr_stored_block=B,n._tr_flush_block=function(e,t,n,r){var o,s,c=0;0<e.level?(e.strm.data_type===2&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t<l;t++)if(e.dyn_ltree[2*t]!==0)return a;return i}(e)),se(e,e.l_desc),se(e,e.d_desc),c=function(e){var t;for(ce(e,e.dyn_ltree,e.l_desc.max_code),ce(e,e.dyn_dtree,e.d_desc.max_code),se(e,e.bl_desc),t=f-1;3<=t&&e.bl_tree[2*w[t]+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),o=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?B(e,t,n,r):e.strategy===4||s===o?(ee(e,2+ +!!r,3),oe(e,T,E)):(ee(e,4+ +!!r,3),function(e,t,n,r){var i;for(ee(e,t-257,5),ee(e,n-1,5),ee(e,r-4,4),i=0;i<r;i++)ee(e,e.bl_tree[2*w[i]+1],3);le(e,e.dyn_ltree,t-1),le(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),oe(e,e.dyn_ltree,e.dyn_dtree)),ne(e),r&&re(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){ee(e,2,3),R(e,_,T),function(e){e.bi_valid===16?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(
2a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];return s[o]={callback:e,args:t},n(o),o++},u.clearImmediate=d}function d(e){delete s[e]}function f(e){if(c)setTimeout(f,0,e);else{var n=s[e];if(n){c=!0;try{(function(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r)}})(n)}finally{d(e),c=!1}}}}function p(t){t.source===e&&typeof t.data==`string`&&t.data.indexOf(a)===0&&f(+t.data.slice(a.length))}})(typeof self>`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})})),I=c(N(),1),L=c(P(),1),ee=c(F(),1),R=class{constructor(e=1024){this.buffer=new ArrayBuffer(Math.max(16,e)),this.view=new DataView(this.buffer),this.offset=0}ensureCapacity(e){let t=this.offset+e;if(t<=this.buffer.byteLength)return;let n=this.buffer.byteLength;for(;n<t;)n*=2;let r=new ArrayBuffer(n);new Uint8Array(r).set(new Uint8Array(this.buffer,0,this.offset)),this.buffer=r,this.view=new DataView(r)}writeUInt8(e){this.ensureCapacity(1),this.view.setUint8(this.offset,e),this.offset+=1}writeInt8(e){this.ensureCapacity(1),this.view.setInt8(this.offset,e),this.offset+=1}writeUInt16(e){this.ensureCapacity(2),this.view.setUint16(this.offset,e,!0),this.offset+=2}writeInt16(e){this.ensureCapacity(2),this.view.setInt16(this.offset,e,!0),this.offset+=2}writeUInt32(e){this.ensureCapacity(4),this.view.setUint32(this.offset,e,!0),this.offset+=4}writeInt32(e){this.ensureCapacity(4),this.view.setInt32(this.offset,e,!0),this.offset+=4}writeString8(e){this.writeUInt8(e.length);for(let t=0;t<e.length;t++)this.writeUInt8(e.charCodeAt(t))}writeLongString8(e){this.writeUInt16(e.length);for(let t=0;t<e.length;t++)this.writeUInt8(e.charCodeAt(t))}writeString16(e){this.writeUInt8(e.length);for(let t=0;t<e.length;t++)this.writeUInt16(e.charCodeAt(t))}writeLongString16(e){this.writeUInt16(e.length);for(let t=0;t<e.length;t++)this.writeUInt16(e.charCodeAt(t))}get final(){return this.offset===this.buffer.byteLength?this.buffer:this.buffer.slice(0,this.offset)}},z=new class{handle(e){let t=performance.now(),n=e.readUInt16();for(let r=0;r<n;r++){let n=e.readUInt32(),r=e.readUInt32();Y.eatCell(n,r,t)}let r=e.readUInt16();for(let t=0;t<r;t++){let t=e.readUInt32(),n=e.readInt32(),r=e.readInt32(),i=e.readUInt16(),a=e.readUInt8(),o=Y.newCell(t,n,r,i,a);if(a===0){o.parentPlayerID=e.readUInt16(),Y.ownCellCheck(o);let t=e.readUInt8(),n=e.readUInt8(),r=e.readUInt8();o.r=t,o.g=n,o.b=r,o.color=k.rgb2hex(t,n,r)}if(a===2){let t=e.readUInt8(),n=e.readUInt8(),r=e.readUInt8();o.r=t,o.g=n,o.b=r,o.color=k.rgb2hex(t,n,r)}if(a===5){let t=e.readUInt16(),n=document.createElement(`canvas`);n.render=new Uint8Array(t);for(let r=0;r<t;r++)n.render[r]=e.readUInt8();o.lol=n}
2o&&(o.hidden=!1)}let i=e.readUInt16();for(let n=0;n<i;n++){let n=e.readUInt32(),r=e.readInt32(),i=e.readInt32(),a=e.readUInt16(),o=Y.getCell(n);if(o)o.update(r,i,a,t);else return console.warn(`No cell with ID ${n} exist. Request full sync.`),Ly.fullSync();o&&(o.hidden=!1)}let a=e.readUInt16();for(let t=0;t<a;t++){let t=e.readUInt32();Y.removeCell(t)}if(e.index+1<=e.maxIndex&&(B.activeTab=e.readUInt8(),M.notifyTabs()),e.index+4<=e.maxIndex){let t=e.readUInt32();T.update(0,0,t,t)}}create(e,t,n,r){let i=9+e.length*8+n.length*14+r.length*4;for(let e of t)i+=15+(e.type===0?5:e.type===2?3:0);let a=new R(i);a.writeUInt8(20),a.writeUInt16(e.length);for(let t=0;t<e.length;t++){let n=e[t];a.writeUInt32(n.hunter),a.writeUInt32(n.prey)}a.writeUInt16(t.length);for(let e=0;e<t.length;e++){let n=t[e];a.writeUInt32(n.id),a.writeInt32(n.x),a.writeInt32(n.y),a.writeUInt16(n.radius),a.writeUInt8(n.type),n.type===0&&(a.writeUInt16(n.parentPlayerID),a.writeUInt8(n.r),a.writeUInt8(n.g),a.writeUInt8(n.b)),n.type===2&&(a.writeUInt8(n.r),a.writeUInt8(n.g),a.writeUInt8(n.b))}a.writeUInt16(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.writeUInt32(t.id),a.writeInt32(t.x),a.writeInt32(t.y),a.writeUInt16(t.radius)}a.writeUInt16(r.length);for(let e=0;e<r.length;e++)a.writeUInt32(r[e]);return a.final}},te=new class{handle(e){let t=e.readUInt8();for(let n=0;n<t;n++){let t=e.readUInt16(),n=e.readUInt16(),r=e.readUInt8(),i=e.readUInt8(),a=e.readUInt8(),o=new O(t,n,k.rgb2hex(r,i,a),e.readString8(),r,i,a,X.isReplay?0:e.readUInt32());Y.playersList.set(t,o)}let n=e.readUInt8();for(let t=0;t<n;t++){let t=e.readUInt16(),n=Y.playersList.get(t)||new O,r=e.readUInt8();if(r&1){let t=e.readUInt8(),r=e.readUInt8(),i=e.readUInt8();n.color=k.rgb2hex(t,r,i)}r&2&&(n.skinURL=e.readString8()),r&4&&(n.hatId=e.readUInt32())}let r=e.readUInt8();for(let t=0;t<r;t++){let t=e.readUInt16();Y.playersList.delete(t)}}create(e){let t=4;for(let n of e)t+=8+n.skinURL.length;let n=new R(t);n.writeUInt8(11),n.writeUInt8(e.length);for(let t=0;t<e.length;t++){let r=e[t];n.writeUInt16(r.id),n.writeUInt16(r.parentClientID),n.writeUInt8(r.r),n.writeUInt8(r.g),n.writeUInt8(r.b),n.writeString8(r.skinURL)}return n.writeUInt8(0),n.writeUInt8(0),n.final}},ne=new class{isClanWarsGame=!1;gameStarted=!1;isHost=!1;data=new Map;show(){q.dispatch(A.ClanWars_Toggle)}update(){Y.clientsList.forEach(e=>{let t=this.get(e.id);this.updatePlayer(e.id,t.team||0)}),q.dispatch(A.ClanWars_Update,Y.clientsList,this.data,this.isHost)}updatePlayer(e,t){let n=this.get(e);n.team=t}get(e){return this.data.get(e)||this.data.set(e,{}).get(e)}reset(){this.isClanWarsGame=!1,this.gameStarted=!1,this.isHost=!1,this.data.clear()}},re=new class{handle(e){let t=e.readUInt8();for(let n=0;n<t;n++){let t=e.readUInt16(),n=e.readUInt8()!==0,r=e.readString16().replace(/(\r|\n)/,``),i=e.readString16(),a=e.readUInt8(),o=e.readUInt8(),s=e.readUInt8(),c=X.isReplay?!0:e.readInt8()!==0,l=X.isReplay?``:e.readString16(),u=new D(t,n,r,i,k.rgb2hex(a,o,s),a,o,s,c,l);Y.clientsList.set(t,u)}let n=e.readUInt8();for(let t=0;t<n;t++){let t=e.readUInt16(),n=Y.clientsList.get(t)||new D,r=e.readUInt8();if(r&1&&(n.nick=e.readString16()),r&2&&(n.tag=e.readString16()),r&4){let t=e.readUInt8(),r=e.readUInt8(),i=e.readUInt8(),a=X.isReplay?!0:e.readInt8()!==0;n.teamColor=k.rgb2hex(t,r,i),n.hasReservedName=a}r&8&&(n.clanTag=e.readString16())}let r=e.readUInt8();for(let t=0;t<r;t++){let t=e.readUInt16();Y.clientsList.delete(t)}(t||n||r)&&ne.isClanWarsGame&&ne.update()}create(e){let t=4;for(let n of e)t+=8+n.nick.length*2+n.tag.length*2;let n=new R(t);n.writeUInt8(10),n.writeUInt8(e.length);for(let t=0;t<e.length;t++){let r=e[t];n.writeUInt16(r.id),n.writeUInt8(Number(r.isBot)),n.writeString16(r.nick),n.writeString16(r.tag),n.writeUInt8(r.r),n.writeUInt8(r.g),n.writeUInt8(r.b)}return n.writeUInt8(0),n.writeUInt8(0),n.final}},ie=class{constructor(e){this.id=``,this.lastUpdateTime=0,this.updateTimeout=e,this.rendered=!1}firstRender(e){this.id=e,this.rendered=!0,this.update(!0)}update(e=!1){if(!this.rendered)return;let t=Date.now();(this.lastUpdateTime+this.updateTimeout<t||e)&&(aiptag.cmd.display.push(()=>{aipDisplayTag.display(this.id)}),this.lastUpdateTime=t)}},ae=new class{constructor(){this.isOpen=!0,this.isSettingsMenuOpen=!1,this.isChatFocused=!1,this.adRefreshTimeout=1e3*60*5,this.middleHomeAd=new ie(this.adRefreshTimeout),this.middleEndgameAd=new ie(this.adRefreshTimeout),this.bottomAd=new ie(this.adRefreshTimeout)}initialize(){q.register(A.Render_Ad,(e,t)=>
2{switch(t){case`bottom`:this.bottomAd.firstRender(e);break;case`middleHome`:this.middleHomeAd.firstRender(e);break;case`middleEndgame`:this.middleEndgameAd.firstRender(e);break}})}onSpectate(){this.hide()}onPlay(){this.hide(),this.middleHomeAd.update(),this.bottomAd.update()}onContinue(){this.middleEndgameAd.update(),this.bottomAd.update()}showHUD(e){let t=!E.hideHUD&&!X.isReplay;q.dispatch(A.Show_HUD,t&&e)}hide(){this.isOpen&&(this.isOpen=!1,q.dispatch(A.Show_Menu,!1))}show(){this.isOpen||(this.isOpen=!0,q.dispatch(A.Show_Menu,!0),this.middleHomeAd.update())}toggle(){if(X.isReplay)if(window.confirm(`Press ok to stop watching the replay`))ue.cancel(),X.connect(localStorage.getItem(`senpaio:server`));else return;this.isOpen?this.hide():this.show()}toggleChat(){this.isChatFocused=!this.isChatFocused,q.dispatch(A.Chat_Toggle)}},oe=25,se=oe,ce=class{constructor(e){this.items=Array(Math.max(1,e)),this.start=0,this.length=0}push(e){let t=null;return this.length<this.items.length?(this.items[(this.start+this.length)%this.items.length]=e,this.length+=1):(t=this.items[this.start],this.items[this.start]=e,this.start=(this.start+1)%this.items.length),t}toArray(){let e=Array(this.length);for(let t=0;t<this.length;t++)e[t]=this.items[(this.start+t)%this.items.length];return e}},le=e=>e?e.byteLength:0,ue=new class{constructor(){this.list=new Map,this.localForage=I.default.createInstance({name:`replays-new`}),this.metadataForage=I.default.createInstance({name:`replays-new`,storeName:`metadata`}),this.opacity=1,this.paused=!1,this.tick=0,this.replayLength=1e4,this.currentReplay=null,this.worldSequence=0,this.captureStats={worldPacketBytes:0,keyframeBytes:0,auxiliaryBytes:0,keyframesRetained:0,totalWorldPacketsCaptured:0,totalKeyframesCaptured:0,totalAppendedPacketBytesAllocated:0},this.packets=this.createPacketStore()}createPacketStore(e=null){return{preinfo:e,worldRecords:new ce(this.packetCount),clientUpdates:new ce(this.updatePacketCount),playerUpdates:new ce(this.updatePacketCount)}}cancel(){clearInterval(this.interval),this.paused=!1,X.isReplay=!1,X.cleanUp(),ae.showHUD(!0),q.dispatch(A.Replay_Bar,{show:!1})}save(e){let t=this.packets.worldRecords.toArray(),n=t.findIndex(e=>e.keyframe);if(n<0)return!1;t=t.slice(n);let r=this.packets.clientUpdates.toArray(),i=this.packets.playerUpdates.toArray();if(!this.packets.preinfo||!t.length||!r.length||!i.length)return!1;let a=[],o=[];t.forEach((e,t)=>{e.keyframe&&(a.push(e.keyframe),o.push(t))});let s=new Date().toISOString(),c={time:Date.now(),img:this.createImage(e),packets:{preinfo:this.packets.preinfo,worldUpdate:t.map(e=>e.packet),newWorldUpdates:a,keyframeTicks:o,newClientUpdate:r[0],newPlayerUpdate:i[0]}},l=this.toMetadata(c),u=this.createExport(c);return this.list.set(s,l),this.localForage.setItem(s,u),this.metadataForage.setItem(s,l),!0}createImage(e){let t=this.canvas,n=this.ctx,r=e?.captureFrame?.()||document.getElementById(`screen`);return n.clearRect(0,0,t.width,t.height),t.width=240,t.height=135,n.drawImage(r,0,0,t.width,t.height),t.toDataURL()}sort(){this.list=new Map([...this.list.entries()].sort(([,e],[,t])=>e.time-t.time))}initialize(){this.loadReplayIndex().then(()=>this.sort()),this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),q.register(A.Replay_Action,async e=>{switch(e.type){case`request`:this.sendReplays();break;case`delete`:for(let t of e.replays)this.list.delete(t),this.localForage.removeItem(t),this.metadataForage.removeItem(t);this.sendReplays();break;case`play`:{let t=await this.loadReplay(e.key);t?this.run(t):window.alert(`Invalid replay!`);break}case`jump`:this.paused=!0,this.nextTick(this.currentReplay,e.to,!0);break;case`jumpEnded`:this.paused=!1;break;case`opacity`:this.opacity=e.value/100;break;case`import`:{let{key:t,data:n}=e,r=this.parse(n);if(r!==null){let e={...this.toMetadata(r),time:Date.now()};this.localForage.setItem(t,n),this.metadataForage.setItem(t,e),this.list.set(t,e),this.sort(),this.sendReplays()}else window.alert(`Invalid replay!`);break}case`download`:await this.download(e.replays);break;default:console.log(`unknown replay action`,e);break}})}async loadReplayIndex(){let e=await this.localForage.keys(),t=new Set(e),n=new Set;await this.metadataForage.iterate((e,r)=>{t.has(r)&&e&&e.img&&(this.list.set(r,e),n.add(r))});for(let t of e){if(n.has(t))continue;let e=await this.localForage.getItem(t),r=this.parseMetadata(e);r&&(this.list.set(t,r),await this.metadataForage.setItem(t,r))}}async loadReplay(e){let t=await this.localForage.getItem(e);return typeof t==`string`?this.parse(t):null}async download(e){if(!(!e||!e.length))if(e.length>1){let t=new ee.default;(await Promise.all(e.map(async e=>
2[e,await this.localForage.getItem(e)]))).forEach(([e,n])=>{n!==null&&t.file(`${e}.senpa`,n)}),(0,L.default)(await t.generateAsync({type:`blob`}),`senpa-replays-${new Date().toISOString()}.zip`)}else{let t=e[0],n=await this.localForage.getItem(t);n!==null&&(0,L.default)(new Blob([n]),`${t}.senpa`)}}sendReplays(){let e=[];this.list.forEach(({img:t,time:n},r)=>{e.push({key:r,image:t,date:n||Date.parse(r)||0})}),e.sort((e,t)=>t.date-e.date),q.dispatch(A.Replays,e)}clear(e=!0){let t=e?null:this.packets.preinfo;this.packets=this.createPacketStore(t),this.worldSequence=0,this.captureStats.worldPacketBytes=0,this.captureStats.keyframeBytes=0,this.captureStats.auxiliaryBytes=le(t),this.captureStats.keyframesRetained=0}add(e,t){switch(e){case 0:this.packets.preinfo||(this.packets.preinfo=t,this.captureStats.auxiliaryBytes+=le(t));break;case 10:B.isAlive&&this.pushAuxiliary(this.packets.clientUpdates,re.create(Array.from(Y.clientsList.values())));break;case 11:B.isAlive&&this.pushAuxiliary(this.packets.playerUpdates,te.create(Array.from(Y.playersList.values())
2));break;case 20:B.isAlive&&this.captureWorldPacket(t);break}}pushAuxiliary(e,t){let n=e.push(t);this.captureStats.auxiliaryBytes+=le(t)-le(n)}captureWorldPacket(e){let t=new Uint8Array(e.byteLength+1);t.set(new Uint8Array(e)),new DataView(t.buffer).setUint8(e.byteLength,B.activeTab);let n=null;if(this.worldSequence%se===0){let e=[];Y.cells.forEach((t,n)=>{typeof n==`number`&&e.push(t)}),n=z.create([],e,[],[]),this.captureStats.totalKeyframesCaptured+=1}let r=this.packets.worldRecords.push({packet:t.buffer,keyframe:n});this.worldSequence+=1,this.captureStats.totalWorldPacketsCaptured+=1,this.captureStats.totalAppendedPacketBytesAllocated+=t.byteLength,this.captureStats.worldPacketBytes+=t.byteLength-le(r&&r.packet),this.captureStats.keyframeBytes+=le(n)-le(r&&r.keyframe),n&&(this.captureStats.keyframesRetained+=1),r&&r.keyframe&&--this.captureStats.keyframesRetained}run(e){this.currentReplay=e,clearInterval(this.interval),q.dispatch(A.Replay_Bar,{show:!0,action:{type:`start`,max:e.packets.worldUpdate.length}}),this.tick=0,X.isReplay=!0,X.ws&&X.ws.close(),X.cleanUp(),X.onMessage(e.packets.preinfo),X.onMessage(e.packets.newClientUpdate),X.onMessage(e.packets.newPlayerUpdate),this.applyKeyframe(e,0),ae.hide(),ae.showHUD(!1),this.interval=setInterval(()=>{this.paused||this.nextTick(e,this.tick)},1e3/oe)}
2applyKeyframe(e,t){let n=e.packets.keyframeTicks,r=0;for(let e=n.length-1;e>=0;e--)if(n[e]<=t){r=e;break}return X.onMessage(e.packets.newWorldUpdates[r]),n[r]||0}nextTick(e,t,n=!1){if(!e)return;let r=e.packets.worldUpdate.length;if(!r)return;let i=Math.max(0,Math.min(Number(t)||0,r-1));if(n){Y.myCells=[new Map,new Map],Y.cells.forEach(e=>{e&&(e.hidden=!0)});let t=this.applyKeyframe(e,i);for(let n=t;n<=i;n++)X.onMessage(e.packets.worldUpdate[n]);this.updateReplayBar(i+1);return}if(t>=r){clearInterval(this.interval),this.run(e);return}X.onMessage(e.packets.worldUpdate[t]),this.updateReplayBar(t+1)}updateReplayBar(e){q.dispatch(A.Replay_Bar,{show:!0,action:{type:`update`,value:e}}),this.tick=e}get packetCount(){return this.replayLength/1e3*oe}get updatePacketCount(){return Math.max(1,Math.ceil(this.replayLength/1e3))}getPerformanceStats(){let e=this.captureStats;return{worldPacketCount:this.packets.worldRecords.length,keyframeCount:e.keyframesRetained,worldPacketBytes:e.worldPacketBytes,keyframeBytes:e.keyframeBytes,auxiliaryBytes:e.auxiliaryBytes,retainedBytes:e.worldPacketBytes+e.keyframeBytes+e.auxiliaryBytes,totalWorldPacketsCaptured:e.totalWorldPacketsCaptured,totalKeyframesCaptured:e.totalKeyframesCaptured,totalAppendedPacketBytesAllocated:e.totalAppendedPacketBytesAllocated}}parseMetadata(e){if(typeof e!=`string`||!e.startsWith(`REPLAY|`))return null;let t=e.indexOf(`|`,7);if(t<0)return null;let n=e.indexOf(`|`,t+1);return n<0?null:{img:e.slice(7,t),time:Number(e.slice(t+1,n))||0}}toMetadata(e){return{img:e.img,time:Number(e.time)||0}}decodeBase64(e){let t=Buffer.from(e,`base64`);return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}parse(e){if(typeof e!=`string`||!e.startsWith(`REPLAY|`))return null;try{let t=e.split(`|`),n=1,r=t[n++],i=t[n++],a=this.decodeBase64(t[n++]),o=Number(t[n++]),s=[];for(let e=0;e<o;e++)s.push(this.decodeBase64(t[n++]));let c=Number(t[n++]),l=[];for(let e=0;e<c;e++)l.push(this.decodeBase64(t[n++]));let u=this.decodeBase64(t[n++]),d=this.decodeBase64(t[n++]),f=l.map((e,t)=>t);if(t[n++]===`KEYFRAMES`){let e=(t[n]||``).split(`,`).map(Number).filter(Number.isFinite);e.length===l.length&&(f=e)}return!s.length||!l.length||f[0]!==0?null:{img:r,time:i,packets:{preinfo:a,worldUpdate:s,newWorldUpdates:l,keyframeTicks:f,newClientUpdate:u,newPlayerUpdate:d}}}catch(e){return console.warn(`Could not parse replay`,e),null}}createExport(e){let t=[`REPLAY`,e.img,String(e.time),Buffer.from(e.packets.preinfo).toString(`base64`),String(e.packets.worldUpdate.length)];return e.packets.worldUpdate.forEach(e=>{t.push(Buffer.from(e).toString(`base64`))}),t.push(String(e.packets.newWorldUpdates.length)),e.packets.newWorldUpdates.forEach(e=>{t.push(Buffer.from(e).toString(`base64`))}),t.push(Buffer.from(e.packets.newClientUpdate).toString(`base64`),Buffer.from(e.packets.newPlayerUpdate).toString(`base64`),`KEYFRAMES`,e.packets.keyframeTicks.join(`,`)),t.join(`|`)}},B=new class{constructor(){this.nick=``,this.teamTag=``,this.teamCode=``,this.skin1=``,this.skin2=``,this.hat1=0,this.hat2=0,this.x=0,this.y=0,this.activeTab=0,this.score=0,this.mass=0,this.biggestCellMass=0,this.isTR=!1,this.isStopped=!1,this.isSpectating=!1}tagChange(e){this.teamTag=e,q.dispatch(A.Notify_TagChange)}get myCellCount(){let e=0;for(let t of Y.myCells)e+=t.size;return e}get isAlive(){return this.myCellCount>0}update(){let e=0,t=0,n=0,r=0,i=0,a=0;for(let o of Y.myCells)for(let s of o.values()){a++,e+=s.radius,t+=s.x,n+=s.y;let o=s.mass;r+=o,i<o&&(i=o)}if(a===0)return;let o=Y.clientsList.get(Y.myClientID)||new D;this.isTR=eg.trainingMode&&o.tag===eg.trainingModeTag,this.x=t/a,this.y=n/a,this.mass=r,this.biggestCellMass=i,this.score<this.mass&&(this.score=this.mass);let s=Math.max(self.innerWidth/1920,self.innerHeight/1080);V.autoZoom=M.enabled?V.legacyZoom(3*Math.min(.6/e,1)**.3*s):Math.min(64/e,1)**.4*s}onSpawn(){this.score=0,this.mass=0,this.biggestCellMass=0,this.isSpectating=!1,V.targetZoom=V.spawnZoom(),q.dispatch(A.Player_Spawned)}onDeath(){ue.clear(!1),q.dispatch(A.Player_Died),this.isTR=!1,this.activeTab=0}},de=.25,fe=.04,pe=1,me=8,V=new class{constructor(){this.x=7e3,this.y=7e3,this.zoom=.15,this.targetZoom=.15,this.lastZoom=.25,this.autoZoom=1,this.spectatePoint={x:0,y:0},this.attachEvents()}attachEvents(){document.addEventListener(`wheel`,e=>{ae.isOpen||(e.preventDefault(),this.onMouseWheel(e))},{passive:!1});for(let e of[`gesturestart`,`gesturechange`,`gestureend`])document.addEventListener(e,e=>{ae.isOpen||e.preventDefault()})}legacyZoom(e){return e/(self.devicePixelRatio||1)}spawnZoom(){return M.enabled?this.legacyZoom(de):this.lastZoom}setZoom(e){let t,n;M.enabled?(t=this.legacyZoom(fe),n=this.legacyZoom(pe)):(t=.02*(14142/(T.right-T.left)),n=.6),e=e>n?n:e<t?t:e,this.targetZoom=e,this.lastZoom=e}onMouseWheel(e){let t=this.targetZoom;e.deltaY>0?t*=E.zoomSpeed:t/=E.zoomSpeed,this.setZoom(t)}update(){let e=M.enabled?me:31-E.cameraSpeed;B.isAlive?(this.x+=(B.x-this.x)/e,this.y+=(B.y-this.y)/e):(this.x=(29*this.x+this.spectatePoint.x)/30,this.y=(29*this.y+this.spectatePoint.y)/30);let t=M.enabled?this.autoZoom:this.targetZoom*this.autoZoom,n=E.auto
2Zoom?t:this.targetZoom;this.zoom+=(n-this.zoom)/8}setSpectatePoint(e,t){this.spectatePoint.x=e,this.spectatePoint.y=t}},he=1024,ge=new class{constructor(){this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.cacheKey=``}render(e){if(!E.mapSectors)return;let t=T.left,n=T.top,r=T.right-T.left,i=T.bottom-T.top;if(r<=0||i<=0)return;let a=[r,i,E.sectorGridWidth,E.sectorGridColor,E.sectorTextSize,E.sectorTextColor].join(`:`);a!==this.cacheKey&&this.renderTexture(r,i,a),e.drawImage(this.canvas,t,n,r,i)}renderTexture(e,t,n){let r=he/Math.max(e,t);this.canvas.width=Math.max(1,Math.round(e*r)),this.canvas.height=Math.max(1,Math.round(t*r));let{ctx:i,canvas:a}=this,o=a.width/5,s=a.height/5;i.font=`400 ${E.sectorTextSize*r}px Ubuntu`,i.textAlign=`center`,i.textBaseline=`middle`,i.lineWidth=Math.max(1,E.sectorGridWidth*r),i.strokeStyle=E.sectorGridColor,i.fillStyle=E.sectorTextColor,i.beginPath();for(let e=1;e<5;e++)i.moveTo(o*e,0),i.lineTo(o*e,a.height);for(let e=1;e<5;e++)i.moveTo(0,s*e),i.lineTo(a.width,s*e);i.stroke();for(let e=0;e<5;e++)for(let t=0;t<5;t++)i.fillText(`${`ABCDE`[e]}${t+1}`,(t+.5)*o,(e+.5)*s,o);i.strokeRect(i.lineWidth/2,i.lineWidth/2,a.width-i.lineWidth,a.height-i.lineWidth),this.cacheKey=n}},_e=150,ve=5,ye=`#161616`,be=`#e5e7e9`,xe=new class{render(e){if(!E.grid)return;let t=window.innerWidth/(2*V.zoom),n=window.innerHeight/(2*V.zoom),r=V.x-t,i=V.y-n,a=V.x+t,o=V.y+n;e.strokeStyle=document.body.dataset.theme===`light`?be:ye,e.lineWidth=ve,e.beginPath();for(let t=Math.floor(r/_e)*_e;t<=a;t+=_e)e.moveTo(t,i),e.lineTo(t,o);for(let t=Math.floor(i/_e)*_e;t<=o;t+=_e)e.moveTo(r,t),e.lineTo(a,t);e.stroke()}},Se=4,Ce=14,we=16,Te=3,Ee=75,De=`#ababab`,Oe=`#c8c8c8`,ke=`#ababab`,Ae=`#6c6c6c`,je=()=>document.body.dataset.theme===`light`,Me=new class{activeCells(e){if(E.directionMarkerType!==e||!M.enabled||!B.isAlive)return null;let t=Y.myCells[B.activeTab];return!t||t.size===0?null:t}renderLines(e){let t=this.activeCells(`lines`);if(t===null)return;let n=M.aimFrom(M.activeCenter());e.strokeStyle=je()?Oe:De,e.lineWidth=Se,e.lineCap=`round`,e.beginPath();for(let r of t.values())r.removed||(e.moveTo(r.x,r.y),e.lineTo(n.x,n.y));e.stroke()}renderArrow(e){let t=this.activeCells(`arrow`);if(t===null)return;let n=window.devicePixelRatio||1,r=M.activeCenter(),i=M.aimFrom(r),a=i.x,o=i.y,s=0;for(let e of t.values()){if(e.removed)continue;let t=r.x-e.x,n=r.y-e.y,i=Math.sqrt(t*t+n*n)||1;s<i+e.radius+Ee&&(s=i+e.radius+Ee)}let c=a-r.x,l=o-r.y,u=Math.sqrt(c*c+l*l)||1,d=c/u,f=l/u,p=Math.atan2(d,-f),m=Ce*Te*n,h=we*Te*n;e.save(),e.translate(r.x+d*s,r.y+f*s),e.rotate(p),e.beginPath(),e.moveTo(0,-h/2),e.lineTo(-m/2,h/2),e.lineTo(0,h*4/5-h/2),e.lineTo(m/2,h/2),e.closePath(),e.fillStyle=je()?Ae:ke,e.fill(),e.restore()}},Ne=new class{constructor(){this.textures={food:document.createElement(`canvas`),virus:document.createElement(`canvas`),border:document.createElement(`canvas`)}}init(){this.createFoodTexture(),this.createVirusTexture()}createFoodTexture(){let e=this.textures.food,t=e.getContext(`2d`);t.clearRect(0,0,e.width,e.height),e.width=e.height=256;let n=E.useFoodGlow;t.fillStyle=E.foodColor,n&&(t.shadowBlur=E.foodGlowDistance,t.shadowColor=E.foodGlowColor),t.arc(256/2,256/2,15,0,Math.PI*2,!1);let r=n?E.foodGlowStrength:1;for(let e=0;e<r;e++)t.fill()}createVirusTexture(){let e=this.textures.virus,t=e.getContext(`2d`);t.clearRect(0,0,e.width,e.height),e.width=e.height=512;let n=E.useVirusGlow;t.beginPath(),t.fillStyle=E.virusColor2,t.globalAlpha=.8,t.arc(512/2,512/2,100,0,Math.PI*2,!1),t.fill(),t.globalAlpha=1,n&&(t.shadowColor=E.virusGlowColor,t.shadowBlur=E.virusGlowDistance),t.strokeStyle=E.virusColor1,t.lineWidth=E.virusBorderWidth;let r=n?E.virusGlowStrength:1;for(let e=0;e<r;e++)t.stroke();t.closePath()}createBorderTexture(){let e=E.useBorderGlow,t=E.borderWidth,n=E.borderGlowDistance,r=this.textures.border;r.getContext(`2d`).clearRect(0,0,r.width,r.height),r.width=r.height=2304;let i=r.getContext(`2d`);i.translate(r.width/2,r.height/2);let a=r.width/14142;i.shadowBlur=n*a,i.shadowColor=E.borderGlowColor,i.lineWidth=t/2*a,i.strokeStyle=E.borderColor,i.rect(-1024,-1024,2048,2048);let o=e?E.borderGlowStrength:1;for(let e=0;e<o;e++)i.stroke()}};function Pe(e){e=(e||0)/180*Math.PI;var t=Math.cos(e),n=Math.sin(e),r=Math.sqrt,i=1/3,a=r(i);return[t+(1-t)*i,i*(1-t)-a*n,i*(1-t)+a*n,0,0,i*(1-t)+a*n,t+i*(1-t),i*(1-t)-a*n,0,0,i*(1-t)-a*n,i*(1-t)+a*n,t+i*(1-t),0,0,0,0,0,1,0].join(` `)}var Fe=`/web/assets/rainbow-DA9WGgpI.png`,Ie=new Image;Ie.src=Fe;var Le=new class{constructor(){this.hue=0}render(e){if(!E.mapBorders)return;E.useRainbow&&this.renderRainbow(e);let t=Number(E.borderWidth),n=t>>1,r=T.left-n,i=T.top-n,a=T.right-T.left+t,o=T.bottom-T.top+t;if(E.useBorderGlow&&!E.useRainbow){let t=T.left,n=T.top,r=T.right-T.left,i=T.bottom-T.top,a=r*Ne.textures.border.width/2048,o=i*Ne.textures.border.height/2048,s=a-r;e.drawImage(Ne.textures.border,t-s/2,n-s/2,a,o)}else e.strokeStyle=E.borderColor,e.lineWidth=t,e.strokeRect(r,i,a,o)}renderRainbow(e){let t=Number(E.borderWidth),n=t>>1,r=T.left-n,i=T.top-n,a=T.right-T.left+t,o=T.bottom-T.top+t,s=a/720*15;e.save(),this.hue>360&&(this.hue=0);let c=this.hue++;document.getElementById(`matrix`).setAttribute(`values`,Pe(c)),e.filter=`url(#hue-rotate)`,e.drawImage(Ie,r-s,i-s,a+s*2,o+s*2),e.restore(
2)}},Re=class{constructor(e,t){this.element=e,this.listener=t,this.baseKeys=this.getBaseKeys(),this.attachListeners()}attachListeners(){this.element.addEventListener(`keydown`,e=>{this.handleEvent(`keydown`,e)}),this.element.addEventListener(`keyup`,e=>{this.handleEvent(`keyup`,e)})}getKeyName(e){let t=e.code;switch(t=t.replace(`Key`,``),t=t.replace(`Digit`,``),t=t.replace(`Arrow`,``),t.startsWith(`Shift`)?t=`Shift`:t.startsWith(`Control`)?t=`Control`:t.startsWith(`Alt`)&&(t=`Alt`),t=t.toUpperCase(),t){case`BACKQUOTE`:t=`TILDE`;break}return this.baseKeys.has(t)?e.ctrlKey?`CTRL+${t}`:e.altKey?`ALT+${t}`:t:!1}handleEvent(e,t){if(t.code===`Tab`&&t.preventDefault(),t.repeat)return;let n=this.getKeyName(t);n&&this.listener(t,e,n)}getBaseKeys(){let e=`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),t=`0123456789`.split(``),n=`TAB SHIFT ENTER TILDE SPACE UP DOWN LEFT RIGHT ESCAPE`.split(` `);return new Set([...e,...t,...n])}},ze=class{constructor(e,t){this.element=e,this.listener=t,this.x=0,this.y=0,this.attachListeners()}attachListeners(){this.element.addEventListener(`mousedown`,e=>{this.handleEvent(`mousedown`,e)}),this.element.addEventListener(`mouseup`,e=>{this.handleEvent(`mouseup`,e)}),this.element.addEventListener(`contextmenu`,e=>{e.preventDefault()}),this.element.addEventListener(`mousemove`,e=>{this.setMouse(e)})}getButtonName(e){switch(e.button){case 0:return`LEFT BUTTON`;case 1:return`MIDDLE BUTTON`;case 2:return`RIGHT BUTTON`;default:return`BUTTON ${e.button+1}`}}handleEvent(e,t){let n=this.getButtonName(t);this.listener(t,e,n)}setMouse(e){this.x=e.clientX,this.y=e.clientY}},Be=new class{constructor(){this.keyboard=null,this.mouse=null}initialize(){M.enabled||(this.keyboard=new Re(document,(e,t,n)=>{this.handle(e,t,n)}),this.mouse=new ze(document,(e,t,n)=>{this.handle(e,t,n)}))}handle(e,t,n){switch(t){case`keydown`:this.onKeyDown(e,n);break;case`keyup`:this.onKeyUp(e,n);break;case`mousedown`:this.onMouseDown(e,n);break;case`mouseup`:this.onMouseUp(e,n);break}}onKeyDown(e,t){if(t===`TAB`&&e.preventDefault(),!ae.isSettingsMenuOpen&&!(ae.isChatFocused&&t!==E.hkToggleChat)){if(t===E.hkToggleChat)return void ae.toggleChat();if(t===E.hkToggleMenu)return void ae.toggle();if(!ae.isOpen){if(e.preventDefault(),B.isAlive)switch(t){case E.hkSplit:$h.split();return;case E.hkDoubleSplit:$h.doubleSplit();return;case E.hkTripleSplit:$h.tripleSplit();return;case E.hkSplit16:$h.split16();return;case E.hkSplit32:$h.split32();return;case E.hkSplit64:$h.split64();return;case E.hkFeed:$h.feed();return;case E.hkMacroFeed:$h.macroFeed(!0);return;case E.hkTogglePlayer:$h.togglePlayer();return;case E.hkReplay:$h.replay();return;case E.hkEmoji1:if($h.sendEmoji(0))return;break;case E.hkEmoji2:if($h.sendEmoji(1))return;break;case E.hkEmoji3:if($h.sendEmoji(2))return;break;case E.hkEmoji4:if($h.sendEmoji(3))return;break}switch(t){case E.hkStop:$h.stop();return;case E.hkToggleNick:$h.toggleNick();return;case E.hkToggleHUD:$h.toggleHUDs();return;case E.hkToggleMass:$h.toggleMass();return;case E.hkToggleOwnSkin:$h.toggleSkin();return;case E.hkToggleChatMessage:$h.toggleChatMessages();return;case E.hkToggleChatMode:$h.toggleChatMode();return;case E.hkToggleSpectateMode:$h.toggleSpectateMode();return;case E.hkToggleSectors:$h.toggleSectors();return;case E.hkCommand1:$h.command(E.command1);return;case E.hkCommand2:$h.command(E.command2);return;case E.hkCommand3:$h.command(E.command3);return;case E.hkCommand4:$h.command(E.command4);return;case E.hkCommand5:$h.command(E.command5);return;case E.hkCommand6:$h.command(E.command6);return;case E.hkCommand7:$h.command(E.command7);return;case E.hkCommand8:$h.command(E.command8);return;case E.hkCommand9:$h.command(E.command9);return;case E.hkCommand10:$h.command(E.command10);return;case E.hkZoom1:$h.zoom(1);return;case E.hkZoom2:$h.zoom(.5);return;case E.hkZoom3:$h.zoom(.25);return;case E.hkZoom4:$h.zoom(.125);return;case E.hkZoom5:$h.zoom(.0712);return}}}}onKeyUp(e,t){switch(t){case E.hkMacroFeed:$h.macroFeed(!1);return}}onMouseDown(e,t){if(ae.isOpen)return;let n=!1;switch(t){case`LEFT BUTTON`:n=E.leftClick;break;case`MIDDLE BUTTON`:n=E.middleClick;break;case`RIGHT BUTTON`:n=E.rightClick;break}switch(n){case`none`:break;case`feed`:$h.feed();break;case`macroFeed`:$h.macroFeed(!0);break;case`split`:$h.split();break;case`doubleSplit`:$h.doubleSplit();break;case`split16`:$h.split16();break;case`split32`:$h.split32();break;case`split64`:$h.split64();break;case`dualToggle`:$h.togglePlayer();break}}onMouseUp(e,t){let n=!1;switch(t){case`LEFT BUTTON`:n=E.leftClick;break;case`MIDDLE BUTTON`:n=E.middleClick;break;case`RIGHT BUTTON`:n=E.rightClick;break}switch(n){case`macroFeed`:$h.macroFeed(!1);break}}},Ve=new class{render(e){if(!E.mouseTracker)return;e.strokeStyle=`#fff`,e.lineWidth=4,e.lineCap=`round`,e.lineJoin=`round`;let t=(Be.mouse.x-window.innerWidth/2)/V.zoom+V.x,n=(Be.mouse.y-window.innerHeight/2)/V.zoom+V.y,r=Y.myCells[B.activeTab];if(r){e.beginPath();for(let[i,a]of r)e.moveTo(a.x,a.y),e.lineTo(t,n);e.closePath(),e.stroke()}}},He=class{constructor(){this.lastUseTime=0,this.pool=[document.createElement(`canvas`),document.createElement(`canvas`),document.createElement(`canvas`),document.createElement(`canvas`),document.createElement(`canvas`)],this.text=``,this.font=`ubuntu`,this.shadow=!1,this.color=`#ffffff`,this.shadowColor=`#000000`,this.canvas=[!1,!1,
2!1,!1,!1]}setText(e){this.text!==e&&(this.text=e,this.resetCache())}setFont(e){this.font!==e&&(this.font=e,this.resetCache())}setShadow(e){this.shadow!==e&&(this.shadow=e,this.resetCache())}setColor(e){this.color!==e&&(this.color=e,this.resetCache())}setShadowColor(e){this.shadowColor!==e&&(this.shadowColor=e,this.resetCache())}getCanvas(e){let t=this.getQuality(e);return this.lastUseTime=Date.now(),this.canvas[t]}resetCache(){this.canvas=[!1,!1,!1,!1,!1]}renderCanvas(e){let t=this.getQuality(e),n=this.pool[t],r=n.getContext(`2d`),i=(t+1)*300*.8*.3,a=8*(t+1);r.font=`500 ${i|0}px ${this.font}`;let o=r.measureText(this.text).width;return n.height=(i|0)+a,n.width=(o|0)+a,r.font=`500 ${i|0}px ${this.font}`,r.textBaseline=`middle`,this.shadow&&(r.strokeStyle=this.shadowColor,r.lineWidth=a,r.strokeText(this.text,a>>1,n.height>>1)),r.fillStyle=this.color,r.fillText(this.text,a>>1,n.height>>1),this.canvas[t]=n,this.lastUseTime=Date.now(),n}getQuality(e){return Math.min(e/300,4)|0}},Ue=class{constructor(){this.lastUseTime=0,this.lastTextUpdateTime=0,this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.size=30,this.text=`0`,this.font=`ubuntu`,this.shadow=!1,this.color=`#ffffff`,this.shadowColor=`#000000`,this.isTainted=!1}get updateInterval(){return 500}setSize(e){(this.size/e<.9||e/this.size<.8)&&(this.size=e,this.isTainted=!0)}setText(e){let t=Date.now(),n=t-this.lastTextUpdateTime>this.updateInterval;this.text!==e&&n&&(this.text=e,this.lastTextUpdateTime=t,this.isTainted=!0)}setFont(e){this.font!==e&&(this.font=e,this.isTainted=!0)}setShadow(e){this.shadow!==e&&(this.shadow=e,this.isTainted=!0)}setColor(e){this.color!==e&&(this.color=e,this.isTainted=!0)}setShadowColor(e){this.shadowColor!==e&&(this.shadowColor=e,this.isTainted=!0)}render(){let e=this.canvas,t=this.ctx,n=55*(this.size/1500)|0,r=this.size*.3,i=Math.min(r,50);t.font=`500 ${i|0}px ${this.font}`;let a=t.measureText(this.text).width;e.height=(r|0)+n,e.width=(r/i*a|0)+n,t.font=`500 ${r|0}px ${this.font}`,t.textBaseline=`middle`,this.shadow&&(t.strokeStyle=this.shadowColor,t.lineWidth=n,t.strokeText(this.text,n>>1,e.height>>1)),t.fillStyle=this.color,t.fillText(this.text,n>>1,e.height>>1),this.isTainted=!1}getCanvas(){return this.isTainted&&this.render(),this.lastUseTime=Date.now(),this.canvas}},We=new class{constructor(){this.nickCaches=new Map,this.massCaches=new Map,this.maxCacheLife=2e3,this.cleanupInterval=1e3,this.lastCleanupTime=0,this.maxNickPool=128,this.maxMassPool=512,this.nickCachePool=[],this.massCachePool=[]}nick(e,t,n,r){if(!e||r<34&&E.autoHideText||r<5)return!1;let i=`${t}:${e}`,a=this.nickCaches.get(i)||this.newNickCache(i);return a.setFont(`ubuntu`),a.setShadow(n),a.setColor(t),a.setShadowColor(`#000`),a.setText(e),a.getCanvas(r)||a.renderCanvas(r)}newNickCache(e){let t=this.nickCachePool.shift()||new He;return this.nickCaches.set(e,t),t}mass(e,t,n,r,i){if(i<34&&E.autoHideText||i<5)return!1;let a=this.massCaches.get(e)||this.newMassCache(e);return a.setFont(`ubuntu`),a.setShadow(r),a.setColor(n),a.setShadowColor(`#000`),a.setSize(i),a.setText(t),a.getCanvas()}newMassCache(e){let t=this.massCachePool.shift()||new Ue;return this.massCaches.set(e,t),t}cleaner(){let e=Date.now();if(!(e-this.lastCleanupTime<this.cleanupInterval)){this.lastCleanupTime=e;for(let[t,n]of this.nickCaches)if(!(e-n.lastUseTime<this.maxCacheLife))if(this.nickCaches.delete(t),this.nickCachePool.length<this.maxNickPool)this.nickCachePool.push(n);else for(let e of n.pool)e.width=0,e.height=0;for(let[t,n]of this.massCaches)e-n.lastUseTime<this.maxCacheLife||(this.massCaches.delete(t),this.massCachePool.length<this.maxMassPool?this.massCachePool.push(n):(n.canvas.width=0,n.canvas.height=0))}}},Ge=6e4,Ke=new class{constructor(){this.downloads=new Map,this.maxEntries=96,this.maxIdleTime=3e4,this.cleanupInterval=5e3,this.lastCleanupTime=0,this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.initialize()}initialize(){this.canvas.width=512,this.canvas.height=512,this.ctx.beginPath(),this.ctx.arc(256,256,256,0,Math.PI*2,!0),this.ctx.closePath(),this.ctx.clip()}get(e){if(e===`no-skin`||!e)return!1;let t=performance.now();this.cleanup(t);let n=this.downloads.get(e);if(n===`downloading`)return!1;
2if(typeof n==`number`){if(t-n<Ge)return!1;this.downloads.delete(e),n=void 0}if(n===void 0){if(this.downloads.size>=this.maxEntries)return!1;this.download(e);return}return n.lastUsed=t,n}download(e){this.downloads.set(e,`downloading`);let t=new Image;t.crossOrigin=`anonymous`,t.onload=()=>{this.ctx.clearRect(0,0,512,512),this.ctx.drawImage(t,0,0,512,512);let n=this.canvas.toDataURL();t.onload=null,t.src=n,t.lastUsed=performance.now(),this.downloads.set(e,t),this.cleanup(t.lastUsed)},t.onerror=()=>{this.downloads.set(e,performance.now())},t.src=e}cleanup(e=performance.now()){if(e-this.lastCleanupTime<this.cleanupInterval)return;this.lastCleanupTime=e;let t=[];for(let[n,r]of this.downloads)if(r!==`downloading`){if(typeof r==`number`){e-r>=Ge&&this.downloads.delete(n);continue}if(e-r.lastUsed>this.maxIdleTime){this.downloads.delete(n),r.src=``;continue}t.push([n,r])}if(!(t.length<=this.maxEntries)){t.sort((e,t)=>e[1].lastUsed-t[1].lastUsed);for(let e=0;e<t.length-this.maxEntries;e++){let[n,r]=t[e];this.downloads.delete(n),r.src=``}}}},qe=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.loop=e.conditional=e.parse=void 0,e.parse=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r;if(Array.isArray(n))n.forEach(function(n){return e(t,n,r,i)});else if(typeof n==`function`)n(t,r,i,e);else{var a=Object.keys(n)[0];Array.isArray(n[a])?(i[a]={},e(t,n[a],r,i[a])):i[a]=n[a](t,r,i,e)}return r},e.conditional=function(e,t){return function(n,r,i,a){t(n,r,i)&&a(n,e,r,i)}},e.loop=function(e,t){return function(n,r,i,a){for(var o=[],s=n.pos;t(n,r,i);){var c={};if(a(n,e,r,c),n.pos===s)break;s=n.pos,o.push(c)}return o}}})),Je=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readBits=e.readArray=e.readUnsigned=e.readString=e.peekBytes=e.readBytes=e.peekByte=e.readByte=e.buildStream=void 0,e.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};e.readByte=t,e.peekByte=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(t){return t.data[t.pos+e]}};var n=function(e){return function(t){return t.data.subarray(t.pos,t.pos+=e)}};e.readBytes=n,e.peekBytes=function(e){return function(t){return t.data.subarray(t.pos,t.pos+e)}},e.readString=function(e){return function(t){return Array.from(n(e)(t)).map(function(e){return String.fromCharCode(e)}).join(``)}},e.readUnsigned=function(e){return function(t){var r=n(2)(t);return e?(r[1]<<8)+r[0]:(r[0]<<8)+r[1]}},e.readArray=function(e,t){return function(r,i,a){for(var o=typeof t==`function`?t(r,i,a):t,s=n(e),c=Array(o),l=0;l<o;l++)c[l]=s(r);return c}};var r=function(e,t,n){for(var r=0,i=0;i<n;i++)r+=e[t+i]&&2**(n-i-1);return r};e.readBits=function(e){return function(n){for(var i=t()(n),a=Array(8),o=0;o<8;o++)a[7-o]=!!(i&1<<o);return Object.keys(e).reduce(function(t,n){var i=e[n];return i.length?t[n]=r(a,i.index,i.length):t[n]=a[i.index],t},{})}}})),Ye=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=qe(),n=Je(),r={blocks:function(e){for(var t=0,r=[],i=e.data.length,a=0,o=(0,n.readByte)()(e);o!==t&&o;o=(0,n.readByte)()(e)){if(e.pos+o>=i){var s=i-e.pos;r.push((0,n.readBytes)(s)(e)),a+=s;break}r.push((0,n.readBytes)(o)(e)),a+=o}for(var c=new Uint8Array(a),l=0,u=0;u<r.length;u++)c.set(r[u],l),l+=r[u].length;return c}},i=(0,t.conditional)({gce:[{codes:(0,n.readBytes)(2)},{byteSize:(0,n.readByte)()},{extras:(0,n.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,n.readUnsigned)(!0)},{transparentColorIndex:(0,n.readByte)()},{terminator:(0,n.readByte)()}]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===249}),a=(0,t.conditional)({image:[{code:(0,n.readByte)()},{descriptor:[{left:(0,n.readUnsigned)(!0)},{top:(0,n.readUnsigned)(!0)},{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{lct:(0,n.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,n.readArray)(3,function(e,t,n){return 2**(n.descriptor.lct.size+1)})},function(e,t,n){return n.descriptor.lct.exists}),{data:[{minCodeSize:(0,n.readByte)()},r]}]},function(e){return(0,n.peekByte)()(e)===44}),o=(0,t.conditional)({text:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{preData:function(e,t,r){return(0,n.readBytes)(r.text.blockSize)(e)}},r]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===1}),s=(0,t.conditional)({application:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{id:function(e,t,r){return(0,n.readString)(r.blockSize)(e)}},r]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===255}),c=(0,t.conditional)({comment:[{codes:(0,n.readBytes)(2)},r]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===254});e.default=[{header:[{signature:(0,n.readString)(3)},{version:(0,n.readString)(3)}]},{lsd:[{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{gct:(0,n.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,n.readByte)()},{pixelAspectRatio:(0,n.readByte)()}]},(0,t.conditional)({gct:(0,n.readArray)(3,function(e,t){return 2**(t.lsd.gct.size+1)})},function(e,t){return t.lsd.gct.exists}),{frames:(0,t.loop)([i,s,c,a,o],function(e){var t=(0,n.peekByte)()(e);return t===33||t===44})}]})),Xe=o((e=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.deinterlace=void 0,e.deinterlace=function(e,t){for(var n=Array(e.length),r=e.length/t,i=function(r,i){var a=e.slice(i*t,(i+1)*t);n.splice.apply(n,[r*t,t].concat(a))},a=[0,4,2,1],o=[8,8,4,2],s=0,c=0;c<4;c++)for(var l=a[c];l<r;l+=o[c])i(l,s),s++;return n}})),Ze=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.lzw=void 0,e.lzw=function(e,t,n){var r=4096,i=-1,a=n,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S=Array(n),C=Array(r),w=Array(r),T=Array(r+1);for(_=e,s=1<<_,u=s+1,o=s+2,f=i,l=_+1,c=(1<<l)-1,m=0;m<s;m++)C[m]=0,w[m]=m;var g=p=v=y=x=b=0,p,v,y,x,b;for(h=0;h<a;){if(y===0){if(p<l){g+=t[b]<<p,p+=8,b++;continue}if(m=g&c,g>>=l,p-=l,m>o||m==u)break;if(m==s){l=_+1,c=(1<<l)-1,o=s+2,f=i;continue}if(f==i){T[y++]=w[m],f=m,v=m;continue}for(d=m,m==o&&(T[y++]=v,m=f);m>s;)T[y++]=w[m],m=C[m];v=w[m]&255,T[y++]=v,o<r&&(C[o]=f,w[o]=v,o++,(o&c)===0&&o<r&&(l++,c+=o)),f=d}y--,S[x++]=T[y],h++}for(h=x;h<a;h++)S[h]=0;return S}})),Qe=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.decompressFrames=e.decompressFrame=e.parseGIF=void 0;var t=o(Ye()),n=qe(),r=Je(),i=Xe(),a=Ze();function o(e){return e&&e.__esModule?e:{default:e}}e.parseGIF=function(e){var i=new Uint8Array(e);return(0,n.parse)((0,r.buildStream)(i),t.default)};var s=function(e){for(var t=e.pixels.length,n=new Uint8ClampedArray(t*4),r=0;r<t;r++){var i=r*4,a=e.pixels[r],o=e.colorTable[a]||[0,0,0];n[i]=o[0],n[i+1]=o[1],n[i+2]=o[2],n[i+3]=a===e.transparentIndex?0:255}return n},c=function(e,t,n){if(!e.image){console.warn(`gif frame does not have associated image.`);return}var r=e.image,o=r.descriptor.width*r.descriptor.height,c=(0,a.lzw)(r.data.minCodeSize,r.data.blocks,o);r.descriptor.lct.interlaced&&(c=(0,i.deinterlace)(c,r.descriptor.width));var l={pixels:c,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return r.descriptor.lct&&r.descriptor.lct.exists?l.colorTable=r.lct:l.colorTable=t,e.gce&&(l.delay=(e.gce.delay||10)*10,l.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(l.transparentIndex=e.gce.transparentColorIndex)),n&&(l.patch=s(l)),l};e.decompressFrame=c,e.decompressFrames=function(e,t){return e.frames.filter(function(e){return e.image}).map(function(n){return c(n,e.gct,t)})}}))(),$e=256,et=192,tt=32,nt=20,rt=100,it=8,at=12e4,ot=32,st=96,ct=64<<20,lt=6e4,ut=5e3,dt=5e3,ft=.97,pt=400;function mt(e,t){if(e.emojiUntil<=t)return 1;let n=Math.min(1,(e.emojiUntil-t)/pt,(t-e.emojiStartedAt)/pt);return 1-(1-ft)*Math.max(0,n)}var ht=()=>new Promise(e=>setTimeout(e,0));function gt(e,t,n){return Math.max(1,Math.min(n,Math.min(e,t)))}function _t(e){e&&(e.width=0,e.height=0)}var vt=class{constructor(e){this.url=e,this.state=`loading`,this.sheet=null,this.frameSize=0,this.cols=0,this.frameCount=0,this.offsets=[],this.totalDuration=0,this.animated=!1,this.bytes=0,this.lastUsed=0,this.failedAt=0}frameX(e){return e%this.cols*this.frameSize}frameY(e){return(e/this.cols|0)*this.frameSize}dispose(){let e=this.sheet;this.sheet=null,this.frameCount=0,this.bytes=0,_t(e)}},yt=new class{constructor(){this.entries=new Map,this.lastSweep=0}get(e,t=performance.now()){let n=this.ensure(e,t);return n?(n.lastUsed=t,n.state===`ready`?n:null):null}peek(e){return this.entries.get(e)||null}warm(e){this.ensure(e,performance.now())}ensure(e,t){if(!e)return null;let n=this.entries.get(e);return n&&n.state===`error`&&t-n.failedAt>=lt&&(n=void 0),n||(!this.entries.has(e)&&this.entries.size>=st?null:(n=new vt(e),n.lastUsed=t,this.entries.set(e,n),this.load(n).catch(()=>{this.entries.get(e)===n&&(n.dispose(),n.state=`error`,n.failedAt=performance.now())}),n))}delete(e,t){t.dispose(),this.entries.delete(e)}frameIndexAt(e,t){if(!e.animated||e.totalDuration<=0)return 0;let n=t%e.totalDuration;n<0&&(n+=e.totalDuration);let r=e.offsets,i=0,a=r.length-1;for(;i<a;){let e=i+a+1>>1;r[e]<=n?i=e:a=e-1}return i}drawFrame(e,t,n,r,i,a,o){if(!t.sheet)return;let s=this.frameIndexAt(t,n),c=t.frameSize;e.drawImage(t.sheet,t.frameX(s),t.frameY(s),c,c,r,i,a,o)}async load(e){let t=await fetch(e.url,{mode:`cors`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.arrayBuffer();if(this.entries.get(e.url)!==e)return;let r=new Uint8Array(n,0,Math.min(4,n.byteLength)),i=r[0]===71&&r[1]===73&&r[2]===70&&r[3]===56?await this.decodeGif(n):await this.decodeStatic(n);if(this.entries.get(e.url)!==e){_t(i.sheet);return}let{sheet:a,frameSize:o,cols:s,delays:c}=i;if(!c.length)throw Error(`no frames`);let l=0;e.offsets=c.map(e=>{let t=l;return l+=e,t}),e.totalDuration=l,e.animated=c.length>1,e.sheet=a,e.frameSize=o,e.cols=s,e.frameCount=c.length,e.bytes=a.width*a.height*4,e.
2state=`ready`}makeSheet(e,t){let n=Math.max(1,Math.ceil(Math.sqrt(t))),r=Math.ceil(t/n),i=document.createElement(`canvas`);return i.width=n*e,i.height=r*e,{sheet:i,cols:n,ctx:i.getContext(`2d`)}}blitFrame(e,t,n,r,i,a,o){let s=Math.min(a,o),c=r%t*n,l=(r/t|0)*n;e.save(),e.beginPath(),e.arc(c+n/2,l+n/2,n/2,0,Math.PI*2),e.clip(),e.drawImage(i,(a-s)/2,(o-s)/2,s,s,c,l,n,n),e.restore()}async decodeStatic(e){let t=new Blob([e]),n;n=typeof createImageBitmap==`function`?await createImageBitmap(t):await this.loadImage(URL.createObjectURL(t));let r=n.width||n.naturalWidth,i=n.height||n.naturalHeight;if(!r||!i)throw Error(`empty image`);let a=gt(r,i,$e),{sheet:o,cols:s,ctx:c}=this.makeSheet(a,1);return this.blitFrame(c,s,a,0,n,r,i),n.close?n.close():URL.revokeObjectURL(n.src),{sheet:o,frameSize:a,cols:s,delays:[0]}}loadImage(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=()=>{URL.revokeObjectURL(e),n(Error(`image decode failed`))},r.src=e})}async decodeGif(e){let t=(0,Qe.parseGIF)(e),n=t.frames.filter(e=>e.image),r=t.lsd.width,i=t.lsd.height;if(!n.length||!r||!i)throw Error(`bad gif`);let a=new Set,o=Math.min(n.length,tt);for(let e=0;e<o;e++)a.add(Math.floor(e*n.length/o));let s=gt(r,i,o>1?et:$e),{sheet:c,cols:l,ctx:u}=this.makeSheet(s,o),d=document.createElement(`canvas`);d.width=r,d.height=i;let f=d.getContext(`2d`),p=document.createElement(`canvas`),m=p.getContext(`2d`),h=[],g=0,_=0,v=0,y=null,b=null;try{for(let e=0;e<n.length;e++){let c=(0,Qe.decompressFrame)(n[e],t.gct,!0);if(!c)continue;let x=c.dims;v===3&&b?f.putImageData(b,0,0):v===2&&y&&f.clearRect(y.left,y.top,y.width,y.height),c.disposalType===3&&(b=f.getImageData(0,0,r,i)),x.width&&x.height&&c.patch&&(p.width=x.width,p.height=x.height,m.putImageData(new ImageData(c.patch,x.width,x.height),0,0),f.drawImage(p,x.left,x.top));let S=c.delay>=nt?c.delay:rt;_+=S,a.has(e)&&g<o&&(this.blitFrame(u,l,s,g,d,r,i),h.push(_),g++,_=0),v=c.disposalType|0,y=x,(e+1)%it===0&&await ht()}}catch(e){throw _t(c),e}finally{_t(d),_t(p)}
2if(_&&h.length&&(h[h.length-1]+=_),!h.length)throw _t(c),Error(`no frames`);return{sheet:c,frameSize:s,cols:l,delays:h}}sweep(e=performance.now()){if(e-this.lastSweep<ut)return;this.lastSweep=e;let t=[],n=0;for(let[r,i]of this.entries)if(i.state!==`loading`){if(i.state===`error`){e-i.failedAt>=lt&&this.entries.delete(r);continue}if(e-i.lastUsed>=at){this.delete(r,i);continue}t.push(i),n+=i.bytes}if(t.length<=ot&&n<=ct)return;t.sort((e,t)=>e.lastUsed-t.lastUsed);let r=t.length-ot;for(let i of t){if(r<=0&&n<=ct||e-i.lastUsed<dt)break;n-=i.bytes,r--,this.delete(i.url,i)}}getPerformanceStats(){let e=0,t=0,n=0;for(let r of this.entries.values())r.state===`loading`&&e++,t+=r.frameCount,n+=r.bytes;return{emojiEntries:this.entries.size,emojiEntriesLoading:e,emojiFrames:t,emojiBytesEstimate:n}}},bt=512,xt=12e4,St=48,Ct=128,wt=48<<20,Tt=6e4,Et=5e3,Dt=5e3;function Ot(e,t){let n=64;for(;n<Math.max(e,t)&&n<bt;)n<<=1;return n}function kt(e){e&&(e.width=0,e.height=0)}var At=class{constructor(e){this.url=e,this.state=`loading`,this.canvas=null,this.bytes=0,this.lastUsed=0,this.failedAt=0,this.image=null}dispose(){let e=this.canvas;this.canvas=null,this.bytes=0,this.image&&=(this.image.onload=null,this.image.onerror=null,this.image.src=``,null),kt(e)}},jt=new class{constructor(){this.entries=new Map,this.lastSweep=0}get(e,t=performance.now()){let n=this.ensure(e,t);return n?(n.lastUsed=t,n.state===`ready`?n:null):null}peek(e){return this.entries.get(e)||null}warm(e){this.ensure(e,performance.now())}ensure(e,t){if(!e)return null;let n=this.entries.get(e);return n&&n.state===`error`&&t-n.failedAt>=Tt&&(n=void 0),n||(!this.entries.has(e)&&this.entries.size>=Ct?null:(n=new At(e),n.lastUsed=t,this.entries.set(e,n),this.load(n),n))}load(e){let t=new Image;e.image=t,t.crossOrigin=`anonymous`,t.onload=()=>{if(t.onload=null,t.onerror=null,this.entries.get(e.url)!==e)return;e.image=null;let n=t.naturalWidth||t.width,r=t.naturalHeight||t.height;if(!n||!r)return this.fail(e);let i=Ot(n,r),a=document.createElement(`canvas`);a.width=i,a.height=i;let o=a.getContext(`2d`),s=Math.min(i/n,i/r),c=n*s,l=r*s;o.drawImage(t,(i-c)/2,(i-l)/2,c,l),e.canvas=a,e.bytes=i*i*4,e.state=`ready`},t.onerror=()=>{t.onload=null,t.onerror=null,this.entries.get(e.url)===e&&(e.image=null,this.fail(e))},t.src=e.url}fail(e){e.dispose(),e.state=`error`,e.failedAt=performance.now()}delete(e,t){t.dispose(),this.entries.delete(e)}sweep(e=performance.now()){if(e-this.lastSweep<Et)return;this.lastSweep=e;let t=[],n=0;for(let[r,i]of this.entries)if(i.state!==`loading`){if(i.state===`error`){e-i.failedAt>=Tt&&this.entries.delete(r);continue}if(e-i.lastUsed>=xt){this.delete(r,i);continue}t.push(i),n+=i.bytes}if(t.length<=St&&n<=wt)return;t.sort((e,t)=>e.lastUsed-t.lastUsed);let r=t.length-St;for(let i of t){if(r<=0&&n<=wt||e-i.lastUsed<Dt)break;n-=i.bytes,r--,this.delete(i.url,i)}}getPerformanceStats(){let e=0,t=0;for(let n of this.entries.values())n.state===`loading`&&e++,t+=n.bytes;return{hatEntries:this.entries.size,hatEntriesLoading:e,hatBytesEstimate:t}}},Mt={authRoot:`https://api.senpa.io`,turnstile:{sitekey:`0x4AAAAAAACWFDYFT_opGqX8`},endPoints:{serverList:`https://api.senpa.io/tracker`,authFacebook:`https://api.senpa.io/auth/facebook`,authDiscord:`https://api.senpa.io/auth/discord`,authProfile:`https://api.senpa.io/account/`,skins:{routeBase:`https://api.senpa.io/u`,list:`https://api.senpa.io/skins/list`,search:`https://api.senpa.io/skins/search`,submit:`https://api.senpa.io/skins/submit`,favorite:`https://api.senpa.io/skins/favorite`,fallbackUpload:`https://api.senpa.io/skins/fallback-upload`},clans:{icons:`https://api.senpa.io/clans-icons/`},emojis:{list:`/emojis/`,slots:`/emojis/slots`,buy:e=>`/emojis/${e}/buy`},hats:{list:`/hats/`,catalogue:`/hats/catalogue`,equip:`/hats/equip`,buy:e=>`/hats/${e}/buy`}},storageKeys:{server:`senpaio:server`,region:`senpaio:region`,profiles:`senpaio:profiles`,account:`senpaio:account`,session:`senpaio:session`,refresh:`senpaio:refresh`,mobileSettings:`senpa-mob:settings`},maxProfiles:10},Nt=new class{constructor(){this.authToken=null,this.emojiSlots=null}setAuthToken(e){this.authToken=e,Ly.auth()}setEmojiSlots(e){if(!Array.isArray(e)){this.emojiSlots=null;return}this.emojiSlots=e.map(e=>typeof e==`string`&&e?e:null);for(let e of this.emojiSlots)e&&yt.warm(e)}addExp(e){q.dispatch(A.Reload_Account)}},Pt=600*1e3,Ft=30*1e3,It=30*1e3,Lt=5*1e3,Rt=3,zt=/^[\w-]+\.[\w-]+\.[\w-]+$/,Bt=/^[\w-]{43,128}$/,Vt=`senpaio:pkce`,Ht=Mt.authRoot,Ut=new URL(Ht).origin;function Wt(e){return e.split(`.`).slice(-2).join(`.`)}var Gt=Wt(location.hostname)!==Wt(new URL(Ht).hostname);function Kt(){if(!Gt)return null;try{return localStorage.getItem(Mt.storageKeys.refresh)}catch{return null}}function qt(e){if(Gt)try{e?localStorage.setItem(Mt.storageKeys.refresh,e):localStorage.removeItem(Mt.storageKeys.refresh)}catch{}}var Jt=null,Yt=null,Xt=null,Zt=null,Qt=null,$t=null,en=null,tn=!1,nn=new Map,rn=new Set;window.addEventListener(`message`,e=>{if(e.origin===Ut){if(e.data?.type===`senpa-auth-ready`){e.source?.postMessage({type:`senpa-auth-hello`},Ut);return}wn(e.data?.access_token)&&e.source?.postMessage({type:`senpa-auth-done`},Ut)}});function an(){return Jt}function on(e){return rn.add(e),()=>rn.delete(e)}function sn(e){if(Jt=e||null,tn)try{Jt?localStorage.setItem(Mt.storageKeys.session,Jt):localStorage.removeItem(Mt.storageKeys.session)}catch{}Nt.setAuthToken(Jt);for(let e of rn)e(Jt);cn(Pt)}function cn(e){clearTimeout(Yt),Yt=Jt?setTimeout(()=>dn().catch(()=>{}),e):null}function ln(){document.visibilityState!==`hidden`&&Jt&&yn(Jt)&&dn().catch(()=>{})}document.addEventListener(`visibilitychange`,ln),window.addEventListener(`online`,ln),window.addEventListener(`pageshow`,ln);function un(){tn=!0;try{let e=localStorage.getItem(Mt.storageKeys.session);if(e&&zt.test(e)&&!yn(e))return sn(e),e;e&&localStorage.removeItem(Mt.storageKeys.session)}catch{}return null}function dn(){if(Xt)return Xt;let e=Kt();return Xt=fetch(Ht+`/auth/refresh`,{method:`POST`,credentials:`include`,...e&&{headers:{"Content-Type":`application/json`},body:JSON.stringify({refresh_token:e})}}).then(async e=>{if(e.ok){let t=await e.json();return t.refresh_token&&qt(t.refresh_token),sn(t.access_token),Jt}return e.status===401?(qt(null),(!Jt||yn(Jt))&&sn(null)):cn(Ft),Jt}).catch(e=>{throw cn(Ft),e}).finally(()=>{Xt=null}),Xt}async function fn(){let e=Kt();try{await fetch(Ht+`/auth/logout`,{method:`POST`,credentials:`include`,...e&&{headers:{"Content-Type":`application/json`},body:JSON.stringify({refresh_token:e})}})}catch{}finally{qt(null),sn(null)}}function pn(e,t={}){let n=(t.method||`GET`).toUpperCase(),r=t.headers||{},i=t.body,a=Sn(e,t.query),o=()=>hn(a,{method:n,headers:r,body:i});if(n!==`GET`||i!==void 0)return o();let s=xn(a,r),c=nn.get(s);if(c)return c;let l=o().finally(()=>nn.delete(s));return nn.set(s,l),l}function mn(e,t,n={}){return pn(e,{...n,method:n.method||`POST`,headers:{...n.headers,"Content-Type":`application/json`},body:JSON.stringify(t)})}async function hn(e,t){await _n();let n=await gn(e,t);return n.status===401&&await dn()&&(n=await gn(e,t)),bn(n)}function gn(e,t){let n=new Headers(t.headers);return Jt&&n.set(`Authorization`,`Bearer `+Jt),fetch(Ht+e,{method:t.method,headers:n,body:t.body})}async function _n(){$t&&await $t,Zt&&await Zt,Xt&&await Xt,Jt&&yn(Jt)&&await dn()}function vn(e){if(Qt===e)return Zt??Promise.resolve(!1);Qt=e;let t=n=>fetch(Ht+`/auth/adopt`,{method:`POST`,credentials:`include`,headers:{Authorization:`Bearer `+e}}).then(async t=>{if(t.ok){let n=await t.json();return Jt===e&&(n.refresh_token&&qt(n.refresh_token),sn(n.access_token)),!0}if(t.status===401||t.status===403)return!1;throw Error(`adopt failed: HTTP ${t.status}`)}).catch(async()=>n<=0||Jt!==e?(Qt=null,!1):(await new Promise(e=>setTimeout(e,Lt)),t(n-1)));return Zt=t(Rt).finally(()=>{Zt=null}),Zt}function yn(e){try{let t=e.split(`.`)[1];if(!t)return!1;let n=t.replace(/-/g,`+`).replace(/_/g,`/`),r=n+`=`.repeat((4-n.length%4)%4),i=JSON.parse(atob(r));return typeof i.exp==`number`&&i.exp*1e3<=Date.now()+It}catch{return!1}}async function bn(e){if(e.status===204)return{};let t=await e.text();if(!t)return{};try{return JSON.parse(t)}catch{return{error:`HTTP ${e.status}`}}}function xn(e,t){let n=[...new Headers(t).entries()].sort(([e],[t])=>e.localeCompare(t));return JSON.stringify([e,n])}function Sn(e,t){if(!t)return e;let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!=null&&r!==``&&n.set(e,String(r));let r=n.toString();return r?`${e}${e.includes(`?`)?`&`:`?`}${r}`:e}function Cn(e){if(!e)return;let t=setInterval(()=>{e.closed&&(clearInterval(t),Jt||dn().catch(()=>{}))},500);setTimeout(()=>clearInterval(t),300*1e3)}function wn(e){return typeof e!=`string`||!zt.test(e)?!1:(sn(e),vn(e),!0)}var Tn=[`senpa://token__`,`token:`];function En(){return typeof window.ReactNativeWebView?.postMessage==`function`}function Dn(e){return En()?(On(e).then(e=>{window.ReactNativeWebView.postMessage(JSON.stringify({authURL:e}))}),!0):!1}async function On(e){try{let t=kn(crypto.getRandomValues(new Uint8Array(32))),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t)),r=kn(new Uint8Array(n));en=t;try{sessionStorage.setItem(Vt,t)}catch{}return e+(e.includes(`?`)?`&`:`?`)+`code_challenge=`+r}catch{return e}}function kn(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function An(){let e=en;try{e||=sessionStorage.getItem(Vt),sessionStorage.removeItem(Vt)}catch{}return en=null,e}function jn(e){if($t)return $t;let t=An();if(!t)return Promise.resolve(!1);let n=r=>fetch(Ht+`/auth/handoff`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,code_verifier:t})}).then(async e=>{if(e.ok){let t=await e.json();return t.refresh_token&&qt(t.refresh_token),sn(t.access_token),!0}if(e.status>=400&&e.status<500)return!1;throw Error(`handoff failed: HTTP ${e.status}`)}).catch(async()=>r<=0?!1:(await new Promise(e=>setTimeout(e,Lt)),n(r-1)));return $t=n(Rt).finally(()=>{$t=null}),$t}function Mn(){if(!En())return()=>{};let e=e=>{let t=e?.data;if(typeof t!=`string`)return;let n=Tn.find(e=>t.includes(e));if(!n)return;let r=t.slice(t.indexOf(n)+n.length);!wn(r)&&Bt.test(r)&&jn(r)};return document.addEventListener(`message`,e),window.addEventListener(`message`,e),()=>{document.removeEventListener(`message`,e),window.removeEventListener(`message`,e)}}var Nn={getToken:an,setToken:sn,onTokenChange:on,restoreSession:un,refresh:dn,logout:fn,request:pn,requestJson:mn,isNativeShell:En,openNativeAuth:Dn,listenForNativeToken:Mn,watchAuthPopup:Cn},Pn=-100;function Fn(e,t){return Number.isFinite(e)?e:t}function In(e=150,t=Pn){let n=Fn(e,150),r=Fn(t,Pn),i=(100-n)/2;return{left:`${i}%`,top:`${i+r/2}%`,width:`${n}%`,height:`${n}%`}}var Ln=1e4;function Rn(e,t){return Number.isFinite(e)?e:t}var zn=new class{constructor(){this.entries=new Map,this.inFlight=null,this.lastFetchAt=-1/0}get(e){return e?this.entries.get(e)||(this.refresh(),null):null}load(){this.lastFetchAt===-1/0&&this.refresh()}refresh(){if(this.inFlight)return this.inFlight;let e=performance.now();return e-this.lastFetchAt<Ln?null:(this.lastFetchAt=e,this.inFlight=Nn.request(Mt.endPoints.hats.catalogue).then(e=>this.apply(e)).catch(()=>{}).finally(()=>{this.inFlight=null}),this.inFlight)}apply(e){let t=e?.results?.hats;if(!Array.isArray(t))return;let n=new Map;for(let e of t)typeof e?.id!=`number`||!e.image_url||n.set(e.id,{url:e.image_url,scale:Rn(e.scale,150)||150,offset_y:Rn(e.offset_y,Pn)});this.entries=n}},Bn=`/web/assets/shield-TkE9rWuh.png`,Vn=new class{constructor(){this.shield=new Image,this.shieldActiveImg=new Image,this.shieldActive=document.createElement(`canvas`),this.shieldActiveImg.src=Bn}init(){this.cache()}cache(){this.shield.src=Bn,this.updateTexture()}updateTexture(){let e=this.shieldActive,t=e.getContext(`2d`);t.clearRect(0,0,e.width,e.height),e.width=e.height=512*1.25,t.save(),t.translate(e.width/2,e.height/2),t.shadowColor=E.activeCellBorderColor,t.shadowBlur=40;for(let e=0;e<4;e++)t.drawImage(this.shieldActiveImg,0-512/2,0-512/2,512,512);
2t.restore()}},Hn=new class{constructor(){this.canvas=document.createElement(`canvas`),this.size=150}init(){this.cache()}draw(e,t){let n=E.activeCellIndicatorSize;e.drawImage(this.canvas,t.x-n/2,t.y-t.radius-n,n,n)}cache(){let e=this.canvas,t=e.getContext(`2d`);t.clearRect(0,0,e.width,e.height),e.width=e.height=this.size,t.textAlign=`center`,t.textBaseline=`middle`,t.font=`900 ${this.size}px 'Font Awesome 5 Free'`,t.fillStyle=E.activeCellIndicatorColor,t.fillText(``,e.width/2,e.height/2)}},Un=2;function Wn(){return E.graphicsQuality*Math.min(self.devicePixelRatio||1,Un)}function Gn(e){let t=()=>{matchMedia(`(resolution: ${self.devicePixelRatio||1}dppx)`).addEventListener(`change`,()=>{e(),t()},{once:!0})};t()}var Kn=new class{constructor(){this.PI2=Math.PI*2,this.EMOJI_FADE_MS=400,this.visibleCells=0,this.culledCells=0}render(e,t){let n=E.activeCellBorder,r=E.shieldMarker,i=E.activeCellBorderWidth,a=E.activeCellBorderColor,o=E.nickSize,s=E.massSize,c=E.cellMass,l=E.ownCellMass,u=E.cellMassStroke,d=E.cellMassFormat,f=E.cellNick,p=E.ownCellNick,m=E.cellNickStroke,h=E.cellClanTag,g=E.cellSkin,_=E.teammateCellSkin,v=E.enemyCellSkin,y=E.pellets,b=Y.clientsList.get(Y.myClientID)?.tag||``,x=Y.myPlayerIDs[B.activeTab];this.visibleCells=t.cells.length,this.culledCells=t.culledCells;let S=E.rainbowFood,C=E.useFoodGlow,w=Ne.textures.food,T=Ne.textures.virus,D=V.zoom*Wn(),O=performance.now();yt.sweep(O),jt.sweep(O);for(let k of t.cells){if(!y&&k.isFood)continue;if(e.globalAlpha=1,k.isFood&&(!S||C)){let t=k.radius*w.width/15;e.drawImage(w,k.x-t/2,k.y-t/2,t,t);continue}else if(k.isFood&&S){e.beginPath(),e.arc(k.x,k.y,k.radius,0,this.PI2,!0),e.closePath(),e.fillStyle=k.color,e.fill();continue}if(k.isEject){e.beginPath(),e.arc(k.x,k.y,k.radius,0,this.PI2,!0),e.closePath(),e.fillStyle=k.color,e.fill();continue}if(k.isVirus){let t=k.radius*T.width/100;e.drawImage(T,k.x-t/2,k.y-t/2,t,t)}let t=!1;if(k.isPlayerCell){let s=e.globalAlpha=X.isReplay?ue.opacity:E.cellOpacity/100;s!==1&&(s=1);let c=k.parentPlayer.parentClient,l=b===c.tag,u=c.isBot,d=!1;if(!u&&B.isTR&&!k.isTR&&(e.globalAlpha*=.35),!u&&!B.isTR&&k.isTR&&(e.globalAlpha*=.35),k.removed&&(e.globalAlpha*=1-k.dt),u||(k.isOwn>=0?g&&(d=Ke.get(k.skin)):l?g&&_&&(d=Ke.get(k.skin)):v&&(d=Ke.get(k.skin))),!d||!k.removed){let t=k.color;k.isOwn>=0&&Y.myPlayerIDs.length>1&&E.ownCellColoring===`multibox`&&(t=k.isOwn===B.activeTab?E.activeCellBorderColor:`#ffffff`),e.beginPath(),e.arc(k.x,k.y,k.radius,0,this.PI2,!0),e.closePath(),e.fillStyle=t,e.fill()}if(s!==e.globalAlpha&&(e.globalAlpha=s),k.isOwn>=0&&r&&Y.myPlayerIDs.length>1){let t=k.radius;k.parentPlayer.id===x&&(t*=1.25);let n=t+14*t/100,r=k.parentPlayer&&k.parentPlayer.id===x?Vn.shieldActive:Vn.shield;e.drawImage(r,k.x-n,k.y-n,n*2,n*2)}let y=k.radius*(k.isOwn>=0&&Y.myPlayerIDs.length>1&&r?.65:1),S=!u&&c.emojiUntil>O,C=y*(S?mt(c,O):1);if(d&&e.drawImage(d,k.x-C,k.y-C,C*2,C*2),S){let t=yt.get(c.emojiUrl,O);
2if(t){e.globalAlpha=s*Math.min(1,(c.emojiUntil-O)/this.EMOJI_FADE_MS);let n=C*1;yt.drawFrame(e,t,O-c.emojiStartedAt,k.x-n,k.y-n,n*2,n*2),e.globalAlpha=s}}if(k.isOwn>=0&&n&&Y.myPlayerIDs.length>1){let t=y,n=i/100*t,r=n/2;e.beginPath(),e.arc(k.x,k.y,t-r|0,0,this.PI2,!0),e.closePath(),e.lineWidth=n|0,e.strokeStyle=k.parentPlayer&&k.parentPlayer.id===x?a:`#FFF`,e.stroke()}if(!u&&k.hat){let t=zn.get(k.hat),n=t&&jt.get(t.url,O);if(n){let r=y*2*t.scale/100;e.drawImage(n.canvas,k.x-r/2,k.y+y*t.offset_y/100-r/2,r,r)}}if(k.isOwn>=0&&p||k.isOwn<0&&f){t=!0;let n=k.radius*D*o,r=c.teamColor,i=We.nick(k.nick||eg.defaultCellName,r,m,n),a=i.width/768>1?768/i.width:1;if(i&&i.width&&i.height){let t=k.radius*o*.3/i.height*a,n=i.width*t,r=i.height*t;e.drawImage(i,k.x-n/2,k.y-r/2,n,r)}if(h&&c.clanTag){let t=We.nick(c.clanTag,r,m,n);if(t&&t.width&&t.height){let n=t.width/768>1?768/t.width:1,r=k.radius*o*.3*.55/t.height*n,i=t.width*r,a=t.height*r;e.drawImage(t,k.x-i/2,k.y-k.radius*.3-a/2,i,a)}}}k.isOwn>=0&&Y.myPlayerIDs.length>1&&k.isOwn===B.activeTab&&E.activeCellIndicator&&Hn.draw(e,k)}if(k.isOwn>=0&&l||k.isOwn<0&&c){let n=k.radius*D*s,r=k.parentPlayer.parentClient.teamColor,i=k.mass>999&&d===`shortened`?`${(k.mass/100|0)/10}k`:k.mass,a=We.mass(k.id,i,r,u,n);if(a&&a.width&&a.height){let n=k.radius*s*.3/a.height,r=a.width*n,i=a.height*n;e.drawImage(a,k.x-r/2,k.y+(t?i/4/o:-(i/2)),r,i)}}}e.globalAlpha=1,We.cleaner()}getPerformanceStats(){return{nickTextCaches:We.nickCaches.size,massTextCaches:We.massCaches.size,nickTextCachePool:We.nickCachePool.length,massTextCachePool:We.massCachePool.length,downloadedSkins:Ke.downloads.size,...yt.getPerformanceStats(),...jt.getPerformanceStats(),visibleCells:this.visibleCells,culledCells:this.culledCells}}},qn=new class{constructor(){this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.image=new Image,this.image.crossOrigin=`anonymous`,this.lastUrl=null,this.image.onload=()=>{this.updateCache()},this.image.onerror=()=>{console.warn(`[Background] Could not load image: ${this.image.src}`)}}render(e){E.backgroundImage&&(this.update(),e.drawImage(this.canvas,T.left,T.top,T.right-T.left,T.bottom-T.top))}update(){let e=E.backgroundImageURL;this.lastUrl!==e&&(this.lastUrl=e,this.image.src=e)}updateCache(){let e=this.image;if(!e.complete||!e.naturalWidth||!e.naturalHeight)return;let t=Math.min(Math.max(e.naturalWidth,e.naturalHeight),2048);this.canvas.width=t,this.canvas.height=t,this.ctx.drawImage(e,0,0,t,t)}},Jn=new class{constructor(){this.levels=new Map([[0,new Set],[1,new Set],[2,new Set],[3,new Set],[4,new Set],[5,new Set]]),this.levelColors=[`#FF0000`,`#FF6600`,`#FFFF00`,`#00DDFF`,`#00FF00`,`#0000FF`],this.PI2=Math.PI*2}render(e){if(this.clear(),!(!B.isAlive||!E.splitIndicators)){this.sort(),e.lineWidth=2/V.zoom|0;for(let[t,n]of this.levels)e.strokeStyle=this.levelColors[t],this.renderGroup(e,n)}}renderGroup(e,t){e.beginPath();for(let n of t){let t=3/V.zoom|0;e.moveTo(n.x+n.radius+t*2,n.y),e.arc(n.x,n.y,n.radius+t*2,0,this.PI2,!0)}e.closePath(),e.stroke()}sort(){let e=B.biggestCellMass;for(let[t,n]of Y.cells){if(!n.isPlayerCell||n.isOwn>=0)continue;let t=n.mass,r=5;t>e*2*1.3?r=0:t>e*1.3?r=1:t>e*.77?r=2:t>e*.5*.77?r=3:t>e/16*1.3&&(r=4),this.levels.get(r).add(n)}}clear(){for(let[e,t]of this.levels)t.clear()}};Object.freeze([]);var Yn=256;function Xn(e,t){let n=V.zoom*Wn(),r=t.width/n/2,i=t.height/n/2;return e.left=V.x-r,e.right=V.x+r,e.top=V.y-i,e.bottom=V.y+i,e}function Zn(e,t){let n=e.radius+Yn;return e.x+n>=t.left&&e.x-n<=t.right&&e.y+n>=t.top&&e.y-n<=t.bottom}var Qn=new class{constructor(){this.viewport={},this.cells=[],this.hiddenCells=0,this.culledCells=0}update(e){Xn(this.viewport,e),this.cells.length=0,this.hiddenCells=0,this.culledCells=0;let t=Y.sortedCells;for(let e of t){if(X.isReplay&&e.hidden){this.hiddenCells++;continue}if(!Zn(e,this.viewport)){this.culledCells++;continue}this.cells.push(e)}return this}getPerformanceStats(){return{visibleCells:this.cells.length,hiddenCells:this.hiddenCells,culledCells:this.culledCells}}},$n=class{initialize(){this.initialized||(this.initialized=!0,this.canvas=document.getElementById(`screen`),this.ctx=this.canvas.getContext(`2d`),this.logRendererInfo(),Vn.init(),Ne.init(),Hn.init(),this.setScreenSize(),window.addEventListener(`resize`,()=>{this.setScreenSize()},{passive:!0}),Gn(()=>this.setScreenSize()))}setScreenSize(){this.initialize();let e=Wn();this.canvas.width=window.innerWidth*e|0,this.canvas.height=window.innerHeight*e|0,this.ctx.imageSmoothingEnabled=!!E.antialiasing,this.ctx.imageSmoothingQuality=E.graphicsQuality<1?`medium`:`high`}run(){if(!this.ctx)return;this.clearCanvas(),this.setCamera(),qn.render(this.ctx),xe.render(this.ctx),ge.render(this.ctx),Le.render(this.ctx),Ve.render(this.ctx),Me.renderLines(this.ctx),Jn.render(this.ctx);let e=Qn.update(this.canvas);Kn.render(this.ctx,e),Me.renderArrow(this.ctx),this.resetCamera()}captureFrame(){return this.canvas}getPerformanceStats(){return{backend:`canvas-2d`,canvasBytesEstimate:this.canvas?this.canvas.width*this.canvas.height*4:0,...Kn.getPerformanceStats()}}clearCanvas(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}logRendererInfo(){let e={backend:`canvas-2d`,fallback:!0,contextAttributes:this.ctx.getContextAttributes?.()};window.SenpaRendererInfo=e,console.info(`[SenpaEngine] Renderer: Canvas 2D fallback`,e)}setCamera(){let e=V.zoom*Wn(),t=(this.canvas.width>>1)/e-V.x,n=(this.canvas.height>>1)/e-V.y;this.ctx.scale(e,e),this.ctx.translate(t,n)}resetCamera(){this.ctx.resetTransform()}},er=(e=>(e[e.WEBGL_LEGACY=0]=`WEBGL_LEGACY`,e[e.WEBGL=1]=`WEBGL`,e[e.WEBGL2=2]=`WEBGL2`,e))(er||{}),tr=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.WEBGL=1]=`WEBGL`,e[e.CANVAS=2]=`CANVAS`,e))(tr||{}),nr=(e=>(e[e.COLOR=16384]=`COLOR`,e[e.DEPTH=256]=`DEPTH`,e[e.STENCIL=1024]=`STENCIL`,e))(nr||{}),rr=(e=>(e[e.NORMAL=0]=`NORMAL`,e[e.ADD=1]=`ADD`,e[e.MULTIPLY=2]=`MULTIPLY`,e[e.SCREEN=3]=`SCREEN`,e[e.OVERLAY=4]=`OVERLAY`,e[e.DARKEN=5]=`DARKEN`,e[e.LIGHTEN=6]=`LIGHTEN`,e[e.COLOR_DODGE=7]=`COLOR_DODGE`,e[e.COLOR_BURN=8]=`COLOR_BURN`,e[e.HARD_LIGHT=9]=`HARD_LIGHT`,e[e.SOFT_LIGHT=10]=`SOFT_LIGHT`,e[e.DIFFERENCE=11]=`DIFFERENCE`,e[e.EXCLUSION=12]=`EXCLUSION`,e[e.HUE=13]=`HUE`,e[e.SATURATION=14]=`SATURATION`,e[e.COLOR=15]=`COLOR`,e[e.LUMINOSITY=16]=`LUMINOSITY`,e[e.NORMAL_NPM=17]=`NORMAL_NPM`,e[e.ADD_NPM=18]=`ADD_NPM`,e[e.SCREEN_NPM=19]=`SCREEN_NPM`,e[e.NONE=20]=`NONE`,e[e.SRC_OVER=0]=`SRC_OVER`,e[e.SRC_IN=21]=`SRC_IN`,e[e.SRC_OUT=22]=`SRC_OUT`,e[e.SRC_ATOP=23]=`SRC_ATOP`,e[e.DST_OVER=24]=`DST_OVER`,e[e.DST_IN=25]=`DST_IN`,e[e.DST_OUT=26]=`DST_OUT`,e[e.DST_ATOP=27]=`DST_ATOP`,e[e.ERASE=26]=`ERASE`,e[e.SUBTRACT=28]=`SUBTRACT`,e[e.XOR=29]=`XOR`,e))(rr||{}),ir=(e=>(e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`,e))(ir||{}),H=(e=>(e[e.RGBA=6408]=`RGBA`,e[e.RGB=6407]=`RGB`,e[e.RG=33319]=`RG`,e[e.RED=6403]=`RED`,e[e.RGBA_INTEGER=36249]=`RGBA_INTEGER`,e[e.RGB_INTEGER=36248]=`RGB_INTEGER`,e[e.RG_INTEGER=33320]=`RG_INTEGER`,e[e.RED_INTEGER=36244]=`RED_INTEGER`,e[e.ALPHA=6406]=`ALPHA`,e[e.LUMINANCE=6409]=`
2LUMINANCE`,e[e.LUMINANCE_ALPHA=6410]=`LUMINANCE_ALPHA`,e[e.DEPTH_COMPONENT=6402]=`DEPTH_COMPONENT`,e[e.DEPTH_STENCIL=34041]=`DEPTH_STENCIL`,e))(H||{}),ar=(e=>(e[e.TEXTURE_2D=3553]=`TEXTURE_2D`,e[e.TEXTURE_CUBE_MAP=34067]=`TEXTURE_CUBE_MAP`,e[e.TEXTURE_2D_ARRAY=35866]=`TEXTURE_2D_ARRAY`,e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=`TEXTURE_CUBE_MAP_POSITIVE_X`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=`TEXTURE_CUBE_MAP_NEGATIVE_X`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=`TEXTURE_CUBE_MAP_POSITIVE_Y`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=`TEXTURE_CUBE_MAP_NEGATIVE_Y`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=`TEXTURE_CUBE_MAP_POSITIVE_Z`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=`TEXTURE_CUBE_MAP_NEGATIVE_Z`,e))(ar||{}),or=(e=>(e[e.UNSIGNED_BYTE=5121]=`UNSIGNED_BYTE`,e[e.UNSIGNED_SHORT=5123]=`UNSIGNED_SHORT`,e[e.UNSIGNED_SHORT_5_6_5=33635]=`UNSIGNED_SHORT_5_6_5`,e[e.UNSIGNED_SHORT_4_4_4_4=32819]=`UNSIGNED_SHORT_4_4_4_4`,e[e.UNSIGNED_SHORT_5_5_5_1=32820]=`UNSIGNED_SHORT_5_5_5_1`,e[e.UNSIGNED_INT=5125]=`UNSIGNED_INT`,e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=`UNSIGNED_INT_10F_11F_11F_REV`,e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=`UNSIGNED_INT_2_10_10_10_REV`,e[e.UNSIGNED_INT_24_8=34042]=`UNSIGNED_INT_24_8`,e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=`UNSIGNED_INT_5_9_9_9_REV`,e[e.BYTE=5120]=`BYTE`,e[e.SHORT=5122]=`SHORT`,e[e.INT=5124]=`INT`,e[e.FLOAT=5126]=`FLOAT`,e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=`FLOAT_32_UNSIGNED_INT_24_8_REV`,e[e.HALF_FLOAT=36193]=`HALF_FLOAT`,e))(or||{}),U=(e=>(e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`,e))(U||{}),sr=(e=>(e[e.NEAREST=0]=`NEAREST`,e[e.LINEAR=1]=`LINEAR`,e))(sr||{}),cr=(e=>(e[e.CLAMP=33071]=`CLAMP`,e[e.REPEAT=10497]=`REPEAT`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`,e))(cr||{}),lr=(e=>(e[e.OFF=0]=`OFF`,e[e.POW2=1]=`POW2`,e[e.ON=2]=`ON`,e[e.ON_MANUAL=3]=`ON_MANUAL`,e))(lr||{}),ur=(e=>(e[e.NPM=0]=`NPM`,e[e.UNPACK=1]=`UNPACK`,e[e.PMA=2]=`PMA`,e[e.NO_PREMULTIPLIED_ALPHA=0]=`NO_PREMULTIPLIED_ALPHA`,e[e.PREMULTIPLY_ON_UPLOAD=1]=`PREMULTIPLY_ON_UPLOAD`,e[e.PREMULTIPLIED_ALPHA=2]=`PREMULTIPLIED_ALPHA`,e))(ur||{}),dr=(e=>(e[e.NO=0]=`NO`,e[e.YES=1]=`YES`,e[e.AUTO=2]=`AUTO`,e[e.BLEND=0]=`BLEND`,e[e.CLEAR=1]=`CLEAR`,e[e.BLIT=2]=`BLIT`,e))(dr||{}),fr=(e=>(e[e.AUTO=0]=`AUTO`,e[e.MANUAL=1]=`MANUAL`,e))(fr||{}),pr=(e=>(e.LOW=`lowp`,e.MEDIUM=`mediump`,e.HIGH=`highp`,e))(pr||{}),mr=(e=>(e[e.NONE=0]=`NONE`,e[e.SCISSOR=1]=`SCISSOR`,e[e.STENCIL=2]=`STENCIL`,e[e.SPRITE=3]=`SPRITE`,e[e.COLOR=4]=`COLOR`,e))(mr||{}),hr=(e=>(e[e.NONE=0]=`NONE`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=8]=`HIGH`,e))(hr||{}),gr=(e=>(e[e.ELEMENT_ARRAY_BUFFER=34963]=`ELEMENT_ARRAY_BUFFER`,e[e.ARRAY_BUFFER=34962]=`ARRAY_BUFFER`,e[e.UNIFORM_BUFFER=35345]=`UNIFORM_BUFFER`,e))(gr||{}),W={ADAPTER:{createCanvas:(e,t)=>{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,`text/xml`)},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},_r=/iPhone/i,vr=/iPod/i,yr=/iPad/i,br=/\biOS-universal(?:.+)Mac\b/i,xr=/\bAndroid(?:.+)Mobile\b/i,Sr=/Android/i,Cr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,wr=/Silk/i,Tr=/Windows Phone/i,Er=/\bWindows(?:.+)ARM\b/i,Dr=/BlackBerry/i,Or=/BB10/i,kr=/Opera Mini/i,Ar=/\b(CriOS|Chrome)(?:.+)Mobile/i,jr=/Mobile(?:.+)Firefox\b/i,Mr=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function Nr(e){return function(t){return t.test(e)}}function Pr(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=Nr(n),a={apple:{phone:i(_r)&&!i(Tr),ipod:i(vr),tablet:!i(_r)&&(i(yr)||Mr(t))&&!i(Tr),universal:i(br),device:(i(_r)||i(vr)||i(yr)||i(br)||Mr(t))&&!i(Tr)},amazon:{phone:i(Cr),tablet:!i(Cr)&&i(wr),device:i(Cr)||i(wr)},android:{phone:!i(Tr)&&i(Cr)||!i(Tr)&&i(xr),tablet:!i(Tr)&&!i(Cr)&&!i(xr)&&(i(wr)||i(Sr)),device:!i(Tr)&&(i(Cr)||i(wr)||i(xr)||i(Sr))||i(/\bokhttp\b/i)}
2,windows:{phone:i(Tr),tablet:i(Er),device:i(Tr)||i(Er)},other:{blackberry:i(Dr),blackberry10:i(Or),opera:i(kr),firefox:i(jr),chrome:i(Ar),device:i(Dr)||i(Or)||i(kr)||i(jr)||i(Ar)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var Fr=(Pr.default??Pr)(globalThis.navigator);W.RETINA_PREFIX=/@([0-9\.]+)x/,W.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ir=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),Lr=o(((e,t)=>{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_<o;_+=n)m=e[_],h=e[_+1],m<l&&(l=m),h<d&&(d=h),m>f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===N(e,t,n,r)>0)for(a=t;a<n;a+=r)o=A(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(j(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(j(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;
vendor: 6,115 bytes, line 2
2){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),j(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=i<a?i<o?i:o:a<o?a:o,d=s<c?s<l?s:l:c<l?c:l,f=i>a?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=s<c?s<l?s:l:c<l?c:l,m=u<d?u<f?u:f:d<f?d:f,h=s>c?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o<s;o++)c=t[o]*i,l=o<s-1?t[o+1]*i:e.length,u=r(e,c,l,i,!1),u===u.next&&(u.steiner=!0),a.push(v(u));for(a.sort(d),o=0;o<a.length;o++)n=f(a[o],n);return n}function d(e,t){return e.x-t.x}function f(e,t){var n=p(e,t);if(!n)return t;var r=k(n,e);return i(r,r.next),i(n,n.next)}function p(e,t){var n=t,r=e.x,i=e.y,a=-1/0,o;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x<n.next.x?n:n.next,s===r))return o}n=n.next}while(n!==t);if(!o)return null;var c=o,l=o.x,u=o.y,d=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&y(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)&&(f=Math.abs(i-n.y)/(r-n.x),D(n,e)&&(f<d||f===d&&(n.x>o.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ,r);t++);for(c=l;s>0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new M(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(N(e,0,a,n));if(i)for(var s=0,c=t.length;s<c;s++){var l=t[s]*n,u=s<c-1?t[s+1]*n:e.length;o-=Math.abs(N(e,l,u,n))}var d=0;for(s=0;s<r.length;s+=3){var f=r[s]*n,p=r[s+1]*n,m=r[s+2]*n;d+=Math.abs((e[f]-e[m])*(e[p+1]-e[f+1])-(e[f]-e[p])*(e[m+1]-e[f+1]))}return o===0&&d===0?0:Math.abs((d-o)/o)};function N(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}n.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n}})),Rr=o(((e,t)=>{(function(n){var r=typeof e==`object`&&e&&!e.nodeType&&e,i=typeof t==`object`&&t&&!t.nodeType&&t,a=typeof global==`object`&&global;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,c=36,l=1,u=26,d=38,f=700,p=72,m=128,h=`-`,g=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >
2= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},b=c-l,x=Math.floor,S=String.fromCharCode,C;function w(e){throw RangeError(y[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(v,`.`);var i=T(e.split(`.`),t).join(`.`);return r+i}function D(e){for(var t=[],n=0,r=e.length,i,a;n<r;)i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<r?(a=e.charCodeAt(n++),(a&64512)==56320?t.push(((i&1023)<<10)+(a&1023)+65536):(t.push(i),n--)):t.push(i);return t}function O(e){return T(e,function(e){var t=``;return e>65535&&(e-=65536,t+=S(e>>>10&1023|55296),e=56320|e&1023),t+=S(e),t}).join(``)}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function A(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function j(e,t,n){var r=0;for(e=n?x(e/f):e>>1,e+=x(e/t);e>b*u>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+d))}function M(e){var t=[],n=e.length,r,i=0,a=m,o=p,d=e.lastIndexOf(h),f,g,_,v,y,b,S,C;for(d<0&&(d=0),f=0;f<d;++f)e.charCodeAt(f)>=128&&w(`not-basic`),t.push(e.charCodeAt(f));for(g=d>0?d+1:0;g<n;){for(_=i,v=1,y=c;g>=n&&w(`invalid-input`),b=k(e.charCodeAt(g++)),(b>=c||b>x((s-i)/v))&&w(`overflow`),i+=b*v,S=y<=o?l:y>=o+u?u:y-o,!(b<S);y+=c)C=c-S,v>x(s/C)&&w(`overflow`),v*=C;r=t.length+1,o=j(i-_,r,_==0),x(i/r)>s-a&&w(`overflow`),a+=x(i/r),i%=r,t.splice(i++,0,a)}return O(t)}function N(e){var t,n,r,i,a,o,d,f,g,_,v,y=[],b,C,T,E;for(e=D(e),b=e.length,t=m,n=0,a=p,o=0;o<b;++o)v=e[o],v<128&&y.push(S(v));for(r=i=y.length,i&&y.push(h);r<b;){for(d=s,o=0;o<b;++o)v=e[o],v>=t&&v<d&&(d=v);for(C=r+1,d-t>x((s-n)/C)&&w(`overflow`),n+=(d-t)*C,t=d,o=0;o<b;++o)if(v=e[o],v<t&&++n>s&&w(`overflow`),v==t){for(f=n,g=c;_=g<=a?l:g>=a+u?u:g-a,!(f<_);g+=c)E=f-_,T=c-_,y.push(S(A(_+E%T,0))),f=x(E/T);y.push(S(A(f,0))),a=j(n,C,r==i),n=0,++r}++n,++t}return y.join(``)}function P(e){return E(e,function(e){return g.test(e)?M(e.slice(4).toLowerCase()):e})}function F(e){return E(e,function(e){return _.test(e)?`xn--`+N(e):e})}if(o={version:`1.4.1`,ucs2:{decode:D,encode:O},decode:M,encode:N,toASCII:F,toUnicode:P},typeof define==`function`&&typeof define.amd==`object`&&define.amd)define(`punycode`,function(){return o});else if(r&&i)if(t.exports==r)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(r[C]=o[C]);else n.punycode=o})(e)})),zr=o(((e,t)=>{t.exports=TypeError})),Br=o(((e,t)=>{t.exports={}})),Vr=o(((e,t)=>{var n=typeof Map==`function`&&Map.prototype,r=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,`size`):null,i=n&&r&&typeof r.get==`function`?r.get:null,a=n&&Map.prototype.forEach,o=typeof Set==`function`&&Set.prototype,s=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,`size`):null,c=o&&s&&typeof s.get==`function`?s.get:null,l=o&&Set.prototype.forEach,u=typeof WeakMap==`function`&&WeakMap.prototype?WeakMap.prototype.has:null,d=typeof WeakSet==`function`&&WeakSet.prototype?WeakSet.prototype.has:null,f=typeof WeakRef==`function`&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,h=Function.prototype.toString,g=String.prototype.match,_=String.prototype.slice,v=String.prototype.replace,y=String.prototype.toUpperCase,b=String.prototype.toLowerCase,x=RegExp.prototype.test,S=Array.prototype.concat,C=Array.prototype.join,w=Array.prototype.slice,T=Math.floor,E=typeof BigInt==`function`?BigInt.prototype.valueOf:null,D=Object.getOwnPropertySymbols,O=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?Symbol.prototype.toString:null,k=typeof Symbol==`function`&&typeof Symbol.iterator==`object`,A=typeof Symbol==`function`&&Symbol.toStringTag?Symbol.toStringTag:null,j=Object.prototype.propertyIsEnumerable,M=(typeof Reflect==`function`?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||x.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e==`number`){var r=e<0?-T(-e):T(e);if(r!==e){var i=String(r),a=_.call(t,i.length+1);return v.call(i,n,`$&_`)+`.`+v.call(v.call(a,/([0-9]{3})/g,`$&_`),/_$/,``)}}return v.call(t,n,`$&_`)}
2var P=Br(),F=P.custom,I=le(F)?F:null,L={__proto__:null,double:`"`,single:`'`},ee={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};t.exports=function e(t,n,r,o){var s=n||{};if(de(s,`quoteStyle`)&&!de(L,s.quoteStyle))throw TypeError(`option "quoteStyle" must be "single" or "double"`);if(de(s,`maxStringLength`)&&(typeof s.maxStringLength==`number`?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!de(s,`customInspect`)||s.customInspect;if(typeof u!=`boolean`&&u!==`symbol`)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(de(s,`indent`)&&s.indent!==null&&s.indent!==`	`&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(de(s,`numericSeparator`)&&typeof s.numericSeparator!=`boolean`)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(t===void 0)return`undefined`;if(t===null)return`null`;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`string`)return be(t,s);if(typeof t==`number`){if(t===0)return 1/0/t>0?`0`:`-0`;var f=String(t);return d?N(t,f):f}if(typeof t==`bigint`){var m=String(t)+`n`;return d?N(t,m):m}var h=s.depth===void 0?5:s.depth;if(r===void 0&&(r=0),r>=h&&h>0&&typeof t==`object`)return ne(t)?`[Array]`:`[Object]`;var g=Ee(s,r);
vendor: 5,770 bytes, lines 2-5
2if(o===void 0)o=[];else if(me(o,t)>=0)return`[Circular]`;function y(t,n,i){if(n&&(o=w.call(o),o.push(n)),i){var a={depth:s.depth};return de(s,`quoteStyle`)&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if(typeof t==`function`&&!ie(t)){var x=pe(t),T=Oe(t,y);return`[Function`+(x?`: `+x:` (anonymous)`)+`]`+(T.length>0?` { `+C.call(T,`, `)+` }`:``)}if(le(t)){var D=k?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,`$1`):O.call(t);return typeof t==`object`&&!k?Se(D):D}if(ye(t)){for(var F=`<`+b.call(String(t.nodeName)),ee=t.attributes||[],te=0;te<ee.length;te++)F+=` `+ee[te].name+`=`+R(z(ee[te].value),`double`,s);return F+=`>`,t.childNodes&&t.childNodes.length&&(F+=`...`),F+=`</`+b.call(String(t.nodeName))+`>`,F}if(ne(t)){if(t.length===0)return`[]`;var B=Oe(t,y);return g&&!Te(B)?`[`+De(B,g)+`]`:`[ `+C.call(B,`, `)+` ]`}if(ae(t)){var xe=Oe(t,y);return!(`cause`in Error.prototype)&&`cause`in t&&!j.call(t,`cause`)?`{ [`+String(t)+`] `+C.call(S.call(`[cause]: `+y(t.cause),xe),`, `)+` }`:xe.length===0?`[`+String(t)+`]`:`{ [`+String(t)+`] `+C.call(xe,`, `)+` }`}if(typeof t==`object`&&u){if(I&&typeof t[I]==`function`&&P)return P(t,{depth:h-r});if(u!==`symbol`&&typeof t.inspect==`function`)return t.inspect()}if(V(t)){var ke=[];return a&&a.call(t,function(e,n){ke.push(y(n,t,!0)+` => `+y(e,t))}),we(`Map`,i.call(t),ke,g)}if(_e(t)){var Ae=[];return l&&l.call(t,function(e){Ae.push(y(e,t))}),we(`Set`,c.call(t),Ae,g)}if(he(t))return Ce(`WeakMap`);if(ve(t))return Ce(`WeakSet`);if(ge(t))return Ce(`WeakRef`);if(se(t))return Se(y(Number(t)));if(ue(t))return Se(y(E.call(t)));if(ce(t))return Se(p.call(t));if(oe(t))return Se(y(String(t)));if(typeof window<`u`&&t===window)return`{ [object Window] }`;if(typeof globalThis<`u`&&t===globalThis||typeof global<`u`&&t===global)return`{ [object globalThis] }`;if(!re(t)&&!ie(t)){var je=Oe(t,y),Me=M?M(t)===Object.prototype:t instanceof Object||t.constructor===Object,Ne=t instanceof Object?``:`null prototype`,Pe=!Me&&A&&Object(t)===t&&A in t?_.call(fe(t),8,-1):Ne?`Object`:``,Fe=(Me||typeof t.constructor!=`function`?``:t.constructor.name?t.constructor.name+` `:``)+(Pe||Ne?`[`+C.call(S.call([],Pe||[],Ne||[]),`: `)+`] `:``);return je.length===0?Fe+`{}`:g?Fe+`{`+De(je,g)+`}`:Fe+`{ `+C.call(je,`, `)+` }`}return String(t)};function R(e,t,n){var r=L[n.quoteStyle||t];return r+e+r}function z(e){return v.call(String(e),/"/g,`&quot;`)}function te(e){return!A||!(typeof e==`object`&&(A in e||e[A]!==void 0))}function ne(e){return fe(e)===`[object Array]`&&te(e)}function re(e){return fe(e)===`[object Date]`&&te(e)}function ie(e){return fe(e)===`[object RegExp]`&&te(e)}function ae(e){return fe(e)===`[object Error]`&&te(e)}function oe(e){return fe(e)===`[object String]`&&te(e)}function se(e){return fe(e)===`[object Number]`&&te(e)}function ce(e){return fe(e)===`[object Boolean]`&&te(e)}function le(e){if(k)return e&&typeof e==`object`&&e instanceof Symbol;if(typeof e==`symbol`)return!0;if(!e||typeof e!=`object`||!O)return!1;try{return O.call(e),!0}catch{}return!1}function ue(e){if(!e||typeof e!=`object`||!E)return!1;try{return E.call(e),!0}catch{}return!1}var B=Object.prototype.hasOwnProperty||function(e){return e in this};function de(e,t){return B.call(e,t)}function fe(e){return m.call(e)}function pe(e){if(e.name)return e.name;var t=g.call(h.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function me(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function V(e){if(!i||!e||typeof e!=`object`)return!1;try{i.call(e);try{c.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function he(e){if(!u||!e||typeof e!=`object`)return!1;try{u.call(e,u);try{d.call(e,d)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function ge(e){if(!f||!e||typeof e!=`object`)return!1;try{return f.call(e),!0}catch{}return!1}function _e(e){if(!c||!e||typeof e!=`object`)return!1;try{c.call(e);try{i.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function ve(e){if(!d||!e||typeof e!=`object`)return!1;try{d.call(e,d);try{u.call(e,u)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function ye(e){return!e||typeof e!=`object`?!1:typeof HTMLElement<`u`&&e instanceof HTMLElement||typeof e.nodeName==`string`&&typeof e.getAttribute==`function`}function be(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r=`... `+n+` more character`+(n>1?`s`:``);return be(_.call(e,0,t.maxStringLength),t)+r}var i=ee[t.quoteStyle||`single`];return i.lastIndex=0,R(v.call(v.call(e,i,`\\$1`),/[\x00-\x1f]/g,xe),`single`,t)}function xe(e){var t=e.charCodeAt(0),n={8:`b`,9:`t`,10:`n`,12:`f`,13:`r`}[t];return n?`\\`+n:`\\x`+(t<16?`0`:``)+y.call(t.toString(16))}function Se(e){return`Object(`+e+`)`}function Ce(e){return e+` { ? }`}function we(e,t,n,r){var i=r?De(n,r):C.call(n,`, `);return e+` (`+t+`) {`+i+`}`}function Te(e){for(var t=0;t<e.length;t++)if(me(e[t],`
3`)>=0)return!1;return!0}function Ee(e,t){var n;if(e.indent===`	`)n=`	`;else if(typeof e.indent==`number`&&e.indent>0)n=C.call(Array(e.indent+1),` `);else return null;return{base:n,prev:C.call(Array(t+1),n)}}function De(e,t){if(e.length===0)return``;var n=`
4`+t.prev+t.base;return n+C.call(e,`,`+n)+`
5`+t.prev}function Oe(e,t){var n=ne(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=de(e,i)?t(e[i],e):``}var a=typeof D==`function`?D(e):[],o;if(k){o={};for(var s=0;s<a.length;s++)o[`$`+a[s]]=a[s]}for(var c in e)de(e,c)&&(n&&String(Number(c))===c&&c<e.length||k&&o[`$`+c]instanceof Symbol||(x.call(/[^\w$]/,c)?r.push(t(c,e)+`: `+t(e[c],e)):r.push(c+`: `+t(e[c],e))));if(typeof D==`function`)for(var l=0;l<a.length;l++)j.call(e,a[l])&&r.push(`[`+t(a[l])+`]: `+t(e[a[l]],e));return r}})),Hr=o(((e,t)=>{var n=Vr(),r=zr(),i=function(e,t,n){for(var r=e,i;
5(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,n||(i.next=e.next,e.next=i),i},a=function(e,t){if(e){var n=i(e,t);return n&&n.value}},o=function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},s=function(e,t){return e?!!i(e,t):!1},c=function(e,t){if(e)return i(e,t,!0)};t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r(`Side channel does not contain `+n(e))},delete:function(t){var n=c(e,t);return n&&e&&!e.next&&(e=void 0),!!n},get:function(t){return a(e,t)},has:function(t){return s(e,t)},set:function(t,n){e||={next:void 0},o(e,t,n)}};return t}})),Ur=o(((e,t)=>{t.exports=Object})),Wr=o(((e,t)=>{t.exports=Error})),Gr=o(((e,t)=>{t.exports=EvalError})),Kr=o(((e,t)=>{t.exports=RangeError})),qr=o(((e,t)=>{t.exports=ReferenceError})),Jr=o(((e,t)=>{t.exports=SyntaxError})),Yr=o(((e,t)=>{t.exports=URIError})),Xr=o(((e,t)=>{t.exports=Math.abs})),Zr=o(((e,t)=>{t.exports=Math.floor})),Qr=o(((e,t)=>{t.exports=Math.max})),$r=o(((e,t)=>{t.exports=Math.min})),ei=o(((e,t)=>{t.exports=Math.pow})),ti=o(((e,t)=>{t.exports=Math.round})),ni=o(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),ri=o(((e,t)=>{var n=ni();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),ii=o(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),ai=o(((e,t)=>{var n=ii();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),oi=o(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),si=o(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),ci=o(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=si();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),li=o(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),ui=o(((e,t)=>{t.exports=Ur().getPrototypeOf||null})),di=o(((e,t)=>{var n=Object.prototype.toString,r=Math.max,i=`[object Function]`,a=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},o=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},s=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||n.apply(t)!==i)throw TypeError(`Function.prototype.bind called on incompatible `+t);for(var c=o(arguments,1),l,u=function(){if(this instanceof l){var n=t.apply(this,a(c,arguments));return Object(n)===n?n:this}return t.apply(e,a(c,arguments))},d=r(0,t.length-c.length),f=[],p=0;p<d;p++)f[p]=`$`+p;if(l=Function(`binder`,`return function (`+s(f,`,`)+`){ return binder.apply(this,arguments); }`)(u),t.prototype){var m=function(){};m.prototype=t.prototype,l.prototype=new m,m.prototype=null}return l}})),fi=o(((e,t)=>{var n=di();t.exports=Function.prototype.bind||n})),pi=o(((e,t)=>{t.exports=Function.prototype.call})),mi=o(((e,t)=>{t.exports=Function.prototype.apply})),hi=o(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),gi=o(((e,t)=>{var n=fi(),r=mi(),i=pi();t.exports=hi()||n.call(i,r)})),_i=o(((e,t)=>{var n=fi(),r=zr(),i=pi(),a=gi();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}}
5)),vi=o(((e,t)=>{var n=_i(),r=ai(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`&&function(e){return s(e==null?e:o(e))}})),yi=o(((e,t)=>{var n=li(),r=ui(),i=vi();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),bi=o(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=fi().call(n,r)})),xi=o(((e,t)=>{var n,r=Ur(),i=Wr(),a=Gr(),o=Kr(),s=qr(),c=Jr(),l=zr(),u=Yr(),d=Xr(),f=Zr(),p=Qr(),m=$r(),h=ei(),g=ti(),_=ri(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=ai(),x=oi(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=ci()(),T=yi(),E=ui(),D=li(),O=mi(),k=pi(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>
vendor: 5,156 bytes, line 5
5`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){M[`%Error.prototype%`]=T(T(e))}var N=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},P={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},F=fi(),I=bi(),L=F.call(k,Array.prototype.concat),ee=F.call(O,Array.prototype.splice),R=F.call(k,String.prototype.replace),z=F.call(k,String.prototype.slice),te=F.call(k,RegExp.prototype.exec),ne=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,ie=function(e){var t=z(e,0,1),n=z(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return R(e,ne,function(e,t,n,i){r[r.length]=n?R(i,re,`$1`):t||e}),r},ae=function(e,t){var n=e,r;
5if(I(P,n)&&(r=P[n],n=`%`+r[0]+`%`),I(M,n)){var i=M[n];if(i===A&&(i=N(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(te(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ie(e),r=n.length>0?n[0]:``,i=ae(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],ee(n,L([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=z(p,0,1),h=z(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,I(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=I(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}})),Si=o(((e,t)=>{var n=xi(),r=_i(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),Ci=o(((e,t)=>{var n=xi(),r=Si(),i=Vr(),a=zr(),o=n(`%Map%`,!0),s=r(`Map.prototype.get`,!0),c=r(`Map.prototype.set`,!0),l=r(`Map.prototype.has`,!0),u=r(`Map.prototype.delete`,!0),d=r(`Map.prototype.size`,!0);t.exports=!!o&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a(`Side channel does not contain `+i(e))},delete:function(t){if(e){var n=u(e,t);return d(e)===0&&(e=void 0),n}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return e?l(e,t):!1},set:function(t,n){e||=new o,c(e,t,n)}};return t}})),wi=o(((e,t)=>{var n=xi(),r=Si(),i=Vr(),a=Ci(),o=zr(),s=n(`%WeakMap%`,!0),c=r(`WeakMap.prototype.get`,!0),l=r(`WeakMap.prototype.set`,!0),u=r(`WeakMap.prototype.has`,!0),d=r(`WeakMap.prototype.delete`,!0);t.exports=s?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new o(`Side channel does not contain `+i(e))},delete:function(n){if(s&&n&&(typeof n==`object`||typeof n==`function`)){if(e)return d(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?c(e,n):t&&t.get(n)},has:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?u(e,n):!!t&&t.has(n)},set:function(n,r){s&&n&&(typeof n==`object`||typeof n==`function`)?(e||=new s,l(e,n,r)):a&&(t||=a(),t.set(n,r))}};return n}:a})),Ti=o(((e,t)=>{var n=zr(),r=Vr(),i=Hr(),a=Ci(),o=wi()||a||i;t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n(`Side channel does not contain `+(e&&Object(e)===e?`the given object key`:r(e)))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||=o(),e.set(t,n)}};return t}})),Ei=o(((e,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}})),Di=o(((e,t)=>{var n=Ei(),r=Ti(),i=oi(),a=Object.prototype.hasOwnProperty,o=Array.isArray,s=r(),c=function(e,t){return s.set(e,t),e},l=function(e){return s.has(e)},u=function(e){return s.get(e)},d=function(e,t){s.set(e,t)},f=function(){for(var e=[],t=0;t<256;++t)e[e.length]=`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase();return e}(),p=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i<n.length;++i)n[i]!==void 0&&(r[r.length]=n[i]);t.obj[t.prop]=r}}},m=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)e[r]!==void 0&&(n[r]=e[r]);return n},h=function(e,t,n){t===`__proto__`&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},g=function e(t,n,r){if(!n)return t;if(typeof n!=`object`&&typeof n!=`function`){if(o(t)){var i=t.length;if(r&&typeof r.arrayLimit==`number`&&i>=r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);return c(m(t.concat(n),r),i)}t[i]=n}else if(t&&typeof t==`object`)if(l(t)){var s=u(t)+1;t[s]=n,d(t,s)}else if(r&&r.strictMerge)return[t,n];else(r&&(r.plainObjects||r.allowPrototypes)||!a.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!=`object`){if(l(n)){for(var f=Object.keys(n),p=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},g=0;g<f.length;g++){var _=parseInt(f[g],10);p[_+1]=n[f[g]]}return c(p,u(n)+1)}var v=[t].concat(n);if(r&&typeof r.arrayLimit==`number`&&v.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);return c(m(v,r),v.length-1)}return v}var y=t;if(o(t)&&!o(n)&&(y=m(t,r)),o(t)&&o(n)){if(n.forEach(function(n,i){if
5(a.call(t,i)){var o=t[i];o&&typeof o==`object`&&n&&typeof n==`object`?t[i]=e(o,n,r):t[t.length]=n}else t[i]=n}),r&&typeof r.arrayLimit==`number`&&t.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);return c(m(t,r),t.length-1)}return t}return Object.keys(n).reduce(function(t,i){var o=n[i];if(a.call(t,i)?h(t,i,e(t[i],o,r)):h(t,i,o),l(n)&&!l(t)&&c(t,u(n)),l(t)){var s=parseInt(i,10);String(s)===i&&s>=0&&s>u(t)&&d(t,s)}return t},y)},_=function(e,t){return Object.keys(t).reduce(function(e,n){return h(e,n,t[n]),e},e)},v=function(e,t,n){var r=e.replace(/\+/g,` `);if(n===`iso-8859-1`)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},y=1024;t.exports={arrayToObject:m,assign:_,combine:function(e,t,n,r,i){if(l(e)){if(i)throw RangeError(`Array limit exceeded. Only `+n+` element`+(n===1?``:`s`)+` allowed in an array.`);var a=u(e)+1;return e[a]=t,d(e,a),e}var o=[].concat(e,t);if(o.length>n){if(i)throw RangeError(`Array limit exceeded. Only `+n+` element`+(n===1?``:`s`)+` allowed in an array.`);return c(m(o,{plainObjects:r}),o.length-1)}return o},compact:function(e){for(var t=[{obj:{o:e},prop:`o`}],n=r(),i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),c=0;c<s.length;++c){var l=s[c],u=o[l];typeof u==`object`&&u&&!n.has(u)&&(t[t.length]={obj:o,prop:l},n.set(u,!0))}return p(t),e},decode:v,encode:function(e,t,r,i,a){if(e.length===0)return e;var o=e;if(typeof e==`symbol`?o=Symbol.prototype.toString.call(e):typeof e!=`string`&&(o=String(e)),r===`iso-8859-1`)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(e){return`%26%23`+parseInt(e.slice(2),16)+`%3B`});for(var s=``,c=0;c<o.length;c+=y){var l=o.length>=y?o.slice(c,c+y):o;if(c+y<o.length){var u=l.charCodeAt(l.length-1);u>=55296&&u<=56319&&(l=l.slice(0,-1),--c)}for(var d=[],p=0;p<l.length;++p){var m=l.charCodeAt(p);if(m===45||m===46||m===95||m===126||m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||a===n.RFC1738&&(m===40||m===41)){d[d.length]=l.charAt(p);continue}if(m<128){d[d.length]=f[m];continue}if(m<2048){d[d.length]=f[192|m>>6]+f[128|m&63];continue}if(m<55296||m>=57344){d[d.length]=f[224|m>>12]+f[128|m>>6&63]+f[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|l.charCodeAt(p)&1023),d[d.length]=f[240|m>>18]+f[128|m>>12&63]+f[128|m>>6&63]+f[128|m&63]}s+=d.join(``)}return s},isBuffer:function(e){return!e||typeof e!=`object`?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:l,isRegExp:function(e){return Object.prototype.toString.call(e)===`[object RegExp]`},markOverflow:c,maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r<e.length;r+=1)n[n.length]=t(e[r]);return n}return t(e)},merge:g}})),Oi=o(((e,t)=>{var n=Ti(),r=Di(),i=Ei(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var A=D.get(t);if(O+=1,A!==void 0){if(A===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return S(g&&!C?g(i,f.encoder,w,`key`,x):i);E=``}if(p(E)||r.isBuffer(E))return g?[S(C?i:g(i,f.encoder,w,`key`,x))+`=`+S(g(E,f.encoder,w,`value`,x))]:[S(i)+`=`+S(String(E))];var j=[];if(E===void 0)return j;var M;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,function(e){return e==null?e:g(e)})),M=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))M=_;else{var N=Object.keys(E);M=v?N.sort(v):N}var P=h?String(i).replace(/\./g,`%2E`):String(i),F=o&&s(E)&&E.length===1?P+`[]`:P;if(c&&s(E)&&E.length===0)return F+`[]`;for(var I=0;I<M.length;++I){var L=M[I],ee=typeof L==`object`&&L&&L.value!==void 0?L.value:E[L];if(!(d&&ee===null)){var R=y&&h?String(L).replace(/\./g,`%2E`):String(L),z=s(E)?typeof a==`function`?a(F,R):F:F+(y?`.`+R:`[`+R+`]`);T.set(t,O);var te=n();te.set(m,T),l(j,e(ee,z,a,o,c,u,d,h,a===`comma`&&C&&s(E)?null:g,_,v,y,b,x,S,C,w,te))}}return j},g=function(e){if(!e)return f;if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
5if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!=`boolean`)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!=`function`)throw TypeError(`Encoder has to be a function.`);var t=e.charset||f.charset;if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);var n=i.default;if(e.format!==void 0){if(!a.call(i.formatters,e.format))throw TypeError(`Unknown format option provided.`);n=e.format}var r=i.formatters[n],c=f.filter;(typeof e.filter==`function`||s(e.filter))&&(c=e.filter);var l=e.arrayFormat in o?e.arrayFormat:`indices`in e?e.indices?`indices`:`repeat`:f.arrayFormat;if(`commaRoundTrip`in e&&typeof e.commaRoundTrip!=`boolean`)throw TypeError("`commaRoundTrip` must be a boolean, or absent");var u=e.allowDots===void 0?e.encodeDotInKeys===!0||f.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==`boolean`?e.addQueryPrefix:f.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:l,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:e.delimiter===void 0?f.delimiter:e.delimiter,encode:typeof e.encode==`boolean`?e.encode:f.encode,encodeDotInKeys:typeof e.encodeDotInKeys==`boolean`?e.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof e.encoder==`function`?e.encoder:f.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==`boolean`?e.encodeValuesOnly:f.encodeValuesOnly,filter:c,format:n,formatter:r,serializeDate:typeof e.serializeDate==`function`?e.serializeDate:f.serializeDate,skipNulls:typeof e.skipNulls==`boolean`?e.skipNulls:f.skipNulls,sort:typeof e.sort==`function`?e.sort:null,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:f.strictNullHandling}};t.exports=function(e,t){var r=e,i=g(t),a,c;typeof i.filter==`function`?(c=i.filter,r=c(``,r)):s(i.filter)&&(c=i.filter,a=c);var u=[];if(typeof r!=`object`||!r)return``;var d=o[i.arrayFormat],f=d===`comma`&&i.commaRoundTrip;a||=Object.keys(r),i.sort&&a.sort(i.sort);for(var p=n(),m=0;m<a.length;++m){var _=a[m];if(_!=null){var v=r[_];i.skipNulls&&v===null||l(u,h(v,_,d,f,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,p))}}var y=u.join(i.delimiter),b=i.addQueryPrefix===!0?`?`:``;return i.charsetSentinel&&(i.charset===`iso-8859-1`?b+=`utf8=%26%2310003%3B`+i.delimiter:b+=`utf8=%E2%9C%93`+i.delimiter),y.length>0?b+y:``}})),ki=o(((e,t)=>{var n=Di(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n,r){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1){if(r&&t.throwOnLimitExceeded)for(var i=0,a=e.indexOf(`,`);a>-1;){if(i+=1,i>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);a=e.indexOf(`,`,a+1)}return e.split(`,`)}if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded&&f!==void 0?f+1:f);if(t.throwOnLimitExceeded&&f!==void 0&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h<p.length;++h)p[h].indexOf(`utf8=`)===0&&(p[h]===l?g=`utf-8`:p[h]===c&&(g=`iso-8859-1`),m=h,h=p.length);for(h=0;h<p.length;++h)if(h!==m){var _=p[h],v=_.indexOf(`]=`),y=v===-1?_.indexOf(`=`):v+1,b,x;if(y===-1?(b=t.decoder(_,a.decoder,g,`key`),x=t.strictNullHandling?null:``):(b=t.decoder(_.slice(0,y),a.decoder,g,`key`),b!==null&&(x=n.maybeMap(s(_.slice(y+1),t,i(u[b])?u[b].length:0,_.indexOf(`[]=`)===-1),function(e){return t.decoder(e,a.decoder,g,`value`)}))),x&&t.interpretNumericEntities&&g===`iso-8859-1`&&(x=o(String(x))),_.indexOf(`[]=`)>-1&&(x=i(x)?[x]:x),t.comma&&i(x)&&x.length>t.arrayLimit&&(x=n.combine([],x,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded)),b!==null){var S=r.call(u,b);
5S&&(t.duplicates===`combine`||_.indexOf(`[]=`)>-1)?u[b]=n.combine(u[b],x,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded):(!S||t.duplicates===`last`)&&(u[b]=x)}}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=n.isOverflow(c)?c:r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10),h=!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays;if(!r.parseArrays&&p===``)u={0:c};else if(h&&m<r.arrayLimit)u=[],u[m]=c;else if(h&&r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);else h?(u[m]=c,n.markOverflow(u,m)):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t){var n=t.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e;if(t.depth<=0)return!t.plainObjects&&r.call(Object.prototype,n)&&!t.allowPrototypes?void 0:[n];var i=[],a=n.indexOf(`[`),o=a>=0?n.slice(0,a):n;if(o){if(!t.plainObjects&&r.call(Object.prototype,o)&&!t.allowPrototypes)return;i[i.length]=o}for(var s=n.length,c=a,l=0;c>=0&&l<t.depth;){for(var u=1,d=c+1,f=-1;d<s&&f<0;){var p=n.charCodeAt(d);p===91?u+=1:p===93&&(--u,u===0&&(f=d)),d+=1}if(f<0)return i[i.length]=`[`+n.slice(c)+`]`,i;var m=n.slice(c,f+1),h=m.slice(1,-1);if(!t.plainObjects&&r.call(Object.prototype,h)&&!t.allowPrototypes)return;i[i.length]=m,l+=1,c=n.indexOf(`[`,f+1)}if(c>=0){if(t.strictDepth===!0)throw RangeError(`Input depth exceeded depth option of `+t.depth+` and strictDepth is true`);i[i.length]=`[`+n.slice(c)+`]`}return i},p=function(e,t,n,r){if(e){var i=f(e,n);if(i)return d(i,t,n,r)}},m=function(e){if(!e)return a;
5if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.decodeDotInKeys!==void 0&&typeof e.decodeDotInKeys!=`boolean`)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!=`function`)throw TypeError(`Decoder has to be a function.`);if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);if(e.throwOnLimitExceeded!==void 0&&typeof e.throwOnLimitExceeded!=`boolean`)throw TypeError("`throwOnLimitExceeded` option must be a boolean");var t=e.charset===void 0?a.charset:e.charset,r=e.duplicates===void 0?a.duplicates:e.duplicates;if(r!==`combine`&&r!==`first`&&r!==`last`)throw TypeError(`The duplicates option must be either combine, first, or last`);return{allowDots:e.allowDots===void 0?e.decodeDotInKeys===!0||a.allowDots:!!e.allowDots,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes==`boolean`?e.allowPrototypes:a.allowPrototypes,allowSparse:typeof e.allowSparse==`boolean`?e.allowSparse:a.allowSparse,arrayLimit:typeof e.arrayLimit==`number`?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:a.charsetSentinel,comma:typeof e.comma==`boolean`?e.comma:a.comma,decodeDotInKeys:typeof e.decodeDotInKeys==`boolean`?e.decodeDotInKeys:a.decodeDotInKeys,decoder:typeof e.decoder==`function`?e.decoder:a.decoder,delimiter:typeof e.delimiter==`string`||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:typeof e.depth==`number`||e.depth===!1?+e.depth:a.depth,duplicates:r,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities==`boolean`?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==`number`?e.parameterLimit:a.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects==`boolean`?e.plainObjects:a.plainObjects,strictDepth:typeof e.strictDepth==`boolean`?!!e.strictDepth:a.strictDepth,strictMerge:typeof e.strictMerge==`boolean`?!!e.strictMerge:a.strictMerge,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded==`boolean`&&e.throwOnLimitExceeded}};t.exports=function(e,t){var r=m(t);if(e===``||e==null)return r.plainObjects?{__proto__:null}:{};for(var i=typeof e==`string`?u(e,r):e,a=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var c=o[s],l=p(c,i[c],r,typeof e==`string`);a=n.merge(a,l,r)}return r.allowSparse===!0?a:n.compact(a)}})),Ai=o(((e,t)=>{var n=Oi(),r=ki();t.exports={formats:Ei(),parse:r,stringify:n}})),ji=o((e=>{var t=Rr();function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=[`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
6`,`	`],s=[`%`,`/`,`?`,`;`,`#`].concat(o),c=[`/`,`?`,`#`],l=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},h=Ai();function g(e,t,r){if(e&&typeof e==`object`&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,n,i){if(typeof e!=`string`)throw TypeError(`Parameter 'url' must be a string, not `+typeof e);var g=e.indexOf(`?`),_=g!==-1&&g<e.indexOf(`#`)?`?`:`#`,v=e.split(_);v[0]=v[0].replace(/\\/g,`/`),e=v.join(_);var y=e;if(y=y.trim(),!i&&e.split(`#`).length===1){var b=a.exec(y);if(b)return this.path=y,this.href=y,this.pathname=b[1],b[2]?(this.search=b[2],n?this.query=h.parse(this.search.substr(1)):this.query=this.search.substr(1)):n&&(this.search=``,this.query={}),this}var x=r.exec(y);if(x){x=x[0];var S=x.toLowerCase();this.protocol=S,y=y.substr(x.length)}if(i||x||y.match(/^\/\/[^@/]+@[^@/]+/)){var C=y.substr(0,2)===`//`;C&&!(x&&p[x])&&(y=y.substr(2),this.slashes=!0)}if(!p[x]&&(C||x&&!m[x])){for(var w=-1,T=0;T<c.length;T++){var E=y.indexOf(c[T]);E!==-1&&(w===-1||E<w)&&(w=E)}var D,O=w===-1?y.lastIndexOf(`@`):y.lastIndexOf(`@`,w);O!==-1&&(D=y.slice(0,O),y=y.slice(O+1),this.auth=decodeURIComponent(D)),w=-1;for(var T=0;T<s.length;T++){var E=y.indexOf(s[T]);E!==-1&&(w===-1||E<w)&&(w=E)}w===-1&&(w=y.length),this.host=y.slice(0,w),y=y.slice(w),this.parseHost(),this.hostname=this.hostname||``;var k=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!k)for(var A=this.hostname.split(/\./),T=0,j=A.length;T<j;T++){var M=A[T];if(M&&!M.match(u)){for(var N=``,P=0,F=M.length;P<F;
6P++)M.charCodeAt(P)>127?N+=`x`:N+=M[P];if(!N.match(u)){var I=A.slice(0,T),L=A.slice(T+1),ee=M.match(d);ee&&(I.push(ee[1]),L.unshift(ee[2])),L.length&&(y=`/`+L.join(`.`)+y),this.hostname=I.join(`.`);break}}}this.hostname.length>l?this.hostname=``:this.hostname=this.hostname.toLowerCase(),k||(this.hostname=t.toASCII(this.hostname));var R=this.port?`:`+this.port:``,z=this.hostname||``;this.host=z+R,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),y[0]!==`/`&&(y=`/`+y))}if(!f[S])for(var T=0,j=o.length;T<j;T++){var te=o[T];if(y.indexOf(te)!==-1){var ne=encodeURIComponent(te);ne===te&&(ne=escape(te)),y=y.split(te).join(ne)}}var re=y.indexOf(`#`);re!==-1&&(this.hash=y.substr(re),y=y.slice(0,re));var ie=y.indexOf(`?`);if(ie===-1?n&&(this.search=``,this.query={}):(this.search=y.substr(ie),this.query=y.substr(ie+1),n&&(this.query=h.parse(this.query)),y=y.slice(0,ie)),y&&(this.pathname=y),m[S]&&this.hostname&&!this.pathname&&(this.pathname=`/`),this.pathname||this.search){var R=this.pathname||``,ae=this.search||``;this.path=R+ae}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||``;e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,`:`),e+=`@`);var t=this.protocol||``,n=this.pathname||``,r=this.hash||``,i=!1,a=``;this.host?i=e+this.host:this.hostname&&(i=e+(this.hostname.indexOf(`:`)===-1?this.hostname:`[`+this.hostname+`]`),this.port&&(i+=`:`+this.port)),this.query&&typeof this.query==`object`&&Object.keys(this.query).length&&(a=h.stringify(this.query,{arrayFormat:`repeat`,addQueryPrefix:!1}));var o=this.search||a&&`?`+a||``;return t&&t.substr(-1)!==`:`&&(t+=`:`),this.slashes||(!t||m[t])&&i!==!1?(i=`//`+(i||``),n&&n.charAt(0)!==`/`&&(n=`/`+n)):i||=``,r&&r.charAt(0)!==`#`&&(r=`#`+r),o&&o.charAt(0)!==`?`&&(o=`?`+o),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),o=o.replace(`#`,`%23`),t+i+n+o+r},n.prototype.resolve=function(e){return this.resolveObject(g(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(typeof e==`string`){var t=new n;t.parse(e,!1,!0),e=t}for(var r=new n,i=Object.keys(this),a=0;a<i.length;a++){var o=i[a];r[o]=this[o]}if(r.hash=e.hash,e.href===``)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),c=0;c<s.length;c++){var l=s[c];l!==`protocol`&&(r[l]=e[l])}return m[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname=`/`,r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!m[e.protocol]){for(var u=Object.keys(e),d=0;d<u.length;d++){var f=u[d];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,!e.host&&!p[e.protocol]){for(var h=(e.pathname||``).split(`/`);h.length&&!(e.host=h.shift()););e.host||=``,e.hostname||=``,h[0]!==``&&h.unshift(``),h.length<2&&h.unshift(``),r.pathname=h.join(`/`)}else r.pathname=e.pathname;return r.search=e.search,r.query=e.query,r.host=e.host||``,r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,(r.pathname||r.search)&&(r.path=(r.pathname||``)+(r.search||``)),r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&r.pathname.charAt(0)===`/`,_=e.host||e.pathname&&e.pathname.charAt(0)===`/`,v=_||g||r.host&&e.pathname,y=v,b=r.pathname&&r.pathname.split(`/`)||[],h=e.pathname&&e.pathname.split(`/`)||[],x=r.protocol&&!m[r.protocol];if(x&&(r.hostname=``,r.port=null,r.host&&(b[0]===``?b[0]=r.host:b.unshift(r.host)),r.host=``,e.protocol&&(e.hostname=null,e.port=null,e.host&&(h[0]===``?h[0]=e.host:h.unshift(e.host)),e.host=null),v&&=h[0]===``||b[0]===``),_)r.host=e.host||e.host===``?e.host:r.host,r.hostname=e.hostname||e.hostname===``?e.hostname:r.hostname,r.search=e.search,r.query=e.query,b=h;else if(h.length)b||=[],b.pop(),b=b.concat(h),r.search=e.search,r.query=e.query;else if(e.search!=null){if(x){r.host=b.shift(),r.hostname=r.host;var S=r.host&&r.host.indexOf(`@`)>0?r.host.split(`@`):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.href=r.format(),r}if(!b.length)return r.pathname=null,r.search?r.path=`/`+r.search:r.path=null,r.href=r.format(),r;for(var C=b.slice(-1)[0],w=(r.host||e.host||b.length>1)&&(C===`.`||C===`..`)||C===``,T=0,E=b.length;E>=0;E--)C=b[E],C===`.`?b.splice(E,1):C===`..`?(b.splice(E,1),T++):T&&(b.splice(E,1),T--);if(!v&&!y)for(;T--;)b.unshift(`..`);v&&b[0]!==``&&(!b[0]||b[0].charAt(0)!==`/`)&&b.unshift(``),w&&b.join(`/`).substr(-1)!==`/`&&b.push(``);var D=b[0]===``||b[0]&&b[0].charAt(0)===`/`;if(x){r.hostname=D?``:b.length?b.shift():``,r.host=r.hostname;var S=r.host&&r.host.indexOf(`@`)>0?r.host.split(`@`):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return v||=r.host&&b.length,v&&!D&&b.unshift(``),b.length>0?r.pathname=b.join(`/`):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}})),Mi=c(Ir(),1),Ni=c(Lr(),1);ji();var Pi={};function Fi(e,t,n=3){if(Pi[t])return;let r=Error().stack;typeof r>`u`?console.warn(`PixiJS Deprecation Warning: `,`${t}
7Deprecated since v${e}`):(r=r.split(`
8`).splice(n).join(`
9`),console.groupCollapsed?(console.groupCollapsed(`%cPixiJS Deprecation Warning: %c%s`,`color:#614108;background:#fffbe6`,`font-weight:normal;color:#614108;background:#fffbe6`,`${t}
10Deprecated since v${e}`),console.warn(r),console.groupEnd()):(console.warn(`PixiJS Deprecation Warning: `,`${t}
11Deprecated since v${e}`),console.warn(r))),Pi[t]=!0}function Ii(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function Li(e){return e.split(`?`)[0].split(`#`)[0]}function Ri(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function zi(e,t,n){return e.replace(new RegExp(Ri(t),`g`),n)}function Bi(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCo
11deAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var Vi={toPosix(e){return zi(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){Ii(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(e,t,n){if(Ii(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;let r=Li(this.toPosix(t??W.ADAPTER.getBaseUrl())),i=Li(this.toPosix(n??this.rootname(r)));return e=this.toPosix(e),e.startsWith(`/`)?Vi.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(r,e)},normalize(e){if(Ii(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=Bi(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return Ii(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(Ii(r),r.length>0)if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(Ii(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){Ii(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){Ii(e),t&&Ii(t),e=Li(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){Ii(e),e=Li(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){Ii(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=Li(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(o===0&&r?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]},Hi;async function Ui(){return Hi??=(async()=>{let e=document.createElement(`canvas`).getContext(`webgl`);if(!e)return ur.UNPACK;let t=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!t)return ur.UNPACK;let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(n),e.getExtension(`WEBGL_lose_context`)?.loseContext(),i[0]<=i[3]?ur.PMA:ur.UNPACK})(),Hi}var Wi;function Gi(){return typeof Wi>`u`&&(Wi=function(){let e={stencil:!0,failIfMajorPerformanceCaveat:W.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!W.ADAPTER.getWebGLRenderingContext())return!1;let t=W.ADAPTER.createCanvas(),n=t.getContext(`webgl`,e)||t.getContext(`experimental-webgl`,e),r=!!n?.getContextAttributes()?.stencil;if(n){let e=n.getExtension(`WEBGL_lose_context`);e&&e.loseContext()}return n=null,r}catch{return!1}}()),Wi}var Ki={grad:.9,turn:360,rad:360/(2*Math.PI)},qi=function(e){return typeof e==`string`?e.length>0:typeof e==`number`},Ji=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n+0},Yi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Xi=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Zi=function(e){return{r:Yi(e.r,0,255),g:Yi(e.g,0,255),b:Yi(e.b,0,255),a:Yi(e.a)}},Qi=function(e){return{r:Ji(e.r),g:Ji(e.g),b:Ji(e.b),a:Ji(e.a,3)}},$i=/^#([0-9a-f]{3,8})$/i,ea=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},ta=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},na=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:255*[r,s,o,o,c,r][l],g:255*[c,r,r,s,o,o][l],b:255*[o,o,c,r,r,s][l],a:i}},ra=function(e){return{h:Xi(e.h),s:Yi(e.s,0,100),l:Yi(e.l,0,100),a:Yi(e.a)}},ia=function(e){return{h:Ji(e.h),s:Ji(e.s),l:Ji(e.l),a:Ji(e.a,3)}},aa=function(e){return na((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},oa=function(e){return{h:(t=ta(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},sa=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ca=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,la=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\
11s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ua=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,da={string:[[function(e){var t=$i.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Ji(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Ji(parseInt(e.substr(6,2),16)/255,2):1}:null:null},`hex`],[function(e){var t=la.exec(e)||ua.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Zi({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},`rgb`],[function(e){var t=sa.exec(e)||ca.exec(e);if(!t)return null;var n,r;return aa(ra({h:(n=t[1],r=t[2],r===void 0&&(r=`deg`),Number(n)*(Ki[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}))},`hsl`]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i===void 0?1:i;return qi(t)&&qi(n)&&qi(r)?Zi({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},`rgb`],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,a=i===void 0?1:i;return!qi(t)||!qi(n)||!qi(r)?null:aa(ra({h:Number(t),s:Number(n),l:Number(r),a:Number(a)}))},`hsl`],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,a=i===void 0?1:i;return!qi(t)||!qi(n)||!qi(r)?null:na(function(e){return{h:Xi(e.h),s:Yi(e.s,0,100),v:Yi(e.v,0,100),a:Yi(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)}))},`hsv`]]},fa=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},pa=function(e){return typeof e==`string`?fa(e.trim(),da.string):typeof e==`object`&&e?fa(e,da.object):[null,void 0]},ma=function(e,t){var n=oa(e);return{h:n.h,s:Yi(n.s+100*t,0,100),l:n.l,a:n.a}},ha=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},ga=function(e,t){var n=oa(e);return{h:n.h,s:n.s,l:Yi(n.l+100*t,0,100),a:n.a}},_a=function(){function e(e){this.parsed=pa(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Ji(ha(this.rgba),2)},e.prototype.isDark=function(){return ha(this.rgba)<.5},e.prototype.isLight=function(){return ha(this.rgba)>=.5},e.prototype.toHex=function(){return e=Qi(this.rgba),t=e.r,n=e.g,r=e.b,a=(i=e.a)<1?ea(Ji(255*i)):``,`#`+ea(t)+ea(n)+ea(r)+a;var e,t,n,r,i,a},e.prototype.toRgb=function(){return Qi(this.rgba)},e.prototype.toRgbString=function(){return e=Qi(this.rgba),t=e.r,n=e.g,r=e.b,(i=e.a)<1?`rgba(`+t+`, `+n+`, `+r+`, `+i+`)`:`rgb(`+t+`, `+n+`, `+r+`)`;var e,t,n,r,i},e.prototype.toHsl=function(){return ia(oa(this.rgba))},e.prototype.toHslString=function(){return e=ia(oa(this.rgba)),t=e.h,n=e.s,r=e.l,(i=e.a)<1?`hsla(`+t+`, `+n+`%, `+r+`%, `+i+`)`:`hsl(`+t+`, `+n+`%, `+r+`%)`;var e,t,n,r,i},e.prototype.toHsv=function(){return e=ta(this.rgba),{h:Ji(e.h),s:Ji(e.s),v:Ji(e.v),a:Ji(e.a,3)};var e},e.prototype.invert=function(){return va({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return e===void 0&&(e=.1),va(ma(this.rgba,e))},e.prototype.desaturate=function(e){return e===void 0&&(e=.1),va(ma(this.rgba,-e))},e.prototype.grayscale=function(){return va(ma(this.rgba,-1))},e.prototype.lighten=function(e){return e===void 0&&(e=.1),va(ga(this.rgba,e))},e.prototype.darken=function(e){return e===void 0&&(e=.1),va(ga(this.rgba,-e))},e.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return typeof e==`number`?va({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ji(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=oa(this.rgba);return typeof e==`number`?va({h:e,s:t.s,l:t.l,a:t.a}):Ji(t.h)},e.prototype.isEqual=function(e){return this.toHex()===va(e).toHex()},e}(),va=function(e){return e instanceof _a?e:new _a(e)},ya=[],ba=function(e){e.forEach(function(e){ya.indexOf(e)<0&&(e(_a,da),ya.push(e))})};function xa(e,t){var n={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`,dar
11kgoldenrod:`#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`},r={};for(var i in n)r[n[i]]=i;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return`transparent`;var i,o,s=r[this.toHex()];if(s)return s;if(t?.closest){var c=this.toRgb(),l=1/0,u=`black`;if(!a.length)for(var d in n)a[d]=new e(n[d]).toRgb();for(var f in n){var p=(i=c,o=a[f],(i.r-o.r)**2+(i.g-o.g)**2+(i.b-o.b)**2);p<l&&(l=p,u=f)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i=r===`transparent`?`#0000`:n[r];return i?new e(i).toRgb():null},`name`])}ba([xa]);var Sa=class e{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(t){if(t instanceof e)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw Error(`Cannot set PIXI.Color#value to null`);(this._value===null||!this.isSourceEqual(this._value,t))&&(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(e){return typeof e==`string`||typeof e==`number`||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e==`object`&&e?{...e}:e}isSourceEqual(e,t){let n=typeof e;if(n!==typeof t)return!1;if(n===`number`||n===`string`||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length===t.length&&e.every((e,n)=>e===t[n]);if(e!==null&&t!==null){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}return e===t}toRgba(){let[e,t,n,r]=this._components;return{r:e,g:t,b:n,a:r}}toRgb(){let[e,t,n]=this._components;return{r:e,g:t,b:n}}toRgbaString(){let[e,t,n]=this.toUint8RgbArray();return`rgba(${e},${t},${n},${this.alpha})`}toUint8RgbArray(e){let[t,n,r]=this._components;return e??=[],e[0]=Math.round(t*255),e[1]=Math.round(n*255),e[2]=Math.round(r*255),e}toRgbArray(e){e??=[];let[t,n,r]=this._components;return e[0]=t,e[1]=n,e[2]=r,e}toNumber(){return this._int}toLittleEndianNumber(){let e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(t){let[n,r,i,a]=e.temp.setValue(t)._components;
11return this._components[0]*=n,this._components[1]*=r,this._components[2]*=i,this._components[3]*=a,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let n=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return t&&(n=n*e+.5|0,r=r*e+.5|0,i=i*e+.5|0),(e*255<<24)+(n<<16)+(r<<8)+i}toHex(){let e=this._int.toString(16);return`#${`000000`.substring(0,6-e.length)+e}`}toHexa(){let e=Math.round(this._components[3]*255).toString(16);return this.toHex()+`00`.substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){let[t,n,r]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(n*e)/e,this._components[2]=Math.round(r*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e??=[];let[t,n,r,i]=this._components;return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}normalize(t){let n,r,i,a;if((typeof t==`number`||t instanceof Number)&&t>=0&&t<=16777215){let e=t;n=(e>>16&255)/255,r=(e>>8&255)/255,i=(e&255)/255,a=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,r,i,a=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,r,i,a=255]=t,n/=255,r/=255,i/=255,a/=255;else if(typeof t==`string`||typeof t==`object`){if(typeof t==`string`){let n=e.HEX_PATTERN.exec(t);n&&(t=`#${n[2]}`)}let o=va(t);o.isValid()&&({r:n,g:r,b:i,a}=o.rgba,n/=255,r/=255,i/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=r,this._components[2]=i,this._components[3]=a,this.refreshInt();else throw Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);let[e,t,n]=this._components;this._int=(e*255<<16)+(t*255<<8)+(n*255|0)}_clamp(e,t=0,n=1){return typeof e==`number`?Math.min(Math.max(e,t),n):(e.forEach((r,i)=>{e[i]=Math.min(Math.max(r,t),n)}),e)}};Sa.shared=new Sa,Sa.temp=new Sa,Sa.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;var Ca=Sa;function wa(e){return Fi(`7.2.0`,`utils.hex2string is deprecated, use Color#toHex instead`),Ca.shared.setValue(e).toHex()}function Ta(e){return Fi(`7.2.0`,`utils.rgb2hex is deprecated, use Color#toNumber instead`),Ca.shared.setValue(e).toNumber()}function Ea(){let e=[],t=[];for(let n=0;n<32;n++)e[n]=n,t[n]=n;e[rr.NORMAL_NPM]=rr.NORMAL,e[rr.ADD_NPM]=rr.ADD,e[rr.SCREEN_NPM]=rr.SCREEN,t[rr.NORMAL]=rr.NORMAL_NPM,t[rr.ADD]=rr.ADD_NPM,t[rr.SCREEN]=rr.SCREEN_NPM;let n=[];return n.push(t),n.push(e),n}var Da=Ea();function Oa(e,t){return Da[+!!t][e]}function ka(e,t=null){let n=e*6;if(t||=new Uint16Array(n),t.length!==n)throw Error(`Out buffer length is incorrect, got ${t.length} and expected ${n}`);for(let e=0,r=0;e<n;e+=6,r+=4)t[e+0]=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;return t}function Aa(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?`Float32Array`:e instanceof Uint32Array?`Uint32Array`:`Int32Array`;if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return`Uint16Array`}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return`Uint8Array`;return null}function ja(e){return e+=+(e===0),--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function Ma(e){return!(e&e-1)&&!!e}function Na(e){let t=(e>65535)<<4;e>>>=t;let n=(e>255)<<3;return e>>>=n,t|=n,n=(e>15)<<2,e>>>=n,t|=n,n=(e>3)<<1,e>>>=n,t|=n,t|e>>1}function Pa(e,t,n){let r=e.length,i;if(t>=r||n===0)return;n=t+n>r?r-t:n;let a=r-n;for(i=t;i<a;++i)e[i]=e[i+n];e.length=a}function Fa(e){return e===0?0:e<0?-1:1}var Ia=0;function La(){return++Ia}var Ra=class{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};Ra.EMPTY=new Ra(0,0,0,0);var za=Ra,Ba={},Va=Object.create(null),Ha=Object.create(null),Ua=class{constructor(e,t,n){this._canvas=W.ADAPTER.createCanvas(),this._context=this._canvas.getContext(`2d`),this.resolution=n||W.RESOLUTION,this.resize(e,t)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(e,t){this._checkDestroyed(),this._canvas.width=Math.round(e*this.resolution),this._canvas.height=Math.round(t*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(e){this._checkDestroyed(),this._canvas.width=Math.round(e)}get height(){return this._checkDestroyed(),this._canvas.height}set height(e){this._checkDestroyed(),this._canvas.height=Math.round(e)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(this._canvas===null)throw TypeError(`The CanvasRenderTarget has already been destroyed`)}};function Wa(e,t,n){for(let r=0,i=4*n*t;r<t;++r,i+=4)if(e[i+3]!==0)return!1;return!0}function Ga(e,t,n,r,i){let a=4*t;for(let t=r,o=r*a+4*n;t<=i;++t,o+=a)if(e[o+3]!==0)return!1;return!0}function Ka(e){let{width:t,height:n}=e,r=e.getContext(`2d`,{willReadFrequently:!0});if(r===null)throw TypeError(`Failed to get canvas 2D context`);let i=r.getImageData(0,0,t,n).data,a=0,o=0,s=t-1,c=n-1;for(;o<n&&Wa(i,t,o);)++o;if(o===n)return za.EMPTY;for(;Wa(i,t,c);)--c;for(;Ga(i,t,a,o,c);)++a;for(;Ga(i,t,s,o,c);)--s;
11return++s,++c,new za(a,o,s,c)}function qa(e){let t=Ka(e),{width:n,height:r}=t,i=null;if(!t.isEmpty()){let a=e.getContext(`2d`);if(a===null)throw TypeError(`Failed to get canvas 2D context`);i=a.getImageData(t.left,t.top,n,r)}return{width:n,height:r,data:i}}function Ja(e,t=globalThis.location){if(e.startsWith(`data:`))return``;t||=globalThis.location;let n=new URL(e,document.baseURI);return n.hostname!==t.hostname||n.port!==t.port||n.protocol!==t.protocol?`anonymous`:``}function Ya(e,t=1){let n=W.RETINA_PREFIX?.exec(e);return n?parseFloat(n[1]):t}var G=(e=>(e.Renderer=`renderer`,e.Application=`application`,e.RendererSystem=`renderer-webgl-system`,e.RendererPlugin=`renderer-webgl-plugin`,e.CanvasRendererSystem=`renderer-canvas-system`,e.CanvasRendererPlugin=`renderer-canvas-plugin`,e.Asset=`asset`,e.LoadParser=`load-parser`,e.ResolveParser=`resolve-parser`,e.CacheParser=`cache-parser`,e.DetectionParser=`detection-parser`,e))(G||{}),Xa=e=>{if(typeof e==`function`||typeof e==`object`&&e.extension){if(!e.extension)throw Error(`Extension class must have an extension object`);e={...typeof e.extension==`object`?e.extension:{type:e.extension},ref:e}}if(typeof e==`object`)e={...e};else throw Error(`Invalid extension type`);return typeof e.type==`string`&&(e.type=[e.type]),e},Za=(e,t)=>Xa(e).priority??t,Qa={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(Xa).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e))}),this},add(...e){return e.map(Xa).forEach(e=>{e.type.forEach(t=>{let n=this._addHandlers,r=this._queue;n[t]?n[t]?.(e):(r[t]=r[t]||[],r[t]?.push(e))})}),this},handle(e,t,n){let r=this._addHandlers,i=this._removeHandlers;if(r[e]||i[e])throw Error(`Extension type ${e} already has a handler`);r[e]=t,i[e]=n;let a=this._queue;return a[e]&&(a[e]?.forEach(e=>t(e)),delete a[e]),this},handleByMap(e,t){return this.handle(e,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByList(e,t,n=-1){return this.handle(e,e=>{t.includes(e.ref)||(t.push(e.ref),t.sort((e,t)=>Za(t,n)-Za(e,n)))},e=>{let n=t.indexOf(e.ref);n!==-1&&t.splice(n,1)})}},$a=class{constructor(e){typeof e==`number`?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||=new Int8Array(this.rawBinaryData),this._int8View}get uint8View(){return this._uint8View||=new Uint8Array(this.rawBinaryData),this._uint8View}get int16View(){return this._int16View||=new Int16Array(this.rawBinaryData),this._int16View}get uint16View(){return this._uint16View||=new Uint16Array(this.rawBinaryData),this._uint16View}get int32View(){return this._int32View||=new Int32Array(this.rawBinaryData),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case`int8`:case`uint8`:return 1;case`int16`:case`uint16`:return 2;case`int32`:case`uint32`:case`float32`:return 4;default:throw Error(`${e} isn't a valid view type`)}}},eo=[`precision mediump float;`,`void main(void){`,`float test = 0.1;`,`%forloop%`,`gl_FragColor = vec4(0.0);`,`}`].join(`
12`);function to(e){let t=``;for(let n=0;n<e;++n)n>0&&(t+=`
13else `),n<e-1&&(t+=`if(test == ${n}.0){}`);return t}function no(e,t){if(e===0)throw Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");let n=t.createShader(t.FRAGMENT_SHADER);for(;;){let r=eo.replace(/%forloop%/gi,to(e));if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))e=e/2|0;else break}return e}var ro=0,io=1,ao=2,oo=3,so=4,co=5,lo=class e{constructor(){this.data=0,this.blendMode=rr.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<ro)}set blend(e){!!(this.data&1<<ro)!==e&&(this.data^=1<<ro)}get offsets(){return!!(this.data&1<<io)}set offsets(e){!!(this.data&1<<io)!==e&&(this.data^=1<<io)}
13get culling(){return!!(this.data&1<<ao)}set culling(e){!!(this.data&1<<ao)!==e&&(this.data^=1<<ao)}get depthTest(){return!!(this.data&1<<oo)}set depthTest(e){!!(this.data&1<<oo)!==e&&(this.data^=1<<oo)}get depthMask(){return!!(this.data&1<<co)}set depthMask(e){!!(this.data&1<<co)!==e&&(this.data^=1<<co)}get clockwiseFrontFace(){return!!(this.data&1<<so)}set clockwiseFrontFace(e){!!(this.data&1<<so)!==e&&(this.data^=1<<so)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==rr.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}static for2d(){let t=new e;return t.depthTest=!1,t.blend=!0,t}};lo.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};var uo=[];function fo(e,t){if(!e)return null;let n=``;if(typeof e==`string`){let t=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);t&&(n=t[1].toLowerCase())}for(let r=uo.length-1;r>=0;--r){let i=uo[r];if(i.test&&i.test(e,n))return new i(e,t)}throw Error(`Unrecognized source type to auto-detect Resource`)}var po=class{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,n,r,i,a,o,s){if(arguments.length>8)throw Error(`max arguments reached`);let{name:c,items:l}=this;this._aliasCount++;for(let u=0,d=l.length;u<d;u++)l[u][c](e,t,n,r,i,a,o,s);return l===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){let t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=``}get empty(){return this.items.length===0}get name(){return this._name}};Object.defineProperties(po.prototype,{dispatch:{value:po.prototype.emit},run:{value:po.prototype.emit}});var mo=class{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new po(`setRealSize`),this.onUpdate=new po(`update`),this.onError=new po(`onError`)}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,t,n){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,t){return!1}},ho=class extends mo{constructor(e,t){let{width:n,height:r}=t||{};if(!n||!r)throw Error(`BufferResource width or height invalid`);super(n,r),this.data=e,this.unpackAlignment=t.unpackAlignment??4}upload(e,t,n){let r=e.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,this.unpackAlignment),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===ur.UNPACK);let i=t.realWidth,a=t.realHeight;return n.width===i&&n.height===a?r.texSubImage2D(t.target,0,0,0,i,a,t.format,n.type,this.data):(n.width=i,n.height=a,r.texImage2D(t.target,0,n.internalFormat,i,a,0,t.format,n.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}},go={scaleMode:sr.NEAREST,alphaMode:ur.NPM},_o=class e extends Mi.default{constructor(t=null,n=null){super(),n=Object.assign({},e.defaultOptions,n);let{alphaMode:r,mipmap:i,anisotropicLevel:a,scaleMode:o,width:s,height:c,wrapMode:l,format:u,type:d,target:f,resolution:p,resourceOptions:m}=n;t&&!(t instanceof mo)&&(t=fo(t,m),t.internal=!0),this.resolution=p||W.RESOLUTION,this.width=Math.round((s||0)*this.resolution)/this.resolution,this.height=Math.round((c||0)*this.resolution)/this.resolution,this._mipmap=i,this.anisotropicLevel=a,this._wrapMode=l,this._scaleMode=o,this.format=u,this.type=d,this.target=f,this.alphaMode=r,this.uid=La(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&c>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),t!==void 0&&t!==this.mipmap&&
13(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this}setSize(e,t,n){return n||=this.resolution,this.setRealSize(e*n,t*n,n)}setRealSize(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Ma(this.realWidth)&&Ma(this.realHeight)}setResolution(e){let t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit(`update`,this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw Error(`Resource can be set only once`);return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit(`update`,this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit(`loaded`,this),this.emit(`update`,this))}onError(e){this.emit(`error`,this,e)}destroy(){this.resource&&=(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),null),this.cacheId&&=(delete Ha[this.cacheId],delete Va[this.cacheId],null),this.valid=!1,this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit(`destroyed`,this),this.removeAllListeners()}dispose(){this.emit(`dispose`,this)}castToBaseTexture(){return this}static from(t,n,r=W.STRICT_TEXTURE_CACHE){let i=typeof t==`string`,a=null;i?a=t:(t._pixiId||=`${n?.pixiIdPrefix||`pixiid`}_${La()}`,a=t._pixiId);let o=Ha[a];if(i&&r&&!o)throw Error(`The cacheId "${a}" does not exist in BaseTextureCache.`);return o||(o=new e(t,n),o.cacheId=a,e.addToCache(o,a)),o}static fromBuffer(t,n,r,i){t||=new Float32Array(n*r*4);let a=new ho(t,{width:n,height:r,...i?.resourceOptions}),o,s;return t instanceof Float32Array?(o=H.RGBA,s=or.FLOAT):t instanceof Int32Array?(o=H.RGBA_INTEGER,s=or.INT):t instanceof Uint32Array?(o=H.RGBA_INTEGER,s=or.UNSIGNED_INT):t instanceof Int16Array?(o=H.RGBA_INTEGER,s=or.SHORT):t instanceof Uint16Array?(o=H.RGBA_INTEGER,s=or.UNSIGNED_SHORT):t instanceof Int8Array?(o=H.RGBA,s=or.BYTE):(o=H.RGBA,s=or.UNSIGNED_BYTE),a.internal=!0,new e(a,Object.assign({},go,{type:s,format:o},i))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Ha[t]&&Ha[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Ha[t]=e)}static removeFromCache(e){if(typeof e==`string`){let t=Ha[e];if(t){let n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete Ha[e],t}}else if(e?.textureCacheIds){for(let t=0;t<e.textureCacheIds.length;++t)delete Ha[e.textureCacheIds[t]];return e.textureCacheIds.length=0,e}return null}};_o.defaultOptions={mipmap:lr.POW2,anisotropicLevel:0,scaleMode:sr.LINEAR,wrapMode:cr.CLAMP,alphaMode:ur.UNPACK,target:ar.TEXTURE_2D,format:H.RGBA,type:or.UNSIGNED_BYTE},_o._globalBatch=0;var vo=_o,yo=class{constructor(){this.texArray=null,this.blend=0,this.type=ir.TRIANGLES,this.start=0,this.size=0,this.data=null}},bo=0,xo=class e{constructor(e,t=!0,n=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=t,this.id=bo++,this.disposeRunner=new po(`disposeBuffer`)}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?gr.ELEMENT_ARRAY_BUFFER:gr.ARRAY_BUFFER}get index(){return this.type===gr.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new e(t)}},So=class e{constructor(e,t=0,n=!1,r=or.FLOAT,i,a,o,s=1){this.buffer=e,this.size=t,this.normalized=n,this.type=r,this.stride=i,this.start=a,this.instance=o,this.divisor=s}destroy(){this.buffer=null}static from(t,n,r,i,a){return new e(t,n,r,i,a)}},Co={Float32Array,Uint32Array,Int32Array,Uint8Array};function wo(e,t){let n=0,r=0,i={};for(let i=0;i<e.length;i++)r+=t[i],n+=e[i].length;let a=new ArrayBuffer(n*4),o=null,s=0;for(let n=0;n<e.length;n++){let c=t[n],l=e[n],u=Aa(l);i[u]||(i[u]=new Co[u](a)),o=i[u];for(let e=0;e<l.length;e++){let t=(e/c|0)*r+s,n=e%c;o[t+n]=l[e]}s+=c}return new Float32Array(a)}var To={5126:4,5123:2,5121:1},Eo=0,Do={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Oo=class e{constructor(e=[],t={}){this.buffers=e,this.indexBuffer=null,this.attributes=t,this.glVertexArrayObjects={},this.id=Eo++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new po(`disposeGeometry`),this.refCount=0}addAttribute(e,t,n=0,r=!1,i,a,o,s=!1){if(!t)throw Error(`You must pass a buffer when creating an attribute`);t instanceof xo||(t instanceof Array&&(t=new Float32Array(t)),t=new xo(t));let c=e.split(`|`);if(c.length>1){for(let e=0;e<c.length;e++)this.addAttribute(c[e],t,n,r,i);return this}let l=this.buffers.indexOf(t);return l===-1&&(this.buffers.push(t),l=this.buffers.length-1),this.attributes[e]=new So(l,n,r,i,a,o,s),this.instanced=this.instanced||s,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof xo||(e instanceof Array&&(e=new Uint16Array(e)),e=new xo(e)),e.type=gr.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;let e=[],t=[],n=new xo,r;for(r in this.attributes){let n=this.attributes[r],i=this.buffers[n.buffer];e.push(i.data),t.push(n.size*To[n.type]/4),n.buffer=0}for(n.data=wo(e,t),r=0;r<this.buffers.length;r++)this.buffers[r]!==this.indexBuffer&&this.buffers[r].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(let e in this.attributes){let t=this.attributes[e];return this.buffers[t.buffer].data.length/(t.stride/4||t.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){let t=new e;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new xo(this.buffers[e].data.slice(0));for(let e in this.attributes){let n=this.attributes[e];t.attributes[e]=new So(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=gr.ELEMENT_ARRAY_BUFFER),t}static merge(t){let n=new e,r=[],i=[],a=[],o;for(let e=0;e<t.length;e++){o=t[e];for(let e=0;e<o.buffers.length;e++)i[e]=i[e]||0,i[e]+=o.buffers[e].data.length,a[e]=0}for(let e=0;e<o.buffers.length;e++)r[e]=new Do[Aa(o.buffers[e].data)](i[e]),n.buffers[e]=new xo(r[e]);for(let e=0;e<t.length;e++){o=t[e];for(let e=0;e<o.buffers.length;e++)r[e].set(o.buffers[e].data,a[e]),a[e]+=o.buffers[e].data.length}if(n.attributes=o.attributes,o.indexBuffer){n.indexBuffer=n.buffers[o.buffers.indexOf(o.indexBuffer)],n.indexBuffer.type=gr.ELEMENT_ARRAY_BUFFER;let e=0,r=0,i=0,a=0;for(let e=0;e<o.buffers.length;e++)if(o.buffers[e]!==o.indexBuffer){a=e;break}
13for(let e in o.attributes){let t=o.attributes[e];(t.buffer|0)===a&&(r+=t.size*To[t.type]/4)}for(let o=0;o<t.length;o++){let s=t[o].indexBuffer.data;for(let t=0;t<s.length;t++)n.indexBuffer.data[t+i]+=e;e+=t[o].buffers[a].data.length/r,i+=s.length}}return n}},ko=class extends Oo{constructor(e=!1){super(),this._buffer=new xo(null,e,!1),this._indexBuffer=new xo(null,e,!0),this.addAttribute(`aVertexPosition`,this._buffer,2,!1,or.FLOAT).addAttribute(`aTextureCoord`,this._buffer,2,!1,or.FLOAT).addAttribute(`aColor`,this._buffer,4,!0,or.UNSIGNED_BYTE).addAttribute(`aTextureId`,this._buffer,1,!0,or.FLOAT).addIndex(this._indexBuffer)}},Ao=Math.PI*2,jo=180/Math.PI,Mo=Math.PI/180,No=(e=>(e[e.POLY=0]=`POLY`,e[e.RECT=1]=`RECT`,e[e.CIRC=2]=`CIRC`,e[e.ELIP=3]=`ELIP`,e[e.RREC=4]=`RREC`,e))(No||{}),Po=class e{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new e(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}};Po.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};var Fo=[new Po,new Po,new Po,new Po],Io=class e{constructor(e=0,t=0,n=0,r=0){this.x=Number(e),this.y=Number(t),this.width=Number(n),this.height=Number(r),this.type=No.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new e(0,0,0,0)}clone(){return new e(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}intersects(e,t){if(!t){let t=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=t)return!1;let n=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>n}let n=this.left,r=this.right,i=this.top,a=this.bottom;if(r<=n||a<=i)return!1;let o=Fo[0].set(e.left,e.top),s=Fo[1].set(e.left,e.bottom),c=Fo[2].set(e.right,e.top),l=Fo[3].set(e.right,e.bottom);if(c.x<=o.x||s.y<=o.y)return!1;let u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(o,o),t.apply(s,s),t.apply(c,c),t.apply(l,l),Math.max(o.x,s.x,c.x,l.x)<=n||Math.min(o.x,s.x,c.x,l.x)>=r||Math.max(o.y,s.y,c.y,l.y)<=i||Math.min(o.y,s.y,c.y,l.y)>=a))return!1;let d=u*(s.y-o.y),f=u*(o.x-s.x),p=d*n+f*i,m=d*r+f*i,h=d*n+f*a,g=d*r+f*a;if(Math.max(p,m,h,g)<=d*o.x+f*o.y||Math.min(p,m,h,g)>=d*l.x+f*l.y)return!1;let _=u*(o.y-c.y),v=u*(c.x-o.x),y=_*n+v*i,b=_*r+v*i,x=_*n+v*a,S=_*r+v*a;return!(Math.max(y,b,x,S)<=_*o.x+v*o.y||Math.min(y,b,x,S)>=_*l.x+v*l.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this}ceil(e=1,t=.001){let n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this}enlarge(e){let t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this}};Io.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};var Lo=class e{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.radius=n,this.type=No.CIRC}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}getBounds(){return new Io(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}};Lo.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};var Ro=class e{constructor(e=0,t=0,n=0,r=0){this.x=e,this.y=t,this.width=n,this.height=r,this.type=No.ELIP}clone(){return new e(this.x,this.y,this.width,this.height)}contains(e,t){if(this.width<=0||this.height<=0)return!1;let n=(e-this.x)/this.width,r=(t-this.y)/this.height;return n*=n,r*=r,n+r<=1}getBounds(){return new Io(this.x-this.width,this.y-this.height,this.width,this.height)}};Ro.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};var zo=class e{constructor(...e){let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.type=No.POLY,this.closeStroke=!0}clone(){let t=this.points.slice(),n=new e(t);return n.closeStroke=this.closeStroke,n}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}};zo.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((e,t)=>
13`${e}, ${t}`,``)}]`};var Bo=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i,this.type=No.RREC}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}};Bo.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};var Vo=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a,this}toArray(e,t){this.array||=new Float32Array(9);let n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(e,t){t||=new Po;let n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t}applyInverse(e,t){t||=new Po;let n=1/(this.a*this.d+this.c*-this.b),r=e.x,i=e.y;return t.x=this.d*n*r+-this.c*n*i+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*i+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,a=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=a*t-this.ty*n,this.ty=a*n+this.ty*t,this}append(e){let t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this}setTransform(e,t,n,r,i,a,o,s,c){return this.a=Math.cos(o+c)*i,this.b=Math.sin(o+c)*i,this.c=-Math.sin(o-s)*a,this.d=Math.cos(o-s)*a,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let t=this.a,n=this.c;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,o=-Math.atan2(-r,i),s=Math.atan2(n,t),c=Math.abs(o+s);return c<1e-5||Math.abs(Ao-c)<1e-5?(e.rotation=s,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=s),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e}invert(){let e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,a=e*r-t*n;return this.a=r/a,this.b=-t/a,this.c=-n/a,this.d=e/a,this.tx=(n*this.ty-r*i)/a,this.ty=-(e*this.ty-t*i)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let t=new e;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(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new e}static get TEMP_MATRIX(){return new e}};Vo.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};var Ho=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Uo=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Wo=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Go=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ko=[],qo=[],Jo=Math.sign;function Yo(){for(let e=0;e<16;e++){let t=[];Ko.push(t);for(let n=0;n<16;n++){let r=Jo(Ho[e]*Ho[n]+Wo[e]*Uo[n]),i=Jo(Uo[e]*Ho[n]+Go[e]*Uo[n]),a=Jo(Ho[e]*Wo[n]+Wo[e]*Go[n]),o=Jo(Uo[e]*Wo[n]+Go[e]*Go[n]);for(let e=0;e<16;e++)if(Ho[e]===r&&Uo[e]===i&&Wo[e]===a&&Go[e]===o){t.push(e);break}}}for(let e=0;e<16;e++){let t=new Vo;t.set(Ho[e],Uo[e],Wo[e],Go[e],0,0),qo.push(t)}}Yo();var Xo={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:e=>Ho[e],uY:e=>Uo[e],vX:e=>Wo[e],vY:e=>Go[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Ko[e][t],sub:(e,t)=>Ko[e][Xo.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)==2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Xo.S:Xo.N:Math.abs(t)*2<=Math.abs(e)?e>0?Xo.E:Xo.W:t>0?e>0?Xo.SE:Xo.SW:e>0?Xo.NE:Xo.NW,matrixAppendRotationInv:(e,t,n=0,r=0)=>{let i=qo[Xo.inv(t)];i.tx=n,i.ty=r,e.append(i)}},Zo=class e{constructor(e,t,n=0,r=0){this._x=n,this._y=r,this.cb=e,this.scope=t}clone(t=this.cb,n=this.scope){return new e(t,n,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this}
13copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}};Zo.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};var Qo=class{constructor(){this.worldTransform=new Vo,this.localTransform=new Vo,this.position=new Zo(this.onChange,this,0,0),this.scale=new Zo(this.onChange,this,1,1),this.pivot=new Zo(this.onChange,this,0,0),this.skew=new Zo(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){let e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(e){let t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){let n=e.worldTransform,r=this.worldTransform;r.a=t.a*n.a+t.b*n.c,r.b=t.a*n.b+t.b*n.d,r.c=t.c*n.a+t.d*n.c,r.d=t.c*n.b+t.d*n.d,r.tx=t.tx*n.a+t.ty*n.c+n.tx,r.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}}setFromMatrix(e){e.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())}};Qo.IDENTITY=new Qo;var $o=Qo;$o.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var es=`varying vec2 vTextureCoord;
14
15uniform sampler2D uSampler;
16
17void main(void){
18   gl_FragColor *= texture2D(uSampler, vTextureCoord);
19}`,ts=`attribute vec2 aVertexPosition;
20attribute vec2 aTextureCoord;
21
22uniform mat3 projectionMatrix;
23
24varying vec2 vTextureCoord;
25
26void main(void){
27   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
27)).xy, 0.0, 1.0);
28   vTextureCoord = aTextureCoord;
29}
30`;function ns(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function rs(e){let t=Array(e);for(let e=0;e<t.length;e++)t[e]=!1;return t}function is(e,t){switch(e){case`float`:return 0;case`vec2`:return new Float32Array(2*t);case`vec3`:return new Float32Array(3*t);case`vec4`:return new Float32Array(4*t);case`int`:case`uint`:case`sampler2D`:case`sampler2DArray`:return 0;case`ivec2`:return new Int32Array(2*t);case`ivec3`:return new Int32Array(3*t);case`ivec4`:return new Int32Array(4*t);case`uvec2`:return new Uint32Array(2*t);case`uvec3`:return new Uint32Array(3*t);case`uvec4`:return new Uint32Array(4*t);case`bool`:return!1;case`bvec2`:return rs(2*t);case`bvec3`:return rs(3*t);case`bvec4`:return rs(4*t);case`mat2`:return new Float32Array([1,0,0,1]);case`mat3`:return new Float32Array([1,0,0,0,1,0,0,0,1]);case`mat4`:return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var as=[{test:e=>e.type===`float`&&e.size===1&&!e.isArray,code:e=>`
31            if(uv["${e}"] !== ud["${e}"].value)
32            {
33                ud["${e}"].value = uv["${e}"]
34                gl.uniform1f(ud["${e}"].location, uv["${e}"])
35            }
36            `},{test:(e,t)=>(e.type===`sampler2D`||e.type===`samplerCube`||e.type===`sampler2DArray`)&&e.size===1&&!e.isArray&&(t==null||t.castToBaseTexture!==void 0),code:e=>`t = syncData.textureCount++;
37
38            renderer.texture.bind(uv["${e}"], t);
39
40            if(ud["${e}"].value !== t)
41            {
42                ud["${e}"].value = t;
43                gl.uniform1i(ud["${e}"].location, t);
44; // eslint-disable-line max-len
45            }`},{test:(e,t)=>e.type===`mat3`&&e.size===1&&!e.isArray&&t.a!==void 0,code:e=>`
46            gl.uniformMatrix3fv(ud["${e}"].location, false, uv["${e}"].toArray(true));
47            `,codeUbo:e=>`
48                var ${e}_matrix = uv.${e}.toArray(true);
49
50                data[offset] = ${e}_matrix[0];
51                data[offset+1] = ${e}_matrix[1];
52                data[offset+2] = ${e}_matrix[2];
53        
54                data[offset + 4] = ${e}_matrix[3];
55                data[offset + 5] = ${e}_matrix[4];
56                data[offset + 6] = ${e}_matrix[5];
57        
58                data[offset + 8] = ${e}_matrix[6];
59                data[offset + 9] = ${e}_matrix[7];
60                data[offset + 10] = ${e}_matrix[8];
61            `},{test:(e,t)=>e.type===`vec2`&&e.size===1&&!e.isArray&&t.x!==void 0,code:e=>`
62                cv = ud["${e}"].value;
63                v = uv["${e}"];
64
65                if(cv[0] !== v.x || cv[1] !== v.y)
66                {
67                    cv[0] = v.x;
68                    cv[1] = v.y;
69                    gl.uniform2f(ud["${e}"].location, v.x, v.y);
70                }`,codeUbo:e=>`
71                v = uv.${e};
72
73                data[offset] = v.x;
74                data[offset+1] = v.y;
75            `},{test:e=>e.type===`vec2`&&e.size===1&&!e.isArray,code:e=>`
76                cv = ud["${e}"].value;
77                v = uv["${e}"];
78
79                if(cv[0] !== v[0] || cv[1] !== v[1])
80                {
81                    cv[0] = v[0];
82                    cv[1] = v[1];
83                    gl.uniform2f(ud["${e}"].location, v[0], v[1]);
84                }
85            `},{test:(e,t)=>e.type===`vec4`&&e.size===1&&!e.isArray&&t.width!==void 0,code:e=>`
86                cv = ud["${e}"].value;
87                v = uv["${e}"];
88
89                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
90                {
91                    cv[0] = v.x;
92                    cv[1] = v.y;
93                    cv[2] = v.width;
94                    cv[3] = v.height;
95                    gl.uniform4f(ud["${e}"].location, v.x, v.y, v.width, v.height)
96                }`,codeUbo:e=>`
97                    v = uv.${e};
98
99                    data[offset] = v.x;
100                    data[offset+1] = v.y;
101                    data[offset+2] = v.width;
102                    data[offset+3] = v.height;
103                `},{test:(e,t)=>e.type===`vec4`&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>`
104                cv = ud["${e}"].value;
105                v = uv["${e}"];
106
107                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)
108                {
109                    cv[0] = v.red;
110                    cv[1] = v.green;
111                    cv[2] = v.blue;
112                    cv[3] = v.alpha;
113                    gl.uniform4f(ud["${e}"].location, v.red, v.green, v.blue, v.alpha)
114                }`,codeUbo:e=>`
115                    v = uv.${e};
116
117                    data[offset] = v.red;
118                    data[offset+1] = v.green;
119                    data[offset+2] = v.blue;
120                    data[offset+3] = v.alpha;
121                `},{test:(e,t)=>
121e.type===`vec3`&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>`
122                cv = ud["${e}"].value;
123                v = uv["${e}"];
124
125                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)
126                {
127                    cv[0] = v.red;
128                    cv[1] = v.green;
129                    cv[2] = v.blue;
130    
131                    gl.uniform3f(ud["${e}"].location, v.red, v.green, v.blue)
132                }`,codeUbo:e=>`
133                    v = uv.${e};
134
135                    data[offset] = v.red;
136                    data[offset+1] = v.green;
137                    data[offset+2] = v.blue;
138                `},{test:e=>e.type===`vec4`&&e.size===1&&!e.isArray,code:e=>`
139                cv = ud["${e}"].value;
140                v = uv["${e}"];
141
142                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
143                {
144                    cv[0] = v[0];
145                    cv[1] = v[1];
146                    cv[2] = v[2];
147                    cv[3] = v[3];
148
149                    gl.uniform4f(ud["${e}"].location, v[0], v[1], v[2], v[3])
150                }`}],os={float:`
151    if (cv !== v)
152    {
153        cu.value = v;
154        gl.uniform1f(location, v);
155    }`,vec2:`
156    if (cv[0] !== v[0] || cv[1] !== v[1])
157    {
158        cv[0] = v[0];
159        cv[1] = v[1];
160
161        gl.uniform2f(location, v[0], v[1])
162    }`,vec3:`
163    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
164    {
165        cv[0] = v[0];
166        cv[1] = v[1];
167        cv[2] = v[2];
168
169        gl.uniform3f(location, v[0], v[1], v[2])
170    }`,vec4:`
171    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
172    {
173        cv[0] = v[0];
174        cv[1] = v[1];
175        cv[2] = v[2];
176        cv[3] = v[3];
177
178        gl.uniform4f(location, v[0], v[1], v[2], v[3]);
179    }`,int:`
180    if (cv !== v)
181    {
182        cu.value = v;
183
184        gl.uniform1i(location, v);
185    }`,ivec2:`
186    if (cv[0] !== v[0] || cv[1] !== v[1])
187    {
188        cv[0] = v[0];
189        cv[1] = v[1];
190
191        gl.uniform2i(location, v[0], v[1]);
192    }`,ivec3:`
193    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
194    {
195        cv[0] = v[0];
196        cv[1] = v[1];
197        cv[2] = v[2];
198
199        gl.uniform3i(location, v[0], v[1], v[2]);
200    }`,ivec4:`
201    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
202    {
203        cv[0] = v[0];
204        cv[1] = v[1];
205        cv[2] = v[2];
206        cv[3] = v[3];
207
208        gl.uniform4i(location, v[0], v[1], v[2], v[3]);
209    }`,uint:`
210    if (cv !== v)
211    {
212        cu.value = v;
213
214        gl.uniform1ui(location, v);
215    }`,uvec2:`
216    if (cv[0] !== v[0] || cv[1] !== v[1])
217    {
218        cv[0] = v[0];
219        cv[1] = v[1];
220
221        gl.uniform2ui(location, v[0], v[1]);
222    }`,uvec3:`
223    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
224    {
225        cv[0] = v[0];
226        cv[1] = v[1];
227        cv[2] = v[2];
228
229        gl.uniform3ui(location, v[0], v[1], v[2]);
230    }`,uvec4:`
231    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
232    {
233        cv[0] = v[0];
234        cv[1] = v[1];
235        cv[2] = v[2];
236        cv[3] = v[3];
237
238        gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
239    }`,bool:`
240    if (cv !== v)
241    {
242        cu.value = v;
243        gl.uniform1i(location, v);
244    }`,bvec2:`
245    if (cv[0] != v[0] || cv[1] != v[1])
246    {
247        cv[0] = v[0];
248        cv[1] = v[1];
249
250        gl.uniform2i(location, v[0], v[1]);
251    }`,bvec3:`
252    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
253    {
254        cv[0] = v[0];
255        cv[1] = v[1];
256        cv[2] = v[2];
257
258        gl.uniform3i(location, v[0], v[1], v[2]);
259    }`,bvec4:`
260    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
261    {
262        cv[0] = v[0];
263        cv[1] = v[1];
264        cv[2] = v[2];
265        cv[3] = v[3];
266
267        gl.uniform4i(location, v[0], v[1], v[2], v[3]);
268    }`,mat2:`gl.uniformMatrix2fv(location, false, v)`,mat3:`gl.uniformMatrix3fv(location, false, v)`,mat4:`gl.uniformMatrix4fv(location, false, v)`,sampler2D:`
269    if (cv !== v)
270    {
271        cu.value = v;
272
273        gl.uniform1i(location, v);
274    }`,samplerCube:`
275    if (cv !== v)
276    {
277        cu.value = v;
278
279        gl.uniform1i(location, v);
280    }`,sampler2DArray:`
281    if (cv !== v)
282    {
283        cu.value = v;
284
285        gl.uniform1i(location, v);
286    }`},ss={float:`gl.uniform1fv(location, v)`,vec2:`gl.uniform2fv(location, v)`,vec3:`gl.uniform3fv(location, v)`,vec4:`gl.uniform4fv(location, v)`,mat4:`gl.uniformMatrix4fv(location, false, v)`,mat3:`gl.uniformMatrix3fv(location, false, v)`,mat2:`gl.uniformMatrix2fv(location, false, v)`,int:`gl.uniform1iv(location, v)`,ivec2:`gl.uniform2iv(location, v)`,ivec3:`gl.uniform3iv(location, v)`,ivec4:`gl.uniform4iv(location, v)`,uint:`gl.uniform1uiv(location, v)`,uvec2:`gl.uniform2uiv(location, v)`,uvec3:`gl.uniform3uiv(location, v)`,uvec4:`gl.uniform4uiv(location, v)`,bool:`gl.uniform1iv(location, v)`,bvec2:`gl.uniform2iv(location, v)`,bvec3:`gl.uniform3iv(location, v)`,bvec4:`gl.uniform4iv(location, v)`,sampler2D:`gl.uniform1iv(location, v)`,samplerCube:`gl.uniform1iv(location, v)`,sampler2DArray:`gl.uniform1iv(location, v)`};function cs(e,t){let n=[`
287        var v = null;
288        var cv = null;
289        var cu = null;
290        var t = 0;
291        var gl = renderer.gl;
292    `];for(let r in e.uniforms){let i=t[r];
292if(!i){e.uniforms[r]?.group===!0&&(e.uniforms[r].ubo?n.push(`
293                        renderer.shader.syncUniformBufferGroup(uv.${r}, '${r}');
294                    `):n.push(`
295                        renderer.shader.syncUniformGroup(uv.${r}, syncData);
296                    `));continue}let a=e.uniforms[r],o=!1;for(let e=0;e<as.length;e++)if(as[e].test(i,a)){n.push(as[e].code(r,a)),o=!0;break}if(!o){let e=(i.size===1&&!i.isArray?os:ss)[i.type].replace(`location`,`ud["${r}"].location`);n.push(`
297            cu = ud["${r}"];
298            cv = cu.value;
299            v = uv["${r}"];
300            ${e};`)}}return Function(`ud`,`uv`,`renderer`,`syncData`,n.join(`
301`))}var ls={},us=ls;function ds(){if(us===ls||us?.isContextLost()){let e=W.ADAPTER.createCanvas(),t;W.PREFER_ENV>=er.WEBGL2&&(t=e.getContext(`webgl2`,{})),t||(t=e.getContext(`webgl`,{})||e.getContext(`experimental-webgl`,{}),t?t.getExtension(`WEBGL_draw_buffers`):t=null),us=t}return us}var fs;function ps(){if(!fs){fs=pr.MEDIUM;let e=ds();if(e&&e.getShaderPrecisionFormat){let t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);t&&(fs=t.precision?pr.HIGH:pr.MEDIUM)}}return fs}function ms(e,t){let n=e.getShaderSource(t).split(`
302`).map((e,t)=>`${t}: ${e}`),r=e.getShaderInfoLog(t),i=r.split(`
303`),a={},o=i.map(e=>parseFloat(e.replace(/^ERROR\: 0\:([\d]+)\:.*$/,`$1`))).filter(e=>e&&!a[e]?(a[e]=!0,!0):!1),s=[``];o.forEach(e=>{n[e-1]=`%c${n[e-1]}%c`,s.push(`background: #FF0000; color:#FFFFFF; font-size: 10px`,`font-size: 10px`)}),s[0]=n.join(`
304`),console.error(r),console.groupCollapsed(`click to view full shader code`),console.warn(...s),console.groupEnd()}function hs(e,t,n,r){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(n,e.COMPILE_STATUS)||ms(e,n),e.getShaderParameter(r,e.COMPILE_STATUS)||ms(e,r),console.error(`PixiJS Error: Could not initialize shader.`),e.getProgramInfoLog(t)!==``&&console.warn(`PixiJS Warning: gl.getProgramInfoLog()`,e.getProgramInfoLog(t)))}var gs={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function _s(e){return gs[e]}var vs=null,ys={FLOAT:`float`,FLOAT_VEC2:`vec2`,FLOAT_VEC3:`vec3`,FLOAT_VEC4:`vec4`,INT:`int`,INT_VEC2:`ivec2`,INT_VEC3:`ivec3`,INT_VEC4:`ivec4`,UNSIGNED_INT:`uint`,UNSIGNED_INT_VEC2:`uvec2`,UNSIGNED_INT_VEC3:`uvec3`,UNSIGNED_INT_VEC4:`uvec4`,BOOL:`bool`,BOOL_VEC2:`bvec2`,BOOL_VEC3:`bvec3`,BOOL_VEC4:`bvec4`,FLOAT_MAT2:`mat2`,FLOAT_MAT3:`mat3`,FLOAT_MAT4:`mat4`,SAMPLER_2D:`sampler2D`,INT_SAMPLER_2D:`sampler2D`,UNSIGNED_INT_SAMPLER_2D:`sampler2D`,SAMPLER_CUBE:`samplerCube`,INT_SAMPLER_CUBE:`samplerCube`,UNSIGNED_INT_SAMPLER_CUBE:`samplerCube`,SAMPLER_2D_ARRAY:`sampler2DArray`,INT_SAMPLER_2D_ARRAY:`sampler2DArray`,UNSIGNED_INT_SAMPLER_2D_ARRAY:`sampler2DArray`};function bs(e,t){if(!vs){let t=Object.keys(ys);vs={};for(let n=0;n<t.length;++n){let r=t[n];vs[e[r]]=ys[r]}}return vs[t]}function xs(e,t,n){if(e.substring(0,9)!==`precision`){let r=t;return t===pr.HIGH&&n!==pr.HIGH&&(r=pr.MEDIUM),`precision ${r} float;
305${e}`}else if(n!==pr.HIGH&&e.substring(0,15)===`precision highp`)return e.replace(`precision highp`,`precision mediump`);return e}var Ss;function Cs(){if(typeof Ss==`boolean`)return Ss;try{Ss=Function(`param1`,`param2`,`param3`,`return param1[param2] === param3;`)({a:`b`},`a`,`b`)===!0}catch{Ss=!1}return Ss}var ws=0,Ts={},Es=class e{constructor(t,n,r=`pixi-shader`,i={}){this.extra={},this.id=ws++,this.vertexSrc=t||e.defaultVertexSrc,this.fragmentSrc=n||e.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=i,this.vertexSrc.substring(0,8)!==`#version`&&(r=r.replace(/\s+/g,`-`),Ts[r]?(Ts[r]++,r+=`-${Ts[r]}`):Ts[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
306${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${r}
307${this.fragmentSrc}`,this.vertexSrc=xs(this.vertexSrc,e.defaultVertexPrecision,pr.HIGH),this.fragmentSrc=xs(this.fragmentSrc,e.defaultFragmentPrecision,ps())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return ts}static get defaultFragmentSrc(){return es}static from(t,n,r){let i=t+n,a=Ba[i];return a||(Ba[i]=a=new e(t,n,r)),a}};Es.defaultVertexPrecision=pr.HIGH,Es.defaultFragmentPrecision=Fr.apple.device?pr.HIGH:pr.MEDIUM;var Ds=Es,Os=0,ks=class e{constructor(e,t,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Os++,this.static=!!t,this.ubo=!!n,e instanceof xo?(this.buffer=e,this.buffer.type=gr.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new xo(new Float32Array(1)),this.buffer.type=gr.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update(
307)}add(t,n,r){if(!this.ubo)this.uniforms[t]=new e(n,r);else throw Error(`[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them`)}static from(t,n,r){return new e(t,n,r)}static uboFrom(t,n){return new e(t,n??!0,!0)}},As=class e{constructor(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof ks?this.uniformGroup=t:this.uniformGroup=new ks(t):this.uniformGroup=new ks({}),this.disposeRunner=new po(`disposeShader`)}checkUniformExists(e,t){if(t.uniforms[e])return!0;for(let n in t.uniforms){let r=t.uniforms[n];if(r.group===!0&&this.checkUniformExists(e,r))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,n,r){let i=Ds.from(t,n);return new e(i,r)}},js=class{constructor(e,t){if(this.vertexSrc=e,this.fragTemplate=t,this.programCache={},this.defaultGroupCache={},!t.includes(`%count%`))throw Error(`Fragment template must contain "%count%".`);if(!t.includes(`%forloop%`))throw Error(`Fragment template must contain "%forloop%".`)}generateShader(e){if(!this.programCache[e]){let t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=n;this.defaultGroupCache[e]=ks.from({uSamplers:t},!0);let n=this.fragTemplate;n=n.replace(/%count%/gi,`${e}`),n=n.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new Ds(this.vertexSrc,n)}let t={tint:new Float32Array([1,1,1,1]),translationMatrix:new Vo,default:this.defaultGroupCache[e]};return new As(this.programCache[e],t)}generateSampleSrc(e){let t=``;t+=`
308`,t+=`
309`;for(let n=0;n<e;n++)n>0&&(t+=`
310else `),n<e-1&&(t+=`if(vTextureId < ${n}.5)`),t+=`
311{`,t+=`
312	color = texture2D(uSamplers[${n}], vTextureCoord);`,t+=`
313}`;return t+=`
314`,t+=`
315`,t}},Ms=class{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let e=0;e<this.count;e++)this.elements[e]=null;this.count=0}};function Ns(){return!Fr.apple.device}function Ps(e){let t=!0,n=W.ADAPTER.getNavigator();if(Fr.tablet||Fr.phone){if(Fr.apple.device){let e=n.userAgent.match(/OS (\d+)_(\d+)?/);e&&parseInt(e[1],10)<11&&(t=!1)}if(Fr.android.device){let e=n.userAgent.match(/Android\s([0-9.]*)/);e&&parseInt(e[1],10)<7&&(t=!1)}}return t?e:4}var Fs=class{constructor(e){this.renderer=e}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(e){}},Is=`varying vec2 vTextureCoord;
316varying vec4 vColor;
317varying float vTextureId;
318uniform sampler2D uSamplers[%count%];
319
320void main(void){
321    vec4 color;
322    %forloop%
323    gl_FragColor = color * vColor;
324}
325`,Ls=`precision highp float;
326attribute vec2 aVertexPosition;
327attribute vec2 aTextureCoord;
328attribute vec4 aColor;
329attribute float aTextureId;
330
331uniform mat3 projectionMatrix;
332uniform mat3 translationMatrix;
333uniform vec4 tint;
334
335varying vec2 vTextureCoord;
336varying vec4 vColor;
337varying float vTextureId;
338
339void main(void){
340    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
340)).xy, 0.0, 1.0);
341
342    vTextureCoord = aTextureCoord;
343    vTextureId = aTextureId;
344    vColor = aColor * tint;
345}
346`,Rs=class e extends Fs{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=ko,this.vertexSize=6,this.state=lo.for2d(),this.size=e.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on(`prerender`,this.onPrerender,this),t.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??Ps(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??Ns(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return Fi(`7.1.0`,`BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures`),this.maxTextures}static get defaultVertexSrc(){return Ls}static get defaultFragmentTemplate(){return Is}setShaderGenerator({vertex:t=e.defaultVertexSrc,fragment:n=e.defaultFragmentTemplate}={}){this.shaderGenerator=new js(t,n)}contextChange(){let t=this.renderer.gl;W.PREFER_ENV===er.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),e.defaultMaxTextures),this.maxTextures=no(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){let{_drawCallPool:t,_textureArrayPool:n}=e,r=this.size/4,i=Math.floor(r/this.maxTextures)+1;for(;t.length<r;)t.push(new yo);for(;n.length<i;)n.push(new Ms);for(let e=0;e<this.maxTextures;e++)this._tempBoundTextures[e]=null}onPrerender(){this._flushId=0}render(e){e._texture.valid&&(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){let{_bufferedTextures:t,maxTextures:n}=this,r=e._textureArrayPool,i=this.renderer.batch,a=this._tempBoundTextures,o=this.renderer.textureGC.count,s=++vo._globalBatch,c=0,l=r[0],u=0;i.copyBoundTextures(a,n);for(let e=0;e<this._bufferSize;++e){let d=t[e];t[e]=null,d._batchEnabled!==s&&(l.count>=n&&(i.boundArray(l,a,s,n),this.buildDrawCalls(l,u,e),u=e,l=r[++c],++s),d._batchEnabled=s,d.touched=o,l.elements[l.count++]=d)}l.count>0&&(i.boundArray(l,a,s,n),this.buildDrawCalls(l,u,this._bufferSize),++c,++s);for(let e=0;e<a.length;e++)a[e]=null;vo._globalBatch=s}buildDrawCalls(t,n,r){let{_bufferedElements:i,_attributeBuffer:a,_indexBuffer:o,vertexSize:s}=this,c=e._drawCallPool,l=this._dcIndex,u=this._aIndex,d=this._iIndex,f=c[l];f.start=this._iIndex,f.texArray=t;for(let e=n;e<r;++e){let r=i[e],p=Da[+!!r._texture.baseTexture.alphaMode][r.blendMode];i[e]=null,n<e&&f.blend!==p&&(f.size=d-f.start,n=e,f=c[++l],f.texArray=t,f.start=d),this.packInterleavedGeometry(r,a,o,u,d),u+=r.vertexData.length/2*s,d+=r.indices.length,f.blend=p}n<r&&(f.size=d-f.start,++l),this._dcIndex=l,this._aIndex=u,this._iIndex=d}bindAndClearTexArray(e){let t=this.renderer.texture;for(let n=0;n<e.count;n++)t.bind(e.elements[n],e.ids[n]),e.elements[n]=null;e.count=0}updateGeometry(){let{_packedGeometries:t,_attributeBuffer:n,_indexBuffer:r}=this;e.canUploadSameBuffer?(t[this._flushId]._buffer.update(n.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(n.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){let t=this._dcIndex,{gl:n,state:r}=this.renderer,i=e._drawCallPool,a=null;for(let e=0;e<t;e++){let{texArray:t,type:o,size:s,start:c,blend:l}=i[e];a!==t&&(a=t,this.bindAndClearTexArray(t)),this.state.blendMode=l,r.set(this.state),n.drawElements(o,s,n.UNSIGNED_SHORT,c*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),e.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off(`prerender`,this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&=(this._shader.destroy(),null),super.destroy()}getAttributeBuffer(e){let t=ja(Math.ceil(e/8)),n=Na(t),r=t*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);let i=this._aBuffers[r];
346return i||(this._aBuffers[r]=i=new $a(r*this.vertexSize*4)),i}getIndexBuffer(e){let t=ja(Math.ceil(e/12)),n=Na(t),r=t*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);let i=this._iBuffers[n];return i||(this._iBuffers[n]=i=new Uint16Array(r)),i}packInterleavedGeometry(e,t,n,r,i){let{uint32View:a,float32View:o}=t,s=r/this.vertexSize,c=e.uvs,l=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=Ca.shared.setValue(e._tintRGB).toPremultiplied(f,e._texture.baseTexture.alphaMode>0);for(let e=0;e<u.length;e+=2)o[r++]=u[e],o[r++]=u[e+1],o[r++]=c[e],o[r++]=c[e+1],a[r++]=p,o[r++]=d;for(let e=0;e<l.length;e++)n[i++]=s+l[e]}};Rs.defaultBatchSize=4096,Rs.extension={name:`batch`,type:G.RendererPlugin},Rs._drawCallPool=[],Rs._textureArrayPool=[];var zs=Rs;Qa.add(zs);var Bs=`varying vec2 vTextureCoord;
347
348uniform sampler2D uSampler;
349
350void main(void){
351   gl_FragColor = texture2D(uSampler, vTextureCoord);
352}
353`,Vs=`attribute vec2 aVertexPosition;
354
355uniform mat3 projectionMatrix;
356
357varying vec2 vTextureCoord;
358
359uniform vec4 inputSize;
360uniform vec4 outputFrame;
361
362vec4 filterVertexPosition( void )
363{
364    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
365
366    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
367}
368
369vec2 filterTextureCoord( void )
370{
371    return aVertexPosition * (outputFrame.zw * inputSize.zw);
372}
373
374void main(void)
375{
376    gl_Position = filterVertexPosition();
377    vTextureCoord = filterTextureCoord();
378}
379`,Hs=class e extends As{constructor(t,n,r){let i=Ds.from(t||e.defaultVertexSrc,n||e.defaultFragmentSrc);super(i,r),this.padding=0,this.resolution=e.defaultResolution,this.multisample=e.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new lo}apply(e,t,n,r,i){e.applyFilter(this,t,n,r)}get blendMode(){return this.state.blendMode}set blendMode(e){this.state.blendMode=e}get resolution(){return this._resolution}set resolution(e){this._resolution=e}static get defaultVertexSrc(){return Vs}static get defaultFragmentSrc(){return Bs}};Hs.defaultResolution=1,Hs.defaultMultisample=hr.NONE;var Us=Hs,Ws=class{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Ca(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;let{backgroundColor:t,background:n,backgroundAlpha:r}=e,i=n??t;i!==void 0&&(this.color=i),this.alpha=r}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}};Ws.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Ws.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:`background`},Qa.add(Ws);var Gs=class{constructor(e){this.renderer=e,this.emptyRenderer=new Fs(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,t){let{boundTextures:n}=this.renderer.texture;for(let r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)}boundArray(e,t,n,r){let{elements:i,ids:a,count:o}=e,s=0;for(let e=0;e<o;e++){let o=i[e],c=o._batchLocation;if(c>=0&&c<r&&t[c]===o){a[e]=c;continue}for(;s<r;){let r=t[s];if(r&&r._batchEnabled===n&&r._batchLocation===s){s++;continue}a[e]=s,o._batchLocation=s,t[s]=o;break}}}destroy(){this.renderer=null}};Gs.extension={type:G.RendererSystem,name:`batch`},Qa.add(Gs);var Ks=0,qs=class{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Ks++}init(e){if(e.context)this.initFromContext(e.context);else{let t=this.renderer.background.alpha<1,n=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlp
379ha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:t,premultipliedAlpha:n,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Ks++,this.renderer.runners.contextChange.emit(e);let t=this.renderer.view;t.addEventListener!==void 0&&(t.addEventListener(`webglcontextlost`,this.handleContextLost,!1),t.addEventListener(`webglcontextrestored`,this.handleContextRestored,!1))}initFromOptions(e){let t=this.createContext(this.renderer.view,e);this.initFromContext(t)}createContext(e,t){let n;if(W.PREFER_ENV>=er.WEBGL2&&(n=e.getContext(`webgl2`,t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext(`webgl`,t)||e.getContext(`experimental-webgl`,t),!n)throw Error(`This browser does not support WebGL. Try using the canvas renderer`);return this.gl=n,this.getExtensions(),this.gl}getExtensions(){let{gl:e}=this,t={loseContext:e.getExtension(`WEBGL_lose_context`),anisotropicFiltering:e.getExtension(`EXT_texture_filter_anisotropic`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),s3tc:e.getExtension(`WEBGL_compressed_texture_s3tc`),s3tc_sRGB:e.getExtension(`WEBGL_compressed_texture_s3tc_srgb`),etc:e.getExtension(`WEBGL_compressed_texture_etc`),etc1:e.getExtension(`WEBGL_compressed_texture_etc1`),pvrtc:e.getExtension(`WEBGL_compressed_texture_pvrtc`)||e.getExtension(`WEBKIT_WEBGL_compressed_texture_pvrtc`),atc:e.getExtension(`WEBGL_compressed_texture_atc`),astc:e.getExtension(`WEBGL_compressed_texture_astc`),bptc:e.getExtension(`EXT_texture_compression_bptc`)};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension(`WEBGL_draw_buffers`),depthTexture:e.getExtension(`WEBGL_depth_texture`),vertexArrayObject:e.getExtension(`OES_vertex_array_object`)||e.getExtension(`MOZ_OES_vertex_array_object`)||e.getExtension(`WEBKIT_OES_vertex_array_object`),uint32ElementIndex:e.getExtension(`OES_element_index_uint`),floatTexture:e.getExtension(`OES_texture_float`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),textureHalfFloat:e.getExtension(`OES_texture_half_float`),textureHalfFloatLinear:e.getExtension(`OES_texture_half_float_linear`)}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension(`EXT_color_buffer_float`)})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){let e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener(`webglcontextlost`,this.handleContextLost),e.removeEventListener(`webglcontextrestored`,this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){let t=e.getContextAttributes(),n=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn(`Provided WebGL context does not have a stencil buffer, masks may not render correctly`);let r=n||!!e.getExtension(`OES_element_index_uint`);this.supports.uint32Indices=r,r||console.warn(`Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly`)}};qs.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:`default`},qs.extension={type:G.RendererSystem,name:`context`},Qa.add(qs);var Js=class{constructor(e,t){if(this.width=Math.round(e),this.height=Math.round(t),!this.width||!this.height)throw Error(`Framebuffer width or height is zero`);this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new po(`disposeFramebuffer`),this.multisample=hr.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new vo(null,{scaleMode:sr.NEAREST,resolution:1,mipmap:lr.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new vo(null,{scaleMode:sr.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:lr.OFF,format:H.DEPTH_COMPONENT,type:or.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,t){if(e=Math.round(e),t=Math.round(t),!e||!t)throw Error(`Framebuffer width and height must not be zero`);if(!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(let n=0;n<this.colorTextures.length;n++){let r=this.colorTextures[n],i=r.resolution;r.setSize(e/i,t/i)}if(this.depthTexture){let n=this.depthTexture.resolution;this.depthTexture.setSize(e/n,t/n)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}},Ys=class extends vo{constructor(e={}){typeof e==`number`&&(e={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),e.width=e.width??100,e.height=e.height??100,e.multisample??=hr.NONE,super(null,e),this.mipmap=lr.OFF,this.valid=!0,this._clear=new Ca([0,0,0,0]),this.framebuffer=new Js(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t){this.framebuffer.resize(e*this.resolution,t*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.he
379ight)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}},Xs=class extends mo{constructor(e){let t=e,n=t.naturalWidth||t.videoWidth||t.displayWidth||t.width,r=t.naturalHeight||t.videoHeight||t.displayHeight||t.height;super(n,r),this.source=e,this.noSubImage=!1}static crossOrigin(e,t,n){n===void 0&&!t.startsWith(`data:`)?e.crossOrigin=Ja(t):n!==!1&&(e.crossOrigin=typeof n==`string`?n:`anonymous`)}upload(e,t,n,r){let i=e.gl,a=t.realWidth,o=t.realHeight;if(r||=this.source,typeof HTMLImageElement<`u`&&r instanceof HTMLImageElement){if(!r.complete||r.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<`u`&&r instanceof HTMLVideoElement&&r.readyState<=1)return!1;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===ur.UNPACK),!this.noSubImage&&t.target===i.TEXTURE_2D&&n.width===a&&n.height===o?i.texSubImage2D(i.TEXTURE_2D,0,0,0,t.format,n.type,r):(n.width=a,n.height=o,i.texImage2D(t.target,0,n.internalFormat,t.format,n.type,r)),!0}update(){if(this.destroyed)return;let e=this.source,t=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(t,n),super.update()}dispose(){this.source=null}},Zs=class extends Xs{constructor(e,t){if(t||={},typeof e==`string`){let n=new Image;Xs.crossOrigin(n,e,t.crossorigin),n.src=e,e=n}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(t.createBitmap??W.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof t.alphaMode==`number`?t.alphaMode:null,this.bitmap=null,this._load=null,t.autoLoad!==!1&&this.load()}load(e){return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise((e,t)=>{let n=this.source;this.url=n.src;let r=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?e(this.process()):e(this))};n.complete&&n.src?r():(n.onload=r,n.onerror=e=>{t(e),this.onError.emit(e)})}),this._load)}process(){let e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);let t=globalThis.createImageBitmap,n=!e.crossOrigin||e.crossOrigin===`anonymous`;return this._process=fetch(e.src,{mode:n?`cors`:`no-cors`}).then(e=>e.blob()).then(n=>t(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===ur.UNPACK?`premultiply`:`none`})).then(e=>this.destroyed?Promise.reject():(this.bitmap=e,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,t,n){if(typeof this.alphaMode==`number`&&(t.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,t,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,t,n,this.bitmap),!this.preserveBitmap){let e=!0,r=t._glTextures;for(let i in r){let a=r[i];if(a!==n&&a.dirtyId!==t.dirtyId){e=!1;break}}e&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&=(this.bitmap.close(),null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<`u`&&(typeof e==`string`||e instanceof HTMLImageElement)}},Qs=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,n){let r=t.width,i=t.height;if(n){let t=e.width/2/r,a=e.height/2/i,o=e.x/r+t,s=e.y/i+a;n=Xo.add(n,Xo.NW),this.x0=o+t*Xo.uX(n),this.y0=s+a*Xo.uY(n),n=Xo.add(n,2),this.x1=o+t*Xo.uX(n),this.y1=s+a*Xo.uY(n),n=Xo.add(n,2),this.x2=o+t*Xo.uX(n),this.y2=s+a*Xo.uY(n),n=Xo.add(n,2),this.x3=o+t*Xo.uX(n),this.y3=s+a*Xo.uY(n)}else this.x0=e.x/r,this.y0=e.y/i,this.x1=(e.x+e.width)/r,this.y1=e.y/i,this.x2=(e.x+e.width)/r,this.y2=(e.y+e.height)/i,this.x3=e.x/r,this.y3=(e.y+e.height)/i;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}};Qs.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};var $s=new Qs;function ec(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}
379var K=class e extends Mi.default{constructor(t,n,r,i,a,o,s){if(super(),this.noFrame=!1,n||=(this.noFrame=!0,new Io(0,0,1,1)),t instanceof e&&(t=t.baseTexture),this.baseTexture=t,this._frame=n,this.trim=i,this.valid=!1,this.destroyed=!1,this._uvs=$s,this.uvMatrix=null,this.orig=r||n,this._rotate=Number(a||0),a===!0)this._rotate=2;else if(this._rotate%2!=0)throw Error(`attempt to use diamond-shaped UVs. If you are sure, set rotation manually`);this.defaultAnchor=o?new Po(o.x,o.y):new Po(0,0),this.defaultBorders=s,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=n:t.once(`loaded`,this.onBaseTextureUpdated,this),this.noFrame&&t.on(`update`,this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit(`update`,this)}destroy(t){if(this.baseTexture){if(t){let{resource:t}=this.baseTexture;t?.url&&Va[t.url]&&e.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off(`loaded`,this.onBaseTextureUpdated,this),this.baseTexture.off(`update`,this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit(`destroyed`,this),this.removeAllListeners()}clone(){let t=this._frame.clone(),n=this._frame===this.orig?t:this.orig.clone(),r=new e(this.baseTexture,!this.noFrame&&t,n,this.trim?.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(r._frame=t),r}updateUvs(){this._uvs===$s&&(this._uvs=new Qs),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,n={},r=W.STRICT_TEXTURE_CACHE){let i=typeof t==`string`,a=null;i?a=t:t instanceof vo?(t.cacheId||(t.cacheId=`${n?.pixiIdPrefix||`pixiid`}-${La()}`,vo.addToCache(t,t.cacheId)),a=t.cacheId):(t._pixiId||=`${n?.pixiIdPrefix||`pixiid`}_${La()}`,a=t._pixiId);let o=Va[a];if(i&&r&&!o)throw Error(`The cacheId "${a}" does not exist in TextureCache.`);return!o&&!(t instanceof vo)?(n.resolution||=Ya(t),o=new e(new vo(t,n)),o.baseTexture.cacheId=a,vo.addToCache(o.baseTexture,a),e.addToCache(o,a)):!o&&t instanceof vo&&(o=new e(t),e.addToCache(o,a)),o}static fromURL(t,n){let r=Object.assign({autoLoad:!1},n?.resourceOptions),i=e.from(t,Object.assign({resourceOptions:r},n),!1),a=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):a.load().then(()=>Promise.resolve(i))}static fromBuffer(t,n,r,i){return new e(vo.fromBuffer(t,n,r,i))}static fromLoader(t,n,r,i){let a=new vo(t,Object.assign({scaleMode:vo.defaultOptions.scaleMode,resolution:Ya(n)},i)),{resource:o}=a;o instanceof Zs&&(o.url=n);let s=new e(a);return r||=n,vo.addToCache(s.baseTexture,r),e.addToCache(s,r),r!==n&&(vo.addToCache(s.baseTexture,n),e.addToCache(s,n)),s.baseTexture.valid?Promise.resolve(s):new Promise(e=>{s.baseTexture.once(`loaded`,()=>e(s))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Va[t]&&Va[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),Va[t]=e)}static removeFromCache(e){if(typeof e==`string`){let t=Va[e];if(t){let n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete Va[e],t}}else if(e?.textureCacheIds){for(let t=0;t<e.textureCacheIds.length;++t)Va[e.textureCacheIds[t]]===e&&delete Va[e.textureCacheIds[t]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;let{x:t,y:n,width:r,height:i}=e,a=t+r>this.baseTexture.width,o=n+i>this.baseTexture.height;if(a||o){let e=a&&o?`and`:`or`,s=`X: ${t} + ${r} = ${t+r} > ${this.baseTexture.width}`,c=`Y: ${n} + ${i} = ${n+i} > ${this.baseTexture.height}`;throw Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${s} ${e} ${c}`)}this.valid=r&&i&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}
379static get EMPTY(){return e._EMPTY||(e._EMPTY=new e(new vo),ec(e._EMPTY),ec(e._EMPTY.baseTexture)),e._EMPTY}static get WHITE(){if(!e._WHITE){let t=W.ADAPTER.createCanvas(16,16),n=t.getContext(`2d`);t.width=16,t.height=16,n.fillStyle=`white`,n.fillRect(0,0,16,16),e._WHITE=new e(vo.from(t)),ec(e._WHITE),ec(e._WHITE.baseTexture)}return e._WHITE}},tc=class e extends K{constructor(e,t){super(e,t),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t,n=!0){let r=this.baseTexture.resolution,i=Math.round(e*r)/r,a=Math.round(t*r)/r;this.valid=i>0&&a>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(i,a),this.updateUvs()}setResolution(e){let{baseTexture:t}=this;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))}static create(t){return new e(new Ys(t))}},nc=class{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,n=hr.NONE){return new tc(new Ys(Object.assign({width:e,height:t,resolution:1,multisample:n},this.textureOptions)))}getOptimalTexture(e,t,n=1,r=hr.NONE){let i;e=Math.max(Math.ceil(e*n-1e-6),1),t=Math.max(Math.ceil(t*n-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=ja(e),t=ja(t),i=((e&65535)<<16|t&65535)>>>0,r>1&&(i+=r*4294967296)):i=r>1?-r:-1,this.texturePool[i]||(this.texturePool[i]=[]);let a=this.texturePool[i].pop();return a||=this.createTexture(e,t,r),a.filterPoolKey=i,a.setResolution(n),a}getFilterTexture(e,t,n){let r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||hr.NONE);return r.filterFrame=e.filterFrame,r}returnTexture(e){let t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(let e in this.texturePool){let t=this.texturePool[e];if(t)for(let e=0;e<t.length;e++)t[e].destroy(!0)}this.texturePool={}}setScreenSize(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(let e in this.texturePool){if(!(Number(e)<0))continue;let t=this.texturePool[e];if(t)for(let e=0;e<t.length;e++)t[e].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}};nc.SCREEN_KEY=-1;var rc=class extends Oo{constructor(){super(),this.addAttribute(`aVertexPosition`,new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}},ic=class extends Oo{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new xo(this.vertices),this.uvBuffer=new xo(this.uvs),this.addAttribute(`aVertexPosition`,this.vertexBuffer).addAttribute(`aTextureCoord`,this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,t){let n=0,r=0;return this.uvs[0]=n,this.uvs[1]=r,this.uvs[2]=n+t.width/e.width,this.uvs[3]=r,this.uvs[4]=n+t.width/e.width,this.uvs[5]=r+t.height/e.height,this.uvs[6]=n,this.uvs[7]=r+t.height/e.height,n=t.x,r=t.y,this.vertices[0]=n,this.vertices[1]=r,this.vertices[2]=n+t.width,this.vertices[3]=r,this.vertices[4]=n+t.width,this.vertices[5]=r+t.height,this.vertices[6]=n,this.vertices[7]=r+t.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}},ac=class{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=hr.NONE,this.sourceFrame=new Io,this.destinationFrame=new Io,this.bindingSourceFrame=new Io,this.bindingDestinationFrame=new Io,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}},oc=[new Po,new Po,new Po,new Po],sc=new Vo,cc=class{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new nc,this.statePool=[],this.quad=new rc,this.quadUv=new ic,this.tempRect=new Io,this.activeState={},this.globalUniforms=new ks({outputFrame:new Io,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}
379init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,t){let n=this.renderer,r=this.defaultFilterStack,i=this.statePool.pop()||new ac,a=n.renderTexture,o,s;if(a.current){let e=a.current;o=e.resolution,s=e.multisample}else o=n.resolution,s=n.multisample;let c=t[0].resolution||o,l=t[0].multisample??s,u=t[0].padding,d=t[0].autoFit,f=t[0].legacy??!0;for(let e=1;e<t.length;e++){let n=t[e];c=Math.min(c,n.resolution||o),l=Math.min(l,n.multisample??s),u=this.useMaxPadding?Math.max(u,n.padding):u+n.padding,d&&=n.autoFit,f||=n.legacy??!0}r.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),r.push(i),i.resolution=c,i.multisample=l,i.legacy=f,i.target=e,i.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),i.sourceFrame.pad(u);let p=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB(sc.copyFrom(n.projection.transform).invert(),p),d?(i.sourceFrame.fit(p),(i.sourceFrame.width<=0||i.sourceFrame.height<=0)&&(i.sourceFrame.width=0,i.sourceFrame.height=0)):i.sourceFrame.intersects(p)||(i.sourceFrame.width=0,i.sourceFrame.height=0),this.roundFrame(i.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),i.renderTexture=this.getOptimalFilterTexture(i.sourceFrame.width,i.sourceFrame.height,c,l),i.filters=t,i.destinationFrame.width=i.renderTexture.width,i.destinationFrame.height=i.renderTexture.height;let m=this.tempRect;m.x=0,m.y=0,m.width=i.sourceFrame.width,m.height=i.sourceFrame.height,i.renderTexture.filterFrame=i.sourceFrame,i.bindingSourceFrame.copyFrom(a.sourceFrame),i.bindingDestinationFrame.copyFrom(a.destinationFrame),i.transform=n.projection.transform,n.projection.transform=null,a.bind(i.renderTexture,i.sourceFrame,m),n.framebuffer.clear(0,0,0,0)}pop(){let e=this.defaultFilterStack,t=e.pop(),n=t.filters;this.activeState=t;let r=this.globalUniforms.uniforms;r.outputFrame=t.sourceFrame,r.resolution=t.resolution;let i=r.inputSize,a=r.inputPixel,o=r.inputClamp;if(i[0]=t.destinationFrame.width,i[1]=t.destinationFrame.height,i[2]=1/i[0],i[3]=1/i[1],a[0]=Math.round(i[0]*t.resolution),a[1]=Math.round(i[1]*t.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=t.sourceFrame.width*i[2]-.5*a[2],o[3]=t.sourceFrame.height*i[3]-.5*a[3],t.legacy){let e=r.filterArea;e[0]=t.destinationFrame.width,e[1]=t.destinationFrame.height,e[2]=t.sourceFrame.x,e[3]=t.sourceFrame.y,r.filterClamp=r.inputClamp}this.globalUniforms.update();let s=e[e.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,t.renderTexture,s.renderTexture,dr.BLEND,t),this.returnFilterTexture(t.renderTexture);else{let e=t.renderTexture,r=this.getOptimalFilterTexture(e.width,e.height,t.resolution);r.filterFrame=e.filterFrame;let i=0;for(i=0;i<n.length-1;++i){i===1&&t.multisample>1&&(r=this.getOptimalFilterTexture(e.width,e.height,t.resolution),r.filterFrame=e.filterFrame),n[i].apply(this,e,r,dr.CLEAR,t);let a=e;e=r,r=a}n[i].apply(this,e,s.renderTexture,dr.BLEND,t),i>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(e),this.returnFilterTexture(r)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=dr.CLEAR){let{renderTexture:n,state:r}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e?.filterFrame){let t=this.tempRect;t.x=0,t.y=0,t.width=e.filterFrame.width,t.height=e.filterFrame.height,n.bind(e,e.filterFrame,t)}else e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame):n.bind(e);let i=r.stateId&1||this.forceClear;(t===dr.CLEAR||t===dr.BLIT&&i)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,t,n,r){let i=this.renderer;i.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,i.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),i.geometry.bind(this.quadUv),i.geometry.draw(ir.TRIANGLES)):(i.geometry.bind(this.quad),i.geometry.draw(ir.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){let{sourceFrame:n,destinationFrame:r}=this.activeState,{orig:i}=t._texture,a=e.set(r.width,0,0,r.height,n.x,n.y),o=t.worldTransform.copyTo(Vo.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/i.width,1/i.height),a.translate(t.anchor.x,t.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,n=1,r=hr.NONE){return this.texturePool.getOptimalTexture(e,t,n,r)}getFilterTexture(e,t,n){if(typeof e==`number`){let n=e;e=t,t=n}e||=this.activeState.renderTexture;let r=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||hr.NONE);return r.filterFrame=e.filterFrame,r}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}
379resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,t){let n=oc[0],r=oc[1],i=oc[2],a=oc[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(a,a);let o=Math.min(n.x,r.x,i.x,a.x),s=Math.min(n.y,r.y,i.y,a.y),c=Math.max(n.x,r.x,i.x,a.x),l=Math.max(n.y,r.y,i.y,a.y);t.x=o,t.y=s,t.width=c-o,t.height=l-s}roundFrame(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){let{a:e,b:t,c:n,d:r}=i;if((Math.abs(t)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(r)>1e-4))return}i=i?sc.copyFrom(i):sc.identity(),i.translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}}};cc.extension={type:G.RendererSystem,name:`filter`},Qa.add(cc);var lc=class{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=hr.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}},uc=new Io,dc=class{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Js(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);let e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Io,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;W.PREFER_ENV===er.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=e=>t.drawBuffersWEBGL(e):(this.hasMRT=!1,e.drawBuffers=()=>{}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,t,n=0){let{gl:r}=this;if(e){let i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat===e.dirtyFormat?i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)):(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)));for(let t=0;t<e.colorTextures.length;t++){let n=e.colorTextures[t];this.renderer.texture.unbind(n.parentTextureArray||n)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),t){let e=t.width>>n,r=t.height>>n,i=e/t.width;this.setViewport(t.x*i,t.y*i,e,r)}else{let t=e.width>>n,r=e.height>>n;this.setViewport(0,0,t,r)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,t,n,r){let i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),(i.width!==n||i.height!==r||i.x!==e||i.y!==t)&&(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,t,n,r,i=nr.COLOR|nr.DEPTH){let{gl:a}=this;a.clearColor(e,t,n,r),a.clear(i)}initFramebuffer(e){let{gl:t}=this,n=new lc(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n}resizeFramebuffer(e){let{gl:t}=this,n=e.glFramebuffers[this.CONTEXT_UID];if(n.stencil){t.bindRenderbuffer(t.RENDERBUFFER,n.stencil);let r;r=this.renderer.context.webGLVersion===1?t.DEPTH_STENCIL:e.depth&&e.stencil?t.DEPTH24_STENCIL8:e.depth?t.DEPTH_COMPONENT24:t.STENCIL_INDEX8,n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,r,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,r,e.width,e.height)}let r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(let a=0;a<i;a++){let i=r[a],o=i.parentTextureArray||i;this.renderer.texture.bind(o,0),a===0&&n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,o._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,t){let{gl:n}=this,r=e.glFramebuffers[this.CONTEXT_UID],i=e.colorTextures,a=i.length;n.drawBuffers||(a=Math.min(a,1)),r.multisample>1&&this.canMultisampleFramebuffer(e)?r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer():r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&=(r.blitFramebuffer.dispose(),null));let o=[];for(let s=0;s<a;s++){let a=i[s],c=a.parentTextureArray||a;this.renderer.texture.bind(c,0),s===0&&r.msaaBuffer?(n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,c._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+s,a.target,c._glTextures[this.CONTEXT_UID].texture,t),o.push(n.COLOR_ATTACHMENT0+s))}if(o.length>1&&n.drawBuffers(o),e.depthTexture&&this.writeDepthTexture){let r=e.depthTexture;this.renderer.texture.bind(r,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,r._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){r.stencil=r.stencil||n.createRenderbuffer();let t,i;this.renderer.context.webGLVersion===1?(t=n.DEPTH_STENCIL_ATTACHMENT,i=n.DEPTH_STENCIL):e.depth&&e.stencil?(t=n.DEPTH_STENCIL_ATTACHMENT,i=n.DEPTH24_STENCIL8):e.depth?(t=n.DEPTH_ATTACHMENT,i=n.DEPTH_COMPONENT24):(t=n.STENCIL_ATTACHMENT,i=n.STENCIL_INDEX8),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,i,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,i,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,t,n.RENDERBUFFER,r.stencil)}else r.stencil&&=(n.deleteRenderbuffer(r.stencil),null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){let{msaaSamples:t}=this,n=hr.NONE;if(e<=1||t===null)return n;for(let r=0;r<t.length;r++)if(t[r]<=e){n=t[r];break}return n===1&&(n=hr.NONE),n}blit(e,t,n){let{current:r,renderer:i,gl:a,CONTEXT_UID:o}=this;if(i.context.webGLVersion!==2||!r)return;let s=r.glFramebuffers[o];if(!s)return;if(!e){if(!s.msaaBuffer)return;let t=r.colorTextures[0];if(!t)return;s.blitFramebuffer||(s.blitFramebuffer=new Js(r.width,r.height),s.blitFramebuffer.addColorTexture(0,t)),e=s.blitFramebuffer,e.colorTextures[0]!==t&&(e.colorTextures[0]=t,e.dirtyId++,e.dirtyFormat++),(e.width!==r.width||e.height!==r.height)&&(e.width=r.width,e.height=r.height,e.dirtyId++,e.dirtySize++)}t||(t=uc,t.width=r.width,t.height=r.height),n||=t;let c=t.width===n.width&&t.height===n.height;this.bind(e),a.bindFramebuffer(a.READ_FRAMEBUFFER,s.framebuffer),a.blitFramebuffer(t.left,t.top,t.right,t.bottom,n.left,n.top,n.right,n.bottom,a.COLOR_BUFFER_BIT,c?a.NEAREST:a.LINEAR),a.bindFramebuffer(a.READ_FRAMEBUFFER,e.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(e,t){let n=e.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(!n)return;delete e.glFramebuffers[this.CONTEXT_UID];let i=this.managedFramebuffers.indexOf(e);i>=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&this.disposeFramebuffer(n.blitFramebuffer,t)}disposeAll(e){let t=this.managedFramebuffers;this.managedFramebuffers=[];for(let n=0;n<t.length;n++)this.disposeFramebuffer(t[n],e)}forceStencil(){let e=this.current;if(!e)return;let t=e.glFramebuffers[this.CONTEXT_UID];if(!t||t.stencil&&e.stencil)return;e.stencil=!0;let n=e.width,r=e.height,i=this.gl,a=t.stencil=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,a);let o,s;this.renderer.context.webGLVersion===1?(o=i.DEPTH_STENCIL_ATTACHMENT,s=i.DEPTH_STENCIL):e.depth?(o=i.DEPTH_STENCIL_ATTACHMENT,s=i.DEPTH24_STENCIL8):(o=i.STENCIL_ATTACHMENT,s=i.STENCIL_INDEX8),t.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,t.multisample,s,n,r):i.renderbufferStorage(i.RENDERBUFFER,s,n,r),i.framebufferRenderbuffer(i.FRAMEBUFFER,o,i.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new Io}destroy(){this.renderer=null}};dc.extension={type:G.RendererSystem,name:`framebuffer`},Qa.add(dc);var fc={5126:4,5123:2,5121:1},pc=class{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);let e=this.gl=this.renderer.gl,t=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,t.webGLVersion!==2){let t=this.renderer.context.extensions.vertexArrayObject;W.PREFER_ENV===er.WEBGL_LEGACY&&(t=null),t?(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}
379if(t.webGLVersion!==2){let t=e.getExtension(`ANGLE_instanced_arrays`);t?(e.vertexAttribDivisor=(e,n)=>t.vertexAttribDivisorANGLE(e,n),e.drawElementsInstanced=(e,n,r,i,a)=>t.drawElementsInstancedANGLE(e,n,r,i,a),e.drawArraysInstanced=(e,n,r,i)=>t.drawArraysInstancedANGLE(e,n,r,i)):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex}bind(e,t){t||=this.renderer.shader.shader;let{gl:n}=this,r=e.glVertexArrayObjects[this.CONTEXT_UID],i=!1;r||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=r={},i=!0);let a=r[t.program.id]||this.initGeometryVao(e,t,i);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?n.bindVertexArray(a):this.activateVao(e,t.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){let e=this._activeGeometry,t=this.renderer.buffer;for(let n=0;n<e.buffers.length;n++){let r=e.buffers[n];t.update(r)}}checkCompatibility(e,t){let n=e.attributes,r=t.attributeData;for(let e in r)if(!n[e])throw Error(`shader and geometry incompatible, geometry missing the "${e}" attribute`)}getSignature(e,t){let n=e.attributes,r=t.attributeData,i=[`g`,e.id];for(let e in n)r[e]&&i.push(e,r[e].location);return i.join(`-`)}initGeometryVao(e,t,n=!0){let r=this.gl,i=this.CONTEXT_UID,a=this.renderer.buffer,o=t.program;o.glPrograms[i]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,o);let s=this.getSignature(e,o),c=e.glVertexArrayObjects[this.CONTEXT_UID],l=c[s];if(l)return c[o.id]=l,l;let u=e.buffers,d=e.attributes,f={},p={};for(let e in u)f[e]=0,p[e]=0;for(let e in d)!d[e].size&&o.attributeData[e]?d[e].size=o.attributeData[e].size:d[e].size||console.warn(`PIXI Geometry attribute '${e}' size cannot be determined (likely the bound shader does not have the attribute)`),f[d[e].buffer]+=d[e].size*fc[d[e].type];for(let e in d){let t=d[e],n=t.size;t.stride===void 0&&(f[t.buffer]===n*fc[t.type]?t.stride=0:t.stride=f[t.buffer]),t.start===void 0&&(t.start=p[t.buffer],p[t.buffer]+=n*fc[t.type])}l=r.createVertexArray(),r.bindVertexArray(l);for(let e=0;e<u.length;e++){let t=u[e];a.bind(t),n&&t._glBuffers[i].refCount++}return this.activateVao(e,o),c[o.id]=l,c[s]=l,r.bindVertexArray(null),a.unbind(gr.ARRAY_BUFFER),l}disposeGeometry(e,t){if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];let n=e.glVertexArrayObjects[this.CONTEXT_UID],r=this.gl,i=e.buffers,a=this.renderer?.buffer;if(e.disposeRunner.remove(this),n){if(a)for(let e=0;e<i.length;e++){let n=i[e]._glBuffers[this.CONTEXT_UID];n&&(n.refCount--,n.refCount===0&&!t&&a.dispose(i[e],t))}if(!t){for(let e in n)if(e[0]===`g`){let t=n[e];this._activeVao===t&&this.unbind(),r.deleteVertexArray(t)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){let t=Object.keys(this.managedGeometries);for(let n=0;n<t.length;n++)this.disposeGeometry(this.managedGeometries[t[n]],e)}activateVao(e,t){let n=this.gl,r=this.CONTEXT_UID,i=this.renderer.buffer,a=e.buffers,o=e.attributes;e.indexBuffer&&i.bind(e.indexBuffer);let s=null;for(let e in o){let c=o[e],l=a[c.buffer],u=l._glBuffers[r];if(t.attributeData[e]){s!==u&&(i.bind(l),s=u);let r=t.attributeData[e].location;if(n.enableVertexAttribArray(r),n.vertexAttribPointer(r,c.size,c.type||n.FLOAT,c.normalized,c.stride,c.start),c.instance)if(this.hasInstance)n.vertexAttribDivisor(r,c.divisor);else throw Error(`geometry error, GPU Instancing is not supported on this device`)}}}draw(e,t,n,r){let{gl:i}=this,a=this._activeGeometry;if(a.indexBuffer){let o=a.indexBuffer.data.BYTES_PER_ELEMENT,s=o===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?i.drawElementsInstanced(e,t||a.indexBuffer.data.length,s,(n||0)*o,r||1):i.drawElements(e,t||a.indexBuffer.data.length,s,(n||0)*o):console.warn(`unsupported index buffer type: uint32`)}else a.instanced?i.drawArraysInstanced(e,n,t||a.getSize(),r||1):i.drawArrays(e,n,t||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}};pc.extension={type:G.RendererSystem,name:`geometry`},Qa.add(pc);var mc=new Vo,hc=class{constructor(e,t){this._texture=e,this.mapCoord=new Vo,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof t>`u`?.5:t,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}
379multiplyUvs(e,t){t===void 0&&(t=e);let n=this.mapCoord;for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];t[r]=i*n.a+a*n.c+n.tx,t[r+1]=i*n.b+a*n.d+n.ty}return t}update(e){let t=this._texture;if(!t||!t.valid||!e&&this._textureID===t._updateID)return!1;this._textureID=t._updateID,this._updateID++;let n=t._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);let r=t.orig,i=t.trim;i&&(mc.set(r.width/i.width,0,0,r.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(mc));let a=t.baseTexture,o=this.uClampFrame,s=this.clampMargin/a.resolution,c=this.clampOffset;return o[0]=(t._frame.x+s+c)/a.width,o[1]=(t._frame.y+s+c)/a.height,o[2]=(t._frame.x+t._frame.width-s+c)/a.width,o[3]=(t._frame.y+t._frame.height-s+c)/a.height,this.uClampOffset[0]=c/a.realWidth,this.uClampOffset[1]=c/a.realHeight,this.isSimple=t._frame.width===a.width&&t._frame.height===a.height&&t.rotate===0,!0}},gc=`varying vec2 vMaskCoord;
380varying vec2 vTextureCoord;
381
382uniform sampler2D uSampler;
383uniform sampler2D mask;
384uniform float alpha;
385uniform float npmAlpha;
386uniform vec4 maskClamp;
387
388void main(void)
389{
390    float clip = step(3.5,
391        step(maskClamp.x, vMaskCoord.x) +
392        step(maskClamp.y, vMaskCoord.y) +
393        step(vMaskCoord.x, maskClamp.z) +
394        step(vMaskCoord.y, maskClamp.w));
395
396    vec4 original = texture2D(uSampler, vTextureCoord);
397    vec4 masky = texture2D(mask, vMaskCoord);
398    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
399
400    original *= (alphaMul * masky.r * alpha * clip);
401
402    gl_FragColor = original;
403}
404`,_c=`attribute vec2 aVertexPosition;
405attribute vec2 aTextureCoord;
406
407uniform mat3 projectionMatrix;
408uniform mat3 otherMatrix;
409
410varying vec2 vMaskCoord;
411varying vec2 vTextureCoord;
412
413void main(void)
414{
415    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
416
417    vTextureCoord = aTextureCoord;
418    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;
419}
420`,vc=class extends Us{constructor(e,t,n){let r=null;typeof e!=`string`&&t===void 0&&n===void 0&&(r=e,e=void 0,t=void 0,n=void 0),super(e||_c,t||gc,n),this.maskSprite=r,this.maskMatrix=new Vo}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,t,n,r){let i=this._maskSprite,a=i._texture;a.valid&&(a.uvMatrix||=new hc(a,0),a.uvMatrix.update(),this.uniforms.npmAlpha=+!a.baseTexture.alphaMode,this.uniforms.mask=a,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,i).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=i.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,e.applyFilter(this,t,n,r))}},yc=class{constructor(e=null){this.type=mr.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Us.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=mr.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}},bc=class{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,t){let n=t;if(!n.isMaskData){let e=this.maskDataPool.pop()||new yc;e.pooled=!0,e.maskObject=t,n=e}let r=this.maskStack.length===0?null:this.maskStack[this.maskStack.length-1];if(n.copyCountersOrReset(r),n._colorMask=r?r._colorMask:15,n.autoDetect&&this.detect(n),n._target=e,n.type!==mr.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case mr.SCISSOR:this.renderer.scissor.push(n);break;case mr.STENCIL:this.renderer.stencil.push(n);break;case mr.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case mr.COLOR:this.pushColorMask(n);break;default:break}n.type===mr.SPRITE&&this.maskStack.push(n)}pop(e){let t=this.maskStack.pop();if(!(!t||t._target!==e)){if(t.enabled)switch(t.type){case mr.SCISSOR:this.renderer.scissor.pop(t);break;case mr.STENCIL:this.renderer.stencil.pop(t.maskObject);break;case mr.SPRITE:this.popSpriteMask(t);break;case mr.COLOR:this.popColorMask(t);break;default:break}if(t.reset(),t.pooled&&this.maskDataPool.push(t),this.maskStack.length!==0){let e=this.maskStack[this.maskStack.length-1];e.type===mr.SPRITE&&e._filters&&(e._filters[0].maskSprite=e.maskObject)}}}detect(e){let t=e.maskObject;t?t.isSprite?e.type=mr.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=mr.SCISSOR:e.type=mr.STENCIL:e.type=mr.COLOR}pushSpriteMask(e){let{maskObject:t}=e,n=e._target,r=e._filters;r||(r=this.alphaMaskPool[this.alphaMaskIndex],r||=this.alphaMaskPool[this.alphaMaskIndex]=[new vc]),r[0].resolution=e.resolution,r[0].multisample=e.multisample,r[0].maskSprite=t;let i=n.filterArea;n.filterArea=t.getBounds(!0),this.renderer.filter.push(n,r),n.filterArea=i,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){let t=e._colorMask,n=e._colorMask=t&e.colorMask;n!==t&&this.renderer.gl.colorMask((n&1)!=0,(n&2)!=0,(n&4)!=0,(n&8)!=0)}popColorMask(e){let t=e._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==t&&this.renderer.gl.colorMask((n&1)!=0,(n&2)!=0,(n&4)!=0,(n&8)!=0)}destroy(){this.renderer=null}};bc.extension={type:G.RendererSystem,name:`mask`},Qa.add(bc);var xc=class{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){let{gl:t}=this.renderer,n=this.getStackLength();this.maskStack=e;let r=this.getStackLength();r!==n&&(r===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}},Sc=new Vo,Cc=[],wc=class e extends xc{constructor(e){super(e),this.glConst=W.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){let e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}
420calcScissorRect(e){if(e._scissorRectLocal)return;let t=e._scissorRect,{maskObject:n}=e,{renderer:r}=this,i=r.renderTexture,a=n.getBounds(!0,Cc.pop()??new Io);this.roundFrameToPixels(a,i.current?i.current.resolution:r.resolution,i.sourceFrame,i.destinationFrame,r.projection.transform),t&&a.fit(t),e._scissorRectLocal=a}static isMatrixRotated(e){if(!e)return!1;let{a:t,b:n,c:r,d:i}=e;return(Math.abs(n)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)}testScissor(t){let{maskObject:n}=t;if(!n.isFastRect||!n.isFastRect()||e.isMatrixRotated(n.worldTransform)||e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);let r=t._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(t,n,r,i,a){e.isMatrixRotated(a)||(a=a?Sc.copyFrom(a):Sc.identity(),a.translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(a,t),t.fit(i),t.x=Math.round(t.x*n),t.y=Math.round(t.y*n),t.width=Math.round(t.width*n),t.height=Math.round(t.height*n))}push(e){e._scissorRectLocal||this.calcScissorRect(e);let{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){let{gl:t}=this.renderer;e&&Cc.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){let e=this.maskStack[this.maskStack.length-1]._scissorRect,t;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};wc.extension={type:G.RendererSystem,name:`scissor`};var Tc=wc;Qa.add(Tc);var Ec=class extends xc{constructor(e){super(e),this.glConst=W.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){let e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){let t=e.maskObject,{gl:n}=this.renderer,r=e._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;let i=e._colorMask;i!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,i!==0&&(e._colorMask=i,n.colorMask((i&1)!=0,(i&2)!=0,(i&4)!=0,(i&8)!=0)),this._useCurrent()}pop(e){let t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{let n=this.maskStack.length===0?null:this.maskStack[this.maskStack.length-1],r=n?n._colorMask:15;r!==0&&(n._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,r!==0&&(n._colorMask=r,t.colorMask((r&1)!=0,(r&2)!=0,(r&4)!=0,(r&8)!=0)),this._useCurrent()}}_useCurrent(){let e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}};Ec.extension={type:G.RendererSystem,name:`stencil`},Qa.add(Ec);var Dc=class{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return Fi(`7.0.0`,`renderer.plugins.extract has moved to renderer.extract`),e.extract}},prepare:{enumerable:!1,get(){return Fi(`7.0.0`,`renderer.plugins.prepare has moved to renderer.prepare`),e.prepare}},interaction:{enumerable:!1,get(){return Fi(`7.0.0`,`renderer.plugins.interaction has been deprecated, use renderer.events`),e.events}}})}init(){let e=this.rendererPlugins;for(let t in e)this.plugins[t]=new e[t](this.renderer)}destroy(){for(let e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}};Dc.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:`_plugin`},Qa.add(Dc);var Oc=class{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Vo,this.transform=null}update(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);let i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)}calculateProjection(e,t,n,r){let i=this.projectionMatrix,a=r?-1:1;
420i.identity(),i.a=1/t.width*2,i.d=a*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-a-t.y*i.d}setTransform(e){}destroy(){this.renderer=null}};Oc.extension={type:G.RendererSystem,name:`projection`},Qa.add(Oc);var kc=new $o,Ac=new Io,jc=class{constructor(e){this.renderer=e,this._tempMatrix=new Vo}generateTexture(e,t){let{region:n,...r}=t||{},i=n?.copyTo(Ac)||e.getLocalBounds(Ac,!0),a=r.resolution||this.renderer.resolution;i.width=Math.max(i.width,1/a),i.height=Math.max(i.height,1/a),r.width=i.width,r.height=i.height,r.resolution=a,r.multisample??=this.renderer.multisample;let o=tc.create(r);this._tempMatrix.tx=-i.x,this._tempMatrix.ty=-i.y;let s=e.transform;return e.transform=kc,this.renderer.render(e,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=s,o}destroy(){}};jc.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:`textureGenerator`},Qa.add(jc);var Mc=new Io,Nc=new Io,Pc=class{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Io,this.destinationFrame=new Io,this.viewportFrame=new Io}contextChange(){let e=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,t,n){let r=this.renderer;this.current=e;let i,a,o;e?(i=e.baseTexture,o=i.resolution,t||=(Mc.width=e.frame.width,Mc.height=e.frame.height,Mc),n||=(Nc.x=e.frame.x,Nc.y=e.frame.y,Nc.width=t.width,Nc.height=t.height,Nc),a=i.framebuffer):(o=r.resolution,t||=(Mc.width=r._view.screen.width,Mc.height=r._view.screen.height,Mc),n||(n=Mc,n.width=t.width,n.height=t.height));let s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=r.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(a,s),this.renderer.projection.update(n,t,o,!a),e?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)}clear(e,t){let n=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=Ca.shared.setValue(e||n);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&r.premultiply(r.alpha);let i=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=i.width!==a.width||i.height!==a.height;if(o){let{x:e,y:t,width:n,height:r}=this.viewportFrame;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(e,t,n,r)}this.renderer.framebuffer.clear(r.red,r.green,r.blue,r.alpha,t),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}};Pc.extension={type:G.RendererSystem,name:`renderTexture`},Qa.add(Pc);var Fc=class{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}};function Ic(e,t){let n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=t.getActiveAttrib(e,i);if(r.name.startsWith(`gl_`))continue;let a=bs(t,r.type),o={type:a,name:r.name,size:_s(a),location:t.getAttribLocation(e,r.name)};n[r.name]=o}return n}function Lc(e,t){let n={},r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<r;i++){let r=t.getActiveUniform(e,i),a=r.name.replace(/\[.*?\]$/,``),o=!!r.name.match(/\[.*?\]$/),s=bs(t,r.type);n[a]={name:a,index:i,type:s,size:r.size,isArray:o,value:is(s,r.size)}}return n}function Rc(e,t){let n=ns(e,e.VERTEX_SHADER,t.vertexSrc),r=ns(e,e.FRAGMENT_SHADER,t.fragmentSrc),i=e.createProgram();e.attachShader(i,n),e.attachShader(i,r);let a=t.extra?.transformFeedbackVaryings;if(a&&(typeof e.transformFeedbackVaryings==`function`?e.transformFeedbackVaryings(i,a.names,a.bufferMode===`separate`?e.SEPARATE_ATTRIBS:e.INTERLEAVED_ATTRIBS):console.warn(`TransformFeedback is not supported but TransformFeedbackVaryings are given.`)),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||hs(e,i,n,r),t.attributeData=Ic(i,e),t.uniformData=Lc(i,e),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){let n=Object.keys(t.attributeData);n.sort((e,t)=>
420e>t?1:-1);for(let r=0;r<n.length;r++)t.attributeData[n[r]].location=r,e.bindAttribLocation(i,r,n[r]);e.linkProgram(i)}e.deleteShader(n),e.deleteShader(r);let o={};for(let n in t.uniformData){let r=t.uniformData[n];o[n]={location:e.getUniformLocation(i,n),value:is(r.type,r.size)}}return new Fc(i,o)}function zc(e,t,n,r,i){n.buffer.update(i)}var Bc={float:`
421        data[offset] = v;
422    `,vec2:`
423        data[offset] = v[0];
424        data[offset+1] = v[1];
425    `,vec3:`
426        data[offset] = v[0];
427        data[offset+1] = v[1];
428        data[offset+2] = v[2];
429
430    `,vec4:`
431        data[offset] = v[0];
432        data[offset+1] = v[1];
433        data[offset+2] = v[2];
434        data[offset+3] = v[3];
435    `,mat2:`
436        data[offset] = v[0];
437        data[offset+1] = v[1];
438
439        data[offset+4] = v[2];
440        data[offset+5] = v[3];
441    `,mat3:`
442        data[offset] = v[0];
443        data[offset+1] = v[1];
444        data[offset+2] = v[2];
445
446        data[offset + 4] = v[3];
447        data[offset + 5] = v[4];
448        data[offset + 6] = v[5];
449
450        data[offset + 8] = v[6];
451        data[offset + 9] = v[7];
452        data[offset + 10] = v[8];
453    `,mat4:`
454        for(var i = 0; i < 16; i++)
455        {
456            data[offset + i] = v[i];
457        }
458    `},Vc={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function Hc(e){let t=e.map(e=>({data:e,offset:0,dataLen:0,dirty:0})),n=0,r=0,i=0;for(let e=0;e<t.length;e++){let a=t[e];if(n=Vc[a.data.type],a.data.size>1&&(n=Math.max(n,16)*a.data.size),a.dataLen=n,r%n!==0&&r<16){let e=r%n%16;r+=e,i+=e}r+n>16?(i=Math.ceil(i/16)*16,a.offset=i,i+=n,r=n):(a.offset=i,r+=n,i+=n)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function Uc(e,t){let n=[];for(let r in e)t[r]&&n.push(t[r]);return n.sort((e,t)=>e.index-t.index),n}function Wc(e,t){if(!e.autoManage)return{size:0,syncFunc:zc};let{uboElements:n,size:r}=Hc(Uc(e.uniforms,t)),i=[`
459    var v = null;
460    var v2 = null;
461    var cv = null;
462    var t = 0;
463    var gl = renderer.gl
464    var index = 0;
465    var data = buffer.data;
466    `];for(let t=0;t<n.length;t++){let r=n[t],a=e.uniforms[r.data.name],o=r.data.name,s=!1;for(let e=0;e<as.length;e++){let t=as[e];if(t.codeUbo&&t.test(r.data,a)){i.push(`offset = ${r.offset/4};`,as[e].codeUbo(r.data.name,a)),s=!0;break}}if(!s)if(r.data.size>1){let e=_s(r.data.type),t=Math.max(Vc[r.data.type]/16,1),n=e/t,a=(4-n%4)%4;i.push(`
467                cv = ud.${o}.value;
468                v = uv.${o};
469                offset = ${r.offset/4};
470
471                t = 0;
472
473                for(var i=0; i < ${r.data.size*t}; i++)
474                {
475                    for(var j = 0; j < ${n}; j++)
476                    {
477                        data[offset++] = v[t++];
478                    }
479                    offset += ${a};
480                }
481
482                `)}else{let e=Bc[r.data.type];i.push(`
483                cv = ud.${o}.value;
484                v = uv.${o};
485                offset = ${r.offset/4};
486                ${e};
487                `)}}return i.push(`
488       renderer.buffer.update(buffer);
489    `),{size:r,syncFunc:Function(`ud`,`uv`,`renderer`,`syncData`,`buffer`,i.join(`
490`))}}var Gc=0,Kc={textureCount:0,uboCount:0},qc=class{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Gc++}systemCheck(){if(!Cs())throw Error(`Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.`)}contextChange(e){this.gl=e,this.reset()}bind(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;let n=e.program,r=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(r.program)),t||(Kc.textureCount=0,Kc.uboCount=0,this.syncUniformGroup(e.uniformGroup,Kc)),r}setUniforms(e){let t=this.shader.program,n=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(n.uniformData,e,this.renderer)}syncUniformGroup(e,t){let n=this.getGlProgram();(!e.static||e.dirtyId!==n.uniformDirtyGroups[e.id])&&(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,t))}
490syncUniforms(e,t,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,n)}createSyncGroups(e){let t=this.getSignature(e,this.shader.program.uniformData,`u`);return this.cache[t]||(this.cache[t]=cs(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){let n=this.getGlProgram();if(!e.static||e.dirtyId!==0||!n.uniformGroups[e.id]){e.dirtyId=0;let r=n.uniformGroups[e.id]||this.createSyncBufferGroup(e,n,t);e.buffer.update(),r(n.uniformData,e.uniforms,this.renderer,Kc,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,n.uniformBufferBindings[t])}createSyncBufferGroup(e,t,n){let{gl:r}=this.renderer;this.renderer.buffer.bind(e.buffer);let i=this.gl.getUniformBlockIndex(t.program,n);t.uniformBufferBindings[n]=this.shader.uniformBindCount,r.uniformBlockBinding(t.program,i,this.shader.uniformBindCount),this.shader.uniformBindCount++;let a=this.getSignature(e,this.shader.program.uniformData,`ubo`),o=this._uboCache[a];if(o||=this._uboCache[a]=Wc(e,this.shader.program.uniformData),e.autoManage){let t=new Float32Array(o.size/4);e.buffer.update(t)}return t.uniformGroups[e.id]=o.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,n){let r=e.uniforms,i=[`${n}-`];for(let e in r)i.push(e),t[e]&&i.push(t[e].type);return i.join(`-`)}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){let t=this.gl,n=e.program,r=Rc(t,n);return n.glPrograms[this.renderer.CONTEXT_UID]=r,r}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}};qc.extension={type:G.RendererSystem,name:`shader`},Qa.add(qc);var Jc=class{constructor(e){this.renderer=e}run(e){let{renderer:t}=this;t.runners.init.emit(t.options),e.hello&&console.log(`PixiJS 7.4.3 - ${t.rendererLogId} - https://pixijs.com`),t.resize(t.screen.width,t.screen.height)}destroy(){}};Jc.defaultOptions={hello:!1},Jc.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:`startup`},Qa.add(Jc);function Yc(e,t=[]){return t[rr.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.ADD]=[e.ONE,e.ONE],t[rr.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.NONE]=[0,0],t[rr.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[rr.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[rr.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[rr.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[rr.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[rr.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[rr.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[rr.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[rr.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[rr.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[rr.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}var Xc=0,Zc=1,Qc=2,$c=3,el=4,tl=5,nl=class e{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=rr.NONE,this._blendEq=!1,this.map=[],this.map[Xc]=this.setBlend,this.map[Zc]=this.setOffset,this.map[Qc]=this.setCullFace,this.map[$c]=this.setDepthTest,this.map[el]=this.setFrontFace,this.map[tl]=this.setDepthMask,this.checks=[],this.defaultState=new lo,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=Yc(e),this.set(this.defaultState),this.reset()}set(e){if(e||=this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,n=0;for(;t;)t&1&&this.map[n].call(this,!!(e.data&1<<n)),t>>=1,n++;this.stateId=e.data}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e)}forceState(e){e||=this.defaultState;for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data}setBlend(t){this.updateCheck(e.checkBlendMode,t),this.gl[t?`enable`:`disable`](this.gl.BLEND)}setOffset(t){this.updateCheck(e.checkPolygonOffset,t),this.gl[t?`enable`:`disable`](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?`enable`:`disable`](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?`enable`:`disable`](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?`CW`:`CCW`])}setBlendMode(e){if(e===this.blendMode)return;this.blendMode=e;let t=this.blendModes[e],n=this.gl;t.length===2?n.blendFunc(t[0],t[1]):n.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,n.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD))}setPolygonOffset(e,t){this.gl.polygonOffset(e,t)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(e,t){let n=this.checks.indexOf(e);t&&n===-1?this.checks.push(e):!t&&n!==-1&&this.checks.splice(n,1)}static checkBlendMode(e,t){e.setBlendMode(t.blendMode)}static checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset)}destroy(){this.gl=null}};nl.extension={type:G.RendererSystem,name:`state`};var rl=nl;Qa.add(rl);var il=class extends Mi.default{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);let t=(e.priority??[]).filter(t=>e.systems[t]),n=[...t,...Object.keys(e.systems).filter(e=>!t.includes(e))];for(let t of n)this.addSystem(e.systems[t],t)}
490addRunners(...e){e.forEach(e=>{this.runners[e]=new po(e)})}addSystem(e,t){let n=new e(this);if(this[t])throw Error(`Whoops! The name "${t}" is already in use`);this[t]=n,this._systemsHash[t]=n;for(let e in this.runners)this.runners[e].add(n);return this}emitWithCustomOptions(e,t){let n=Object.keys(this._systemsHash);e.items.forEach(r=>{let i=n.find(e=>this._systemsHash[e]===r);r[e.name](t[i])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}},al=class e{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=e.defaultMaxIdle,this.checkCountMax=e.defaultCheckCountMax,this.mode=e.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==fr.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){let e=this.renderer.texture,t=e.managedTextures,n=!1;for(let r=0;r<t.length;r++){let i=t[r];i.resource&&this.count-i.touched>this.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){let e=0;for(let n=0;n<t.length;n++)t[n]!==null&&(t[e++]=t[n]);t.length=e}}unload(e){let t=this.renderer.texture,n=e._texture;n&&!n.framebuffer&&t.destroyTexture(n);for(let t=e.children.length-1;t>=0;t--)this.unload(e.children[t])}destroy(){this.renderer=null}};al.defaultMode=fr.AUTO,al.defaultMaxIdle=3600,al.defaultCheckCountMax=600,al.extension={type:G.RendererSystem,name:`textureGC`};var ol=al;Qa.add(ol);var sl=class{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=or.UNSIGNED_BYTE,this.internalFormat=H.RGBA,this.samplerType=0}};function cl(e){let t;return t=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext?{[e.RGB]:U.FLOAT,[e.RGBA]:U.FLOAT,[e.ALPHA]:U.FLOAT,[e.LUMINANCE]:U.FLOAT,[e.LUMINANCE_ALPHA]:U.FLOAT,[e.R8]:U.FLOAT,[e.R8_SNORM]:U.FLOAT,[e.RG8]:U.FLOAT,[e.RG8_SNORM]:U.FLOAT,[e.RGB8]:U.FLOAT,[e.RGB8_SNORM]:U.FLOAT,[e.RGB565]:U.FLOAT,[e.RGBA4]:U.FLOAT,[e.RGB5_A1]:U.FLOAT,[e.RGBA8]:U.FLOAT,[e.RGBA8_SNORM]:U.FLOAT,[e.RGB10_A2]:U.FLOAT,[e.RGB10_A2UI]:U.FLOAT,[e.SRGB8]:U.FLOAT,[e.SRGB8_ALPHA8]:U.FLOAT,[e.R16F]:U.FLOAT,[e.RG16F]:U.FLOAT,[e.RGB16F]:U.FLOAT,[e.RGBA16F]:U.FLOAT,[e.R32F]:U.FLOAT,[e.RG32F]:U.FLOAT,[e.RGB32F]:U.FLOAT,[e.RGBA32F]:U.FLOAT,[e.R11F_G11F_B10F]:U.FLOAT,[e.RGB9_E5]:U.FLOAT,[e.R8I]:U.INT,[e.R8UI]:U.UINT,[e.R16I]:U.INT,[e.R16UI]:U.UINT,[e.R32I]:U.INT,[e.R32UI]:U.UINT,[e.RG8I]:U.INT,[e.RG8UI]:U.UINT,[e.RG16I]:U.INT,[e.RG16UI]:U.UINT,[e.RG32I]:U.INT,[e.RG32UI]:U.UINT,[e.RGB8I]:U.INT,[e.RGB8UI]:U.UINT,[e.RGB16I]:U.INT,[e.RGB16UI]:U.UINT,[e.RGB32I]:U.INT,[e.RGB32UI]:U.UINT,[e.RGBA8I]:U.INT,[e.RGBA8UI]:U.UINT,[e.RGBA16I]:U.INT,[e.RGBA16UI]:U.UINT,[e.RGBA32I]:U.INT,[e.RGBA32UI]:U.UINT,[e.DEPTH_COMPONENT16]:U.FLOAT,[e.DEPTH_COMPONENT24]:U.FLOAT,[e.DEPTH_COMPONENT32F]:U.FLOAT,[e.DEPTH_STENCIL]:U.FLOAT,[e.DEPTH24_STENCIL8]:U.FLOAT,[e.DEPTH32F_STENCIL8]:U.FLOAT}:{[e.RGB]:U.FLOAT,[e.RGBA]:U.FLOAT,[e.ALPHA]:U.FLOAT,[e.LUMINANCE]:U.FLOAT,[e.LUMINANCE_ALPHA]:U.FLOAT,[e.DEPTH_STENCIL]:U.FLOAT},t}function ll(e){let t;return t=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext?{[or.UNSIGNED_BYTE]:{[H.RGBA]:e.RGBA8,[H.RGB]:e.RGB8,[H.RG]:e.RG8,[H.RED]:e.R8,[H.RGBA_INTEGER]:e.RGBA8UI,[H.RGB_INTEGER]:e.RGB8UI,[H.RG_INTEGER]:e.RG8UI,[H.RED_INTEGER]:e.R8UI,[H.ALPHA]:e.ALPHA,[H.LUMINANCE]:e.LUMINANCE,[H.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[or.BYTE]:{[H.RGBA]:e.RGBA8_SNORM,[H.RGB]:e.RGB8_SNORM,[H.RG]:e.RG8_SNORM,[H.RED]:e.R8_SNORM,[H.RGBA_INTEGER]:e.RGBA8I,[H.RGB_INTEGER]:e.RGB8I,[H.RG_INTEGER]:e.RG8I,[H.RED_INTEGER]:e.R8I},[or.UNSIGNED_SHORT]:{[H.RGBA_INTEGER]:e.RGBA16UI,[H.RGB_INTEGER]:e.RGB16UI,[H.RG_INTEGER]:e.RG16UI,[H.RED_INTEGER]:e.R16UI,[H.DEPTH_COMPONENT]:e.DEPTH_COMPONENT16},[or.SHORT]:{[H.RGBA_INTEGER]:e.RGBA16I,[H.RGB_INTEGER]:e.RGB16I,[H.RG_INTEGER]:e.RG16I,[H.RED_INTEGER]:e.R16I},[or.UNSIGNED_INT]:{[H.RGBA_INTEGER]:e.RGBA32UI,[H.RGB_INTEGER]:e.RGB32UI,[H.RG_INTEGER]:e.RG32UI,[H.RED_INTEGER]:e.R32UI,[H.DEPTH_COMPONENT]:e.DEPTH_COMPONENT24},[or.INT]:{[H.RGBA_INTEGER]:e.RGBA32I,[H.RGB_INTEGER]:e.RGB32I,[H.RG_INTEGER]:e.RG32I,[H.RED_INTEGER]:e.R32I},[or.FLOAT]:{[H.RGBA]:e.RGBA32F,[H.RGB]:e.RGB32F,[H.RG]:e.RG32F,[H.RED]:e.R32F,[H.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[or.HALF_FLOAT]:{[H.RGBA]:e.RGBA16F,[H.RGB]:e.RGB16F,[H.RG]:e.RG16F,[H.RED]:e.R16F},[or.UNSIGNED_SHORT_5_6_5]:{[H.RGB]:e.RGB565},[or.UNSIGNED_SHORT_4_4_4_4]:{[H.RGBA]:e.RGBA4},[or.UNSIGNED_SHORT_5_5_5_1]:{[H.RGBA]:e.RGB5_A1},[or.UNSIGNED_INT_2_10_10_10_REV]:{[H.RGBA]:e.RGB10_A2,[H.RGBA_INTEGER]:e.RGB10_A2UI}
490,[or.UNSIGNED_INT_10F_11F_11F_REV]:{[H.RGB]:e.R11F_G11F_B10F},[or.UNSIGNED_INT_5_9_9_9_REV]:{[H.RGB]:e.RGB9_E5},[or.UNSIGNED_INT_24_8]:{[H.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[or.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[H.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:{[or.UNSIGNED_BYTE]:{[H.RGBA]:e.RGBA,[H.RGB]:e.RGB,[H.ALPHA]:e.ALPHA,[H.LUMINANCE]:e.LUMINANCE,[H.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[or.UNSIGNED_SHORT_5_6_5]:{[H.RGB]:e.RGB},[or.UNSIGNED_SHORT_4_4_4_4]:{[H.RGBA]:e.RGBA},[or.UNSIGNED_SHORT_5_5_5_1]:{[H.RGBA]:e.RGBA}},t}var ul=class{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new vo,this.hasIntegerTextures=!1}contextChange(){let e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=ll(e),this.samplerTypes=cl(e);let t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let e=0;e<t;e++)this.boundTextures[e]=null;this.emptyTextures={};let n=new sl(e.createTexture());e.bindTexture(e.TEXTURE_2D,n.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=n,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new sl(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let t=0;t<6;t++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let e=0;e<this.boundTextures.length;e++)this.bind(null,e)}bind(e,t=0){let{gl:n}=this;if(e=e?.castToBaseTexture(),e?.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;let r=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[t]!==e&&(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(e.target,r.texture)),r.dirtyId===e.dirtyId?r.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e):(this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),this.updateTexture(e)),this.boundTextures[t]=e}else this.currentLocation!==t&&(this.currentLocation=t,n.activeTexture(n.TEXTURE0+t)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[t]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){let{gl:t,boundTextures:n}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let e=0;e<n.length;e++)n[e]===this.unknownTexture&&this.bind(null,e)}for(let r=0;r<n.length;r++)n[r]===e&&(this.currentLocation!==r&&(t.activeTexture(t.TEXTURE0+r),this.currentLocation=r),t.bindTexture(e.target,this.emptyTextures[e.target].texture),n[r]=null)}ensureSamplerType(e){let{boundTextures:t,hasIntegerTextures:n,CONTEXT_UID:r}=this;if(n)for(let n=e-1;n>=0;--n){let e=t[n];e&&e._glTextures[r].samplerType!==U.FLOAT&&this.renderer.texture.unbind(e)}}initTexture(e){let t=new sl(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on(`dispose`,this.destroyTexture,this),t}initTextureType(e,t){t.internalFormat=this.internalFormats[e.type]?.[e.format]??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??U.FLOAT,this.webGLVersion===2&&e.type===or.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type}updateTexture(e){let t=e._glTextures[this.CONTEXT_UID];if(!t)return;let n=this.renderer;if(this.initTextureType(e,t),e.resource?.upload(n,e,t))t.samplerType!==U.FLOAT&&(this.hasIntegerTextures=!0);else{let r=e.realWidth,i=e.realHeight,a=n.gl;(t.width!==r||t.height!==i||t.dirtyId<0)&&(t.width=r,t.height=i,a.texImage2D(e.target,0,t.internalFormat,r,i,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){let{gl:n}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off(`dispose`,this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){let t=this.managedTextures.indexOf(e);t!==-1&&Pa(this.managedTextures,t,1)}}updateTextureStyle(e){let t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===lr.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=cr.CLAMP:t.wrapMode=e.wrapMode,e.resource?.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){let n=this.gl;if(t.mipmap&&e.mipmap!==lr.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===sr.LINEAR?
490n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);let t=this.renderer.context.extensions.anisotropicFiltering;if(t&&e.anisotropicLevel>0&&e.scaleMode===sr.LINEAR){let r=Math.min(e.anisotropicLevel,n.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===sr.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===sr.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}};ul.extension={type:G.RendererSystem,name:`texture`},Qa.add(ul);var dl=class{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){let{gl:t,CONTEXT_UID:n}=this,r=e._glTransformFeedbacks[n]||this.createGLTransformFeedback(e);t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r)}unbind(){let{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,t){let{gl:n,renderer:r}=this;t&&r.shader.bind(t),n.beginTransformFeedback(e)}endTransformFeedback(){let{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){let{gl:t,renderer:n,CONTEXT_UID:r}=this,i=t.createTransformFeedback();e._glTransformFeedbacks[r]=i,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,i);for(let i=0;i<e.buffers.length;i++){let a=e.buffers[i];a&&(n.buffer.update(a),a._glBuffers[r].refCount++,t.bindBufferBase(t.TRANSFORM_FEEDBACK_BUFFER,i,a._glBuffers[r].buffer||null))}return t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),i}disposeTransformFeedback(e,t){let n=e._glTransformFeedbacks[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this);let i=this.renderer.buffer;if(i)for(let n=0;n<e.buffers.length;n++){let r=e.buffers[n];if(!r)continue;let a=r._glBuffers[this.CONTEXT_UID];a&&(a.refCount--,a.refCount===0&&!t&&i.dispose(r,t))}n&&(t||r.deleteTransformFeedback(n),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}};dl.extension={type:G.RendererSystem,name:`transformFeedback`},Qa.add(dl);var fl=class{constructor(e){this.renderer=e}init(e){this.screen=new Io(0,0,e.width,e.height),this.element=e.view||W.ADAPTER.createCanvas(),this.resolution=e.resolution||W.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,t){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(t*this.resolution);let n=this.element.width/this.resolution,r=this.element.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.element.style.width=`${n}px`,this.element.style.height=`${r}px`),this.renderer.emit(`resize`,n,r),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){e&&this.element.parentNode?.removeChild(this.element),this.renderer=null,this.element=null,this.screen=null}};fl.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},fl.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:`_view`},Qa.add(fl),W.PREFER_ENV=er.WEBGL2,W.STRICT_TEXTURE_CACHE=!1,W.RENDER_OPTIONS={...qs.defaultOptions,...Ws.defaultOptions,...fl.defaultOptions,...Jc.defaultOptions},Object.defineProperties(W,{WRAP_MODE:{get(){return vo.defaultOptions.wrapMode},set(e){Fi(`7.1.0`,`settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode`),vo.defaultOptions.wrapMode=e}},SCALE_MODE:{get(){return vo.defaultOptions.scaleMode},set(e){Fi(`7.1.0`,`settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode`),vo.defaultOptions.scaleMode=e}},MIPMAP_TEXTURES:{get(){return vo.defaultOptions.mipmap},set(e){Fi(`7.1.0`,`settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap`),vo.defaultOptions.mipmap=e}},ANISOTROPIC_LEVEL:{get(){return vo.defaultOptions.anisotropicLevel},set(e){Fi(`7.1.0`,`settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel`),vo.defaultOptions.anisotropicLevel=e}},FILTER_RESOLUTION:{get(){return Fi(`7.1.0`,`settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution`),Us.defaultResolution},set(e){Us.defaultResolution=e}},FILTER_MULTISAMPLE:{get(){return Fi(`7.1.0`,`settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample`),Us.defaultMultisample},set(e){Us.defaultMultisample=e}},SPRITE_MAX_TEXTURES:{get(){return zs.defaultMaxTextures},set(e){Fi(`7.1.0`,`settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures`),zs.defaultMaxTextures=e}},SPRITE_BATCH_SIZE:{get(){return zs.defaultBatchSize},set(e){Fi(`7.1.0`,`settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize`),zs.defaultBatchSize=e}},CAN_UPLOAD_SAME_BUFFER:{get(){return zs.canUploadSameBuffer},set(e){Fi(`7.1.0`,`settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer`),zs.canU
490ploadSameBuffer=e}},GC_MODE:{get(){return ol.defaultMode},set(e){Fi(`7.1.0`,`settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode`),ol.defaultMode=e}},GC_MAX_IDLE:{get(){return ol.defaultMaxIdle},set(e){Fi(`7.1.0`,`settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle`),ol.defaultMaxIdle=e}},GC_MAX_CHECK_COUNT:{get(){return ol.defaultCheckCountMax},set(e){Fi(`7.1.0`,`settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax`),ol.defaultCheckCountMax=e}},PRECISION_VERTEX:{get(){return Ds.defaultVertexPrecision},set(e){Fi(`7.1.0`,`settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision`),Ds.defaultVertexPrecision=e}},PRECISION_FRAGMENT:{get(){return Ds.defaultFragmentPrecision},set(e){Fi(`7.1.0`,`settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision`),Ds.defaultFragmentPrecision=e}}});var pl=(e=>(e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`,e))(pl||{}),ml=class{constructor(e,t=null,n=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=n,this.once=r}match(e,t=null){return this.fn===e&&this.context===t}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));let t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}}
490,hl=class e{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 ml(null,null,1/0),this.deltaMS=1/e.targetFPMS,this.elapsedMS=1/e.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,n=pl.NORMAL){return this._addListener(new ml(e,t,n))}addOnce(e,t,n=pl.NORMAL){return this._addListener(new ml(e,t,n,!0))}_addListener(e){let t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this}remove(e,t){let n=this._head.next;for(;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){let e=t-this._lastFrame|0;if(e<this._minElapsedMS)return;this._lastFrame=t-e%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*e.targetFPMS;let r=this._head,i=r.next;for(;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){let n=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,n)/1e3,e.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!e._shared){let t=e._shared=new e;t.autoStart=!0,t._protected=!0}return e._shared}static get system(){if(!e._system){let t=e._system=new e;t.autoStart=!0,t._protected=!0}return e._system}};hl.targetFPMS=.06;var gl=hl;Object.defineProperties(W,{TARGET_FPMS:{get(){return gl.targetFPMS},set(e){Fi(`7.1.0`,`settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS`),gl.targetFPMS=e}}});var _l=class{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,pl.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?gl.shared:new gl,e.autoStart&&this.start()}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy()}}};_l.extension=G.Application,Qa.add(_l);var vl=[];Qa.handleByList(G.Renderer,vl);function yl(e){for(let t of vl)if(t.test(e))return new t(e);throw Error(`Unable to auto-detect a suitable renderer.`)}var bl=`attribute vec2 aVertexPosition;
491attribute vec2 aTextureCoord;
492
493uniform mat3 projectionMatrix;
494
495varying vec2 vTextureCoord;
496
497void main(void)
498{
499    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
499)).xy, 0.0, 1.0);
500    vTextureCoord = aTextureCoord;
501}`,xl=`attribute vec2 aVertexPosition;
502
503uniform mat3 projectionMatrix;
504
505varying vec2 vTextureCoord;
506
507uniform vec4 inputSize;
508uniform vec4 outputFrame;
509
510vec4 filterVertexPosition( void )
511{
512    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
513
514    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
515}
516
517vec2 filterTextureCoord( void )
518{
519    return aVertexPosition * (outputFrame.zw * inputSize.zw);
520}
521
522void main(void)
523{
524    gl_Position = filterVertexPosition();
525    vTextureCoord = filterTextureCoord();
526}
527`,Sl=bl,Cl=xl,wl=class{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){let n=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,n)}else{let n=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n)}t>=hr.HIGH?this.multisample=hr.HIGH:t>=hr.MEDIUM?this.multisample=hr.MEDIUM:t>=hr.LOW?this.multisample=hr.LOW:this.multisample=hr.NONE}destroy(){}};wl.extension={type:G.RendererSystem,name:`_multisample`},Qa.add(wl);var Tl=class{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}},El=class{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){let{gl:t,CONTEXT_UID:n}=this,r=e._glBuffers[n]||this.createGLBuffer(e);t.bindBuffer(e.type,r.buffer)}unbind(e){let{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){let{gl:n,CONTEXT_UID:r}=this;if(this.boundBufferBases[t]!==e){let i=e._glBuffers[r]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,i.buffer)}}bindBufferRange(e,t,n){let{gl:r,CONTEXT_UID:i}=this;n||=0;let a=e._glBuffers[i]||this.createGLBuffer(e);r.bindBufferRange(r.UNIFORM_BUFFER,t||0,a.buffer,n*256,256)}update(e){let{gl:t,CONTEXT_UID:n}=this,r=e._glBuffers[n]||this.createGLBuffer(e);if(e._updateID!==r.updateID)if(r.updateID=e._updateID,t.bindBuffer(e.type,r.buffer),r.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{let n=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,n)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];let n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){let t=Object.keys(this.managedBuffers);for(let n=0;n<t.length;n++)this.dispose(this.managedBuffers[t[n]],e)}createGLBuffer(e){let{CONTEXT_UID:t,gl:n}=this;return e._glBuffers[t]=new Tl(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[t]}};El.extension={type:G.RendererSystem,name:`buffer`},Qa.add(El);var Dl=class{constructor(e){this.renderer=e}render(e,t){let n=this.renderer,r,i,a,o;if(t&&(r=t.renderTexture,i=t.clear,a=t.transform,o=t.skipUpdateTransform),this.renderingToScreen=!r,n.runners.prerender.emit(),n.emit(`prerender`),n.projection.transform=a,!n.context.isLost){if(r||(this.lastObjectRendered=e),!o){let t=e.enableTempParent();e.updateTransform(),e.disableTempParent(t)}n.renderTexture.bind(r),n.batch.currentRenderer.start(),(i??n.background.clearBeforeRender)&&n.renderTexture.clear(),e.render(n),n.batch.currentRenderer.flush(),r&&(t.blit&&n.framebuffer.blit(),r.baseTexture.update()),n.runners.postrender.emit(),n.projection.transform=null,n.emit(`postrender`)}}destroy(){this.renderer=null,this.lastObjectRendered=null}};Dl.extension={type:G.RendererSystem,name:`objectRenderer`},Qa.add(Dl);var Ol=class e extends il{constructor(t){super(),this.type=tr.WEBGL,t=Object.assign({},W.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new ks({projectionMatrix:new Vo},!0);let n={runners:[`init`,`destroy`,`contextChange`,`resolutionChange`,`reset`,`update`,`postrender`,`prerender`,`resize`],systems:e.__systems,priority:[`_view`,`textureGenerator`,`background`,`_plugin`,`startup`,`context`,`state`,`texture`,`buffer`,`geometry`,`framebuffer`,`transformFeedback`,`mask`,`scissor`,`stencil`,`projection`,`textureGC`,`filter`,`renderTexture`,`batch`,`objectRenderer`,`_multisample`]};
527this.setup(n),`useContextAlpha`in t&&(Fi(`7.0.0`,`options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead`),t.premultipliedAlpha=t.useContextAlpha&&t.useContextAlpha!==`notMultiplied`,t.backgroundAlpha=t.useContextAlpha===!1?1:t.backgroundAlpha),this._plugin.rendererPlugins=e.__plugins,this.options=t,this.startup.run(this.options)}static test(e){return!e?.forceCanvas&&Gi()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return Fi(`7.0.0`,`renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead.`),this.background.clearBeforeRender}get useContextAlpha(){return Fi(`7.0.0`,`renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead.`),this.context.useContextAlpha}get preserveDrawingBuffer(){return Fi(`7.0.0`,`renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context`),this.context.preserveDrawingBuffer}get backgroundColor(){return Fi(`7.0.0`,`renderer.backgroundColor has been deprecated, use renderer.background.color instead.`),this.background.color}set backgroundColor(e){Fi(`7.0.0`,`renderer.backgroundColor has been deprecated, use renderer.background.color instead.`),this.background.color=e}get backgroundAlpha(){return Fi(`7.0.0`,`renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead.`),this.background.alpha}set backgroundAlpha(e){Fi(`7.0.0`,`renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead.`),this.background.alpha=e}get powerPreference(){return Fi(`7.0.0`,`renderer.powerPreference has been deprecated, we can only know this if pixi creates the context`),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};Ol.extension={type:G.Renderer,priority:1},Ol.__plugins={},Ol.__systems={};var kl=Ol;
527Qa.handleByMap(G.RendererPlugin,kl.__plugins),Qa.handleByMap(G.RendererSystem,kl.__systems),Qa.add(kl);var Al=class extends mo{constructor(e,t){let{width:n,height:r}=t||{};super(n,r),this.items=[],this.itemDirtyIds=[];for(let t=0;t<e;t++){let e=new vo;this.items.push(e),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,t){for(let n=0;n<this.length;n++)e[n]&&(e[n].castToBaseTexture?this.addBaseTextureAt(e[n].castToBaseTexture(),n):e[n]instanceof mo?this.addResourceAt(e[n],n):this.addResourceAt(fo(e[n],t),n))}dispose(){for(let e=0,t=this.length;e<t;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,t){if(!this.items[t])throw Error(`Index ${t} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[t].setResource(e),this}bind(e){if(this.baseTexture!==null)throw Error(`Only one base texture per TextureArray is allowed`);super.bind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=e,this.items[t].on(`update`,e.update,e)}unbind(e){super.unbind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=null,this.items[t].off(`update`,e.update,e)}load(){if(this._load)return this._load;let e=this.items.map(e=>e.resource).filter(e=>e).map(e=>e.load());return this._load=Promise.all(e).then(()=>{let{realWidth:e,realHeight:t}=this.items[0];return this.resize(e,t),this.update(),Promise.resolve(this)}),this._load}},jl=class extends Al{constructor(e,t){let{width:n,height:r}=t||{},i,a;Array.isArray(e)?(i=e,a=e.length):a=e,super(a,{width:n,height:r}),i&&this.initFromArray(i,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw Error(`ArrayResource does not support RenderTexture`);return this}bind(e){super.bind(e),e.target=ar.TEXTURE_2D_ARRAY}upload(e,t,n){let{length:r,itemDirtyIds:i,items:a}=this,{gl:o}=e;n.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,r,0,t.format,n.type,null);for(let e=0;e<r;e++){let r=a[e];i[e]<r.dirtyId&&(i[e]=r.dirtyId,r.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,e,r.resource.width,r.resource.height,1,t.format,n.type,r.resource.source))}return!0}},Ml=class extends Xs{constructor(e){super(e)}static test(e){let{OffscreenCanvas:t}=globalThis;return t&&e instanceof t?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}},Nl=class e extends Al{constructor(t,n){let{width:r,height:i,autoLoad:a,linkBaseTexture:o}=n||{};if(t&&t.length!==e.SIDES)throw Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:r,height:i});for(let t=0;t<e.SIDES;t++)this.items[t].target=ar.TEXTURE_CUBE_MAP_POSITIVE_X+t;this.linkBaseTexture=o!==!1,t&&this.initFromArray(t,n),a!==!1&&this.load()}bind(e){super.bind(e),e.target=ar.TEXTURE_CUBE_MAP}addBaseTextureAt(e,t,n){if(n===void 0&&(n=this.linkBaseTexture),!this.items[t])throw Error(`Index ${t} is out of bounds`);if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,t);else throw Error(`CubeResource does not support copying of renderTexture.`);else e.target=ar.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(t,n,r){let i=this.itemDirtyIds;for(let a=0;a<e.SIDES;a++){let e=this.items[a];(i[a]<e.dirtyId||r.dirtyId<n.dirtyId)&&(e.valid&&e.resource?(e.resource.upload(t,e,r),i[a]=e.dirtyId):i[a]<-1&&(t.gl.texImage2D(e.target,0,r.internalFormat,n.realWidth,n.realHeight,0,n.format,r.type,null),i[a]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===e.SIDES}};Nl.SIDES=6;var Pl=Nl,Fl=class e extends Xs{constructor(t,n){n||={};let r,i,a;typeof t==`string`?(r=e.EMPTY,i=t,a=!0):(r=t,i=null,a=!1),super(r),this.url=i,this.crossOrigin=n.crossOrigin??!0,this.alphaMode=typeof n.alphaMode==`number`?n.alphaMode:null,this.ownsImageBitmap=n.ownsImageBitmap??a,this._load=null,n.autoLoad!==!1&&this.load()}load(){return this._load||=new Promise(async(e,t)=>{if(this.url===null){e(this);return}try{let t=await W.ADAPTER.fetch(this.url,{mode:this.crossOrigin?`cors`:`no-cors`});if(this.destroyed)return;let n=await t.blob();if(this.destroyed)return;let r=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===ur.UNPACK?`premultiply`:`none`});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(e){if(this.destroyed)return;t(e),this.onError.emit(e)}}),this._load}upload(e,t,n){return this.source instanceof ImageBitmap?(typeof this.alphaMode==`number`&&(t.alphaMode=this.alphaMode),super.upload(e,t,n)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<`u`&&(typeof e==`string`||e instanceof ImageBitmap)}static get EMPTY(){return e._EMPTY=e._EMPTY??W.ADAPTER.createCanvas(0,0),e._EMPTY}},Il=class e extends Xs{constructor(e,t){t||={},super(W.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load||=new Promise(t=>{if(this._resolve=()=>{this.update(),t(this)},e.SVG_XML.test(this.svg.trim())){if(!btoa)throw Error(`Your browser doesn't support base64 conversions.`);this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load}_loadSvg(){let e=new Image;Xs.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>
527{if(!this._resolve)return;let t=e.width,n=e.height;if(!t||!n)throw Error(`The SVG image must have width and height defined (in pixels), canvas API needs them.`);let r=t*this.scale,i=n*this.scale;(this._overrideWidth||this._overrideHeight)&&(r=this._overrideWidth||this._overrideHeight/n*t,i=this._overrideHeight||this._overrideWidth/t*n),r=Math.round(r),i=Math.round(i);let a=this.source;a.width=r,a.height=i,a._pixiId=`canvas_${La()}`,a.getContext(`2d`).drawImage(e,0,0,t,n,0,0,r,i),this._resolve(),this._resolve=null}}static getSize(t){let n=e.SVG_SIZE.exec(t),r={};return n&&(r[n[1]]=Math.round(parseFloat(n[3])),r[n[5]]=Math.round(parseFloat(n[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,n){return n===`svg`||typeof t==`string`&&t.startsWith(`data:image/svg+xml`)||typeof t==`string`&&e.SVG_XML.test(t)}};Il.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Il.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var Ll=Il,Rl=class extends Xs{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}},zl=class e extends Xs{constructor(t,n){if(n||={},!(t instanceof HTMLVideoElement)){let r=document.createElement(`video`);n.autoLoad!==!1&&r.setAttribute(`preload`,`auto`),n.playsinline!==!1&&(r.setAttribute(`webkit-playsinline`,``),r.setAttribute(`playsinline`,``)),n.muted===!0&&(r.setAttribute(`muted`,``),r.muted=!0),n.loop===!0&&r.setAttribute(`loop`,``),n.autoPlay!==!1&&r.setAttribute(`autoplay`,``),typeof t==`string`&&(t=[t]);let i=t[0].src||t[0];Xs.crossOrigin(r,i,n.crossorigin);for(let n=0;n<t.length;++n){let i=document.createElement(`source`),{src:a,mime:o}=t[n];if(a||=t[n],a.startsWith(`data:`))o=a.slice(5,a.indexOf(`;`));else if(!a.startsWith(`blob:`)){let t=a.split(`?`).shift().toLowerCase(),n=t.slice(t.lastIndexOf(`.`)+1);o=o||e.MIME_TYPES[n]||`video/${n}`}i.src=a,o&&(i.type=o),r.appendChild(i)}t=r}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=n.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=n.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),n.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){if(this._updateFPS){let e=gl.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;let e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._onCanPlay():(e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlay),e.addEventListener(`error`,this._onError,!0)),this._load=new Promise((t,n)=>{this.valid?t(this):(this._resolve=t,this._reject=n,e.load())}),this._load}_onError(e){this.source.removeEventListener(`error`,this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){let e=this.source;e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlay);let t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();let e=this.source;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlay),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(gl.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(gl.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(gl.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,n){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.includes(n)}};zl.TYPES=[`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`h264`,`avi`,`mov`],zl.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var Bl=zl;uo.push(Fl,Zs,Ml,Bl,Rl,Ll,ho,Pl,jl);var Vl=class{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?Io.EMPTY:(e||=new Io(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,t){let{a:n,b:r,c:i,d:a,tx:o,ty:s}=e,c=n*t.x+i*t.y+o,l=r*t.x+a*t.y+s;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)}addQuad(e){let t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,a=e[0],o=e[1];t=a<t?a:t,n=o<n?o:n,r=a>r?a:r,i=o>i?o:i,a=e[2],o=e[3],t=a<t?a:t,n=o<n?o:n,r=a>r?a:r,i=o>
vendor: 1,230 bytes, line 527
527i?o:i,a=e[4],o=e[5],t=a<t?a:t,n=o<n?o:n,r=a>r?a:r,i=o>i?o:i,a=e[6],o=e[7],t=a<t?a:t,n=o<n?o:n,r=a>r?a:r,i=o>i?o:i,this.minX=t,this.minY=n,this.maxX=r,this.maxY=i}addFrame(e,t,n,r,i){this.addFrameMatrix(e.worldTransform,t,n,r,i)}addFrameMatrix(e,t,n,r,i){let a=e.a,o=e.b,s=e.c,c=e.d,l=e.tx,u=e.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,h=a*t+s*n+l,g=o*t+c*n+u;d=h<d?h:d,f=g<f?g:f,p=h>p?h:p,m=g>m?g:m,h=a*r+s*n+l,g=o*r+c*n+u,d=h<d?h:d,f=g<f?g:f,p=h>p?h:p,m=g>m?g:m,h=a*t+s*i+l,g=o*t+c*i+u,d=h<d?h:d,f=g<f?g:f,p=h>p?h:p,m=g>m?g:m,h=a*r+s*i+l,g=o*r+c*i+u,d=h<d?h:d,f=g<f?g:f,p=h>p?h:p,m=g>m?g:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(e,t,n){let r=this.minX,i=this.minY,a=this.maxX,o=this.maxY;for(let s=t;s<n;s+=2){let t=e[s],n=e[s+1];r=t<r?t:r,i=n<i?n:i,a=t>a?t:a,o=n>o?n:o}this.minX=r,this.minY=i,this.maxX=a,this.maxY=o}addVertices(e,t,n,r){this.addVerticesMatrix(e.worldTransform,t,n,r)}addVerticesMatrix(e,t,n,r,i=0,a=i){let o=e.a,s=e.b,c=e.c,l=e.d,u=e.tx,d=e.ty,f=this.minX,p=this.minY,m=this.maxX,h=this.maxY;for(let e=n;e<r;e+=2){let n=t[e],r=t[e+1],g=o*n+c*r+u,_=l*r+s*n+d;f=Math.min(f,g-i),m=Math.max(m,g+i),p=Math.min(p,_-a),h=Math.max(h,_+a)}this.minX=f,this.minY=p,this.maxX=m,this.maxY=h}
527addBounds(e){let t=this.minX,n=this.minY,r=this.maxX,i=this.maxY;this.minX=e.minX<t?e.minX:t,this.minY=e.minY<n?e.minY:n,this.maxX=e.maxX>r?e.maxX:r,this.maxY=e.maxY>i?e.maxY:i}addBoundsMask(e,t){let n=e.minX>t.minX?e.minX:t.minX,r=e.minY>t.minY?e.minY:t.minY,i=e.maxX<t.maxX?e.maxX:t.maxX,a=e.maxY<t.maxY?e.maxY:t.maxY;if(n<=i&&r<=a){let e=this.minX,t=this.minY,o=this.maxX,s=this.maxY;this.minX=n<e?n:e,this.minY=r<t?r:t,this.maxX=i>o?i:o,this.maxY=a>s?a:s}}addBoundsMatrix(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,t){let n=e.minX>t.x?e.minX:t.x,r=e.minY>t.y?e.minY:t.y,i=e.maxX<t.x+t.width?e.maxX:t.x+t.width,a=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(n<=i&&r<=a){let e=this.minX,t=this.minY,o=this.maxX,s=this.maxY;this.minX=n<e?n:e,this.minY=r<t?r:t,this.maxX=i>o?i:o,this.maxY=a>s?a:s}}pad(e=0,t=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)}addFramePad(e,t,n,r,i,a){e-=i,t-=a,n+=i,r+=a,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<t?this.minY:t,this.maxY=this.maxY>r?this.maxY:r}},Hl=class e extends Mi.default{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new $o,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Vl,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){let n=Object.keys(t);for(let r=0;r<n.length;++r){let i=n[r];Object.defineProperty(e.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,t){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),t||=(this._boundsRect||=new Io,this._boundsRect),this._bounds.getRectangle(t)}getLocalBounds(e){e||=(this._localBoundsRect||=new Io,this._localBoundsRect),this._localBounds||=new Vl;let t=this.transform,n=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=n?.worldAlpha??1,this.transform=this._tempDisplayObjectParent.transform;let r=this._bounds,i=this._boundsID;this._bounds=this._localBounds;let a=this.getBounds(!1,e);return this.parent=n,this.transform=t,this._bounds=r,this._bounds.updateID+=this._boundsID-i,a}toGlobal(e,t,n=!1){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,t)}toLocal(e,t,n,r){return t&&(e=t.toGlobal(e,n,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)}setParent(e){if(!e||!e.addChild)throw Error(`setParent: Argument must be a Container`);return e.addChild(this),e}removeFromParent(){this.parent?.removeChild(this)}setTransform(e=0,t=0,n=1,r=1,i=0,a=0,o=0,s=0,c=0){return this.position.x=e,this.position.y=t,this.scale.x=n||1,this.scale.y=r||1,this.rotation=i,this.skew.x=a,this.skew.y=o,this.pivot.x=s,this.pivot.y=c,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode=`auto`,this.interactiveChildren=!1,this.emit
527(`destroyed`),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new Ul),this.tempDisplayObjectParent}enableTempParent(){let e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*jo}set angle(e){this.transform.rotation=e*Mo}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex!==e&&(this._zIndex=e,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){let e=this._mask.isMaskData?this._mask.maskObject:this._mask;e&&(e._maskRefCount--,e._maskRefCount===0&&(e.renderable=!0,e.isMask=!1))}if(this._mask=e,this._mask){let e=this._mask.isMaskData?this._mask.maskObject:this._mask;e&&(e._maskRefCount===0&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++)}}}},Ul=class extends Hl{constructor(){super(...arguments),this.sortDirty=null}};Hl.prototype.displayObjectUpdateTransform=Hl.prototype.updateTransform;var Wl=new Vo;function Gl(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}var Kl=class e extends Hl{constructor(){super(),this.children=[],this.sortableChildren=e.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(e){}addChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.addChild(e[t]);else{let t=e[0];t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit(`childAdded`,t,this,this.children.length-1),t.emit(`added`,this)}return e[0]}addChildAt(e,t){if(t<0||t>this.children.length)throw Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit(`added`,this),this.emit(`childAdded`,e,this,t),e}swapChildren(e,t){if(e===t)return;let n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e,this.onChildrenChange(n<r?n:r)}getChildIndex(e){let t=this.children.indexOf(e);if(t===-1)throw Error(`The supplied DisplayObject must be a child of the caller`);return t}setChildIndex(e,t){if(t<0||t>=this.children.length)throw Error(`The index ${t} supplied is out of bounds ${this.children.length}`);let n=this.getChildIndex(e);Pa(this.children,n,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.removeChild(e[t]);else{let t=e[0],n=this.children.indexOf(t);if(n===-1)return null;t.parent=null,t.transform._parentID=-1,Pa(this.children,n,1),this._boundsID++,this.onChildrenChange(n),t.emit(`removed`,this),this.emit(`childRemoved`,t,this,n)}return e[0]}removeChildAt(e){let t=this.getChildAt(e);return t.parent=null,t.transform._parentID=-1,Pa(this.children,e,1),this._boundsID++,this.onChildrenChange(e),t.emit(`removed`,this),this.emit(`childRemoved`,t,this,e),t}removeChildren(e=0,t=this.children.length){let n=e,r=t,i=r-n,a;if(i>0&&i<=r){a=this.children.splice(n,i);for(let e=0;e<a.length;++e)a[e].parent=null,a[e].transform&&(a[e].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(let e=0;e<a.length;
527++e)a[e].emit(`removed`,this),this.emit(`childRemoved`,a[e],this,e);return a}else if(i===0&&this.children.length===0)return[];throw RangeError(`removeChildren: numeric values are outside the acceptable range.`)}sortChildren(){let e=!1;for(let t=0,n=this.children.length;t<n;++t){let n=this.children[t];n._lastSortedIndex=t,!e&&n.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(Gl),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e<t;++e){let t=this.children[e];t.visible&&t.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let e=0;e<this.children.length;e++){let t=this.children[e];if(!(!t.visible||!t.renderable))if(t.calculateBounds(),t._mask){let e=t._mask.isMaskData?t._mask.maskObject:t._mask;e?(e.calculateBounds(),this._bounds.addBoundsMask(t._bounds,e._bounds)):this._bounds.addBounds(t._bounds)}else t.filterArea?this._bounds.addBoundsArea(t._bounds,t.filterArea):this._bounds.addBounds(t._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(e,t=!1){let n=super.getLocalBounds(e);if(!t)for(let e=0,t=this.children.length;e<t;++e){let t=this.children[e];t.visible&&t.updateTransform()}return n}_calculateBounds(){}_renderWithCulling(t){let n=t.renderTexture.sourceFrame;if(!(n.width>0&&n.height>0))return;let r,i;this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==e.prototype._render&&(r=this.getBounds(!0));let a=t.projection.transform;if(a&&(i?(i=Wl.copyFrom(i),i.prepend(a)):i=a),r&&n.intersects(r,i))this._render(t);else if(this.cullArea)return;for(let e=0,n=this.children.length;e<n;++e){let n=this.children[e],r=n.cullable;n.cullable=r||!this.cullArea,n.render(t),n.cullable=r}}render(e){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters?.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(let t=0,n=this.children.length;t<n;++t)this.children[t].render(e)}}renderAdvanced(e){let t=this.filters,n=this._mask;if(t){this._enabledFilters||=[],this._enabledFilters.length=0;for(let e=0;e<t.length;e++)t[e].enabled&&this._enabledFilters.push(t[e])}let r=t&&this._enabledFilters?.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==mr.NONE));if(r&&e.batch.flush(),t&&this._enabledFilters?.length&&e.filter.push(this,this._enabledFilters),n&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(let t=0,n=this.children.length;t<n;++t)this.children[t].render(e)}r&&e.batch.flush(),n&&e.mask.pop(this),t&&this._enabledFilters?.length&&e.filter.pop()}_render(e){}destroy(e){super.destroy(),this.sortDirty=!1;let t=typeof e==`boolean`?e:e?.children,n=this.removeChildren(0,this.children.length);if(t)for(let t=0;t<n.length;++t)n[t].destroy(e)}get width(){return this.scale.x*this.getLocalBounds().width}set width(e){let t=this.getLocalBounds().width;t===0?this.scale.x=1:this.scale.x=e/t,this._width=e}get height(){return this.scale.y*this.getLocalBounds().height}set height(e){let t=this.getLocalBounds().height;t===0?this.scale.y=1:this.scale.y=e/t,this._height=e}};Kl.defaultSortableChildren=!1;var ql=Kl;ql.prototype.containerUpdateTransform=ql.prototype.updateTransform,Object.defineProperties(W,{SORTABLE_CHILDREN:{get(){return ql.defaultSortableChildren},set(e){Fi(`7.1.0`,`settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren`),ql.defaultSortableChildren=e}}});var Jl=new Po,Yl=new Uint16Array([0,1,2,0,2,3]),Xl=class e extends ql{constructor(e){super(),this._anchor=new Zo(this._onAnchorUpdate,this,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Ca(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=rr.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=e||K.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=Yl,this.pluginName=`batch`,this.isSprite=!0,this._roundPixels=W.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Fa(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Fa(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){let e=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===e._updateID)return;this._textureID!==e._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=e._updateID;let t=this.transform.worldTransform,n=t.a,r=t.b,i=t.c,a=t.d,o=t.tx,s=t.ty,c=this.vertexData,l=e.trim,u=e.orig,d=this._anchor,f=0,p=0,m=0,h=0;if(l?(p=l.x-d._x*u.width,f=p+l.width,h=l.y-d._y*u.height,m=h+l.height):(p=-d._x*u.width,f=p+u.width,h=-d._y*u.height,m=h+u.height),c[0]=n*p+i*h+o,c[1]=a*h+r*p+s,c[2]=n*f+i*h+o,c[3]=a*h+r*f+s,c[4]=n*f+i*m+o,c[5]=a*m+r*f+s,c[6]=n*p+i*m+o,c[7]=a*m+r*p+s,this._roundPixels){let e=W.RESOLUTION;for(let t=0;t<c.length;++t)c[t]=Math.round(c[t]*e)/e}}
527calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;let e=this._texture,t=this.vertexTrimmedData,n=e.orig,r=this._anchor,i=this.transform.worldTransform,a=i.a,o=i.b,s=i.c,c=i.d,l=i.tx,u=i.ty,d=-r._x*n.width,f=d+n.width,p=-r._y*n.height,m=p+n.height;if(t[0]=a*d+s*p+l,t[1]=c*p+o*d+u,t[2]=a*f+s*p+l,t[3]=c*p+o*f+u,t[4]=a*f+s*m+l,t[5]=c*m+o*f+u,t[6]=a*d+s*m+l,t[7]=c*m+o*d+u,this._roundPixels){let e=W.RESOLUTION;for(let n=0;n<t.length;++n)t[n]=Math.round(t[n]*e)/e}}_render(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)}_calculateBounds(){let e=this._texture.trim,t=this._texture.orig;!e||e.width===t.width&&e.height===t.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(e){return this.children.length===0?(this._localBounds||=new Vl,this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||=(this._localBoundsRect||=new Io,this._localBoundsRect),this._localBounds.getRectangle(e)):super.getLocalBounds.call(this,e)}containsPoint(e){this.worldTransform.applyInverse(e,Jl);let t=this._texture.orig.width,n=this._texture.orig.height,r=-t*this.anchor.x,i=0;return Jl.x>=r&&Jl.x<r+t&&(i=-n*this.anchor.y,Jl.y>=i&&Jl.y<i+n)}destroy(e){if(super.destroy(e),this._texture.off(`update`,this._onTextureUpdate,this),this._anchor=null,typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.baseTexture;this._texture.destroy(!!t)}this._texture=null}static from(t,n){let r=t instanceof K?t:K.from(t,n);return new e(r)}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){let t=Fa(this.scale.x)||1;this.scale.x=t*e/this._texture.orig.width,this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){let t=Fa(this.scale.y)||1;this.scale.y=t*e/this._texture.orig.height,this._height=e}get anchor(){return this._anchor}set anchor(e){this._anchor.copyFrom(e)}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this._texture.off(`update`,this._onTextureUpdate,this),this._texture=e||K.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once(`update`,this._onTextureUpdate,this)))}},Zl=new Vo;Hl.prototype._cacheAsBitmap=!1,Hl.prototype._cacheData=null,Hl.prototype._cacheAsBitmapResolution=null,Hl.prototype._cacheAsBitmapMultisample=null;var Ql=class{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}};Object.defineProperties(Hl.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(e){e!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=e,this.cacheAsBitmap&&=(this.cacheAsBitmap=!1,!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(e){e!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=e,this.cacheAsBitmap&&=(this.cacheAsBitmap=!1,!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(e){if(this._cacheAsBitmap===e)return;this._cacheAsBitmap=e;let t;e?(this._cacheData||=new Ql,t=this._cacheData,t.originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(t=this._cacheData,t.sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea)}}}),Hl.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},Hl.prototype._initCachedDisplayObject=function(e){if(this._cacheData?.sprite)return;let t=this.alpha;this.alpha=1,e.batch.flush();let n=this.getLocalBounds(new Io,!0);if(this.filters?.length){let e=this.filters[0].padding;n.pad(e)}let r=this.cacheAsBitmapResolution||e.resolution;n.ceil(r),n.width=Math.max(n.width,1/r),n.height=Math.max(n.height,1/r);let i=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),o=e.renderTexture.destinationFrame.clone(),s=e.projection.transform,c=tc.create({width:n.width,height:n.height,resolution:r,multisample:this.cacheAsBitmapMultisample??e.multisample}),l=`cacheAsBitmap_${La()}`;this._cacheData.textureCacheId=l,vo.addToCache(c.baseTexture,l),K.addToCache(c,l);let u=this.transform.localTransform.copyTo(Zl).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:c,clear:!0,transform:u,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=s,e.renderTexture.bind(i,a,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=t;let d=new Xl(c);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-(n.x/n.width),d.anch
527or.y=-(n.y/n.height),d.alpha=t,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)},Hl.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},Hl.prototype._initCachedDisplayObjectCanvas=function(e){if(this._cacheData?.sprite)return;let t=this.getLocalBounds(new Io,!0),n=this.alpha;this.alpha=1;let r=e.canvasContext.activeContext,i=e._projTransform,a=this.cacheAsBitmapResolution||e.resolution;t.ceil(a),t.width=Math.max(t.width,1/a),t.height=Math.max(t.height,1/a);let o=tc.create({width:t.width,height:t.height,resolution:a}),s=`cacheAsBitmap_${La()}`;this._cacheData.textureCacheId=s,vo.addToCache(o.baseTexture,s),K.addToCache(o,s);let c=Zl;this.transform.localTransform.copyTo(c),c.invert(),c.tx-=t.x,c.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,clear:!0,transform:c,skipUpdateTransform:!1}),e.canvasContext.activeContext=r,e._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;let l=new Xl(o);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-(t.x/t.width),l.anchor.y=-(t.y/t.height),l.alpha=n,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)},Hl.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Hl.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Hl.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,vo.removeFromCache(this._cacheData.textureCacheId),K.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Hl.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},Hl.prototype.name=null,ql.prototype.getChildByName=function(e,t){for(let t=0,n=this.children.length;t<n;t++)if(this.children[t].name===e)return this.children[t];if(t)for(let t=0,n=this.children.length;t<n;t++){let n=this.children[t];if(!n.getChildByName)continue;let r=n.getChildByName(e,!0);if(r)return r}return null},Hl.prototype.getGlobalPosition=function(e=new Po,t=!1){return this.parent?this.parent.toGlobal(this.position,e,t):(e.x=this.position.x,e.y=this.position.y),e};var $l=`varying vec2 vTextureCoord;
528
529uniform sampler2D uSampler;
530uniform float uAlpha;
531
532void main(void)
533{
534   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
535}
536`,eu=class extends Us{constructor(e=1){super(Sl,$l,{uAlpha:1}),this.alpha=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}},tu={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},nu=[`varying vec2 vBlurTexCoords[%size%];`,`uniform sampler2D uSampler;`,`void main(void)`,`{`,`    gl_FragColor = vec4(0.0);`,`    %blur%`,`}`].join(`
537`);function ru(e){let t=tu[e],n=t.length,r=nu,i=``,a;for(let r=0;r<e;r++){let o=`gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;`.replace(`%index%`,r.toString());a=r,r>=n&&(a=e-r-1),o=o.replace(`%value%`,t[a].toString()),i+=o,i+=`
538`}return r=r.replace(`%blur%`,i),r=r.replace(`%size%`,e.toString()),r}var iu=`
539    attribute vec2 aVertexPosition;
540
541    uniform mat3 projectionMatrix;
542
543    uniform float strength;
544
545    varying vec2 vBlurTexCoords[%size%];
546
547    uniform vec4 inputSize;
548    uniform vec4 outputFrame;
549
550    vec4 filterVertexPosition( void )
551    {
552        vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
553
554        return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
555    }
556
557    vec2 filterTextureCoord( void )
558    {
559        return aVertexPosition * (outputFrame.zw * inputSize.zw);
560    }
561
562    void main(void)
563    {
564        gl_Position = filterVertexPosition();
565
566        vec2 textureCoord = filterTextureCoord();
567        %blur%
568    }`;function au(e,t){let n=Math.ceil(e/2),r=iu,i=``,a;a=t?`vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);`:`vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);`;for(let t=0;t<e;t++){let e=a.replace(`%index%`,t.toString());e=e.replace(`%sampleIndex%`,`${t-(n-1)}.0`),i+=e,i+=`
569`}return r=r.replace(`%blur%`,i),r=r.replace(`%size%`,e.toString()),r}var ou=class extends Us{constructor(e,t=8,n=4,r=Us.defaultResolution,i=5){let a=au(i,e),o=ru(i);super(a,o),this.horizontal=e,this.resolution=r,this._quality=0,this.quality=n,this.blur=t}apply(e,t,n,r){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/t.width):this.uniforms.strength=1/n.height*(n.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,t,n,r);else{let i=e.getFilterTexture(),a=e.renderer,o=t,s=i;this.state.blend=!1,e.applyFilter(this,o,s,dr.CLEAR);for(let t=1;t<this.passes-1;t++){e.bindAndClear(o,dr.BLIT),this.uniforms.uSampler=s;let t=s;s=o,o=t,a.shader.bind(this),a.geometry.draw(5)}this.state.blend=!0,e.applyFilter(this,s,n,r),e.returnFilterTexture(i)}}get blur(){return this.strength}set blur(e){this.padding=1+Math.abs(e)*2,this.strength=e}get quality(){return this._quality}set quality(e){this._quality=e,this.passes=e}},su=class extends Us{constructor(e=8,t=4,n=Us.defaultResolution,r=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new ou(!0,e,t,n,r),this.blurYFilter=new ou(!1,e,t,n,r),this.resolution=n,this.quality=t,this.blur=e,this.repeatEdgePixels=!1}apply(e,t,n,r){let i=Math.abs(this.blurXFilter.strength),a=Math.abs(this.blurYFilter.strength);if(i&&a){let i=e.getFilterTexture();this.blurXFilter.apply(e,t,i,dr.CLEAR),this.blurYFilter.apply(e,i,n,r),e.returnFilterTexture(i)}else a?this.blurYFilter.apply(e,t,n,r):this.blurXFilter.apply(e,t,n,r)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2}get blur(){return this.blurXFilter.blur}set blur(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(e){this.blurXFilter.quality=this.blurYFilter.quality=e}get blurX(){return this.blurXFilter.blur}set blurX(e){this.blurXFilter.blur=e,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(e){this.blurYFilter.blur=e,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(e){this.blurYFilter.blendMode=e}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(e){this._repeatEdgePixels=e,this.updatePadding()}},cu=`varying vec2 vTextureCoord;
570uniform sampler2D uSampler;
571uniform float m[20];
572uniform float uAlpha;
573
574void main(void)
575{
576    vec4 c = texture2D(uSampler, vTextureCoord);
577
578    if (uAlpha == 0.0) {
579        gl_FragColor = c;
580        return;
581    }
582
583    // Un-premultiply alpha before applying the color matrix. See issue #3539.
584    if (c.a > 0.0) {
585      c.rgb /= c.a;
586    }
587
588    vec4 result;
589
590    result.r = (m[0] * c.r);
591        result.r += (m[1] * c.g);
592        result.r += (m[2] * c.b);
593        result.r += (m[3] * c.a);
594        result.r += m[4];
595
596    result.g = (m[5] * c.r);
597        result.g += (m[6] * c.g);
598        result.g += (m[7] * c.b);
599        result.g += (m[8] * c.a);
600        result.g += m[9];
601
602    result.b = (m[10] * c.r);
603       result.b += (m[11] * c.g);
604       result.b += (m[12] * c.b);
605       result.b += (m[13] * c.a);
606       result.b += m[14];
607
608    result.a = (m[15] * c.r);
609       result.a += (m[16] * c.g);
610       result.a += (m[17] * c.b);
611       result.a += (m[18] * c.a);
612       result.a += m[19];
613
614    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);
615
616    // Premultiply alpha again.
617    rgb *= result.a;
618
619    gl_FragColor = vec4(rgb, result.a);
620}
621`,lu=class extends Us{constructor(){let e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(Cl,cu,e),this.alpha=1}_loadMatrix(e,t=!1){let n=e;t&&(this._multiply(n,this.uniforms.m,e),n=this._colorMatrix(n)),this.uniforms.m=n}_multiply(e,t,n){return e[0]=t[0]*n[0]+t[1]*n[5]+t[2]*n[10]+t[3]*n[15],e[1]=t[0]*n[1]+t[1]*n[6]+t[2]*n[11]+t[3]*n[16],e[2]=t[0]*n[2]+t[1]*n[7]+t[2]*n[12]+t[3]*n[17],e[3]=t[0]*n[3]+t[1]*n[8]+t[2]*n[13]+t[3]*n[18],e[4]=t[0]*n[4]+t[1]*n[9]+t[2]*n[14]+t[3]*n[19]+t[4],e[5]=t[5]*n[0]+t[6]*n[5]+t[7]*n[10]+t[8]*n[15],e[6]=t[5]*n[1]+t[6]*n[6]+t[7]*n[11]+t[8]*n[16],e[7]=t[5]*n[2]+t[6]*n[7]+t[7]*n[12]+t[8]*n[17],e[8]=t[5]*n[3]+t[6]*n[8]+t[7]*n[13]+t[8]*n[18],e[9]=t[5]*n[4]+t[6]*n[9]+t[7]*n[14]+t[8]*n[19]+t[9],e[10]=t[10]*n[0]+t[11]*n[5]+t[12]*n[10]+t[13]*n[15],e[11]=t[10]*n[1]+t[11]*n[6]+t[12]*n[11]+t[13]*n[16],e[12]=t[10]*n[2]+t[11]*n[7]+t[12]*n[12]+t[13]*n[17],e[13]=t[10]*n[3]+t[11]*n[8]+t[12]*n[13]+t[13]*n[18],e[14]=t[10]*n[4]+t[11]*n[9]+t[12]*n[14]+t[13]*n[19]+t[14],e[15]=t[15]*n[0]+t[16]*n[5]+t[17]*n[10]+t[18]*n[15],e[16]=t[15]*n[1]+t[16]*n[6]+t[17]*n[11]+t[18]*n[16],e[17]=t[15]*n[2]+t[16]*n[7]+t[17]*n[12]+t[18]*n[17],e[18]=t[15]*n[3]+t[16]*n[8]+t[17]*n[13]+t[18]*n[18],e[19]=t[15]*n[4]+t[16]*n[9]+t[17]*n[14]+t[18]*n[19]+t[19],e}_colorMatrix(e){let t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){let n=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)}tint(e,t){let[n,r,i]=Ca.shared.setValue(e).toArray(),a=[n,0,0,0,0,0,r,0,0,0,0,0,i,0,0,0,0,0,1,0];this._loadMatrix(a,t)}greyscale(e,t){let n=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)}blackAndWhite(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)}hue(e,t){e=(e||0)/180*Math.PI;let n=Math.cos(e),r=Math.sin(e),i=Math.sqrt,a=1/3,o=i(a),s=[n+(1-n)*a,a*(1-n)-o*r,a*(1-n)+o*r,0,0,a*(1-n)+o*r,n+a*(1-n),a*(1-n)-o*r,0,0,a*(1-n)-o*r,a*(1-n)+o*r,n+a*(1-n),0,0,0,0,0,1,0];this._loadMatrix(s,t)}contrast(e,t){let n=(e||0)+1,r=-.5*(n-1),i=[n,0,0,0,r,0,n,0,0,r,0,0,n,0,r,0,0,0,1,0];this._loadMatrix(i,t)}saturate(e=0,t){let n=e*2/3+1,r=(n-1)*-.5,i=[n,r,r,0,0,r,n,r,0,0,r,r,n,0,0,0,0,0,1,0];this._loadMatrix(i,t)}desaturate(){this.saturate(-1)}negative(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)}sepia(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)}technicolor(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.091555084827
62155585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)}polaroid(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)}toBGR(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)}kodachrome(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)}browni(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)}vintage(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)}colorTone(e,t,n,r,i){e||=.2,t||=.15,n||=16770432,r||=3375104;let a=Ca.shared,[o,s,c]=a.setValue(n).toArray(),[l,u,d]=a.setValue(r).toArray(),f=[.3,.59,.11,0,0,o,s,c,e,0,l,u,d,t,0,o-l,s-u,c-d,0,0];this._loadMatrix(f,i)}night(e,t){e||=.1;let n=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(n,t)}predator(e,t){let n=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(n,t)}lsd(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)}reset(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}};lu.prototype.grayscale=lu.prototype.greyscale;var uu=`varying vec2 vFilterCoord;
622varying vec2 vTextureCoord;
623
624uniform vec2 scale;
625uniform mat2 rotation;
626uniform sampler2D uSampler;
627uniform sampler2D mapSampler;
628
629uniform highp vec4 inputSize;
630uniform vec4 inputClamp;
631
632void main(void)
633{
634  vec4 map =  texture2D(mapSampler, vFilterCoord);
635
636  map -= 0.5;
637  map.xy = scale * inputSize.zw * (rotation * map.xy);
638
639  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
640}
641`,du=`attribute vec2 aVertexPosition;
642
643uniform mat3 projectionMatrix;
644uniform mat3 filterMatrix;
645
646varying vec2 vTextureCoord;
647varying vec2 vFilterCoord;
648
649uniform vec4 inputSize;
650uniform vec4 outputFrame;
651
652vec4 filterVertexPosition( void )
653{
654    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
655
656    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
657}
658
659vec2 filterTextureCoord( void )
660{
661    return aVertexPosition * (outputFrame.zw * inputSize.zw);
662}
663
664void main(void)
665{
666	gl_Position = filterVertexPosition();
667	vTextureCoord = filterTextureCoord();
668	vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0)  ).xy;
669}
670`,fu=class extends Us{constructor(e,t){let n=new Vo;e.renderable=!1,super(du,uu,{mapSampler:e._texture,filterMatrix:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=n,t??=20,this.scale=new Po(t,t)}apply(e,t,n,r){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;let i=this.maskSprite.worldTransform,a=Math.sqrt(i.a*i.a+i.b*i.b),o=Math.sqrt(i.c*i.c+i.d*i.d);a!==0&&o!==0&&(this.uniforms.rotation[0]=i.a/a,this.uniforms.rotation[1]=i.b/a,this.uniforms.rotation[2]=i.c/o,this.uniforms.rotation[3]=i.d/o),e.applyFilter(this,t,n,r)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}},pu=`varying vec2 v_rgbNW;
671varying vec2 v_rgbNE;
672varying vec2 v_rgbSW;
673varying vec2 v_rgbSE;
674varying vec2 v_rgbM;
675
676varying vec2 vFragCoord;
677uniform sampler2D uSampler;
678uniform highp vec4 inputSize;
679
680
681/**
682 Basic FXAA implementation based on the code on geeks3d.com with the
683 modification that the texture2DLod stuff was removed since it's
684 unsupported by WebGL.
685
686 --
687
688 From:
689 https://github.com/mitsuhiko/webgl-meincraft
690
691 Copyright (c) 2011 by Armin Ronacher.
692
693 Some rights reserved.
694
695 Redistribution and use in source and binary forms, with or without
696 modification, are permitted provided that the following conditions are
697 met:
698
699 * Redistributions of source code must retain the above copyright
700 notice, this list of conditions and the following disclaimer.
701
702 * Redistributions in binary form must reproduce the above
703 copyright notice, this list of conditions and the following
704 disclaimer in the documentation and/or other materials provided
705 with the distribution.
706
707 * The names of the contributors may not be used to endorse or
708 promote products derived from this software without specific
709 prior written permission.
710
711 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
712 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
713 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
714 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
715 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
716 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
717 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
718 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
719 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
720 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
721 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
722 */
723
724#ifndef FXAA_REDUCE_MIN
725#define FXAA_REDUCE_MIN   (1.0/ 128.0)
726#endif
727#ifndef FXAA_REDUCE_MUL
728#define FXAA_REDUCE_MUL   (1.0 / 8.0)
729#endif
730#ifndef FXAA_SPAN_MAX
731#define FXAA_SPAN_MAX     8.0
732#endif
733
734//optimized version for mobile, where dependent
735//texture reads can be a bottleneck
736vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
737          vec2 v_rgbNW, vec2 v_rgbNE,
738          vec2 v_rgbSW, vec2 v_rgbSE,
739          vec2 v_rgbM) {
740    vec4 color;
741    vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
742    vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
743    vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
744    vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
745    vec4 texColor = texture2D(tex, v_rgbM);
746    vec3 rgbM  = texColor.xyz;
747    vec3 luma = vec3(0.299, 0.587, 0.114);
748    float lumaNW = dot(rgbNW, luma);
749    float lumaNE = dot(rgbNE, luma);
750    float lumaSW = dot(rgbSW, luma);
751    float lumaSE = dot(rgbSE, luma);
752    float lumaM  = dot(rgbM,  luma);
753    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
754    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
755
756    mediump vec2 dir;
757    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
758    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));
759
760    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
761                          (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
762
763    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
764    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
765              max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
766                  dir * rcpDirMin)) * inverseVP;
767
768    vec3 rgbA = 0.5 * (
769                       texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
770                       texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
771    vec3 rgbB = rgbA * 0.5 + 0.25 * (
772                                     texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
773                                     texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
774
775    float lumaB = dot(rgbB, luma);
776    if ((lumaB < lumaMin) || (lumaB > lumaMax))
777        color = vec4(rgbA, texColor.a);
778    else
779        color = vec4(rgbB, texColor.a);
780    return color;
781}
782
783void main() {
784
785      vec4 color;
786
787      color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
788
789      gl_FragColor = color;
790}
791`,mu=`
792attribute vec2 aVertexPosition;
793
794uniform mat3 projectionMatrix;
795
796varying vec2 v_rgbNW;
797varying vec2 v_rgbNE;
798varying vec2 v_rgbSW;
799varying vec2 v_rgbSE;
800varying vec2 v_rgbM;
801
802varying vec2 vFragCoord;
803
804uniform vec4 inputSize;
805uniform vec4 outputFrame;
806
807vec4 filterVertexPosition( void )
808{
809    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
810
811    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
812}
813
814void texcoords(vec2 fragCoord, vec2 inverseVP,
815               out vec2 v_rgbNW, out vec2 v_rgbNE,
816               out vec2 v_rgbSW, out vec2 v_rgbSE,
817               out vec2 v_rgbM) {
818    v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
819    v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
820    v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
821    v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
822    v_rgbM = vec2(fragCoord * inverseVP);
823}
824
825void main(void) {
826
827   gl_Position = filterVertexPosition();
828
829   vFragCoord = aVertexPosition * outputFrame.zw;
830
831   texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
832}
833`,hu=class extends Us{constructor(){super(mu,pu)}},gu=`precision highp float;
834
835varying vec2 vTextureCoord;
836varying vec4 vColor;
837
838uniform float uNoise;
839uniform float uSeed;
840uniform sampler2D uSampler;
841
842float rand(vec2 co)
843{
844    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
845}
846
847void main()
848{
849    vec4 color = texture2D(uSampler, vTextureCoord);
850    float randomValue = rand(gl_FragCoord.xy * uSeed);
851    float diff = (randomValue - 0.5) * uNoise;
852
853    // Un-premultiply alpha before applying the color matrix. See issue #3539.
854    if (color.a > 0.0) {
855        color.rgb /= color.a;
856    }
857
858    color.r += diff;
859    color.g += diff;
860    color.b += diff;
861
862    // Premultiply alpha again.
863    color.rgb *= color.a;
864
865    gl_FragColor = color;
866}
867`,_u={AlphaFilter:eu,BlurFilter:su,BlurFilterPass:ou,ColorMatrixFilter:lu,DisplacementFilter:fu,FXAAFilter:hu,NoiseFilter:class extends Us{constructor(e=.5,t=Math.random()){super(Cl,gu,{uNoise:0,uSeed:0}),this.noise=e,this.seed=t}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}};Object.entries(_u).forEach(([e,t])=>{Object.defineProperty(_u,e,{get(){return Fi(`7.1.0`,`filters.${e} has moved to ${e}`),t}})});var vu=new class{constructor(){this.interactionFrequency=10,this._deltaT
867ime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||(gl.system.add(this.tickerUpdate,this,pl.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&=(gl.system.remove(this.tickerUpdate,this),!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}let e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType===`touch`||globalThis.document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}},yu=class e{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=e.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Po,this.page=new Po,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,n){throw Error(`initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}initUIEvent(e,t,n,r,i){throw Error(`initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}},bu=class extends yu{constructor(){super(...arguments),this.client=new Po,this.movement=new Po,this.offset=new Po,this.global=new Po,this.screen=new Po}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)}getModifierState(e){return`getModifierState`in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){throw Error(`Method not implemented.`)}},xu=class extends bu{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type===`pointermove`||this.type===`mousemove`||this.type===`touchmove`?[this]:[]}getPredictedEvents(){throw Error(`getPredictedEvents is not supported!`)}},Su=class extends bu{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}};Su.DOM_DELTA_PIXEL=0,Su.DOM_DELTA_LINE=1,Su.DOM_DELTA_PAGE=2;var Cu=2048,wu=new Po,Tu=new Po,Eu=class{constructor(e){this.dispatch=new Mi.default,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping(`pointerdown`,this.mapPointerDown),this.addEventMapping(`pointermove`,this.mapPointerMove),this.addEventMapping(`pointerout`,this.mapPointerOut),this.addEventMapping(`pointerleave`,this.mapPointerOut),this.addEventMapping(`pointerover`,this.mapPointerOver),this.addEventMapping(`pointerup`,this.mapPointerUp),this.addEventMapping(`pointerupoutside`,this.mapPointerUpOutside),this.addEventMapping(`wheel`,this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((e,t)=>
867e.priority-t.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let n=0,r=t.length;n<r;n++)t[n].fn(e);else console.warn(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){vu.pauseUpdate=!0;let n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?`hitTestMoveRecursive`:`hitTestRecursive`,r=this[n](this.rootTarget,this.rootTarget.eventMode,wu.set(e,t),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(e,t){if(!e.target)return;let n=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let r=0,i=n.length-1;r<i;r++)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let r=n.length-2;r>=0;r--)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,n=this._allInteractiveElements){if(n.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let r=Array.isArray(t)?t:[t];for(let t=n.length-1;t>=0;t--)r.forEach(r=>{e.currentTarget=n[t],this.notifyTarget(e,r)})}propagationPath(e){let t=[e];for(let n=0;n<Cu&&e!==this.rootTarget;n++){if(!e.parent)throw Error(`Cannot find propagation path to disconnected target`);t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,n,r,i,a=!1){let o=!1;if(this._interactivePrune(e))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(vu.pauseUpdate=!1),e.interactiveChildren&&e.children){let s=e.children;for(let c=s.length-1;c>=0;c--){let l=s[c],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,n,r,i,a||i(e,n));if(u){if(u.length>0&&!u[u.length-1].parent)continue;let t=e.isInteractive();(u.length>0||t)&&(t&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),o=!0}}}let s=this._isInteractive(t),c=e.isInteractive();return s&&c&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:s&&!i(e,n)&&r(e,n)?c?[e]:[]:null}hitTestRecursive(e,t,n,r,i){if(this._interactivePrune(e)||i(e,n))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(vu.pauseUpdate=!1),e.interactiveChildren&&e.children){let a=e.children;for(let o=a.length-1;o>=0;o--){let s=a[o],c=this.hitTestRecursive(s,this._isInteractive(t)?t:s.eventMode,n,r,i);if(c){if(c.length>0&&!c[c.length-1].parent)continue;let t=e.isInteractive();return(c.length>0||t)&&c.push(e),c}}}let a=this._isInteractive(t),o=e.isInteractive();return a&&r(e,n)?o?[e]:[]:null}_isInteractive(e){return e===`static`||e===`dynamic`}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode===`none`||e.eventMode===`passive`&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,Tu),!e.hitArea.contains(Tu.x,Tu.y)))return!0;if(e._mask){let n=e._mask.isMaskData?e._mask.maskObject:e._mask;if(n&&!n.containsPoint?.(t))return!0}return!1}hitTestFn(e,t){return e.eventMode===`passive`?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(t):!1}notifyTarget(e,t){t??=e.type;let n=`on${t}`;e.currentTarget[n]?.(e);let r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this.notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof xu)){console.warn(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,`pointerdown`),t.pointerType===`touch`)this.dispatchEvent(t,`touchstart`);else if(t.pointerType===`mouse`||t.pointerType===`pen`){let e=t.button===2;this.dispatchEvent(t,e?`rightdown`:`mousedown`)}let n=this.trackingData(e.pointerId);n.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof xu)){console.warn(`EventBoundary cannot map a non-pointer event as a pointer event`);return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;let t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;let n=t.pointerType===`mouse`||t.pointerType===`pen`,r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.overTargets);if(r.overTargets?.length>0&&i!==t.target){let r=e.type===`mousemove`?`mouseout`:`pointerout`,a=this.createPointerEvent(e,r,i);if(this.dispatchEvent(a,`pointerout`),n&&this.dispatchEvent(a,`mouseout`),!t.composedPath().includes(i)){let r=this.createPointerEvent(e,`pointerleave`,i);for(r.eventPhase=r.AT_TARGET;r.target&&!t.composedPath().includes(r.target);)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,`mouseleave`),r.target=r.target.parent;this.freeEvent(r)}this.freeEvent(a)}if(i!==t.target){let r=e.type===`mousemove`?`mouseover`:`pointerover`,a=this.clonePointerEvent(t,r);this.dispatchEvent(a,`pointerover`),n&&this.dispatchEvent(a,`mouseover`);let o=i?.parent;for(;o&&o!==this.rootTarget.parent&&o!==t.target;)o=o.parent;if(!o||o===this.rootTarget.parent){let e=this.clonePointerEvent(t,`pointerenter`);for(e.eventPhase=e.AT_TARGET;e.target&&e.target!==i&&e.target!==this.rootTarget.parent;)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,`mou
867seenter`),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(a)}let a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push(`pointermove`):this.dispatchEvent(t,`pointermove`),o&&a.push(`globalpointermove`),t.pointerType===`touch`&&(this.moveOnAll?a.splice(1,0,`touchmove`):this.dispatchEvent(t,`touchmove`),o&&a.push(`globaltouchmove`)),n&&(this.moveOnAll?a.splice(1,0,`mousemove`):this.dispatchEvent(t,`mousemove`),o&&a.push(`globalmousemove`),this.cursor=t.target?.cursor),a.length>0&&this.all(t,a),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof xu)){console.warn(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.createPointerEvent(e),r=n.pointerType===`mouse`||n.pointerType===`pen`;this.dispatchEvent(n,`pointerover`),r&&this.dispatchEvent(n,`mouseover`),n.pointerType===`mouse`&&(this.cursor=n.target?.cursor);let i=this.clonePointerEvent(n,`pointerenter`);for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==this.rootTarget.parent;)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,`mouseenter`),i.target=i.target.parent;t.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i)}mapPointerOut(e){if(!(e instanceof xu)){console.warn(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId);if(t.overTargets){let n=e.pointerType===`mouse`||e.pointerType===`pen`,r=this.findMountedTarget(t.overTargets),i=this.createPointerEvent(e,`pointerout`,r);this.dispatchEvent(i),n&&this.dispatchEvent(i,`mouseout`);let a=this.createPointerEvent(e,`pointerleave`,r);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),n&&this.notifyTarget(a,`mouseleave`),a.target=a.target.parent;t.overTargets=null,this.freeEvent(i),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof xu)){console.warn(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=performance.now(),n=this.createPointerEvent(e);if(this.dispatchEvent(n,`pointerup`),n.pointerType===`touch`)this.dispatchEvent(n,`touchend`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.dispatchEvent(n,e?`rightup`:`mouseup`)}let r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[e.button]),a=i;if(i&&!n.composedPath().includes(i)){let t=i;for(;t&&!n.composedPath().includes(t);){if(n.currentTarget=t,this.notifyTarget(n,`pointerupoutside`),n.pointerType===`touch`)this.notifyTarget(n,`touchendoutside`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.notifyTarget(n,e?`rightupoutside`:`mouseupoutside`)}t=t.parent}delete r.pressTargetsByButton[e.button],a=t}if(a){let i=this.clonePointerEvent(n,`click`);i.target=a,i.path=null,r.clicksByButton[e.button]||(r.clicksByButton[e.button]={clickCount:0,target:i.target,timeStamp:t});let o=r.clicksByButton[e.button];if(o.target===i.target&&t-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=i.target,o.timeStamp=t,i.detail=o.clickCount,i.pointerType===`mouse`){let e=i.button===2;this.dispatchEvent(i,e?`rightclick`:`click`)}else i.pointerType===`touch`&&this.dispatchEvent(i,`tap`);this.dispatchEvent(i,`pointertap`),this.freeEvent(i)}this.freeEvent(n)}mapPointerUpOutside(e){if(!(e instanceof xu)){console.warn(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.findMountedTarget(t.pressTargetsByButton[e.button]),r=this.createPointerEvent(e);if(n){let i=n;for(;i;)r.currentTarget=i,this.notifyTarget(r,`pointerupoutside`),r.pointerType===`touch`?this.notifyTarget(r,`touchendoutside`):(r.pointerType===`mouse`||r.pointerType===`pen`)&&this.notifyTarget(r,r.button===2?`rightupoutside`:`mouseupoutside`),i=i.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(r)}mapWheel(e){if(!(e instanceof Su)){console.warn(`EventBoundary cannot map a non-wheel event as a wheel event`);return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let n=1;n<e.length&&e[n].parent===t;n++)t=e[n];return t}createPointerEvent(e,t,n){let r=this.allocateEvent(xu);return this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=n??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof t==`string`&&(r.type=t),r}createWheelEvent(e){let t=this.allocateEvent(Su);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.n
867ativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let n=this.allocateEvent(xu);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=t??n.type,n}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof xu&&t instanceof xu&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof bu&&t instanceof bu&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw Error(`It is illegal to free an event not managed by this EventBoundary!`);let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}notifyListeners(e,t){let n=e.currentTarget._events[t];if(n&&e.currentTarget.isInteractive())if(`fn`in n)n.once&&e.currentTarget.removeListener(t,n.fn,void 0,!0),n.fn.call(n.context,e);else for(let r=0,i=n.length;r<i&&!e.propagationImmediatelyStopped;r++)n[r].once&&e.currentTarget.removeListener(t,n[r].fn,void 0,!0),n[r].fn.call(n[r].context,e)}},Du=1,Ou={touchstart:`pointerdown`,touchend:`pointerup`,touchendoutside:`pointerupoutside`,touchmove:`pointermove`,touchcancel:`pointercancel`},ku=class e{constructor(t){this.supportsTouchEvents=`ontouchstart`in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new Eu(null),vu.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new xu(null),this.rootWheelEvent=new Su(null),this.cursorStyles={default:`inherit`,pointer:`pointer`},this.features=new Proxy({...e.defaultEventFeatures},{set:(e,t,n)=>(t===`globalMove`&&(this.rootBoundary.enableGlobalMoveEvents=n),e[t]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){let{view:n,resolution:r}=this.renderer;this.setTargetElement(n),this.resolution=r,e._defaultEventMode=t.eventMode??`auto`,Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e||=`default`;let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;let n=this.cursorStyles[e];if(n)switch(typeof n){case`string`:t&&(this.domElement.style.cursor=n);break;case`function`:n(e);break;case`object`:t&&Object.assign(this.domElement.style,n);break}else t&&typeof e==`string`&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!(`cancelable`in e))&&e.preventDefault();for(let e=0,n=t.length;e<n;e++){let n=t[e],r=this.bootstrapEvent(this.rootPointerEvent,n);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,vu.pointerMoved();let t=this.normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this.bootstrapEvent(this.rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let n=t===this.domElement?``:`outside`,r=this.normalizeToPointerData(e);for(let e=0,t=r.length;e<t;e++){let t=this.bootstrapEvent(this.rootPointerEvent,r[e]);t.type+=n,this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this.normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this.bootstrapEvent(this.rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this.removeEvents(),this.domElement=e,vu.domElement=e,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;vu.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`)),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this.onPointerMove,!0),this.domElement.addEventListener(`pointerdown`,this.onPointerDown,!0),this.domElement.addEventListener(`pointerleave`,this.onPointerOverOut,!0),this.domElement.addEventListener(`pointerover`,this.onPointerOverOut,!0),globalThis.addEventListener(`pointerup`,this.onPointerUp,!0)):(globalThis.document.addEventListener(`mousemove`,this.onPointerMove,!0),this.domElement.addEventListener(`mousedown`,this.onPointerDown,!0),this.domElement.addEventListener(`mouseout`,this.onPointerOverOut,!0),this.domElement.addEventListener(`mouseover`,this.onPointerOverOut,!0),globalThis.addEventListener(`mouseup`,this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener(`touchstart`,this.onPointerDown,!0),this.domElement.addEventListener(`touchend`,this.onPointerUp,!0),this.domElement.addEventListener(`touchmove`,this.onPointerMove,!0))),this.domElement.addEventListener(`wheel`,this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;vu.removeTickerListener();let e=this.domElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this.onPointerMove,!0),this.domElement.removeEventListener(`pointerdown`,this.onPointerDown,!0),this.domElement.removeEventListener(`pointerleave`,this.onPointerOverOut,!0),this.domElement.removeEventListener(`pointerover`,this.onPointerOverOut,!0),globalThis.removeEventListener(`pointerup`,this.onPointerUp,!0)):(globalThis.document.removeEventListener(`mousemove`,this.onPointerMove,!0),this.domElement.removeEventListener(`mousedown`,this.onPointerDown,!0),this.domElement.removeEventListener(`mouseout`,this.onPointerOverOut,!0),this.domElement.removeEventListener(`mouseover`,this.onPointerOverOut,!0),globalThis.removeEventListener(`mouseup`,this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener(`touchstart`,this.onPointerDown,!0),this.domElement.removeEventListener(`touchend`,this.onPointerUp,!0),this.domElement.removeEventListener(`touchmove`,this.onPointerMove,!0))),this.domElement.removeEventListener(`wheel`,this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(e,t,n){let r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},i=1/this.resolution;e.x=(t-r.left)*(this.domElement.width/r.width)*i,e.y=(n-r.top)*(this.domElement.height/r.height)*i}normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches[n];typeof r.button>`u`&&(r.button=0),typeof r.buttons>`u`&&(r.buttons=1),typeof r.isPrimary>`u`&&(r.isPrimary=e.touches.length===1&&e.type===`touchstart`),typeof r.width>`u`&&(r.width=r.radiusX||1),typeof r.height>`u`&&(r.height=r.radiusY||1),typeof r.tiltX>`u`&&(r.tiltX=0),typeof r.tiltY>`u`&&(r.tiltY=0),typeof r.pointerType>`u`&&(r.pointerType=`touch`),typeof r.pointerId>`u`&&(r.pointerId=r.identifier||0),typeof r.pressure>`u`&&(r.pressure=r.force||.5),typeof r.twist>`u`&&(r.twist=0),typeof r.tangentialPressure>`u`&&(r.tangentialPressure=0),typeof r.layerX>`u`&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>`u`&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let n=e;typeof n.isPrimary>`u`&&(n.isPrimary=!0),typeof n.width>`u`&&(n.width=1),typeof n.height>`u`&&(n.height=1),typeof n.tiltX>`u`&&(n.tiltX=0),typeof n.tiltY>`u`&&(n.tiltY=0),typeof n.pointerType>`u`&&(n.pointerType=`mouse`),typeof n.pointerId>`u`&&(n.pointerId=Du),typeof n.pressure>`u`&&(n.pressure=.5),typeof n.twist>`u`&&(n.twist=0),typeof n.tangentialPressure>`u`&&(n.tangentialPressure=0),n.isNormalized=!0,t.push(n)}else t.push(e);return t}normalizeWheelEvent(e){let t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.t
867iltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type===`pointerleave`&&(e.type=`pointerout`),e.type.startsWith(`mouse`)&&(e.type=e.type.replace(`mouse`,`pointer`)),e.type.startsWith(`touch`)&&(e.type=Ou[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};ku.extension={name:`events`,type:[G.RendererSystem,G.CanvasRendererSystem]},ku.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};var Au=ku;Qa.add(Au);function ju(e){return e===`dynamic`||e===`static`}Hl.mixin({onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??ju(Au.defaultEventMode)},set interactive(e){Fi(`7.2.0`,`Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead.`),this._internalInteractive=e,this.eventMode=e?`static`:`auto`},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Au.defaultEventMode},set eventMode(e){this._internalInteractive=ju(e),this._internalEventMode=e},isInteractive(){return this.eventMode===`static`||this.eventMode===`dynamic`},interactiveChildren:!0,hitArea:null,addEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof n==`object`?n.signal:void 0,a=typeof n==`object`&&n.once===!0,o=typeof t==`function`?void 0:t;e=r?`${e}capture`:e;let s=typeof t==`function`?t:t.handleEvent,c=this;i&&i.addEventListener(`abort`,()=>{c.off(e,s,o)}),a?c.once(e,s,o):c.on(e,s,o)},removeEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof t==`function`?void 0:t;e=r?`${e}capture`:e,t=typeof t==`function`?t:t.handleEvent,this.off(e,t,i)},dispatchEvent(e){if(!(e instanceof yu))throw Error(`DisplayObject cannot propagate events outside of the Federated Events API`);return e.defaultPrevented=!1,e.path=null,e.target=this,e.manager.dispatchEvent(e),!e.defaultPrevented}}),Hl.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:`button`,accessiblePointerEvents:`auto`,accessibleChildren:!0,renderId:-1});var Mu=9,Nu=100,Pu=0,Fu=0,Iu=2,Lu=1,Ru=-1e3,zu=-1e3,Bu=2,Vu=class{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Fr.tablet||Fr.phone)&&this.createTouchHook();let t=document.createElement(`div`);t.style.width=`${Nu}px`,t.style.height=`${Nu}px`,t.style.position=`absolute`,t.style.top=`${Pu}px`,t.style.left=`${Fu}px`,t.style.zIndex=Iu.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener(`keydown`,this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){let e=document.createElement(`button`);e.style.width=`${Lu}px`,e.style.height=`${Lu}px`,e.style.position=`absolute`,e.style.top=`${Ru}px`,e.style.left=`${zu}px`,e.style.zIndex=Bu.toString(),e.style.backgroundColor=`#FF0000`,e.title=`select to enable accessibility for this content`,e.addEventListener(`focus`,()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&=(document.body.removeChild(this._hookDiv),null)}activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener(`mousemove`,this._onMouseMove,!0),globalThis.removeEventListener(`ke
867ydown`,this._onKeyDown,!1),this.renderer.on(`postrender`,this.update,this),this.renderer.view.parentNode?.appendChild(this.div))}deactivate(){!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener(`mousemove`,this._onMouseMove,!0),globalThis.addEventListener(`keydown`,this._onKeyDown,!1),this.renderer.off(`postrender`,this.update),this.div.parentNode?.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);let t=e.children;if(t)for(let e=0;e<t.length;e++)this.updateAccessibleObjects(t[e])}update(){let e=performance.now();if(Fr.android.device&&e<this.androidUpdateCount||(this.androidUpdateCount=e+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);let{x:t,y:n,width:r,height:i}=this.renderer.view.getBoundingClientRect(),{width:a,height:o,resolution:s}=this.renderer,c=r/a*s,l=i/o*s,u=this.div;u.style.left=`${t}px`,u.style.top=`${n}px`,u.style.width=`${a}px`,u.style.height=`${o}px`;for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t.renderId!==this.renderId)t._accessibleActive=!1,Pa(this.children,e,1),this.div.removeChild(t._accessibleDiv),this.pool.push(t._accessibleDiv),t._accessibleDiv=null,e--;else{u=t._accessibleDiv;let e=t.hitArea,n=t.worldTransform;t.hitArea?(u.style.left=`${(n.tx+e.x*n.a)*c}px`,u.style.top=`${(n.ty+e.y*n.d)*l}px`,u.style.width=`${e.width*n.a*c}px`,u.style.height=`${e.height*n.d*l}px`):(e=t.getBounds(),this.capHitArea(e),u.style.left=`${e.x*c}px`,u.style.top=`${e.y*l}px`,u.style.width=`${e.width*c}px`,u.style.height=`${e.height*l}px`,u.title!==t.accessibleTitle&&t.accessibleTitle!==null&&(u.title=t.accessibleTitle),u.getAttribute(`aria-label`)!==t.accessibleHint&&t.accessibleHint!==null&&u.setAttribute(`aria-label`,t.accessibleHint)),(t.accessibleTitle!==u.title||t.tabIndex!==u.tabIndex)&&(u.title=t.accessibleTitle,u.tabIndex=t.tabIndex,this.debug&&this.updateDebugHTML(u))}}this.renderId++}updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:n}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>n&&(e.height=n-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement(`button`),t.style.width=`${Nu}px`,t.style.height=`${Nu}px`,t.style.backgroundColor=this.debug?`rgba(255,255,255,0.5)`:`transparent`,t.style.position=`absolute`,t.style.zIndex=Iu.toString(),t.style.borderStyle=`none`,navigator.userAgent.toLowerCase().includes(`chrome`)?t.setAttribute(`aria-live`,`off`):t.setAttribute(`aria-live`,`polite`),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute(`aria-relevant`,`additions`):t.setAttribute(`aria-relevant`,`text`),t.addEventListener(`click`,this._onClick.bind(this)),t.addEventListener(`focus`,this._onFocus.bind(this)),t.addEventListener(`focusout`,this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute(`aria-label`,e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){let{displayObject:n}=e.target,r=this.renderer.events.rootBoundary,i=Object.assign(new yu(r),{target:n});r.rootTarget=this.renderer.lastObjectRendered,t.forEach(e=>r.dispatchEvent(i,e))}_onClick(e){this._dispatchEvent(e,[`click`,`pointertap`,`tap`])}_onFocus(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`assertive`),this._dispatchEvent(e,[`mouseover`])}_onFocusOut(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`polite`),this._dispatchEvent(e,[`mouseout`])}_onKeyDown(e){e.keyCode===Mu&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener(`mousemove`,this._onMouseMove,!0),globalThis.removeEventListener(`ke
867ydown`,this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}};Vu.extension={name:`accessibility`,type:[G.RendererPlugin,G.CanvasRendererPlugin]},Qa.add(Vu);var Hu=class e{constructor(t){this.stage=new ql,t=Object.assign({forceCanvas:!1},t),this.renderer=yl(t),e._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render(this.stage)}get view(){return this.renderer?.view}get screen(){return this.renderer?.screen}destroy(t,n){let r=e._plugins.slice(0);r.reverse(),r.forEach(e=>{e.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Hu._plugins=[];var Uu=Hu;Qa.handleByList(G.Application,Uu._plugins);var Wu=class{static init(e){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener(`resize`,this.queueResize),this._resizeTo=e,e&&(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),null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let e,t;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{let{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,t=r}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener(`resize`,this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}};Wu.extension=G.Application,Qa.add(Wu);var Gu={loader:G.LoadParser,resolver:G.ResolveParser,cache:G.CacheParser,detection:G.DetectionParser};Qa.handle(G.Asset,e=>{let t=e.ref;Object.entries(Gu).filter(([e])=>!!t[e]).forEach(([e,n])=>Qa.add(Object.assign(t[e],{extension:t[e].extension??n})))},e=>{let t=e.ref;Object.keys(Gu).filter(e=>!!t[e]).forEach(e=>Qa.remove(t[e]))});var Ku=class{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach(e=>{this._assetList.push(e)}),this.verbose&&console.log(`[BackgroundLoader] assets: `,this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;let e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let n=0;n<t;n++)e.push(this._assetList.pop());await this._loader.load(e),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next())}};function qu(e,t){if(Array.isArray(t)){for(let n of t)if(e.startsWith(`data:${n}`))return!0;return!1}return e.startsWith(`data:${t}`)}function Ju(e,t){let n=e.split(`?`)[0],r=Vi.extname(n).toLowerCase();return Array.isArray(t)?t.includes(r):r===t}var Yu=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(e=>typeof e==`string`||n?t(e):e):e),Xu=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e};function Zu(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?Zu(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function Qu(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),Zu(e,r,0,t,n)}else n.push(e);return n}var $u=e=>!Array.isArray(e),ed=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let n=Yu(e),r;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];if(i.test(t)){r=i.getCacheableAssets(n,t);break}}r||(r={},n.forEach(e=>{r[e]=t}));let i=Object.keys(r),a={cacheKeys:i,keys:n};if(n.forEach(e=>{this._cacheMap.set(e,a)}
867),i.forEach(e=>{let n=r?r[e]:t;this._cache.has(e)&&this._cache.get(e)!==n&&console.warn(`[Cache] already has key:`,e),this._cache.set(e,r[e])}),t instanceof K){let e=t;n.forEach(t=>{e.baseTexture!==K.EMPTY.baseTexture&&vo.addToCache(e.baseTexture,t),K.addToCache(e,t)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(e=>{this._cache.delete(e)}),t.keys.forEach(e=>{this._cacheMap.delete(e)})}get parsers(){return this._parsers}},td=class{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,n)=>(this._parsersValidated=!1,e[t]=n,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){let n={promise:null,parser:null};return n.promise=(async()=>{let r=null,i=null;if(t.loadParser&&(i=this._parserHash[t.loadParser],i||console.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!i){for(let n=0;n<this.parsers.length;n++){let r=this.parsers[n];if(r.load&&r.test?.(e,t,this)){i=r;break}}if(!i)return console.warn(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}r=await i.load(e,t,this),n.parser=i;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];i.parse&&i.parse&&await i.testParse?.(r,t,this)&&(r=await i.parse(r,t,this)||r,n.parser=i)}return r})(),n}async load(e,t){this._parsersValidated||this._validateParsers();let n=0,r={},i=$u(e),a=Yu(e,e=>({alias:[e],src:e})),o=a.length,s=a.map(async e=>{let i=Vi.toAbsolute(e.src);if(!r[e.src])try{this.promiseCache[i]||(this.promiseCache[i]=this._getLoadPromiseAndParser(i,e)),r[e.src]=await this.promiseCache[i].promise,t&&t(++n/o)}catch(t){throw delete this.promiseCache[i],delete r[e.src],Error(`[Loader.load] Failed to load ${i}.
868${t}`)}});return await Promise.all(s),i?r[a[0].src]:r}async unload(e){let t=Yu(e,e=>({alias:[e],src:e})).map(async e=>{let t=Vi.toAbsolute(e.src),n=this.promiseCache[t];if(n){let r=await n.promise;delete this.promiseCache[t],n.parser?.unload?.(r,e,this)}});await Promise.all(t)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(e[t.name]&&console.warn(`[Assets] loadParser name conflict "${t.name}"`),{...e,[t.name]:t}),{})}},nd=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(nd||{}),rd=`.json`,id=`application/json`,ad={extension:{type:G.LoadParser,priority:nd.Low},name:`loadJson`,test(e){return qu(e,id)||Ju(e,rd)},async load(e){return await(await W.ADAPTER.fetch(e)).json()}};Qa.add(ad);var od=`.txt`,sd=`text/plain`,cd={name:`loadTxt`,extension:{type:G.LoadParser,priority:nd.Low},test(e){return qu(e,sd)||Ju(e,od)},async load(e){return await(await W.ADAPTER.fetch(e)).text()}};Qa.add(cd);var ld=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],ud=[`.ttf`,`.otf`,`.woff`,`.woff2`],dd=[`font/ttf`,`font/otf`,`font/woff`,`font/woff2`],fd=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function pd(e){let t=Vi.extname(e),n=Vi.basename(e,t).replace(/(-|_)/g,` `).toLowerCase().split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1)),r=n.length>0;for(let e of n)if(!e.match(fd)){r=!1;break}let i=n.join(` `);return r||(i=`"${i.replace(/[\\"]/g,`\\$&`)}"`),i}var md=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function hd(e){return md.test(e)?e:encodeURI(e)}var gd={extension:{type:G.LoadParser,priority:nd.Low},name:`loadWebFont`,test(e){return qu(e,dd)||Ju(e,ud)},async load(e,t){let n=W.ADAPTER.getFontFaceSet();if(n){let r=[],i=t.data?.family??pd(e),a=t.data?.weights?.filter(e=>ld.includes(e))??[`normal`],o=t.data??{};for(let t=0;t<a.length;t++){let s=a[t],c=new FontFace(i,`url(${hd(e)})`,{...o,weight:s});await c.load(),n.add(c),r.push(c)}return r.length===1?r[0]:r}return console.warn(`[loadWebFont] FontFace API is not supported. Skipping loading font`),null},unload(e){(Array.isArray(e)?e:[e]).forEach(e=>W.ADAPTER.getFontFaceSet().delete(e))}};Qa.add(gd);var _d=`(function() {
869  "use strict";
870  const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
871  async function checkImageBitmap() {
872    try {
873      if (typeof createImageBitmap != "function")
874        return !1;
875      const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);
876      return imageBitmap.width === 1 && imageBitmap.height === 1;
877    } catch {
878      return !1;
879    }
880  }
881  checkImageBitmap().then((result) => {
882    self.postMessage(result);
883  });
884})();
885`,vd=null,yd=class{constructor(){vd||=URL.createObjectURL(new Blob([_d],{type:`application/javascript`})),this.worker=new Worker(vd)}};yd.revokeObjectURL=function(){vd&&=(URL.revokeObjectURL(vd),null)};var bd=`(function() {
886  "use strict";
887  async function loadImageBitmap(url) {
888    const response = await fetch(url);
889    if (!response.ok)
890      throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`);
891    const imageBlob = await response.blob();
892    return await createImageBitmap(imageBlob);
893  }
894  self.onmessage = async (event) => {
895    try {
896      const imageBitmap = await loadImageBitmap(event.data.data[0]);
897      self.postMessage({
898        data: imageBitmap,
899        uuid: event.data.uuid,
900        id: event.data.id
901      }, [imageBitmap]);
902    } catch (e) {
903      self.postMessage({
904        error: e,
905        uuid: event.data.uuid,
906        id: event.data.id
907      });
908    }
909  };
910})();
911`,xd=null,Sd=class{constructor(){xd||=URL.createObjectURL(new Blob([bd],{type:`application/javascript`})),this.worker=new Worker(xd)}};Sd.revokeObjectURL=function(){xd&&=(URL.revokeObjectURL(xd),null)};var Cd=0,wd,Td=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported===void 0&&(this._isImageBitmapSupported=new Promise(e=>{let{worker:t}=new yd;t.addEventListener(`message`,n=>{t.terminate(),yd.revokeObjectURL(),e(n.data)})})),this._isImageBitmapSupported}loadImageBitmap(e){return this._run(`loadImageBitmap`,[e])}async _initWorkers(){this._initialized||=!0}getWorker(){wd===void 0&&(wd=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers<wd&&(this._createdWorkers++,e=new Sd().worker,e.addEventListener(`message`,e=>{this.complete(e.data),this.returnWorker(e.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error===void 0?this.resolveHash[e.uuid].resolve(e.data):this.resolveHash[e.uuid].reject(e.error),this.resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();let n=new Promise((n,r)=>{this.queue.push({id:e,arguments:t,resolve:n,reject:r})});return this.next(),n}next(){if(!this.queue.length)return;let e=this.getWorker();if(!e)return;let t=this.queue.pop(),n=t.id;this.resolveHash[Cd]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:Cd++,id:n})}};function Ed(e,t,n){e.resource.internal=!0;let r=new K(e),i=()=>{delete t.promiseCache[n],ed.has(n)&&ed.remove(n)};return r.baseTexture.once(`destroyed`,()=>{n in t.promiseCache&&(console.warn(`[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture.`),i())}),r.once(`destroyed`,()=>{e.destroyed||(console.warn(`[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture.`),i())}),r}var Dd=[`.jpeg`,`.jpg`,`.png`,`.webp`,`.avif`],Od=[`image/jpeg`,`image/png`,`image/webp`,`image/avif`];async function kd(e){let t=await W.ADAPTER.fetch(e);if(!t.ok)throw Error(`[loadImageBitmap] Failed to fetch ${e}: ${t.status} ${t.statusText}`);let n=await t.blob();return await createImageBitmap(n)}var Ad={name:`loadTextures`,extension:{type:G.LoadParser,priority:nd.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:`anonymous`},test(e){return qu(e,Od)||Ju(e,Dd)},async load(e,t,n){let r=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap,i;i=r?this.config.preferWorkers&&await Td.isImageBitmapSupported()?await Td.loadImageBitmap(e):await kd(e):await new Promise((t,n)=>{let r=new Image;r.crossOrigin=this.config.crossOrigin,r.src=e,r.complete?t(r):(r.onload=()=>t(r),r.onerror=e=>n(e))});let a={...t.data};a.resolution??=Ya(e),r&&a.resourceOptions?.ownsImageBitmap===void 0&&(a.resourceOptions={...a.resourceOptions},a.resourceOptions.ownsImageBitmap=!0);let o=new vo(i,a);return o.resource.src=e,Ed(o,n,e)},unload(e){e.destroy(!0)}};Qa.add(Ad);var jd=`.svg`,Md=`image/svg+xml`,Nd={extension:{type:G.LoadParser,priority:nd.High},name:`loadSVG`,test(e){return qu(e,Md)||Ju(e,jd)},async testParse(e){return Ll.test(e)},async parse(e,t,n){let r=new Ll(e,t?.data?.resourceOptions);await r.load();let i=new vo(r,{resolution:Ya(e),...t?.data});return i.resource.src=t.src,Ed(i,n,t.src)},async load(e,t){return(await W.ADAPTER.fetch(e)).text()},unload:Ad.unload};Qa.add(Nd);var Pd=[`.mp4`,`.m4v`,`.webm`,`.ogv`],Fd=[`video/mp4`,`video/webm`,`video/ogg`],Id={name:`loadVideo`,extension:{type:G.LoadParser,priority:nd.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(e){return qu(e,Fd)||Ju(e,Pd)},async load(e,t,n){let r,i=await(await W.ADAPTER.fetch(e)).blob(),a=URL.createObjectURL(i);try{let i=new Bl(a,{autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...t?.data?.resourceOptions,autoLoad:!0});await i.load();let o=new vo(i,{alphaMode:await Ui(),resolution:Ya(e),...t?.data});o.resource.src=e,r=Ed(o,n,e),r.baseTexture.once(`destroyed`,()=>{URL.revokeObjectURL(a)})}catch(e){throw URL.revokeObjectURL(a),e}return r},unload(e){e.destroy(!0)}};Qa.add(Id);var Ld=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>
911t.replace(`${e}${this._bundleIdConnector}`,``)},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,name:n,src:r,srcs:i}=e;return Yu(t||n||r||i,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e?.srcs??e):e?.src||e?.srcs?e.src??e.srcs:e,!0)}addManifest(e){this._manifest&&console.warn(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[];Array.isArray(t)?t.forEach(t=>{let r=t.src??t.srcs,i=t.alias??t.name,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}):Object.keys(t).forEach(r=>{let i=[r,this._createBundleAssetId(e,r)];if(typeof t[r]==`string`)this.add({alias:i,src:t[r]});else if(Array.isArray(t[r]))this.add({alias:i,src:t[r]});else{let e=t[r],n=e.src??e.srcs;this.add({...e,alias:i,src:Array.isArray(n)?n:[n]})}n.push(...i)}),this._bundles[e]=n}add(e,t,n,r,i){let a=[];typeof e==`string`||Array.isArray(e)&&typeof e[0]==`string`?(Fi(`7.2.0`,`Assets.add now uses an object instead of individual parameters.
912Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:e,src:t,data:n,format:r,loadParser:i})):Array.isArray(e)?a.push(...e):a.push(e);let o=e=>{this.hasKey(e)&&console.warn(`[Resolver] already has key: ${e} overwriting`)};Yu(a).forEach(e=>{let{src:t,srcs:n}=e,{data:r,format:i,loadParser:a}=e,s=Yu(t||n).map(e=>typeof e==`string`?Qu(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(o):o(c);let l=[];s.forEach(e=>{e.forEach(e=>{let t={};if(typeof e!=`object`){t.src=e;for(let n=0;n<this._parsers.length;n++){let r=this._parsers[n];if(r.test(e)){t=r.parse(e);break}}}else r=e.data??r,i=e.format??i,a=e.loadParser??a,t={...t,...e};if(!c)throw Error(`[Resolver] alias is undefined for this asset: ${t.src}`);t=this.buildResolvedAsset(t,{aliases:c,data:r,format:i,loadParser:a}),l.push(t)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=$u(e);e=Yu(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=$u(e);e=Yu(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e])if(this._assetMap[e]){let t=this._assetMap[e],n=t[0],r=this._getPreferredOrder(t);r?.priority.forEach(e=>{r.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]??n}
912else this._resolverHash[e]=this.buildResolvedAsset({alias:[e],src:e},{});n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let t=e[0],n=this._preferredOrder.find(e=>e.params.format.includes(t.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,format:a}=t;return(this._basePath||this._rootPath)&&(e.src=Vi.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.format=a??e.format??Vi.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}},Rd=new class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Ld,this.loader=new td,this.cache=ed,this._backgroundLoader=new Ku(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){if(this._initialized){console.warn(`[Assets]AssetManager already initialized, did you load before calling this Assets.init()?`);return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let t=e.manifest;typeof t==`string`&&(t=await this.load(t)),this.resolver.addManifest(t)}let t=e.texturePreference?.resolution??1,n=typeof t==`number`?[t]:t,r=await this._detectFormats({preferredFormats:e.texturePreference?.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:r,resolution:n}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,n,r,i){this.resolver.add(e,t,n,r,i)}async load(e,t){this._initialized||await this.init();let n=$u(e),r=Yu(e).map(e=>{if(typeof e!=`string`){let t=this.resolver.getAlias(e);return t.some(e=>!this.resolver.hasKey(e))&&this.add(e),Array.isArray(t)?t[0]:t}return this.resolver.hasKey(e)||this.add({alias:e,src:e}),e}),i=this.resolver.resolve(r),a=await this._mapLoadToResolve(i,t);return n?a[r[0]]:a}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let n=!1;typeof e==`string`&&(n=!0,e=[e]);let r=this.resolver.resolveBundle(e),i={},a=Object.keys(r),o=0,s=0,c=()=>{t?.(++o/s)},l=a.map(e=>{let t=r[e];return s+=Object.keys(t).length,this._mapLoadToResolve(t,c).then(t=>{i[e]=t})});return await Promise.all(l),n?i[e[0]]:i}async backgroundLoad(e){this._initialized||await this.init(),typeof e==`string`&&(e=[e]);let t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e==`string`&&(e=[e]);let t=this.resolver.resolveBundle(e);Object.values(t).forEach(e=>{this._backgroundLoader.add(Object.values(e))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e==`string`)return ed.get(e);let t={};for(let n=0;n<e.length;n++)t[n]=ed.get(e[n]);return t}async _mapLoadToResolve(e,t){let n=Object.values(e),r=Object.keys(e);this._backgroundLoader.active=!1;let i=await this.loader.load(n,t);this._backgroundLoader.active=!0;let a={};return n.forEach((e,t)=>{let n=i[e.src],o=[e.src];e.alias&&o.push(...e.alias),a[r[t]]=n,ed.set(o,n)}),a}async unload(e){this._initialized||await this.init();let t=Yu(e).map(e=>typeof e==`string`?e:e.src),n=this.resolver.resolve(t);await this._unloadFromResolved(n)}async unloadBundle(e){this._initialized||await this.init(),e=Yu(e);let t=this.resolver.resolveBundle(e),n=Object.keys(t).map(e=>this._unloadFromResolved(t[e]));await Promise.all(n)}async _unloadFromResolved(e){let t=Object.values(e);t.forEach(e=>{ed.remove(e.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(let n of e.detections)e.skipDetections||await n.test()?t=await n.add(t):e.skipDetections||(t=await n.remove(t));
912return t=t.filter((e,n)=>t.indexOf(e)===n),t}get detections(){return this._detections}get preferWorkers(){return Ad.config.preferWorkers}set preferWorkers(e){Fi(`7.2.0`,`Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead.`),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(t=>t in e).forEach(n=>{t.config[n]=e[n]})})}};Qa.handleByList(G.LoadParser,Rd.loader.parsers).handleByList(G.ResolveParser,Rd.resolver.parsers).handleByList(G.CacheParser,Rd.cache.parsers).handleByList(G.DetectionParser,Rd.detections);var zd={extension:G.CacheParser,test:e=>Array.isArray(e)&&e.every(e=>e instanceof K),getCacheableAssets:(e,t)=>{let n={};return e.forEach(e=>{t.forEach((t,r)=>{n[e+(r===0?``:r+1)]=t})}),n}};Qa.add(zd);async function Bd(e){if(`Image`in globalThis)return new Promise(t=>{let n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e});if(`createImageBitmap`in globalThis&&`fetch`in globalThis){try{let t=await(await fetch(e)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}var Vd={extension:{type:G.DetectionParser,priority:1},test:async()=>Bd(`data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=`),add:async e=>[...e,`avif`],remove:async e=>e.filter(e=>e!==`avif`)};Qa.add(Vd);var Hd={extension:{type:G.DetectionParser,priority:0},test:async()=>Bd(`data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=`),add:async e=>[...e,`webp`],remove:async e=>e.filter(e=>e!==`webp`)};Qa.add(Hd);var Ud=[`png`,`jpg`,`jpeg`],Wd={extension:{type:G.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async e=>[...e,...Ud],remove:async e=>e.filter(e=>!Ud.includes(e))};Qa.add(Wd);var Gd=`WorkerGlobalScope`in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Kd(e){return!Gd&&document.createElement(`video`).canPlayType(e)!==``}var qd={extension:{type:G.DetectionParser,priority:0},test:async()=>Kd(`video/webm`),add:async e=>[...e,`webm`],remove:async e=>e.filter(e=>e!==`webm`)};Qa.add(qd);var Jd={extension:{type:G.DetectionParser,priority:0},test:async()=>Kd(`video/mp4`),add:async e=>[...e,`mp4`,`m4v`],remove:async e=>e.filter(e=>e!==`mp4`&&e!==`m4v`)};Qa.add(Jd);var Yd={extension:{type:G.DetectionParser,priority:0},test:async()=>Kd(`video/ogg`),add:async e=>[...e,`ogv`],remove:async e=>e.filter(e=>e!==`ogv`)};Qa.add(Yd);var Xd={extension:G.ResolveParser,test:Ad.test,parse:e=>({resolution:parseFloat(W.RETINA_PREFIX.exec(e)?.[1]??`1`),format:Vi.extname(e).slice(1),src:e})};Qa.add(Xd);var Zd=(e=>(e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]=`COMPRESSED_RGB_S3TC_DXT1_EXT`,e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]=`COMPRESSED_RGBA_S3TC_DXT1_EXT`,e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]=`COMPRESSED_RGBA_S3TC_DXT3_EXT`,e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]=`COMPRESSED_RGBA_S3TC_DXT5_EXT`,e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]=`COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT`,e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]=`COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT`,e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]=`COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT`,e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]=`COMPRESSED_SRGB_S3TC_DXT1_EXT`,e[e.COMPRESSED_R11_EAC=37488]=`COMPRESSED_R11_EAC`,e[e.COMPRESSED_SIGNED_R11_EAC=37489]=`COMPRESSED_SIGNED_R11_EAC`,e[e.COMPRESSED_RG11_EAC=37490]=`COMPRESSED_RG11_EAC`,e[e.COMPRESSED_SIGNED_RG11_EAC=37491]=`COMPRESSED_SIGNED_RG11_EAC`,e[e.COMPRESSED_RGB8_ETC2=37492]=`COMPRESSED_RGB8_ETC2`,e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]=`COMPRESSED_RGBA8_ETC2_EAC`,e[e.COMPRESSED_SRGB8_ETC2=37493]=`COMPRESSED_SRGB8_ETC2`,e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]=`COMPRESSED_SRGB8_ALPHA8_ETC2_EAC`,e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]=`COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2`,e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]=`COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2`,e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]=`COMPRESSED_RGB_PVRTC_4BPPV1_IMG`,e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]=`COMPRESSED_RGBA_PVRTC_4BPPV1_IMG`,e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]=`COMPRESSED_RGB_PVRTC_2BPPV1_IMG`,e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]=`COMPRESSED_RGBA_PVRTC_2BPPV1_IMG`,e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]=`COMPRESSED_RGB_ETC1_WEBGL`,e[e.COMPRESSED_RGB_ATC_WEBGL=35986]=`COMPRESSED_RGB_ATC_WEBGL`,e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]=`COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL`,e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]=`COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL`,e[e.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]=`COMPRESSED_RGBA_ASTC_4x4_KHR`,e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]=`COMPRESSED_RGBA_BPTC_UNORM_EXT`,e[e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]=`COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT`,e[e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]=`COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT`,e[e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]=`COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT`,e))(Zd||{}),Qd={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,3749
9120:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1},$d,ef;function tf(){ef={bptc:$d.getExtension(`EXT_texture_compression_bptc`),astc:$d.getExtension(`WEBGL_compressed_texture_astc`),etc:$d.getExtension(`WEBGL_compressed_texture_etc`),s3tc:$d.getExtension(`WEBGL_compressed_texture_s3tc`),s3tc_sRGB:$d.getExtension(`WEBGL_compressed_texture_s3tc_srgb`),pvrtc:$d.getExtension(`WEBGL_compressed_texture_pvrtc`)||$d.getExtension(`WEBKIT_WEBGL_compressed_texture_pvrtc`),etc1:$d.getExtension(`WEBGL_compressed_texture_etc1`),atc:$d.getExtension(`WEBGL_compressed_texture_atc`)}}var nf={extension:{type:G.DetectionParser,priority:2},test:async()=>{let e=W.ADAPTER.createCanvas().getContext(`webgl`);return e?($d=e,!0):(console.warn(`WebGL not available for compressed textures.`),!1)},add:async e=>{ef||tf();let t=[];for(let e in ef)ef[e]&&t.push(e);return[...t,...e]},remove:async e=>(ef||tf(),e.filter(e=>!(e in ef)))};Qa.add(nf);var rf=class extends ho{constructor(e,t={width:1,height:1,autoLoad:!0}){let n,r;typeof e==`string`?(n=e,r=new Uint8Array):(n=null,r=e),super(r,t),this.origin=n,this.buffer=r?new $a(r):null,this._load=null,this.loaded=!1,this.origin!==null&&t.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load||=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new $a(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load}},af=class e extends rf{constructor(t,n){super(t,n),this.format=n.format,this.levels=n.levels||1,this._width=n.width,this._height=n.height,this._extension=e._formatToExtension(this.format),(n.levelBuffers||this.buffer)&&(this._levelBuffers=n.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,n){let r=e.gl;if(!e.context.extensions[this._extension])throw Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;r.pixelStorei(r.UNPACK_ALIGNMENT,4);for(let e=0,t=this.levels;e<t;e++){let{levelID:t,levelWidth:n,levelHeight:i,levelBuffer:a}=this._levelBuffers[e];r.compressedTexImage2D(r.TEXTURE_2D,t,this.format,n,i,0,a)}return!0}onBlobLoaded(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(e){if(e>=33776&&e<=33779)return`s3tc`;if(e>=35916&&e<=35919)return`s3tc_sRGB`;if(e>=37488&&e<=37497)return`etc`;if(e>=35840&&e<=35843)return`pvrtc`;if(e===36196)return`etc1`;if(e===35986||e===35987||e===34798)return`atc`;if(e>=36492&&e<=36495)return`bptc`;if(e===37808)return`astc`;throw Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,t,n,r,i,a,o){let s=Array(n),c=e.byteOffset,l=a,u=o,d=l+r-1&~(r-1),f=u+i-1&~(i-1),p=d*f*Qd[t];for(let a=0;a<n;a++)s[a]={levelID:a,levelWidth:n>1?l:d,levelHeight:n>1?u:f,levelBuffer:new Uint8Array(e.buffer,c,p)},c+=p,l=l>>1||1,u=u>>1||1,d=l+r-1&~(r-1),f=u+i-1&~(i-1),p=d*f*Qd[t];return s}},of=124,sf=32,cf=20,lf=542327876,uf={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},df={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},ff={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},pf=1,mf=2,hf=4,gf=64,_f=512,vf=131072,yf=827611204,bf=861165636,xf=894720068,Sf=808540228,Cf=4,wf={[yf]:Zd.COMPRESSED_RGBA_S3TC_DXT1_EXT,[bf]:Zd.COMPRESSED_RGBA_S3TC_DXT3_EXT,[xf]:Zd.COMPRESSED_RGBA_S3TC_DXT5_EXT},Tf={70:Zd.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Zd.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Zd.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Zd.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Zd.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Zd.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Zd.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Zd.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Zd.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Zd.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Zd.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Zd.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Zd.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function Ef(e){let t=new Uint32Array(e);if(t[0]!==lf)throw Error(`Invalid DDS file magic word`);let n=new Uint32Array(e,0,of/Uint32Array.BYTES_PER_ELEMENT),r=n[uf.HEIGHT],i=n[uf.WIDTH],a=n[uf.MIPMAP_COUNT],o=new Uint32Array(e,uf.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,sf/Uint32Array.BYTES_PER_ELEMENT),s=o[pf];if(s&hf){let n=o[df.FOURCC];if(n!==Sf){let t=wf[n];return[new af(new Uint8Array(e,128),{format:t,width:i,height:r,levels:a})]}let s=new Uint32Array(t.buffer,128,cf/Uint32Array.BYTES_PER_ELEMENT),c=s[ff.DXGI_FORMAT],l=s[ff.RESOURCE_DIMENSION],u=s[ff.MISC_FLAG],d=s[ff.ARRAY_SIZE],f=Tf[c];if(f===void 0)throw Error(`DDSParser cannot parse texture data with DXGI format ${c}`);if(u===Cf)throw Error(`DDSParser does not support cubemap textures`);if(l===6)throw Error(`DDSParser does not supported 3D texture data`);let p=[];if(d===1)p.push(new Uint8Array(e,148));else{let t=Qd[f],n=0,o=i,s=r;for(let e=0;e<a;e++){let e=Math.max(1,o+3&-4)*Math.max(1,s+3&-4)*t;n+=e,o>>>=1,s>>>=1}let c=148;for(let t=0;t<d;t++)p.push(new Uint8Array(e,c,n)),c+=n}return p.map(e=>new af(e,{format:f,width:i,height:r,levels:a}))}throw s&gf?Error(`DDSParser does not support uncompressed texture data.`):s&_f?Error(`DDSParser does not supported YUV uncompressed texture data.`):s&vf?Error(`DDSParser does not support single-channel (lumninance) texture data!`):s&mf?Error(`DDSParser does not support single-channel (alpha) texture data!`):Error(`DDSParser failed to load a texture file due to an unknown reason!`)}var Df=[171,75,84,88,32,49,49,187,13,10,26,10],Of=67305985,kf={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Af=64,jf={[or.UNSIGNED_BYTE]:1,[or.UNSIGNED_SHORT]:2,[or.INT]:4,[or.UNSIGNED_INT]:4,[or.FLOAT]:4,[or.HALF_FLOAT]:8},Mf={[H.RGBA]:4,[H.RGB]:3,[H.RG]:2,[H.RED]:1,[H.LUMINANCE]:1,[H.LUMINANCE_ALPHA]:2,[H.ALPHA]:1},Nf={[or.UNSIGNED_SHORT_4_4_4_4]:2,[or.UNSIGNED_SHORT_5_5_5_1]:2,[or.UNSIGNED_SHORT_5_6_5]:2};function Pf(e,t,n=!1){let r=new DataView(t);if(!Ff(e,r))return null;let i=r.getUint32(kf.ENDIANNESS,!0)===Of,a=r.getUint32(kf.GL_TYPE,i),o=r.getUint32(kf.GL_FORMAT,i),s=r.getUint32(kf.GL_INTERNAL_FORMAT,i),c=r.getUint32(kf.PIXEL_WIDTH,i),l=r.getUint32(kf.PIXEL_HEIGHT,i)||1,u=r.getUint32(kf.PIXEL_DEPTH,i)||1,d=r.getUint32(kf.NUMBER_OF_ARRAY_ELEMENTS,i)||1,f=r.getUint32(kf.NUMBER_OF_FACES,i),p=r.getUint32(kf.NUMBER_OF_MIPMAP_LEVELS,i),m=r.getUint32(kf.BYTES_OF_KEY_VALUE_DATA,i);if(l===0||u!==1)throw Error(`Only 2D textures are supported`);if(f!==1)throw Error(`CubeTextures are not supported by KTXLoader yet!`);if(d!==1)throw Error(`WebGL does not support array textures`);let h=c+3&-4,g=l+3&-4,_=Array(d),v=c*l;a===0&&(v=h*g);let y;if(y=a===0?Qd[s]:jf[a]?jf[a]*Mf[o]:Nf[a],y===void 0)throw Error(`Unable to resolve the pixel format stored in the *.ktx file!`);let b=n?Lf(r,m,i):null,x=v*y,S=c,C=l,w=h,T=g,E=Af+m;for(let e=0;e<p;e++){let n=r.getUint32(E,i),o=E+4;for(let n=0;n<d;n++){let r=_[n];r||=_[n]=Array(p),r[e]={levelID:e,levelWidth:p>1||a!==0?S:w,levelHeight:p>1||a!==0?C:T,levelBuffer:new Uint8Array(t,o,x)},o+=x}
912E+=n+4,E=E%4==0?E:E+4-E%4,S=S>>1||1,C=C>>1||1,w=S+4-1&-4,T=C+4-1&-4,x=w*T*y}return a===0?{compressed:_.map(e=>new af(null,{format:s,width:c,height:l,levels:p,levelBuffers:e})),kvData:b}:{uncompressed:_.map(e=>{let t=e[0].levelBuffer,n=!1;return a===or.FLOAT?t=new Float32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4):a===or.UNSIGNED_INT?(n=!0,t=new Uint32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)):a===or.INT&&(n=!0,t=new Int32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)),{resource:new ho(t,{width:e[0].levelWidth,height:e[0].levelHeight}),type:a,format:n?If(o):o}}),kvData:b}}function Ff(e,t){for(let n=0;n<Df.length;n++)if(t.getUint8(n)!==Df[n])return console.error(`${e} is not a valid *.ktx file!`),!1;return!0}function If(e){switch(e){case H.RGBA:return H.RGBA_INTEGER;case H.RGB:return H.RGB_INTEGER;case H.RG:return H.RG_INTEGER;case H.RED:return H.RED_INTEGER;default:return e}}function Lf(e,t,n){let r=new Map,i=0;for(;i<t;){let a=e.getUint32(Af+i,n),o=Af+i+4,s=3-(a+3)%4;if(a===0||a>t-i){console.error(`KTXLoader: keyAndValueByteSize out of bounds`);break}let c=0;for(;c<a&&e.getUint8(o+c)!==0;c++);if(c===-1){console.error(`KTXLoader: Failed to find null byte terminating kvData key`);break}let l=new TextDecoder().decode(new Uint8Array(e.buffer,o,c)),u=new DataView(e.buffer,o+c+1,a-c-1);r.set(l,u),i+=4+a+s}return r}var Rf={extension:{type:G.LoadParser,priority:nd.High},name:`loadDDS`,test(e){return Ju(e,`.dds`)},async load(e,t,n){let r=Ef(await(await W.ADAPTER.fetch(e)).arrayBuffer()).map(r=>Ed(new vo(r,{mipmap:lr.OFF,alphaMode:ur.NO_PREMULTIPLIED_ALPHA,resolution:Ya(e),...t.data}),n,e));return r.length===1?r[0]:r},unload(e){Array.isArray(e)?e.forEach(e=>e.destroy(!0)):e.destroy(!0)}};Qa.add(Rf);var zf={extension:{type:G.LoadParser,priority:nd.High},name:`loadKTX`,test(e){return Ju(e,`.ktx`)},async load(e,t,n){let{compressed:r,uncompressed:i,kvData:a}=Pf(e,await(await W.ADAPTER.fetch(e)).arrayBuffer()),o=r??i,s={mipmap:lr.OFF,alphaMode:ur.NO_PREMULTIPLIED_ALPHA,resolution:Ya(e),...t.data},c=o.map(t=>{o===i&&Object.assign(s,{type:t.type,format:t.format});let r=new vo(t.resource??t,s);return r.ktxKeyValueData=a,Ed(r,n,e)});return c.length===1?c[0]:c},unload(e){Array.isArray(e)?e.forEach(e=>e.destroy(!0)):e.destroy(!0)}};Qa.add(zf);var Bf=[`s3tc`,`s3tc_sRGB`,`etc`,`etc1`,`pvrtc`,`atc`,`astc`,`bptc`],Vf={extension:G.ResolveParser,test:e=>{let t=Vi.extname(e).slice(1);return[`basis`,`ktx`,`dds`].includes(t)},parse:e=>{let t=e.split(`.`),n=t.pop();if([`ktx`,`dds`].includes(n)){let n=t.pop();if(Bf.includes(n))return{resolution:parseFloat(W.RETINA_PREFIX.exec(e)?.[1]??`1`),format:n,src:e}}return{resolution:parseFloat(W.RETINA_PREFIX.exec(e)?.[1]??`1`),format:n,src:e}}};Qa.add(Vf);var Hf=new Io,Uf=4,Wf=class e{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){let e=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,t,n,r){let i=new Image;return i.src=await this.base64(e,t,n,r),i}async base64(e,t,n,r){let i=this.canvas(e,r);if(i.toBlob!==void 0)return new Promise((e,r)=>{i.toBlob(t=>{if(!t){r(Error(`ICanvas.toBlob failed!`));return}let n=new FileReader;n.onload=()=>e(n.result),n.onerror=r,n.readAsDataURL(t)},t,n)});if(i.toDataURL!==void 0)return i.toDataURL(t,n);if(i.convertToBlob!==void 0){let e=await i.convertToBlob({type:t,quality:n});return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>
912t(r.result),r.onerror=n,r.readAsDataURL(e)})}throw Error(`Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented`)}canvas(t,n){let{pixels:r,width:i,height:a,flipY:o,premultipliedAlpha:s}=this._rawPixels(t,n);o&&e._flipY(r,i,a),s&&e._unpremultiplyAlpha(r);let c=new Ua(i,a,1),l=new ImageData(new Uint8ClampedArray(r.buffer),i,a);return c.context.putImageData(l,0,0),c.canvas}pixels(t,n){let{pixels:r,width:i,height:a,flipY:o,premultipliedAlpha:s}=this._rawPixels(t,n);return o&&e._flipY(r,i,a),s&&e._unpremultiplyAlpha(r),r}_rawPixels(e,t){let n=this.renderer;if(!n)throw Error(`The Extract has already been destroyed`);let r,i=!1,a=!1,o,s=!1;e&&(e instanceof tc?o=e:(o=n.generateTexture(e,{region:t,resolution:n.resolution,multisample:n.multisample}),s=!0,t&&=(Hf.width=t.width,Hf.height=t.height,Hf)));let c=n.gl;if(o){if(r=o.baseTexture.resolution,t??=o.frame,i=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===H.RGBA,!s){n.renderTexture.bind(o);let e=o.framebuffer.glFramebuffers[n.CONTEXT_UID];e.blitFramebuffer&&n.framebuffer.bind(e.blitFramebuffer)}}else r=n.resolution,t||(t=Hf,t.width=n.width/r,t.height=n.height/r),i=!0,a=this._rendererPremultipliedAlpha,n.renderTexture.bind();let l=Math.max(Math.round(t.width*r),1),u=Math.max(Math.round(t.height*r),1),d=new Uint8Array(Uf*l*u);return c.readPixels(Math.round(t.x*r),Math.round(t.y*r),l,u,c.RGBA,c.UNSIGNED_BYTE,d),s&&o?.destroy(!0),{pixels:d,width:l,height:u,flipY:i,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(e,t,n){let r=t<<2,i=n>>1,a=new Uint8Array(r);for(let t=0;t<i;t++){let i=t*r,o=(n-t-1)*r;a.set(e.subarray(i,i+r)),e.copyWithin(i,o,o+r),e.set(a,o)}}static _unpremultiplyAlpha(e){e instanceof Uint8ClampedArray&&(e=new Uint8Array(e.buffer));let t=e.length;for(let n=0;n<t;n+=4){let t=e[n+3];if(t!==0){let r=255.001/t;e[n]=e[n]*r+.5,e[n+1]=e[n+1]*r+.5,e[n+2]=e[n+2]*r+.5}}}};Wf.extension={name:`extract`,type:G.RendererSystem};var Gf=Wf;Qa.add(Gf);var Kf={build(e){let t=e.points,n,r,i,a,o,s;if(e.type===No.CIRC){let t=e.shape;n=t.x,r=t.y,o=s=t.radius,i=a=0}else if(e.type===No.ELIP){let t=e.shape;n=t.x,r=t.y,o=t.width,s=t.height,i=a=0}else{let t=e.shape,c=t.width/2,l=t.height/2;n=t.x+c,r=t.y+l,o=s=Math.max(0,Math.min(t.radius,Math.min(c,l))),i=c-o,a=l-s}if(!(o>=0&&s>=0&&i>=0&&a>=0)){t.length=0;return}let c=Math.ceil(2.3*Math.sqrt(o+s)),l=c*8+(i?4:0)+(a?4:0);if(t.length=l,l===0)return;if(c===0){t.length=8,t[0]=t[6]=n+i,t[1]=t[3]=r+a,t[2]=t[4]=n-i,t[5]=t[7]=r-a;return}let u=0,d=c*4+(i?2:0)+2,f=d,p=l;{let e=i+o,s=a,c=n+e,l=n-e,m=r+s;if(t[u++]=c,t[u++]=m,t[--d]=m,t[--d]=l,a){let e=r-s;t[f++]=l,t[f++]=e,t[--p]=e,t[--p]=c}}for(let e=1;e<c;e++){let l=Math.PI/2*(e/c),m=i+Math.cos(l)*o,h=a+Math.sin(l)*s,g=n+m,_=n-m,v=r+h,y=r-h;t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,t[f++]=_,t[f++]=y,t[--p]=y,t[--p]=g}{let e=i,o=a+s,c=n+e,l=n-e,d=r+o,f=r-o;t[u++]=c,t[u++]=d,t[--p]=f,t[--p]=c,i&&(t[u++]=l,t[u++]=d,t[--p]=f,t[--p]=l)}},triangulate(e,t){let n=e.points,r=t.points,i=t.indices;if(n.length===0)return;let a=r.length/2,o=a,s,c;if(e.type!==No.RREC){let t=e.shape;s=t.x,c=t.y}else{let t=e.shape;s=t.x+t.width/2,c=t.y+t.height/2}let l=e.matrix;r.push(e.matrix?l.a*s+l.c*c+l.tx:s,e.matrix?l.b*s+l.d*c+l.ty:c),a++,r.push(n[0],n[1]);for(let e=2;e<n.length;e+=2)r.push(n[e],n[e+1]),i.push(a++,o,a);i.push(o+1,o,a)}};function qf(e,t=!1){let n=e.length;if(n<6)return;let r=0;for(let t=0,i=e[n-2],a=e[n-1];t<n;t+=2){let n=e[t],o=e[t+1];r+=(n-i)*(o+a),i=n,a=o}if(!t&&r>0||t&&r<=0){let t=n/2;for(let r=t+t%2;r<n;r+=2){let t=n-r-2,i=n-r-1,a=r,o=r+1;[e[t],e[a]]=[e[a],e[t]],[e[i],e[o]]=[e[o],e[i]]}}}var Jf={build(e){e.points=e.shape.points.slice()},triangulate(e,t){let n=e.points,r=e.holes,i=t.points,a=t.indices;if(n.length>=6){qf(n,!1);let e=[];for(let t=0;t<r.length;t++){let i=r[t];qf(i.points,!0),e.push(n.length/2),n=n.concat(i.points)}let t=Ni.default(n,e,2);if(!t)return;let o=i.length/2;for(let e=0;e<t.length;e+=3)a.push(t[e]+o),a.push(t[e+1]+o),a.push(t[e+2]+o);for(let e=0;e<n.length;e++)i.push(n[e])}}},Yf={build(e){let t=e.shape,n=t.x,r=t.y,i=t.width,a=t.height,o=e.points;o.length=0,i>=0&&a>=0&&o.push(n,r,n+i,r,n+i,r+a,n,r+a)},triangulate(e,t){let n=e.points,r=t.points;if(n.length===0)return;let i=r.length/2;r.push(n[0],n[1],n[2],n[3],n[6],n[7],n[4],n[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},Xf={build(e){Kf.build(e)},triangulate(e,t){Kf.triangulate(e,t)}},Zf=(e=>(e.MITER=`miter`,e.BEVEL=`bevel`,e.ROUND=`round`,e))(Zf||{}),Qf=(e=>(e.BUTT=`butt`,e.ROUND=`round`,e.SQUARE=`square`,e))(Qf||{}),$f={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(e,t=2
9120){if(!this.adaptive||!e||isNaN(e))return t;let n=Math.ceil(e/this.maxLength);return n<this.minSegments?n=this.minSegments:n>this.maxSegments&&(n=this.maxSegments),n}},ep=class{static curveTo(e,t,n,r,i,a){let o=a[a.length-2],s=a[a.length-1]-t,c=o-e,l=r-t,u=n-e,d=Math.abs(s*u-c*l);if(d<1e-8||i===0)return(a[a.length-2]!==e||a[a.length-1]!==t)&&a.push(e,t),null;let f=s*s+c*c,p=l*l+u*u,m=s*l+c*u,h=i*Math.sqrt(f)/d,g=i*Math.sqrt(p)/d,_=h*m/f,v=g*m/p,y=h*u+g*c,b=h*l+g*s,x=c*(g+_),S=s*(g+_),C=u*(h+v),w=l*(h+v),T=Math.atan2(S-b,x-y),E=Math.atan2(w-b,C-y);return{cx:y+e,cy:b+t,radius:i,startAngle:T,endAngle:E,anticlockwise:c*l>u*s}}static arc(e,t,n,r,i,a,o,s,c){let l=o-a,u=$f._segmentsCount(Math.abs(l)*i,Math.ceil(Math.abs(l)/Ao)*40),d=l/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),h=u-1,g=h%1/h;for(let e=0;e<=h;++e){let t=e+g*e,o=d+a+f*t,s=Math.cos(o),l=-Math.sin(o);c.push((p*s+m*l)*i+n,(p*-l+m*s)*i+r)}}},tp=class{constructor(){this.reset()}begin(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n}end(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}},np=class e{static curveLength(e,t,n,r,i,a,o,s){let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=e,b=t;for(let x=1;x<=10;++x)l=x/10,u=l*l,d=u*l,f=1-l,p=f*f,m=p*f,h=m*e+3*p*l*n+3*f*u*i+d*o,g=m*t+3*p*l*r+3*f*u*a+d*s,_=y-h,v=b-g,y=h,b=g,c+=Math.sqrt(_*_+v*v);return c}static curveTo(t,n,r,i,a,o,s){let c=s[s.length-2],l=s[s.length-1];s.length-=2;let u=$f._segmentsCount(e.curveLength(c,l,t,n,r,i,a,o)),d=0,f=0,p=0,m=0,h=0;s.push(c,l);for(let e=1,g=0;e<=u;++e)g=e/u,d=1-g,f=d*d,p=f*d,m=g*g,h=m*g,s.push(p*c+3*f*g*t+3*d*m*r+h*a,p*l+3*f*g*n+3*d*m*i+h*o)}};function rp(e,t,n,r,i,a,o,s){let c=e-n*i,l=t-r*i,u=e+n*a,d=t+r*a,f,p;o?(f=r,p=-n):(f=-r,p=n);let m=c+f,h=l+p,g=u+f,_=d+p;return s.push(m,h,g,_),2}function ip(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=Math.atan2(c,l),d=Math.atan2(i-e,a-t);s&&u<d?u+=Math.PI*2:!s&&u>d&&(d+=Math.PI*2);let f=u,p=d-u,m=Math.abs(p),h=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(h)/Math.PI>>0)+1,_=p/g;if(f+=_,s){o.push(e,t,n,r);for(let n=1,r=f;n<g;n++,r+=_)o.push(e,t,e+Math.sin(r)*h,t+Math.cos(r)*h);o.push(e,t,i,a)}else{o.push(n,r,e,t);for(let n=1,r=f;n<g;n++,r+=_)o.push(e+Math.sin(r)*h,t+Math.cos(r)*h,e,t);o.push(i,a,e,t)}return g*2}function ap(e,t){let n=e.shape,r=e.points||n.points.slice(),i=t.closePointEps;if(r.length===0)return;let a=e.lineStyle,o=new Po(r[0],r[1]),s=new Po(r[r.length-2],r[r.length-1]),c=n.type!==No.POLY||n.closeStroke,l=Math.abs(o.x-s.x)<i&&Math.abs(o.y-s.y)<i;if(c){r=r.slice(),l&&(r.pop(),r.pop(),s.set(r[r.length-2],r[r.length-1]));let e=(o.x+s.x)*.5,t=(s.y+o.y)*.5;r.unshift(e,t),r.push(e,t)}let u=t.points,d=r.length/2,f=r.length,p=u.length/2,m=a.width/2,h=m*m,g=a.miterLimit*a.miterLimit,_=r[0],v=r[1],y=r[2],b=r[3],x=0,S=0,C=-(v-b),w=_-y,T=0,E=0,D=Math.sqrt(C*C+w*w);C/=D,w/=D,C*=m,w*=m;let O=a.alignment,k=(1-O)*2,A=O*2;c||(a.cap===Qf.ROUND?f+=ip(_-C*(k-A)*.5,v-w*(k-A)*.5,_-C*k,v-w*k,_+C*A,v+w*A,u,!0)+2:a.cap===Qf.SQUARE&&(f+=rp(_,v,C,w,k,A,!0,u))),u.push(_-C*k,v-w*k,_+C*A,v+w*A);for(let e=1;e<d-1;++e){_=r[(e-1)*2],v=r[(e-1)*2+1],y=r[e*2],b=r[e*2+1],x=r[(e+1)*2],S=r[(e+1)*2+1],C=-(v-b),w=_-y,D=Math.sqrt(C*C+w*w),C/=D,w/=D,C*=m,w*=m,T=-(b-S),E=y-x,D=Math.sqrt(T*T+E*E),T/=D,E/=D,T*=m,E*=m;let t=y-_,n=v-b,i=y-x,o=S-b,s=t*i+n*o,c=n*i-o*t,l=c<0;if(Math.abs(c)<.001*Math.abs(s)){u.push(y-C*k,b-w*k,y+C*A,b+w*A),s>=0&&(a.join===Zf.ROUND?f+=ip(y,b,y-C*k,b-w*k,y-T*k,b-E*k,u,!1)+4:f+=2,u.push(y-T*A,b-E*A,y+T*k,b+E*k));continue}let d=(-C+_)*(-w+b)-(-C+y)*(-w+v),p=(-T+x)*(-E+b)-(-T+y)*(-E+S),O=(t*p-i*d)/c,j=(o*d-n*p)/c,M=(O-y)*(O-y)+(j-b)*(j-b),N=y+(O-y)*k,P=b+(j-b)*k,F=y-(O-y)*A,I=b-(j-b)*A,L=Math.min(t*t+n*n,i*i+o*o),ee=l?k:A,R=M<=L+ee*ee*h,z=a.join;if(z===Zf.MITER&&M/h>g&&(z=Zf.BEVEL),R)switch(z){case Zf.MITER:u.push(N,P,F,I);break;case Zf.BEVEL:l?u.push(N,P,y+C*A,b+w*A,N,P,y+T*A,b+E*A):u.push(y-C*k,b-w*k,F,I,y-T*k,b-E*k,F,I),f+=2;break;case Zf.ROUND:l?(u.push(N,P,y+C*A,b+w*A),f+=ip(y,b,y+C*A,b+w*A,y+T*A,b+E*A,u,!0)+4,u.push(N,P,y+T*A,b+E*A)):(u.push(y-C*k,b-w*k,F,I),f+=ip(y,b,y-C*k,b-w*k,y-T*k,b-E*k,u,!1)+4,u.push(y-T*k,b-E*k,F,I));break}else{switch(u.push(y-C*k,b-w*k,y+C*A,b+w*A),z){case Zf.MITER:l?u.push(F,I,F,I):u.push(N,P,N,P),f+=2;break;case Zf.ROUND:l?f+=ip(y,b,y+C*A,b+w*A,y+T*A,b+E*A,u,!0)+2:f+=ip(y,b,y-C*k,b-w*k,y-T*k,b-E*k,u,!1)+2;break}
912u.push(y-T*k,b-E*k,y+T*A,b+E*A),f+=2}}_=r[(d-2)*2],v=r[(d-2)*2+1],y=r[(d-1)*2],b=r[(d-1)*2+1],C=-(v-b),w=_-y,D=Math.sqrt(C*C+w*w),C/=D,w/=D,C*=m,w*=m,u.push(y-C*k,b-w*k,y+C*A,b+w*A),c||(a.cap===Qf.ROUND?f+=ip(y-C*(k-A)*.5,b-w*(k-A)*.5,y-C*k,b-w*k,y+C*A,b+w*A,u,!1)+2:a.cap===Qf.SQUARE&&(f+=rp(y,b,C,w,k,A,!1,u)));let j=t.indices,M=$f.epsilon*$f.epsilon;for(let e=p;e<f+p-2;++e)_=u[e*2],v=u[e*2+1],y=u[(e+1)*2],b=u[(e+1)*2+1],x=u[(e+2)*2],S=u[(e+2)*2+1],!(Math.abs(_*(b-S)+y*(S-v)+x*(v-b))<M)&&j.push(e,e+1,e+2)}function op(e,t){let n=0,r=e.shape,i=e.points||r.points,a=r.type!==No.POLY||r.closeStroke;if(i.length===0)return;let o=t.points,s=t.indices,c=i.length/2,l=o.length/2,u=l;for(o.push(i[0],i[1]),n=1;n<c;n++)o.push(i[n*2],i[n*2+1]),s.push(u,u+1),u++;a&&s.push(u,l)}function sp(e,t){e.lineStyle.native?op(e,t):ap(e,t)}var cp=class e{static curveLength(e,t,n,r,i,a){let o=e-2*n+i,s=t-2*r+a,c=2*n-2*e,l=2*r-2*t,u=4*(o*o+s*s),d=4*(o*c+s*l),f=c*c+l*l,p=2*Math.sqrt(u+d+f),m=Math.sqrt(u),h=2*u*m,g=2*Math.sqrt(f),_=d/m;return(h*p+m*d*(p-g)+(4*f*u-d*d)*Math.log((2*m+_+p)/(_+g)))/(4*h)}static curveTo(t,n,r,i,a){let o=a[a.length-2],s=a[a.length-1],c=$f._segmentsCount(e.curveLength(o,s,t,n,r,i)),l=0,u=0;for(let e=1;e<=c;++e){let d=e/c;l=o+(t-o)*d,u=s+(n-s)*d,a.push(l+(t+(r-t)*d-l)*d,u+(n+(i-n)*d-u)*d)}}},lp={[No.POLY]:Jf,[No.CIRC]:Kf,[No.ELIP]:Kf,[No.RECT]:Yf,[No.RREC]:Xf},up=[],dp=[],fp=class e{constructor(e,t=null,n=null,r=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=r,this.type=e.type}clone(){return new e(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}},pp=new Po,mp=class e extends ko{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new Vl,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),dp.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){let t=this.batches[e];t.reset(),up.push(t)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,n=null,r=null){let i=new fp(e,t,n,r);return this.graphicsData.push(i),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;let n=new fp(e,null,null,t),r=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=r.lineStyle,r.holes.push(n),this.dirty++,this}destroy(){super.destroy();for(let e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(e){let t=this.graphicsData;for(let n=0;n<t.length;++n){let r=t[n];if(r.fillStyle.visible&&r.shape&&(r.matrix?r.matrix.applyInverse(e,pp):pp.copyFrom(e),r.shape.contains(pp.x,pp.y))){let e=!1;if(r.holes){for(let t=0;t<r.holes.length;t++)if(r.holes[t].shape.contains(pp.x,pp.y)){e=!0;break}}if(!e)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;let e=this.uvs,t=this.graphicsData,n=null,r=null;this.batches.length>0&&(n=this.batches[this.batches.length-1],r=n.style);for(let i=this.shapeIndex;i<t.length;i++){this.shapeIndex++;let a=t[i],o=a.fillStyle,s=a.lineStyle;lp[a.type].build(a),a.matrix&&this.transformPoints(a.points,a.matrix
912),(o.visible||s.visible)&&this.processHoles(a.holes);for(let t=0;t<2;t++){let i=t===0?o:s;if(!i.visible)continue;let c=i.texture.baseTexture,l=this.indices.length,u=this.points.length/2;c.wrapMode=cr.REPEAT,t===0?this.processFill(a):this.processLine(a);let d=this.points.length/2-u;d!==0&&(n&&!this._compareStyles(r,i)&&(n.end(l,u),n=null),n||(n=up.pop()||new tp,n.begin(i,l,u),this.batches.push(n),r=i),this.addUvs(this.points,e,i.texture,u,d,i.matrix))}}let i=this.indices.length,a=this.points.length/2;if(n&&n.end(i,a),this.batches.length===0){this.batchable=!0;return}let o=a>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e<t;e++){let t=this.graphicsData[e],n=t.fillStyle,r=t.lineStyle;if(n&&!n.texture.baseTexture.valid||r&&!r.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);let e=this.batches;for(let t=0,n=e.length;t<n;t++){let n=e[t];for(let e=0;e<n.size;e++){let t=n.start+e;this.indicesUint16[t]=this.indicesUint16[t]-n.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;let t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<e.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++vo._globalBatch;for(let e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),dp.push(this.drawCalls[e]);this.drawCalls.length=0;let t=this.colors,n=this.textureIds,r=dp.pop();r||(r=new yo,r.texArray=new Ms),r.texArray.count=0,r.start=0,r.size=0,r.type=ir.TRIANGLES;let i=0,a=null,o=0,s=!1,c=ir.TRIANGLES,l=0;this.drawCalls.push(r);for(let u=0;u<this.batches.length;u++){let d=this.batches[u],f=d.style,p=f.texture.baseTexture;s!==!!f.native&&(s=!!f.native,c=s?ir.LINES:ir.TRIANGLES,a=null,i=8,e++),a!==p&&(a=p,p._batchEnabled!==e&&(i===8&&(e++,i=0,r.size>0&&(r=dp.pop(),r||(r=new yo,r.texArray=new Ms),this.drawCalls.push(r)),r.start=l,r.size=0,r.texArray.count=0,r.type=c),p.touched=1,p._batchEnabled=e,p._batchLocation=i,p.wrapMode=cr.REPEAT,r.texArray.elements[r.texArray.count++]=p,i++)),r.size+=d.size,l+=d.size,o=p._batchLocation,this.addColors(t,f.color,f.alpha,d.attribSize,d.attribStart),this.addTextureIds(n,o,d.attribSize,d.attribStart)}vo._globalBatch=e,this.packAttributes()}packAttributes(){let e=this.points,t=this.uvs,n=this.colors,r=this.textureIds,i=new ArrayBuffer(e.length*3*4),a=new Float32Array(i),o=new Uint32Array(i),s=0;for(let i=0;i<e.length/2;i++)a[s++]=e[i*2],a[s++]=e[i*2+1],a[s++]=t[i*2],a[s++]=t[i*2+1],o[s++]=n[i],a[s++]=r[i];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)}processFill(e){e.holes.length?Jf.triangulate(e,this):lp[e.type].triangulate(e,this)}processLine(e){sp(e,this);for(let t=0;t<e.holes.length;t++)sp(e.holes[t],this)}processHoles(e){for(let t=0;t<e.length;t++){let n=e[t];lp[n.type].build(n),n.matrix&&this.transformPoints(n.points,n.matrix)}}calculateBounds(){let e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)}transformPoints(e,t){for(let n=0;n<e.length/2;n++){let r=e[n*2],i=e[n*2+1];e[n*2]=t.a*r+t.c*i+t.tx,e[n*2+1]=t.b*r+t.d*i+t.ty}}addColors(e,t,n,r,i=0){let a=Ca.shared.setValue(t).toLittleEndianNumber(),o=Ca.shared.setValue(a).toPremultiplied(n);e.length=Math.max(e.length,i+r);for(let t=0;t<r;t++)e[i+t]=o}addTextureIds(e,t,n,r=0){e.length=Math.max(e.length,r+n);for(let i=0;i<n;i++)e[r+i]=t}addUvs(e,t,n,r,i,a=null){let o=0,s=t.length,c=n.frame;for(;o<i;){let n=e[(r+o)*2],i=e[(r+o)*2+1];if(a){let e=a.a*n+a.c*i+a.tx;i=a.b*n+a.d*i+a.ty,n=e}o++,t.push(n/c.width,i/c.height)}let l=n.baseTexture;(c.width<l.width||c.height<l.height)&&this.adjustUvs(t,n,s,i)}adjustUvs(e,t,n,r){let i=t.baseTexture,a=1e-6,o=n+r*2,s=t.frame,c=s.width/i.width,l=s.height/i.height,u=s.x/s.width,d=s.y/s.height,f=Math.floor(e[n]+a),p=Math.floor(e[n+1]+a);for(let t=n+2;t<o;t+=2)f=Math.min(f,Math.floor(e[t]+a)),p=Math.min(p,Math.floor(e[t+1]+a));u-=f,d-=p;for(let t=n;t<o;
912t+=2)e[t]=(e[t]+u)*c,e[t+1]=(e[t+1]+d)*l}};mp.BATCHABLE_SIZE=100;var hp=mp,gp=class e{constructor(){this.color=16777215,this.alpha=1,this.texture=K.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){let t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=K.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}},_p=class e extends gp{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Qf.BUTT,this.join=Zf.MITER,this.miterLimit=10}clone(){let t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=Qf.BUTT,this.join=Zf.MITER,this.miterLimit=10}},vp={},yp=class e extends ql{constructor(e=null){super(),this.shader=null,this.pluginName=`batch`,this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new gp,this._lineStyle=new _p,this._matrix=null,this._holeMode=!1,this.state=lo.for2d(),this._geometry=e||new hp,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Ca(16777215),this.blendMode=rr.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new e(this._geometry)}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(e=null,t=0,n,r=.5,i=!1){return typeof e==`number`&&(e={width:e,color:t,alpha:n,alignment:r,native:i}),this.lineTextureStyle(e)}lineTextureStyle(e){let t={width:0,texture:K.WHITE,color:e?.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Qf.BUTT,join:Zf.MITER,miterLimit:10};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();let n=e.width>0&&e.alpha>0;return n?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:n},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){let e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new zo,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new zo,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);let n=this.currentPath.points,r=n[n.length-2],i=n[n.length-1];return(r!==e||i!==t)&&n.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,n,r){this._initCurve();let i=this.currentPath.points;return i.length===0&&this.moveTo(0,0),cp.curveTo(e,t,n,r,i),this}bezierCurveTo(e,t,n,r,i,a){return this._initCurve(),np.curveTo(e,t,n,r,i,a,this.currentPath.points),this}arcTo(e,t,n,r,i){this._initCurve(e,t);let a=this.currentPath.points,o=ep.curveTo(e,t,n,r,i,a);if(o){let{cx:e,cy:t,radius:n,startAngle:r,endAngle:i,anticlockwise:a}=o;this.arc(e,t,n,r,i,a)}return this}arc(e,t,n,r,i,a=!1){if(r===i||(!a&&i<=r?i+=Ao:a&&r<=i&&(r+=Ao),i-r===0))return this;let o=e+Math.cos(r)*n,s=t+Math.sin(r)*n,c=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){let e=Math.abs(l[l.length-2]-o),t=Math.abs(l[l.length-1]-s);e<c&&t<c||l.push(o,s)}else this.moveTo(o,s),l=this.currentPath.points;return ep.arc(o,s,e,t,n,r,i,a,l),this}beginFill(e=0,t){return this.beginTextureFill({texture:K.WHITE,color:e,alpha:t})}normalizeColor(e){let t=Ca.shared.setValue(e.color??0);e.color=t.toNumber(),e.alpha??=t.alpha}beginTextureFill(e){let t={texture:K.WHITE,color:16777215,matrix:null};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();let n=e.alpha>0;return n?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:n},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,n,r){return this.drawShape(new Io(e,t,n,r))}drawRoundedRect(e,t,n,r,i){return this.drawShape(new Bo(e,t,n,r,i))}drawCircle(e,t,n){return this.drawShape(new Lo(e,t,n))}drawEllipse(e,t,n,r){return this.drawShape(new Ro(e,t,n,r))}drawPolygon(...e){let t,n=!0,r=e[0];r.points?(n=r.closeStroke,t=r.points):t=Array.isArray(e[0])?e[0]:e;let i=new zo(t);return i.closeStroke=n,this.drawShape(i),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}
912isFastRect(){let e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===No.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();let t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){let e=this._geometry,t=this.blendMode,n=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=n,this.vertexData=new Float32Array(e.points);for(let r=0;r<n;r++){let n=e.batches[r],i=n.style.color,a=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),o=new Float32Array(e.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),s={vertexData:a,blendMode:t,indices:new Uint16Array(e.indicesUint16.buffer,n.start*2,n.size),uvs:o,_batchRGB:Ca.shared.setValue(i).toRgbArray(),_tintRGB:i,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[r]=s}}_renderBatched(e){if(this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let t=0,n=this.batches.length;t<n;t++){let n=this.batches[t];n.worldAlpha=this.worldAlpha*n.alpha,e.plugins[this.pluginName].render(n)}}}_renderDirect(e){let t=this._resolveDirectShader(e),n=this._geometry,r=this.worldAlpha,i=t.uniforms,a=n.drawCalls;i.translationMatrix=this.transform.worldTransform,Ca.shared.setValue(this._tintColor).premultiply(r).toArray(i.tint),e.shader.bind(t),e.geometry.bind(n,t),e.state.set(this.state);for(let t=0,r=a.length;t<r;t++)this._renderDrawCallDirect(e,n.drawCalls[t])}_renderDrawCallDirect(e,t){let{texArray:n,type:r,size:i,start:a}=t,o=n.count;for(let t=0;t<o;t++)e.texture.bind(n.elements[t],t);e.geometry.draw(r,i,a)}_resolveDirectShader(e){let t=this.shader,n=this.pluginName;if(!t){if(!vp[n]){let{maxTextures:t}=e.plugins[n],r=new Int32Array(t);for(let e=0;e<t;e++)r[e]=e;let i={tint:new Float32Array([1,1,1,1]),translationMatrix:new Vo,default:ks.from({uSamplers:r},!0)},a=e.plugins[n]._shader.program;vp[n]=new As(a,i)}t=vp[n]}return t}_calculateBounds(){this.finishPoly();let e=this._geometry;if(!e.graphicsData.length)return;let{minX:t,minY:n,maxX:r,maxY:i}=e.bounds;this._bounds.addFrame(this.transform,t,n,r,i)}containsPoint(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let e=0;e<this.batches.length;e++){let t=this.batches[e];t._tintRGB=Ca.shared.setValue(this._tintColor).multiply(t._batchRGB).toLittleEndianNumber()}}}calculateVertices(){let e=this.transform._worldID;if(this._transformID===e)return;this._transformID=e;let t=this.transform.worldTransform,n=t.a,r=t.b,i=t.c,a=t.d,o=t.tx,s=t.ty,c=this._geometry.points,l=this.vertexData,u=0;for(let e=0;e<c.length;e+=2){let t=c[e],d=c[e+1];l[u++]=n*t+i*d+o,l[u++]=a*d+r*t+s}}closePath(){let e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this}setMatrix(e){return this._matrix=e,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(e){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,
912super.destroy(e)}};yp.curves=$f,yp._TEMP_POINT=new Po;var bp=yp,xp=class{constructor(e,t){this.uvBuffer=e,this.uvMatrix=t,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(e){if(!e&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;let t=this.uvBuffer.data;(!this.data||this.data.length!==t.length)&&(this.data=new Float32Array(t.length)),this.uvMatrix.multiplyUvs(t,this.data),this._updateID++}},Sp=new Po,Cp=new zo,wp=class e extends ql{constructor(e,t,n,r=ir.TRIANGLES){super(),this.geometry=e,this.shader=t,this.state=n||lo.for2d(),this.drawMode=r,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=W.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(e){this._geometry!==e&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=e,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(e){this.shader=e}get material(){return this.shader}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get tint(){return`tint`in this.shader?this.shader.tint:null}set tint(e){this.shader.tint=e}get tintValue(){return this.shader.tintValue}get texture(){return`texture`in this.shader?this.shader.texture:null}set texture(e){this.shader.texture=e}_render(t){let n=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===ir.TRIANGLES&&n.length<e.BATCHABLE_SIZE*2?this._renderToBatch(t):this._renderDefault(t)}_renderDefault(e){let t=this.shader;t.alpha=this.worldAlpha,t.update&&t.update(),e.batch.flush(),t.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(t),e.state.set(this.state),e.geometry.bind(this.geometry,t),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(e){let t=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=t.indexBuffer.data,this._tintRGB=n._tintRGB,this._texture=n.texture;let r=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[r]),e.plugins[r].render(this)}calculateVertices(){let e=this.geometry.buffers[0],t=e.data,n=e._updateID;if(n===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==t.length&&(this.vertexData=new Float32Array(t.length));let r=this.transform.worldTransform,i=r.a,a=r.b,o=r.c,s=r.d,c=r.tx,l=r.ty,u=this.vertexData;for(let e=0;e<u.length/2;e++){let n=t[e*2],r=t[e*2+1];u[e*2]=i*n+o*r+c,u[e*2+1]=a*n+s*r+l}if(this._roundPixels){let e=W.RESOLUTION;for(let t=0;t<u.length;++t)u[t]=Math.round(u[t]*e)/e}this.vertexDirty=n}calculateUvs(){let e=this.geometry.buffers[1],t=this.shader;t.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||=new xp(e,t.uvMatrix),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,Sp);let t=this.geometry.getBuffer(`aVertexPosition`).data,n=Cp.points,r=this.geometry.getIndex().data,i=r.length,a=this.drawMode===4?3:1;for(let e=0;e+2<i;e+=a){let i=r[e]*2,a=r[e+1]*2,o=r[e+2]*2;if(n[0]=t[i],n[1]=t[i+1],n[2]=t[a],n[3]=t[a+1],n[4]=t[o],n[5]=t[o+1],Cp.contains(Sp.x,Sp.y))return!0}return!1}destroy(e){super.destroy(e),this._cachedTexture&&=(this._cachedTexture.destroy(),null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};wp.BATCHABLE_SIZE=100;var Tp=wp,Ep=class extends Oo{constructor(e,t,n){super();let r=new xo(e),i=new xo(t,!0),a=new xo(n,!0,!0);this.addAttribute(`aVertexPosition`,r,2,!1,or.FLOAT).addAttribute(`aTextureCoord`,i,2,!1,or.FLOAT).addIndex(a),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}},Dp=`varying vec2 vTextureCoord;
913uniform vec4 uColor;
914
915uniform sampler2D uSampler;
916
917void main(void)
918{
919    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
920}
921`,Op=`attribute vec2 aVertexPosition;
922attribute vec2 aTextureCoord;
923
924uniform mat3 projectionMatrix;
925uniform mat3 translationMatrix;
926uniform mat3 uTextureMatrix;
927
928varying vec2 vTextureCoord;
929
930void main(void)
931{
932    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
932)).xy, 0.0, 1.0);
933
934    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
935}
936`,kp=class extends As{constructor(e,t){let n={uSampler:e,alpha:1,uTextureMatrix:Vo.IDENTITY,uColor:new Float32Array([1,1,1,1])};t=Object.assign({tint:16777215,alpha:1,pluginName:`batch`},t),t.uniforms&&Object.assign(n,t.uniforms),super(t.program||Ds.from(Op,Dp),n),this._colorDirty=!1,this.uvMatrix=new hc(e),this.batchable=t.program===void 0,this.pluginName=t.pluginName,this._tintColor=new Ca(t.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=t.alpha}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;let e=this.texture.baseTexture.alphaMode;Ca.shared.setValue(this._tintColor).premultiply(this._alpha,e).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}},Ap=class extends ql{constructor(e=1500,t,n=16384,r=!1){super();let i=16384;n>i&&(n=i),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=n,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=rr.NORMAL,this.autoResize=r,this.roundPixels=!0,this.baseTexture=null,this.setProperties(t),this._tintColor=new Ca(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(e){e&&(this._properties[0]=`vertices`in e||`scale`in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]=`position`in e?!!e.position:this._properties[1],this._properties[2]=`rotation`in e?!!e.rotation:this._properties[2],this._properties[3]=`uvs`in e?!!e.uvs:this._properties[3],this._properties[4]=`tint`in e||`alpha`in e?!!e.tint||!!e.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e),this._tintColor.toRgbArray(this.tintRgb)}render(e){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once(`update`,()=>this.onChildrenChange(0))),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))}onChildrenChange(e){let t=Math.floor(e/this._batchSize);for(;this._bufferUpdateIDs.length<t;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[t]=++this._updateID}dispose(){if(this._buffers){for(let e=0;e<this._buffers.length;++e)this._buffers[e].destroy();this._buffers=null}}destroy(e){super.destroy(e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}},jp=class{constructor(e,t,n){this.geometry=new Oo,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(let n=0;n<e.length;++n){let r=e[n];r={attributeName:r.attributeName,size:r.size,uploadFunction:r.uploadFunction,type:r.type||or.FLOAT,offset:r.offset},t[n]?this.dynamicProperties.push(r):this.staticProperties.push(r)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){let e=this.geometry,t=0;this.indexBuffer=new xo(ka(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(let e=0;e<this.dynamicProperties.length;++e){let n=this.dynamicProperties[e];n.offset=t,t+=n.size,this.dynamicStride+=n.size}let n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new xo(this.dynamicData,!1,!1);let r=0;
936this.staticStride=0;for(let e=0;e<this.staticProperties.length;++e){let t=this.staticProperties[e];t.offset=r,r+=t.size,this.staticStride+=t.size}let i=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(i),this.staticDataUint32=new Uint32Array(i),this.staticBuffer=new xo(this.staticData,!0,!1);for(let t=0;t<this.dynamicProperties.length;++t){let n=this.dynamicProperties[t];e.addAttribute(n.attributeName,this.dynamicBuffer,0,n.type===or.UNSIGNED_BYTE,n.type,this.dynamicStride*4,n.offset*4)}for(let t=0;t<this.staticProperties.length;++t){let n=this.staticProperties[t];e.addAttribute(n.attributeName,this.staticBuffer,0,n.type===or.UNSIGNED_BYTE,n.type,this.staticStride*4,n.offset*4)}}uploadDynamic(e,t,n){for(let r=0;r<this.dynamicProperties.length;r++){let i=this.dynamicProperties[r];i.uploadFunction(e,t,n,i.type===or.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,i.offset)}this.dynamicBuffer._updateID++}uploadStatic(e,t,n){for(let r=0;r<this.staticProperties.length;r++){let i=this.staticProperties[r];i.uploadFunction(e,t,n,i.type===or.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,i.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}},Mp=`varying vec2 vTextureCoord;
937varying vec4 vColor;
938
939uniform sampler2D uSampler;
940
941void main(void){
942    vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
943    gl_FragColor = color;
944}`,Np=`attribute vec2 aVertexPosition;
945attribute vec2 aTextureCoord;
946attribute vec4 aColor;
947
948attribute vec2 aPositionCoord;
949attribute float aRotation;
950
951uniform mat3 translationMatrix;
952uniform vec4 uColor;
953
954varying vec2 vTextureCoord;
955varying vec4 vColor;
956
957void main(void){
958    float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
959    float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
960
961    vec2 v = vec2(x, y);
962    v = v + aPositionCoord;
963
964    gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
965
966    vTextureCoord = aTextureCoord;
967    vColor = aColor * uColor;
968}
969`,Pp=class extends Fs{constructor(e){super(e),this.shader=null,this.properties=null,this.tempMatrix=new Vo,this.properties=[{attributeName:`aVertexPosition`,size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:`aPositionCoord`,size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:`aRotation`,size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:`aTextureCoord`,size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:`aColor`,size:1,type:or.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=As.from(Np,Mp,{}),this.state=lo.for2d()}render(e){let t=e.children,n=e._maxSize,r=e._batchSize,i=this.renderer,a=t.length;if(a===0)return;a>n&&!e.autoResize&&(a=n);let o=e._buffers;o||=e._buffers=this.generateBuffers(e);let s=t[0]._texture.baseTexture,c=s.alphaMode>0;this.state.blendMode=Oa(e.blendMode,c),i.state.set(this.state);let l=i.gl,u=e.worldTransform.copyTo(this.tempMatrix);u.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Ca.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,c).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);let d=!1;for(let n=0,s=0;n<a;n+=r,s+=1){let c=a-n;c>r&&(c=r),s>=o.length&&o.push(this._generateOneMoreBuffer(e));let u=o[s];u.uploadDynamic(t,n,c);let f=e._bufferUpdateIDs[s]||0;d||=u._updateID<f,d&&(u._updateID=e._updateID,u.uploadStatic(t,n,c)),i.geometry.bind(u.geometry),l.drawElements(l.TRIANGLES,c*6,l.UNSIGNED_SHORT,0)}}generateBuffers(e){let t=[],n=e._maxSize,r=e._batchSize,i=e._properties;for(let e=0;e<n;e+=r)t.push(new jp(this.properties,i,r));return t}_generateOneMoreBuffer(e){let t=e._batchSize,n=e._properties;return new jp(this.properties,n,t)}uploadVertices(e,t,n,r,i,a){let o=0,s=0,c=0,l=0;for(let u=0;u<n;++u){let n=e[t+u],d=n._texture,f=n.scale.x,p=n.scale.y,m=d.trim,h=d.orig;m?(s=m.x-n.anchor.x*h.width,o=s+m.width,l=m.y-n.anchor.y*h.height,c=l+m.height):(o=h.width*(1-n.anchor.x),s=h.width*-n.anchor.x,c=h.height*(1-n.anchor.y),l=h.height*-n.anchor.y),r[a]=s*f,r[a+1]=l*p,r[a+i]=o*f,r[a+i+1]=l*p,r[a+i*2]=o*f,r[a+i*2+1]=c*p,r[a+i*3]=s*f,r[a+i*3+1]=c*p,a+=i*4}}uploadPosition(e,t,n,r,i,a){for(let o=0;o<n;o++){let n=e[t+o].position;r[a]=n.x,r[a+1]=n.y,r[a+i]=n.x,r[a+i+1]=n.y,r[a+i*2]=n.x,r[a+i*2+1]=n.y,r[a+i*3]=n.x,r[a+i*3+1]=n.y,a+=i*4}}uploadRotation(e,t,n,r,i,a){for(let o=0;o<n;o++){let n=e[t+o].rotation;r[a]=n,r[a+i]=n,r[a+i*2]=n,r[a+i*3]=n,a+=i*4}}uploadUvs(e,t,n,r,i,a){for(let o=0;o<n;++o){let n=e[t+o]._texture._uvs;n?(r[a]=n.x0,r[a+1]=n.y0,r[a+i]=n.x1,r[a+i+1]=n.y1,r[a+i*2]=n.x2,r[a+i*2+1]=n.y2,r[a+i*3]=n.x3,r[a+i*3+1]=n.y3,a+=i*4):(r[a]=0,r[a+1]=0,r[a+i]=0,r[a+i+1]=0,r[a+i*2]=0,r[a+i*2+1]=0,r[a+i*3]=0,r[a+i*3+1]=0,a+=i*4)}}uploadTint(e,t,n,r,i,a){for(let o=0;o<n;++o){let n=e[t+o],s=Ca.shared.setValue(n._tintRGB).toPremultiplied(n.alpha,n.texture.baseTexture.alphaMode>0);r[a]=s,r[a+i]=s,r[a+i*2]=s,r[a+i*3]=s,a+=i*4}}destroy(){super.destroy(),this.shader&&=(this.shader.destroy(),null),this.tempMatrix=null}};Pp.extension={name:`particle`,type:G.RendererPlugin},Qa.add(Pp);var Fp=(e=>(e[e.LINEAR_VERTICAL=0]=`LINEAR_VERTICAL`,e[e.LINEAR_HORIZONTAL=1]=`LINEAR_HORIZONTAL`,e))(Fp||{}),Ip={willReadFrequently:!0},Lp=class e{static get experimentalLetterSpacingSupported(){let t=e._experimentalLetterSpacingSupported;if(t!==void 0){let n=W.ADAPTER.getCanvasRenderingContext2D().prototype;t=e._experimentalLetterSpacingSupported=`letterSpacing`in n||`textLetterSpacing`in n}return t}constructor(e,t,n,r,i,a,o,s,c){this.text=e,this.style=t,this.width=n,this.height=r,this.lines=i,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=s,this.fontProperties=c}static measureText(t,n,r,i=e._canvas){r??=n.wordWrap;let a=n.toFontString(),o=e.measureFont(a);o.fontSize===0&&(o.fontSize=n.fontSize,o.ascent=n.fontSize);let s=i.getContext(`2d`,Ip);s.font=a;let c=(r?e.wordWrap(t,n,i):t).split(/(?:\r\n|\r|\n)/),l=Array(c.length),u=0;for(let t=0;t<c.length;t++){let r=e._measureText(c[t],n.letterSpacing,s);l[t]=r,u=Math.max(u,r)}let d=u+n.strokeThickness;n.dropShadow&&(d+=n.dropShadowDistance);let f=n.lineHeight||o.fontSize+n.strokeThickness,p=Math.max(f,o.fontSize+n.strokeThickness*2)+n.leading+(c.length-1)*(f+n.leading);return n.dropShadow&&(p+=n.dropShadowDistance),new e(t,n,d,p,c,l,f+n.leading,u,o)}static _measureText(t,n,r){let i=!1;e.experimentalLetterSpacingSupported&&(e.experimentalLetterSpacing?(r.letterSpacing=`${n}px`,r.textLetterSpacing=`${n}px`,i=!0):(r.letterSpacing=`0px`,r.textLetterSpacing=`0px`));let a=r.measureText(t).width;return a>0&&(i?a-=n:a+=(e.graphemeSegmenter(t).length-1)*n),a}static wordWrap(t,n,r=e._canvas){let i=r.getContext(`2d`,Ip),a=0,o=``,s=``,c=Object.create(null),{letterSpacing:l,whiteSpace:u}=n,d=e.collapseSpaces(u),f=e.collapseNewlines(u),p=!d,m=n.wordWrapWidth+l,h=e.tokenize(t);for(let t=0;t<h.length;t++){let r=h[t];if(e.isNewline(r)){if(!f){s+=e.addLine(o),p=!d,o=``,a=0;continue}r=` `}if(d){let t=e.isBreakingSpace(r),n=e.isBreakingSpace(o[o.length-1]);if(t&&n)continue}let u=e.getFromCache(r,l,c,i);if(u>m)if(o!==``&&(s+=e.addLine(o),o=``,a=0),e.canBreakWords(r,n.breakWords)){let t=e.wordWrapSplit(r);for(let u=0;u<t.length;u++){let d=t[u],f=d,h=1;for(;t[u+h];){let i=t[u+h];if(!e.canBreakChars(f,i,r,u,n.breakWords))d+=i;else break;f=i,h++}u+=h-1;let g=e.getFromCache(d,l,c,i);g+a>m&&(s+=e.addLine(o),p=!1,o=``,a=0),o+=d,a+=g}}else{o.length>0&&(s+=e.addLine(o),o=``,a=0);let n=t===h.length-1;s+=e.addLine(r,!n),p=!1,o=``,a=0}else u+a>m&&(p=!1,s+=e.addLine(o),o=``,a=0),(o.length>0||!e.isBreakingSpace(r)||p)&&(o+=r,a+=u)}return s+=e.addLine(o,!1),s}static addLine(t,n=!0){return t=e.trimRight(t),t=n?`${t}
970`:t,t}static getFromCache(t,n,r,i){let a=r[t];return typeof a!=`number`&&(a=e._measureText(t,n,i)+n,r[t]=a),a}static collapseSpaces(e){return e===`normal`||e===`pre-line`}static collapseNewlines(e){return e===`normal`}static trimRight(t){if(typeof t!=`string`)return``;for(let n=t.length-1;n>=0;n--){let r=t[n];if(!e.isBreakingSpace(r))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t==`string`&&e._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,n){return typeof t==`string`&&e._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){let n=[],r=``;if(typeof t!=`string`)return n;for(let i=0;i<t.length;i++){let a=t[i],o=t[i+1];if(e.isBreakingSpace(a,o)||e.isNewline(a)){r!==``&&(n.push(r),r=``),n.push(a);continue}r+=a}return r!==``&&n.push(r),n}static canBreakWords(e,t){return t}static canBreakChars(e,t,n,r,i){return!0}static wordWrapSplit(t){return e.graphemeSegmenter(t)}static measureFont(t){if(e._fonts[t])return e._fonts[t];let n={ascent:0,descent:0,fontSize:0},r=e._canvas,i=e._context;i.font=t;let a=e.METRICS_STRING+e.BASELINE_SYMBOL,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(e.BASELINE_SYMBOL).width),c=Math.ceil(e.HEIGHT_MULTIPLIER*s);if(s=s*e.BASELINE_MULTIPLIER|0,o===0||c===0)return e._fonts[t]=n,n;r.width=o,r.height=c,i.fillStyle=`#f00`,i.fillRect(0,0,o,c),i.font=t,i.textBaseline=`alphabetic`,i.fillStyle=`#000`,i.fillText(a,0,s);let l=i.getImageData(0,0,o,c).data,u=l.length,d=o*4,f=0,p=0,m=!1;for(f=0;f<s;++f){for(let e=0;e<d;e+=4)if(l[p+e]!==255){m=!0;break}if(!m)p+=d;else break}for(n.ascent=s-f,p=u-d,m=!1,f=c;f>s;--f){for(let e=0;e<d;e+=4)if(l[p+e]!==255){m=!0;break}if(!m)p-=d;else break}return n.descent=f-s,n.fontSize=n.ascent+n.descent,e._fonts[t]=n,n}static clearMetrics(t=``){t?delete e._fonts[t]:e._fonts={}}static get _canvas(){if(!e.__canvas){let t;try{let n=new OffscreenCanvas(0,0);if(n.getContext(`2d`,Ip)?.measureText)return e.__canvas=n,n;t=W.ADAPTER.createCanvas()}catch{t=W.ADAPTER.createCanvas()}t.width=t.height=10,e.__canvas=t}return e.__canvas}static get _context(){return e.__context||=e._canvas.getContext(`2d`,Ip),e.__context}};Lp.METRICS_STRING=`|ÉqÅ`,Lp.BASELINE_SYMBOL=`M`,Lp.BASELINE_MULTIPLIER=1.4,Lp.HEIGHT_MULTIPLIER=2,Lp.graphemeSegmenter=(()=>
970{if(typeof Intl?.Segmenter==`function`){let e=new Intl.Segmenter;return t=>[...e.segment(t)].map(e=>e.segment)}return e=>[...e]})(),Lp.experimentalLetterSpacing=!1,Lp._fonts={},Lp._newlines=[10,13],Lp._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Rp=Lp,zp=[`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`],Bp=class e{constructor(e){this.styleID=0,this.reset(),Wp(this,e,e)}clone(){let t={};return Wp(t,this,e.defaultStyle),new e(t)}reset(){Wp(this,e.defaultStyle,e.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){let t=Hp(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){let t=Hp(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){Up(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){let t=Hp(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){let e=typeof this.fontSize==`number`?`${this.fontSize}px`:this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(`,`));for(let e=t.length-1;e>=0;e--){let n=t[e].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!zp.includes(n)&&(n=`"${n}"`),t[e]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(`,`)}`}}
970;Bp.defaultStyle={align:`left`,breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:`black`,dropShadowDistance:5,fill:`black`,fillGradientType:Fp.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:`Arial`,fontSize:26,fontStyle:`normal`,fontVariant:`normal`,fontWeight:`normal`,leading:0,letterSpacing:0,lineHeight:0,lineJoin:`miter`,miterLimit:10,padding:0,stroke:`black`,strokeThickness:0,textBaseline:`alphabetic`,trim:!1,whiteSpace:`pre`,wordWrap:!1,wordWrapWidth:100};var Vp=Bp;function Hp(e){let t=Ca.shared,n=e=>{let n=t.setValue(e);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(e)?e.map(n):n(e)}function Up(e,t){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}function Wp(e,t,n){for(let r in n)Array.isArray(t[r])?e[r]=t[r].slice():e[r]=t[r]}var Gp={texture:!0,children:!1,baseTexture:!0},Kp=class e extends Xl{constructor(t,n,r){let i=!1;r||(r=W.ADAPTER.createCanvas(),i=!0),r.width=3,r.height=3;let a=K.from(r);a.orig=new Io,a.trim=new Io,super(a),this._ownCanvas=i,this.canvas=r,this.context=r.getContext(`2d`,{willReadFrequently:!0}),this._resolution=e.defaultResolution??W.RESOLUTION,this._autoResolution=e.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font=``,this.text=t,this.style=n,this.localStyleID=-1}static get experimentalLetterSpacing(){return Rp.experimentalLetterSpacing}static set experimentalLetterSpacing(e){Fi(`7.1.0`,`Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing`),Rp.experimentalLetterSpacing=e}updateText(e){let t=this._style;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;this._font=this._style.toFontString();let n=this.context,r=Rp.measureText(this._text||` `,this._style,this._style.wordWrap,this.canvas),i=r.width,a=r.height,o=r.lines,s=r.lineHeight,c=r.lineWidths,l=r.maxLineWidth,u=r.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,i)+t.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,a)+t.padding*2)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=t.strokeThickness,n.textBaseline=t.textBaseline,n.lineJoin=t.lineJoin,n.miterLimit=t.miterLimit;let d,f,p=t.dropShadow?2:1;for(let e=0;e<p;++e){let i=t.dropShadow&&e===0,p=i?Math.ceil(Math.max(1,a)+t.padding*2):0,m=p*this._resolution;if(i){n.fillStyle=`black`,n.strokeStyle=`black`;let e=t.dropShadowColor,r=t.dropShadowBlur*this._resolution,i=t.dropShadowDistance*this._resolution;n.shadowColor=Ca.shared.setValue(e).setAlpha(t.dropShadowAlpha).toRgbaString(),n.shadowBlur=r,n.shadowOffsetX=Math.cos(t.dropShadowAngle)*i,n.shadowOffsetY=Math.sin(t.dropShadowAngle)*i+m}else n.fillStyle=this._generateFillStyle(t,o,r),n.strokeStyle=t.stroke,n.shadowColor=`black`,n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;let h=(s-u.fontSize)/2;s-u.fontSize<0&&(h=0);for(let e=0;e<o.length;e++)d=t.strokeThickness/2,f=t.strokeThickness/2+e*s+u.ascent+h,t.align===`right`?d+=l-c[e]:t.align===`center`&&(d+=(l-c[e])/2),t.stroke&&t.strokeThickness&&this.drawLetterSpacing(o[e],d+t.padding,f+t.padding-p,!0),t.fill&&this.drawLetterSpacing(o[e],d+t.padding,f+t.padding-p)}this.updateTexture()}drawLetterSpacing(e,t,n,r=!1){let i=this._style.letterSpacing,a=!1;if(Rp.experimentalLetterSpacingSupported&&(Rp.experimentalLetterSpacing?(this.context.letterSpacing=`${i}px`,this.context.textLetterSpacing=`${i}px`,a=!0):(this.context.letterSpacing=`0px`,this.context.textLetterSpacing=`0px`)),i===0||a){r?this.context.strokeText(e,t,n):this.context.fillText(e,t,n);return}let o=t,s=Rp.graphemeSegmenter(e),c=this.context.measureText(e).width,l=0;for(let e=0;e<s.length;++e){let t=s[e];r?this.context.strokeText(t,o,n):this.context.fillText(t,o,n);let a=``;for(let t=e+1;t<s.length;++t)a+=s[t];l=this.context.measureText(a).width,o+=c-l+i,c=l}}updateTexture(){let e=this.canvas;if(this._style.trim){let t=qa(e);t.data&&(e.width=t.width,e.height=t.height,this.context.putImageData(t.data,0,0))}let t=this._texture,n=this._style,r=n.trim?0:n.padding,i=t.baseTexture;t.trim.width=t._frame.width=e.width/this._resolution,t.trim.height=t._frame.height=e.height/this._resolution,t.trim.x=-r,t.trim.y=-r,t.orig.width=t._frame.width-r*2,t.orig.height=t._frame.height-r*2,this._onTextureUpdate(),i.setRealSize(e.width,e.height,this._resolution),t.updateUvs(),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(e,t){return this.updateText(!0),this._textureID===-1&&(e=!1),super.getBounds(e,t)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds.call(this,e)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(e,t,n){let r=e.fill;if(Array.isArray(r)){if(r.length===1)return r[0]}else return r;let i,a=e.dropShadow?e.dropShadowDistance:0,o=e.padding||0,s=this.canvas.width/this._resolution-a-o*2,c=this.canvas.height/this._resolution-a-o*2,l=r.slice(),u=e.fillGradientStops.slice();if(!u.length){let e=l.length+1;for(let t=1;t<e;++t)u.push(t/e)}if(l.unshift(r[0]),u.unshift(0),l.push(r[r.length-1]),u.push(1),e.fillGradientType===Fp.LINEAR_VERTICAL){i=this.context.createLinearGradient(s/2,o,s/2,c+o);let r=n.fontProperties.fontSize+e.strokeThickness;for(let e=0;e<t.length;e++){let a=n.lineHeight*(e-1)+r,o=n.lineHeight*e,s=o;e>0&&a>o&&(s=(o+a)/2);let d=o+r,f=n.lineHeight*(e+1),p=d;e+1<t.length&&f<d&&(p=(d+f)/2);let m=(p-s)/c;for(let e=0;e<l.length;e++){let t=0;t=typeof u[e]==`number`?u[e]:e/l.length;let n=Math.min(1,Math.max(0,s/c+t*m));n=Number(n.toFixed(5)),i.addColorStop(n,l[e])}}}else{i=this.context.createLinearGradient(o,c/2,s+o,c/2);let e=l.length+1,t=1;for(let n=0;n<l.length;n++){let r;r=typeof u[n]==`number`?u[n]:t/e,i.addColorStop(r,l[n]),t++}}return i}destroy(e){typeof e==`boolean`&&(e={children:e}),e=Object.assign({},Gp,e),super.destroy(e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this.updateText(!0);let t=Fa(this.scale.x)||1;this.scale.x=t*e/this._texture.orig.width,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this.updateText(!0);let t=Fa(this.scale.y)||1;this.scale.y=t*e/this._texture.orig.height,this._height=e}get style(){return this._style}set style(e){e||={},e instanceof Vp?this._style=e:this._style=new Vp(e),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(e){e=String(e??``),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}};Kp.defaultAutoResolution=!0;var qp=Kp,Jp=class{constructor(e){this.maxItemsPerFrame=e,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-->0}};function Yp(e,t){let n=!1;if(e?._textures?.length){for(let r=0;r<e._textures.length;r++)if(e._textures[r]instanceof K){let i=e._textures[r].baseTexture;t.includes(i)||(t.push(i),n=!0)}}return n}function Xp(e,t){if(e.baseTexture instanceof vo){let n=e.baseTexture;return t.includes(n)||t.push(n),!0}return!1}function Zp(e,t){if(e._texture&&e._texture instanceof K){let n=e._texture.baseTexture;return t.includes(n)||t.push(n),!0}return!1}function Qp(e,t){return t instanceof qp?(t.updateText(!0),!0):!1}function $p(e,t){if(t instanceof Vp){let e=t.toFontString();return Rp.measureFont(e),!0}return!1}function em(e,t){if(e instanceof qp){t.includes(e.style)||t.push(e.style),t.includes(e)||t.push(e);let n=e._texture.baseTexture;return t.includes(n)||t.push(n),!0}return!1}function tm(e,t){return e instanceof Vp?(t.includes(e)||t.push(e),!0):!1}var nm=class e{constructor(t){this.limiter=new Jp(e.uploadsPerFrame),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(em),this.registerFindHook(tm),this.registerFindHook(Yp),this.registerFindHook(Xp),this.registerFindHook(Zp),this.registerUploadHook(Qp),this.registerUploadHook($p)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,gl.system.addOnce(this.tick,this,pl.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){let e=this.queue[0],t=!1;
970if(e&&!e._destroyed){for(let n=0,r=this.uploadHooks.length;n<r;n++)if(this.uploadHooks[n](this.uploadHookHelper,e)){this.queue.shift(),t=!0;break}}t||this.queue.shift()}if(this.queue.length)gl.system.addOnce(this.tick,this,pl.UTILITY);else{this.ticking=!1;let e=this.completes.slice(0);this.completes.length=0;for(let t=0,n=e.length;t<n;t++)e[t]()}}registerFindHook(e){return e&&this.addHooks.push(e),this}registerUploadHook(e){return e&&this.uploadHooks.push(e),this}add(e){for(let t=0,n=this.addHooks.length;t<n&&!this.addHooks[t](e,this.queue);t++);if(e instanceof ql)for(let t=e.children.length-1;t>=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&gl.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};nm.uploadsPerFrame=4;var rm=nm;Object.defineProperties(W,{UPLOADS_PER_FRAME:{get(){return rm.uploadsPerFrame},set(e){Fi(`7.1.0`,`settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame`),rm.uploadsPerFrame=e}}});function im(e,t){return t instanceof vo?(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0):!1}function am(e,t){if(!(t instanceof bp))return!1;let{geometry:n}=t;t.finishPoly(),n.updateBatches();let{batches:r}=n;for(let t=0;t<r.length;t++){let{texture:n}=r[t].style;n&&im(e,n.baseTexture)}return n.batchable||e.geometry.bind(n,t._resolveDirectShader(e)),!0}function om(e,t){return e instanceof bp?(t.push(e),!0):!1}var sm=class extends rm{constructor(e){super(e),this.uploadHookHelper=this.renderer,this.registerFindHook(om),this.registerUploadHook(im),this.registerUploadHook(am)}};sm.extension={name:`prepare`,type:G.RendererSystem},Qa.add(sm);var cm=new Po,lm=class e extends Xl{constructor(e,t=100,n=100){super(e),this.tileTransform=new $o,this._width=t,this._height=n,this.uvMatrix=this.texture.uvMatrix||new hc(e),this.pluginName=`tilingSprite`,this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(e){this.uvMatrix.clampMargin=e,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(e){this.tileTransform.scale.copyFrom(e)}get tilePosition(){return this.tileTransform.position}set tilePosition(e){this.tileTransform.position.copyFrom(e)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(e){let t=this._texture;!t||!t.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))}_calculateBounds(){let e=this._width*-this._anchor._x,t=this._height*-this._anchor._y,n=this._width*(1-this._anchor._x),r=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,e,t,n,r)}getLocalBounds(e){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||=(this._localBoundsRect||=new Io,this._localBoundsRect),this._bounds.getRectangle(e)):super.getLocalBounds.call(this,e)}containsPoint(e){this.worldTransform.applyInverse(e,cm);let t=this._width,n=this._height,r=-t*this.anchor._x;if(cm.x>=r&&cm.x<r+t){let e=-n*this.anchor._y;if(cm.y>=e&&cm.y<e+n)return!0}return!1}destroy(e){super.destroy(e),this.tileTransform=null,this.uvMatrix=null}static from(t,n){let r=t instanceof K?t:K.from(t,n);return new e(r,n.width,n.height)}get width(){return this._width}set width(e){this._width=e}get height(){return this._height}set height(e){this._height=e}},um=`#version 300 es
971#define SHADER_NAME Tiling-Sprite-100
972
973precision lowp float;
974
975in vec2 vTextureCoord;
976
977out vec4 fragmentColor;
978
979uniform sampler2D uSampler;
980uniform vec4 uColor;
981uniform mat3 uMapCoord;
982uniform vec4 uClampFrame;
983uniform vec2 uClampOffset;
984
985void main(void)
986{
987    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
988    coord = (uMapCoord * vec3(coord, 1.0)).xy;
989    vec2 unclamped = coord;
990    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
991
992    vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
993
994    fragmentColor = texSample * uColor;
995}
996`,dm=`#version 300 es
997#define SHADER_NAME Tiling-Sprite-300
998
999precision lowp float;
1000
1001in vec2 aVertexPosition;
1002in vec2 aTextureCoord;
1003
1004uniform mat3 projectionMatrix;
1005uniform mat3 translationMatrix;
1006uniform mat3 uTransform;
1007
1008out vec2 vTextureCoord;
1009
1010void main(void)
1011{
1012    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
1013
1014    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
1015}
1016`,fm=`#version 100
1017#ifdef GL_EXT_shader_texture_lod
1018    #extension GL_EXT_shader_texture_lod : enable
1019#endif
1020#define SHADER_NAME Tiling-Sprite-100
1021
1022precision lowp float;
1023
1024varying vec2 vTextureCoord;
1025
1026uniform sampler2D uSampler;
1027uniform vec4 uColor;
1028uniform mat3 uMapCoord;
1029uniform vec4 uClampFrame;
1030uniform vec2 uClampOffset;
1031
1032void main(void)
1033{
1034    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
1035    coord = (uMapCoord * vec3(coord, 1.0)).xy;
1036    vec2 unclamped = coord;
1037    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
1038
1039    #ifdef GL_EXT_shader_texture_lod
1040        vec4 texSample = unclamped == coord
1041            ? texture2D(uSampler, coord) 
1042            : texture2DLodEXT(uSampler, coord, 0);
1043    #else
1044        vec4 texSample = texture2D(uSampler, coord);
1045    #endif
1046
1047    gl_FragColor = texSample * uColor;
1048}
1049`,pm=`#version 100
1050#define SHADER_NAME Tiling-Sprite-100
1051
1052precision lowp float;
1053
1054attribute vec2 aVertexPosition;
1055attribute vec2 aTextureCoord;
1056
1057uniform mat3 projectionMatrix;
1058uniform mat3 translationMatrix;
1059uniform mat3 uTransform;
1060
1061varying vec2 vTextureCoord;
1062
1063void main(void)
1064{
1065    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
1065)).xy, 0.0, 1.0);
1066
1067    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
1068}
1069`,mm=`#version 100
1070#define SHADER_NAME Tiling-Sprite-Simple-100
1071
1072precision lowp float;
1073
1074varying vec2 vTextureCoord;
1075
1076uniform sampler2D uSampler;
1077uniform vec4 uColor;
1078
1079void main(void)
1080{
1081    vec4 texSample = texture2D(uSampler, vTextureCoord);
1082    gl_FragColor = texSample * uColor;
1083}
1084`,hm=new Vo,gm=class extends Fs{constructor(e){super(e),e.runners.contextChange.add(this),this.quad=new ic,this.state=lo.for2d()}contextChange(){let e=this.renderer,t={globals:e.globalUniforms};this.simpleShader=As.from(pm,mm,t),this.shader=e.context.webGLVersion>1?As.from(dm,um,t):As.from(pm,fm,t)}render(e){let t=this.renderer,n=this.quad,r=n.vertices;r[0]=r[6]=e._width*-e.anchor.x,r[1]=r[3]=e._height*-e.anchor.y,r[2]=r[4]=e._width*(1-e.anchor.x),r[5]=r[7]=e._height*(1-e.anchor.y);let i=e.uvRespectAnchor?e.anchor.x:0,a=e.uvRespectAnchor?e.anchor.y:0;r=n.uvs,r[0]=r[6]=-i,r[1]=r[3]=-a,r[2]=r[4]=1-i,r[5]=r[7]=1-a,n.invalidate();let o=e._texture,s=o.baseTexture,c=s.alphaMode>0,l=e.tileTransform.localTransform,u=e.uvMatrix,d=s.isPowerOfTwo&&o.frame.width===s.width&&o.frame.height===s.height;d&&(s._glTextures[t.CONTEXT_UID]?d=s.wrapMode!==cr.CLAMP:s.wrapMode===cr.CLAMP&&(s.wrapMode=cr.REPEAT));let f=d?this.simpleShader:this.shader,p=o.width,m=o.height,h=e._width,g=e._height;hm.set(l.a*p/h,l.b*p/g,l.c*m/h,l.d*m/g,l.tx/h,l.ty/g),hm.invert(),d?hm.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=hm.toArray(!0),f.uniforms.uColor=Ca.shared.setValue(e.tint).premultiply(e.worldAlpha,c).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=o,t.shader.bind(f),t.geometry.bind(n),this.state.blendMode=Oa(e.blendMode,c),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}};gm.extension={name:`tilingSprite`,type:G.RendererPlugin},Qa.add(gm);var _m=class e{constructor(e,t,n){this.linkedSheets=[],(e instanceof vo||e instanceof K)&&(e={texture:e,data:t,resolutionFilename:n});let{texture:r,data:i,resolutionFilename:a=null,cachePrefix:o=``}=e;this.cachePrefix=o,this._texture=r instanceof K?r:null,this.baseTexture=r instanceof vo?r:this._texture.baseTexture,this.textures={},this.animations={},this.data=i;let s=this.baseTexture.resource;this.resolution=this._updateResolution(a||(s?s.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){let{scale:t}=this.data.meta,n=Ya(e,null);return n===null&&(n=typeof t==`number`?t:parseFloat(t??`1`)),n!==1&&this.baseTexture.setResolution(n),n}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let n=t,r=e.BATCH_SIZE;for(;n-t<r&&n<this._frameKeys.length;){let e=this._frameKeys[n],t=this._frames[e],r=t.frame;if(r){let n=null,i=null,a=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,o=new Io(0,0,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution);n=t.rotated?new Io(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 Io(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(i=new Io(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution)),this.textures[e]=new K(this.baseTexture,n,o,i,t.rotated?2:0,t.anchor,t.borders),K.addToCache(this.textures[e],this.cachePrefix+e.toString())}n++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};_m.BATCH_SIZE=1e3;var vm=_m,ym=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`s3tc`,`s3tc_sRGB`,`etc`,`etc1`,`pvrtc`,`atc`,`astc`,`bptc`];function bm(e,t,n){let r={};
1084if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=Vi.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{Object.assign(r,bm([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0))})}return r}var xm={extension:G.Asset,cache:{test:e=>e instanceof vm,getCacheableAssets:(e,t)=>bm(e,t,!1)},resolver:{test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&ym.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(W.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,extension:{type:G.LoadParser,priority:nd.Normal},async testParse(e,t){return Vi.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:i,cachePrefix:a}=t?.data??{},o=Vi.dirname(t.src);o&&o.lastIndexOf(`/`)!==o.length-1&&(o+=`/`);let s;if(r&&r.baseTexture)s=r;else{let r=Xu(o+(i??e.meta.image),t.src);s=(await n.load([r]))[r]}let c=new vm({texture:s.baseTexture,data:e,resolutionFilename:t.src,cachePrefix:a});await c.parse();let l=e?.meta?.related_multi_packs;if(Array.isArray(l)){let e=[];for(let r of l){if(typeof r!=`string`)continue;let i=o+r;t.data?.ignoreMultiPack||(i=Xu(i,t.src),e.push(n.load({src:i,data:{ignoreMultiPack:!0}})))}let r=await Promise.all(e);c.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[c].concat(c.linkedSheets.filter(t=>t!==e))})}return c},unload(e){e.destroy(!0)}}};Qa.add(xm);var Sm=class{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}},Cm=class{static test(e){return typeof e==`string`&&e.startsWith(`info face=`)}static parse(e){let t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(let e in t){let r=t[e].match(/^[a-z]+/gm)[0],i=t[e].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(let e in i){let t=i[e].split(`=`),n=t[0],r=t[1].replace(/"/gm,``),o=parseFloat(r);a[n]=isNaN(o)?r:o}n[r].push(a)}let r=new Sm;return n.info.forEach(e=>r.info.push({face:e.face,size:parseInt(e.size,10)})),n.common.forEach(e=>r.common.push({lineHeight:parseInt(e.lineHeight,10)})),n.page.forEach(e=>r.page.push({id:parseInt(e.id,10),file:e.file})),n.char.forEach(e=>r.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})),n.kerning.forEach(e=>r.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})),n.distanceField.forEach(e=>r.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})),r}},wm=class{static test(e){let t=e;return typeof e!=`string`&&`getElementsByTagName`in e&&t.getElementsByTagName(`page`).length&&t.getElementsByTagName(`info`)[0].getAttribute(`face`)!==null}static parse(e){let t=new Sm,n=e.getElementsByTagName(`info`),r=e.getElementsByTagName(`common`),i=e.getElementsByTagName(`page`),a=e.getElementsByTagName(`char`),o=e.getElementsByTagName(`kerning`),s=e.getElementsByTagName(`distanceField`);for(let e=0;e<n.length;e++)t.info.push({face:n[e].getAttribute(`face`),size:parseInt(n[e].getAttribute(`size`),10)});for(let e=0;e<r.length;e++)t.common.push({lineHeight:parseInt(r[e].getAttribute(`lineHeight`),10)});for(let e=0;e<i.length;e++)t.page.push({id:parseInt(i[e].getAttribute(`id`),10)||0,file:i[e].getAttribute(`file`)});for(let e=0;e<a.length;e++){let n=a[e];t.char.push({id:parseInt(n.getAttribute(`id`),10),page:parseInt(n.getAttribute(`page`),10)||0,x:parseInt(n.getAttribute(`x`),10),y:parseInt(n.getAttribute(`y`),10),width:parseInt(n.getAttribute(`width`),10),height:parseInt(n.getAttribute(`height`),10),xoffset:parseInt(n.getAttribute(`xoffset`),10),yoffset:parseInt(n.getAttribute(`yoffset`),10),xadvance:parseInt(n.getAttribute(`xadvance`),10)})}for(let e=0;e<o.length;e++)t.kerning.push({first:parseInt(o[e].getAttribute(`first`),10),second:parseInt(o[e].getAttribute(`second`),10),amount:parseInt(o[e].getAttribute(`amount`),10)});for(let e=0;e<s.length;
1084e++)t.distanceField.push({fieldType:s[e].getAttribute(`fieldType`),distanceRange:parseInt(s[e].getAttribute(`distanceRange`),10)});return t}},Tm=class{static test(e){return typeof e==`string`&&e.includes(`<font>`)?wm.test(W.ADAPTER.parseXML(e)):!1}static parse(e){return wm.parse(W.ADAPTER.parseXML(e))}},Em=[Cm,wm,Tm];function Dm(e){for(let t=0;t<Em.length;t++)if(Em[t].test(e))return Em[t];return null}function Om(e,t,n,r,i,a){let o=n.fill;if(Array.isArray(o)){if(o.length===1)return o[0]}else return o;let s,c=n.dropShadow?n.dropShadowDistance:0,l=n.padding||0,u=e.width/r-c-l*2,d=e.height/r-c-l*2,f=o.slice(),p=n.fillGradientStops.slice();if(!p.length){let e=f.length+1;for(let t=1;t<e;++t)p.push(t/e)}if(f.unshift(o[0]),p.unshift(0),f.push(o[o.length-1]),p.push(1),n.fillGradientType===Fp.LINEAR_VERTICAL){s=t.createLinearGradient(u/2,l,u/2,d+l);let e=0,r=(a.fontProperties.fontSize+n.strokeThickness)/d;for(let t=0;t<i.length;t++){let n=a.lineHeight*t;for(let t=0;t<f.length;t++){let i=0;i=typeof p[t]==`number`?p[t]:t/f.length;let a=n/d+i*r,o=Math.max(e,a);o=Math.min(o,1),s.addColorStop(o,f[t]),e=o}}}else{s=t.createLinearGradient(l,d/2,u+l,d/2);let e=f.length+1,n=1;for(let t=0;t<f.length;t++){let r;r=typeof p[t]==`number`?p[t]:n/e,s.addColorStop(r,f[t]),n++}}return s}function km(e,t,n,r,i,a,o){let s=n.text,c=n.fontProperties;t.translate(r,i),t.scale(a,a);let l=o.strokeThickness/2,u=-(o.strokeThickness/2);if(t.font=o.toFontString(),t.lineWidth=o.strokeThickness,t.textBaseline=o.textBaseline,t.lineJoin=o.lineJoin,t.miterLimit=o.miterLimit,t.fillStyle=Om(e,t,o,a,[s],n),t.strokeStyle=o.stroke,o.dropShadow){let e=o.dropShadowColor,n=o.dropShadowBlur*a,r=o.dropShadowDistance*a;t.shadowColor=Ca.shared.setValue(e).setAlpha(o.dropShadowAlpha).toRgbaString(),t.shadowBlur=n,t.shadowOffsetX=Math.cos(o.dropShadowAngle)*r,t.shadowOffsetY=Math.sin(o.dropShadowAngle)*r}else t.shadowColor=`black`,t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0;o.stroke&&o.strokeThickness&&t.strokeText(s,l,u+n.lineHeight-c.descent),o.fill&&t.fillText(s,l,u+n.lineHeight-c.descent),t.setTransform(1,0,0,1,0,0),t.fillStyle=`rgba(0, 0, 0, 0)`}function Am(e){return e.codePointAt?e.codePointAt(0):e.charCodeAt(0)}function jm(e){return Array.from?Array.from(e):e.split(``)}function Mm(e){typeof e==`string`&&(e=[e]);let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];if(Array.isArray(r)){if(r.length!==2)throw Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${r.length}.`);let e=r[0].charCodeAt(0),n=r[1].charCodeAt(0);if(n<e)throw Error(`[BitmapFont]: Invalid character range.`);for(let r=e,i=n;r<=i;r++)t.push(String.fromCharCode(r))}else t.push(...jm(r))}if(t.length===0)throw Error(`[BitmapFont]: Empty set when resolving characters.`);return t}var Nm=class e{constructor(e,t,n){let[r]=e.info,[i]=e.common,[a]=e.page,[o]=e.distanceField,s=Ya(a.file),c={};this._ownsTextures=n,this.font=r.face,this.size=r.size,this.lineHeight=i.lineHeight/s,this.chars={},this.pageTextures=c;for(let n=0;n<e.page.length;n++){let{id:r,file:i}=e.page[n];c[r]=t instanceof Array?t[n]:t[i],o?.fieldType&&o.fieldType!==`none`&&(c[r].baseTexture.alphaMode=ur.NO_PREMULTIPLIED_ALPHA,c[r].baseTexture.mipmap=lr.OFF)}for(let t=0;t<e.char.length;t++){let{id:n,page:r}=e.char[t],{x:i,y:a,width:o,height:l,xoffset:u,yoffset:d,xadvance:f}=e.char[t];i/=s,a/=s,o/=s,l/=s,u/=s,d/=s,f/=s;let p=new Io(i+c[r].frame.x/s,a+c[r].frame.y/s,o,l);this.chars[n]={xOffset:u,yOffset:d,xAdvance:f,kerning:{},texture:new K(c[r].baseTexture,p),page:r}}for(let t=0;t<e.kerning.length;t++){let{first:n,second:r,amount:i}=e.kerning[t];n/=s,r/=s,i/=s,this.chars[r]&&(this.chars[r].kerning[n]=i)}this.distanceFieldRange=o?.distanceRange,this.distanceFieldType=o?.fieldType?.toLowerCase()??`none`}destroy(){for(let e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(let e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null}static install(t,n,r){let i;if(t instanceof Sm)i=t;else{let e=Dm(t);if(!e)throw Error(`Unrecognized data format for font.`);i=e.parse(t)}n instanceof K&&(n=[n]);let a=new e(i,n,r);return e.available[a.font]=a,a}static uninstall(t){let n=e.available[t];if(!n)throw Error(`No font found named '${t}'`);n.destroy(),delete e.available[t]}static from(t,n,r){if(!t)throw Error("[BitmapFont] Property `name` is required.");let{chars:i,padding:a,resolution:o,textureWidth:s,textureHeight:c,...l}=Object.assign({},e.defaultOptions,r),u=Mm(i),d=n instanceof Vp?n:new Vp(n),f=s,p=new Sm;p.info[0]={face:d.fontFamily,size:d.fontSize},p.common[0]={lineHeight:d.fontSize};let m=0,h=0,g,_,v,y=0,b=[],x=[];for(let e=0;e<u.length;e++){g||(g=W.ADAPTER.createCanvas(),g.width=s,g.height=c,_=g.getContext(`2d`),v=new vo(g,{resolution:o,...l}),b.push(v),x.push(new K(v)),p.page.push({id:x.length-1,file:``}));let t=u[e],n=Rp.measureText(t,d,!1,g),r=n.width,i=Math.ceil(n.height),S=Math.ceil((d.fontStyle===`italic`?2:1)*r);if(h>=c-i*o){if(h===0)throw Error(`[BitmapFont] textureHeight ${c}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${t}')`);--e,g=null,_=null,v=null,h=0,m=0,y=0;continue}if(y=Math.max(i+n.fontProperties.descent,y),S*o+m>=f){if(m===0)throw Error(`[BitmapFont] textureWidth ${s}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${t}')`);--e,h+=y*o,h=Math.ceil(h),m=0,y=0;continue}km(g,_,n,m,h,o,d);let C=Am(n.text);p.char.push({id:C,page:x.length-1,x:m/o,y:h/o,width:S,height:i,xoffset:0,yoffset:0,xadvance:r-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),m+=(S+2*a)*o,m=Math.ceil(m)}if(!r?.skipKerning)for(let e=0,t=u.length;e<t;e++){let n=u[e];for(let e=0;e<t;e++){let t=u[e],r=_.measureText(n).width,i=_.measureText(t).width,a=_.measureText(n+t).width-(r+i);a&&p.kerning.push({first:Am(n),second:Am(t),amount:a})}}let S=new e(p,x,!0);return e.available[t]!==void 0&&e.uninstall(t),e.available[t]=S,S}};Nm.ALPHA=[[`a`,`z`],[`A`,`Z`],` `],Nm.NUMERIC=[[`0`,`9`]],Nm.ALPHANUMERIC=[[`a`,`z`],[`A`,`Z`],[`0`,`9`],` `],Nm.ASCII=[[` `,`~`]],Nm.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Nm.ALPHANUMERIC},Nm.available={};var Pm=Nm,Fm=`// Pixi texture info\r
1085varying vec2 vTextureCoord;\r
1086uniform sampler2D uSampler;\r
1087\r
1088// Tint\r
1089uniform vec4 uColor;\r
1090\r
1091// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
1092uniform float uFWidth;\r
1093\r
1094void main(void) {\r
1095\r
1096  // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
1097  vec4 texColor = texture2D(uSampler, vTextureCoord);\r
1098\r
1099  // MSDF\r
1100  float median = texColor.r + texColor.g + texColor.b -\r
1101                  min(texColor.r, min(texColor.g, texColor.b)) -\r
1102                  max(texColor.r, max(texColor.g, texColor.b));\r
1103  // SDF\r
1104  median = min(median, texColor.a);\r
1105\r
1106  float screenPxDistance = uFWidth * (median - 0.5);\r
1107  float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
1108  if (median < 0.01) {\r
1109    alpha = 0.0;\r
1110  } else if (median > 0.99) {\r
1111    alpha = 1.0;\r
1112  }\r
1113\r
1114  // Gamma correction for coverage-like alpha\r
1115  float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r
1116  float gamma = mix(1.0, 1.0 / 2.2, luma);\r
1117  float coverage = pow(uColor.a * alpha, gamma);  \r
1118\r
1119  // NPM Textures, NPM outputs\r
1120  gl_FragColor = vec4(uColor.rgb, coverage);\r
1121}\r
1122`,Im=`// Mesh material default fragment\r
1123attribute vec2 aVertexPosition;\r
1124attribute vec2 aTextureCoord;\r
1125\r
1126uniform mat3 projectionMatrix;\r
1127uniform mat3 translationMatrix;\r
1128uniform mat3 uTextureMatrix;\r
1129\r
1130varying vec2 vTextureCoord;\r
1131\r
1132void main(void)\r
1133{\r
1134    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
1135\r
1136    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
1137}\r
1138`,Lm=[],Rm=[],zm=[],Bm=class e extends ql{constructor(t,n={}){super();let{align:r,tint:i,maxWidth:a,letterSpacing:o,fontName:s,fontSize:c}=Object.assign({},e.styleDefaults,n);if(!Pm.available[s])throw Error(`Missing BitmapFont "${s}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=r,this._tintColor=new Ca(i),this._font=void 0,this._fontName=s,this._fontSize=c,this.text=t,this._maxWidth=a,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new Zo(()=>{this.dirty=!0},this,0,0),this._roundPixels=W.ROUND_PIXELS,this.dirty=!0,this._resolution=W.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){let e=Pm.available[this._fontName],t=this.fontSize,n=t/e.size,r=new Po,i=[],a=[],o=[],s=jm(this._text.replace(/(?:\r\n|\r)/g,`
1139`)||` `),c=this._maxWidth*e.size/t,l=e.distanceFieldType===`none`?Lm:Rm,u=null,d=0,f=0,p=0,m=-1,h=0,g=0,_=0,v=0;for(let t=0;t<s.length;t++){let n=s[t],l=Am(n);if(/(?:\s)/.test(n)&&(m=t,h=d,v++),n===`\r`||n===`
1140`){a.push(d),o.push(-1),f=Math.max(f,d),++p,++g,r.x=0,r.y+=e.lineHeight,u=null,v=0;continue}let y=e.chars[l];if(!y)continue;u&&y.kerning[u]&&(r.x+=y.kerning[u]);let b=zm.pop()||{texture:K.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Po};b.texture=y.texture,b.line=p,b.charCode=l,b.position.x=Math.round(r.x+y.xOffset+this._letterSpacing/2),b.position.y=Math.round(r.y+y.yOffset),b.prevSpaces=v,i.push(b),d=b.position.x+Math.max(y.xAdvance-y.xOffset,y.texture.orig.width),r.x+=y.xAdvance+this._letterSpacing,_=Math.max(_,y.yOffset+y.texture.height),u=l,m!==-1&&c>0&&r.x>c&&(++g,Pa(i,1+m-g,1+t-m),t=m,m=-1,a.push(h),o.push(i.length>0?i[i.length-1].prevSpaces:0),f=Math.max(f,h),p++,r.x=0,r.y+=e.lineHeight,u=null,v=0)}let y=s[s.length-1];y!==`\r`&&y!==`
1141`&&(/(?:\s)/.test(y)&&(d=h),a.push(d),f=Math.max(f,d),o.push(-1));let b=[];for(let e=0;e<=p;e++){let t=0;this._align===`right`?t=f-a[e]:this._align===`center`?t=(f-a[e])/2:this._align===`justify`&&(t=o[e]<0?0:(f-a[e])/o[e]),b.push(t)}let x=i.length,S={},C=[],w=this._activePagesMeshData;l.push(...w);for(let t=0;t<x;t++){let n=i[t].texture,r=n.baseTexture.uid;if(!S[r]){let t=l.pop();if(!t){let n=new Ep,r,i;e.distanceFieldType===`none`?(r=new kp(K.EMPTY),i=rr.NORMAL):(r=new kp(K.EMPTY,{program:Ds.from(Im,Fm),uniforms:{uFWidth:0}}),i=rr.NORMAL_NPM);let a=new Tp(n,r);a.blendMode=i,t={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:a,vertices:null,uvs:null,indices:null}}t.index=0,t.indexCount=0,t.vertexCount=0,t.uvsCount=0,t.total=0;let{_textureCache:i}=this;i[r]=i[r]||new K(n.baseTexture),t.mesh.texture=i[r],t.mesh.tint=this._tintColor.value,C.push(t),S[r]=t}S[r].total++}for(let e=0;e<w.length;e++)C.includes(w[e])||this.removeChild(w[e].mesh);for(let e=0;e<C.length;e++)C[e].mesh.parent!==this&&this.addChild(C[e].mesh);this._activePagesMeshData=C;for(let e in S){let t=S[e],n=t.total;if(!(t.indices?.length>6*n)||t.vertices.length<Tp.BATCHABLE_SIZE*2)t.vertices=new Float32Array(8*n),t.uvs=new Float32Array(8*n),t.indices=new Uint16Array(6*n);else{let e=t.total,n=t.vertices;for(let t=e*4*2;t<n.length;t++)n[t]=0}t.mesh.size=6*n}for(let e=0;e<x;e++){let t=i[e],r=t.position.x+b[t.line]*(this._align===`justify`?t.prevSpaces:1);this._roundPixels&&(r=Math.round(r));let a=r*n,o=t.position.y*n,s=t.texture,c=S[s.baseTexture.uid],l=s.frame,u=s._uvs,d=c.index++;c.indices[d*6+0]=0+d*4,c.indices[d*6+1]=1+d*4,c.indices[d*6+2]=2+d*4,c.indices[d*6+3]=0+d*4,c.indices[d*6+4]=2+d*4,c.indices[d*6+5]=3+d*4,c.vertices[d*8+0]=a,c.vertices[d*8+1]=o,c.vertices[d*8+2]=a+l.width*n,c.vertices[d*8+3]=o,c.vertices[d*8+4]=a+l.width*n,c.vertices[d*8+5]=o+l.height*n,c.vertices[d*8+6]=a,c.vertices[d*8+7]=o+l.height*n,c.uvs[d*8+0]=u.x0,c.uvs[d*8+1]=u.y0,c.uvs[d*8+2]=u.x1,c.uvs[d*8+3]=u.y1,c.uvs[d*8+4]=u.x2,c.uvs[d*8+5]=u.y2,c.uvs[d*8+6
1141]=u.x3,c.uvs[d*8+7]=u.y3}this._textWidth=f*n,this._textHeight=(r.y+e.lineHeight)*n;for(let e in S){let t=S[e];if(this.anchor.x!==0||this.anchor.y!==0){let e=0,n=this._textWidth*this.anchor.x,r=this._textHeight*this.anchor.y;for(let i=0;i<t.total;i++)t.vertices[e++]-=n,t.vertices[e++]-=r,t.vertices[e++]-=n,t.vertices[e++]-=r,t.vertices[e++]-=n,t.vertices[e++]-=r,t.vertices[e++]-=n,t.vertices[e++]-=r}this._maxLineHeight=_*n;let r=t.mesh.geometry.getBuffer(`aVertexPosition`),i=t.mesh.geometry.getBuffer(`aTextureCoord`),a=t.mesh.geometry.getIndex();r.data=t.vertices,i.data=t.uvs,a.data=t.indices,r.update(),i.update(),a.update()}for(let e=0;e<i.length;e++)zm.push(i[e]);this._font=e,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);let{distanceFieldRange:t,distanceFieldType:n,size:r}=Pm.available[this._fontName];if(n!==`none`){let{a:n,b:i,c:a,d:o}=this.worldTransform,s=Math.sqrt(n*n+i*i),c=Math.sqrt(a*a+o*o),l=(Math.abs(s)+Math.abs(c))/2,u=this.fontSize/r,d=e._view.resolution;for(let e of this._activePagesMeshData)e.mesh.shader.uniforms.uFWidth=l*t*u*d}super._render(e)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){let e=Pm.available[this._fontName];if(!e)throw Error(`Missing BitmapFont "${this._fontName}"`);this._font!==e&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(e){if(this.tint!==e){this._tintColor.setValue(e);for(let t=0;t<this._activePagesMeshData.length;t++)this._activePagesMeshData[t].mesh.tint=e}}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.dirty=!0)}get fontName(){return this._fontName}set fontName(e){if(!Pm.available[e])throw Error(`Missing BitmapFont "${e}"`);this._fontName!==e&&(this._fontName=e,this.dirty=!0)}get fontSize(){return this._fontSize??Pm.available[this._fontName].size}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.dirty=!0)}get anchor(){return this._anchor}set anchor(e){typeof e==`number`?this._anchor.set(e):this._anchor.copyFrom(e)}get text(){return this._text}set text(e){e=String(e??``),this._text!==e&&(this._text=e,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(e){e!==this._roundPixels&&(this._roundPixels=e,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}destroy(e){let{_textureCache:t}=this,n=Pm.available[this._fontName].distanceFieldType===`none`?Lm:Rm;n.push(...this._activePagesMeshData);for(let e of this._activePagesMeshData)this.removeChild(e.mesh);this._activePagesMeshData=[],n.filter(e=>t[e.mesh.texture.baseTexture.uid]).forEach(e=>{e.mesh.texture=K.EMPTY});for(let e in t)t[e].destroy(),delete t[e];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};Bm.styleDefaults={align:`left`,tint:16777215,maxWidth:0,letterSpacing:0};var Vm=Bm,Hm=[`.xml`,`.fnt`],Um={extension:{type:G.LoadParser,priority:nd.Normal},name:`loadBitmapFont`,test(e){return Hm.includes(Vi.extname(e).toLowerCase())},async testParse(e){return Cm.test(e)||Tm.test(e)},async parse(e,t,n){let r=Cm.test(e)?Cm.parse(e):Tm.parse(e),{src:i}=t,{page:a}=r,o=[];for(let e=0;e<a.length;++e){let t=a[e].file,n=Vi.join(Vi.dirname(i),t);n=Xu(n,i),o.push(n)}let s=await n.load(o),c=o.map(e=>s[e]);return Pm.install(r,c,!0)},async load(e,t){return(await W.ADAPTER.fetch(e)).text()},unload(e){e.destroy()}};Qa.add(Um);var Wm=class e extends Vp{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet=``,this.fontsDirt
1141y=!1}static from(t){return new e(Object.keys(e.defaultOptions).reduce((e,n)=>({...e,[n]:t[n]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(t=>{URL.revokeObjectURL(t.src),t.refs--,t.refs===0&&(t.fontFace&&document.fonts.delete(t.fontFace),delete e.availableFonts[t.originalUrl])}),this.fontFamily=`Arial`,this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,n={}){let{availableFonts:r}=e;if(r[t]){let e=r[t];return this._fonts.push(e),e.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return W.ADAPTER.fetch(t).then(e=>e.blob()).then(async e=>new Promise((t,n)=>{let r=URL.createObjectURL(e),i=new FileReader;i.onload=()=>t([r,i.result]),i.onerror=n,i.readAsDataURL(e)})).then(async([e,i])=>{let a=Object.assign({family:Vi.basename(t,Vi.extname(t)),weight:`normal`,style:`normal`,display:`auto`,src:e,dataSrc:i,refs:1,originalUrl:t,fontFace:null},n);r[t]=a,this._fonts.push(a),this.styleID++;let o=new FontFace(a.family,`url(${a.src})`,{weight:a.weight,style:a.style,display:a.display});a.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){let t=e.filter(e=>!this._overrides.includes(e));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){let t=e.filter(e=>this._overrides.includes(e));t.length>0&&(this._overrides=this._overrides.filter(e=>!t.includes(e)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,`transform-origin: top left`,`display: inline-block`,`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?`break-all`:`break-word`}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,`paint-order: stroke`]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(`;`)}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e}
1142            @font-face {
1143                font-family: "${t.family}";
1144                src: url('${t.dataSrc}');
1145                font-weight: ${t.weight};
1146                font-style: ${t.style};
1147                font-display: ${t.display};
1148            }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=Ta(e)),typeof e==`number`?wa(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor),t=this.dropShadowAlpha,n=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),r=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith(`#`)&&t<1&&(e+=(t*255|0).toString(16).padStart(2,`0`));let i=`${n}px ${r}px`;return this.dropShadowBlur>0?`text-shadow: ${i} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${i} ${e}`}reset(){Object.assign(this,e.defaultOptions)}onBeforeDraw(){let{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){let{userAgent:e}=W.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn(`[HTMLTextStyle] fillGradientStops is not supported by HTMLText`)}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn(`[HTMLTextStyle] fillGradientType is not supported by HTMLText`)}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn(`[HTMLTextStyle] miterLimit is not supported by HTMLText`)}get miterLimit(){return super.miterLimit}set trim(e){console.warn(`[HTMLTextStyle] trim is not supported by HTMLText`)}get trim(){return super.trim}set textBaseline(e){console.warn(`[HTMLTextStyle] textBaseline is not supported by HTMLText`)}get textBaseline(){return super.textBaseline}set leading(e){console.warn(`[HTMLTextStyle] leading is not supported by HTMLText`)}get leading(){return super.leading}set lineJoin(e){console.warn(`[HTMLTextStyle] lineJoin is not supported by HTMLText`)}get lineJoin(){return super.lineJoin}};Wm.availableFonts={},Wm.defaultOptions={align:`left`,breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:`black`,dropShadowDistance:5,fill:`black`,fontFamily:`Arial`,fontSize:26,fontStyle:`normal`,fontVariant:`normal`,fontWeight:`normal`,letterSpacing:0,lineHeight:0,padding:0,stroke:`black`,strokeThickness:0,whiteSpace:`normal`,wordWrap:!1,wordWrapWidth:100};var Gm=Wm,Km=class e extends Xl{constructor(t=``,n={}){super(K.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;let r=new Image,i=K.from(r,{scaleMode:W.SCALE_MODE,resourceOptions:{autoLoad:!1}});i.orig=new Io,i.trim=new Io,this.texture=i;let a=`http://www.w3.org/2000/svg`,o=`http://www.w3.org/1999/xhtml`,s=document.createElementNS(a,`svg`),c=document.createElementNS(a,`foreignObject`),l=document.createElementNS(o,`div`),u=document.createElementNS(o,`style`);c.setAttribute(`width`,`10000`),c.setAttribute(`height`,`10000`),c.style.overflow=`hidden`,s.appendChild(c),this.maxWidth=e.defaultMaxWidth,this.maxHeight=e.defaultMaxHeight,this._domElement=l,this._styleElement=u,this._svgRoot=s,this._foreignObject=c,this._foreignObject.appendChild(u),this._foreignObject.appendChild(l),this._image=r,this._loadImage=new Image,this._autoResolution=e.defaultAutoResolution,this._resolution=e.defaultResolution??W.RESOLUTION,this.text=t,this.style=n}measureText(e){let{text:t,style:n,resolution:r}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);
1148Object.assign(this._domElement,{innerHTML:t,style:n.toCSS(r)}),this._styleElement.textContent=n.toGlobalCSS(),document.body.appendChild(this._svgRoot);let i=this._domElement.getBoundingClientRect();this._svgRoot.remove();let{width:a,height:o}=i;(a>this.maxWidth||o>this.maxHeight)&&console.warn(`[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.`);let s=Math.min(this.maxWidth,Math.ceil(a)),c=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute(`width`,s.toString()),this._svgRoot.setAttribute(`height`,c.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),n!==this._style&&(Object.assign(this._domElement,{style:this._style?.toCSS(r)}),this._styleElement.textContent=this._style?.toGlobalCSS()),{width:s+n.padding*2,height:c+n.padding*2}}async updateText(e=!0){let{style:t,_image:n,_loadImage:r}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;let{width:i,height:a}=this.measureText();n.width=r.width=Math.ceil(Math.max(1,i)),n.height=r.height=Math.ceil(Math.max(1,a)),this._updateID++;let o=this._updateID;await new Promise(e=>{r.onload=async()=>{if(o<this._updateID){e();return}await t.onBeforeDraw(),n.src=r.src,r.onload=null,r.src=``,this.updateTexture(),e()};let i=new XMLSerializer().serializeToString(this._svgRoot);r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(i)}`})}get source(){return this._image}updateTexture(){let{style:e,texture:t,_image:n,resolution:r}=this,{padding:i}=e,{baseTexture:a}=t;t.trim.width=t._frame.width=n.width/r,t.trim.height=t._frame.height=n.height/r,t.trim.x=-i,t.trim.y=-i,t.orig.width=t._frame.width-i*2,t.orig.height=t._frame.height-i*2,this._onTextureUpdate(),a.setRealSize(n.width,n.height,r),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(t){typeof t==`boolean`&&(t={children:t}),t=Object.assign({},e.defaultDestroyOptions,t),super.destroy(t),this.ownsStyle&&this._style?.cleanFonts(),this._style=null,this._svgRoot?.remove(),this._svgRoot=null,this._domElement?.remove(),this._domElement=null,this._foreignObject?.remove(),this._foreignObject=null,this._styleElement?.remove(),this._styleElement=null,this._loadImage.src=``,this._loadImage.onload=null,this._loadImage=null,this._image.src=``,this._image=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);let t=Fa(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);let t=Fa(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e||={},e instanceof Gm?(this.ownsStyle=!1,this._style=e):e instanceof Vp?(console.warn(`[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle`),this.ownsStyle=!0,this._style=Gm.from(e)):(this.ownsStyle=!0,this._style=new Gm(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===``||e==null?` `:e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,`<br/>`).replace(/<hr>/gi,`<hr/>`).replace(/&nbsp;/gi,`&#160;`)}};Km.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0}
1148,Km.defaultMaxWidth=2024,Km.defaultMaxHeight=2024,Km.defaultAutoResolution=!0;var qm=new class{constructor(){this.options={tint:!0,position:!0,vertices:!0},this.container=new Ap(4,this.options),this.glowContainer=new ql,this.texture=K.WHITE,this.sprites=[],this.glow=null,this.glowTexture=K.WHITE,this.glowSprite=null,this.glowDirty=!0,this.glowUnusedSince=0}initialize(){for(let e=0;e<4;e++){let t=new Xl(this.texture);t.anchor.set(.5),t.rotation=Math.PI/2*e,this.sprites.push(t),this.container.addChild(t)}}updateGlow(){this.glowDirty=!0,E.useBorderGlow&&!E.useRainbow&&this.glow&&this.createGlowTexture()}ensureGlowResources(){this.glow||(this.glow=document.createElement(`canvas`),this.glow.width=this.glow.height=1024,this.glowTexture=K.from(this.glow),this.glowSprite=new Xl(this.glowTexture),this.glowDirty=!0)}createGlowTexture(){this.ensureGlowResources();let e=this.glow,t=e.getContext(`2d`),n=e.width*(2048/2304),r=(e.width-n)/2,i=e.width/14142;t.clearRect(0,0,e.width,e.height),t.save(),t.shadowBlur=E.borderGlowDistance*i,t.shadowColor=E.borderGlowColor,t.lineWidth=Math.max(1,Number(E.borderWidth)*i),t.strokeStyle=E.borderColor,t.strokeRect(r,r,n,n);let a=Math.max(1,E.borderGlowStrength|0);for(let e=1;e<a;e++)t.strokeRect(r,r,n,n);t.restore(),this.glowTexture.baseTexture.update(),this.glowDirty=!1}run(){let e=E.mapBorders&&E.useBorderGlow&&!E.useRainbow;if(E.mapBorders&&!e){if(this.container.children.length!==4)for(let e of this.sprites)this.container.addChild(e);this.runPlain()}else this.container.children.length&&this.container.removeChildren();e?(this.glowUnusedSince=0,this.ensureGlowResources(),this.glowDirty&&this.createGlowTexture(),this.glowSprite.parent||this.glowContainer.addChild(this.glowSprite),this.runGlow()):(this.glowSprite?.parent&&this.glowContainer.removeChild(this.glowSprite),this.releaseGlowAfterCooldown())}runPlain(){let e=Number(E.borderWidth),t=parseInt(E.borderColor.replace(`#`,`0x`)),n=T.right-T.left,r=T.bottom-T.top;for(let e of this.sprites)e.tint=t;let i=this.sprites[0];i.position.set(T.left+n/2,T.top),i.width=n+e,i.height=e;let a=this.sprites[1];a.position.set(T.right,T.top+r/2),a.width=r+e,a.height=e;let o=this.sprites[2];o.position.set(T.left+n/2,T.bottom),o.width=n+e,o.height=e;let s=this.sprites[3];s.position.set(T.left,T.top+r/2),s.width=r+e,s.height=e}runGlow(){let e=T.right-T.left,t=T.bottom-T.top,n=2304/2048,r=e*n,i=t*n,a=this.glowSprite;a.position.set(T.left-(r-e)/2,T.top-(i-t)/2),a.width=r,a.height=i}releaseGlowAfterCooldown(){if(!this.glow)return;let e=performance.now();this.glowUnusedSince||=e,!(e-this.glowUnusedSince<15e3)&&(this.glowSprite.destroy({texture:!1,baseTexture:!1}),this.glowTexture.destroy(!0),this.glow=null,this.glowSprite=null,this.glowTexture=K.WHITE,this.glowDirty=!0)}},Jm=1024,Ym=new class{initialize(){this.container=new ql,this.canvas=null,this.texture=null,this.sprite=null,this.dirty=!0,this.cacheKey=``,this.unusedSince=0}ensureResources(){this.canvas||(this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.canvas.width=this.canvas.height=Jm,this.texture=K.from(this.canvas),this.sprite=new Xl(this.texture),this.sprite.anchor.set(.5),this.dirty=!0)}run(){if(!E.mapSectors){this.sprite?.parent&&this.container.removeChild(this.sprite),this.releaseAfterCooldown();return}this.unusedSince=0,this.ensureResources();let e=T.right-T.left,t=T.bottom-T.top;if(e<=0||t<=0)return;let n=[e,t,E.sectorGridWidth,E.sectorGridColor,E.sectorTextSize,E.sectorTextColor].join(`:`);(this.dirty||n!==this.cacheKey)&&this.renderTexture(e,t,n),this.sprite.parent||this.container.addChild(this.sprite),this.sprite.position.set(T.left+e/2,T.top+t/2),this.sprite.width=e,this.sprite.height=t}cache(){this.dirty=!0}renderTexture(e,t,n){if(!this.canvas)return;let{ctx:r,canvas:i}=this,a=Jm/Math.max(e,t),o=Math.max(1,Math.round(e*a)),s=Math.max(1,Math.round(t*a));i.width!==o&&(i.width=o),i.height!==s&&(i.height=s);let c=i.width/5,l=i.height/5;r.clearRect(0,0,i.width,i.height),r.save(),r.font=`400 ${E.sectorTextSize*a}px Ubuntu`,r.textAlign=`center`,r.textBaseline=`middle`,r.lineWidth=Math.max(1,E.sectorGridWidth*a),r.strokeStyle=E.sectorGridColor,r.fillStyle=E.sectorTextColor,r.beginPath();for(let e=1;e<5;e++)r.moveTo(c*e,0),r.lineTo(c*e,i.height);for(let e=1;e<5;e++)r.moveTo(0,l*e),r.lineTo(i.width,l*e);r.stroke();for(let e=0;e<5;e++)for(let t=0;t<5;t++)r.fillText(`${`ABCDE`[e]}${t+1}`,(t+.5)*c,(e+.5)*l,c);r.strokeRect(r.lineWidth/2,r.lineWidth/2,i.width-r.lineWidth,i.height-r.lineWidth),r.restore(
1148),this.texture.baseTexture.resource.update(),this.dirty=!1,this.cacheKey=n}releaseAfterCooldown(){if(!this.canvas)return;let e=performance.now();this.unusedSince||=e,!(e-this.unusedSince<15e3)&&(this.sprite.destroy({texture:!1,baseTexture:!1}),this.texture.destroy(!0),this.sprite=null,this.texture=null,this.canvas=null,this.ctx=null,this.dirty=!0,this.cacheKey=``)}},Xm=150,Zm=5,Qm=1447446,$m=15067113,eh=256,th=new class{initialize(){this.container=new ql,this.sprite=new lm(this.createTexture(),1,1),this.container.addChild(this.sprite)}createTexture(){let e=document.createElement(`canvas`);e.width=e.height=eh;let t=e.getContext(`2d`),n=eh/Xm*Zm/2;t.fillStyle=`#ffffff`,t.fillRect(0,0,n,eh),t.fillRect(eh-n,0,n,eh),t.fillRect(0,0,eh,n),t.fillRect(0,eh-n,eh,n);let r=K.from(e);return r.baseTexture.wrapMode=cr.REPEAT,r.baseTexture.mipmap=lr.POW2,r}run(){let e=this.sprite;if(!E.grid){e.visible=!1;return}e.visible=!0;let t=window.innerWidth/(2*V.zoom),n=window.innerHeight/(2*V.zoom),r=V.x-t,i=V.y-n;e.tint=document.body.dataset.theme===`light`?$m:Qm,e.position.set(r,i),e.width=t*2,e.height=n*2,e.tileScale.set(Xm/eh),e.tilePosition.set(-((r%Xm+Xm)%Xm),-((i%Xm+Xm)%Xm))}},nh=4,rh=14,ih=16,ah=3,oh=75,sh=11250603,ch=13158600,lh=11250603,uh=7105644,dh=()=>document.body.dataset.theme===`light`,fh=new class{initialize(){this.container=new ql,this.graphics=new bp,this.container.addChild(this.graphics),this.arrowContainer=new ql,this.arrowGraphics=new bp,this.arrowContainer.addChild(this.arrowGraphics)}activeCells(e){if(E.directionMarkerType!==e||!M.enabled||!B.isAlive)return null;let t=Y.myCells[B.activeTab];return!t||t.size===0?null:t}runLines(){let e=this.graphics;e.clear();let t=this.activeCells(`lines`);if(t===null)return;let n=M.aimFrom(M.activeCenter());e.lineStyle(nh,dh()?ch:sh);for(let r of t.values())r.removed||(e.moveTo(r.x,r.y),e.lineTo(n.x,n.y))}runArrow(){let e=this.arrowGraphics;e.clear();let t=this.activeCells(`arrow`);if(t===null)return;let n=window.devicePixelRatio||1,r=M.activeCenter(),i=M.aimFrom(r),a=i.x,o=i.y,s=0;for(let e of t.values()){if(e.removed)continue;let t=r.x-e.x,n=r.y-e.y,i=Math.sqrt(t*t+n*n)||1;s<i+e.radius+oh&&(s=i+e.radius+oh)}let c=a-r.x,l=o-r.y,u=Math.sqrt(c*c+l*l)||1,d=c/u,f=l/u,p=Math.atan2(d,-f),m=rh*ah*n,h=ih*ah*n,g=Math.cos(p),_=Math.sin(p),v=r.x+d*s,y=r.y+f*s,b=(e,t)=>[v+e*g-t*_,y+e*_+t*g];e.beginFill(dh()?uh:lh),e.drawPolygon([...b(0,-h/2),...b(-m/2,h/2),...b(0,h*4/5-h/2),...b(m/2,h/2)]),e.endFill()}},ph=new class{initialize(){this.container=new ql,this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.sprite=new Xl,this.image=new Image,this.image.crossOrigin=`anonymous`,this.lastUrl=null,this.image.onload=()=>{this.updateCache()},this.image.onerror=()=>{console.warn(`[Background] Could not load image: ${this.image.src}`)}}updateCache(){if(!this.canvas)return;let e=this.image;if(!e.complete||!e.naturalWidth||!e.naturalHeight)return;let t=Math.min(Math.max(e.naturalWidth,e.naturalHeight),2048);this.canvas.width=t,this.canvas.height=t,this.ctx.drawImage(e,0,0,t,t),this.container.removeChild(this.sprite),this.sprite.destroy(!0),this.sprite=Xl.from(this.canvas),this.container.addChild(this.sprite)}run(){if(!this.canvas)return;if(E.backgroundImage)this.container.children.length!==1&&this.container.addChild(this.sprite);else{this.container.children.length!==0&&this.container.removeChildren();return}let e=E.backgroundImageURL;this.lastUrl!==e&&(this.lastUrl=e,this.image.src=e);let t=T.right-T.left,n=T.bottom-T.top;this.sprite.anchor.set(.5,.5),this.sprite.x=T.left+t/2,this.sprite.y=T.top+n/2,this.sprite.width=t,this.sprite.height=n}},mh=128,hh=new class{constructor(){this.options={vertices:!0,rotation:!0,tint:!0},this.container=new Ap(mh,this.options),this.texture=K.WHITE,this.sprites=[]}initialize(){for(let e=0;e<mh;e++){let e=new Xl(this.texture);e.anchor.x=.5,this.sprites.push(e)}}run(){if(E.mouseTracker){if(this.container.children.length!==mh)for(let e of this.sprites)this.container.addChild(e)}else{this.container.children.length!==0&&this.container.removeChildren();return}for(let e=0;e<this.sprites.length;e++){let t=this.sprites[e];t.alpha=0}let e=(Be.mouse.x-window.innerWidth/2)/V.zoom+V.x,t=(Be.mouse.y-window.innerHeight/2)/V.zoom+V.y,n=Y.myCells[B.activeTab];if(!n)return;let r=0;for(let i of n.values()){if(r===mh)break;let n=e-i.x,a=t-i.y,o=Math.sqrt(n*n+a*a),s=Math.atan(n/a)||0,c=this.sprites[r++];c.x=e,c.y=t,c.width=4,c.height=o,c.rotation=(t<i.y?0:Math.PI)-s,c.alpha=1}}},gh=new WeakMap,_h=2e3,vh=1e4;function yh(e,t,n=0){let r=performance.now(),i=gh.get(e);if(i||(i={checkedAt:0,oversizedAt:0},gh.set(e,i)),r-i.checkedAt<_h)return;i.checkedAt=r;let a=Math.max(n,Math.ceil(t*1.25)+8);if(e.length<=a){i.oversizedAt=0;return}if(!i.oversizedAt){i.oversizedAt=r;return}if(r-i.oversizedAt<vh)return;let o=e.splice(a);for(let e of o)e.parent&&e.parent.removeChild(e),e.destroy({children:!0,texture:!1,baseTexture:!1});i.oversizedAt=0}var bh=new class{constructor(){this.size=256,this.textures={base:K.WHITE,ring:K.WHITE,inner:K.WHITE}
1148,this.pools={base:[],ring:[],inner:[]},this.index={base:0,ring:0,inner:0},this.baseTexture=null,this.ringFrameTexture=K.WHITE,this.glowRingTexture=K.WHITE,this.baseColor=null,this.baseTint=16777215,this.ringColor=null,this.ringTint=16777215}clean(){this.canvas&&(this.createTextures(),this.reset())}initialize(){this.canvas=document.createElement(`canvas`),this.createTextures()}reset(){this.index.base=0,this.index.ring=0}add(e,t){if(!this.canvas)return;let n=t.radius/100,r=this.pools.base[this.index.base++]||this.newBase(),i=this.pools.ring[this.index.ring++]||this.newRing();r.scale.set(n,n),r.position.set(t.x,t.y),r.tint=this.getBaseTint(),e.addChild(r),i.scale.set(n,n),i.position.set(t.x,t.y),i.tint=E.useVirusGlow?16777215:this.getRingTint(),e.addChild(i)}getBaseTint(){return this.baseColor!==E.virusColor2&&(this.baseColor=E.virusColor2,this.baseTint=k.toNumber(this.baseColor)),this.baseTint}getRingTint(){return this.ringColor!==E.virusColor1&&(this.ringColor=E.virusColor1,this.ringTint=k.toNumber(this.ringColor)),this.ringTint}createTextures(){let e=this.canvas,t=e.getContext(`2d`);t.clearRect(0,0,e.width,e.height);let n=this.size;e.width=n*2,e.height=n*2,t.beginPath(),t.arc(n/2,n/2,100,0,Math.PI*2,!0),t.closePath(),t.fillStyle=`#ffffff`,t.fill(),E.useVirusGlow||(t.beginPath(),t.arc(n+n/2,n/2,100,0,Math.PI*2,!0),t.closePath(),t.strokeStyle=`#ffffff`,t.lineWidth=E.virusBorderWidth,t.stroke());let r=this.baseTexture,i=[this.textures.base,this.ringFrameTexture];if(this.baseTexture=new vo(e),this.textures.base=new K(this.baseTexture,new Io(0,0,this.size,this.size)),this.ringFrameTexture=new K(this.baseTexture,new Io(this.size,0,this.size,this.size)),r){for(let e of i)e!==K.WHITE&&e.destroy(!1);r.destroy()}E.useVirusGlow?this.createGlowTexture():(this.releaseGlowTexture(),this.textures.ring=this.ringFrameTexture),this.refreshPoolTextures(this.pools.base,this.textures.base),this.refreshPoolTextures(this.pools.ring,this.textures.ring)}createGlowTexture(){if(E.useVirusGlow){let e=this.ringCanvas||=document.createElement(`canvas`),t=e.getContext(`2d`);e.width=512,e.height=512,t.beginPath(),t.arc(512/2,512/2,100,0,Math.PI*2,!0),t.closePath(),t.shadowBlur=E.virusGlowDistance,t.shadowColor=E.virusGlowColor,t.strokeStyle=E.virusColor1,t.lineWidth=E.virusBorderWidth;for(let e=0;e<E.virusGlowStrength;e++)t.stroke();let n=this.glowRingTexture;this.glowRingTexture=new K(new vo(e)),n!==K.WHITE&&n.destroy(!0),this.textures.ring=this.glowRingTexture}}releaseGlowTexture(){this.glowRingTexture!==K.WHITE&&this.glowRingTexture.destroy(!0),this.glowRingTexture=K.WHITE,this.ringCanvas=null}newBase(){let e=new Xl(this.textures.base);return e.anchor.x=.5,e.anchor.y=.5,e.alpha=.7,this.pools.base.push(e),e}newRing(){let e=new Xl(this.textures.ring);return e.anchor.x=.5,e.anchor.y=.5,this.pools.ring.push(e),e}newInner(){let e=new Xl(this.textures.inner);return e.anchor.x=.5,e.anchor.y=.5,this.pools.inner.push(e),e}refreshPoolTextures(e,t){for(let n of e)n.texture=t}trim(){yh(this.pools.base,this.index.base,16),yh(this.pools.ring,this.index.ring,16)}getTextureBytesEstimate(){return(this.canvas?this.canvas.width*this.canvas.height*4:0)+(this.ringCanvas?this.ringCanvas.width*this.ringCanvas.height*4:0)}},xh=new class{constructor(){this.texture=K.WHITE,this.pool=[],this.index=0,this.foodColor=null,this.foodTint=16777215}initialize(){this.canvas=document.createElement(`canvas`),this.createTexture()}clean(){this.canvas&&(this.createTexture(),this.reset())}reset(){this.index=0}add(e,t){if(!this.canvas)return;let n=this.pool[this.index++]||this.newSprite();n.x=t.x,n.y=t.y;let r=E.useFoodGlow?t.radius*128/15*2:t.radius*2;n.scale.set(r/this.texture.width),E.useFoodGlow?n.tint=16777215:n.tint=E.rainbowFood?t.tint:this.getFoodTint(),e.addChild(n)}getFoodTint(){return this.foodColor!==E.foodColor&&(this.foodColor=E.foodColor,this.foodTint=k.toNumber(this.foodColor)),this.foodTint}createTexture(){let e=this.canvas,t=e.getContext(`2d`);t.clearRect(0,0,e.width,e.height);let n=E.useFoodGlow?256:64;if(e.width=n,e.height=n,!E.useFoodGlow)t.beginPath(),t.arc(n/2,n/2,n/2,0,Math.PI*2,!0),t.closePath(),t.fillStyle=`#ffffff`,t.fill();else if(E.useFoodGlow){let e=E.foodGlowStrength,r=E.foodGlowDistance;t.beginPath(),t.shadowBlur=r,t.shadowColor=E.foodGlowColor,t.arc(n/2,n/2,15,0,Math.PI*2,!0),t.closePath(),t.fillStyle=E.foodColor;for(let n=0;n<e;n++)t.fill()}let r=this.texture;this.texture=new K(new vo(e)),r!==K.WHITE&&r.destroy(!0);for(let e of this.pool)e.texture=this.texture}trim(){yh(this.pool,this.index,64)}newSprite(){let e=new Xl(this.texture);return e.anchor.x=.5,e.anchor.y=.5,this.pool.push(e),e}getTextureBytesEstimate(){return this.canvas?this.canvas.width*this.canvas.height*4:0}},Sh=new class{constructor(){this.texture=K.WHITE,this.pool=[],this.index=0}initialize(){this.createTexture()}reset(){this.index=0}add(e,t){let n=this.pool[this.index++]||this.newSprite();n.x=t.x,n.y=t.y,n.scale.set(t.radius*2/this.texture.width),n.tint=t.tint,e.addChild(n)}createTexture(){let e=document.createElement(`canvas`),t=e.getContext(`2d`);e.width=64,e.height=64,t.beginPath(),t.arc(64/2,64/2,64/2,0,Math.PI*2,!0),t.closePath(),t.fillStyle=`#ffffff`,t.fill(),this.texture=K.from(e)}newSprite(){let e=new Xl(this.texture);return e.anchor.x=.5,e.anchor.y=.5,this.pool.push(e),e}trim(){yh(this.pool,this.index,32)}},Ch=class{constructor(e){this.texture=K.from(e),this.pool=[],this.index=0,this.lastUsed=Date.now(),this.frame=-1}getSprite(){return this.pool[this.index++]||this.newSprite()}newSprite(){let e=new Xl(this.texture);return e.anchor.set(.5,.5),this.pool.push(e),e}reset(){this.index=0}trim(){yh(this.pool,this.index,1)}destroy(){for(let e of this.pool)e.destroy(!1);this.texture.destroy(!0)}},wh=6e4,Th=new class{constructor(){this.skins=new Map,this.downloading=new Map,this.failedAt=new Map,this.activeSkins=[],this.frame=0,this.lastSweep=0,this.now=Date.now(),this.maxDownloads=16}initialize(){}reset(){for(let e of this.activeSkins)e.reset();this.activeSkins.length=0,this.frame++;let e=this.now=Date.now();if(!(e-this.lastSweep<1e3)){this.lastSweep=e;for(let[t,n]of this.skins)e-n.lastUsed>=2e3&&(n.destroy(),this.skins.delete(t));for(let[t,n]of this.failedAt)e-n>=wh&&this.failedAt.delete(t)}}get(e){if(e===`no-skin`||!e)return!1;let t=this.skins.get(e);if(t!==void 0)return t.frame!==this.frame&&(t.frame=this.frame,t.lastUsed=this.now,this.activeSkins.push(t)),t.getSprite();let n=this.failedAt.get(e);return n!==void 0&&this.now-n<wh||!this.downloading.has(e)&&this.downloading.size<this.maxDownloads&&this.download(e),!1}download(e){let t=new Image;t.crossOrigin=`anonymous`,t.onload=()=>{this.failedAt.delete(e);let n=document.createElement(`canvas`),r=n.getContext(`2d`);n.width=512,n.height=512,r.beginPath(),r.arc(256,256,256,0,Math.PI*2,!0),r.closePath(),r.clip(),t.width&&t.height&&r.drawImage(t,0,0,512,512);let i=new Ch(n);this.downloading.delete(e),this.skins.set(e,i),t.onload=null,t.onerror=null},t.onerror=()=>{this.downloading.delete(e),this.failedAt.set(e,Date.now()),t.onload=null,t.onerror=null},t.src=e,this.downloading.set(e,!0)}getPerformanceStats(){let e=0;for(let t of this.skins.values())e+=t.pool.length;return{skins:this.skins.size,skinSpritesAllocated:e,skinsDownloading:this.downloading.size,skinTextureBytesEstimate:this.skins.size*512*512*4}}trim(){for(let e of this.activeSkins)e.trim()}},Eh=new class{constructor(){this.texture=K.WHITE,this.pool=[],this.index=0,this.unusedSince=0}initialize(){}update(){this.canvas&&this.createTexture()}reset(){this.index=0}getSprite(){return this.canvas||this.createTexture(),this.unusedSince=0,this.pool[this.index++]||this.newSprite()}createTexture(){let e=this.canvas||=document.createElement(`canvas`),t=e.getContext(`2d`);t.clearRect(0,0,e.width,e.height);let n=128*(E.activeCellBorderWidth/100),r=n/2;e.width=256,e.height=256,t.beginPath(),t.arc(256/2,256/2,128-r,0,Math.PI*2,!0),t.closePath(),t.lineWidth=n,t.strokeStyle=`#ffffff`,t.stroke(),this.texture===K.WHITE?this.texture=K.from(e):this.texture.baseTexture.update(
1148)}newSprite(){let e=new Xl(this.texture);return e.anchor.x=.5,e.anchor.y=.5,this.pool.push(e),e}trim(){if(yh(this.pool,this.index,4),this.index){this.unusedSince=0;return}let e=performance.now();this.unusedSince||=e,this.canvas&&e-this.unusedSince>15e3&&this.release()}release(){for(let e of this.pool)e.destroy({texture:!1,baseTexture:!1});this.pool.length=0,this.texture!==K.WHITE&&this.texture.destroy(!0),this.texture=K.WHITE,this.canvas=null}},Dh=new class{constructor(){this.pool=[],this.index=0,this.loaded=!1}reset(){this.index=0}initialize(){this.loadFonts()}get(e){let t=this.pool[this.index++]||this.newText();return t.text=`${e}`,t.fontName=E.cellMassStroke?`UbuntuStroked`:`Ubuntu`,t.fontSize=256,t}newText(){let e=new Vm(`000`,{fontName:`Ubuntu`,fontSize:256});return e.anchor=.5,this.pool.push(e),e}trim(){yh(this.pool,this.index,16)}loadFonts(){Rd.load([`/web/bitmapFonts/ubuntuBold.fnt`,`/web/bitmapFonts/ubuntuBoldStroked.fnt`]).then(()=>{this.loaded=!0})}},Oh=class{constructor(e){this.texture=K.from(e),this.pool=[],this.index=0,this.lastUsed=Date.now(),this.frame=-1}getSprite(){return this.pool[this.index++]||this.newSprite()}newSprite(){let e=new Xl(this.texture);return e.anchor.set(.5,.5),this.pool.push(e),e}reset(){this.index=0}trim(){yh(this.pool,this.index,1)}destroy(){for(let e of this.pool)e.destroy(!1);this.texture.destroy(!0)}},kh=new class{constructor(){this.cacheMap=new Map,this.activeCaches=[],this.frame=0,this.lastSweep=0,this.now=Date.now()}reset(){for(let e of this.activeCaches)e.reset();this.activeCaches.length=0,this.frame++;let e=this.now=Date.now();if(!(e-this.lastSweep<1e3)){this.lastSweep=e;for(let[t,n]of this.cacheMap)e-n.lastUsed>=5e3&&(n.destroy(),this.cacheMap.delete(t))}}get(e){let t=(E.cellNickStroke?`s:`:`n:`)+e,n=this.cacheMap.get(t)||this.newNickCache(e,t);return n.frame!==this.frame&&(n.frame=this.frame,n.lastUsed=this.now,this.activeCaches.push(n)),n.getSprite()}trim(){for(let e of this.activeCaches)e.trim()}newNickCache(e,t){let n=document.createElement(`canvas`),r=n.getContext(`2d`),i=E.cellNickStroke?39:0;r.font=`500 32px Ubuntu`;let a=256+i*2,o=r.measureText(e).width*(256/32)+i*2|0;n.height=a,n.width=o,r.font=`500 256px Ubuntu`,r.textBaseline=`middle`,i>0&&(r.lineWidth=i,r.strokeStyle=`#000000`,r.strokeText(e,i,a>>1)),r.fillStyle=`#ffffff`,r.fillText(e,i,a>>1);let s=new Oh(n);return this.cacheMap.set(t,s),s}},Ah=new class{constructor(){this.size=256,this.texture=K.WHITE,this.activeTexture=K.WHITE,this.image=null,this.canvas=null,this.indexes={shield:0,shieldActive:0},this.pools={shield:[],shieldActive:[]},this.unusedSince=0}initialize(){}ensureResources(){this.image||(this.canvas=document.createElement(`canvas`),this.image=new Image,this.image.onload=()=>{this.texture=K.from(this.image),this.createActiveTexture();for(let e of this.pools.shield)e.texture=this.texture},this.image.src=Bn)}update(){this.image?.complete&&this.image.naturalWidth&&this.createActiveTexture()}reset(){this.indexes.shield=0,this.indexes.shieldActive=0}add(e,t,n){if(this.ensureResources(),this.texture===K.WHITE||!this.image.complete||!this.image.naturalWidth)return;this.unusedSince=0;let r=t.radius;n&&(r*=1.25);let i=14*r/100,a=n?this.pools.shieldActive[this.indexes.shieldActive++]||this.newSpriteActive():this.pools.shield[this.indexes.shield++]||this.newSprite();a.position.set(t.x,t.y),a.scale.set((r+i)*2/a.texture.width),e.addChild(a)}createActiveTexture(){if(!this.canvas||!this.image?.naturalWidth)return;let e=this.canvas,t=e.getContext(`2d`);e.width=e.height=this.size*1.25,t.clearRect(0,0,e.width,e.height),t.save(),t.translate(e.width/2,e.height/2),t.shadowColor=E.activeCellBorderColor,t.shadowBlur=20;for(let e=0;e<4;e++)t.drawImage(this.image,-this.size/2,-this.size/2,this.size,this.size);t.restore(),this.activeTexture===K.WHITE?this.activeTexture=K.from(e):this.activeTexture.baseTexture.update();for(let e of this.pools.shieldActive)e.texture=this.activeTexture}newSprite(){let e=new Xl(this.texture);return e.anchor.set(.5),this.pools.shield.push(e),e}newSpriteActive(){let e=new Xl(this.activeTexture);return e.anchor.set(.5),this.pools.shieldActive.push(e),e}
1148trim(){if(yh(this.pools.shield,this.indexes.shield,2),yh(this.pools.shieldActive,this.indexes.shieldActive,2),this.indexes.shield||this.indexes.shieldActive){this.unusedSince=0;return}let e=performance.now();this.unusedSince||=e,this.image&&e-this.unusedSince>15e3&&this.release()}release(){for(let e of Object.values(this.pools)){for(let t of e)t.destroy({texture:!1,baseTexture:!1});e.length=0}this.texture!==K.WHITE&&this.texture.destroy(!0),this.activeTexture!==K.WHITE&&this.activeTexture.destroy(!0),this.image&&(this.image.onload=null,this.image.src=``),this.texture=K.WHITE,this.activeTexture=K.WHITE,this.image=null,this.canvas=null}},jh=new class{constructor(){this.texture=K.WHITE,this.size=150,this.index=0,this.pool=[],this.unusedSince=0}reset(){this.index=0}add(e,t){this.canvas||this.createTexture(),this.unusedSince=0;let n=E.activeCellIndicatorSize,r=this.pool[this.index++]||this.new();r.position.set(t.x-n/2,t.y-t.radius-n),r.scale.set(n/this.texture.width),r.tint=parseInt(E.activeCellIndicatorColor.replace(`#`,`0x`)),e.addChild(r)}initialize(){}createTexture(){let e=this.canvas||=document.createElement(`canvas`),t=e.getContext(`2d`);e.width=e.height=this.size,t.textAlign=`center`,t.textBaseline=`middle`,t.font=`900 ${this.size}
1148px 'Font Awesome 5 Free'`,t.fillStyle=`white`,t.fillText(``,e.width/2,e.height/2),this.texture=K.from(e),this.texture.update()}new(){let e=new Xl(this.texture);return this.pool.push(e),e}trim(){if(yh(this.pool,this.index,2),this.index){this.unusedSince=0;return}let e=performance.now();this.unusedSince||=e,this.canvas&&e-this.unusedSince>15e3&&this.release()}release(){for(let e of this.pool)e.destroy({texture:!1,baseTexture:!1});this.pool.length=0,this.texture!==K.WHITE&&this.texture.destroy(!0),this.texture=K.WHITE,this.canvas=null}},Mh=400,Nh=6e4,Ph=1e3,Fh=class{constructor(e){this.entry=e,this.base=new vo(e.sheet),this.textures=[];let t=e.frameSize;for(let n=0;n<e.frameCount;n++)this.textures.push(new K(this.base,new Io(e.frameX(n),e.frameY(n),t,t)));this.pool=[],this.index=0,this.frame=-1,this.lastUsed=0}getSprite(){return this.pool[this.index++]||this.newSprite()}newSprite(){let e=new Xl(this.textures[0]);return e.anchor.set(.5,.5),this.pool.push(e),e}destroy(){for(let e of this.pool)e.destroy(!1);for(let e of this.textures)e.destroy(!1);this.base.destroy(),this.pool.length=0,this.textures.length=0}},Ih=new class{constructor(){this.records=new Map,this.active=[],this.frame=0,this.lastSweep=0}reset(e){for(let e of this.active)e.index=0;this.active.length=0,this.frame++,this.sweep(e)}add(e,t,n,r,i,a){let o=n.emojiUrl,s=yt.get(o,i);if(!s)return;let c=this.records.get(o);c&&c.entry!==s&&(c.destroy(),c=void 0),c||(c=new Fh(s),this.records.set(o,c)),c.frame!==this.frame&&(c.frame=this.frame,c.lastUsed=i,this.active.push(c));let l=c.textures[yt.frameIndexAt(s,i-n.emojiStartedAt)],u=c.getSprite();u.texture=l,u.position.set(t.x,t.y),u.scale.set(a*2*1/s.frameSize),u.alpha=r*Math.min(1,(n.emojiUntil-i)/Mh),e.addChild(u)}trim(){for(let e of this.active)yh(e.pool,e.index,1)}sweep(e){if(!(e-this.lastSweep<Ph)){this.lastSweep=e,yt.sweep(e);for(let[t,n]of this.records)e-n.lastUsed<Nh&&yt.peek(t)===n.entry||(n.destroy(),this.records.delete(t))}}getPerformanceStats(){let e=0,t=0;for(let n of this.records.values())e+=n.pool.length,t+=n.entry.bytes;return{emojiTextureSets:this.records.size,emojiSpritesAllocated:e,emojiTextureBytesEstimate:t,...yt.getPerformanceStats()}}},Lh=6e4,Rh=1e3,zh=class{constructor(e){this.entry=e,this.base=new vo(e.canvas),this.texture=new K(this.base),this.pool=[],this.index=0,this.frame=-1,this.lastUsed=0}getSprite(){return this.pool[this.index++]||this.newSprite()}newSprite(){let e=new Xl(this.texture);return e.anchor.set(.5,.5),this.pool.push(e),e}destroy(){for(let e of this.pool)e.destroy(!1);this.texture.destroy(!1),this.base.destroy(),this.pool.length=0}},Bh=new class{constructor(){this.records=new Map,this.active=[],this.frame=0,this.lastSweep=0}reset(e){for(let e of this.active)e.index=0;this.active.length=0,this.frame++,this.sweep(e)}add(e,t,n,r,i){let a=zn.get(t.hat);if(!a)return;let o=a.url,s=jt.get(o,i);if(!s)return;let c=this.records.get(o);c&&c.entry!==s&&(c.destroy(),c=void 0),c||(c=new zh(s),this.records.set(o,c)),c.frame!==this.frame&&(c.frame=this.frame,c.lastUsed=i,this.active.push(c));let l=c.getSprite();l.position.set(t.x,t.y+r*a.offset_y/100),l.scale.set(r*2*a.scale/100/s.canvas.width),l.alpha=n,e.addChild(l)}trim(){for(let e of this.active)yh(e.pool,e.index,1)}sweep(e){if(!(e-this.lastSweep<Rh)){this.lastSweep=e,jt.sweep(e);for(let[t,n]of this.records)e-n.lastUsed<Lh&&jt.peek(t)===n.entry||(n.destroy(),this.records.delete(t))}}getPerformanceStats(){let e=0,t=0;for(let n of this.records.values())e+=n.pool.length,t+=n.entry.bytes;return{hatTextureSets:this.records.size,hatSpritesAllocated:e,hatTextureBytesEstimate:t,...jt.getPerformanceStats()}}},Vh=new class{constructor(){this.texture=K.WHITE,this.pool=[],this.index=0,this.ownTag=0,this.now=0}initialize(){this.createTexture(),jh.initialize(),Th.initialize(),Eh.initialize(),Dh.initialize(),Ah.initialize()}reset(){this.index=0,this.now=performance.now();let e=Y.clientsList.get(Y.myClientID);this.ownTag=e?.tag||``,jh.reset(),Ah.reset(),Th.reset(),Eh.reset(),Dh.reset(),kh.reset(),Ih.reset(this.now),Bh.reset(this.now)}add(e,t){if(!this.texture)return;let n=t.parentPlayer.parentClient,r=n.tag===this.ownTag,i=n.isBot,a=this.pool[this.index++]||this.newBase(),o=t.color;t.isOwn>=0&&Y.myPlayerIDs.length>1&&E.ownCellColoring===`multibox`&&(o=t.isOwn===B.activeTab?E.activeCellBorderColor:`#ffffff`),a.x=t.x,a.y=t.y,a.scale.set(t.radius*2/this.texture.width),a.tint=o===t.color?t.tint:k.toNumber(o);let s=a.alpha=X.isReplay?ue.opacity:E.cellOpacity/100;s!==1&&(s=1),!i&&B.isTR&&!t.isTR&&(s*=.35),!i&&!B.isTR&&t.isTR&&(s*=.35),t.removed&&(s*=1-t.dt),e.addChild(a);let c=!1;n.isBot||(t.isOwn>=0?E.cellSkin&&(c=Th.get(t.skin)):r?E.cellSkin&&E.teammateCellSkin&&(c=Th.get(t.skin)):E.enemyCellSkin&&(c=Th.get(t.skin))),t.isOwn>=0&&Y.myPlayerIDs.length>1&&E.shieldMarker&&Ah.add(e,t,t.isOwn===B.activeTab);let l=t.radius*(t.isOwn>=0&&Y.myPlayerIDs.length>1&&E.shieldMarker?.65:1),u=!i&&n.emojiUntil>this.now,d=l*(u?mt(n,this.now):1);if(c!==!1&&(c.x=t.x,c.y=t.y,c.scale.set(d*2/c.texture.width),c.alph
1148a=s,e.addChild(c)),u&&Ih.add(e,t,n,s,this.now,d),t.isOwn>=0&&Y.myPlayerIDs.length>1&&E.activeCellBorder){let n=t.isOwn===B.activeTab?E.activeCellBorderColor:`#ffffff`,r=parseInt(n.replace(`#`,`0x`)),i=Eh.getSprite();i.x=t.x,i.y=t.y,i.scale.set(l*2/i.texture.width),i.tint=r,e.addChild(i)}if(!i&&t.hat&&Bh.add(e,t,s,l,this.now),t.radius*V.zoom<34&&E.autoHideText)return!1;let f=t.isOwn>=0&&E.ownCellNick||t.isOwn<0&&E.cellNick;if(f){let r=kh.get(n.nick||eg.defaultCellName),i=Math.min(1,256*10.7/r.texture.width),a=E.nickSize*(t.radius*.3)/256,o=k.toNumber(n.teamColor);r.position.set(t.x,t.y),r.scale.set(a*i,a*i),r.alpha=s,r.tint=o,e.addChild(r)}if(f&&E.cellClanTag&&n.clanTag){let r=kh.get(n.clanTag),i=Math.min(1,256*10.7/r.texture.width),a=E.nickSize*(t.radius*.3)/256*.55;r.position.set(t.x,t.y-t.radius*.3),r.scale.set(a*i,a*i),r.alpha=s,r.tint=k.toNumber(n.teamColor),e.addChild(r)}if(t.isOwn>=0&&E.ownCellMass||t.isOwn<0&&E.cellMass){let r=t.mass>999&&E.cellMassFormat===`shortened`?`${(t.mass/100|0)/10}k`:t.mass,i=Dh.get(r),a=E.massSize*(t.radius*.3)/256,o=k.toNumber(n.teamColor);i.x=t.x,i.y=t.y+(f?t.radius*.3:0),i.scale.set(a),i.alpha=s,i.tint=o,e.addChild(i)}t.isOwn>=0&&Y.myPlayerIDs.length>1&&t.isOwn===B.activeTab&&E.activeCellIndicator&&jh.add(e,t)}createTexture(){let e=this.canvas=document.createElement(`canvas`),t=e.getContext(`2d`);e.width=256,e.height=256,t.beginPath(),t.arc(256/2,256/2,256/2,0,Math.PI*2,!0),t.closePath(),t.fillStyle=`#ffffff`,t.fill(),this.texture=K.from(e)}trim(){yh(this.pool,this.index,16),jh.trim(),Ah.trim(),Th.trim(),Eh.trim(),Dh.trim(),kh.trim(),Ih.trim(),Bh.trim()}newBase(){let e=new Xl(this.texture);return e.anchor.x=.5,e.anchor.y=.5,this.pool.push(e),e}getTextureBytesEstimate(){return this.canvas?this.canvas.width*this.canvas.height*4:0}getPerformanceStats(){return{playerSpritesAllocated:this.pool.length,nickTextCaches:kh.cacheMap.size,massTextSpritesAllocated:Dh.pool.length,...Th.getPerformanceStats(),...Ih.getPerformanceStats(),...Bh.getPerformanceStats(),playerTextureBytesEstimate:this.getTextureBytesEstimate(),activeCellRingBytesEstimate:Eh.canvas?Eh.canvas.width*Eh.canvas.height*4:0,shieldTextureBytesEstimate:Ah.canvas?Ah.canvas.width*Ah.canvas.height*4:0}}},Hh=new class{constructor(){this.container=new ql,this.desiredChildren=[],this.childSet=new Set,this.collector={addChild:e=>this.desiredChildren.push(e)},this.visibleCells=0,this.culledCells=0}initialize(){xh.initialize(),Sh.initialize(),bh.initialize(),Vh.initialize()}reset(){this.desiredChildren.length=0,xh.reset(),Sh.reset(),bh.reset(),Vh.reset()}run(e){Dh.loaded!==!1&&(this.reset(),this.setup(e),this.reconcileChildren(),xh.trim(),Sh.trim(),bh.trim(),Vh.trim())}getPerformanceStats(){let e=Vh.getPerformanceStats();return{cellDisplayObjects:this.container.children.length,visibleCells:this.visibleCells,culledCells:this.culledCells,foodSpritesAllocated:xh.pool.length,virusSpritesAllocated:bh.pools.base.length+bh.pools.ring.length,ejectSpritesAllocated:Sh.pool.length,textureBytesEstimate:xh.getTextureBytesEstimate()+bh.getTextureBytesEstimate()+e.playerTextureBytesEstimate+e.activeCellRingBytesEstimate+e.shieldTextureBytesEstimate+e.skinTextureBytesEstimate+e.emojiTextureBytesEstimate,...e}}setup(e){this.visibleCells=e.cells.length,this.culledCells=e.culledCells;for(let t of e.cells)t.isVirus?bh.add(this.collector,t):t.isFood?E.pellets&&xh.add(this.collector,t):t.isEject?Sh.add(this.collector,t):t.isPlayerCell&&Vh.add(this.collector,t)}reconcileChildren(){let e=this.desiredChildren,t=this.container.children;if(t.length===e.length){let n=!0;for(let r=0;r<e.length;r++)if(t[r]!==e[r]){n=!1;break}if(n)return}let n=this.childSet;n.clear();for(let t of e)n.add(t);for(let e=this.container.children.length-1;e>=0;e--)n.has(this.container.children[e])||this.container.removeChildAt(e);for(let t=0;t<e.length;t++){let n=e[t];n.parent===this.container?this.container.children[t]!==n&&this.container.setChildIndex(n,t):this.container.addChildAt(n,t)}}},Uh=new class{constructor(){this.container=new ql,this.sprite=null,this.filter=null,this.filterArea=new Io,this.hue=0,this.lastHueUpdate=0,this.unusedSince=0}initialize(){}ensureResources(){this.sprite||(this.sprite=Xl.from(Fe),this.sprite.anchor.set(.5),this.filter=new lu,this.container.filters=[this.filter],this.container.filterArea=this.filterArea)}run(){if(!(E.mapBorders&&E.useRainbow)){this.sprite?.parent&&this.container.removeChild(this.sprite),this.releaseAfterCooldown();return}this.unusedSince=0,this.ensureResources(),this.sprite.parent||this.container.addChild(this.sprite);let e=T.right-T.left,t=T.bottom-T.top,n=e/720*15;this.sprite.position.set(T.left+e/2,T.top+t/2),this.sprite.width=e+n*2,this.sprite.height=t+n*2,this.filterArea.x=this.sprite.x-this.sprite.width/2,this.filterArea.y=this.sprite.y-this.sprite.height/2,this.filterArea.width=this.sprite.width,this.filterArea.height=this.sprite.height;let r=performance.now();if(r-this.lastHueUpdate>=1e3/30){let e=this.lastHueUpdate?r-this.lastHueUpdate:1e3/60;this.hue=(this.hue+e*.06)%360,this.filter.hue(this.hue,!1),this.lastHueUpdate=r}}releaseAfterCooldown(){if(!this.sprite)return;let e=performance.now();this.unusedSince||=e,!(e-this.unusedSince<15e3)&&(this.container.filters=null,this.container.filterArea=null,this.filter.destroy?.(),this.sprite.destroy({texture:!0,baseTexture:!0}),this.sprite=null,this.filter=null,this.lastHueUpdate=0)}},Wh=class{static get isSupported(){return Gi()}initialize(){this.initialized||(this.initialized=!0,this.canvas=document.getElementById(`screen`),this.options={view:this.canvas,autoStart:!1,antialias:!!E.antialiasing&&Wn()<2,resolution:1,backgroundAlpha:0,preserveDrawingBuffer:!1},this.application=new Uu(this.options),this.renderer=this.application.renderer,this.stage=new ql,this.logRendererInfo(),ph.initialize(),this.stage.addChild(ph.container),th.initialize(),this.stage.addChild(th.container),Ym.
1148initialize(),this.stage.addChild(Ym.container),Uh.initialize(),this.stage.addChild(Uh.container),qm.initialize(),this.stage.addChild(qm.glowContainer),this.stage.addChild(qm.container),hh.initialize(),this.stage.addChild(hh.container),fh.initialize(),this.stage.addChild(fh.container),Hh.initialize(),this.stage.addChild(Hh.container),this.stage.addChild(fh.arrowContainer),this.setScreenSize(),window.addEventListener(`resize`,()=>{this.setScreenSize()},{passive:!0}),Gn(()=>this.setScreenSize()))}setScreenSize(){this.initialize();let e=Wn(),t=window.innerWidth*e|0,n=window.innerHeight*e|0;this.renderer.resize(t,n)}run(){if(!this.canvas)return;this.setCamera(),ph.run(),th.run(),Ym.run(),Uh.run(),qm.run(),hh.run(),fh.runLines(),fh.runArrow();let e=Qn.update(this.canvas);Hh.run(e),this.renderer.render(this.stage)}captureFrame(){let e=tc.create({width:this.canvas.width,height:this.canvas.height,resolution:1});try{return this.renderer.render(this.stage,{renderTexture:e,clear:!0}),this.renderer.extract.canvas(e)}finally{e.destroy(!0)}}getPerformanceStats(){let e=Ym.canvas?Ym.canvas.width*Ym.canvas.height*4:0,t=qm.glow?qm.glow.width*qm.glow.height*4:0,n=Hh.getPerformanceStats();return{backend:`pixi-webgl`,canvasBytesEstimate:this.canvas?this.canvas.width*this.canvas.height*4:0,stageChildren:this.stage?.children.length||0,gpuTimerSupported:0,gridTextureBytesEstimate:e,borderTextureBytesEstimate:t,...n,textureBytesEstimate:e+t+n.textureBytesEstimate}}logRendererInfo(){let e=this.renderer.gl,t=e.getExtension(`WEBGL_debug_renderer_info`),n={backend:typeof WebGL2RenderingContext<`u`&&e instanceof WebGL2RenderingContext?`webgl2`:`webgl`,fallback:!1,pixiRendererType:this.renderer.type,version:e.getParameter(e.VERSION),shadingLanguageVersion:e.getParameter(e.SHADING_LANGUAGE_VERSION),vendor:t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),renderer:t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxRenderbufferSize:e.getParameter(e.MAX_RENDERBUFFER_SIZE),maxTextureImageUnits:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),canvas:{width:this.canvas.width,height:this.canvas.height},antialias:this.options.antialias,preserveDrawingBuffer:this.options.preserveDrawingBuffer};window.SenpaRendererInfo=n,console.info(`[SenpaEngine] Renderer: PIXI WebGL`,n)}setCamera(){let e=V.zoom*Wn(),t=this.canvas.width/2-V.x*e,n=this.canvas.height/2-V.y*e;this.stage.setTransform(t,n,e,e)}},Gh=`Senpaio:WebGL`,Kh=`Senpaio:settings`;function qh(){try{return JSON.parse(localStorage.getItem(Gh))===!0}catch{return!1}}function Jh(e){localStorage.setItem(Gh,JSON.stringify(!!e))}function Yh(e){localStorage.removeItem(`Senpaio:CanvasForced`);let t=localStorage.getItem(Gh),n=e&&(t===`true`||t===`false`?JSON.parse(t):!0);Jh(n);let r={};try{r=JSON.parse(localStorage.getItem(Kh))||{}}catch{}return r.useWebGL=n,localStorage.setItem(Kh,JSON.stringify(r)),n}var Xh=Gi(),Zh=new(Yh(Xh)&&Xh?Wh:$n),Qh=1e3,$h=new class{constructor(){this.specMode=1,this.isMacroFeeding=!1,this.macroFeedTab=0,this.isChatInPrivateTeamMode=!1,this.lastChatType=`chatroom`,this.emojiCooldownUntil=0,this.emojiCooldownMs=0,this.emojiSendPendingUntil=0}sendEmoji(e){if(X.isReplay||!B.isAlive||Nt.authToken==null||!Nt.emojiSlots?.[e])return!1;let t=performance.now();return t<this.emojiCooldownUntil||t<this.emojiSendPendingUntil?!0:(this.emojiSendPendingUntil=t+Qh,Ly.emoji(e),!0)}onEmojiConfirmed(e){this.emojiCooldownMs=e,this.emojiCooldownUntil=performance.now()+e,this.emojiSendPendingUntil=0,q.dispatch(A.Emoji_Cooldown,{until:this.emojiCooldownUntil,cooldownMs:e})}resetEmojiCooldown(){this.emojiCooldownUntil=0,this.emojiSendPendingUntil=0,q.dispatch(A.Emoji_Cooldown,{until:0,cooldownMs:this.emojiCooldownMs})}onOwnTabDeath(e){if(!this.isMacroFeeding||e!==this.macroFeedTab)return;let t=Y.myPlayerIDs.length;for(let n=1;n<t;n++){let r=(e+n)%t;if(Y.myCells[r].size>0){this.macroFeedTab=r,Ly.feed(r,!1,1);return}}}toggleSpectateMode(){this.specMode=!(this.specMode-1)+1}replay(){X.isReplay||ue.save(Zh)&&q.showNotification({nick:`CLIENT`,message:`Replay saved!`,type:1,room:Number(this.isChatInPrivateTeamMode),time:Date.now()})}feed(){Ly.feed(B.activeTab,!0)}macroFeed(e){e&&!this.isMacroFeeding&&(this.macroFeedTab=B.activeTab),this.isMacroFeeding=e,Ly.feed(this.macroFeedTab,!1,+!!e)}split(){Ly.split(B.activeTab,1)}
1148doubleSplit(){Ly.split(B.activeTab,2)}tripleSplit(){Ly.split(B.activeTab,3)}split16(){Ly.split(B.activeTab,4)}split32(){Ly.split(B.activeTab,5)}split64(){Ly.split(B.activeTab,6)}togglePlayer(){if(X.isReplay)return;let e=this.isMacroFeeding&&E.feedFollowsTab;e&&this.macroFeed(!1);let t=Y.myPlayerIDs.length,n=(B.activeTab+1)%t;B.activeTab=n,Y.myCells[n].size<1&&Ly.spawn(n),e&&this.macroFeed(!0),M.notifyTabs()}sendMouse(){if(B.isStopped||!X.connected||!Ly.handshakeDone)return;let e=Wn(),t=V.zoom*e,n=V.x+(Be.mouse.x*e-(Zh.canvas.width>>1))/t,r=V.y+(Be.mouse.y*e-(Zh.canvas.height>>1))/t;Ly.cursor(n,r,B.activeTab)}command(e){Ly.chat(2,e)}zoom(e){V.targetZoom=e}toggleNick(){let e=B.isAlive?E.ownCellNick:E.cellNick;E.ownCellNick=!e,E.cellNick=!e}toggleMass(){let e=B.isAlive?E.ownCellMass:E.cellMass;E.ownCellMass=!e,E.cellMass=!e}toggleSectors(){E.mapSectors=!E.mapSectors}toggleHUDs(){E.hideHUD=!E.hideHUD,ae.showHUD(!E.hideHUD)}toggleSkin(){E.cellSkin=!E.cellSkin}toggleEnemySkin(){E.enemyCellSkin=!E.enemyCellSkin}toggleChatMessages(){E.chatType===`off`?E.chatType=this.lastChatType:(this.lastChatType=E.chatType,E.chatType=`off`)}toggleChatMode(){q.dispatch(A.Chat_ToggleMode)}stop(){B.isStopped?B.isStopped=!1:B.isStopped=!0}},q=new class{constructor(){this.listeners={},this.register(A.Player_Died,()=>{ae.isOpen=!0}),this.register(A.Request_Connect,e=>{j.log(`connecting to `+e),X.connect(e)}),this.register(A.Assign_PlayerInfo,({nick:e,tag:t,code:n,skin1:r,skin2:i,hat1:a=0,hat2:o=0})=>{B.nick=e,B.teamTag=t,B.teamCode=n,B.skin1=r,B.skin2=i,B.hat1=a|0,B.hat2=o|0}),this.register(A.Request_Play,()=>{ae.onPlay(),!B.isAlive&&Ly.spawn()}),this.register(A.Request_Spectate,()=>{ae.onSpectate(),B.isAlive||(B.isSpectating=!0)}),this.register(A.Request_Continue,()=>{ae.onContinue()}),this.register(A.Chat_Mode_Toggled,e=>{$h.isChatInPrivateTeamMode=e===1}),this.register(A.ClanWars_RequestUpdate,()=>{ne.update()}),this.register(A.ClanWars_UpdatePlayer,(e,t)=>{ne.updatePlayer(e,t)}),this.register(A.Send_Chat,e=>{Ly.chat(1,e)}),this.register(A.Send_Nick,e=>{B.nick=e,Ly.nick()}),this.register(A.Send_Tag,e=>{B.teamTag=e,Ly.tag(),this.dispatch(A.Player_Tag,B.teamTag)}),this.register(A.Input_Move,(e,t)=>{M.setDirection(e,t)}),this.register(A.Input_Release,e=>{M.release(e)}),this.register(A.Input_Split,e=>{Ly.split(B.activeTab,e)}),this.register(A.Input_Feed,({single:e,state:t})=>{e?$h.feed():$h.macroFeed(t===1)}),this.register(A.Input_ToggleTab,()=>{$h.togglePlayer()}),this.register(A.OwnTab_Died,e=>{$h.onOwnTabDeath(e)}),this.register(A.Input_Zoom,e=>{V.setZoom(V.targetZoom*e)}),this.register(A.Input_Stop,()=>{$h.stop()}),this.register(A.Input_Emoji,e=>{$h.sendEmoji(e)}),this.register(A.Socket_Cleanup,()=>{$h.resetEmojiCooldown()}),this.register(A.Request_Menu,()=>{ae.show()})}showNotification(e){this.dispatch(A.Notify_ShowNotification,e)}dispatch(e,...t){let n=this.listeners[e];if(n)for(let r of[...n])try{r(...t)}catch(t){console.error(`[Dispatcher] Handler for ${e} failed:`,t)}}register(e,t){this.listeners[e]===void 0&&(this.listeners[e]=[]),this.listeners[e].push(t);let n=!1;return()=>{if(n)return;n=!0;let r=this.listeners[e],i=r.indexOf(t);i!==-1&&r.splice(i,1)}}},eg=new class{constructor(){this.leaderboardTitle=`SENPA.IO`,this.trainingMode=!0,this.trainingModeTag=`TR`,this.defaultCellName=`Unnamed cell`,this.adDelayDeathPenalty=0,this.adDelayGameStart=0,this.adDelayMainPanelOpened=0,this.adRefreshCooldown=0}onChange(){q.dispatch(A.LeaderBoard_TitleChanged,this.leaderboardTitle)}},tg=class{constructor(e=-1,t=0,n=0,r=0,i=0){this.id=e,this.parentPlayerID=-1,this.parentPlayer=new O,this.type=i,this.isOwn=-1,this.startX=t,this.x=t,this.endX=t,this.startY=n,this.y=n,this.endY=n,this.startRadius=r,this.radius=r,this.endRadius=r,this._color=k.randomColor(),this._tint=k.toNumber(this._color),this.updateTime=0,this.removed=!1,this.dt=1,this.animating=!1,this.radiusAnimating=!1}animate(e=performance.now()){if(!this.animating)return!1;let t=this.radiusAnimating,n=E.cellAnimation,r=n>0?(e-this.updateTime)/n:1;return r=r>1?1:r<0?0:r,this.x=this.startX+(this.endX-this.startX)*r,this.y=this.startY+(this.endY-this.startY)*r,this.radius=this.startRadius+(this.endRadius-this.startRadius)*r,this.dt=r,r===1&&(this.animating=!1,this.radiusAnimating=!1),t}update(e,t,n,r=performance.now()){this.animate(r),this.startX=this.x,this.startY=this.y,this.startRadius=this.radius,this.endX=e,this.endY=t,this.endRadius=n,this.updateTime=r,this.radiusAnimating=this.startRadius!==n,this.animating=this.startX!==e||this.startY!==t||this.radiusAnimating,this.dt=+!this.animating}set color(e){this._color=e,this._tint=k.toNumber(e)}get color(){return this._color}get tint(){return this._tint}get isTR(){return eg.trainingMode&&this.parentPlayer.parentClient.tag===eg.trainingModeTag}get nick(){return this.parentPlayer.parentClient.nick}get skin(){return this.parentPlayer.skinURL}get hat(){return this.parentPlayer.hatId}get mass(){return this.endRadius*this.endRadius/100|0}get shortMass(){let e=~~this.mass;return e<1e3?e:`${(0|e/100)/10}k`}get isBot(){return this.parentPlayer.parentClient.isBot}get isPlayerCell(){return this.type===0}get isVirus(){return this.type===1}get isEject(){return this.type===2}get isFood(){return this.type===3}get clientLoaded(){return this.parentPlayer.parentClientID!==-1}},J=J===void 0?{}:J;J.locateFile=function(e){return`/web/`+e};var ng={},rg;for(rg in J)J.hasOwnProperty(rg)&&(ng[rg]=J[rg]);var ig=[],ag=function(e,t){throw t},og=typeof window==`object`,sg=typeof importScripts==`function`,cg=``;function lg(e){return J.locateFile?J.locateFile(e,cg):cg+e}var ug,dg;(og||sg)&&(sg?cg=self.location.href:typeof document<`u`&&document.currentScript&&(cg=document.currentScript.src),cg=cg.indexOf(`blob:`)===0?``:cg.substr(0,cg.lastIndexOf(`/`)+1),sg&&(dg=function(e){var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),ug=function(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=function(){if(r.status==200||r.status==0&&r.response){t(r.response);return}n()},r.onerror=n,r.send(null)}),J.print||console.log.bind(console);var fg=J.printErr||console.warn.bind(console);for(rg in ng)ng.hasOwnProperty(rg)&&(J[rg]=ng[rg]);ng=null,J.arguments&&(ig=J.arguments),J.thisProgram&&J.thisProgram,J.quit&&(ag=J.quit);var pg;J.wasmBinary&&(pg=J.wasmBinary);var mg=J.noExitRuntime||!0;typeof WebAssembly!=`object`&&o_(`no native wasm support detected`);
1148var hg,gg=!1,_g,vg=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function yg(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&vg)return vg.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128)){a+=String.fromCharCode(o);continue}var s=e[t++]&63;if((o&224)==192){a+=String.fromCharCode((o&31)<<6|s);continue}var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return a}function bg(e,t){return e?yg(Ng,e,t):``}function xg(e,t,n,r){if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343){var c=e.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63}}return t[n]=0,n-i}function Sg(e,t,n){return xg(e,Ng,t,n)}function Cg(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((r&1023)<<10)|e.charCodeAt(++n)&1023),r<=127?++t:r<=2047?t+=2:r<=65535?t+=3:t+=4}return t}var wg=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0;function Tg(e,t){for(var n=e,r=n>>1,i=r+t/2;!(r>=i)&&Fg[r];)++r;if(n=r<<1,n-e>32&&wg)return wg.decode(Ng.subarray(e,n));for(var a=``,o=0;!(o>=t/2);++o){var s=Pg[e+o*2>>1];if(s==0)break;a+=String.fromCharCode(s)}return a}function Eg(e,t,n){if(n===void 0&&(n=2147483647),n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);Pg[t>>1]=o,t+=2}return Pg[t>>1]=0,t-r}function Dg(e){return e.length*2}function Og(e,t){for(var n=0,r=``;!(n>=t/4);){var i=Ig[e+n*4>>2];if(i==0)break;if(++n,i>=65536){var a=i-65536;r+=String.fromCharCode(55296|a>>10,56320|a&1023)}else r+=String.fromCharCode(i)}return r}function kg(e,t,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o>=55296&&o<=57343){var s=e.charCodeAt(++a);o=65536+((o&1023)<<10)|s&1023}if(Ig[t>>2]=o,t+=4,t+4>i)break}return Ig[t>>2]=0,t-r}function Ag(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t}var jg,Mg,Ng,Pg,Fg,Ig,Lg,Rg,zg;function Bg(e){jg=e,J.HEAP8=Mg=new Int8Array(e),J.HEAP16=Pg=new Int16Array(e),J.HEAP32=Ig=new Int32Array(e),J.HEAPU8=Ng=new Uint8Array(e),J.HEAPU16=Fg=new Uint16Array(e),J.HEAPU32=Lg=new Uint32Array(e),J.HEAPF32=Rg=new Float32Array(e),J.HEAPF64=zg=new Float64Array(e)}J.INITIAL_MEMORY;var Vg,Hg=[],Ug=[],Wg=[],Gg=[],Kg=0;function qg(){return mg||Kg>0}function Jg(){if(J.preRun)for(typeof J.preRun==`function`&&(J.preRun=[J.preRun]);J.preRun.length;)Qg(J.preRun.shift());m_(Hg)}function Yg(){m_(Ug)}function Xg(){m_(Wg)}function Zg(){if(J.postRun)for(typeof J.postRun==`function`&&(J.postRun=[J.postRun]);J.postRun.length;)e_(J.postRun.shift());m_(Gg)}function Qg(e){Hg.unshift(e)}function $g(e){Ug.unshift(e)}function e_(e){Gg.unshift(e)}var t_=0,n_=null,r_=null;function i_(e){t_++,J.monitorRunDependencies&&J.monitorRunDependencies(t_)}function a_(e){if(t_--,J.monitorRunDependencies&&J.monitorRunDependencies(t_),t_==0&&(n_!==null&&(clearInterval(n_),n_=null),r_)){var t=r_;r_=null,t()}}J.preloadedImages={},J.preloadedAudios={};function o_(e){throw J.onAbort&&J.onAbort(e),e+=``,fg(e),gg=!0,_g=1,e=`abort(`+e+`). Build with -s ASSERTIONS=1 for more info.`,new WebAssembly.RuntimeError(e)}var s_=`data:application/octet-stream;base64,`;function c_(e){return e.startsWith(s_)}function l_(e){return e.startsWith(`file://`)}var u_=`bundle.wasm`;c_(u_)||(u_=lg(u_));function d_(e){try{if(e==u_&&pg)return new Uint8Array(pg);if(dg)return dg(e);throw`both async and sync fetching of the wasm failed`}catch(e){o_(e)}}function f_(){if(!pg&&(og||sg)){if(typeof fetch==`function`&&!l_(u_))return fetch(u_,{credentials:`same-origin`}).then(function(e){if(!e.ok)throw`failed to load wasm binary file at '`+u_+`'`;return e.arrayBuffer()}).catch(function(){return d_(u_)});if(ug)return new Promise(function(e,t){ug(u_,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return d_(u_)})}function p_(){var e={a:qv};function t(e,t){J.asm=e.exports,hg=J.asm.F,Bg(hg.buffer),Vg=J.asm.J,$g(J.asm.G),a_(`wasm-instantiate`)}i_(`wasm-instantiate`);function n(e){t(e.instance)}function r(t){return f_().then(function(t){return WebAssembly.instantiate(t,e)}).then(function(e){return e}).then(t,function(e){fg(`failed to asynchronously prepare wasm: `+e),o_(e)})}function i(){return!pg&&typeof WebAssembly.instantiateStreaming==`function`&&!c_(u_)&&!l_(u_)&&typeof fetch==`function`?fetch(u_,{credentials:`same-origin`}).then(function(t){return WebAssembly.instantiateStreaming(t,e).then(n,function(e){return fg(`w
1148asm streaming compile failed: `+e),fg(`falling back to ArrayBuffer instantiation`),r(n)})}):r(n)}if(J.instantiateWasm)try{return J.instantiateWasm(e,t)}catch(e){return fg(`Module.instantiateWasm callback failed with error: `+e),!1}return i(),{}}function m_(e){for(;e.length>0;){var t=e.shift();if(typeof t==`function`){t(J);continue}var n=t.func;typeof n==`number`?t.arg===void 0?Vg.get(n)():Vg.get(n)(t.arg):n(t.arg===void 0?null:t.arg)}}function h_(e){if(e instanceof ty||e==`unwind`)return _g;fg(`exception thrown: `+e),ag(1,e)}function g_(e,t,n,r,i){}function __(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw TypeError(`Unknown type size: `+e)}}function v_(){for(var e=Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);y_=e}var y_=void 0;function b_(e){for(var t=``,n=e;Ng[n];)t+=y_[Ng[n++]];return t}var x_={},S_={},C_={},w_=48,T_=57;function E_(e){if(e===void 0)return`_unknown`;e=e.replace(/[^a-zA-Z0-9_]/g,`$`);var t=e.charCodeAt(0);return t>=w_&&t<=T_?`_`+e:e}function D_(e,t){return e=E_(e),Function(`body`,`return function `+e+`() {
1149    "use strict";    return body.apply(this, arguments);
1150};
1151`)(t)}function O_(e,t){var n=D_(t,function(e){this.name=t,this.message=e;var n=Error(e).stack;n!==void 0&&(this.stack=this.toString()+`
1152`+n.replace(/^Error(:[^\n]*)?\n/,``))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+`: `+this.message},n}var k_=void 0;function A_(e){throw new k_(e)}var j_=void 0;function M_(e){throw new j_(e)}function N_(e,t,n){e.forEach(function(e){C_[e]=t});function r(t){var r=n(t);r.length!==e.length&&M_(`Mismatched type converter count`);for(var i=0;i<e.length;++i)P_(e[i],r[i])}var i=Array(t.length),a=[],o=0;t.forEach(function(e,t){S_.hasOwnProperty(e)?i[t]=S_[e]:(a.push(e),x_.hasOwnProperty(e)||(x_[e]=[]),x_[e].push(function(){i[t]=S_[e],++o,o===a.length&&r(i)}))}),a.length===0&&r(i)}function P_(e,t,n){if(n||={},!(`argPackAdvance`in t))throw TypeError(`registerType registeredInstance requires argPackAdvance`);var r=t.name;if(e||A_(`type "`+r+`" must have a positive integer typeid pointer`),S_.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;A_(`Cannot register type '`+r+`' twice`)}if(S_[e]=t,delete C_[e],x_.hasOwnProperty(e)){var i=x_[e];delete x_[e],i.forEach(function(e){e()})}}function F_(e,t,n,r,i){var a=__(n);t=b_(t),P_(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:i},argPackAdvance:8,readValueFromPointer:function(e){var r;if(n===1)r=Mg;else if(n===2)r=Pg;else if(n===4)r=Ig;else throw TypeError(`Unknown boolean type size: `+t);return this.fromWireType(r[e>>a])},destructorFunction:null})}var I_=[],L_=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function R_(e){e>4&&--L_[e].refcount===0&&(L_[e]=void 0,I_.push(e))}function z_(){for(var e=0,t=5;t<L_.length;++t)L_[t]!==void 0&&++e;return e}function B_(){for(var e=5;e<L_.length;++e)if(L_[e]!==void 0)return L_[e];return null}function V_(){J.count_emval_handles=z_,J.get_first_emval=B_}function H_(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=I_.length?I_.pop():L_.length;return L_[t]={refcount:1,value:e},t}}function U_(e){return this.fromWireType(Lg[e>>2])}function W_(e,t){t=b_(t),P_(e,{name:t,fromWireType:function(e){var t=L_[e].value;return R_(e),t},toWireType:function(e,t){return H_(t)},argPackAdvance:8,readValueFromPointer:U_,destructorFunction:null})}function G_(e){if(e===null)return`null`;var t=typeof e;return t===`object`||t===`array`||t===`function`?e.toString():``+e}function K_(e,t){switch(t){case 2:return function(e){return this.fromWireType(Rg[e>>2])};case 3:return function(e){return this.fromWireType(zg[e>>3])};default:throw TypeError(`Unknown float type: `+e)}}function q_(e,t,n){var r=__(n);t=b_(t),P_(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,t){if(typeof t!=`number`&&typeof t!=`boolean`)throw TypeError(`Cannot convert "`+G_(t)+`" to `+this.name);return t},argPackAdvance:8,readValueFromPointer:K_(t,r),destructorFunction:null})}function J_(e,t){if(!(e instanceof Function))throw TypeError(`new_ called with constructor type `+typeof e+` which is not a function`);var n=D_(e.name||`unknownFunctionName`,function(){});n.prototype=e.prototype;var r=new n,i=e.apply(r,t);return i instanceof Object?i:r}function Y_(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function X_(e,t,n,r,i){var a=t.length;a<2&&A_(`argTypes array size mismatch! Must at least get return value and 'this' types!`);for(var o=t[1]!==null&&n!==null,s=!1,c=1;c<t.length;++c)if(t[c]!==null&&t[c].destructorFunction===void 0){s=!0;break}for(var l=t[0].name!==`void`,u=``,d=``,c=0;c<a-2;++c)u+=(c===0?``:`, `)+`arg`+c,d+=(c===0?``:`, `)+`arg`+c+`Wired`;var f=`return function `+E_(e)+`(`+u+`) {
1153if (arguments.length !== `+(a-2)+`) {
1154throwBindingError('function `+e+` called with ' + arguments.length + ' arguments, expected `+(a-2)+` args!');
1155}
1156`;s&&(f+=`var destructors = [];
1157`);var p=s?`destructors`:`null`,m=[`throwBindingError`,`invoker`,`fn`,`runDestructors`,`retType`,`classParam`],h=[A_,r,i,Y_,t[0],t[1]];o&&(f+=`var thisWired = classParam.toWireType(`+p+`, this);
1158`);for(var c=0;c<a-2;++c)f+=`var arg`+c+`Wired = argType`+c+`.toWireType(`+p+`, arg`+c+`); // `+t[c+2].name+`
1159`,m.push(`argType`+c),h.push(t[c+2]);if(o&&(d=`thisWired`+(d.length>0?`, `:``)+d),f+=(l?`var rv = `:``)+`invoker(fn`+(d.length>0?`, `:``)+d+`);
1160`,s)f+=`runDestructors(destructors);
1161`;else for(var c=o?1:2;c<t.length;++c){var g=c===1?`thisWired`:`arg`+(c-2)+`Wired`;t[c].destructorFunction!==null&&(f+=g+`_dtor(`+g+`); // `+t[c].name+`
1162`,m.push(g+`_dtor`),h.push(t[c].destructorFunction))}return l&&(f+=`var ret = retType.fromWireType(rv);
1163return ret;
1164`),f+=`}
1165`,m.push(f),J_(Function,m).apply(null,h)}function Z_(e,t,n){if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||A_(`Function '`+n+`' called with an invali
1165d number of arguments (`+arguments.length+`) - expects one of (`+e[t].overloadTable+`)!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}}function Q_(e,t,n){J.hasOwnProperty(e)?((n===void 0||J[e].overloadTable!==void 0&&J[e].overloadTable[n]!==void 0)&&A_(`Cannot register public name '`+e+`' twice`),Z_(J,e,e),J.hasOwnProperty(n)&&A_(`Cannot register multiple overloads of a function with the same number of arguments (`+n+`)!`),J[e].overloadTable[n]=t):(J[e]=t,n!==void 0&&(J[e].numArguments=n))}function $_(e,t){for(var n=[],r=0;r<e;r++)n.push(Ig[(t>>2)+r]);return n}function ev(e,t,n){J.hasOwnProperty(e)||M_(`Replacing nonexistant public symbol`),J[e].overloadTable!==void 0&&n!==void 0?J[e].overloadTable[n]=t:(J[e]=t,J[e].argCount=n)}function tv(e,t,n){var r=J[`dynCall_`+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}function nv(e,t,n){return e.includes(`j`)?tv(e,t,n):Vg.get(t).apply(null,n)}function rv(e,t){var n=[];return function(){n.length=arguments.length;for(var r=0;r<arguments.length;r++)n[r]=arguments[r];return nv(e,t,n)}}function iv(e,t){e=b_(e);function n(){return e.includes(`j`)?rv(e,t):Vg.get(t)}var r=n();return typeof r!=`function`&&A_(`unknown function pointer with signature `+e+`: `+t),r}var av=void 0;function ov(e){var t=Zv(e),n=b_(t);return $v(t),n}function sv(e,t){var n=[],r={};function i(e){if(!r[e]&&!S_[e]){if(C_[e]){C_[e].forEach(i);return}n.push(e),r[e]=!0}}throw t.forEach(i),new av(e+`: `+n.map(ov).join([`, `]))}function cv(e,t,n,r,i,a){var o=$_(t,n);e=b_(e),i=iv(r,i),Q_(e,function(){sv(`Cannot call `+e+` due to unbound types`,o)},t-1),N_([],o,function(n){var r=[n[0],null].concat(n.slice(1));return ev(e,X_(e,r,null,i,a),t-1),[]})}function lv(e,t,n){switch(t){case 0:return n?function(e){return Mg[e]}:function(e){return Ng[e]};case 1:return n?function(e){return Pg[e>>1]}:function(e){return Fg[e>>1]};case 2:return n?function(e){return Ig[e>>2]}:function(e){return Lg[e>>2]};default:throw TypeError(`Unknown integer type: `+e)}}function uv(e,t,n,r,i){t=b_(t),i===-1&&(i=4294967295);var a=__(n),o=function(e){return e};if(r===0){var s=32-8*n;o=function(e){return e<<s>>>s}}var c=t.includes(`unsigned`);P_(e,{name:t,fromWireType:o,toWireType:function(e,n){if(typeof n!=`number`&&typeof n!=`boolean`)throw TypeError(`Cannot convert "`+G_(n)+`" to `+this.name);if(n<r||n>i)throw TypeError(`Passing a number "`+G_(n)+`" from JS side to C/C++ side to an argument of type "`+t+`", which is outside the valid range [`+r+`, `+i+`]!`);return c?n>>>0:n|0},argPackAdvance:8,readValueFromPointer:lv(t,a,r!==0),destructorFunction:null})}function dv(e,t,n){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){e>>=2;var t=Lg,n=t[e],i=t[e+1];return new r(jg,i,n)}n=b_(n),P_(e,{name:n,fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})}function fv(e,t){t=b_(t);var n=t===`std::string`;P_(e,{name:t,fromWireType:function(e){var t=Lg[e>>2],r;if(n)for(var i=e+4,a=0;a<=t;++a){var o=e+4+a;if(a==t||Ng[o]==0){var s=o-i,c=bg(i,s);r===void 0?r=c:(r+=`\0`,r+=c),i=o+1}}else{for(var l=Array(t),a=0;a<t;++a)l[a]=String.fromCharCode(Ng[e+4+a]);r=l.join(``)}return $v(e),r},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;i||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||A_(`Cannot pass non-string to std::string`),r=n&&i?function(){return Cg(t)}:function(){return t.length};var a=r(),o=Yv(4+a+1);if(Lg[o>>2]=a,n&&i)Sg(t,o+4,a+1);else if(i)for(var s=0;s<a;++s){var c=t.charCodeAt(s);c>255&&($v(o),A_(`String has UTF-16 code units that do not fit in 8 bits`)),Ng[o+4+s]=c}else for(var s=0;s<a;++s)Ng[o+4+s]=t[s];return e!==null&&e.push($v,o),o},argPackAdvance:8,readValueFromPointer:U_,destructorFunction:function(e){$v(e)}})}function pv(e,t,n){n=b_(n);var r,i,a,o,s;t===2?(r=Tg,i=Eg,o=Dg,a=function(){return Fg},s=1):t===4&&(r=Og,i=kg,o=Ag,a=function(){return Lg},s=2),P_(e,{name:n,fromWireType:function(e){for(var n=Lg[e>>2],i=a(),o,c=e+4,l=0;l<=n;++l){var u=e+4+l*t;if(l==n||i[u>>
1165s]==0){var d=u-c,f=r(c,d);o===void 0?o=f:(o+=`\0`,o+=f),c=u+t}}return $v(e),o},toWireType:function(e,r){typeof r!=`string`&&A_(`Cannot pass non-string to C++ string type `+n);var a=o(r),c=Yv(4+a+t);return Lg[c>>2]=a>>s,i(r,c+4,a+t),e!==null&&e.push($v,c),c},argPackAdvance:8,readValueFromPointer:U_,destructorFunction:function(e){$v(e)}})}function mv(e,t){t=b_(t),P_(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})}function hv(e){return e||A_(`Cannot use deleted val. handle = `+e),L_[e].value}function gv(e,t){var n=S_[e];return n===void 0&&A_(t+` has unknown type `+ov(e)),n}function _v(e,t,n){e=hv(e),t=gv(t,`emval::as`);var r=[],i=H_(r);return Ig[n>>2]=i,t.toWireType(r,e)}function vv(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=gv(Ig[(t>>2)+r],`parameter `+r);return n}function yv(e,t,n,r){e=hv(e);for(var i=vv(t,n),a=Array(t),o=0;o<t;++o){var s=i[o];a[o]=s.readValueFromPointer(r),r+=s.argPackAdvance}return H_(e.apply(void 0,a))}function bv(e){var t=[];return Ig[e>>2]=H_(t),t}var xv={};function Sv(e){var t=xv[e];return t===void 0?b_(e):t}var Cv=[];function wv(e,t,n,r,i){return e=Cv[e],t=hv(t),n=Sv(n),e(t,n,bv(r),i)}function Tv(e,t,n,r){e=Cv[e],t=hv(t),n=Sv(n),e(t,n,null,r)}function Ev(){return typeof globalThis==`object`?globalThis:(function(){return Function})()(`return this`)()}function Dv(e){return e===0?H_(Ev()):(e=Sv(e),H_(Ev()[e]))}function Ov(e){var t=Cv.length;return Cv.push(e),t}function kv(e,t){for(var n=vv(e,t),r=n[0],i=r.name+`_$`+n.slice(1).map(function(e){return e.name}).join(`_`)+`$`,a=[`retType`],o=[r],s=``,c=0;c<e-1;++c)s+=(c===0?``:`, `)+`arg`+c,a.push(`argType`+c),o.push(n[1+c]);for(var l=`return function `+E_(`methodCaller_`+i)+`(handle, name, destructors, args) {
1166`,u=0,c=0;c<e-1;++c)l+=`    var arg`+c+` = argType`+c+`.readValueFromPointer(args`+(u?`+`+u:``)+`);
1167`,u+=n[c+1].argPackAdvance;l+=`    var rv = handle[name](`+s+`);
1168`;for(var c=0;c<e-1;++c)n[c+1].deleteObject&&(l+=`    argType`+c+`.deleteObject(arg`+c+`);
1169`);return r.isVoid||(l+=`    return retType.toWireType(destructors, rv);
1170`),l+=`};
1171`,a.push(l),Ov(J_(Function,a).apply(null,o))}function Av(e){return e=Sv(e),H_(J[e])}function jv(e,t){return e=hv(e),t=hv(t),H_(e[t])}function Mv(e){e>4&&(L_[e].refcount+=1)}function Nv(e,t){return e=hv(e),t=hv(t),e instanceof t}function Pv(e){for(var t=``,n=0;n<e;++n)t+=(n===0?``:`, `)+`arg`+n;for(var r=`return function emval_allocator_`+e+`(constructor, argTypes, args) {
1172`,n=0;n<e;++n)r+=`var argType`+n+` = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + `+n+`], "parameter `+n+`");
1173var arg`+n+` = argType`+n+`.readValueFromPointer(args);
1174args += argType`+n+`['argPackAdvance'];
1175`;return r+=`var obj = new constructor(`+t+`);
1176return __emval_register(obj);
1177}
1178`,Function(`requireRegisteredType`,`Module`,`__emval_register`,r)(gv,J,H_)}var Fv={};function Iv(e,t,n,r){e=hv(e);var i=Fv[t];return i||(i=Pv(t),Fv[t]=i),i(e,n,r)}function Lv(){return H_([])}function Rv(e){return H_(Sv(e))}function zv(){return H_({})}function Bv(e){var t=L_[e].value;Y_(t),R_(e)}function Vv(e,t,n){e=hv(e),t=hv(t),n=hv(n),e[t]=n}function Hv(e,t){return e=gv(e,`_emval_take_value`),H_(e.readValueFromPointer(t))}function Uv(e){return e=hv(e),H_(typeof e)}function Wv(){o_()}function Gv(e){o_(`OOM`)}function Kv(e){Ng.length,e>>>=0,Gv(e)}v_(),k_=J.BindingError=O_(Error,`BindingError`),j_=J.InternalError=O_(Error,`InternalError`),V_(),av=J.UnboundTypeError=O_(Error,`UnboundTypeError`);var qv={t:g_,w:F_,v:W_,o:q_,l:cv,d:uv,c:dv,p:fv,j:pv,x:mv,g:_v,D:yv,b:wv,f:Tv,m:R_,y:Dv,a:kv,r:Av,i:jv,h:Mv,q:Nv,s:Iv,C:Lv,z:Rv,E:zv,A:Bv,e:Vv,k:Hv,B:Uv,n:Wv,u:Kv};p_();var Jv=J.___wasm_call_ctors=function(){return(Jv=J.___wasm_call_ctors=J.asm.G).apply(null,arguments)},Yv=J._malloc=function(){return(Yv=J._malloc=J.asm.H).apply(null,arguments)},Xv=J._main=function(){return(Xv=J._main=J.asm.I).apply(null,arguments)},Zv=J.___getTypeName=function(){return(Zv=J.___getTypeName=J.asm.K).apply(null,arguments)},Qv=J.___embind_register_native_and_builtin_types=function(){return(Qv=J.___embind_register_native_and_builtin_types=J.asm.L).apply(null,arguments)},$v=J._free=function(){return($v=J._free=J.asm.M).apply(null,arguments)},ey;function ty(e){this.name=`ExitStatus`,this.message=`Program terminated with exit(`+e+`)`,this.status=e}r_=function e(){ey||ry(),ey||(r_=e)};function ny(e){var t=J._main,n=0,r=0;try{var i=t(n,r);return iy(i,!0),i}catch(e){return h_(e)}}function ry(e){if(e||=ig,t_>0||(Jg(),t_>0))return;function t(){ey||(ey=!0,J.calledRun=!0,!gg&&(Yg(),Xg(),J.onRuntimeInitialized&&J.onRuntimeInitialized(),oy&&ny(e),Zg()))}J.setStatus?(J.setStatus(`Running...`),setTimeout(function(){setTimeout(function(){J.setStatus(``)},1),t()},1)):t()}J.run=ry;function iy(e,t){_g=e,ay(e)}function ay(e){_g=e,qg()||(J.onExit&&J.onExit(e),gg=!0),ag(e,new ty(e))}if(J.preInit)for(typeof J.preInit==`function`&&(J.preInit=[J.preInit]);J.preInit.length>0;)J.preInit.pop()();var oy=!0;
1178J.noInitialRun&&(oy=!1),ry();var sy=class{constructor(e,t,n,r){this.id=e,this.startX=t,this.x=t,this.endX=t,this.startY=n,this.y=n,this.endY=n,this.startRadius=r,this.radius=r,this.endRadius=r,this.updateTime=0,this.dt=1,this.animating=!1}animate(e=performance.now()){if(!this.animating)return;let t=(e-this.updateTime)/3e3;t=t>1?1:t<0?0:t,this.x=this.startX+(this.endX-this.startX)*t,this.y=this.startY+(this.endY-this.startY)*t,this.radius=this.startRadius+(this.endRadius-this.startRadius)*t,this.dt=t,t===1&&(this.animating=!1)}update(e,t,n,r=performance.now()){this.animate(r),this.startX=this.x,this.startY=this.y,this.startRadius=this.radius,this.endX=e,this.endY=t,this.endRadius=n,this.updateTime=r,this.animating=this.startX!==e||this.startY!==t||this.startRadius!==n,this.dt=+!this.animating}},Y=new class{constructor(){this.clientsList=new Map,this.playersList=new Map,this.myClientID=-1,this.myPlayerIDs=[],this.myCells=[],this.cells=new Map,this.minimapPlayers=new Map,this.sortedCells=[],this.sortedCellsDirty=!1,this.lastTeamlistDispatch=0,this.teamlistDispatchInterval=1e3}getNewMinimapPlayer(e,t,n,r){let i=new sy(e,t,n,r);return this.minimapPlayers.set(e,i),i}updateMinimapPlayer(e,t,n,r,i=performance.now()){(this.minimapPlayers.get(e)||this.getNewMinimapPlayer(e,t,n,r)).update(t,n,r,i)}removeMinimapPlayer(e){this.minimapPlayers.delete(e)}newCell(e,t,n,r,i){if(X.isReplay&&this.cells.has(e))return this.cells.get(e);let a=new tg(e,t,n,r,i);return this.cells.set(e,a),this.sortedCellsDirty=!0,a}getCell(e){return this.cells.get(e)}eatCell(e,t,n=performance.now()){let r=this.cells.get(e),i=this.cells.get(t);if(i){if(!E.eatAnimation){i.removed=!0,i.renderer&&i.renderer.onRemove(),this.cells.delete(t),this.sortedCellsDirty=!0,i.isOwn>=0&&(this.onOwnCellDeath(i),B.myCellCount===0&&B.onDeath());return}if(!r)return void this.removeCell(t);i.update(r.x,r.y,i.radius,n),i.removed=!0,this.cells.delete(t),i.isOwn>=0&&(this.onOwnCellDeath(i),B.myCellCount===0&&B.onDeath()),this.cells.set(`${t}:removed`,i),this.sortedCellsDirty=!0}}removeCell(e){let t=this.cells.get(e);t&&(t.removed=!0,t.renderer&&t.renderer.onRemove(),this.cells.delete(e),this.sortedCellsDirty=!0,t.isOwn>=0&&(this.onOwnCellDeath(t),B.myCellCount===0&&B.onDeath()))}onOwnCellDeath(e){let t=this.myCells[e.isOwn];if(t.delete(e.id),e.isOwn===B.activeTab&&t.size===0&&E.autoSwitchCells){let t=(e.isOwn+1)%this.myPlayerIDs.length,n=0;for(;(t!==e.isOwn||n===this.myPlayerIDs.length)&&!(this.myCells[t].size>0);)t=(t+1)%this.myPlayerIDs.length,n++;B.activeTab=t}t.size===0&&q.dispatch(A.OwnTab_Died,e.isOwn)}ownCellCheck(e){let t=this.myPlayerIDs.indexOf(e.parentPlayerID);if(t<0)return;e.isOwn=t;let n=B.myCellCount;this.myCells[t].set(e.id,e),n===0&&B.onSpawn()}getLocation(e,t){let n=T.right-T.left,r=t/(n/5)|0,i=e/(n/5)|0;return r=r<0?0:r>=5?4:r,i=i<0?0:i>=5?4:i,String.fromCharCode(r+65)+(i+1)}updateTeamlist(){let e=new Map;for(let t of this.minimapPlayers.values()){let n=this.playersList.get(t.id);if(!n||n.parentClient.isBot)continue;let r=n.parentClient,i=e.get(r.id);i||(i={nick:r.nick,playerAmount:0,x:0,y:0,mass:0},e.set(r.id,i)),i.playerAmount++,i.x+=t.x,i.y+=t.y,i.mass+=t.radius*t.radius/100|0}let t=[];for(let n of e.values()){let e=n.x/n.playerAmount,r=n.y/n.playerAmount;t.push({nick:n.nick,location:this.getLocation(e,r),mass:n.mass>999?`${(n.mass/100|0)/10}k`:n.mass,massInt:n.mass})}t.sort((e,t)=>t.massInt-e.massInt),t.length>5&&(t.length=5),q.dispatch(A.Teamlist_Update,t)}update(e=performance.now()){e-this.lastTeamlistDispatch>=this.teamlistDispatchInterval&&(this.updateTeamlist(),this.lastTeamlistDispatch=e);for(let e of this.playersList.values())if(e.parentClientID!==e.parentClient.id){let t=this.clientsList.get(e.parentClientID);t!==void 0&&(e.parentClient=t)}let t=this.sortedCellsDirty||this.sortedCells.length!==this.cells.size,n=!1;for(let[r,i]of this.cells){if(i.parentPlayerID!==i.parentPlayer.id){let e=this.playersList.get(i.parentPlayerID);e!==void 0&&(i.parentPlayer=e)}if(i.removed&&i.dt===1){this.cells.delete(r),t=!0,i.renderer&&i.renderer.onRemove();continue}if(i.animate(e)&&(n=!0),i.id===5024){let e=i.lol.render;i.lol.render=null,i.lol=null,X.connected&&J._alloc(8,e),i.renderer&&i.renderer.onRemove(),this.cells.delete(i.id),t=!0}}if(t){this.sortedCells.length=0;for(let e of this.cells.values())this.sortedCells.push(e);
1178this.sortedCellsDirty=!1}(t||n)&&this.sortedCells.sort(this.sort)}getPerformanceStats(){return{cells:this.cells.size,sortedCells:this.sortedCells.length,clients:this.clientsList.size,players:this.playersList.size,minimapPlayers:this.minimapPlayers.size}}sort(e,t){return e.radius-t.radius}},cy=new class{handle(e){let t=e.readUInt32();T.update(0,0,t,t),Y.myClientID=e.readUInt16(),Y.myPlayerIDs=[],Y.myCells=[];let n=e.readUInt8();for(let t=0;t<n;t++){let t=e.readUInt16(),n=new Map;Y.myPlayerIDs.push(t),Y.myCells.push(n)}M.notifyTabs(),Ly.playerInfo()}},ly=new class{constructor(){this.lastDispatch=0,this.dispatchInterval=1e3}handle(e){let t=[],n=e.readUInt8();for(let r=0;r<n;r++){let n=e.readUInt16(),r=Y.clientsList.get(n)||new D,i=r.nick||eg.defaultCellName,a=r.teamColor,o=e.readUInt32();t.push({nick:i,mass:o,color:a})}let r=performance.now();r-this.lastDispatch>=this.dispatchInterval&&(q.dispatch(A.LeaderBoard_Update,t),this.lastDispatch=r)}},uy=new class{handle(e){let t=performance.now(),n=e.readUInt8();for(let r=0;r<n;r++){let n=e.readUInt16(),r=e.readInt32(),i=e.readInt32(),a=e.readUInt16();Y.updateMinimapPlayer(n,r,i,a,t)}}},dy=new class{handle(e){V.spectatePoint.x=e.readInt32(),V.spectatePoint.y=e.readInt32()}},fy=new class{handle(){X.latency=performance.now()-X.pingTime|0}},py=new class{handle(e){let t=e.readUInt16(),n=Y.clientsList.get(t)||new D,r=e.readUInt8(),i=e.readUInt8(),a=e.readString16(),o=n.nick||eg.defaultCellName,s=n.teamColor,c=n.hasReservedName;q.showNotification({nick:o,message:a,type:r,room:i,tag:``,color:s,hasReservedName:c,time:Date.now()})}},my=new class{handle(e){let t=e.readUInt8(),n=e.readLongString16();switch(t){case 0:q.dispatch(A.Server_Message_Update,n);break;case 1:q.showNotification({nick:`SERVER`,message:n,type:1,room:Number($h.isChatInPrivateTeamMode),time:Date.now()});break;case 2:{let e=n.split(`|`);q.showNotification({nick:`SERVER`,message:e[1],type:1,room:Number($h.isChatInPrivateTeamMode),time:Date.now()}),q.dispatch(A.Update_Nickname,e[0]);break}}}},hy=new class{handle(e){let t=e.readUInt8(),n=e.readUInt8(),r=e.readUInt8(),i=e.readUInt8(),a=n-t,o=`FPS: ${e.readUInt8()}`,s=`Average load: ${e.readUInt8()}%`,c=`Worst load: ${e.readUInt8()}%`,l=`Memory: ${e.readUInt16()}MB`;q.dispatch(A.ServerStats_Update,{fps:o,loadAverage:s,loadWorst:c,memory:l}),q.dispatch(A.RoomStats_Update,{playerCount:n,maxPlayerCount:r,alivePlayerCount:t,specPlayerCount:a,botCount:i})}},gy=new class{handle(e){eg.leaderboardTitle=e.readString16(),eg.trainingMode=e.readUInt8()===1,eg.trainingModeTag=e.readString16(),eg.onChange()}},_y=new class{handle(e){let t=e.readUInt32();Nt.addExp(t)}},vy=new class{handle(e){let t=e.readUInt32();T.update(0,0,t,t)}},yy=new class{constructor(){this.refreshInterval=2e3,this.lobbyUrl=``,this.generation=0,this.refetchTimeout=null,this.abortController=null,this.cleanupHandlerRegistered=!1,document.addEventListener(`visibilitychange`,()=>{!document.hidden&&this.lobbyUrl&&this.fetchCustomServers()})}start(e){if(!e)return;this.cleanupHandlerRegistered||(this.cleanupHandlerRegistered=!0,q.register(A.Socket_Cleanup,()=>this.stop())),this.stop(),this.lobbyUrl=e;let t=++this.generation;this.fetchCustomServers(t)}stop(){this.generation+=1,this.refetchTimeout!==null&&(clearTimeout(this.refetchTimeout),this.refetchTimeout=null),this.abortController?.abort(),this.abortController=null,this.lobbyUrl=``}async fetchCustomServers(e=this.generation){if(!this.lobbyUrl||e!==this.generation||document.hidden)return;let t=new AbortController;this.abortController=t;let n=/^(localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/.test(this.lobbyUrl),r=new URLSearchParams;Nt.authToken&&r.set(`jwt`,Nt.authToken);try{let i=await fetch(`${n?`http`:`https`}://${this.lobbyUrl}?${r.toString()}`,{signal:t.signal});if(!i.ok)throw Error(`HTTP ${i.status}`);let a=await i.json();if(!Array.isArray(a))throw Error(`Invalid custom-game list`);e===this.generation&&q.dispatch(A.Custom_Games_List,a)}catch(e){e?.name!==`AbortError`&&console.warn(`Failed to fetch custom-game list`,e)}finally{this.abortController===t&&(this.abortController=null),e===this.generation&&this.lobbyUrl&&(this.refetchTimeout=setTimeout(()=>void this.fetchCustomServers(e),this.refreshInterval))}}},by=new class{handle(e){let t,n=e.readUInt8(),r=Array(n+1);for(r[0]=0,t=0;t<n;t++)r[t+1]=e.readUInt16();let i=e.readUInt8(),a=Array(i+1);for(a[0]=0,t=0;t<i;t++)a[t+1]=e.readUInt16();let o=e.readUInt8(),s=Array(o+1);for(s[0]=0,t=0;t<o;t++)s[t+1]=e.readUInt16();let c=e.readUInt8(),l=Array(c+1);for(l[0]=0,t=0;t<c;t++)l[t+1]=e.readUInt16();let u=e.readUInt8(),d=e.readUInt8(),f=Array(d),p=new Map;for(t=0;t<d;t++){let n=e.readString8();f[t]=n;let r=[];p.set(n,r);for(let t=0;t<u;t++)r[t]=e.readUInt16()}let m=e.readUInt16();q.dispatch(A.Custom_Games,{maxSlots:m,configs:p,mapSizes:r,virusCount:a,botCount:l,startMass:s,modes:f,maxSlots:m}),yy.start(X.url)}},xy=new class{handle(e){let t=e.readUInt16();if(e.bytesLeft<1){console.error(`Custom-game redirect is missing its instance id.`);return}let n=e.readString8();n&&(X.connectCustomGame(X.host+`:`+t,X.lastPassword,n),X.lastPassword=``)}},Sy=new class{handle(e){let t=e.readUInt8();if(e.readUInt8()){let e=ne.get(Y.myClientID);ne.gameStarted=!0,!e||e.team==0?ae.onSpectate():e&&e.team!==0&&ae.onPlay()}else if(t)ne.isHost=!0,ne.show();else{ne.isHost||ne.show();let t=e.readUInt8();for(let n=0;n<t;n++){let t=e.readUInt32(),n=e.readUInt8();ne.updatePlayer(t,n)}}
1178ne.isClanWarsGame=!0,ne.update()}},Cy=new class{handle(e){Ly.handshakeDone=!0,Ly.auth()}},wy=new class{handle(e){let t=e.readUInt32();t/=1e3;let n=Math.floor(t/3600).toString().padStart(2,`0`);t%=3600;let r=Math.floor(t/60).toString().padStart(2,`0`),i=Math.floor(t%60).toString().padStart(2,`0`);q.dispatch(A.Server_Time,`${n}:${r}:${i}`)}},Ty=new class{handle(e){let t=e.readUInt8(),n=e.readUInt8();console.log(`[Captcha] Received captcha request. Logged users only: ${t}, Version: ${n}`),q.dispatch(A.Request_Captcha,{loggedUsersOnly:t,version:n,isTurnstile:!0})}},Ey=new class{handle(e){let t=e.readUInt16(),n=e.readUInt16(),r=e.readUInt16(),i=e.readString8();if(!i)return;let a=Y.clientsList.get(t);if(a){let e=performance.now();a.emojiUrl=i,a.emojiStartedAt=e,a.emojiUntil=e+n}yt.warm(i),t===Y.myClientID&&$h.onEmojiConfirmed(r)}},Dy=new class{constructor(){this.handlers=Array(52),this.handlers[0]=cy.handle.bind(cy),this.handlers[1]=vy.handle,this.handlers[2]=by.handle,this.handlers[3]=xy.handle,this.handlers[4]=Sy.handle,this.handlers[5]=wy.handle,this.handlers[7]=Ty.handle.bind(Ty),this.handlers[8]=Cy.handle.bind(Cy),this.handlers[10]=re.handle.bind(re),this.handlers[11]=te.handle.bind(te),this.handlers[20]=z.handle.bind(z),this.handlers[21]=ly.handle.bind(ly),this.handlers[22]=uy.handle.bind(uy),this.handlers[23]=dy.handle.bind(dy),this.handlers[30]=fy.handle.bind(fy),this.handlers[40]=py.handle.bind(py),this.handlers[41]=my.handle.bind(my),this.handlers[42]=hy.handle.bind(hy),this.handlers[43]=gy.handle.bind(gy),this.handlers[44]=Ey.handle.bind(Ey),this.handlers[51]=_y.handle.bind(_y),this.reader=new w}parse(e){if(!(e instanceof ArrayBuffer)||e.byteLength===0)return;let t=this.reader.reset(e),n=t.readUInt8(),r=this.handlers[n];if(typeof r==`function`)try{r(t),X.isReplay||ue.add(n,e)}catch(e){if(!(e instanceof RangeError))throw e}}},Oy=0,ky=1,Ay=1e3,jy=3e4,My=.2,Ny={4100:{message:`You were kicked from the server.`,alert:!0},4101:{message:`You are banned from this server.`,alert:!0},4102:{message:`You were kicked for being AFK.`,alert:!0},4403:{message:`Server is full. Please switch to another server.`,alert:!1},4404:{message:`VPN/proxy connections are blocked. Disable it and press Play to retry.`,alert:!1},4405:{message:`Too many connections from your IP. Close other game tabs, then press Play.`,alert:!0},4406:{message:`This account is already playing on this server in too many tabs. Close the others, then press Play.`,alert:!0}},Py=4103,Fy=(()=>{try{if(window.self!==window.top)return`iframe:`+((document.referrer?new URL(document.referrer).host:``)||`unknown`);let e=location.host||`unknown`;return e+(location.pathname.startsWith(`/web/mobile`)&&!e.startsWith(`mobile.`)?`/mobile`:``)}catch{return`iframe:unknown`}})(),X=new class{constructor(){this.ws=null,this.url=``,this.host=``,this.lastPassword=``,this.customGameLobby=``,this.customGameId=``,this.pingTime=0,this.latency=0,this.reconnectWait=Ay,this.reconnectTimer=null,this.connectionGeneration=0,this.blockReconnect=!1,this.pendingConnect=null,this.moduleWaitTimer=null,this.passwordProtected=!1,this.onCustomGame=!1,this.isReplay=!1}send(e){let t=this.ws;if(!t||t.readyState!==ky)return!1;try{return t.send(e),!0}catch(e){return j.warn(`[Game server] Failed to send data to ${this.url}: ${e?.message||e}`),!1}}
1178connect(e,t=``){return this.onCustomGame=!1,this.customGameLobby=``,this.customGameId=``,this.openConnection(e,t,``)}connectCustomGame(e,t,n){if(!J.create||!e||!n)return!1;let r=this.onCustomGame?this.customGameLobby:this.url;return r?(this.onCustomGame=!0,this.customGameLobby=r,this.customGameId=n,this.openConnection(e,t,n)):!1}openConnection(e,t=``,n=``){if(!e)return!1;if(!J.create)return this.pendingConnect={url:e,password:t,gameId:n},this.moduleWaitTimer??=setInterval(()=>{if(!J.create)return;clearInterval(this.moduleWaitTimer),this.moduleWaitTimer=null;let e=this.pendingConnect;this.pendingConnect=null,e&&this.openConnection(e.url,e.password,e.gameId)},100),!1;this.pendingConnect=null,this.cleanUp(),this.blockReconnect=!1,this.isReplay=!1,self.game_server=e,this.url=e,this.host=e.replace(/:\d+$/,``),this.lastPassword=t,this.passwordProtected=!!t;let r=/^(localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/.test(e)?`ws`:`wss`,i=++this.connectionGeneration,a=new URLSearchParams;t&&a.set(`password`,t),n&&a.set(`gameId`,n),a.set(`po`,Fy),a.set(`tid`,v());let o=`${r}://${e}?${a.toString()}`,s;try{s=J.create(o,()=>this.onOpen(i),()=>this.onClose(i),e=>this.onMessage(e,i),()=>this.onError(i))}catch{return i===this.connectionGeneration?(this.ws=null,this.passwordProtected=!1,this.onError(i),this.onClose(i),!1):!1}if(i!==this.connectionGeneration)return s&&s.readyState<=ky&&s.close(),!1;if(!s)return this.passwordProtected=!1,this.onError(i),this.onClose(i),!1;if(this.ws=s,`binaryType`in s)try{s.binaryType=`arraybuffer`}catch{j.warn(`[Game server] Could not configure binary messages for ${this.url}.`)}return typeof s.addEventListener==`function`&&s.addEventListener(`close`,e=>this.onCloseEvent(e,i)),!0}onCloseEvent(e,t){if(t!==void 0&&t!==this.connectionGeneration)return;if(e?.code!==void 0&&e.code!==1e3&&console.warn(`[Game server] Connection to ${this.url} closed by ${e.wasClean?`server`:`network`}: code=${e.code}${e.reason?` reason="${e.reason}"`:``}`),e?.code===Py){q.dispatch(A.Server_Message_Update,`Incorrect password!`),window.alert(`Incorrect password!`);return}let n=Ny[e?.code];n&&(this.blockReconnect=!0,this.cancelReconnect(),j.info(`[Game server] Connection refused by the server (code ${e.code}).`),q.dispatch(A.Server_Message_Update,n.message),q.dispatch(A.Socket_Blocked,e.code),n.alert&&window.alert(n.message))}cleanUp(){this.cancelReconnect(),this.connectionGeneration+=1,window.CanvasCaptureMediaStreamTrack&&(window.CanvasCaptureMediaStreamTrack.contextBufferFactory=null);let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{(e.readyState===Oy||e.readyState===ky)&&e.close()}catch{j.warn(`[Game server] Could not close the connection to ${this.url}.`)}}this.isReplay||ue.clear(),Y.clientsList.clear(),Y.playersList.clear(),Y.minimapPlayers.clear(),Y.myClientID=-1,Y.myPlayerIDs=[],Y.myCells=[],Y.cells.forEach(e=>{e.renderer&&e.renderer.onRemove()}),Y.cells.clear(),Y.sortedCells=[],B.isSpectating=!1,q.dispatch(A.Socket_Cleanup),q.dispatch(A.Clear_Notifications),q.dispatch(A.Server_Message_Update,``)}cancelReconnect(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}onOpen(e){e!==void 0&&e!==this.connectionGeneration||(this.cancelReconnect(),this.passwordProtected=!1,this.reconnectWait=Ay,Ly.initialize(),j.info(`[Game server] Connected to ${this.url}`),q.dispatch(A.Custom_Games,null),q.dispatch(A.Socket_Connected,this.url))}onMessage(e,t){t!==void 0&&t!==this.connectionGeneration||Dy.parse(e)}onClose(e){if(e!==void 0&&e!==this.connectionGeneration)return;this.ws=null,this.passwordProtected&&(this.passwordProtected=!1,window.alert(`Incorrect password!`));let t=this.onCustomGame;if(!this.isReplay){if(ae.show(),this.blockReconnect){j.info(`[Game server] Auto-reconnect disabled by a moderation close code.`);return}let n=t?this.customGameLobby:this.url;if(!n||this.reconnectTimer!==null)return;j.info(`[Game server] Connection to ${this.url} closed. Trying to reconnect...`);let r=Math.min(this.reconnectWait,jy),i=Math.random()*r*My,a=Math.min(r+i,jy),o=setTimeout(()=>{this.reconnectTimer===o&&(this.reconnectTimer=null,!(e!==void 0&&e!==this.connectionGeneration)&&(this.isReplay||this.connected||this.ws?.readyState===Oy||(this.reconnectWait=Math.min(r*2,jy),t&&(this.onCustomGame=!1,this.customGameLobby=``,this.customGameId=``),this.connect(n))))},a);this.reconnectTimer=o}}onError(e){e!==void 0&&e!==this.connectionGeneration||j.warn(`[Game server] connection to ${this.url} failed.`)}get connected(){return this.ws?.readyState===ky}},Iy=class{constructor(e=128){let t=new ArrayBuffer(e);this.view=new DataView(t),this.index=0,this.maxIndex=e}writeInt8(e){this.view.setInt8(this.index,e,!0),this.index+=1}writeUInt8(e){this.view.setUint8(this.index,e,!0),this.index+=1}writeInt16(e){this.view.setInt16(this.index,e,!0),this.index+=2}writeUInt16(e){this.view.setUint16(this.index,e,!0),this.index+=2}writeInt32(e){this.view.setInt32(this.index,e,!0),this.index+=4}writeUInt32(e){this.view.setUint32(this.index,e,!0),this.index+=4}writeFloat(e){this.view.setFloat32(this.index,e,!0),this.index+=4}writeDouble(e){this.view.setFloat64(this.index,e,!0),this.index+=8}writeString8(e){this.validateStringLength(e,255,`String8`),this.writeUInt8(e.length);for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);this.writeUInt8(n)}}writeLongString8(e){this.validateStringLength(e,65535,`LongString8`),this.writeUInt16(e.length);for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);this.writeUInt8(n)}}writeString16(e){this.validateStringLength(e,255,`String16`),this.writeUInt8(e.length);for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);this.writeUInt16(n)}}writeLongString16(e){this.validateStringLength(e,65535,`LongString16`),this.writeUInt16(e.length);for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);this.writeUInt16(n)}}encodeString(e){return encodeURI(e)}validateStringLength(e,t,n){if(e.length>t)throw RangeError(`${n} supports at most ${t} code units`)}reset(){this.index=0}get buffer(){let e=this.view.buffer;return this.index===this.maxIndex?e:e.slice(0,this.index)}},Ly=new class{constructor(){this.handshakeDone=!1,this.aliveCursorWriter=new Iy(11),this.spectateCursorWriter=new Iy(10),this.pingPacket=new Uint8Array([30]).buffer,this.fullSyncPacket=new Uint8Array([31]).buffer}initialize(){this.handshakeDone=!1,X.scrambling=!1}auth(){if(!X.connected||!this.handshakeDone)return;let e=Nt.authToken+``,t=new Iy(3+2*e.length);t.writeUInt8(13),t.writeLongString16(e),X.send(t.buffer)}auth2(e){if(!X.connected||!e)return;let t=new Iy(2+e.length);t.writeUInt8(150),t.writeString8(e),X.send(t.buffer)}playerInfo(){this.nick(),this.tag(),this.skin(0),this.skin(1),this.hat(0),this.hat(1)}spawn(e){if(!X.connected||!this.handshakeDone)return;e===void 0&&(e=B.activeTab),this.playerInfo();let t=new Iy(2);t.writeUInt8(0),t.writeUInt8(e),X.send(t.buffer)}captcha(e,t){let n=new Iy(4+t.length);n.writeUInt8(14),n.writeUInt8(e),n.writeLongString8(t),X.send(n.buffer)}nick(){if(!X.connected||!this.handshakeDone||B.isAlive)return;let e=Nt.authToken!=null,t=2+2*B.nick.length;e&&(t+=2+2*Nt.authToken.length);let n=new Iy(t);n.writeUInt8(10),n.writeString16(B.nick),e&&n.writeLongString16(Nt.authToken),X.send(n.buffer)}tag(){if(!X.connected||!this.handshakeDone||B.isAlive)return;let e=new Iy(2+2*B.teamTag.length);e.writeUInt8(11),e.writeString16(B.teamTag),X.send(e.buffer)}cursor(e,t,n){if(!X.connected||!this.handshakeDone)return;let r=B.isAlive;if(!r&&!B.isSpectating)return;n===void 0&&(n=B.activeTab);let i=!r,a=i?this.spectateCursorWriter:this.aliveCursorWriter;a.reset(),a.writeUInt8(20),a.writeUInt8(i?$h.specMode:0),i||a.writeUInt8(n),a.writeInt32(e),a.writeInt32(t),X.send(a.buffer)}customGameInfo(e,t,n,r,i,a,o,s,c,l){if(!X.connected||!this.handshakeDone)return;if(n)return this.deleteCustomGame(e);let u=new Iy(11+2*(e.length+t.length));u.writeUInt8(2),u.writeUInt8(0),u.writeString16(e),u.writeString16(t),u.
1178writeUInt8(+!!r),u.writeUInt8(i),u.writeUInt8(a),u.writeUInt8(o),u.writeUInt8(s),u.writeUInt8(c),u.writeUInt8(l),X.send(u.buffer)}joinCustomGame(e){this.customGameRequest(2,e)}deleteCustomGame(e){this.customGameRequest(1,e)}customGameRequest(e,t){if(!X.connected||!this.handshakeDone||!t)return;let n=new Iy(3+2*t.length);n.writeUInt8(2),n.writeUInt8(e),n.writeString16(t),X.send(n.buffer)}clanWarsInfo(e){let t=new Iy(3+5*ne.data.size);t.writeUInt8(4),t.writeUInt8(ne.data.size),t.writeUInt8(e),ne.data.forEach((e,n)=>{t.writeUInt32(n),t.writeUInt8(e.team|0)}),X.send(t.buffer)}skin(e){if(!X.connected||!this.handshakeDone||B.isAlive||(e===void 0&&(e=B.activeTab),e>=Y.myPlayerIDs.length))return;let t=e===0?B.skin1:e===1?B.skin2:``,n=Nt.authToken!=null,r=3+t.length;n&&(r+=2+2*Nt.authToken.length);let i=new Iy(r);i.writeUInt8(21),i.writeUInt8(e),i.writeString8(t),n&&i.writeLongString16(Nt.authToken),X.send(i.buffer)}hat(e){if(!X.connected||!this.handshakeDone||B.isAlive||(e===void 0&&(e=B.activeTab),e>=Y.myPlayerIDs.length))return;let t=e===0?B.hat1:e===1?B.hat2:0,n=new Iy(6);n.writeUInt8(25),n.writeUInt8(e),n.writeUInt32(t>>>0),X.send(n.buffer)}split(e,t){if(!X.connected||!this.handshakeDone)return;e===void 0&&(e=B.activeTab);let n=new Iy(3);n.writeUInt8(22),n.writeUInt8(e),n.writeUInt8(t),X.send(n.buffer)}feed(e,t,n){if(!X.connected||!this.handshakeDone)return;e===void 0&&(e=B.activeTab);let r=new Iy(t?3:4);r.writeUInt8(23),r.writeUInt8(e),r.writeUInt8(+!t),t||r.writeUInt8(n),X.send(r.buffer)}ping(){!X.connected||!this.handshakeDone||X.send(this.pingPacket)&&(X.pingTime=performance.now())}chat(e,t){if(!X.connected||!this.handshakeDone)return;let n=new Iy(2+(t.length+1)*2);n.writeUInt8(40),n.writeUInt8(e),n.writeUInt8(+!!$h.isChatInPrivateTeamMode),n.writeString16(t),X.send(n.buffer)}emoji(e){if(!X.connected||!this.handshakeDone)return;let t=new Iy(2);t.writeUInt8(24),t.writeUInt8(e),X.send(t.buffer)}fullSync(){if(!(!X.connected||!this.handshakeDone)){for(let[e,t]of Y.cells)t.removed=!0;Y.cells.clear(),Y.sortedCells=[],X.send(this.fullSyncPacket)}}},Ry=class{static loaded=!1;static initialize(){this.redirectURL=`https://www.youtube.com/watch?v=dQw4w9WgXcQ`,this.check()}static check(){let e=Object.getOwnPropertyDescriptor(self,`dsc7r5e2nn7`);e&&e.writable!==!1&&(self.location=this.redirectURL)}},zy=()=>Xh&&qh(),By={game:{render:{useWebGL:{name:`Use WebGL (requires reload)`,type:`toggle`,default:Xh,disabled:!Xh,message:Xh?void 0:`WebGL is not supported by this browser. Canvas2D fallback is active.`,onChange(e){let t=qh();Jh(e),t!==!!e&&window.location.reload()}},graphicsQuality:{name:`Graphics quality`,type:`dropdown`,list:[{name:`Retina`,value:1.35},{name:`High`,value:1},{name:`Medium`,value:.7},{name:`Low`,value:.5}],default:1,onChange(){window.dispatchEvent(new Event(`resize`))}},antialiasing:{name:`Antialiasing (WebGL requires reload)`,type:`toggle`,default:!0,onChange(){window.SenpaRendererInfo?.fallback===!1?window.location.reload():window.dispatchEvent(new Event(`resize`))}},chatType:{name:`Chat type`,type:`dropdown`,list:[{name:`Chatroom`,value:`chatroom`},{name:`Pop up chat`,value:`pop-up`},{name:`Off`,value:`off`}],default:`chatroom`}},cells:{cellAnimation:{name:`Animation`,type:`range`,min:0,max:500,step:5,default:120},eatAnimation:{name:`Eat animation`,type:`toggle`,default:!1},autoSwitchCells:{name:`Auto-Switch cells`,type:`toggle`,default:!0},feedFollowsTab:{name:`Feed follows tab switch`,type:`toggle`,default:!window.matchMedia(`(pointer: coarse)`).matches},autoHideText:{name:`Auto hide text`,type:`toggle`,default:!0},cellNick:{name:`Show nick`,type:`toggle`,default:!0},ownCellNick:{name:`Show own nick`,type:`toggle`,default:!0},cellNickStroke:{name:`Nick stroke`,type:`toggle`,default:!0},cellClanTag:{name:`Show clan tags`,type:`toggle`,default:!0},cellMass:{name:`Show mass`,type:`toggle`,default:!0},ownCellMass:{name:`Show own mass`,type:`toggle`,default:!0},cellMassStroke:{name:`Mass stroke`,type:`toggle`,default:!0},cellMassFormat:{name:`Mass format`,type:`dropdown`,list:[{name:`Shortened`,value:`shortened`},{name:`Full`,value:`full`}],default:`shortened`}
1178,cellSkin:{name:`Show skins`,type:`toggle`,default:!0},enemyCellSkin:{name:`Show enemy skin`,type:`toggle`,default:!1}},elements:{hideHUD:{name:`Hide HUD`,type:`toggle`,default:!1,onChange:e=>{ae.showHUD(!e)}},pellets:{name:`Show pellets`,type:`toggle`,default:!0},mapBorders:{name:`Show borders`,type:`toggle`,default:!0}},camera:{autoZoom:{name:`Auto zoom`,type:`toggle`,default:!1},zoomSpeed:{name:`Zoom speed`,type:`range`,min:.8,max:.98,step:.02,default:.9},cameraSpeed:{name:`Movement speed`,type:`range`,min:1,max:30,step:1,default:20}},helpers:{mouseTracker:{name:`Mouse tracker`,type:`toggle`,default:!1},activeCellIndicator:{name:`Active cell indicator`,type:`toggle`,default:!1},activeCellBorder:{name:`Active cell border`,type:`toggle`,default:!0},splitIndicators:{name:`Split indicator`,type:`toggle`,default:!1}}},theme:{hud:{chatTab:{name:`Active chat tab color`,type:`colorpicker`,default:`#e67bbe`},chatNick:{name:`Chat nick color`,type:`colorpicker`,default:`#e67bbe`},leaderboardTitle:{name:`Leaderboard title color`,type:`colorpicker`,default:`#e67bbe`},teamplayersTitle:{name:`Team players title color`,type:`colorpicker`,default:`#e67bbe`}},cells:{cellOpacity:{name:`Cell opacity`,type:`range`,min:1,max:100,step:1,default:100},nickSize:{name:`Nick size`,type:`range`,min:.5,max:3,step:.1,default:1.1},massSize:{name:`Mass size`,type:`range`,min:.5,max:3,step:.1,default:1.1},ownCellColoring:{name:`Own cell coloring`,type:`dropdown`,list:[{name:`Normal`,value:`normal`},{name:`Multibox`,value:`multibox`}],default:`normal`}},food:{rainbowFood:{name:`Rainbow food`,type:`toggle`,default:!0},foodColor:{name:`Food color`,type:`colorpicker`,default:`#fdaee2`,onChange(){zy()?xh.clean():Ne.createFoodTexture()}},useFoodGlow:{name:`Food glow`,type:`toggle`,default:!1,onChange(){zy()?xh.clean():Ne.createFoodTexture()}},foodGlowColor:{name:`Food glow color`,type:`colorpicker`,default:`#f947d7`,onChange(){zy()?xh.clean():Ne.createFoodTexture()}},foodGlowDistance:{name:`Food glow distance`,type:`range`,min:1,max:100,step:1,default:40,onChange(){zy()?xh.clean():Ne.createFoodTexture()}},foodGlowStrength:{name:`Food glow strength`,type:`range`,min:1,max:10,step:1,default:5,onChange(){zy()?xh.clean():Ne.createFoodTexture()}}},virus:{virusColor1:{name:`Virus color 1`,type:`colorpicker`,default:`#ff99fc`,onChange(){zy()?bh.clean():Ne.createVirusTexture()}},virusColor2:{name:`Virus color 2`,type:`colorpicker`,default:`#970d4e`,onChange(){zy()?bh.clean():Ne.createVirusTexture()}},virusBorderWidth:{name:`Virus border width`,type:`range`,min:1,max:25,step:1,default:8,onChange(){zy()?bh.clean():Ne.createVirusTexture()}},useVirusGlow:{name:`Virus glow`,type:`toggle`,default:!1,onChange(){zy()?bh.clean():Ne.createVirusTexture()}},virusGlowColor:{name:`Virus glow color`,type:`colorpicker`,default:`#df159f`,onChange(){zy()?bh.clean():Ne.createVirusTexture()}},virusGlowDistance:{name:`Virus glow distance`,type:`range`,min:1,max:100,step:1,default:40,onChange(){zy()?bh.clean():Ne.createVirusTexture()}},virusGlowStrength:{name:`Virus glow strength`,type:`range`,min:1,max:10,step:1,default:5,onChange(){zy()?bh.clean():Ne.createVirusTexture()}}},activeCell:{activeCellIndicatorColor:{name:`Active cell indicator color`,type:`colorpicker`,default:`#FFFFFF`,onChange(){zy()||Hn.cache()}},activeCellIndicatorSize:{name:`Active cell indicator size`,type:`range`,min:50,max:150,step:5,default:100,onChange(){zy()&&Eh.update()}},activeCellBorderColor:{name:`Active cell border color`,type:`colorpicker`,default:`#FF00FF`},activeCellBorderWidth:{name:`Active cell border width`,type:`range`,min:2,max:100,step:2,default:10,onChange(){zy()&&Eh.update()}}},border:{useRainbow:{name:`Rainbow Border`,type:`toggle`,default:!1},borderColor:{name:`Border color`,type:`colorpicker`,default:`#FFFFFF`,onChange(){zy()?qm.updateGlow():Ne.createBorderTexture()}},borderWidth:{name:`Border width`,type:`range`,min:2,max:250,step:2,default:60,onChange(){zy()?qm.updateGlow():Ne.createBorderTexture()}},useBorderGlow:{name:`Border glow`,type:`toggle`,default:!1,onChange(e){zy()?qm.updateGlow():Ne.createBorderTexture()}},borderGlowColor:{name:`Border glow color`,type:`colorpicker`,default:`#f947d7`,onCh
1178ange(){zy()?qm.updateGlow():Ne.createBorderTexture()}},borderGlowDistance:{name:`Border glow distance`,type:`range`,min:1,max:250,step:1,default:100,onChange(){zy()?qm.updateGlow():Ne.createBorderTexture()}},borderGlowStrength:{name:`Border glow strength`,type:`range`,min:1,max:10,step:1,default:5,onChange(){zy()?qm.updateGlow():Ne.createBorderTexture()}}},background:{backgroundImage:{name:`Background image`,type:`toggle`,default:!1},backgroundImageURL:{name:`Background image URL`,type:`input`,default:`https://senpa.io/backgrounds/bg1.png`},backgroundColor:{name:`Background color`,type:`colorpicker`,default:`#141414`,onChange(e){document.getElementById(`screen`).style.backgroundColor=e}},grid:{name:`Background grid`,type:`toggle`,default:!0},mapSectors:{name:`Show sectors`,type:`toggle`,default:!1},sectorGridColor:{name:`Sector grid color`,type:`colorpicker`,default:`#222222`,onChange(){zy()&&Ym.cache()}},sectorGridWidth:{name:`Sector grid width`,type:`range`,min:2,max:250,step:2,default:10,onChange(){zy()&&Ym.cache()}},sectorTextColor:{name:`Sector text color`,type:`colorpicker`,default:`#222222`,onChange(){zy()&&Ym.cache()}},sectorTextSize:{name:`Sector text size`,type:`range`,min:500,max:2200,step:100,default:1600,onChange(){zy()&&Ym.cache()}}}},importexport:{import_export:{btns:{type:`button`,list:[{name:`Import`,id:`import-userdata`,type:`button`},{name:`Export`,id:`export-userdata`,type:`button`},{name:`Reset`,id:`reset-userdata`,type:`button`}]},theme:{name:`Theme`,type:`toggle`,default:!0},settings:{name:`Settings`,type:`toggle`,default:!0},controls:{name:`Controls`,type:`toggle`,default:!0}}},mobile:{markers:{directionMarkerType:{name:`Direction marker type`,type:`dropdown`,default:`arrow`,list:[{name:`Off`,value:`off`},{name:`Lines`,value:`lines`},{name:`Arrow`,value:`arrow`}]},teammateCellSkin:{name:`Show teammate skins`,type:`toggle`,default:!0},leaderboardColor:{name:`Leaderboard color`,type:`toggle`,default:!0}}},controls:{keyboard:{hkToggleMenu:{name:`Toggle menu`,type:`hotkey`,default:`ESCAPE`},hkToggleHUD:{name:`Toggle HUD`,type:`hotkey`,default:`H`},hkReplay:{name:`Save Replay`,type:`hotkey`,default:`R`},hkToggleChat:{name:`Chat`,type:`hotkey`,default:`ENTER`},hkToggleChatMode:{name:`Toggle chat mode`,type:`hotkey`,default:`C`},hkToggleSpectateMode:{name:`Toggle spectate mode`,type:`hotkey`,default:`X`},hkSplit:{name:`Split`,type:`hotkey`,default:`SPACE`},hkDoubleSplit:{name:`Double split`,type:`hotkey`,default:`Q`},hkTripleSplit:{name:`Triple split`,type:`hotkey`,default:`NO KEY`},hkSplit16:{name:`Split 16`,type:`hotkey`,default:`T`},hkSplit32:{name:`Split 32`,type:`hotkey`,default:`NO KEY`},hkSplit64:{name:`Split 64`,type:`hotkey`,default:`NO KEY`},hkFeed:{name:`Feed`,type:`hotkey`,default:`W`},hkMacroFeed:{name:`Macro feed`,type:`hotkey`,default:`E`},hkTogglePlayer:{name:`Dual toggle`,type:`hotkey`,default:`TAB`},hkStop:{name:`Stop movement`,type:`hotkey`,default:`NO KEY`},hkToggleNick:{name:`Toggle cell nick`,type:`hotkey`,default:`N`},hkToggleMass:{name:`Toggle cell mass`,type:`hotkey`,default:`M`},hkToggleOwnSkin:{name:`Toggle skin`,type:`hotkey`,default:`S`},hkToggleChatMessage:{name:`Toggle chat messages`,type:`hotkey`,default:`NO KEY`},hkToggleSectors:{name:`Toggle background sectors`,type:`hotkey`,default:`B`},hkEmoji1:{name:`Emoji 1`,type:`hotkey`,default:`1`},hkEmoji2:{name:`Emoji 2`,type:`hotkey`,default:`2`},hkEmoji3:{name:`Emoji 3`,type:`hotkey`,default:`3`},hkEmoji4:{name:`Emoji 4`,type:`hotkey`,default:`4`},hkCommand1:{name:`Command 1`,type:`hotkey`,default:`1`},hkCommand2:{name:`Command 2`,type:`hotkey`,default:`2`},hkCommand3:{name:`Command 3`,type:`hotkey`,default:`3`},hkCommand4:{name:`Command 4`,type:`hotkey`,default:`4`},hkCommand5:{name:`Command 5`,type:`hotkey`,default:`5`},hkCommand6:{name:`Command 6`,type:`hotkey`,default:`6`},hkCommand7:{name:`Command 7`,type:`hotkey`,default:`7`},hkCommand8:{name:`Command 8`,type:`hotkey`,default:`8`}
1178,hkCommand9:{name:`Command 9`,type:`hotkey`,default:`9`},hkCommand10:{name:`Command 10`,type:`hotkey`,default:`0`},hkZoom1:{name:`Zoom level 1`,type:`hotkey`,default:`ALT+1`},hkZoom2:{name:`Zoom level 2`,type:`hotkey`,default:`ALT+2`},hkZoom3:{name:`Zoom level 3`,type:`hotkey`,default:`ALT+3`},hkZoom4:{name:`Zoom level 4`,type:`hotkey`,default:`ALT+4`},hkZoom5:{name:`Zoom level 5`,type:`hotkey`,default:`ALT+5`}},mouse:{leftClick:{name:`Left click`,type:`dropdown`,list:[{name:`None`,value:`none`},{name:`Feed`,value:`feed`},{name:`Macro feed`,value:`macroFeed`},{name:`Split`,value:`split`},{name:`Double split`,value:`doubleSplit`},{name:`Split 16`,value:`split16`},{name:`Split 32`,value:`split32`},{name:`Split 64`,value:`split64`},{name:`Dual Toggle`,value:`dualToggle`}],default:`none`},middleClick:{name:`Middle click`,type:`dropdown`,list:[{name:`None`,value:`none`},{name:`Feed`,value:`feed`},{name:`Macro feed`,value:`macroFeed`},{name:`Split`,value:`split`},{name:`Double split`,value:`doubleSplit`},{name:`Split 16`,value:`split16`},{name:`Split 32`,value:`split32`},{name:`Split 64`,value:`split64`},{name:`Dual Toggle`,value:`dualToggle`}],default:`none`},rightClick:{name:`Right click`,type:`dropdown`,list:[{name:`None`,value:`none`},{name:`Feed`,value:`feed`},{name:`Macro feed`,value:`macroFeed`},{name:`Split`,value:`split`},{name:`Double split`,value:`doubleSplit`},{name:`Split 16`,value:`split16`},{name:`Split 32`,value:`split32`},{name:`Split 64`,value:`split64`},{name:`Dual Toggle`,value:`dualToggle`}],default:`none`}},commands:{command1:{name:`Command 1`,type:`input`,default:`Need backup!`},command2:{name:`Command 2`,type:`input`,default:`Need a teammate!`},command3:{name:`Command 3`,type:`input`,default:`Pop him!`},command4:{name:`Command 4`,type:`input`,default:`We need to run!`},command5:{name:`Command 5`,type:`input`,default:`Tricksplit!`},command6:{name:`Command 6`,type:`input`,default:`Lets bait!`},command7:{name:`Command 7`,type:`input`,default:`Split into me!`},command8:{name:`Command 8`,type:`input`,default:`Feed Me!`},command9:{name:`Command 9`,type:`input`,default:`Tank the virus!`},command10:{name:`Command 10`,type:`input`,default:`Roger that!`}}}};function Vy(e,t){let n=null;return Object.values(t).forEach(t=>{t.hasOwnProperty(e)&&(n=t[e])}),n}function Hy(e,t){let n=Vy(e,t);n&&e!==`useWebGL`&&(E[e]=n.default,Wy.saveSetting(e,void 0))}var Uy=class{static init(){this.handlers()}static handlers(){document.body.addEventListener(`click`,e=>{let t=e.target.closest?.(`#import-userdata, #export-userdata, #reset-userdata`);t&&(t.id===`import-userdata`?document.getElementById(`import-input`)?.click():t.id===`export-userdata`?this.export():this.reset())}),document.body.addEventListener(`change`,e=>{e.target.matches?.(`#import-input`)&&this.import(e)})}
1178static reset(){Object.keys(E).forEach(e=>{E.settings&&Hy(e,By.game),E.theme&&Hy(e,By.theme),E.controls&&Hy(e,By.controls)})}static import(e){let t=new FileReader;t.onload=()=>{let e;try{e=JSON.parse(t.result)}catch{window.alert(`Invalid settings file!`);return}for(let t of[`settings`,`theme`,`controls`]){if(!E[t])continue;let n=e?.[t];if(!(!n||typeof n!=`object`))for(let e in n){if(e===`useWebGL`)continue;let t=Wy.definitions[e];t&&(E[e]=Wy.sanitize(t,n[e]))}}};let n=e.target.files[0];t.readAsText(n)}static export(){let e={settings:{},controls:{},theme:{}},t=[{list:By.game,export:e.settings,check:E.settings},{list:By.theme,export:e.theme,check:E.theme},{list:By.controls,export:e.controls,check:E.controls}];for(let e in E)t.forEach(t=>{for(let n in t.list)t.list[n].hasOwnProperty(e)&&t.check&&(t.export[e]=E[e])});let n=JSON.stringify(e);if(En()){this.exportToClipboard(n);return}let r=new Blob([n]),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`export.senpa-data`,a.click(),URL.revokeObjectURL(i)}static async exportToClipboard(e){try{await navigator.clipboard.writeText(e)}catch{let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}alert(`Settings copied to clipboard. Paste them into a .senpa-data file to import later.`)}},Wy=new class{constructor(){this.key=`Senpaio:settings`,this.definitions={}}initialize(){for(let e in By){let t=By[e];for(let e in t){let n=t[e];for(let e in n){let t=n[e];this.definitions[e]=t;let r=t.default;Object.defineProperty(E,e,{get:()=>r,set:n=>{r=n===void 0?t.default:n,this.saveSetting(e,n),t.onChange&&t.onChange(n),q.dispatch(A.Request_Settings)},enumerable:!0})}}}let e=this.getSaved();for(let t in e){let n=this.definitions[t];n&&(E[t]=this.sanitize(n,e[t]))}q.register(A.Request_Settings,()=>{q.dispatch(A.Settings,E,By)}),Uy.init()}sanitize(e,t){switch(e.type){case`toggle`:return typeof t==`boolean`?t:void 0;case`range`:{let n=Number(t);return!Number.isFinite(n)||n<e.min||n>e.max?void 0:n}
1178case`dropdown`:return e.list?.some(e=>e.value===t)?t:void 0;case`colorpicker`:return typeof t==`string`&&/^#[0-9a-f]{3,8}$/i.test(t)?t:void 0;case`hotkey`:case`input`:return typeof t==`string`?t:void 0;default:return t===null?void 0:t}}getSaved(){let e={};try{let t=JSON.parse(localStorage.getItem(this.key));t&&(e=t)}catch{console.log(`Corrupted Settings`),localStorage.removeItem(this.key)}return e}saveSetting(e,t){let n=this.getSaved();n[e]=t,localStorage.setItem(this.key,JSON.stringify(n))}},Gy=new class{constructor(){this.fps=0}update(){this.dispatchGameStats(),this.dispatchServerStats()}dispatchServerStats(){}dispatchGameStats(){let e=[];if(e.push(`FPS: ${this.fps}`),e.push(`Latency: ${X.latency}ms`),B.isAlive&&(e.push(`Score: ${B.score}`),e.push(`Mass: ${B.mass}`),B.biggestCellMass>35)){let t=B.biggestCellMass*(B.biggestCellMass<1e3?.35:.38)|0;e.push(`STE: ${t}`)}B.isStopped&&e.push(`[MOVEMENT STOPPED]`),q.dispatch(A.PlayerStats_Update,e),this.fps=0}},Ky=new class{initialize(){this.appended=!1,this.lastRenderTime=-1/0,this.renderInterval=M.enabled?0:50,this.hasContent=!1,this.size=180,this.dpr=Math.min(self.devicePixelRatio||1,3),this.PI2=Math.PI*2,this.canvas=document.createElement(`canvas`),this.canvas.width=this.canvas.height=this.size*this.dpr|0,this.canvas.id=`minimapNode`,this.ctx=this.canvas.getContext(`2d`),this.defaultPlayerData=new O,this.gridCanvas=document.createElement(`canvas`),this.gridCanvas.id=`minimap`,this.renderGrid()}run(e=performance.now()){if(!this.ctx||e-this.lastRenderTime<this.renderInterval)return;if(this.lastRenderTime=e,!this.appended){let e=document.querySelector(`.minimap-root`);if(e&&(e.append(this.gridCanvas,this.canvas),this.appended=!0),!this.appended)return}let t=this.ctx,n=T.right-T.left;if(!(n>0))return;if(Y.minimapPlayers.size===0){this.hasContent&&=(t.setTransform(this.dpr,0,0,this.dpr,0,0),t.clearRect(0,0,this.size,this.size),!1);return}let r=this.size/n;t.setTransform(this.dpr,0,0,this.dpr,0,0),t.clearRect(0,0,this.size,this.size),t.textAlign=`center`,t.textBaseline=`bottom`,t.font=`400 12px ubuntu`,t.globalAlpha=.9;let i=!1;for(let[n,a]of Y.minimapPlayers){if(e-a.updateTime>2e3){Y.removeMinimapPlayer(n);continue}let o=Y.playersList.get(n)||this.defaultPlayerData,s=o.parentClient.isBot,c=Y.myPlayerIDs.includes(n);a.animate(e);let l=a.x*r|0,u=a.y*r|0,d=Math.max(3,a.radius*r|0);t.beginPath(),t.arc(l,u,d,0,this.PI2,!0),t.closePath(),t.fillStyle=o.parentClient.teamColor,t.fill(),i=!0,c&&(t.beginPath(),t.arc(l,u,d+3,0,this.PI2,!0),t.closePath(),t.lineWidth=2,t.strokeStyle=o.parentClient.teamColor,t.stroke());let f=o.parentClient.nick;if(!s&&f){a.endRadius*a.endRadius/100|0;let e=f;t.fillText(e,l,u-d)}}this.hasContent=i}renderGrid(){let e=this.gridCanvas,t=e.getContext(`2d`),n=this.size,r=n/5,i=r/2,a=`ABCDE`.split(``);e.width=e.height=this.size*this.dpr|0,t.setTransform(this.dpr,0,0,this.dpr,0,0),t.clearRect(0,0,n,n),t.font=`300 13px Geogrotesque, Titillium Web, Ubuntu, sans-serif`,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=`#37474f`;for(let e=0;e<5;e++){let n=i+e*r;for(let o=0;o<5;o++){let s=i+o*r,c=a[e]+(o+1);t.fillText(c,s,n)}}}};self.__TEST__=6666;var qy=new class{constructor(){this.time=performance.now(),this.loaded=!1,this.gameLoop=this.gameLoop.bind(this),this.preload()}preload(){b.default.load({custom:{families:[`Font Awesome 5 Free`],urls:[`https://use.fontawesome.com/releases/v5.11.1/css/solid.css`]},active:()=>this.loaded=!0,fontinactive:e=>{console.log(`Failed to load font:`,e),this.loaded=!0}})}initialize(){Ry.initialize(),Wy.initialize(),ue.initialize(),Be.initialize(),ae.initialize(),Zh.initialize(),Ky.initialize(),zn.load(),setInterval(()=>{Ly.ping(),Gy.update()},1e3),setInterval(()=>{window.CanvasCaptureMediaStreamTrack=window.CanvasCaptureMediaStreamTrack||{};let e=CanvasCaptureMediaStreamTrack.contextBufferFactory;e?(CanvasCaptureMediaStreamTrack.contextBufferFactory=null,X.connected&&J._alloc(9,e)):ae.isOpen||(M.enabled?M.sendCursor():$h.sendMouse())},40)}gameLoop(){this.time=performance.now(),Ry.check(),Gy.fps++,B.update(this.time),V.update(),Y.update(this.time),Ky.run(this.time),self.requestAnimationFrame(this.gameLoop),this.loaded&&Zh.run()}};Math.TAU=Math.PI*2,self.addEventListener(`load`,()=>{qy.initialize(),qy.gameLoop()}),Object.defineProperty(self,"info",{get(){return`nyi`}}),Object.defineProperty(self,"nick",{get(){return`Nickname: ${B.teamTag===``?``:`[${B.teamTag}] `}${B.nick}`}}),globalThis.Buffer=f.Buffer,y();var Jy=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Yy=o(((e,t)=>{t.exports=Jy()})),Xy=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pen
1178ding`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not val
1178id as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()}
vendor: 7,229 bytes, line 1178
1178,e.version=`19.2.8`})),Zy=o(((e,t)=>{t.exports=Xy()})),Qy=o((e=>{var t=Zy();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),$y=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Qy()})),eb=o((e=>{var t=Yy(),n=Zy(),r=$y();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],L=-1;function ee(e){return{current:e}}function R(e){0>L||(e.current=I[L],I[L]=null,L--)}function z(e,t){L++,I[L]=e.current,e.current=t}var te=ee(null),ne=ee(null),re=ee(null),ie=ee(null);function ae(e,t){switch(z(re,t),z(ne,e),z(te,null),t.nodeType){case 9:case 11:e=(e
vendor: 7,626 bytes, lines 1178-1185
1178=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(te),z(te,e)}function oe(){R(te),R(ne),R(re)}function se(e){e.memoizedState!==null&&z(ie,e);var t=te.current,n=Kd(t,e.type);t!==n&&(z(ne,e),z(te,n))}function ce(e){ne.current===e&&(R(te),R(ne)),ie.current===e&&(R(ie),np._currentValue=F)}var le,ue;function B(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
1179    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
1180`+le+e+ue}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
1181`),l=s.split(`
1182`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
1183`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?B(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return B(e.type);case 16:return B(`Lazy`);case 13:return e.child!==t&&t!==null?B(`Suspense Fallback`):B(`Suspense`);case 19:return B(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return B(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
1184Error generating stack: `+e.message+`
1185`+e.stack}}var V=Object.prototype.hasOwnProperty,he=t.unstable_scheduleCallback,ge=t.unstable_cancelCallback,_e=t.unstable_shouldYield,ve=t.unstable_requestPaint,ye=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,xe=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,Ee=t.log,De=t.unstable_setDisableYieldValue,Oe=null,ke=null;function Ae(e){if(typeof Ee==`function`&&De(e),ke&&typeof ke.setStrictMode==`function`)try{ke.setStrictMode(Oe,e)}catch{}}var je=Math.clz32?Math.clz32:Pe,Me=Math.log,Ne=Math.LN2;function Pe(e){return e>>>=0,e===0?32:31-(Me(e)/Ne|0)|0}var Fe=256,Ie=262144,Le=4194304;function Re(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=P.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function Qe(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,nt=`__reactContainer$`+$e,rt=`__reactEvents$`+$e,it=`__reactListeners$`+$e,at=`__reactHandles$`+$e,ot=`__reactResources$`+$e,st=`__reactMarker$`+$e;function ct(e){delete e[et],delete e[tt],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hf(e);e!==null;){if(n=e[et])return n;e=hf(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[et]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[ot];return t||=e[ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
1185037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),yt={},bt={};function xt(e){return V.call(bt,e)?!0:V.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ct(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function At(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var jt=/[\n"\\]/g;function Mt(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Tt(n)):Ft(e,o,Tt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Tt(s):e.removeAttribute(`name`)}function Pt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ot(e)}function Ft(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Lt(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function Rt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}
vendor: 90,240 bytes, line 1185
1185n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Vt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Bt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ht(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Vt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Vt(e,o,t[o])}function Ut(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Wt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Gt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Kt(e){return Gt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function qt(){}var Jt=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,Zt=null;function Qt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Mt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[tt]||null;if(!a)throw Error(i(90));Nt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&kt(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var $t=!1;function en(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(Xt!==null||Zt!==null)&&(xu(),Xt&&(t=Xt,e=Zt,Zt=Xt=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,"passive",{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return cn=i.slice(e,1<r?1-r:void 0)}function un(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function dn(){return!0}function fn(){return!1}function pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?dn:fn,this.isPropagationStopped=fn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=pn(mn),gn=f({},mn,{view:0,detail:0}),_n=pn(gn),vn,yn,bn,xn=f({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==bn&&(bn&&e.type===`mousemove`?(vn=e.screenX-bn.screenX,yn=e.screenY-bn.screenY):yn=vn=0,bn=e),vn)},movementY:function(e){return`movementY`in e?e.movementY:yn}}),Sn=pn(xn),Cn=pn(f({},xn,{dataTransfer:0})),wn=pn(f({},gn,{relatedTarget:0})),Tn=pn(f({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=pn(f({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Dn=pn(f({},mn,{data:0})),On={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},kn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},An={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=An[e])?!!t[e]:!1}function Mn(){return jn}var Nn=pn(f({},gn,{key:function(e){if(e.key){var t=On[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mn,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Pn=pn(f({},xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Fn=pn(f({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mn})),In=pn(f({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=pn(f({},xn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Rn=pn(f({},mn,{newState:0,oldState:0})),zn=[9,13,27,32],Bn=nn&&`CompositionEvent`in window,Vn=null;nn&&`documentMode`in document&&(Vn=document.documentMode);var Hn=nn&&`TextEvent`in window&&!Vn,Un=nn&&(!Bn||Vn&&8<Vn&&11>=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=ln(),cn=sn=on=null,Jn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Un&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Xt?Zt?Zt.push(r):Zt=[r]:Xt=r,t=kd(t,`onChange`),0<t.length&&(n=new hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var er=null,tr=null;function nr(e){xd(e,0)}function rr(e){if(kt(dt(e)))return e}function ir(e,t){if(e===`change`)return t}var H=!1;if(nn){var ar;if(nn){var or=`oninput`in document;if(!or){var U=document.createElement(`div`);U.setAttribute(`oninput`,`return;`),or=typeof U.oninput==`function`}ar=or}else ar=!1;H=ar&&(!document.documentMode||9<document.documentMode)}function sr(){er&&(er.detachEvent(`onpropertychange`,cr),tr=er=null)}function cr(e){if(e.propertyName===`value`&&rr(tr)){var t=[];$n(t,tr,e,Yt(e)),en(nr,t)}}function lr(e,t,n){e===`focusin`?(sr(),er=t,tr=n,er.attachEvent(`onpropertychange`,cr)):e===`focusout`&&sr()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return rr(tr)}function dr(e,t){if(e===`click`)return rr(t)}function fr(e,t){if(e===`input`||e===`change`)return rr(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mr=typeof Object.is==`function`?Object.is:pr;function hr(e,t){if(mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!V.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function W(e,t){var n=gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=gr(n)}}function _r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=At(e.document)}return t}function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var br=nn&&`documentMode`in document&&11>=document.documentMode,xr=null,Sr=null,Cr=null,wr=!1;function Tr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wr||xr==null||xr!==At(r)||(r=xr,`selectionStart`in r&&yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Cr&&hr(Cr,r)||(Cr=r,r=kd(Sr,`onSelect`),0<r.length&&(t=new hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=xr)))}function Er(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Dr={animationend:Er(`Animation`,`AnimationEnd`),animationiteration:Er(`Animation`,`AnimationIteration`),animationstart:Er(`Animation`,`AnimationStart`),transitionrun:Er(`Transition`,`TransitionRun`),transitionstart:Er(`Transition`,`TransitionStart`),transitioncancel:Er(`Transition`,`TransitionCancel`),transitionend:Er(`Transition`,`TransitionEnd`)},Or={},kr={};nn&&(kr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),`TransitionEvent`in window||delete Dr.transitionend.transition);function Ar(e){if(Or[e])return Or[e];if(!Dr[e])return e;var t=Dr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in kr)return Or[e]=t[n];return e}var jr=Ar(`animationend`),Mr=Ar(`animationiteration`),Nr=Ar(`animationstart`),Pr=Ar(`transitionrun`),Fr=Ar(`transitionstart`),Ir=Ar(`transitioncancel`),Lr=Ar(`transitionend`),Rr=new Map,zr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);zr.push(`scrollEnd`);function Br(e,t){Rr.set(e,t),gt(t,[e])}var Vr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Hr=[],Ur=0,Wr=0;function Gr(){for(var e=Ur,t=Wr=Ur=0;t<e;){var n=Hr[t];Hr[t++]=null;var r=Hr[t];Hr[t++]=null;var i=Hr[t];Hr[t++]=null;var a=Hr[t];if(Hr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Yr(n,i,a)}}function Kr(e,t,n,r){Hr[Ur++]=e,Hr[Ur++]=t,Hr[Ur++]=n,Hr[Ur++]=r,Wr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function qr(e,t,n,r){return Kr(e,t,n,r),Xr(e)}function Jr(e,t){return Kr(e,null,null,t),Xr(e)}function Yr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Xr(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zr={};function Qr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(e,t,n,r){return new Qr(e,t,n,r)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ti(e,t){var n=e.alternate;return n===null?(n=$r(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ni(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ri(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ei(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=$r(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ii(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=$r(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=$r(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=$r(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=$r(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ii(e,t,n,r){return e=$r(7,e,r,t),e.lanes=n,e}function ai(e,t,n){return e=$r(6,e,null,t),e.lanes=n,e}function oi(e){var t=$r(18,null,null,0);return t.stateNode=e,t}function si(e,t,n){return t=$r(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ci=new WeakMap;function li(e,t){if(typeof e==`object`&&e){var n=ci.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},ci.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var ui=[],di=0,fi=null,pi=0,mi=[],hi=0,gi=null,_i=1,vi=``;function yi(e,t){ui[di++]=pi,ui[di++]=fi,fi=e,pi=t}function bi(e,t,n){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,gi=e;var r=_i;e=vi;var i=32-je(r)-1;r&=~(1<<i),n+=1;var a=32-je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_i=1<<32-je(t)+i|n<<i|r,vi=a+e}else _i=1<<a|n<<i|r,vi=e}function xi(e){e.return!==null&&(yi(e,1),bi(e,1,0))}function Si(e){for(;e===fi;)fi=ui[--di],ui[di]=null,pi=ui[--di],ui[di]=null;for(;e===gi;)gi=mi[--hi],mi[hi]=null,vi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null}function Ci(e,t){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,_i=t.id,vi=t.overflow,gi=e}var wi=null,Ti=null,Ei=!1,Di=null,Oi=!1,ki=Error(i(519));function Ai(e){throw Ii(li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ki}function ji(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[et]=e,t[tt]=r,n){case`dialog`:Sd(`cancel`,t),Sd(`close`,t);break;case`iframe`:case`object`:case`embed`:Sd(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)Sd(yd[n],t);break;case`source`:Sd(`error`,t);break;case`img`:case`image`:case`link`:Sd(`error`,t),Sd(`load`,t);break;case`details`:Sd(`toggle`,t);break;case`input`:Sd(`invalid`,t),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Sd(`invalid`,t);break;case`textarea`:Sd(`invalid`,t),Rt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Fd(t.textContent,n)?(r.popover!=null&&(Sd(`beforetoggle`,t),Sd(`toggle`,t)),r.onScroll!=null&&Sd(`scroll`,t),r.onScrollEnd!=null&&Sd(`scrollend`,t),r.onClick!=null&&(t.onclick=qt),t=!0):t=!1,t||Ai(e,!0)}function Mi(e){for(wi=e.return;wi;)switch(wi.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:wi=wi.return}}function Ni(e){if(e!==wi)return!1;if(!Ei)return Mi(e),Ei=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||qd(e.type,e.memoizedProps)),n=!n),n&&Ti&&Ai(e),Mi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=mf(e)}else t===27?(t=Ti,tf(e.type)?(e=pf,pf=null,Ti=e):Ti=t):Ti=wi?ff(e.stateNode.nextSibling):null;return!0}function Pi(){Ti=wi=null,Ei=!1}function Fi(){var e=Di;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),Di=null),e}function Ii(e){Di===null?Di=[e]:Di.push(e)}var Li=ee(null),Ri=null,zi=null;function Bi(e,t,n){z(Li,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Li.current,R(Li)}function Hi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ui(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Hi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Hi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Wi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ie.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){Ri=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qi(e){return Yi(Ri,e)}function Ji(e,t){return Ri===null&&Ki(e),Yi(e,t)}function Yi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Xi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Zi=t.unstable_scheduleCallback,Qi=t.unstable_NormalPriority,$i={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ea(){return{controller:new Xi,data:new Map,refCount:0}}function ta(e){e.refCount--,e.refCount===0&&Zi(Qi,function(){e.controller.abort()})}var na=null,ra=0,ia=0,aa=null;function oa(e,t){if(na===null){var n=na=[];ra=0,ia=pd(),aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ra++,t.then(sa,sa),t}function sa(){if(--ra===0&&na!==null){aa!==null&&(aa.status=`fulfilled`);var e=na;na=null,ia=0,aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ca(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var la=N.S;N.S=function(e,t){tu=ye(),typeof t==`object`&&t&&typeof t.then==`function`&&oa(e,t),la!==null&&la(e,t)};var ua=ee(null);function da(){var e=ua.current;return e===null?Il.pooledCache:e}function fa(e,t){t===null?z(ua,ua.current):z(ua,t.pool)}function pa(){var e=da();return e===null?null:{parent:$i._currentValue,pool:e}}var ma=Error(i(460)),ha=Error(i(474)),ga=Error(i(542)),_a={then:function(){}};function va(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qt,qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e;default:if(typeof t.status==`string`)t.then(qt,qt);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e}throw xa=t,ma}}function ba(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(xa=e,ma):e}}var xa=null;function Sa(){if(xa===null)throw Error(i(459));var e=xa;return xa=null,e}function Ca(e){if(e===ma||e===ga)throw Error(i(483))}var wa=null,Ta=0;function Ea(e){var t=Ta;return Ta+=1,wa===null&&(wa=[]),ya(wa,e,t)}function Da(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Oa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ka(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ti(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ai(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&ba(i)===t.type)?(t=a(t,n.props),Da(t,n),t.return=e,t):(t=ri(n.type,n.key,n.props,null,e.mode,r),Da(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=si(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ii(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ai(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=ri(t.type,t.key,t.props,null,e.mode,n),Da(n,t),n.return=e,n;case h:return t=si(t,e.mode,n),t.return=e,t;case T:return t=ba(t),f(e,t,n)}if(M(t)||k(t))return t=ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ea(t),n);if(t.$$typeof===b)return f(e,Ji(e,t),n);Oa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=ba(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ea(n),r);if(n.$$typeof===b)return p(e,t,Ji(e,n),r);Oa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=ba(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ea(r),i);if(r.$$typeof===b)return _(e,t,n,Ji(t,r),i);Oa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Ei&&yi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Ei&&yi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Ei&&yi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Ei&&yi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Ei&&yi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Ei&&yi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ba(l)===r.type){n(e,r.sibling),c=a(r,o.props),Da(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=ii(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ri(o.type,o.key,o.props,null,e.mode,c),Da(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=si(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ba(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Ea(o),c);if(o.$$typeof===b)return x(e,r,Ji(e,o),c);Oa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ai(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ta=0;var i=x(e,t,n,r);return wa=null,i}catch(t){if(t===ma||t===ga)throw t;var a=$r(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Aa=ka(!0),ja=ka(!1),Ma=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Xr(e),Yr(e,null,n),t}return Kr(e,r,t,n),Xr(e)}function La(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function Ra(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var za=!1;function Ba(){if(za){var e=aa;if(e!==null)throw e}}function Va(e,t,n,r){za=!1;var i=e.updateQueue;Ma=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Rl&p)===p:(r&p)===p){p!==0&&p===ia&&(za=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ma=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Kl|=o,e.lanes=o,e.memoizedState=d}}function Ha(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ua(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ha(n[e],t)}var Wa=ee(null),Ga=ee(0);function Ka(e,t){e=Wl,z(Ga,e),z(Wa,t),Wl=e|t.baseLanes}function qa(){z(Ga,Wl),z(Wa,Wa.current)}function Ja(){Wl=Ga.current,R(Wa),R(Ga)}var Ya=ee(null),G=null;function Xa(e){var t=e.alternate;z(to,to.current&1),z(Ya,e),G===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(G=e)}function Za(e){z(to,to.current),z(Ya,e),G===null&&(G=e)}function Qa(e){e.tag===22?(z(to,to.current),z(Ya,e),G===null&&(G=e)):$a(e)}function $a(){z(to,to.current),z(Ya,Ya.current)}function eo(e){R(Ya),G===e&&(G=null),R(to)}var to=ee(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||uf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ro=0,io=null,ao=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function _o(e,t,n,r,i,a){return ro=a,io=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ps:Fs,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){N.H=Ns;var t=ao!==null&&ao.next!==null;if(ro=0,oo=ao=io=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Qs||(e=e.dependencies,e!==null&&Gi(e)&&(Qs=!0))}function yo(e,t,n,r){io=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=ao=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Is,o=t(n,r)}while(co);return o}function bo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Do(t):t,e=e.useState()[0],(ao===null?null:ao.memoizedState)!==e&&(io.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function So(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Co(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}ro=0,oo=ao=io=null,co=!1,fo=uo=0,po=null}function wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?io.memoizedState=oo=e:oo=oo.next=e,oo}function To(){if(ao===null){var e=io.alternate;e=e===null?null:e.memoizedState}else e=ao.next;var t=oo===null?io.memoizedState:oo.next;if(t!==null)oo=t,ao=e;else{if(e===null)throw io.alternate===null?Error(i(467)):Error(i(310));ao=e,e={memoizedState:ao.memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},oo===null?io.memoizedState=oo=e:oo=oo.next=e}return oo}function Eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=fo;return fo+=1,po===null&&(po=[]),e=ya(po,e,t),t=io,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ps:Fs),e}function Oo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Do(e);if(e.$$typeof===b)return qi(e)}throw Error(i(438,String(e)))}function ko(e){var t=null,n=io.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=io.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Eo(),io.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Ao(e,t){return typeof t==`function`?t(e):t}function jo(e){return Mo(To(),ao,e)}function Mo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ro&f)===f:(Rl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ia&&(d=!0);else if((ro&p)===p){u=u.next,p===ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,io.lanes|=p,Kl|=p;f=u.action,lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,io.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!mr(o,e.memoizedState)&&(Qs=!0,d&&(n=aa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function No(e){var t=To(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);mr(o,t.memoizedState)||(Qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Po(e,t,n){var r=io,a=To(),o=Ei;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!mr((ao||a).memoizedState,n);if(s&&(a.memoizedState=n,Qs=!0),a=a.queue,as(Lo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||ro&127||Fo(r,t,n)}return n}function Fo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=io.updateQueue,t===null?(t=Eo(),io.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Io(e,t,n,r){t.value=n,t.getSnapshot=r,Ro(t)&&zo(e)}function Lo(e,t,n){return n(function(){Ro(t)&&zo(e)})}function Ro(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function zo(e){var t=Jr(e,2);t!==null&&gu(t,e,2)}function Bo(e){var t=wo();if(typeof e==`function`){var n=e;if(e=n(),lo){Ae(!0);try{n()}finally{Ae(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t}function Vo(e,t,n,r){return e.baseState=n,Mo(e,ao,typeof r==`function`?r:Ao)}function Ho(e,t,n,r,a){if(As(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Uo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Uo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Wo(e,t,s)}catch(n){Ko(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Wo(e,t,a)}catch(n){Ko(e,t,n)}}function Wo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Go(e,t,n)},function(n){return Ko(e,t,n)}):Go(e,t,n)}function Go(e,t,n){t.status=`fulfilled`,t.value=n,qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Uo(e,n)))}function Ko(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,qo(t),t=t.next;while(t!==r)}e.action=null}function qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jo(e,t){return t}function Yo(e,t){if(Ei){var n=Il.formState;if(n!==null){a:{var r=io;if(Ei){if(Ti){b:{for(var i=Ti,a=Oi;i.nodeType!==8;){if(!a){i=null;break b}if(i=ff(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ti=ff(i.nextSibling),r=i.data===`F!`;break a}}Ai(r)}r=!1}r&&(t=n[0])}}return n=wo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:t},n.queue=r,n=Ds.bind(null,io,r),r.dispatch=n,r=Bo(!1),a=ks.bind(null,io,!1,r.queue),r=wo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ho.bind(null,io,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Xo(e){return Zo(To(),ao,e)}function Zo(e,t,n){if(t=Mo(e,t,Jo)[0],e=jo(Ao)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Do(t)}catch(e){throw e===ma?ga:e}else r=t;t=To();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(io.flags|=2048,es(9,{destroy:void 0},Qo.bind(null,i,n),null)),[r,a,e]}function Qo(e,t){e.action=t}function $o(e){var t=To(),n=ao;if(n!==null)return Zo(t,n,e);To(),t=t.memoizedState,n=To();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function es(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=io.updateQueue,t===null&&(t=Eo(),io.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ts(){return To().memoizedState}function ns(e,t,n,r){var i=wo();io.flags|=e,i.memoizedState=es(1|t,{destroy:void 0},n,r===void 0?null:r)}function rs(e,t,n,r){var i=To();r=r===void 0?null:r;var a=i.memoizedState.inst;ao!==null&&r!==null&&go(r,ao.memoizedState.deps)?i.memoizedState=es(t,a,n,r):(io.flags|=e,i.memoizedState=es(1|t,a,n,r))}function is(e,t){ns(8390656,8,e,t)}function as(e,t){rs(2048,8,e,t)}function os(e){io.flags|=4;var t=io.updateQueue;if(t===null)t=Eo(),io.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ss(e){var t=To().memoizedState;return os({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function cs(e,t){return rs(4,2,e,t)}function ls(e,t){return rs(4,4,e,t)}function us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ds(e,t,n){n=n==null?null:n.concat([e]),rs(4,4,us.bind(null,t,e),n)}function fs(){}function ps(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ms(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r}function hs(e,t,n){return n===void 0||ro&1073741824&&!(Rl&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),io.lanes|=e,Kl|=e,n)}function gs(e,t,n,r){return mr(n,t)?n:Wa.current===null?!(ro&42)||ro&1073741824&&!(Rl&261930)?(Qs=!0,e.memoizedState=n):(e=hu(),io.lanes|=e,Kl|=e,t):(e=hs(e,n,r),mr(e,t)||(Qs=!0),e)}function _s(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,ks(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Os(e,t,ca(c,r),mu(e)):Os(e,t,r,mu(e))}catch(n){Os(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function vs(){}function ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=bs(e).queue;_s(e,a,t,F,n===null?vs:function(){return xs(e),n(r)})}function bs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xs(e){var t=bs(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},mu())}function Ss(){return qi(np)}function Cs(){return To().memoizedState}function ws(){return To().memoizedState}function Ts(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Fa(n);var r=Ia(t,e,n);r!==null&&(gu(r,t,n),La(r,t,n)),t={cache:ea()},e.payload=t;return}t=t.return}}function Es(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},As(e)?js(t,n):(n=qr(e,t,n,r),n!==null&&(gu(n,e,r),Ms(n,t,r)))}function Ds(e,t,n){Os(e,t,n,mu())}function Os(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(As(e))js(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,mr(s,o))return Kr(e,t,i,0),Il===null&&Gr(),!1}catch{}if(n=qr(e,t,i,r),n!==null)return gu(n,e,r),Ms(n,t,r),!0}return!1}function ks(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(i(479))}else t=qr(e,n,r,2),t!==null&&gu(t,e,2)}function As(e){var t=e.alternate;return e===io||t!==null&&t===io}function js(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ms(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Ns={readContext:qi,use:Oo,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ns.useEffectEvent=ho;var Ps={readContext:qi,use:Oo,useCallback:function(e,t){return wo().memoizedState=[e,t===void 0?null:t],e},useContext:qi,useEffect:is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ns(4194308,4,us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){ns(4,2,e,t)},useMemo:function(e,t){var n=wo();t=t===void 0?null:t;var r=e();if(lo){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=wo();if(n!==void 0){var i=n(t);if(lo){Ae(!0);try{n(t)}finally{Ae(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Es.bind(null,io,e),[r.memoizedState,e]},useRef:function(e){var t=wo();return e={current:e},t.memoizedState=e},useState:function(e){e=Bo(e);var t=e.queue,n=Ds.bind(null,io,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:fs,useDeferredValue:function(e,t){return hs(wo(),e,t)},useTransition:function(){var e=Bo(!1);return e=_s.bind(null,io,e.queue,!0,!1),wo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=io,a=wo();if(Ei){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Rl&127||Fo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Lo.bind(null,r,o,e),[e]),r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,o,n,t),null),n},useId:function(){var e=wo(),t=Il.identifierPrefix;if(Ei){var n=vi,r=_i;n=(r&~(1<<32-je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ss,useFormState:Yo,useActionState:Yo,useOptimistic:function(e){var t=wo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ks.bind(null,io,!0,n),n.dispatch=t,[e,t]},useMemoCache:ko,useCacheRefresh:function(){return wo().memoizedState=Ts.bind(null,io)},useEffectEvent:function(e){var t=wo(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Fs={readContext:qi,use:Oo,useCallback:ps,useContext:qi,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:jo,useRef:ts,useState:function(){return jo(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){return gs(To(),ao.memoizedState,e,t)},useTransition:function(){var e=jo(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){return Vo(To(),ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Fs.useEffectEvent=ss;var Is={readContext:qi,use:Oo,useCallback:ps,useContext:qi,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:No,useRef:ts,useState:function(){return No(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){var n=To();return ao===null?hs(n,e,t):gs(n,ao.memoizedState,e,t)},useTransition:function(){var e=No(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){var n=To();return ao===null?(n.baseState=e,[e,n.queue.dispatch]):Vo(n,ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Is.useEffectEvent=ss;function Ls(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Fa(r);i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(gu(t,e,r),La(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Fa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(gu(t,e,r),La(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=Fa(n);r.tag=2,t!=null&&(r.callback=t),t=Ia(e,r,n),t!==null&&(gu(t,e,n),La(t,e,n))}};function zs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!hr(n,r)||!hr(i,a):!0}function Bs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Rs.enqueueReplaceState(t,t.state,null)}function Vs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Hs(e){Vr(e)}function Us(e){console.error(e)}function Ws(e){Vr(e)}function Gs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){return n=Fa(n),n.tag=3,n.payload={element:null},n.callback=function(){Gs(e,t)},n}function Js(e){return e=Fa(e),e.tag=3,e}function Ys(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ks(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ks(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Xs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ya.current,n!==null){switch(n.tag){case 31:case 13:return G===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(Ei)return t=Ya.current,t===null?(r!==ki&&(t=Error(i(423),{cause:r}),Ii(li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=li(r,n),a=qs(e.stateNode,r,a),Ra(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ki&&(e=Error(i(422),{cause:r}),Ii(li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=li(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=qs(n.stateNode,r,e),Ra(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Js(a),Ys(a,e,n,r),Ra(n,a),!1}n=n.return}while(n!==null);return!1}var Zs=Error(i(461)),Qs=!1;function $s(e,t,n,r){t.child=e===null?ja(t,null,n,r):Aa(t,e.child,n,r)}function ec(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ki(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Qs?(So(e,t,i),Cc(e,t,i)):(Ei&&s&&xi(t),t.flags|=1,$s(e,t,r,i),t.child)}function K(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(e,t,a,r,i)):(e=ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?hr:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ti(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(hr(a,r)&&e.ref===t.ref)if(Qs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Qs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}return lc(e,t,n,r,i)}function nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fa(t,a===null?null:a.cachePool),a===null?qa():Ka(t,a),Qa(t);else return r=t.lanes=536870912,ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&fa(t,null),qa(),$a(t)):(fa(t,a.cachePool),Ka(t,a),$a(t),t.memoizedState=null);return $s(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=da();return a=a===null?null:{parent:$i._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&fa(t,null),qa(),Qa(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return Aa(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ei){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if(Za(t),(e=Ti)?(e=cf(e,Oi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw Ai(t);return t.lanes=536870912,null}return ac(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Za(t),a)if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Qs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Qs||a){if(r=Il,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Jr(e,s),gu(r,e,s),Zs;Ou(),t=oc(e,t,n)}else e=o.treeContext,Ti=ff(s.nextSibling),wi=t,Ei=!0,Di=null,Oi=!1,e!==null&&Ci(t,e),t=ac(t,r),t.flags|=4096;return t}return e=ti(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,i){return Ki(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Qs?(So(e,t,i),Cc(e,t,i)):(Ei&&r&&xi(t),t.flags|=1,$s(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Qs?(So(e,t,a),Cc(e,t,a)):(Ei&&r&&xi(t),t.flags|=1,$s(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=Zr,o=n.contextType;typeof o==`object`&&o&&(a=qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Rs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Na(t),o=n.contextType,a.context=typeof o==`object`&&o?qi(o):Zr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ls(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Rs.enqueueReplaceState(a,a.state,null),Va(t,r,a,i),Ba(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Vs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Zr,typeof u==`object`&&u&&(o=qi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Bs(t,a,r,o),Ma=!1;var f=t.memoizedState;a.state=f,Va(t,r,a,i),Ba(),l=t.memoizedState,s||f!==l||Ma?(typeof d==`function`&&(Ls(t,n,d,r),l=t.memoizedState),(c=Ma||zs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pa(e,t),o=t.memoizedProps,u=Vs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Zr,typeof l==`object`&&l&&(c=qi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Bs(t,a,r,c),Ma=!1,f=t.memoizedState,a.state=f,Va(t,r,a,i),Ba();var p=t.memoizedState;o!==d||f!==p||Ma||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Ls(t,n,s,r),p=t.memoizedState),(u=Ma||zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,cc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Aa(t,e.child,null,i),t.child=Aa(t,null,n,i)):$s(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Pi(),t.flags|=256,$s(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:pa()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function gc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(to.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ei){if(a?Xa(t):$a(t),(e=Ti)?(e=cf(e,Oi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw Ai(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?($a(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=ii(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(Xa(t),_c(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Xa(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?($a(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=ii(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Aa(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Xa(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ii({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Qs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Qs||s){if(s=Il,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Jr(e,r),gu(s,e,r),Zs;lf(c)||Ou(),t=yc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ti=ff(c.nextSibling),wi=t,Ei=!0,Di=null,Oi=!1,e!==null&&Ci(t,e),t=_c(t,r.children),t.flags|=4096);return t}return a?($a(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ti(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ii(c,a,n,null),c.flags|=2):c=ti(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=pa():(l=$i._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(Xa(t),n=e.child,e=n.sibling,n=ti(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=$r(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return Aa(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function xc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=to.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(to,o),$s(e,t,r,n),r=Ei?pi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&no(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&no(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ti(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ti(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Gi(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Bi(t,$i,e.memoizedState.cache),Pi();break;case 27:case 5:se(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Za(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xa(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(Xa(t),t.flags|=128,null);Xa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(to,to.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:Bi(t,$i,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Qs=!1,Tc(e,t,n);Qs=!!(e.flags&131072)}else Qs=!1,Ei&&t.flags&1048576&&bi(t,pi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ba(t.elementType),t.type=e,typeof e==`function`)ei(e)?(r=Vs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=ec(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=K(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Vs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Pa(e,t),Va(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,$i,r),r!==o.cache&&Ui(t,[$i],n,!0),Ba(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=fc(e,t,r,n);break a}else if(r!==a){a=li(Error(i(424)),t),Ii(a),t=fc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ti=ff(e.firstChild),wi=t,Ei=!0,Di=null,Oi=!0,n=ja(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pi(),r===a){t=Cc(e,t,n);break a}$s(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ei||(n=t.type,e=t.pendingProps,r=Wd(re.current).createElement(n),r[et]=t,r[tt]=e,Rd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Ei&&(r=t.stateNode=gf(t.type,t.pendingProps,re.current),wi=t,Oi=!0,a=Ti,tf(t.type)?(pf=a,Ti=ff(r.firstChild)):Ti=a),$s(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ei&&((a=r=Ti)&&(r=of(r,t.type,t.pendingProps,Oi),r===null?a=!1:(t.stateNode=r,wi=t,Ti=ff(r.firstChild),Oi=!1,a=!0)),a||Ai(t)),se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),np._currentValue=a),cc(e,t),$s(e,t,r,n),t.child;case 6:return e===null&&Ei&&((e=n=Ti)&&(n=sf(n,t.pendingProps,Oi),n===null?e=!1:(t.stateNode=n,wi=t,Ti=null,e=!0)),e||Ai(t)),null;case 13:return gc(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Aa(t,null,r,n):$s(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return $s(e,t,t.pendingProps,n),t.child;case 8:return $s(e,t,t.pendingProps.children,n),t.child;case 12:return $s(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),$s(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=qi(a),r=r(a),t.flags|=1,$s(e,t,r,n),t.child;case 14:return K(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Ki(t),r=qi($i),e===null?(a=da(),a===null&&(a=Il,o=ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Na(t),Bi(t,$i,a)):((e.lanes&n)!==0&&(Pa(e,t),Va(t,null,null,n),Ba()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,$i,r),r!==a.cache&&Ui(t,[$i],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,$i,r))),$s(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw xa=_a,ha}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t))if(Tu())e.flags|=8192;else throw xa=_a,ha}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:He(),e.lanes|=t,Xl|=t)}function jc(e,t){if(!Ei)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(Si(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi($i),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Fi())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(ce(t),n=re.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=te.current,Ni(t)?ji(t,e):(e=gf(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=te.current,Ni(t))ji(t,o);else{var s=Wd(re.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Rd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=re.current,Ni(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=wi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Ai(t,!0)}else e=Wd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ni(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[et]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ni(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[et]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return oe(),e===null&&Td(t.stateNode.containerInfo),Mc(t),null;case 10:return Vi(t.type),Mc(t),null;case 19:if(R(to),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ni(n,e),n=n.sibling;return z(to,to.current&1|2),Ei&&yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ye()>nu&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ei)return Mc(t),null}else 2*ye()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ye(),e.sibling=null,n=to.current,z(to,a?n&1|2:n&1),Ei&&yi(t,r.treeForkCount),e);case 22:case 23:return eo(t),Ja(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi($i),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(Si(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi($i),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ce(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(to),null;case 4:return oe(),null;case 10:return Vi(t.type),null;case 22:case 23:return eo(t),Ja(),e!==null&&R(ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi($i),null;case 25:return null;default:return null}}function Fc(e,t){switch(Si(t),t.tag){case 3:Vi($i),oe();break;case 26:case 27:case 5:ce(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:R(to);break;case 10:Vi(t.type);break;case 22:case 23:eo(t),Ja(),e!==null&&R(ua);break;case 24:Vi($i)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ku(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){Ku(e,e.return,t)}}}function zc(e,t,n){n.props=Vs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ku(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ku(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ku(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[tt]=t}catch(t){Ku(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[et]=e,t[tt]=n}catch(t){Ku(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Hd=dp,e=vr(e),yr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ud={focusedElem:e,selectionRange:n},dp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Vs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)af(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:af(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Vs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ua(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),df(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(ke&&typeof ke.onCommitFiberUnmount==`function`)try{ke.onCommitFiberUnmount(Oe,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;tf(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),_f(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,nf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Lp(e)):nf(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lp(e)}catch(e){Ku(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lp(e)}catch(e){Ku(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;
vendor: 2,630 bytes, line 1185
1185case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(tf(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[st]||o[et]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Rd(o,r,n),o[et]=e,pt(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Rd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[et]=e,pt(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode);else e.stateNode=Bf(a,r,e.memoizedProps);
vendor: 22,741 bytes, line 1185
1185else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Bf(a,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Wf=null,a=fl,fl=bf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lp(t.containerInfo)}catch(t){Ku(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=bf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=ye()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?rf(m,!0):rf(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:_f(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ha(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ta(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Yf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=bf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=qi($i),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qi($i).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,Ll=null,Rl=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Fl&2&&Rl!==0?Rl&-Rl:N.T===null?Ze():pd()}function hu(){if(Yl===0)if(!(Rl&536870912)||Ei){var e=Ie;Ie<<=1,!(Ie&3932160)&&(Ie=262144),Yl=e}else Yl=536870912;return e=Ya.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Il&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Rl,Yl,!1)),We(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(ql|=n),Gl===4&&bu(e,Rl,Yl,!1)),ad(e))}function _u(e,t,n){if(Fl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Be(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!yu(n)){a=ku(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-ye(),10<a)){if(bu(r,t,Yl,!Vl),ze(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Xd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);ad(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qt},Dl(t,a,d);var m=(a&62914560)===a?eu-ye():(a&4194048)===a?tu-ye():0;if(m=Zf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!mr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function xu(){return Fl&6?!0:(od(0,!1),!1)}function Su(){if(Ll!==null){if(zl===0)var e=Ll.return;else e=Ll,zi=Ri=null,Co(e),wa=null,Ta=0,e=Ll;for(;e!==null;)Fc(e.alternate,e),e=e.return;Ll=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Il=e,Ll=n=ti(e.current,null),Rl=t,zl=0,Bl=null,Vl=!1,Hl=Be(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-je(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,Gr(),n}function wu(e,t){io=null,N.H=Ns,t===ma||t===ga?(t=Sa(),zl=3):t===ha?(t=Sa(),zl=4):zl=t===Zs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,Ll===null&&(Gl=1,Gs(e,li(t,e.current)))}function Tu(){var e=Ya.current;return e===null?!0:(Rl&4194048)===Rl?G===null:(Rl&62914560)===Rl||Rl&536870912?e===G:!1}function Eu(){var e=N.H;return N.H=Ns,e===null?Ns:e}function Du(){var e=N.A;return N.A=Nl,e}function Ou(){Gl=4,Vl||(Rl&4194048)!==Rl&&Ya.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Il===null||bu(Il,Rl,Yl,!1)}function ku(e,t,n){var r=Fl;Fl|=2;var i=Eu(),a=Du();(Il!==e||Rl!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&Ll!==null){var s=Ll,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Ya.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,zi=Ri=null,Fl=r,N.H=i,N.A=a,Ll===null&&(Il=null,Rl=0,Gr()),o}function Au(){for(;Ll!==null;)Nu(Ll)}function ju(e,t){var n=Fl;Fl|=2;var r=Eu(),a=Du();Il!==e||Rl!==t?(ru=null,nu=ye()+500,Cu(e,t)):Hl=Be(e,t);a:do try{if(zl!==0&&Ll!==null){t=Ll;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(va(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Il!==e||(zl=7),ad(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:va(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(Ll.tag){case 26:s=Ll.memoizedState;case 5:case 27:var c=Ll;if(s?Jf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)Ll=l;else{var u=c.return;u===null?Ll=null:(Ll=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return zi=Ri=null,N.H=r,N.A=a,Fl=n,Ll===null?(Il=null,Rl=0,Gr(),Gl):0}function Mu(){for(;Ll!==null&&!_e();)Nu(Ll)}function Nu(e){var t=Ec(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Rl);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Rl);break;case 5:Co(t);default:Fc(n,t),t=Ll=ni(t,Wl),t=Ec(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Fu(e,t,n,r){zi=Ri=null,Co(t),wa=null,Ta=0;var i=t.return;try{if(Xs(e,i,t,n,Rl)){Gl=1,Gs(e,li(n,e.current)),Ll=null;return}}catch(t){if(i!==null)throw Ll=i,t;Gl=1,Gs(e,li(n,e.current)),Ll=null;return}t.flags&32768?(Ei||r===1?e=!0:Hl||Rl&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ya.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Nc(t.alternate,t,Wl);if(n!==null){Ll=n;return}if(t=t.sibling,t!==null){Ll=t;return}Ll=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Ll=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ll=e;return}Ll=e=n}while(e!==null);Gl=6,Ll=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(Fl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Wr,Ge(e,n,o,s,c,l),e===Il&&(Ll=Il=null,Rl=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Ce,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Fl,Fl|=4;try{el(e,t,n)}finally{Fl=s,P.p=a,N.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Fl;Fl|=4;try{pl(t,e);var a=Ud,o=vr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&_r(s.ownerDocument.documentElement,s)){if(c!==null&&yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=W(s,h),v=W(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}dp=!!Hd,Ud=Hd=null}finally{Fl=i,P.p=r,N.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Fl;Fl|=4;try{tl(e,t.alternate,t)}finally{Fl=i,P.p=r,N.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,ve();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),Xe(n),t=t.stateNode,ke&&typeof ke.onCommitFiberRoot==`function`)try{ke.onCommitFiberRoot(Oe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}cu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ta(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=Xe(cu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Fl&6)throw Error(i(331));var c=Fl;if(Fl|=4,Al(o.current),Sl(o,o.current,s,n),Fl=c,od(0,!1),ke&&typeof ke.onPostCommitFiberRoot==`function`)try{ke.onPostCommitFiberRoot(Oe,o)}catch{}return!0}finally{P.p=a,N.T=r,Hu(e,t)}}function Gu(e,t,n){t=li(n,t),t=qs(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(We(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=li(n,e),n=Js(2),r=Ia(t,n,2),r!==null&&(Ys(n,r,t,e),We(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Rl&n)===n&&(Gl===4||Gl===3&&(Rl&62914560)===Rl&&300>ye()-eu?!(Fl&2)&&Cu(e,0):Jl|=n,Xl===Rl&&(Xl=0)),ad(e)}function Yu(e,t){t===0&&(t=He()),e=Jr(e,t),e!==null&&(We(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Yu(e,n)}function Qu(e,t){return he(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=Rl,a=ze(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Yd()&&(e=id);for(var t=ye(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}au!==0&&au!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Rl,n=ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ge(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ge(r),Xe(n)){case 2:case 8:n=Se;break;case 32:n=Ce;break;case 268435456:n=Te;break;default:n=Ce}return r=ud.bind(null,e),n=he(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ge(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Rl;return r=ze(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,ye()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){$d(function(){Fl&6?he(xe,sd):cd()})}function pd(){if(id===0){var e=ia;e===0&&(e=Fe,Fe<<=1,!(Fe&261888)&&(Fe=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Kt(``+e)}function hd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<zr.length;_d++){var vd=zr[_d];Br(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}Br(jr,`onAnimationEnd`),Br(Mr,`onAnimationIteration`),Br(Nr,`onAnimationStart`),Br(`dblclick`,`onDoubleClick`),Br(`focu
1185sin`,`onFocus`),Br(`focusout`,`onBlur`),Br(Pr,`onTransitionRun`),Br(Fr,`onTransitionStart`),Br(Ir,`onTransitionCancel`),Br(Lr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Vr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Vr(e)}i.currentTarget=null,a=c}}}}function Sd(e,t){var n=t[rt];n===void 0&&(n=t[rt]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=`_reactListening`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,mt.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!rn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Dd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=lt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}en(function(){var r=a,i=Yt(n),s=[];a:{var c=Rr.get(e);if(c!==void 0){var l=hn,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=Nn;break;case`focusin`:u=`focus`,l=wn;break;case`focusout`:u=`blur`,l=wn;break;case`beforeblur`:case`afterblur`:l=wn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Sn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Cn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Fn;break;case jr:case Mr:case Nr:l=Tn;break;case Lr:l=In;break;case`scroll`:case`scrollend`:l=_n;break;case`wheel`:l=Ln;break;case`copy`:case`cut`:case`paste`:l=En;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Pn;break;case`toggle`:case`beforetoggle`:l=Rn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=tn(m,p),g!=null&&d.push(Od(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Jt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[nt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?lt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Sn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Pn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ad,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&jd(s,c,l,d,!1),u!==null&&f!==null&&jd(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ir;else if(Qn(c))if(H)v=fr;else{v=ur;var y=lr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ut(r.elementType)&&(v=ir):v=dr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(xr=y,Sr=r,Cr=null);break;case`focusout`:Cr=Sr=xr=null;break;case`mousedown`:wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:wr=!1,Tr(s,n,i);break;case`selectionchange`:if(br)break;case`keydown`:case`keyup`:Tr(s,n,i)}var b;if(Bn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Un&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=ln()):(on=i,sn=`value`in on?on.value:on.textContent,Jn=!0)),y=kd(r,x),0<y.length&&(x=new Dn(x,e,null,n,i),s.push({event:x,listeners:y}
vendor: 11,460 bytes, lines 1185-1186
1185),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Hn?Yn(e,n):Xn(e,n))&&(x=kd(r,`onBeforeInput`),0<x.length&&(y=new Dn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=tn(e,n),i!=null&&r.unshift(Od(e,i,a)),i=tn(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=tn(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,`
1186`).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Id(e,t,`name`,a.name,a,null),Id(e,t,`formEncType`,a.formEncType,a,null),Id(e,t,`formMethod`,a.formMethod,a,null),Id(e,t,`formTarget`,a.formTarget,a,null)):(Id(e,t,`encType`,a.encType,a,null),Id(e,t,`method`,a.method,a,null),Id(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Kt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Sd(`beforetoggle`,e),Sd(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Wt.get(n)||n,St(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case`style`:Ht(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[tt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):St(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Sd(`error`,e),Sd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Id(e,t,o,s,n,null)}}a&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:Sd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Id(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Sd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in Sd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Id(e,t,s,c,n,null)}Rt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Id(e,t,l,r,n,null)}return;case`dialog`:Sd(`beforetoggle`,e),Sd(`toggle`,e),Sd(`cancel`,e),Sd(`close`,e);break;case`iframe`:case`object`:Sd(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)Sd(yd[r],e);break;case`image`:Sd(`error`,e),Sd(`load`,e);break;case`details`:Sd(`toggle`,e);break;case`embed`:case`source`:case`link`:Sd(`error`,e),Sd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Id(e,t,u,r,n,null)}return;default:if(Ut(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Id(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Id(e,t,p,m,r,f)}}Nt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Id(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Id(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Id(e,t,s,a,r,o)}Lt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Id(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Id(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Id(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Id(e,t,u,p,r,m)}return;default:if(Ut(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(e,t,_,void 0,r,p);
vendor: 4,463 bytes, line 1186
1186for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Bd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Bd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Kd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function qd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===`head`}function nf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Lp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_f(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_f(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[st]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_f(e.ownerDocument.body);n=i}while(n);Lp(t)}function rf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function af(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:af(n),ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function of(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[st])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=ff(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===``)return null;for(;
vendor: 20,213 bytes, line 1186
1186e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ff(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ff(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function uf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function df(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function ff(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var pf=null;function mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ff(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function gf(e,t,n){switch(t=Wd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var vf=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=P.d;P.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=xu();return e||t}function Cf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?xs(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=Pf(e);break;case`script`:a=Rf(e)}vf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!vf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=ft(r).hoistableStyles,a=Pf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);pt(c),Rd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=ft(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=f({src:e,async:!0},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),pt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=ft(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),pt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=re.current)?bf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Pf(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pf(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vf.set(e,n),o||Lf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Rf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pf(e){return`href="`+Mt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Rd(t,`link`,n),pt(t),e.head.appendChild(t))}function Rf(e){return`[src="`+Mt(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),Rd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pf(n.href);var o=e.querySelector(Ff(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=If(n),(a=vf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,pt(a),a):(r=n,(a=vf.get(o))&&(r=f({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Rd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vf(r,n.precedence,e));return t.instance}function Vf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[st]||a[et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pf(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=If(r),(i=vf.get(i))&&Hf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Qf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var np={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function rp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=$r(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Na(a),e}function ap(e){return e?(e=Zr,e):Zr}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=Fa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ia(e,r,t),n!==null&&(gu(n,e,t),La(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=Jr(e,67108864);t!==null&&gu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=mu();t=Ye(t);var n=Jr(e,t);n!==null&&gu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,mp(e,t,n,r)}finally{P.p=a,N.T=i}}function pp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,mp(e,t,n,r)}finally{P.p=a,N.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)Dd(e,t,r,gp,n),Dp(e,r);else if(kp(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.indexOf(e)){for(;i!==null;){var a=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-je(o);s.entanglements[1]|=c,o&=~c}ad(a),!(Fl&6)&&(nu=ye()+500,od(0,!1))}}break;case 31:case 13:s=Jr(a,2),s!==null&&gu(s,a,2),xu(),cp(a,2)}if(a=hp(r),a===null&&Dd(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function hp(e){return e=Yt(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=lt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return gp=e,null}function vp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(be()){case xe:return 2;case Se:return 8;case Ce:case we:return 32;case Te:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ut(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function kp(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ap(e){var t=lt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){up(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){up(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=ut(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){jp(e)&&n.delete(t)}function Np(){yp=!1,bp!==null&&jp(bp)&&(bp=null),xp!==null&&jp(xp)&&(xp=null),Sp!==null&&jp(Sp)&&(Sp=null),Cp.forEach(Mp),wp.forEach(Mp)}function Pp(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Np)))}var Fp=null;function Ip(e){Fp!==e&&(Fp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fp===e&&(Fp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(_p(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,ys(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Lp(e){function t(t){return Pp(t,e)}bp!==null&&Pp(bp,e),xp!==null&&Pp(xp,e),Sp!==null&&Pp(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Tp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[tt]||null;if(typeof a==`function`)o||Ip(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Ip(n)}}}function Rp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function zp(e){this._internalRoot=e}Bp.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;op(n,mu(),e,t,null,null)},Bp.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;
1186op(e.current,2,null,e,null,null),xu(),t[nt]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&Ap(e)}};var Vp=n.version;if(Vp!==`19.2.8`)throw Error(i(527,Vp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Hp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{Oe=Up.inject(Hp),ke=Up}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Hs,s=Us,c=Ws;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ip(e,1,!1,null,null,n,r,null,o,s,c,Rp),e[nt]=t.current,Td(e),new zp(t)}})),tb=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=eb()}))(),Z=c(Zy(),1),nb={"nbk.io":{logo:`branding/nbk.io/logo-nbk.png`,accent:`#ff0000`},"dual-agar.me":{logo:`branding/dual-agar/logo-dual-agar.png`,accent:`#3e88ce`},"dual-agar.online":{logo:`branding/dual-agar/logo-dual-agar.png`,accent:`#3e88ce`},"agar2.io":{logo:`branding/agar2.io/logo-agar2.png`}};function rb(e){let t=e.toLowerCase();for(;t;){let e=nb[t];if(typeof e==`string`&&(e=nb[e]),e)return e;let n=t.indexOf(`.`);t=n===-1?``:t.slice(n+1)}return{}}var ib=rb(location.hostname),ab=document.querySelector(`meta[property="og:site_name"]`)?.getAttribute(`content`)||`Senpa.io`,ob=`/web/`;function sb(e){return/^(https?:)?\/\//.test(e)?e:ob+e}function cb(e){return ib.logo?sb(ib.logo):e}function lb(e,t,n){let r=parseInt(e.slice(1),16),i=parseInt(t.slice(1),16),a=`#`;for(let e of[16,8,0]){let t=r>>e&255,o=i>>e&255;a+=Math.round(t+(o-t)*n).toString(16).padStart(2,`0`)}return a}function ub(e){let t=lb(e,`#6e6e6e`,.7),n=[16,8,0].map(t=>parseInt(e.slice(1),16)>>t&255).join(`, `),r={"--ui-accent":e,"--ui-accent-rgb":n,"--ui-accent-hover":lb(e,`#ffffff`,.18),"--ui-accent-dark":lb(e,`#000000`,.23),"--theme-accent":e,"--theme-accent-dark":lb(e,`#000000`,.32),"--theme-accent-light":lb(e,`#ffffff`,.25),"--theme-accent-dark-lightened":lb(e,`#000000`,.16),"--theme-accent-disabled-light":t,"--theme-accent-disabled-dark":lb(t,`#000000`,.22),"--theme-accent-vivid":e,"--theme-link-visited":lb(e,`#ffffff`,.55),"--m-accent":e,"--m-accent-rgb":n},i=document.documentElement.style;for(let[e,t]of Object.entries(r))i.setProperty(e,t)}function db(){let{accent:e}=ib;if(e){ub(e);for(let t of Object.values(By.theme.hud))t.default===`#e67bbe`&&(t.default=e)}}var fb=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Q=o(((e,t)=>{t.exports=fb()}))();function pb({children:e}){let[t,n]=(0,Z.useState)(!1),[r,i]=(0,Z.useState)(!1);return(0,Z.useEffect)(()=>{window.addEventListener(`load`,()=>{n(!0),setTimeout(()=>{i(!0)},1e3)})},[]),(0,Q.jsxs)(Q.Fragment,{children:[t&&e,(0,Q.jsx)(`div`,{id:`loader`,style:{opacity:+!t,display:r?`none`:void 0,backgroundImage:`url(./img/food-bg.png)`},children:(0,Q.jsx)(`img`,{className:`senpaio-logo`,src:cb(`./img/logo-med.png`),alt:ab,draggable:`false`})})]})}var mb=c(o(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];
1186n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1);function hb(e,t,n=[]){let r=(0,Z.useRef)(t);r.current=t,(0,Z.useEffect)(()=>{if(e)return q.register(e,(...e)=>r.current?.(...e))},[e,...n])}function gb(){let e=(0,Z.useRef)(),[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(!1);return hb(A.Chat_Toggle,()=>{i(e=>!e)}),(0,Z.useEffect)(()=>{!r&&t?(q.dispatch(A.Send_Chat,t),n(``)):r&&e.current.focus()},[r]),(0,Q.jsx)(`input`,{className:(0,mb.default)(`chat-input`,r&&`active`),placeholder:`Enter message...`,maxLength:`100`,value:t,onChange:({target:e})=>{n(e.value)},ref:e})}var _b=[`All`,`Party`],vb=8;function yb(){let e=(0,Z.useRef)(),[t,n]=(0,Z.useState)(0),[r,i]=(0,Z.useState)([]),[a,o]=(0,Z.useState)([]),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),h=e=>{o(t=>(t.length>=vb&&t.splice(0,1),[...t,e]))},g=(0,Z.useCallback)(e=>{i(t=>[...t,e]),d===`pop-up`&&h(e)},[d]),_=()=>r.filter(e=>e.room===t),v=e=>{n(e),q.dispatch(A.Chat_Mode_Toggled,e)},y=(0,Z.useCallback)(()=>{let e={message:`Connected to party chat for no tag`,nick:`SERVER`,type:1,room:1,time:Date.now()};p!==``&&(e.message=e.message.replace(`no tag`,`[${p}]`)),g(e)},[g,p]);return hb(A.Settings,e=>{c(e.chatTab),u(e.chatNick),f(e.chatType)}),hb(A.Player_Tag,e=>m(e)),hb(A.Clear_Notifications,()=>{i([]),o([]),y()}),hb(A.Notify_TagChange,()=>{t===1&&y()}),hb(A.Chat_ToggleMode,()=>{let e=t+1>=_b.length?0:t+1;if(v(e),d===`pop-up`){let t={nick:`SERVER`,message:e===0?`Connected to global chat`:`Connected to party chat for no tag`,room:e,type:1,time:Date.now()};e===1&&p!==``&&(t.message=t.message.replace(`no tag`,`[${p}]`)),h(t)}}),hb(A.Notify_ShowNotification,e=>g(e)),(0,Z.useEffect)(()=>{q.dispatch(A.Request_Settings)},[]),(0,Z.useEffect)(()=>{e.current?.scrollIntoView({behavior:`smooth`})},[r,t]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{id:`chat-room`,style:{display:d===`chatroom`?`block`:`none`},children:[(0,Q.jsx)(`div`,{id:`chat-control`,children:_b.map((e,n)=>(0,Q.jsx)(`button`,{type:`button`,className:(0,mb.default)(t===n&&`active`),style:{backgroundColor:t===n&&s},onClick:()=>v(n),children:e},n))}),(0,Q.jsx)(`div`,{id:`chat-room-inner`,onWheel:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:(0,Q.jsx)(bb,{id:t,messages:_(),lastMessage:e,nickColor:l})})]}),(0,Q.jsx)(`div`,{className:`popup-container`,style:{display:d===`pop-up`?`block`:`none`,width:`250px`},children:a.map(e=>(0,Q.jsx)(Cb,{message:e,remove:()=>o(t=>t.filter(t=>t.time!==e.time))},e.time))})]})}function bb({messages:e,lastMessage:t,nickColor:n}){return(0,Q.jsxs)(`div`,{className:`current-chat-room`,children:[e.map(({type:e,color:t,time:r,nick:i,hasReservedName:a,tag:o,message:s},c)=>(0,Q.jsx)(Sb,{type:e,color:t,time:r,nick:i,hasReservedName:a,tag:o,message:s,nickColor:n},c)),(0,Q.jsx)(`div`,{ref:t})]})}var xb={0:`[banned] `,1:``,2:(0,Q.jsx)(`span`,{style:{color:`yellow`},children:`[VIP]`}),3:(0,Q.jsx)(`span`,{style:{color:`orange`},children:`[YT]`}),90:(0,Q.jsx)(`span`,{style:{color:`lightblue`},children:`[Mod]`}),100:(0,Q.jsx)(`span`,{style:{color:`red`},children:`[Admin]`})};function Sb({type:e,color:t,time:n,nick:r,hasReservedName:i,tag:a,message:o,nickColor:s}){let c={};t&&i?c.color=t:c.color=s,xb[e]&&(r=` `+r);let l=new Date(n);return(0,Q.jsxs)(`div`,{msg:``,children:[(0,Q.jsx)(`span`,{className:`time`,children:`${l.getHours().toString().padStart(2,`0`)}:${l.getMinutes().toString().padStart(2,`0`)}`}),(0,Q.jsxs)(`span`,{className:`nick`,style:c,children:[xb[e],r,` :`]}),(0,Q.jsx)(`span`,{className:`message`,children:o})]})}function Cb({message:e,remove:t}){let[n,r]=(0,Z.useState)(!1),i=(0,Z.useRef)(null),a=()=>{r(!0),setTimeout(t,500)};(0,Z.useEffect)(()=>{i.current.style.position=`absolute`,i.current.style.left=`-9999px`,i.current.style.height=`auto`;let e=i.current.clientHeight-20;i.current.style.removeProperty(`position`),i.current.style.removeProperty(`left`),i.current.style.removeProperty(`height`),i.current.style.setProperty(`--notification-height`,`${e}px`),i.current.classList.add(`animate`);let t=setTimeout(a,7e3);return()=>clearTimeout(t)},[]);let o={};return e.color&&e.hasReservedName&&(o.color=e.color),(0,Q.jsxs)(`div`,{className:`popup ${n?`dismissed`:``}`,ref:i,children:[(0,Q.jsx)(`strong`,{style:o,children:e.nick}),` `,e.message]})}var wb=Symbol(),Tb=Symbol(),Eb=`a`,Db=`f`,Ob=`p`,kb=`c`,Ab=`t`,jb=`h`,Mb=`w`,Nb=`o`,Pb=`k`,Fb=(e,t)=>
1186new Proxy(e,t),Ib=Object.getPrototypeOf,Lb=new WeakMap,Rb=e=>e&&(Lb.has(e)?Lb.get(e):Ib(e)===Object.prototype||Ib(e)===Array.prototype),zb=e=>typeof e==`object`&&!!e,Bb=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.configurable&&!e.writable),Vb=e=>{if(Array.isArray(e))return Array.from(e);let t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(e=>{e.configurable=!0}),Object.create(Ib(e),t)},Hb=(e,t)=>{let n={[Db]:t},r=!1,i=(t,i)=>{if(!r){let r=n[Eb].get(e);if(r||(r={},n[Eb].set(e,r)),t===Mb)r[Mb]=!0;else{let e=r[t];e||(e=new Set,r[t]=e),e.add(i)}}},a=()=>{r=!0,n[Eb].delete(e)},o={get(t,r){return r===Tb?e:(i(Pb,r),Wb(Reflect.get(t,r),n[Eb],n[kb],n[Ab]))},has(e,t){return t===wb?(a(),!0):(i(jb,t),Reflect.has(e,t))},getOwnPropertyDescriptor(e,t){return i(Nb,t),Reflect.getOwnPropertyDescriptor(e,t)},ownKeys(e){return i(Mb),Reflect.ownKeys(e)}};return t&&(o.set=o.deleteProperty=()=>!1),[o,n]},Ub=e=>e[Tb]||e,Wb=(e,t,n,r)=>{if(!Rb(e))return e;let i=r&&r.get(e);if(!i){let t=Ub(e);i=Bb(t)?[t,Vb(t)]:[t],r?.set(e,i)}let[a,o]=i,s=n&&n.get(a);return(!s||s[1][Db]!==!!o)&&(s=Hb(a,!!o),s[1][Ob]=Fb(o||a,s[0]),n&&n.set(a,s)),s[1][Eb]=t,s[1][kb]=n,s[1][Ab]=r,s[1][Ob]},Gb=(e,t)=>{let n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((e,t)=>e!==r[t])},Kb=(e,t,n,r,i=Object.is)=>{if(i(e,t))return!1;if(!zb(e)||!zb(t))return!0;let a=n.get(Ub(e));if(!a)return!0;if(r){if(r.get(e)===t)return!1;r.set(e,t)}let o=null;for(let n of a[jb]||[])if(o=Reflect.has(e,n)!==Reflect.has(t,n),o)return o;if(a[Mb]===!0){if(o=Gb(e,t),o)return o}else for(let n of a[Nb]||[])if(o=!!Reflect.getOwnPropertyDescriptor(e,n)!=!!Reflect.getOwnPropertyDescriptor(t,n),o)return o;for(let s of a[Pb]||[])if(o=Kb(e[s],t[s],n,r,i),o)return o;if(o===null)throw Error(`invalid used`);return o},qb=e=>Rb(e)&&e[Tb]||null,Jb=(e,t=!0)=>{Lb.set(e,t)},Yb=e=>typeof e==`object`&&!!e,Xb=e=>Yb(e)&&!ex.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),Zb=(e,t)=>{let n=tx.get(e);if(n?.[0]===t)return n[1];let r=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return Jb(r,!0),tx.set(e,[t,r]),Reflect.ownKeys(e).forEach(t=>{if(Object.getOwnPropertyDescriptor(r,t))return;let n=Reflect.get(e,t),{enumerable:i}=Reflect.getOwnPropertyDescriptor(e,t),a={value:n,enumerable:i,configurable:!0};if(ex.has(n))Jb(n,!1);else if($b.has(n)){let[e,t]=$b.get(n);a.value=Zb(e,t())}Object.defineProperty(r,t,a)}),r},Qb=(e,t,n,r)=>({deleteProperty(e,t){let i=Reflect.get(e,t);n(t);let a=Reflect.deleteProperty(e,t);return a&&r(lx?.(`delete`,t,i)),a},set(i,a,o,s){let c=!e()&&Reflect.has(i,a),l=Reflect.get(i,a,s);if(c&&(ix(l,o)||rx.has(o)&&ix(l,rx.get(o))))return!0;n(a),Yb(o)&&(o=qb(o)||o);let u=!$b.has(o)&&ox(o)?ux(o):o;return t(a,u),Reflect.set(i,a,u,s),r(lx?.(`set`,a,o,l)),!0}}),$b=new WeakMap,ex=new WeakSet,tx=new WeakMap,nx=[1],rx=new WeakMap,ix=Object.is,ax=(e,t)=>new Proxy(e,t),ox=Xb,sx=Zb,cx=Qb,lx;function ux(e={}){if(!Yb(e))throw Error(`object required`);let t=rx.get(e);if(t)return t;let n=nx[0],r=new Set,i=(e,t=++nx[0])=>{n!==t&&(a=n=t,r.forEach(n=>n(e,t)))},a=n,o=(e=nx[0])=>(a!==e&&(a=e,c.forEach(([t])=>{let r=t[1](e);r>n&&(n=r)})),n),s=e=>(t,n)=>{let r;t&&(r=[...t],r[1]=[e,...r[1]]),i(r,n)},c=new Map,l=(e,t)=>{let n=!ex.has(t)&&$b.get(t);if(n)if(r.size){let t=n[2](s(e));c.set(e,[n,t])}else c.set(e,[n])},u=e=>{var t;let n=c.get(e);n&&(c.delete(e),(t=n[1])==null||t.call(n))},d=e=>(r.add(e),r.size===1&&c.forEach(([e,t],n)=>{let r=e[2](s(n));c.set(n,[e,r])}),()=>{r.delete(e),r.size===0&&c.forEach(([e,t],n)=>{t&&(t(),c.set(n,[e]))})}),f=!0,p=ax(e,cx(()=>f,l,u,i));rx.set(e,p);let m=[e,o,d];return $b.set(p,m),Reflect.ownKeys(e).forEach(t=>{let n=Object.getOwnPropertyDescriptor(e,t);`value`in n&&n.writable&&(p[t]=e[t])}),f=!1,p}function dx(e,t,n){let r=$b.get(e),i,a=[],o=r[2],s=!1,c=o(e=>{if(e&&a.push(e),n){t(a.splice(0));return}i||=Promise.resolve().then(()=>{i=void 0,s&&t(a.splice(0))})});return s=!0,()=>{s=!1,c()}}function fx(e){let[t,n]=$b.get(e);return sx(t,n())}var px=new WeakMap;function mx(e,t){let n=t?.sync,r=(0,Z.useMemo)(()=>e&&new WeakMap,[e]),i=(0,Z.useRef)(void 0),a=!0,o=(0,Z.useSyncExternalStore)((0,Z.useCallback)(t=>{let r=dx(e,t,n);return t(),r},[e,n]),()=>{let t=fx(e);try{if(!a&&i.current&&!Kb(i.current,t,r,new WeakMap))return i.current}catch{}return t},()=>fx(e));return a=!1,(0,Z.useLayoutEffect)(()=>{i.current=o}),Wb(o,r,(0,Z.useMemo)(()=>new WeakMap,[]),px)}function hx(){return{authToken:null,account:null,region:localStorage.getItem(Mt.storageKeys.region)||`EU`,skinList:{tab:`level`,search:``,page:1},profile:{nick:`Profile 1`,skin1:``,skin2:``,hat1:0,hat2:0},profiles:{selected:0,list:[],tag:``,version:`2.0.0`}}}function gx(e){Nn.onTokenChange(t=>{e.authToken=t||null})}function _x(e){let t=JSON.parse(localStorage.getItem(Mt.storageKeys.profiles))||{};isNaN(t.selected)||(e.profiles.selected=Number(t.selected)),typeof t.tag==`string`&&(e.profiles.tag=t.tag);let n=t.list||[];for(let t=0;t<Mt.maxProfiles;t++){let r=n[t]||{};e.profiles.list.push({nick:r.nick||`Profile ${t+1}`,skin1:r.skin1||``,skin2:r.skin2||``,hat1:Number(r.hat1)||0,hat2:Number(r.hat2)||0})}e.profiles.list[e.profiles.selected]||(e.profiles.selected=0),e.profile=e.profiles.list[e.profiles.selected]}function vx(e){dx(e.profiles,()=>{e.profile=e.profiles.list[e.profiles.selected],localStorage.setItem(Mt.storageKeys.profiles,JSON.stringify(e.profiles))}),dx(e.profile,()=>{e.profiles.list[e.profiles.selected]=e.profile})}function yx(e={}){let t=ux({...hx(),...e});return gx(t),_x(t),vx(t),t}var $=yx({customServers:[],scale:1,replayList:{page:1}});function bx(e){return e*Math.max(document.documentElement.clientHeight,window.innerHeight||0)/100}
1186function xx(e){return e*Math.max(document.documentElement.clientWidth,window.innerWidth||0)/100}function Sx(e=window.innerWidth,t=window.innerHeight){return t==0?e:Sx(t,e%t)}function Cx(){let e=Sx(),t=1,{w:n,h:r}={w:16,h:9};t=e*window.innerWidth/(e*window.innerHeight)>n/r?bx(27)/230:r*xx(27)/n/230,$.scale=Math.min(1,t)}window.addEventListener(`resize`,()=>{Cx()});function wx(e){let t=mx($).scale,n={transform:`scale(${t})`};return e&&(n.transform=`translate(-50%, -50%) scale(${t})`),n}function Tx(){let[e,t]=(0,Z.useState)([]),[n,r]=(0,Z.useState)(`SENPA.IO`),[i,a]=(0,Z.useState)(``);return hb(A.LeaderBoard_Update,e=>{t(e)}),hb(A.LeaderBoard_TitleChanged,e=>{r(e)}),hb(A.Settings,e=>{a(e.leaderboardTitle)}),(0,Z.useEffect)(()=>{q.dispatch(A.Request_Settings)},[]),(0,Q.jsxs)(`div`,{className:`leaderboard`,style:wx(!1),children:[(0,Q.jsx)(`div`,{className:`title`,style:{color:i},children:n}),(0,Q.jsx)(`div`,{className:`positions`,children:e.map(({nick:e,mass:t,color:n},r)=>{let i={color:n},a=`(${t})`;return(0,Q.jsxs)(`div`,{style:i,className:`position`,children:[r+1,`. `,e||`Unnamed cell`,` `,a]},r)})})]})}function Ex(){let[e,t]=(0,Z.useState)(`00:00:00`);return hb(A.Server_Time,e=>t(e)),(0,Q.jsx)(`div`,{className:`minimap-root`,style:wx(!1),children:(0,Q.jsx)(`p`,{className:`server-timer`,children:e})})}function Dx(){let[e,t]=(0,Z.useState)({playerCount:0,maxPlayerCount:0,alivePlayerCount:0,specPlayerCount:0,botCount:0});return hb(A.RoomStats_Update,e=>{t(e)}),(0,Q.jsxs)(`div`,{className:`room-stats-display`,children:[e.playerCount,`/`,e.maxPlayerCount,` (play: `,e.alivePlayerCount,`, spec: `,e.specPlayerCount,`) bot:`,` `,e.botCount]})}function Ox(){let[e,t]=(0,Z.useState)([]);return hb(A.PlayerStats_Update,e=>{t(e)}),(0,Q.jsxs)(`div`,{className:`stats-display`,children:[`\xA0`,e.join(`   `)]})}function kx(){let[e,t]=(0,Z.useState)(``),[n,r]=(0,Z.useState)([]);return hb(A.Teamlist_Update,e=>{r(e)}),hb(A.Settings,e=>{t(e.teamplayersTitle)}),(0,Z.useEffect)(()=>{q.dispatch(A.Request_Settings)},[]),(0,Q.jsxs)(`div`,{className:`team-players-list`,style:wx(!1),children:[(0,Q.jsx)(`div`,{className:`team-players-title`,style:{color:e},children:`ALLIES`}),(0,Q.jsx)(`div`,{className:`team-players-positions`,children:n.map((e,t)=>(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`playerRow`,children:[(0,Q.jsx)(`span`,{className:`playerIndex`,children:t+1}),(0,Q.jsx)(`span`,{className:`playerMass`,children:e.mass}),(0,Q.jsx)(`span`,{className:`playerMass`,children:e.location}),(0,Q.jsx)(`span`,{className:`playerNick`,children:e.nick||`Unnamed cell`})]})},t))})]})}function Ax(e){let t=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{let n=t.current;if(n){n.innerHTML=e;for(let e of n.querySelectorAll(`script`)){let t=document.createElement(`script`);for(let n of e.attributes)t.setAttribute(n.name,n.value);t.textContent=e.textContent,e.replaceWith(t)}}},[e]),t}function jx(){let[e,t]=(0,Z.useState)(``);return hb(A.Server_Message_Update,e=>{t(typeof e==`string`?e:``)}),(0,Q.jsx)(`div`,{id:`server-message`,ref:Ax((0,Z.useMemo)(()=>e.split(`
1187`).join(`<br>`),[e]))})}var Mx=100;function Nx(){return{until:$h.emojiCooldownUntil||0,cooldownMs:$h.emojiCooldownMs||0}}function Px({until:e,cooldownMs:t}){let n=Math.max(0,e-performance.now());return{active:n>0,remaining:n,seconds:Math.ceil(n/1e3),fraction:t>0?Math.min(1,n/t):0}}function Fx(){let[e,t]=(0,Z.useState)(Nx),[,n]=(0,Z.useState)(0);hb(A.Emoji_Cooldown,e=>t({until:e?.until??0,cooldownMs:e?.cooldownMs??0}));let r=Px(e);return(0,Z.useEffect)(()=>{if(!r.active)return;let e=setInterval(()=>n(e=>e+1),Mx);return()=>clearInterval(e)},[e,r.active]),r}var Ix=$y(),Lx=4e3,Rx=270,zx=240;function Bx(e){return{onPointerUp:t=>{t.pointerType===`mouse`&&t.button!==0||(t.stopPropagation(),e(t))}}}function Vx({open:e,slots:t,keys:n,cooldown:r,scale:i=1,onPick:a,onClose:o}){if((0,Z.useEffect)(()=>{if(!e)return;let t=setTimeout(o,Lx);return()=>clearTimeout(t)},[e,o]),!e)return null;let s=t.map((e,t)=>e?{...e,index:t}:null).filter(Boolean),c=t.length>1?-150/(t.length-1):0,l=Rx;return(0,Ix.createPortal)((0,Q.jsx)(`div`,{className:(0,mb.default)(`emoji-radial`,r?.active&&`cooling`),onPointerDown:o,onContextMenu:e=>e.preventDefault(),children:(0,Q.jsxs)(`div`,{className:`emoji-radial-ring`,style:{"--s":i},onPointerDown:e=>e.stopPropagation(),children:[(0,Q.jsx)(`div`,{className:`emoji-radial-disc`}),s.map(e=>{let t=(l+c*e.index)*Math.PI/180,i=Math.cos(t)*zx,o=Math.sin(t)*zx,s=n?.[e.index];return(0,Q.jsxs)(`button`,{type:`button`,className:`emoji-radial-item`,style:{"--x":`${i}px`,"--y":`${o}px`,"--i":e.index},"aria-label":`Throw emoji ${e.index+1}`,disabled:r?.active,onMouseDown:e=>e.preventDefault(),...Bx(()=>a(e.index)),children:[(0,Q.jsx)(`img`,{src:e.image_url,alt:``,draggable:`false`}
1187),s&&(0,Q.jsx)(`span`,{className:`key`,children:s})]},e.index)}),r?.active&&(0,Q.jsxs)(`div`,{className:`emoji-radial-cooldown`,children:[r.seconds,`s`]})]})}),document.body)}var Hx={not_enought_coins:`Not enough coins`,already_owned:`You already own this emoji`,not_for_sale:`This emoji is not for sale`,not_found:`Emoji not found`,emoji_not_owned:`You don't own that emoji`,emoji_slots_duplicate:`An emoji can only sit in one slot`};function Ux(e){return e?Hx[e]||String(e).replace(/[-_]/g,` `):`Something went wrong`}function Wx(e){let t=e&&typeof e==`object`&&Array.isArray(e.emoji_slots)?e.emoji_slots:[];return Array.from({length:4},(e,n)=>t[n]||null)}function Gx(e){return e.map(e=>e?.image_url??null)}function Kx(e){Nt.setEmojiSlots(e&&typeof e==`object`?Gx(Wx(e)):null)}async function qx(e){let t=await Nn.requestJson(Mt.endPoints.emojis.buy(e),{});if(!t||t.error||!t.success)throw Error(t?.error||`buy_failed`);return t}async function Jx(e,t){let n=e.account;if(!n||typeof n!=`object`)throw Error(`not_signed_in`);let r=Wx(n),i=Array.from({length:4},(e,n)=>t[n]||null);n.emoji_slots=i,Nt.setEmojiSlots(Gx(i));try{let e=await Nn.requestJson(Mt.endPoints.emojis.slots,{slots:i.map(e=>e?.id??null)});if(!e||e.error||!e.success)throw Error(e?.error||`save_failed`);return e}catch(t){throw e.account&&typeof e.account==`object`&&(e.account.emoji_slots=r,Nt.setEmojiSlots(Gx(r))),t}}function Yx(){return[1,2,3,4].map(e=>{let t=E[`hkEmoji${e}`];return!t||t===`NO KEY`?``:t})}function Xx(){let{account:e,authToken:t,scale:n}=mx($),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(!1),[,s]=(0,Z.useState)(0),c=Fx(),l=(0,Z.useCallback)(()=>i(!1),[]);hb(A.Chat_Toggle,()=>o(e=>!e)),hb(A.Show_Menu,l),hb(A.Settings,()=>s(e=>e+1));let u=!!t&&typeof e==`object`&&!!e,d=Wx(e);return!u||d.every(e=>!e)?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{className:(0,mb.default)(`emoji-fab`,a&&`chat-open`,r&&`open`,c.active&&`cooling`),style:{transform:`translateX(-50%) scale(${n})`,"--cd":c.fraction},title:`Emojis`,onMouseDown:e=>e.preventDefault(),onClick:()=>i(e=>!e),children:[(0,Q.jsx)(`i`,{className:`fas fa-smile`}),c.active&&(0,Q.jsx)(`span`,{className:`seconds`,children:c.seconds})]}),(0,Q.jsx)(Vx,{open:r,slots:d,keys:Yx(),cooldown:c,scale:n,onPick:e=>
1187{q.dispatch(A.Input_Emoji,e),l()},onClose:l})]})}function Zx(e,t={}){q.dispatch(A.Replay_Action,{...t,type:e})}var Qx={replay_bar:`_replay_bar_1yemc_1`,opacity:`_opacity_1yemc_10`,slider:`_slider_1yemc_13`,text:`_text_1yemc_17`};function $x(){let[e,t]=(0,Z.useState)(100),[n,r]=(0,Z.useState)(0),[i,a]=(0,Z.useState)(0),[o,s]=(0,Z.useState)(!1);return hb(A.Replay_Bar,({show:e,action:t})=>{if(s(e),t)switch(t.type){case`start`:a(0),r(t.max);break;case`update`:a(t.value);break}}),o?(0,Q.jsxs)(`div`,{className:Qx.replay_bar,children:[(0,Q.jsxs)(`div`,{className:Qx.opacity,children:[(0,Q.jsxs)(`div`,{children:[`Opacity `,e,`%`]}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`input`,{id:`replay-opacity-slider`,type:`range`,min:`10`,max:`100`,value:e,className:Qx.slider,onChange:({target:e})=>{let n=Number(e.value);t(n),Zx(`opacity`,{value:n})}})})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:Qx.text,children:[`Packet `,i,` / `,n]})}),(0,Q.jsx)(`input`,{id:`packets`,type:`range`,step:`1`,min:`0`,max:n,value:i,className:Qx.slider,onChange:({target:e})=>{Zx(`jump`,{to:Number(e.value)})},onMouseUp:()=>Zx(`jumpEnded`)})]}):null}function eS(){let e=wx(!1),[t,n]=(0,Z.useState)(!0);return hb(A.Show_HUD,e=>n(e)),(0,Q.jsxs)(`div`,{className:`HUD`,children:[(0,Q.jsxs)(`div`,{style:{display:t?`block`:`none`},children:[(0,Q.jsx)(Dx,{}),(0,Q.jsx)(kx,{}),(0,Q.jsx)(Tx,{}),(0,Q.jsx)(Ex,{}),(0,Q.jsx)(gb,{}),(0,Q.jsx)(Xx,{}),(0,Q.jsx)(jx,{}),(0,Q.jsxs)(`div`,{style:e,className:`hud-left-bottom`,children:[(0,Q.jsx)(yb,{}),(0,Q.jsx)(Ox,{})]})]}),(0,Q.jsx)($x,{})]})}var tS=c(o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.Sweetalert2=r())})(e,(function(){function e(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function t(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function n(t,n){return t.get(e(t,n))}function r(e,n,r){t(e,n),n.set(e,r)}function i(t,n,r){return t.set(e(t,n),r),r}let a={},o=()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus()},s=e=>new Promise(t=>{if(!e)return t();let n=window.scrollX,r=window.scrollY;a.restoreFocusTimeout=setTimeout(()=>{o(),t()},100),window.scrollTo(n,r)}),c=`swal2-`,l=`container.shown.height-auto.iosfix.popup.modal.no-backdrop.no-transition.toast.toast-shown.show.hide.close.title.html-container.actions.confirm.deny.cancel.footer.icon.icon-content.image.input.file.range.select.radio.checkbox.label.textarea.inputerror.input-label.validation-message.progress-steps.active-progress-step.progress-step.progress-step-line.loader.loading.styled.top.top-start.top-end.top-left.top-right.center.center-start.center-end.center-left.center-right.bottom.bottom-start.bottom-end.bottom-left.bottom-right.grow-row.grow-column.grow-fullscreen.rtl.timer-progress-bar.timer-progress-bar-container.scrollbar-measure.icon-success.icon-warning.icon-info.icon-question.icon-error.draggable.dragging`.split(`.`).reduce((e,t)=>(e[t]=c+t,e),{}),u=[`success`,`warning`,`info`,`question`,`error`].reduce((e,t)=>(e[t]=c+t,e),{}),d=`SweetAlert2:`,f=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>{console.warn(`${d} ${typeof e==`object`?e.join(` `):e}`)},m=e=>{console.error(`${d} ${e}`)},h=[],g=e=>{h.includes(e)||(h.push(e),p(e))},_=(e,t=null)=>{g(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:``}`)},v=e=>typeof e==`function`?e():e,y=e=>e&&typeof e.toPromise==`function`,b=e=>y(e)?e.toPromise():Promise.resolve(e),x=e=>e&&Promise.resolve(e)===e,S=()=>navigator.userAgent.includes(`Firefox`),C=()=>document.body.querySelector(`.${l.container}`),w=e=>{let t=C();return t?t.querySelector(e):null},T=e=>w(`.${e}`),E=()=>T(l.popup),D=()=>T(l.icon),O=()=>T(l[`icon-content`]),k=()=>T(l.title),A=()=>T(l[`html-container`]),j=()=>T(l.image),M=()=>T(l[`progress-steps`]),N=()=>T(l[`validation-message`]),P=()=>w(`.${l.actions} .${l.confirm}`),F=()=>w(`.${l.actions} .${l.cancel}`),I=()=>w(`.${l.actions} .${l.deny}`),L=()=>T(l[`input-label`]),ee=()=>w(`.${l.loader}`),R=()=>T(l.actions),z=()=>T(l.footer),te=()=>T(l[`timer-progress-bar`]),ne=()=>T(l.close),re=()=>{let e=E();if(!e)return[];
1187let t=e.querySelectorAll(`[tabindex]:not([tabindex="-1"]):not([tabindex="0"])`),n=Array.from(t).sort((e,t)=>{let n=parseInt(e.getAttribute(`tabindex`)||`0`),r=parseInt(t.getAttribute(`tabindex`)||`0`);return n>r?1:n<r?-1:0}),r=e.querySelectorAll(`
1188  a[href],
1189  area[href],
1190  input:not([disabled]),
1191  select:not([disabled]),
1192  textarea:not([disabled]),
1193  button:not([disabled]),
1194  iframe,
1195  object,
1196  embed,
1197  [tabindex="0"],
1198  [contenteditable],
1199  audio[controls],
1200  video[controls],
1201  summary
1202`),i=Array.from(r).filter(e=>e.getAttribute(`tabindex`)!==`-1`);return[...new Set(n.concat(i))].filter(e=>xe(e))},ie=()=>ce(document.body,l.shown)&&!ce(document.body,l[`toast-shown`])&&!ce(document.body,l[`no-backdrop`]),ae=()=>{let e=E();return e?ce(e,l.toast):!1},oe=()=>{let e=E();return e?e.hasAttribute(`data-loading`):!1},se=(e,t)=>{if(e.textContent=``,t){let n=new DOMParser().parseFromString(t,`text/html`),r=n.querySelector(`head`);r&&Array.from(r.childNodes).forEach(t=>{e.appendChild(t)});let i=n.querySelector(`body`);i&&Array.from(i.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},ce=(e,t)=>t?t.split(/\s+/).every(t=>e.classList.contains(t)):!1,le=(e,t)=>{Array.from(e.classList).forEach(n=>{!Object.values(l).includes(n)&&!Object.values(u).includes(n)&&!Object.values(t.showClass||{}).includes(n)&&e.classList.remove(n)})},ue=(e,t,n)=>{if(le(e,t),!t.customClass)return;let r=t.customClass[n];if(r){if(typeof r!=`string`&&!r.forEach){p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof r}"`);return}pe(e,r)}},B=(e,t)=>{if(!t)return null;switch(t){case`select`:case`textarea`:case`file`:return e.querySelector(`.${l.popup} > .${l[t]}`);case`checkbox`:return e.querySelector(`.${l.popup} > .${l.checkbox} input`);case`radio`:return e.querySelector(`.${l.popup} > .${l.radio} input:checked`)||e.querySelector(`.${l.popup} > .${l.radio} input:first-child`);case`range`:return e.querySelector(`.${l.popup} > .${l.range} input`);default:return e.querySelector(`.${l.popup} > .${l.input}`)}},de=e=>{if(e.focus(),e.type!==`file`){let t=e.value;e.value=``,e.value=t}},fe=(e,t,n)=>{if(!e||!t)return;let r=typeof t==`string`?t.split(/\s+/).filter(Boolean):t;(Array.isArray(e)?e:[e]).forEach(e=>{r.forEach(t=>{n?e.classList.add(t):e.classList.remove(t)})})},pe=(e,t)=>
1202{fe(e,t,!0)},me=(e,t)=>{fe(e,t,!1)},V=(e,t)=>Array.from(e.children).find(e=>e instanceof HTMLElement&&ce(e,t)),he=(e,t,n)=>{n===`${parseInt(`${n}`)}`&&(n=parseInt(n)),n||n===0?e.style.setProperty(t,typeof n==`number`?`${n}px`:n):e.style.removeProperty(t)},ge=(e,t=`flex`)=>{e&&(e.style.display=t)},_e=e=>{e&&(e.style.display=`none`)},ve=(e,t=`block`)=>{e&&new MutationObserver(()=>{be(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},ye=(e,t,n,r)=>{let i=e.querySelector(t);i&&i.style.setProperty(n,r)},be=(e,t,n=`flex`)=>{t?ge(e,n):_e(e)},xe=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),Se=()=>!xe(P())&&!xe(I())&&!xe(F()),Ce=e=>e.scrollHeight>e.clientHeight,we=(e,t)=>{let n=e;for(;n&&n!==t;){if(Ce(n))return!0;n=n.parentElement}return!1},Te=e=>{let t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue(`animation-duration`)||`0`),r=parseFloat(t.getPropertyValue(`transition-duration`)||`0`);return n>0||r>0},Ee=(e,t=!1)=>{let n=te();n&&xe(n)&&(t&&(n.style.transition=`none`,n.style.width=`100%`),setTimeout(()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width=`0%`},10))},De=()=>{let e=te();if(!e)return;let t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty(`transition`),e.style.width=`100%`;let n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},Oe=()=>typeof window>`u`||typeof document>`u`,ke=`
1203 <div aria-labelledby="${l.title}" aria-describedby="${l[`html-container`]}" class="${l.popup}" tabindex="-1">
1204   <button type="button" class="${l.close}"></button>
1205   <ul class="${l[`progress-steps`]}"></ul>
1206   <div class="${l.icon}"></div>
1207   <img class="${l.image}" />
1208   <h2 class="${l.title}" id="${l.title}"></h2>
1209   <div class="${l[`html-container`]}" id="${l[`html-container`]}"></div>
1210   <input class="${l.input}" id="${l.input}" />
1211   <input type="file" class="${l.file}" />
1212   <div class="${l.range}">
1213     <input type="range" />
1214     <output></output>
1215   </div>
1216   <select class="${l.select}" id="${l.select}"></select>
1217   <div class="${l.radio}"></div>
1218   <label class="${l.checkbox}">
1219     <input type="checkbox" id="${l.checkbox}" />
1220     <span class="${l.label}"></span>
1221   </label>
1222   <textarea class="${l.textarea}" id="${l.textarea}"></textarea>
1223   <div class="${l[`validation-message`]}" id="${l[`validation-message`]}"></div>
1224   <div class="${l.actions}">
1225     <div class="${l.loader}"></div>
1226     <button type="button" class="${l.confirm}"></button>
1227     <button type="button" class="${l.deny}"></button>
1228     <button type="button" class="${l.cancel}"></button>
1229   </div>
1230   <div class="${l.footer}"></div>
1231   <div class="${l[`timer-progress-bar-container`]}">
1232     <div class="${l[`timer-progress-bar`]}"></div>
1233   </div>
1234 </div>
1235`.replace(/(^|\n)\s*/g,``),Ae=()=>{let e=C();return e?(e.remove(),me([document.documentElement,document.body],[l[`no-backdrop`],l[`toast-shown`],l[`has-column`]]),!0):!1},je=()=>{a.currentInstance&&a.currentInstance.resetValidationMessage()},Me=()=>{let e=E();if(!e)return;let t=V(e,l.input),n=V(e,l.file),r=e.querySelector(`.${l.range} input`),i=e.querySelector(`.${l.range} output`),a=V(e,l.select),o=e.querySelector(`.${l.checkbox} input`),s=V(e,l.textarea);t&&(t.oninput=je),n&&(n.onchange=je),a&&(a.onchange=je),o&&(o.onchange=je),s&&(s.oninput=je),r&&i&&(r.oninput=()=>{je(),i.value=r.value},r.onchange=()=>{je(),i.value=r.value})},Ne=e=>{if(typeof e==`string`){let t=document.querySelector(e);if(!t)throw Error(`Target element "${e}" not found`);return t}return e},Pe=e=>{let t=E();t&&(t.setAttribute(`role`,e.toast?`alert`:`dialog`),t.setAttribute(`aria-live`,e.toast?`polite`:`assertive`),e.toast||t.setAttribute(`aria-modal`,`true`))},Fe=e=>{window.getComputedStyle(e).direction===`rtl`&&(pe(C(),l.rtl),a.isRTL=!0)},Ie=e=>{let t=Ae();if(Oe()){m(`SweetAlert2 requires document to initialize`);return}let n=document.createElement(`div`);n.className=l.container,t&&pe(n,l[`no-transition`]),se(n,ke),n.dataset.swal2Theme=e.theme;let r=Ne(e.target||`body`);r.appendChild(n),e.topLayer&&(n.setAttribute(`popover`,``),n.showPopover()),Pe(e),Fe(r),Me()},Le=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e==`object`?Re(e,t):e&&se(t,e)},Re=(e,t)=>{`jquery`in e?ze(t,e):se(t,e.toString())},ze=(e,t)=>
1235{if(e.textContent=``,0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Be=(e,t)=>{let n=R(),r=ee();!n||!r||(!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?_e(n):ge(n),ue(n,t,`actions`),Ve(n,r,t),se(r,t.loaderHtml||``),ue(r,t,`loader`))};function Ve(e,t,n){let r=P(),i=I(),a=F();!r||!i||!a||(We(r,`confirm`,n),We(i,`deny`,n),We(a,`cancel`,n),He(r,i,a,n),n.reverseButtons&&(n.toast?(e.insertBefore(a,r),e.insertBefore(i,r)):(e.insertBefore(a,t),e.insertBefore(i,t),e.insertBefore(r,t))))}function He(e,t,n,r){if(!r.buttonsStyling){me([e,t,n],l.styled);return}pe([e,t,n],l.styled),[[e,`confirm`,r.confirmButtonColor],[t,`deny`,r.denyButtonColor],[n,`cancel`,r.cancelButtonColor]].forEach(([e,t,n])=>{n&&e.style.setProperty(`--swal2-${t}-button-background-color`,n),Ue(e)})}function Ue(e){let t=window.getComputedStyle(e);if(t.getPropertyValue(`--swal2-action-button-focus-box-shadow`))return;let n=t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,`rgba($1, $2, $3, 0.5)`);e.style.setProperty(`--swal2-action-button-focus-box-shadow`,t.getPropertyValue(`--swal2-outline`).replace(/ rgba\(.*/,` ${n}`))}function We(e,t,n){let r=f(t);be(e,n[`show${r}Button`],`inline-block`),se(e,n[`${t}ButtonText`]||``),e.setAttribute(`aria-label`,n[`${t}ButtonAriaLabel`]||``),e.className=l[t],ue(e,n,`${t}Button`)}let Ge=(e,t)=>{let n=ne();n&&(se(n,t.closeButtonHtml||``),ue(n,t,`closeButton`),be(n,t.showCloseButton),n.setAttribute(`aria-label`,t.closeButtonAriaLabel||``))},Ke=(e,t)=>{let n=C();n&&(qe(n,t.backdrop),Je(n,t.position),Ye(n,t.grow),ue(n,t,`container`))};function qe(e,t){typeof t==`string`?e.style.background=t:t||pe([document.documentElement,document.body],l[`no-backdrop`])}function Je(e,t){t&&(t in l?pe(e,l[t]):(p(`The "position" parameter is not valid, defaulting to "center"`),pe(e,l.center)))}function Ye(e,t){t&&pe(e,l[`grow-${t}`])}var Xe={innerParams:new WeakMap,domCache:new WeakMap,focusedElement:new WeakMap};let Ze=[`input`,`file`,`range`,`select`,`radio`,`checkbox`,`textarea`],Qe=(e,t)=>{let n=E();if(!n)return;let r=Xe.innerParams.get(e),i=!r||t.input!==r.input;Ze.forEach(e=>{let r=V(n,l[e]);r&&(tt(e,t.inputAttributes),r.className=l[e],i&&_e(r))}),t.input&&(i&&$e(t),nt(t))},$e=e=>{if(!e.input)return;if(!st[e.input]){m(`Unexpected type of input! Expected ${Object.keys(st).join(` | `)}, got "${e.input}"`);return}let t=at(e.input);if(!t)return;let n=st[e.input](t,e);ge(t),e.inputAutoFocus&&setTimeout(()=>{de(n)})},et=e=>{for(let{name:t}of Array.from(e.attributes))[`id`,`type`,`value`,`style`].includes(t)||e.removeAttribute(t)},tt=(e,t)=>{let n=E();if(!n)return;let r=B(n,e);if(r){et(r);for(let e in t)r.setAttribute(e,t[e])}},nt=e=>{if(!e.input)return;let t=at(e.input);t&&ue(t,e,`input`)},rt=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},it=(e,t,n)=>{if(n.inputLabel){let r=document.createElement(`label`),i=l[`input-label`];r.setAttribute(`for`,e.id),r.className=i,typeof n.customClass==`object`&&pe(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement(`beforebegin`,r)}},at=e=>{let t=E();if(t)return V(t,l[e]||l.input)},ot=(e,t)=>{[`string`,`number`].includes(typeof t)?e.value=`${t}`:x(t)||p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},st={};st.text=st.email=st.password=st.number=st.tel=st.url=st.search=st.date=st[`datetime-local`]=st.time=st.week=st.month=(e,t)=>{let n=e;return ot(n,t.inputValue),it(n,n,t),rt(n,t),n.type=t.input,n},st.file=(e,t)=>{let n=e;return it(n,n,t),rt(n,t),n},st.range=(e,t)=>{let n=e,r=n.querySelector(`input`),i=n.querySelector(`output`);return r&&(ot(r,t.inputValue),r.type=t.input,it(r,e,t)),i&&ot(i,t.inputValue),e},st.select=(e,t)=>{let n=e;if(n.textContent=``,t.inputPlaceholder){let e=document.createElement(`option`);se(e,t.inputPlaceholder),e.value=``,e.disabled=!0,e.selected=!0,n.appendChild(e)}return it(n,n,t),n},st.radio=e=>{let t=e;return t.textContent=``,e},st.checkbox=(e,t)=>{let n=E();if(!n)throw Error(`Popup not found`);let r=B(n,`checkbox`);if(!r)throw Error(`Checkbox input not found`);r.value=`1`,r.checked=!!t.inputValue;let i=e.querySelector(`span`);if(i){let e=t.inputPlaceholder||t.inputLabel;e&&se(i,e)}return r},st.textarea=(e,t)=>{let n=e;ot(n,t.inputValue),rt(n,t),it(n,n,t);let r=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout(()=>{if(`MutationObserver`in window){let e=E();if(!e)return;let i=parseInt(window.getComputedStyle(e).width);new MutationObserver(()=>{if(!document.body.contains(n))return;let e=n.offsetWidth+r(n),a=E();a&&(e>i?a.style.width=`${e}px`:he(a,`width`,t.width))}).observe(n,{attributes:!0,attributeFilter:[`style`]})}}),n};let ct=(e,t)=>
1235{let n=A();n&&(ve(n),ue(n,t,`htmlContainer`),t.html?(Le(t.html,n),ge(n,`block`)):t.text?(n.textContent=t.text,ge(n,`block`)):_e(n),Qe(e,t))},lt=(e,t)=>{let n=z();n&&(ve(n),be(n,!!t.footer,`block`),t.footer&&Le(t.footer,n),ue(n,t,`footer`))},ut=(e,t)=>{let n=Xe.innerParams.get(e),r=D();if(r){if(n&&t.icon===n.icon){mt(r,t),dt(r,t);return}if(!t.icon&&!t.iconHtml){_e(r);return}if(t.icon&&Object.keys(u).indexOf(t.icon)===-1){m(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),_e(r);return}ge(r),mt(r,t),dt(r,t),pe(r,t.showClass&&t.showClass.icon),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,ft)}},dt=(e,t)=>{for(let[n,r]of Object.entries(u))t.icon!==n&&me(e,r);pe(e,t.icon&&u[t.icon]),ht(e,t),ft(),ue(e,t,`icon`)},ft=()=>{let e=E();if(!e)return;let t=window.getComputedStyle(e).getPropertyValue(`background-color`);e.querySelectorAll(`[class^=swal2-success-circular-line], .swal2-success-fix`).forEach(e=>{e.style.backgroundColor=t})},pt=e=>`
1236  ${e.animation?`<div class="swal2-success-circular-line-left"></div>`:``}
1237  <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
1238  <div class="swal2-success-ring"></div>
1239  ${e.animation?`<div class="swal2-success-fix"></div>`:``}
1240  ${e.animation?`<div class="swal2-success-circular-line-right"></div>`:``}
1241`,mt=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,r=``;t.iconHtml?r=gt(t.iconHtml):t.icon===`success`?(r=pt(t),n=n.replace(/ style=".*?"/g,``)):t.icon===`error`?r=`
1242  <span class="swal2-x-mark">
1243    <span class="swal2-x-mark-line-left"></span>
1244    <span class="swal2-x-mark-line-right"></span>
1245  </span>
1246`:t.icon&&(r=gt({question:`?`,warning:`!`,info:`i`}[t.icon])),n.trim()!==r.trim()&&se(e,r)},ht=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(let n of[`.swal2-success-line-tip`,`.swal2-success-line-long`,`.swal2-x-mark-line-left`,`.swal2-x-mark-line-right`])ye(e,n,`background-color`,t.iconColor);ye(e,`.swal2-success-ring`,`border-color`,t.iconColor)}},gt=e=>`<div class="${l[`icon-content`]}">${e}</div>`,_t=(e,t)=>{let n=j();if(n){if(!t.imageUrl){_e(n);return}ge(n,``),n.setAttribute(`src`,t.imageUrl),n.setAttribute(`alt`,t.imageAlt||``),he(n,`width`,t.imageWidth),he(n,`height`,t.imageHeight),n.className=l.image,ue(n,t,`image`)}},vt=!1,yt=0,bt=0,xt=0,St=0,Ct=e=>{e.addEventListener(`mousedown`,Tt),document.body.addEventListener(`mousemove`,Et),e.addEventListener(`mouseup`,Dt),e.addEventListener(`touchstart`,Tt),document.body.addEventListener(`touchmove`,Et),e.addEventListener(`touchend`,Dt)},wt=e=>{e.removeEventListener(`mousedown`,Tt),document.body.removeEventListener(`mousemove`,Et),e.removeEventListener(`mouseup`,Dt),e.removeEventListener(`touchstart`,Tt),document.body.removeEventListener(`touchmove`,Et),e.removeEventListener(`touchend`,Dt)},Tt=e=>{let t=E();if(!t)return;let n=D();if(e.target===t||n&&n.contains(e.target)){vt=!0;let n=Ot(e);yt=n.clientX,bt=n.clientY,xt=parseInt(t.style.insetInlineStart)||0,St=parseInt(t.style.insetBlockStart)||0,pe(t,`swal2-dragging`)}},Et=e=>{let t=E();if(t&&vt){let{clientX:n,clientY:r}=Ot(e),i=n-yt;t.style.insetInlineStart=`${xt+(a.isRTL?-i:i)}px`,t.style.insetBlockStart=`${St+(r-bt)}px`}},Dt=()=>{let e=E();vt=!1,me(e,`swal2-dragging`)},Ot=e=>{let t=e.type.startsWith(`touch`)?e.touches[0]:e;return{clientX:t.clientX,clientY:t.clientY}},kt=(e,t)=>{let n=C(),r=E();if(!(!n||!r)){if(t.toast){he(n,`width`,t.width),r.style.width=`100%`;let e=ee();e&&r.insertBefore(e,D())}else he(r,`width`,t.width);he(r,`padding`,t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),_e(N()),At(r,t),t.draggable&&!t.toast?(pe(r,l.draggable),Ct(r)):(me(r,l.draggable),wt(r))}},At=(e,t)=>{let n=t.showClass||{};e.className=`${l.popup} ${xe(e)?n.popup:``}`,t.toast?(pe([document.documentElement,document.body],l[`toast-shown`]),pe(e,l.toast)):pe(e,l.modal),ue(e,t,`popup`),typeof t.customClass==`string`&&pe(e,t.customClass),t.icon&&pe(e,l[`icon-${t.icon}`])},jt=(e,t)=>{let n=M();if(!n)return;let{progressSteps:r,currentProgressStep:i}=t;if(!r||r.length===0||i===void 0){_e(n);return}ge(n),n.textContent=``,i>=r.length&&p(`Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)`),r.forEach((e,a)=>{let o=Mt(e);
1246if(n.appendChild(o),a===i&&pe(o,l[`active-progress-step`]),a!==r.length-1){let e=Nt(t);n.appendChild(e)}})},Mt=e=>{let t=document.createElement(`li`);return pe(t,l[`progress-step`]),se(t,e),t},Nt=e=>{let t=document.createElement(`li`);return pe(t,l[`progress-step-line`]),e.progressStepsDistance&&he(t,`width`,e.progressStepsDistance),t},Pt=(e,t)=>{let n=k();n&&(ve(n),be(n,!!(t.title||t.titleText),`block`),t.title&&Le(t.title,n),t.titleText&&(n.innerText=t.titleText),ue(n,t,`title`))},Ft=(e,t)=>{var n;kt(e,t),Ke(e,t),jt(e,t),ut(e,t),_t(e,t),Pt(e,t),Ge(e,t),ct(e,t),Be(e,t),lt(e,t);let r=E();typeof t.didRender==`function`&&r&&t.didRender(r),(n=a.eventEmitter)==null||n.emit(`didRender`,r)},It=()=>xe(E()),Lt=()=>P()?.click(),Rt=()=>I()?.click(),zt=()=>F()?.click(),Bt=Object.freeze({cancel:`cancel`,backdrop:`backdrop`,close:`close`,esc:`esc`,timer:`timer`}),Vt=e=>{if(e.keydownTarget&&e.keydownHandlerAdded&&e.keydownHandler){let t=e.keydownHandler;e.keydownTarget.removeEventListener(`keydown`,t,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1}},Ht=(e,t,n)=>{if(Vt(e),!t.toast){let r=e=>Kt(t,e,n);e.keydownHandler=r;let i=t.keydownListenerCapture?window:E();if(i){e.keydownTarget=i,e.keydownListenerCapture=t.keydownListenerCapture;let n=r;e.keydownTarget.addEventListener(`keydown`,n,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0}}},Ut=(e,t)=>{var n;let r=re();return r.length?(e+=t,e===-2&&(e=r.length-1),e===r.length?e=0:e===-1&&(e=r.length-1),r[e].focus(),!(S()&&r[e]instanceof HTMLIFrameElement)):((n=E())==null||n.focus(),!0)},Wt=[`ArrowRight`,`ArrowDown`],Gt=[`ArrowLeft`,`ArrowUp`],Kt=(e,t,n)=>{e&&(t.isComposing||t.keyCode===229||(e.stopKeydownPropagation&&t.stopPropagation(),t.key===`Enter`?qt(t,e):t.key===`Tab`?Jt(t):[...Wt,...Gt].includes(t.key)?Yt(t.key):t.key===`Escape`&&Xt(t,e,n)))},qt=(e,t)=>{if(!v(t.allowEnterKey))return;let n=E();if(!n||!t.input)return;let r=B(n,t.input);if(e.target&&r&&e.target instanceof HTMLElement&&e.target.outerHTML===r.outerHTML){if([`textarea`,`file`].includes(t.input))return;Lt(),e.preventDefault()}},Jt=e=>{let t=e.target,n=re().findIndex(e=>e===t),r=!0;r=e.shiftKey?Ut(n,-1):Ut(n,1),e.stopPropagation(),r&&e.preventDefault()},Yt=e=>{let t=R(),n=P(),r=I(),i=F();if(!t||!n||!r||!i)return;let a=[n,r,i];if(document.activeElement instanceof HTMLElement&&!a.includes(document.activeElement))return;let o=Wt.includes(e)?`nextElementSibling`:`previousElementSibling`,s=document.activeElement;if(s){for(let e=0;e<t.children.length;e++){if(s=s[o],!s)return;if(s instanceof HTMLButtonElement&&xe(s))break}s instanceof HTMLButtonElement&&s.focus()}},Xt=(e,t,n)=>{e.preventDefault(),v(t.allowEscapeKey)&&n(Bt.esc)};var Zt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};let Qt=()=>{let e=C();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute(`aria-hidden`)&&t.setAttribute(`data-previous-aria-hidden`,t.getAttribute(`aria-hidden`)||``),t.setAttribute(`aria-hidden`,`true`))})},$t=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute(`data-previous-aria-hidden`)?(e.setAttribute(`aria-hidden`,e.getAttribute(`data-previous-aria-hidden`)||``),e.removeAttribute(`data-previous-aria-hidden`)):e.removeAttribute(`aria-hidden`)})},en=typeof window<`u`&&!!window.GestureEvent,tn=en&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,nn=()=>{if(en&&!ce(document.body,l.iosfix)){let e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,pe(document.body,l.iosfix),rn()}},rn=()=>{let e=C();if(!e)return;let t;e.ontouchstart=e=>{t=an(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},an=e=>{let t=e.target,n=C(),r=A();return!n||!r||on(e)||sn(e)?!1:t===n||!Ce(n)&&t instanceof HTMLElement&&!we(t,r)&&t.tagName!==`INPUT`&&t.tagName!==`TEXTAREA`&&!(Ce(r)&&r.contains(t))},on=e=>!!(e.touches&&e.touches.length&&e.touches[0].touchType===`stylus`),sn=e=>e.touches&&e.touches.length>1,cn=()=>{if(ce(document.body,l.iosfix)){let e=parseInt(document.body.style.top,10);me(document.body,l.iosfix),document.body.style.top=``,document.body.scrollTop=e*-1}},ln=()=>{let e=document.createElement(`div`);e.className=l[`scrollbar-measure`],document.body.appendChild(e);let t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},un=null,dn=e=>{un===null&&(document.body.scrollHeight>window.innerHeight||e===`scroll`)&&(un=parseInt(window.getComputedStyle(document.body).getPropertyValue(`padding-right`)),document.body.style.paddingRight=`${un+l
1246n()}px`)},fn=()=>{un!==null&&(document.body.style.paddingRight=`${un}px`,un=null)};function pn(e,t,n,r){ae()?Sn(e,r):(s(n).then(()=>Sn(e,r)),Vt(a)),en?(t.setAttribute(`style`,`display:none !important`),t.removeAttribute(`class`),t.innerHTML=``):t.remove(),ie()&&(fn(),cn(),$t()),mn()}function mn(){me([document.documentElement,document.body],[l.shown,l[`height-auto`],l[`no-backdrop`],l[`toast-shown`]])}function hn(e){e=yn(e);let t=Zt.swalPromiseResolve.get(this),n=gn(this);this.isAwaitingPromise?e.isDismissed||(vn(this),t(e)):n&&t(e)}let gn=e=>{let t=E();if(!t)return!1;let n=Xe.innerParams.get(e);if(!n||ce(t,n.hideClass.popup))return!1;me(t,n.showClass.popup),pe(t,n.hideClass.popup);let r=C();return me(r,n.showClass.backdrop),pe(r,n.hideClass.backdrop),bn(e,t,n),!0};function _n(e){let t=Zt.swalPromiseReject.get(this);vn(this),t&&t(e)}let vn=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,Xe.innerParams.get(e)||e._destroy())},yn=e=>e===void 0?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),bn=(e,t,n)=>{var r;let i=C(),o=Te(t);typeof n.willClose==`function`&&n.willClose(t),(r=a.eventEmitter)==null||r.emit(`willClose`,t),o&&i?xn(e,t,i,!!n.returnFocus,n.didClose):i&&pn(e,i,!!n.returnFocus,n.didClose)},xn=(e,t,n,r,i)=>{a.swalCloseEventFinishedCallback=pn.bind(null,e,n,r,i);let o=function(e){if(e.target===t){var n;(n=a.swalCloseEventFinishedCallback)==null||n.call(a),delete a.swalCloseEventFinishedCallback,t.removeEventListener(`animationend`,o),t.removeEventListener(`transitionend`,o)}};t.addEventListener(`animationend`,o),t.addEventListener(`transitionend`,o)},Sn=(e,t)=>{setTimeout(()=>{var n;typeof t==`function`&&t.bind(e.params)(),(n=a.eventEmitter)==null||n.emit(`didClose`),e._destroy&&e._destroy()})},Cn=e=>{let t=E();if(t||new vi,t=E(),!t)return;let n=ee();ae()?_e(D()):wn(t,e),ge(n),t.setAttribute(`data-loading`,`true`),t.setAttribute(`aria-busy`,`true`),t.focus()},wn=(e,t)=>{let n=R(),r=ee();!n||!r||(!t&&xe(P())&&(t=P()),ge(n),t&&(_e(t),r.setAttribute(`data-button-to-replace`,t.className),n.insertBefore(r,t)),pe([e,n],l.loading))},Tn=(e,t)=>{t.input===`select`||t.input===`radio`?An(e,t):[`text`,`email`,`number`,`tel`,`textarea`].some(e=>e===t.input)&&(y(t.inputValue)||x(t.inputValue))&&(Cn(P()),jn(e,t))},En=(e,t)=>{let n=e.getInput();if(!n)return null;switch(t.input){case`checkbox`:return Dn(n);case`radio`:return On(n);case`file`:return kn(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Dn=e=>+!!e.checked,On=e=>e.checked?e.value:null,kn=e=>e.files&&e.files.length?e.getAttribute(`multiple`)===null?e.files[0]:e.files:null,An=(e,t)=>{let n=E();if(!n)return;let r=e=>{t.input===`select`?Mn(n,Pn(e),t):t.input===`radio`&&Nn(n,Pn(e),t)};y(t.inputOptions)||x(t.inputOptions)?(Cn(P()),b(t.inputOptions).then(t=>{e.hideLoading(),r(t)})):typeof t.inputOptions==`object`?r(t.inputOptions):m(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof t.inputOptions}`)},jn=(e,t)=>{let n=e.getInput();n&&(_e(n),b(t.inputValue).then(r=>{n.value=t.input===`number`?`${parseFloat(r)||0}`:`${r}`,ge(n),n.focus(),e.hideLoading()}).catch(t=>{m(`Error in inputValue promise: ${t}`),n.value=``,ge(n),n.focus(),e.hideLoading()}))};function Mn(e,t,n){let r=V(e,l.select);if(!r)return;let i=(e,t,r)=>{let i=document.createElement(`option`);i.value=r,se(i,t),i.selected=Fn(r,n.inputValue),e.appendChild(i)};t.forEach(e=>{let t=e[0],n=e[1];if(Array.isArray(n)){let e=document.createElement(`optgroup`);e.label=t,e.disabled=!1,r.appendChild(e),n.forEach(t=>i(e,t[1],t[0]))}else i(r,n,t)}
1246),r.focus()}function Nn(e,t,n){let r=V(e,l.radio);if(!r)return;t.forEach(e=>{let t=e[0],i=e[1],a=document.createElement(`input`),o=document.createElement(`label`);a.type=`radio`,a.name=l.radio,a.value=t,Fn(t,n.inputValue)&&(a.checked=!0);let s=document.createElement(`span`);se(s,i),s.className=l.label,o.appendChild(a),o.appendChild(s),r.appendChild(o)});let i=r.querySelectorAll(`input`);i.length&&i[0].focus()}let Pn=e=>(e instanceof Map?Array.from(e):Object.entries(e)).map(([e,t])=>[e,typeof t==`object`?Pn(t):t]),Fn=(e,t)=>!!t&&t!=null&&t.toString()===e.toString(),In=e=>{let t=Xe.innerParams.get(e);e.disableButtons(),t.input?zn(e,`confirm`):Wn(e,!0)},Ln=e=>{let t=Xe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?zn(e,`deny`):Vn(e,!1)},Rn=(e,t)=>{e.disableButtons(),t(Bt.cancel)},zn=(e,t)=>{let n=Xe.innerParams.get(e);if(!n.input){m(`The "input" parameter is needed to be set when using returnInputValueOn${f(t)}`);return}let r=e.getInput(),i=En(e,n);n.inputValidator?Bn(e,i,t):r&&!r.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||r.validationMessage)):t===`deny`?Vn(e,i):Wn(e,i)},Bn=(e,t,n)=>{let r=Xe.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>b(r.inputValidator(t,r.validationMessage))).then(r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):n===`deny`?Vn(e,t):Wn(e,t)})},Vn=(e,t)=>{let n=Xe.innerParams.get(e);n.showLoaderOnDeny&&Cn(I()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>b(n.preDeny(t,n.validationMessage))).then(n=>{n===!1?(e.hideLoading(),vn(e)):e.close({isDenied:!0,value:n===void 0?t:n})}).catch(t=>Un(e,t))):e.close({isDenied:!0,value:t})},Hn=(e,t)=>{e.close({isConfirmed:!0,value:t})},Un=(e,t)=>{e.rejectPromise(t)},Wn=(e,t)=>{let n=Xe.innerParams.get(e);n.showLoaderOnConfirm&&Cn(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>b(n.preConfirm(t,n.validationMessage))).then(n=>{xe(N())||n===!1?(e.hideLoading(),vn(e)):Hn(e,n===void 0?t:n)}).catch(t=>Un(e,t))):Hn(e,t)};function Gn(){let e=Xe.innerParams.get(this);if(!e)return;let t=Xe.domCache.get(this);_e(t.loader),ae()?e.icon&&ge(D()):Kn(t),me([t.popup,t.actions],l.loading),t.popup.removeAttribute(`aria-busy`),t.popup.removeAttribute(`data-loading`),this.enableButtons()}let Kn=e=>{let t=e.loader.getAttribute(`data-button-to-replace`),n=t?e.popup.getElementsByClassName(t):[];n.length?ge(n[0],`inline-block`):Se()&&_e(e.actions)};function qn(){let e=Xe.innerParams.get(this),t=Xe.domCache.get(this);return t?B(t.popup,e.input):null}function Jn(e,t,n){let r=Xe.domCache.get(e);t.forEach(e=>{r[e].disabled=n})}function Yn(e,t){let n=E();!n||!e||(e.type===`radio`?n.querySelectorAll(`[name="${l.radio}"]`).forEach(e=>{e.disabled=t}):e.disabled=t)}function Xn(){Jn(this,[`confirmButton`,`denyButton`,`cancelButton`],!1);let e=Xe.focusedElement.get(this);e instanceof HTMLElement&&document.activeElement===document.body&&e.focus(),Xe.focusedElement.delete(this)}
1246function Zn(){Xe.focusedElement.set(this,document.activeElement),Jn(this,[`confirmButton`,`denyButton`,`cancelButton`],!0)}function Qn(){Yn(this.getInput(),!1)}function $n(){Yn(this.getInput(),!0)}function er(e){let t=Xe.domCache.get(this),n=Xe.innerParams.get(this);se(t.validationMessage,e),t.validationMessage.className=l[`validation-message`],n.customClass&&n.customClass.validationMessage&&pe(t.validationMessage,n.customClass.validationMessage),ge(t.validationMessage);let r=this.getInput();r&&(r.setAttribute(`aria-invalid`,`true`),r.setAttribute(`aria-describedby`,l[`validation-message`]),de(r),pe(r,l.inputerror))}function tr(){let e=Xe.domCache.get(this);e.validationMessage&&_e(e.validationMessage);let t=this.getInput();t&&(t.removeAttribute(`aria-invalid`),t.removeAttribute(`aria-describedby`),me(t,l.inputerror))}let nr={title:``,titleText:``,text:``,html:``,footer:``,icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:`light`,showClass:{popup:`swal2-show`,backdrop:`swal2-backdrop-show`,icon:`swal2-icon-show`},hideClass:{popup:`swal2-hide`,backdrop:`swal2-backdrop-hide`,icon:`swal2-icon-hide`},customClass:{},target:`body`,color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:`OK`,confirmButtonAriaLabel:``,confirmButtonColor:void 0,denyButtonText:`No`,denyButtonAriaLabel:``,denyButtonColor:void 0,cancelButtonText:`Cancel`,cancelButtonAriaLabel:``,cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:`&times;`,closeButtonAriaLabel:`Close this dialog`,loaderHtml:``,showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:``,timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:``,inputLabel:``,inputValue:``,inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:`center`,progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose
1246:void 0,didDestroy:void 0,scrollbarPadding:!0,topLayer:!1},rr=`allowEscapeKey.allowOutsideClick.background.buttonsStyling.cancelButtonAriaLabel.cancelButtonColor.cancelButtonText.closeButtonAriaLabel.closeButtonHtml.color.confirmButtonAriaLabel.confirmButtonColor.confirmButtonText.currentProgressStep.customClass.denyButtonAriaLabel.denyButtonColor.denyButtonText.didClose.didDestroy.draggable.footer.hideClass.html.icon.iconColor.iconHtml.imageAlt.imageHeight.imageUrl.imageWidth.preConfirm.preDeny.progressSteps.returnFocus.reverseButtons.showCancelButton.showCloseButton.showConfirmButton.showDenyButton.text.title.titleText.theme.willClose`.split(`.`),ir={allowEnterKey:void 0},H=[`allowOutsideClick`,`allowEnterKey`,`backdrop`,`draggable`,`focusConfirm`,`focusDeny`,`focusCancel`,`returnFocus`,`heightAuto`,`keydownListenerCapture`],ar=e=>Object.prototype.hasOwnProperty.call(nr,e),or=e=>rr.indexOf(e)!==-1,U=e=>ir[e],sr=e=>{ar(e)||p(`Unknown parameter "${e}"`)},cr=e=>{H.includes(e)&&p(`The parameter "${e}" is incompatible with toasts`)},lr=e=>{let t=U(e);t&&_(e,t)},ur=e=>{e.backdrop===!1&&e.allowOutsideClick&&p('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&![`light`,`dark`,`auto`,`minimal`,`borderless`,`bootstrap-4`,`bootstrap-4-light`,`bootstrap-4-dark`,`bootstrap-5`,`bootstrap-5-light`,`bootstrap-5-dark`,`material-ui`,`material-ui-light`,`material-ui-dark`,`embed-iframe`,`bulma`,`bulma-light`,`bulma-dark`].includes(e.theme)&&p(`Invalid theme "${e.theme}"`);for(let t in e)sr(t),e.toast&&cr(t),lr(t)};function dr(e){let t=C(),n=E(),r=Xe.innerParams.get(this);if(!n||ce(n,r.hideClass.popup)){p(`You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.`);return}let i=fr(e),a=Object.assign({},r,i);ur(a),t&&(t.dataset.swal2Theme=a.theme),Ft(this,a),Xe.innerParams.set(this,a),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}let fr=e=>{let t={};return Object.keys(e).forEach(n=>{or(n)?t[n]=e[n]:p(`Invalid parameter to update: ${n}`)}),t};function pr(){var e;let t=Xe.domCache.get(this),n=Xe.innerParams.get(this);if(!n){hr(this);return}t.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),typeof n.didDestroy==`function`&&n.didDestroy(),(e=a.eventEmitter)==null||e.emit(`didDestroy`),mr(this)}let mr=e=>{hr(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},hr=e=>{e.isAwaitingPromise?(gr(Xe,e),e.isAwaitingPromise=!0):(gr(Zt,e),gr(Xe,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},gr=(e,t)=>{for(let n in e)e[n].delete(t)};var W=Object.freeze({__proto__:null,_destroy:pr,close:hn,closeModal:hn,closePopup:hn,closeToast:hn,disableButtons:Zn,disableInput:$n,disableLoading:Gn,enableButtons:Xn,enableInput:Qn,getInput:qn,handleAwaitingPromise:vn,hideLoading:Gn,rejectPromise:_n,resetValidationMessage:tr,showValidationMessage:er,update:dr});let _r=(e,t,n)=>{e.toast?vr(e,t,n):(xr(t),Sr(t),Cr(e,t,n))},vr=(e,t,n)=>{t.popup.onclick=()=>{e&&(yr(e)||e.timer||e.input)||n(Bt.close)}},yr=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton),br=!1,xr=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(br=!0)}}},Sr=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(br=!0)}}},Cr=(e,t,n)=>{t.container.onclick=r=>{if(br){br=!1;return}r.target===t.container&&v(e.allowOutsideClick)&&n(Bt.backdrop)}},wr=e=>typeof e==`object`&&!!e&&`jquery`in e,Tr=e=>e instanceof Element||wr(e),Er=e=>{let t={};return typeof e[0]==`object`&&!Tr(e[0])?Object.assign(t,e[0]):[`title`,`html`,`icon`].forEach((n,r)=>{let i=e[r];typeof i==`string`||Tr(i)?t[n]=i:i!==void 0&&m(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)}),t};function Dr(...e){return new this(...e)}
1246function Or(e){class t extends this{_main(t,n){return super._main(t,Object.assign({},e,n))}}return t}let kr=()=>a.timeout&&a.timeout.getTimerLeft(),Ar=()=>{if(a.timeout)return De(),a.timeout.stop()},jr=()=>{if(a.timeout){let e=a.timeout.start();return Ee(e),e}},Mr=()=>{let e=a.timeout;return e&&(e.running?Ar():jr())},Nr=e=>{if(a.timeout){let t=a.timeout.increase(e);return Ee(t,!0),t}},Pr=()=>!!(a.timeout&&a.timeout.isRunning()),Fr=!1,Ir={};function Lr(e=`data-swal-template`){Ir[e]=this,Fr||=(document.body.addEventListener(`click`,Rr),!0)}let Rr=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(let e in Ir){let n=t.getAttribute&&t.getAttribute(e);if(n){Ir[e].fire({template:n});return}}};class zr{constructor(){this.events={}}_getHandlersByEventName(e){return this.events[e]===void 0&&(this.events[e]=[]),this.events[e]}on(e,t){let n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){let n=(...r)=>{this.removeListener(e,n),t.apply(this,r)};this.on(e,n)}emit(e,...t){this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,t)}catch(e){console.error(e)}})}removeListener(e,t){let n=this._getHandlersByEventName(e),r=n.indexOf(t);r>-1&&n.splice(r,1)}removeAllListeners(e){this.events[e]!==void 0&&(this.events[e].length=0)}reset(){this.events={}}}a.eventEmitter=new zr;var Br=Object.freeze({__proto__:null,argsToParams:Er,bindClickHandler:Lr,clickCancel:zt,clickConfirm:Lt,clickDeny:Rt,enableLoading:Cn,fire:Dr,getActions:R,getCancelButton:F,getCloseButton:ne,getConfirmButton:P,getContainer:C,getDenyButton:I,getFocusableElements:re,getFooter:z,getHtmlContainer:A,getIcon:D,getIconContent:O,getImage:j,getInputLabel:L,getLoader:ee,getPopup:E,getProgressSteps:M,getTimerLeft:kr,getTimerProgressBar:te,getTitle:k,getValidationMessage:N,increaseTimer:Nr,isDeprecatedParameter:U,isLoading:oe,isTimerRunning:Pr,isUpdatableParameter:or,isValidParameter:ar,isVisible:It,mixin:Or,off:(e,t)=>{if(a.eventEmitter){if(!e){a.eventEmitter.reset();return}t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e)}},on:(e,t)=>{a.eventEmitter&&a.eventEmitter.on(e,t)},once:(e,t)=>{a.eventEmitter&&a.eventEmitter.once(e,t)},resumeTimer:jr,showLoading:Cn,stopTimer:Ar,toggleTimer:Mr});class Vr{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(e){let t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}let Hr=[`swal-title`,`swal-html`,`swal-footer`],Ur=e=>{let t=typeof e.template==`string`?document.querySelector(e.template):e.template;if(!t)return{};let n=t.content;return Zr(n),Object.assign(Wr(n),Gr(n),Kr(n),qr(n),Jr(n),Yr(n),Xr(n,Hr))},Wr=e=>{let t={};return Array.from(e.querySelectorAll(`swal-param`)).forEach(e=>{Qr(e,[`name`,`value`]);let n=e.getAttribute(`name`),r=e.getAttribute(`value`);!n||!r||(n in nr&&typeof nr[n]==`boolean`?t[n]=r!==`false`:n in nr&&typeof nr[n]==`object`?t[n]=JSON.parse(r):t[n]=r)}),t},Gr=e=>{let t={};return Array.from(e.querySelectorAll(`swal-function-param`)).forEach(e=>{let n=e.getAttribute(`name`),r=e.getAttribute(`value`);!n||!r||(t[n]=Function(`return ${r}`)())}),t},Kr=e=>{let t={};return Array.from(e.querySelectorAll(`swal-button`)).forEach(e=>{Qr(e,[`type`,`color`,`aria-label`]);let n=e.getAttribute(`type`);if(!n||![`confirm`,`cancel`,`deny`].includes(n))return;t[`${n}ButtonText`]=e.innerHTML,t[`show${f(n)}Button`]=!0;let r=e.getAttribute(`color`);r!==null&&(t[`${n}ButtonColor`]=r);let i=e.getAttribute(`aria-label`);i!==null&&(t[`${n}ButtonAriaLabel`]=i)}),t},qr=e=>{let t={},n=e.querySelector(`swal-image`);if(n){Qr(n,[`src`,`width`,`height`,`alt`]);let e=n.getAttribute(`src`);e!==null&&(t.imageUrl=e||void 0);let r=n.getAttribute(`width`);r!==null&&(t.imageWidth=r||void 0);let i=n.getAttribute(`height`);i!==null&&(t.imageHeight=i||void 0);let a=n.getAttribute(`alt`);a!==null&&(t.imageAlt=a||void 0)}return t},Jr=e=>{let t={},n=e.querySelector(`swal-icon`);return n&&(Qr(n,[`type`,`color`]),n.hasAttribute(`type`)&&(t.icon=n.getAttribute(`type`)),n.hasAttribute(`color`)&&(t.iconColor=n.getAttribute(`color`)),t.iconHtml=n.innerHTML),t},Yr=e=>{let t={},n=e.querySelector(`swal-input`);n&&(Qr(n,[`type`,`label`,`placeholder`,`value`]),t.input=n.getAttribute(`type`)||`text`,n.hasAttribute(`label`)&&(t.inputLabel=n.getAttribute(`label`)),n.hasAttribute(`placeholder`)&&(t.inputPlaceholder=n.getAttribute(`placeholder`)),n.hasAttribute(`value`)&&(t.inputValue=n.getAttribute(`value`)));let r=Array.from(e.querySelectorAll(`swal-input-option`));return r.length&&(t.inputOptions={}
1246,r.forEach(e=>{Qr(e,[`value`]);let n=e.getAttribute(`value`);if(!n)return;let r=e.innerHTML;t.inputOptions[n]=r})),t},Xr=(e,t)=>{let n={};for(let r in t){let i=t[r],a=e.querySelector(i);a&&(Qr(a,[]),n[i.replace(/^swal-/,``)]=a.innerHTML.trim())}return n},Zr=e=>{let t=Hr.concat([`swal-param`,`swal-function-param`,`swal-button`,`swal-image`,`swal-icon`,`swal-input`,`swal-input-option`]);Array.from(e.children).forEach(e=>{let n=e.tagName.toLowerCase();t.includes(n)||p(`Unrecognized element <${n}>`)})},Qr=(e,t)=>{Array.from(e.attributes).forEach(n=>{t.indexOf(n.name)===-1&&p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,`${t.length?`Allowed attributes are: ${t.join(`, `)}`:`To set the value, use HTML within the element.`}`])})},$r=e=>{var t,n;let r=C(),i=E();if(!r||!i)return;typeof e.willOpen==`function`&&e.willOpen(i),(t=a.eventEmitter)==null||t.emit(`willOpen`,i);let o=window.getComputedStyle(document.body).overflowY;if(ri(r,i,e),setTimeout(()=>{ti(r,i)},10),ie()&&(ni(r,e.scrollbarPadding!==void 0&&e.scrollbarPadding,o),Qt()),tn&&e.backdrop===!1&&i.scrollHeight>r.clientHeight&&(r.style.pointerEvents=`auto`),!ae()&&!a.previousActiveElement&&(a.previousActiveElement=document.activeElement),typeof e.didOpen==`function`){let t=e.didOpen;setTimeout(()=>t(i))}(n=a.eventEmitter)==null||n.emit(`didOpen`,i)},ei=e=>{let t=E();if(!t||e.target!==t)return;let n=C();n&&(t.removeEventListener(`animationend`,ei),t.removeEventListener(`transitionend`,ei),n.style.overflowY=`auto`,me(n,l[`no-transition`]))},ti=(e,t)=>{Te(t)?(e.style.overflowY=`hidden`,t.addEventListener(`animationend`,ei),t.addEventListener(`transitionend`,ei)):e.style.overflowY=`auto`},ni=(e,t,n)=>{nn(),t&&n!==`hidden`&&dn(n),setTimeout(()=>{e.scrollTop=0})},ri=(e,t,n)=>{var r;(r=n.showClass)!=null&&r.backdrop&&pe(e,n.showClass.backdrop),n.animation?(t.style.setProperty(`opacity`,`0`,`important`),ge(t,`grid`),setTimeout(()=>{var e;(e=n.showClass)!=null&&e.popup&&pe(t,n.showClass.popup),t.style.removeProperty(`opacity`)},10)):ge(t,`grid`),pe([document.documentElement,document.body],l.shown),n.heightAuto&&n.backdrop&&!n.toast&&pe([document.documentElement,document.body],l[`height-auto`])};var ii={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||`Invalid email address`),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||`Invalid URL`)};function ai(e){e.inputValidator||(e.input===`email`&&(e.inputValidator=ii.email),e.input===`url`&&(e.inputValidator=ii.url))}function oi(e){(!e.target||typeof e.target==`string`&&!document.querySelector(e.target)||typeof e.target!=`string`&&!e.target.appendChild)&&(p(`Target parameter is not valid, defaulting to "body"`),e.target=`body`)}function si(e){ai(e),e.showLoaderOnConfirm&&!e.preConfirm&&p(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
1247showLoaderOnConfirm should be used together with preConfirm, see usage example:
1248https://sweetalert2.github.io/#ajax-request`),oi(e),typeof e.title==`string`&&(e.title=e.title.split(`
1249`).join(`<br />`)),Ie(e)}let ci;var li=new WeakMap;class ui{constructor(...e){if(r(this,li,Promise.resolve({isConfirmed:!1,isDenied:!1,isDismissed:!0})),typeof window>`u`)return;ci=this;let t=Object.freeze(this.constructor.argsToParams(e));this.params=t,this.isAwaitingPromise=!1,i(li,this,this._main(ci.params))}_main(e,t={}){if(ur(Object.assign({},t,e)),a.currentInstance){let e=Zt.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),ie()&&$t()}a.currentInstance=ci;let n=fi(e,t);si(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);let r=pi(ci);return Ft(ci,n),Xe.innerParams.set(ci,n),di(ci,r,n)}then(e){return n(li,this).then(e)}finally(e){return n(li,this).finally(e)}}let di=(e,t,n)=>new Promise((r,i)=>{let o=t=>{e.close({isDismissed:!0,dismiss:t,isConfirmed:!1,isDenied:!1})};Zt.swalPromiseResolve.set(e,r),Zt.swalPromiseReject.set(e,i),t.confirmButton.onclick=()=>{In(e)},t.denyButton.onclick=()=>{Ln(e)},t.cancelButton.onclick=()=>{Rn(e,o)},t.closeButton.onclick=()=>{o(Bt.close)}
1249,_r(n,t,o),Ht(a,n,o),Tn(e,n),$r(n),mi(a,n,o),hi(t,n),setTimeout(()=>{t.container.scrollTop=0})}),fi=(e,t)=>{let n=Ur(e),r=Object.assign({},nr,t,n,e);return r.showClass=Object.assign({},nr.showClass,r.showClass),r.hideClass=Object.assign({},nr.hideClass,r.hideClass),r.animation===!1&&(r.showClass={backdrop:`swal2-noanimation`},r.hideClass={}),r},pi=e=>{let t={popup:E(),container:C(),actions:R(),confirmButton:P(),denyButton:I(),cancelButton:F(),loader:ee(),closeButton:ne(),validationMessage:N(),progressSteps:M()};return Xe.domCache.set(e,t),t},mi=(e,t,n)=>{let r=te();_e(r),t.timer&&(e.timeout=new Vr(()=>{n(`timer`),delete e.timeout},t.timer),t.timerProgressBar&&r&&(ge(r),ue(r,t,`timerProgressBar`),setTimeout(()=>{e.timeout&&e.timeout.running&&Ee(t.timer)})))},hi=(e,t)=>{if(!t.toast){if(!v(t.allowEnterKey)){_(`allowEnterKey`,`preConfirm: () => false`),e.popup.focus();return}gi(e)||_i(e,t)||Ut(-1,1)}},gi=e=>{let t=Array.from(e.popup.querySelectorAll(`[autofocus]`));for(let e of t)if(e instanceof HTMLElement&&xe(e))return e.focus(),!0;return!1},_i=(e,t)=>t.focusDeny&&xe(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&xe(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&xe(e.confirmButton)?(e.confirmButton.focus(),!0):!1;ui.prototype.disableButtons=Zn,ui.prototype.enableButtons=Xn,ui.prototype.getInput=qn,ui.prototype.disableInput=$n,ui.prototype.enableInput=Qn,ui.prototype.hideLoading=Gn,ui.prototype.disableLoading=Gn,ui.prototype.showValidationMessage=er,ui.prototype.resetValidationMessage=tr,ui.prototype.close=hn,ui.prototype.closePopup=hn,ui.prototype.closeModal=hn,ui.prototype.closeToast=hn,ui.prototype.rejectPromise=_n,ui.prototype.update=dr,ui.prototype._destroy=pr,Object.assign(ui,Br),Object.keys(W).forEach(e=>{ui[e]=function(...t){if(ci&&ci[e])return ci[e](...t)}}),ui.DismissReason=Bt,ui.version=`11.26.25`;let vi=ui;return vi.default=vi,vi})),e!==void 0&&e.Sweetalert2&&(e.swal=e.sweetAlert=e.Swal=e.SweetAlert=e.Sweetalert2),typeof document<`u`&&function(e,t){var n=e.createElement(`style`);if(e.getElementsByTagName(`head`)[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch{n.innerText=t}}(document,`:root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;
1249--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:auto}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start     top            top-end" "center-start  center         center-end" "bottom-start  bottom-center  bottom-end
vendor: 12,791 bytes, line 1249
1249";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:
1249"!
vendor: 11,078 bytes, line 1249
1249";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:auto}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}
1249`)}))(),1);function nS(){let e=(0,Z.useRef)(null),t=(0,Z.useRef)(null);return(0,Z.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let i=n.clientWidth,a=n.clientHeight,o=r.offsetWidth,s=r.offsetHeight,c=-1,l=()=>{if(!o||!s||!i||!a)return;let e=Math.min(1,i/o,a/s);Math.abs(e-c)<.001||(c=e,r.style.transform=`scale(${e})`)};l();let u=new ResizeObserver(e=>{for(let t of e)if(t.target===n){let e=t.contentBoxSize?.[0];i=e?e.inlineSize:n.clientWidth,a=e?e.blockSize:n.clientHeight}else{let e=t.borderBoxSize?.[0];o=e?e.inlineSize:r.offsetWidth,s=e?e.blockSize:r.offsetHeight}l()});return u.observe(n),u.observe(r),()=>u.disconnect()},[]),{areaRef:e,contentRef:t}}function rS({showModal:e,toggleModal:t,children:n,useScale:r=!0,closeButton:i=!0,plainBackdrop:a=!1,useDisplayNone:o=!1,className:s=``}){let[c,l]=(0,Z.useState)(!0),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(0),{scale:m}=mx($);(0,Z.useEffect)(()=>{l(!1)},[]),(0,Z.useEffect)(()=>{if(c)return;let t=e;d(!0),l(!0),p(+!e),setTimeout(()=>p(+!!e),100),setTimeout(()=>l(!1),250),setTimeout(()=>d(t),260)},[e]);let h=(0,Z.useCallback)(()=>{c||t()},[t,c]),g=(0,Z.useCallback)(t=>{t.key===`Escape`&&e&&h()},[e,h]);(0,Z.useEffect)(()=>(document.addEventListener(`keydown`,g),()=>document.removeEventListener(`keydown`,g)),[g]);let _=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:(0,mb.default)(`modal-backdrop`,a&&`backdrop-plain`),style:{opacity:f,display:!u&&o?`none`:``}}),(0,Q.jsxs)(`div`,{className:(0,mb.default)(`modal`,s,r&&`scale-modal`),style:{opacity:f,transform:r?`scale(${m})`:``,display:!u&&o?`none`:``},children:[i&&(0,Q.jsx)(iS,{close:h}),n]})]});return(0,Q.jsx)(Q.Fragment,{children:u||o?_:null})}function iS({close:e}){return(0,Q.jsx)(`div`,{onClick:e,className:`close-button`,children:(0,Q.jsx)(`i`,{className:`fas fa-times`})})}var aS={not_enought_coins:`Not enough coins`,hat_already_owned:`You already own this hat`,hat_not_for_sale:`This hat is not for sale`,hat_not_owned:`You don't own that hat`,not_found:`Hat not found`,"bad-prof-id":`Unknown profile`};function oS(e){return e?aS[e]||String(e).replace(/[-_]/g,` `):`Something went wrong`}function sS(e){return e&&typeof e==`object`&&!e.error}function cS(e,t){return Number.isFinite(e)?e:t}function lS(e){return{scale:cS(e?.scale,150),offset_y:cS(e?.offset_y,Pn)}}function uS(e,t){if(typeof t!=`number`)return null;let n=e.hat_images?.[t];return n?.image_url?{id:t,image_url:n.image_url,...lS(n)}:null}function dS(e){if(!(!sS(e)||!e.hat_images))for(let t of Object.values(e.hat_images))t?.image_url&&jt.warm(t.image_url)}function fS(e,t){if(!sS(e))return[null,null];let n=e.hat_profiles?.[t];return n?[uS(e,n.hat_id_1),uS(e,n.hat_id_2)]:[null,null]}function pS(e,t){if(typeof t!=`number`||!e)return``;let n=e[t];return n?n.includes(`http`)?n:`${Mt.endPoints.skins.routeBase}/${n}`:``}function mS(e,t){if(!sS(e))return[``,``];let n=e.skin_profiles?.[t];return n?[pS(e.skin_routes,n.skin_id_1),pS(e.skin_routes,n.skin_id_2)]:[``,``]}async function hS(e){let t=await Nn.requestJson(Mt.endPoints.hats.buy(e),{});if(!t||t.error||!t.success)throw Error(t?.error||`buy_failed`);return t}async function gS(e,t,n,r){let i=e.account;if(!sS(i))throw Error(`not_signed_in`);if(t<0||t>=Mt.maxProfiles)throw Error(`bad-prof-id`);let a=n===1?`hat_id_2`:`hat_id_1`;Array.isArray(i.hat_profiles)||(i.hat_profiles=[]),(!i.hat_images||typeof i.hat_images!=`object`)&&(i.hat_images={}),i.hat_profiles[t]||(i.hat_profiles[t]={hat_id_1:null,hat_id_2:null});let o=i.hat_profiles[t],s=o[a]??null,c=r?r.id:null;o[a]=c,r?.image_url&&(i.hat_images[r.id]={image_url:r.image_url,...lS(r)},jt.warm(r.image_url));try{let e=await Nn.requestJson(Mt.endPoints.hats.equip,{profile_id:t,tab:n+1,hat_id:c});if(!e||e.error||!e.success)throw Error(e?.error||`equip_failed`);return e}catch(n){let r=sS(e.account)?e.account.hat_profiles?.[t]:null;throw r&&r[a]===c&&(r[a]=s),n}}var _S=(e,t,n)=>e<=t?t:e>=n?n:e,vS={0:0,1:50,2:125,3:250,4:500},yS=new class{constructor(){this.levelCap=100,this.cache={0:0};for(let e=1;e<=this.levelCap;e++)this.cache[e]=this.expRequiredForLevel(e)}realExp(e){return e-this.cache[this.levelFromExp(e)-1]}expRemainingToLevel(e){return this.cache[this.levelFromExp(e)]-e}levelFromExp(e){let t=1;for(;e>=this.realExpGainRequiredForLevelUp(t);)e-=this.realExpGainRequiredForLevelUp(t),t++;return t>this.levelCap&&(t=this.levelCap),t}realExpGainRequiredForLevelUp(e){return this.cache[e]-this.cache[e-1]}expRequiredForLevel(e){if(e<=4)return vS[e]??0;let t=0;for(let n=1;n<=e;n++)t+=n*100;return t-500}};function bS(e){return String(e).replace(/(?!^)(?=(?:\d{3})+(?:\.|$))/gm,` `)}function xS(){let{account:e}=mx($);return typeof e!=`object`||!e?null:(0,Q.jsxs)(`div`,{className:`coins-balance`,title:`Your coins`,children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),(0,Q.jsx)(`span`,{children:bS(e.coins)})]})}var SS=`./img/avatar.png`;function CS({account:e,className:t=``}){return(0,Q.jsxs)(`div`,{className:`user-card ${t}
1249`,children:[(0,Q.jsx)(`img`,{className:`avatar`,src:e.avatar_url||SS,draggable:`false`,onError:e=>{e.currentTarget.src.endsWith(`/img/avatar.png`)||(e.currentTarget.src=SS)}}),(0,Q.jsxs)(`div`,{className:`info`,children:[(0,Q.jsx)(`div`,{className:`name`,children:e.name}),e.reserved_name&&e.real_name&&e.real_name!==e.reserved_name&&(0,Q.jsx)(`div`,{className:`meta real-name`,children:e.real_name})]}),(0,Q.jsxs)(`div`,{className:`id-badge`,title:`Account ID`,children:[(0,Q.jsx)(`div`,{className:`label`,children:`ID`}),(0,Q.jsx)(`div`,{className:`value`,children:e.id})]})]})}function wS(e,t={}){let{method:n=`GET`,query:r={},deps:i=[],enabled:a=!0,transform:o=e=>e,onError:s}=t,[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(!!a),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(0),g=(0,Z.useCallback)(()=>h(e=>e+1),[]);return(0,Z.useEffect)(()=>{if(!a)return;let t=!1;return d(!0),(async()=>{try{let i=await Nn.request(e,{method:n,query:r});if(t)return;if(i&&i.error)throw Error(i.message||i.error);l(o(i)),p(null)}catch(e){if(t)return;let n=e&&e.message||`network error`;p(n),s&&s(n)}finally{t||d(!1)}})(),()=>{t=!0}},[a,m,e,...i]),{data:c,loading:u,error:f,reload:g}}var TS=3e3,ES={emojis:[],slots:[],cooldown_seconds:0};function DS(e,t){let{account:n,authToken:r}=mx(e),i=!!r&&typeof n==`object`&&!!n,[a,o]=(0,Z.useState)(`shop`),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(null),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),{data:_,loading:v,error:y,reload:b}=wS(Mt.endPoints.emojis.list,{enabled:i,transform:e=>e.results||ES}),x=_?.emojis||ES.emojis,S=_?.cooldown_seconds||0,C=(0,Z.useMemo)(()=>Wx(n),[n]),w=x.filter(e=>e.owned),T=x.filter(e=>e.for_sale),E=a===`mine`?w:T;(0,Z.useEffect)(()=>{if(d===null)return;let e=setTimeout(()=>f(null),TS);return()=>clearTimeout(e)},[d]);let D=()=>{c(null),u(null)},O=async(n,r)=>{let i=C.map(e=>e&&r&&e.id===r.id?null:e);i[n]=r?{id:r.id,image_url:r.image_url}:null,D();try{await Jx(e,i)}catch(e){t(`error`,Ux(e?.message))}},k=e=>{if(s!==null)return O(s,e);let t=C.findIndex(e=>!e);if(t!==-1)return O(t,e);u(e)},j=e=>{if(l)return O(e,l);c(t=>t===e?null:e)},M=async e=>{g(e.id);try{await qx(e.id);let n=C.findIndex(e=>!e);return n!==-1&&await O(n,e),t(`success`,n===-1?`Emoji is yours`:`Emoji is yours — equipped to slot ${n+1}`),n}catch(e){throw t(`error`,Ux(e?.message)),e}finally{g(null),q.dispatch(A.Reload_Account),b()}};return{signedIn:i,coins:n?.coins??0,tab:a,setTab:o,emojis:x,visible:E,owned:w,forSale:T,slots:C,cooldownSeconds:S,loading:v,error:y,reload:b,selectedSlot:s,pendingEmoji:l,confirmId:d,pendingBuy:p,buyingId:h,assign:O,equip:k,clickSlot:j,buy:async e=>d===e.id?(f(null),M(e).catch(()=>-1)):f(e.id),startBuy:e=>m(e),confirmBuy:async()=>{if(!p)return-1;let e=p;try{let t=await M(e);return m(null),t}catch{return-1}},cancelBuy:()=>m(null),cancelPick:D}}function OS(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function kS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function AS(e,t,n){return t&&kS(e.prototype,t),n&&kS(e,n),e}var jS=Object.defineProperty,MS=function(e,t){return jS(e,`name`,{value:t,configurable:!0})},NS=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1250  <path d="m8.94 8 4.2-4.193a.67.67 0 0 0-.947-.947L8 7.06l-4.193-4.2a.67.67 0 1 0-.947.947L7.06 8l-4.2 4.193a.667.667 0 0 0 .217 1.093.666.666 0 0 0 .73-.146L8 8.94l4.193 4.2a.666.666 0 0 0 1.094-.217.665.665 0 0 0-.147-.73L8.94 8Z" fill="currentColor"/>\r
1251</svg>\r
1252`,PS=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1253  <path d="M16 2.667a13.333 13.333 0 1 0 0 26.666 13.333 13.333 0 0 0 0-26.666Zm0 24A10.667 10.667 0 0 1 5.333 16a10.56 10.56 0 0 1 2.254-6.533l14.946 14.946A10.56 10.56 0 0 1 16 26.667Zm8.413-4.134L9.467 7.587A10.56 10.56 0 0 1 16 5.333 10.667 10.667 0 0 1 26.667 16a10.56 10.56 0 0 1-2.254 6.533Z" fill="currentColor"/>\r
1254</svg>\r
1255`,FS=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1256  <path d="M16 14.667A1.333 1.333 0 0 0 14.667 16v5.333a1.333 1.333 0 0 0 2.666 0V16A1.333 1.333 0 0 0 16 14.667Zm.507-5.227a1.333 1.333 0 0 0-1.014 0 1.334 1.334 0 0 0-.44.28 1.56 1.56 0 0 0-.28.44c-.075.158-.11.332-.106.507a1.332 1.332 0 0 0 .386.946c.13.118.279.213.44.28a1.334 1.334 0 0 0 1.84-1.226 1.4 1.4 0 0 0-.386-.947 1.334 1.334 0 0 0-.44-.28ZM16 2.667a13.333 13.333 0 1 0 0 26.666 13.333 13.333 0 0 0 0-26.666Zm0 24a10.666 10.666 0 1 1 0-21.333 10.666 10.666 0 0 1 0 21.333Z" fill="currentColor"/>\r
1257</svg>\r
1258`,IS=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1259  <path d="m19.627 11.72-5.72 5.733-2.2-2.2a1.334 1.334 0 1 0-1.88 1.881l3.133 3.146a1.333 1.333 0 0 0 1.88 0l6.667-6.667a1.333 1.333 0 1 0-1.88-1.893ZM16 2.667a13.333 13.333 0 1 0 0 26.666 13.333 13.333 0 0 0 0-26.666Zm0 24a10.666 10.666 0 1 1 0-21.333 10.666 10.666 0 0 1 0 21.333Z" fill="currentColor"/>\r
1260</svg>\r
1261`,LS=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1262  <path d="M16.334 17.667a1.334 1.334 0 0 0 1.334-1.333v-5.333a1.333 1.333 0 0 0-2.665 0v5.333a1.333 1.333 0 0 0 1.33 1.333Zm-.508 5.227c.325.134.69.134 1.014 0 .165-.064.314-.159.44-.28a1.56 1.56 0 0 0 .28-.44c.076-.158.112-.332.107-.507a1.332 1.332 0 0 0-.387-.946 1.532 1.532 0 0 0-.44-.28 1.334 1.334 0 0 0-1.838 1.226 1.4 1.4 0 0 0 .385.947c.127.121.277.216.44.28Zm.508 6.773a13.333 13.333 0 1 0 0-26.667 13.333 13.333 0 0 0 0 26.667Zm0-24A10.667 10.667 0 1 1 16.54 27a10.667 10.667 0 0 1-.206-21.333Z" fill="currentColor"/>\r
1263</svg>\r
1264`,RS=MS(function(e){return new DOMParser().parseFromString(e,`text/html`).body.childNodes[0]},`stringToHTML`),zS=MS(function(e){var t=new DOMParser().parseFromString(e,`application/xml`);return document.importNode(t.documentElement,!0).outerHTML},`getSvgNode`),BS={CONTAINER:`sn-notifications-container`,NOTIFY:`sn-notify`,NOTIFY_CONTENT:`sn-notify-content`,NOTIFY_ICON:`sn-notify-icon`,NOTIFY_CLOSE:`sn-notify-close`,NOTIFY_TITLE:`sn-notify-title`,NOTIFY_TEXT:`sn-notify-text`,IS_X_CENTER:`sn-is-x-center`,IS_Y_CENTER:`sn-is-y-center`,IS_CENTER:`sn-is-center`,IS_LEFT:`sn-is-left`,IS_RIGHT:`sn-is-right`,IS_TOP:`sn-is-top`,IS_BOTTOM:`sn-is-bottom`,NOTIFY_OUTLINE:`sn-notify-outline`,NOTIFY_FILLED:`sn-notify-filled`,NOTIFY_ERROR:`sn-notify-error`,NOTIFY_WARNING:`sn-notify-warning`,NOTIFY_SUCCESS:`sn-notify-success`,NOTIFY_INFO:`sn-notify-info`,NOTIFY_FADE:`sn-notify-fade`,NOTIFY_FADE_IN:`sn-notify-fade-in`,NOTIFY_SLIDE:`sn-notify-slide`,NOTIFY_SLIDE_IN:`sn-notify-slide-in`,NOTIFY_AUTOCLOSE:`sn-notify-autoclose`}
1264,VS={ERROR:`error`,WARNING:`warning`,SUCCESS:`success`,INFO:`info`},HS={OUTLINE:`outline`,FILLED:`filled`},US={FADE:`fade`,SLIDE:`slide`},WS={CLOSE:zS(NS),SUCCESS:zS(IS),ERROR:zS(PS),WARNING:zS(LS),INFO:zS(FS)},GS=MS(function(e){e.wrapper.classList.add(BS.NOTIFY_FADE),setTimeout(function(){e.wrapper.classList.add(BS.NOTIFY_FADE_IN)},100)},`fadeIn`),KS=MS(function(e){e.wrapper.classList.remove(BS.NOTIFY_FADE_IN),setTimeout(function(){e.wrapper.remove()},e.speed)},`fadeOut`),qS=MS(function(e){e.wrapper.classList.add(BS.NOTIFY_SLIDE),setTimeout(function(){e.wrapper.classList.add(BS.NOTIFY_SLIDE_IN)},100)},`slideIn`),JS=MS(function(e){e.wrapper.classList.remove(BS.NOTIFY_SLIDE_IN),setTimeout(function(){e.wrapper.remove()},e.speed)},`slideOut`),YS=function(){function e(t){var n=this;OS(this,e),this.notifyOut=MS(function(e){e(n)},`notifyOut`);var r=t.notificationsGap,i=r===void 0?20:r,a=t.notificationsPadding,o=a===void 0?20:a,s=t.status,c=s===void 0?`success`:s,l=t.effect,u=l===void 0?US.FADE:l,d=t.type,f=d===void 0?`outline`:d,p=t.title,m=t.text,h=t.showIcon,g=h===void 0||h,_=t.customIcon,v=_===void 0?``:_,y=t.customClass,b=y===void 0?``:y,x=t.speed,S=x===void 0?500:x,C=t.showCloseButton,w=C===void 0||C,T=t.autoclose,E=T===void 0||T,D=t.autotimeout,O=D===void 0?3e3:D,k=t.position,A=k===void 0?`right top`:k,j=t.customWrapper,M=j===void 0?``:j;if(this.customWrapper=M,this.status=c,this.title=p,this.text=m,this.showIcon=g,this.customIcon=v,this.customClass=b,this.speed=S,this.effect=u,this.showCloseButton=w,this.autoclose=E,this.autotimeout=O,this.notificationsGap=i,this.notificationsPadding=o,this.type=f,this.position=A,!this.checkRequirements()){console.error(`You must specify 'title' or 'text' at least.`);return}this.setContainer(),this.setWrapper(),this.setPosition(),this.showIcon&&this.setIcon(),this.showCloseButton&&this.setCloseButton(),this.setContent(),this.container.prepend(this.wrapper),this.setEffect(),this.notifyIn(this.selectedNotifyInEffect),this.autoclose&&this.autoClose(),this.setObserver()}return AS(e,[{key:`checkRequirements`,value:function(){return!!(this.title||this.text)}},{key:`setContainer`,value:function(){var e=document.querySelector(`.${BS.CONTAINER}`);e?this.container=e:(this.container=document.createElement(`div`),this.container.classList.add(BS.CONTAINER),document.body.appendChild(this.container)),this.notificationsPadding&&this.container.style.setProperty(`--sn-notifications-padding`,`${this.notificationsPadding}px`),this.notificationsGap&&this.container.style.setProperty(`--sn-notifications-gap`,`${this.notificationsGap}px`)}},{key:`setPosition`,value:function(){this.container.classList[this.position===`center`?`add`:`remove`](BS.IS_CENTER),this.container.classList[this.position.includes(`left`)?`add`:`remove`](BS.IS_LEFT),this.container.classList[this.position.includes(`right`)?`add`:`remove`](BS.IS_RIGHT),this.container.classList[this.position.includes(`top`)?`add`:`remove`](BS.IS_TOP),this.container.classList[this.position.includes(`bottom`)?`add`:`remove`](BS.IS_BOTTOM),this.container.classList[this.position.includes(`x-center`)?`add`:`remove`](BS.IS_X_CENTER),this.container.classList[this.position.includes(`y-center`)?`add`:`remove`](BS.IS_Y_CENTER)}},{key:`setCloseButton`,value:function(){var e=this,t=document.createElement(`div`);t.classList.add(BS.NOTIFY_CLOSE),t.innerHTML=WS.CLOSE,this.wrapper.appendChild(t),t.addEventListener(`click`,function(){e.close()})}},{key:`setWrapper`,value:function(){var e=this;switch(this.customWrapper?this.wrapper=RS(this.customWrapper):this.wrapper=document.createElement(`div`),this.wrapper.style.setProperty(`--sn-notify-transition-duration`,`${this.speed}ms`),this.wrapper.classList.add(BS.NOTIFY),this.type){case HS.OUTLINE:this.wrapper.classList.add(BS.NOTIFY_OUTLINE);break;case HS.FILLED:this.wrapper.classList.add(BS.NOTIFY_FILLED);break;default:this.wrapper.classList.add(BS.NOTIFY_OUTLINE)}switch(this.status){case VS.SUCCESS:this.wrapper.classList.add(BS.NOTIFY_SUCCESS);break;case VS.ERROR:this.wrapper.classList.add(BS.NOTIFY_ERROR);break;case VS.WARNING:this.wrapper.classList.add(BS.NOTIFY_WARNING);break;case VS.INFO:this.wrapper.classList.add(BS.NOTIFY_INFO);break}this.autoclose&&(this.wrapper.classList.add(BS.NOTIFY_AUTOCLOSE),this.wrapper.style.setProperty(`--sn-notify-autoclose-timeout`,`${this.autotimeout+this.speed}ms`)),this.customClass&&this.customClass.split(` `).forEach(function(t){e.wrapper.classList.add(t)})}},{key:`setContent`,value:function(){var e=document.createElement(`div`);e.classList.add(BS.NOTIFY_CONTENT);var t,n;this.title&&(t=document.createElement(`div`),t.classList.add(BS.NOTIFY_TITLE),t.textContent=this.title.trim(),this.showCloseButton||(t.style.paddingRight=`0`)),this.text&&(n=document.createElement(`div`),n.classList.add(BS.NOTIFY_TEXT),n.innerHTML=this.text.trim(),this.title||(n.style.marginTop=`0`)),this.wrapper.appendChild(e),this.title&&e.appendChild(t),this.text&&e.appendChild(n)}},{key:`setIcon`,value:function(){var e=MS(function(e){switch(e){case VS.SUCCESS:return WS.SUCCESS;case VS.ERROR:return WS.ERROR;case VS.WARNING:return WS.WARNING;
1264case VS.INFO:return WS.INFO}},`computedIcon`),t=document.createElement(`div`);t.classList.add(BS.NOTIFY_ICON),t.innerHTML=this.customIcon||e(this.status),(this.status||this.customIcon)&&this.wrapper.appendChild(t)}},{key:`setObserver`,value:function(){var e=this,t=new IntersectionObserver(function(t){if(t[0].intersectionRatio<=0)e.close();else return},{threshold:0});setTimeout(function(){t.observe(e.wrapper)},this.speed)}},{key:`notifyIn`,value:function(e){e(this)}},{key:`autoClose`,value:function(){var e=this;setTimeout(function(){e.close()},this.autotimeout+this.speed)}},{key:`close`,value:function(){this.notifyOut(this.selectedNotifyOutEffect)}},{key:`setEffect`,value:function(){switch(this.effect){case US.FADE:this.selectedNotifyInEffect=GS,this.selectedNotifyOutEffect=KS;break;case US.SLIDE:this.selectedNotifyInEffect=qS,this.selectedNotifyOutEffect=JS;break;default:this.selectedNotifyInEffect=GS,this.selectedNotifyOutEffect=KS}}}]),e}();MS(YS,`Notify`);var XS=YS;globalThis.Notify=XS;function ZS(e,t){return t===`error`&&(e=String(e).replace(/[-_]/g,` `)),new XS({status:t,text:e,effect:`slide`,speed:300,autoclose:!0,showCloseButton:!1,type:`filled`,position:`bottom left`})}var QS=(e,t)=>ZS(t,e);function $S({onNeedCoins:e}){let t=DS($,QS),{signedIn:n,forSale:r,loading:i,error:a,reload:o,pendingBuy:s,buyingId:c,coins:l}=t,u;return u=n?a?(0,Q.jsxs)(`div`,{className:`emoji-shop-state error`,children:[`Could not load emojis: `,a,(0,Q.jsx)(`button`,{className:`retry`,onClick:o,children:`Retry`})]}):i&&r.length===0?(0,Q.jsx)(`div`,{className:`emoji-shop-state`,children:`Loading...`}):r.length===0?(0,Q.jsx)(`div`,{className:`emoji-shop-state`,children:`No emojis for sale right now.`}):(0,Q.jsx)(`div`,{className:(0,mb.default)(`emoji-shop-grid`,i&&`loading`),children:r.map(e=>(0,Q.jsx)(eC,{emoji:e,canAfford:l>=e.price,onBuy:()=>t.startBuy(e)},e.id))}):(0,Q.jsx)(`div`,{className:`emoji-shop-state`,children:`Sign in to buy emojis.`}),(0,Q.jsxs)(`div`,{className:`emoji-shop`,children:[u,s&&(0,Q.jsx)(tC,{emoji:s,coins:l,busy:c===s.id,onConfirm:t.confirmBuy,onCancel:t.cancelBuy,onNeedCoins:e})]})}function eC({emoji:e,canAfford:t,onBuy:n}){let{image_url:r,price:i,owned:a,animated:o}=e;return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`emoji-shop-item`,a&&`owned`),children:[o&&(0,Q.jsx)(`span`,{className:`gif-badge`,children:`GIF`}),(0,Q.jsx)(`img`,{src:r,alt:``,draggable:`false`,loading:`lazy`}),a?(0,Q.jsxs)(`div`,{className:`owned-label`,children:[(0,Q.jsx)(`i`,{className:`fas fa-check`}),`Owned`]}):(0,Q.jsxs)(`button`,{className:(0,mb.default)(`buy`,!t&&`poor`),onClick:n,children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),i===0?`Free`:bS(i)]})]})}function tC({emoji:e,coins:t,busy:n,onConfirm:r,onCancel:i,onNeedCoins:a}){let o=t>=e.price,s=t-e.price;return(0,Q.jsx)(`div`,{className:`emoji-buy-confirm`,onClick:n?void 0:i,children:(0,Q.jsxs)(`div`,{className:`card`,onClick:e=>e.stopPropagation(),children:[(0,Q.jsxs)(`div`,{className:`preview`,children:[(0,Q.jsx)(`img`,{src:e.image_url,alt:``,draggable:`false`}),e.animated&&(0,Q.jsx)(`span`,{className:`gif-badge`,children:`GIF`})]}),(0,Q.jsxs)(`div`,{className:`price`,children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),e.price===0?`Free`:bS(e.price)]}),!o&&(0,Q.jsxs)(`div`,{className:`balance poor`,children:[`You have `,bS(t),` · need `,bS(-s),` more`]}),(0,Q.jsxs)(`div`,{className:`actions`,children:[(0,Q.jsx)(`button`,{className:`cancel`,disabled:n,onClick:i,children:`Cancel`}),o?(0,Q.jsx)(`button`,{className:`confirm`,disabled:n,onClick:r,children:n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`i`,{className:`fas fa-circle-notch fa-spin`}),`Buying...`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`i`,{className:`fas fa-shopping-cart`}),`Buy`]})}):(0,Q.jsxs)(`button`,{className:`confirm`,onClick:()=>{i(),a?.()},children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),`Get coins`]})]})]})})}var nC=3e3,rC={hats:[]};function iC(e,t,{equipOnBuy:n=!0}={}){let{account:r,authToken:i,profiles:a}=mx(e),o=!!i&&typeof r==`object`&&!!r,s=a.selected,[c,l]=(0,Z.useState)(`shop`),[u,d]=(0,Z.useState)(0),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(null),{data:v,loading:y,error:b,reload:x}=wS(Mt.endPoints.hats.list,{enabled:o,transform:e=>e.results||rC}),S=v?.hats||rC.hats,C=(0,Z.useMemo)(()=>fS(r,s),[r,s]),w=(0,Z.useMemo)(()=>mS(r,s),[r,s]),T=S.filter(e=>e.owned),E=S.filter(e=>e.for_sale),D=c===`mine`?T:E;(0,Z.useEffect)(()=>
1264{if(f===null)return;let e=setTimeout(()=>p(null),nC);return()=>clearTimeout(e)},[f]);let O=async(n,r)=>{try{return await gS(e,s,n,r),!0}catch(e){return t(`error`,oS(e?.message)),!1}},k=e=>O(u,e),j=(e=u)=>O(e,null),M=async e=>{_(e.id);try{await hS(e.id);let r=n&&await O(u,e);return(r||!n)&&t(`success`,r?`Hat is yours — equipped on cell ${u+1}`:`Hat is yours`),r?u:-1}catch(e){throw t(`error`,oS(e?.message)),e}finally{_(null),q.dispatch(A.Reload_Account),x()}};return{signedIn:o,coins:r?.coins??0,tab:c,setTab:l,hats:S,visible:D,owned:T,forSale:E,profileIndex:s,equipped:C,skins:w,loading:y,error:b,reload:x,selectedTab:u,setSelectedTab:d,confirmId:f,pendingBuy:m,buyingId:g,equip:k,unequip:j,purchase:M,buy:async e=>f===e.id?(p(null),M(e).catch(()=>-1)):p(e.id),startBuy:e=>h(e),confirmBuy:async()=>{if(!m)return-1;let e=m;try{let t=await M(e);return h(null),t}catch{return-1}},cancelBuy:()=>h(null)}}var aC=new Map,oC=new Map,sC=3e4,cC=256;function lC(e){let t=aC.get(e);if(t&&!(!t.ok&&Date.now()-t.at>sC))return t.ok}function uC(e){let t=oC.get(e);return t||(t=new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e}).then(t=>(aC.size>=cC&&aC.delete(aC.keys().next().value),aC.set(e,{ok:t,at:Date.now()}),oC.delete(e),t)),oC.set(e,t),t)}function dC(e){let[t,n]=(0,Z.useState)(()=>e?lC(e)===!1:!1);return(0,Z.useEffect)(()=>{if(!e)return;let t=lC(e);if(t!==void 0){n(!t);return}let r=!0;return n(!1),uC(e).then(e=>r&&n(!e)),()=>{r=!1}},[e]),e&&!t?e:``}function fC({skin:e=``,hat:t=``,size:n,className:r,children:i}){let a=dC(e),o=t&&typeof t==`object`?t:null,s=(o?o.image_url:t)||``,[c,l]=(0,Z.useState)(``),u=n?{width:n,height:n}:void 0;return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`cell-preview`,!a&&`no-skin`,r),style:u,children:[a?(0,Q.jsx)(`img`,{className:`cell-preview-skin`,src:a,alt:``,draggable:`false`}):null,s&&s!==c?(0,Q.jsx)(`img`,{className:`cell-preview-hat`,src:s,alt:``,draggable:`false`,style:In(o?.scale,o?.offset_y),onError:()=>l(s)}):null,i]})}var pC=(e,t)=>ZS(t,e),mC=[0,1];function hC({onNeedCoins:e}){let t=iC($,pC,{equipOnBuy:!1}),{signedIn:n,forSale:r,loading:i,error:a,reload:o,pendingBuy:s,buyingId:c,coins:l,skins:u,selectedTab:d}=t,[f,p]=(0,Z.useState)(null),m=e=>{p(null),t.startBuy(e)},h;return h=n?a?(0,Q.jsxs)(`div`,{className:`hat-shop-state error`,children:[`Could not load hats: `,a,(0,Q.jsx)(`button`,{className:`retry`,onClick:o,children:`Retry`})]}):i&&r.length===0?(0,Q.jsx)(`div`,{className:`hat-shop-state`,children:`Loading...`}):r.length===0?(0,Q.jsx)(`div`,{className:`hat-shop-state`,children:`No hats for sale right now.`}
1264):(0,Q.jsx)(`div`,{className:(0,mb.default)(`hat-shop-grid`,i&&`loading`),children:r.map(e=>(0,Q.jsx)(gC,{hat:e,canAfford:l>=e.price,onTryOn:()=>p(e),onBuy:()=>t.startBuy(e)},e.id))}):(0,Q.jsx)(`div`,{className:`hat-shop-state`,children:`Sign in to buy hats.`}),(0,Q.jsxs)(`div`,{className:`hat-shop`,children:[h,f&&(0,Q.jsx)(vC,{hat:f,skins:u,cell:d,onCell:t.setSelectedTab,onBuy:()=>m(f),onClose:()=>p(null)}),s&&(0,Q.jsx)(yC,{hat:s,skin:u[d],coins:l,busy:c===s.id,onConfirm:t.confirmBuy,onCancel:t.cancelBuy,onNeedCoins:e})]})}function gC({hat:e,canAfford:t,onTryOn:n,onBuy:r}){let{name:i,price:a,owned:o}=e,s=`Try on ${i}`;return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`hat-shop-item`,o&&`owned`),children:[(0,Q.jsx)(`div`,{className:`try-on`,role:`button`,tabIndex:0,title:s,"aria-label":s,onClick:n,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),n())},children:(0,Q.jsx)(fC,{hat:e})}),(0,Q.jsx)(`div`,{className:`name`,title:i,children:i}),(0,Q.jsx)(`div`,{className:`actions`,children:o?(0,Q.jsxs)(`div`,{className:`owned-label`,children:[(0,Q.jsx)(`i`,{className:`fas fa-check`}),`Owned`]}):(0,Q.jsxs)(`button`,{className:(0,mb.default)(`buy`,!t&&`poor`),onClick:r,children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),a===0?`Free`:bS(a)]})})]})}function _C({cell:e,onCell:t}){return(0,Q.jsx)(`div`,{className:`cell-toggle`,role:`tablist`,children:mC.map(n=>(0,Q.jsxs)(`button`,{role:`tab`,"aria-selected":e===n,className:(0,mb.default)(e===n&&`active`),onClick:()=>t(n),children:[`Cell `,n+1]},n))})}function vC({hat:e,skins:t,cell:n,onCell:r,onBuy:i,onClose:a}){return(0,Q.jsx)(`div`,{className:`hat-overlay try-on`,onClick:a,children:(0,Q.jsxs)(`div`,{className:`card`,onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(_C,{cell:n,onCell:r}),(0,Q.jsx)(`div`,{className:`preview`,children:(0,Q.jsx)(fC,{skin:t[n],hat:e})}),(0,Q.jsx)(`div`,{className:`hat-name`,children:e.name}),e.owned?(0,Q.jsxs)(`div`,{className:`owned-note`,children:[(0,Q.jsx)(`i`,{className:`fas fa-check`}),`Owned — wear it from the Hats menu`]}):(0,Q.jsxs)(`div`,{className:`price`,children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),e.price===0?`Free`:bS(e.price)]}),(0,Q.jsxs)(`div`,{className:(0,mb.default)(`actions`,e.owned&&`single`),children:[(0,Q.jsx)(`button`,{className:`cancel`,onClick:a,children:`Close`}),!e.owned&&(0,Q.jsxs)(`button`,{className:`confirm`,onClick:i,children:[(0,Q.jsx)(`i`,{className:`fas fa-shopping-cart`}),`Buy`]})]})]})})}function yC({hat:e,skin:t,coins:n,busy:r,onConfirm:i,onCancel:a,onNeedCoins:o}){let s=n>=e.price,c=n-e.price;return(0,Q.jsx)(`div`,{className:`hat-overlay buy-confirm`,onClick:r?void 0:a,children:(0,Q.jsxs)(`div`,{className:`card`,onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(`div`,{className:`preview`,children:(0,Q.jsx)(fC,{skin:t,hat:e})}),(0,Q.jsx)(`div`,{className:`hat-name`,children:e.name}),(0,Q.jsx)(`div`,{className:`wear-note`,children:`Wear it from the Hats menu`}),(0,Q.jsxs)(`div`,{className:`price`,children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),e.price===0?`Free`:bS(e.price)]}),!s&&(0,Q.jsxs)(`div`,{className:`balance poor`,children:[`You have `,bS(n),` · need `,bS(-c),` more`]}),(0,Q.jsxs)(`div`,{className:`actions`,children:[(0,Q.jsx)(`button`,{className:`cancel`,disabled:r,onClick:a,children:`Cancel`}),s?(0,Q.jsx)(`button`,{className:`confirm`,disabled:r,onClick:i,children:r?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`i`,{className:`fas fa-circle-notch fa-spin`}),`Buying...`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`i`,{className:`fas fa-shopping-cart`}),`Buy`]})}):(0,Q.jsxs)(`button`,{className:`confirm`,onClick:()=>{a(),o?.()},children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),`Get coins`]})]})]})})}var bC=`https://static.xsolla.com/embed/paystation/1.2.3/widget.min.js`,xC=`./img/coins.png`,SC=500,CC;function wC(){return window.XPayStationWidget?Promise.resolve():CC||(CC=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=bC,n.onload=e,n.onerror=()=>{CC=null,t(Error(`Could not load Xsolla Pay Station`))},document.body.append(n)}),CC)}var TC=[{id:`coins`,text:`Coins`,icon:`fas fa-coins`},{id:`emojis`,text:`Emojis`,icon:`fas fa-grin-stars`},{id:`hats`,text:`Hats`,icon:`fas fa-hat-cowboy`}];function EC({tab:e=`coins`}){let[t,n]=(0,Z.useState)(e);return(0,Q.jsxs)(`div`,{className:`store-coins-modal`,children:[(0,Q.jsx)(xS,{}),(0,Q.jsx)(`div`,{className:`tabs`,children:TC.map(({id:e,text:r,icon:i})=>(0,Q.jsxs)(`button`,{disabled:e===t,onClick:()=>n(e),children:[(0,Q.jsx)(`i`,{className:i}),r]},e))}),t===`coins`&&(0,Q.jsx)(DC,{}),t===`emojis`&&(0,Q.jsx)($S,{onNeedCoins:()=>n(`coins`)}),t===`hats`&&(0,Q.jsx)(hC,{onNeedCoins:()=>n(`coins`)})]})}function DC(){let[e,t]=(0,Z.useState)(``),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(`idle`),[u,d]=(0,Z.useState)(``),f=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{e&&(XPayStationWidget.on(`status-done status-delivering`,()=>{q.dispatch(A.Reload_Account);let e=f.current;ZS(e?`Coins gifted to ${e.name} (ID ${e.id})`:`Coins credited`,`success`),XPayStationWidget.off()}),XPayStationWidget.init({access_token:e,lightbox:{height:`60%`}}),XPayStationWidget.open())},[e]),(0,Z.useEffect)(()=>
1264{if(s(null),!n||!i){l(`idle`),d(``);return}let e=$.account&&typeof $.account==`object`?$.account.id:null;if(e&&Number(i)===Number(e)){l(`error`),d(`That's your own account ID`);return}l(`checking`),d(``);let t=!1,r=setTimeout(async()=>{try{let e=await Nn.request(`/store/giftRecipient`,{query:{account_id:i}});if(t)return;if(e.error||!e.account)throw Error(e.error||`not found`);s(e.account),l(`found`)}catch{if(t)return;l(`error`),d(`Account not found — check the ID`)}},SC);return()=>{t=!0,clearTimeout(r)}},[n,i]);let{data:p}=wS(`/store/coins`,{transform:e=>{if(e.packets_type!=`coins`)throw Error(String(e.packets_type));return e.packets},onError:e=>ZS(`Store coins err load: `+e,`error`)}),m=p||[],h=n&&c===`found`?o:null,g=n&&!h,_=(0,Z.useCallback)((e,n)=>{f.current=n||null,kC(e,t,n)},[]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`gift-bar`,children:[(0,Q.jsxs)(`div`,{className:`gift-toggle`,onClick:()=>r(!n),children:[(0,Q.jsxs)(`div`,{className:`label`,children:[(0,Q.jsx)(`i`,{className:`fas fa-gift`}),`Buy as a gift for a friend`]}),(0,Q.jsxs)(`div`,{className:(0,mb.default)(`toggle-btn`,n&&`active`),children:[(0,Q.jsx)(`div`,{className:`slide`}),(0,Q.jsx)(`div`,{className:`ball`})]})]}),n&&(0,Q.jsxs)(`div`,{className:`gift-controls`,children:[(0,Q.jsx)(`input`,{type:`text`,className:`input-field`,placeholder:`Friend's account ID`,inputMode:`numeric`,maxLength:12,value:i,onChange:({target:e})=>a(e.value.replace(/\D/g,``))}),c===`found`&&o?(0,Q.jsxs)(`div`,{className:`gift-found`,children:[(0,Q.jsx)(`i`,{className:`fas fa-check-circle`}),(0,Q.jsx)(CS,{account:o})]}):(0,Q.jsxs)(`div`,{className:(0,mb.default)(`gift-status`,c),children:[c===`idle`&&`The ID is shown in your friend's profile`,c===`checking`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`i`,{className:`fas fa-circle-notch fa-spin`}),` Checking…`]}),c===`error`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`i`,{className:`fas fa-exclamation-circle`}),` `,u]})]})]})]}),(0,Q.jsx)(`div`,{className:`blocks`,children:m.map(e=>(0,Q.jsx)(OC,{item:e,onBuy:_,giftRecipient:h,disabled:g},e.id))})]})}function OC({item:e,onBuy:t,giftRecipient:n,disabled:r}){let i=e.active_time_discount_price>Date.now(),a=e.img_url||xC;return(0,Q.jsxs)(`div`,{className:`block`,children:[(0,Q.jsx)(`div`,{className:`count`,children:String(e.amount).replace(/(?!^)(?=(?:\d{3})+(?:\.|$))/gm,` `)}),(0,Q.jsx)(`img`,{src:a,draggable:`false`,onError:e=>{e.currentTarget.src.endsWith(`/img/coins.png`)||(e.currentTarget.src=xC)}}),i&&(0,Q.jsxs)(`div`,{className:`discount`,children:[(0,Q.jsxs)(`div`,{className:`old-price`,children:[`$`,e.price]}),(0,Q.jsxs)(`div`,{className:`time`,children:[`to `,AC(parseInt((e.active_time_discount_price-Date.now())/1e3))]})]}),(0,Q.jsxs)(`button`,{disabled:r,onClick:()=>{t(e,n)},children:[n?`Gift`:`Buy`,` for $`,i&&e.discount_price||e.price]})]})}async function kC(e,t,n){try{let r={packet_type:`coins`,packet_id:e.id};n&&(r.recipient_account_id=n.id);let[i]=await Promise.all([Nn.requestJson(`/store/generateToken`,r),wC()]);if(i.error||!i.token)return ZS(i.error===`invalid_request`?`Payments are temporarily unavailable. Please try again later.`:i.error===`invalid_packet`?`This coin package is no longer available.`:i.error===`invalid_recipient`?`Could not find that account. Check the ID and try again.`:`Could not start the payment. Please try again.`,`error`);t(i.token)}catch(e){console.error(`Could not initialize payment`,e),ZS(`Could not start the payment. Please try again.`,`error`)}}function AC(e,t=!0){if(e<3e3)return`<5 m`;let n=e/3600^0,r=(e-n*3600)/60^0,i=0;t&&(i=parseInt(n/24),n-=i*24);let a=``;return i!=0&&t&&(a+=i+`d `),n!=0&&(a+=n+`h `),r==0?n!=0&&(a+=r+`m `):a+=r+`m `,a}function jC(){return(jC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function MC(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function NC(e){var t=(0,Z.useRef)(e),n=(0,Z.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var PC=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},FC=function(e){return`touches`in e},IC=function(e){return e&&e.ownerDocument.defaultView||self},LC=function(e,t,n){var r=e.getBoundingClientRect(),i=FC(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:PC((i.pageX-(r.left+IC(e).pageXOffset))/r.width),top:PC((i.pageY-(r.top+IC(e).pageYOffset))/r.height)}},RC=function(e){!FC(e)&&e.preventDefault()},zC=Z.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=MC(e,[`onMove`,`onKey`,`onEnd`]),a=(0,Z.useRef)(null),o=NC(t),s=NC(n),c=NC(r),l=(0,Z.useRef)(null),u=(0,Z.useRef)(!1),d=(0,Z.useMemo)(function(){var e=function(e){RC(e),(FC(e)?e.touches.length>0:e.buttons>0)&&a.current?o(LC(a.current,e,l.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=u.current,i=IC(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(RC(t),!function(e,t){return t&&!FC(e)}(t,u.current)&&r)){if(FC(t)){u.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(LC(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,o,c]),f=d[0],p=d[1],m=d[2],h=d[3];return(0,Z.useEffect)(function(){return h},[h]),Z.createElement(`div`,jC({},i,{onTouchStart:f,onMouseDown:f,className:`react-colorful__interactive`,ref:a,onKeyDown:p,onKeyUp:m,tabIndex:0,role:`slider`}))}),BC=function(e){return e.filter(Boolean).join(` `)},VC=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=BC([`react-colorful__pointer`,e.className]);
1264return Z.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},Z.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},HC=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var UC=function(e){return ZC(WC(e))},WC=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?HC(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?HC(parseInt(e.substring(6,8),16)/255,2):1}},GC=function(e){return XC(JC(e))},KC=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:HC(e.h),s:HC(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:HC(i/2),a:HC(r,2)}},qC=function(e){var t=KC(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},JC=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:HC(255*[r,s,o,o,c,r][l]),g:HC(255*[c,r,r,s,o,o][l]),b:HC(255*[o,o,c,r,r,s][l]),a:HC(i,2)}},YC=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},XC=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?YC(HC(255*i)):``;return`#`+YC(t)+YC(n)+YC(r)+a},ZC=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:HC(60*(s<0?s+6:s)),s:HC(a?o/a*100:0),v:HC(a/255*100),a:i}},QC=Z.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=BC([`react-colorful__hue`,e.className]);return Z.createElement(`div`,{className:i},Z.createElement(zC,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:PC(t+360*e.left,0,360)})},onEnd:r,"aria-label":`Hue`,"aria-valuenow":HC(t),"aria-valuemax":`360`,"aria-valuemin":`0`},Z.createElement(VC,{className:`react-colorful__hue-pointer`,left:t/360,color:qC({h:t,s:100,v:100,a:1})})))}),$C=Z.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:qC({h:t.h,s:100,v:100,a:1})};return Z.createElement(`div`,{className:`react-colorful__saturation`,style:i},Z.createElement(zC,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:PC(t.s+100*e.left,0,100),v:PC(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":`Color`,"aria-valuetext":`Saturation `+HC(t.s)+`%, Brightness `+HC(t.v)+`%`},Z.createElement(VC,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:qC(t)})))}),ew=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},tw=function(e,t){return e.toLowerCase()===t.toLowerCase()||ew(WC(e),WC(t))};function nw(e,t,n,r){var i=NC(n),a=NC(r),o=(0,Z.useState)(function(){return e.toHsva(t)}),s=o[0],c=o[1],l=(0,Z.useRef)({color:t,hsva:s}),u=(0,Z.useRef)(!1);return(0,Z.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},c(n),u.current=!1}},[t,e]),(0,Z.useEffect)(function(){var t;ew(s,l.current.hsva)||e.equal(t=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:t},i(t),u.current=!0)},[s,e,i]),[s,(0,Z.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,Z.useCallback)(function(){u.current&&(u.current=!1,a(l.current.color))},[a])]}var rw,iw=typeof window<`u`?Z.useLayoutEffect:Z.useEffect,aw=function(){return rw||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},ow=new WeakMap,sw=function(e){iw(function(){var t=e.current;if(typeof document<`u`&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&(`head`in n||`host`in n)?n:t.ownerDocument;if(!ow.has(r)){var i=`head`in r?r.head:r,a=(i.ownerDocument||document).createElement(`style`);a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;
1264left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var o=aw();o&&a.setAttribute(`nonce`,o),ow.set(r,a),i.appendChild(a)}}},[])},cw=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=e.onChangeEnd,s=MC(e,[`className`,`colorModel`,`color`,`onChange`,`onChangeEnd`]),c=(0,Z.useRef)(null);sw(c);var l=nw(n,i,a,o),u=l[0],d=l[1],f=l[2],p=BC([`react-colorful`,t]);return Z.createElement(`div`,jC({},s,{ref:c,className:p}),Z.createElement($C,{hsva:u,onChange:d,onChangeEnd:f}),Z.createElement(QC,{hue:u.h,onChange:d,onChangeEnd:f,className:`react-colorful__last-control`}))},lw={defaultColor:`000`,toHsva:UC,fromHsva:function(e){return GC({h:e.h,s:e.s,v:e.v,a:1})},equal:tw},uw=function(e){return Z.createElement(cw,jC({},e,{colorModel:lw}))},dw=/^#?([0-9A-F]{3,8})$/i,fw=function(e){var t=e.color,n=t===void 0?``:t,r=e.onChange,i=e.onBlur,a=e.escape,o=e.validate,s=e.format,c=e.process,l=MC(e,[`color`,`onChange`,`onBlur`,`escape`,`validate`,`format`,`process`]),u=(0,Z.useState)(function(){return a(n)}),d=u[0],f=u[1],p=NC(r),m=NC(i),h=(0,Z.useCallback)(function(e){var t=a(e.target.value);f(t),o(t)&&p(c?c(t):t)},[a,c,o,p]),g=(0,Z.useCallback)(function(e){o(e.target.value)||f(a(n)),m(e)},[n,a,o,m]);return(0,Z.useEffect)(function(){f(a(n))},[n,a]),Z.createElement(`input`,jC({},l,{value:s?s(d):d,spellCheck:`false`,onChange:h,onBlur:g}))},pw=function(e){return`#`+e},mw=function(e){var t=e.prefixed,n=e.alpha,r=MC(e,[`prefixed`,`alpha`]),i=(0,Z.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,``).substring(0,n?8:6)},[n]),a=(0,Z.useCallback)(function(e){return function(e,t){var n=dw.exec(e),r=n?n[1].length:0;return r===3||r===6||!!t&&r===4||!!t&&r===8}(e,n)},[n]);return Z.createElement(fw,jC({},r,{escape:i,format:t?pw:void 0,process:pw,validate:a}))},hw=(e,t)=>{(0,Z.useEffect)(()=>{let n=!1,r=!1,i=i=>{n||!r||!e.current||e.current.contains(i.target)||t(i)},a=t=>{r=e.current,n=e.current&&e.current.contains(t.target)};return document.addEventListener(`mousedown`,a),document.addEventListener(`touchstart`,a,{passive:!0}),document.addEventListener(`click`,i),()=>{document.removeEventListener(`mousedown`,a),document.removeEventListener(`touchstart`,a),document.removeEventListener(`click`,i)}},[e,t])},gw=({color:e,onChange:t,root:n})=>{let r=(0,Z.useRef)(),[i,a]=(0,Z.useState)(!1);return hw(r,(0,Z.useCallback)(()=>a(!1),[]),n),(0,Q.jsxs)(`div`,{className:`popup-color-picker`,children:[(0,Q.jsx)(`span`,{className:`swatch`,onClick:()=>a(!0),children:(0,Q.jsx)(`span`,{style:{backgroundColor:e}})}),(0,Q.jsx)(mw,{color:e.toUpperCase(),onChange:t,onClick:()=>a(!0)}),i&&(0,Q.jsx)(`div`,{className:`popover`,ref:r,children:(0,Q.jsx)(uw,{color:e,onChange:t})})]})},_w=Mt.endPoints.clans.icons,vw=e=>e.message||e.error||`Unknown error`,yw=[{name:`My`,icon:(0,Q.jsx)(`i`,{className:`fas fa-home`})},{name:`Invitations`,icon:(0,Q.jsx)(`i`,{className:`fas fa-envelope`})},{name:`Free`,icon:(0,Q.jsx)(`i`,{className:`fas fa-user`})},{name:`Top`,icon:(0,Q.jsx)(`i`,{className:`fas fa-star`})}];function bw(){let[e,t]=(0,Z.useState)(`My`),[n,r]=(0,Z.useState)({}),[i,a]=(0,Z.useState)({}),[o,s]=(0,Z.useState)([]),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(0),f=(0,Z.useCallback)(()=>n.clan&&n.members.find(e=>e.accounts_id==$.account.id)||null),{data:p}=wS(`/clans/load`,{deps:[u],onError:e=>ZS(`Couldn't load clans: `+e,`error`)});(0,Z.useEffect)(()=>{p&&r(p)},[p]),(0,Z.useEffect)(()=>{c||(a({}),s([]))},[c]);let m=(0,Z.useCallback)(async e=>{let t=await Nn.requestJson(`/clans/watch`,{clan_id:e});if(t.error||!t.clan||!t.members?.length)return ZS(`Couldn't load the clan: `+vw(t),`error`);a(t.clan),s(t.members),l(!0)});return(0,Q.jsxs)(`div`,{className:`clans-modal`,children:[(0,Q.jsx)(xw,{activeTab:c?null:e,countInvites:n?.invsClans?.length||0,onTab:e=>{l(!1),t(e)}}),!c&&(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(Sw,{activeTab:e,clansData:n,setActiveTab:t,openClanWatcher:m,setReloadClans:d,playerInClan:f})}
1264)||c&&(0,Q.jsx)(`div`,{className:`content`,children:(0,Q.jsx)(ww,{clanData:i,clanMembers:o,setActiveTab:t,setActive:l,setReloadClans:d,playerInClan:f})})]})}function xw({activeTab:e,onTab:t,countInvites:n}){return(0,Q.jsx)(`div`,{className:`tabs`,children:yw.map((r,i)=>(0,Q.jsxs)(`div`,{className:(0,mb.default)(`tab`,e===r.name&&`active`),onClick:()=>{t(r.name)},children:[i==1&&n&&(0,Q.jsx)(`div`,{className:`counter`,children:n})||(0,Q.jsx)(Q.Fragment,{}),r.icon,` `,r.name]},i))})}function Sw({activeTab:e,clansData:t,setActiveTab:n,openClanWatcher:r,setReloadClans:i,playerInClan:a}){return(0,Q.jsx)(`div`,{className:`content`,children:(0,Z.useMemo)(()=>({My:(0,Q.jsx)(ww,{clanData:t.clan||{},clanMembers:t.members||[],inMy:!0,setActiveTab:n,setReloadClans:i,playerInClan:a}),Invitations:(0,Q.jsx)(Dw,{isUsers:t.type===`clan`,clansData:t.invsClans||[],openClanWatcher:r,setReloadClans:i}),Free:(0,Q.jsx)(Ow,{clansData:t.freeClans||[],openClanWatcher:r}),Top:(0,Q.jsx)(kw,{clansData:t.topClans||[],openClanWatcher:r})}),[t])[e]})}function Cw({clanData:e,setClanCreatorActive:t,setReloadClans:n}){let r=Object.keys(e).length,[i,a]=(0,Z.useState)(e.name||``),[o,s]=(0,Z.useState)(e.tag||``),[c,l]=(0,Z.useState)(e.description||``),[u,d]=(0,Z.useState)(e.type||0),[f,p]=(0,Z.useState)(e.min_level||0),[m,h]=(0,Z.useState)(e.icon||``),[g,_]=(0,Z.useState)(e.icon_type||0),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(e.places||0),[S,C]=(0,Z.useState)(!1),{data:w}=wS(`/store/pricelist`,{query:{type:`clan`},transform:e=>{if(!e.pricelist||!Object.keys(e.pricelist).length)throw Error(`empty pricelist`);return e.pricelist},onError:e=>ZS(`Couldn't load prices: `+e,`error`)}),T=w?.[`clan-create`]||`???`,E=w?.[`clan-tune`]||`???`,D=w?.[`clan-add-slots`]||`???`,O=(e,t,n=1)=>{if(S||C(!0),e+=1,e>t)return C(!1);setTimeout(()=>{x(e),O(e,t,n++)},300*n)},k=async()=>{let e=new FormData;e.append(`tag`,o),e.append(`name`,i),e.append(`description`,c),e.append(`icon`,m),e.append(`icon_type`,String(g)),e.append(`type`,String(u)),e.append(`min_level`,String(f)),v&&g==2&&e.append(`image_file`,v);try{let i=await Nn.request(r?`/clans/change`:`/clans/create`,{method:`POST`,body:e});if(i.error||!i.success)return ZS((r?`Couldn't save clan settings: `:`Couldn't create the clan: `)+vw(i),`error`);ZS(r&&`Clan settings saved`||`Clan created`,`success`),t(!1),n(e=>e+1),q.dispatch(A.Reload_Account)}catch(e){console.log(e)}};return(0,Q.jsxs)(`div`,{className:`clan-creator`,children:[(0,Q.jsxs)(`button`,{className:`back-to`,onClick:()=>{t(!1),n(e=>e+1)},children:[(0,Q.jsx)(`i`,{className:`fas fa-arrow-left`}),` Back`]}),(0,Q.jsx)(`div`,{className:`title`,children:r&&`Clan settings`||`Create a clan`}),(0,Q.jsxs)(`div`,{className:`setup`,children:[(0,Q.jsxs)(`div`,{className:`main`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Main setup`}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`input`,{type:`text`,placeholder:`Name`,maxLength:25,onChange:({target:e})=>a(e.value),value:i}),(0,Q.jsx)(`div`,{className:`ps`,children:`* The clan's name`})]}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`input`,{type:`text`,placeholder:`Tag`,maxLength:10,onChange:({target:e})=>s(e.value),value:o}),(0,Q.jsx)(`div`,{className:`ps`,children:`* A short, simple tag`})]}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`textarea`,{placeholder:`Description`,maxLength:255,onChange:({target:e})=>l(e.value),value:c,style:{height:r?`95px`:`150px`}}),(0,Q.jsx)(`div`,{className:`ps`,children:`* Clan description (rules, history, discord etc.)`})]}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsxs)(`select`,{value:u,onChange:({target:e})=>d(e.value),children:[(0,Q.jsx)(`option`,{value:`-1`,disabled:!0,children:`Accessibility`}),(0,Q.jsx)(`option`,{value:`0`,children:`Open`}),(0,Q.jsx)(`option`,{value:`1`,children:`Invitation only`})]}),(0,Q.jsx)(`div`,{className:`ps`,children:`* How other players can join your clan`})]}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`input`,{type:`number`,placeholder:`Min level`,onChange:e=>{let t=e.target.value;t<0?t=0:t>999&&(t=999),p(t)},value:f}),(0,Q.jsx)(`div`,{className:`ps`,children:`* Minimum level to be able to join`})]})]}),(0,Q.jsxs)(`div`,{className:`setup-other`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Icon setup`}),(0,Q.jsxs)(`div`,{className:`other`,children:[g==2&&v!=null&&(0,Q.jsx)(`img`,{className:`icon`,draggable:`false`,src:URL.createObjectURL(v)})||r&&g==2&&(0,Q.jsx)(`img`,{className:`icon`,draggable:`false`,src:_w+m})||(0,Q.jsx)(`div`,{className:`icon`,style:{background:m}}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsxs)(`select`,{value:g,onChange:({target:e})=>{_(e.value),h(``),y(null)},children:[(0,Q.jsx)(`option`,{value:`-1`,disabled:!0,children:`Choose the type of icon to be displayed`}),(0,Q.jsx)(`option`,{value:`0`,children:`Color`}),(0,Q.jsx)(`option`,{value:`2`,children:`Uploading an image to the server`})]}
1264),g==0&&(0,Q.jsx)(gw,{color:`#FFF`,onChange:e=>{h(e)}})||g==2&&(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`div`,{className:`upload-wrap`,children:[(0,Q.jsxs)(`button`,{children:[(0,Q.jsx)(`i`,{className:`fas fa-upload`}),` Select image`]}),(0,Q.jsx)(`input`,{id:`loadClanIcon`,className:`imageUploadFile`,type:`file`,accept:`image/png, image/jpeg`,onChange:({target:e})=>{let t=e.files[0];t&&y(t)}})]})}),(0,Q.jsx)(`div`,{className:`ps`,children:`* The icon that players will see.`})]})]}),(0,Q.jsxs)(`button`,{className:`action`,onClick:()=>k(),children:[r&&`Change settings`||`Create a clan`,` for`,` `,Mw(r&&E||T),` `,(0,Q.jsx)(`i`,{className:`fas fa-coins`})]})]})]}),r?(0,Q.jsxs)(`div`,{className:`add-slotes`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Add slots to clan`}),(0,Q.jsxs)(`div`,{className:`action`,children:[(0,Q.jsxs)(`div`,{className:`slots`,children:[`Total slots: `,b,`/100`]}),(0,Q.jsxs)(`button`,{onClick:async()=>{let e=await Nn.request(`/clans/addSlots`,{method:`POST`});if(e.error)return ZS(`Couldn't add slots: `+vw(e),`error`);e.success&&(O(b,b+5),q.dispatch(A.Reload_Account))},disabled:S,children:[`+5 slots for `,Mw(D),` `,(0,Q.jsx)(`i`,{className:`fas fa-coins`})]})]})]}):``]})}function ww({clanData:e,clanMembers:t,inMy:n=!1,setActive:r=()=>{},setActiveTab:i=()=>{},setReloadClans:a=()=>{},playerInClan:o}){let[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),d=async()=>{let e=await Nn.request(`/clans/leave`,{method:`POST`});if(e.error)return ZS(`Couldn't leave the clan: `+vw(e),`error`);a(e=>e+1)};return t.sort((e,t)=>t.xp-e.xp).sort((e,t)=>t.right-e.right),(0,Q.jsx)(`div`,{className:`clanWatch`,children:s&&(0,Q.jsx)(Cw,{clanData:e,setClanCreatorActive:c,setReloadClans:a})||Object.keys(e).length&&(0,Q.jsxs)(`div`,{className:`clan`,children:[(0,Q.jsxs)(`div`,{className:`info`,children:[l&&(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(Ew,{setClanInviterShow:u})}),!n&&(0,Q.jsx)(`div`,{className:`admin-row`,children:(0,Q.jsxs)(`button`,{className:`back-to`,onClick:()=>{r(!1)},children:[(0,Q.jsx)(`i`,{className:`fas fa-arrow-left`}),` Back`]})}),o()?.right>=2&&n&&(0,Q.jsxs)(`div`,{className:`admin-row`,children:[(0,Q.jsxs)(`button`,{className:`invite`,onClick:()=>{u(!l)},children:[(0,Q.jsx)(`i`,{className:`fas fa-user-plus`}),` Invite`]}),o()?.right==3&&(0,Q.jsxs)(`button`,{className:`settings`,onClick:()=>{c(!0)},children:[(0,Q.jsx)(`i`,{className:`fas fa-cog`}),` Settings`]})]}),e.icon_type==0&&(0,Q.jsx)(`div`,{className:`icon`,style:{background:e.icon||`#4b4b4b`}})||(0,Q.jsx)(`img`,{className:`icon`,draggable:`false`,src:_w+e.icon}),(0,Q.jsx)(`div`,{className:`name text-line`,children:e.name}),(0,Q.jsxs)(`div`,{className:`xps`,children:[(0,Q.jsx)(`img`,{className:`xp-icon`,draggable:`false`,src:`./img/xp.png`}),Mw(e.xps)]}),(0,Q.jsx)(`div`,{className:`description`,children:e.description}),(0,Q.jsxs)(`div`,{className:`other`,children:[(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Place`}),(0,Q.jsxs)(`div`,{className:`info text-line`,children:[`#`,e.position]})]}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Tag`}),(0,Q.jsx)(`div`,{className:`info text-line`,children:e.tag})]}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Type`}),(0,Q.jsx)(`div`,{className:`info text-line`,children:e.type==0&&`Free`||`Invite only`})]}),(0,Q.jsxs)(`div`,{className:`item`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Min Level`}),(0,Q.jsx)(`div`,{className:`info text-line`,children:e.min_level})]})]}),(0,Q.jsx)(`div`,{className:`buttons`,children:o()&&n&&(0,Q.jsx)(`button`,{className:`leave`,onClick:()=>{if(o()?.right==3&&e.members>1)return tS.default.fire({icon:`info`,title:`You can't leave the clan`,text:`You can only leave the clan if only one player remains in the clan - it's you or if you transfer the right to control the clan to another player.`,heightAuto:!1});tS.default.fire({title:e.members==1&&`You are the last member in the clan. If you leave it, the clan will be deleted. Are you sure you want this?`||`Do you really want to leave the clan?`,showDenyButton:!0,confirmButtonText:`Yes`,denyButtonText:`No, I'd rather stay`,heightAuto:!1}).then(e=>{e.isConfirmed&&d()})},children:`Leave`})||!o()&&!n&&(0,Q.jsx)(`button`,{className:`join`,onClick:async()=>{let t=await Nn.requestJson(`/clans/join`,{clan_id:e.id});if(t.error)return ZS(`Couldn't join the clan: `+vw(t),`error`);a(e=>e+1),r(!1),i(`My`),ZS(`You joined a clan`,`success`)},children:`Join`})})]}),(0,Q.jsxs)(`div`,{className:`members`,children:[(0,Q.jsxs)(`div`,{className:`count`,children:[`Members: `,e.members,`/`,e.places]}),(0,Q.jsx)(`div`,{className:`members-store`,children:t.map((e,t)=>(0,Q.jsx)(Tw,{idx:t,member:e,playerInClan:o,setReloadClans:a,inMy:n},t))})]})]})||n&&(0,Q.jsxs)(`div`,{className:`startMenuClan`,children:[(0,Q.jsxs)(`div`,{className:`description`,children:[`Welcome to clans!`,(0,Q.jsx)(`br`,{}),`Here you can unite with players in one clan and fight for the best place in the top, defeating other players. You can find a clan or create your own.`]}),(0,Q.jsxs)(`div`,{className:`actions`,children:[(0,Q.jsx)(`button`,{onClick:()=>{i(`Free`)},children:`Find a clan`}),(0,Q.jsx)(`div`,{className:`gachiMuchi`,children:`or`}),(0,Q.jsx)(`button`,{onClick:()=>{c(!0)},children:`Create a clan`})]})]})||(0,Q.jsx)(`div`,{className:`loadingClan`,children:`Loading...`})})}function Tw({member:e,idx:t,playerInClan:n,setReloadClans:r,inMy:i}){let[a,o]=(0,Z.useState)(!1),s=n()||{},c=async()=>{let t=await Nn.requestJson(`/clans/kick`,{member_id:e.member_id});if(t.error)return ZS(`Couldn't kick the member: `+vw(t),`error`);ZS(`Player removed from clan`,`success`),r(e=>e+1)},l=async t=>{let n=await Nn.requestJson(`/clans/set-role`,{type:t,member_id:e.member_id});if(n.error)return ZS(`Couldn't change the role: `+vw(n),`error`);ZS(`The player has been assigned a new role`,`success`),r(e=>e+1)};return(0,Q.jsxs)(`div`,{className:`member`,children:[(0,Q.jsx)(`div`,{className:`idx`,children:t+1}),(0,Q.jsx)(`img`,{className:`member-avatar`,draggable:`false`,src:e.avatar_url,onError:({currentTarget:e})=>{e.onerror=null,e.src=`./img/avatar.png`}}),(0,Q.jsxs)(`div`,{className:`member-info`,children:[(0,Q.jsx)(`div`,{className:`name text-line`,children:e.real_name}),(0,Q.jsx)(`div`,{className:`right`,style:{color:e.right==1&&`#FFF`||e.right==2&&`#57e689`||`#e69757`},children:e.right==1&&`Member`||e.right==2&&`Deputy`||`Chief`})]}),(0,Q.jsxs)(`div`,{className:`member-xp`,children:[(0,Q.jsx)(`img`,{className:`xp-icon`,draggable:`false`,src:`./img/xp.png`}),(0,Q.jsx)(`div`,{className:`xp text-line`,children:Mw(e.xp)})]}),s.right>1&&i&&(0,Q.jsx)(`i`,{className:`player-menu-control fas fa-ellipsis-v`,onClick:()=>o(!a)}),a&&i&&(0,Q.jsxs)(`div`,{className:`player-menu`,children:[s.right>=2&&s.right>e.right&&(0,Q.jsxs)(`div`,{className:`item`,onClick:c,children:[(0,Q.jsx)(`i`,{className:`fas fa-minus`}),`Kick`]}),s.right>=3&&e.right==1&&(0,Q.jsxs)(`div`,{className:`item`,onClick:()=>l(`deputy`),children:[(0,Q.jsx)(`i`,{className:`fas fa-angle-up`}),`Promote to Deputy`]}),s.right>=3&&e.right==2&&(0,Q.jsxs)(`div`,{className:`item`,onClick:()=>{tS.default.fire({title:`Are you sure you want to transfer all clan management rights to this player? You will lose the ability to manage the clan and only this player can return it.`,showDenyButton:!0,confirmButtonText:`Yes`,denyButtonText:`No, I will remain Chief`,heightAuto:!1}).then(e=>{e.isConfirmed&&l(`chief`)})},children:[(0,Q.jsx)(`i`,{className:`fas fa-angle-double-up`}),`Promote to Chief`]}),s.right>=3&&e.right==2&&(0,Q.jsxs)(`div`,{className:`item`,onClick:()=>l(`undeputy`),children:[(0,Q.jsx)(`i`,{className:`fas fa-angle-down`}),`Demoted to Member`]}
1264),(0,Q.jsxs)(`div`,{className:`item`,onClick:()=>o(!1),children:[(0,Q.jsx)(`i`,{className:`fas fa-times`}),`Close`]})]})]},`member-`+t)}function Ew({setClanInviterShow:e}){let[t,n]=(0,Z.useState)(``);return(0,Q.jsxs)(`div`,{className:`invite-block`,children:[(0,Q.jsx)(`button`,{className:`close`,onClick:()=>e(!1),children:`x`}),(0,Q.jsx)(`div`,{className:`title`,children:`Invite player to clan`}),(0,Q.jsxs)(`div`,{className:`action`,children:[(0,Q.jsx)(`input`,{type:`number`,placeholder:`Account ID`,onChange:({target:e})=>{n(e.value)},value:t}),(0,Q.jsx)(`button`,{onClick:async()=>{let n=await Nn.requestJson(`/clans/invite`,{player_id:Number(t)});if(n.error)return ZS(`Couldn't send the invite: `+vw(n),`error`);ZS(`Clan invite sent to player`,`success`),e(!1)},children:`Invite`})]})]})}function Dw({isUsers:e,clansData:t,openClanWatcher:n,setReloadClans:r}){let i=(0,Z.useCallback)(async e=>{let t=await Nn.requestJson(`/clans/deleteClanInvite`,{clan_id:e},{method:`DELETE`});if(t.error)return ZS(`Couldn't remove the invite: `+vw(t),`error`);r(e=>e+1)}),a=(0,Z.useCallback)(async e=>{let t=await Nn.requestJson(`/clans/deleteUserInvite`,{invited_id:e},{method:`DELETE`});if(t.error)return ZS(`Couldn't remove the invite: `+vw(t),`error`);r(e=>e+1)});return(0,Q.jsx)(`div`,{className:`clansInvitation`,children:t.length&&t.map((t,r)=>e?(0,Q.jsx)(jw,{user:t,deleteInvite:a},t.id):(0,Q.jsx)(Aw,{clan:t,idx:r,openClanWatcher:n,deleteInvite:i},t.id))||(0,Q.jsx)(`div`,{className:`notFound`,children:`No pending clan invitations`})})}function Ow({clansData:e,openClanWatcher:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(e),o=(0,Z.useCallback)(async()=>{let e=await Nn.request(`/clans/search`,{query:{query:n}});if(e.error)return ZS(`Couldn't search clans: `+vw(e),`error`);a(e.clans||[])});return(0,Q.jsxs)(`div`,{className:`clansFree`,children:[(0,Q.jsxs)(`div`,{className:`search-block`,children:[(0,Q.jsx)(`input`,{type:`text`,className:`input-field`,id:`name-clan-search`,placeholder:`Name or Tag`,onChange:({target:e})=>{r(e.value)}}),(0,Q.jsx)(`button`,{onClick:()=>{o()},children:`Find a clan`})]}),(0,Q.jsx)(`div`,{className:`clans-items`,children:i.length&&i.map((e,n)=>(0,Q.jsx)(Aw,{clan:e,idx:n,openClanWatcher:t},n))||(0,Q.jsx)(`div`,{className:`notFound`,children:`No matches.`})})]})}function kw({clansData:e,openClanWatcher:t}){return(0,Q.jsx)(`div`,{className:`clansTop`,children:e.length&&e.map((e,n)=>(0,Q.jsx)(Aw,{clan:e,idx:n,displayPosition:!0,openClanWatcher:t},e.id))||(0,Q.jsx)(`div`,{className:`notFound`,children:`No clans found...`})})}function Aw({clan:e,idx:t,displayPosition:n=!1,openClanWatcher:r,deleteInvite:i=null}){return(0,Q.jsxs)(`div`,{className:`clan-item`,onClick:()=>r(e.id),children:[n&&(0,Q.jsxs)(`div`,{className:`position`,children:[`#`,t+1]})||(0,Q.jsx)(Q.Fragment,{}),(0,Q.jsx)(`div`,{className:`icon`,style:e.icon_type==0&&{background:e.icon||`#4b4b4b`}||{background:`url(${_w+e.icon})`,backgroundSize:`cover`}}),(0,Q.jsx)(`div`,{className:`name text-line`,children:e.name}),(0,Q.jsx)(`div`,{className:`tag`,children:e.tag}),(0,Q.jsxs)(`div`,{className:`places`,title:`Members`,children:[(0,Q.jsx)(`i`,{className:`fas fa-user`}),e.members,`/`,e.places]}),(0,Q.jsxs)(`div`,{className:`xps`,children:[(0,Q.jsx)(`img`,{className:`xp-icon`,draggable:`false`,src:`./img/xp.png`}),Mw(e.xps)]}),i&&(0,Q.jsx)(`button`,{className:`delete-invite`,title:`Decline invite`,onClick:t=>{t.stopPropagation(),i(e.id)},children:(0,Q.jsx)(`i`,{className:`fas fa-times`})})]})}function jw({user:e,deleteInvite:t=null}){return(0,Q.jsxs)(`div`,{className:`member-item`,children:[(0,Q.jsx)(`div`,{className:`icon`,style:{background:`url(${e.avatar_url})`,backgroundSize:`cover`}}),(0,Q.jsx)(`div`,{className:`name text-line`,children:e.real_name}),(0,Q.jsxs)(`div`,{className:`xps`,children:[(0,Q.jsx)(`img`,{className:`xp-icon`,draggable:`false`,src:`./img/xp.png`}),(0,Q.jsx)(`div`,{className:`xp text-line`,children:Mw(e.experience)})]}),t&&(0,Q.jsx)(`button`,{className:`delete-invite`,title:`Cancel invite`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(`i`,{className:`fas fa-times`})})]})}function Mw(e){return String(e).replace(/(?!^)(?=(?:\d{3})+(?:\.|$))/gm,` `)}function Nw(){let[e,t]=(0,Z.useState)(`Name`),[n,r]=(0,Z.useState)(`#FFFFFF`),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(0),{data:c}=wS(`/store/reserved_names/list`,{deps:[o],transform:e=>e.names||[],onError:e=>ZS(`Recerved names err load: `+e,`error`)}),l=c||[],{data:u}=wS(`/store/pricelist`,{query:{type:`reserved-names`},deps:[o],transform:e=>{if(!e.pricelist||!Object.keys(e.pricelist).length)throw Error(`empty pricelist`);return e.pricelist},onError:e=>ZS(`Price list err load: `+e,`error`)}),d=u?.[`reserved-name`]||`???`,f=u?.[`reserved-name-free-color`]||`???`,p=u?.[`reserved-name-change-color`]||`???`;return(0,Q.jsxs)(`div`,{className:`reserved-names-modal`,children:[(0,Q.jsx)(xS,{}),(0,Q.jsx)(`div`,{className:`title`,children:`Reserved Names`}),(0,Q.jsxs)(`div`,{className:`body`,children:[(0,Q.jsxs)(`div`,{className:`owned`,children:[(0,Q.jsx)(`div`,{className:`owned-title`,children:`Owned names`}),(0,Q.jsxs)(`div`,{className:`names`,children:[l.length===0&&(0,Q.jsx)(`div`,{className:`no-names`,children:`No reserved names yet`}),l.map(e=>(0,Q.jsx)(Pw,{item:e,priceChangeColor:p},e.id))]})]}),(0,Q.jsxs)(`div`,{className:`create`,children:[(0,Q.jsx)(`div`,{className:`new-name-preview`,style:{color:n},children:e||`Name`}
1264),(0,Q.jsxs)(`div`,{className:`create-controls`,children:[(0,Q.jsx)(`input`,{type:`text`,className:`input-field`,id:`reserved-name`,placeholder:`Name`,onChange:({target:e})=>{t(e.value)},defaultValue:e}),(0,Q.jsx)(gw,{color:n,onChange:e=>{r(e)}}),(0,Q.jsxs)(`div`,{className:`opt-toggle`,children:[(0,Q.jsxs)(`div`,{className:`name`,children:[`Free color change (+`,bS((f||0)-(d||0)||`?`),` `,(0,Q.jsx)(`i`,{className:`fas fa-coins`}),`)`]}),(0,Q.jsxs)(`div`,{className:(0,mb.default)(`toggle-btn`,i&&`active`),onClick:()=>{a(!i)},children:[(0,Q.jsx)(`div`,{className:`slide`}),(0,Q.jsx)(`div`,{className:`ball`})]})]}),(0,Q.jsxs)(`button`,{className:`add`,onClick:()=>{Fw(e,n,i,s)},children:[`Buy for `,bS(i&&(f||`?`)||d||`?`),(0,Q.jsx)(`i`,{className:`fas fa-coins`})]})]})]})]})]})}function Pw({item:e,priceChangeColor:t}){let[n,r]=(0,Z.useState)(e.color);return(0,Q.jsxs)(`div`,{className:`block`,children:[(0,Q.jsx)(`div`,{className:`name`,style:{color:n},children:e.name}),(0,Q.jsxs)(`div`,{className:`change-color`,children:[(0,Q.jsx)(gw,{color:n,onChange:e=>{r(e)}}),(0,Q.jsx)(`button`,{className:`btn-change-color`,onClick:()=>{Iw(e.id,n)},children:e.change_color_free&&`Save free`||(0,Q.jsxs)(Q.Fragment,{children:[`Save for `,bS(t||`?`),` `,(0,Q.jsx)(`i`,{className:`fas fa-coins`})]})})]})]})}async function Fw(e,t,n,r){let i=await Nn.requestJson(`/store/reserved_names/add`,{name:e,color:t,change_color_free:!!n});if(i.error||!i.success)return ZS(`Add reserved name err: `+i.error,`error`);q.dispatch(A.Reload_Account),ZS(`The added name is reserved`,`success`),r(e=>e+1)}async function Iw(e,t){let n=await Nn.requestJson(`/store/reserved_names/setColor`,{name_id:e,color:t});if(n.error||!n.success)return ZS(`Set name color err: `+n.error,`error`);ZS(`Name color saved`,`success`),q.dispatch(A.Reload_Account)}var Lw=Mt.endPoints.clans.icons,Rw=`./img/avatar.png`;function zw(e){return String(e).replace(/(?!^)(?=(?:\d{3})+(?:\.|$))/gm,` `)}function Bw(){let[e,t]=(0,Z.useState)(`players`),{account:n}=mx($),r=typeof n==`object`&&n?n:null,{data:i,loading:a}=wS(`/accounts/leaderboard/top`,{onError:e=>ZS(`Leaderboard err load: `+e,`error`)}),o=i?.players||[],s=i?.clans||[],c=i?.me||null,l=c!==null&&o.some(e=>e.id===c.id);return(0,Q.jsxs)(`div`,{className:`leaderboard-modal`,children:[(0,Q.jsx)(`div`,{className:`lb-header`,children:(0,Q.jsxs)(`div`,{className:`lb-selector`,children:[(0,Q.jsx)(`div`,{className:(0,mb.default)(e===`players`&&`selected`),onClick:()=>t(`players`),children:`Players`}),(0,Q.jsx)(`div`,{className:(0,mb.default)(e===`clans`&&`selected`),onClick:()=>t(`clans`),children:`Clans`})]})}),(0,Q.jsxs)(`div`,{className:`lb-body`,children:[(0,Q.jsx)(`div`,{className:`lb-title`,children:e===`players`?`Top 100 all-time players`:`Top 50 clans`}),(0,Q.jsxs)(`div`,{className:`lb-rows`,children:[!i&&(0,Q.jsx)(`div`,{className:`lb-empty`,children:a?`Loading...`:`No data yet`}),e===`players`&&o.map(e=>(0,Q.jsxs)(`div`,{className:(0,mb.default)(`lb-row`,e.rank<=3&&`lb-top-${e.rank}`,r?.id===e.id&&`myself`),children:[(0,Q.jsxs)(`div`,{className:`pos`,children:[`#`,e.rank]}),(0,Q.jsx)(`img`,{className:`avatar`,draggable:`false`,loading:`lazy`,src:e.avatar_url||Rw,onError:({target:e})=>{e.onerror=null,e.src=Rw}}),(0,Q.jsx)(`div`,{className:`name text-line`,children:e.name}),(0,Q.jsxs)(`div`,{className:`level`,children:[`Level `,e.level]}),(0,Q.jsxs)(`div`,{className:`xps`,children:[(0,Q.jsx)(`img`,{className:`xp-icon`,draggable:`false`,src:`./img/xp.png`}),zw(e.experience)]})]},e.id)),e===`clans`&&s.map(e=>(0,Q.jsxs)(`div`,{className:`lb-row`,children:[(0,Q.jsxs)(`div`,{className:`pos`,children:[`#`,e.rank]}),e.icon_type==0&&(0,Q.jsx)(`div`,{className:`clan-icon`,style:{background:e.icon||`#4b4b4b`}})||(0,Q.jsx)(`img`,{className:`clan-icon`,draggable:`false`,loading:`lazy`,src:Lw+e.icon}),(0,Q.jsx)(`div`,{className:`name text-line`,children:e.name}),(0,Q.jsx)(`div`,{className:`tag`,children:e.tag}),(0,Q.jsxs)(`div`,{className:`members`,title:`Members`,children:[(0,Q.jsx)(`i`,{className:`fas fa-user`}),e.members,`/`,e.places]}),(0,Q.jsxs)(`div`,{className:`xps`,children:[(0,Q.jsx)(`img`,{className:`xp-icon`,draggable:`false`,src:`./img/xp.png`}
1264),zw(e.xps)]})]},e.id))]}),e===`players`&&c!==null&&!l&&(0,Q.jsxs)(`div`,{className:`lb-row myself lb-me-row`,children:[(0,Q.jsxs)(`div`,{className:`pos`,children:[`#`,zw(c.rank)]}),(0,Q.jsx)(`img`,{className:`avatar`,draggable:`false`,src:r?.avatar_url||Rw,onError:({target:e})=>{e.onerror=null,e.src=Rw}}),(0,Q.jsx)(`div`,{className:`name text-line`,children:r?.real_name||`You`}),(0,Q.jsxs)(`div`,{className:`level`,children:[`Level `,c.level]}),(0,Q.jsxs)(`div`,{className:`xps`,children:[(0,Q.jsx)(`img`,{className:`xp-icon`,draggable:`false`,src:`./img/xp.png`}),zw(c.experience)]})]})]})]})}aiptag=window.aiptag=window.aiptag||{cmd:[]},aiptag.cmd.load=aiptag.cmd.load||[],aiptag.cmd.display=aiptag.cmd.display||[],aiptag.cmd.player=aiptag.cmd.player||[],aiptag.cmp={show:!1,position:`centered`,button:!1,buttonText:`Privacy settings`,buttonPosition:`bottom-left`};var Vw=aiptag,Hw=Mt.turnstile.sitekey,Uw=`captcha-overlay`,Ww=null,Gw=Promise.resolve(),Kw=null,qw=0,Jw=null,Yw=new Map,Xw=class e{static options={};static sendCaptcha(t){if(Kw)return Kw;let n=X.connectionGeneration,r=++qw,i=e.getToken({...t,action:`game-connect`,isValid:()=>r===qw&&n===X.connectionGeneration}).then(e=>e===null||r!==qw||n!==X.connectionGeneration?!1:(Ly.captcha(1,e),!!e));return Kw=i,i.then(()=>{Kw===i&&(Kw=null)},()=>{Kw===i&&(Kw=null)}),i}static cancelGameChallenge(){qw++,Kw=null,Yw.delete(`game-connect`),Jw?.action===`game-connect`&&Jw.finish(null)}static getToken(t={}){let n=t.action===`game-connect`?`game-connect`:null;if(n){let e=Yw.get(n);if(e)return e}let r=Gw.then(()=>e.renderToken(t));return n&&Yw.set(n,r),Gw=r.then(()=>void 0,()=>void 0),r.then(()=>{Yw.get(n)===r&&Yw.delete(n)},()=>{Yw.get(n)===r&&Yw.delete(n)}),r}static async renderToken({action:t,isValid:n}={}){if(n&&!n())return null;let r=document.getElementById(Uw);if(!r)return console.error(`Turnstile overlay is not available`),``;if(r.style.visibility=`visible`,!Hw)return console.error(`Turnstile sitekey is not configured`),r.style.visibility=`hidden`,``;try{await e.waitForTurnstile()}catch(e){return console.error(`Turnstile failed to load:`,e),r.style.visibility=`hidden`,``}if(n&&!n())return r.style.visibility=`hidden`,null;Ww!==null&&(window.turnstile.remove(Ww),Ww=null),r.innerHTML=``;let i=document.createElement(`div`);i.id=`cf-turnstile`,r.appendChild(i);try{return await new Promise(e=>{let n=!1,i=(t=``)=>{n||(n=!0,r.style.visibility=`hidden`,Ww!==null&&window.turnstile&&(window.turnstile.remove(Ww),Ww=null),r.innerHTML=``,Jw?.finish===i&&(Jw=null),e(t))};Jw={action:t,finish:i};let a={sitekey:Hw,theme:`dark`,retry:`never`,callback:e=>{i(e)},"expired-callback":()=>{Ww!==null&&window.turnstile.reset(Ww)},"timeout-callback":()=>{Ww!==null&&window.turnstile.reset(Ww)},"error-callback":e=>(console.error(`Turnstile error:`,e),i(),!0),"unsupported-callback":()=>i()};t&&(a.action=t),Ww=window.turnstile.render(`#cf-turnstile`,a)})}catch(e){return console.error(`Turnstile render failed:`,e),r.style.visibility=`hidden`,``}}static async waitForTurnstile(){if(!window.turnstile)return new Promise((e,t)=>{let n=Date.now()+1e4,r=()=>{window.turnstile?e():Date.now()>=n?t(Error(`Turnstile script load timed out`)):setTimeout(r,100)};r()})}static reset(){Ww&&window.turnstile&&window.turnstile.reset(Ww)}};Vw.cmd.player.push(function(){Vw.adplayer=new aipPlayer({AIP_REWARDEDCOMPLETE:function(e){ZS(`Reward not received due to error: `+e,`warning`)},AIP_REWARDEDGRANTED:async function(){let e=await Xw.getToken({action:`free-coins`});if(!e)return ZS(`CAPTCHA verification was not completed`,`error`);let t=await Nn.request(`/store/coins/get-free-coins`,{headers:{"cf-turnstile-response":e}});if(t.error)return ZS(t.error,`error`);ZS(t.success,`success`),q.dispatch(A.Reload_Account)}})});function Zw(){Vw.adplayer===void 0?ZS(`Rewarded Ad Could not be loaded, please try again later.`,`error`):Vw.cmd.player.push(function(){Vw.adplayer.startRewardedAd({preload:!1,showLoading:!0})})}var Qw=`./img/avatar.png`;function $w({version:e,callModal:t}){let{authToken:n,account:r}=mx($),[i,a]=(0,Z.useState)(`loggedout`),o=(0,Z.useCallback)(()=>{$.account=-1,Kx(null),Nn.logout()},[]),s=(0,Z.useCallback)(()=>{$.authToken&&(async()=>{let t=await Nn.request(`/account/`);if(t.cmd===`reset-account-store`||t.error)return o();t.version=e,$.account=t,Kx(t),dS(t)})().catch(o)},[]);hb(A.Reload_Account,s),(0,Z.useEffect)(()=>{$.account===null?a(`loading`):$.account===-1?a(`loggedout`):a(`loggedin`)},[r]),(0,Z.useEffect)(()=>{localStorage.removeItem(Mt.storageKeys.account),$.account=null,Nn.refresh().then(e=>{e||($.account=-1)}).catch(()=>{$.account=-1})},[]),(0,Z.useEffect)(()=>{s()},[n,e,o]);let c;switch(i){case`loading`:c=eT;break;case`loggedout`:c=iT;break;case`loggedin`:c=!$.authToken||!$.account||typeof $.account!=`object`?iT:rT;break}return(0,Q.jsx)(`div`,{id:`account-box`,children:(0,Q.jsx)(c,{setState:a,clearAccount:o,callModal:t})})}function eT(){return(0,Q.jsx)(`div`,{className:`account-loading`,children:(0,Q.jsx)(`h2`,{children:`Loading...`})})}
1264function tT(e){let t=Math.ceil(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60);return n>0?`${n}h ${r}m`:r>0?`${r}m`:`${t}s`}function nT(e){let t=e?new Date(e).getTime():0,[n,r]=(0,Z.useState)(()=>Math.max(0,t-Date.now()));return(0,Z.useEffect)(()=>{if(r(Math.max(0,t-Date.now())),!t)return;let e=setInterval(()=>{let n=Math.max(0,t-Date.now());r(n),n===0&&clearInterval(e)},1e3);return()=>clearInterval(e)},[t]),n>0?tT(n):null}function rT({clearAccount:e,callModal:t}){let[n,r]=(0,Z.useState)($.account.avatar_url||Qw),{real_name:i,experience:a,coins:o,free_coins_available_at:s}=mx($.account),c=nT(s),l=yS.levelFromExp(a),u=yS.realExp(a),d=yS.realExpGainRequiredForLevelUp(l),f=_S(u/d*100,5,100);return(0,Q.jsxs)(`div`,{className:`account-profile`,children:[(0,Q.jsxs)(`div`,{className:`profile-card`,children:[(0,Q.jsxs)(`div`,{className:`profile-top`,children:[(0,Q.jsx)(`div`,{className:`profile-avatar`,children:(0,Q.jsx)(`img`,{id:`pf-avatar`,draggable:`false`,src:n,onError:()=>{r(Qw)},alt:`avatar`})}),(0,Q.jsxs)(`div`,{className:`profile-stats`,children:[(0,Q.jsx)(`div`,{id:`pf-name`,className:`profile-name truncate`,children:i}),(0,Q.jsxs)(`div`,{id:`pf-level`,className:`profile-level`,children:[`Level `,l]}),(0,Q.jsxs)(`div`,{className:`profile-id`,children:[`ID `,$.account.id||``]}),(0,Q.jsxs)(`div`,{className:`profile-coins`,children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),(0,Q.jsx)(`span`,{id:`pf-coins`,children:o}),(0,Q.jsx)(`button`,{id:`pf-coins-btn`,className:`add-coins`,title:`Buy coins`,onClick:()=>{t((0,Q.jsx)(EC,{}))},children:(0,Q.jsx)(`i`,{className:`fas fa-plus`})})]})]})]}),(0,Q.jsxs)(`div`,{className:`xp-bar`,children:[(0,Q.jsx)(`div`,{id:`pf-exp-fill`,className:`xp-fill`,style:{width:`${f}%`}}),(0,Q.jsxs)(`span`,{id:`pf-exp`,className:`xp-text`,children:[u,` / `,d,` XP`]})]})]}),(0,Q.jsxs)(`div`,{className:`account-buttons`,children:[(0,Q.jsxs)(`button`,{id:`pf-coins-shop-btn`,className:`btn btn-hybrid`,onClick:()=>{t((0,Q.jsx)(EC,{}))},children:[(0,Q.jsx)(`i`,{className:`fas fa-coins`}),`Shop`]}),(0,Q.jsxs)(`button`,{id:`pf-free-coins-btn`,className:`btn btn-hybrid`,disabled:c!=null,title:c==null?`Watch an ad to earn free coins`:`Next free coins in ${c}`,onClick:()=>{Zw()},children:[(0,Q.jsx)(`i`,{className:c==null?`fas fa-gift`:`fas fa-hourglass-half`}),c??`Free Coins`]}),(0,Q.jsxs)(`button`,{id:`pf-reserved-names-btn`,className:`btn btn-hybrid`,onClick:()=>{t((0,Q.jsx)(Nw,{}))},children:[(0,Q.jsx)(`i`,{className:`fas fa-lock`}),`Names`]}),(0,Q.jsxs)(`button`,{id:`pf-clans-btn`,className:`btn btn-hybrid`,onClick:()=>{t((0,Q.jsx)(bw,{}))},children:[(0,Q.jsx)(`i`,{className:`fas fa-users`}),`Clans`]}),(0,Q.jsxs)(`button`,{id:`pf-leaderboard-btn`,className:`btn btn-hybrid`,onClick:()=>{t((0,Q.jsx)(Bw,{}))},children:[(0,Q.jsx)(`i`,{className:`fas fa-trophy`}),`Leaderboard`]}),(0,Q.jsxs)(`button`,{id:`btnLogout`,className:`btn btn-hybrid logout`,onClick:()=>{tS.default.fire({title:`Log out?`,text:`You will need to sign in again to access your skins, clan and coins.`,icon:`question`,showDenyButton:!0,confirmButtonText:`Logout`,denyButtonText:`Stay`,confirmButtonColor:`#dc3545`,denyButtonColor:`#6c757d`,heightAuto:!1}).then(t=>{t.isConfirmed&&e()})},children:[(0,Q.jsx)(`i`,{className:`fas fa-sign-out-alt`}),`Logout`]})]})]})}function iT(){return(0,Q.jsxs)(`div`,{className:`login-screen`,children:[(0,Q.jsx)(`div`,{className:`login-screen-text`,children:`Sign in to access exclusive features!`}),(0,Q.jsxs)(`div`,{className:`login-details`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`i`,{className:`fas fa-magic`}),`Skins`]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`i`,{className:`fas fa-arrow-up`}),`Levels`]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`i`,{className:`fas fa-shield-alt`}),`Clans`]})]}),(0,Q.jsxs)(`div`,{className:`login-buttons`,children:[(0,Q.jsxs)(`button`,{id:`btnLoginDisc`,className:`btn btn-discord login-btn`,onClick:()=>{aT(Mt.endPoints.authDiscord,`Discord`)},children:[(0,Q.jsx)(`svg`,{width:`26`,height:`26`,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.1.1 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.1 16.1 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.
126402.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02M8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12m6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12`})}),`Login with Discord`]}),(0,Q.jsxs)(`button`,{id:`btnLoginFB`,className:`btn btn-fb login-btn`,onClick:()=>{aT(Mt.endPoints.authFacebook,`Facebook`)},children:[(0,Q.jsx)(`svg`,{width:`26`,height:`26`,viewBox:`0 0 1024 1024`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32m-92.4 233.5h-63.9c-50.1 0-59.8 23.8-59.8 58.8v77.1h119.6l-15.6 120.7h-104V912H539.2V602.2H434.9V481.4h104.3v-89c0-103.3 63.1-159.6 155.3-159.6c44.2 0 82.1 3.3 93.2 4.8v107.9z`})}),`Login with Facebook`]})]})]})}function aT(e,t){let n=`toolbar=no, menubar=no, width=600, height=700, top=100, left=100`;t=`Login with `+t,window.login===void 0&&(window.login={windowObjectReference:null,previousUrl:null});let r=window.login;r.windowObjectReference===null||r.windowObjectReference.closed?r.windowObjectReference=window.open(e,t,n):(r.previousUrl===e||(r.windowObjectReference=window.open(e,t,n)),r.windowObjectReference.focus()),r.previousUrl=e,Nn.watchAuthPopup(r.windowObjectReference)}var oT={LEVELS:`level`,FREE:`free`,MYSKINS:`mine`,FAVORITES:`favorites`,SUBMITSKIN:`submit`},sT={NONE:(0,Q.jsx)(Q.Fragment,{}),FAVORITE:(0,Q.jsx)(`i`,{className:`fas fa-star fa-2x`}),DELETE:(0,Q.jsx)(`i`,{className:`fas fa-times fa-2x`})},cT=[{id:oT.LEVELS,corner:sT.NONE,text:`Level`,icon:(0,Q.jsx)(`i`,{className:`fas fa-medal`}),type:`list`,paginated:!1},{id:oT.FREE,corner:sT.FAVORITE,text:`Free`,icon:(0,Q.jsx)(`i`,{className:`fas fa-grin-hearts`}),type:`list`,paginated:!0},{id:oT.MYSKINS,corner:sT.NONE,text:`My Skins`,icon:(0,Q.jsx)(`i`,{className:`fas fa-user-circle`}),type:`list`,paginated:!0},{id:oT.FAVORITES,corner:sT.DELETE,text:`Favorites`,icon:(0,Q.jsx)(`i`,{className:`fas fa-star`}),type:`list`,paginated:!0},{id:oT.SUBMITSKIN,corner:sT.NONE,text:`Submit`,icon:(0,Q.jsx)(`i`,{className:`fas fa-plus-square`}),type:`submit`,paginated:!1}];function lT({skins:e,selectedSkinId:t}){let{tab:n}=mx($).skinList,r=e=>{$.skinList.tab=e,$.skinList.page=1,$.skinList.search=``},i=(0,Z.useMemo)(()=>cT.find(({id:e})=>e===n),[n]),a;switch(i.type){case`list`:a=(0,Q.jsx)(mT,{skins:e,selectedSkinId:t,currentTab:i});break;case`submit`:a=(0,Q.jsx)(vT,{});break}return(0,Q.jsxs)(`div`,{className:`skins-modal`,children:[(0,Q.jsx)(`div`,{className:`tabs`,children:cT.map(({id:e,icon:t,text:i})=>(0,Q.jsxs)(`button`,{disabled:e===n,onClick:()=>r(e),children:[t,i]},e))}),(0,Q.jsx)(`div`,{className:`content`,children:a})]})}var uT=async(e,t)=>Nn.request(`/skins/${e}`,{method:t}),dT=async(e,t,n)=>(q.dispatch(A.Hide_Modals),Nn.requestJson(`/account/save-profile`,{profile_id:e,profile:{route1:t,route2:n}})),fT=(0,Q.jsx)(`i`,{className:`fas fa-lock`}),pT=`/web/img/error-skin.png`;function mT({selectedSkinId:e,skins:t,currentTab:n}){let r=mx($),{account:i}=r,a=r.profiles.selected,{page:o,search:s}=r.skinList,c=e=>$.skinList.page=e,l=e=>{$.skinList.search=e,$.skinList.page=1},[u,d]=(0,Z.useState)(s);(0,Z.useEffect)(()=>{let e=setTimeout(()=>d(s),300);return()=>clearTimeout(e)},[s]);let f=u.trim()!==``,{data:p,loading:m,error:h}=wS(`/skins/${f?`search`:`list`}`,{query:{type:n.id,page:n.id==`free`?o-1:o,query:u},deps:[u,n,o],transform:({results:e})=>Array.isArray(e)?[...e].sort((e,t)=>parseInt(e.requirement_data)-parseInt(t.requirement_data)):[]}),g=p||[],_=Array.isArray(i?.favorites)?i.favorites:[],v=g.length<10;return(0,Q.jsxs)(Q.Fragment,{children:[n.paginated&&(0,Q.jsx)(`input`,{type:`text`,className:`searchBox`,placeholder:`Search . . .`,value:s,onChange:e=>l(e.target.value)}),h&&(0,Q.jsx)(`div`,{className:`skins-error`,children:h}),(0,Q.jsx)(`div`,{className:`scrollview`,children:(0,Q.jsx)(`div`,{className:(0,mb.default)(`grid-container`,m&&`loading`),children:g.map(({skin_name:r,skin_route:o,requirement_data:s,requirement_type:c,id:l})=>{let u=c===1,d=!1;u&&yS.levelFromExp(i?.experience||0)<parseInt(s)&&(d=!0);let f=_.includes(l),p=t[e]===`${Mt.endPoints.skins.routeBase}/${o}`,m=r===`Pending`,h;switch(!0){case d:h=(0,Q.jsxs)(Q.Fragment,{children:[fT,` Level `,s]});break;case m:d=!0,h=(0,Q.jsxs)(Q.Fragment,{children:[fT,` Pending`]});break;case p:h=`Unequip`;break;case!p:h=`Equip`;break}return!f&&n.id===oT.FAVORITES?null:(0,Q.jsxs)(`div`,{className:(0,mb.default)(`grid-item`,p&&`equipped`),children:[(0,Q.jsx)(`img`,{src:/^https?:\/\//.test(o)?o:`${Mt.endPoints.skins.routeBase}/${o}`,draggable:`false`,loading:`lazy`,onError:({target:e})=>{e.onerror=null,e.src=pT}}),(0,Q.jsx)(`div`,{className:(0,mb.default)(`icon`,f&&`selected`,n.corner===sT.DELET
1264E&&`delete-icon`),onClick:()=>{let e=$.account?.favorites;Array.isArray(e)&&(f?e.splice(e.indexOf(l),1):e.push(l),uT(`favorite/${l}`,f?`DELETE`:`POST`))},children:n.corner}),(0,Q.jsx)(`div`,{className:`title`,children:r}),(0,Q.jsx)(`button`,{className:(0,mb.default)(p&&`delete`),disabled:d,onClick:()=>{if(!$.account?.skin_profiles)return;let t=$.account.skin_profiles[a]||{};p?(t[`skin_id_${e+1}`]=null,$.account.skin_routes[l]=``):(t[`skin_id_${e+1}`]=l,$.account.skin_routes[l]=o),dT(a,$.account.skin_routes[t.skin_id_1]||``,$.account.skin_routes[t.skin_id_2]||``),$.account.skin_profiles[a]=t},children:h})]},l??o)})})}),n.paginated&&!f&&(0,Q.jsx)(hT,{isMax:v,page:o,setPage:c})]})}function hT({isMax:e,page:t,setPage:n}){return(0,Q.jsxs)(`div`,{id:`skinsPagin`,className:`pagination`,children:[t>=2&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`a`,{className:`pagination-0`,onClick:()=>n(1),children:`«`}),(0,Q.jsx)(`a`,{className:`pagination-1`,onClick:()=>n(t-1),children:t-1})]}),(0,Q.jsx)(`a`,{className:`pagination-2 active`,children:t}),(0,Q.jsx)(`a`,{className:(0,mb.default)(`pagination-3`,e&&`disabled`),onClick:()=>!e&&n(t+1),children:t+1}),(0,Q.jsx)(`a`,{className:(0,mb.default)(`pagination-4`,e&&`disabled`),onClick:()=>!e&&n(t+2),children:t+2})]})}async function gT(e){return Nn.requestJson(`/skins/submit`,{image:e})}async function _T(e){let t=new FormData;t.append(`image_file`,e);let n=await Nn.request(`/skins/fallback-upload`,{method:`POST`,body:t});if(!n||!n.link)throw Error(n&&(n.message||n.error)||`network error`);return n.link}function vT(){let[e,t]=(0,Z.useState)(1),[n,r]=(0,Z.useState)(null);return(0,Q.jsx)(`div`,{id:`skin-submit`,children:(0,Q.jsxs)(`div`,{className:`submit-page`,children:[(0,Q.jsx)(`h3`,{children:`Submit A Skin`}),(0,Q.jsx)(`p`,{children:`Submit a custom skin to be approved. Approved skins will become freely available to all players!`}),(0,Q.jsx)(`p`,{children:(0,Q.jsx)(`i`,{children:`Note: You can only have a limited number of skins pending approval at once.`})}),(0,Q.jsx)(`div`,{className:`upload`,children:{1:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`input`,{className:`imageUploadFile`,type:`file`,accept:`image/png, image/jpeg`,onChange:({target:e})=>{let n=e.files[0];n&&(t(2),(async()=>{let e;try{e=await _T(n)}catch(e){r(e&&e.message||null),t(5);return}let i=await gT(e);i.success&&!i.error?t(3):i.error&&i.error.indexOf(`pending`)!=-1?t(4):(r(i.message||i.error||null),t(5))})())}}),` `,(0,Q.jsx)(`button`,{className:`submit-button`,children:`Browse `})]}),2:(0,Q.jsx)(`button`,{disabled:!0,className:`submit-button`,children:`Uploading...`}),3:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h2`,{children:`Done!`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{children:`Check your 'My Skins' periodically to see your approved submissions.`}),(0,Q.jsx)(`button`,{id:`submitStartOver`,onClick:()=>{t(1)},children:`Start Over`})]})]}),4:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h2`,{children:`Pending`}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`p`,{children:`You already have the maximum number of skins pending moderation.`})})]}),5:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h2`,{children:`Whoops.`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{children:n||`There was a problem uploading.`}),(0,Q.jsx)(`button`,{onClick:()=>{r(null),t(1)},children:`Try Again`})]})]})}[e]})]})})}var yT=`/web/img/no-skin.png`;function bT({callModal:e,skins:t,setSkins:n,setHats:r}){let i=mx($),a=i.profiles.selected,{account:o}=i,s=fS(o,a),c=n=>{if(!$.authToken||!$.account||typeof $.account!=`object`)return tS.default.fire({icon:`info`,title:`Info`,text:`You must be logged in to use this feature!`,heightAuto:!1});e((0,Q.jsx)(lT,{skins:t,selectedSkinId:n}),1)};return(0,Z.useEffect)(()=>{let e=mS(o,a),t=fS(o,a).map(e=>e?.id||0);n(t=>xT(t,e)),r(e=>xT(e,t))},[a,o,n,r]),(0,Q.jsxs)(`div`,{className:`profile-controls`,children:[(0,Q.jsx)(`div`,{className:`arrow inline`,id:`profile-previous`,onClick:()=>{$.profiles.selected=ST($.profiles.selected-1,0,Mt.maxProfiles-1)},children:(0,Q.jsx)(`i`,{className:`fas fa-caret-left`})}),(0,Q.jsx)(`div`,{className:`skin-preview inline`,id:`skin-preview-1`,onClick:()=>c(0),style:{backgroundImage:`url(${yT})`},children:(0,Q.jsx)(fC,{skin:t[0],hat:s[0]})}),(0,Q.jsx)(`div`,{className:`skin-preview inline`,id:`skin-preview-2`,onClick:()=>c(1),style:{backgroundImage:`url(${yT})`},children:(0,Q.jsx)(fC,{skin:t[1],hat:s[1]})}),(0,Q.jsx)(`div`,{className:`arrow inline`,id:`profile-next`,onClick:()=>{$.profiles.selected=ST($.profiles.selected+1,0,Mt.maxProfiles-1)},children:(0,Q.jsx)(`i`,{className:`fas fa-caret-right`})})]})}function xT(e,t){return e[0]===t[0]&&e[1]===t[1]?e:t}function ST(e,t,n){return e<t&&(e=n),e>n&&(e=t),e}var CT=!1;async function wT(e){if(!(CT||localStorage.getItem(Mt.storageKeys.region))){CT=!0;try{let t=(await(await fetch(`https://ipapi.co/json/`,{signal:AbortSignal.timeout(5e3)})).json())?.continent_code;e.region=t===`NA`||t===`SA`?`NA`:t===`AS`?`AS`:`EU`}catch{}}}var TT=e=>String(e?.mode??``).trim().toLowerCase()===`sep`,ET=[`EU`,`NA`,`AS`],DT={EU:`Europe`,NA:`North America`,AS:`Asia`};function OT(){let{region:e}=mx($),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)([]),[a,o]=(0,Z.useState)(!0),s=(0,Z.useMemo)(()=>r.filter(t=>t?.region===e&&!TT(t)),[r,e]);(0,Z.useEffect)(()=>{$.customServers=r.filter(TT)},[r]);let[c,l]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{wT($).finally(()=>l(!0))},[]);let u=(0,Z.useRef)(!1);return(0,Z.useEffect)(()=>
1264{if(!c||u.current||!s.length||t)return;u.current=!0;let e=localStorage.getItem(Mt.storageKeys.server),r=e&&s.find(t=>t.host===e)||s[0];n(r)},[c,s]),(0,Z.useEffect)(()=>q.register(A.Socket_Connected,e=>{n(t=>t&&t.host!==e?null:t)}),[]),(0,Z.useEffect)(()=>{a&&(async()=>{let e=await fetch(Mt.endPoints.serverList);if(!e.ok)throw Error(`server list HTTP ${e.status}`);let t=await e.json();Array.isArray(t)&&i(t)})().catch(e=>{console.log(e.message)}).finally(()=>o(!1))},[a]),(0,Z.useEffect)(()=>{let e=setInterval(()=>{document.hidden||o(!0)},1e4),t=()=>{document.hidden||o(!0)};return document.addEventListener(`visibilitychange`,t),()=>{clearInterval(e),document.removeEventListener(`visibilitychange`,t)}},[]),(0,Z.useEffect)(()=>{t&&(q.dispatch(A.Request_Connect,t.host),localStorage.setItem(Mt.storageKeys.server,t.host))},[t]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`panel-title`,children:`Servers`}),(0,Q.jsx)(`div`,{className:`region-select`,children:ET.map(t=>(0,Q.jsx)(`div`,{className:(0,mb.default)(`region-tab`,t===e&&`active`),onClick:()=>{$.region=t,localStorage.setItem(Mt.storageKeys.region,t)},children:DT[t]||t},t))}),(0,Q.jsxs)(`div`,{className:`server-header`,children:[(0,Q.jsx)(`div`,{children:`N
1264ame`}),(0,Q.jsx)(`div`,{children:`Players`}),(0,Q.jsx)(`div`,{children:`Game mode`})]}),(0,Q.jsxs)(`div`,{className:`server-rows`,children:[s.length===0&&(0,Q.jsx)(`div`,{className:`no-servers`,children:`No servers online`}),s.map(e=>{let{host:r,name:i,mode_name:a,num_players:o,max_players:s}=e;return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`server-row`,r===t?.host&&`active`),onClick:()=>{n(e)},children:[(0,Q.jsx)(`div`,{className:`server-name`,children:i}),(0,Q.jsxs)(`div`,{className:`server-players`,children:[o,`/`,s]}),(0,Q.jsx)(`div`,{className:`server-mode`,children:a})]},r)})]})]})}function kT({onSelect:e}){let{region:t,customServers:n,scale:r}=mx($),i=(0,Z.useMemo)(()=>n.find(e=>e?.region===t)||n[0]||null,[n,t]);return i?(0,Q.jsx)(`button`,{className:`custom-games-btn`,style:{"--ui-scale":r},onClick:()=>e(i),children:`Custom Games`}):null}var AT={bottom:`senpa-io_970x250`,middleHome:`senpa-io_300x250_2`,middleEndgame:`senpa-io_300x250_3`};function jT({location:e}){let[t,n]=(0,Z.useState)(!1),r=(0,Z.useRef)(null),i=(0,Z.useRef)(null),a=AT[e];return(0,Z.useEffect)(()=>{r.current!==null&&!t&&(n(!0),q.dispatch(A.Render_Ad,a,e))},[r,a,t]),(0,Z.useEffect)(()=>{i.current!==null&&(r.current&&r.current.innerHTML===``?i.current.style.backgroundImage=null:i.current.style.backgroundImage=`none`)},[r.current,r.current?.innerHTML]),(0,Q.jsx)(`div`,{className:`support-holder support-${e}`,ref:i,children:(0,Q.jsx)(`div`,{id:a,ref:r})})}var MT=`https://www.youtube.com/embed/TqZjkXMUlyM`,NT=null,PT=Nn.request(`/settings/endgame-video`).then(e=>{e&&!e.error&&typeof e.url==`string`&&e.url&&(NT=e.url)}).catch(()=>{});function FT({onContinue:e}){let[t,n]=(0,Z.useState)(()=>NT||MT);return(0,Z.useEffect)(()=>{let e=!1;return PT.then(()=>{!e&&NT&&n(NT)}),()=>{e=!0}},[]),(0,Q.jsx)(`div`,{id:`endGame`,children:(0,Q.jsxs)(`div`,{className:`endgame-container`,children:[(0,Q.jsx)(`div`,{className:`banner`,children:(0,Q.jsx)(`iframe`,{height:180,src:t,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,title:`end-game-video`,loading:`lazy`})}),(0,Q.jsxs)(`button`,{id:`continue-button`,onClick:e,children:[(0,Q.jsx)(`i`,{className:`fas fa-play`}),`Continue`]}),(0,Q.jsx)(`div`,{className:`support-label-endgame`,children:`Advertisement`}),(0,Q.jsx)(jT,{location:`middleEndgame`})]})})}var IT=new class{constructor(){this.baseKeys=this.getBaseKeys()}getKeyName(e){let t=e.code;if(!t)return t;switch(t=t.replace(`Key`,``),t=t.replace(`Digit`,``),t=t.replace(`Arrow`,``),t.startsWith(`Shift`)?t=`Shift`:t.startsWith(`Control`)?t=`Control`:t.startsWith(`Alt`)&&(t=`Alt`),t=t.toUpperCase(),t){case`BACKQUOTE`:t=`TILDE`;break}return this.baseKeys.has(t)?e.ctrlKey?`CTRL+${t}`:e.altKey?`ALT+${t}`:t:!1}getBaseKeys(){let e=`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),t=`0123456789`.split(``),n=`TAB SHIFT ENTER TILDE SPACE UP DOWN LEFT RIGHT ESCAPE`.split(` `);return new Set([...e,...t,...n])}},LT=[{name:`game`,text:`Game`,icon:(0,Q.jsx)(`i`,{className:`fas fa-gamepad`})},{name:`theme`,text:`Theme`,icon:(0,Q.jsx)(`i`,{className:`fas fa-palette`})},{name:`controls`,text:`Controls`,icon:(0,Q.jsx)(`i`,{className:`fas fa-keyboard`})},{name:`importexport`,text:`Import/Export`,icon:(0,Q.jsx)(`i`,{className:`far fa-file`})}];function RT(){let[e,t]=(0,Z.useState)(0);return()=>t(e=>e+1)}var zT=`game`,BT=`render`;function VT(){let e=RT(),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(zT),[s,c]=(0,Z.useState)(BT);zT=a,BT=s;let l=(0,Z.useCallback)(e=>e===s,[s]),u=(0,Z.useCallback)(e=>e===a,[a]),d=(0,Z.useMemo)(()=>r?Object.keys(r[a]):[],[r,a]),f=e=>{o(e),c(Object.keys(r[e])[0])};if(hb(A.Settings,(e,t)=>{n(e),i(t)}),(0,Z.useEffect)(()=>{q.dispatch(A.Request_Settings)},[]),!r||!t)return null;let p=r[a][s];return(0,Q.jsxs)(`div`,{className:`options`,children:[(0,Q.jsx)(HT,{isActiveColumn:u,setActiveColumn:f}),(0,Q.jsxs)(`div`,{className:`options-body`,children:[(0,Q.jsx)(UT,{isActiveTab:l,activeColumnTabs:d,setActiveTab:c}),(0,Q.jsx)(`div`,{className:`content`,children:Object.keys(p).map(n=>{let r=p[n];return(0,Q.jsx)(WT,{data:r,value:t[n],onChange:i=>{if(r.type===`hotkey`){let n=!1;
1264Object.keys(p).forEach(e=>{t[e]===i&&(t[e]=`NO KEY`,n=!0)}),n&&e()}t[n]=i}},n)})})]})]})}function HT({isActiveColumn:e,setActiveColumn:t}){return(0,Q.jsx)(`div`,{className:`category-row`,children:LT.map(({name:n,text:r,icon:i},a)=>(0,Q.jsxs)(`button`,{className:(0,mb.default)(`category`,e(n)&&`active`),onClick:()=>{t(n)},children:[i,(0,Q.jsx)(`span`,{children:r})]},a))})}function UT({isActiveTab:e,setActiveTab:t,activeColumnTabs:n}){return(0,Q.jsx)(`div`,{className:`sidebar`,children:n.map((n,r)=>(0,Q.jsx)(`button`,{className:(0,mb.default)(`section`,e(n)&&`active`),onClick:()=>{t(n)},children:String(n).replace(`_`,` `)},r))})}function WT({data:e,value:t,onChange:n}){return{toggle:(0,Q.jsx)(qT,{name:e.name,value:t,disabled:e.disabled,message:e.message,onChange:n}),range:(0,Q.jsx)(KT,{name:e.name,value:t,min:e.min,max:e.max,step:e.step,onChange:n}),colorpicker:(0,Q.jsx)(YT,{name:e.name,value:t,onChange:n}),dropdown:(0,Q.jsx)(JT,{name:e.name,value:t,list:e.list,onChange:n}),hotkey:(0,Q.jsx)(XT,{name:e.name,value:t,onChange:n}),input:(0,Q.jsx)(ZT,{name:e.name,value:t,onChange:n}),inputFile:(0,Q.jsx)(ZT,{name:e.name,value:t,onChange:n}),button:(0,Q.jsx)(GT,{list:e.list})}[e.type]}function GT({list:e}){return(0,Q.jsxs)(`div`,{className:`settings-btn`,children:[e.map((e,t)=>(0,Q.jsx)(`button`,{id:e.id,children:e.name},t)),(0,Q.jsx)(`input`,{type:`file`,id:`import-input`,accept:`.senpa-data`,style:{display:`none`}})]})}function KT({name:e,value:t,min:n,max:r,step:i,onChange:a}){let[o,s]=(0,Z.useState)(t);return(0,Q.jsxs)(`div`,{className:`setting opt-range`,children:[(0,Q.jsxs)(`div`,{className:`range-header`,children:[(0,Q.jsx)(`div`,{className:`name`,children:e}),(0,Q.jsx)(`div`,{className:`value`,children:o})]}),(0,Q.jsxs)(`div`,{className:`range-box`,children:[(0,Q.jsxs)(`div`,{className:`fake-range`,children:[(0,Q.jsx)(`div`,{className:`fill-outer`,children:(0,Q.jsx)(`div`,{className:`fill`,style:{width:`${(o-n)/(r-n)*100|0}%`}})}),(0,Q.jsx)(`div`,{className:`extra`})]}),(0,Q.jsx)(`input`,{type:`range`,className:`real-range`,min:n,max:r,step:i,value:o,onChange:({target:e})=>{let t=Number(e.value);s(t),a(t)}})]})]})}function qT({name:e,value:t,disabled:n,message:r,onChange:i}){let[a,o]=(0,Z.useState)(t);return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`setting opt-toggle`,n&&`disabled`),children:[(0,Q.jsxs)(`div`,{className:`name`,children:[e,r&&(0,Q.jsx)(`div`,{className:`message`,children:r})]}),(0,Q.jsxs)(`div`,{className:(0,mb.default)(`toggle-btn`,a&&`active`),onClick:()=>{n||(o(!a),i(!a))},role:`switch`,"aria-checked":!!a,"aria-disabled":!!n,children:[(0,Q.jsx)(`div`,{className:`slide`}),(0,Q.jsx)(`div`,{className:`ball`})]})]})}function JT({name:e,value:t,list:n,onChange:r}){let[i,a]=(0,Z.useState)(t),o=n.find(({value:e})=>e===i)?.name;return(0,Q.jsxs)(`div`,{className:`setting opt-dropdown`,children:[(0,Q.jsx)(`div`,{className:`name`,children:e}),(0,Q.jsxs)(`div`,{className:`dropdown-box`,children:[(0,Q.jsx)(`div`,{className:`selected`,children:o}),(0,Q.jsx)(`i`,{className:`fas fa-chevron-down`}),(0,Q.jsx)(`div`,{className:`dropdown-list`,children:n.map(({name:e,value:t},n)=>(0,Q.jsx)(`div`,{onClick:()=>{a(t),r(t)},className:`dropdown-item`,children:e},n))})]})]})}function YT({name:e,value:t,onChange:n}){let[r,i]=(0,Z.useState)(t);return(0,Q.jsxs)(`div`,{className:`setting opt-colorpicker`,children:[(0,Q.jsx)(`div`,{className:`name`,children:e}),(0,Q.jsx)(gw,{color:r,onChange:e=>{n(e),i(e)}})]})}function XT({name:e,value:t,onChange:n}){let[r,i]=(0,Z.useState)(t);return(0,Z.useEffect)(()=>{i(t)},[t]),(0,Q.jsxs)(`div`,{className:`setting opt-hotkey`,children:[(0,Q.jsx)(`div`,{className:`name`,children:e}),(0,Q.jsx)(`input`,{className:`text hotkey`,value:r,onChange:()=>{},onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();let t=IT.getKeyName(e);t&&(n(t),i(t))}})]})}function ZT({name:e,value:t,onChange:n}){let[r,i]=(0,Z.useState)(t);return(0,Q.jsxs)(`div`,{className:`setting opt-input`,children:[(0,Q.jsx)(`div`,{className:`name`,children:e}),(0,Q.jsx)(`input`,{className:`text`,value:r,onChange:({target:e})=>{n(e.value),i(e.value)}})]})}
1264var QT={0:{name:`Spectator`,className:`team-spectator`},1:{name:`Red`,className:`team-red`},2:{name:`Blue`,className:`team-blue`}};function $T(){let[e,t]=(0,Z.useState)([]),[n,r]=(0,Z.useState)(new Map),[i,a]=(0,Z.useState)(!1),o=(e,t)=>{n.get(e).team=t,r(new Map(n)),q.dispatch(A.ClanWars_UpdatePlayer,e,t),Ly.clanWarsInfo(0)};return hb(A.ClanWars_Update,(e,n,i)=>{r(n),t(Array.from(e.values()).filter(e=>!e.isBot)),a(i)}),(0,Z.useEffect)(()=>{q.dispatch(A.ClanWars_RequestUpdate)},[]),(0,Q.jsxs)(`div`,{className:`clan-wars-modal`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Clan Wars`}),(0,Q.jsxs)(`div`,{className:`body`,children:[(0,Q.jsxs)(`div`,{className:`players`,children:[(0,Q.jsxs)(`div`,{className:`table-heading`,children:[(0,Q.jsx)(`div`,{children:`Name`}),(0,Q.jsx)(`div`,{children:`Team`})]}),(0,Q.jsxs)(`div`,{className:`table-body`,tabIndex:`2`,id:`table-player-list`,children:[e.length===0&&(0,Q.jsx)(`div`,{className:`no-players`,children:`Waiting for players...`}),e.map((e,t)=>{let r=n.get(e.id).team||0,a=QT[r]||QT[0];return(0,Q.jsxs)(`div`,{className:`trow`,children:[(0,Q.jsx)(`div`,{className:`num`,children:t+1}),(0,Q.jsx)(`div`,{className:`player-name text-line`,children:e.nick}),i?(0,Q.jsxs)(`select`,{className:a.className,name:`Team`,value:r,onChange:({target:t})=>o(e.id,t.value),children:[(0,Q.jsx)(`option`,{id:`no-team`,name:`Spectate`,value:`0`,children:`Spectate`}),(0,Q.jsx)(`option`,{id:`red-team`,name:`Red`,value:`1`,children:`Red`}),(0,Q.jsx)(`option`,{id:`blue-team`,name:`Blue`,value:`2`,children:`Blue`})]}):(0,Q.jsx)(`div`,{className:`team-badge ${a.className}`,children:a.name})]},e.id)})]})]}),i&&(0,Q.jsxs)(`div`,{className:`side`,children:[(0,Q.jsx)(`div`,{className:`side-title`,children:`You are the host`}),(0,Q.jsx)(`p`,{children:`Assign each player to the Red or Blue team — spectators will just watch. When both teams are ready, start the game!`}),(0,Q.jsxs)(`button`,{type:`button`,className:`btn confirm`,id:`startGame`,onClick:()=>{Ly.clanWarsInfo(1)},children:[(0,Q.jsx)(`i`,{className:`fas fa-play`}),`Start Game`]})]})]})]})}var eE=12;function tE(){let[e,t]=(0,Z.useState)([]),{page:n}=mx($).replayList,r=e=>$.replayList.page=e,[i,a]=(0,Z.useState)(``);hb(A.Replays,e=>{t(e)}),(0,Z.useEffect)(()=>{Zx(`request`)},[]);let o=Math.max(1,Math.ceil(e.length/eE));(0,Z.useEffect)(()=>{e.length&&n>o&&r(o)},[o,n,e.length]);let s=e=>{let t=parseInt(e,10);if(isNaN(t))return;let n=Math.min(o,Math.max(1,t));r(n),a(String(n))};(0,Z.useEffect)(()=>{if(i===``)return;let e=setTimeout(()=>s(i),500);return()=>clearTimeout(e)},[i]);let c=e.slice((n-1)*eE,n*eE);return(0,Q.jsxs)(`div`,{className:`replays-modal`,children:[(0,Q.jsxs)(`div`,{className:`nav-bar`,children:[(0,Q.jsxs)(`div`,{className:`import-tap`,children:[(0,Q.jsx)(`input`,{type:`file`,accept:`.senpa`,onChange:({target:e})=>{let t=e.files[0];if(t){let n=new FileReader;n.onload=()=>{let r=t.name.split(`.senpa`)[0];Zx(`import`,{key:r,data:n.result}),e.value=null},n.readAsText(t)}}}),(0,Q.jsxs)(`button`,{type:`button`,className:`btn-blue`,children:[(0,Q.jsx)(`i`,{className:`fas fa-arrow-circle-up`}),`Import`]})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`btn-green`,onClick:()=>{Zx(`download`,{replays:e.map(({key:e})=>e)})},children:[(0,Q.jsx)(`i`,{className:`fas fa-arrow-circle-down`}),`Download all`]}),(0,Q.jsxs)(`button`,{type:`button`,className:`btn-red`,onClick:()=>{window.confirm(`Are you sure you want to delete all replays?`)&&Zx(`delete`,{replays:e.map(({key:e})=>e)})},children:[(0,Q.jsx)(`i`,{className:`fas fa-eraser`}),`Delete all`]}),(0,Q.jsxs)(`div`,{className:`replay-arrows`,children:[(0,Q.jsx)(`i`,{className:`fas fa-caret-left arrow ${n<=1?`disabled`:``}`,onClick:()=>r(Math.max(1,n-1))}),(0,Q.jsxs)(`span`,{className:`pages`,children:[n,` / `,o]}),(0,Q.jsx)(`i`,{className:`fas fa-caret-right arrow ${n>=o?`disabled`:``}`,onClick:()=>r(Math.min(o,n+1))}),(0,Q.jsx)(`input`,{type:`text`,inputMode:`numeric`,className:`page-jump`,placeholder:`What page?`,value:i,onChange:({target:e})=>a(e.value.replace(/\D/g,``)),onKeyDown:e=>e.key===`Enter`&&s(i)})]})]}),(0,Q.jsxs)(`div`,{className:`replays`,children:[e.length===0&&(0,Q.jsx)(`div`,{className:`no-replays`,children:`No replays yet — they are recorded automatically while you play`}),c.map(({key:e,image:t},n)=>(0,Q.jsxs)(`div`,{className:`replay`,style:{backgroundImage:`url(${t})`},onClick:()=>{Zx(`play`,{key:e})},children:[(0,Q.jsxs)(`div`,{className:`replay-title`,children:[(0,Q.jsx)(`div`,{className:`replay-name`,title:e,children:e}),(0,Q.jsxs)(`div`,{className:`replay-controls`,children:[(0,Q.jsx)(`i`,{className:`fas fa-arrow-circle-down replay-icon download`,title:`Download`,onClick:t=>{t.stopPropagation(),Zx(`download`,{replays:[e]})}}
1264),(0,Q.jsx)(`i`,{className:`fas fa-trash replay-icon delete`,title:`Delete`,onClick:t=>{t.stopPropagation(),window.confirm(`Are you sure you want to delete this replay?`)&&Zx(`delete`,{replays:[e]})}})]})]}),(0,Q.jsx)(`div`,{className:`play-overlay`,children:(0,Q.jsx)(`i`,{className:`fas fa-play`})})]},n))]})]})}function nE({data:e,connect:t,createGame:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(!1),s=()=>o(!a),c=()=>{if(!$.authToken||!$.account||typeof $.account!=`object`)return tS.default.fire({icon:`info`,title:`Info`,text:`You must be logged in to use this feature!`,heightAuto:!1});i(!r)},[l,u]=(0,Z.useState)([]);hb(A.Custom_Games_List,e=>{u(e)});let[d,f]=(0,Z.useState)(null),p=e=>{f(e),o(!0)};return(0,Q.jsxs)(`div`,{className:`private-servers-modal`,children:[(0,Q.jsx)(`div`,{className:`title`,children:`Custom Games`}),(0,Q.jsxs)(`div`,{className:`body`,children:[(0,Q.jsxs)(`div`,{className:`games`,children:[(0,Q.jsxs)(`div`,{className:`table-heading`,children:[(0,Q.jsx)(`div`,{children:`Game`}),(0,Q.jsx)(`div`,{children:`Players`}),(0,Q.jsx)(`div`,{children:`Mode`}),(0,Q.jsx)(`div`,{children:`\xA0`})]}),(0,Q.jsxs)(`div`,{className:`table-body`,id:`table-custom-game`,children:[l.length===0&&(0,Q.jsx)(`div`,{className:`no-games`,children:`No custom games yet — create the first one!`}),l.map(e=>(0,Q.jsxs)(`div`,{className:`trow`,children:[(0,Q.jsx)(`div`,{className:`text-line`,children:e.name}),(0,Q.jsxs)(`div`,{children:[e.players,`/`,e.slots]}),(0,Q.jsx)(`div`,{children:e.mode}),(0,Q.jsxs)(`div`,{className:`row-actions`,children:[e.players<e.slots&&(0,Q.jsxs)(`button`,{className:`btn join`,type:`button`,id:`joinBtn`,onClick:()=>{if(e.players>=e.slots)return alert(`This server has reached max players!`);e.needsPassword?p(e):t(e.id,``)},children:[e.needsPassword?(0,Q.jsx)(`i`,{className:`fas fa-lock`}):``,` Join`]}),e.players>=e.slots&&(0,Q.jsx)(`button`,{className:`btn full`,type:`button`,id:`fullBtn`,disabled:!0,children:`Full`}),e.owned&&(0,Q.jsx)(`button`,{className:`btn delete`,type:`button`,id:`deleteBtn`,onClick:()=>{Ly.deleteCustomGame(e.id)},children:`Delete`})]})]},e.id))]})]}),(0,Q.jsxs)(`div`,{className:`side`,children:[(0,Q.jsx)(`div`,{className:`side-title`,children:`Host your own lobby`}),(0,Q.jsx)(`p`,{children:`Create a custom game, pick the mode, map size, bots and more — then invite your friends to join. Add a password to keep the match private.`}),(0,Q.jsxs)(`button`,{type:`button`,className:`btn confirm`,id:`createGame`,disabled:!e,onClick:c,children:[(0,Q.jsx)(`i`,{className:`fas fa-plus`}),e?`Create game`:`Connecting...`]})]})]}),(0,Q.jsx)(rS,{showModal:r,toggleModal:c,children:e&&(0,Q.jsx)(aE,{data:e,hideSettings:c,createGame:n}),useScale:!1,className:`confirm-model`}),(0,Q.jsx)(rS,{showModal:a,toggleModal:s,children:(0,Q.jsx)(rE,{server:d,close:s,connect:t}),useScale:!1,className:`confirm-model`})]})}function rE({server:e,connect:t,close:n}){let[r,i]=(0,Z.useState)(``);return(0,Q.jsxs)(`div`,{className:`inner-content join-dialog`,children:[(0,Q.jsx)(`div`,{className:`dialog-title`,children:`Join private game`}),(0,Q.jsxs)(`div`,{className:`field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Please enter the password`}),(0,Q.jsx)(`input`,{type:`text`,maxLength:64,value:r,onChange:e=>i(e.target.value)})]}),(0,Q.jsxs)(`div`,{className:`btn-container`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn cancel`,onClick:n,children:`Cancel`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn confirm`,onClick:()=>{t(e.id,r)},children:`Confirm`})]})]})}var iE=2;function aE({data:e,hideSettings:t,createGame:n}){let[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(`0`),[s,c]=(0,Z.useState)(`2`),[l,u]=(0,Z.useState)(`0`),[d,f]=(0,Z.useState)(`0`),[p,m]=(0,Z.useState)(`0`),[h,g]=(0,Z.useState)(`0`),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(``),C=e.modes[a],w=e.configs.get(C),T=Array(Math.max(0,e.maxSlots-iE+1)).fill(null).map((e,t)=>t+iE);return(0,Q.jsxs)(`div`,{className:`inner-content create-dialog`,children:[(0,Q.jsx)(`div`,{className:`dialog-title`,children:`Create a new game`}),(0,Q.jsxs)(`div`,{className:`field name-field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Game name`}),(0,Q.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),type:`text`,id:`serverName`,className:`input-field`,placeholder:`Server Name`,maxLength:25}
1264)]}),(0,Q.jsxs)(`div`,{className:`options-grid`,children:[(0,Q.jsxs)(`div`,{className:`field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Virus Count`}),(0,Q.jsx)(`select`,{id:`virusCount`,name:`Virus Count`,value:h,onChange:e=>g(e.target.value),children:e.virusCount.map((e,t)=>(0,Q.jsx)(`option`,{value:t,children:t===0?w[2]:e},t))})]}),(0,Q.jsxs)(`div`,{className:`field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Bot Count`}),(0,Q.jsx)(`select`,{id:`botCount`,name:`Bot Count`,value:d,onChange:e=>f(e.target.value),children:e.botCount.map((e,t)=>(0,Q.jsx)(`option`,{value:t,children:t===0?w[3]:e},t))})]}),(0,Q.jsxs)(`div`,{className:`field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Map Size`}),(0,Q.jsx)(`select`,{id:`mapSize`,name:`Map Size`,value:l,onChange:e=>u(e.target.value),children:e.mapSizes.map((e,t)=>(0,Q.jsx)(`option`,{value:t,children:t===0?w[1]:e},t))})]}),(0,Q.jsxs)(`div`,{className:`field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Start Mass`}),(0,Q.jsx)(`select`,{id:`startMass`,name:`Start Mass`,value:p,onChange:e=>m(e.target.value),children:e.startMass.map((e,t)=>(0,Q.jsx)(`option`,{value:t,children:t===0?w[0]:e},t))})]}),(0,Q.jsxs)(`div`,{className:`field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Mode`}),(0,Q.jsx)(`select`,{id:`modes`,name:`Mode`,value:a,onChange:e=>o(e.target.value),children:e.modes.map((e,t)=>(0,Q.jsx)(`option`,{value:t,children:e},t))})]}),(0,Q.jsxs)(`div`,{className:`field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Slots`}),(0,Q.jsx)(`select`,{id:`slots`,name:`Slots`,value:s,onChange:e=>c(e.target.value),children:T.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))})]}),(0,Q.jsxs)(`div`,{className:`field toggle-field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Clan Wars`}),(0,Q.jsx)(`div`,{className:`sw-btn`,children:(0,Q.jsxs)(`label`,{children:[(0,Q.jsx)(`input`,{type:`checkbox`,value:_,onChange:e=>v(e.target.checked)}),(0,Q.jsx)(`span`,{})]})})]}),(0,Q.jsxs)(`div`,{className:`field toggle-field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Private match`}),(0,Q.jsx)(`div`,{className:`sw-btn`,children:(0,Q.jsxs)(`label`,{id:`private-match`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,onChange:e=>b(e.target.checked)}),(0,Q.jsx)(`span`,{})]})})]})]}),y&&(0,Q.jsxs)(`div`,{className:`field name-field`,children:[(0,Q.jsx)(`div`,{className:`txt`,children:`Password`}),(0,Q.jsx)(`input`,{type:`text`,maxLength:64,value:x,onChange:e=>S(e.target.value)})]}),(0,Q.jsxs)(`div`,{className:`btn-container`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`btn cancel`,onClick:t,children:`Cancel`}),(0,Q.jsx)(`button`,{type:`button`,className:`btn confirm`,onClick:()=>{let e=y?x:``;X.lastPassword=e,n(r,e,0,_,s,a,p,l,h,d)},children:`Confirm`})]})]})}var oE=`New Client (Beta)`,sE=`If you notice any bugs, let us know in <a href="https://discord.gg/senpa" target="_blank" rel="noreferrer">Discord</a>
1265in the channel <span class="channel">#senpa-new-version-bugs</span>`;function cE({config:e}){let t=e?.title||oE,n=e?.body||sE,r=Ax((0,Z.useMemo)(()=>n.split(`
1266`).map(e=>`<p>${e}</p>`).join(``),[n]));return(0,Q.jsxs)(`div`,{className:`welcome-modal`,children:[(0,Q.jsx)(`div`,{className:`title`,children:t}),(0,Q.jsx)(`div`,{className:`body`,ref:r})]})}var lE=`./img/coins.png`;function uE({gifts:e}){let t=(0,Z.useRef)(null),n=e.reduce((e,t)=>e+(t.coins||0),0);return(0,Z.useEffect)(()=>{Nn.requestJson(`/store/gifts/seen`,{}).catch(()=>{})},[]),(0,Z.useEffect)(()=>dE(t.current),[]),(0,Q.jsxs)(`div`,{className:`gift-received-modal`,children:[(0,Q.jsx)(`canvas`,{className:`confetti`,ref:t}),(0,Q.jsx)(`div`,{className:`title`,children:`You've got a gift! 🎁`}),(0,Q.jsxs)(`div`,{className:`body`,children:[(0,Q.jsxs)(`div`,{className:`coins`,children:[(0,Q.jsx)(`img`,{src:lE,draggable:`false`}),(0,Q.jsxs)(`div`,{className:`amount`,children:[`+`,bS(n),` `,(0,Q.jsx)(`i`,{className:`fas fa-coins`})]})]}),(0,Q.jsx)(`div`,{className:`from-label`,children:e.length>1?`Gifts from`:`A gift from`}),(0,Q.jsx)(`div`,{className:`givers`,children:e.map(t=>(0,Q.jsxs)(`div`,{className:`giver`,children:[(0,Q.jsx)(CS,{account:t.from}),e.length>1&&(0,Q.jsxs)(`div`,{className:`giver-coins`,children:[`+`,bS(t.coins),` `,(0,Q.jsx)(`i`,{className:`fas fa-coins`})]})]},t.id))}),(0,Q.jsx)(`div`,{className:`hint`,children:`The coins are already on your balance. Enjoy!`})]})]})}function dE(e){if(!e||window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.getContext(`2d`),n=[ib.accent||`#fe70c3`,`#e6cf00`,`#3998ff`,`#39d340`,`#ff8ed0`,`#ffffff`],r=3800;e.width=e.offsetWidth,e.height=e.offsetHeight;let i=Array.from({length:120},()=>
1266({x:Math.random()*e.width,y:-20-Math.random()*e.height*.6,w:5+Math.random()*5,h:8+Math.random()*6,vx:-.8+Math.random()*1.6,vy:1.6+Math.random()*2.4,rot:Math.random()*Math.PI,vr:-.1+Math.random()*.2,phase:Math.random()*Math.PI*2,color:n[Math.random()*n.length|0]})),a,o,s=n=>{o===void 0&&(o=n);let c=n-o;t.clearRect(0,0,e.width,e.height),t.globalAlpha=c>r-700?Math.max(0,(r-c)/700):1;for(let r of i)r.x+=r.vx+Math.sin(n/400+r.phase)*.6,r.y+=r.vy,r.rot+=r.vr,r.y>e.height+20&&(r.y=-20,r.x=Math.random()*e.width),t.save(),t.translate(r.x,r.y),t.rotate(r.rot),t.fillStyle=r.color,t.fillRect(-r.w/2,-r.h/2,r.w,r.h*(.35+Math.abs(Math.sin(n/300+r.phase))*.65)),t.restore();c<r?a=requestAnimationFrame(s):t.clearRect(0,0,e.width,e.height)};return a=requestAnimationFrame(s),()=>cancelAnimationFrame(a)}function fE(e){let t=E[`hkEmoji${e+1}`];return!t||t===`NO KEY`?``:t}var pE=(e,t)=>ZS(t,e);function mE({callModal:e}){let t=DS($,pE),{signedIn:n,owned:r,slots:i,loading:a,error:o,reload:s,selectedSlot:c,pendingEmoji:l}=t,u=()=>e((0,Q.jsx)(EC,{tab:`emojis`})),d;if(l)d=(0,Q.jsxs)(Q.Fragment,{children:[`Pick a slot for the emoji`,(0,Q.jsx)(`a`,{className:`hint-link`,onClick:t.cancelPick,children:`cancel`})]});else if(c!==null)d=(0,Q.jsxs)(Q.Fragment,{children:[`Now click an emoji to put it in slot `,(0,Q.jsx)(`b`,{children:c+1}),(0,Q.jsx)(`a`,{className:`hint-link`,onClick:t.cancelPick,children:`cancel`})]});else{let e=i.map((e,t)=>fE(t)).filter(Boolean);d=(0,Q.jsxs)(Q.Fragment,{children:[`Click a slot, then an emoji to assign it.`,e.length?` Throw in game with ${e.join(`, `)}.`:``,t.cooldownSeconds?` Cooldown ${t.cooldownSeconds}s.`:``]})}let f;return f=n?o?(0,Q.jsxs)(`div`,{className:`emojis-state error`,children:[`Could not load emojis: `,o,(0,Q.jsx)(`button`,{className:`btn-accent`,onClick:s,children:`Retry`})]}):a&&r.length===0?(0,Q.jsx)(`div`,{className:`emojis-state`,children:`Loading...`}):(0,Q.jsxs)(`div`,{className:(0,mb.default)(`emoji-grid`,a&&`loading`),children:[r.map(e=>(0,Q.jsx)(_E,{emoji:e,slotIndex:i.findIndex(t=>t?.id===e.id),assignable:c!==null,onEquip:()=>t.equip(e),onUnequip:e=>t.assign(e,null)},e.id)),(0,Q.jsx)(hE,{first:r.length===0,onClick:u})]}):(0,Q.jsx)(`div`,{className:`emojis-state`,children:`Sign in to collect and equip emojis.`}),(0,Q.jsxs)(`div`,{className:`emojis-modal`,children:[(0,Q.jsx)(xS,{}),(0,Q.jsx)(`div`,{className:`title`,children:`Emojis`}),(0,Q.jsxs)(`div`,{className:`content`,children:[n&&(0,Q.jsxs)(`div`,{className:(0,mb.default)(`slots-bar`,l&&`picking`),children:[(0,Q.jsx)(`div`,{className:`slots`,children:i.map((e,n)=>(0,Q.jsx)(gE,{index:n,slot:e,selected:c===n,onClick:()=>t.clickSlot(n),onClear:()=>t.assign(n,null)},n))}),(0,Q.jsx)(`div`,{className:`slots-hint`,children:d})]}),f]})]})}function hE({first:e,onClick:t}){return(0,Q.jsxs)(`div`,{className:`emoji-card shop-card`,role:`button`,onClick:t,children:[(0,Q.jsx)(`div`,{className:`plus`,children:(0,Q.jsx)(`i`,{className:`fas fa-plus`})}),(0,Q.jsx)(`div`,{className:`name`,children:e?`Get your first emoji`:`Get more`}),(0,Q.jsxs)(`div`,{className:`action shop`,children:[(0,Q.jsx)(`i`,{className:`fas fa-store`}),`Shop`]})]})}function gE({index:e,slot:t,selected:n,onClick:r,onClear:i}){let a=fE(e);return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`slot-tile`,n&&`selected`,!t&&`empty`),role:`button`,title:t?`Slot ${e+1}`:`Slot ${e+1} — empty`,onClick:r,children:[a&&(0,Q.jsx)(`span`,{className:`key`,children:a}),t?(0,Q.jsx)(`img`,{src:t.image_url,alt:``,draggable:`false`}):(0,Q.jsx)(`i`,{className:`fas fa-plus placeholder`}),t&&(0,Q.jsx)(`span`,{className:`clear`,title:`Empty this slot`,onClick:e=>{e.stopPropagation(),i()},children:(0,Q.jsx)(`i`,{className:`fas fa-times`})})]})}function _E({emoji:e,slotIndex:t,assignable:n,onEquip:r,onUnequip:i}){let{image_url:a,animated:o}=e,s=t!==-1,c=e=>t=>{t.stopPropagation(),e()};return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`emoji-card`,s&&`equipped`,n&&`assignable`),onClick:n?r:void 0,children:[s&&(0,Q.jsx)(`span`,{className:`slot-badge`,children:t+1}),o&&(0,Q.jsx)(`span`,{className:`gif-badge`,children:`GIF`}),(0,Q.jsx)(`img`,{src:a,alt:``,draggable:`false`,loading:`lazy`}),s?(0,Q.jsx)(`button`,{className:`action unequip`,onClick:c(()=>i(t)),children:`Unequip`}):(0,Q.jsx)(`button`,{className:`action equip`,onClick:c(r),children:`Equip`})]})}var vE=(e,t)=>ZS(t,e);function yE({callModal:e}){let{profile:t}=mx($),n=iC($,vE),{signedIn:r,owned:i,loading:a,error:o,reload:s,profileIndex:c,equipped:l,skins:u,selectedTab:d}=n,f=()=>e((0,Q.jsx)(EC,{tab:`hats`})),p=e=>l.map(t=>t?.id===e.id),m;return m=r?o?(0,Q.jsxs)(`div`,{className:`hats-state error`,children:[`Could not load hats: `,o,(0,Q.jsx)(`button`,{className:`btn-accent`,onClick:s,children:`Retry`})]}):a&&i.length===0?(0,Q.jsx)(`div`,{className:`hats-state`,children:`Loading...`}):(0,Q.jsxs)(`div`,{className:(0,mb.default)(`hat-grid`,a&&`loading`),children:[i.map(e=>(0,Q.jsx)(SE,{hat:e,skin:u[d],worn:p(e),cell:d,onEquip:()=>n.equip(e),onUnequip:()=>n.unequip(d)},e.id)),(0,Q.jsx)(bE,{first:i.length===0,onClick:f})]}):(0,Q.jsx)(`div`,{className:`hats-state`,children:`Sign in to collect and wear hats.`}),(0,Q.jsxs)(`div`,{className:`hats-modal`,children:[(0,Q.jsx)(xS,{}),(0,Q.jsx)(`div`,{className:`title`,children:`Hats`}),(0,Q.jsxs)(`div`,{className:`content`,children:[r&&(0,Q.jsxs)(`div`,{className:`cells-bar`,children:[(0,Q.jsxs)(`div`,{className:`profile-label`,children:[`Profile `,c+1,(0,Q.jsx)(`span`,{className:`nick`,children:t.nick})]}),(0,Q.jsx)(`div`,{className:`cells`,children:l.map((e,t)=>(0,Q.jsx)(xE,{index:t,skin:u[t],hat:e,selected:d===t,onClick:()=>n.setSelectedTab(t),onClear:()=>n.unequip(t)},t))}),(0,Q.jsxs)(`div`,{className:`cells-hint`,children:[`Pick a cell, then click a hat to wear it there — dressing `,(0,Q.jsxs)(`b`,{children:[`Cell `,d+1]}),` now. ✕ on a cell takes its hat off.`]})]}),m]})]})}function bE({first:e,onClick:t}){return(0,Q.jsxs)(`div`,{className:`hat-card shop-card`,role:`button`,onClick:t,children:[(0,Q.jsx)(`div`,{className:`plus`,children:(0,Q.jsx)(`i`,{className:`fas fa-plus`})}),(0,Q.jsx)(`div`,{className:`name`,children:e?`Get your first hat`:`Get more`}),(0,Q.jsxs)(`div`,{className:`action shop`,children:[(0,Q.jsx)(`i`,{className:`fas fa-store`}),`Shop`]})]})}function xE({index:e,skin:t,hat:n,selected:r,onClick:i,onClear:a}){return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`cell-tile`,r&&`selected`,!n&&`bare`),role:`button`,title:n?`Cell ${e+1}`:`Cell ${e+1} — no hat`,onClick:i,children:[(0,Q.jsxs)(`div`,{className:`frame`,children:[(0,Q.jsx)(fC,{skin:t,hat:n}),n&&(0,Q.jsx)(`span`,{className:`clear`,title:`Take the hat off`,onClick:e=>{e.stopPropagation(),a()},children:(0,Q.jsx)(`i`,{className:`fas fa-times`})})]}),(0,Q.jsxs)(`div`,{className:`label`,children:[`Cell `,e+1]})]})}function SE({hat:e,skin:t,worn:n,cell:r,onEquip:i,onUnequip:a}){let o=n[r],s=n.some(Boolean),c=o?a:i,l=e=>t=>{t.stopPropagation(),e()};return(0,Q.jsxs)(`div`,{className:(0,mb.default)(`hat-card`,s&&`equipped`),onClick:c,children:[s&&(0,Q.jsx)(`span`,{className:`cell-badges`,children:n.map((e,t)=>e&&(0,Q.jsx)(`span`,{children:t+1},t))}),(0,Q.jsx)(fC,{skin:t,hat:e}),(0,Q.jsx)(`div`,{className:`name`,title:e.name,children:e.name}),o?(0,Q.jsx)(`button`,{className:`action unequip`,onClick:l(a),children:`Unequip`}):(0,Q.jsxs)(`button`,{className:`action equip`,onClick:l(i),children:[`Equip on cell `,r+1]})]})}var CE=class{static checkEvent(e){e&&!e.isTrusted&&(window.location.href=`https://www.youtube.com/watch?v=mMAnCgjeZ4Q&t=5`)}},wE={width:970,height:250};function TE(){return Math.min(.6,(window.innerWidth-20)/wE.width,window.innerHeight*.3/wE.height)}function EE(){let[e,t]=(0,Z.useState)(TE);return(0,Z.useEffect)(()=>{let e=()=>t(TE());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function DE(){return tS.default.fire({icon:`info`,title:`Info`,text:`You must be logged in!`,heightAuto:!1})}function OE({version:e}){let t=mx($),{tag:n}=t.profiles,{nick:r}=t.profile,{areaRef:i,contentRef:a}=nS(),o=EE(),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(!0),p=!d&&!s&&!l,[m,h]=(0,Z.useState)([``,``]),[g,_]=(0,Z.useState)([0,0]),v=()=>!Xw.options.loggedUsersOnly||$.authToken,[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(null),C=()=>{y&&f(!0),b(e=>!e)},[w,T]=(0,Z.useState)(null),E=(0,Z.useRef)(!1),D=(0,Z.useRef)(null),O=(e,t)=>{if(!X.connected||!Ly.handshakeDone){D.current={gameId:e,password:t};return}X.lastPassword=t,Ly.joinCustomGame(e),f(!0),C()},k=(...e)=>{Ly.customGameInfo(...e),f(!0),C()},j=e=>{b(!0),S(e)},M=e=>{if(!v())return DE();CE.checkEvent(e),f(!1),w?j((0,Q.jsx)(nE,{data:w,connect:O,createGame:k})):q.dispatch(A.Request_Play)},N=e=>{if(!v())return DE();f(!1),j((0,Q.jsx)(nE,{data:w,connect:O,createGame:k})),!w&&(E.current=!0,q.dispatch(A.Request_Connect,e.host),yy.start(e.host))},P=e=>{if(!v())return DE();CE.checkEvent(e),q.dispatch(A.Request_Spectate),f(!1)},F=e=>{CE.checkEvent(e),c(!1),u(!1),f(!0),q.dispatch(A.Request_Continue)};(0,Z.useEffect)(()=>{q.dispatch(A.Send_Nick,r)},[r]),(0,Z.useEffect)(()=>{q.dispatch(A.Send_Tag,n)},[n]),(0,Z.useEffect)(()=>{q.dispatch(A.Assign_PlayerInfo,{nick:r,tag:n,code:``,skin1:m[0]||``,skin2:m[1]||``,hat1:g[0]||0,hat2:g[1]||0})},[r,n,m,g]),(0,Z.useEffect)(()=>{let e=[[A.Player_Died,()=>{c(!0),q.dispatch(A.Reload_Account)}],[A.Show_Menu,e=>{f(e),b(!1),u(!1)}],[A.Hide_Modals,()=>{b(!1)}],[A.Custom_Games,e=>{if(T(e),e&&D.current){let{gameId:e,password:t}=D.current;D.current=null,X.lastPassword=t,Ly.joinCustomGame(e),f(!0),b(!1);return}e&&E.current&&(E.current=!1,f(!1),j((0,Q.jsx)(nE,{data:e,connect:O,createGame:k})))}],[A.ClanWars_Toggle,()=>{u(e=>!e)}],[A.Request_Captcha,e=>{Xw.options=e,v()&&Xw.sendCaptcha(e)}],[A.Socket_Cleanup,()=>
1266{D.current=null,Xw.cancelGameChallenge(),Xw.options={}}]].map(([e,t])=>q.register(e,t)),t=!1;return(async()=>{let e=Nn.request(`/settings/welcome-modal`).catch(()=>null);try{if($.authToken||await Nn.refresh().catch(()=>null)){let e=await Nn.request(`/store/gifts/pending`);if(!t&&e&&!e.error&&e.gifts?.length){j((0,Q.jsx)(uE,{gifts:e.gifts}));return}}}catch{}let n=await e;t||!n||n.error||n.enabled===!1||j((0,Q.jsx)(cE,{config:n}))})(),()=>{t=!0,e.forEach(e=>e())}},[]),(0,Z.useEffect)(Cx);let I=d&&!s&&!l;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{id:`captcha-overlay`,style:{"--ui-scale":t.scale}}),(0,Q.jsxs)(`div`,{id:`menu`,style:{display:p&&!w?`none`:``,backgroundColor:I?`rgba(0,0,0,.75)`:``},children:[I&&(0,Q.jsx)(kT,{onSelect:N}),(0,Q.jsxs)(`div`,{className:`menu-area`,ref:i,children:[(0,Q.jsx)(rS,{showModal:s,closeButton:!1,plainBackdrop:!0,useDisplayNone:!0,toggleModal:F,children:(0,Q.jsx)(FT,{onContinue:F})}),(0,Q.jsx)(rS,{showModal:l,toggleModal:F,children:(0,Q.jsx)($T,{})}),(0,Q.jsxs)(`div`,{className:`main-menu`,ref:a,style:{display:I?``:`none`},children:[(0,Q.jsx)(jE,{}),(0,Q.jsxs)(`div`,{className:`menu-columns`,children:[(0,Q.jsxs)(`div`,{className:`menu-col left`,children:[(0,Q.jsxs)(`div`,{className:`menu-panel quick-panel`,children:[(0,Q.jsxs)(`div`,{className:`quick-buttons`,children:[(0,Q.jsxs)(`button`,{id:`replays-toggle`,className:`btn btn-yellow`,onClick:()=>j((0,Q.jsx)(tE,{})),children:[(0,Q.jsx)(`i`,{className:`fas fa-file-video`}),`Replays`]}),(0,Q.jsxs)(`button`,{id:`emojis-toggle`,className:`btn btn-blue`,onClick:()=>$.authToken&&typeof $.account==`object`&&$.account?j((0,Q.jsx)(mE,{callModal:j})):DE(),children:[(0,Q.jsx)(`i`,{className:`fas fa-grin-stars`}),`Emojis`]}),(0,Q.jsxs)(`button`,{id:`hats-toggle`,className:`btn btn-pink`,onClick:()=>$.authToken&&typeof $.account==`object`&&$.account?j((0,Q.jsx)(yE,{callModal:j})):DE(),children:[(0,Q.jsx)(`i`,{className:`fas fa-hat-cowboy`}),`Hats`]})]}),(0,Q.jsx)(bT,{callModal:j,skins:m,setSkins:h,setHats:_})]}),(0,Q.jsx)(`div`,{className:`menu-panel account-panel`,children:(0,Q.jsx)($w,{callModal:j})})]}),(0,Q.jsxs)(`div`,{className:`menu-col center`,children:[(0,Q.jsxs)(`div`,{className:`menu-panel play-panel`,children:[(0,Q.jsx)(kE,{tag:n,nick:r}),(0,Q.jsx)(AE,{doPlay:M,doSpectate:P}),(0,Q.jsxs)(`button`,{id:`settings-btn`,className:`btn btn-red`,onClick:()=>j((0,Q.jsx)(VT,{})),children:[(0,Q.jsx)(`i`,{className:`fas fa-cog`}),`Settings`]}),(0,Q.jsxs)(`div`,{className:`info-footer`,children:[(0,Q.jsxs)(`span`,{children:[`v`,e]}),(0,Q.jsx)(`a`,{href:`terms.txt`,target:`_blank`,children:`Terms of Service`}),(0,Q.jsx)(`a`,{href:`privacy.txt`,target:`_blank`,children:`Privacy Policy`})]})]}),(0,Q.jsxs)(`div`,{className:`menu-panel support-panel`,children:[(0,Q.jsx)(`div`,{className:`support-label`,children:`Advertisement`}),(0,Q.jsx)(`div`,{className:`support-block`,children:(0,Q.jsx)(jT,{location:`middleHome`})})]})]}),(0,Q.jsxs)(`div`,{className:`menu-col right`,children:[(0,Q.jsx)(`div`,{className:`menu-panel server-panel`,children:(0,Q.jsx)(OT,{})}),(0,Q.jsx)(ME,{})]})]})]}),(0,Q.jsx)(rS,{showModal:y,toggleModal:C,children:x})]}),(0,Q.jsx)(`div`,{style:{transform:`scale(${o})`,height:`${Math.round(wE.height*o)}px`,display:p?`none`:``},id:`bottomBar`,children:(0,Q.jsx)(jT,{location:`bottom`})})]}),(0,Q.jsx)(`div`,{id:`gameadsbanner-container`,style:p?{display:`none`}:{}})]})}function kE({tag:e,nick:t}){return(0,Q.jsxs)(`div`,{id:`primary-inputs`,children:[(0,Q.jsx)(`input`,{type:`text`,className:`input-field`,id:`tag`,placeholder:`Tag`,maxLength:5,value:e,onChange:({target:e})=>$.profiles.tag=e.value}),(0,Q.jsx)(`input`,{type:`text`,className:`input-field`,id:`name`,placeholder:`Nickname`,value:t,onChange:({target:e})=>$.profile.nick=e.value})]})}function AE({doPlay:e,doSpectate:t}){return(0,Q.jsxs)(`div`,{className:`action-row`,children:[(0,Q.jsxs)(`button`,{id:`play`,className:`btn btn-blue`,onClick:e,children:[(0,Q.jsx)(`i`,{className:`fas fa-play`}),`Play`]}),(0,Q.jsxs)(`button`,{id:`spectate`,className:`btn btn-yellow`,onClick:t,children:[(0,Q.jsx)(`i`,{className:`fas fa-eye`}),`Spectate`]})]})}function jE(){return(0,Q.jsx)(`div`,{className:`logo`,children:(0,Q.jsx)(`img`,{src:cb(`./img/logo-med.png`),className:`logo`,alt:ab,draggable:`false`})})}function ME(){return(0,Q.jsxs)(`div`,{className:`menu-panel social-panel`,children:[(0,Q.jsx)(`a`,{className:`btn btn-discord`,href:`https://discord.gg/senpa`,target:`_blank`,title:`Discord`,children:(0,Q.jsx)(`svg`,{width:`30`,height:`30`,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.1.1 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.1 16.1 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.
126602.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02M8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12m6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12`})})}),(0,Q.jsx)(`a`,{className:`btn btn-fb`,href:`https://www.facebook.com/SenpaIO/`,target:`_blank`,title:`Facebook`,children:(0,Q.jsx)(`svg`,{width:`30`,height:`30`,viewBox:`0 0 1024 1024`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32m-92.4 233.5h-63.9c-50.1 0-59.8 23.8-59.8 58.8v77.1h119.6l-15.6 120.7h-104V912H539.2V602.2H434.9V481.4h104.3v-89c0-103.3 63.1-159.6 155.3-159.6c44.2 0 82.1 3.3 93.2 4.8v107.9z`})})}),(0,Q.jsx)(`a`,{className:`btn btn-x`,href:`https://twitter.com/playsenpaio`,target:`_blank`,title:`X`,children:(0,Q.jsx)(`svg`,{width:`30`,height:`30`,viewBox:`0 0 300 300`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66`})})}),(0,Q.jsx)(`a`,{className:`btn btn-youtube`,href:`https://www.youtube.com/@PlaySenpaIO`,target:`_blank`,title:`YouTube`,children:(0,Q.jsx)(`svg`,{width:`30`,height:`30`,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`m10 15l5.19-3L10 9zm11.56-7.83c.13.47.22 1.1.28 1.9c.07.8.1 1.49.1 2.09L22 12c0 2.19-.16 3.8-.44 4.83c-.25.9-.83 1.48-1.73 1.73c-.47.13-1.33.22-2.65.28c-1.3.07-2.49.1-3.59.1L12 19c-4.19 0-6.8-.16-7.83-.44c-.9-.25-1.48-.83-1.73-1.73c-.13-.47-.22-1.1-.28-1.9c-.07-.8-.1-1.49-.1-2.09L2 12c0-2.19.16-3.8.44-4.83c.25-.9.83-1.48 1.73-1.73c.47-.13 1.33-.22 2.65-.28c1.3-.07 2.49-.1 3.59-.1L12 5c4.19 0 6.8.16 7.83.44c.9.25 1.48.83 1.73 1.73`})})}),(0,Q.jsx)(`a`,{className:`btn btn-forum`,href:`https://forum.senpa.io/`,target:`_blank`,title:`Forum`,children:(0,Q.jsx)(`svg`,{width:`30`,height:`30`,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`M7 18q-.425 0-.712-.288T6 17v-2h13V6h2q.425 0 .713.288T22 7v15l-4-4zm-5-1V3q0-.425.288-.712T3 2h13q.425 0 .713.288T17 3v9q0 .425-.288.713T16 13H6z`})})})]})}var NE=`4.0.0`;function PE(){return(0,Q.jsx)(pb,{children:(0,Q.jsxs)(`div`,{className:`App`,children:[(0,Q.jsx)(eS,{}),(0,Q.jsx)(OE,{version:NE})]})})}for(let e of[`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js`]){let t=document.createElement(`script`);t.src=e,document.body.append(t)}db(),(0,tb.createRoot)(document.getElementById(`ui-root`)).render((0,Q.jsx)(PE,{}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.