tiny-essentials 1.13.0 โ 1.13.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/README.md +1 -0
- package/dist/v1/TinyBasicsEs.js +38 -0
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.js +38 -0
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/basics/index.cjs +1 -0
- package/dist/v1/basics/index.d.mts +2 -1
- package/dist/v1/basics/index.mjs +2 -2
- package/dist/v1/basics/simpleMath.cjs +38 -0
- package/dist/v1/basics/simpleMath.d.mts +24 -0
- package/dist/v1/basics/simpleMath.mjs +29 -0
- package/dist/v1/index.cjs +1 -0
- package/dist/v1/index.d.mts +2 -1
- package/dist/v1/index.mjs +2 -2
- package/docs/v1/basics/simpleMath.md +28 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,6 +66,7 @@ Check out the full documentation here:
|
|
|
66
66
|
- ๐ [**tiny-crypto-suite**](https://github.com/JasminDreasond/Tiny-Crypto-Suite) โ Lightweight cryptography toolkit.
|
|
67
67
|
- ๐ฅ๏ธ [**tiny-server-essentials**](https://github.com/JasminDreasond/Tiny-Server-Essentials) โ Node.js server utilities.
|
|
68
68
|
- ๐ช [**tiny-electron-essentials**](https://github.com/JasminDreasond/Tiny-Electron-Essentials) โ Essential tools for Electron apps.
|
|
69
|
+
- ๐๏ธ [**puddysql**](https://github.com/JasminDreasond/PuddySQL) โ Smart SQL engine for structured data, tags, and advanced queries.
|
|
69
70
|
|
|
70
71
|
---
|
|
71
72
|
|
package/dist/v1/TinyBasicsEs.js
CHANGED
|
@@ -2156,6 +2156,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
2156
2156
|
formatCustomTimer: () => (/* reexport */ formatCustomTimer),
|
|
2157
2157
|
formatDayTimer: () => (/* reexport */ formatDayTimer),
|
|
2158
2158
|
formatTimer: () => (/* reexport */ formatTimer),
|
|
2159
|
+
genFibonacciSeq: () => (/* reexport */ genFibonacciSeq),
|
|
2159
2160
|
getAge: () => (/* reexport */ getAge),
|
|
2160
2161
|
getHtmlElBorders: () => (/* reexport */ getHtmlElBorders),
|
|
2161
2162
|
getHtmlElBordersWidth: () => (/* reexport */ getHtmlElBordersWidth),
|
|
@@ -3352,6 +3353,43 @@ function formatBytes(bytes, decimals = null, maxUnit = null) {
|
|
|
3352
3353
|
return { unit, value };
|
|
3353
3354
|
}
|
|
3354
3355
|
|
|
3356
|
+
/**
|
|
3357
|
+
* Generates a Fibonacci-like sequence as an array of vectors.
|
|
3358
|
+
*
|
|
3359
|
+
* @param {Object} [settings={}]
|
|
3360
|
+
* @param {number[]} [settings.baseValues=[0, 1]] - An array of two starting numbers (e.g. [0, 1] or [1, 1]).
|
|
3361
|
+
* @param {number} [settings.length=10] - Total number of items to generate in the sequence.
|
|
3362
|
+
* @param {(a: number, b: number, index: number) => number} [settings.combiner=((a, b) => a + b)] - A custom function to combine previous two numbers.
|
|
3363
|
+
* @returns {number[]} The resulting Fibonacci sequence.
|
|
3364
|
+
*
|
|
3365
|
+
* FibonacciVectors2D
|
|
3366
|
+
* @example
|
|
3367
|
+
* generateFibonacciSequence({
|
|
3368
|
+
* baseValues: [[0, 1], [1, 1]],
|
|
3369
|
+
* length: 10,
|
|
3370
|
+
* combiner: ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2]
|
|
3371
|
+
* });
|
|
3372
|
+
*
|
|
3373
|
+
* @beta
|
|
3374
|
+
*/
|
|
3375
|
+
function genFibonacciSeq({
|
|
3376
|
+
baseValues = [0, 1],
|
|
3377
|
+
length = 10,
|
|
3378
|
+
combiner = (a, b) => a + b,
|
|
3379
|
+
} = {}) {
|
|
3380
|
+
if (!Array.isArray(baseValues) || baseValues.length !== 2)
|
|
3381
|
+
throw new Error('baseValues must be an array of exactly two numbers');
|
|
3382
|
+
|
|
3383
|
+
const sequence = [...baseValues.slice(0, 2)];
|
|
3384
|
+
|
|
3385
|
+
for (let i = 2; i < length; i++) {
|
|
3386
|
+
const next = combiner(sequence[i - 2], sequence[i - 1], i);
|
|
3387
|
+
sequence.push(next);
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
return sequence;
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3355
3393
|
;// ./src/v1/basics/text.mjs
|
|
3356
3394
|
/**
|
|
3357
3395
|
* Converts a string to title case where the first letter of each word is capitalized.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see TinyBasicsEs.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,u=8*o-n-1,a=(1<<u)-1,f=a>>1,l=-7,h=r?o-1:0,c=r?-1:1,p=t[e+h];for(h+=c,i=p&(1<<-l)-1,p>>=-l,l+=u;l>0;i=256*i+t[e+h],h+=c,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=c,l-=8);if(0===i)i=1-f;else{if(i===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,u,a,f=8*i-o-1,l=(1<<f)-1,h=l>>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+h>=1?c/a:c*Math.pow(2,1-h))*a>=2&&(s++,a/=2),s+h>=l?(u=0,s=l):s+h>=1?(u=(e*a-1)*Math.pow(2,o),s+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&u,p+=y,u/=256,o-=8);for(s=s<<o|u,f+=o;f>0;t[r+p]=255&s,p+=y,s/=256,f-=8);t[r+p-y]|=128*g}},287:(t,e,r)=>{"use strict";var n=r(526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=a,e.IS=50;var s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|g(t,e),n=u(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);var o=function(t){if(a.isBuffer(t)){var e=0|y(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?u(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),u(t<0?0:0|y(t))}function c(t){for(var e=t.length<0?0:0|y(t.length),r=u(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,a.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(o)return n?-1:P(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return U(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=r;i<u;i++)if(f(t,i)===f(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===a)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(r+a>u&&(r=u-a),i=r;i>=0;i--){for(var h=!0,c=0;c<a;c++)if(f(t,i+c)!==f(e,c)){h=!1;break}if(h)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(q(u))return s;t[r+s]=u}return s}function E(t,e,r,n){return z(P(e,t.length-r),t,r,n)}function A(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function B(t,e,r,n){return z(D(e),t,r,n)}function S(t,e,r,n){return z(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function U(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,u,a,f=t[o],l=null,h=f>239?4:f>223?3:f>191?2:1;if(o+h<=r)switch(h){case 1:f<128&&(l=f);break;case 2:128==(192&(i=t[o+1]))&&(a=(31&f)<<6|63&i)>127&&(l=a);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(a=(15&f)<<12|(63&i)<<6|63&s)>2047&&(a<55296||a>57343)&&(l=a);break;case 4:i=t[o+1],s=t[o+2],u=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&u)&&(a=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(l=a)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=h}return function(t){var e=t.length;if(e<=F)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=F));return r}(n)}a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),a.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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},a.allocUnsafe=function(t){return h(t)},a.allocUnsafeSlow=function(t){return h(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(W(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).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}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(W(i,Uint8Array))o+i.length>n.length?a.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},a.byteLength=g,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?U(this,0,t):d.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,o){if(W(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),u=Math.min(i,s),f=this.slice(n,o),l=t.slice(e,r),h=0;h<u;++h)if(f[h]!==l[h]){i=f[h],s=l[h];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return B(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var F=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function N(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=Y[t[i]];return o}function L(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,i){return e=+e,r>>>=0,i||I(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,i){return e=+e,r>>>=0,i||I(t,0,r,8),o.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=0,s=1,u=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=r-1,s=1,u=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=a.isBuffer(t)?t:a.from(t,n),u=s.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};var k=/[^+/0-9A-Za-z-_]/g;function P(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function D(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var Y=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}()},526:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[l++]=e>>16&255,f[l++]=e>>8&255,f[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[l++]=e>>8&255,f[l++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,u=0,f=n-o;u<f;u+=s)i.push(a(t,u,u+s>f?f:u+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,n){for(var o,i,s=[],u=e;u<n;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";function t(t,e=!1){return e?function(e,r){return e[t]>r[t]?-1:e[t]<r[t]?1:0}:function(e,r){return e[t]<r[t]?-1:e[t]>r[t]?1:0}}async function e(t,e,r){const n=[];t.replace(e,((t,...e)=>(n.push(r(t,...e)),t)));const o=await Promise.all(n);return t.replace(e,(()=>o.shift()))}function o(t){let e,r=t.length;for(;0!==r;)e=Math.floor(Math.random()*r),r--,[t[r],t[e]]=[t[e],t[r]];return t}function i(t=new Date,e="asSeconds",r=null){if(t instanceof Date){const n=r instanceof Date?r:new Date,o=t.getTime()-n.getTime();switch(e){case"asMilliseconds":return o;case"asSeconds":default:return o/1e3;case"asMinutes":return o/6e4;case"asHours":return o/36e5;case"asDays":return o/864e5}}return null}function s(t,e="seconds",r="{time}"){t=Math.max(0,Math.floor(t));const n=["seconds","minutes","hours","days","months","years"].indexOf(e),o=n>=5,i=n>=4,s=n>=3,u=n>=2,a=n>=1,f=n>=0,l={years:o?0:NaN,months:i?0:NaN,days:s?0:NaN,hours:u?0:NaN,minutes:a?0:NaN,seconds:f?0:NaN,total:NaN};let h=t;if(o||i||s){const t=new Date(1980,0,1),e=new Date(t.getTime()+1e3*h),r=new Date(t);if(o)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=e.getTime();)r.setFullYear(r.getFullYear()+1),l.years++;if(i)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=e.getTime();)r.setMonth(r.getMonth()+1),l.months++;if(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=e.getTime();)r.setDate(r.getDate()+1),l.days++;h=Math.floor((e.getTime()-r.getTime())/1e3)}u&&(l.hours=Math.floor(h/3600),h%=3600),a&&(l.minutes=Math.floor(h/60),h%=60),f&&(l.seconds=h);const c={seconds:f?t:NaN,minutes:a?t/60:NaN,hours:u?t/3600:NaN,days:s?t/86400:NaN,months:i?12*l.years+l.months+(l.days||0)/30:NaN,years:o?l.years+(l.months||0)/12+(l.days||0)/365:NaN};l.total=+(c[e]||0).toFixed(2).replace(/\.00$/,"");const p=t=>{const e="string"==typeof t?parseInt(t):t;return Number.isNaN(e)?"NaN":String(e).padStart(2,"0")},y=[u?p(l.hours):null,a?p(l.minutes):null,f?p(l.seconds):null].filter((t=>null!==t)).join(":");return r.replace(/\{years\}/g,String(l.years)).replace(/\{months\}/g,String(l.months)).replace(/\{days\}/g,String(l.days)).replace(/\{hours\}/g,p(l.hours)).replace(/\{minutes\}/g,p(l.minutes)).replace(/\{seconds\}/g,p(l.seconds)).replace(/\{time\}/g,y).replace(/\{total\}/g,String(l.total)).trim()}function u(t){return s(t,"hours","{hours}:{minutes}:{seconds}")}function a(t){return s(t,"days","{days}d {hours}:{minutes}:{seconds}")}r.r(n),r.d(n,{addAiMarkerShortcut:()=>W,areHtmlElsColliding:()=>b,arraySortPositions:()=>t,asyncReplace:()=>e,cloneObjTypeOrder:()=>y,countObj:()=>m,documentIsFullScreen:()=>F,exitFullScreen:()=>L,extendObjType:()=>c,fetchJson:()=>A,formatBytes:()=>P,formatCustomTimer:()=>s,formatDayTimer:()=>a,formatTimer:()=>u,getAge:()=>k,getHtmlElBorders:()=>S,getHtmlElBordersWidth:()=>B,getHtmlElMargin:()=>T,getHtmlElPadding:()=>U,getSimplePerc:()=>j,getTimeDuration:()=>i,isFullScreenMode:()=>N,isJsonObject:()=>w,isScreenFilled:()=>M,objType:()=>d,offFullScreenChange:()=>I,onFullScreenChange:()=>R,readJsonBlob:()=>v,reorderObjTypeOrder:()=>p,requestFullScreen:()=>O,ruleOfThree:()=>x,saveJsonFile:()=>E,shuffleArray:()=>o,toTitleCase:()=>D,toTitleCaseLowerFirst:()=>z});var f=r(287);const l="undefined"!=typeof window&&void 0!==window.document,h={items:{},order:[]};function c(t,e){const r=[],n=Array.isArray(t)?t:Object.entries(t);for(const[t,o]of n)if(!h.items.hasOwnProperty(t)){h.items[t]=o;let n="number"==typeof e?e:-1;if(-1===n){const t=h.order.indexOf("object");n=t>-1?t:h.order.length}n=Math.min(Math.max(0,n),h.order.length),h.order.splice(n,0,t),r.push(t)}return r}function p(t){const e=[...h.order];return!!t.every((t=>e.includes(t)))&&(h.order=t.slice(),!0)}function y(){return[...h.order]}const g=t=>{if(null===t)return"null";for(const e of h.order)if("function"!=typeof h.items[e]||h.items[e](t))return e;return"unknown"};function d(t,e){if(void 0===t)return null;const r=g(t);return"string"==typeof e?r===e.toLowerCase():r}function m(t){return Array.isArray(t)?t.length:d(t,"object")?Object.keys(t).length:0}function w(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t)}function b(t,e){const r=t.getBoundingClientRect(),n=e.getBoundingClientRect();return!(r.right<n.left||r.left>n.right||r.bottom<n.top||r.top>n.bottom)}function v(t){return new Promise(((e,r)=>{const n=new FileReader;n.onload=()=>{try{const t=JSON.parse(n.result);e(t)}catch(e){r(new Error(`Invalid JSON in file: ${t.name}\n${e.message}`))}},n.onerror=()=>{r(new Error(`Error reading file: ${t.name}`))},n.readAsText(t)}))}function E(t,e,r=2){const n=JSON.stringify(e,null,r),o=new Blob([n],{type:"application/json"}),i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}async function A(t,{method:e="GET",body:r,timeout:n=0,retries:o=0,headers:i={},signal:s=null}={}){if("string"!=typeof t||!t.startsWith("../")&&!t.startsWith("./")&&!t.startsWith("/")&&!t.startsWith("https://")&&!t.startsWith("http://"))throw new Error("Invalid URL: must be a valid http or https address.");if("string"!=typeof e||!e.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 o||!Number.isFinite(o)||Number.isNaN(o)||o<0)throw new Error("Invalid retries: must be a positive number.")}const u=s?1:o+1;let a=null;for(let f=0;f<u;f++){const u=s?null:new AbortController,l=s||(u?.signal??null),h=!s&&n&&u?setTimeout((()=>u.abort()),n):null;try{const n=await fetch(t,{method:e.toUpperCase(),headers:{Accept:"application/json",...i},body:void 0!==r?w(r)?JSON.stringify(r):r:void 0,signal:l});if(h&&clearTimeout(h),!n.ok)throw new Error(`HTTP error: ${n.status} ${n.statusText}`);const o=n.headers.get("content-type")||"";if(!o.includes("application/json"))throw new Error(`Unexpected content-type: ${o}`);const s=await n.json();if(!w(s))throw new Error("Received invalid data instead of valid JSON.");return s}catch(t){if(a=t,s)break;f<o&&await new Promise((t=>setTimeout(t,300*(f+1))))}}throw new Error(`Failed to fetch JSON from "${t}"${a?`: ${a.message}`:"."}`)}c([["undefined",t=>void 0===t],["null",t=>null===t],["boolean",t=>"boolean"==typeof t],["number",t=>"number"==typeof t&&!Number.isNaN(t)],["bigint",t=>"bigint"==typeof t],["string",t=>"string"==typeof t],["symbol",t=>"symbol"==typeof t],["function",t=>"function"==typeof t],["array",t=>Array.isArray(t)]]),l||c([["buffer",t=>void 0!==f.hp&&f.hp.isBuffer(t)]]),l&&c([["file",t=>"undefined"!=typeof File&&t instanceof File]]),c([["date",t=>t instanceof Date],["regexp",t=>t instanceof RegExp],["map",t=>t instanceof Map],["set",t=>t instanceof Set],["weakmap",t=>t instanceof WeakMap],["weakset",t=>t instanceof WeakSet],["promise",t=>t instanceof Promise]]),l&&c([["htmlelement",t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement]]),c([["object",t=>w(t)]]);const B=t=>{const e=getComputedStyle(t),r=parseFloat(e.borderLeftWidth)||0,n=parseFloat(e.borderRightWidth)||0,o=parseFloat(e.borderTopWidth)||0,i=parseFloat(e.borderBottomWidth)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},S=t=>{const e=getComputedStyle(t),r=parseFloat(e.borderLeft)||0,n=parseFloat(e.borderRight)||0,o=parseFloat(e.borderTop)||0,i=parseFloat(e.borderBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},T=t=>{const e=getComputedStyle(t),r=parseFloat(e.marginLeft)||0,n=parseFloat(e.marginRight)||0,o=parseFloat(e.marginTop)||0,i=parseFloat(e.marginBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},U=t=>{const e=getComputedStyle(t),r=parseFloat(e.paddingLeft)||0,n=parseFloat(e.paddingRight)||0,o=parseFloat(e.paddingTop)||0,i=parseFloat(e.paddingBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},F=()=>!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen),M=()=>window.innerHeight===screen.height&&window.innerWidth===screen.width,N=()=>F()||M(),O=t=>new Promise((async(e,r)=>{const n=document.documentElement;try{n.requestFullscreen?await n.requestFullscreen(t):n.mozRequestFullScreen?n.mozRequestFullScreen(t):n.webkitRequestFullScreen?n.webkitRequestFullScreen(t):n.msRequestFullscreen&&n.msRequestFullscreen(t),e()}catch(t){r(t)}})),L=()=>new Promise(((t,e)=>{if(document.exitFullscreen)document.exitFullscreen().then(t).catch(e);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()}t()}catch(t){e(t)}})),C=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],R=(t,e)=>{C.forEach((r=>{document.addEventListener(r,t,e)}))},I=(t,e)=>{C.forEach((r=>{document.removeEventListener(r,t,e)}))};function x(t,e,r,n=!1){return n?Number(t*e)/r:Number(r*e)/t}function j(t,e){return t*(e/100)}function k(t=0,e=null){if(null!=t&&0!==t){const r=new Date(t);if(Number.isNaN(r.getTime()))return null;const n=e instanceof Date?e:new Date;let o=n.getFullYear()-r.getFullYear();const i=n.getMonth(),s=r.getMonth(),u=n.getDate(),a=r.getDate();return(i<s||i===s&&u<a)&&o--,Math.abs(o)}return null}function P(t,e=null,r=null){if("number"!=typeof t||t<0)return{unit:null,value:null};if(0===t)return{unit:"Bytes",value:0};const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=r&&n.includes(r)?n.indexOf(r):n.length-1,i=Math.min(Math.floor(Math.log(t)/Math.log(1024)),o);let s=t/Math.pow(1024,i);if(null!==e){const t=e<0?0:e;s=parseFloat(s.toFixed(t))}return{unit:n[i],value:s}}function D(t){return t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function z(t){const e=t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()));return e.charAt(0).toLowerCase()+e.slice(1)}function W(t="a"){"undefined"!=typeof HTMLElement?document.addEventListener("keydown",(function(e){if(e.ctrlKey&&e.altKey&&e.key.toLowerCase()===t){if(e.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.")}})(),window.TinyBasicsEs=n})();
|
|
2
|
+
(()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,u=8*o-n-1,a=(1<<u)-1,f=a>>1,l=-7,h=r?o-1:0,c=r?-1:1,p=t[e+h];for(h+=c,i=p&(1<<-l)-1,p>>=-l,l+=u;l>0;i=256*i+t[e+h],h+=c,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=c,l-=8);if(0===i)i=1-f;else{if(i===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,u,a,f=8*i-o-1,l=(1<<f)-1,h=l>>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+h>=1?c/a:c*Math.pow(2,1-h))*a>=2&&(s++,a/=2),s+h>=l?(u=0,s=l):s+h>=1?(u=(e*a-1)*Math.pow(2,o),s+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&u,p+=y,u/=256,o-=8);for(s=s<<o|u,f+=o;f>0;t[r+p]=255&s,p+=y,s/=256,f-=8);t[r+p-y]|=128*g}},287:(t,e,r)=>{"use strict";var n=r(526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=a,e.IS=50;var s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|g(t,e),n=u(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);var o=function(t){if(a.isBuffer(t)){var e=0|y(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?u(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),u(t<0?0:0|y(t))}function c(t){for(var e=t.length<0?0:0|y(t.length),r=u(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,a.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(o)return n?-1:P(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return U(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=r;i<u;i++)if(f(t,i)===f(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===a)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(r+a>u&&(r=u-a),i=r;i>=0;i--){for(var h=!0,c=0;c<a;c++)if(f(t,i+c)!==f(e,c)){h=!1;break}if(h)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(q(u))return s;t[r+s]=u}return s}function E(t,e,r,n){return z(P(e,t.length-r),t,r,n)}function A(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function B(t,e,r,n){return z(D(e),t,r,n)}function S(t,e,r,n){return z(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function U(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,u,a,f=t[o],l=null,h=f>239?4:f>223?3:f>191?2:1;if(o+h<=r)switch(h){case 1:f<128&&(l=f);break;case 2:128==(192&(i=t[o+1]))&&(a=(31&f)<<6|63&i)>127&&(l=a);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(a=(15&f)<<12|(63&i)<<6|63&s)>2047&&(a<55296||a>57343)&&(l=a);break;case 4:i=t[o+1],s=t[o+2],u=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&u)&&(a=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(l=a)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=h}return function(t){var e=t.length;if(e<=F)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=F));return r}(n)}a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),a.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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},a.allocUnsafe=function(t){return h(t)},a.allocUnsafeSlow=function(t){return h(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(W(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).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}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(W(i,Uint8Array))o+i.length>n.length?a.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},a.byteLength=g,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?U(this,0,t):d.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,o){if(W(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),u=Math.min(i,s),f=this.slice(n,o),l=t.slice(e,r),h=0;h<u;++h)if(f[h]!==l[h]){i=f[h],s=l[h];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return B(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var F=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function N(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=Y[t[i]];return o}function L(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function x(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,i){return e=+e,r>>>=0,i||x(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,i){return e=+e,r>>>=0,i||x(t,0,r,8),o.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=0,s=1,u=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=r-1,s=1,u=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=a.isBuffer(t)?t:a.from(t,n),u=s.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};var k=/[^+/0-9A-Za-z-_]/g;function P(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function D(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var Y=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}()},526:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[l++]=e>>16&255,f[l++]=e>>8&255,f[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[l++]=e>>8&255,f[l++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,u=0,f=n-o;u<f;u+=s)i.push(a(t,u,u+s>f?f:u+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,n){for(var o,i,s=[],u=e;u<n;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";function t(t,e=!1){return e?function(e,r){return e[t]>r[t]?-1:e[t]<r[t]?1:0}:function(e,r){return e[t]<r[t]?-1:e[t]>r[t]?1:0}}async function e(t,e,r){const n=[];t.replace(e,((t,...e)=>(n.push(r(t,...e)),t)));const o=await Promise.all(n);return t.replace(e,(()=>o.shift()))}function o(t){let e,r=t.length;for(;0!==r;)e=Math.floor(Math.random()*r),r--,[t[r],t[e]]=[t[e],t[r]];return t}function i(t=new Date,e="asSeconds",r=null){if(t instanceof Date){const n=r instanceof Date?r:new Date,o=t.getTime()-n.getTime();switch(e){case"asMilliseconds":return o;case"asSeconds":default:return o/1e3;case"asMinutes":return o/6e4;case"asHours":return o/36e5;case"asDays":return o/864e5}}return null}function s(t,e="seconds",r="{time}"){t=Math.max(0,Math.floor(t));const n=["seconds","minutes","hours","days","months","years"].indexOf(e),o=n>=5,i=n>=4,s=n>=3,u=n>=2,a=n>=1,f=n>=0,l={years:o?0:NaN,months:i?0:NaN,days:s?0:NaN,hours:u?0:NaN,minutes:a?0:NaN,seconds:f?0:NaN,total:NaN};let h=t;if(o||i||s){const t=new Date(1980,0,1),e=new Date(t.getTime()+1e3*h),r=new Date(t);if(o)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=e.getTime();)r.setFullYear(r.getFullYear()+1),l.years++;if(i)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=e.getTime();)r.setMonth(r.getMonth()+1),l.months++;if(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=e.getTime();)r.setDate(r.getDate()+1),l.days++;h=Math.floor((e.getTime()-r.getTime())/1e3)}u&&(l.hours=Math.floor(h/3600),h%=3600),a&&(l.minutes=Math.floor(h/60),h%=60),f&&(l.seconds=h);const c={seconds:f?t:NaN,minutes:a?t/60:NaN,hours:u?t/3600:NaN,days:s?t/86400:NaN,months:i?12*l.years+l.months+(l.days||0)/30:NaN,years:o?l.years+(l.months||0)/12+(l.days||0)/365:NaN};l.total=+(c[e]||0).toFixed(2).replace(/\.00$/,"");const p=t=>{const e="string"==typeof t?parseInt(t):t;return Number.isNaN(e)?"NaN":String(e).padStart(2,"0")},y=[u?p(l.hours):null,a?p(l.minutes):null,f?p(l.seconds):null].filter((t=>null!==t)).join(":");return r.replace(/\{years\}/g,String(l.years)).replace(/\{months\}/g,String(l.months)).replace(/\{days\}/g,String(l.days)).replace(/\{hours\}/g,p(l.hours)).replace(/\{minutes\}/g,p(l.minutes)).replace(/\{seconds\}/g,p(l.seconds)).replace(/\{time\}/g,y).replace(/\{total\}/g,String(l.total)).trim()}function u(t){return s(t,"hours","{hours}:{minutes}:{seconds}")}function a(t){return s(t,"days","{days}d {hours}:{minutes}:{seconds}")}r.r(n),r.d(n,{addAiMarkerShortcut:()=>q,areHtmlElsColliding:()=>b,arraySortPositions:()=>t,asyncReplace:()=>e,cloneObjTypeOrder:()=>y,countObj:()=>m,documentIsFullScreen:()=>F,exitFullScreen:()=>L,extendObjType:()=>c,fetchJson:()=>A,formatBytes:()=>P,formatCustomTimer:()=>s,formatDayTimer:()=>a,formatTimer:()=>u,genFibonacciSeq:()=>D,getAge:()=>k,getHtmlElBorders:()=>S,getHtmlElBordersWidth:()=>B,getHtmlElMargin:()=>T,getHtmlElPadding:()=>U,getSimplePerc:()=>j,getTimeDuration:()=>i,isFullScreenMode:()=>N,isJsonObject:()=>w,isScreenFilled:()=>M,objType:()=>d,offFullScreenChange:()=>x,onFullScreenChange:()=>R,readJsonBlob:()=>v,reorderObjTypeOrder:()=>p,requestFullScreen:()=>O,ruleOfThree:()=>I,saveJsonFile:()=>E,shuffleArray:()=>o,toTitleCase:()=>z,toTitleCaseLowerFirst:()=>W});var f=r(287);const l="undefined"!=typeof window&&void 0!==window.document,h={items:{},order:[]};function c(t,e){const r=[],n=Array.isArray(t)?t:Object.entries(t);for(const[t,o]of n)if(!h.items.hasOwnProperty(t)){h.items[t]=o;let n="number"==typeof e?e:-1;if(-1===n){const t=h.order.indexOf("object");n=t>-1?t:h.order.length}n=Math.min(Math.max(0,n),h.order.length),h.order.splice(n,0,t),r.push(t)}return r}function p(t){const e=[...h.order];return!!t.every((t=>e.includes(t)))&&(h.order=t.slice(),!0)}function y(){return[...h.order]}const g=t=>{if(null===t)return"null";for(const e of h.order)if("function"!=typeof h.items[e]||h.items[e](t))return e;return"unknown"};function d(t,e){if(void 0===t)return null;const r=g(t);return"string"==typeof e?r===e.toLowerCase():r}function m(t){return Array.isArray(t)?t.length:d(t,"object")?Object.keys(t).length:0}function w(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t)}function b(t,e){const r=t.getBoundingClientRect(),n=e.getBoundingClientRect();return!(r.right<n.left||r.left>n.right||r.bottom<n.top||r.top>n.bottom)}function v(t){return new Promise(((e,r)=>{const n=new FileReader;n.onload=()=>{try{const t=JSON.parse(n.result);e(t)}catch(e){r(new Error(`Invalid JSON in file: ${t.name}\n${e.message}`))}},n.onerror=()=>{r(new Error(`Error reading file: ${t.name}`))},n.readAsText(t)}))}function E(t,e,r=2){const n=JSON.stringify(e,null,r),o=new Blob([n],{type:"application/json"}),i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}async function A(t,{method:e="GET",body:r,timeout:n=0,retries:o=0,headers:i={},signal:s=null}={}){if("string"!=typeof t||!t.startsWith("../")&&!t.startsWith("./")&&!t.startsWith("/")&&!t.startsWith("https://")&&!t.startsWith("http://"))throw new Error("Invalid URL: must be a valid http or https address.");if("string"!=typeof e||!e.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 o||!Number.isFinite(o)||Number.isNaN(o)||o<0)throw new Error("Invalid retries: must be a positive number.")}const u=s?1:o+1;let a=null;for(let f=0;f<u;f++){const u=s?null:new AbortController,l=s||(u?.signal??null),h=!s&&n&&u?setTimeout((()=>u.abort()),n):null;try{const n=await fetch(t,{method:e.toUpperCase(),headers:{Accept:"application/json",...i},body:void 0!==r?w(r)?JSON.stringify(r):r:void 0,signal:l});if(h&&clearTimeout(h),!n.ok)throw new Error(`HTTP error: ${n.status} ${n.statusText}`);const o=n.headers.get("content-type")||"";if(!o.includes("application/json"))throw new Error(`Unexpected content-type: ${o}`);const s=await n.json();if(!w(s))throw new Error("Received invalid data instead of valid JSON.");return s}catch(t){if(a=t,s)break;f<o&&await new Promise((t=>setTimeout(t,300*(f+1))))}}throw new Error(`Failed to fetch JSON from "${t}"${a?`: ${a.message}`:"."}`)}c([["undefined",t=>void 0===t],["null",t=>null===t],["boolean",t=>"boolean"==typeof t],["number",t=>"number"==typeof t&&!Number.isNaN(t)],["bigint",t=>"bigint"==typeof t],["string",t=>"string"==typeof t],["symbol",t=>"symbol"==typeof t],["function",t=>"function"==typeof t],["array",t=>Array.isArray(t)]]),l||c([["buffer",t=>void 0!==f.hp&&f.hp.isBuffer(t)]]),l&&c([["file",t=>"undefined"!=typeof File&&t instanceof File]]),c([["date",t=>t instanceof Date],["regexp",t=>t instanceof RegExp],["map",t=>t instanceof Map],["set",t=>t instanceof Set],["weakmap",t=>t instanceof WeakMap],["weakset",t=>t instanceof WeakSet],["promise",t=>t instanceof Promise]]),l&&c([["htmlelement",t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement]]),c([["object",t=>w(t)]]);const B=t=>{const e=getComputedStyle(t),r=parseFloat(e.borderLeftWidth)||0,n=parseFloat(e.borderRightWidth)||0,o=parseFloat(e.borderTopWidth)||0,i=parseFloat(e.borderBottomWidth)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},S=t=>{const e=getComputedStyle(t),r=parseFloat(e.borderLeft)||0,n=parseFloat(e.borderRight)||0,o=parseFloat(e.borderTop)||0,i=parseFloat(e.borderBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},T=t=>{const e=getComputedStyle(t),r=parseFloat(e.marginLeft)||0,n=parseFloat(e.marginRight)||0,o=parseFloat(e.marginTop)||0,i=parseFloat(e.marginBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},U=t=>{const e=getComputedStyle(t),r=parseFloat(e.paddingLeft)||0,n=parseFloat(e.paddingRight)||0,o=parseFloat(e.paddingTop)||0,i=parseFloat(e.paddingBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},F=()=>!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen),M=()=>window.innerHeight===screen.height&&window.innerWidth===screen.width,N=()=>F()||M(),O=t=>new Promise((async(e,r)=>{const n=document.documentElement;try{n.requestFullscreen?await n.requestFullscreen(t):n.mozRequestFullScreen?n.mozRequestFullScreen(t):n.webkitRequestFullScreen?n.webkitRequestFullScreen(t):n.msRequestFullscreen&&n.msRequestFullscreen(t),e()}catch(t){r(t)}})),L=()=>new Promise(((t,e)=>{if(document.exitFullscreen)document.exitFullscreen().then(t).catch(e);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()}t()}catch(t){e(t)}})),C=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],R=(t,e)=>{C.forEach((r=>{document.addEventListener(r,t,e)}))},x=(t,e)=>{C.forEach((r=>{document.removeEventListener(r,t,e)}))};function I(t,e,r,n=!1){return n?Number(t*e)/r:Number(r*e)/t}function j(t,e){return t*(e/100)}function k(t=0,e=null){if(null!=t&&0!==t){const r=new Date(t);if(Number.isNaN(r.getTime()))return null;const n=e instanceof Date?e:new Date;let o=n.getFullYear()-r.getFullYear();const i=n.getMonth(),s=r.getMonth(),u=n.getDate(),a=r.getDate();return(i<s||i===s&&u<a)&&o--,Math.abs(o)}return null}function P(t,e=null,r=null){if("number"!=typeof t||t<0)return{unit:null,value:null};if(0===t)return{unit:"Bytes",value:0};const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=r&&n.includes(r)?n.indexOf(r):n.length-1,i=Math.min(Math.floor(Math.log(t)/Math.log(1024)),o);let s=t/Math.pow(1024,i);if(null!==e){const t=e<0?0:e;s=parseFloat(s.toFixed(t))}return{unit:n[i],value:s}}function D({baseValues:t=[0,1],length:e=10,combiner:r=(t,e)=>t+e}={}){if(!Array.isArray(t)||2!==t.length)throw new Error("baseValues must be an array of exactly two numbers");const n=[...t.slice(0,2)];for(let t=2;t<e;t++){const e=r(n[t-2],n[t-1],t);n.push(e)}return n}function z(t){return t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function W(t){const e=t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()));return e.charAt(0).toLowerCase()+e.slice(1)}function q(t="a"){"undefined"!=typeof HTMLElement?document.addEventListener("keydown",(function(e){if(e.ctrlKey&&e.altKey&&e.key.toLowerCase()===t){if(e.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.")}})(),window.TinyBasicsEs=n})();
|
|
@@ -2920,6 +2920,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
2920
2920
|
formatCustomTimer: () => (/* reexport */ formatCustomTimer),
|
|
2921
2921
|
formatDayTimer: () => (/* reexport */ formatDayTimer),
|
|
2922
2922
|
formatTimer: () => (/* reexport */ formatTimer),
|
|
2923
|
+
genFibonacciSeq: () => (/* reexport */ genFibonacciSeq),
|
|
2923
2924
|
getAge: () => (/* reexport */ getAge),
|
|
2924
2925
|
getHtmlElBorders: () => (/* reexport */ getHtmlElBorders),
|
|
2925
2926
|
getHtmlElBordersWidth: () => (/* reexport */ getHtmlElBordersWidth),
|
|
@@ -4132,6 +4133,43 @@ function formatBytes(bytes, decimals = null, maxUnit = null) {
|
|
|
4132
4133
|
return { unit, value };
|
|
4133
4134
|
}
|
|
4134
4135
|
|
|
4136
|
+
/**
|
|
4137
|
+
* Generates a Fibonacci-like sequence as an array of vectors.
|
|
4138
|
+
*
|
|
4139
|
+
* @param {Object} [settings={}]
|
|
4140
|
+
* @param {number[]} [settings.baseValues=[0, 1]] - An array of two starting numbers (e.g. [0, 1] or [1, 1]).
|
|
4141
|
+
* @param {number} [settings.length=10] - Total number of items to generate in the sequence.
|
|
4142
|
+
* @param {(a: number, b: number, index: number) => number} [settings.combiner=((a, b) => a + b)] - A custom function to combine previous two numbers.
|
|
4143
|
+
* @returns {number[]} The resulting Fibonacci sequence.
|
|
4144
|
+
*
|
|
4145
|
+
* FibonacciVectors2D
|
|
4146
|
+
* @example
|
|
4147
|
+
* generateFibonacciSequence({
|
|
4148
|
+
* baseValues: [[0, 1], [1, 1]],
|
|
4149
|
+
* length: 10,
|
|
4150
|
+
* combiner: ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2]
|
|
4151
|
+
* });
|
|
4152
|
+
*
|
|
4153
|
+
* @beta
|
|
4154
|
+
*/
|
|
4155
|
+
function genFibonacciSeq({
|
|
4156
|
+
baseValues = [0, 1],
|
|
4157
|
+
length = 10,
|
|
4158
|
+
combiner = (a, b) => a + b,
|
|
4159
|
+
} = {}) {
|
|
4160
|
+
if (!Array.isArray(baseValues) || baseValues.length !== 2)
|
|
4161
|
+
throw new Error('baseValues must be an array of exactly two numbers');
|
|
4162
|
+
|
|
4163
|
+
const sequence = [...baseValues.slice(0, 2)];
|
|
4164
|
+
|
|
4165
|
+
for (let i = 2; i < length; i++) {
|
|
4166
|
+
const next = combiner(sequence[i - 2], sequence[i - 1], i);
|
|
4167
|
+
sequence.push(next);
|
|
4168
|
+
}
|
|
4169
|
+
|
|
4170
|
+
return sequence;
|
|
4171
|
+
}
|
|
4172
|
+
|
|
4135
4173
|
;// ./src/v1/basics/text.mjs
|
|
4136
4174
|
/**
|
|
4137
4175
|
* Converts a string to title case where the first letter of each word is capitalized.
|
|
@@ -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 j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:j(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 k(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 S(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(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 $(j(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 D(e,t,r,n){return $(H(t),e,r,n)}function x(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 C(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 D(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 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 S(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 k(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 N(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 B(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||B(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||B(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||B(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(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||B(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||B(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||B(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||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||B(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||B(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||B(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||B(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||B(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(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 j(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 H(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:()=>F,TinyDomReadyManager:()=>ke,TinyDragDropDetector:()=>X,TinyDragger:()=>Se,TinyLevelUp:()=>t,TinyNotifyCenter:()=>U,TinyPromiseQueue:()=>j,TinyRateLimiter:()=>H,TinyToastNotify:()=>_,addAiMarkerShortcut:()=>R,areHtmlElsColliding:()=>J,arraySortPositions:()=>i,asyncReplace:()=>e,backupFile:()=>ge,checkObj:()=>v,clearDirectory:()=>ne,clearDirectoryAsync:()=>De,cloneObjTypeOrder:()=>p,countObj:()=>b,dirExists:()=>oe,dirSize:()=>de,dirSizeAsync:()=>Ae,documentIsFullScreen:()=>E,ensureCopyFile:()=>ae,ensureDirectory:()=>re,exitFullScreen:()=>C,extendObjType:()=>d,fetchJson:()=>z,fileExists:()=>ie,fileSize:()=>fe,fileSizeAsync:()=>Me,formatBytes:()=>B,formatCustomTimer:()=>a,formatDayTimer:()=>u,formatTimer:()=>l,getAge:()=>N,getHtmlElBorders:()=>W,getHtmlElBordersWidth:()=>Y,getHtmlElMargin:()=>Q,getHtmlElPadding:()=>V,getLatestBackupPath:()=>pe,getSimplePerc:()=>k,getTimeDuration:()=>s,isDirEmpty:()=>se,isDirEmptyAsync:()=>xe,isFullScreenMode:()=>D,isJsonObject:()=>w,isScreenFilled:()=>T,listDirs:()=>he,listDirsAsync:()=>Le,listFiles:()=>ce,listFilesAsync:()=>Ce,objType:()=>y,offFullScreenChange:()=>A,onFullScreenChange:()=>M,readJsonBlob:()=>G,readJsonFile:()=>ee,renameFileAddPrefixSuffix:()=>be,renameFileBatch:()=>ye,renameFileNormalizeCase:()=>we,renameFilePadNumbers:()=>Ee,renameFileRegex:()=>ve,reorderObjTypeOrder:()=>g,requestFullScreen:()=>x,restoreLatestBackup:()=>me,ruleOfThree:()=>S,saveJsonFile:()=>q,shuffleArray:()=>o,toTitleCase:()=>O,toTitleCaseLowerFirst:()=>I,tryDeleteFile:()=>le,writeJsonFile:()=>te,writeTextFile:()=>ue});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,D=()=>E()||T(),x=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)}})),C=()=>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 S(e,t,r,n=!1){return n?Number(e*t)/r:Number(r*t)/e}function k(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 O(e){return e.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()))}function I(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 R(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.")}class P{#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={...P.#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={...P.#t.default}}loadColorPreset(e){const t=P.#t[e];if(!t)throw new Error(`Preset "${e}" not found.`);this.#e={...t}}saveColorPreset(e,t){P.#t[e]={...t}}getAvailablePresets(){return Object.keys(P.#t)}}const F=P,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}},H=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;#D=0;#x=99;#C=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.#C)}#S(e){this.#D=Math.max(0,e),this.#w.setAttribute("data-value",String(this.#D)),this.#w.textContent=this.#D>this.#x?`${this.#x}+`:String(this.#D)}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.#C=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.#S(this.#D-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.#S(this.#D+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.#S(e)}get count(){return this.#D}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.#D=0,this.#M=new WeakMap}}const U=$,_=class{#k;#N;#B;#O;#I;#R;constructor(e="top",t="right",r=3e3,n=50,i=300,o=".notify-container"){this.#P(e),this.#F(t),this.#j(r,"baseDuration"),this.#j(n,"extraPerChar"),this.#j(i,"fadeOutDuration"),this.#k=e,this.#N=t,this.#B=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".`)}#j(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.#k}setY(e){this.#P(e);const t=this.getContainer();t.classList.remove(this.#k),t.classList.add(e),this.#k=e}getX(){return this.#N}setX(e){this.#F(e);const t=this.getContainer();t.classList.remove(this.#N),t.classList.add(e),this.#N=e}getBaseDuration(){return this.#B}setBaseDuration(e){this.#j(e,"baseDuration"),this.#B=e}getExtraPerChar(){return this.#O}setExtraPerChar(e){this.#j(e,"extraPerChar"),this.#O=e}getFadeOutDuration(){return this.#I}setFadeOutDuration(e){this.#j(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.#B+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)}};function J(e,t){const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return!(r.right<n.left||r.left>n.right||r.bottom<n.top||r.top>n.bottom)}function G(e){return new Promise(((t,r)=>{const n=new FileReader;n.onload=()=>{try{const e=JSON.parse(n.result);t(e)}catch(t){r(new Error(`Invalid JSON in file: ${e.name}\n${t.message}`))}},n.onerror=()=>{r(new Error(`Error reading file: ${e.name}`))},n.readAsText(e)}))}function q(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 z(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(!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 Y=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}},W=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}},Q=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}},V=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}},X=class{#H;#$;#U;#_;#J;#G;#q;#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.#H=a,this.#$=r,this.#U=n,this.#_=i||(()=>{}),this.#J=o,this.#G=s,this.#q=!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.#H}getHoverClass(){return this.#U}isFullScreen(){return this.#$}isDragging(){return this.#q}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}#W(){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.#q){const t=this.getTarget();this.#q=!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.#q=!1,t.classList.remove(this.#U),this.#G(e))}_handleDrop(e){if(e.preventDefault(),!e.dataTransfer)return void console.warn("[TinyDragDropDetector] [handleDrop] DragOver event missing dataTransfer.");const t=this.getTarget();this.#q=!1,t.classList.remove(this.#U);const r=e.dataTransfer.files;r.length>0&&this.#_(r,e)}destroy(){this.#W(),this.getTarget().classList.remove(this.#U)}};var K=r(133),Z=r(975);function ee(e){if(!(0,K.existsSync)(e))throw new Error(`File not found: ${e}`);const t=(0,K.readFileSync)(e,"utf-8");return JSON.parse(t)}function te(e,t,r=2){const n=JSON.stringify(t,null,r);(0,K.writeFileSync)(e,n,"utf-8")}function re(e){(0,K.existsSync)(e)||(0,K.mkdirSync)(e,{recursive:!0})}function ne(e){if(!(0,K.existsSync)(e))return;const t=(0,K.readdirSync)(e);for(const r of t){const t=(0,Z.join)(e,r);(0,K.lstatSync)(t).isDirectory()?(0,K.rmSync)(t,{recursive:!0,force:!0}):(0,K.unlinkSync)(t)}}function ie(e){return(0,K.existsSync)(e)&&(0,K.lstatSync)(e).isFile()}function oe(e){return(0,K.existsSync)(e)&&(0,K.lstatSync)(e).isDirectory()}function se(e){return 0===(0,K.readdirSync)(e).length}function ae(e,t,r){re((0,Z.dirname)(t)),(0,K.copyFileSync)(e,t,r)}function le(e){return!!ie(e)&&((0,K.unlinkSync)(e),!0)}function ue(e,t,r="utf-8"){re((0,Z.dirname)(e)),(0,K.writeFileSync)(e,t,r)}function ce(e,t=!1){const r={files:[],dirs:[]};if(!oe(e))return r;const n=(0,K.readdirSync)(e);for(const i of n){const n=(0,Z.join)(e,i);if((0,K.lstatSync)(n).isDirectory()){if(r.dirs.push(n),t){const e=ce(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}function he(e,t=!1){const r=[];if(!oe(e))return r;const n=(0,K.readdirSync)(e);for(const i of n){const n=(0,Z.join)(e,i);(0,K.lstatSync)(n).isDirectory()&&(r.push(n),t&&r.push(...he(n,!0)))}return r}function fe(e){return ie(e)?(0,K.statSync)(e).size:0}function de(e){let t=0;const r=ce(e,!0).files;for(const e of r)t+=fe(e);return t}function ge(e,t="bak"){ie(e)&&ae(e,`${e}.${t}.${(new Date).toISOString().replace(/[:.]/g,"-")}`)}function pe(e,t="bak"){const r=(0,Z.dirname)(e),n=(0,Z.basename)(e),i=(0,K.readdirSync)(r).filter((e=>e.startsWith(`${n}.${t}.`))).sort().reverse();if(0===i.length)throw new Error(`No backups found for ${e}`);return(0,Z.join)(r,i[0])}function me(e,t="bak"){ae(pe(e,t),e)}function ye(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,K.existsSync)(e)||!(0,K.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=ce(e).files;let i=0;for(const o of n){const n=(0,Z.extname)(o);if(r.length&&!r.includes(n))continue;const s=(0,Z.basename)(o),a=t(s,i++),l=(0,Z.join)(e,a);s!==a&&(0,K.renameSync)(o,l)}}function ve(e,t,r,n=[]){ye(e,(e=>{const n=(0,Z.extname)(e);return`${(0,Z.basename)(e,n).replace(t,r)}${n}`}),n)}function be(e,{prefix:t="",suffix:r=""},n=[]){ye(e,(e=>{const n=(0,Z.extname)(e),i=(0,Z.basename)(e,n);return`${t}${i}${r}${n}`}),n)}function we(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'.`);ye(e,(e=>{const r=e=>"lower"===t?e.toLowerCase():"upper"===t?e.toUpperCase():"title"===t?O(e):e,i=(0,Z.extname)(e),o=n?r(i):i;return`${r((0,Z.basename)(e,i))}${o}`}),r)}function Ee(e,t=3,r=[]){ye(e,(e=>e.replace(/\d+/,(e=>e.padStart(t,"0")))),r)}var Te=r(370);async function De(e){if(!(0,K.existsSync)(e))return;const t=await(0,Te.readdir)(e),r={},n=[];for(const i of t){const t=(0,Z.join)(e,i),o=(0,Te.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,Te.rm)(e,{recursive:!0,force:!0})):i.push((0,Te.unlink)(e));await Promise.all(i)}async function xe(e){return 0===(await(0,Te.readdir)(e)).length}async function Ce(e,t=!1){const r={files:[],dirs:[]};if(!oe(e))return r;const n=await(0,Te.readdir)(e);for(const i of n){const n=(0,Z.join)(e,i);if((await(0,Te.lstat)(n)).isDirectory()){if(r.dirs.push(n),t){const e=await Ce(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}async function Le(e,t=!1){const r=[];if(!oe(e))return r;const n=await(0,Te.readdir)(e);for(const i of n){const n=(0,Z.join)(e,i);(await(0,Te.lstat)(n)).isDirectory()&&(r.push(n),t&&r.push(...await Le(n,!0)))}return r}async function Me(e){return ie(e)?(await(0,Te.stat)(e)).size:0}async function Ae(e){let t=0;const{files:r}=await Ce(e,!0),n=[];for(const e of r){const r=Me(e);r.then((e=>(t+=e,e))),n.push(r)}return await Promise.all(n),t}const Se=class{#Q=!0;#V=!1;#X=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;#H;#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.#H=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.#H.addEventListener("mousedown",this._onMouseDown),this.#H.addEventListener("touchstart",this._onTouchStart,{passive:!1})}enable(){this.#be(),this.#ue&&this.#ue.classList.add(this.#ge),this.#Q=!0}disable(){this.#ue&&this.#ue.classList.remove(this.#ge),this.#Q=!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.#H.getBoundingClientRect(),{left:r,top:n}=Y(this.#H);return{x:e.clientX-t.left+r,y:e.clientY-t.top+n}}#me(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#V||!this.#Q||!this.#H.parentElement)return;const t=this.#H.cloneNode(!0);if(!(t instanceof HTMLElement))return;this.#ae=t,this.#re=!0;const r=this.#H.getBoundingClientRect();Object.assign(this.#ae.style,{position:"absolute",pointerEvents:"none",left:`${this.#H.offsetLeft}px`,top:`${this.#H.offsetTop}px`,width:`${r.width}px`,height:`${r.height}px`,zIndex:9999}),this.#H.classList.add(this.#ce),this.#H.parentElement.appendChild(this.#ae);const{x:n,y:i}=this.getOffset(e);this.#K=n,this.#X=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))}#De(){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.#De(),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.#V||!this.#re||!this.#Q||!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.#X;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}=Y(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.#V||!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.#V||!this.#re)return;if(this.#re=!1,!this.#ae)return;this.#H.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.#De(),this.#oe=null,this.#H.classList.remove(this.#ce),this.#te||(this.#H.style.left=r,this.#H.style.top=n);const i=new CustomEvent("drop",{detail:{targets:t,first:t[0]||null}});this.#H.dispatchEvent(i)}#xe(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.#xe(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.#xe(t,e)))||null}#Ce(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.#Ce(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.#Ce(r,e,t)))||null}#we(e){const t=new CustomEvent(e);this.#H.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.#H}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.#Q}#be(){if(this.#V)throw new Error("This TinyDragger instance has been destroyed and can no longer be used.")}destroy(){this.#V||(this.disable(),this.#H.removeEventListener("mousedown",this._onMouseDown),this.#H.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.#De(),this.#ae&&(this.#ae.remove(),this.#ae=null),this.#se=[],this.#re=!1,this.#oe=null,this.#H.classList.remove(this.#ce,this.#he),document.body.classList.remove(this.#fe),this.#ue&&this.#ue.classList.remove(this.#de,this.#ge),this.#V=!0)}},ke=class{#Le=[];#Me=!1;#Ae=!1;#Se=[];#ke(){this.#Me&&Promise.all(this.#Se).then((()=>{this.#Ae=!0,this.#Ne(!1)})).catch((e=>{console.error("[TinyDomReadyManager] Promise rejected:",e)}))}#Ne(e){this.#Le.filter((t=>t.domOnly===e)).sort(((e,t)=>t.priority-e.priority)).forEach((e=>this.#Be(e))),this.#Le=this.#Le.filter((t=>!(t.once&&(!e||t.domOnly))))}#Be(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.#Ne(!0),this.#ke()}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.#Se.push(e),this.#Me&&this.#ke())}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.#Be(o),void(t||this.#Le.push(o));!i&&this.#Ae?this.#Be(o):this.#Le.push(o)}isReady(){return this.#Ae}isDomReady(){return this.#Me}}})(),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,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 j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:j(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 k(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 S(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(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 $(j(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 D(e,t,r,n){return $(H(t),e,r,n)}function x(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 C(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 D(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 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 S(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 k(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 N(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 B(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||B(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||B(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||B(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(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||B(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||B(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||B(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||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||B(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||B(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||B(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||B(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||B(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(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 j(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 H(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:()=>Ne,TinyDragDropDetector:()=>K,TinyDragger:()=>ke,TinyLevelUp:()=>t,TinyNotifyCenter:()=>_,TinyPromiseQueue:()=>H,TinyRateLimiter:()=>$,TinyToastNotify:()=>J,addAiMarkerShortcut:()=>P,areHtmlElsColliding:()=>G,arraySortPositions:()=>i,asyncReplace:()=>e,backupFile:()=>pe,checkObj:()=>v,clearDirectory:()=>ie,clearDirectoryAsync:()=>xe,cloneObjTypeOrder:()=>p,countObj:()=>b,dirExists:()=>se,dirSize:()=>ge,dirSizeAsync:()=>Se,documentIsFullScreen:()=>E,ensureCopyFile:()=>le,ensureDirectory:()=>ne,exitFullScreen:()=>C,extendObjType:()=>d,fetchJson:()=>Y,fileExists:()=>oe,fileSize:()=>de,fileSizeAsync:()=>Ae,formatBytes:()=>B,formatCustomTimer:()=>a,formatDayTimer:()=>u,formatTimer:()=>l,genFibonacciSeq:()=>O,getAge:()=>N,getHtmlElBorders:()=>Q,getHtmlElBordersWidth:()=>W,getHtmlElMargin:()=>V,getHtmlElPadding:()=>X,getLatestBackupPath:()=>me,getSimplePerc:()=>k,getTimeDuration:()=>s,isDirEmpty:()=>ae,isDirEmptyAsync:()=>Ce,isFullScreenMode:()=>D,isJsonObject:()=>w,isScreenFilled:()=>T,listDirs:()=>fe,listDirsAsync:()=>Me,listFiles:()=>he,listFilesAsync:()=>Le,objType:()=>y,offFullScreenChange:()=>A,onFullScreenChange:()=>M,readJsonBlob:()=>q,readJsonFile:()=>te,renameFileAddPrefixSuffix:()=>we,renameFileBatch:()=>ve,renameFileNormalizeCase:()=>Ee,renameFilePadNumbers:()=>Te,renameFileRegex:()=>be,reorderObjTypeOrder:()=>g,requestFullScreen:()=>x,restoreLatestBackup:()=>ye,ruleOfThree:()=>S,saveJsonFile:()=>z,shuffleArray:()=>o,toTitleCase:()=>I,toTitleCaseLowerFirst:()=>R,tryDeleteFile:()=>ue,writeJsonFile:()=>re,writeTextFile:()=>ce});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,D=()=>E()||T(),x=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)}})),C=()=>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 S(e,t,r,n=!1){return n?Number(e*t)/r:Number(r*t)/e}function k(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 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.")}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 j=F,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}},$=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 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())}#v;#b;#w;#E;#T;#D=0;#x=99;#C=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.#C)}#S(e){this.#D=Math.max(0,e),this.#w.setAttribute("data-value",String(this.#D)),this.#w.textContent=this.#D>this.#x?`${this.#x}+`:String(this.#D)}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.#C=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.#S(this.#D-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.#S(this.#D+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.#S(e)}get count(){return this.#D}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.#D=0,this.#M=new WeakMap}}const _=U,J=class{#k;#N;#B;#O;#I;#R;constructor(e="top",t="right",r=3e3,n=50,i=300,o=".notify-container"){this.#P(e),this.#F(t),this.#j(r,"baseDuration"),this.#j(n,"extraPerChar"),this.#j(i,"fadeOutDuration"),this.#k=e,this.#N=t,this.#B=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".`)}#j(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.#k}setY(e){this.#P(e);const t=this.getContainer();t.classList.remove(this.#k),t.classList.add(e),this.#k=e}getX(){return this.#N}setX(e){this.#F(e);const t=this.getContainer();t.classList.remove(this.#N),t.classList.add(e),this.#N=e}getBaseDuration(){return this.#B}setBaseDuration(e){this.#j(e,"baseDuration"),this.#B=e}getExtraPerChar(){return this.#O}setExtraPerChar(e){this.#j(e,"extraPerChar"),this.#O=e}getFadeOutDuration(){return this.#I}setFadeOutDuration(e){this.#j(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.#B+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)}};function G(e,t){const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return!(r.right<n.left||r.left>n.right||r.bottom<n.top||r.top>n.bottom)}function q(e){return new Promise(((t,r)=>{const n=new FileReader;n.onload=()=>{try{const e=JSON.parse(n.result);t(e)}catch(t){r(new Error(`Invalid JSON in file: ${e.name}\n${t.message}`))}},n.onerror=()=>{r(new Error(`Error reading file: ${e.name}`))},n.readAsText(e)}))}function z(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 Y(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(!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 W=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}},Q=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}},V=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}},X=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}},K=class{#H;#$;#U;#_;#J;#G;#q;#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.#H=a,this.#$=r,this.#U=n,this.#_=i||(()=>{}),this.#J=o,this.#G=s,this.#q=!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.#H}getHoverClass(){return this.#U}isFullScreen(){return this.#$}isDragging(){return this.#q}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}#W(){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.#q){const t=this.getTarget();this.#q=!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.#q=!1,t.classList.remove(this.#U),this.#G(e))}_handleDrop(e){if(e.preventDefault(),!e.dataTransfer)return void console.warn("[TinyDragDropDetector] [handleDrop] DragOver event missing dataTransfer.");const t=this.getTarget();this.#q=!1,t.classList.remove(this.#U);const r=e.dataTransfer.files;r.length>0&&this.#_(r,e)}destroy(){this.#W(),this.getTarget().classList.remove(this.#U)}};var Z=r(133),ee=r(975);function te(e){if(!(0,Z.existsSync)(e))throw new Error(`File not found: ${e}`);const t=(0,Z.readFileSync)(e,"utf-8");return JSON.parse(t)}function re(e,t,r=2){const n=JSON.stringify(t,null,r);(0,Z.writeFileSync)(e,n,"utf-8")}function ne(e){(0,Z.existsSync)(e)||(0,Z.mkdirSync)(e,{recursive:!0})}function ie(e){if(!(0,Z.existsSync)(e))return;const t=(0,Z.readdirSync)(e);for(const r of t){const t=(0,ee.join)(e,r);(0,Z.lstatSync)(t).isDirectory()?(0,Z.rmSync)(t,{recursive:!0,force:!0}):(0,Z.unlinkSync)(t)}}function oe(e){return(0,Z.existsSync)(e)&&(0,Z.lstatSync)(e).isFile()}function se(e){return(0,Z.existsSync)(e)&&(0,Z.lstatSync)(e).isDirectory()}function ae(e){return 0===(0,Z.readdirSync)(e).length}function le(e,t,r){ne((0,ee.dirname)(t)),(0,Z.copyFileSync)(e,t,r)}function ue(e){return!!oe(e)&&((0,Z.unlinkSync)(e),!0)}function ce(e,t,r="utf-8"){ne((0,ee.dirname)(e)),(0,Z.writeFileSync)(e,t,r)}function he(e,t=!1){const r={files:[],dirs:[]};if(!se(e))return r;const n=(0,Z.readdirSync)(e);for(const i of n){const n=(0,ee.join)(e,i);if((0,Z.lstatSync)(n).isDirectory()){if(r.dirs.push(n),t){const e=he(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}function fe(e,t=!1){const r=[];if(!se(e))return r;const n=(0,Z.readdirSync)(e);for(const i of n){const n=(0,ee.join)(e,i);(0,Z.lstatSync)(n).isDirectory()&&(r.push(n),t&&r.push(...fe(n,!0)))}return r}function de(e){return oe(e)?(0,Z.statSync)(e).size:0}function ge(e){let t=0;const r=he(e,!0).files;for(const e of r)t+=de(e);return t}function pe(e,t="bak"){oe(e)&&le(e,`${e}.${t}.${(new Date).toISOString().replace(/[:.]/g,"-")}`)}function me(e,t="bak"){const r=(0,ee.dirname)(e),n=(0,ee.basename)(e),i=(0,Z.readdirSync)(r).filter((e=>e.startsWith(`${n}.${t}.`))).sort().reverse();if(0===i.length)throw new Error(`No backups found for ${e}`);return(0,ee.join)(r,i[0])}function ye(e,t="bak"){le(me(e,t),e)}function ve(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,Z.existsSync)(e)||!(0,Z.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=he(e).files;let i=0;for(const o of n){const n=(0,ee.extname)(o);if(r.length&&!r.includes(n))continue;const s=(0,ee.basename)(o),a=t(s,i++),l=(0,ee.join)(e,a);s!==a&&(0,Z.renameSync)(o,l)}}function be(e,t,r,n=[]){ve(e,(e=>{const n=(0,ee.extname)(e);return`${(0,ee.basename)(e,n).replace(t,r)}${n}`}),n)}function we(e,{prefix:t="",suffix:r=""},n=[]){ve(e,(e=>{const n=(0,ee.extname)(e),i=(0,ee.basename)(e,n);return`${t}${i}${r}${n}`}),n)}function Ee(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'.`);ve(e,(e=>{const r=e=>"lower"===t?e.toLowerCase():"upper"===t?e.toUpperCase():"title"===t?I(e):e,i=(0,ee.extname)(e),o=n?r(i):i;return`${r((0,ee.basename)(e,i))}${o}`}),r)}function Te(e,t=3,r=[]){ve(e,(e=>e.replace(/\d+/,(e=>e.padStart(t,"0")))),r)}var De=r(370);async function xe(e){if(!(0,Z.existsSync)(e))return;const t=await(0,De.readdir)(e),r={},n=[];for(const i of t){const t=(0,ee.join)(e,i),o=(0,De.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,De.rm)(e,{recursive:!0,force:!0})):i.push((0,De.unlink)(e));await Promise.all(i)}async function Ce(e){return 0===(await(0,De.readdir)(e)).length}async function Le(e,t=!1){const r={files:[],dirs:[]};if(!se(e))return r;const n=await(0,De.readdir)(e);for(const i of n){const n=(0,ee.join)(e,i);if((await(0,De.lstat)(n)).isDirectory()){if(r.dirs.push(n),t){const e=await Le(n,!0);r.files.push(...e.files),r.dirs.push(...e.dirs)}}else r.files.push(n)}return r}async function Me(e,t=!1){const r=[];if(!se(e))return r;const n=await(0,De.readdir)(e);for(const i of n){const n=(0,ee.join)(e,i);(await(0,De.lstat)(n)).isDirectory()&&(r.push(n),t&&r.push(...await Me(n,!0)))}return r}async function Ae(e){return oe(e)?(await(0,De.stat)(e)).size:0}async function Se(e){let t=0;const{files:r}=await Le(e,!0),n=[];for(const e of r){const r=Ae(e);r.then((e=>(t+=e,e))),n.push(r)}return await Promise.all(n),t}const ke=class{#Q=!0;#V=!1;#X=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;#H;#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.#H=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.#H.addEventListener("mousedown",this._onMouseDown),this.#H.addEventListener("touchstart",this._onTouchStart,{passive:!1})}enable(){this.#be(),this.#ue&&this.#ue.classList.add(this.#ge),this.#Q=!0}disable(){this.#ue&&this.#ue.classList.remove(this.#ge),this.#Q=!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.#H.getBoundingClientRect(),{left:r,top:n}=W(this.#H);return{x:e.clientX-t.left+r,y:e.clientY-t.top+n}}#me(e){if(e instanceof MouseEvent&&e.preventDefault(),this.#V||!this.#Q||!this.#H.parentElement)return;const t=this.#H.cloneNode(!0);if(!(t instanceof HTMLElement))return;this.#ae=t,this.#re=!0;const r=this.#H.getBoundingClientRect();Object.assign(this.#ae.style,{position:"absolute",pointerEvents:"none",left:`${this.#H.offsetLeft}px`,top:`${this.#H.offsetTop}px`,width:`${r.width}px`,height:`${r.height}px`,zIndex:9999}),this.#H.classList.add(this.#ce),this.#H.parentElement.appendChild(this.#ae);const{x:n,y:i}=this.getOffset(e);this.#K=n,this.#X=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))}#De(){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.#De(),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.#V||!this.#re||!this.#Q||!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.#X;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}=W(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.#V||!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.#V||!this.#re)return;if(this.#re=!1,!this.#ae)return;this.#H.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.#De(),this.#oe=null,this.#H.classList.remove(this.#ce),this.#te||(this.#H.style.left=r,this.#H.style.top=n);const i=new CustomEvent("drop",{detail:{targets:t,first:t[0]||null}});this.#H.dispatchEvent(i)}#xe(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.#xe(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.#xe(t,e)))||null}#Ce(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.#Ce(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.#Ce(r,e,t)))||null}#we(e){const t=new CustomEvent(e);this.#H.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.#H}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.#Q}#be(){if(this.#V)throw new Error("This TinyDragger instance has been destroyed and can no longer be used.")}destroy(){this.#V||(this.disable(),this.#H.removeEventListener("mousedown",this._onMouseDown),this.#H.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.#De(),this.#ae&&(this.#ae.remove(),this.#ae=null),this.#se=[],this.#re=!1,this.#oe=null,this.#H.classList.remove(this.#ce,this.#he),document.body.classList.remove(this.#fe),this.#ue&&this.#ue.classList.remove(this.#de,this.#ge),this.#V=!0)}},Ne=class{#Le=[];#Me=!1;#Ae=!1;#Se=[];#ke(){this.#Me&&Promise.all(this.#Se).then((()=>{this.#Ae=!0,this.#Ne(!1)})).catch((e=>{console.error("[TinyDomReadyManager] Promise rejected:",e)}))}#Ne(e){this.#Le.filter((t=>t.domOnly===e)).sort(((e,t)=>t.priority-e.priority)).forEach((e=>this.#Be(e))),this.#Le=this.#Le.filter((t=>!(t.once&&(!e||t.domOnly))))}#Be(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.#Ne(!0),this.#ke()}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.#Se.push(e),this.#Me&&this.#ke())}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.#Be(o),void(t||this.#Le.push(o));!i&&this.#Ae?this.#Be(o):this.#Le.push(o)}isReady(){return this.#Ae}isDomReady(){return this.#Me}}})(),window.TinyEssentials=n})();
|
package/dist/v1/basics/index.cjs
CHANGED
|
@@ -41,6 +41,7 @@ exports.offFullScreenChange = fullScreen.offFullScreenChange;
|
|
|
41
41
|
exports.onFullScreenChange = fullScreen.onFullScreenChange;
|
|
42
42
|
exports.requestFullScreen = fullScreen.requestFullScreen;
|
|
43
43
|
exports.formatBytes = simpleMath.formatBytes;
|
|
44
|
+
exports.genFibonacciSeq = simpleMath.genFibonacciSeq;
|
|
44
45
|
exports.getAge = simpleMath.getAge;
|
|
45
46
|
exports.getSimplePerc = simpleMath.getSimplePerc;
|
|
46
47
|
exports.ruleOfThree = simpleMath.ruleOfThree;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { genFibonacciSeq } from './simpleMath.mjs';
|
|
1
2
|
import { getHtmlElBorders } from './html.mjs';
|
|
2
3
|
import { getHtmlElBordersWidth } from './html.mjs';
|
|
3
4
|
import { getHtmlElMargin } from './html.mjs';
|
|
@@ -33,5 +34,5 @@ import { getTimeDuration } from './clock.mjs';
|
|
|
33
34
|
import { shuffleArray } from './array.mjs';
|
|
34
35
|
import { toTitleCase } from './text.mjs';
|
|
35
36
|
import { toTitleCaseLowerFirst } from './text.mjs';
|
|
36
|
-
export { getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, fetchJson, readJsonBlob, saveJsonFile, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
37
|
+
export { genFibonacciSeq, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, fetchJson, readJsonBlob, saveJsonFile, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
37
38
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/v1/basics/index.mjs
CHANGED
|
@@ -5,6 +5,6 @@ import { formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration } from
|
|
|
5
5
|
import { areHtmlElsColliding, readJsonBlob, saveJsonFile, fetchJson, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, } from './html.mjs';
|
|
6
6
|
import { countObj, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, objType, isJsonObject, } from './objFilter.mjs';
|
|
7
7
|
import { documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, } from './fullScreen.mjs';
|
|
8
|
-
import { formatBytes, getAge, getSimplePerc, ruleOfThree } from './simpleMath.mjs';
|
|
8
|
+
import { formatBytes, genFibonacciSeq, getAge, getSimplePerc, ruleOfThree } from './simpleMath.mjs';
|
|
9
9
|
import { addAiMarkerShortcut, toTitleCase, toTitleCaseLowerFirst } from './text.mjs';
|
|
10
|
-
export { getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, fetchJson, readJsonBlob, saveJsonFile, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
|
|
10
|
+
export { genFibonacciSeq, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, fetchJson, readJsonBlob, saveJsonFile, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
|
|
@@ -126,7 +126,45 @@ function formatBytes(bytes, decimals = null, maxUnit = null) {
|
|
|
126
126
|
return { unit, value };
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Generates a Fibonacci-like sequence as an array of vectors.
|
|
131
|
+
*
|
|
132
|
+
* @param {Object} [settings={}]
|
|
133
|
+
* @param {number[]} [settings.baseValues=[0, 1]] - An array of two starting numbers (e.g. [0, 1] or [1, 1]).
|
|
134
|
+
* @param {number} [settings.length=10] - Total number of items to generate in the sequence.
|
|
135
|
+
* @param {(a: number, b: number, index: number) => number} [settings.combiner=((a, b) => a + b)] - A custom function to combine previous two numbers.
|
|
136
|
+
* @returns {number[]} The resulting Fibonacci sequence.
|
|
137
|
+
*
|
|
138
|
+
* FibonacciVectors2D
|
|
139
|
+
* @example
|
|
140
|
+
* generateFibonacciSequence({
|
|
141
|
+
* baseValues: [[0, 1], [1, 1]],
|
|
142
|
+
* length: 10,
|
|
143
|
+
* combiner: ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2]
|
|
144
|
+
* });
|
|
145
|
+
*
|
|
146
|
+
* @beta
|
|
147
|
+
*/
|
|
148
|
+
function genFibonacciSeq({
|
|
149
|
+
baseValues = [0, 1],
|
|
150
|
+
length = 10,
|
|
151
|
+
combiner = (a, b) => a + b,
|
|
152
|
+
} = {}) {
|
|
153
|
+
if (!Array.isArray(baseValues) || baseValues.length !== 2)
|
|
154
|
+
throw new Error('baseValues must be an array of exactly two numbers');
|
|
155
|
+
|
|
156
|
+
const sequence = [...baseValues.slice(0, 2)];
|
|
157
|
+
|
|
158
|
+
for (let i = 2; i < length; i++) {
|
|
159
|
+
const next = combiner(sequence[i - 2], sequence[i - 1], i);
|
|
160
|
+
sequence.push(next);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return sequence;
|
|
164
|
+
}
|
|
165
|
+
|
|
129
166
|
exports.formatBytes = formatBytes;
|
|
167
|
+
exports.genFibonacciSeq = genFibonacciSeq;
|
|
130
168
|
exports.getAge = getAge;
|
|
131
169
|
exports.getSimplePerc = getSimplePerc;
|
|
132
170
|
exports.ruleOfThree = ruleOfThree;
|
|
@@ -74,6 +74,30 @@ export function getAge(timeData?: number | string | Date, now?: Date | null): nu
|
|
|
74
74
|
* // โ { unit: 'MB', value: 1024 }
|
|
75
75
|
*/
|
|
76
76
|
export function formatBytes(bytes: number, decimals?: number | null, maxUnit?: string | null): FormattedByteResult;
|
|
77
|
+
/**
|
|
78
|
+
* Generates a Fibonacci-like sequence as an array of vectors.
|
|
79
|
+
*
|
|
80
|
+
* @param {Object} [settings={}]
|
|
81
|
+
* @param {number[]} [settings.baseValues=[0, 1]] - An array of two starting numbers (e.g. [0, 1] or [1, 1]).
|
|
82
|
+
* @param {number} [settings.length=10] - Total number of items to generate in the sequence.
|
|
83
|
+
* @param {(a: number, b: number, index: number) => number} [settings.combiner=((a, b) => a + b)] - A custom function to combine previous two numbers.
|
|
84
|
+
* @returns {number[]} The resulting Fibonacci sequence.
|
|
85
|
+
*
|
|
86
|
+
* FibonacciVectors2D
|
|
87
|
+
* @example
|
|
88
|
+
* generateFibonacciSequence({
|
|
89
|
+
* baseValues: [[0, 1], [1, 1]],
|
|
90
|
+
* length: 10,
|
|
91
|
+
* combiner: ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2]
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* @beta
|
|
95
|
+
*/
|
|
96
|
+
export function genFibonacciSeq({ baseValues, length, combiner, }?: {
|
|
97
|
+
baseValues?: number[] | undefined;
|
|
98
|
+
length?: number | undefined;
|
|
99
|
+
combiner?: ((a: number, b: number, index: number) => number) | undefined;
|
|
100
|
+
}): number[];
|
|
77
101
|
export type FormattedByteResult = {
|
|
78
102
|
/**
|
|
79
103
|
* - The resulting unit (e.g., 'MB', 'GB') or null if input is invalid.
|
|
@@ -111,3 +111,32 @@ export function formatBytes(bytes, decimals = null, maxUnit = null) {
|
|
|
111
111
|
const unit = sizes[i];
|
|
112
112
|
return { unit, value };
|
|
113
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Generates a Fibonacci-like sequence as an array of vectors.
|
|
116
|
+
*
|
|
117
|
+
* @param {Object} [settings={}]
|
|
118
|
+
* @param {number[]} [settings.baseValues=[0, 1]] - An array of two starting numbers (e.g. [0, 1] or [1, 1]).
|
|
119
|
+
* @param {number} [settings.length=10] - Total number of items to generate in the sequence.
|
|
120
|
+
* @param {(a: number, b: number, index: number) => number} [settings.combiner=((a, b) => a + b)] - A custom function to combine previous two numbers.
|
|
121
|
+
* @returns {number[]} The resulting Fibonacci sequence.
|
|
122
|
+
*
|
|
123
|
+
* FibonacciVectors2D
|
|
124
|
+
* @example
|
|
125
|
+
* generateFibonacciSequence({
|
|
126
|
+
* baseValues: [[0, 1], [1, 1]],
|
|
127
|
+
* length: 10,
|
|
128
|
+
* combiner: ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2]
|
|
129
|
+
* });
|
|
130
|
+
*
|
|
131
|
+
* @beta
|
|
132
|
+
*/
|
|
133
|
+
export function genFibonacciSeq({ baseValues = [0, 1], length = 10, combiner = (a, b) => a + b, } = {}) {
|
|
134
|
+
if (!Array.isArray(baseValues) || baseValues.length !== 2)
|
|
135
|
+
throw new Error('baseValues must be an array of exactly two numbers');
|
|
136
|
+
const sequence = [...baseValues.slice(0, 2)];
|
|
137
|
+
for (let i = 2; i < length; i++) {
|
|
138
|
+
const next = combiner(sequence[i - 2], sequence[i - 1], i);
|
|
139
|
+
sequence.push(next);
|
|
140
|
+
}
|
|
141
|
+
return sequence;
|
|
142
|
+
}
|
package/dist/v1/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ exports.offFullScreenChange = fullScreen.offFullScreenChange;
|
|
|
46
46
|
exports.onFullScreenChange = fullScreen.onFullScreenChange;
|
|
47
47
|
exports.requestFullScreen = fullScreen.requestFullScreen;
|
|
48
48
|
exports.formatBytes = simpleMath.formatBytes;
|
|
49
|
+
exports.genFibonacciSeq = simpleMath.genFibonacciSeq;
|
|
49
50
|
exports.getAge = simpleMath.getAge;
|
|
50
51
|
exports.getSimplePerc = simpleMath.getSimplePerc;
|
|
51
52
|
exports.ruleOfThree = simpleMath.ruleOfThree;
|
package/dist/v1/index.d.mts
CHANGED
|
@@ -7,6 +7,7 @@ import TinyRateLimiter from './libs/TinyRateLimiter.mjs';
|
|
|
7
7
|
import ColorSafeStringify from './libs/ColorSafeStringify.mjs';
|
|
8
8
|
import TinyPromiseQueue from './libs/TinyPromiseQueue.mjs';
|
|
9
9
|
import TinyLevelUp from '../legacy/libs/userLevel.mjs';
|
|
10
|
+
import { genFibonacciSeq } from './basics/simpleMath.mjs';
|
|
10
11
|
import { isDirEmptyAsync } from './fileManager/asyncFuncs.mjs';
|
|
11
12
|
import { fileSizeAsync } from './fileManager/asyncFuncs.mjs';
|
|
12
13
|
import { dirSizeAsync } from './fileManager/asyncFuncs.mjs';
|
|
@@ -71,5 +72,5 @@ import { getTimeDuration } from './basics/clock.mjs';
|
|
|
71
72
|
import { shuffleArray } from './basics/array.mjs';
|
|
72
73
|
import { toTitleCase } from './basics/text.mjs';
|
|
73
74
|
import { toTitleCaseLowerFirst } from './basics/text.mjs';
|
|
74
|
-
export { TinyDomReadyManager, TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectoryAsync, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
75
|
+
export { TinyDomReadyManager, TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, genFibonacciSeq, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectoryAsync, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
75
76
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/v1/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { shuffleArray } from './basics/array.mjs';
|
|
|
5
5
|
import { formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, } from './basics/clock.mjs';
|
|
6
6
|
import { countObj, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, objType, checkObj, isJsonObject, } from './basics/objFilter.mjs';
|
|
7
7
|
import { documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, } from './basics/fullScreen.mjs';
|
|
8
|
-
import { formatBytes, getAge, getSimplePerc, ruleOfThree } from './basics/simpleMath.mjs';
|
|
8
|
+
import { formatBytes, genFibonacciSeq, getAge, getSimplePerc, ruleOfThree, } from './basics/simpleMath.mjs';
|
|
9
9
|
import { addAiMarkerShortcut, toTitleCase, toTitleCaseLowerFirst } from './basics/text.mjs';
|
|
10
10
|
import ColorSafeStringify from './libs/ColorSafeStringify.mjs';
|
|
11
11
|
import TinyPromiseQueue from './libs/TinyPromiseQueue.mjs';
|
|
@@ -18,4 +18,4 @@ import { readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExist
|
|
|
18
18
|
import { listFilesAsync, listDirsAsync, clearDirectoryAsync, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, } from './fileManager/asyncFuncs.mjs';
|
|
19
19
|
import TinyDragger from './libs/TinyDragger.mjs';
|
|
20
20
|
import TinyDomReadyManager from './libs/TinyDomReadyManager.mjs';
|
|
21
|
-
export { TinyDomReadyManager, TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectoryAsync, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
|
|
21
|
+
export { TinyDomReadyManager, TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, genFibonacciSeq, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectoryAsync, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
|
|
@@ -119,3 +119,31 @@ formatBytes(1073741824, 2, 'MB');
|
|
|
119
119
|
* **Formatting:** Converts bytes to the most appropriate unit (from 'Bytes' to 'YB') based on the byte value.
|
|
120
120
|
* **Max Unit:** The `maxUnit` parameter allows you to limit the highest unit for conversion. If not provided, it will convert all the way up to 'YB'.
|
|
121
121
|
* **Decimals:** The result can be customized with a specified number of decimal places for precision. If `decimals` is `null`, no rounding is applied, and the full precision value is returned.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### ๐ข `genFibonacciSeq()` โ Custom Fibonacci Sequence Generator
|
|
126
|
+
|
|
127
|
+
๐ Flexible, combinable, and vector-friendly!
|
|
128
|
+
|
|
129
|
+
Generates a customizable Fibonacci-like sequence. You can use simple numbers or even 2D/ND vectors by passing a custom `combiner` function.
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
genFibonacciSeq({
|
|
133
|
+
baseValues: [[0, 1], [1, 1]],
|
|
134
|
+
length: 10,
|
|
135
|
+
combiner: ([x1, y1], [x2, y2]) => [x1 + x2, y1 + y2]
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### โ๏ธ Options
|
|
140
|
+
|
|
141
|
+
* `baseValues` ๐งฌ: Two starting values (default: `[0, 1]`)
|
|
142
|
+
* `length` ๐: How many items to generate (default: `10`)
|
|
143
|
+
* `combiner` ๐งช: Custom function to generate next value from the last two (default: `(a, b) => a + b`)
|
|
144
|
+
|
|
145
|
+
#### ๐ง Returns
|
|
146
|
+
|
|
147
|
+
An array representing the generated sequence.
|
|
148
|
+
|
|
149
|
+
> ๐ **Beta** โ Still experimental and fun to tweak!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-essentials",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.1",
|
|
4
4
|
"description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "npm run test:mjs && npm run test:cjs && npm run test:js",
|