tiny-essentials 1.15.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v1/TinyAfterScrollWatcher.js +196 -0
- package/dist/v1/TinyAfterScrollWatcher.min.js +1 -0
- package/dist/v1/TinyBasicsEs.js +5058 -745
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDragger.js +4874 -546
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.js +5299 -750
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyHtml.js +4815 -0
- package/dist/v1/TinyHtml.min.js +1 -0
- package/dist/v1/TinyUploadClicker.js +5093 -298
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/basics/html.cjs +5 -187
- package/dist/v1/basics/html.d.mts +2 -53
- package/dist/v1/basics/html.mjs +5 -161
- package/dist/v1/basics/html_deprecated.cjs +124 -0
- package/dist/v1/basics/html_deprecated.d.mts +40 -0
- package/dist/v1/basics/html_deprecated.mjs +97 -0
- package/dist/v1/basics/index.cjs +8 -7
- package/dist/v1/basics/index.d.mts +7 -7
- package/dist/v1/basics/index.mjs +2 -1
- package/dist/v1/build/TinyAfterScrollWatcher.cjs +7 -0
- package/dist/v1/build/TinyAfterScrollWatcher.d.mts +3 -0
- package/dist/v1/build/TinyAfterScrollWatcher.mjs +2 -0
- package/dist/v1/build/TinyHtml.cjs +7 -0
- package/dist/v1/build/TinyHtml.d.mts +3 -0
- package/dist/v1/build/TinyHtml.mjs +2 -0
- package/dist/v1/index.cjs +12 -7
- package/dist/v1/index.d.mts +10 -8
- package/dist/v1/index.mjs +5 -2
- package/dist/v1/libs/TinyAfterScrollWatcher.cjs +157 -0
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +86 -0
- package/dist/v1/libs/TinyAfterScrollWatcher.mjs +138 -0
- package/dist/v1/libs/TinyDragger.cjs +91 -16
- package/dist/v1/libs/TinyDragger.d.mts +78 -2
- package/dist/v1/libs/TinyDragger.mjs +93 -17
- package/dist/v1/libs/TinyHtml.cjs +4347 -0
- package/dist/v1/libs/TinyHtml.d.mts +2301 -0
- package/dist/v1/libs/TinyHtml.mjs +3926 -0
- package/dist/v1/libs/TinyUploadClicker.cjs +1 -0
- package/docs/v1/README.md +11 -10
- package/docs/v1/basics/html.md +0 -130
- package/docs/v1/basics/html_deprecated.md +127 -0
- package/docs/v1/libs/TinyAfterScrollWatcher.md +181 -0
- package/docs/v1/libs/TinyDragger.md +45 -15
- package/docs/v1/libs/TinyHtml.md +1658 -0
- package/package.json +4 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see TinyEssentials.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={133:()=>{},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,g=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=g,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=g,s/=256,u-=8);e[r+d-g]|=128*p}},287:(e,t,r)=>{"use strict";var n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|p(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var i=function(e){if(l.isBuffer(e)){var t=0|g(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||_(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),a(e<0?0:0|g(e))}function f(e){for(var t=e.length<0?0:0|g(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function g(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),_(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var h=!0,f=0;f<l;f++)if(u(e,o+f)!==u(t,f)){h=!1;break}if(h)return o}return-1}function w(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(_(a))return s;e[r+s]=a}return s}function E(e,t,r,n){return $(H(t,e.length-r),e,r,n)}function T(e,t,r,n){return $(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return $(j(t),e,r,n)}function D(e,t,r,n){return $(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function L(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=M)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=M));return r}(n)}l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(U(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),U(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(U(o,Uint8Array))i+o.length>n.length?l.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?L(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(U(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function S(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=J[e[o]];return i}function B(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,n,o){return t=+t,r>>>=0,o||I(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,o){return t=+t,r>>>=0,o||I(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(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]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=l.isBuffer(e)?e:l.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var F=/[^+/0-9A-Za-z-_]/g;function H(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function j(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function _(e){return e!=e}var J=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},370:()=>{},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),c=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(l(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],u=!1,c=-1;function h(){u&&a&&(u=!1,a.length?l=a.concat(l):c=-1,l.length&&f())}function f(){if(!u){var e=s(h);u=!0;for(var t=l.length;t;){for(a=l,l=[];++c<t;)a&&a[c].run();c=-1,t=l.length}a=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new d(e,t)),1!==l.length||u||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},975:(e,t,r)=>{"use strict";var n=r(606);function i(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function o(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var s={resolve:function(){for(var e,t="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=n.cwd()),a=e),i(a),0!==a.length&&(t=a+"/"+t,r=47===a.charCodeAt(0))}return t=o(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(i(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=o(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return i(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var r=arguments[t];i(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(i(e),i(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var n=e.length,o=n-r,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var l=t.length-a,u=o<l?o:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===t.charCodeAt(a+h))return t.slice(a+h+1);if(0===h)return t.slice(a+h)}else o>u&&(47===e.charCodeAt(r+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(r+h);if(f!==t.charCodeAt(a+h))break;47===f&&(c=h)}var d="";for(h=r+c+1;h<=n;++h)h!==n&&47!==e.charCodeAt(h)||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(a+c):(a+=c,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(i(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!o){n=s;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');i(e);var r,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){n=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(u===t.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=l))}return n===o?o=l:-1===o&&(o=e.length),e.slice(n,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){n=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(n,o)},extname:function(e){i(e);for(var t=-1,r=0,n=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===n&&(o=!1,n=a+1),46===l?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){r=a+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){i(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,n=e.charCodeAt(0),o=47===n;o?(t.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=r;--c)if(47!==(n=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===n?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(t.base=t.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(t.name=e.slice(1,s),t.base=e.slice(1,l)):(t.name=e.slice(a,s),t.base=e.slice(a,l)),t.ext=e.slice(s,l)),a>0?t.dir=e.slice(0,a-1):o&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";async function e(e,t,r){const n=[];e.replace(t,((e,...t)=>(n.push(r(e,...t)),e)));const i=await Promise.all(n);return e.replace(t,(()=>i.shift()))}r.r(n),r.d(n,{ColorSafeStringify:()=>j,TinyDomReadyManager:()=>tt,TinyDragDropDetector:()=>Te,TinyDragger:()=>et,TinyLevelUp:()=>t,TinyNotifications:()=>rt,TinyNotifyCenter:()=>J,TinyPromiseQueue:()=>$,TinyRateLimiter:()=>U,TinyToastNotify:()=>q,addAiMarkerShortcut:()=>P,areElsCollBottom:()=>z,areElsCollLeft:()=>Y,areElsCollPerfBottom:()=>X,areElsCollPerfLeft:()=>Q,areElsCollPerfRight:()=>K,areElsCollPerfTop:()=>W,areElsCollRight:()=>V,areElsCollTop:()=>G,areElsColliding:()=>Z,areElsPerfColliding:()=>ee,areHtmlElsColliding:()=>ue,arraySortPositions:()=>i,asyncReplace:()=>e,backupFile:()=>je,checkObj:()=>v,clearDirectory:()=>Ae,clearDirectoryAsync:()=>Ve,cloneObjTypeOrder:()=>p,countObj:()=>b,dirExists:()=>Se,dirSize:()=>He,dirSizeAsync:()=>Ze,documentIsFullScreen:()=>E,ensureCopyFile:()=>Ne,ensureDirectory:()=>Me,exitFullScreen:()=>x,extendObjType:()=>d,fetchJson:()=>ge,fileExists:()=>ke,fileSize:()=>Fe,fileSizeAsync:()=>Ke,formatBytes:()=>N,formatCustomTimer:()=>a,formatDayTimer:()=>u,formatTimer:()=>l,genFibonacciSeq:()=>O,getAge:()=>B,getElsCollDetails:()=>le,getElsCollDirDepth:()=>ae,getElsCollOverlap:()=>ne,getElsCollOverlapPos:()=>ie,getElsColliding:()=>te,getElsPerfColliding:()=>re,getElsRelativeCenterOffset:()=>se,getHtmlElBorders:()=>me,getHtmlElBordersWidth:()=>pe,getHtmlElMargin:()=>ye,getHtmlElPadding:()=>ve,getLatestBackupPath:()=>$e,getRectCenter:()=>oe,getSimplePerc:()=>S,getTimeDuration:()=>s,installWindowHiddenScript:()=>be,isDirEmpty:()=>Be,isDirEmptyAsync:()=>We,isFullScreenMode:()=>C,isInViewport:()=>we,isJsonObject:()=>w,isScreenFilled:()=>T,isScrolledIntoView:()=>Ee,listDirs:()=>Pe,listDirsAsync:()=>Qe,listFiles:()=>Re,listFilesAsync:()=>Xe,objType:()=>y,offFullScreenChange:()=>A,onFullScreenChange:()=>M,readBase64Blob:()=>he,readFileBlob:()=>ce,readJsonBlob:()=>fe,readJsonFile:()=>xe,renameFileAddPrefixSuffix:()=>qe,renameFileBatch:()=>_e,renameFileNormalizeCase:()=>Ge,renameFilePadNumbers:()=>ze,renameFileRegex:()=>Je,reorderObjTypeOrder:()=>g,requestFullScreen:()=>D,restoreLatestBackup:()=>Ue,ruleOfThree:()=>k,safeTextTrim:()=>F,saveJsonFile:()=>de,shuffleArray:()=>o,toTitleCase:()=>I,toTitleCaseLowerFirst:()=>R,tryDeleteFile:()=>Oe,writeJsonFile:()=>Le,writeTextFile:()=>Ie});const t=class{constructor(e,t){if("number"!=typeof e||Number.isNaN(e))throw new Error("giveExp must be a valid number");if("number"!=typeof t||Number.isNaN(t))throw new Error("expLevel must be a valid number");this.giveExp=e,this.expLevel=t}createUser(){return{exp:0,level:1,totalExp:0}}validateUser(e){if("number"!=typeof e.exp||Number.isNaN(e.exp))throw new Error("exp must be a valid number");if("number"!=typeof e.level||Number.isNaN(e.level))throw new Error("level must be a valid number");if(e.level<1)throw new Error("level must be at least 1");if("number"!=typeof e.totalExp||Number.isNaN(e.totalExp))throw new Error("totalExp must be a valid number")}isValidUser(e){return!("number"!=typeof e.exp||Number.isNaN(e.exp)||"number"!=typeof e.level||Number.isNaN(e.level)||e.level<1||"number"!=typeof e.totalExp||Number.isNaN(e.totalExp))}getGiveExpBase(){if("number"!=typeof this.giveExp||Number.isNaN(this.giveExp))throw new Error("giveExp must be a valid number");return this.giveExp}getExpLevelBase(){if("number"!=typeof this.expLevel||Number.isNaN(this.expLevel))throw new Error("expLevel must be a valid number");return this.expLevel}expValidator(e){const t=this.getExpLevelBase();this.validateUser(e);let r=0;const n=t*e.level;return e.exp>=n&&(e.level++,r=e.exp-n,e.exp=0,r>0)?this.give(e,r,"extra"):e.exp<1&&e.level>1&&(e.level--,r=Math.abs(e.exp),e.exp=t*e.level,r>0)?this.remove(e,r,"extra"):e}getTotalExp(e){this.validateUser(e);let t=0;for(let r=1;r<=e.level;r++)t+=this.getExpLevelBase()*r;return t+=e.exp,t}expGenerator(e=1){if("number"!=typeof e||Number.isNaN(e))throw new Error("multi must be a valid number");return Math.floor(Math.random()*this.getGiveExpBase())*e}getMissingExp(e){return this.getProgress(e)-e.exp}progress(e){return this.getProgress(e)}getProgress(e){return this.validateUser(e),this.getExpLevelBase()*e.level}set(e,t){if("number"!=typeof t||Number.isNaN(t))throw new Error("value must be a valid number");return e.exp=t,this.expValidator(e),e.totalExp=this.getTotalExp(e),e}give(e,t=0,r="add",n=1){if("number"!=typeof n||Number.isNaN(n))throw new Error("multi must be a valid number");if("number"!=typeof t||Number.isNaN(t))throw new Error("extraExp must be a valid number");if("string"!=typeof r)throw new Error("type must be a valid string");return"add"===r?e.exp+=this.expGenerator(n)+t:"extra"===r&&(e.exp+=t),this.expValidator(e),e.totalExp=this.getTotalExp(e),e}remove(e,t=0,r="add",n=1){if("number"!=typeof n||Number.isNaN(n))throw new Error("multi must be a valid number");if("number"!=typeof t||Number.isNaN(t))throw new Error("extraExp must be a valid number");if("string"!=typeof r)throw new Error("type must be a valid string");return"add"===r?e.exp-=this.expGenerator(n)+t:"extra"===r&&(e.exp-=t),this.expValidator(e),e.totalExp=this.getTotalExp(e),e}};function i(e,t=!1){return t?function(t,r){return t[e]>r[e]?-1:t[e]<r[e]?1:0}:function(t,r){return t[e]<r[e]?-1:t[e]>r[e]?1:0}}function o(e){let t,r=e.length;for(;0!==r;)t=Math.floor(Math.random()*r),r--,[e[r],e[t]]=[e[t],e[r]];return e}function s(e=new Date,t="asSeconds",r=null){if(e instanceof Date){const n=r instanceof Date?r:new Date,i=e.getTime()-n.getTime();switch(t){case"asMilliseconds":return i;case"asSeconds":default:return i/1e3;case"asMinutes":return i/6e4;case"asHours":return i/36e5;case"asDays":return i/864e5}}return null}function a(e,t="seconds",r="{time}"){e=Math.max(0,Math.floor(e));const n=["seconds","minutes","hours","days","months","years"].indexOf(t),i=n>=5,o=n>=4,s=n>=3,a=n>=2,l=n>=1,u=n>=0,c={years:i?0:NaN,months:o?0:NaN,days:s?0:NaN,hours:a?0:NaN,minutes:l?0:NaN,seconds:u?0:NaN,total:NaN};let h=e;if(i||o||s){const e=new Date(1980,0,1),t=new Date(e.getTime()+1e3*h),r=new Date(e);if(i)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=t.getTime();)r.setFullYear(r.getFullYear()+1),c.years++;if(o)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=t.getTime();)r.setMonth(r.getMonth()+1),c.months++;if(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=t.getTime();)r.setDate(r.getDate()+1),c.days++;h=Math.floor((t.getTime()-r.getTime())/1e3)}a&&(c.hours=Math.floor(h/3600),h%=3600),l&&(c.minutes=Math.floor(h/60),h%=60),u&&(c.seconds=h);const f={seconds:u?e:NaN,minutes:l?e/60:NaN,hours:a?e/3600:NaN,days:s?e/86400:NaN,months:o?12*c.years+c.months+(c.days||0)/30:NaN,years:i?c.years+(c.months||0)/12+(c.days||0)/365:NaN};c.total=+(f[t]||0).toFixed(2).replace(/\.00$/,"");const d=e=>{const t="string"==typeof e?parseInt(e):e;return Number.isNaN(t)?"NaN":String(t).padStart(2,"0")},g=[a?d(c.hours):null,l?d(c.minutes):null,u?d(c.seconds):null].filter((e=>null!==e)).join(":");return r.replace(/\{years\}/g,String(c.years)).replace(/\{months\}/g,String(c.months)).replace(/\{days\}/g,String(c.days)).replace(/\{hours\}/g,d(c.hours)).replace(/\{minutes\}/g,d(c.minutes)).replace(/\{seconds\}/g,d(c.seconds)).replace(/\{time\}/g,g).replace(/\{total\}/g,String(c.total)).trim()}function l(e){return a(e,"hours","{hours}:{minutes}:{seconds}")}function u(e){return a(e,"days","{days}d {hours}:{minutes}:{seconds}")}var c=r(287);const h="undefined"!=typeof window&&void 0!==window.document,f={items:{},order:[]};function d(e,t){const r=[],n=Array.isArray(e)?e:Object.entries(e);for(const[e,i]of n)if(!f.items.hasOwnProperty(e)){f.items[e]=i;let n="number"==typeof t?t:-1;if(-1===n){const e=f.order.indexOf("object");n=e>-1?e:f.order.length}n=Math.min(Math.max(0,n),f.order.length),f.order.splice(n,0,e),r.push(e)}return r}function g(e){const t=[...f.order];return!!e.every((e=>t.includes(e)))&&(f.order=e.slice(),!0)}function p(){return[...f.order]}const m=e=>{if(null===e)return"null";for(const t of f.order)if("function"!=typeof f.items[t]||f.items[t](e))return t;return"unknown"};function y(e,t){if(void 0===e)return null;const r=m(e);return"string"==typeof t?r===t.toLowerCase():r}function v(e){const t={valid:null,type:null};for(const r of f.order)if("function"==typeof f.items[r]){const n=f.items[r](e);if(n){t.valid=n,t.type=r;break}}return t}function b(e){return Array.isArray(e)?e.length:y(e,"object")?Object.keys(e).length:0}function w(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}d([["undefined",e=>void 0===e],["null",e=>null===e],["boolean",e=>"boolean"==typeof e],["number",e=>"number"==typeof e&&!Number.isNaN(e)],["bigint",e=>"bigint"==typeof e],["string",e=>"string"==typeof e],["symbol",e=>"symbol"==typeof e],["function",e=>"function"==typeof e],["array",e=>Array.isArray(e)]]),h||d([["buffer",e=>void 0!==c.hp&&c.hp.isBuffer(e)]]),h&&d([["file",e=>"undefined"!=typeof File&&e instanceof File]]),d([["date",e=>e instanceof Date],["regexp",e=>e instanceof RegExp],["map",e=>e instanceof Map],["set",e=>e instanceof Set],["weakmap",e=>e instanceof WeakMap],["weakset",e=>e instanceof WeakSet],["promise",e=>e instanceof Promise]]),h&&d([["htmlelement",e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement]]),d([["object",e=>w(e)]]);const E=()=>!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen),T=()=>window.innerHeight===screen.height&&window.innerWidth===screen.width,C=()=>E()||T(),D=e=>new Promise((async(t,r)=>{const n=document.documentElement;try{n.requestFullscreen?await n.requestFullscreen(e):n.mozRequestFullScreen?n.mozRequestFullScreen(e):n.webkitRequestFullScreen?n.webkitRequestFullScreen(e):n.msRequestFullscreen&&n.msRequestFullscreen(e),t()}catch(e){r(e)}})),x=()=>new Promise(((e,t)=>{if(document.exitFullscreen)document.exitFullscreen().then(e).catch(t);else try{if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{if(!document.msExitFullscreen)throw new Error("Fullscreen API is not supported");document.msExitFullscreen()}e()}catch(e){t(e)}})),L=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],M=(e,t)=>{L.forEach((r=>{document.addEventListener(r,e,t)}))},A=(e,t)=>{L.forEach((r=>{document.removeEventListener(r,e,t)}))};function k(e,t,r,n=!1){return n?Number(e*t)/r:Number(r*t)/e}function S(e,t){return e*(t/100)}function B(e=0,t=null){if(null!=e&&0!==e){const r=new Date(e);if(Number.isNaN(r.getTime()))return null;const n=t instanceof Date?t:new Date;let i=n.getFullYear()-r.getFullYear();const o=n.getMonth(),s=r.getMonth(),a=n.getDate(),l=r.getDate();return(o<s||o===s&&a<l)&&i--,Math.abs(i)}return null}function N(e,t=null,r=null){if("number"!=typeof e||e<0)return{unit:null,value:null};if(0===e)return{unit:"Bytes",value:0};const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=r&&n.includes(r)?n.indexOf(r):n.length-1,o=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i);let s=e/Math.pow(1024,o);if(null!==t){const e=t<0?0:t;s=parseFloat(s.toFixed(e))}return{unit:n[o],value:s}}function O({baseValues:e=[0,1],length:t=10,combiner:r=(e,t)=>e+t}={}){if(!Array.isArray(e)||2!==e.length)throw new Error("baseValues must be an array of exactly two numbers");const n=[...e.slice(0,2)];for(let e=2;e<t;e++){const t=r(n[e-2],n[e-1],e);n.push(t)}return n}function I(e){return e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()))}function R(e){const t=e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));return t.charAt(0).toLowerCase()+t.slice(1)}function P(e="a"){"undefined"!=typeof HTMLElement?document.addEventListener("keydown",(function(t){if(t.ctrlKey&&t.altKey&&t.key.toLowerCase()===e){if(t.preventDefault(),!document.body)return void console.warn("[AiMarkerShortcut] <body> element not found. Cannot toggle class. Ensure the DOM is fully loaded when using the shortcut.");document.body.classList.toggle("detect-made-by-ai")}})):console.error("[AiMarkerShortcut] Environment does not support the DOM. This function must be run in a browser.")}function F(e,t,r=.6){if("string"!=typeof e)throw new TypeError("Expected a string for 'text', but received "+typeof e);if(!Number.isInteger(t)||t<=0)throw new TypeError(`Expected 'limit' to be a positive integer, but received ${t}`);if("number"!=typeof r||r<0||r>1)throw new TypeError(`Expected 'safeCutZone' to be a number between 0 and 1, but received ${r}`);let n=e.trim();if(n.length>t){const e=n.lastIndexOf(" ",t);return e>0&&e>=t*r?`${n.substring(0,e).trim()}...`:`${n.substring(0,t).trim()}...`}return n}class H{#e;static#t={default:{reset:"[0m",key:"[36m",string:"[32m",string_url:"[34m",string_bool:"[35m",string_number:"[33m",number:"[33m",boolean:"[35m",null:"[1;30m",special:"[31m",func:"[90m"},solarized:{reset:"[0m",key:"[38;5;37m",string:"[38;5;136m",string_url:"[38;5;33m",string_bool:"[38;5;166m",string_number:"[38;5;136m",number:"[38;5;136m",boolean:"[38;5;166m",null:"[38;5;241m",special:"[38;5;160m",func:"[38;5;244m"},monokai:{reset:"[0m",key:"[38;5;81m",string:"[38;5;114m",string_url:"[38;5;75m",string_bool:"[38;5;204m",string_number:"[38;5;221m",number:"[38;5;221m",boolean:"[38;5;204m",null:"[38;5;241m",special:"[38;5;160m",func:"[38;5;102m"}};constructor(e={}){this.#e={...H.#t.default,...e}}#r(e,t){const r=[];e=(e=(e=e.replace(/(?<!")\b(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b(?!")/g,`${t.number}$1${t.reset}`)).replace(/"([^"]+)":/g,((e,t)=>{const n=`___KEY${r.length}___`;return r.push({marker:n,key:t}),`${n}:`}))).replace(/"(?:\\.|[^"\\])*?"/g,(e=>{const r=e.slice(1,-1);return/^(https?|ftp):\/\/[^\s]+$/i.test(r)?`${t.string_url}${e}${t.reset}`:/^(true|false|null)$/.test(r)?`${t.string_bool}${e}${t.reset}`:/^-?\d+(\.\d+)?([eE][+-]?\d+)?$/.test(r)?`${t.string_number}${e}${t.reset}`:`${t.string}${e}${t.reset}`}));for(const{marker:n,key:i}of r){const r=new RegExp(n,"g");e=e.replace(r,`${t.key}"${i}"${t.reset}`)}return(e=(e=(e=(e=e.replace(/(?<!")\b(true|false)\b(?!")/g,`${t.boolean}$1${t.reset}`)).replace(/(?<!")\bnull\b(?!")/g,`${t.null}null${t.reset}`)).replace(/\[Circular\]/g,`${t.special}[Circular]${t.reset}`)).replace(/\[undefined\]/g,`${t.special}[undefined]${t.reset}`)).replace(/"function.*?[^\\]"/gs,`${t.func}$&${t.reset}`)}colorize(e,t={}){const r={...this.#e,...t};return this.#r(e,r)}getColors(){return{...this.#e}}updateColors(e){Object.assign(this.#e,e)}resetColors(){this.#e={...H.#t.default}}loadColorPreset(e){const t=H.#t[e];if(!t)throw new Error(`Preset "${e}" not found.`);this.#e={...t}}saveColorPreset(e,t){H.#t[e]={...t}}getAvailablePresets(){return Object.keys(H.#t)}}const j=H,$=class{#n=[];#i=!1;#o={};#s=new Set;isRunning(){return this.#i}async#a(e){if(e&&"function"==typeof e.task&&"function"==typeof e.resolve&&"function"==typeof e.reject){const{task:t,resolve:r,reject:n,delay:i,id:o}=e;try{if(o&&this.#s.has(o))return n(new Error("The function was canceled on TinyPromiseQueue.")),this.#s.delete(o),this.#i=!1,void this.#l();i&&o&&await new Promise((e=>{const t=setTimeout((()=>{delete this.#o[o],e(null)}),i);this.#o[o]=t})),r(await t())}catch(e){n(e)}finally{this.#i=!1,this.#l()}}}async#u(){const e=[];for(;this.#n.length&&"POINT_MARKER"===this.#n[0]?.marker;)e.push(this.#n.shift());if(0===e.length)return this.#i=!1,void this.#l();await Promise.all(e.map((({task:e,resolve:t,reject:r,id:n})=>new Promise((async i=>{if(n&&this.#s.has(n))return this.#s.delete(n),r(new Error("The function was canceled on TinyPromiseQueue.")),void i(!0);await e().then(t).catch(r),i(!0)}))))),this.#i=!1,this.#l()}async#l(){if(!this.#i&&0!==this.#n.length)if(this.#i=!0,"string"!=typeof this.#n[0]?.marker||"POINT_MARKER"!==this.#n[0]?.marker){const e=this.#n.shift();this.#a(e)}else this.#u()}getIndexById(e){return this.#n.findIndex((t=>t.id===e))}getQueuedIds(){return this.#n.map(((e,t)=>({index:t,id:e.id}))).filter((e=>"string"==typeof e.id))}reorderQueue(e,t){if("number"!=typeof e||"number"!=typeof t||e<0||t<0||e>=this.#n.length||t>=this.#n.length)return;const[r]=this.#n.splice(e,1);this.#n.splice(t,0,r)}async enqueuePoint(e,t){if("function"!=typeof e)return Promise.reject(new Error("Task must be a function returning a Promise."));if(void 0!==t&&"string"!=typeof t)throw new Error('The "id" parameter must be a string.');return this.#i?new Promise(((r,n)=>{this.#n.push({marker:"POINT_MARKER",task:e,resolve:r,reject:n,id:t}),this.#l()})):e()}enqueue(e,t,r){if("function"!=typeof e)return Promise.reject(new Error("Task must be a function returning a Promise."));if(void 0!==t&&("number"!=typeof t||t<0))return Promise.reject(new Error("Delay must be a positive number or undefined."));if(void 0!==r&&"string"!=typeof r)throw new Error('The "id" parameter must be a string.');return new Promise(((n,i)=>{this.#n.push({task:e,resolve:n,reject:i,id:r,delay:t}),this.#l()}))}cancelTask(e){if("string"!=typeof e)throw new Error('The "id" parameter must be a string.');let t=!1;e in this.#o&&(clearTimeout(this.#o[e]),delete this.#o[e],t=!0);const r=this.getIndexById(e);if(-1!==r){const[e]=this.#n.splice(r,1);e?.reject?.(new Error("The function was canceled on TinyPromiseQueue.")),t=!0}return t&&this.#s.add(e),t}},U=class{#c=null;#h=null;#f=null;#d=null;#g=null;#p=null;groupData=new Map;lastSeen=new Map;userToGroup=new Map;groupFlags=new Map;groupTTL=new Map;#m=null;setOnMemoryExceeded(e){if("function"!=typeof e)throw new Error("onMemoryExceeded must be a function");this.#m=e}clearOnMemoryExceeded(){this.#m=null}#y=null;setOnGroupExpired(e){if("function"!=typeof e)throw new Error("onGroupExpired must be a function");this.#y=e}clearOnGroupExpired(){this.#y=null}constructor({maxHits:e,interval:t,cleanupInterval:r,maxIdle:n=3e5,maxMemory:i=1e5}){const o=e=>"number"==typeof e&&Number.isFinite(e)&&e>=1&&Number.isInteger(e),s=o(e),a=o(t),l=o(r),u=o(n);if(!s&&!a)throw new Error("RateLimiter requires at least one valid option: 'maxHits' or 'interval'.");if(void 0!==e&&!s)throw new Error("'maxHits' must be a positive integer if defined.");if(void 0!==t&&!a)throw new Error("'interval' must be a positive integer in milliseconds if defined.");if(void 0!==r&&!l)throw new Error("'cleanupInterval' must be a positive integer in milliseconds if defined.");if(!u)throw new Error("'maxIdle' must be a positive integer in milliseconds.");if("number"==typeof i&&Number.isFinite(i)&&i>0)this.#c=Math.floor(i);else{if(null!=i)throw new Error("maxMemory must be a positive number or null");this.#c=null}this.#f=s?e:null,this.#d=a?t:null,this.#g=l?r:null,this.#p=n,null!==this.#g&&(this.#h=setInterval((()=>this._cleanup()),this.#g))}isGroupId(e){const t=this.groupFlags.get(e);return"boolean"==typeof t&&t}getUsersInGroup(e){const t=[];for(const[r,n]of this.userToGroup.entries())n===e&&t.push(r);return t}setGroupTTL(e,t){if("number"!=typeof t||!Number.isFinite(t)||t<=0)throw new Error("TTL must be a positive number in milliseconds");this.groupTTL.set(e,t)}getGroupTTL(e){return this.groupTTL.get(e)??null}deleteGroupTTL(e){this.groupTTL.delete(e)}assignToGroup(e,t){const r=this.userToGroup.get(e);if(r&&r!==t)throw new Error(`User ${e} is already assigned to group ${r}`);if(r===t)return;const n=this.groupData.get(e);if(this.isGroupId(e)){for(const[r,n]of this.userToGroup.entries())n===e&&this.userToGroup.set(r,t);this.userToGroup.delete(e)}else this.userToGroup.set(e,t);if(!n)return;const i=this.groupData.get(t);if(i)for(const e of n)i.push(e);else{const e=[];for(const t of n)e.push(t);this.groupData.set(t,e)}this.lastSeen.set(t,Date.now()),this.groupFlags.delete(e),this.groupData.delete(e),this.lastSeen.delete(e),this.groupTTL.delete(e),this.groupFlags.set(t,!0)}getGroupId(e){return this.userToGroup.get(e)||e}hit(e){const t=this.getGroupId(e),r=Date.now();this.groupData.has(t)||(this.groupData.set(t,[]),this.groupFlags.set(t,!1));const n=this.groupData.get(t);if(!n)throw new Error(`No data found for groupId: ${t}`);if(n.push(r),this.lastSeen.set(t,r),null!==this.#d){const e=r-this.getInterval();for(;n.length&&n[0]<e;)n.shift()}null!==this.#c&&"number"==typeof this.#c&&n.length>this.#c&&(n.splice(0,n.length-this.#c),"function"==typeof this.#m&&this.#m(t))}isRateLimited(e){const t=this.getGroupId(e);if(!this.groupData.has(t))return!1;const r=this.groupData.get(t);if(!r)throw new Error(`No data found for groupId: ${t}`);if(null!==this.#d){const e=Date.now()-this.getInterval();let t=0;for(let n=r.length-1;n>=0&&r[n]>e;n--)t++;return null!==this.#f?t>this.getMaxHits():t>0}return null!==this.#f&&r.length>this.getMaxHits()}resetGroup(e){this.groupFlags.delete(e),this.groupData.delete(e),this.lastSeen.delete(e),this.groupTTL.delete(e)}reset(e){return this.resetUserGroup(e)}resetUserGroup(e){this.userToGroup.delete(e)}setData(e,t){if(!Array.isArray(t))throw new Error("timestamps must be an array of numbers.");for(const e of t)if("number"!=typeof e||!Number.isFinite(e))throw new Error("All timestamps must be finite numbers.");this.groupData.has(e)||this.groupFlags.set(e,!1),this.groupData.set(e,t),this.lastSeen.set(e,Date.now())}hasData(e){return this.groupData.has(e)}getData(e){return this.groupData.get(e)||[]}getMaxIdle(){if("number"!=typeof this.#p||!Number.isFinite(this.#p)||this.#p<0)throw new Error("'maxIdle' must be a non-negative finite number.");return this.#p}setMaxIdle(e){if("number"!=typeof e||!Number.isFinite(e)||e<0)throw new Error("'maxIdle' must be a non-negative finite number.");this.#p=e}_cleanup(){const e=Date.now();for(const[t,r]of this.lastSeen.entries())e-r>(this.getGroupTTL(t)??this.getMaxIdle())&&(this.groupFlags.delete(t),this.groupData.delete(t),this.lastSeen.delete(t),this.groupTTL.delete(t),"function"==typeof this.#y&&this.#y(t))}getActiveGroups(){return Array.from(this.groupData.keys())}getAllUserMappings(){return Object.fromEntries(this.userToGroup)}getInterval(){if("number"!=typeof this.#d||!Number.isFinite(this.#d))throw new Error("'interval' is not a valid finite number.");return this.#d}getMaxHits(){if("number"!=typeof this.#f||!Number.isFinite(this.#f))throw new Error("'maxHits' is not a valid finite number.");return this.#f}getTotalHits(e){const t=this.groupData.get(e);return Array.isArray(t)?t.length:0}getLastHit(e){const t=this.groupData.get(e);return t?.length?t[t.length-1]:null}getTimeSinceLastHit(e){const t=this.getLastHit(e);return null!==t?Date.now()-t:null}_calculateAverageSpacing(e){if(!Array.isArray(e)||e.length<2)return null;let t=0;for(let r=1;r<e.length;r++)t+=e[r]-e[r-1];return t/(e.length-1)}getAverageHitSpacing(e){return this._calculateAverageSpacing(this.groupData.get(e))}getMetrics(e){const t=this.groupData.get(e);if(!Array.isArray(t)||0===t.length)return{totalHits:0,lastHit:null,timeSinceLastHit:null,averageHitSpacing:null};const r=t.length,n=t[r-1];return{totalHits:r,lastHit:n,timeSinceLastHit:Date.now()-n,averageHitSpacing:this._calculateAverageSpacing(t)}}destroy(){this.#h&&clearInterval(this.#h),this._cleanup(),this.groupData.clear(),this.lastSeen.clear(),this.userToGroup.clear(),this.groupTTL.clear(),this.groupFlags.clear()}};class _{static getTemplate(){return'\n<div class="notify-overlay hidden">\n <div class="notify-center" id="notifCenter">\n <div class="header">\n <div>Notifications</div>\n <div class="options">\n <button class="clear-all" type="button">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 24 24"\n width="24"\n height="24"\n fill="currentColor"\n >\n <path\n d="M21.6 2.4a1 1 0 0 0-1.4 0L13 9.6l-1.3-1.3a1 1 0 0 0-1.4 0L3 15.6a1 1 0 0 0 0 1.4l4 4a1 1 0 0 0 1.4 0l7.3-7.3a1 1 0 0 0 0-1.4l-1.3-1.3 7.2-7.2a1 1 0 0 0 0-1.4zM6 17l3.5-3.5 1.5 1.5L7.5 18.5 6 17z"\n />\n </svg>\n </button>\n <button class="close">×</button>\n </div>\n </div>\n <div class="list"></div>\n </div>\n</div>\n\n<button class="notify-bell" aria-label="Open notifications">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n fill="currentColor"\n viewBox="0 0 24 24"\n >\n <path\n d="M12 2C10.3 2 9 3.3 9 5v1.1C6.7 7.2 5 9.4 5 12v5l-1 1v1h16v-1l-1-1v-5c0-2.6-1.7-4.8-4-5.9V5c0-1.7-1.3-3-3-3zm0 20c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z"\n />\n </svg>\n <span class="badge" id="notifBadge">0</span>\n</button>\n '}static insertTemplate(e="afterbegin"){document.body.insertAdjacentHTML(e,_.getTemplate())}#v;#b;#w;#E;#T;#C=0;#D=99;#x=300;#L=!1;#M=new WeakMap;#A(e){if(this.#M.delete(e),!(e instanceof HTMLElement))throw new Error("Invalid HTMLElement to clear.");e.classList.add("removing"),setTimeout((()=>{this.markAsRead(e),e.remove()}),this.#x)}#k(e){this.#C=Math.max(0,e),this.#w.setAttribute("data-value",String(this.#C)),this.#w.textContent=this.#C>this.#D?`${this.#D}+`:String(this.#C)}constructor(e={}){const{center:t=document.getElementById("notifCenter"),badge:r=document.getElementById("notifBadge"),button:n=document.querySelector(".notify-bell"),overlay:i=document.querySelector(".notify-overlay")}=e;if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "center" must be an HTMLElement. Got: ${t}`);if(!(i instanceof HTMLElement))throw new Error(`NotificationCenter: "overlay" must be an HTMLElement. Got: ${i}`);if(!(r instanceof HTMLElement))throw new Error(`NotificationCenter: "badge" must be an HTMLElement. Got: ${r}`);if(!(n instanceof HTMLElement))throw new Error(`NotificationCenter: "button" must be an HTMLElement. Got: ${n}`);const o=t?.querySelector(".clear-all"),s=t?.querySelector(".list")??null;if(!(s instanceof HTMLElement))throw new Error(`NotificationCenter: ".list" inside center must be an HTMLElement. Got: ${s}`);this.#v=t,this.#b=s,this.#w=r,this.#E=n,this.#T=i,this.#E.addEventListener("click",(()=>this.toggle())),this.#v.querySelector(".close")?.addEventListener("click",(()=>this.close())),o&&o.addEventListener("click",(()=>this.clear())),this.#T.addEventListener("click",(e=>{e.target===this.#T&&this.close()}))}setMarkAllAsReadOnClose(e){if("boolean"!=typeof e)throw new TypeError("Expected boolean for markAllAsReadOnClose, got "+typeof e);this.#L=e}setRemoveDelay(e){if("number"!=typeof e)throw new Error('NotificationCenter: "ms" must be an number.');this.#x=e}getItemMode(e){const t=this.getItem(e);return t?this.#M.get(t):null}getItem(e){const t=this.#b.children.item(e);if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "item" must be an HTMLElement. Got: ${t}`);return t}hasItem(e){return e>=0&&e<this.#b.children.length}markAsRead(e){const t=e instanceof HTMLElement?e:this.getItem(e);t.classList.contains("unread")&&(t.classList.remove("unread"),this.#k(this.#C-1))}add(e,t="text"){const r=document.createElement("div");r.className="item unread";let n=null,i=null,o=null,s=null;if("object"==typeof e&&null!==e?(n=e.title,i=e.message,o=e.avatar,s=e.onClick):i=e,o){const e=document.createElement("div");e.className="avatar",e.style.backgroundImage=`url("${o}")`,r.appendChild(e)}const a=document.createElement("div");if(a.className="content",n){const e=document.createElement("div");e.className="title",e.textContent=n,a.appendChild(e)}const l=document.createElement("div");l.className="message","html"===t?l.innerHTML=i:l.textContent=i,a.appendChild(l),"function"==typeof s&&(r.classList.add("clickable"),r.addEventListener("click",(e=>{e.target instanceof HTMLElement&&!e.target.closest(".notify-close")&&s(e)})));const u=document.createElement("button");u.className="notify-close",u.setAttribute("type","button"),u.innerHTML="×",u.addEventListener("click",(e=>{e.stopPropagation(),this.#A(r)})),r.append(a,u),this.#b.prepend(r),this.#M.set(r,t),this.#k(this.#C+1)}remove(e){const t=this.getItem(e);this.#A(t)}clear(){let e=!0;for(;e;){e=!1;const t=Array.from(this.#b.children);for(const r of t)r instanceof HTMLElement&&!r.classList.contains("removing")&&(this.#A(r),e=!0)}}open(){this.#T.classList.remove("hidden"),this.#v.classList.add("open")}close(){if(this.#T.classList.add("hidden"),this.#v.classList.remove("open"),this.#L){const e=this.#b.querySelectorAll(".item.unread");for(const t of e)t instanceof HTMLElement&&this.markAsRead(t)}}toggle(){this.#v.classList.contains("open")?this.close():this.open()}recount(){const e=this.#b.querySelectorAll(".item.unread").length;this.#k(e)}get count(){return this.#C}destroy(){this.#E?.removeEventListener("click",this.toggle),this.#v?.querySelector(".close")?.removeEventListener("click",this.close),this.#v?.querySelector(".clear-all")?.removeEventListener("click",this.clear),this.#T?.removeEventListener("click",this.close),this.clear(),this.#v?.remove(),this.#T?.remove(),this.#E?.remove(),this.#C=0,this.#M=new WeakMap}}const J=_,q=class{#S;#B;#N;#O;#I;#R;constructor(e="top",t="right",r=3e3,n=50,i=300,o=".notify-container"){this.#P(e),this.#F(t),this.#H(r,"baseDuration"),this.#H(n,"extraPerChar"),this.#H(i,"fadeOutDuration"),this.#S=e,this.#B=t,this.#N=r,this.#O=n,this.#I=i;const s=document.querySelector(`${o}.${e}.${t}`);s instanceof HTMLElement?this.#R=s:(this.#R=document.createElement("div"),this.#R.className=`notify-container ${e} ${t}`,document.body.appendChild(this.#R))}getContainer(){if(!(this.#R instanceof HTMLElement))throw new Error("Container is not a valid HTMLElement.");return this.#R}#P(e){if(!["top","bottom"].includes(e))throw new Error(`Invalid vertical direction "${e}". Expected "top" or "bottom".`)}#F(e){if(!["left","right","center"].includes(e))throw new Error(`Invalid horizontal position "${e}". Expected "left", "right" or "center".`)}#H(e,t){if("number"!=typeof e||e<0||!Number.isFinite(e))throw new Error(`Invalid value for "${t}": ${e}. Must be a non-negative finite number.`)}getY(){return this.#S}setY(e){this.#P(e);const t=this.getContainer();t.classList.remove(this.#S),t.classList.add(e),this.#S=e}getX(){return this.#B}setX(e){this.#F(e);const t=this.getContainer();t.classList.remove(this.#B),t.classList.add(e),this.#B=e}getBaseDuration(){return this.#N}setBaseDuration(e){this.#H(e,"baseDuration"),this.#N=e}getExtraPerChar(){return this.#O}setExtraPerChar(e){this.#H(e,"extraPerChar"),this.#O=e}getFadeOutDuration(){return this.#I}setFadeOutDuration(e){this.#H(e,"fadeOutDuration"),this.#I=e}show(e){let t="",r="",n=null,i=!1,o=null;const s=document.createElement("div");if(s.className="notify enter","string"==typeof e)t=e;else{if("object"!=typeof e||null===e||"string"!=typeof e.message)throw new Error("Invalid argument for show(): expected string or { message: string, title?: string, onClick?: function, html?: boolean, avatar?: string }");if(t=e.message,r="string"==typeof e.title?e.title:"",i=!0===e.html,o="string"==typeof e.avatar?e.avatar:null,void 0!==e.onClick){if("function"!=typeof e.onClick)throw new Error("onClick must be a function if defined");n=e.onClick,s.classList.add("clickable")}}const a=document.createElement("button");if(a.innerHTML="×",a.className="close",a.setAttribute("aria-label","Close"),a.addEventListener("mouseenter",(()=>{a.style.color="var(--notif-close-color-hover)"})),a.addEventListener("mouseleave",(()=>{a.style.color="var(--notif-close-color)"})),o){const e=document.createElement("img");e.src=o,e.alt="avatar",e.className="avatar",s.appendChild(e)}if(r){const e=document.createElement("strong");e.textContent=r,e.style.display="block",s.appendChild(e)}if(i){const e=document.createElement("div");e.innerHTML=t,s.appendChild(e)}else s.appendChild(document.createTextNode(t));s.appendChild(a),this.getContainer().appendChild(s);const l=this.#N+t.length*this.#O+this.#I;let u=!1;const c=()=>{u||(u=!0,s.classList.remove("enter","show"),s.classList.add("exit"),setTimeout((()=>s.remove()),this.#I))};"function"==typeof n&&s.addEventListener("click",(e=>{e.target!==a&&n(e,c)})),a.addEventListener("click",(e=>{e.stopPropagation(),c()})),setTimeout((()=>{s.classList.remove("enter"),s.classList.add("show")}),1),setTimeout((()=>c()),l)}destroy(){this.#R instanceof HTMLElement&&(this.#R.querySelectorAll(".notify").forEach((e=>e.remove())),this.#R.parentNode&&this.#R.parentNode.removeChild(this.#R),this.#R=null)}},G=(e,t)=>e.bottom<t.top,z=(e,t)=>e.top>t.bottom,Y=(e,t)=>e.right<t.left,V=(e,t)=>e.left>t.right,W=(e,t)=>e.bottom<=t.top,X=(e,t)=>e.top>=t.bottom,Q=(e,t)=>e.right<=t.left,K=(e,t)=>e.left>=t.right,Z=(e,t)=>!(Y(e,t)||V(e,t)||G(e,t)||z(e,t)),ee=(e,t)=>!(Q(e,t)||K(e,t)||W(e,t)||X(e,t)),te=(e,t)=>Y(e,t)?"left":V(e,t)?"right":G(e,t)?"top":z(e,t)?"bottom":null,re=(e,t)=>Q(e,t)?"left":K(e,t)?"right":W(e,t)?"top":X(e,t)?"bottom":null,ne=(e,t)=>({overlapLeft:t.right-e.left,overlapRight:e.right-t.left,overlapTop:t.bottom-e.top,overlapBottom:e.bottom-t.top}),ie=({overlapLeft:e=-1,overlapRight:t=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:e<t?"right":"left",dirY:r<n?"bottom":"top"}),oe=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function se(e,t){const r=e.left+e.width/2,n=e.top+e.height/2;return{x:t.left+t.width/2-r,y:t.top+t.height/2-n}}function ae(e,t){if(!ee(e,t))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:i,overlapBottom:o}=ne(e,t),{dirX:s,dirY:a}=ie({overlapLeft:r,overlapRight:n,overlapTop:i,overlapBottom:o}),l=Math.min(r,n),u=Math.min(i,o);let c;return c=l<u?s:a,{inDir:c,dirX:s,dirY:a,depthX:l,depthY:u}}function le(e,t){const r=ee(e,t),n={in:null,x:null,y:null},i={y:null,x:null},o={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:a,overlapTop:l,overlapBottom:u}=ne(t,e);o.top=l,o.bottom=u,o.left=s,o.right=a;const c=Object.entries(o).filter((([,e])=>e>0)).sort(((e,t)=>e[1]-t[1])),{dirX:h,dirY:f}=ie({overlapLeft:a,overlapRight:s,overlapTop:u,overlapBottom:l});return n.y=f,n.x=h,o.bottom<0?i.y="bottom":o.top<0&&(i.y="top"),o.left<0?i.x="left":o.right<0&&(i.x="right"),n.in=r?o.top===o.bottom&&o.bottom===o.left&&o.left===o.right?"center":c.length?c[0][0]:"top":null,{dirs:n,depth:o,isNeg:i}}function ue(e,t){const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return Z(r,n)}function ce(e,t){return new Promise(((r,n)=>{const i=new FileReader;i.onload=()=>{try{r(i.result)}catch(e){n(e)}},i.onerror=()=>{n(i.error)},i[t](e)}))}function he(e,t=!1){return new Promise(((r,n)=>{"string"!=typeof t&&"boolean"!=typeof t&&n(new TypeError("The isDataUrl parameter must be a boolean or a string.")),ce(e,"readAsDataURL").then((e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const n=e.match(/^data:(.+);base64,(.*)$/);if(!n||!n[2])throw new Error("Invalid data URL format or missing Base64 content.");const[,i,o]=n;if(!/^[\w/+]+=*$/.test(o))throw new Error("Base64 content is malformed.");if("boolean"==typeof t)return r(t?e:o);if(!/^[\w-]+\/[\w.+-]+$/.test(t))throw new Error(`Invalid MIME type string: ${t}`);return r(`data:${t};base64,${o}`)})).catch(n)}))}function fe(e){return new Promise(((t,r)=>ce(e,"readAsText").then((e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const r=e.trim();if(0===r.length)throw new Error("File is empty or contains only whitespace.");const n=JSON.parse(r);if("object"!=typeof n||null===n)throw new Error("Parsed content is not a valid JSON object or array.");t(n)})).catch(r)))}function de(e,t,r=2){const n=JSON.stringify(t,null,r),i=new Blob([n],{type:"application/json"}),o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}async function ge(e,{method:t="GET",body:r,timeout:n=0,retries:i=0,headers:o={},signal:s=null}={}){if("string"!=typeof e||!e.startsWith("../")&&!e.startsWith("./")&&!e.startsWith("/")&&!e.startsWith("https://")&&!e.startsWith("http://"))throw new Error("Invalid URL: must be a valid http or https address.");if("string"!=typeof t||!t.trim())throw new Error("Invalid method: must be a non-empty string.");if(!s){if("number"!=typeof n||!Number.isFinite(n)||Number.isNaN(n)||n<0)throw new Error("Invalid timeout: must be a positive number.");if("number"!=typeof i||!Number.isFinite(i)||Number.isNaN(i)||i<0)throw new Error("Invalid retries: must be a positive number.")}const a=s?1:i+1;let l=null;for(let u=0;u<a;u++){const a=s?null:new AbortController,c=s||(a?.signal??null),h=!s&&n&&a?setTimeout((()=>a.abort()),n):null;try{const n=await fetch(e,{method:t.toUpperCase(),headers:{Accept:"application/json",...o},body:void 0!==r?w(r)?JSON.stringify(r):r:void 0,signal:c});if(h&&clearTimeout(h),!n.ok)throw new Error(`HTTP error: ${n.status} ${n.statusText}`);const i=n.headers.get("content-type")||"";if(!i.includes("application/json"))throw new Error(`Unexpected content-type: ${i}`);const s=await n.json();if(!Array.isArray(s)&&!w(s))throw new Error("Received invalid data instead of valid JSON.");return s}catch(e){if(l=e,s)break;u<i&&await new Promise((e=>setTimeout(e,300*(u+1))))}}throw new Error(`Failed to fetch JSON from "${e}"${l?`: ${l.message}`:"."}`)}const pe=e=>{const t=getComputedStyle(e),r=parseFloat(t.borderLeftWidth)||0,n=parseFloat(t.borderRightWidth)||0,i=parseFloat(t.borderTopWidth)||0,o=parseFloat(t.borderBottomWidth)||0;return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}},me=e=>{const t=getComputedStyle(e),r=parseFloat(t.borderLeft)||0,n=parseFloat(t.borderRight)||0,i=parseFloat(t.borderTop)||0,o=parseFloat(t.borderBottom)||0;return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}},ye=e=>{const t=getComputedStyle(e),r=parseFloat(t.marginLeft)||0,n=parseFloat(t.marginRight)||0,i=parseFloat(t.marginTop)||0,o=parseFloat(t.marginBottom)||0;return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}},ve=e=>{const t=getComputedStyle(e),r=parseFloat(t.paddingLeft)||0,n=parseFloat(t.paddingRight)||0,i=parseFloat(t.paddingTop)||0,o=parseFloat(t.paddingBottom)||0;return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}};function be({element:e=document.body,hiddenClass:t="windowHidden",visibleClass:r="windowVisible",onVisible:n,onHidden:i}={}){if(!(e instanceof HTMLElement))throw new TypeError('"element" must be an instance of HTMLElement.');if("string"!=typeof t)throw new TypeError('"hiddenClass" must be a string.');if("string"!=typeof r)throw new TypeError('"visibleClass" must be a string.');if(void 0!==n&&"function"!=typeof n)throw new TypeError('"onVisible" must be a function if provided.');if(void 0!==i&&"function"!=typeof i)throw new TypeError('"onHidden" must be a function if provided.');const o=()=>{e.classList.remove(t),e.classList.remove(r)};let s=null;const a=["visibilitychange","mozvisibilitychange","webkitvisibilitychange","msvisibilitychange"],l=["hidden","mozHidden","webkitHidden","msHidden"];for(let e=0;e<l.length;e++)if(l[e]in document){s=l[e];break}const u=function(a){o();const l=a?.type,u=s&&document[s];["focus","focusin","pageshow"].includes(l)?(e.classList.add(r),n?.()):["blur","focusout","pagehide"].includes(l)||u?(e.classList.add(t),i?.()):(e.classList.add(r),n?.())};let c=()=>{};if(s){const e=a[l.indexOf(s)];document.addEventListener(e,u),window.addEventListener("focus",u),window.addEventListener("blur",u),c=()=>{document.removeEventListener(e,u),window.removeEventListener("focus",u),window.removeEventListener("blur",u),o()}}else"onfocusin"in document?(document.onfocusin=document.onfocusout=u,c=()=>{document.onfocusin=document.onfocusout=null,o()}):(window.onpageshow=window.onpagehide=window.onfocus=window.onblur=u,c=()=>{window.onpageshow=window.onpagehide=window.onfocus=window.onblur=null,o()});const h=new Event(s&&document[s]?"blur":"focus");return u(h),c}function we(e){const t=e.offsetTop,r=t+e.offsetHeight,n=window.scrollY,i=n+window.innerHeight;return r>n&&t<i}function Ee(e){const t=window.scrollY,r=t+window.innerHeight,n=e.offsetTop;return n+e.offsetHeight<=r&&n>=t}const Te=class{#j;#$;#U;#_;#J;#q;#G;#z;constructor(e={}){const{target:t,fullscreen:r=!0,hoverClass:n="dnd-hover",onDrop:i,onEnter:o,onLeave:s}=e;if("boolean"!=typeof r)throw new TypeError('The "fullscreen" option must be a boolean.');const a=r?document.body:t||document.body;if(!(a instanceof HTMLElement))throw new TypeError('The "target" option must be an instance of HTMLElement.');if("string"!=typeof n)throw new TypeError('The "hoverClass" option must be a string.');if("function"!=typeof i)throw new TypeError('The "onDrop" option must be a function.');if("function"!=typeof o)throw new TypeError('The "onEnter" option must be a function.');if("function"!=typeof s)throw new TypeError('The "onLeave" option must be a function.');this.#j=a,this.#$=r,this.#U=n,this.#_=i||(()=>{}),this.#J=o,this.#q=s,this.#G=!1,this.#z=!1,this._handleDragEnter=this._handleDragEnter.bind(this),this._handleDragOver=this._handleDragOver.bind(this),this._handleDragLeave=this._handleDragLeave.bind(this),this._handleDrop=this._handleDrop.bind(this),this.#Y()}getTarget(){return this.#j}getHoverClass(){return this.#U}isFullScreen(){return this.#$}isDragging(){return this.#G}bound(){return this.#z}#Y(){if(this.#z)return;const e=this.getTarget();e.addEventListener("dragenter",this._handleDragEnter),e.addEventListener("dragover",this._handleDragOver),e.addEventListener("dragleave",this._handleDragLeave),e.addEventListener("drop",this._handleDrop),this.#z=!0}#V(){if(!this.#z)return;const e=this.getTarget();e.removeEventListener("dragenter",this._handleDragEnter),e.removeEventListener("dragover",this._handleDragOver),e.removeEventListener("dragleave",this._handleDragLeave),e.removeEventListener("drop",this._handleDrop),this.#z=!1}_handleDragEnter(e){if(e.preventDefault(),!this.#G){const t=this.getTarget();this.#G=!0,t.classList.add(this.#U),this.#J(e)}}_handleDragOver(e){e.preventDefault(),e.dataTransfer?e.dataTransfer.dropEffect="copy":console.warn("[TinyDragDropDetector] [handleDragOver] DragOver event missing dataTransfer.")}_handleDragLeave(e){e.preventDefault();const t=this.getTarget();null!==e.relatedTarget&&t.contains(e.relatedTarget)||(this.#G=!1,t.classList.remove(this.#U),this.#q(e))}_handleDrop(e){if(e.preventDefault(),!e.dataTransfer)return void console.warn("[TinyDragDropDetector] [handleDrop] DragOver event missing dataTransfer.");const t=this.getTarget();this.#G=!1,t.classList.remove(this.#U);const r=e.dataTransfer.files;r.length>0&&this.#_(r,e)}destroy(){this.#V(),this.getTarget().classList.remove(this.#U)}};var Ce=r(133),De=r(975);function xe(e){if(!(0,Ce.existsSync)(e))throw new Error(`File not found: ${e}`);const t=(0,Ce.readFileSync)(e,"utf-8");return JSON.parse(t)}function Le(e,t,r=2){const n=JSON.stringify(t,null,r);(0,Ce.writeFileSync)(e,n,"utf-8")}function Me(e){(0,Ce.existsSync)(e)||(0,Ce.mkdirSync)(e,{recursive:!0})}function Ae(e){if(!(0,Ce.existsSync)(e))return;const t=(0,Ce.readdirSync)(e);for(const r of t){const t=(0,De.join)(e,r);(0,Ce.lstatSync)(t).isDirectory()?(0,Ce.rmSync)(t,{recursive:!0,force:!0}):(0,Ce.unlinkSync)(t)}}function ke(e){return(0,Ce.existsSync)(e)&&(0,Ce.lstatSync)(e).isFile()}function Se(e){return(0,Ce.existsSync)(e)&&(0,Ce.lstatSync)(e).isDirectory()}function Be(e){return 0===(0,Ce.readdirSync)(e).length}function Ne(e,t,r){Me((0,De.dirname)(t)),(0,Ce.copyFileSync)(e,t,r)}function Oe(e){return!!ke(e)&&((0,Ce.unlinkSync)(e),!0)}function Ie(e,t,r="utf-8"){Me((0,De.dirname)(e)),(0,Ce.writeFileSync)(e,t,r)}function Re(e,t=!1){const r={files:[],dirs:[]};if(!Se(e))return r;const n=(0,Ce.readdirSync)(e);for(const i of n){const n=(0,De.join)(e,i);if((0,Ce.lstatSync)(n).isDirectory()){if(r.dirs.push(n),t){const e=Re(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}function Pe(e,t=!1){const r=[];if(!Se(e))return r;const n=(0,Ce.readdirSync)(e);for(const i of n){const n=(0,De.join)(e,i);(0,Ce.lstatSync)(n).isDirectory()&&(r.push(n),t&&r.push(...Pe(n,!0)))}return r}function Fe(e){return ke(e)?(0,Ce.statSync)(e).size:0}function He(e){let t=0;const r=Re(e,!0).files;for(const e of r)t+=Fe(e);return t}function je(e,t="bak"){ke(e)&&Ne(e,`${e}.${t}.${(new Date).toISOString().replace(/[:.]/g,"-")}`)}function $e(e,t="bak"){const r=(0,De.dirname)(e),n=(0,De.basename)(e),i=(0,Ce.readdirSync)(r).filter((e=>e.startsWith(`${n}.${t}.`))).sort().reverse();if(0===i.length)throw new Error(`No backups found for ${e}`);return(0,De.join)(r,i[0])}function Ue(e,t="bak"){Ne($e(e,t),e)}function _e(e,t,r=[]){if("string"!=typeof e)throw new TypeError("dirPath must be a string");if("function"!=typeof t)throw new TypeError("renameFn must be a function");if(!Array.isArray(r))throw new TypeError("extensions must be an array of strings");if(!(0,Ce.existsSync)(e)||!(0,Ce.statSync)(e).isDirectory())throw new Error(`Directory not found or invalid: ${e}`);for(const e of r)if("string"!=typeof e||!e.startsWith("."))throw new TypeError(`Invalid extension: ${e}`);const n=Re(e).files;let i=0;for(const o of n){const n=(0,De.extname)(o);if(r.length&&!r.includes(n))continue;const s=(0,De.basename)(o),a=t(s,i++),l=(0,De.join)(e,a);s!==a&&(0,Ce.renameSync)(o,l)}}function Je(e,t,r,n=[]){_e(e,(e=>{const n=(0,De.extname)(e);return`${(0,De.basename)(e,n).replace(t,r)}${n}`}),n)}function qe(e,{prefix:t="",suffix:r=""},n=[]){_e(e,(e=>{const n=(0,De.extname)(e),i=(0,De.basename)(e,n);return`${t}${i}${r}${n}`}),n)}function Ge(e,t="lower",r=[],n=!1){if("string"!=typeof t||!["lower","upper","title"].includes(t))throw new Error(`Invalid mode "${t}". Must be 'lower', 'upper' or 'title'.`);_e(e,(e=>{const r=e=>"lower"===t?e.toLowerCase():"upper"===t?e.toUpperCase():"title"===t?I(e):e,i=(0,De.extname)(e),o=n?r(i):i;return`${r((0,De.basename)(e,i))}${o}`}),r)}function ze(e,t=3,r=[]){_e(e,(e=>e.replace(/\d+/,(e=>e.padStart(t,"0")))),r)}var Ye=r(370);async function Ve(e){if(!(0,Ce.existsSync)(e))return;const t=await(0,Ye.readdir)(e),r={},n=[];for(const i of t){const t=(0,De.join)(e,i),o=(0,Ye.lstat)(t);o.then((e=>(r[t]=e,e))),n.push(o)}await Promise.all(n);const i=[];for(const e in r)r[e].isDirectory()?i.push((0,Ye.rm)(e,{recursive:!0,force:!0})):i.push((0,Ye.unlink)(e));await Promise.all(i)}async function We(e){return 0===(await(0,Ye.readdir)(e)).length}async function Xe(e,t=!1){const r={files:[],dirs:[]};if(!Se(e))return r;const n=await(0,Ye.readdir)(e);for(const i of n){const n=(0,De.join)(e,i);if((await(0,Ye.lstat)(n)).isDirectory()){if(r.dirs.push(n),t){const e=await Xe(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}async function Qe(e,t=!1){const r=[];if(!Se(e))return r;const n=await(0,Ye.readdir)(e);for(const i of n){const n=(0,De.join)(e,i);(await(0,Ye.lstat)(n)).isDirectory()&&(r.push(n),t&&r.push(...await Qe(n,!0)))}return r}async function Ke(e){return ke(e)?(await(0,Ye.stat)(e)).size:0}async function Ze(e){let t=0;const{files:r}=await Xe(e,!0),n=[];for(const e of r){const r=Ke(e);r.then((e=>(t+=e,e))),n.push(r)}return await Promise.all(n),t}const et=class{#W=!0;#X=!1;#Q=0;#K=0;#Z=!1;#ee=!1;#te=!1;#re=!1;#ne=!1;#ie=!1;#oe=null;#se=[];#ae=null;#le={start:!1,end:!1,collide:!1,move:!1};#ue=null;#j;#ce="drag-hidden";#he="dragging";#fe="drag-active";#de="jail-drag-active";#ge="jail-drag-disabled";#pe="dragging-collision";constructor(e,t={}){if(!(e instanceof HTMLElement))throw new Error("TinyDragger requires a valid target HTMLElement to initialize.");if(this.#j=e,void 0!==t.jail&&!(t.jail instanceof HTMLElement))throw new Error('The "jail" option must be an HTMLElement if provided.');if(void 0!==t.vibration&&!1!==t.vibration&&!w(t.vibration))throw new Error('The "vibration" option must be an object or false.');const r=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new Error(`The "${t}" option must be a boolean.`)},n=(e,t)=>{if(void 0!==e&&"string"!=typeof e)throw new Error(`The "${t}" option must be a string.`)};r(t.collisionByMouse,"collisionByMouse"),r(t.lockInsideJail,"lockInsideJail"),r(t.dropInJailOnly,"dropInJailOnly"),r(t.revertOnDrop,"revertOnDrop"),r(t.multiCollision,"multiCollision"),n(t.classDragging,"classDragging"),n(t.classBodyDragging,"classBodyDragging"),n(t.classJailDragging,"classJailDragging"),n(t.classJailDragDisabled,"classJailDragDisabled"),n(t.classDragCollision,"classDragCollision"),n(t.classHidden,"classHidden"),t.jail instanceof HTMLElement&&(this.#ue=t.jail),this.#le=Object.assign({start:!1,end:!1,collide:!1,move:!1},w(t.vibration)?t.vibration:{}),"string"==typeof t.classDragging&&(this.#he=t.classDragging),"string"==typeof t.classBodyDragging&&(this.#fe=t.classBodyDragging),"string"==typeof t.classJailDragging&&(this.#de=t.classJailDragging),"string"==typeof t.classJailDragDisabled&&(this.#ge=t.classJailDragDisabled),"string"==typeof t.classHidden&&(this.#ce=t.classHidden),"string"==typeof t.classDragCollision&&(this.#pe=t.classDragCollision),"boolean"==typeof t.collisionByMouse&&(this.#ne=t.collisionByMouse),"boolean"==typeof t.revertOnDrop&&(this.#te=t.revertOnDrop),"boolean"==typeof t.lockInsideJail&&(this.#ee=t.lockInsideJail),"boolean"==typeof t.dropInJailOnly&&(this.#ie=t.dropInJailOnly),"boolean"==typeof t.multiCollision&&(this.#Z=t.multiCollision),this._onMouseDown=this.#me.bind(this),this._onMouseMove=this.#ye.bind(this),this._onMouseUp=this.#ve.bind(this),this._onTouchStart=e=>this.#me(e.touches[0]),this._onTouchMove=e=>this.#ye(e.touches[0]),this._onTouchEnd=e=>this.#ve(e.changedTouches[0]),this.#j.addEventListener("mousedown",this._onMouseDown),this.#j.addEventListener("touchstart",this._onTouchStart,{passive:!1})}enable(){this.#be(),this.#ue&&this.#ue.classList.add(this.#ge),this.#W=!0}disable(){this.#ue&&this.#ue.classList.remove(this.#ge),this.#W=!1}addCollidable(e){if(this.#be(),!(e instanceof HTMLElement))throw new Error("addCollidable expects an HTMLElement as argument.");this.#se.includes(e)||this.#se.push(e)}removeCollidable(e){if(this.#be(),!(e instanceof HTMLElement))throw new Error("removeCollidable expects an HTMLElement as argument.");this.#se=this.#se.filter((t=>t!==e))}setVibrationPattern({startPattern:e=!1,endPattern:t=!1,collidePattern:r=!1,movePattern:n=!1}={}){this.#be();const i=e=>!1===e||Array.isArray(e)&&e.every((e=>"number"==typeof e));if(!i(e))throw new Error('Invalid "startPattern": must be false or an array of numbers.');if(!i(t))throw new Error('Invalid "endPattern": must be false or an array of numbers.');if(!i(r))throw new Error('Invalid "collidePattern": must be false or an array of numbers.');if(!i(n))throw new Error('Invalid "movePattern": must be false or an array of numbers.');this.#le={start:e,end:t,collide:r,move:n}}disableVibration(){this.#be(),this.#le={start:!1,end:!1,collide:!1,move:!1}}getOffset(e){if(this.#be(),!(e instanceof MouseEvent||e instanceof Touch)||"number"!=typeof e.clientX||"number"!=typeof e.clientY)throw new Error("getOffset expects an event with valid clientX and clientY coordinates.");const t=this.#j.getBoundingClientRect(),{left:r,top:n}=pe(this.#j);return{x:e.clientX-t.left+r,y:e.clientY-t.top+n}}#me(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#X||!this.#W||!this.#j.parentElement)return;const t=this.#j.cloneNode(!0);if(!(t instanceof HTMLElement))return;this.#ae=t,this.#re=!0;const r=this.#j.getBoundingClientRect();Object.assign(this.#ae.style,{position:"absolute",pointerEvents:"none",left:`${this.#j.offsetLeft}px`,top:`${this.#j.offsetTop}px`,width:`${r.width}px`,height:`${r.height}px`,zIndex:9999}),this.#j.classList.add(this.#ce),this.#j.parentElement.appendChild(this.#ae);const{x:n,y:i}=this.getOffset(e);this.#K=n,this.#Q=i,this.#ae.classList.add(this.#he),document.body.classList.add(this.#fe),this.#ue&&this.#ue.classList.add(this.#de),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("touchmove",this._onTouchMove,{passive:!1}),document.addEventListener("touchend",this._onTouchEnd),navigator.vibrate&&Array.isArray(this.#le.start)&&navigator.vibrate(this.#le.start),this.checkDragCollision(e),this.#we("drag")}#Ee=[];#Te(e){e&&(e.classList.add(this.#pe),this.#Ee.push(e))}#Ce(){for(;this.#Ee.length>0;){const e=this.#Ee.shift();e&&e.classList.remove(this.#pe)}this.#oe&&this.#oe.classList.remove(this.#pe)}checkDragCollision(e){const{collidedElements:t}=this.execCollision(e),r=t[0]||null;this.#oe&&!t.includes(this.#oe)&&this.#Ce(),t.forEach((e=>this.#Te(e))),this.#se.forEach((e=>{t.includes(e)||e.classList.remove(this.#pe)})),navigator.vibrate&&Array.isArray(this.#le.collide)&&t.length>0&&navigator.vibrate(this.#le.collide),this.#oe=r}#ye(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#X||!this.#re||!this.#W||!this.#ae)return;const t=(this.#ae.offsetParent||document.body).getBoundingClientRect();let r=e.clientX-t.left-this.#K,n=e.clientY-t.top-this.#Q;if(this.#ee&&this.#ue){const e=this.#ue.getBoundingClientRect(),i=this.#ae.getBoundingClientRect(),o=e.left-t.left,s=e.top-t.top,{x:a,y:l}=pe(this.#ue),u=o+e.width-i.width-l,c=s+e.height-i.height-a;r=Math.max(o,Math.min(r,u)),n=Math.max(s,Math.min(n,c))}this.#ae.style.position="absolute",this.#ae.style.left=`${r}px`,this.#ae.style.top=`${n}px`,navigator.vibrate&&Array.isArray(this.#le.move)&&navigator.vibrate(this.#le.move),this.checkDragCollision(e),this.#we("dragging")}execCollision(e){if(this.#X||!this.#ae)return{inJail:!1,collidedElements:[]};let t=[],r=!0;const n=this.#ue?.getBoundingClientRect();if(this.#ne){const i=e.clientX,o=e.clientY;this.#ie&&this.#ue&&n&&(r=i>=n.left&&i<=n.right&&o>=n.top&&o<=n.bottom),t=r?this.#Z?this.getAllCollidedElements(i,o):[this.getCollidedElement(i,o)].filter(Boolean):[]}else{const e=this.#ae.getBoundingClientRect();this.#ie&&this.#ue&&n&&(r=e.left>=n.left&&e.right<=n.right&&e.top>=n.top&&e.bottom<=n.bottom),t=r?this.#Z?this.getAllCollidedElementsByRect(e):[this.getCollidedElementByRect(e)].filter(Boolean):[]}return{inJail:r,collidedElements:t}}#ve(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#X||!this.#re)return;if(this.#re=!1,!this.#ae)return;this.#j.classList.remove(this.#he),document.body.classList.remove(this.#fe),this.#ue&&this.#ue.classList.remove(this.#de),document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("touchend",this._onTouchEnd);const{collidedElements:t}=this.execCollision(e);navigator.vibrate&&Array.isArray(this.#le.end)&&navigator.vibrate(this.#le.end);const r=this.#ae.style.left,n=this.#ae.style.top;this.#ae&&(this.#ae.remove(),this.#ae=null),this.#oe&&this.#Ce(),this.#oe=null,this.#j.classList.remove(this.#ce),this.#te||(this.#j.style.left=r,this.#j.style.top=n);const i=new CustomEvent("drop",{detail:{targets:t,first:t[0]||null}});this.#j.dispatchEvent(i)}#De(e,t){const r=e.getBoundingClientRect();return!(t.right<r.left||t.left>r.right||t.bottom<r.top||t.top>r.bottom)}getAllCollidedElementsByRect(e){if(this.#be(),!(e instanceof DOMRect)||"number"!=typeof e.left||"number"!=typeof e.right||"number"!=typeof e.top||"number"!=typeof e.bottom)throw new Error("getCollidedElementByRect expects a valid DOMRect object.");return this.#se.filter((t=>this.#De(t,e)))}getCollidedElementByRect(e){if(this.#be(),!(e instanceof DOMRect)||"number"!=typeof e.left||"number"!=typeof e.right||"number"!=typeof e.top||"number"!=typeof e.bottom)throw new Error("getCollidedElementByRect expects a valid DOMRect object.");return this.#se.find((t=>this.#De(t,e)))||null}#xe(e,t,r){const n=e.getBoundingClientRect();return t>=n.left&&t<=n.right&&r>=n.top&&r<=n.bottom}getAllCollidedElements(e,t){if(this.#be(),"number"!=typeof e||"number"!=typeof t)throw new Error("getCollidedElement expects numeric x and y coordinates.");return this.#se.filter((r=>this.#xe(r,e,t)))}getCollidedElement(e,t){if(this.#be(),"number"!=typeof e||"number"!=typeof t)throw new Error("getCollidedElement expects numeric x and y coordinates.");return this.#se.find((r=>this.#xe(r,e,t)))||null}#we(e){const t=new CustomEvent(e);this.#j.dispatchEvent(t)}getDragging(){return this.#re}getLockInsideJail(){return this.#ee}setLockInsideJail(e){if("boolean"!=typeof e)throw new Error("lockInsideJail must be a boolean.");this.#ee=e}getRevertOnDrop(){return this.#te}setRevertOnDrop(e){if("boolean"!=typeof e)throw new Error("revertOnDrop must be a boolean.");this.#te=e}getCollisionByMouse(){return this.#ne}setCollisionByMouse(e){if("boolean"!=typeof e)throw new Error("collisionByMouse must be a boolean.");this.#ne=e}getDropInJailOnly(){return this.#ie}setDropInJailOnly(e){if("boolean"!=typeof e)throw new Error("dropInJailOnly must be a boolean.");this.#ie=e}getTarget(){return this.#j}getJail(){return this.#ue}getDragProxy(){return this.#ae}getLastCollision(){return this.#oe}getCollidables(){return[...this.#se]}getDragHiddenClass(){return this.#ce}getClassDragging(){return this.#he}getClassBodyDragging(){return this.#fe}getClassJailDragging(){return this.#de}getClassJailDragDisabled(){return this.#ge}getClassDragCollision(){return this.#pe}getVibrations(){return{...this.#le}}getStartVibration(){return this.#le.start}getEndVibration(){return this.#le.end}getCollideVibration(){return this.#le.collide}getMoveVibration(){return this.#le.move}isEnabled(){return this.#W}#be(){if(this.#X)throw new Error("This TinyDragger instance has been destroyed and can no longer be used.")}destroy(){this.#X||(this.disable(),this.#j.removeEventListener("mousedown",this._onMouseDown),this.#j.removeEventListener("touchstart",this._onTouchStart),document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("touchend",this._onTouchEnd),this.#oe&&this.#Ce(),this.#ae&&(this.#ae.remove(),this.#ae=null),this.#se=[],this.#re=!1,this.#oe=null,this.#j.classList.remove(this.#ce,this.#he),document.body.classList.remove(this.#fe),this.#ue&&this.#ue.classList.remove(this.#de,this.#ge),this.#X=!0)}},tt=class{#Le=[];#Me=!1;#Ae=!1;#ke=[];#Se(){this.#Me&&Promise.all(this.#ke).then((()=>{this.#Ae=!0,this.#Be(!1)})).catch((e=>{console.error("[TinyDomReadyManager] Promise rejected:",e)}))}#Be(e){this.#Le.filter((t=>t.domOnly===e)).sort(((e,t)=>t.priority-e.priority)).forEach((e=>this.#Ne(e))),this.#Le=this.#Le.filter((t=>!(t.once&&(!e||t.domOnly))))}#Ne(e){if("function"==typeof e.filter)try{if(!e.filter())return}catch(e){return void console.warn("[TinyDomReadyManager] Filter error:",e)}try{e.fn()}catch(e){console.error("[TinyDomReadyManager] Handler error:",e)}}_markDomReady(){this.#Me=!0,this.#Be(!0),this.#Se()}init(){if(this.#Me)throw new Error("[TinyDomReadyManager] init() has already been called.");"interactive"===document.readyState||"complete"===document.readyState?this._markDomReady():document.addEventListener("DOMContentLoaded",(()=>this._markDomReady()))}addPromise(e){if(!(e instanceof Promise))throw new TypeError("[TinyDomReadyManager] promise must be a valid Promise.");this.#Ae||(this.#ke.push(e),this.#Me&&this.#Se())}onReady(e,{once:t=!0,priority:r=0,filter:n=null,domOnly:i=!1}={}){if("function"!=typeof e)throw new TypeError("[TinyDomReadyManager] fn must be a function.");const o={fn:e,once:t,priority:r,filter:n,domOnly:i};if(i&&this.#Me)return this.#Ne(o),void(t||this.#Le.push(o));!i&&this.#Ae?this.#Ne(o):this.#Le.push(o)}isReady(){return this.#Ae}isDomReady(){return this.#Me}},rt=class{#Oe=!1;#Ie=!1;#Re=null;#Pe=100;#Fe=null;#He;constructor({audio:e=null,defaultIcon:t=null,bodyLimit:r=100,defaultOnClick:n=function(e){e.preventDefault(),window.focus&&window.focus(),this.close()}}={}){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("audio must be an instance of HTMLAudioElement or null.");if(null!==t&&"string"!=typeof t)throw new TypeError("defaultIcon must be a string or null.");if(!Number.isFinite(r)||r<0)throw new TypeError("bodyLimit must be a non-negative number.");if("function"!=typeof n)throw new TypeError("defaultOnClick must be a function.");this.#Re="string"!=typeof e?e:new Audio(e),this.#Fe=t,this.#Pe=r,this.#He=n}requestPerm(){const e=this;return new Promise(((t,r)=>{e.isCompatible()?"default"===Notification.permission?Notification.requestPermission().then((r=>{this.#Ie=!0,e.#Oe="granted"===r,t(e.#Oe)})).catch(r):(this.#Ie=!0,e.#Oe="granted"===Notification.permission,t(e.#Oe)):(this.#Ie=!0,e.#Oe=!1,t(!1))}))}isCompatible(){return"Notification"in window}send(e,t={}){if(!this.#Ie)throw new Error("You must call requestPerm() before sending a notification.");if("string"!=typeof e)throw new TypeError("title must be a string.");if("object"!=typeof t||null===t)throw new TypeError("config must be a non-null object.");if(!this.#Oe)return null;const{icon:r=this.#Fe||void 0,vibrate:n=[200,100,200]}=t,i={...t};"string"==typeof r&&(i.icon=r),Array.isArray(n)&&(i.vibrate=n),"string"==typeof i.body&&(i.body=F(i.body,this.#Pe));const o=new Notification(e,i);return o.addEventListener("show",(()=>{this.#Re instanceof HTMLAudioElement&&(this.#Re.currentTime=0,this.#Re.play().catch((e=>console.error(e))))})),"function"==typeof this.#He&&o.addEventListener("click",this.#He),o}wasPermissionRequested(){return this.#Ie}isAllowed(){return this.#Oe}getAudio(){return this.#Re}setAudio(e){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("sound must be an instance of HTMLAudioElement or null.");this.#Re="string"!=typeof e?e:new Audio(e)}getBodyLimit(){return this.#Pe}setBodyLimit(e){if(!Number.isFinite(e)||e<0)throw new TypeError("bodyLimit must be a non-negative number.");this.#Pe=e}getDefaultAvatar(){return this.#Fe}setDefaultAvatar(e){if("string"!=typeof e&&null!==e)throw new TypeError("defaultIcon must be a string or null.");this.#Fe=e}getDefaultOnClick(){return this.#He}setDefaultOnClick(e){if("function"!=typeof e)throw new TypeError("defaultOnClick must be a function.");this.#He=e}}})(),window.TinyEssentials=n})();
|
|
2
|
+
(()=>{var e={133:()=>{},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*m}},287:(e,t,r)=>{"use strict";var n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(j(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var i=function(e){if(l.isBuffer(e)){var t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||$(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),a(e<0?0:0|p(e))}function f(e){for(var t=e.length<0?0:0|p(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _(this,t,r);case"utf8":case"utf-8":return D(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var h=!0,f=0;f<l;f++)if(u(e,o+f)!==u(t,f)){h=!1;break}if(h)return o}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if($(a))return s;e[r+s]=a}return s}function E(e,t,r,n){return W(H(t,e.length-r),e,r,n)}function T(e,t,r,n){return W(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return W(F(t),e,r,n)}function x(e,t,r,n){return W(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function L(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function D(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(j(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),j(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(j(o,Uint8Array))i+o.length>n.length?l.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?D(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(j(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function _(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=U[e[o]];return i}function M(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(e,t,r,n,o){return t=+t,r>>>=0,o||I(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function R(e,t,r,n,o){return t=+t,r>>>=0,o||I(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(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]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=l.isBuffer(e)?e:l.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var O=/[^+/0-9A-Za-z-_]/g;function H(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},370:()=>{},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),c=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(l(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],u=!1,c=-1;function h(){u&&a&&(u=!1,a.length?l=a.concat(l):c=-1,l.length&&f())}function f(){if(!u){var e=s(h);u=!0;for(var t=l.length;t;){for(a=l,l=[];++c<t;)a&&a[c].run();c=-1,t=l.length}a=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new d(e,t)),1!==l.length||u||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},975:(e,t,r)=>{"use strict";var n=r(606);function i(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function o(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var s={resolve:function(){for(var e,t="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=n.cwd()),a=e),i(a),0!==a.length&&(t=a+"/"+t,r=47===a.charCodeAt(0))}return t=o(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(i(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=o(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return i(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var r=arguments[t];i(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(i(e),i(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var n=e.length,o=n-r,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var l=t.length-a,u=o<l?o:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===t.charCodeAt(a+h))return t.slice(a+h+1);if(0===h)return t.slice(a+h)}else o>u&&(47===e.charCodeAt(r+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(r+h);if(f!==t.charCodeAt(a+h))break;47===f&&(c=h)}var d="";for(h=r+c+1;h<=n;++h)h!==n&&47!==e.charCodeAt(h)||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(a+c):(a+=c,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(i(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!o){n=s;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');i(e);var r,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){n=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(u===t.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=l))}return n===o?o=l:-1===o&&(o=e.length),e.slice(n,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){n=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(n,o)},extname:function(e){i(e);for(var t=-1,r=0,n=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===n&&(o=!1,n=a+1),46===l?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){r=a+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){i(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,n=e.charCodeAt(0),o=47===n;o?(t.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=r;--c)if(47!==(n=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===n?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(t.base=t.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(t.name=e.slice(1,s),t.base=e.slice(1,l)):(t.name=e.slice(a,s),t.base=e.slice(a,l)),t.ext=e.slice(s,l)),a>0?t.dir=e.slice(0,a-1):o&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{ColorSafeStringify:()=>W,TinyAfterScrollWatcher:()=>gt,TinyDomReadyManager:()=>pt,TinyDragDropDetector:()=>Ie,TinyDragger:()=>dt,TinyHtml:()=>De,TinyLevelUp:()=>i,TinyNotifications:()=>mt,TinyNotifyCenter:()=>J,TinyPromiseQueue:()=>j,TinyRateLimiter:()=>$,TinyToastNotify:()=>q,addAiMarkerShortcut:()=>O,areElsCollBottom:()=>Z,areElsCollLeft:()=>ee,areElsCollPerfBottom:()=>ne,areElsCollPerfLeft:()=>ie,areElsCollPerfRight:()=>oe,areElsCollPerfTop:()=>re,areElsCollRight:()=>te,areElsCollTop:()=>K,areElsColliding:()=>se,areElsPerfColliding:()=>ae,areHtmlElsColliding:()=>Ae,arraySortPositions:()=>o,asyncReplace:()=>t,backupFile:()=>Qe,checkObj:()=>w,clearDirectory:()=>We,clearDirectoryAsync:()=>st,cloneObjTypeOrder:()=>g,countObj:()=>v,dirExists:()=>$e,dirSize:()=>Xe,dirSizeAsync:()=>ht,documentIsFullScreen:()=>T,ensureCopyFile:()=>Je,ensureDirectory:()=>Fe,exitFullScreen:()=>D,extendObjType:()=>p,fetchJson:()=>X,fileExists:()=>je,fileSize:()=>Ye,fileSizeAsync:()=>ct,formatBytes:()=>B,formatCustomTimer:()=>l,formatDayTimer:()=>c,formatTimer:()=>u,genFibonacciSeq:()=>I,getAge:()=>N,getElsCollDetails:()=>me,getElsCollDirDepth:()=>pe,getElsCollOverlap:()=>ce,getElsCollOverlapPos:()=>he,getElsColliding:()=>le,getElsPerfColliding:()=>ue,getElsRelativeCenterOffset:()=>de,getHtmlElBorders:()=>ke,getHtmlElBordersWidth:()=>Se,getHtmlElMargin:()=>_e,getHtmlElPadding:()=>Me,getLatestBackupPath:()=>Ke,getRectCenter:()=>fe,getSimplePerc:()=>M,getTimeDuration:()=>a,installWindowHiddenScript:()=>Q,isDirEmpty:()=>Ue,isDirEmptyAsync:()=>at,isFullScreenMode:()=>x,isInViewport:()=>Ne,isJsonObject:()=>E,isScreenFilled:()=>C,isScrolledIntoView:()=>Be,listDirs:()=>Ge,listDirsAsync:()=>ut,listFiles:()=>ze,listFilesAsync:()=>lt,objType:()=>b,offFullScreenChange:()=>k,onFullScreenChange:()=>S,readBase64Blob:()=>z,readFileBlob:()=>V,readJsonBlob:()=>G,readJsonFile:()=>Oe,renameFileAddPrefixSuffix:()=>rt,renameFileBatch:()=>et,renameFileNormalizeCase:()=>nt,renameFilePadNumbers:()=>it,renameFileRegex:()=>tt,reorderObjTypeOrder:()=>m,requestFullScreen:()=>L,restoreLatestBackup:()=>Ze,ruleOfThree:()=>_,safeTextTrim:()=>H,saveJsonFile:()=>Y,shuffleArray:()=>s,toTitleCase:()=>P,toTitleCaseLowerFirst:()=>R,tryDeleteFile:()=>qe,writeJsonFile:()=>He,writeTextFile:()=>Ve});var e={};async function t(e,t,r){const n=[];e.replace(t,((e,...t)=>(n.push(r(e,...t)),e)));const i=await Promise.all(n);return e.replace(t,(()=>i.shift()))}r.r(e),r.d(e,{areElsCollBottom:()=>Z,areElsCollLeft:()=>ee,areElsCollPerfBottom:()=>ne,areElsCollPerfLeft:()=>ie,areElsCollPerfRight:()=>oe,areElsCollPerfTop:()=>re,areElsCollRight:()=>te,areElsCollTop:()=>K,areElsColliding:()=>se,areElsPerfColliding:()=>ae,getElsCollDetails:()=>me,getElsCollDirDepth:()=>pe,getElsCollOverlap:()=>ce,getElsCollOverlapPos:()=>he,getElsColliding:()=>le,getElsPerfColliding:()=>ue,getElsRelativeCenterOffset:()=>de,getRectCenter:()=>fe});const i=class{constructor(e,t){if("number"!=typeof e||Number.isNaN(e))throw new Error("giveExp must be a valid number");if("number"!=typeof t||Number.isNaN(t))throw new Error("expLevel must be a valid number");this.giveExp=e,this.expLevel=t}createUser(){return{exp:0,level:1,totalExp:0}}validateUser(e){if("number"!=typeof e.exp||Number.isNaN(e.exp))throw new Error("exp must be a valid number");if("number"!=typeof e.level||Number.isNaN(e.level))throw new Error("level must be a valid number");if(e.level<1)throw new Error("level must be at least 1");if("number"!=typeof e.totalExp||Number.isNaN(e.totalExp))throw new Error("totalExp must be a valid number")}isValidUser(e){return!("number"!=typeof e.exp||Number.isNaN(e.exp)||"number"!=typeof e.level||Number.isNaN(e.level)||e.level<1||"number"!=typeof e.totalExp||Number.isNaN(e.totalExp))}getGiveExpBase(){if("number"!=typeof this.giveExp||Number.isNaN(this.giveExp))throw new Error("giveExp must be a valid number");return this.giveExp}getExpLevelBase(){if("number"!=typeof this.expLevel||Number.isNaN(this.expLevel))throw new Error("expLevel must be a valid number");return this.expLevel}expValidator(e){const t=this.getExpLevelBase();this.validateUser(e);let r=0;const n=t*e.level;return e.exp>=n&&(e.level++,r=e.exp-n,e.exp=0,r>0)?this.give(e,r,"extra"):e.exp<1&&e.level>1&&(e.level--,r=Math.abs(e.exp),e.exp=t*e.level,r>0)?this.remove(e,r,"extra"):e}getTotalExp(e){this.validateUser(e);let t=0;for(let r=1;r<=e.level;r++)t+=this.getExpLevelBase()*r;return t+=e.exp,t}expGenerator(e=1){if("number"!=typeof e||Number.isNaN(e))throw new Error("multi must be a valid number");return Math.floor(Math.random()*this.getGiveExpBase())*e}getMissingExp(e){return this.getProgress(e)-e.exp}progress(e){return this.getProgress(e)}getProgress(e){return this.validateUser(e),this.getExpLevelBase()*e.level}set(e,t){if("number"!=typeof t||Number.isNaN(t))throw new Error("value must be a valid number");return e.exp=t,this.expValidator(e),e.totalExp=this.getTotalExp(e),e}give(e,t=0,r="add",n=1){if("number"!=typeof n||Number.isNaN(n))throw new Error("multi must be a valid number");if("number"!=typeof t||Number.isNaN(t))throw new Error("extraExp must be a valid number");if("string"!=typeof r)throw new Error("type must be a valid string");return"add"===r?e.exp+=this.expGenerator(n)+t:"extra"===r&&(e.exp+=t),this.expValidator(e),e.totalExp=this.getTotalExp(e),e}remove(e,t=0,r="add",n=1){if("number"!=typeof n||Number.isNaN(n))throw new Error("multi must be a valid number");if("number"!=typeof t||Number.isNaN(t))throw new Error("extraExp must be a valid number");if("string"!=typeof r)throw new Error("type must be a valid string");return"add"===r?e.exp-=this.expGenerator(n)+t:"extra"===r&&(e.exp-=t),this.expValidator(e),e.totalExp=this.getTotalExp(e),e}};function o(e,t=!1){return t?function(t,r){return t[e]>r[e]?-1:t[e]<r[e]?1:0}:function(t,r){return t[e]<r[e]?-1:t[e]>r[e]?1:0}}function s(e){let t,r=e.length;for(;0!==r;)t=Math.floor(Math.random()*r),r--,[e[r],e[t]]=[e[t],e[r]];return e}function a(e=new Date,t="asSeconds",r=null){if(e instanceof Date){const n=r instanceof Date?r:new Date,i=e.getTime()-n.getTime();switch(t){case"asMilliseconds":return i;case"asSeconds":default:return i/1e3;case"asMinutes":return i/6e4;case"asHours":return i/36e5;case"asDays":return i/864e5}}return null}function l(e,t="seconds",r="{time}"){e=Math.max(0,Math.floor(e));const n=["seconds","minutes","hours","days","months","years"].indexOf(t),i=n>=5,o=n>=4,s=n>=3,a=n>=2,l=n>=1,u=n>=0,c={years:i?0:NaN,months:o?0:NaN,days:s?0:NaN,hours:a?0:NaN,minutes:l?0:NaN,seconds:u?0:NaN,total:NaN};let h=e;if(i||o||s){const e=new Date(1980,0,1),t=new Date(e.getTime()+1e3*h),r=new Date(e);if(i)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=t.getTime();)r.setFullYear(r.getFullYear()+1),c.years++;if(o)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=t.getTime();)r.setMonth(r.getMonth()+1),c.months++;if(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=t.getTime();)r.setDate(r.getDate()+1),c.days++;h=Math.floor((t.getTime()-r.getTime())/1e3)}a&&(c.hours=Math.floor(h/3600),h%=3600),l&&(c.minutes=Math.floor(h/60),h%=60),u&&(c.seconds=h);const f={seconds:u?e:NaN,minutes:l?e/60:NaN,hours:a?e/3600:NaN,days:s?e/86400:NaN,months:o?12*c.years+c.months+(c.days||0)/30:NaN,years:i?c.years+(c.months||0)/12+(c.days||0)/365:NaN};c.total=+(f[t]||0).toFixed(2).replace(/\.00$/,"");const d=e=>{const t="string"==typeof e?parseInt(e):e;return Number.isNaN(t)?"NaN":String(t).padStart(2,"0")},p=[a?d(c.hours):null,l?d(c.minutes):null,u?d(c.seconds):null].filter((e=>null!==e)).join(":");return r.replace(/\{years\}/g,String(c.years)).replace(/\{months\}/g,String(c.months)).replace(/\{days\}/g,String(c.days)).replace(/\{hours\}/g,d(c.hours)).replace(/\{minutes\}/g,d(c.minutes)).replace(/\{seconds\}/g,d(c.seconds)).replace(/\{time\}/g,p).replace(/\{total\}/g,String(c.total)).trim()}function u(e){return l(e,"hours","{hours}:{minutes}:{seconds}")}function c(e){return l(e,"days","{days}d {hours}:{minutes}:{seconds}")}var h=r(287);const f="undefined"!=typeof window&&void 0!==window.document,d={items:{},order:[]};function p(e,t){const r=[],n=Array.isArray(e)?e:Object.entries(e);for(const[e,i]of n)if(!d.items.hasOwnProperty(e)){d.items[e]=i;let n="number"==typeof t?t:-1;if(-1===n){const e=d.order.indexOf("object");n=e>-1?e:d.order.length}n=Math.min(Math.max(0,n),d.order.length),d.order.splice(n,0,e),r.push(e)}return r}function m(e){const t=[...d.order];return!!e.every((e=>t.includes(e)))&&(d.order=e.slice(),!0)}function g(){return[...d.order]}const y=e=>{if(null===e)return"null";for(const t of d.order)if("function"!=typeof d.items[t]||d.items[t](e))return t;return"unknown"};function b(e,t){if(void 0===e)return null;const r=y(e);return"string"==typeof t?r===t.toLowerCase():r}function w(e){const t={valid:null,type:null};for(const r of d.order)if("function"==typeof d.items[r]){const n=d.items[r](e);if(n){t.valid=n,t.type=r;break}}return t}function v(e){return Array.isArray(e)?e.length:b(e,"object")?Object.keys(e).length:0}function E(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}p([["undefined",e=>void 0===e],["null",e=>null===e],["boolean",e=>"boolean"==typeof e],["number",e=>"number"==typeof e&&!Number.isNaN(e)],["bigint",e=>"bigint"==typeof e],["string",e=>"string"==typeof e],["symbol",e=>"symbol"==typeof e],["function",e=>"function"==typeof e],["array",e=>Array.isArray(e)]]),f||p([["buffer",e=>void 0!==h.hp&&h.hp.isBuffer(e)]]),f&&p([["file",e=>"undefined"!=typeof File&&e instanceof File]]),p([["date",e=>e instanceof Date],["regexp",e=>e instanceof RegExp],["map",e=>e instanceof Map],["set",e=>e instanceof Set],["weakmap",e=>e instanceof WeakMap],["weakset",e=>e instanceof WeakSet],["promise",e=>e instanceof Promise]]),f&&p([["htmlelement",e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement]]),p([["object",e=>E(e)]]);const T=()=>!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen),C=()=>window.innerHeight===screen.height&&window.innerWidth===screen.width,x=()=>T()||C(),L=e=>new Promise((async(t,r)=>{const n=document.documentElement;try{n.requestFullscreen?await n.requestFullscreen(e):n.mozRequestFullScreen?n.mozRequestFullScreen(e):n.webkitRequestFullScreen?n.webkitRequestFullScreen(e):n.msRequestFullscreen&&n.msRequestFullscreen(e),t()}catch(e){r(e)}})),D=()=>new Promise(((e,t)=>{if(document.exitFullscreen)document.exitFullscreen().then(e).catch(t);else try{if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{if(!document.msExitFullscreen)throw new Error("Fullscreen API is not supported");document.msExitFullscreen()}e()}catch(e){t(e)}})),A=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],S=(e,t)=>{A.forEach((r=>{document.addEventListener(r,e,t)}))},k=(e,t)=>{A.forEach((r=>{document.removeEventListener(r,e,t)}))};function _(e,t,r,n=!1){return n?Number(e*t)/r:Number(r*t)/e}function M(e,t){return e*(t/100)}function N(e=0,t=null){if(null!=e&&0!==e){const r=new Date(e);if(Number.isNaN(r.getTime()))return null;const n=t instanceof Date?t:new Date;let i=n.getFullYear()-r.getFullYear();const o=n.getMonth(),s=r.getMonth(),a=n.getDate(),l=r.getDate();return(o<s||o===s&&a<l)&&i--,Math.abs(i)}return null}function B(e,t=null,r=null){if("number"!=typeof e||e<0)return{unit:null,value:null};if(0===e)return{unit:"Bytes",value:0};const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=r&&n.includes(r)?n.indexOf(r):n.length-1,o=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i);let s=e/Math.pow(1024,o);if(null!==t){const e=t<0?0:t;s=parseFloat(s.toFixed(e))}return{unit:n[o],value:s}}function I({baseValues:e=[0,1],length:t=10,combiner:r=(e,t)=>e+t}={}){if(!Array.isArray(e)||2!==e.length)throw new Error("baseValues must be an array of exactly two numbers");const n=[...e.slice(0,2)];for(let e=2;e<t;e++){const t=r(n[e-2],n[e-1],e);n.push(t)}return n}function P(e){return e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()))}function R(e){const t=e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));return t.charAt(0).toLowerCase()+t.slice(1)}function O(e="a"){"undefined"!=typeof HTMLElement?document.addEventListener("keydown",(function(t){if(t.ctrlKey&&t.altKey&&t.key.toLowerCase()===e){if(t.preventDefault(),!document.body)return void console.warn("[AiMarkerShortcut] <body> element not found. Cannot toggle class. Ensure the DOM is fully loaded when using the shortcut.");document.body.classList.toggle("detect-made-by-ai")}})):console.error("[AiMarkerShortcut] Environment does not support the DOM. This function must be run in a browser.")}function H(e,t,r=.6){if("string"!=typeof e)throw new TypeError("Expected a string for 'text', but received "+typeof e);if(!Number.isInteger(t)||t<=0)throw new TypeError(`Expected 'limit' to be a positive integer, but received ${t}`);if("number"!=typeof r||r<0||r>1)throw new TypeError(`Expected 'safeCutZone' to be a number between 0 and 1, but received ${r}`);let n=e.trim();if(n.length>t){const e=n.lastIndexOf(" ",t);return e>0&&e>=t*r?`${n.substring(0,e).trim()}...`:`${n.substring(0,t).trim()}...`}return n}class F{#e;static#t={default:{reset:"[0m",key:"[36m",string:"[32m",string_url:"[34m",string_bool:"[35m",string_number:"[33m",number:"[33m",boolean:"[35m",null:"[1;30m",special:"[31m",func:"[90m"},solarized:{reset:"[0m",key:"[38;5;37m",string:"[38;5;136m",string_url:"[38;5;33m",string_bool:"[38;5;166m",string_number:"[38;5;136m",number:"[38;5;136m",boolean:"[38;5;166m",null:"[38;5;241m",special:"[38;5;160m",func:"[38;5;244m"},monokai:{reset:"[0m",key:"[38;5;81m",string:"[38;5;114m",string_url:"[38;5;75m",string_bool:"[38;5;204m",string_number:"[38;5;221m",number:"[38;5;221m",boolean:"[38;5;204m",null:"[38;5;241m",special:"[38;5;160m",func:"[38;5;102m"}};constructor(e={}){this.#e={...F.#t.default,...e}}#r(e,t){const r=[];e=(e=(e=e.replace(/(?<!")\b(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b(?!")/g,`${t.number}$1${t.reset}`)).replace(/"([^"]+)":/g,((e,t)=>{const n=`___KEY${r.length}___`;return r.push({marker:n,key:t}),`${n}:`}))).replace(/"(?:\\.|[^"\\])*?"/g,(e=>{const r=e.slice(1,-1);return/^(https?|ftp):\/\/[^\s]+$/i.test(r)?`${t.string_url}${e}${t.reset}`:/^(true|false|null)$/.test(r)?`${t.string_bool}${e}${t.reset}`:/^-?\d+(\.\d+)?([eE][+-]?\d+)?$/.test(r)?`${t.string_number}${e}${t.reset}`:`${t.string}${e}${t.reset}`}));for(const{marker:n,key:i}of r){const r=new RegExp(n,"g");e=e.replace(r,`${t.key}"${i}"${t.reset}`)}return(e=(e=(e=(e=e.replace(/(?<!")\b(true|false)\b(?!")/g,`${t.boolean}$1${t.reset}`)).replace(/(?<!")\bnull\b(?!")/g,`${t.null}null${t.reset}`)).replace(/\[Circular\]/g,`${t.special}[Circular]${t.reset}`)).replace(/\[undefined\]/g,`${t.special}[undefined]${t.reset}`)).replace(/"function.*?[^\\]"/gs,`${t.func}$&${t.reset}`)}colorize(e,t={}){const r={...this.#e,...t};return this.#r(e,r)}getColors(){return{...this.#e}}updateColors(e){Object.assign(this.#e,e)}resetColors(){this.#e={...F.#t.default}}loadColorPreset(e){const t=F.#t[e];if(!t)throw new Error(`Preset "${e}" not found.`);this.#e={...t}}saveColorPreset(e,t){F.#t[e]={...t}}getAvailablePresets(){return Object.keys(F.#t)}}const W=F,j=class{#n=[];#i=!1;#o={};#s=new Set;isRunning(){return this.#i}async#a(e){if(e&&"function"==typeof e.task&&"function"==typeof e.resolve&&"function"==typeof e.reject){const{task:t,resolve:r,reject:n,delay:i,id:o}=e;try{if(o&&this.#s.has(o))return n(new Error("The function was canceled on TinyPromiseQueue.")),this.#s.delete(o),this.#i=!1,void this.#l();i&&o&&await new Promise((e=>{const t=setTimeout((()=>{delete this.#o[o],e(null)}),i);this.#o[o]=t})),r(await t())}catch(e){n(e)}finally{this.#i=!1,this.#l()}}}async#u(){const e=[];for(;this.#n.length&&"POINT_MARKER"===this.#n[0]?.marker;)e.push(this.#n.shift());if(0===e.length)return this.#i=!1,void this.#l();await Promise.all(e.map((({task:e,resolve:t,reject:r,id:n})=>new Promise((async i=>{if(n&&this.#s.has(n))return this.#s.delete(n),r(new Error("The function was canceled on TinyPromiseQueue.")),void i(!0);await e().then(t).catch(r),i(!0)}))))),this.#i=!1,this.#l()}async#l(){if(!this.#i&&0!==this.#n.length)if(this.#i=!0,"string"!=typeof this.#n[0]?.marker||"POINT_MARKER"!==this.#n[0]?.marker){const e=this.#n.shift();this.#a(e)}else this.#u()}getIndexById(e){return this.#n.findIndex((t=>t.id===e))}getQueuedIds(){return this.#n.map(((e,t)=>({index:t,id:e.id}))).filter((e=>"string"==typeof e.id))}reorderQueue(e,t){if("number"!=typeof e||"number"!=typeof t||e<0||t<0||e>=this.#n.length||t>=this.#n.length)return;const[r]=this.#n.splice(e,1);this.#n.splice(t,0,r)}async enqueuePoint(e,t){if("function"!=typeof e)return Promise.reject(new Error("Task must be a function returning a Promise."));if(void 0!==t&&"string"!=typeof t)throw new Error('The "id" parameter must be a string.');return this.#i?new Promise(((r,n)=>{this.#n.push({marker:"POINT_MARKER",task:e,resolve:r,reject:n,id:t}),this.#l()})):e()}enqueue(e,t,r){if("function"!=typeof e)return Promise.reject(new Error("Task must be a function returning a Promise."));if(void 0!==t&&("number"!=typeof t||t<0))return Promise.reject(new Error("Delay must be a positive number or undefined."));if(void 0!==r&&"string"!=typeof r)throw new Error('The "id" parameter must be a string.');return new Promise(((n,i)=>{this.#n.push({task:e,resolve:n,reject:i,id:r,delay:t}),this.#l()}))}cancelTask(e){if("string"!=typeof e)throw new Error('The "id" parameter must be a string.');let t=!1;e in this.#o&&(clearTimeout(this.#o[e]),delete this.#o[e],t=!0);const r=this.getIndexById(e);if(-1!==r){const[e]=this.#n.splice(r,1);e?.reject?.(new Error("The function was canceled on TinyPromiseQueue.")),t=!0}return t&&this.#s.add(e),t}},$=class{#c=null;#h=null;#f=null;#d=null;#p=null;#m=null;groupData=new Map;lastSeen=new Map;userToGroup=new Map;groupFlags=new Map;groupTTL=new Map;#g=null;setOnMemoryExceeded(e){if("function"!=typeof e)throw new Error("onMemoryExceeded must be a function");this.#g=e}clearOnMemoryExceeded(){this.#g=null}#y=null;setOnGroupExpired(e){if("function"!=typeof e)throw new Error("onGroupExpired must be a function");this.#y=e}clearOnGroupExpired(){this.#y=null}constructor({maxHits:e,interval:t,cleanupInterval:r,maxIdle:n=3e5,maxMemory:i=1e5}){const o=e=>"number"==typeof e&&Number.isFinite(e)&&e>=1&&Number.isInteger(e),s=o(e),a=o(t),l=o(r),u=o(n);if(!s&&!a)throw new Error("RateLimiter requires at least one valid option: 'maxHits' or 'interval'.");if(void 0!==e&&!s)throw new Error("'maxHits' must be a positive integer if defined.");if(void 0!==t&&!a)throw new Error("'interval' must be a positive integer in milliseconds if defined.");if(void 0!==r&&!l)throw new Error("'cleanupInterval' must be a positive integer in milliseconds if defined.");if(!u)throw new Error("'maxIdle' must be a positive integer in milliseconds.");if("number"==typeof i&&Number.isFinite(i)&&i>0)this.#c=Math.floor(i);else{if(null!=i)throw new Error("maxMemory must be a positive number or null");this.#c=null}this.#f=s?e:null,this.#d=a?t:null,this.#p=l?r:null,this.#m=n,null!==this.#p&&(this.#h=setInterval((()=>this._cleanup()),this.#p))}isGroupId(e){const t=this.groupFlags.get(e);return"boolean"==typeof t&&t}getUsersInGroup(e){const t=[];for(const[r,n]of this.userToGroup.entries())n===e&&t.push(r);return t}setGroupTTL(e,t){if("number"!=typeof t||!Number.isFinite(t)||t<=0)throw new Error("TTL must be a positive number in milliseconds");this.groupTTL.set(e,t)}getGroupTTL(e){return this.groupTTL.get(e)??null}deleteGroupTTL(e){this.groupTTL.delete(e)}assignToGroup(e,t){const r=this.userToGroup.get(e);if(r&&r!==t)throw new Error(`User ${e} is already assigned to group ${r}`);if(r===t)return;const n=this.groupData.get(e);if(this.isGroupId(e)){for(const[r,n]of this.userToGroup.entries())n===e&&this.userToGroup.set(r,t);this.userToGroup.delete(e)}else this.userToGroup.set(e,t);if(!n)return;const i=this.groupData.get(t);if(i)for(const e of n)i.push(e);else{const e=[];for(const t of n)e.push(t);this.groupData.set(t,e)}this.lastSeen.set(t,Date.now()),this.groupFlags.delete(e),this.groupData.delete(e),this.lastSeen.delete(e),this.groupTTL.delete(e),this.groupFlags.set(t,!0)}getGroupId(e){return this.userToGroup.get(e)||e}hit(e){const t=this.getGroupId(e),r=Date.now();this.groupData.has(t)||(this.groupData.set(t,[]),this.groupFlags.set(t,!1));const n=this.groupData.get(t);if(!n)throw new Error(`No data found for groupId: ${t}`);if(n.push(r),this.lastSeen.set(t,r),null!==this.#d){const e=r-this.getInterval();for(;n.length&&n[0]<e;)n.shift()}null!==this.#c&&"number"==typeof this.#c&&n.length>this.#c&&(n.splice(0,n.length-this.#c),"function"==typeof this.#g&&this.#g(t))}isRateLimited(e){const t=this.getGroupId(e);if(!this.groupData.has(t))return!1;const r=this.groupData.get(t);if(!r)throw new Error(`No data found for groupId: ${t}`);if(null!==this.#d){const e=Date.now()-this.getInterval();let t=0;for(let n=r.length-1;n>=0&&r[n]>e;n--)t++;return null!==this.#f?t>this.getMaxHits():t>0}return null!==this.#f&&r.length>this.getMaxHits()}resetGroup(e){this.groupFlags.delete(e),this.groupData.delete(e),this.lastSeen.delete(e),this.groupTTL.delete(e)}reset(e){return this.resetUserGroup(e)}resetUserGroup(e){this.userToGroup.delete(e)}setData(e,t){if(!Array.isArray(t))throw new Error("timestamps must be an array of numbers.");for(const e of t)if("number"!=typeof e||!Number.isFinite(e))throw new Error("All timestamps must be finite numbers.");this.groupData.has(e)||this.groupFlags.set(e,!1),this.groupData.set(e,t),this.lastSeen.set(e,Date.now())}hasData(e){return this.groupData.has(e)}getData(e){return this.groupData.get(e)||[]}getMaxIdle(){if("number"!=typeof this.#m||!Number.isFinite(this.#m)||this.#m<0)throw new Error("'maxIdle' must be a non-negative finite number.");return this.#m}setMaxIdle(e){if("number"!=typeof e||!Number.isFinite(e)||e<0)throw new Error("'maxIdle' must be a non-negative finite number.");this.#m=e}_cleanup(){const e=Date.now();for(const[t,r]of this.lastSeen.entries())e-r>(this.getGroupTTL(t)??this.getMaxIdle())&&(this.groupFlags.delete(t),this.groupData.delete(t),this.lastSeen.delete(t),this.groupTTL.delete(t),"function"==typeof this.#y&&this.#y(t))}getActiveGroups(){return Array.from(this.groupData.keys())}getAllUserMappings(){return Object.fromEntries(this.userToGroup)}getInterval(){if("number"!=typeof this.#d||!Number.isFinite(this.#d))throw new Error("'interval' is not a valid finite number.");return this.#d}getMaxHits(){if("number"!=typeof this.#f||!Number.isFinite(this.#f))throw new Error("'maxHits' is not a valid finite number.");return this.#f}getTotalHits(e){const t=this.groupData.get(e);return Array.isArray(t)?t.length:0}getLastHit(e){const t=this.groupData.get(e);return t?.length?t[t.length-1]:null}getTimeSinceLastHit(e){const t=this.getLastHit(e);return null!==t?Date.now()-t:null}_calculateAverageSpacing(e){if(!Array.isArray(e)||e.length<2)return null;let t=0;for(let r=1;r<e.length;r++)t+=e[r]-e[r-1];return t/(e.length-1)}getAverageHitSpacing(e){return this._calculateAverageSpacing(this.groupData.get(e))}getMetrics(e){const t=this.groupData.get(e);if(!Array.isArray(t)||0===t.length)return{totalHits:0,lastHit:null,timeSinceLastHit:null,averageHitSpacing:null};const r=t.length,n=t[r-1];return{totalHits:r,lastHit:n,timeSinceLastHit:Date.now()-n,averageHitSpacing:this._calculateAverageSpacing(t)}}destroy(){this.#h&&clearInterval(this.#h),this._cleanup(),this.groupData.clear(),this.lastSeen.clear(),this.userToGroup.clear(),this.groupTTL.clear(),this.groupFlags.clear()}};class U{static getTemplate(){return'\n<div class="notify-overlay hidden">\n <div class="notify-center" id="notifCenter">\n <div class="header">\n <div>Notifications</div>\n <div class="options">\n <button class="clear-all" type="button">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 24 24"\n width="24"\n height="24"\n fill="currentColor"\n >\n <path\n d="M21.6 2.4a1 1 0 0 0-1.4 0L13 9.6l-1.3-1.3a1 1 0 0 0-1.4 0L3 15.6a1 1 0 0 0 0 1.4l4 4a1 1 0 0 0 1.4 0l7.3-7.3a1 1 0 0 0 0-1.4l-1.3-1.3 7.2-7.2a1 1 0 0 0 0-1.4zM6 17l3.5-3.5 1.5 1.5L7.5 18.5 6 17z"\n />\n </svg>\n </button>\n <button class="close">×</button>\n </div>\n </div>\n <div class="list"></div>\n </div>\n</div>\n\n<button class="notify-bell" aria-label="Open notifications">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n fill="currentColor"\n viewBox="0 0 24 24"\n >\n <path\n d="M12 2C10.3 2 9 3.3 9 5v1.1C6.7 7.2 5 9.4 5 12v5l-1 1v1h16v-1l-1-1v-5c0-2.6-1.7-4.8-4-5.9V5c0-1.7-1.3-3-3-3zm0 20c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z"\n />\n </svg>\n <span class="badge" id="notifBadge">0</span>\n</button>\n '}static insertTemplate(e="afterbegin"){document.body.insertAdjacentHTML(e,U.getTemplate())}#b;#w;#v;#E;#T;#C=0;#x=99;#L=300;#D=!1;#A=new WeakMap;#S(e){if(this.#A.delete(e),!(e instanceof HTMLElement))throw new Error("Invalid HTMLElement to clear.");e.classList.add("removing"),setTimeout((()=>{this.markAsRead(e),e.remove()}),this.#L)}#k(e){this.#C=Math.max(0,e),this.#v.setAttribute("data-value",String(this.#C)),this.#v.textContent=this.#C>this.#x?`${this.#x}+`:String(this.#C)}constructor(e={}){const{center:t=document.getElementById("notifCenter"),badge:r=document.getElementById("notifBadge"),button:n=document.querySelector(".notify-bell"),overlay:i=document.querySelector(".notify-overlay")}=e;if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "center" must be an HTMLElement. Got: ${t}`);if(!(i instanceof HTMLElement))throw new Error(`NotificationCenter: "overlay" must be an HTMLElement. Got: ${i}`);if(!(r instanceof HTMLElement))throw new Error(`NotificationCenter: "badge" must be an HTMLElement. Got: ${r}`);if(!(n instanceof HTMLElement))throw new Error(`NotificationCenter: "button" must be an HTMLElement. Got: ${n}`);const o=t?.querySelector(".clear-all"),s=t?.querySelector(".list")??null;if(!(s instanceof HTMLElement))throw new Error(`NotificationCenter: ".list" inside center must be an HTMLElement. Got: ${s}`);this.#b=t,this.#w=s,this.#v=r,this.#E=n,this.#T=i,this.#E.addEventListener("click",(()=>this.toggle())),this.#b.querySelector(".close")?.addEventListener("click",(()=>this.close())),o&&o.addEventListener("click",(()=>this.clear())),this.#T.addEventListener("click",(e=>{e.target===this.#T&&this.close()}))}setMarkAllAsReadOnClose(e){if("boolean"!=typeof e)throw new TypeError("Expected boolean for markAllAsReadOnClose, got "+typeof e);this.#D=e}setRemoveDelay(e){if("number"!=typeof e)throw new Error('NotificationCenter: "ms" must be an number.');this.#L=e}getItemMode(e){const t=this.getItem(e);return t?this.#A.get(t):null}getItem(e){const t=this.#w.children.item(e);if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "item" must be an HTMLElement. Got: ${t}`);return t}hasItem(e){return e>=0&&e<this.#w.children.length}markAsRead(e){const t=e instanceof HTMLElement?e:this.getItem(e);t.classList.contains("unread")&&(t.classList.remove("unread"),this.#k(this.#C-1))}add(e,t="text"){const r=document.createElement("div");r.className="item unread";let n=null,i=null,o=null,s=null;if("object"==typeof e&&null!==e?(n=e.title,i=e.message,o=e.avatar,s=e.onClick):i=e,o){const e=document.createElement("div");e.className="avatar",e.style.backgroundImage=`url("${o}")`,r.appendChild(e)}const a=document.createElement("div");if(a.className="content",n){const e=document.createElement("div");e.className="title",e.textContent=n,a.appendChild(e)}const l=document.createElement("div");l.className="message","html"===t?l.innerHTML=i:l.textContent=i,a.appendChild(l),"function"==typeof s&&(r.classList.add("clickable"),r.addEventListener("click",(e=>{e.target instanceof HTMLElement&&!e.target.closest(".notify-close")&&s(e)})));const u=document.createElement("button");u.className="notify-close",u.setAttribute("type","button"),u.innerHTML="×",u.addEventListener("click",(e=>{e.stopPropagation(),this.#S(r)})),r.append(a,u),this.#w.prepend(r),this.#A.set(r,t),this.#k(this.#C+1)}remove(e){const t=this.getItem(e);this.#S(t)}clear(){let e=!0;for(;e;){e=!1;const t=Array.from(this.#w.children);for(const r of t)r instanceof HTMLElement&&!r.classList.contains("removing")&&(this.#S(r),e=!0)}}open(){this.#T.classList.remove("hidden"),this.#b.classList.add("open")}close(){if(this.#T.classList.add("hidden"),this.#b.classList.remove("open"),this.#D){const e=this.#w.querySelectorAll(".item.unread");for(const t of e)t instanceof HTMLElement&&this.markAsRead(t)}}toggle(){this.#b.classList.contains("open")?this.close():this.open()}recount(){const e=this.#w.querySelectorAll(".item.unread").length;this.#k(e)}get count(){return this.#C}destroy(){this.#E?.removeEventListener("click",this.toggle),this.#b?.querySelector(".close")?.removeEventListener("click",this.close),this.#b?.querySelector(".clear-all")?.removeEventListener("click",this.clear),this.#T?.removeEventListener("click",this.close),this.clear(),this.#b?.remove(),this.#T?.remove(),this.#E?.remove(),this.#C=0,this.#A=new WeakMap}}const J=U,q=class{#_;#M;#N;#B;#I;#P;constructor(e="top",t="right",r=3e3,n=50,i=300,o=".notify-container"){this.#R(e),this.#O(t),this.#H(r,"baseDuration"),this.#H(n,"extraPerChar"),this.#H(i,"fadeOutDuration"),this.#_=e,this.#M=t,this.#N=r,this.#B=n,this.#I=i;const s=document.querySelector(`${o}.${e}.${t}`);s instanceof HTMLElement?this.#P=s:(this.#P=document.createElement("div"),this.#P.className=`notify-container ${e} ${t}`,document.body.appendChild(this.#P))}getContainer(){if(!(this.#P instanceof HTMLElement))throw new Error("Container is not a valid HTMLElement.");return this.#P}#R(e){if(!["top","bottom"].includes(e))throw new Error(`Invalid vertical direction "${e}". Expected "top" or "bottom".`)}#O(e){if(!["left","right","center"].includes(e))throw new Error(`Invalid horizontal position "${e}". Expected "left", "right" or "center".`)}#H(e,t){if("number"!=typeof e||e<0||!Number.isFinite(e))throw new Error(`Invalid value for "${t}": ${e}. Must be a non-negative finite number.`)}getY(){return this.#_}setY(e){this.#R(e);const t=this.getContainer();t.classList.remove(this.#_),t.classList.add(e),this.#_=e}getX(){return this.#M}setX(e){this.#O(e);const t=this.getContainer();t.classList.remove(this.#M),t.classList.add(e),this.#M=e}getBaseDuration(){return this.#N}setBaseDuration(e){this.#H(e,"baseDuration"),this.#N=e}getExtraPerChar(){return this.#B}setExtraPerChar(e){this.#H(e,"extraPerChar"),this.#B=e}getFadeOutDuration(){return this.#I}setFadeOutDuration(e){this.#H(e,"fadeOutDuration"),this.#I=e}show(e){let t="",r="",n=null,i=!1,o=null;const s=document.createElement("div");if(s.className="notify enter","string"==typeof e)t=e;else{if("object"!=typeof e||null===e||"string"!=typeof e.message)throw new Error("Invalid argument for show(): expected string or { message: string, title?: string, onClick?: function, html?: boolean, avatar?: string }");if(t=e.message,r="string"==typeof e.title?e.title:"",i=!0===e.html,o="string"==typeof e.avatar?e.avatar:null,void 0!==e.onClick){if("function"!=typeof e.onClick)throw new Error("onClick must be a function if defined");n=e.onClick,s.classList.add("clickable")}}const a=document.createElement("button");if(a.innerHTML="×",a.className="close",a.setAttribute("aria-label","Close"),a.addEventListener("mouseenter",(()=>{a.style.color="var(--notif-close-color-hover)"})),a.addEventListener("mouseleave",(()=>{a.style.color="var(--notif-close-color)"})),o){const e=document.createElement("img");e.src=o,e.alt="avatar",e.className="avatar",s.appendChild(e)}if(r){const e=document.createElement("strong");e.textContent=r,e.style.display="block",s.appendChild(e)}if(i){const e=document.createElement("div");e.innerHTML=t,s.appendChild(e)}else s.appendChild(document.createTextNode(t));s.appendChild(a),this.getContainer().appendChild(s);const l=this.#N+t.length*this.#B+this.#I;let u=!1;const c=()=>{u||(u=!0,s.classList.remove("enter","show"),s.classList.add("exit"),setTimeout((()=>s.remove()),this.#I))};"function"==typeof n&&s.addEventListener("click",(e=>{e.target!==a&&n(e,c)})),a.addEventListener("click",(e=>{e.stopPropagation(),c()})),setTimeout((()=>{s.classList.remove("enter"),s.classList.add("show")}),1),setTimeout((()=>c()),l)}destroy(){this.#P instanceof HTMLElement&&(this.#P.querySelectorAll(".notify").forEach((e=>e.remove())),this.#P.parentNode&&this.#P.parentNode.removeChild(this.#P),this.#P=null)}};function V(e,t){return new Promise(((r,n)=>{const i=new FileReader;i.onload=()=>{try{r(i.result)}catch(e){n(e)}},i.onerror=()=>{n(i.error)},i[t](e)}))}function z(e,t=!1){return new Promise(((r,n)=>{"string"!=typeof t&&"boolean"!=typeof t&&n(new TypeError("The isDataUrl parameter must be a boolean or a string.")),V(e,"readAsDataURL").then((e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const n=e.match(/^data:(.+);base64,(.*)$/);if(!n||!n[2])throw new Error("Invalid data URL format or missing Base64 content.");const[,i,o]=n;if(!/^[\w/+]+=*$/.test(o))throw new Error("Base64 content is malformed.");if("boolean"==typeof t)return r(t?e:o);if(!/^[\w-]+\/[\w.+-]+$/.test(t))throw new Error(`Invalid MIME type string: ${t}`);return r(`data:${t};base64,${o}`)})).catch(n)}))}function G(e){return new Promise(((t,r)=>V(e,"readAsText").then((e=>{if("string"!=typeof e)throw new TypeError("Expected file content to be a string.");const r=e.trim();if(0===r.length)throw new Error("File is empty or contains only whitespace.");const n=JSON.parse(r);if("object"!=typeof n||null===n)throw new Error("Parsed content is not a valid JSON object or array.");t(n)})).catch(r)))}function Y(e,t,r=2){const n=JSON.stringify(t,null,r),i=new Blob([n],{type:"application/json"}),o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}async function X(e,{method:t="GET",body:r,timeout:n=0,retries:i=0,headers:o={},signal:s=null}={}){if("string"!=typeof e||!e.startsWith("../")&&!e.startsWith("./")&&!e.startsWith("/")&&!e.startsWith("https://")&&!e.startsWith("http://"))throw new Error("Invalid URL: must be a valid http or https address.");if("string"!=typeof t||!t.trim())throw new Error("Invalid method: must be a non-empty string.");if(!s){if("number"!=typeof n||!Number.isFinite(n)||Number.isNaN(n)||n<0)throw new Error("Invalid timeout: must be a positive number.");if("number"!=typeof i||!Number.isFinite(i)||Number.isNaN(i)||i<0)throw new Error("Invalid retries: must be a positive number.")}const a=s?1:i+1;let l=null;for(let u=0;u<a;u++){const a=s?null:new AbortController,c=s||(a?.signal??null),h=!s&&n&&a?setTimeout((()=>a.abort()),n):null;try{const n=await fetch(e,{method:t.toUpperCase(),headers:{Accept:"application/json",...o},body:void 0!==r?E(r)?JSON.stringify(r):r:void 0,signal:c});if(h&&clearTimeout(h),!n.ok)throw new Error(`HTTP error: ${n.status} ${n.statusText}`);const i=n.headers.get("content-type")||"";if(!i.includes("application/json"))throw new Error(`Unexpected content-type: ${i}`);const s=await n.json();if(!Array.isArray(s)&&!E(s))throw new Error("Received invalid data instead of valid JSON.");return s}catch(e){if(l=e,s)break;u<i&&await new Promise((e=>setTimeout(e,300*(u+1))))}}throw new Error(`Failed to fetch JSON from "${e}"${l?`: ${l.message}`:"."}`)}function Q({element:e=document.body,hiddenClass:t="windowHidden",visibleClass:r="windowVisible",onVisible:n,onHidden:i}={}){if(!(e instanceof Element))throw new TypeError('"element" must be an instance of Element.');if("string"!=typeof t)throw new TypeError('"hiddenClass" must be a string.');if("string"!=typeof r)throw new TypeError('"visibleClass" must be a string.');if(void 0!==n&&"function"!=typeof n)throw new TypeError('"onVisible" must be a function if provided.');if(void 0!==i&&"function"!=typeof i)throw new TypeError('"onHidden" must be a function if provided.');const o=()=>{e.classList.remove(t),e.classList.remove(r)};let s=null;const a=["visibilitychange","mozvisibilitychange","webkitvisibilitychange","msvisibilitychange"],l=["hidden","mozHidden","webkitHidden","msHidden"];for(let e=0;e<l.length;e++)if(l[e]in document){s=l[e];break}const u=function(a){o();const l=a?.type,u=s&&document[s];["focus","focusin","pageshow"].includes(l)?(e.classList.add(r),n?.()):["blur","focusout","pagehide"].includes(l)||u?(e.classList.add(t),i?.()):(e.classList.add(r),n?.())};let c=()=>{};if(s){const e=a[l.indexOf(s)];document.addEventListener(e,u),window.addEventListener("focus",u),window.addEventListener("blur",u),c=()=>{document.removeEventListener(e,u),window.removeEventListener("focus",u),window.removeEventListener("blur",u),o()}}else"onfocusin"in document?(document.onfocusin=document.onfocusout=u,c=()=>{document.onfocusin=document.onfocusout=null,o()}):(window.onpageshow=window.onpagehide=window.onfocus=window.onblur=u,c=()=>{window.onpageshow=window.onpagehide=window.onfocus=window.onblur=null,o()});const h=new Event(s&&document[s]?"blur":"focus");return u(h),c}const K=(e,t)=>e.bottom<t.top,Z=(e,t)=>e.top>t.bottom,ee=(e,t)=>e.right<t.left,te=(e,t)=>e.left>t.right,re=(e,t)=>e.bottom<=t.top,ne=(e,t)=>e.top>=t.bottom,ie=(e,t)=>e.right<=t.left,oe=(e,t)=>e.left>=t.right,se=(e,t)=>!(ee(e,t)||te(e,t)||K(e,t)||Z(e,t)),ae=(e,t)=>!(ie(e,t)||oe(e,t)||re(e,t)||ne(e,t)),le=(e,t)=>ee(e,t)?"left":te(e,t)?"right":K(e,t)?"top":Z(e,t)?"bottom":null,ue=(e,t)=>ie(e,t)?"left":oe(e,t)?"right":re(e,t)?"top":ne(e,t)?"bottom":null,ce=(e,t)=>({overlapLeft:t.right-e.left,overlapRight:e.right-t.left,overlapTop:t.bottom-e.top,overlapBottom:e.bottom-t.top}),he=({overlapLeft:e=-1,overlapRight:t=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:e<t?"right":"left",dirY:r<n?"bottom":"top"}),fe=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function de(e,t){const r=e.left+e.width/2,n=e.top+e.height/2;return{x:t.left+t.width/2-r,y:t.top+t.height/2-n}}function pe(e,t){if(!ae(e,t))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:i,overlapBottom:o}=ce(e,t),{dirX:s,dirY:a}=he({overlapLeft:r,overlapRight:n,overlapTop:i,overlapBottom:o}),l=Math.min(r,n),u=Math.min(i,o);let c;return c=l<u?s:a,{inDir:c,dirX:s,dirY:a,depthX:l,depthY:u}}function me(e,t){const r=ae(e,t),n={in:null,x:null,y:null},i={y:null,x:null},o={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:a,overlapTop:l,overlapBottom:u}=ce(t,e);o.top=l,o.bottom=u,o.left=s,o.right=a;const c=Object.entries(o).filter((([,e])=>e>0)).sort(((e,t)=>e[1]-t[1])),{dirX:h,dirY:f}=he({overlapLeft:a,overlapRight:s,overlapTop:u,overlapBottom:l});return n.y=f,n.x=h,o.bottom<0?i.y="bottom":o.top<0&&(i.y="top"),o.left<0?i.x="left":o.right<0&&(i.x="right"),n.in=r?o.top===o.bottom&&o.bottom===o.left&&o.left===o.right?"center":c.length?c[0][0]:"top":null,{dirs:n,depth:o,isNeg:i}}const{areElsColliding:ge,areElsPerfColliding:ye,areElsCollTop:be,areElsCollBottom:we,areElsCollLeft:ve,areElsCollRight:Ee}=e,Te=new WeakMap,Ce=new WeakMap,xe={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class Le{static Utils={...e};static query(e){const t=document.querySelector(e);if(!t)throw new Error(`[TinyHtml] query(): No element found for selector "${e}".`);return new Le(t)}static queryAll(e){const t=document.querySelectorAll(e);return Le.toTinyElm([...t])}static getById(e){const t=document.getElementById(e);if(!t)throw new Error(`[TinyHtml] getById(): No element found with ID "${e}".`);return new Le(t)}static getByClassName(e){const t=document.getElementsByClassName(e);return Le.toTinyElm([...t])}static getByName(e){const t=document.getElementsByName(e);return Le.toTinyElm([...t])}static getByTagNameNS(e,t="http://www.w3.org/1999/xhtml"){const r=document.getElementsByTagNameNS(t,e);return Le.toTinyElm([...r])}get(){return this.#F}_getElement(e){if(!(this.#F instanceof Element||this.#F instanceof Window||this.#F instanceof Document))throw new Error(`[TinyHtml] Invalid Element in ${e}().`);return this.#F}static _preElemsTemplate(e,t,r,n){const i=e=>e.map((e=>{const i=e instanceof Le?e._getElement(t):e;let o=!1;for(const e of r)if(i instanceof e){o=!0;break}if(!o)throw new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${t}().`);return i}));return Array.isArray(e)?i(e):i([e])}static _preElemTemplate(e,t,r,n,i=!1){const o=e=>{const o=e[0];let s=o instanceof Le?o._getElement(t):o,a=!1;for(const e of r)if(s instanceof e){a=!0;break}if(i&&null==s&&(s=null,a=!0),!a)throw new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${t}().`);return s};if(!Array.isArray(e))return o([e]);if(e.length>1)throw new Error(`[TinyHtml] Invalid element amount in ${t}() (Received ${e.length}/1).`);return o(e)}static _preElems(e,t){return Le._preElemsTemplate(e,t,[Element],["Element"])}static _preElem(e,t){return Le._preElemTemplate(e,t,[Element],["Element"])}static _preNodeElems(e,t){return Le._preElemsTemplate(e,t,[Node],["Node"])}static _preNodeElem(e,t){return Le._preElemTemplate(e,t,[Node],["Node"])}static _preNodeElemWithNull(e,t){return Le._preElemTemplate(e,t,[Node],["Node"],!0)}static _preHtmlElems(e,t){return Le._preElemsTemplate(e,t,[HTMLElement],["HTMLElement"])}static _preHtmlElem(e,t){return Le._preElemTemplate(e,t,[HTMLElement],["HTMLElement"])}static _preInputElems(e,t){return Le._preElemsTemplate(e,t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preInputElem(e,t){return Le._preElemTemplate(e,t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preEventTargetElems(e,t){return Le._preElemsTemplate(e,t,[EventTarget],["EventTarget"])}static _preEventTargetElem(e,t){return Le._preElemTemplate(e,t,[EventTarget],["EventTarget"])}static _preElemsAndWindow(e,t){return Le._preElemsTemplate(e,t,[Element,Window],["Element","Window"])}static _preElemAndWindow(e,t){return Le._preElemTemplate(e,t,[Element,Window],["Element","Window"])}static toTinyElm(e){const t=e=>e.map((e=>e instanceof Le?e:new Le(e)));return Array.isArray(e)?t(e):t([e])}static fromTinyElm(e){const t=e=>e.map((e=>e instanceof Le?e._getElement("fromTinyElm"):e));return Array.isArray(e)?t(e):t([e])}static winnow(e,t,r,n=!1){if("boolean"!=typeof n)throw new TypeError('The "not" must be a boolean.');if("function"==typeof t)return Le._preElems(e,r).filter(((e,r)=>!!t.call(e,r,e)!==n));if(t instanceof Element)return Le._preElems(e,r).filter((e=>e===t!==n));if(Array.isArray(t)||"string"!=typeof t&&null!=t.length)return Le._preElems(e,r).filter((e=>t.includes(e)!==n));let i=t;return n&&(i=`:not(${i})`),Le._preElems(e,r).filter((e=>1===e.nodeType&&e.matches(i)))}static filter(e,t,r=!1){return r&&(t=`:not(${t})`),Le._preElems(e,"filter").filter((e=>1===e.nodeType&&e.matches(t)))}static filterOnly(e,t){return Le.winnow(e,t,"filterOnly",!1)}static not(e,t){return Le.winnow(e,t,"not",!0)}not(e){return Le.not(this,e)}static find(e,t){const r=[];for(const n of Le._preElems(e,"find"))r.push(...n.querySelectorAll(t));return[...new Set(r)]}find(e){return Le.find(this,e)}static is(e,t){return Le.winnow(e,t,"is",!1).length>0}is(e){return Le.is(this,e)}static has(e,t){const r="string"==typeof t?[...document.querySelectorAll(t)]:Le._preElems(t,"has");return Le._preElems(e,"has").filter((e=>r.some((t=>e&&e.contains(t)))))}has(e){return Le.has(this,e).length>0}static closest(e,t,r){const n=[];for(const i of Le._preElems(e,"closest")){let e=i;for(;e&&e!==r;){if(1===e.nodeType&&("string"==typeof t?e.matches(t):e===t)){n.push(e);break}e=e.parentElement}}return[...new Set(n)]}closest(e,t){return Le.closest(this,e,t)}static isSameDom(e,t){return Le._preNodeElem(e,"isSameDom")===Le._preNodeElem(t,"isSameDom")}isSameDom(e){return Le.isSameDom(this,e)}_data={};static _dataSelector={public:(e,t)=>{const r=Le._preElem(t,e);let n=Ce.get(r);return n||(n={},Ce.set(r,n)),n},private:(e,t)=>{if(!(t instanceof Le))throw new Error(`Element must be a TinyHtml instance to execute ${e}().`);return t._data}};static data(e,t,r=!1){const n=Le._dataSelector[r?"private":"public"]("data",e);if(null==t)return{...n};if("string"!=typeof t)throw new TypeError("The key must be a string.");return n.hasOwnProperty(t)?n[t]:void 0}data(e,t){return Le.data(this,e,t)}static setData(e,t,r,n=!1){const i=Le._dataSelector[n?"private":"public"]("setData",e);if("string"!=typeof t)throw new TypeError("The key must be a string.");i[t]=r}setData(e,t,r=!1){return Le.setData(this,e,t,r)}static _getSibling(e,t,r){let n=Le._preNodeElemWithNull(e,r);for(;n&&(n=n[t])&&1!==n.nodeType;);return n instanceof Node?n:null}static _getSiblings(e,t){let r=e;const n=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==t&&n.push(r);return n}static domDir(e,t,r,n="domDir"){if("string"!=typeof t)throw new TypeError('The "direction" must be a string.');let i=Le._preNodeElemWithNull(e,n);const o=[];for(;i&&(i=i[t]);)if(1===i.nodeType){if(r&&("string"==typeof r?i.matches(r):i===r))break;o.push(i)}return o}static parent(e){let t=Le._preNodeElemWithNull(e,"parent");const r=t?t.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return Le.parent(this)}static parents(e,t){return Le.domDir(e,"parentNode",t,"parents")}parents(e){return Le.parents(this,e)}static next(e){return Le._getSibling(e,"nextSibling","next")}next(){return Le.next(this)}static prev(e){return Le._getSibling(e,"previousSibling","prev")}prev(){return Le.prev(this)}static nextAll(e){return Le.domDir(e,"nextSibling",void 0,"nextAll")}nextAll(){return Le.nextAll(this)}static prevAll(e){return Le.domDir(e,"previousSibling",void 0,"prevAll")}prevAll(){return Le.prevAll(this)}static nextUntil(e,t){return Le.domDir(e,"nextSibling",t,"nextUtil")}nextUntil(e){return Le.nextUntil(this,e)}static prevUntil(e,t){return Le.domDir(e,"previousSibling",t,"prevUtil")}prevUntil(e){return Le.prevUntil(this,e)}static siblings(e){const t=Le._preNodeElemWithNull(e,"siblings");return Le._getSiblings(t&&t.parentNode?t.parentNode.firstChild:null,t)}siblings(){return Le.siblings(this)}static children(e){const t=Le._preNodeElemWithNull(e,"children");return Le._getSiblings(t?t.firstChild:null)}children(){return Le.children(this)}static contents(e){const t=Le._preNodeElemWithNull(e,"contents");return t instanceof HTMLIFrameElement&&null!=t.contentDocument&&Object.getPrototypeOf(t.contentDocument)?[t.contentDocument]:t instanceof HTMLTemplateElement?Array.from((t.content||t).childNodes):t?Array.from(t.childNodes):[]}contents(){return Le.contents(this)}static clone(e,t=!0){if("boolean"!=typeof t)throw new TypeError('The "deep" must be a boolean.');return Le._preNodeElems(e,"clone").map((e=>e.cloneNode(t)))}clone(e){return Le.clone(this,e)[0]}static _appendChecker(e,...t){const r=[],n=[...t];for(const t in n)"string"!=typeof n[t]?r.push(Le._preNodeElem(n[t],e)):r.push(n[t]);return r}static append(e,...t){Le._preElem(e,"append").append(...Le._appendChecker("append",...t))}append(...e){return Le.append(this,...e)}static prepend(e,...t){Le._preElem(e,"prepend").prepend(...Le._appendChecker("prepend",...t))}prepend(...e){return Le.prepend(this,...e)}static before(e,...t){Le._preElem(e,"before").before(...Le._appendChecker("before",...t))}before(...e){return Le.before(this,...e)}static after(e,...t){Le._preElem(e,"after").after(...Le._appendChecker("after",...t))}after(...e){return Le.after(this,...e)}static replaceWith(e,...t){Le._preElem(e,"replaceWith").replaceWith(...Le._appendChecker("replaceWith",...t))}replaceWith(...e){return Le.replaceWith(this,...e)}static appendTo(e,t){const r=Le._preNodeElems(e,"appendTo"),n=Le._preNodeElems(t,"appendTo");n.forEach(((e,t)=>{r.forEach((r=>e.appendChild(t===n.length-1?r:r.cloneNode(!0))))}))}appendTo(e){return Le.appendTo(this,e)}static prependTo(e,t){const r=Le._preElems(e,"prependTo"),n=Le._preElems(t,"prependTo");n.forEach(((e,t)=>{r.slice().reverse().forEach((r=>e.prepend(t===n.length-1?r:r.cloneNode(!0))))}))}prependTo(e){return Le.prependTo(this,e)}static insertBefore(e,t,r=null){const n=Le._preNodeElem(e,"insertBefore"),i=Le._preNodeElem(t,"insertBefore"),o=Le._preNodeElemWithNull(r,"insertBefore");if(!i.parentNode)throw new Error("");i.parentNode.insertBefore(n,o||i)}insertBefore(e,t){return Le.insertBefore(this,e,t)}static insertAfter(e,t,r=null){const n=Le._preNodeElem(e,"insertAfter"),i=Le._preNodeElem(t,"insertBefore"),o=Le._preNodeElemWithNull(r,"insertBefore");if(!i.parentNode)throw new Error("");i.parentNode.insertBefore(n,o||i.nextSibling)}insertAfter(e,t){return Le.insertAfter(this,e,t)}static replaceAll(e,t){const r=Le._preNodeElems(e,"replaceAll"),n=Le._preNodeElems(t,"replaceAll");n.forEach(((e,t)=>{const i=e.parentNode;r.forEach((r=>{i&&i.replaceChild(t===n.length-1?r:r.cloneNode(!0),e)}))}))}replaceAll(e){return Le.replaceAll(this,e)}#F;constructor(e){if(e instanceof Le)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");if(!(e instanceof Element||e instanceof Window||e instanceof Document))throw new Error("[TinyHtml] Invalid Target in constructor.");this.#F=e}static isWindow(e){return null!=e&&e===e.window}static css(e){const t=Le._preElem(e,"css");return window.getComputedStyle(t)}css(){return Le.css(this)}static cssString(e,t){const r=Le._preElem(e,"cssString");if("string"!=typeof t)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[t];return"string"==typeof n?n:"number"==typeof n?n.toString():null}cssString(e){return Le.cssString(this,e)}static cssList(e,t){const r=Le._preElem(e,"cssList");if(!Array.isArray(t))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),i={};for(const e of t)void 0!==e&&(i[e]=n.getPropertyValue(e));return i}cssList(e){return Le.cssList(this,e)}static cssFloat(e,t){const r=Le._preElem(e,"cssFloat");if("string"!=typeof t)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[t];return parseFloat(n)||0}cssFloat(e){return Le.cssFloat(this,e)}static cssFloats(e,t){const r=Le._preElem(e,"cssFloats");if(!Array.isArray(t))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),i={};for(const e of t)i[e]=parseFloat(n[e])||0;return i}cssFloats(e){return Le.cssFloats(this,e)}static#W={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(Le.#W,{set:(e,t,r)=>(e[t]=r,Le.cssPropRevAliases[r]=t,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(Le.#W).map((([e,t])=>[t,e])));static toStyleKc(e){return"string"==typeof Le.cssPropAliases[e]?Le.cssPropAliases[e]:e}static toStyleCc(e){return"string"==typeof Le.cssPropRevAliases[e]?Le.cssPropRevAliases[e]:e}static setStyle(e,t,r=null){Le._preHtmlElems(e,"setStyle").forEach((e=>{if("object"==typeof t)for(const[r,n]of Object.entries(t))e.style.setProperty(Le.toStyleKc(r),"string"==typeof n?n:"number"==typeof n?`${n}px`:String(n));else e.style.setProperty(Le.toStyleKc(t),r)}))}setStyle(e,t){return Le.setStyle(this,e,t)}static getStyle(e,t){return Le._preHtmlElem(e,"getStyle").style.getPropertyValue(Le.toStyleKc(t))}getStyle(e){return Le.getStyle(this,e)}static style(e,{camelCase:t=!1,rawAttr:r=!1}={}){if("boolean"!=typeof t)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof t);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const n=Le._preHtmlElem(e,"style"),i={};if(r){const e=(n.getAttribute("style")||"").split(";");for(const r of e){const[e,n]=r.split(":");if(!e||!n)continue;const o=e.trim(),s=n.trim();i[t?Le.toStyleCc(o):o]=s}}else{const e=n.style;for(let r=0;r<e.length;r++){const n=e[r],o=e.getPropertyValue(n);i[t?Le.toStyleCc(n):n]=o}}return i}style(e){return Le.style(this,e)}static removeStyle(e,t){Le._preHtmlElems(e,"removeStyle").forEach((e=>{if(Array.isArray(t))for(const r of t)e.style.removeProperty(Le.toStyleKc(r));else e.style.removeProperty(Le.toStyleKc(t))}))}removeStyle(e){return Le.removeStyle(this,e)}static toggleStyle(e,t,r,n){Le._preHtmlElems(e,"toggleStyle").forEach((e=>{const i=Le.getStyle(e,t).trim()===Le.toStyleKc(r)?n:r;Le.setStyle(e,t,i)}))}toggleStyle(e,t,r){return Le.toggleStyle(this,e,t,r)}static clearStyle(e){Le._preElems(e,"clearStyle").forEach((e=>e.removeAttribute("style")))}clearStyle(){return Le.clearStyle(this)}static focus(e){Le._preHtmlElem(e,"focus").focus()}focus(){return Le.focus(this)}static blur(e){Le._preHtmlElem(e,"blur").blur()}blur(){return Le.blur(this)}static setWinScrollTop(e){if("number"!=typeof e)throw new TypeError("The value must be a number.");window.scrollTo({top:e})}static setWinScrollLeft(e){if("number"!=typeof e)throw new TypeError("The value must be a number.");window.scrollTo({left:e})}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static getDimension(e,t,r="content"){const n=Le._preElemAndWindow(e,"getDimension");if("string"!=typeof t)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const i="width"===t?"Width":"Height";if(Le.isWindow(n))return"margin"===r?n["inner"+i]:n.document.documentElement["client"+i];const o=n;if(9===o.nodeType){const e=o.documentElement;return Math.max(o.body["scroll"+i],e["scroll"+i],o.body["offset"+i],e["offset"+i],e["client"+i])}let s=o.getBoundingClientRect()[t];function a(e){return"width"===t?Le.cssFloat(o,e+"Left")+Le.cssFloat(o,e+"Right"):Le.cssFloat(o,e+"Top")+Le.cssFloat(o,e+"Bottom")}switch(r){case"content":s-=a("padding"),s-=a("border");break;case"padding":s-=a("border");break;case"border":break;case"margin":s+=a("margin")}return s}getDimension(e,t){return Le.getDimension(this,e,t)}static setHeight(e,t){const r=Le._preHtmlElem(e,"setHeight");if("number"!=typeof t&&"string"!=typeof t)throw new TypeError("The value must be a string or number.");r.style.height="number"==typeof t?`${t}px`:t}setHeight(e){return Le.setHeight(this,e)}static setWidth(e,t){const r=Le._preHtmlElem(e,"setWidth");if("number"!=typeof t&&"string"!=typeof t)throw new TypeError("The value must be a string or number.");r.style.width="number"==typeof t?`${t}px`:t}setWidth(e){return Le.setWidth(this,e)}static height(e){const t=Le._preElemAndWindow(e,"height");return Le.getDimension(t,"height","content")}height(){return Le.height(this)}static width(e){const t=Le._preElemAndWindow(e,"width");return Le.getDimension(t,"width","content")}width(){return Le.width(this)}static innerHeight(e){const t=Le._preElemAndWindow(e,"innerHeight");return Le.getDimension(t,"height","padding")}innerHeight(){return Le.innerHeight(this)}static innerWidth(e){const t=Le._preElemAndWindow(e,"innerWidth");return Le.getDimension(t,"width","padding")}innerWidth(){return Le.innerWidth(this)}static outerHeight(e,t=!1){if("boolean"!=typeof t)throw new TypeError('The "includeMargin" must be a boolean.');const r=Le._preElemAndWindow(e,"outerHeight");return Le.getDimension(r,"height",t?"margin":"border")}outerHeight(e){return Le.outerHeight(this,e)}static outerWidth(e,t=!1){if("boolean"!=typeof t)throw new TypeError('The "includeMargin" must be a boolean.');const r=Le._preElemAndWindow(e,"outerWidth");return Le.getDimension(r,"width",t?"margin":"border")}outerWidth(e){return Le.outerWidth(this,e)}static offset(e){const t=Le._preElem(e,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft;return{top:t.top+r,left:t.left+n}}offset(){return Le.offset(this)}static position(e){const t=Le._preHtmlElem(e,"position");let r,n,i={top:0,left:0};if("fixed"===window.getComputedStyle(t).position)n=t.getBoundingClientRect();else{n=Le.offset(t),r=t.offsetParent||document.documentElement;const{position:e}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===e;)r=r.parentNode;if(r instanceof HTMLElement&&r!==t&&1===r.nodeType){const{borderTopWidth:e,borderLeftWidth:t}=Le.cssFloats(r,["borderTopWidth","borderLeftWidth"]);i=Le.offset(r),i.top+=e,i.left+=t}}return{top:n.top-i.top-Le.cssFloat(t,"marginTop"),left:n.left-i.left-Le.cssFloat(t,"marginLeft")}}position(){return Le.position(this)}static offsetParent(e){let t=Le._preHtmlElem(e,"offsetParent").offsetParent;for(;t instanceof HTMLElement&&"static"===window.getComputedStyle(t).position;)t=t.offsetParent;return t instanceof HTMLElement?t:document.documentElement}offsetParent(){return Le.offsetParent(this)}static scrollTop(e){const t=Le._preElemAndWindow(e,"scrollTop");return Le.isWindow(t)?t.pageYOffset:9===t.nodeType?t.defaultView.pageYOffset:t.scrollTop}scrollTop(){return Le.scrollTop(this)}static scrollLeft(e){const t=Le._preElemAndWindow(e,"scrollLeft");return Le.isWindow(t)?t.pageXOffset:9===t.nodeType?t.defaultView.pageXOffset:t.scrollLeft}scrollLeft(){return Le.scrollLeft(this)}static setScrollTop(e,t){if("number"!=typeof t)throw new TypeError("ScrollTop value must be a number.");Le._preElemsAndWindow(e,"setScrollTop").forEach((e=>{Le.isWindow(e)?e.scrollTo(e.pageXOffset,t):9===e.nodeType?e.defaultView.scrollTo(e.defaultView.pageXOffset,t):e.scrollTop=t}))}setScrollTop(e){return Le.setScrollTop(this,e)}static setScrollLeft(e,t){if("number"!=typeof t)throw new TypeError("ScrollLeft value must be a number.");Le._preElemsAndWindow(e,"setScrollLeft").forEach((e=>{Le.isWindow(e)?e.scrollTo(t,e.pageYOffset):9===e.nodeType?e.defaultView.scrollTo(t,e.defaultView.pageYOffset):e.scrollLeft=t}))}setScrollLeft(e){return Le.setScrollLeft(this,e)}static borderWidth(e){const t=Le._preElem(e,"borderWidth"),{borderLeftWidth:r,borderRightWidth:n,borderTopWidth:i,borderBottomWidth:o}=Le.cssFloats(t,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}}borderWidth(){return Le.borderWidth(this)}static border(e){const t=Le._preElem(e,"border"),{borderLeft:r,borderRight:n,borderTop:i,borderBottom:o}=Le.cssFloats(t,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}}border(){return Le.border(this)}static margin(e){const t=Le._preElem(e,"margin"),{marginLeft:r,marginRight:n,marginTop:i,marginBottom:o}=Le.cssFloats(t,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}}margin(){return Le.margin(this)}static padding(e){const t=Le._preElem(e,"padding"),{paddingLeft:r,paddingRight:n,paddingTop:i,paddingBottom:o}=Le.cssFloats(t,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+n,y:i+o,left:r,right:n,top:i,bottom:o}}padding(){return Le.padding(this)}static addClass(e,...t){Le._preElems(e,"addClass").forEach((e=>e.classList.add(...t)))}addClass(...e){return Le.addClass(this,...e)}static removeClass(e,...t){Le._preElems(e,"removeClass").forEach((e=>e.classList.remove(...t)))}removeClass(...e){return Le.removeClass(this,...e)}static replaceClass(e,t,r){if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const n=[];return Le._preElems(e,"replaceClass").forEach((e=>n.push(e.classList.replace(t,r)))),n}replaceClass(e,t){return Le.replaceClass(this,e,t)[0]}static classItem(e,t){const r=Le._preElem(e,"classItem");if("number"!=typeof t)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(t)}classItem(e){return Le.classItem(this,e)}static toggleClass(e,t,r){if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const n=[];return Le._preElems(e,"toggleClass").forEach((e=>n.push(e.classList.toggle(t,r)))),n}toggleClass(e,t){return Le.toggleClass(this,e,t)[0]}static hasClass(e,t){const r=Le._preElem(e,"hasClass");if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(t)}hasClass(e){return Le.hasClass(this,e)}static classLength(e){return Le._preElem(e,"classLength").classList.length}classLength(){return Le.classLength(this)}static classList(e){return Le._preElem(e,"classList").classList.values().toArray()}classList(){return Le.classList(this)}static tagName(e){return Le._preElem(e,"tagName").tagName}tagName(){return Le.tagName(this)}static id(e){return Le._preElem(e,"id").id}id(){return Le.id(this)}static text(e){return Le._preElem(e,"text").textContent}text(){return Le.text(this)}static setText(e,t){if("string"!=typeof t)throw new Error("Value is not a valid string.");Le._preElems(e,"setText").forEach((e=>e.textContent=t))}setText(e){return Le.setText(this,e)}static empty(e){Le._preElems(e,"empty").forEach((e=>e.textContent=""))}empty(){return Le.empty(this)}static html(e){return Le._preElem(e,"html").innerHTML}html(){return Le.html(this)}static setHtml(e,t){if("string"!=typeof t)throw new Error("Value is not a valid string.");Le._preElems(e,"setHtml").forEach((e=>e.innerHTML=t))}setHtml(e){return Le.setHtml(this,e)}static _valHooks={option:{get:e=>{const t=e.getAttribute("value");return null!=t?t:e.textContent}},select:{get:e=>{const t=e.options,r=e.selectedIndex,n="select-one"===e.type,i=n?r+1:t.length,o=[];let s=r<0?i:n?r:0;for(;s<i;s++){const e=t[s],i=e.parentNode;if((e.selected||s===r)&&!e.disabled&&(!i||!i.disabled||"OPTGROUP"!==i.tagName)){const t=Le._valHooks.option.get(e);if(n)return t;o.push(t)}}return o},set:(e,t)=>{const r=e.options,n=Array.isArray(t)?t.map(String):[String(t)];let i=!1;for(let e=0;e<r.length;e++){const t=r[e],o=Le._valHooks.option.get(t);"string"==typeof o&&(t.selected=n.includes(o))&&(i=!0)}return i||(e.selectedIndex=-1),n}},radio:{get:e=>e.checked?"on":"off",set(e,t){if("boolean"==typeof t){const r=e.closest("label");return t&&r&&r.querySelectorAll('input[type="radio"]').forEach((t=>{t instanceof HTMLInputElement&&t!==e&&(t.checked=!1)})),e.checked=t,t}}},checkbox:{get:e=>e.checked?"on":"off",set(e,t){if("boolean"==typeof t)return e.checked=t,t}}};static setVal(e,t){Le._preInputElems(e,"setVal").forEach((e=>{if(1!==e.nodeType)return;let r="function"==typeof t?t(e,Le.val(e)):t;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=(e=>{const t=[];for(let n=0;n<e.length;n++)t.push(null==(r=e[n])?"":String(r));var r;return t})(r));const n=Le._valHooks[e.type]||Le._valHooks[e.nodeName.toLowerCase()];if(!n||"function"!=typeof n.set||void 0===n.set(e,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(e.value=r)}}))}setVal(e){return Le.setVal(this,e)}static _valTypes={string:e=>e.value,date:e=>e.valueAsDate,number:e=>e.valueAsNumber};static _getValByType(e,t,r){if("string"!=typeof t)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(e instanceof HTMLInputElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof Le._valTypes[t])throw new Error(`No handler found for type "${t}" in ${r}().`);return Le._valTypes[t](e)}static _val(e,t,r){const n=Le._preInputElem(e,t),i=Le._valHooks[n.type]||Le._valHooks[n.nodeName.toLowerCase()];if(i&&"function"==typeof i.get){const e=i.get(n,"value",r);if(void 0!==e)return"string"==typeof e?e.replace(/\r/g,""):e}return Le._getValByType(n,r,t)}_val(e,t){return Le._val(this,e,t)}static val(e){return Le._val(e,"val","string")}val(){return Le.val(this)}static valTxt(e){const t=Le._val(e,"valTxt","string");if("string"!=typeof t&&null!==t)throw new Error("Value is not a valid string.");return null==t?"":"string"==typeof t?t.replace(/\r/g,""):t}valTxt(){return Le.valTxt(this)}static _valArr(e,t,r){const n=Le._val(e,t,r);if(!Array.isArray(n))throw new Error(`Value expected an array but got ${typeof n}.`);return n}_valArr(e,t){return Le._valArr(this,e,t)}static valArr(e){return Le._valArr(e,"valArr","string")}valArr(){return Le.valArr(this)}static valNb(e){if(!(Le._preInputElem(e,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const t=Le._val(e,"valNb","number");if(Number.isNaN(t))throw new Error("Value is not a valid number.");return t}valNb(){return Le.valNb(this)}static valDate(e){if(!(Le._preInputElem(e,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const t=Le._val(e,"valDate","date");if(!(t instanceof Date))throw new Error("Value is not a valid date.");return t}valDate(){return Le.valDate(this)}static valBool(e){const t=Le._preInputElem(e,"valBool");if(!(t instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===Le.val(t)}valBool(){return Le.valBool(this)}static on(e,t,r,n){if("string"!=typeof t)throw new TypeError("The event name must be a string.");Le._preEventTargetElems(e,"on").forEach((e=>{e.addEventListener(t,r,n),Te.has(e)||Te.set(e,{});const i=Te.get(e);i&&(Array.isArray(i[t])||(i[t]=[]),i[t].push({handler:r,options:n}))}))}on(e,t,r){return Le.on(this,e,t,r)}static once(e,t,r,n={}){if("string"!=typeof t)throw new TypeError("The event name must be a string.");Le._preEventTargetElems(e,"once").forEach((e=>{const i=n=>{Le.off(e,t,i),r(n)};Le.on(e,t,i,"boolean"==typeof n?n:{...n,once:!0})}))}once(e,t,r={}){return Le.once(this,e,t,r)}static off(e,t,r,n){if("string"!=typeof t)throw new TypeError("The event name must be a string.");Le._preEventTargetElems(e,"off").forEach((e=>{e.removeEventListener(t,r,n);const i=Te.get(e);i&&i[t]&&(i[t]=i[t].filter((e=>e.handler!==r)),0===i[t].length&&delete i[t])}))}off(e,t,r){return Le.off(this,e,t,r)}static offAll(e,t){if("string"!=typeof t)throw new TypeError("The event name must be a string.");Le._preEventTargetElems(e,"offAll").forEach((e=>{const r=Te.get(e);if(r&&r[t]){for(const n of r[t])e.removeEventListener(t,n.handler,n.options);delete r[t]}}))}offAll(e){return Le.offAll(this,e)}static offAllTypes(e,t=null){if(null!==t&&"function"!=typeof t)throw new TypeError('The "filterFn" must be a function.');Le._preEventTargetElems(e,"offAllTypes").forEach((e=>{const r=Te.get(e);if(r){for(const n in r)for(const i of r[n])("function"!=typeof t||t(i.handler,n))&&e.removeEventListener(n,i.handler,i.options);Te.delete(e)}}))}offAllTypes(e=null){return Le.offAllTypes(this,e)}static trigger(e,t,r={}){if("string"!=typeof t)throw new TypeError("The event name must be a string.");Le._preEventTargetElems(e,"trigger").forEach((e=>{const n=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e.dispatchEvent(n)}))}trigger(e,t={}){return Le.trigger(this,e,t)}static _propFix={for:"htmlFor",class:"className"};static attr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return Le._preElem(e,"attr").getAttribute(t)}attr(e){return Le.attr(this,e)}static setAttr(e,t,r=null){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');if(null!==r&&"string"!=typeof r)throw new TypeError('The "value" must be a string.');Le._preElems(e,"setAttr").forEach((e=>{null===r?e.removeAttribute(t):e.setAttribute(t,r)}))}setAttr(e,t){return Le.setAttr(this,e,t)}static removeAttr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');Le._preElems(e,"removeAttr").forEach((e=>e.removeAttribute(t)))}removeAttr(e){return Le.removeAttr(this,e)}static hasAttr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return Le._preElem(e,"hasAttr").hasAttribute(t)}hasAttr(e){return Le.hasAttr(this,e)}static hasProp(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return!!Le._preElem(e,"hasProp")[Le._propFix[t]||t]}hasProp(e){return Le.hasProp(this,e)}static addProp(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');Le._preElems(e,"addProp").forEach((e=>{e[t=Le._propFix[t]||t]=!0}))}addProp(e){return Le.addProp(this,e)}static removeProp(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');Le._preElems(e,"removeProp").forEach((e=>{e[t=Le._propFix[t]||t]=!1}))}removeProp(e){return Le.removeProp(this,e)}static toggleProp(e,t,r){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');Le._preElems(e,"toggleProp").forEach((e=>{const n=Le._propFix[t]||t;(void 0===r?!e[n]:r)?Le.addProp(e,t):Le.removeProp(e,t)}))}toggleProp(e,t){return Le.toggleProp(this,e,t)}static remove(e){Le._preElems(e,"remove").forEach((e=>e.remove()))}remove(){return Le.remove(this)}static index(e,t=null){const r=Le._preElem(e,"index");if(!r)return-1;if(!t)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(t){const e="string"==typeof t?document.querySelectorAll(t):Le._preElems(t,"index");return Array.prototype.indexOf.call(e,r)}return-1}index(e){return Le.index(this,e)}static _getCustomRect(e,t){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const t in e)"number"==typeof e[t]&&(r[t]=e[t]);if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("");const{height:n=0,width:i=0,top:o=0,bottom:s=0,left:a=0,right:l=0}=t;if("number"!=typeof n)throw new Error("");if("number"!=typeof i)throw new Error("");if("number"!=typeof o)throw new Error("");if("number"!=typeof s)throw new Error("");if("number"!=typeof a)throw new Error("");if("number"!=typeof l)throw new Error("");return r.height+=n,r.width+=i,r.top+=o,r.bottom+=s,r.left+=a,r.right+=l,r}static isCollWith(e,t,r={}){const n=Le._getCustomRect(Le._preElem(e,"isCollWith").getBoundingClientRect(),r),i=Le._preElem(t,"isCollWith").getBoundingClientRect();return ge(n,i)}isCollWith(e,t){return Le.isCollWith(this,e,t)}static isCollPerfWith(e,t,r={}){const n=Le._getCustomRect(Le._preElem(e,"isCollPerfWith").getBoundingClientRect(),r),i=Le._preElem(t,"isCollPerfWith").getBoundingClientRect();return ye(n,i)}isCollPerfWith(e,t){return Le.isCollPerfWith(this,e,t)}static _isCollWithLock(e,t,r,n,i){const o=xe[i];if(e)return o.has(n)||o.set(n,!0),!0;if(o.has(n)){let e=!1;switch(i){case"top":e=be(t,r);break;case"bottom":e=we(t,r);break;case"left":e=ve(t,r);break;case"right":e=Ee(t,r)}return e&&o.delete(n),o.has(n)}return!1}static isCollWithLock(e,t,r,n={}){const i=Le._preElem(e,"isCollWithLock"),o=Le._preElem(t,"isCollWithLock"),s=Le._getCustomRect(i.getBoundingClientRect(),n),a=o.getBoundingClientRect(),l=ge(s,a);return Le._isCollWithLock(l,s,a,i,r)}isCollWithLock(e,t,r){return Le.isCollWithLock(this,e,t,r)}static isCollPerfWithLock(e,t,r,n={}){const i=Le._preElem(e,"isCollPerfWithLock"),o=Le._preElem(t,"isCollPerfWithLock"),s=Le._getCustomRect(i.getBoundingClientRect(),n),a=o.getBoundingClientRect(),l=ye(s,a);return Le._isCollWithLock(l,s,a,i,r)}isCollPerfWithLock(e,t,r){return Le.isCollPerfWithLock(this,e,t,r)}static resetCollLock(e){const t=Le._preElem(e,"resetCollLock");let r=!1;for(const e of["top","bottom","left","right"])xe[e].has(t)&&(xe[e].delete(t),r=!0);return r}resetCollLock(){return Le.resetCollLock(this)}static resetCollLockDir(e,t){const r=Le._preElem(e,"resetCollLockDir"),n=xe[t];return!!n.has(r)&&(n.delete(r),!0)}resetCollLockDir(e){return Le.resetCollLockDir(this,e)}static isInViewport(e){const t=Le._preElem(e,"isInViewport"),r=Le.offset(t).top,n=r+Le.outerHeight(t),i=Le.scrollTop(window),o=i+Le.height(window);return n>i&&r<o}isInViewport(){return Le.isInViewport(this)}static isScrolledIntoView(e){const t=Le._preElem(e,"isScrolledIntoView"),r=Le.scrollTop(window),n=r+Le.height(window),i=Le.offset(t).top;return i+Le.height(t)<=n&&i>=r}isScrolledIntoView(){return Le.isScrolledIntoView(this)}}const De=Le;function Ae(e,t){return De.isCollWith(e,t)}const Se=e=>De.borderWidth(e),ke=e=>De.border(e),_e=e=>De.margin(e),Me=e=>De.padding(e);function Ne(e){const t=e.offsetTop,r=t+e.offsetHeight,n=window.scrollY,i=n+window.innerHeight;return r>n&&t<i}function Be(e){const t=window.scrollY,r=t+window.innerHeight,n=e.offsetTop;return n+e.offsetHeight<=r&&n>=t}const Ie=class{#j;#$;#U;#J;#q;#V;#z;#G;constructor(e={}){const{target:t,fullscreen:r=!0,hoverClass:n="dnd-hover",onDrop:i,onEnter:o,onLeave:s}=e;if("boolean"!=typeof r)throw new TypeError('The "fullscreen" option must be a boolean.');const a=r?document.body:t||document.body;if(!(a instanceof HTMLElement))throw new TypeError('The "target" option must be an instance of HTMLElement.');if("string"!=typeof n)throw new TypeError('The "hoverClass" option must be a string.');if("function"!=typeof i)throw new TypeError('The "onDrop" option must be a function.');if("function"!=typeof o)throw new TypeError('The "onEnter" option must be a function.');if("function"!=typeof s)throw new TypeError('The "onLeave" option must be a function.');this.#j=a,this.#$=r,this.#U=n,this.#J=i||(()=>{}),this.#q=o,this.#V=s,this.#z=!1,this.#G=!1,this._handleDragEnter=this._handleDragEnter.bind(this),this._handleDragOver=this._handleDragOver.bind(this),this._handleDragLeave=this._handleDragLeave.bind(this),this._handleDrop=this._handleDrop.bind(this),this.#Y()}getTarget(){return this.#j}getHoverClass(){return this.#U}isFullScreen(){return this.#$}isDragging(){return this.#z}bound(){return this.#G}#Y(){if(this.#G)return;const e=this.getTarget();e.addEventListener("dragenter",this._handleDragEnter),e.addEventListener("dragover",this._handleDragOver),e.addEventListener("dragleave",this._handleDragLeave),e.addEventListener("drop",this._handleDrop),this.#G=!0}#X(){if(!this.#G)return;const e=this.getTarget();e.removeEventListener("dragenter",this._handleDragEnter),e.removeEventListener("dragover",this._handleDragOver),e.removeEventListener("dragleave",this._handleDragLeave),e.removeEventListener("drop",this._handleDrop),this.#G=!1}_handleDragEnter(e){if(e.preventDefault(),!this.#z){const t=this.getTarget();this.#z=!0,t.classList.add(this.#U),this.#q(e)}}_handleDragOver(e){e.preventDefault(),e.dataTransfer?e.dataTransfer.dropEffect="copy":console.warn("[TinyDragDropDetector] [handleDragOver] DragOver event missing dataTransfer.")}_handleDragLeave(e){e.preventDefault();const t=this.getTarget();null!==e.relatedTarget&&t.contains(e.relatedTarget)||(this.#z=!1,t.classList.remove(this.#U),this.#V(e))}_handleDrop(e){if(e.preventDefault(),!e.dataTransfer)return void console.warn("[TinyDragDropDetector] [handleDrop] DragOver event missing dataTransfer.");const t=this.getTarget();this.#z=!1,t.classList.remove(this.#U);const r=e.dataTransfer.files;r.length>0&&this.#J(r,e)}destroy(){this.#X(),this.getTarget().classList.remove(this.#U)}};var Pe=r(133),Re=r(975);function Oe(e){if(!(0,Pe.existsSync)(e))throw new Error(`File not found: ${e}`);const t=(0,Pe.readFileSync)(e,"utf-8");return JSON.parse(t)}function He(e,t,r=2){const n=JSON.stringify(t,null,r);(0,Pe.writeFileSync)(e,n,"utf-8")}function Fe(e){(0,Pe.existsSync)(e)||(0,Pe.mkdirSync)(e,{recursive:!0})}function We(e){if(!(0,Pe.existsSync)(e))return;const t=(0,Pe.readdirSync)(e);for(const r of t){const t=(0,Re.join)(e,r);(0,Pe.lstatSync)(t).isDirectory()?(0,Pe.rmSync)(t,{recursive:!0,force:!0}):(0,Pe.unlinkSync)(t)}}function je(e){return(0,Pe.existsSync)(e)&&(0,Pe.lstatSync)(e).isFile()}function $e(e){return(0,Pe.existsSync)(e)&&(0,Pe.lstatSync)(e).isDirectory()}function Ue(e){return 0===(0,Pe.readdirSync)(e).length}function Je(e,t,r){Fe((0,Re.dirname)(t)),(0,Pe.copyFileSync)(e,t,r)}function qe(e){return!!je(e)&&((0,Pe.unlinkSync)(e),!0)}function Ve(e,t,r="utf-8"){Fe((0,Re.dirname)(e)),(0,Pe.writeFileSync)(e,t,r)}function ze(e,t=!1){const r={files:[],dirs:[]};if(!$e(e))return r;const n=(0,Pe.readdirSync)(e);for(const i of n){const n=(0,Re.join)(e,i);if((0,Pe.lstatSync)(n).isDirectory()){if(r.dirs.push(n),t){const e=ze(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}function Ge(e,t=!1){const r=[];if(!$e(e))return r;const n=(0,Pe.readdirSync)(e);for(const i of n){const n=(0,Re.join)(e,i);(0,Pe.lstatSync)(n).isDirectory()&&(r.push(n),t&&r.push(...Ge(n,!0)))}return r}function Ye(e){return je(e)?(0,Pe.statSync)(e).size:0}function Xe(e){let t=0;const r=ze(e,!0).files;for(const e of r)t+=Ye(e);return t}function Qe(e,t="bak"){je(e)&&Je(e,`${e}.${t}.${(new Date).toISOString().replace(/[:.]/g,"-")}`)}function Ke(e,t="bak"){const r=(0,Re.dirname)(e),n=(0,Re.basename)(e),i=(0,Pe.readdirSync)(r).filter((e=>e.startsWith(`${n}.${t}.`))).sort().reverse();if(0===i.length)throw new Error(`No backups found for ${e}`);return(0,Re.join)(r,i[0])}function Ze(e,t="bak"){Je(Ke(e,t),e)}function et(e,t,r=[]){if("string"!=typeof e)throw new TypeError("dirPath must be a string");if("function"!=typeof t)throw new TypeError("renameFn must be a function");if(!Array.isArray(r))throw new TypeError("extensions must be an array of strings");if(!(0,Pe.existsSync)(e)||!(0,Pe.statSync)(e).isDirectory())throw new Error(`Directory not found or invalid: ${e}`);for(const e of r)if("string"!=typeof e||!e.startsWith("."))throw new TypeError(`Invalid extension: ${e}`);const n=ze(e).files;let i=0;for(const o of n){const n=(0,Re.extname)(o);if(r.length&&!r.includes(n))continue;const s=(0,Re.basename)(o),a=t(s,i++),l=(0,Re.join)(e,a);s!==a&&(0,Pe.renameSync)(o,l)}}function tt(e,t,r,n=[]){et(e,(e=>{const n=(0,Re.extname)(e);return`${(0,Re.basename)(e,n).replace(t,r)}${n}`}),n)}function rt(e,{prefix:t="",suffix:r=""},n=[]){et(e,(e=>{const n=(0,Re.extname)(e),i=(0,Re.basename)(e,n);return`${t}${i}${r}${n}`}),n)}function nt(e,t="lower",r=[],n=!1){if("string"!=typeof t||!["lower","upper","title"].includes(t))throw new Error(`Invalid mode "${t}". Must be 'lower', 'upper' or 'title'.`);et(e,(e=>{const r=e=>"lower"===t?e.toLowerCase():"upper"===t?e.toUpperCase():"title"===t?P(e):e,i=(0,Re.extname)(e),o=n?r(i):i;return`${r((0,Re.basename)(e,i))}${o}`}),r)}function it(e,t=3,r=[]){et(e,(e=>e.replace(/\d+/,(e=>e.padStart(t,"0")))),r)}var ot=r(370);async function st(e){if(!(0,Pe.existsSync)(e))return;const t=await(0,ot.readdir)(e),r={},n=[];for(const i of t){const t=(0,Re.join)(e,i),o=(0,ot.lstat)(t);o.then((e=>(r[t]=e,e))),n.push(o)}await Promise.all(n);const i=[];for(const e in r)r[e].isDirectory()?i.push((0,ot.rm)(e,{recursive:!0,force:!0})):i.push((0,ot.unlink)(e));await Promise.all(i)}async function at(e){return 0===(await(0,ot.readdir)(e)).length}async function lt(e,t=!1){const r={files:[],dirs:[]};if(!$e(e))return r;const n=await(0,ot.readdir)(e);for(const i of n){const n=(0,Re.join)(e,i);if((await(0,ot.lstat)(n)).isDirectory()){if(r.dirs.push(n),t){const e=await lt(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}async function ut(e,t=!1){const r=[];if(!$e(e))return r;const n=await(0,ot.readdir)(e);for(const i of n){const n=(0,Re.join)(e,i);(await(0,ot.lstat)(n)).isDirectory()&&(r.push(n),t&&r.push(...await ut(n,!0)))}return r}async function ct(e){return je(e)?(await(0,ot.stat)(e)).size:0}async function ht(e){let t=0;const{files:r}=await lt(e,!0),n=[];for(const e of r){const r=ct(e);r.then((e=>(t+=e,e))),n.push(r)}return await Promise.all(n),t}class ft{static Utils={...e,TinyHtml:De};#Q=!0;#K=!1;#Z=0;#ee=0;#te=!0;#re=!1;#ne=!1;#ie=!1;#oe=!1;#se=!1;#ae=!1;#le=null;#ue=[];#ce=null;#he={start:!1,end:!1,collide:!1,move:!1};#fe=null;#j;#de="drag-hidden";#pe="dragging";#me="drag-active";#ge="jail-drag-active";#ye="jail-drag-disabled";#be="dragging-collision";#we=9999;constructor(e,t={}){const r=e instanceof De?e.get():e;if(!(r instanceof HTMLElement))throw new Error("TinyDragger requires a valid target HTMLElement to initialize.");if(this.#j=r,void 0!==t.jail&&!(t.jail instanceof HTMLElement))throw new Error('The "jail" option must be an HTMLElement if provided.');if(void 0!==t.defaultZIndex&&this.setDefaultZIndex(t.defaultZIndex),void 0!==t.vibration&&!1!==t.vibration&&!E(t.vibration))throw new Error('The "vibration" option must be an object or false.');const n=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new Error(`The "${t}" option must be a boolean.`)},i=(e,t)=>{if(void 0!==e&&"string"!=typeof e)throw new Error(`The "${t}" option must be a string.`)};n(t.mirrorElem,"mirrorElem"),n(t.collisionByMouse,"collisionByMouse"),n(t.lockInsideJail,"lockInsideJail"),n(t.dropInJailOnly,"dropInJailOnly"),n(t.revertOnDrop,"revertOnDrop"),n(t.multiCollision,"multiCollision"),i(t.classDragging,"classDragging"),i(t.classBodyDragging,"classBodyDragging"),i(t.classJailDragging,"classJailDragging"),i(t.classJailDragDisabled,"classJailDragDisabled"),i(t.classDragCollision,"classDragCollision"),i(t.classHidden,"classHidden"),t.jail instanceof HTMLElement&&(this.#fe=t.jail),this.#he=Object.assign({start:!1,end:!1,collide:!1,move:!1},E(t.vibration)?t.vibration:{}),"string"==typeof t.classDragging&&(this.#pe=t.classDragging),"string"==typeof t.classBodyDragging&&(this.#me=t.classBodyDragging),"string"==typeof t.classJailDragging&&(this.#ge=t.classJailDragging),"string"==typeof t.classJailDragDisabled&&(this.#ye=t.classJailDragDisabled),"string"==typeof t.classHidden&&(this.#de=t.classHidden),"string"==typeof t.classDragCollision&&(this.#be=t.classDragCollision),"boolean"==typeof t.collisionByMouse&&(this.#se=t.collisionByMouse),"boolean"==typeof t.mirrorElem&&(this.#te=t.mirrorElem),"boolean"==typeof t.revertOnDrop&&(this.#ie=t.revertOnDrop),"boolean"==typeof t.lockInsideJail&&(this.#ne=t.lockInsideJail),"boolean"==typeof t.dropInJailOnly&&(this.#ae=t.dropInJailOnly),"boolean"==typeof t.multiCollision&&(this.#re=t.multiCollision),this._onMouseDown=this.#ve.bind(this),this._onMouseMove=this.#Ee.bind(this),this._onMouseUp=this.#Te.bind(this),this._onTouchStart=e=>this.#ve(e.touches[0]),this._onTouchMove=e=>this.#Ee(e.touches[0]),this._onTouchEnd=e=>this.#Te(e.changedTouches[0]),this.#j.addEventListener("mousedown",this._onMouseDown),this.#j.addEventListener("touchstart",this._onTouchStart,{passive:!1})}enable(){this.#Ce(),this.#fe&&this.#fe.classList.add(this.#ye),this.#Q=!0}disable(){this.#fe&&this.#fe.classList.remove(this.#ye),this.#Q=!1}addCollidable(e){if(this.#Ce(),!(e instanceof HTMLElement))throw new Error("addCollidable expects an HTMLElement as argument.");this.#ue.includes(e)||this.#ue.push(e)}removeCollidable(e){if(this.#Ce(),!(e instanceof HTMLElement))throw new Error("removeCollidable expects an HTMLElement as argument.");this.#ue=this.#ue.filter((t=>t!==e))}setVibrationPattern({startPattern:e=!1,endPattern:t=!1,collidePattern:r=!1,movePattern:n=!1}={}){this.#Ce();const i=e=>!1===e||Array.isArray(e)&&e.every((e=>"number"==typeof e));if(!i(e))throw new Error('Invalid "startPattern": must be false or an array of numbers.');if(!i(t))throw new Error('Invalid "endPattern": must be false or an array of numbers.');if(!i(r))throw new Error('Invalid "collidePattern": must be false or an array of numbers.');if(!i(n))throw new Error('Invalid "movePattern": must be false or an array of numbers.');this.#he={start:e,end:t,collide:r,move:n}}disableVibration(){this.#Ce(),this.#he={start:!1,end:!1,collide:!1,move:!1}}getOffset(e){if(this.#Ce(),!(e instanceof MouseEvent||e instanceof Touch)||"number"!=typeof e.clientX||"number"!=typeof e.clientY)throw new Error("getOffset expects an event with valid clientX and clientY coordinates.");const t=this.#j.getBoundingClientRect(),{left:r,top:n}=De.borderWidth(this.#j);return{x:e.clientX-t.left+r,y:e.clientY-t.top+n}}#ve(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#K||!this.#Q||!this.#j.parentElement)return;if(this.#te){const e=this.#j.cloneNode(!0);if(!(e instanceof HTMLElement))throw new Error("[TinyDragger] INVALID DRAG ELEMENT!");this.#ce=e}else this.#ce=this.#j;this.#oe=!0;const t=this.#j.getBoundingClientRect();Object.assign(this.#ce.style,{position:"absolute",pointerEvents:"none",left:`${this.#j.offsetLeft}px`,top:`${this.#j.offsetTop}px`,width:`${t.width}px`,height:`${t.height}px`,zIndex:this.#we}),this.#te&&(this.#j.classList.add(this.#de),this.#j.parentElement.appendChild(this.#ce));const{x:r,y:n}=this.getOffset(e);this.#ee=r,this.#Z=n,this.#ce.classList.add(this.#pe),document.body.classList.add(this.#me),this.#fe&&this.#fe.classList.add(this.#ge),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("touchmove",this._onTouchMove,{passive:!1}),document.addEventListener("touchend",this._onTouchEnd),navigator.vibrate&&Array.isArray(this.#he.start)&&navigator.vibrate(this.#he.start),this.checkDragCollision(e),this.#xe("drag")}#Le=[];#De(e){e&&(e.classList.add(this.#be),this.#Le.push(e))}#Ae(){for(;this.#Le.length>0;){const e=this.#Le.shift();e&&e.classList.remove(this.#be)}this.#le&&this.#le.classList.remove(this.#be)}checkDragCollision(e){const{collidedElements:t}=this.execCollision(e),r=t[0]||null;this.#le&&!t.includes(this.#le)&&this.#Ae(),t.forEach((e=>this.#De(e))),this.#ue.forEach((e=>{t.includes(e)||e.classList.remove(this.#be)})),navigator.vibrate&&Array.isArray(this.#he.collide)&&t.length>0&&navigator.vibrate(this.#he.collide),this.#le=r}#Ee(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#K||!this.#oe||!this.#Q||!this.#ce)return;const t=(this.#ce.offsetParent||document.body).getBoundingClientRect();let r=e.clientX-t.left-this.#ee,n=e.clientY-t.top-this.#Z;if(this.#ne&&this.#fe){const e=this.#fe.getBoundingClientRect(),i=this.#ce.getBoundingClientRect(),o=e.left-t.left,s=e.top-t.top,{x:a,y:l}=De.borderWidth(this.#fe),u=o+e.width-i.width-l,c=s+e.height-i.height-a;r=Math.max(o,Math.min(r,u)),n=Math.max(s,Math.min(n,c))}this.#ce.style.position="absolute",this.#ce.style.left=`${r}px`,this.#ce.style.top=`${n}px`,navigator.vibrate&&Array.isArray(this.#he.move)&&navigator.vibrate(this.#he.move),this.checkDragCollision(e),this.#xe("dragging")}execCollision(e){if(this.#K||!this.#ce)return{inJail:!1,collidedElements:[]};let t=[],r=!0;const n=this.#fe?.getBoundingClientRect();if(this.#se){const i=e.clientX,o=e.clientY;this.#ae&&this.#fe&&n&&(r=i>=n.left&&i<=n.right&&o>=n.top&&o<=n.bottom),t=r?this.#re?this.getAllCollidedElements(i,o):[this.getCollidedElement(i,o)].filter(Boolean):[]}else{const e=this.#ce.getBoundingClientRect();this.#ae&&this.#fe&&n&&(r=e.left>=n.left&&e.right<=n.right&&e.top>=n.top&&e.bottom<=n.bottom),t=r?this.#re?this.getAllCollidedElementsByRect(e):[this.getCollidedElementByRect(e)].filter(Boolean):[]}return{inJail:r,collidedElements:t}}#Te(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#K||!this.#oe)return;if(this.#oe=!1,!this.#ce)return;this.#j.classList.remove(this.#pe),document.body.classList.remove(this.#me),this.#fe&&this.#fe.classList.remove(this.#ge),document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("touchend",this._onTouchEnd);const{collidedElements:t}=this.execCollision(e);navigator.vibrate&&Array.isArray(this.#he.end)&&navigator.vibrate(this.#he.end);const r=this.#ce.style.left,n=this.#ce.style.top;this.#ce&&(this.#te?this.#ce.remove():Object.assign(this.#ce.style,{position:"",pointerEvents:"",left:"",top:"",width:"",height:"",zIndex:""}),this.#ce=null),this.#le&&this.#Ae(),this.#le=null,this.#te&&this.#j.classList.remove(this.#de),this.#ie||(this.#j.style.left=r,this.#j.style.top=n);const i=new CustomEvent("drop",{detail:{targets:t,first:t[0]||null}});this.#j.dispatchEvent(i)}#Se(e,t){const r=e.getBoundingClientRect();return!(t.right<r.left||t.left>r.right||t.bottom<r.top||t.top>r.bottom)}getAllCollidedElementsByRect(e){if(this.#Ce(),!(e instanceof DOMRect)||"number"!=typeof e.left||"number"!=typeof e.right||"number"!=typeof e.top||"number"!=typeof e.bottom)throw new Error("getCollidedElementByRect expects a valid DOMRect object.");return this.#ue.filter((t=>this.#Se(t,e)))}getCollidedElementByRect(e){if(this.#Ce(),!(e instanceof DOMRect)||"number"!=typeof e.left||"number"!=typeof e.right||"number"!=typeof e.top||"number"!=typeof e.bottom)throw new Error("getCollidedElementByRect expects a valid DOMRect object.");return this.#ue.find((t=>this.#Se(t,e)))||null}#ke(e,t,r){const n=e.getBoundingClientRect();return t>=n.left&&t<=n.right&&r>=n.top&&r<=n.bottom}getAllCollidedElements(e,t){if(this.#Ce(),"number"!=typeof e||"number"!=typeof t)throw new Error("getCollidedElement expects numeric x and y coordinates.");return this.#ue.filter((r=>this.#ke(r,e,t)))}getCollidedElement(e,t){if(this.#Ce(),"number"!=typeof e||"number"!=typeof t)throw new Error("getCollidedElement expects numeric x and y coordinates.");return this.#ue.find((r=>this.#ke(r,e,t)))||null}#xe(e){const t=new CustomEvent(e);this.#j.dispatchEvent(t)}getDragging(){return this.#oe}getLockInsideJail(){return this.#ne}setLockInsideJail(e){if("boolean"!=typeof e)throw new Error("lockInsideJail must be a boolean.");this.#ne=e}getRevertOnDrop(){return this.#ie}setRevertOnDrop(e){if("boolean"!=typeof e)throw new Error("revertOnDrop must be a boolean.");this.#ie=e}getCollisionByMouse(){return this.#se}setCollisionByMouse(e){if("boolean"!=typeof e)throw new Error("collisionByMouse must be a boolean.");this.#se=e}getDropInJailOnly(){return this.#ae}setDropInJailOnly(e){if("boolean"!=typeof e)throw new Error("dropInJailOnly must be a boolean.");this.#ae=e}getDefaultZIndex(){return this.#we}setDefaultZIndex(e){if("number"!=typeof e||!Number.isFinite(e))throw new TypeError("Z-index must be a finite number.");this.#we=e}isMirrorEnabled(){return this.#te}setMirrorEnabled(e){if("boolean"!=typeof e)throw new TypeError("Mirror setting must be a boolean.");this.#te=e}getTarget(){return this.#j}getJail(){return this.#fe}getDragProxy(){return this.#ce}getLastCollision(){return this.#le}getCollidables(){return[...this.#ue]}getDragHiddenClass(){return this.#de}getClassDragging(){return this.#pe}getClassBodyDragging(){return this.#me}getClassJailDragging(){return this.#ge}getClassJailDragDisabled(){return this.#ye}getClassDragCollision(){return this.#be}getVibrations(){return{...this.#he}}getStartVibration(){return this.#he.start}getEndVibration(){return this.#he.end}getCollideVibration(){return this.#he.collide}getMoveVibration(){return this.#he.move}isEnabled(){return this.#Q}#Ce(){if(this.#K)throw new Error("This TinyDragger instance has been destroyed and can no longer be used.")}destroy(){this.#K||(this.disable(),this.#j.removeEventListener("mousedown",this._onMouseDown),this.#j.removeEventListener("touchstart",this._onTouchStart),document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("touchend",this._onTouchEnd),this.#le&&this.#Ae(),this.#ce&&(this.#te?this.#ce.remove():Object.assign(this.#ce.style,{position:"",pointerEvents:"",left:"",top:"",width:"",height:"",zIndex:""}),this.#ce=null),this.#ue=[],this.#oe=!1,this.#le=null,this.#te&&this.#j.classList.remove(this.#de),this.#j.classList.remove(this.#pe),document.body.classList.remove(this.#me),this.#fe&&this.#fe.classList.remove(this.#ge,this.#ye),this.#K=!0)}}const dt=ft,pt=class{#_e=[];#Me=!1;#Ne=!1;#Be=[];#Ie(){this.#Me&&Promise.all(this.#Be).then((()=>{this.#Ne=!0,this.#Pe(!1)})).catch((e=>{console.error("[TinyDomReadyManager] Promise rejected:",e)}))}#Pe(e){this.#_e.filter((t=>t.domOnly===e)).sort(((e,t)=>t.priority-e.priority)).forEach((e=>this.#Re(e))),this.#_e=this.#_e.filter((t=>!(t.once&&(!e||t.domOnly))))}#Re(e){if("function"==typeof e.filter)try{if(!e.filter())return}catch(e){return void console.warn("[TinyDomReadyManager] Filter error:",e)}try{e.fn()}catch(e){console.error("[TinyDomReadyManager] Handler error:",e)}}_markDomReady(){this.#Me=!0,this.#Pe(!0),this.#Ie()}init(){if(this.#Me)throw new Error("[TinyDomReadyManager] init() has already been called.");"interactive"===document.readyState||"complete"===document.readyState?this._markDomReady():document.addEventListener("DOMContentLoaded",(()=>this._markDomReady()))}addPromise(e){if(!(e instanceof Promise))throw new TypeError("[TinyDomReadyManager] promise must be a valid Promise.");this.#Ne||(this.#Be.push(e),this.#Me&&this.#Ie())}onReady(e,{once:t=!0,priority:r=0,filter:n=null,domOnly:i=!1}={}){if("function"!=typeof e)throw new TypeError("[TinyDomReadyManager] fn must be a function.");const o={fn:e,once:t,priority:r,filter:n,domOnly:i};if(i&&this.#Me)return this.#Re(o),void(t||this.#_e.push(o));!i&&this.#Ne?this.#Re(o):this.#_e.push(o)}isReady(){return this.#Ne}isDomReady(){return this.#Me}},mt=class{#Oe=!1;#He=!1;#Fe=null;#We=100;#je=null;#$e;constructor({audio:e=null,defaultIcon:t=null,bodyLimit:r=100,defaultOnClick:n=function(e){e.preventDefault(),window.focus&&window.focus(),this.close()}}={}){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("audio must be an instance of HTMLAudioElement or null.");if(null!==t&&"string"!=typeof t)throw new TypeError("defaultIcon must be a string or null.");if(!Number.isFinite(r)||r<0)throw new TypeError("bodyLimit must be a non-negative number.");if("function"!=typeof n)throw new TypeError("defaultOnClick must be a function.");this.#Fe="string"!=typeof e?e:new Audio(e),this.#je=t,this.#We=r,this.#$e=n}requestPerm(){const e=this;return new Promise(((t,r)=>{e.isCompatible()?"default"===Notification.permission?Notification.requestPermission().then((r=>{this.#He=!0,e.#Oe="granted"===r,t(e.#Oe)})).catch(r):(this.#He=!0,e.#Oe="granted"===Notification.permission,t(e.#Oe)):(this.#He=!0,e.#Oe=!1,t(!1))}))}isCompatible(){return"Notification"in window}send(e,t={}){if(!this.#He)throw new Error("You must call requestPerm() before sending a notification.");if("string"!=typeof e)throw new TypeError("title must be a string.");if("object"!=typeof t||null===t)throw new TypeError("config must be a non-null object.");if(!this.#Oe)return null;const{icon:r=this.#je||void 0,vibrate:n=[200,100,200]}=t,i={...t};"string"==typeof r&&(i.icon=r),Array.isArray(n)&&(i.vibrate=n),"string"==typeof i.body&&(i.body=H(i.body,this.#We));const o=new Notification(e,i);return o.addEventListener("show",(()=>{this.#Fe instanceof HTMLAudioElement&&(this.#Fe.currentTime=0,this.#Fe.play().catch((e=>console.error(e))))})),"function"==typeof this.#$e&&o.addEventListener("click",this.#$e),o}wasPermissionRequested(){return this.#He}isAllowed(){return this.#Oe}getAudio(){return this.#Fe}setAudio(e){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("sound must be an instance of HTMLAudioElement or null.");this.#Fe="string"!=typeof e?e:new Audio(e)}getBodyLimit(){return this.#We}setBodyLimit(e){if(!Number.isFinite(e)||e<0)throw new TypeError("bodyLimit must be a non-negative number.");this.#We=e}getDefaultAvatar(){return this.#je}setDefaultAvatar(e){if("string"!=typeof e&&null!==e)throw new TypeError("defaultIcon must be a string or null.");this.#je=e}getDefaultOnClick(){return this.#$e}setDefaultOnClick(e){if("function"!=typeof e)throw new TypeError("defaultOnClick must be a function.");this.#$e=e}},gt=class{#Ue;lastScrollTime=0;#Je=[];#qe=100;#Ve=new Set;#K=!1;constructor(e=window,t=100){if(!(e instanceof Element||e instanceof Window))throw new TypeError("scrollTarget must be an Element or the Window object.");this.#Ue=e,this._onScroll=this._onScroll.bind(this),this._checkQueue=this._checkQueue.bind(this),this.#Ue.addEventListener("scroll",this._onScroll),this.#qe=t,requestAnimationFrame(this._checkQueue)}get inactivityTime(){return this.#qe}set inactivityTime(e){if("number"!=typeof e||e<=0||!Number.isFinite(e))throw new Error("inactivityTime must be a positive number in milliseconds.");this.#qe=e}_onScroll(){this.lastScrollTime=Date.now()}_checkQueue(){if(!this.#K&&(requestAnimationFrame(this._checkQueue),Date.now()-this.lastScrollTime>this.#qe))for(;this.#Je.length;){const e=this.#Je.pop();"function"==typeof e&&e()}}doAfterScroll(e){if("function"!=typeof e)throw new TypeError("Argument must be a function.");this.lastScrollTime=Date.now(),this.#Je.push(e)}onScroll(e){if("function"!=typeof e)throw new TypeError("Argument must be a function.");this.#Ue.addEventListener("scroll",e),this.#Ve.add(e)}offScroll(e){if("function"!=typeof e)throw new TypeError("Argument must be a function.");this.#Ve.has(e)&&(this.#Ue.removeEventListener("scroll",e),this.#Ve.delete(e))}destroy(){if(!this.#K){this.#K=!0,this.#Ue.removeEventListener("scroll",this._onScroll);for(const e of this.#Ve)this.#Ue.removeEventListener("scroll",e);this.#Ve.clear()}}}})(),window.TinyEssentials=n})();
|