tiny-essentials 1.23.2 → 1.24.0

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see TinyUploadClicker.min.js.LICENSE.txt */
2
- (()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,l=(1<<a)-1,c=l>>1,f=-7,u=r?o-1:0,p=r?-1:1,h=t[e+u];for(u+=p,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+t[e+u],u+=p,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+u],u+=p,f-=8);if(0===i)i=1-c;else{if(i===l)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=c}return(h?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,l,c=8*i-o-1,f=(1<<c)-1,u=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,m=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+u>=1?p/l:p*Math.pow(2,1-u))*l>=2&&(s++,l/=2),s+u>=f?(a=0,s=f):s+u>=1?(a=(e*l-1)*Math.pow(2,o),s+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;t[r+h]=255&a,h+=m,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+h]=255&s,h+=m,s/=256,c-=8);t[r+h-m]|=128*d}},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=l,e.IS=50;var s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(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 u(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=a(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(j(t,Uint8Array)){var e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return p(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(j(t,ArrayBuffer)||t&&j(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(j(t,SharedArrayBuffer)||t&&j(t.buffer,SharedArrayBuffer)))return h(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 l.from(n,e,r);var o=function(t){if(l.isBuffer(t)){var e=0|m(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||U(t.length)?a(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.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 f(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 u(t){return f(t),a(t<0?0:0|m(t))}function p(t){for(var e=t.length<0?0:0|m(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(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,l.prototype),n}function m(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function d(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||j(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 R(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(o)return n?-1:R(t).length;e=(""+e).toLowerCase(),o=!0}}function g(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 N(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(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),U(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=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:w(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):w(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,o){var i,s=1,a=t.length,l=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,a/=2,l/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===l)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+l>a&&(r=a-l),i=r;i>=0;i--){for(var u=!0,p=0;p<l;p++)if(c(t,i+p)!==c(e,p)){u=!1;break}if(u)return i}return-1}function E(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 a=parseInt(e.substr(2*s,2),16);if(U(a))return s;t[r+s]=a}return s}function v(t,e,r,n){return F(R(e,t.length-r),t,r,n)}function T(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return F(H(e),t,r,n)}function S(t,e,r,n){return F(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,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,l,c=t[o],f=null,u=c>239?4:c>223?3:c>191?2:1;if(o+u<=r)switch(u){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(l=(31&c)<<6|63&i)>127&&(f=l);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(l=(15&c)<<12|(63&i)<<6|63&s)>2047&&(l<55296||l>57343)&&(f=l);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(l=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(f=l)}null===f?(f=65533,u=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=u}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=C));return r}(n)}l.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}}(),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(t,e,r){return c(t,e,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},l.allocUnsafe=function(t){return u(t)},l.allocUnsafeSlow=function(t){return u(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(j(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),j(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.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},l.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}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=l.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(j(i,Uint8Array))o+i.length>n.length?l.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!l.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},l.byteLength=d,l.prototype._isBuffer=!0,l.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)y(this,e,e+1);return this},l.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)y(this,e,e+3),y(this,e+1,e+2);return this},l.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)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},l.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.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&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(t,e,r,n,o){if(j(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.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),a=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),u=0;u<a;++u)if(c[u]!==f[u]){i=c[u],s=f[u];break}return i<s?-1:s<i?1:0},l.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},l.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},l.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},l.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 E(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return A(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}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function L(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 k(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 N(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+=J[t[i]];return o}function B(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 I(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 D(t,e,r,n,o,i){if(!l.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 O(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 P(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,0,r,8),o.write(t,e,r,n,52,8),r+8}l.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,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(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},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(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},l.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||D(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},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||D(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},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||D(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},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||D(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},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||D(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},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||D(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},l.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(!l.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},l.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&&!l.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=l.isBuffer(t)?t:l.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var W=/[^+/0-9A-Za-z-_]/g;function R(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 H(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(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 j(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function U(t){return t!=t}var J=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=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=a(t),s=i[0],l=i[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,l)),f=0,u=l>0?s-4:s;for(r=0;r<u;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)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,l=n-o;a<l;a+=s)i.push(c(t,a,a+s>l?l:a+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 a(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 l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function c(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(l(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},606:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var a,l=[],c=!1,f=-1;function u(){c&&a&&(c=!1,a.length?l=a.concat(l):f=-1,l.length&&p())}function p(){if(!c){var t=s(u);c=!0;for(var e=l.length;e;){for(a=l,l=[];++f<e;)a&&a[f].run();f=-1,e=l.length}a=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function m(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new h(t,e)),1!==l.length||c||s(p)},h.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=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},975:(t,e,r)=>{"use strict";var n=r(606);function o(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function i(t,e){for(var r,n="",o=0,i=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(n.length<2||2!==o||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="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),i=a,s=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var s={resolve:function(){for(var t,e="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=n.cwd()),a=t),o(a),0!==a.length&&(e=a+"/"+e,r=47===a.charCodeAt(0))}return e=i(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(o(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=i(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return o(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];o(r),r.length>0&&(void 0===t?t=r:t+="/"+r)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(o(t),o(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,i=n-r,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var l=e.length-a,c=i<l?i:l,f=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===e.charCodeAt(a+u))return e.slice(a+u+1);if(0===u)return e.slice(a+u)}else i>c&&(47===t.charCodeAt(r+u)?f=u:0===u&&(f=0));break}var p=t.charCodeAt(r+u);if(p!==e.charCodeAt(a+u))break;47===p&&(f=u)}var h="";for(u=r+f+1;u<=n;++u)u!==n&&47!==t.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+e.slice(a+f):(a+=f,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(o(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,i=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!i){n=s;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');o(t);var r,n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(r=t.length-1;r>=0;--r){var c=t.charCodeAt(r);if(47===c){if(!s){n=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(c===e.charCodeAt(a)?-1===--a&&(i=r):(a=-1,i=l))}return n===i?i=l:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){n=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname:function(t){o(t);for(var e=-1,r=0,n=-1,i=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===n&&(i=!1,n=a+1),46===l?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){o(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=t.charCodeAt(0),i=47===n;i?(e.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,c=!0,f=t.length-1,u=0;f>=r;--f)if(47!==(n=t.charCodeAt(f)))-1===l&&(c=!1,l=f+1),46===n?-1===s?s=f:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){a=f+1;break}return-1===s||-1===l||0===u||1===u&&s===l-1&&s===a+1?-1!==l&&(e.base=e.name=0===a&&i?t.slice(1,l):t.slice(a,l)):(0===a&&i?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(a,s),e.base=t.slice(a,l)),e.ext=t.slice(s,l)),a>0?e.dir=t.slice(0,a-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,t.exports=s}},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";r.d(n,{TinyUploadClicker:()=>V});var t={};r.r(t),r.d(t,{areElsCollBottom:()=>c,areElsCollLeft:()=>f,areElsCollPerfBottom:()=>h,areElsCollPerfLeft:()=>m,areElsCollPerfRight:()=>d,areElsCollPerfTop:()=>p,areElsCollRight:()=>u,areElsCollTop:()=>l,areElsColliding:()=>g,areElsPerfColliding:()=>y,getElsCollDetails:()=>_,getElsCollDirDepth:()=>S,getElsCollOverlap:()=>E,getElsCollOverlapPos:()=>v,getElsColliding:()=>b,getElsPerfColliding:()=>w,getElsRelativeCenterOffset:()=>A,getRectCenter:()=>T});var e=r(287);function o(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t)}const i="undefined"!=typeof window&&void 0!==window.document,s={items:{},order:[]};function a(t,e){const r=[],n=Array.isArray(t)?t:Object.entries(t);for(const[t,o]of n)if(!s.items.hasOwnProperty(t)){s.items[t]=o;let n="number"==typeof e?e:-1;if(-1===n){const t=s.order.indexOf("object");n=t>-1?t:s.order.length}n=Math.min(Math.max(0,n),s.order.length),s.order.splice(n,0,t),r.push(t)}return r}a([["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)]]),i||a([["buffer",t=>void 0!==e.hp&&e.hp.isBuffer(t)]]),i&&a([["file",t=>"undefined"!=typeof File&&t instanceof File]]),a([["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]]),i&&a([["htmlelement",t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement]]),a([["object",t=>o(t)]]),r(975);const l=(t,e)=>t.bottom<e.top,c=(t,e)=>t.top>e.bottom,f=(t,e)=>t.right<e.left,u=(t,e)=>t.left>e.right,p=(t,e)=>t.bottom<=e.top,h=(t,e)=>t.top>=e.bottom,m=(t,e)=>t.right<=e.left,d=(t,e)=>t.left>=e.right,g=(t,e)=>!(f(t,e)||u(t,e)||l(t,e)||c(t,e)),y=(t,e)=>!(m(t,e)||d(t,e)||p(t,e)||h(t,e)),b=(t,e)=>f(t,e)?"left":u(t,e)?"right":l(t,e)?"top":c(t,e)?"bottom":null,w=(t,e)=>m(t,e)?"left":d(t,e)?"right":p(t,e)?"top":h(t,e)?"bottom":null,E=(t,e)=>({overlapLeft:e.right-t.left,overlapRight:t.right-e.left,overlapTop:e.bottom-t.top,overlapBottom:t.bottom-e.top}),v=({overlapLeft:t=-1,overlapRight:e=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:t<e?"right":"left",dirY:r<n?"bottom":"top"}),T=t=>({x:t.left+t.width/2,y:t.top+t.height/2});function A(t,e){const r=t.left+t.width/2,n=t.top+t.height/2;return{x:e.left+e.width/2-r,y:e.top+e.height/2-n}}function S(t,e){if(!y(t,e))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}=E(t,e),{dirX:s,dirY:a}=v({overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}),l=Math.min(r,n),c=Math.min(o,i);let f;return f=l<c?s:a,{inDir:f,dirX:s,dirY:a,depthX:l,depthY:c}}function _(t,e){const r=y(t,e),n={in:null,x:null,y:null},o={y:null,x:null},i={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:a,overlapTop:l,overlapBottom:c}=E(e,t);i.top=l,i.bottom=c,i.left=s,i.right=a;const f=Object.entries(i).filter(([,t])=>t>0).sort((t,e)=>t[1]-e[1]),{dirX:u,dirY:p}=v({overlapLeft:a,overlapRight:s,overlapTop:c,overlapBottom:l});return n.y=p,n.x=u,i.bottom<0?o.y="bottom":i.top<0&&(o.y="top"),i.left<0?o.x="left":i.right<0&&(o.x="right"),n.in=r?i.top===i.bottom&&i.bottom===i.left&&i.left===i.right?"center":f.length?f[0][0]:"top":null,{dirs:n,depth:i,isNeg:o}}const x=class{#t;get el(){return this.#t}set el(t){if(this.#t)throw new Error("The observed element has already been set and cannot be reassigned.");if(void 0!==t&&!(t instanceof Element))throw new TypeError("The observed element must be a valid DOM Element.");this.#t=t}#e={};get settings(){return this.#e}set settings(t){if("object"!=typeof t||null===t)throw new TypeError("settings must be a non-null object.");this.#e=t}#r=null;get observer(){return this.#r}#n=[];get detectors(){return this.#n.map(t=>[t[0],t[1]])}set detectors(t){if(!Array.isArray(t))throw new TypeError("detectors must be an array.");const e=[];for(const[r,n]of t){if("string"!=typeof r)throw new TypeError("Detector name must be a string.");if("function"!=typeof n)throw new TypeError(`Detector handler for "${r}" must be a function.`);e.push([r,n])}this.#n=e}get isActive(){return!!this.#r}get size(){return this.#n.length}constructor({el:t,initDetectors:e=[],initCfg:r={}}={}){this.el=t,e.length&&(this.detectors=e),r&&(this.settings=r)}clear(){this.#n=[]}start(){if(!this.#t)throw new Error("Cannot start observation: no target element has been set.");this.#r||(this.#r=new MutationObserver(t=>{t.forEach((t,e,r)=>this.#n.forEach(n=>n[1](t,e,r)))}),this.#r.observe(this.#t,this.#e))}stop(){this.#r&&(this.#r.disconnect(),this.#r=null)}add(t,e){this.#o(t,e),this.#n.push([t,e])}insertAtStart(t,e){this.#o(t,e),this.#n.unshift([t,e])}insertAt(t,e,r,n="after"){if(this.#o(e,r),"number"!=typeof t||t<0||t>=this.#n.length)throw new RangeError("Invalid index for insertDetectorAt.");const o="before"===n?t:t+1;this.#n.splice(o,0,[e,r])}removeAt(t){if("number"!=typeof t||t<0||t>=this.#n.length)throw new RangeError("Invalid index for removeDetectorAt.");this.#n.splice(t,1)}removeAround(t,e=0,r=0){if("number"!=typeof t||t<0||t>=this.#n.length)throw new RangeError("Invalid index for removeDetectorsAround.");const n=Math.max(0,t-e),o=e+1+r;this.#n.splice(n,o)}isIndexUsed(t){return t>=0&&t<this.#n.length}hasHandler(t){if("function"!=typeof t)throw new TypeError("Handler must be a function.");return this.#n.some(([e,r])=>r===t)}#o(t,e){if("string"!=typeof t||!t.trim())throw new TypeError("Detector name must be a non-empty string.");if("function"!=typeof e)throw new TypeError(`Detector handler for "${t}" must be a function.`)}destroy(){this.stop(),this.clear()}},{areElsColliding:C,areElsPerfColliding:L,areElsCollTop:k,areElsCollBottom:N,areElsCollLeft:B,areElsCollRight:I}=t,D=new WeakMap,O=new WeakMap,P=new WeakMap,M=new WeakMap,W={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class R{static Utils={...t};static#i=!1;static get elemDebug(){return R.#i}static set elemDebug(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value for elemDebug");R.#i=t}static _debugElemError(t,e){if(!R.#i)return;const r="[TinyHtml Debug] Element validation error";if(console.groupCollapsed(`${r}${e?" — details below":""}`),console.error(r),"undefined"!=typeof Error&&"function"==typeof Error.captureStackTrace){const t=new Error(r);Error.captureStackTrace(t,R._debugElemError),console.error(t.stack)}else console.trace(r);if(Array.isArray(t)){const e=t.map((t,e)=>({index:e,typeOf:null===t?"null":typeof t,constructor:t?.constructor?.name??(null===t?"null":"primitive"),summary:"undefined"!=typeof Element&&t instanceof Element?`${t.tagName?.toLowerCase?.()??"element"}#${t.id||""}.${String(t.className||"").trim().replace(/\s+/g,".")}`:t&&"object"==typeof t&&"nodeType"in t?`nodeType:${t.nodeType}`:"",value:t}));console.table(e)}else console.warn('[TinyHtml Debug] "elems" is not an array:',t);arguments.length>1&&(console.error("[TinyHtml Debug] Problematic element:",e),e&&"object"==typeof e&&console.dir(e)),console.groupEnd()}static parseStyle(t){const e={};return t.split(";").forEach(t=>{const[r,n]=t.split(":").map(t=>t&&t.trim());r&&n&&(e[r]=n)}),e}static#s=!0;static get autoStartElemObserver(){return R.#s}static set autoStartElemObserver(t){if("boolean"!=typeof t)throw new TypeError("autoStartElemObserver must be a boolean.");R.#s=t}static#a=new x({el:"undefined"!=typeof window&&void 0!==window.document?window.document.documentElement:void 0,initDetectors:[["tinyStyleEvent",t=>{if("attributes"!==t.type||"style"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.getAttribute("style")||"",n=function(t,e){const r={added:{},removed:{},modified:{}};for(const n in t)n in e?t[n]!==e[n]&&(r.modified[n]={old:t[n],new:e[n]}):r.removed[n]=t[n];for(const n in e)n in t||(r.added[n]=e[n]);return r}(R.parseStyle(e),R.parseStyle(r));(Object.keys(n.added).length||Object.keys(n.removed).length||Object.keys(n.modified).length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.stylechanged",{detail:n}))}],["tinyClassEvent",t=>{if("attributes"!==t.type||"class"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.className||"",n=function(t,e){const r=t.filter(t=>!e.includes(t));return{added:e.filter(e=>!t.includes(e)),removed:r}}(e.split(/\s+/).filter(Boolean),r.split(/\s+/).filter(Boolean));(n.added.length||n.removed.length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.classchanged",{detail:n}))}]],initCfg:{attributeOldValue:!0,attributes:!0,subtree:!0,attributeFilter:["style","class"]}});static get tinyObserver(){return R.#a}static async fetchHtmlFile(t,e={method:"GET"}){const r=await fetch(t,e),n=r.headers.get("Content-Type")||"";if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);if(!n.includes("text/html"))throw new Error(`Invalid content type: ${n} (expected text/html)`);const o=await r.text();return R.htmlToJson(o)}static async fetchHtmlNodes(t,e){const r=await R.fetchHtmlFile(t,e);return R.jsonToNodes(r)}static async fetchHtmlTinyElems(t,e){const r=await R.fetchHtmlNodes(t,e);return R.toTinyElm(r)}static templateToJson(t){return R.htmlToJson([...t.content.childNodes].map(t=>t instanceof Element?t.getHTML():t instanceof Text?t.textContent:"").join(""))}static templateToNodes(t){const e=[];return[...t.content.cloneNode(!0).childNodes].map(t=>{if(!(t instanceof Element||t instanceof Text||t instanceof Comment))throw new Error(`Expected only Element nodes in <template>, but found: ${t.constructor.name}`);t instanceof Comment||e.push(t)}),e}static templateToTinyElems(t){return R.toTinyElm(R.templateToNodes(t))}static htmlToJson(t){const e=document.createElement("div");e.innerHTML=t.trim();const r=[],n=t=>{if(t instanceof Comment)return null;if(t instanceof Text){const e=t.textContent?.trim();return e||null}if(!(t instanceof Element))return null;const e=t.tagName.toLowerCase(),r={};for(const e of t.attributes)r[R.getPropName(e.name)]=e.value;const o=Array.from(t.childNodes).map(n).filter(Boolean);return o.length>0?[e,r,...o]:[e,r]};for(const t of e.childNodes){const e=n(t);e&&r.push(e)}return e.innerHTML="",r}static jsonToNodes(t){const e=t=>{if("string"==typeof t)return document.createTextNode(t);if(!Array.isArray(t))return document.createTextNode("");const[r,n,...o]=t,i=document.createElement(r);for(const[t,e]of Object.entries(n))i.setAttribute(R.getAttrName(t),e);for(const t of o){const r=e(t);r instanceof Comment||i.appendChild(r)}return i};return t.map(e).filter(t=>!(t instanceof Comment))}static jsonToTinyElems(t){return R.toTinyElm(R.jsonToNodes(t))}static createFrom(t,e){if("string"!=typeof t)throw new TypeError('The "tagName" must be a string.');if(void 0!==e&&"object"!=typeof e)throw new TypeError('The "attrs" must be a object.');const r=R.createElement(t);if("object"==typeof e)for(const t in e)r.setAttr(t,e[t]);return r}static createElement(t,e){if("string"!=typeof t)throw new TypeError("[TinyHtml] createElement(): The tagName must be a string.");if(void 0!==e&&"object"!=typeof e)throw new TypeError("[TinyHtml] createElement(): The ops must be a object.");return new R(document.createElement(t,e))}static createTextNode(t){if("string"!=typeof t)throw new TypeError("[TinyHtml] createTextNode(): The value must be a string.");return new R(document.createTextNode(t))}static createElementFromHTML(t){const e=document.createElement("template");if(!(t=t.trim()).startsWith("<"))return R.createTextNode(t);if(e.innerHTML=t,!(e.content.firstChild instanceof Element))throw new Error("The HTML string must contain a valid HTML element.");return new R(e.content.firstChild)}static createFromHTML(t){const e=document.createElement("template");t=t.trim(),e.innerHTML=t;const r=Array.from(e.content.childNodes);if(!r.every(t=>t instanceof Element||t instanceof Text))throw new Error("The HTML string must contain a valid HTML element.");return new R(r)}static createFromHtml(t){return R.createFromHTML(t)}static query(t,e=document){const r=e.querySelector(t);return r?new R(r):null}querySelector(t){return R.query(t,R._preElem(this,"query"))}static queryAll(t,e=document){return new R(e.querySelectorAll(t))}querySelectorAll(t){return R.queryAll(t,R._preElem(this,"queryAll"))}static getById(t){const e=document.getElementById(t);return e?new R(e):null}static getByClassName(t,e=document){return new R(e.getElementsByClassName(t))}getElementsByClassName(t){return R.getByClassName(t,R._preElem(this,"getByClassName"))}static getByName(t){return new R(document.getElementsByName(t))}static getByTagNameNS(t,e="http://www.w3.org/1999/xhtml",r=document){return new R(r.getElementsByTagNameNS(e,t))}getElementsByTagNameNS(t,e="http://www.w3.org/1999/xhtml"){return R.getByTagNameNS(t,e,R._preElem(this,"getByTagNameNS"))}get elements(){return[...this.#t]}forEach(t){const e=this.elements.map((t,e)=>this.extract(e));for(const r in e)t(e[r],Number(r),e);return this}get(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#t[t])throw new Error(`No element found at index ${t}.`);return this.#t[t]}extract(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#t[t])throw new Error(`Cannot extract: no element exists at index ${t}.`);return new R(this.#t[t])}exists(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");return!!this.#t[t]}getAll(){return[...this.#t]}_getElement(t,e){if(!(this.#t[e]instanceof Element||this.#t[e]instanceof Window||this.#t[e]instanceof Document||this.#t[e]instanceof Text))throw R._debugElemError([...this.#t],this.#t[e]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return this.#t[e]}_getElements(t){if(!this.#t.every(t=>t instanceof Element||t instanceof Window||t instanceof Document||t instanceof Text))throw R._debugElemError([...this.#t]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return[...this.#t]}static _preElemsTemplate(t,e,r,n){const o=t=>{const o=[];return t.map(i=>(i instanceof R?i._getElements(e):[i]).map(i=>{let s=!1;for(const t of r)if(i instanceof t){s=!0;break}if(!s)throw R._debugElemError([...t],i),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return o.push(i),i})),o};return Array.isArray(t)?o(t):o([t])}static _preElemTemplate(t,e,r,n,o=!1){const i=t=>{const i=t[0],s=i instanceof R?i._getElements(e):[i];if(s.length>1)throw R._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${s.length}/1).`);let a=!1;for(const t of r)if(s[0]instanceof t){a=!0;break}if(!o||null!==s[0]&&void 0!==s[0]||(s[0]=null,a=!0),!a)throw R._debugElemError([...t],s[0]),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return s[0]};if(!Array.isArray(t))return i([t]);if(t.length>1)throw R._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${t.length}/1).`);return i(t)}static _preElems(t,e){return R._preElemsTemplate(t,e,[Element],["Element"])}static _preElem(t,e){return R._preElemTemplate(t,e,[Element],["Element"])}static _preNodeElems(t,e){return R._preElemsTemplate(t,e,[Node],["Node"])}static _preNodeElem(t,e){return R._preElemTemplate(t,e,[Node],["Node"])}static _preNodeElemWithNull(t,e){return R._preElemTemplate(t,e,[Node],["Node"],!0)}static _preHtmlElems(t,e){return R._preElemsTemplate(t,e,[HTMLElement],["HTMLElement"])}static _preHtmlElem(t,e){return R._preElemTemplate(t,e,[HTMLElement],["HTMLElement"])}static _preInputElems(t,e){return R._preElemsTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preInputElem(t,e){return R._preElemTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preEventTargetElems(t,e){return R._preElemsTemplate(t,e,[EventTarget],["EventTarget"])}static _preEventTargetElem(t,e){return R._preElemTemplate(t,e,[EventTarget],["EventTarget"])}static _preElemsAndWindow(t,e){return R._preElemsTemplate(t,e,[Element,Window],["Element","Window"])}static _preElemAndWindow(t,e){return R._preElemTemplate(t,e,[Element,Window],["Element","Window"])}static _preElemsAndWinAndDoc(t,e){return R._preElemsTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]).map(t=>t instanceof Document?t.documentElement:t)}static _preElemAndWinAndDoc(t,e){const r=R._preElemTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]);return r instanceof Document?r.documentElement:r}static _preElemsWithDoc(t,e){return R._preElemsTemplate(t,e,[Element,Document],["Element","Document"])}static _preElemWithDoc(t,e){return R._preElemTemplate(t,e,[Element,Document],["Element","Document"])}static toTinyElm(t){const e=t=>t.map(t=>t instanceof R?t:new R(t));return Array.isArray(t)?e(t):e([t])}static fromTinyElm(t){const e=t=>{const e=[];return t.map(t=>(t instanceof R?t._getElements("fromTinyElm"):[t]).map(t=>e.push(t))),e};return Array.isArray(t)?e(t):e([t])}static winnow(t,e,r,n=!1){if("boolean"!=typeof n)throw new TypeError('The "not" must be a boolean.');if("function"==typeof e)return R._preElems(t,r).filter((t,r)=>!!e.call(t,r,t)!==n);if(e instanceof Element)return R._preElems(t,r).filter(t=>t===e!==n);if(Array.isArray(e)||"string"!=typeof e&&null!=e.length)return R._preElems(t,r).filter(t=>e.includes(t)!==n);let o=e;return n&&(o=`:not(${o})`),R._preElems(t,r).filter(t=>1===t.nodeType&&t.matches(o))}static filter(t,e,r=!1){return r&&(e=`:not(${e})`),R._preElems(t,"filter").filter(t=>1===t.nodeType&&t.matches(e))}static filterOnly(t,e){return R.winnow(t,e,"filterOnly",!1)}static not(t,e){return R.winnow(t,e,"not",!0)}not(t){return R.not(this,t)}static find(t,e){const r=[];for(const n of R._preElems(t,"find"))r.push(...n.querySelectorAll(e));return[...new Set(r)]}find(t){return R.find(this,t)}static is(t,e){return R.winnow(t,e,"is",!1).length>0}is(t){return R.is(this,t)}static has(t,e){const r="string"==typeof e?[...document.querySelectorAll(e)]:R._preElems(e,"has");return R._preElems(t,"has").filter(t=>r.some(e=>t&&t.contains(e)))}has(t){return R.has(this,t)}static closest(t,e,r){const n=[];for(const o of R._preElems(t,"closest")){let t=o;for(;t&&t!==r;){if(1===t.nodeType&&("string"==typeof e?t.matches(e):t===e)){n.push(t);break}t=t.parentElement}}return[...new Set(n)]}closest(t,e){return R.closest(this,t,e)}static isSameDom(t,e){return R._preNodeElem(t,"isSameDom")===R._preNodeElem(e,"isSameDom")}isSameDom(t){return R.isSameDom(this,t)}#l={};get _data(){return{...this.#l}}set _data(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("value must be a non-null object.");this.#l=t}static _dataSelector={public:(t,e)=>{const r=R._preElem(e,t);let n=O.get(r);return n||(n={},O.set(r,n)),n},private:(t,e)=>{if(!(e instanceof R))throw new Error(`Element must be a TinyHtml instance to execute ${t}().`);return e.#l}};static data(t,e,r=!1){const n=R._dataSelector[r?"private":"public"]("data",t);if(null==e)return{...n};if("string"!=typeof e)throw new TypeError("The key must be a string.");return n.hasOwnProperty(e)?n[e]:void 0}data(t,e){return R.data(this,t,e)}static setData(t,e,r,n=!1){const o=R._dataSelector[n?"private":"public"]("setData",t);if("string"!=typeof e)throw new TypeError("The key must be a string.");return void 0!==r?o[e]=r:R.removeData(t,e),t}setData(t,e,r=!1){return R.setData(this,t,e,r)}static hasData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");const n=R._dataSelector[r?"private":"public"]("hasData",t);return Object.prototype.hasOwnProperty.call(n,e)}hasData(t,e=!1){return R.hasData(this,t,e)}static removeData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");return delete R._dataSelector[r?"private":"public"]("removeData",t)[e]}removeData(t,e=!1){return R.removeData(this,t,e)}static _getSibling(t,e,r){let n=R._preNodeElemWithNull(t,r);for(;n&&(n=n[e])&&1!==n.nodeType;);return n instanceof Node?n:null}static _getSiblings(t,e){let r=t;const n=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==e&&n.push(r);return n}static domDir(t,e,r,n="domDir"){if("string"!=typeof e)throw new TypeError('The "direction" must be a string.');let o=R._preNodeElemWithNull(t,n);const i=[];for(;o&&(o=o[e]);)if(1===o.nodeType){if(r&&("string"==typeof r?o.matches(r):o===r))break;i.push(o)}return i}static parent(t){let e=R._preNodeElemWithNull(t,"parent");const r=e?e.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return R.parent(this)}static parents(t,e){return R.domDir(t,"parentNode",e,"parents")}parents(t){return R.parents(this,t)}static next(t){return R._getSibling(t,"nextSibling","next")}next(){return R.next(this)}static prev(t){return R._getSibling(t,"previousSibling","prev")}prev(){return R.prev(this)}static nextAll(t){return R.domDir(t,"nextSibling",void 0,"nextAll")}nextAll(){return R.nextAll(this)}static prevAll(t){return R.domDir(t,"previousSibling",void 0,"prevAll")}prevAll(){return R.prevAll(this)}static nextUntil(t,e){return R.domDir(t,"nextSibling",e,"nextUtil")}nextUntil(t){return R.nextUntil(this,t)}static prevUntil(t,e){return R.domDir(t,"previousSibling",e,"prevUtil")}prevUntil(t){return R.prevUntil(this,t)}static siblings(t){const e=R._preNodeElemWithNull(t,"siblings");return R._getSiblings(e&&e.parentNode?e.parentNode.firstChild:null,e)}siblings(){return R.siblings(this)}static children(t){const e=R._preNodeElemWithNull(t,"children");return R._getSiblings(e?e.firstChild:null)}children(){return R.children(this)}static contents(t){const e=R._preNodeElemWithNull(t,"contents");return e instanceof HTMLIFrameElement&&null!=e.contentDocument&&Object.getPrototypeOf(e.contentDocument)?[e.contentDocument]:e instanceof HTMLTemplateElement?Array.from((e.content||e).childNodes):e?Array.from(e.childNodes):[]}contents(){return R.contents(this)}static clone(t,e=!0){if("boolean"!=typeof e)throw new TypeError('The "deep" must be a boolean.');return R._preNodeElems(t,"clone").map(t=>t.cloneNode(e))}clone(t){return R.clone(this,t)[0]}static _appendChecker(t,...e){const r=[];for(const n of e)if(null!=n&&!1!==n)if("string"!=typeof n&&"number"!=typeof n)if(n instanceof Node||n instanceof R)r.push(...R._preNodeElems(n,t));else if(Array.isArray(n))r.push(...R._appendChecker(t,...n));else for(const e in n){const o=n[e];r.push(...R._appendChecker(t,o))}else r.push(n);return r}static append(t,...e){return R._preElem(t,"append").append(...R._appendChecker("append",...e)),t}append(...t){return R.append(this,...t)}static prepend(t,...e){return R._preElem(t,"prepend").prepend(...R._appendChecker("prepend",...e)),t}prepend(...t){return R.prepend(this,...t)}static before(t,...e){return R._preElem(t,"before").before(...R._appendChecker("before",...e)),t}before(...t){return R.before(this,...t)}static after(t,...e){return R._preElem(t,"after").after(...R._appendChecker("after",...e)),t}after(...t){return R.after(this,...t)}static replaceWith(t,...e){return R._preElem(t,"replaceWith").replaceWith(...R._appendChecker("replaceWith",...e)),t}replaceWith(...t){return R.replaceWith(this,...t)}static appendTo(t,e){const r=R._preNodeElems(t,"appendTo"),n=R._preNodeElems(e,"appendTo");return n.forEach((t,e)=>{r.forEach(r=>t.appendChild(e===n.length-1?r:r.cloneNode(!0)))}),t}appendTo(t){return R.appendTo(this,t)}static prependTo(t,e){const r=R._preElems(t,"prependTo"),n=R._preElems(e,"prependTo");return n.forEach((t,e)=>{r.slice().reverse().forEach(r=>t.prepend(e===n.length-1?r:r.cloneNode(!0)))}),t}prependTo(t){return R.prependTo(this,t)}static insertBefore(t,e,r=null){const n=R._preNodeElem(t,"insertBefore"),o=R._preNodeElem(e,"insertBefore"),i=R._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert before.");return o.parentNode.insertBefore(n,i||o),t}insertBefore(t,e){return R.insertBefore(this,t,e)}static insertAfter(t,e,r=null){const n=R._preNodeElem(t,"insertAfter"),o=R._preNodeElem(e,"insertBefore"),i=R._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert after.");return o.parentNode.insertBefore(n,i||o.nextSibling),t}insertAfter(t,e){return R.insertAfter(this,t,e)}static replaceAll(t,e){const r=R._preNodeElems(t,"replaceAll"),n=R._preNodeElems(e,"replaceAll");return n.forEach((t,e)=>{const o=t.parentNode;r.forEach(r=>{o&&o.replaceChild(e===n.length-1?r:r.cloneNode(!0),t)})}),t}replaceAll(t){return R.replaceAll(this,t)}#t;get size(){return this.#t.length}static _elCheck(t){for(const e of t)if(!(e instanceof Element||e instanceof Window||e instanceof Document||e instanceof Text))throw new Error("[TinyHtml] Invalid Target in constructor.")}add(t){return new R([...this.#t,...R._selector(t)])}static _selector(t){if(t instanceof R)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");const e=t=>Array.from(new Set(t)),r="string"!=typeof t?t:document.querySelectorAll(t);if(Array.isArray(r))return R._elCheck(r),e(r);if(r instanceof NodeList||r instanceof HTMLCollection){const t=[...r];return R._elCheck(t),e(t)}{const t=[r];return R._elCheck(t),e(t)}}constructor(t){this.#t=R._selector(t),this.#c=R.#f}static isWindow(t){return null!=t&&t===t.window}static css(t){const e=R._preElem(t,"css");return window.getComputedStyle(e)}css(){return R.css(this)}static cssString(t,e){const r=R._preElem(t,"cssString");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return"string"==typeof n?n:"number"==typeof n?n.toString():null}cssString(t){return R.cssString(this,t)}static cssList(t,e){const r=R._preElem(t,"cssList");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)void 0!==t&&(o[t]=n.getPropertyValue(t));return o}cssList(t){return R.cssList(this,t)}static cssFloat(t,e){const r=R._preElem(t,"cssFloat");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return parseFloat(n)||0}cssFloat(t){return R.cssFloat(this,t)}static cssFloats(t,e){const r=R._preElem(t,"cssFloats");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)o[t]=parseFloat(n[t])||0;return o}cssFloats(t){return R.cssFloats(this,t)}static#u={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(R.#u,{set:(t,e,r)=>(t[e]=r,R.cssPropRevAliases[r]=e,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(R.#u).map(([t,e])=>[e,t]));static toStyleKc(t){return"string"==typeof R.cssPropAliases[t]?R.cssPropAliases[t]:t}static toStyleCc(t){return"string"==typeof R.cssPropRevAliases[t]?R.cssPropRevAliases[t]:t}static setStyle(t,e,r=null){return R._preHtmlElems(t,"setStyle").forEach(t=>{if("object"==typeof e)for(const[r,n]of Object.entries(e))t.style.setProperty(R.toStyleKc(r),"string"==typeof n?n:"number"==typeof n?`${n}px`:String(n));else t.style.setProperty(R.toStyleKc(e),r)}),t}setStyle(t,e){return R.setStyle(this,t,e)}static getStyle(t,e){return R._preHtmlElem(t,"getStyle").style.getPropertyValue(R.toStyleKc(e))}getStyle(t){return R.getStyle(this,t)}static style(t,{camelCase:e=!1,rawAttr:r=!1}={}){if("boolean"!=typeof e)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof e);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const n=R._preHtmlElem(t,"style"),o={};if(r){const t=(n.getAttribute("style")||"").split(";");for(const r of t){const[t,n]=r.split(":");if(!t||!n)continue;const i=t.trim(),s=n.trim();o[e?R.toStyleCc(i):i]=s}}else{const t=n.style;for(let r=0;r<t.length;r++){const n=t[r],i=t.getPropertyValue(n);o[e?R.toStyleCc(n):n]=i}}return o}style(t){return R.style(this,t)}static removeStyle(t,e){return R._preHtmlElems(t,"removeStyle").forEach(t=>{if(Array.isArray(e))for(const r of e)t.style.removeProperty(R.toStyleKc(r));else t.style.removeProperty(R.toStyleKc(e))}),t}removeStyle(t){return R.removeStyle(this,t)}static toggleStyle(t,e,r,n){return R._preHtmlElems(t,"toggleStyle").forEach(t=>{const o=R.getStyle(t,e).trim()===R.toStyleKc(r)?n:r;R.setStyle(t,e,o)}),t}toggleStyle(t,e,r){return R.toggleStyle(this,t,e,r)}static clearStyle(t){return R._preElems(t,"clearStyle").forEach(t=>t.removeAttribute("style")),t}clearStyle(){return R.clearStyle(this)}static focus(t){return R._preHtmlElem(t,"focus").focus(),t}focus(){return R.focus(this)}static blur(t){return R._preHtmlElem(t,"blur").blur(),t}blur(){return R.blur(this)}static select(t){const e=R._preHtmlElem(t,"select");if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("Element must be an <input> or <textarea> to use select().");return e.select(),t}select(){return R.select(this)}static boolCheck(t){return void 0!==t&&("true"===t||"1"===t||!0===t||"on"===t||"number"==typeof t&&t>0)}static setWinScrollTop(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");R.setScrollTop(window,t)}static setWinScrollLeft(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");R.setScrollLeft(window,t)}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static isPageTop(){return 0===window.scrollY}static isPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}static getDimension(t,e,r="content"){const n=R._preElemAndWinAndDoc(t,"getDimension");if("string"!=typeof e)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const o="width"===e?"Width":"Height";if(R.isWindow(n))return"margin"===r?n["inner"+o]:n.document.documentElement["client"+o];const i=n;if(9===i.nodeType){const t=i.documentElement;return Math.max(i.body["scroll"+o],t["scroll"+o],i.body["offset"+o],t["offset"+o],t["client"+o])}let s=i.getBoundingClientRect()[e];function a(t){return"width"===e?R.cssFloat(i,t+"Left")+R.cssFloat(i,t+"Right"):R.cssFloat(i,t+"Top")+R.cssFloat(i,t+"Bottom")}switch(r){case"content":s-=a("padding"),s-=a("border");break;case"padding":s-=a("border");break;case"border":break;case"margin":s+=a("margin")}return s}getDimension(t,e){return R.getDimension(this,t,e)}static setHeight(t,e){const r=R._preHtmlElem(t,"setHeight");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.height="number"==typeof e?`${e}px`:e,t}setHeight(t){return R.setHeight(this,t)}static setWidth(t,e){const r=R._preHtmlElem(t,"setWidth");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.width="number"==typeof e?`${e}px`:e,t}setWidth(t){return R.setWidth(this,t)}static height(t){const e=R._preElemAndWinAndDoc(t,"height");return R.getDimension(e,"height","content")}height(){return R.height(this)}static width(t){const e=R._preElemAndWinAndDoc(t,"width");return R.getDimension(e,"width","content")}width(){return R.width(this)}static innerHeight(t){const e=R._preElemAndWinAndDoc(t,"innerHeight");return R.getDimension(e,"height","padding")}innerHeight(){return R.innerHeight(this)}static innerWidth(t){const e=R._preElemAndWinAndDoc(t,"innerWidth");return R.getDimension(e,"width","padding")}innerWidth(){return R.innerWidth(this)}static outerHeight(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=R._preElemAndWinAndDoc(t,"outerHeight");return R.getDimension(r,"height",e?"margin":"border")}outerHeight(t){return R.outerHeight(this,t)}static outerWidth(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=R._preElemAndWinAndDoc(t,"outerWidth");return R.getDimension(r,"width",e?"margin":"border")}outerWidth(t){return R.outerWidth(this,t)}#c="";get mainDisplay(){return this.#c}set mainDisplay(t){if("string"!=typeof t)throw new TypeError("mainDisplay must be a string.");this.#c=t}static#f="block";static get defaultDisplay(){return R.#f}static set defaultDisplay(t){if("string"!=typeof t)throw new TypeError("defaultDisplay must be a string.");R.#f=t}static getAnimateData(t,e){let r=P.get(t);return r||(r={},P.set(t,r)),r[e]}static setAnimateData(t,e,r){if(!(t instanceof HTMLElement))throw new TypeError("setAnimateData: el must be an HTMLElement.");if("string"!=typeof e)throw new TypeError("setAnimateData: where must be a string.");if("string"!=typeof r&&"number"!=typeof r)throw new TypeError("setAnimateData: value must be a string or number.");let n=P.get(t);n||(n={},P.set(t,n)),n[e]=r}static#p=!0;static get cancelOldStyleFx(){return R.#p}static set cancelOldStyleFx(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value.");R.#p=t}static#h={slow:{duration:600,easing:"ease"},fast:{duration:200,easing:"ease-out"},_default:{duration:400,easing:"linear"}};static get styleFxSpeeds(){const t={};for(const e in R.#h){const r=R.#h[e];t[e]="object"==typeof r?{...r}:r}return t}static set styleFxSpeeds(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleFxSpeeds must be an object.");for(const[e,r]of Object.entries(t))if("number"!=typeof r&&"object"!=typeof r)throw new TypeError(`styleFxSpeeds["${e}"] must be a number or KeyframeAnimationOptions.`);R.#h={};for(const[e,r]of Object.entries(t))R.setStyleFxSpeed(e,r)}static getStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=R.#h[t];return"object"==typeof e?{...e}:e}static setStyleFxSpeed(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("number"!=typeof e&&"object"!=typeof e)throw new TypeError("styleFxSpeed must be a number or KeyframeAnimationOptions");R.#h[t]="object"==typeof e?{...e}:e}static deleteStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete R.#h[t]}static hasStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(R.#h,t)}static#m=["Top","Right","Bottom","Left"];static#d={slideDown:R.genStyleFx("show"),slideUp:R.genStyleFx("hide"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}};static get styleEffects(){return JSON.parse(JSON.stringify(R.#d))}static set styleEffects(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffects must be an object");for(const e in t)for(const[r,n]of Object.entries(t[e]))if(!("string"==typeof n||Array.isArray(n)&&n.every(t=>"string"==typeof t||"number"==typeof t)))throw new TypeError(`Invalid styleEffect["${r}"]`);R.#d={};for(const e in t)R.setStyleEffect(e,t[e])}static getStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=R.#d[t];return e?JSON.parse(JSON.stringify(e)):void 0}static setStyleEffect(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("styleEffect must be an object");const r={};for(const[t,n]of Object.entries(e))if("string"==typeof n)r[t]=n;else{if(!Array.isArray(n)||!n.every(t=>"string"==typeof t||"number"==typeof t))throw new TypeError(`Invalid styleEffect["${t}"]`);r[t]=[...n]}R.#d[t]=r}static deleteStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete R.#d[t]}static hasStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(R.#d,t)}static#g={slideDown:"slideUp",slideUp:"slideDown",fadeIn:"fadeOut",fadeOut:"fadeIn",fadeTo:"fadeIn"};static get styleEffectInverse(){return{...R.#g}}static set styleEffectInverse(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectInverse must be an object.");for(const[e,r]of Object.entries(t))if("string"!=typeof r)throw new TypeError(`styleEffectInverse["${e}"] must be a string.`);R.#g={};for(const[e,r]of Object.entries(t))R.setStyleEffectInverse(e,r)}static getStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return R.#g[t]||null}static setStyleEffectInverse(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("string"!=typeof e)throw new TypeError(`styleEffectInverse["${t}"] must be a string.`);R.#g[t]=e}static deleteStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete R.#g[t]}static hasStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(R.#g,t)}static#y={slideDown:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),slideUp:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),fadeIn:t=>Number(t.opacity[0])===Number(t.opacity[1]),fadeOut:t=>Number(t.opacity[0])===Number(t.opacity[1])};static get styleEffectsRd(){return{...R.#y}}static set styleEffectsRd(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectsRd must be an object.");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsRd["${e}"] must be a function.`);R.#y={};for(const[e,r]of Object.entries(t))R.setStyleEffectRd(e,r)}static getStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return R.#y[t]||null}static setStyleEffectRd(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsRd["${t}"] must be a function.`);R.#y[t]=e}static deleteStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete R.#y[t]}static hasStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(R.#y,t)}static#b={show:(t,e,r,n)=>{if("height"===r||"width"===r){const o=R.getAnimateData(t,`orig${r}`)||t.scrollHeight+"px";R.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,o]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=R.getAnimateData(t,r)||n[r];R.setAnimateData(t,r,o),e[r]=["0px",o]}else if("opacity"===r){const t=n.opacity;e[r]=[t,1]}else{const o=R.getAnimateData(t,r)||n[r];R.setAnimateData(t,r,o),e[r]=[o,n[r]||1]}},hide:(t,e,r,n)=>{if("height"===r||"width"===r){const o=R.getAnimateData(t,`orig${r}`)||n[r];R.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,0]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=R.getAnimateData(t,r)||n[r];R.setAnimateData(t,r,o),e[r]=[n[r],"0px"]}else if("opacity"===r){const t=n.opacity;e[r]=[t,0]}else{const o=R.getAnimateData(t,r)||n[r];R.setAnimateData(t,r,o),e[r]=[o,0]}}};static get styleEffectsProps(){return{...R.#b}}static set styleEffectsProps(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffectsProps must be an object");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsProps["${e}"] must be a function`);R.#b={};for(const[e,r]of Object.entries(t))R.setStyleEffectProp(e,r)}static getStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return R.#b[t]||null}static setStyleEffectProp(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsProps["${t}"] must be a function`);R.#b[t]=e}static deleteStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete R.#b[t]}static hasStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(R.#b,t)}static genStyleFx(t,e=!1){if("string"!=typeof t)throw new TypeError("genStyleFx: type must be a string.");if("boolean"!=typeof e)throw new TypeError("genStyleFx: includeWidth must be a boolean.");let r,n=0;const o={height:t},i=e?1:0;for(;n<4;n+=2-i)r=R.#m[n],o["margin"+r]=t,o["padding"+r]=t;return e&&(o.opacity=t,o.width=t),o}static applyStyleFx(t,e,r,n){if("string"!=typeof e)throw new TypeError("applyStyleFx: id must be a string.");if("object"!=typeof r||null===r)throw new TypeError("applyStyleFx: props must be a non-null object.");if(void 0!==n&&"number"!=typeof n&&"string"!=typeof n&&("object"!=typeof n||null===n))throw new TypeError("applyStyleFx: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return R._preHtmlElems(t,"applyStyleFx").forEach(i=>{const s={};for(const[t,e]of Object.entries(r))if("string"==typeof e&&this.#b[e]){const r=getComputedStyle(i);this.#b[e](i,s,t,r)}else{if("object"!=typeof e)throw new TypeError(`applyStyleFx: invalid action for prop "${t}". Must be string or array.`);s[t]=e}if("function"==typeof R.#y[e]&&R.#y[e](s))return void o.set(i,null);const a=[],l=s[Object.keys(s)[0]].length;for(let t=0;t<l;t++){const e={};for(const r in s)e[r]=s[r][t];a.push(e)}o.set(i,R.animate(t,a,n,e)[0])}),o}applyStyleFx(t,e,r){return R.applyStyleFx(this,t,e,r)}static getCurrentAnimationId(t){if(!(t instanceof HTMLElement))throw new TypeError("Expected an HTMLElement.");return M.get(t)?.id??void 0}static animate(t,e,r=R.#h._default,n=null,o=R.#p){const i="string"==typeof r?R.#h[r]??void 0:"number"!=typeof r?{...r}:r;"object"==typeof i&&void 0===i.fill&&(i.fill="forwards");const s=[];return R._preHtmlElems(t,"animate").forEach(t=>{if(o){const e=M.get(t);e&&e.animation.cancel()}const r=t.animate(e,i);s.push(r),M.set(t,{animation:r,id:n??""}),r.addEventListener("finish",()=>{M.get(t)?.animation===r&&M.delete(t)})}),s}animate(t,e,r,n){return R.animate(this,t,e,r,n)}static stop(t){const e=[];return R._preHtmlElems(t,"stop").forEach(t=>{const r=M.get(t);r?(r.animation.cancel(),M.delete(t),e.push(!0)):e.push(!1)}),e}stop(){return R.stop(this)}static slideDown(t,e){return R.applyStyleFx(t,"slideDown",this.#d.slideDown,e??{duration:500,easing:"ease-out"})}slideDown(t){return R.slideDown(this,t)}static slideUp(t,e){return R.applyStyleFx(t,"slideUp",this.#d.slideUp,e??{duration:500,easing:"ease-out"})}slideUp(t){return R.slideUp(this,t)}static slideToggle(t,e){const r=R._preHtmlElem(t,"slideToggle"),n=getComputedStyle(r),o=R.getCurrentAnimationId(r),i="none"===n.display||0===r.offsetHeight;return("string"==typeof o?"slideUp"===o:i)?R.slideDown(t,e):R.slideUp(t,e)}slideToggle(t){return R.slideToggle(this,t)}static fadeIn(t,e){return R.applyStyleFx(t,"fadeIn",this.#d.fadeIn,e)}fadeIn(t){return R.fadeIn(this,t)}static fadeOut(t,e){return R.applyStyleFx(t,"fadeOut",this.#d.fadeOut,e)}fadeOut(t){return R.fadeOut(this,t)}static fadeToggle(t,e){const r=R._preHtmlElem(t,"fadeToggle"),n=getComputedStyle(r),o=R.getCurrentAnimationId(r),i="0"===n.opacity||null===r.offsetParent;return("string"==typeof o?"fadeOut"===o:i)?R.fadeIn(t,e):R.fadeOut(t,e)}fadeToggle(t){return R.fadeToggle(this,t)}static fadeTo(t,e,r,n=R.#f){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new TypeError("fadeTo: opacity must be a number between 0 and 1.");if(void 0!==r&&"number"!=typeof r&&"string"!=typeof r&&("object"!=typeof r||null===r))throw new TypeError("fadeTo: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return R._preHtmlElems(t,"fadeTo").forEach(i=>{const s=getComputedStyle(i);if(!(t instanceof Element&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length))){const t=R.getAnimateData(i,"origdisplay");i.style.display="string"==typeof t?t:n}const a=[s.opacity,e].map(t=>({opacity:t}));o.set(i,R.animate(i,a,r,"fadeTo")[0])}),o}fadeTo(t,e,r=this.#c){return R.fadeTo(this,t,e,r)}static offset(t){const e=R._preElem(t,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft;return{top:e.top+r,left:e.left+n}}offset(){return R.offset(this)}static position(t){const e=R._preHtmlElem(t,"position");let r,n,o={top:0,left:0};if("fixed"===window.getComputedStyle(e).position)n=e.getBoundingClientRect();else{n=R.offset(e),r=e.offsetParent||document.documentElement;const{position:t}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===t;)r=r.parentNode;if(r instanceof HTMLElement&&r!==e&&1===r.nodeType){const{borderTopWidth:t,borderLeftWidth:e}=R.cssFloats(r,["borderTopWidth","borderLeftWidth"]);o=R.offset(r),o.top+=t,o.left+=e}}return{top:n.top-o.top-R.cssFloat(e,"marginTop"),left:n.left-o.left-R.cssFloat(e,"marginLeft")}}position(){return R.position(this)}static offsetParent(t){let e=R._preHtmlElem(t,"offsetParent").offsetParent;for(;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position;)e=e.offsetParent;return e instanceof HTMLElement?e:document.documentElement}offsetParent(){return R.offsetParent(this)}static scrollTop(t){const e=R._preElemAndWindow(t,"scrollTop");return R.isWindow(e)?e.pageYOffset:9===e.nodeType?e.defaultView.pageYOffset:e.scrollTop}scrollTop(){return R.scrollTop(this)}static scrollLeft(t){const e=R._preElemAndWindow(t,"scrollLeft");return R.isWindow(e)?e.pageXOffset:9===e.nodeType?e.defaultView.pageXOffset:e.scrollLeft}scrollLeft(){return R.scrollLeft(this)}static easings={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};static scrollToXY(t,{targetX:e,targetY:r,duration:n,easing:o,onAnimation:i}={}){if(void 0!==e&&"number"!=typeof e)throw new TypeError("`targetX` must be a number if provided.");if(void 0!==r&&"number"!=typeof r)throw new TypeError("`targetY` must be a number if provided.");if(void 0!==n&&"number"!=typeof n)throw new TypeError("`duration` must be a number if provided.");if(void 0!==o&&"string"!=typeof o)throw new TypeError("`easing` must be a string if provided.");if(void 0!==o&&"function"!=typeof R.easings[o])throw new TypeError(`Unknown easing function: "${o}".`);if(void 0!==i&&"function"!=typeof i)throw new TypeError("`onAnimation` must be a function if provided.");const s=(t,e,r,n)=>{if(t instanceof Window)window.scrollTo(e,r);else if(9===t.nodeType)t.defaultView.scrollTo(e,r);else{const n=t instanceof Window?window.scrollX:t.scrollLeft,o=t instanceof Window?window.scrollY:t.scrollTop;n!==e&&(t.scrollLeft=e),o!==r&&(t.scrollTop=r)}"function"==typeof i&&i({x:e,y:r,isComplete:n>=1,time:n})};return R._preElemsAndWindow(t,"scrollToXY").forEach(t=>{const i=t instanceof Window?window.scrollX:t.scrollLeft,a=t instanceof Window?window.scrollY:t.scrollTop,l=e??i,c=r??a,f=l-i,u=c-a,p="string"==typeof o&&R.easings[o]||null;if("number"!=typeof n||"function"!=typeof p)return s(t,l,c,1);const h=performance.now(),m=n??0;requestAnimationFrame(function e(r){if("function"!=typeof p)return;const n=Math.min(1,(r-h)/m),o=p(n);s(t,i+f*o,a+u*o,n),n<1&&requestAnimationFrame(e)})}),t}scrollToXY({targetX:t,targetY:e,duration:r,easing:n,onAnimation:o}={}){return R.scrollToXY(this,{targetX:t,targetY:e,duration:r,easing:n,onAnimation:o})}static setScrollTop(t,e){if("number"!=typeof e)throw new TypeError("ScrollTop value must be a number.");return R.scrollToXY(t,{targetY:e})}setScrollTop(t){return R.setScrollTop(this,t)}static setScrollLeft(t,e){if("number"!=typeof e)throw new TypeError("ScrollLeft value must be a number.");return R.scrollToXY(t,{targetX:e})}setScrollLeft(t){return R.setScrollLeft(this,t)}static borderWidth(t){const e=R._preElem(t,"borderWidth"),{borderLeftWidth:r,borderRightWidth:n,borderTopWidth:o,borderBottomWidth:i}=R.cssFloats(e,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}borderWidth(){return R.borderWidth(this)}static border(t){const e=R._preElem(t,"border"),{borderLeft:r,borderRight:n,borderTop:o,borderBottom:i}=R.cssFloats(e,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}border(){return R.border(this)}static margin(t){const e=R._preElem(t,"margin"),{marginLeft:r,marginRight:n,marginTop:o,marginBottom:i}=R.cssFloats(e,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}margin(){return R.margin(this)}static padding(t){const e=R._preElem(t,"padding"),{paddingLeft:r,paddingRight:n,paddingTop:o,paddingBottom:i}=R.cssFloats(e,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}padding(){return R.padding(this)}static#w=!1;static get classCanWhitespace(){return this.#w}static set classCanWhitespace(t){if("boolean"!=typeof t)throw new TypeError("classCanWhitespace must be a boolean");this.#w=t}static addClass(t,...e){const r=[];for(const t of e)if(R.#w){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return R._preElems(t,"addClass").forEach(t=>t.classList.add(...r)),t}addClass(...t){return R.addClass(this,...t)}static removeClass(t,...e){const r=[];for(const t of e)if(R.#w){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return R._preElems(t,"removeClass").forEach(t=>t.classList.remove(...r)),t}removeClass(...t){return R.removeClass(this,...t)}static replaceClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const n=[];return R._preElems(t,"replaceClass").forEach(t=>n.push(t.classList.replace(e,r))),n}replaceClass(t,e){return R.replaceClass(this,t,e)[0]}static classItem(t,e){const r=R._preElem(t,"classItem");if("number"!=typeof e)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(e)}classItem(t){return R.classItem(this,t)}static toggleClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const n=[];return R._preElems(t,"toggleClass").forEach(t=>n.push(t.classList.toggle(e,r))),n}toggleClass(t,e){return R.toggleClass(this,t,e)[0]}static hasClass(t,e){const r=R._preElem(t,"hasClass");if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(e)}hasClass(t){return R.hasClass(this,t)}static classLength(t){return R._preElem(t,"classLength").classList.length}classLength(){return R.classLength(this)}static classList(t){return R._preElem(t,"classList").classList.values().toArray()}classList(){return R.classList(this)}static tagName(t){return R._preElem(t,"tagName").tagName}tagName(){return R.tagName(this)}static id(t){return R._preElem(t,"id").id}id(){return R.id(this)}static toBigInt(t){const e=R._preElem(t,"toBigInt"),r=e.textContent?.trim();let n=null;try{n=BigInt(r??"")}catch{n=null}return n}toBigInt(){return R.toBigInt(this)}static setBigInt(t,e){if("bigint"!=typeof e)throw new Error("Value is not a valid BigInt.");const r=e.toString();return R._preElems(t,"setBigInt").forEach(t=>t.textContent=r),t}setBigInt(t){return R.setBigInt(this,t)}static toDate(t){const e=R._preElem(t,"toDate"),r=e.textContent?.trim();if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}toDate(){return R.toDate(this)}static setDate(t,e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))throw new Error("Value is not a valid Date.");const r=e.toISOString();return R._preElems(t,"setDate").forEach(t=>t.textContent=r),t}setDate(t){return R.setDate(this,t)}static toJson(t){const e=R._preElem(t,"toJson"),r=e.textContent?.trim();if(!r)return null;try{return JSON.parse(r)}catch{return null}}toJson(){return R.toJson(this)}static setJson(t,e,r,n){const o=JSON.stringify(e,r,n);return R._preElems(t,"setJson").forEach(t=>t.textContent=o),t}setJson(t,e,r){return R.setJson(this,t,e,r)}static toNumber(t){const e=R._preElem(t,"toNumber");return"string"==typeof e.textContent?parseFloat(e.textContent.trim()):null}toNumber(){return R.toNumber(this)}static setNumber(t,e){if("number"!=typeof e)throw new Error("Value is not a valid number.");const r=e.toString();return R._preElems(t,"setNumber").forEach(t=>t.textContent=r),t}setNumber(t){return R.setNumber(this,t)}static toBoolean(t){const e=R._preElem(t,"toBoolean"),r=e.textContent?.trim();return null==r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}toBoolean(){return R.toBoolean(this)}static setBoolean(t,e){if("boolean"!=typeof e)throw new Error("Value is not a valid boolean.");const r=e.toString();return R._preElems(t,"setBoolean").forEach(t=>t.textContent=r),t}setBoolean(t){return R.setBoolean(this,t)}static toString(t){const e=R._preElem(t,"toString");return"string"==typeof e.textContent?e.textContent:null}toString(){return R.toString(this)}static setString(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return R._preElems(t,"setString").forEach(t=>t.textContent=e),t}setString(t){return R.setString(this,t)}static text(t){return R._preElem(t,"text").textContent}text(){return R.text(this)}static setText(t,e){const r=null!=e?String(e):"";return R._preElems(t,"setText").forEach(t=>t.textContent=r),t}setText(t){return R.setText(this,t)}static empty(t){return R._preElems(t,"empty").forEach(t=>t.textContent=""),t}empty(){return R.empty(this)}static html(t,e){return R._preElem(t,"html").getHTML(e)}html(t){return R.html(this,t)}static setHtml(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return R._preElems(t,"setHtml").forEach(t=>t.innerHTML=e),t}setHtml(t){return R.setHtml(this,t)}static _valHooks={option:{get:t=>{const e=t.getAttribute("value");return null!=e?e:t.textContent}},select:{get:t=>{const e=t.options,r=t.selectedIndex,n="select-one"===t.type,o=n?r+1:e.length,i=[];let s=r<0?o:n?r:0;for(;s<o;s++){const t=e[s],o=t.parentNode;if((t.selected||s===r)&&!t.disabled&&(!o||!o.disabled||"OPTGROUP"!==o.tagName)){const e=R._valHooks.option.get(t);if(n)return e;i.push(e)}}return i},set:(t,e)=>{const r=t.options,n=Array.isArray(e)?e.map(String):[String(e)];let o=!1;for(let t=0;t<r.length;t++){const e=r[t],i=R._valHooks.option.get(e);"string"==typeof i&&(e.selected=n.includes(i))&&(o=!0)}return o||(t.selectedIndex=-1),n}},radio:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e){const r=t.closest("label");return e&&r&&r.querySelectorAll('input[type="radio"]').forEach(e=>{e instanceof HTMLInputElement&&e!==t&&(e.checked=!1)}),t.checked=e,e}}},checkbox:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e)return t.checked=e,e}}};static setVal(t,e){return R._preInputElems(t,"setVal").forEach(t=>{if(1!==t.nodeType)return;let r="function"==typeof e?e(t,R.val(t)):e;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=((t,e)=>{const r=[];for(let n=0;n<t.length;n++)r.push(e(t[n]));return r})(r,t=>null==t?"":String(t)));const n=R._valHooks[t.type]||R._valHooks[t.nodeName.toLowerCase()];if(!n||"function"!=typeof n.set||void 0===n.set(t,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(t.value=r)}}),t}setVal(t){return R.setVal(this,t)}static _valTypes={string:t=>t.value,date:t=>t.valueAsDate,number:t=>t.valueAsNumber};static _getValByType(t,e,r){if("string"!=typeof e)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof R._valTypes[e])throw new Error(`No handler found for type "${e}" in ${r}().`);return R._valTypes[e](t)}static _val(t,e,r){const n=R._preInputElem(t,e),o=R._valHooks[n.type]||R._valHooks[n.nodeName.toLowerCase()];if(o&&"function"==typeof o.get){const t=o.get(n,"value",r);if(void 0!==t)return"string"==typeof t?t.replace(/\r/g,""):t}return R._getValByType(n,r,e)}_val(t,e){return R._val(this,t,e)}static val(t){return R._val(t,"val","string")}val(){return R.val(this)}static valTxt(t){const e=R._val(t,"valTxt","string");if("string"!=typeof e&&null!==e)throw new Error("Value is not a valid string.");return null==e?"":"string"==typeof e?e.replace(/\r/g,""):e}valTxt(){return R.valTxt(this)}static _valArr(t,e,r){const n=R._val(t,e,r);if(!Array.isArray(n))throw new Error(`Value expected an array but got ${typeof n}.`);return n}_valArr(t,e){return R._valArr(this,t,e)}static valArr(t){return R._valArr(t,"valArr","string")}valArr(){return R.valArr(this)}static valNb(t){if(!(R._preInputElem(t,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=R._val(t,"valNb","number");if(Number.isNaN(e))throw new Error("Value is not a valid number.");return e}valNb(){return R.valNb(this)}static valDate(t){if(!(R._preInputElem(t,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=R._val(t,"valDate","date");if(!(e instanceof Date))throw new Error("Value is not a valid date.");return e}valDate(){return R.valDate(this)}static valBool(t){const e=R._preInputElem(t,"valBool");if(!(e instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===R.val(e)}valBool(){return R.valBool(this)}static listenForPaste(t,{onFilePaste:e,onTextPaste:r}={}){if(void 0!==e&&"function"!=typeof e)throw new TypeError("onFilePaste must be a function.");if(void 0!==r&&"function"!=typeof r)throw new TypeError("onTextPaste must be a function.");const n=t=>{if(!(t instanceof ClipboardEvent))return;const n=t.clipboardData?.items||[];for(const t of n)if("file"===t.kind){if("function"==typeof e){const r=t.getAsFile();r&&e(t,r)}}else"string"===t.kind&&"function"==typeof r&&t.getAsString(e=>r(t,e))};return R._preElemsWithDoc(t,"listenForPaste").forEach(t=>R.on(t,"paste",n)),n}listenForPaste({onFilePaste:t,onTextPaste:e}={}){return R.listenForPaste(this,{onFilePaste:t,onTextPaste:e})}static hasEventListener(t,e){const r=R._preEventTargetElem(t,"hasEventListener");if(!D.has(r))return!1;const n=D.get(r);return!!(n&&Array.isArray(n[e])&&n[e].length>0)}hasEventListener(t){return R.hasEventListener(this,t)}static hasExactEventListener(t,e,r){const n=R._preEventTargetElem(t,"hasExactEventListener");if("function"!=typeof r)throw new TypeError('The "handler" must be a function.');if(!D.has(n))return!1;const o=D.get(n);return!(!o||!Array.isArray(o[e]))&&o[e].some(t=>t.handler===r)}hasExactEventListener(t,e){return R.hasExactEventListener(this,t,e)}static hover(t,e,r,n){return R.on(t,"mouseenter",e,n),R.on(t,"mouseleave",r||e,n),t}hover(t,e,r){return R.hover(this,t,e,r)}static on(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");R._preEventTargetElems(t,"on").forEach(t=>{t.addEventListener(o,r,n),D.has(t)||D.set(t,{});const e=D.get(t);e&&(Array.isArray(e[o])||(e[o]=[]),e[o].push({handler:r,options:n}))})}return t}on(t,e,r){return R.on(this,t,e,r)}static once(t,e,r,n={}){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");R._preEventTargetElems(t,"once").forEach(t=>{const e=n=>{R.off(t,o,e),"function"==typeof r&&r(n)};R.on(t,o,e,"boolean"==typeof n?n:{...n,once:!0})})}return t}once(t,e,r={}){return R.once(this,t,e,r)}static off(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");R._preEventTargetElems(t,"off").forEach(t=>{t.removeEventListener(o,r,n);const e=D.get(t);e&&e[o]&&(e[o]=e[o].filter(t=>t.handler!==r),0===e[o].length&&delete e[o])})}return t}off(t,e,r){return R.off(this,t,e,r)}static offAll(t,e){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const r of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof r)throw new TypeError("The event name must be a string.");R._preEventTargetElems(t,"offAll").forEach(t=>{const e=D.get(t);if(e&&e[r]){for(const n of e[r])t.removeEventListener(r,n.handler,n.options);delete e[r]}})}return t}offAll(t){return R.offAll(this,t)}static offAllTypes(t,e=null){if(null!==e&&"function"!=typeof e)throw new TypeError('The "filterFn" must be a function.');return R._preEventTargetElems(t,"offAllTypes").forEach(t=>{const r=D.get(t);if(r){for(const n in r)for(const o of r[n])("function"!=typeof e||e(o.handler,n))&&t.removeEventListener(n,o.handler,o.options);D.delete(t)}}),t}offAllTypes(t=null){return R.offAllTypes(this,t)}static trigger(t,e,r={}){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const n of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof n)throw new TypeError("The event name must be a string.");R._preEventTargetElems(t,"trigger").forEach(t=>{const e=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:r});t.dispatchEvent(e)})}return t}trigger(t,e={}){return R.trigger(this,t,e)}static#E={for:"htmlFor",class:"className"};static propFix=new Proxy(R.#E,{set:(t,e,r)=>(t[e]=r,R.attrFix[r]=e,!0)});static attrFix=Object.fromEntries(Object.entries(R.#E).map(([t,e])=>[e,t]));static getPropName(t){return"string"==typeof R.propFix[t]?R.propFix[t]:t}static getAttrName(t){return"string"==typeof R.attrFix[t]?R.attrFix[t]:t}static attrBigInt(t,e){const r=R._preElem(t,"attrBigInt").getAttribute(R.getAttrName(e));if(null==r)return null;try{return BigInt(r)}catch{return null}}attrBigInt(t){return R.attrBigInt(this,t)}static setAttrBigInt(t,e,r){if("bigint"!=typeof r)throw new Error("Value is not a valid BigInt.");return R.setAttr(t,e,r.toString())}setAttrBigInt(t,e){return R.setAttrBigInt(this,t,e)}static attrDate(t,e){const r=R._preElem(t,"attrDate").getAttribute(R.getAttrName(e));if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}attrDate(t){return R.attrDate(this,t)}static setAttrDate(t,e,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new Error("Value is not a valid Date.");return R.setAttr(t,e,r.toISOString())}setAttrDate(t,e){return R.setAttrDate(this,t,e)}static attrJson(t,e){const r=R._preElem(t,"attrJson").getAttribute(R.getAttrName(e));if(!r)return null;try{return JSON.parse(r)}catch{return null}}attrJson(t){return R.attrJson(this,t)}static setAttrJson(t,e,r,n,o){const i=JSON.stringify(r,n,o);return R.setAttr(t,e,i)}setAttrJson(t,e,r,n){return R.setAttrJson(this,t,e,r,n)}static attrNumber(t,e){const r=R._preElem(t,"attrNumber").getAttribute(R.getAttrName(e));return null!=r?parseFloat(r):null}attrNumber(t){return R.attrNumber(this,t)}static setAttrNumber(t,e,r){if("number"!=typeof r)throw new Error("Value is not a valid number.");return R.setAttr(t,e,r.toString())}setAttrNumber(t,e){return R.setAttrNumber(this,t,e)}static attrBoolean(t,e){const r=R._preElem(t,"attrBoolean").getAttribute(R.getAttrName(e));return null===r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}attrBoolean(t){return R.attrBoolean(this,t)}static setAttrBoolean(t,e,r){if("boolean"!=typeof r)throw new Error("Value is not a valid boolean.");return R.setAttr(t,e,r.toString())}setAttrBoolean(t,e){return R.setAttrBoolean(this,t,e)}static attrString(t,e){const r=R._preElem(t,"attrString").getAttribute(R.getAttrName(e));return"string"==typeof r?r:null}attrString(t){return R.attrString(this,t)}static setAttrString(t,e,r){if("string"!=typeof r)throw new Error("Value is not a valid string.");return R.setAttr(t,e,r)}setAttrString(t,e){return R.setAttrString(this,t,e)}static attr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return R._preElem(t,"attr").getAttribute(R.getAttrName(e))}attr(t){return R.attr(this,t)}static setAttr(t,e,r=null){const n=R._preElems(t,"setAttr");if("object"==typeof e&&null!==e)return Object.entries(e).forEach(([t,e])=>n.forEach(r=>{null===e?r.removeAttribute(R.getAttrName(t)):r.setAttribute(R.getAttrName(t),String(e))})),t;if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return n.forEach(t=>{null===r?t.removeAttribute(R.getAttrName(e)):t.setAttribute(R.getAttrName(e),String(r))}),t}setAttr(t,e){return R.setAttr(this,t,e)}static removeAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return R._preElems(t,"removeAttr").forEach(t=>t.removeAttribute(R.getAttrName(e))),t}removeAttr(t){return R.removeAttr(this,t)}static hasAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return R._preElem(t,"hasAttr").hasAttribute(R.getAttrName(e))}hasAttr(t){return R.hasAttr(this,t)}static hasProp(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return!!R._preElem(t,"hasProp")[R.getPropName(e)]}hasProp(t){return R.hasProp(this,t)}static addProp(t,...e){return R._preElems(t,"addProp").forEach(t=>{e.forEach(e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[R.getPropName(e)]=!0})}),t}addProp(...t){return R.addProp(this,...t)}static removeProp(t,...e){return R._preElems(t,"removeProp").forEach(t=>{e.forEach(e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[R.getPropName(e)]=!1})}),t}removeProp(...t){return R.removeProp(this,...t)}static toggleProp(t,e,r){const n=R._preElems(t,"toggleProp");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');return(Array.isArray(e)?e:[e]).forEach(t=>{if("string"!=typeof t)throw new TypeError("Each property name must be a string.");n.forEach(e=>{(void 0===r?!e[R.getPropName(t)]:r)?R.addProp(e,t):R.removeProp(e,t)})}),t}toggleProp(t,e){return R.toggleProp(this,t,e)}static prop(t,e){if("string"!=typeof e)throw new TypeError('Invalid arguments passed to prop(). Expected string for "name".');return R._preElem(t,"prop")[e]}prop(t){return R.prop(this,t)}static setProp(t,e,r){if("string"!=typeof e||""===e.trim())throw new Error("Property name must be a non-empty string.");return R._preElems(t,"setProp").forEach(t=>{t[e]=r}),t}setProp(t,e){return R.setProp(this,t,e)}static remove(t){return R._preElems(t,"remove").forEach(t=>t.remove()),t}remove(){return R.remove(this)}static index(t,e=null){const r=R._preElem(t,"index");if(!r)return-1;if(!e)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(e){const t="string"==typeof e?document.querySelectorAll(e):R._preElems(e,"index");return Array.prototype.indexOf.call(t,r)}return-1}index(t){return R.index(this,t)}static _getCustomRect(t,e){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const e in t)"number"==typeof t[e]&&(r[e]=t[e]);if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("extraRect must be a non-null object.");const{height:n=0,width:o=0,top:i=0,bottom:s=0,left:a=0,right:l=0}=e;if("number"!=typeof n)throw new Error("extraRect.height must be a number.");if("number"!=typeof o)throw new Error("extraRect.width must be a number.");if("number"!=typeof i)throw new Error("extraRect.top must be a number.");if("number"!=typeof s)throw new Error("extraRect.bottom must be a number.");if("number"!=typeof a)throw new Error("extraRect.left must be a number.");if("number"!=typeof l)throw new Error("extraRect.right must be a number.");return r.height+=n,r.width+=o,r.top+=i,r.bottom+=s,r.left+=a,r.right+=l,r}static isCollWith(t,e,r={}){const n=R._getCustomRect(R._preElem(t,"isCollWith").getBoundingClientRect(),r),o=R._preElem(e,"isCollWith").getBoundingClientRect();return C(n,o)}isCollWith(t,e){return R.isCollWith(this,t,e)}static isCollPerfWith(t,e,r={}){const n=R._getCustomRect(R._preElem(t,"isCollPerfWith").getBoundingClientRect(),r),o=R._preElem(e,"isCollPerfWith").getBoundingClientRect();return L(n,o)}isCollPerfWith(t,e){return R.isCollPerfWith(this,t,e)}static _isCollWithLock(t,e,r,n,o){const i=W[o];if(t)return i.has(n)||i.set(n,!0),!0;if(i.has(n)){let t=!1;switch(o){case"top":t=k(e,r);break;case"bottom":t=N(e,r);break;case"left":t=B(e,r);break;case"right":t=I(e,r)}return t&&i.delete(n),i.has(n)}return!1}static isCollWithLock(t,e,r,n={}){const o=R._preElem(t,"isCollWithLock"),i=R._preElem(e,"isCollWithLock"),s=R._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=C(s,a);return R._isCollWithLock(l,s,a,o,r)}isCollWithLock(t,e,r){return R.isCollWithLock(this,t,e,r)}static isCollPerfWithLock(t,e,r,n={}){const o=R._preElem(t,"isCollPerfWithLock"),i=R._preElem(e,"isCollPerfWithLock"),s=R._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=L(s,a);return R._isCollWithLock(l,s,a,o,r)}isCollPerfWithLock(t,e,r){return R.isCollPerfWithLock(this,t,e,r)}static resetCollLock(t){const e=R._preElem(t,"resetCollLock");let r=!1;for(const t of["top","bottom","left","right"])W[t].has(e)&&(W[t].delete(e),r=!0);return r}resetCollLock(){return R.resetCollLock(this)}static resetCollLockDir(t,e){const r=R._preElem(t,"resetCollLockDir"),n=W[e];return!!n.has(r)&&(n.delete(r),!0)}resetCollLockDir(t){return R.resetCollLockDir(this,t)}static isInViewport(t){const e=R._preElem(t,"isInViewport");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=R.offset(e).top,n=r+R.outerHeight(e),o=R.scrollTop(window),i=o+R.height(window);return n>o&&r<i}isInViewport(){return R.isInViewport(this)}static isScrolledIntoView(t){const e=R._preElem(t,"isScrolledIntoView");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=R.scrollTop(window),n=r+R.height(window),o=R.offset(e).top;return o+R.height(e)<=n&&o>=r}isScrolledIntoView(){return R.isScrolledIntoView(this)}static isInContainer(t,e){const r=R._preElem(t,"isInContainer"),n=R._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect(),s=o.bottom>i.top&&o.top<i.bottom,a=o.right>i.left&&o.left<i.right;return s&&a}isInContainer(t){return R.isInContainer(this,t)}static isFullyInContainer(t,e){const r=R._preElem(t,"isScrolledIntoView"),n=R._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect();return o.top>=i.top&&o.bottom<=i.bottom&&o.left>=i.left&&o.right<=i.right}isFullyInContainer(t){return R.isFullyInContainer(this,t)}static hasScroll(t){const e=R._preElem(t,"hasScroll");return{v:e.scrollHeight>e.clientHeight,h:e.scrollWidth>e.clientWidth}}hasScroll(){return R.hasScroll(this)}}const H=class{#v=new Map;#T=10;#A=!1;#S(t,e){if("string"==typeof t)return[t];if(Array.isArray(t)&&t.every(t=>"string"==typeof t))return t;throw new TypeError(`${e}(event): event must be a string or string[]`)}setThrowOnMaxListeners(t){if("boolean"!=typeof t)throw new TypeError("setThrowOnMaxListeners(value): value must be a boolean");this.#A=t}getThrowOnMaxListeners(){return this.#A}#_(t,e,{once:r=!1}={}){let n=this.#v.get(t);Array.isArray(n)||(n=[],this.#v.set(t,n)),n.unshift({handler:e,config:{once:r}});const o=this.#T;if(o>0&&n.length>o){const e=`Possible memory leak detected. ${n.length} "${t}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#A)throw new Error(e);console.warn(e)}}prependListener(t,e){const r=this.#S(t,"prependListener");if("function"!=typeof e)throw new TypeError("prependListener(event, handler): handler must be a function");for(const t of r)this.#_(t,e)}prependListenerOnce(t,e){const r=this.#S(t,"prependListenerOnce");if("function"!=typeof e)throw new TypeError("prependListenerOnce(event, handler): handler must be a function");const n=[];for(const t of r){const r=(...n)=>{this.off(t,r),e(...n)};this.#_(t,r,{once:!0}),n.push(r)}return n}#x(t,e,{once:r=!1}={}){const n=this.#S(t,"on");for(const t of n){let n=this.#v.get(t);Array.isArray(n)||(n=[],this.#v.set(t,n)),n.push({handler:e,config:{once:r}});const o=this.#T;if(o>0&&n.length>o){const e=`Possible memory leak detected. ${n.length} "${t}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#A)throw new Error(e);console.warn(e)}}}on(t,e){if("function"!=typeof e)throw new TypeError("on(event, handler): handler must be a function");return this.#x(t,e)}once(t,e){const r=this.#S(t,"once");if("function"!=typeof e)throw new TypeError("once(event, handler): handler must be a function");const n=[];for(const t of r){const r=(...n)=>{this.off(t,r),e(...n)};this.#x(t,r,{once:!0}),n.push(r)}return n}appendListener(t,e){return this.on(t,e)}appendListenerOnce(t,e){return this.once(t,e)}off(t,e){const r=this.#S(t,"off");if("function"!=typeof e)throw new TypeError("off(event, handler): handler must be a function");for(const t of r){const r=this.#v.get(t);if(!Array.isArray(r))continue;const n=r.findIndex(t=>t.handler===e);-1!==n&&r.splice(n,1),0===r.length&&this.#v.delete(t)}}offAll(t){const e=this.#S(t,"offAll");for(const t of e)this.#v.delete(t)}offAllTypes(){this.#v.clear()}listenerCount(t){if("string"!=typeof t)throw new TypeError("listenerCount(event): event name must be a string");const e=this.#v.get(t);return Array.isArray(e)?e.length:0}listeners(t){if("string"!=typeof t)throw new TypeError("listeners(event): event name must be a string");const e=this.#v.get(t);return Array.isArray(e)?[...e].filter(t=>!t.config.once).map(t=>t.handler):[]}onceListeners(t){if("string"!=typeof t)throw new TypeError("onceListeners(event): event name must be a string");const e=this.#v.get(t);return Array.isArray(e)?[...e].filter(t=>t.config.once).map(t=>t.handler):[]}allListeners(t){if("string"!=typeof t)throw new TypeError("allListeners(event): event name must be a string");const e=this.#v.get(t);return Array.isArray(e)?[...e].map(t=>t.handler):[]}eventNames(){return[...this.#v.keys()]}emit(t,...e){const r=this.#S(t,"emit"),n=[];for(const t of r){const r=this.#v.get(t);Array.isArray(r)&&0!==r.length?(r.forEach(t=>t.handler(...e)),n.push(!0)):n.push(!1)}return n}setMaxListeners(t){if(!Number.isInteger(t)||t<0)throw new TypeError("setMaxListeners(n): n must be a non-negative integer");this.#T=t}getMaxListeners(){return this.#T}},F=new Map,j=new Map,U=new Set(["string","boolean","object","array",String,Boolean,Number,Object,Array,BigInt,Symbol]);class J{#C=new H;setThrowOnMaxListeners(t){return this.#C.setThrowOnMaxListeners(t)}getThrowOnMaxListeners(){return this.#C.getThrowOnMaxListeners()}prependListener(t,e){return this.#C.prependListener(t,e)}prependListenerOnce(t,e){return this.#C.prependListenerOnce(t,e)}appendListener(t,e){return this.#C.appendListener(t,e)}appendListenerOnce(t,e){return this.#C.appendListenerOnce(t,e)}on(t,e){return this.#C.on(t,e)}once(t,e){return this.#C.once(t,e)}off(t,e){return this.#C.off(t,e)}offAll(t){return this.#C.offAll(t)}offAllTypes(){return this.#C.offAllTypes()}listenerCount(t){return this.#C.listenerCount(t)}listeners(t){return this.#C.listeners(t)}onceListeners(t){return this.#C.onceListeners(t)}allListeners(t){return this.#C.allListeners(t)}eventNames(){return this.#C.eventNames()}emit(t,...e){return this.#C.emit(t,...e)}setMaxListeners(t){return this.#C.setMaxListeners(t)}getMaxListeners(){return this.#C.getMaxListeners()}static hasJsonType(t){return F.has(t)&&j.has(t)||U.has(t)}static registerJsonType(t,e,r,n=!1){if(U.has(t))throw new Error(`Cannot register type "${t}" because it is frozen.`);F.set(t,e),j.set(t,r),n&&U.add(t)}static deleteJsonType(t){if(U.has(t))throw new Error(`Cannot remove type "${t}" because it is frozen.`);let e=!1;return F.delete(t)&&(e=!0),j.delete(t)&&(e=!0),e}static encodeSpecialJson(t){if(void 0===t)return{__undefined__:!0};if(null===t)return{__null__:!0};for(const[e,r]of F.entries())if("string"!=typeof e&&t instanceof e||typeof t===e)return r(t,J.encodeSpecialJson);if(Array.isArray(t))return t.map(J.encodeSpecialJson);if(o(t)){const e={};for(const r in t)e[r]=J.encodeSpecialJson(t[r]);return e}return t}static decodeSpecialJson(t){const e=o(t);if(e){if(t.__undefined__)return;if(t.__null__)return null}if(Array.isArray(t))return t.map(J.decodeSpecialJson);if(e){for(const[e,r]of j.entries())if(r.check&&r.check(t))return r.decode(t,J.decodeSpecialJson);const e={};for(const r in t)e[r]=J.decodeSpecialJson(t[r]);return e}return t}#L=window.localStorage;#k=null;#N=0;#B=t=>this.emit("storage",t);constructor(t){if(void 0!==t&&"string"!=typeof t)throw new TypeError("TinyLocalStorage: dbName must be a string if provided.");"string"==typeof t&&(this.#k=`LSDB::${t}`),window.addEventListener("storage",this.#B)}#I(t){if("string"==typeof t&&t.startsWith("LSDB::"))throw new Error(`TinyLocalStorage: Key "${t}" may conflict with reserved dbKeys.`)}updateStorageVersion(t,e){if("string"!=typeof this.#k)throw new Error("TinyLocalStorage: Database key is not initialized. Set a valid dbName in the constructor.");if("number"!=typeof t||Number.isNaN(t)||t<1)throw new TypeError("TinyLocalStorage: version must be a positive number.");if("function"!=typeof e)throw new TypeError("TinyLocalStorage: onUpgrade must be a function.");const r=parseInt(localStorage.getItem(this.#k),10)||0;if("number"!=typeof r||Number.isNaN(r)||r<0)throw new TypeError("TinyLocalStorage: saved version in localStorage is not a valid number.");if(t<r)throw new Error(`TinyLocalStorage: Cannot downgrade database version from ${r} to ${t}.`);t>r&&(e(r,t),localStorage.setItem(this.#k,String(t)),this.#N=t)}getDbKey(){return this.#k}getVersion(){return this.#N}setLocalStorage(t){if(!(t instanceof Storage))throw new TypeError("Argument must be a valid instance of Storage.");this.#L=t}localStorageExists(){return this.#L instanceof Storage}#D(t,e){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return J.encodeSpecialJson(e)}setJson(t,e){if(this.#I(t),!(o(e)||Array.isArray(e)||e instanceof Map||e instanceof Set))throw new TypeError("The storage value is not a valid JSON-compatible structure.");const r=this.#D(t,e);return this.emit("setJson",t,e),this.#L.setItem(t,JSON.stringify(r))}#O(t,e){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");const r=this.#L.getItem(t),n={obj:()=>({}),array:()=>[],map:()=>new Map,set:()=>new Set},o="function"==typeof n[e]?n[e]():null;let i;try{i=JSON.parse(r)}catch{return o}return{decoded:J.decodeSpecialJson(i),fallback:o}}getJson(t,e){const{decoded:r,fallback:n}=this.#O(t,e);return r instanceof Map||r instanceof Set||Array.isArray(r)||o(r)?r:n}setDate(t,e){if(this.#I(t),!(e instanceof Date))throw new TypeError("Value must be a Date.");const r=this.#D(t,e);return this.emit("setDate",t,e),this.#L.setItem(t,JSON.stringify(r))}getDate(t){const e=this.#O(t).decoded;return e instanceof Date?e:null}setRegExp(t,e){if(this.#I(t),!(e instanceof RegExp))throw new TypeError("Value must be a RegExp.");const r=this.#D(t,e);return this.emit("setRegExp",t,e),this.#L.setItem(t,JSON.stringify(r))}getRegExp(t){const e=this.#O(t).decoded;return e instanceof RegExp?e:null}setBigInt(t,e){if(this.#I(t),"bigint"!=typeof e)throw new TypeError("Value must be a BigInt.");const r=this.#D(t,e);return this.emit("setBigInt",t,e),this.#L.setItem(t,JSON.stringify(r))}getBigInt(t){const e=this.#O(t).decoded;return"bigint"==typeof e?e:null}setSymbol(t,e){if(this.#I(t),"symbol"!=typeof e)throw new TypeError("Value must be a Symbol.");const r=this.#D(t,e);return this.emit("setSymbol",t,e),this.#L.setItem(t,JSON.stringify(r))}getSymbol(t){const e=this.#O(t).decoded;return"symbol"==typeof e?e:null}getValue(t){return this.#O(t).decoded??null}setItem(t,e){if(this.#I(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return this.emit("setItem",t,e),this.#L.setItem(t,e)}getItem(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return this.#L.getItem(t)}setString(t,e){if(this.#I(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");if("string"!=typeof e)throw new TypeError("Value must be a string.");return this.emit("setString",t,e),this.#L.setItem(t,JSON.stringify({__string__:!0,value:e}))}getString(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");let e=this.#L.getItem(t);try{if(e=JSON.parse(e),!o(e)||!e.__string__||"string"!=typeof e.value)return null;e=e.value}catch{e=null}return"string"==typeof e?e:null}setNumber(t,e){if(this.#I(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");if("number"!=typeof e)throw new TypeError("Value must be a number.");return this.emit("setNumber",t,e),this.#L.setItem(t,String(e))}getNumber(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");let e=this.#L.getItem(t);return"number"==typeof e||"string"==typeof e&&e.length>0&&(e=parseFloat(e),!Number.isNaN(e))?e:null}setBool(t,e){if(this.#I(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");if("boolean"!=typeof e)throw new TypeError("Value must be a boolean.");return this.emit("setBool",t,e),this.#L.setItem(t,String(e))}getBool(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");const e=this.#L.getItem(t);if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===e)return!0;if("false"===e)return!1}return null}removeItem(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return this.emit("removeItem",t),this.#L.removeItem(t)}clearLocalStorage(){return this.#L.clear()}destroy(){window.removeEventListener("storage",this.#B),this.#C.offAllTypes()}}J.registerJsonType(Map,(t,e)=>({__map__:!0,data:Array.from(t.entries()).map(([t,r])=>[t,e(r)])}),{check:t=>t.__map__,decode:(t,e)=>new Map(t.data.map(([t,r])=>[t,e(r)]))},!0),J.registerJsonType(Set,(t,e)=>({__set__:!0,data:Array.from(t).map(e)}),{check:t=>t.__set__,decode:(t,e)=>new Set(t.data.map(e))},!0),J.registerJsonType(Date,t=>({__date__:!0,value:t.toISOString()}),{check:t=>t.__date__,decode:t=>new Date(t.value)},!0),J.registerJsonType(RegExp,t=>({__regexp__:!0,source:t.source,flags:t.flags}),{check:t=>t.__regexp__,decode:t=>new RegExp(t.source,t.flags)},!0),J.registerJsonType("number",t=>({__number__:!0,value:t.toString()}),{check:t=>t.__number__,decode:t=>Number(t.value)},!0),J.registerJsonType("bigint",t=>({__bigint__:!0,value:t.toString()}),{check:t=>t.__bigint__,decode:t=>BigInt(t.value)},!0),J.registerJsonType("symbol",t=>({__symbol__:!0,key:Symbol.keyFor(t)??t.description??null}),{check:t=>t.__symbol__,decode:t=>{const e=t.key;return null!=e?Symbol.for(e):Symbol()}},!0),new WeakMap,new WeakMap,new Map;const V=class{#P;#M=[];#W=new WeakMap;#R;constructor(t){if(!o(t))throw new TypeError('TinyUploadClicker: "options" must be a valid object.');this.#P={multiple:!1,accept:"",inputAttributes:{},inputStyles:{display:"none"},onClick:null,onFileLoad:null,...t};const{triggers:e}=t;if(!(Array.isArray(e)||"string"==typeof e||e instanceof HTMLElement))throw new TypeError('TinyUploadClicker: "triggers" is required and must be a string, HTMLElement, or an array of them.');const r=(Array.isArray(this.#P.triggers)?this.#P.triggers:[this.#P.triggers]).map(t=>{if("string"==typeof t){const e=document.querySelector(t);if(!e)throw new Error(`TinyUploadClicker: No element found for selector "${t}".`);return e}if(!(t instanceof HTMLElement))throw new TypeError("TinyUploadClicker: All triggers must be either strings (selectors) or HTMLElements.");return t});if(void 0!==t.accept&&"string"!=typeof t.accept&&!Array.isArray(t.accept))throw new TypeError('TinyUploadClicker: "accept" must be a string or an array of strings.');if(void 0!==t.onClick&&"function"!=typeof t.onClick&&null!==t.onClick)throw new TypeError('TinyUploadClicker: "onClick" must be a function or null.');if(void 0!==t.onFileLoad&&"function"!=typeof t.onFileLoad&&null!==t.onFileLoad)throw new TypeError('TinyUploadClicker: "onFileLoad" must be a function or null.');if(void 0!==t.inputAttributes&&!o(t.inputAttributes))throw new TypeError('TinyUploadClicker: "inputAttributes" must be an object.');if(void 0!==t.inputStyles&&!o(t.inputStyles))throw new TypeError('TinyUploadClicker: "inputStyles" must be an object.');this.#R=this.#H.bind(this),this.#M=r,this.#M.forEach(t=>{if(!(t instanceof HTMLElement))return;const e=document.createElement("input");e.type="file",this.#P.multiple&&(e.multiple=!0),"string"==typeof this.#P.accept?e.accept=this.#P.accept:Array.isArray(this.#P.accept)&&(e.accept=this.#P.accept.join(","));const r=this.#P.inputAttributes;if(r&&"object"==typeof r)for(const[t,n]of Object.entries(r))e.setAttribute(t,n);Object.assign(e.style,this.#P.inputStyles||{display:"none"}),e.addEventListener("change",()=>{e.files&&"function"==typeof this.#P.onFileLoad&&this.#P.onFileLoad(e.files,t),e.value=""}),document.body.appendChild(e),this.#W.set(t,e),t.addEventListener("click",this.#R)})}#H(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const r=this.#W.get(e);r&&("function"==typeof this.#P.onClick&&this.#P.onClick(e),r.click())}destroy(){for(const t of this.#M){if(!(t instanceof HTMLElement))return;t.removeEventListener("click",this.#R);const e=this.#W.get(t);e&&e.parentNode&&e.remove(),this.#W.delete(t)}this.#M=[]}}})(),window.TinyUploadClicker=n.TinyUploadClicker})();
2
+ (()=>{var e={251:(e,t)=>{t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,l=(1<<a)-1,c=l>>1,u=-7,f=r?o-1:0,p=r?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=a;u>0;i=256*i+e[t+f],f+=p,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=n;u>0;s=256*s+e[t+f],f+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=c}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,m=n?1:-1,d=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=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+f>=1?p/l:p*Math.pow(2,1-f))*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*l-1)*Math.pow(2,o),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+h]=255&a,h+=m,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[r+h]=255&s,h+=m,s/=256,c-=8);e[r+h-m]|=128*d}},287:(e,t,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;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 f(e)}return c(e,t,r)}function c(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|d(e,t),n=a(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(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 h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return h(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 o=function(e){if(l.isBuffer(e)){var t=0|m(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||j(e.length)?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(o)return o;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 u(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 f(e){return u(e),a(e<0?0:0|m(e))}function p(e){for(var t=e.length<0?0:0|m(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(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 m(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function d(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 o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(o)return n?-1:P(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return _(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),j(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){var i,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 c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var u=-1;for(i=r;i<a;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*s}else-1!==u&&(i-=i-u),u=-1}else for(r+l>a&&(r=a-l),i=r;i>=0;i--){for(var f=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){f=!1;break}if(f)return i}return-1}function E(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(j(a))return s;e[r+s]=a}return s}function T(e,t,r,n){return F(P(t,e.length-r),e,r,n)}function v(e,t,r,n){return F(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return F(W(t),e,r,n)}function S(e,t,r,n){return F(function(e,t){for(var r,n,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function _(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,s,a,l,c=e[o],u=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(l=(15&c)<<12|(63&i)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(l=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=f}return function(e){var t=e.length;if(t<=L)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=L));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 c(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 u(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 f(e)},l.allocUnsafeSlow=function(e){return f(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,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];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),o=0;for(r=0;r<e.length;++r){var i=e[r];if(U(i,Uint8Array))o+i.length>n.length?l.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!l.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},l.byteLength=d,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?x(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,o){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===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(i,s),c=this.slice(n,o),u=e.slice(t,r),f=0;f<a;++f)if(c[f]!==u[f]){i=c[f],s=u[f];break}return i<s?-1:s<i?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return T(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function C(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function N(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);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 o="",i=t;i<r;++i)o+=$[e[i]];return o}function B(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(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 H(e,t,r,n,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)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,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,i){return t=+t,r>>>=0,i||I(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,i){return t=+t,r>>>=0,i||I(e,0,r,8),o.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||R(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(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||R(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||R(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||R(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||R(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||R(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||R(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||R(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||H(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||H(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||H(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||H(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||H(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||H(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||H(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 o=Math.pow(2,8*r-1);H(this,e,t,r,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);H(this,e,t,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||H(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||H(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||H(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||H(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||H(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 O(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return M(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 o=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),o},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 o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}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 i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=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(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};var D=/[^+/0-9A-Za-z-_]/g;function P(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function j(e){return e!=e}var $=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},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,i=a(e),s=i[0],l=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),u=0,f=l>0?s-4:s;for(r=0;r<f;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)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=16383,a=0,l=n-o;a<l;a+=s)i.push(c(e,a,a+s>l?l:a+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<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 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){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(l(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!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:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],c=!1,u=-1;function f(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!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 h(e,t){this.fun=e,this.array=t}function m(){}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 h(e,t)),1!==l.length||c||s(p)},h.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=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,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 o(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var r,n="",o=0,i=-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(i===a-1||1===s);else if(i!==a-1&&2===s){if(n.length<2||2!==o||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="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),i=a,s=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),o=a-i-1;i=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),o(a),0!==a.length&&(t=a+"/"+t,r=47===a.charCodeAt(0))}return t=i(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(o(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return o(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];o(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(o(e),o(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,i=n-r,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var l=t.length-a,c=i<l?i:l,u=-1,f=0;f<=c;++f){if(f===c){if(l>c){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else i>c&&(47===e.charCodeAt(r+f)?u=f:0===f&&(u=0));break}var p=e.charCodeAt(r+f);if(p!==t.charCodeAt(a+f))break;47===p&&(u=f)}var h="";for(f=r+u+1;f<=n;++f)f!==n&&47!==e.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(o(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){n=s;break}}else i=!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');o(e);var r,n=0,i=-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 c=e.charCodeAt(r);if(47===c){if(!s){n=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(c===t.charCodeAt(a)?-1===--a&&(i=r):(a=-1,i=l))}return n===i?i=l:-1===i&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){n=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(n,i)},extname:function(e){o(e);for(var t=-1,r=0,n=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===n&&(i=!1,n=a+1),46===l?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){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){o(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,n=e.charCodeAt(0),i=47===n;i?(t.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,c=!0,u=e.length-1,f=0;u>=r;--u)if(47!==(n=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===n?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!c){a=u+1;break}return-1===s||-1===l||0===f||1===f&&s===l-1&&s===a+1?-1!==l&&(t.base=t.name=0===a&&i?e.slice(1,l):e.slice(a,l)):(0===a&&i?(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):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.d(n,{TinyUploadClicker:()=>V});var e={};r.r(e),r.d(e,{areElsCollBottom:()=>c,areElsCollLeft:()=>u,areElsCollPerfBottom:()=>h,areElsCollPerfLeft:()=>m,areElsCollPerfRight:()=>d,areElsCollPerfTop:()=>p,areElsCollRight:()=>f,areElsCollTop:()=>l,areElsColliding:()=>g,areElsPerfColliding:()=>y,getElsCollDetails:()=>_,getElsCollDirDepth:()=>S,getElsCollOverlap:()=>E,getElsCollOverlapPos:()=>T,getElsColliding:()=>b,getElsPerfColliding:()=>w,getElsRelativeCenterOffset:()=>A,getRectCenter:()=>v});var t=r(287);function o(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}const i="undefined"!=typeof window&&void 0!==window.document,s={items:{},order:[]};function a(e,t){const r=[],n=Array.isArray(e)?e:Object.entries(e);for(const[e,o]of n)if(!s.items.hasOwnProperty(e)){s.items[e]=o;let n="number"==typeof t?t:-1;if(-1===n){const e=s.order.indexOf("object");n=e>-1?e:s.order.length}n=Math.min(Math.max(0,n),s.order.length),s.order.splice(n,0,e),r.push(e)}return r}a([["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)]]),i||a([["buffer",e=>void 0!==t.hp&&t.hp.isBuffer(e)]]),i&&a([["file",e=>"undefined"!=typeof File&&e instanceof File]]),a([["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]]),i&&a([["htmlelement",e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement]]),a([["object",e=>o(e)]]),r(975);const l=(e,t)=>e.bottom<t.top,c=(e,t)=>e.top>t.bottom,u=(e,t)=>e.right<t.left,f=(e,t)=>e.left>t.right,p=(e,t)=>e.bottom<=t.top,h=(e,t)=>e.top>=t.bottom,m=(e,t)=>e.right<=t.left,d=(e,t)=>e.left>=t.right,g=(e,t)=>!(u(e,t)||f(e,t)||l(e,t)||c(e,t)),y=(e,t)=>!(m(e,t)||d(e,t)||p(e,t)||h(e,t)),b=(e,t)=>u(e,t)?"left":f(e,t)?"right":l(e,t)?"top":c(e,t)?"bottom":null,w=(e,t)=>m(e,t)?"left":d(e,t)?"right":p(e,t)?"top":h(e,t)?"bottom":null,E=(e,t)=>({overlapLeft:t.right-e.left,overlapRight:e.right-t.left,overlapTop:t.bottom-e.top,overlapBottom:e.bottom-t.top}),T=({overlapLeft:e=-1,overlapRight:t=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:e<t?"right":"left",dirY:r<n?"bottom":"top"}),v=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function A(e,t){const r=e.left+e.width/2,n=e.top+e.height/2;return{x:t.left+t.width/2-r,y:t.top+t.height/2-n}}function S(e,t){if(!y(e,t))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}=E(e,t),{dirX:s,dirY:a}=T({overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}),l=Math.min(r,n),c=Math.min(o,i);let u;return u=l<c?s:a,{inDir:u,dirX:s,dirY:a,depthX:l,depthY:c}}function _(e,t){const r=y(e,t),n={in:null,x:null,y:null},o={y:null,x:null},i={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:a,overlapTop:l,overlapBottom:c}=E(t,e);i.top=l,i.bottom=c,i.left=s,i.right=a;const u=Object.entries(i).filter(([,e])=>e>0).sort((e,t)=>e[1]-t[1]),{dirX:f,dirY:p}=T({overlapLeft:a,overlapRight:s,overlapTop:c,overlapBottom:l});return n.y=p,n.x=f,i.bottom<0?o.y="bottom":i.top<0&&(o.y="top"),i.left<0?o.x="left":i.right<0&&(o.x="right"),n.in=r?i.top===i.bottom&&i.bottom===i.left&&i.left===i.right?"center":u.length?u[0][0]:"top":null,{dirs:n,depth:i,isNeg:o}}const x=class{#e;get el(){return this.#e}set el(e){if(this.#e)throw new Error("The observed element has already been set and cannot be reassigned.");if(void 0!==e&&!(e instanceof Element))throw new TypeError("The observed element must be a valid DOM Element.");this.#e=e}#t={};get settings(){return this.#t}set settings(e){if("object"!=typeof e||null===e)throw new TypeError("settings must be a non-null object.");this.#t=e}#r=null;get observer(){return this.#r}#n=[];get detectors(){return this.#n.map(e=>[e[0],e[1]])}set detectors(e){if(!Array.isArray(e))throw new TypeError("detectors must be an array.");const t=[];for(const[r,n]of e){if("string"!=typeof r)throw new TypeError("Detector name must be a string.");if("function"!=typeof n)throw new TypeError(`Detector handler for "${r}" must be a function.`);t.push([r,n])}this.#n=t}get isActive(){return!!this.#r}get size(){return this.#n.length}constructor({el:e,initDetectors:t=[],initCfg:r={}}={}){this.el=e,t.length&&(this.detectors=t),r&&(this.settings=r)}clear(){this.#n=[]}start(){if(!this.#e)throw new Error("Cannot start observation: no target element has been set.");this.#r||(this.#r=new MutationObserver(e=>{e.forEach((e,t,r)=>this.#n.forEach(n=>n[1](e,t,r)))}),this.#r.observe(this.#e,this.#t))}stop(){this.#r&&(this.#r.disconnect(),this.#r=null)}add(e,t){this.#o(e,t),this.#n.push([e,t])}insertAtStart(e,t){this.#o(e,t),this.#n.unshift([e,t])}insertAt(e,t,r,n="after"){if(this.#o(t,r),"number"!=typeof e||e<0||e>=this.#n.length)throw new RangeError("Invalid index for insertDetectorAt.");const o="before"===n?e:e+1;this.#n.splice(o,0,[t,r])}removeAt(e){if("number"!=typeof e||e<0||e>=this.#n.length)throw new RangeError("Invalid index for removeDetectorAt.");this.#n.splice(e,1)}removeAround(e,t=0,r=0){if("number"!=typeof e||e<0||e>=this.#n.length)throw new RangeError("Invalid index for removeDetectorsAround.");const n=Math.max(0,e-t),o=t+1+r;this.#n.splice(n,o)}isIndexUsed(e){return e>=0&&e<this.#n.length}hasHandler(e){if("function"!=typeof e)throw new TypeError("Handler must be a function.");return this.#n.some(([t,r])=>r===e)}#o(e,t){if("string"!=typeof e||!e.trim())throw new TypeError("Detector name must be a non-empty string.");if("function"!=typeof t)throw new TypeError(`Detector handler for "${e}" must be a function.`)}destroy(){this.stop(),this.clear()}},{areElsColliding:L,areElsPerfColliding:C,areElsCollTop:N,areElsCollBottom:k,areElsCollLeft:B,areElsCollRight:R}=e,H=new WeakMap,I=new WeakMap,O=new WeakMap,M=new WeakMap,D={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class P{static Utils={...e};static#i=!1;static get elemDebug(){return P.#i}static set elemDebug(e){if("boolean"!=typeof e)throw new TypeError("Expected a boolean value for elemDebug");P.#i=e}static _debugElemError(e,t){if(!P.#i)return;const r="[TinyHtml Debug] Element validation error";if(console.groupCollapsed(`${r}${t?" — details below":""}`),console.error(r),"undefined"!=typeof Error&&"function"==typeof Error.captureStackTrace){const e=new Error(r);Error.captureStackTrace(e,P._debugElemError),console.error(e.stack)}else console.trace(r);if(Array.isArray(e)){const t=e.map((e,t)=>({index:t,typeOf:null===e?"null":typeof e,constructor:e?.constructor?.name??(null===e?"null":"primitive"),summary:"undefined"!=typeof Element&&e instanceof Element?`${e.tagName?.toLowerCase?.()??"element"}#${e.id||""}.${String(e.className||"").trim().replace(/\s+/g,".")}`:e&&"object"==typeof e&&"nodeType"in e?`nodeType:${e.nodeType}`:"",value:e}));console.table(t)}else console.warn('[TinyHtml Debug] "elems" is not an array:',e);arguments.length>1&&(console.error("[TinyHtml Debug] Problematic element:",t),t&&"object"==typeof t&&console.dir(t)),console.groupEnd()}static parseStyle(e){const t={};return e.split(";").forEach(e=>{const[r,n]=e.split(":").map(e=>e&&e.trim());r&&n&&(t[r]=n)}),t}static#s=!0;static get autoStartElemObserver(){return P.#s}static set autoStartElemObserver(e){if("boolean"!=typeof e)throw new TypeError("autoStartElemObserver must be a boolean.");P.#s=e}static#a=new x({el:"undefined"!=typeof window&&void 0!==window.document?window.document.documentElement:void 0,initDetectors:[["tinyStyleEvent",e=>{if("attributes"!==e.type||"style"!==e.attributeName||!(e.target instanceof HTMLElement))return;const t=e.oldValue||"",r=e.target.getAttribute("style")||"",n=function(e,t){const r={added:{},removed:{},modified:{}};for(const n in e)n in t?e[n]!==t[n]&&(r.modified[n]={old:e[n],new:t[n]}):r.removed[n]=e[n];for(const n in t)n in e||(r.added[n]=t[n]);return r}(P.parseStyle(t),P.parseStyle(r));(Object.keys(n.added).length||Object.keys(n.removed).length||Object.keys(n.modified).length)&&e.target.dispatchEvent(new CustomEvent("tinyhtml.stylechanged",{detail:n}))}],["tinyClassEvent",e=>{if("attributes"!==e.type||"class"!==e.attributeName||!(e.target instanceof HTMLElement))return;const t=e.oldValue||"",r=e.target.className||"",n=function(e,t){const r=e.filter(e=>!t.includes(e));return{added:t.filter(t=>!e.includes(t)),removed:r}}(t.split(/\s+/).filter(Boolean),r.split(/\s+/).filter(Boolean));(n.added.length||n.removed.length)&&e.target.dispatchEvent(new CustomEvent("tinyhtml.classchanged",{detail:n}))}]],initCfg:{attributeOldValue:!0,attributes:!0,subtree:!0,attributeFilter:["style","class"]}});static get tinyObserver(){return P.#a}static async fetchHtmlFile(e,t={method:"GET"}){const r=await fetch(e,t),n=r.headers.get("Content-Type")||"";if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);if(!n.includes("text/html"))throw new Error(`Invalid content type: ${n} (expected text/html)`);const o=await r.text();return P.htmlToJson(o)}static async fetchHtmlNodes(e,t){const r=await P.fetchHtmlFile(e,t);return P.jsonToNodes(r)}static async fetchHtmlTinyElems(e,t){const r=await P.fetchHtmlNodes(e,t);return P.toTinyElm(r)}static templateToJson(e){return P.htmlToJson([...e.content.childNodes].map(e=>e instanceof Element?e.getHTML():e instanceof Text?e.textContent:"").join(""))}static templateToNodes(e){const t=[];return[...e.content.cloneNode(!0).childNodes].map(e=>{if(!(e instanceof Element||e instanceof Text||e instanceof Comment))throw new Error(`Expected only Element nodes in <template>, but found: ${e.constructor.name}`);e instanceof Comment||t.push(e)}),t}static templateToTinyElems(e){return P.toTinyElm(P.templateToNodes(e))}static htmlToJson(e){const t=document.createElement("div");t.innerHTML=e.trim();const r=[],n=e=>{if(e instanceof Comment)return null;if(e instanceof Text){const t=e.textContent?.trim();return t||null}if(!(e instanceof Element))return null;const t=e.tagName.toLowerCase(),r={};for(const t of e.attributes)r[P.getPropName(t.name)]=t.value;const o=Array.from(e.childNodes).map(n).filter(Boolean);return o.length>0?[t,r,...o]:[t,r]};for(const e of t.childNodes){const t=n(e);t&&r.push(t)}return t.innerHTML="",r}static jsonToNodes(e){const t=e=>{if("string"==typeof e)return document.createTextNode(e);if(!Array.isArray(e))return document.createTextNode("");const[r,n,...o]=e,i=document.createElement(r);for(const[e,t]of Object.entries(n))i.setAttribute(P.getAttrName(e),t);for(const e of o){const r=t(e);r instanceof Comment||i.appendChild(r)}return i};return e.map(t).filter(e=>!(e instanceof Comment))}static jsonToTinyElems(e){return P.toTinyElm(P.jsonToNodes(e))}static createFrom(e,t){if("string"!=typeof e)throw new TypeError('The "tagName" must be a string.');if(void 0!==t&&"object"!=typeof t)throw new TypeError('The "attrs" must be a object.');const r=P.createElement(e);if("object"==typeof t)for(const e in t)r.setAttr(e,t[e]);return r}static createElement(e,t){if("string"!=typeof e)throw new TypeError("[TinyHtml] createElement(): The tagName must be a string.");if(void 0!==t&&"object"!=typeof t)throw new TypeError("[TinyHtml] createElement(): The ops must be a object.");return new P(document.createElement(e,t))}static createTextNode(e){if("string"!=typeof e)throw new TypeError("[TinyHtml] createTextNode(): The value must be a string.");return new P(document.createTextNode(e))}static createElementFromHTML(e){const t=document.createElement("template");if(!(e=e.trim()).startsWith("<"))return P.createTextNode(e);if(t.innerHTML=e,!(t.content.firstChild instanceof Element))throw new Error("The HTML string must contain a valid HTML element.");return new P(t.content.firstChild)}static createFromHTML(e){const t=document.createElement("template");e=e.trim(),t.innerHTML=e;const r=Array.from(t.content.childNodes);if(!r.every(e=>e instanceof Element||e instanceof Text))throw new Error("The HTML string must contain a valid HTML element.");return new P(r)}static createFromHtml(e){return P.createFromHTML(e)}static query(e,t=document){const r=t.querySelector(e);return r?new P(r):null}querySelector(e){return P.query(e,P._preElem(this,"query"))}static queryAll(e,t=document){return new P(t.querySelectorAll(e))}querySelectorAll(e){return P.queryAll(e,P._preElem(this,"queryAll"))}static getById(e){const t=document.getElementById(e);return t?new P(t):null}static getByClassName(e,t=document){return new P(t.getElementsByClassName(e))}getElementsByClassName(e){return P.getByClassName(e,P._preElem(this,"getByClassName"))}static getByName(e){return new P(document.getElementsByName(e))}static getByTagNameNS(e,t="http://www.w3.org/1999/xhtml",r=document){return new P(r.getElementsByTagNameNS(t,e))}getElementsByTagNameNS(e,t="http://www.w3.org/1999/xhtml"){return P.getByTagNameNS(e,t,P._preElem(this,"getByTagNameNS"))}get elements(){return[...this.#e]}forEach(e){const t=this.elements.map((e,t)=>this.extract(t));for(const r in t)e(t[r],Number(r),t);return this}get(e){if("number"!=typeof e)throw new TypeError("The index must be a number.");if(!this.#e[e])throw new Error(`No element found at index ${e}.`);return this.#e[e]}extract(e){if("number"!=typeof e)throw new TypeError("The index must be a number.");if(!this.#e[e])throw new Error(`Cannot extract: no element exists at index ${e}.`);return new P(this.#e[e])}exists(e){if("number"!=typeof e)throw new TypeError("The index must be a number.");return!!this.#e[e]}getAll(){return[...this.#e]}_getElement(e,t){if(!(this.#e[t]instanceof Element||this.#e[t]instanceof Window||this.#e[t]instanceof Document||this.#e[t]instanceof Text))throw P._debugElemError([...this.#e],this.#e[t]),new Error(`[TinyHtml] Invalid Element in ${e}().`);return this.#e[t]}_getElements(e){if(!this.#e.every(e=>e instanceof Element||e instanceof Window||e instanceof Document||e instanceof Text))throw P._debugElemError([...this.#e]),new Error(`[TinyHtml] Invalid Element in ${e}().`);return[...this.#e]}static _preElemsTemplate(e,t,r,n){const o=e=>{const o=[];return e.map(i=>(i instanceof P?i._getElements(t):[i]).map(i=>{let s=!1;for(const e of r)if(i instanceof e){s=!0;break}if(!s)throw P._debugElemError([...e],i),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${t}().`);return o.push(i),i})),o};return Array.isArray(e)?o(e):o([e])}static _preElemTemplate(e,t,r,n,o=!1){const i=e=>{const i=e[0],s=i instanceof P?i._getElements(t):[i];if(s.length>1)throw P._debugElemError([...e]),new Error(`[TinyHtml] Invalid element amount in ${t}() (Received ${s.length}/1).`);let a=!1;for(const e of r)if(s[0]instanceof e){a=!0;break}if(!o||null!==s[0]&&void 0!==s[0]||(s[0]=null,a=!0),!a)throw P._debugElemError([...e],s[0]),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${t}().`);return s[0]};if(!Array.isArray(e))return i([e]);if(e.length>1)throw P._debugElemError([...e]),new Error(`[TinyHtml] Invalid element amount in ${t}() (Received ${e.length}/1).`);return i(e)}static _preElems(e,t){return P._preElemsTemplate(e,t,[Element],["Element"])}static _preElem(e,t){return P._preElemTemplate(e,t,[Element],["Element"])}static _preNodeElems(e,t){return P._preElemsTemplate(e,t,[Node],["Node"])}static _preNodeElem(e,t){return P._preElemTemplate(e,t,[Node],["Node"])}static _preNodeElemWithNull(e,t){return P._preElemTemplate(e,t,[Node],["Node"],!0)}static _preHtmlElems(e,t){return P._preElemsTemplate(e,t,[HTMLElement],["HTMLElement"])}static _preHtmlElem(e,t){return P._preElemTemplate(e,t,[HTMLElement],["HTMLElement"])}static _preInputElems(e,t){return P._preElemsTemplate(e,t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preInputElem(e,t){return P._preElemTemplate(e,t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preEventTargetElems(e,t){return P._preElemsTemplate(e,t,[EventTarget],["EventTarget"])}static _preEventTargetElem(e,t){return P._preElemTemplate(e,t,[EventTarget],["EventTarget"])}static _preElemsAndWindow(e,t){return P._preElemsTemplate(e,t,[Element,Window],["Element","Window"])}static _preElemAndWindow(e,t){return P._preElemTemplate(e,t,[Element,Window],["Element","Window"])}static _preElemsAndWinAndDoc(e,t){return P._preElemsTemplate(e,t,[Element,Window,Document],["Element","Window","Document"]).map(e=>e instanceof Document?e.documentElement:e)}static _preElemAndWinAndDoc(e,t){const r=P._preElemTemplate(e,t,[Element,Window,Document],["Element","Window","Document"]);return r instanceof Document?r.documentElement:r}static _preElemsWithDoc(e,t){return P._preElemsTemplate(e,t,[Element,Document],["Element","Document"])}static _preElemWithDoc(e,t){return P._preElemTemplate(e,t,[Element,Document],["Element","Document"])}static toTinyElm(e){const t=e=>e.map(e=>e instanceof P?e:new P(e));return Array.isArray(e)?t(e):t([e])}static fromTinyElm(e){const t=e=>{const t=[];return e.map(e=>(e instanceof P?e._getElements("fromTinyElm"):[e]).map(e=>t.push(e))),t};return Array.isArray(e)?t(e):t([e])}static winnow(e,t,r,n=!1){if("boolean"!=typeof n)throw new TypeError('The "not" must be a boolean.');if("function"==typeof t)return P._preElems(e,r).filter((e,r)=>!!t.call(e,r,e)!==n);if(t instanceof Element)return P._preElems(e,r).filter(e=>e===t!==n);if(Array.isArray(t)||"string"!=typeof t&&null!=t.length)return P._preElems(e,r).filter(e=>t.includes(e)!==n);let o=t;return n&&(o=`:not(${o})`),P._preElems(e,r).filter(e=>1===e.nodeType&&e.matches(o))}static filter(e,t,r=!1){return r&&(t=`:not(${t})`),P._preElems(e,"filter").filter(e=>1===e.nodeType&&e.matches(t))}static filterOnly(e,t){return P.winnow(e,t,"filterOnly",!1)}static not(e,t){return P.winnow(e,t,"not",!0)}not(e){return P.not(this,e)}static find(e,t){const r=[];for(const n of P._preElems(e,"find"))r.push(...n.querySelectorAll(t));return[...new Set(r)]}find(e){return P.find(this,e)}static is(e,t){return P.winnow(e,t,"is",!1).length>0}is(e){return P.is(this,e)}static has(e,t){const r="string"==typeof t?[...document.querySelectorAll(t)]:P._preElems(t,"has");return P._preElems(e,"has").filter(e=>r.some(t=>e&&e.contains(t)))}has(e){return P.has(this,e)}static closest(e,t,r){const n=[];for(const o of P._preElems(e,"closest")){let e=o;for(;e&&e!==r;){if(1===e.nodeType&&("string"==typeof t?e.matches(t):e===t)){n.push(e);break}e=e.parentElement}}return[...new Set(n)]}closest(e,t){return P.closest(this,e,t)}static isSameDom(e,t){return P._preNodeElem(e,"isSameDom")===P._preNodeElem(t,"isSameDom")}isSameDom(e){return P.isSameDom(this,e)}#l={};get _data(){return{...this.#l}}set _data(e){if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("value must be a non-null object.");this.#l=e}static _dataSelector={public:(e,t)=>{const r=P._preElem(t,e);let n=I.get(r);return n||(n={},I.set(r,n)),n},private:(e,t)=>{if(!(t instanceof P))throw new Error(`Element must be a TinyHtml instance to execute ${e}().`);return t.#l}};static data(e,t,r=!1){const n=P._dataSelector[r?"private":"public"]("data",e);if(null==t)return{...n};if("string"!=typeof t)throw new TypeError("The key must be a string.");return n.hasOwnProperty(t)?n[t]:void 0}data(e,t){return P.data(this,e,t)}static setData(e,t,r,n=!1){const o=P._dataSelector[n?"private":"public"]("setData",e);if("string"!=typeof t)throw new TypeError("The key must be a string.");return void 0!==r?o[t]=r:P.removeData(e,t),e}setData(e,t,r=!1){return P.setData(this,e,t,r)}static hasData(e,t,r=!1){if("string"!=typeof t)throw new TypeError("The key must be a string.");const n=P._dataSelector[r?"private":"public"]("hasData",e);return Object.prototype.hasOwnProperty.call(n,t)}hasData(e,t=!1){return P.hasData(this,e,t)}static removeData(e,t,r=!1){if("string"!=typeof t)throw new TypeError("The key must be a string.");return delete P._dataSelector[r?"private":"public"]("removeData",e)[t]}removeData(e,t=!1){return P.removeData(this,e,t)}static _getSibling(e,t,r){let n=P._preNodeElemWithNull(e,r);for(;n&&(n=n[t])&&1!==n.nodeType;);return n instanceof Node?n:null}static _getSiblings(e,t){let r=e;const n=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==t&&n.push(r);return n}static domDir(e,t,r,n="domDir"){if("string"!=typeof t)throw new TypeError('The "direction" must be a string.');let o=P._preNodeElemWithNull(e,n);const i=[];for(;o&&(o=o[t]);)if(1===o.nodeType){if(r&&("string"==typeof r?o.matches(r):o===r))break;i.push(o)}return i}static parent(e){let t=P._preNodeElemWithNull(e,"parent");const r=t?t.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return P.parent(this)}static parents(e,t){return P.domDir(e,"parentNode",t,"parents")}parents(e){return P.parents(this,e)}static next(e){return P._getSibling(e,"nextSibling","next")}next(){return P.next(this)}static prev(e){return P._getSibling(e,"previousSibling","prev")}prev(){return P.prev(this)}static nextAll(e){return P.domDir(e,"nextSibling",void 0,"nextAll")}nextAll(){return P.nextAll(this)}static prevAll(e){return P.domDir(e,"previousSibling",void 0,"prevAll")}prevAll(){return P.prevAll(this)}static nextUntil(e,t){return P.domDir(e,"nextSibling",t,"nextUtil")}nextUntil(e){return P.nextUntil(this,e)}static prevUntil(e,t){return P.domDir(e,"previousSibling",t,"prevUtil")}prevUntil(e){return P.prevUntil(this,e)}static siblings(e){const t=P._preNodeElemWithNull(e,"siblings");return P._getSiblings(t&&t.parentNode?t.parentNode.firstChild:null,t)}siblings(){return P.siblings(this)}static children(e){const t=P._preNodeElemWithNull(e,"children");return P._getSiblings(t?t.firstChild:null)}children(){return P.children(this)}static contents(e){const t=P._preNodeElemWithNull(e,"contents");return t instanceof HTMLIFrameElement&&null!=t.contentDocument&&Object.getPrototypeOf(t.contentDocument)?[t.contentDocument]:t instanceof HTMLTemplateElement?Array.from((t.content||t).childNodes):t?Array.from(t.childNodes):[]}contents(){return P.contents(this)}static clone(e,t=!0){if("boolean"!=typeof t)throw new TypeError('The "deep" must be a boolean.');return P._preNodeElems(e,"clone").map(e=>e.cloneNode(t))}clone(e){return P.clone(this,e)[0]}static _appendChecker(e,...t){const r=[];for(const n of t)if(null!=n&&!1!==n)if("string"!=typeof n&&"number"!=typeof n)if(n instanceof Node||n instanceof P)r.push(...P._preNodeElems(n,e));else if(Array.isArray(n))r.push(...P._appendChecker(e,...n));else for(const t in n){const o=n[t];r.push(...P._appendChecker(e,o))}else r.push(n);return r}static append(e,...t){return P._preElem(e,"append").append(...P._appendChecker("append",...t)),e}append(...e){return P.append(this,...e)}static prepend(e,...t){return P._preElem(e,"prepend").prepend(...P._appendChecker("prepend",...t)),e}prepend(...e){return P.prepend(this,...e)}static before(e,...t){return P._preElem(e,"before").before(...P._appendChecker("before",...t)),e}before(...e){return P.before(this,...e)}static after(e,...t){return P._preElem(e,"after").after(...P._appendChecker("after",...t)),e}after(...e){return P.after(this,...e)}static replaceWith(e,...t){return P._preElem(e,"replaceWith").replaceWith(...P._appendChecker("replaceWith",...t)),e}replaceWith(...e){return P.replaceWith(this,...e)}static appendTo(e,t){const r=P._preNodeElems(e,"appendTo"),n=P._preNodeElems(t,"appendTo");return n.forEach((e,t)=>{r.forEach(r=>e.appendChild(t===n.length-1?r:r.cloneNode(!0)))}),e}appendTo(e){return P.appendTo(this,e)}static prependTo(e,t){const r=P._preElems(e,"prependTo"),n=P._preElems(t,"prependTo");return n.forEach((e,t)=>{r.slice().reverse().forEach(r=>e.prepend(t===n.length-1?r:r.cloneNode(!0)))}),e}prependTo(e){return P.prependTo(this,e)}static insertBefore(e,t,r=null){const n=P._preNodeElem(e,"insertBefore"),o=P._preNodeElem(t,"insertBefore"),i=P._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert before.");return o.parentNode.insertBefore(n,i||o),e}insertBefore(e,t){return P.insertBefore(this,e,t)}static insertAfter(e,t,r=null){const n=P._preNodeElem(e,"insertAfter"),o=P._preNodeElem(t,"insertBefore"),i=P._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert after.");return o.parentNode.insertBefore(n,i||o.nextSibling),e}insertAfter(e,t){return P.insertAfter(this,e,t)}static replaceAll(e,t){const r=P._preNodeElems(e,"replaceAll"),n=P._preNodeElems(t,"replaceAll");return n.forEach((e,t)=>{const o=e.parentNode;r.forEach(r=>{o&&o.replaceChild(t===n.length-1?r:r.cloneNode(!0),e)})}),e}replaceAll(e){return P.replaceAll(this,e)}#e;get size(){return this.#e.length}static _elCheck(e){for(const t of e)if(!(t instanceof Element||t instanceof Window||t instanceof Document||t instanceof Text))throw new Error("[TinyHtml] Invalid Target in constructor.")}add(e){return new P([...this.#e,...P._selector(e)])}static _selector(e){if(e instanceof P)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");const t=e=>Array.from(new Set(e)),r="string"!=typeof e?e:document.querySelectorAll(e);if(Array.isArray(r))return P._elCheck(r),t(r);if(r instanceof NodeList||r instanceof HTMLCollection){const e=[...r];return P._elCheck(e),t(e)}{const e=[r];return P._elCheck(e),t(e)}}constructor(e){this.#e=P._selector(e),this.#c=P.#u}static isWindow(e){return null!=e&&e===e.window}static css(e){const t=P._preElem(e,"css");return window.getComputedStyle(t)}css(){return P.css(this)}static cssString(e,t){const r=P._preElem(e,"cssString");if("string"!=typeof t)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[t];return"string"==typeof n?n:"number"==typeof n?n.toString():null}cssString(e){return P.cssString(this,e)}static cssList(e,t){const r=P._preElem(e,"cssList");if(!Array.isArray(t))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const e of t)void 0!==e&&(o[e]=n.getPropertyValue(e));return o}cssList(e){return P.cssList(this,e)}static cssFloat(e,t){const r=P._preElem(e,"cssFloat");if("string"!=typeof t)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[t];return parseFloat(n)||0}cssFloat(e){return P.cssFloat(this,e)}static cssFloats(e,t){const r=P._preElem(e,"cssFloats");if(!Array.isArray(t))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const e of t)o[e]=parseFloat(n[e])||0;return o}cssFloats(e){return P.cssFloats(this,e)}static#f={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(P.#f,{set:(e,t,r)=>(e[t]=r,P.cssPropRevAliases[r]=t,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(P.#f).map(([e,t])=>[t,e]));static toStyleKc(e){return"string"==typeof P.cssPropAliases[e]?P.cssPropAliases[e]:e}static toStyleCc(e){return"string"==typeof P.cssPropRevAliases[e]?P.cssPropRevAliases[e]:e}static setStyle(e,t,r=null){return P._preHtmlElems(e,"setStyle").forEach(e=>{if("object"==typeof t)for(const[r,n]of Object.entries(t))e.style.setProperty(P.toStyleKc(r),"string"==typeof n?n:"number"==typeof n?`${n}px`:String(n));else e.style.setProperty(P.toStyleKc(t),r)}),e}setStyle(e,t){return P.setStyle(this,e,t)}static getStyle(e,t){return P._preHtmlElem(e,"getStyle").style.getPropertyValue(P.toStyleKc(t))}getStyle(e){return P.getStyle(this,e)}static style(e,{camelCase:t=!1,rawAttr:r=!1}={}){if("boolean"!=typeof t)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof t);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const n=P._preHtmlElem(e,"style"),o={};if(r){const e=(n.getAttribute("style")||"").split(";");for(const r of e){const[e,n]=r.split(":");if(!e||!n)continue;const i=e.trim(),s=n.trim();o[t?P.toStyleCc(i):i]=s}}else{const e=n.style;for(let r=0;r<e.length;r++){const n=e[r],i=e.getPropertyValue(n);o[t?P.toStyleCc(n):n]=i}}return o}style(e){return P.style(this,e)}static removeStyle(e,t){return P._preHtmlElems(e,"removeStyle").forEach(e=>{if(Array.isArray(t))for(const r of t)e.style.removeProperty(P.toStyleKc(r));else e.style.removeProperty(P.toStyleKc(t))}),e}removeStyle(e){return P.removeStyle(this,e)}static toggleStyle(e,t,r,n){return P._preHtmlElems(e,"toggleStyle").forEach(e=>{const o=P.getStyle(e,t).trim()===P.toStyleKc(r)?n:r;P.setStyle(e,t,o)}),e}toggleStyle(e,t,r){return P.toggleStyle(this,e,t,r)}static clearStyle(e){return P._preElems(e,"clearStyle").forEach(e=>e.removeAttribute("style")),e}clearStyle(){return P.clearStyle(this)}static focus(e){return P._preHtmlElem(e,"focus").focus(),e}focus(){return P.focus(this)}static blur(e){return P._preHtmlElem(e,"blur").blur(),e}blur(){return P.blur(this)}static select(e){const t=P._preHtmlElem(e,"select");if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))throw new Error("Element must be an <input> or <textarea> to use select().");return t.select(),e}select(){return P.select(this)}static boolCheck(e){return void 0!==e&&("true"===e||"1"===e||!0===e||"on"===e||"number"==typeof e&&e>0)}static setWinScrollTop(e){if("number"!=typeof e)throw new TypeError("The value must be a number.");P.setScrollTop(window,e)}static setWinScrollLeft(e){if("number"!=typeof e)throw new TypeError("The value must be a number.");P.setScrollLeft(window,e)}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static isPageTop(){return 0===window.scrollY}static isPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}static getDimension(e,t,r="content"){const n=P._preElemAndWinAndDoc(e,"getDimension");if("string"!=typeof t)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const o="width"===t?"Width":"Height";if(P.isWindow(n))return"margin"===r?n["inner"+o]:n.document.documentElement["client"+o];const i=n;if(9===i.nodeType){const e=i.documentElement;return Math.max(i.body["scroll"+o],e["scroll"+o],i.body["offset"+o],e["offset"+o],e["client"+o])}let s=i.getBoundingClientRect()[t];function a(e){return"width"===t?P.cssFloat(i,e+"Left")+P.cssFloat(i,e+"Right"):P.cssFloat(i,e+"Top")+P.cssFloat(i,e+"Bottom")}switch(r){case"content":s-=a("padding"),s-=a("border");break;case"padding":s-=a("border");break;case"border":break;case"margin":s+=a("margin")}return s}getDimension(e,t){return P.getDimension(this,e,t)}static setHeight(e,t){const r=P._preHtmlElem(e,"setHeight");if("number"!=typeof t&&"string"!=typeof t)throw new TypeError("The value must be a string or number.");return r.style.height="number"==typeof t?`${t}px`:t,e}setHeight(e){return P.setHeight(this,e)}static setWidth(e,t){const r=P._preHtmlElem(e,"setWidth");if("number"!=typeof t&&"string"!=typeof t)throw new TypeError("The value must be a string or number.");return r.style.width="number"==typeof t?`${t}px`:t,e}setWidth(e){return P.setWidth(this,e)}static height(e){const t=P._preElemAndWinAndDoc(e,"height");return P.getDimension(t,"height","content")}height(){return P.height(this)}static width(e){const t=P._preElemAndWinAndDoc(e,"width");return P.getDimension(t,"width","content")}width(){return P.width(this)}static innerHeight(e){const t=P._preElemAndWinAndDoc(e,"innerHeight");return P.getDimension(t,"height","padding")}innerHeight(){return P.innerHeight(this)}static innerWidth(e){const t=P._preElemAndWinAndDoc(e,"innerWidth");return P.getDimension(t,"width","padding")}innerWidth(){return P.innerWidth(this)}static outerHeight(e,t=!1){if("boolean"!=typeof t)throw new TypeError('The "includeMargin" must be a boolean.');const r=P._preElemAndWinAndDoc(e,"outerHeight");return P.getDimension(r,"height",t?"margin":"border")}outerHeight(e){return P.outerHeight(this,e)}static outerWidth(e,t=!1){if("boolean"!=typeof t)throw new TypeError('The "includeMargin" must be a boolean.');const r=P._preElemAndWinAndDoc(e,"outerWidth");return P.getDimension(r,"width",t?"margin":"border")}outerWidth(e){return P.outerWidth(this,e)}#c="";get mainDisplay(){return this.#c}set mainDisplay(e){if("string"!=typeof e)throw new TypeError("mainDisplay must be a string.");this.#c=e}static#u="block";static get defaultDisplay(){return P.#u}static set defaultDisplay(e){if("string"!=typeof e)throw new TypeError("defaultDisplay must be a string.");P.#u=e}static getAnimateData(e,t){let r=O.get(e);return r||(r={},O.set(e,r)),r[t]}static setAnimateData(e,t,r){if(!(e instanceof HTMLElement))throw new TypeError("setAnimateData: el must be an HTMLElement.");if("string"!=typeof t)throw new TypeError("setAnimateData: where must be a string.");if("string"!=typeof r&&"number"!=typeof r)throw new TypeError("setAnimateData: value must be a string or number.");let n=O.get(e);n||(n={},O.set(e,n)),n[t]=r}static#p=!0;static get cancelOldStyleFx(){return P.#p}static set cancelOldStyleFx(e){if("boolean"!=typeof e)throw new TypeError("Expected a boolean value.");P.#p=e}static#h={slow:{duration:600,easing:"ease"},fast:{duration:200,easing:"ease-out"},_default:{duration:400,easing:"linear"}};static get styleFxSpeeds(){const e={};for(const t in P.#h){const r=P.#h[t];e[t]="object"==typeof r?{...r}:r}return e}static set styleFxSpeeds(e){if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("styleFxSpeeds must be an object.");for(const[t,r]of Object.entries(e))if("number"!=typeof r&&"object"!=typeof r)throw new TypeError(`styleFxSpeeds["${t}"] must be a number or KeyframeAnimationOptions.`);P.#h={};for(const[t,r]of Object.entries(e))P.setStyleFxSpeed(t,r)}static getStyleFxSpeed(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');const t=P.#h[e];return"object"==typeof t?{...t}:t}static setStyleFxSpeed(e,t){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');if("number"!=typeof t&&"object"!=typeof t)throw new TypeError("styleFxSpeed must be a number or KeyframeAnimationOptions");P.#h[e]="object"==typeof t?{...t}:t}static deleteStyleFxSpeed(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return delete P.#h[e]}static hasStyleFxSpeed(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#h,e)}static#m=["Top","Right","Bottom","Left"];static#d={slideDown:P.genStyleFx("show"),slideUp:P.genStyleFx("hide"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}};static get styleEffects(){return JSON.parse(JSON.stringify(P.#d))}static set styleEffects(e){if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("styleEffects must be an object");for(const t in e)for(const[r,n]of Object.entries(e[t]))if(!("string"==typeof n||Array.isArray(n)&&n.every(e=>"string"==typeof e||"number"==typeof e)))throw new TypeError(`Invalid styleEffect["${r}"]`);P.#d={};for(const t in e)P.setStyleEffect(t,e[t])}static getStyleEffect(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');const t=P.#d[e];return t?JSON.parse(JSON.stringify(t)):void 0}static setStyleEffect(e,t){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffect must be an object");const r={};for(const[e,n]of Object.entries(t))if("string"==typeof n)r[e]=n;else{if(!Array.isArray(n)||!n.every(e=>"string"==typeof e||"number"==typeof e))throw new TypeError(`Invalid styleEffect["${e}"]`);r[e]=[...n]}P.#d[e]=r}static deleteStyleEffect(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return delete P.#d[e]}static hasStyleEffect(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#d,e)}static#g={slideDown:"slideUp",slideUp:"slideDown",fadeIn:"fadeOut",fadeOut:"fadeIn",fadeTo:"fadeIn"};static get styleEffectInverse(){return{...P.#g}}static set styleEffectInverse(e){if("object"!=typeof e||null===e)throw new TypeError("styleEffectInverse must be an object.");for(const[t,r]of Object.entries(e))if("string"!=typeof r)throw new TypeError(`styleEffectInverse["${t}"] must be a string.`);P.#g={};for(const[t,r]of Object.entries(e))P.setStyleEffectInverse(t,r)}static getStyleEffectInverse(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return P.#g[e]||null}static setStyleEffectInverse(e,t){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');if("string"!=typeof t)throw new TypeError(`styleEffectInverse["${e}"] must be a string.`);P.#g[e]=t}static deleteStyleEffectInverse(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return delete P.#g[e]}static hasStyleEffectInverse(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#g,e)}static#y={slideDown:e=>e.height[0]===e.height[1]&&(!e.width||e.width[0]===e.width[1]),slideUp:e=>e.height[0]===e.height[1]&&(!e.width||e.width[0]===e.width[1]),fadeIn:e=>Number(e.opacity[0])===Number(e.opacity[1]),fadeOut:e=>Number(e.opacity[0])===Number(e.opacity[1])};static get styleEffectsRd(){return{...P.#y}}static set styleEffectsRd(e){if("object"!=typeof e||null===e)throw new TypeError("styleEffectsRd must be an object.");for(const[t,r]of Object.entries(e))if("function"!=typeof r)throw new TypeError(`styleEffectsRd["${t}"] must be a function.`);P.#y={};for(const[t,r]of Object.entries(e))P.setStyleEffectRd(t,r)}static getStyleEffectRd(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return P.#y[e]||null}static setStyleEffectRd(e,t){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof t)throw new TypeError(`styleEffectsRd["${e}"] must be a function.`);P.#y[e]=t}static deleteStyleEffectRd(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return delete P.#y[e]}static hasStyleEffectRd(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#y,e)}static#b={show:(e,t,r,n)=>{if("height"===r||"width"===r){const o=P.getAnimateData(e,`orig${r}`)||e.scrollHeight+"px";P.setAnimateData(e,`orig${r}`,o);const i=n[r];t[r]=[i,o]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=P.getAnimateData(e,r)||n[r];P.setAnimateData(e,r,o),t[r]=["0px",o]}else if("opacity"===r){const e=n.opacity;t[r]=[e,1]}else{const o=P.getAnimateData(e,r)||n[r];P.setAnimateData(e,r,o),t[r]=[o,n[r]||1]}},hide:(e,t,r,n)=>{if("height"===r||"width"===r){const o=P.getAnimateData(e,`orig${r}`)||n[r];P.setAnimateData(e,`orig${r}`,o);const i=n[r];t[r]=[i,0]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=P.getAnimateData(e,r)||n[r];P.setAnimateData(e,r,o),t[r]=[n[r],"0px"]}else if("opacity"===r){const e=n.opacity;t[r]=[e,0]}else{const o=P.getAnimateData(e,r)||n[r];P.setAnimateData(e,r,o),t[r]=[o,0]}}};static get styleEffectsProps(){return{...P.#b}}static set styleEffectsProps(e){if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("styleEffectsProps must be an object");for(const[t,r]of Object.entries(e))if("function"!=typeof r)throw new TypeError(`styleEffectsProps["${t}"] must be a function`);P.#b={};for(const[t,r]of Object.entries(e))P.setStyleEffectProp(t,r)}static getStyleEffectProp(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return P.#b[e]||null}static setStyleEffectProp(e,t){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof t)throw new TypeError(`styleEffectsProps["${e}"] must be a function`);P.#b[e]=t}static deleteStyleEffectProp(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return delete P.#b[e]}static hasStyleEffectProp(e){if("string"!=typeof e)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#b,e)}static genStyleFx(e,t=!1){if("string"!=typeof e)throw new TypeError("genStyleFx: type must be a string.");if("boolean"!=typeof t)throw new TypeError("genStyleFx: includeWidth must be a boolean.");let r,n=0;const o={height:e},i=t?1:0;for(;n<4;n+=2-i)r=P.#m[n],o["margin"+r]=e,o["padding"+r]=e;return t&&(o.opacity=e,o.width=e),o}static applyStyleFx(e,t,r,n){if("string"!=typeof t)throw new TypeError("applyStyleFx: id must be a string.");if("object"!=typeof r||null===r)throw new TypeError("applyStyleFx: props must be a non-null object.");if(void 0!==n&&"number"!=typeof n&&"string"!=typeof n&&("object"!=typeof n||null===n))throw new TypeError("applyStyleFx: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return P._preHtmlElems(e,"applyStyleFx").forEach(i=>{const s={};for(const[e,t]of Object.entries(r))if("string"==typeof t&&this.#b[t]){const r=getComputedStyle(i);this.#b[t](i,s,e,r)}else{if("object"!=typeof t)throw new TypeError(`applyStyleFx: invalid action for prop "${e}". Must be string or array.`);s[e]=t}if("function"==typeof P.#y[t]&&P.#y[t](s))return void o.set(i,null);const a=[],l=s[Object.keys(s)[0]].length;for(let e=0;e<l;e++){const t={};for(const r in s)t[r]=s[r][e];a.push(t)}o.set(i,P.animate(e,a,n,t)[0])}),o}applyStyleFx(e,t,r){return P.applyStyleFx(this,e,t,r)}static getCurrentAnimationId(e){if(!(e instanceof HTMLElement))throw new TypeError("Expected an HTMLElement.");return M.get(e)?.id??void 0}static animate(e,t,r=P.#h._default,n=null,o=P.#p){const i="string"==typeof r?P.#h[r]??void 0:"number"!=typeof r?{...r}:r;"object"==typeof i&&void 0===i.fill&&(i.fill="forwards");const s=[];return P._preHtmlElems(e,"animate").forEach(e=>{if(o){const t=M.get(e);t&&t.animation.cancel()}const r=e.animate(t,i);s.push(r),M.set(e,{animation:r,id:n??""}),r.addEventListener("finish",()=>{M.get(e)?.animation===r&&M.delete(e)})}),s}animate(e,t,r,n){return P.animate(this,e,t,r,n)}static stop(e){const t=[];return P._preHtmlElems(e,"stop").forEach(e=>{const r=M.get(e);r?(r.animation.cancel(),M.delete(e),t.push(!0)):t.push(!1)}),t}stop(){return P.stop(this)}static slideDown(e,t){return P.applyStyleFx(e,"slideDown",this.#d.slideDown,t??{duration:500,easing:"ease-out"})}slideDown(e){return P.slideDown(this,e)}static slideUp(e,t){return P.applyStyleFx(e,"slideUp",this.#d.slideUp,t??{duration:500,easing:"ease-out"})}slideUp(e){return P.slideUp(this,e)}static slideToggle(e,t){const r=P._preHtmlElem(e,"slideToggle"),n=getComputedStyle(r),o=P.getCurrentAnimationId(r),i="none"===n.display||0===r.offsetHeight;return("string"==typeof o?"slideUp"===o:i)?P.slideDown(e,t):P.slideUp(e,t)}slideToggle(e){return P.slideToggle(this,e)}static fadeIn(e,t){return P.applyStyleFx(e,"fadeIn",this.#d.fadeIn,t)}fadeIn(e){return P.fadeIn(this,e)}static fadeOut(e,t){return P.applyStyleFx(e,"fadeOut",this.#d.fadeOut,t)}fadeOut(e){return P.fadeOut(this,e)}static fadeToggle(e,t){const r=P._preHtmlElem(e,"fadeToggle"),n=getComputedStyle(r),o=P.getCurrentAnimationId(r),i="0"===n.opacity||null===r.offsetParent;return("string"==typeof o?"fadeOut"===o:i)?P.fadeIn(e,t):P.fadeOut(e,t)}fadeToggle(e){return P.fadeToggle(this,e)}static fadeTo(e,t,r,n=P.#u){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new TypeError("fadeTo: opacity must be a number between 0 and 1.");if(void 0!==r&&"number"!=typeof r&&"string"!=typeof r&&("object"!=typeof r||null===r))throw new TypeError("fadeTo: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return P._preHtmlElems(e,"fadeTo").forEach(i=>{const s=getComputedStyle(i);if(!(e instanceof Element&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length))){const e=P.getAnimateData(i,"origdisplay");i.style.display="string"==typeof e?e:n}const a=[s.opacity,t].map(e=>({opacity:e}));o.set(i,P.animate(i,a,r,"fadeTo")[0])}),o}fadeTo(e,t,r=this.#c){return P.fadeTo(this,e,t,r)}static offset(e){const t=P._preElem(e,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft;return{top:t.top+r,left:t.left+n}}offset(){return P.offset(this)}static position(e){const t=P._preHtmlElem(e,"position");let r,n,o={top:0,left:0};if("fixed"===window.getComputedStyle(t).position)n=t.getBoundingClientRect();else{n=P.offset(t),r=t.offsetParent||document.documentElement;const{position:e}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===e;)r=r.parentNode;if(r instanceof HTMLElement&&r!==t&&1===r.nodeType){const{borderTopWidth:e,borderLeftWidth:t}=P.cssFloats(r,["borderTopWidth","borderLeftWidth"]);o=P.offset(r),o.top+=e,o.left+=t}}return{top:n.top-o.top-P.cssFloat(t,"marginTop"),left:n.left-o.left-P.cssFloat(t,"marginLeft")}}position(){return P.position(this)}static offsetParent(e){let t=P._preHtmlElem(e,"offsetParent").offsetParent;for(;t instanceof HTMLElement&&"static"===window.getComputedStyle(t).position;)t=t.offsetParent;return t instanceof HTMLElement?t:document.documentElement}offsetParent(){return P.offsetParent(this)}static scrollTop(e){const t=P._preElemAndWindow(e,"scrollTop");return P.isWindow(t)?t.pageYOffset:9===t.nodeType?t.defaultView.pageYOffset:t.scrollTop}scrollTop(){return P.scrollTop(this)}static scrollLeft(e){const t=P._preElemAndWindow(e,"scrollLeft");return P.isWindow(t)?t.pageXOffset:9===t.nodeType?t.defaultView.pageXOffset:t.scrollLeft}scrollLeft(){return P.scrollLeft(this)}static easings={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1};static scrollToXY(e,{targetX:t,targetY:r,duration:n,easing:o,onAnimation:i}={}){if(void 0!==t&&"number"!=typeof t)throw new TypeError("`targetX` must be a number if provided.");if(void 0!==r&&"number"!=typeof r)throw new TypeError("`targetY` must be a number if provided.");if(void 0!==n&&"number"!=typeof n)throw new TypeError("`duration` must be a number if provided.");if(void 0!==o&&"string"!=typeof o)throw new TypeError("`easing` must be a string if provided.");if(void 0!==o&&"function"!=typeof P.easings[o])throw new TypeError(`Unknown easing function: "${o}".`);if(void 0!==i&&"function"!=typeof i)throw new TypeError("`onAnimation` must be a function if provided.");const s=(e,t,r,n)=>{if(e instanceof Window)window.scrollTo(t,r);else if(9===e.nodeType)e.defaultView.scrollTo(t,r);else{const n=e instanceof Window?window.scrollX:e.scrollLeft,o=e instanceof Window?window.scrollY:e.scrollTop;n!==t&&(e.scrollLeft=t),o!==r&&(e.scrollTop=r)}"function"==typeof i&&i({x:t,y:r,isComplete:n>=1,time:n})};return P._preElemsAndWindow(e,"scrollToXY").forEach(e=>{const i=e instanceof Window?window.scrollX:e.scrollLeft,a=e instanceof Window?window.scrollY:e.scrollTop,l=t??i,c=r??a,u=l-i,f=c-a,p="string"==typeof o&&P.easings[o]||null;if("number"!=typeof n||"function"!=typeof p)return s(e,l,c,1);const h=performance.now(),m=n??0;requestAnimationFrame(function t(r){if("function"!=typeof p)return;const n=Math.min(1,(r-h)/m),o=p(n);s(e,i+u*o,a+f*o,n),n<1&&requestAnimationFrame(t)})}),e}scrollToXY({targetX:e,targetY:t,duration:r,easing:n,onAnimation:o}={}){return P.scrollToXY(this,{targetX:e,targetY:t,duration:r,easing:n,onAnimation:o})}static setScrollTop(e,t){if("number"!=typeof t)throw new TypeError("ScrollTop value must be a number.");return P.scrollToXY(e,{targetY:t})}setScrollTop(e){return P.setScrollTop(this,e)}static setScrollLeft(e,t){if("number"!=typeof t)throw new TypeError("ScrollLeft value must be a number.");return P.scrollToXY(e,{targetX:t})}setScrollLeft(e){return P.setScrollLeft(this,e)}static borderWidth(e){const t=P._preElem(e,"borderWidth"),{borderLeftWidth:r,borderRightWidth:n,borderTopWidth:o,borderBottomWidth:i}=P.cssFloats(t,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}borderWidth(){return P.borderWidth(this)}static border(e){const t=P._preElem(e,"border"),{borderLeft:r,borderRight:n,borderTop:o,borderBottom:i}=P.cssFloats(t,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}border(){return P.border(this)}static margin(e){const t=P._preElem(e,"margin"),{marginLeft:r,marginRight:n,marginTop:o,marginBottom:i}=P.cssFloats(t,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}margin(){return P.margin(this)}static padding(e){const t=P._preElem(e,"padding"),{paddingLeft:r,paddingRight:n,paddingTop:o,paddingBottom:i}=P.cssFloats(t,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}padding(){return P.padding(this)}static#w=!1;static get classCanWhitespace(){return this.#w}static set classCanWhitespace(e){if("boolean"!=typeof e)throw new TypeError("classCanWhitespace must be a boolean");this.#w=e}static addClass(e,...t){const r=[];for(const e of t)if(P.#w){const t=e.split(" ");for(const e of t)r.push(e)}else r.push(e);return P._preElems(e,"addClass").forEach(e=>e.classList.add(...r)),e}addClass(...e){return P.addClass(this,...e)}static removeClass(e,...t){const r=[];for(const e of t)if(P.#w){const t=e.split(" ");for(const e of t)r.push(e)}else r.push(e);return P._preElems(e,"removeClass").forEach(e=>e.classList.remove(...r)),e}removeClass(...e){return P.removeClass(this,...e)}static replaceClass(e,t,r){if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const n=[];return P._preElems(e,"replaceClass").forEach(e=>n.push(e.classList.replace(t,r))),n}replaceClass(e,t){return P.replaceClass(this,e,t)[0]}static classItem(e,t){const r=P._preElem(e,"classItem");if("number"!=typeof t)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(t)}classItem(e){return P.classItem(this,e)}static toggleClass(e,t,r){if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const n=[];return P._preElems(e,"toggleClass").forEach(e=>n.push(e.classList.toggle(t,r))),n}toggleClass(e,t){return P.toggleClass(this,e,t)[0]}static hasClass(e,t){const r=P._preElem(e,"hasClass");if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(t)}hasClass(e){return P.hasClass(this,e)}static classLength(e){return P._preElem(e,"classLength").classList.length}classLength(){return P.classLength(this)}static classList(e){return P._preElem(e,"classList").classList.values().toArray()}classList(){return P.classList(this)}static tagName(e){return P._preElem(e,"tagName").tagName}tagName(){return P.tagName(this)}static id(e){return P._preElem(e,"id").id}id(){return P.id(this)}static toBigInt(e){const t=P._preElem(e,"toBigInt"),r=t.textContent?.trim();let n=null;try{n=BigInt(r??"")}catch{n=null}return n}toBigInt(){return P.toBigInt(this)}static setBigInt(e,t){if("bigint"!=typeof t)throw new Error("Value is not a valid BigInt.");const r=t.toString();return P._preElems(e,"setBigInt").forEach(e=>e.textContent=r),e}setBigInt(e){return P.setBigInt(this,e)}static toDate(e){const t=P._preElem(e,"toDate"),r=t.textContent?.trim();if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}toDate(){return P.toDate(this)}static setDate(e,t){if(!(t instanceof Date)||Number.isNaN(t.getTime()))throw new Error("Value is not a valid Date.");const r=t.toISOString();return P._preElems(e,"setDate").forEach(e=>e.textContent=r),e}setDate(e){return P.setDate(this,e)}static toJson(e){const t=P._preElem(e,"toJson"),r=t.textContent?.trim();if(!r)return null;try{return JSON.parse(r)}catch{return null}}toJson(){return P.toJson(this)}static setJson(e,t,r,n){const o=JSON.stringify(t,r,n);return P._preElems(e,"setJson").forEach(e=>e.textContent=o),e}setJson(e,t,r){return P.setJson(this,e,t,r)}static toNumber(e){const t=P._preElem(e,"toNumber");return"string"==typeof t.textContent?parseFloat(t.textContent.trim()):null}toNumber(){return P.toNumber(this)}static setNumber(e,t){if("number"!=typeof t)throw new Error("Value is not a valid number.");const r=t.toString();return P._preElems(e,"setNumber").forEach(e=>e.textContent=r),e}setNumber(e){return P.setNumber(this,e)}static toBoolean(e){const t=P._preElem(e,"toBoolean"),r=t.textContent?.trim();return null==r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}toBoolean(){return P.toBoolean(this)}static setBoolean(e,t){if("boolean"!=typeof t)throw new Error("Value is not a valid boolean.");const r=t.toString();return P._preElems(e,"setBoolean").forEach(e=>e.textContent=r),e}setBoolean(e){return P.setBoolean(this,e)}static toString(e){const t=P._preElem(e,"toString");return"string"==typeof t.textContent?t.textContent:null}toString(){return P.toString(this)}static setString(e,t){if("string"!=typeof t)throw new Error("Value is not a valid string.");return P._preElems(e,"setString").forEach(e=>e.textContent=t),e}setString(e){return P.setString(this,e)}static text(e){return P._preElem(e,"text").textContent}text(){return P.text(this)}static setText(e,t){const r=null!=t?String(t):"";return P._preElems(e,"setText").forEach(e=>e.textContent=r),e}setText(e){return P.setText(this,e)}static empty(e){return P._preElems(e,"empty").forEach(e=>e.textContent=""),e}empty(){return P.empty(this)}static html(e,t){return P._preElem(e,"html").getHTML(t)}html(e){return P.html(this,e)}static setHtml(e,t){if("string"!=typeof t)throw new Error("Value is not a valid string.");return P._preElems(e,"setHtml").forEach(e=>e.innerHTML=t),e}setHtml(e){return P.setHtml(this,e)}static _valHooks={option:{get:e=>{const t=e.getAttribute("value");return null!=t?t:e.textContent}},select:{get:e=>{const t=e.options,r=e.selectedIndex,n="select-one"===e.type,o=n?r+1:t.length,i=[];let s=r<0?o:n?r:0;for(;s<o;s++){const e=t[s],o=e.parentNode;if((e.selected||s===r)&&!e.disabled&&(!o||!o.disabled||"OPTGROUP"!==o.tagName)){const t=P._valHooks.option.get(e);if(n)return t;i.push(t)}}return i},set:(e,t)=>{const r=e.options,n=Array.isArray(t)?t.map(String):[String(t)];let o=!1;for(let e=0;e<r.length;e++){const t=r[e],i=P._valHooks.option.get(t);"string"==typeof i&&(t.selected=n.includes(i))&&(o=!0)}return o||(e.selectedIndex=-1),n}},radio:{get:e=>e.checked?"on":"off",set(e,t){if("boolean"==typeof t){const r=e.closest("label");return t&&r&&r.querySelectorAll('input[type="radio"]').forEach(t=>{t instanceof HTMLInputElement&&t!==e&&(t.checked=!1)}),e.checked=t,t}}},checkbox:{get:e=>e.checked?"on":"off",set(e,t){if("boolean"==typeof t)return e.checked=t,t}}};static setVal(e,t){return P._preInputElems(e,"setVal").forEach(e=>{if(1!==e.nodeType)return;let r="function"==typeof t?t(e,P.val(e)):t;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=((e,t)=>{const r=[];for(let n=0;n<e.length;n++)r.push(t(e[n]));return r})(r,e=>null==e?"":String(e)));const n=P._valHooks[e.type]||P._valHooks[e.nodeName.toLowerCase()];if(!n||"function"!=typeof n.set||void 0===n.set(e,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(e.value=r)}}),e}setVal(e){return P.setVal(this,e)}static _valTypes={string:e=>e.value,date:e=>e.valueAsDate,number:e=>e.valueAsNumber};static _getValByType(e,t,r){if("string"!=typeof t)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof P._valTypes[t])throw new Error(`No handler found for type "${t}" in ${r}().`);return P._valTypes[t](e)}static _val(e,t,r){const n=P._preInputElem(e,t),o=P._valHooks[n.type]||P._valHooks[n.nodeName.toLowerCase()];if(o&&"function"==typeof o.get){const e=o.get(n,"value",r);if(void 0!==e)return"string"==typeof e?e.replace(/\r/g,""):e}return P._getValByType(n,r,t)}_val(e,t){return P._val(this,e,t)}static val(e){return P._val(e,"val","string")}val(){return P.val(this)}static valTxt(e){const t=P._val(e,"valTxt","string");if("string"!=typeof t&&null!==t)throw new Error("Value is not a valid string.");return null==t?"":"string"==typeof t?t.replace(/\r/g,""):t}valTxt(){return P.valTxt(this)}static _valArr(e,t,r){const n=P._val(e,t,r);if(!Array.isArray(n))throw new Error(`Value expected an array but got ${typeof n}.`);return n}_valArr(e,t){return P._valArr(this,e,t)}static valArr(e){return P._valArr(e,"valArr","string")}valArr(){return P.valArr(this)}static valNb(e){if(!(P._preInputElem(e,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const t=P._val(e,"valNb","number");if(Number.isNaN(t))throw new Error("Value is not a valid number.");return t}valNb(){return P.valNb(this)}static valDate(e){if(!(P._preInputElem(e,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const t=P._val(e,"valDate","date");if(!(t instanceof Date))throw new Error("Value is not a valid date.");return t}valDate(){return P.valDate(this)}static valBool(e){const t=P._preInputElem(e,"valBool");if(!(t instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===P.val(t)}valBool(){return P.valBool(this)}static listenForPaste(e,{onFilePaste:t,onTextPaste:r}={}){if(void 0!==t&&"function"!=typeof t)throw new TypeError("onFilePaste must be a function.");if(void 0!==r&&"function"!=typeof r)throw new TypeError("onTextPaste must be a function.");const n=e=>{if(!(e instanceof ClipboardEvent))return;const n=e.clipboardData?.items||[];for(const e of n)if("file"===e.kind){if("function"==typeof t){const r=e.getAsFile();r&&t(e,r)}}else"string"===e.kind&&"function"==typeof r&&e.getAsString(t=>r(e,t))};return P._preElemsWithDoc(e,"listenForPaste").forEach(e=>P.on(e,"paste",n)),n}listenForPaste({onFilePaste:e,onTextPaste:t}={}){return P.listenForPaste(this,{onFilePaste:e,onTextPaste:t})}static hasEventListener(e,t){const r=P._preEventTargetElem(e,"hasEventListener");if(!H.has(r))return!1;const n=H.get(r);return!!(n&&Array.isArray(n[t])&&n[t].length>0)}hasEventListener(e){return P.hasEventListener(this,e)}static hasExactEventListener(e,t,r){const n=P._preEventTargetElem(e,"hasExactEventListener");if("function"!=typeof r)throw new TypeError('The "handler" must be a function.');if(!H.has(n))return!1;const o=H.get(n);return!(!o||!Array.isArray(o[t]))&&o[t].some(e=>e.handler===r)}hasExactEventListener(e,t){return P.hasExactEventListener(this,e,t)}static hover(e,t,r,n){return P.on(e,"mouseenter",t,n),P.on(e,"mouseleave",r||t,n),e}hover(e,t,r){return P.hover(this,e,t,r)}static on(e,t,r,n){if(!("string"==typeof t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(t)?Array.from(new Set(t)):[t]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");P._preEventTargetElems(e,"on").forEach(e=>{e.addEventListener(o,r,n),H.has(e)||H.set(e,{});const t=H.get(e);t&&(Array.isArray(t[o])||(t[o]=[]),t[o].push({handler:r,options:n}))})}return e}on(e,t,r){return P.on(this,e,t,r)}static once(e,t,r,n={}){if(!("string"==typeof t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(t)?Array.from(new Set(t)):[t]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");P._preEventTargetElems(e,"once").forEach(e=>{const t=n=>{P.off(e,o,t),"function"==typeof r&&r(n)};P.on(e,o,t,"boolean"==typeof n?n:{...n,once:!0})})}return e}once(e,t,r={}){return P.once(this,e,t,r)}static off(e,t,r,n){if(!("string"==typeof t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(t)?Array.from(new Set(t)):[t]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");P._preEventTargetElems(e,"off").forEach(e=>{e.removeEventListener(o,r,n);const t=H.get(e);t&&t[o]&&(t[o]=t[o].filter(e=>e.handler!==r),0===t[o].length&&delete t[o])})}return e}off(e,t,r){return P.off(this,e,t,r)}static offAll(e,t){if(!("string"==typeof t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("The events must be a string or array of strings.");for(const r of Array.isArray(t)?Array.from(new Set(t)):[t]){if("string"!=typeof r)throw new TypeError("The event name must be a string.");P._preEventTargetElems(e,"offAll").forEach(e=>{const t=H.get(e);if(t&&t[r]){for(const n of t[r])e.removeEventListener(r,n.handler,n.options);delete t[r]}})}return e}offAll(e){return P.offAll(this,e)}static offAllTypes(e,t=null){if(null!==t&&"function"!=typeof t)throw new TypeError('The "filterFn" must be a function.');return P._preEventTargetElems(e,"offAllTypes").forEach(e=>{const r=H.get(e);if(r){for(const n in r)for(const o of r[n])("function"!=typeof t||t(o.handler,n))&&e.removeEventListener(n,o.handler,o.options);H.delete(e)}}),e}offAllTypes(e=null){return P.offAllTypes(this,e)}static trigger(e,t,r={}){if(!("string"==typeof t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("The events must be a string or array of strings.");for(const n of Array.isArray(t)?Array.from(new Set(t)):[t]){if("string"!=typeof n)throw new TypeError("The event name must be a string.");P._preEventTargetElems(e,"trigger").forEach(e=>{const t=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:r});e.dispatchEvent(t)})}return e}trigger(e,t={}){return P.trigger(this,e,t)}static#E={for:"htmlFor",class:"className"};static propFix=new Proxy(P.#E,{set:(e,t,r)=>(e[t]=r,P.attrFix[r]=t,!0)});static attrFix=Object.fromEntries(Object.entries(P.#E).map(([e,t])=>[t,e]));static getPropName(e){return"string"==typeof P.propFix[e]?P.propFix[e]:e}static getAttrName(e){return"string"==typeof P.attrFix[e]?P.attrFix[e]:e}static attrBigInt(e,t){const r=P._preElem(e,"attrBigInt").getAttribute(P.getAttrName(t));if(null==r)return null;try{return BigInt(r)}catch{return null}}attrBigInt(e){return P.attrBigInt(this,e)}static setAttrBigInt(e,t,r){if("bigint"!=typeof r)throw new Error("Value is not a valid BigInt.");return P.setAttr(e,t,r.toString())}setAttrBigInt(e,t){return P.setAttrBigInt(this,e,t)}static attrDate(e,t){const r=P._preElem(e,"attrDate").getAttribute(P.getAttrName(t));if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}attrDate(e){return P.attrDate(this,e)}static setAttrDate(e,t,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new Error("Value is not a valid Date.");return P.setAttr(e,t,r.toISOString())}setAttrDate(e,t){return P.setAttrDate(this,e,t)}static attrJson(e,t){const r=P._preElem(e,"attrJson").getAttribute(P.getAttrName(t));if(!r)return null;try{return JSON.parse(r)}catch{return null}}attrJson(e){return P.attrJson(this,e)}static setAttrJson(e,t,r,n,o){const i=JSON.stringify(r,n,o);return P.setAttr(e,t,i)}setAttrJson(e,t,r,n){return P.setAttrJson(this,e,t,r,n)}static attrNumber(e,t){const r=P._preElem(e,"attrNumber").getAttribute(P.getAttrName(t));return null!=r?parseFloat(r):null}attrNumber(e){return P.attrNumber(this,e)}static setAttrNumber(e,t,r){if("number"!=typeof r)throw new Error("Value is not a valid number.");return P.setAttr(e,t,r.toString())}setAttrNumber(e,t){return P.setAttrNumber(this,e,t)}static attrBoolean(e,t){const r=P._preElem(e,"attrBoolean").getAttribute(P.getAttrName(t));return null===r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}attrBoolean(e){return P.attrBoolean(this,e)}static setAttrBoolean(e,t,r){if("boolean"!=typeof r)throw new Error("Value is not a valid boolean.");return P.setAttr(e,t,r.toString())}setAttrBoolean(e,t){return P.setAttrBoolean(this,e,t)}static attrString(e,t){const r=P._preElem(e,"attrString").getAttribute(P.getAttrName(t));return"string"==typeof r?r:null}attrString(e){return P.attrString(this,e)}static setAttrString(e,t,r){if("string"!=typeof r)throw new Error("Value is not a valid string.");return P.setAttr(e,t,r)}setAttrString(e,t){return P.setAttrString(this,e,t)}static attr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return P._preElem(e,"attr").getAttribute(P.getAttrName(t))}attr(e){return P.attr(this,e)}static setAttr(e,t,r=null){const n=P._preElems(e,"setAttr");if("object"==typeof t&&null!==t)return Object.entries(t).forEach(([e,t])=>n.forEach(r=>{null===t?r.removeAttribute(P.getAttrName(e)):r.setAttribute(P.getAttrName(e),String(t))})),e;if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return n.forEach(e=>{null===r?e.removeAttribute(P.getAttrName(t)):e.setAttribute(P.getAttrName(t),String(r))}),e}setAttr(e,t){return P.setAttr(this,e,t)}static removeAttr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return P._preElems(e,"removeAttr").forEach(e=>e.removeAttribute(P.getAttrName(t))),e}removeAttr(e){return P.removeAttr(this,e)}static hasAttr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return P._preElem(e,"hasAttr").hasAttribute(P.getAttrName(t))}hasAttr(e){return P.hasAttr(this,e)}static hasProp(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return!!P._preElem(e,"hasProp")[P.getPropName(t)]}hasProp(e){return P.hasProp(this,e)}static addProp(e,...t){return P._preElems(e,"addProp").forEach(e=>{t.forEach(t=>{if("string"!=typeof t)throw new TypeError('Each "name" must be a string.');e[P.getPropName(t)]=!0})}),e}addProp(...e){return P.addProp(this,...e)}static removeProp(e,...t){return P._preElems(e,"removeProp").forEach(e=>{t.forEach(t=>{if("string"!=typeof t)throw new TypeError('Each "name" must be a string.');e[P.getPropName(t)]=!1})}),e}removeProp(...e){return P.removeProp(this,...e)}static toggleProp(e,t,r){const n=P._preElems(e,"toggleProp");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');return(Array.isArray(t)?t:[t]).forEach(e=>{if("string"!=typeof e)throw new TypeError("Each property name must be a string.");n.forEach(t=>{(void 0===r?!t[P.getPropName(e)]:r)?P.addProp(t,e):P.removeProp(t,e)})}),e}toggleProp(e,t){return P.toggleProp(this,e,t)}static prop(e,t){if("string"!=typeof t)throw new TypeError('Invalid arguments passed to prop(). Expected string for "name".');return P._preElem(e,"prop")[t]}prop(e){return P.prop(this,e)}static setProp(e,t,r){if("string"!=typeof t||""===t.trim())throw new Error("Property name must be a non-empty string.");return P._preElems(e,"setProp").forEach(e=>{e[t]=r}),e}setProp(e,t){return P.setProp(this,e,t)}static remove(e){return P._preElems(e,"remove").forEach(e=>e.remove()),e}remove(){return P.remove(this)}static index(e,t=null){const r=P._preElem(e,"index");if(!r)return-1;if(!t)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(t){const e="string"==typeof t?document.querySelectorAll(t):P._preElems(t,"index");return Array.prototype.indexOf.call(e,r)}return-1}index(e){return P.index(this,e)}static _getCustomRect(e,t){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const t in e)"number"==typeof e[t]&&(r[t]=e[t]);if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("extraRect must be a non-null object.");const{height:n=0,width:o=0,top:i=0,bottom:s=0,left:a=0,right:l=0}=t;if("number"!=typeof n)throw new Error("extraRect.height must be a number.");if("number"!=typeof o)throw new Error("extraRect.width must be a number.");if("number"!=typeof i)throw new Error("extraRect.top must be a number.");if("number"!=typeof s)throw new Error("extraRect.bottom must be a number.");if("number"!=typeof a)throw new Error("extraRect.left must be a number.");if("number"!=typeof l)throw new Error("extraRect.right must be a number.");return r.height+=n,r.width+=o,r.top+=i,r.bottom+=s,r.left+=a,r.right+=l,r}static isCollWith(e,t,r={}){const n=P._getCustomRect(P._preElem(e,"isCollWith").getBoundingClientRect(),r),o=P._preElem(t,"isCollWith").getBoundingClientRect();return L(n,o)}isCollWith(e,t){return P.isCollWith(this,e,t)}static isCollPerfWith(e,t,r={}){const n=P._getCustomRect(P._preElem(e,"isCollPerfWith").getBoundingClientRect(),r),o=P._preElem(t,"isCollPerfWith").getBoundingClientRect();return C(n,o)}isCollPerfWith(e,t){return P.isCollPerfWith(this,e,t)}static _isCollWithLock(e,t,r,n,o){const i=D[o];if(e)return i.has(n)||i.set(n,!0),!0;if(i.has(n)){let e=!1;switch(o){case"top":e=N(t,r);break;case"bottom":e=k(t,r);break;case"left":e=B(t,r);break;case"right":e=R(t,r)}return e&&i.delete(n),i.has(n)}return!1}static isCollWithLock(e,t,r,n={}){const o=P._preElem(e,"isCollWithLock"),i=P._preElem(t,"isCollWithLock"),s=P._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=L(s,a);return P._isCollWithLock(l,s,a,o,r)}isCollWithLock(e,t,r){return P.isCollWithLock(this,e,t,r)}static isCollPerfWithLock(e,t,r,n={}){const o=P._preElem(e,"isCollPerfWithLock"),i=P._preElem(t,"isCollPerfWithLock"),s=P._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=C(s,a);return P._isCollWithLock(l,s,a,o,r)}isCollPerfWithLock(e,t,r){return P.isCollPerfWithLock(this,e,t,r)}static resetCollLock(e){const t=P._preElem(e,"resetCollLock");let r=!1;for(const e of["top","bottom","left","right"])D[e].has(t)&&(D[e].delete(t),r=!0);return r}resetCollLock(){return P.resetCollLock(this)}static resetCollLockDir(e,t){const r=P._preElem(e,"resetCollLockDir"),n=D[t];return!!n.has(r)&&(n.delete(r),!0)}resetCollLockDir(e){return P.resetCollLockDir(this,e)}static isInViewport(e){const t=P._preElem(e,"isInViewport");if(!t.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=P.offset(t).top,n=r+P.outerHeight(t),o=P.scrollTop(window),i=o+P.height(window);return n>o&&r<i}isInViewport(){return P.isInViewport(this)}static isScrolledIntoView(e){const t=P._preElem(e,"isScrolledIntoView");if(!t.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=P.scrollTop(window),n=r+P.height(window),o=P.offset(t).top;return o+P.height(t)<=n&&o>=r}isScrolledIntoView(){return P.isScrolledIntoView(this)}static isInContainer(e,t){const r=P._preElem(e,"isInContainer"),n=P._preElem(t,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect(),s=o.bottom>i.top&&o.top<i.bottom,a=o.right>i.left&&o.left<i.right;return s&&a}isInContainer(e){return P.isInContainer(this,e)}static isFullyInContainer(e,t){const r=P._preElem(e,"isScrolledIntoView"),n=P._preElem(t,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect();return o.top>=i.top&&o.bottom<=i.bottom&&o.left>=i.left&&o.right<=i.right}isFullyInContainer(e){return P.isFullyInContainer(this,e)}static hasScroll(e){const t=P._preElem(e,"hasScroll");return{v:t.scrollHeight>t.clientHeight,h:t.scrollWidth>t.clientWidth}}hasScroll(){return P.hasScroll(this)}}const W=class{#T=new Map;#v=10;#A=!1;#S(e,t){if("string"==typeof e)return[e];if(Array.isArray(e)&&e.every(e=>"string"==typeof e))return e;throw new TypeError(`${t}(event): event must be a string or string[]`)}setThrowOnMaxListeners(e){if("boolean"!=typeof e)throw new TypeError("setThrowOnMaxListeners(value): value must be a boolean");this.#A=e}getThrowOnMaxListeners(){return this.#A}#_(e,t,{once:r=!1}={}){let n=this.#T.get(e);Array.isArray(n)||(n=[],this.#T.set(e,n)),n.unshift({handler:t,config:{once:r}});const o=this.#v;if(o>0&&n.length>o){const t=`Possible memory leak detected. ${n.length} "${e}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#A)throw new Error(t);console.warn(t)}}prependListener(e,t){const r=this.#S(e,"prependListener");if("function"!=typeof t)throw new TypeError("prependListener(event, handler): handler must be a function");for(const e of r)this.#_(e,t)}prependListenerOnce(e,t){const r=this.#S(e,"prependListenerOnce");if("function"!=typeof t)throw new TypeError("prependListenerOnce(event, handler): handler must be a function");const n=[];for(const e of r){const r=(...n)=>{this.off(e,r),t(...n)};this.#_(e,r,{once:!0}),n.push(r)}return n}#x(e,t,{once:r=!1}={}){const n=this.#S(e,"on");for(const e of n){let n=this.#T.get(e);Array.isArray(n)||(n=[],this.#T.set(e,n)),n.push({handler:t,config:{once:r}});const o=this.#v;if(o>0&&n.length>o){const t=`Possible memory leak detected. ${n.length} "${e}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#A)throw new Error(t);console.warn(t)}}}on(e,t){if("function"!=typeof t)throw new TypeError("on(event, handler): handler must be a function");return this.#x(e,t)}once(e,t){const r=this.#S(e,"once");if("function"!=typeof t)throw new TypeError("once(event, handler): handler must be a function");const n=[];for(const e of r){const r=(...n)=>{this.off(e,r),t(...n)};this.#x(e,r,{once:!0}),n.push(r)}return n}appendListener(e,t){return this.on(e,t)}appendListenerOnce(e,t){return this.once(e,t)}off(e,t){const r=this.#S(e,"off");if("function"!=typeof t)throw new TypeError("off(event, handler): handler must be a function");for(const e of r){const r=this.#T.get(e);if(!Array.isArray(r))continue;const n=r.findIndex(e=>e.handler===t);-1!==n&&r.splice(n,1),0===r.length&&this.#T.delete(e)}}offAll(e){const t=this.#S(e,"offAll");for(const e of t)this.#T.delete(e)}offAllTypes(){this.#T.clear()}listenerCount(e){if("string"!=typeof e)throw new TypeError("listenerCount(event): event name must be a string");const t=this.#T.get(e);return Array.isArray(t)?t.length:0}listeners(e){if("string"!=typeof e)throw new TypeError("listeners(event): event name must be a string");const t=this.#T.get(e);return Array.isArray(t)?[...t].filter(e=>!e.config.once).map(e=>e.handler):[]}onceListeners(e){if("string"!=typeof e)throw new TypeError("onceListeners(event): event name must be a string");const t=this.#T.get(e);return Array.isArray(t)?[...t].filter(e=>e.config.once).map(e=>e.handler):[]}allListeners(e){if("string"!=typeof e)throw new TypeError("allListeners(event): event name must be a string");const t=this.#T.get(e);return Array.isArray(t)?[...t].map(e=>e.handler):[]}eventNames(){return[...this.#T.keys()]}emit(e,...t){const r=this.#S(e,"emit"),n=[];for(const e of r){const r=this.#T.get(e);Array.isArray(r)&&0!==r.length?(r.forEach(e=>e.handler(...t)),n.push(!0)):n.push(!1)}return n}setMaxListeners(e){if(!Number.isInteger(e)||e<0)throw new TypeError("setMaxListeners(n): n must be a non-negative integer");this.#v=e}getMaxListeners(){return this.#v}},F=new Map,U=new Map,j=new Set(["string","boolean","object","array",String,Boolean,Number,Object,Array,BigInt,Symbol]);class ${#L=new W;setThrowOnMaxListeners(e){return this.#L.setThrowOnMaxListeners(e)}getThrowOnMaxListeners(){return this.#L.getThrowOnMaxListeners()}prependListener(e,t){return this.#L.prependListener(e,t)}prependListenerOnce(e,t){return this.#L.prependListenerOnce(e,t)}appendListener(e,t){return this.#L.appendListener(e,t)}appendListenerOnce(e,t){return this.#L.appendListenerOnce(e,t)}on(e,t){return this.#L.on(e,t)}once(e,t){return this.#L.once(e,t)}off(e,t){return this.#L.off(e,t)}offAll(e){return this.#L.offAll(e)}offAllTypes(){return this.#L.offAllTypes()}listenerCount(e){return this.#L.listenerCount(e)}listeners(e){return this.#L.listeners(e)}onceListeners(e){return this.#L.onceListeners(e)}allListeners(e){return this.#L.allListeners(e)}eventNames(){return this.#L.eventNames()}emit(e,...t){return this.#L.emit(e,...t)}setMaxListeners(e){return this.#L.setMaxListeners(e)}getMaxListeners(){return this.#L.getMaxListeners()}static hasJsonType(e){return F.has(e)&&U.has(e)||j.has(e)}static registerJsonType(e,t,r,n=!1){if(j.has(e))throw new Error(`Cannot register type "${e}" because it is frozen.`);F.set(e,t),U.set(e,r),n&&j.add(e)}static deleteJsonType(e){if(j.has(e))throw new Error(`Cannot remove type "${e}" because it is frozen.`);let t=!1;return F.delete(e)&&(t=!0),U.delete(e)&&(t=!0),t}static encodeSpecialJson(e){if(void 0===e)return{__undefined__:!0};if(null===e)return{__null__:!0};for(const[t,r]of F.entries())if("string"!=typeof t&&e instanceof t||typeof e===t)return r(e,$.encodeSpecialJson);if(Array.isArray(e))return e.map($.encodeSpecialJson);if(o(e)){const t={};for(const r in e)t[r]=$.encodeSpecialJson(e[r]);return t}return e}static decodeSpecialJson(e){const t=o(e);if(t){if(e.__undefined__)return;if(e.__null__)return null}if(Array.isArray(e))return e.map($.decodeSpecialJson);if(t){for(const[t,r]of U.entries())if(r.check&&r.check(e))return r.decode(e,$.decodeSpecialJson);const t={};for(const r in e)t[r]=$.decodeSpecialJson(e[r]);return t}return e}#C=window.localStorage;#N=null;#k=0;#B=e=>this.emit("storage",e);constructor(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("TinyLocalStorage: dbName must be a string if provided.");"string"==typeof e&&(this.#N=`LSDB::${e}`),window.addEventListener("storage",this.#B)}#R(e){if("string"==typeof e&&e.startsWith("LSDB::"))throw new Error(`TinyLocalStorage: Key "${e}" may conflict with reserved dbKeys.`)}updateStorageVersion(e,t){if("string"!=typeof this.#N)throw new Error("TinyLocalStorage: Database key is not initialized. Set a valid dbName in the constructor.");if("number"!=typeof e||Number.isNaN(e)||e<1)throw new TypeError("TinyLocalStorage: version must be a positive number.");if("function"!=typeof t)throw new TypeError("TinyLocalStorage: onUpgrade must be a function.");const r=parseInt(localStorage.getItem(this.#N),10)||0;if("number"!=typeof r||Number.isNaN(r)||r<0)throw new TypeError("TinyLocalStorage: saved version in localStorage is not a valid number.");if(e<r)throw new Error(`TinyLocalStorage: Cannot downgrade database version from ${r} to ${e}.`);e>r&&(t(r,e),localStorage.setItem(this.#N,String(e)),this.#k=e)}getDbKey(){return this.#N}getVersion(){return this.#k}setLocalStorage(e){if(!(e instanceof Storage))throw new TypeError("Argument must be a valid instance of Storage.");this.#C=e}localStorageExists(){return this.#C instanceof Storage}#H(e,t){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return $.encodeSpecialJson(t)}setJson(e,t){if(this.#R(e),!(o(t)||Array.isArray(t)||t instanceof Map||t instanceof Set))throw new TypeError("The storage value is not a valid JSON-compatible structure.");const r=this.#H(e,t);return this.emit("setJson",e,t),this.#C.setItem(e,JSON.stringify(r))}#I(e,t){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");const r=this.#C.getItem(e),n={obj:()=>({}),array:()=>[],map:()=>new Map,set:()=>new Set},o="function"==typeof n[t]?n[t]():null;let i;try{i=JSON.parse(r)}catch{return o}return{decoded:$.decodeSpecialJson(i),fallback:o}}getJson(e,t){const{decoded:r,fallback:n}=this.#I(e,t);return r instanceof Map||r instanceof Set||Array.isArray(r)||o(r)?r:n}setDate(e,t){if(this.#R(e),!(t instanceof Date))throw new TypeError("Value must be a Date.");const r=this.#H(e,t);return this.emit("setDate",e,t),this.#C.setItem(e,JSON.stringify(r))}getDate(e){const t=this.#I(e).decoded;return t instanceof Date?t:null}setRegExp(e,t){if(this.#R(e),!(t instanceof RegExp))throw new TypeError("Value must be a RegExp.");const r=this.#H(e,t);return this.emit("setRegExp",e,t),this.#C.setItem(e,JSON.stringify(r))}getRegExp(e){const t=this.#I(e).decoded;return t instanceof RegExp?t:null}setBigInt(e,t){if(this.#R(e),"bigint"!=typeof t)throw new TypeError("Value must be a BigInt.");const r=this.#H(e,t);return this.emit("setBigInt",e,t),this.#C.setItem(e,JSON.stringify(r))}getBigInt(e){const t=this.#I(e).decoded;return"bigint"==typeof t?t:null}setSymbol(e,t){if(this.#R(e),"symbol"!=typeof t)throw new TypeError("Value must be a Symbol.");const r=this.#H(e,t);return this.emit("setSymbol",e,t),this.#C.setItem(e,JSON.stringify(r))}getSymbol(e){const t=this.#I(e).decoded;return"symbol"==typeof t?t:null}getValue(e){return this.#I(e).decoded??null}setItem(e,t){if(this.#R(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.emit("setItem",e,t),this.#C.setItem(e,t)}getItem(e){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.#C.getItem(e)}setString(e,t){if(this.#R(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("string"!=typeof t)throw new TypeError("Value must be a string.");return this.emit("setString",e,t),this.#C.setItem(e,JSON.stringify({__string__:!0,value:t}))}getString(e){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");let t=this.#C.getItem(e);try{if(t=JSON.parse(t),!o(t)||!t.__string__||"string"!=typeof t.value)return null;t=t.value}catch{t=null}return"string"==typeof t?t:null}setNumber(e,t){if(this.#R(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("number"!=typeof t)throw new TypeError("Value must be a number.");return this.emit("setNumber",e,t),this.#C.setItem(e,String(t))}getNumber(e){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");let t=this.#C.getItem(e);return"number"==typeof t||"string"==typeof t&&t.length>0&&(t=parseFloat(t),!Number.isNaN(t))?t:null}setBool(e,t){if(this.#R(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("boolean"!=typeof t)throw new TypeError("Value must be a boolean.");return this.emit("setBool",e,t),this.#C.setItem(e,String(t))}getBool(e){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");const t=this.#C.getItem(e);if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}return null}removeItem(e){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.emit("removeItem",e),this.#C.removeItem(e)}clearLocalStorage(){return this.#C.clear()}destroy(){window.removeEventListener("storage",this.#B),this.#L.offAllTypes()}}$.registerJsonType(Map,(e,t)=>({__map__:!0,data:Array.from(e.entries()).map(([e,r])=>[e,t(r)])}),{check:e=>e.__map__,decode:(e,t)=>new Map(e.data.map(([e,r])=>[e,t(r)]))},!0),$.registerJsonType(Set,(e,t)=>({__set__:!0,data:Array.from(e).map(t)}),{check:e=>e.__set__,decode:(e,t)=>new Set(e.data.map(t))},!0),$.registerJsonType(Date,e=>({__date__:!0,value:e.toISOString()}),{check:e=>e.__date__,decode:e=>new Date(e.value)},!0),$.registerJsonType(RegExp,e=>({__regexp__:!0,source:e.source,flags:e.flags}),{check:e=>e.__regexp__,decode:e=>new RegExp(e.source,e.flags)},!0),$.registerJsonType("number",e=>({__number__:!0,value:e.toString()}),{check:e=>e.__number__,decode:e=>Number(e.value)},!0),$.registerJsonType("bigint",e=>({__bigint__:!0,value:e.toString()}),{check:e=>e.__bigint__,decode:e=>BigInt(e.value)},!0),$.registerJsonType("symbol",e=>({__symbol__:!0,key:Symbol.keyFor(e)??e.description??null}),{check:e=>e.__symbol__,decode:e=>{const t=e.key;return null!=t?Symbol.for(t):Symbol()}},!0),new WeakMap,new WeakMap,new Map;class J{static#O=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;static#M=/^#([A-Fa-f0-9]{8})$/;static#D="(0|1|0?\\.\\d+)";static#P="(0|[1-9]\\d?|1\\d{2}|2[0-4]\\d|25[0-5])";static#W="(0|[1-9]\\d?|[1-2]\\d{2}|3[0-5]\\d|360)";static#F="(0|[1-9]?\\d|100)";static#U=new RegExp(`^rgb\\(\\s*${J.#P}\\s*,\\s*${J.#P}\\s*,\\s*${J.#P}\\s*\\)$`);static#j=new RegExp(`^rgba\\(\\s*${J.#P}\\s*,\\s*${J.#P}\\s*,\\s*${J.#P}\\s*,\\s*${J.#D}\\s*\\)$`);static#$=new RegExp(`^hsl\\(\\s*${J.#W}\\s*,\\s*${J.#F}%\\s*,\\s*${J.#F}%\\s*\\)$`);static#J=new RegExp(`^hsla\\(\\s*${J.#W}\\s*,\\s*${J.#F}%\\s*,\\s*${J.#F}%\\s*,\\s*${J.#D}\\s*\\)$`);static#V=new RegExp(`^hwb\\(\\s*${J.#W}(deg|grad|rad|turn)?\\s*${J.#F}%\\s*${J.#F}%\\s*\\)$`);static#X="(-?\\d+)";static#z=new RegExp(`^lab\\(\\s*${J.#F}%?\\s*${J.#X}%?\\s*${J.#X}%?\\s*\\)$`);static#K=new RegExp(`^lch\\(\\s*${J.#F}%?\\s*${J.#F}%?\\s*${J.#W}(deg|grad|rad|turn)?\\s*\\)$`);static#G=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);static#Y=new Set(["transparent","currentColor"]);static getNames(){return Array.from(J.#G)}static addName(e){const t=J.#G.size;return J.#G.add(e.toLowerCase()),J.#G.size>t}static removeName(e){return J.#G.delete(e.toLowerCase())}static hasName(e){return J.#G.has(e.toLowerCase())}static getSpecialNames(){return Array.from(J.#Y)}static addSpecialName(e){const t=J.#Y.size;return J.#Y.add(e),J.#Y.size>t}static removeSpecialName(e){return J.#Y.delete(e)}static hasSpecialName(e){return J.#Y.has(e)}#q;get code(){return this.#q}#Q;get type(){return this.#Q}constructor(e){this.#q=e,this.#Q=J.isColor(this.#q)}static isHex(e){if("string"!=typeof e)throw new TypeError("isHex: input must be a string.");return J.#O.test(e.trim())}isHex(){return J.isHex(this.#q)}static isHexa(e){if("string"!=typeof e)throw new TypeError("isHexa: input must be a string.");return J.#M.test(e.trim())}isHexa(){return J.isHexa(this.#q)}static isRgb(e){if("string"!=typeof e)throw new TypeError("isRgb: input must be a string.");return J.#U.test(e.trim())}isRgb(){return J.isRgb(this.#q)}static isRgba(e){if("string"!=typeof e)throw new TypeError("isRgba: input must be a string.");return J.#j.test(e.trim())}isRgba(){return J.isRgba(this.#q)}static isHsl(e){if("string"!=typeof e)throw new TypeError("isHsl: input must be a string.");return J.#$.test(e.trim())}isHsl(){return J.isHsl(this.#q)}static isHsla(e){if("string"!=typeof e)throw new TypeError("isHsla: input must be a string.");return J.#J.test(e.trim())}isHsla(){return J.isHsla(this.#q)}static isHwb(e){if("string"!=typeof e)throw new TypeError("isHwb: input must be a string.");return J.#V.test(e.trim())}isHwb(){return J.isHwb(this.#q)}static isLab(e){if("string"!=typeof e)throw new TypeError("isLab: input must be a string.");return J.#z.test(e.trim())}isLab(){return J.isLab(this.#q)}static isLch(e){if("string"!=typeof e)throw new TypeError("isLch: input must be a string.");return J.#K.test(e.trim())}isLch(){return J.isLch(this.#q)}static isName(e){if("string"!=typeof e)throw new TypeError("isName: input must be a string.");return J.#G.has(e.trim().toLowerCase())}isName(){return J.isName(this.#q)}static isSpecialName(e){if("string"!=typeof e)throw new TypeError("isSpecialName: input must be a string.");return J.#Y.has(e.trim())}isSpecialName(){return J.isSpecialName(this.#q)}static isColor(e){if("string"!=typeof e)throw new TypeError("isColor: input must be a string.");return J.isHex(e)?"hex":J.isHexa(e)?"hexa":J.isRgb(e)?"rgb":J.isRgba(e)?"rgba":J.isHsl(e)?"hsl":J.isHsla(e)?"hsla":J.isHwb(e)?"hwb":J.isLab(e)?"lab":J.isLch(e)?"lch":J.isName(e)?"name":J.isSpecialName(e)?"specialName":null}parse(){switch(this.#Q){case"hex":return J.parseHex(this.code);case"hexa":return J.parseHexa(this.code);case"rgb":return J.parseRgb(this.code);case"rgba":return J.parseRgba(this.code);case"hsl":return J.parseHsl(this.code);case"hsla":return J.parseHsla(this.code);case"hwb":return J.parseHwb(this.code);case"lab":return J.parseLab(this.code);case"lch":return J.parseLch(this.code);case"name":case"specialName":return this.#q.trim().toLowerCase();default:return null}}static parseHex(e){if("string"!=typeof e)throw new TypeError("parseHex: input must be a string.");const t=new RegExp(J.#O,"gm").exec(e.trim());return t?t[1]:null}parseHex(){return J.parseHex(this.#q)}static parseHexa(e){if("string"!=typeof e)throw new TypeError("parseHexa: input must be a string.");const t=new RegExp(J.#M,"gm").exec(e.trim());return t?t[1]:null}parseHexa(){return J.parseHexa(this.#q)}static parseRgb(e){if("string"!=typeof e)throw new TypeError("parseRgb: input must be a string.");const t=new RegExp(J.#U,"gm").exec(e.trim());return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:null}parseRgb(){return J.parseRgb(this.#q)}static parseRgba(e){if("string"!=typeof e)throw new TypeError("parseRgba: input must be a string.");const t=new RegExp(J.#j,"gm").exec(e.trim());return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4])]:null}parseRgba(){return J.parseRgba(this.#q)}static parseHsl(e){if("string"!=typeof e)throw new TypeError("parseHsl: input must be a string.");const t=new RegExp(J.#$,"gm").exec(e.trim());return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:null}parseHsl(){return J.parseHsl(this.#q)}static parseHsla(e){if("string"!=typeof e)throw new TypeError("parseHsla: input must be a string.");const t=new RegExp(J.#J,"gm").exec(e.trim());return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4])]:null}parseHsla(){return J.parseHsla(this.#q)}static parseHwb(e){if("string"!=typeof e)throw new TypeError("parseHwb: input must be a string.");const t=new RegExp(J.#V,"gm").exec(e.trim());return t?[parseFloat(t[1]),t[2]??null,parseFloat(t[3]),parseFloat(t[4])]:null}parseHwb(){return J.parseHwb(this.#q)}static parseLab(e){if("string"!=typeof e)throw new TypeError("parseLab: input must be a string.");const t=new RegExp(J.#z,"gm").exec(e.trim());return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:null}parseLab(){return J.parseLab(this.#q)}static parseLch(e){if("string"!=typeof e)throw new TypeError("parseLch: input must be a string.");const t=new RegExp(J.#K,"gm").exec(e.trim());return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),t[4]??null]:null}parseLch(){return J.parseLch(this.#q)}}const V=class{#Z;#ee=[];#te=new WeakMap;#re;constructor(e){if(!o(e))throw new TypeError('TinyUploadClicker: "options" must be a valid object.');this.#Z={multiple:!1,accept:"",inputAttributes:{},inputStyles:{display:"none"},onClick:null,onFileLoad:null,...e};const{triggers:t}=e;if(!(Array.isArray(t)||"string"==typeof t||t instanceof HTMLElement))throw new TypeError('TinyUploadClicker: "triggers" is required and must be a string, HTMLElement, or an array of them.');const r=(Array.isArray(this.#Z.triggers)?this.#Z.triggers:[this.#Z.triggers]).map(e=>{if("string"==typeof e){const t=document.querySelector(e);if(!t)throw new Error(`TinyUploadClicker: No element found for selector "${e}".`);return t}if(!(e instanceof HTMLElement))throw new TypeError("TinyUploadClicker: All triggers must be either strings (selectors) or HTMLElements.");return e});if(void 0!==e.accept&&"string"!=typeof e.accept&&!Array.isArray(e.accept))throw new TypeError('TinyUploadClicker: "accept" must be a string or an array of strings.');if(void 0!==e.onClick&&"function"!=typeof e.onClick&&null!==e.onClick)throw new TypeError('TinyUploadClicker: "onClick" must be a function or null.');if(void 0!==e.onFileLoad&&"function"!=typeof e.onFileLoad&&null!==e.onFileLoad)throw new TypeError('TinyUploadClicker: "onFileLoad" must be a function or null.');if(void 0!==e.inputAttributes&&!o(e.inputAttributes))throw new TypeError('TinyUploadClicker: "inputAttributes" must be an object.');if(void 0!==e.inputStyles&&!o(e.inputStyles))throw new TypeError('TinyUploadClicker: "inputStyles" must be an object.');this.#re=this.#ne.bind(this),this.#ee=r,this.#ee.forEach(e=>{if(!(e instanceof HTMLElement))return;const t=document.createElement("input");t.type="file",this.#Z.multiple&&(t.multiple=!0),"string"==typeof this.#Z.accept?t.accept=this.#Z.accept:Array.isArray(this.#Z.accept)&&(t.accept=this.#Z.accept.join(","));const r=this.#Z.inputAttributes;if(r&&"object"==typeof r)for(const[e,n]of Object.entries(r))t.setAttribute(e,n);Object.assign(t.style,this.#Z.inputStyles||{display:"none"}),t.addEventListener("change",()=>{t.files&&"function"==typeof this.#Z.onFileLoad&&this.#Z.onFileLoad(t.files,e),t.value=""}),document.body.appendChild(t),this.#te.set(e,t),e.addEventListener("click",this.#re)})}#ne(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const r=this.#te.get(t);r&&("function"==typeof this.#Z.onClick&&this.#Z.onClick(t),r.click())}destroy(){for(const e of this.#ee){if(!(e instanceof HTMLElement))return;e.removeEventListener("click",this.#re);const t=this.#te.get(e);t&&t.parentNode&&t.remove(),this.#te.delete(e)}this.#ee=[]}}})(),window.TinyUploadClicker=n.TinyUploadClicker})();