tiny-essentials 1.11.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +12 -3
  2. package/dist/node_modules/firebase-functions/lib/common/trace.cjs +82 -0
  3. package/dist/node_modules/firebase-functions/lib/logger/common.cjs +57 -0
  4. package/dist/node_modules/firebase-functions/lib/logger/index.cjs +158 -0
  5. package/dist/v1/TinyBasicsEs.js +1653 -1
  6. package/dist/v1/TinyBasicsEs.min.js +1 -1
  7. package/dist/v1/TinyDragDropDetector.js +307 -0
  8. package/dist/v1/TinyDragDropDetector.min.js +1 -0
  9. package/dist/v1/TinyDragger.js +3668 -0
  10. package/dist/v1/TinyDragger.min.js +2 -0
  11. package/dist/v1/TinyDragger.min.js.LICENSE.txt +8 -0
  12. package/dist/v1/TinyEssentials.js +2888 -2
  13. package/dist/v1/TinyEssentials.min.js +1 -1
  14. package/dist/v1/TinyNotifyCenter.js +32 -0
  15. package/dist/v1/TinyNotifyCenter.min.js +1 -1
  16. package/dist/v1/TinyToastNotify.js +24 -0
  17. package/dist/v1/TinyToastNotify.min.js +1 -1
  18. package/dist/v1/TinyUploadClicker.js +5340 -0
  19. package/dist/v1/TinyUploadClicker.min.js +2 -0
  20. package/dist/v1/TinyUploadClicker.min.js.LICENSE.txt +8 -0
  21. package/dist/v1/basics/fileManager.cjs +524 -0
  22. package/dist/v1/basics/fileManager.d.mts +209 -0
  23. package/dist/v1/basics/fileManager.mjs +443 -0
  24. package/dist/v1/basics/fullScreen.cjs +134 -0
  25. package/dist/v1/basics/fullScreen.d.mts +8 -0
  26. package/dist/v1/basics/fullScreen.mjs +121 -0
  27. package/dist/v1/basics/html.cjs +262 -0
  28. package/dist/v1/basics/html.d.mts +63 -0
  29. package/dist/v1/basics/html.mjs +208 -0
  30. package/dist/v1/basics/index.cjs +40 -0
  31. package/dist/v1/basics/index.d.mts +38 -1
  32. package/dist/v1/basics/index.mjs +4 -1
  33. package/dist/v1/build/TinyDragDropDetector.cjs +7 -0
  34. package/dist/v1/build/TinyDragDropDetector.d.mts +3 -0
  35. package/dist/v1/build/TinyDragDropDetector.mjs +2 -0
  36. package/dist/v1/build/TinyDragger.cjs +7 -0
  37. package/dist/v1/build/TinyDragger.d.mts +3 -0
  38. package/dist/v1/build/TinyDragger.mjs +2 -0
  39. package/dist/v1/build/TinyUploadClicker.cjs +7 -0
  40. package/dist/v1/build/TinyUploadClicker.d.mts +3 -0
  41. package/dist/v1/build/TinyUploadClicker.mjs +2 -0
  42. package/dist/v1/css/TinyDraggerExample.css +21 -0
  43. package/dist/v1/css/TinyDraggerExample.min.css +1 -0
  44. package/dist/v1/index.cjs +44 -0
  45. package/dist/v1/index.d.mts +40 -1
  46. package/dist/v1/index.mjs +6 -1
  47. package/dist/v1/libs/TinyDragDropDetector.cjs +268 -0
  48. package/dist/v1/libs/TinyDragDropDetector.d.mts +123 -0
  49. package/dist/v1/libs/TinyDragDropDetector.mjs +228 -0
  50. package/dist/v1/libs/TinyDragger.cjs +906 -0
  51. package/dist/v1/libs/TinyDragger.d.mts +316 -0
  52. package/dist/v1/libs/TinyDragger.mjs +783 -0
  53. package/dist/v1/libs/TinyNotifyCenter.cjs +32 -0
  54. package/dist/v1/libs/TinyNotifyCenter.d.mts +9 -0
  55. package/dist/v1/libs/TinyNotifyCenter.mjs +28 -0
  56. package/dist/v1/libs/TinyToastNotify.cjs +24 -0
  57. package/dist/v1/libs/TinyToastNotify.d.mts +8 -0
  58. package/dist/v1/libs/TinyToastNotify.mjs +20 -0
  59. package/dist/v1/libs/TinyUploadClicker.cjs +223 -0
  60. package/dist/v1/libs/TinyUploadClicker.d.mts +80 -0
  61. package/dist/v1/libs/TinyUploadClicker.mjs +182 -0
  62. package/docs/v1/README.md +8 -2
  63. package/docs/v1/basics/fileManager.md +222 -0
  64. package/docs/v1/basics/fullScreen.md +183 -0
  65. package/docs/v1/basics/html.md +243 -0
  66. package/docs/v1/libs/TinyDragDropDetector.md +143 -0
  67. package/docs/v1/libs/TinyDragger.md +430 -0
  68. package/docs/v1/libs/TinyLevelUp.md +1 -1
  69. package/docs/v1/libs/TinyNotifyCenter.md +20 -0
  70. package/docs/v1/libs/TinyToastNotify.md +19 -0
  71. package/docs/v1/libs/TinyUploadClicker.md +108 -0
  72. package/package.json +12 -2
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see TinyBasicsEs.min.js.LICENSE.txt */
2
- (()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,u,f=8*o-n-1,s=(1<<f)-1,a=s>>1,h=-7,c=r?o-1:0,l=r?-1:1,p=t[e+c];for(c+=l,i=p&(1<<-h)-1,p>>=-h,h+=f;h>0;i=256*i+t[e+c],c+=l,h-=8);for(u=i&(1<<-h)-1,i>>=-h,h+=n;h>0;u=256*u+t[e+c],c+=l,h-=8);if(0===i)i=1-a;else{if(i===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=a}return(p?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,f,s,a=8*i-o-1,h=(1<<a)-1,c=h>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=h?(f=0,u=h):u+c>=1?(f=(e*s-1)*Math.pow(2,o),u+=c):(f=e*Math.pow(2,c-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&f,p+=y,f/=256,o-=8);for(u=u<<o|f,a+=o;a>0;t[r+p]=255&u,p+=y,u/=256,a-=8);t[r+p-y]|=128*g}},287:(t,e,r)=>{"use strict";var n=r(526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=s,e.IS=50;var u=2147483647;function f(t){if(t>u)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(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 c(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|g(t,e),n=f(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(_(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return l(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(_(t,ArrayBuffer)||t&&_(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(_(t,SharedArrayBuffer)||t&&_(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,e,r);var o=function(t){if(s.isBuffer(t)){var e=0|y(t.length),r=f(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||z(t.length)?f(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.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 h(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 c(t){return h(t),f(t<0?0:0|y(t))}function l(t){for(var e=t.length<0?0:0|y(t.length),r=f(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,s.prototype),n}function y(t){if(t>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|t}function g(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||_(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(o)return n?-1:P(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return U(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(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),z(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=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,u=1,f=t.length,s=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;u=2,f/=2,s/=2,r/=2}function a(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var h=-1;for(i=r;i<f;i++)if(a(t,i)===a(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===s)return h*u}else-1!==h&&(i-=i-h),h=-1}else for(r+s>f&&(r=f-s),i=r;i>=0;i--){for(var c=!0,l=0;l<s;l++)if(a(t,i+l)!==a(e,l)){c=!1;break}if(c)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var u=0;u<n;++u){var f=parseInt(e.substr(2*u,2),16);if(z(f))return u;t[r+u]=f}return u}function E(t,e,r,n){return Y(P(e,t.length-r),t,r,n)}function A(t,e,r,n){return Y(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function B(t,e,r,n){return Y(F(e),t,r,n)}function T(t,e,r,n){return Y(function(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)n=(r=t.charCodeAt(u))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function U(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,u,f,s,a=t[o],h=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(s=(15&a)<<12|(63&i)<<6|63&u)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=t[o+1],u=t[o+2],f=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&f)&&(s=(15&a)<<18|(63&i)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=O));return r}(n)}s.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}}(),s.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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?f(t):void 0!==e?"string"==typeof r?f(t).fill(e,r):f(t).fill(e):f(t)}(t,e,r)},s.allocUnsafe=function(t){return c(t)},s.allocUnsafeSlow=function(t){return c(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(_(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),_(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.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},s.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}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(_(i,Uint8Array))o+i.length>n.length?s.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!s.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},s.byteLength=g,s.prototype._isBuffer=!0,s.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)w(this,e,e+1);return this},s.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)w(this,e,e+3),w(this,e+1,e+2);return this},s.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)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):d.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.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&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,o){if(_(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.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),u=(r>>>=0)-(e>>>=0),f=Math.min(i,u),a=this.slice(n,o),h=t.slice(e,r),c=0;c<f;++c)if(a[c]!==h[c]){i=a[c],u=h[c];break}return i<u?-1:u<i?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return B(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function S(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 L(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+=H[t[i]];return o}function C(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 x(t,e,r,n,o,i){if(!s.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 j(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 R(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,8),o.write(t,e,r,n,52,8),r+8}s.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,s.prototype),n},s.prototype.readUintLE=s.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},s.prototype.readUintBE=s.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},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.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]},s.prototype.readUint32BE=s.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])},s.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},s.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},s.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.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},s.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},s.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},s.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]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(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},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(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},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(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},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(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},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=0,u=1,f=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===f&&0!==this[e+i-1]&&(f=1),this[e+i]=(t/u|0)-f&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=r-1,u=1,f=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===f&&0!==this[e+i+1]&&(f=1),this[e+i]=(t/u|0)-f&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(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},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(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},s.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.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},s.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&&!s.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 u=s.isBuffer(t)?t:s.from(t,n),f=u.length;if(0===f)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=u[i%f]}return this};var k=/[^+/0-9A-Za-z-_]/g;function P(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+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 F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(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 _(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function z(t){return t!=t}var H=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=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=f(t),u=i[0],s=i[1],a=new o(function(t,e,r){return 3*(e+r)/4-r}(0,u,s)),h=0,c=s>0?u-4:u;for(r=0;r<c;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)],a[h++]=e>>16&255,a[h++]=e>>8&255,a[h++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,a[h++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,a[h++]=e>>8&255,a[h++]=255&e),a},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],u=16383,f=0,a=n-o;f<a;f+=u)i.push(s(t,f,f+u>a?a:f+u));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+/",u=0;u<64;++u)r[u]=i[u],n[i.charCodeAt(u)]=u;function f(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 s(t,e,n){for(var o,i,u=[],f=e;f<n;f+=3)o=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(255&t[f+2]),u.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return u.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";function t(t,e=!1){return e?function(e,r){return e[t]>r[t]?-1:e[t]<r[t]?1:0}:function(e,r){return e[t]<r[t]?-1:e[t]>r[t]?1:0}}async function e(t,e,r){const n=[];t.replace(e,((t,...e)=>(n.push(r(t,...e)),t)));const o=await Promise.all(n);return t.replace(e,(()=>o.shift()))}function o(t){let e,r=t.length;for(;0!==r;)e=Math.floor(Math.random()*r),r--,[t[r],t[e]]=[t[e],t[r]];return t}function i(t=new Date,e="asSeconds",r=null){if(t instanceof Date){const n=r instanceof Date?r:new Date,o=t.getTime()-n.getTime();switch(e){case"asMilliseconds":return o;case"asSeconds":default:return o/1e3;case"asMinutes":return o/6e4;case"asHours":return o/36e5;case"asDays":return o/864e5}}return null}function u(t,e="seconds",r="{time}"){t=Math.max(0,Math.floor(t));const n=["seconds","minutes","hours","days","months","years"].indexOf(e),o=n>=5,i=n>=4,u=n>=3,f=n>=2,s=n>=1,a=n>=0,h={years:o?0:NaN,months:i?0:NaN,days:u?0:NaN,hours:f?0:NaN,minutes:s?0:NaN,seconds:a?0:NaN,total:NaN};let c=t;if(o||i||u){const t=new Date(1980,0,1),e=new Date(t.getTime()+1e3*c),r=new Date(t);if(o)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=e.getTime();)r.setFullYear(r.getFullYear()+1),h.years++;if(i)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=e.getTime();)r.setMonth(r.getMonth()+1),h.months++;if(u)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=e.getTime();)r.setDate(r.getDate()+1),h.days++;c=Math.floor((e.getTime()-r.getTime())/1e3)}f&&(h.hours=Math.floor(c/3600),c%=3600),s&&(h.minutes=Math.floor(c/60),c%=60),a&&(h.seconds=c);const l={seconds:a?t:NaN,minutes:s?t/60:NaN,hours:f?t/3600:NaN,days:u?t/86400:NaN,months:i?12*h.years+h.months+(h.days||0)/30:NaN,years:o?h.years+(h.months||0)/12+(h.days||0)/365:NaN};h.total=+(l[e]||0).toFixed(2).replace(/\.00$/,"");const p=t=>{const e="string"==typeof t?parseInt(t):t;return Number.isNaN(e)?"NaN":String(e).padStart(2,"0")},y=[f?p(h.hours):null,s?p(h.minutes):null,a?p(h.seconds):null].filter((t=>null!==t)).join(":");return r.replace(/\{years\}/g,String(h.years)).replace(/\{months\}/g,String(h.months)).replace(/\{days\}/g,String(h.days)).replace(/\{hours\}/g,p(h.hours)).replace(/\{minutes\}/g,p(h.minutes)).replace(/\{seconds\}/g,p(h.seconds)).replace(/\{time\}/g,y).replace(/\{total\}/g,String(h.total)).trim()}function f(t){return u(t,"hours","{hours}:{minutes}:{seconds}")}function s(t){return u(t,"days","{days}d {hours}:{minutes}:{seconds}")}r.r(n),r.d(n,{addAiMarkerShortcut:()=>U,arraySortPositions:()=>t,asyncReplace:()=>e,cloneObjTypeOrder:()=>y,countObj:()=>w,extendObjType:()=>l,formatBytes:()=>A,formatCustomTimer:()=>u,formatDayTimer:()=>s,formatTimer:()=>f,getAge:()=>E,getSimplePerc:()=>v,getTimeDuration:()=>i,isJsonObject:()=>m,objType:()=>d,reorderObjTypeOrder:()=>p,ruleOfThree:()=>b,shuffleArray:()=>o,toTitleCase:()=>B,toTitleCaseLowerFirst:()=>T});var a=r(287);const h="undefined"!=typeof window&&void 0!==window.document,c={items:{},order:[]};function l(t,e){const r=[],n=Array.isArray(t)?t:Object.entries(t);for(const[t,o]of n)if(!c.items.hasOwnProperty(t)){c.items[t]=o;let n="number"==typeof e?e:-1;if(-1===n){const t=c.order.indexOf("object");n=t>-1?t:c.order.length}n=Math.min(Math.max(0,n),c.order.length),c.order.splice(n,0,t),r.push(t)}return r}function p(t){const e=[...c.order];return!!t.every((t=>e.includes(t)))&&(c.order=t.slice(),!0)}function y(){return[...c.order]}const g=t=>{if(null===t)return"null";for(const e of c.order)if("function"!=typeof c.items[e]||c.items[e](t))return e;return"unknown"};function d(t,e){if(void 0===t)return null;const r=g(t);return"string"==typeof e?r===e.toLowerCase():r}function w(t){return Array.isArray(t)?t.length:d(t,"object")?Object.keys(t).length:0}function m(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t)}function b(t,e,r,n=!1){return n?Number(t*e)/r:Number(r*e)/t}function v(t,e){return t*(e/100)}function E(t=0,e=null){if(null!=t&&0!==t){const r=new Date(t);if(Number.isNaN(r.getTime()))return null;const n=e instanceof Date?e:new Date;let o=n.getFullYear()-r.getFullYear();const i=n.getMonth(),u=r.getMonth(),f=n.getDate(),s=r.getDate();return(i<u||i===u&&f<s)&&o--,Math.abs(o)}return null}function A(t,e=null,r=null){if("number"!=typeof t||t<0)return{unit:null,value:null};if(0===t)return{unit:"Bytes",value:0};const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=r&&n.includes(r)?n.indexOf(r):n.length-1,i=Math.min(Math.floor(Math.log(t)/Math.log(1024)),o);let u=t/Math.pow(1024,i);if(null!==e){const t=e<0?0:e;u=parseFloat(u.toFixed(t))}return{unit:n[i],value:u}}function B(t){return t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function T(t){const e=t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()));return e.charAt(0).toLowerCase()+e.slice(1)}function U(t="a"){"undefined"!=typeof HTMLElement?document.addEventListener("keydown",(function(e){if(e.ctrlKey&&e.altKey&&e.key.toLowerCase()===t){if(e.preventDefault(),!document.body)return void console.warn("[AiMarkerShortcut] <body> element not found. Cannot toggle class. Ensure the DOM is fully loaded when using the shortcut.");document.body.classList.toggle("detect-made-by-ai")}})):console.error("[AiMarkerShortcut] Environment does not support the DOM. This function must be run in a browser.")}l([["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)]]),h||l([["buffer",t=>void 0!==a.hp&&a.hp.isBuffer(t)]]),h&&l([["file",t=>"undefined"!=typeof File&&t instanceof File]]),l([["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]]),h&&l([["htmlelement",t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement]]),l([["object",t=>m(t)]])})(),window.TinyBasicsEs=n})();
2
+ (()=>{var t={41:()=>{},251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,u=8*o-n-1,a=(1<<u)-1,f=a>>1,l=-7,c=r?o-1:0,h=r?-1:1,p=t[e+c];for(c+=h,i=p&(1<<-l)-1,p>>=-l,l+=u;l>0;i=256*i+t[e+c],c+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;l>0;s=256*s+t[e+c],c+=h,l-=8);if(0===i)i=1-f;else{if(i===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,u,a,f=8*i-o-1,l=(1<<f)-1,c=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+c>=1?h/a:h*Math.pow(2,1-c))*a>=2&&(s++,a/=2),s+c>=l?(u=0,s=l):s+c>=1?(u=(e*a-1)*Math.pow(2,o),s+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&u,p+=y,u/=256,o-=8);for(s=s<<o|u,f+=o;f>0;t[r+p]=255&s,p+=y,s/=256,f-=8);t[r+p-y]|=128*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=a,e.IS=50;var s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=u(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(z(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(z(t,SharedArrayBuffer)||t&&z(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);var o=function(t){if(a.isBuffer(t)){var e=0|y(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||W(t.length)?u(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return l(t),u(t<0?0:0|y(t))}function h(t){for(var e=t.length<0?0:0|y(t.length),r=u(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,a.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(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 D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(o)return n?-1:D(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 O(this,e,r);case"utf8":case"utf-8":return F(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var l=-1;for(i=r;i<u;i++)if(f(t,i)===f(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===a)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(r+a>u&&(r=u-a),i=r;i>=0;i--){for(var c=!0,h=0;h<a;h++)if(f(t,i+h)!==f(e,h)){c=!1;break}if(c)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(W(u))return s;t[r+s]=u}return s}function E(t,e,r,n){return $(D(e,t.length-r),t,r,n)}function A(t,e,r,n){return $(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return $(P(e),t,r,n)}function T(t,e,r,n){return $(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 B(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function F(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,u,a,f=t[o],l=null,c=f>239?4:f>223?3:f>191?2:1;if(o+c<=r)switch(c){case 1:f<128&&(l=f);break;case 2:128==(192&(i=t[o+1]))&&(a=(31&f)<<6|63&i)>127&&(l=a);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(a=(15&f)<<12|(63&i)<<6|63&s)>2047&&(a<55296||a>57343)&&(l=a);break;case 4:i=t[o+1],s=t[o+2],u=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&u)&&(a=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(l=a)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=c}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)}a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},a.allocUnsafe=function(t){return c(t)},a.allocUnsafeSlow=function(t){return c(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(z(i,Uint8Array))o+i.length>n.length?a.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?F(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,o){if(z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),u=Math.min(i,s),f=this.slice(n,o),l=t.slice(e,r),c=0;c<u;++c)if(f[c]!==l[c]){i=f[c],s=l[c];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function x(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 U(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=J[t[i]];return o}function L(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function N(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 M(t,e,r,n,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function k(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 R(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function I(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||N(t,4,this.length),o.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||N(t,4,this.length),o.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||N(t,8,this.length),o.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||N(t,8,this.length),o.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=0,s=1,u=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=r-1,s=1,u=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=a.isBuffer(t)?t:a.from(t,n),u=s.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};var j=/[^+/0-9A-Za-z-_]/g;function D(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 P(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(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 z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function W(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=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[l++]=e>>16&255,f[l++]=e>>8&255,f[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[l++]=e>>8&255,f[l++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,u=0,f=n-o;u<f;u+=s)i.push(a(t,u,u+s>f?f:u+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,n){for(var o,i,s=[],u=e;u<n;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},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 u,a=[],f=!1,l=-1;function c(){f&&u&&(f=!1,u.length?a=u.concat(a):l=-1,a.length&&h())}function h(){if(!f){var t=s(c);f=!0;for(var e=a.length;e;){for(u=a,a=[];++l<e;)u&&u[l].run();l=-1,e=a.length}u=null,f=!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 p(t,e){this.fun=t,this.array=e}function y(){}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];a.push(new p(t,e)),1!==a.length||f||s(h)},p.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=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,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,u=0;u<=t.length;++u){if(u<t.length)r=t.charCodeAt(u);else{if(47===r)break;r=47}if(47===r){if(i===u-1||1===s);else if(i!==u-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 a=n.lastIndexOf("/");if(a!==n.length-1){-1===a?(n="",o=0):o=(n=n.slice(0,a)).length-1-n.lastIndexOf("/"),i=u,s=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=u,s=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(i+1,u):n=t.slice(i+1,u),o=u-i-1;i=u,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 u;s>=0?u=arguments[s]:(void 0===t&&(t=n.cwd()),u=t),o(u),0!==u.length&&(e=u+"/"+e,r=47===u.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,u=1;u<e.length&&47===e.charCodeAt(u);++u);for(var a=e.length-u,f=i<a?i:a,l=-1,c=0;c<=f;++c){if(c===f){if(a>f){if(47===e.charCodeAt(u+c))return e.slice(u+c+1);if(0===c)return e.slice(u+c)}else i>f&&(47===t.charCodeAt(r+c)?l=c:0===c&&(l=0));break}var h=t.charCodeAt(r+c);if(h!==e.charCodeAt(u+c))break;47===h&&(l=c)}var p="";for(c=r+l+1;c<=n;++c)c!==n&&47!==t.charCodeAt(c)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(u+l):(u+=l,47===e.charCodeAt(u)&&++u,e.slice(u))},_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 u=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){var f=t.charCodeAt(r);if(47===f){if(!s){n=r+1;break}}else-1===a&&(s=!1,a=r+1),u>=0&&(f===e.charCodeAt(u)?-1==--u&&(i=r):(u=-1,i=a))}return n===i?i=a:-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,u=t.length-1;u>=0;--u){var a=t.charCodeAt(u);if(47!==a)-1===n&&(i=!1,n=u+1),46===a?-1===e?e=u:1!==s&&(s=1):-1!==e&&(s=-1);else if(!i){r=u+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,u=0,a=-1,f=!0,l=t.length-1,c=0;l>=r;--l)if(47!==(n=t.charCodeAt(l)))-1===a&&(f=!1,a=l+1),46===n?-1===s?s=l:1!==c&&(c=1):-1!==s&&(c=-1);else if(!f){u=l+1;break}return-1===s||-1===a||0===c||1===c&&s===a-1&&s===u+1?-1!==a&&(e.base=e.name=0===u&&i?t.slice(1,a):t.slice(u,a)):(0===u&&i?(e.name=t.slice(1,s),e.base=t.slice(1,a)):(e.name=t.slice(u,s),e.base=t.slice(u,a)),e.ext=t.slice(s,a)),u>0?e.dir=t.slice(0,u-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";function t(t,e=!1){return e?function(e,r){return e[t]>r[t]?-1:e[t]<r[t]?1:0}:function(e,r){return e[t]<r[t]?-1:e[t]>r[t]?1:0}}async function e(t,e,r){const n=[];t.replace(e,((t,...e)=>(n.push(r(t,...e)),t)));const o=await Promise.all(n);return t.replace(e,(()=>o.shift()))}function o(t){let e,r=t.length;for(;0!==r;)e=Math.floor(Math.random()*r),r--,[t[r],t[e]]=[t[e],t[r]];return t}function i(t=new Date,e="asSeconds",r=null){if(t instanceof Date){const n=r instanceof Date?r:new Date,o=t.getTime()-n.getTime();switch(e){case"asMilliseconds":return o;case"asSeconds":default:return o/1e3;case"asMinutes":return o/6e4;case"asHours":return o/36e5;case"asDays":return o/864e5}}return null}function s(t,e="seconds",r="{time}"){t=Math.max(0,Math.floor(t));const n=["seconds","minutes","hours","days","months","years"].indexOf(e),o=n>=5,i=n>=4,s=n>=3,u=n>=2,a=n>=1,f=n>=0,l={years:o?0:NaN,months:i?0:NaN,days:s?0:NaN,hours:u?0:NaN,minutes:a?0:NaN,seconds:f?0:NaN,total:NaN};let c=t;if(o||i||s){const t=new Date(1980,0,1),e=new Date(t.getTime()+1e3*c),r=new Date(t);if(o)for(;new Date(r.getFullYear()+1,r.getMonth(),r.getDate()).getTime()<=e.getTime();)r.setFullYear(r.getFullYear()+1),l.years++;if(i)for(;new Date(r.getFullYear(),r.getMonth()+1,r.getDate()).getTime()<=e.getTime();)r.setMonth(r.getMonth()+1),l.months++;if(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=e.getTime();)r.setDate(r.getDate()+1),l.days++;c=Math.floor((e.getTime()-r.getTime())/1e3)}u&&(l.hours=Math.floor(c/3600),c%=3600),a&&(l.minutes=Math.floor(c/60),c%=60),f&&(l.seconds=c);const h={seconds:f?t:NaN,minutes:a?t/60:NaN,hours:u?t/3600:NaN,days:s?t/86400:NaN,months:i?12*l.years+l.months+(l.days||0)/30:NaN,years:o?l.years+(l.months||0)/12+(l.days||0)/365:NaN};l.total=+(h[e]||0).toFixed(2).replace(/\.00$/,"");const p=t=>{const e="string"==typeof t?parseInt(t):t;return Number.isNaN(e)?"NaN":String(e).padStart(2,"0")},y=[u?p(l.hours):null,a?p(l.minutes):null,f?p(l.seconds):null].filter((t=>null!==t)).join(":");return r.replace(/\{years\}/g,String(l.years)).replace(/\{months\}/g,String(l.months)).replace(/\{days\}/g,String(l.days)).replace(/\{hours\}/g,p(l.hours)).replace(/\{minutes\}/g,p(l.minutes)).replace(/\{seconds\}/g,p(l.seconds)).replace(/\{time\}/g,y).replace(/\{total\}/g,String(l.total)).trim()}function u(t){return s(t,"hours","{hours}:{minutes}:{seconds}")}function a(t){return s(t,"days","{days}d {hours}:{minutes}:{seconds}")}r.r(n),r.d(n,{addAiMarkerShortcut:()=>z,areHtmlElsColliding:()=>b,arraySortPositions:()=>t,asyncReplace:()=>e,backupFile:()=>ot,clearDirectory:()=>_,cloneObjTypeOrder:()=>y,countObj:()=>m,dirExists:()=>G,dirSize:()=>nt,documentIsFullScreen:()=>C,ensureCopyFile:()=>Z,ensureDirectory:()=>H,exitFullScreen:()=>L,extendObjType:()=>h,fetchJson:()=>A,fileExists:()=>K,fileSize:()=>rt,formatBytes:()=>D,formatCustomTimer:()=>s,formatDayTimer:()=>a,formatTimer:()=>u,getAge:()=>j,getHtmlElBorders:()=>T,getHtmlElBordersWidth:()=>S,getHtmlElMargin:()=>B,getHtmlElPadding:()=>F,getLatestBackupPath:()=>it,getSimplePerc:()=>I,getTimeDuration:()=>i,isDirEmpty:()=>V,isFullScreenMode:()=>U,isJsonObject:()=>w,isScreenFilled:()=>x,listDirs:()=>et,listFiles:()=>tt,objType:()=>g,offFullScreenChange:()=>k,onFullScreenChange:()=>M,readJsonBlob:()=>v,readJsonFile:()=>q,renameFileAddPrefixSuffix:()=>ft,renameFileBatch:()=>ut,renameFileNormalizeCase:()=>lt,renameFilePadNumbers:()=>ct,renameFileRegex:()=>at,reorderObjTypeOrder:()=>p,requestFullScreen:()=>O,restoreLatestBackup:()=>st,ruleOfThree:()=>R,saveJsonFile:()=>E,shuffleArray:()=>o,toTitleCase:()=>P,toTitleCaseLowerFirst:()=>$,tryDeleteFile:()=>Q,writeJsonFile:()=>Y,writeTextFile:()=>X});var f=r(287);const l="undefined"!=typeof window&&void 0!==window.document,c={items:{},order:[]};function h(t,e){const r=[],n=Array.isArray(t)?t:Object.entries(t);for(const[t,o]of n)if(!c.items.hasOwnProperty(t)){c.items[t]=o;let n="number"==typeof e?e:-1;if(-1===n){const t=c.order.indexOf("object");n=t>-1?t:c.order.length}n=Math.min(Math.max(0,n),c.order.length),c.order.splice(n,0,t),r.push(t)}return r}function p(t){const e=[...c.order];return!!t.every((t=>e.includes(t)))&&(c.order=t.slice(),!0)}function y(){return[...c.order]}const d=t=>{if(null===t)return"null";for(const e of c.order)if("function"!=typeof c.items[e]||c.items[e](t))return e;return"unknown"};function g(t,e){if(void 0===t)return null;const r=d(t);return"string"==typeof e?r===e.toLowerCase():r}function m(t){return Array.isArray(t)?t.length:g(t,"object")?Object.keys(t).length:0}function w(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t)}function b(t,e){const r=t.getBoundingClientRect(),n=e.getBoundingClientRect();return!(r.right<n.left||r.left>n.right||r.bottom<n.top||r.top>n.bottom)}function v(t){return new Promise(((e,r)=>{const n=new FileReader;n.onload=()=>{try{const t=JSON.parse(n.result);e(t)}catch(e){r(new Error(`Invalid JSON in file: ${t.name}\n${e.message}`))}},n.onerror=()=>{r(new Error(`Error reading file: ${t.name}`))},n.readAsText(t)}))}function E(t,e,r=2){const n=JSON.stringify(e,null,r),o=new Blob([n],{type:"application/json"}),i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}async function A(t,{method:e="GET",body:r,timeout:n=0,retries:o=0,headers:i={},signal:s=null}={}){if("string"!=typeof t||!t.startsWith("../")&&!t.startsWith("./")&&!t.startsWith("/")&&!t.startsWith("https://")&&!t.startsWith("http://"))throw new Error("Invalid URL: must be a valid http or https address.");if("string"!=typeof e||!e.trim())throw new Error("Invalid method: must be a non-empty string.");if(!s){if("number"!=typeof n||!Number.isFinite(n)||Number.isNaN(n)||n<0)throw new Error("Invalid timeout: must be a positive number.");if("number"!=typeof o||!Number.isFinite(o)||Number.isNaN(o)||o<0)throw new Error("Invalid retries: must be a positive number.")}const u=s?1:o+1;let a=null;for(let f=0;f<u;f++){const u=s?null:new AbortController,l=s||(u?.signal??null),c=!s&&n&&u?setTimeout((()=>u.abort()),n):null;try{const n=await fetch(t,{method:e.toUpperCase(),headers:{Accept:"application/json",...i},body:void 0!==r?w(r)?JSON.stringify(r):r:void 0,signal:l});if(c&&clearTimeout(c),!n.ok)throw new Error(`HTTP error: ${n.status} ${n.statusText}`);const o=n.headers.get("content-type")||"";if(!o.includes("application/json"))throw new Error(`Unexpected content-type: ${o}`);const s=await n.json();if(!w(s))throw new Error("Received invalid data instead of valid JSON.");return s}catch(t){if(a=t,s)break;f<o&&await new Promise((t=>setTimeout(t,300*(f+1))))}}throw new Error(`Failed to fetch JSON from "${t}"${a?`: ${a.message}`:"."}`)}h([["undefined",t=>void 0===t],["null",t=>null===t],["boolean",t=>"boolean"==typeof t],["number",t=>"number"==typeof t&&!Number.isNaN(t)],["bigint",t=>"bigint"==typeof t],["string",t=>"string"==typeof t],["symbol",t=>"symbol"==typeof t],["function",t=>"function"==typeof t],["array",t=>Array.isArray(t)]]),l||h([["buffer",t=>void 0!==f.hp&&f.hp.isBuffer(t)]]),l&&h([["file",t=>"undefined"!=typeof File&&t instanceof File]]),h([["date",t=>t instanceof Date],["regexp",t=>t instanceof RegExp],["map",t=>t instanceof Map],["set",t=>t instanceof Set],["weakmap",t=>t instanceof WeakMap],["weakset",t=>t instanceof WeakSet],["promise",t=>t instanceof Promise]]),l&&h([["htmlelement",t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement]]),h([["object",t=>w(t)]]);const S=t=>{const e=getComputedStyle(t),r=parseFloat(e.borderLeftWidth)||0,n=parseFloat(e.borderRightWidth)||0,o=parseFloat(e.borderTopWidth)||0,i=parseFloat(e.borderBottomWidth)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},T=t=>{const e=getComputedStyle(t),r=parseFloat(e.borderLeft)||0,n=parseFloat(e.borderRight)||0,o=parseFloat(e.borderTop)||0,i=parseFloat(e.borderBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},B=t=>{const e=getComputedStyle(t),r=parseFloat(e.marginLeft)||0,n=parseFloat(e.marginRight)||0,o=parseFloat(e.marginTop)||0,i=parseFloat(e.marginBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},F=t=>{const e=getComputedStyle(t),r=parseFloat(e.paddingLeft)||0,n=parseFloat(e.paddingRight)||0,o=parseFloat(e.paddingTop)||0,i=parseFloat(e.paddingBottom)||0;return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}},C=()=>!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen),x=()=>window.innerHeight===screen.height&&window.innerWidth===screen.width,U=()=>C()||x(),O=t=>new Promise((async(e,r)=>{const n=document.documentElement;try{n.requestFullscreen?await n.requestFullscreen(t):n.mozRequestFullScreen?n.mozRequestFullScreen(t):n.webkitRequestFullScreen?n.webkitRequestFullScreen(t):n.msRequestFullscreen&&n.msRequestFullscreen(t),e()}catch(t){r(t)}})),L=()=>new Promise(((t,e)=>{if(document.exitFullscreen)document.exitFullscreen().then(t).catch(e);else try{if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{if(!document.msExitFullscreen)throw new Error("Fullscreen API is not supported");document.msExitFullscreen()}t()}catch(t){e(t)}})),N=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],M=(t,e)=>{N.forEach((r=>{document.addEventListener(r,t,e)}))},k=(t,e)=>{N.forEach((r=>{document.removeEventListener(r,t,e)}))};function R(t,e,r,n=!1){return n?Number(t*e)/r:Number(r*e)/t}function I(t,e){return t*(e/100)}function j(t=0,e=null){if(null!=t&&0!==t){const r=new Date(t);if(Number.isNaN(r.getTime()))return null;const n=e instanceof Date?e:new Date;let o=n.getFullYear()-r.getFullYear();const i=n.getMonth(),s=r.getMonth(),u=n.getDate(),a=r.getDate();return(i<s||i===s&&u<a)&&o--,Math.abs(o)}return null}function D(t,e=null,r=null){if("number"!=typeof t||t<0)return{unit:null,value:null};if(0===t)return{unit:"Bytes",value:0};const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=r&&n.includes(r)?n.indexOf(r):n.length-1,i=Math.min(Math.floor(Math.log(t)/Math.log(1024)),o);let s=t/Math.pow(1024,i);if(null!==e){const t=e<0?0:e;s=parseFloat(s.toFixed(t))}return{unit:n[i],value:s}}function P(t){return t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function $(t){const e=t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()));return e.charAt(0).toLowerCase()+e.slice(1)}function z(t="a"){"undefined"!=typeof HTMLElement?document.addEventListener("keydown",(function(e){if(e.ctrlKey&&e.altKey&&e.key.toLowerCase()===t){if(e.preventDefault(),!document.body)return void console.warn("[AiMarkerShortcut] <body> element not found. Cannot toggle class. Ensure the DOM is fully loaded when using the shortcut.");document.body.classList.toggle("detect-made-by-ai")}})):console.error("[AiMarkerShortcut] Environment does not support the DOM. This function must be run in a browser.")}var W=r(41),J=r(975);function q(t){if(!W.existsSync(t))throw new Error(`File not found: ${t}`);const e=W.readFileSync(t,"utf-8");return JSON.parse(e)}function Y(t,e,r=2){const n=JSON.stringify(e,null,r);W.writeFileSync(t,n,"utf-8")}function H(t){W.existsSync(t)||W.mkdirSync(t,{recursive:!0})}function _(t){if(!W.existsSync(t))return;const e=W.readdirSync(t);for(const r of e){const e=J.join(t,r);W.lstatSync(e).isDirectory()?W.rmSync(e,{recursive:!0,force:!0}):W.unlinkSync(e)}}function K(t){return W.existsSync(t)&&W.lstatSync(t).isFile()}function G(t){return W.existsSync(t)&&W.lstatSync(t).isDirectory()}function V(t){return W.existsSync(t)&&0===W.readdirSync(t).length}function Z(t,e,r){H(J.dirname(e)),W.copyFileSync(t,e,r)}function Q(t){return!!K(t)&&(W.unlinkSync(t),!0)}function X(t,e,r="utf-8"){H(J.dirname(t)),W.writeFileSync(t,e,r)}function tt(t,e=!1){const r={files:[],dirs:[]};if(!G(t))return r;const n=W.readdirSync(t);for(const o of n){const n=J.join(t,o);if(W.lstatSync(n).isDirectory()){if(r.dirs.push(n),e){const t=tt(n,!0);r.files.push(...t.files),r.dirs.push(...t.dirs)}}else r.files.push(n)}return r}function et(t,e=!1){const r=[];if(!G(t))return r;const n=W.readdirSync(t);for(const o of n){const n=J.join(t,o);W.lstatSync(n).isDirectory()&&(r.push(n),e&&r.push(...et(n,!0)))}return r}function rt(t){return K(t)?W.statSync(t).size:0}function nt(t){let e=0;const r=tt(t,!0).files;for(const t of r)e+=rt(t);return e}function ot(t,e="bak"){K(t)&&Z(t,`${t}.${e}.${(new Date).toISOString().replace(/[:.]/g,"-")}`)}function it(t,e="bak"){const r=J.dirname(t),n=J.basename(t),o=W.readdirSync(r).filter((t=>t.startsWith(`${n}.${e}.`))).sort().reverse();if(0===o.length)throw new Error(`No backups found for ${t}`);return J.join(r,o[0])}function st(t,e="bak"){Z(it(t,e),t)}function ut(t,e,r=[]){if("string"!=typeof t)throw new TypeError("dirPath must be a string");if("function"!=typeof e)throw new TypeError("renameFn must be a function");if(!Array.isArray(r))throw new TypeError("extensions must be an array of strings");if(!W.existsSync(t)||!W.statSync(t).isDirectory())throw new Error(`Directory not found or invalid: ${t}`);for(const t of r)if("string"!=typeof t||!t.startsWith("."))throw new TypeError(`Invalid extension: ${t}`);const n=tt(t).files;let o=0;for(const i of n){const n=J.extname(i);if(r.length&&!r.includes(n))continue;const s=J.basename(i),u=e(s,o++),a=J.join(t,u);s!==u&&W.renameSync(i,a)}}function at(t,e,r,n=[]){ut(t,(t=>{const n=J.extname(t);return`${J.basename(t,n).replace(e,r)}${n}`}),n)}function ft(t,{prefix:e="",suffix:r=""},n=[]){ut(t,(t=>{const n=J.extname(t),o=J.basename(t,n);return`${e}${o}${r}${n}`}),n)}function lt(t,e="lower",r=[],n=!1){if("string"!=typeof e||!["lower","upper","title"].includes(e))throw new Error(`Invalid mode "${e}". Must be 'lower', 'upper' or 'title'.`);ut(t,(t=>{const r=t=>"lower"===e?t.toLowerCase():"upper"===e?t.toUpperCase():"title"===e?P(t):t,o=J.extname(t),i=n?r(o):o;return`${r(J.basename(t,o))}${i}`}),r)}function ct(t,e=3,r=[]){ut(t,(t=>t.replace(/\d+/,(t=>t.padStart(e,"0")))),r)}})(),window.TinyBasicsEs=n})();
@@ -0,0 +1,307 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ // The require scope
4
+ /******/ var __webpack_require__ = {};
5
+ /******/
6
+ /************************************************************************/
7
+ /******/ /* webpack/runtime/define property getters */
8
+ /******/ (() => {
9
+ /******/ // define getter functions for harmony exports
10
+ /******/ __webpack_require__.d = (exports, definition) => {
11
+ /******/ for(var key in definition) {
12
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14
+ /******/ }
15
+ /******/ }
16
+ /******/ };
17
+ /******/ })();
18
+ /******/
19
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
20
+ /******/ (() => {
21
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
22
+ /******/ })();
23
+ /******/
24
+ /************************************************************************/
25
+ var __webpack_exports__ = {};
26
+
27
+ // EXPORTS
28
+ __webpack_require__.d(__webpack_exports__, {
29
+ TinyDragDropDetector: () => (/* reexport */ libs_TinyDragDropDetector)
30
+ });
31
+
32
+ ;// ./src/v1/libs/TinyDragDropDetector.mjs
33
+ /**
34
+ * @typedef {Object} DragAndDropOptions
35
+ * @property {HTMLElement} [target=document.body] - The DOM element where drag listeners will be attached. Defaults to `document.body` if `fullscreen` is true or no target is provided.
36
+ * @property {boolean} [fullscreen=true] - If true, listeners are attached to the entire page (`document.body`). If false, the `target` must be specified.
37
+ * @property {string} [hoverClass="dnd-hover"] - CSS class applied to the target element while files are being dragged over it.
38
+ * @property {(files: FileList, event: DragEvent) => void} [onDrop] - Callback function executed when files are dropped onto the target.
39
+ * @property {(event: DragEvent) => void} [onEnter] - Optional callback triggered when dragging enters the target area.
40
+ * @property {(event: DragEvent) => void} [onLeave] - Optional callback triggered when dragging leaves the target area.
41
+ */
42
+
43
+ /**
44
+ * TinyDragDropDetector
45
+ *
46
+ * A lightweight utility to detect drag-and-drop file operations on a specific DOM element or the entire page.
47
+ * It handles the drag lifecycle (enter, over, leave, drop) and provides hooks for developers to handle file uploads or UI changes.
48
+ *
49
+ * @class
50
+ */
51
+ class TinyDragDropDetector {
52
+ /** @type {HTMLElement} */
53
+ #target;
54
+
55
+ /** @type {boolean} */
56
+ #fullscreen;
57
+
58
+ /** @type {string} */
59
+ #hoverClass;
60
+
61
+ /** @type {(files: FileList, event: DragEvent) => void} */
62
+ #onDropCallback;
63
+
64
+ /** @type {(event: DragEvent) => void} */
65
+ #onEnterCallback;
66
+
67
+ /** @type {(event: DragEvent) => void} */
68
+ #onLeaveCallback;
69
+
70
+ /** @type {boolean} */
71
+ #isDragging;
72
+
73
+ /** @type {boolean} */
74
+ #bound;
75
+
76
+ /**
77
+ * Creates a new instance of TinyDragDropDetector to handle drag-and-drop file detection.
78
+ *
79
+ * @param {DragAndDropOptions} [options={}] - Configuration options for the detector.
80
+ * @throws {TypeError} If `target` is not an HTMLElement.
81
+ * @throws {TypeError} If `fullscreen` is not a boolean.
82
+ * @throws {TypeError} If `hoverClass` is not a string.
83
+ * @throws {TypeError} If `onDrop` is defined but not a function.
84
+ * @throws {TypeError} If `onEnter` is defined but not a function.
85
+ * @throws {TypeError} If `onLeave` is defined but not a function.
86
+ */
87
+ constructor(options = {}) {
88
+ const {
89
+ target,
90
+ fullscreen = true,
91
+ hoverClass = 'dnd-hover',
92
+ onDrop,
93
+ onEnter,
94
+ onLeave,
95
+ } = options;
96
+
97
+ // Validate fullscreen
98
+ if (typeof fullscreen !== 'boolean')
99
+ throw new TypeError('The "fullscreen" option must be a boolean.');
100
+
101
+ // Validate target
102
+ const resolvedTarget = fullscreen ? document.body : target || document.body;
103
+ if (!(resolvedTarget instanceof HTMLElement))
104
+ throw new TypeError('The "target" option must be an instance of HTMLElement.');
105
+
106
+ // Validate hoverClass
107
+ if (typeof hoverClass !== 'string')
108
+ throw new TypeError('The "hoverClass" option must be a string.');
109
+
110
+ // Validate onDrop
111
+ if (typeof onDrop !== 'function')
112
+ throw new TypeError('The "onDrop" option must be a function.');
113
+
114
+ // Validate onEnter
115
+ if (typeof onEnter !== 'function')
116
+ throw new TypeError('The "onEnter" option must be a function.');
117
+
118
+ // Validate onLeave
119
+ if (typeof onLeave !== 'function')
120
+ throw new TypeError('The "onLeave" option must be a function.');
121
+
122
+ // Store properties
123
+ this.#target = resolvedTarget;
124
+ this.#fullscreen = fullscreen;
125
+ this.#hoverClass = hoverClass;
126
+
127
+ this.#onDropCallback = onDrop || (() => {});
128
+ this.#onEnterCallback = onEnter;
129
+ this.#onLeaveCallback = onLeave;
130
+
131
+ this.#isDragging = false;
132
+ this.#bound = false;
133
+
134
+ // Bind event handlers
135
+ this._handleDragEnter = this._handleDragEnter.bind(this);
136
+ this._handleDragOver = this._handleDragOver.bind(this);
137
+ this._handleDragLeave = this._handleDragLeave.bind(this);
138
+ this._handleDrop = this._handleDrop.bind(this);
139
+
140
+ this.#bindEvents();
141
+ }
142
+
143
+ /**
144
+ * Returns the current target DOM element where the listeners are attached.
145
+ * @returns {HTMLElement}
146
+ */
147
+ getTarget() {
148
+ return this.#target;
149
+ }
150
+
151
+ /**
152
+ * Returns the CSS class applied during drag hover.
153
+ * @returns {string}
154
+ */
155
+ getHoverClass() {
156
+ return this.#hoverClass;
157
+ }
158
+
159
+ /**
160
+ * Indicates whether the detector is operating in fullscreen mode.
161
+ * @returns {boolean}
162
+ */
163
+ isFullScreen() {
164
+ return this.#fullscreen;
165
+ }
166
+
167
+ /**
168
+ * Returns whether a drag operation is currently active over the target.
169
+ * @returns {boolean}
170
+ */
171
+ isDragging() {
172
+ return this.#isDragging;
173
+ }
174
+
175
+ /**
176
+ * Returns whether the event listeners are currently bound to the target.
177
+ * @returns {boolean}
178
+ */
179
+ bound() {
180
+ return this.#bound;
181
+ }
182
+
183
+ /**
184
+ * Binds the drag-and-drop event listeners to the target element.
185
+ * Automatically called on instantiation.
186
+ * @returns {void}
187
+ */
188
+ #bindEvents() {
189
+ if (this.#bound) return;
190
+ const target = this.getTarget();
191
+ target.addEventListener('dragenter', this._handleDragEnter);
192
+ target.addEventListener('dragover', this._handleDragOver);
193
+ target.addEventListener('dragleave', this._handleDragLeave);
194
+ target.addEventListener('drop', this._handleDrop);
195
+ this.#bound = true;
196
+ }
197
+
198
+ /**
199
+ * Removes all previously attached drag-and-drop event listeners from the target.
200
+ * @returns {void}
201
+ */
202
+ #unbindEvents() {
203
+ if (!this.#bound) return;
204
+ const target = this.getTarget();
205
+ target.removeEventListener('dragenter', this._handleDragEnter);
206
+ target.removeEventListener('dragover', this._handleDragOver);
207
+ target.removeEventListener('dragleave', this._handleDragLeave);
208
+ target.removeEventListener('drop', this._handleDrop);
209
+ this.#bound = false;
210
+ }
211
+
212
+ /**
213
+ * Handles the `dragenter` event.
214
+ * Adds the hover CSS class and triggers the `onEnter` callback if provided.
215
+ * @private
216
+ * @param {DragEvent} event - The dragenter event.
217
+ * @returns {void}
218
+ */
219
+ _handleDragEnter(event) {
220
+ event.preventDefault();
221
+ if (!this.#isDragging) {
222
+ const target = this.getTarget();
223
+ this.#isDragging = true;
224
+ target.classList.add(this.#hoverClass);
225
+ this.#onEnterCallback(event);
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Handles the `dragover` event.
231
+ * Prevents default to allow drop and sets the drop effect.
232
+ * @private
233
+ * @param {DragEvent} event - The dragover event.
234
+ * @returns {void}
235
+ */
236
+ _handleDragOver(event) {
237
+ event.preventDefault(); // Required to allow drop
238
+ if (!event.dataTransfer) {
239
+ console.warn('[TinyDragDropDetector] [handleDragOver] DragOver event missing dataTransfer.');
240
+ return;
241
+ }
242
+ event.dataTransfer.dropEffect = 'copy';
243
+ }
244
+
245
+ /**
246
+ * Handles the `dragleave` event.
247
+ * Removes the hover class and triggers the `onLeave` callback if provided.
248
+ * @private
249
+ * @param {DragEvent} event - The dragleave event.
250
+ * @returns {void}
251
+ */
252
+ _handleDragLeave(event) {
253
+ event.preventDefault();
254
+ const target = this.getTarget();
255
+ // Check if you've completely left the area
256
+ // @ts-ignore
257
+ if (event.relatedTarget === null || !target.contains(event.relatedTarget)) {
258
+ this.#isDragging = false;
259
+ target.classList.remove(this.#hoverClass);
260
+ this.#onLeaveCallback(event);
261
+ }
262
+ }
263
+
264
+ /**
265
+ * Handles the `drop` event.
266
+ * Removes the hover class, resets dragging state, and triggers the `onDrop` callback.
267
+ * @private
268
+ * @param {DragEvent} event - The drop event.
269
+ * @returns {void}
270
+ */
271
+ _handleDrop(event) {
272
+ event.preventDefault();
273
+ if (!event.dataTransfer) {
274
+ console.warn('[TinyDragDropDetector] [handleDrop] DragOver event missing dataTransfer.');
275
+ return;
276
+ }
277
+ const target = this.getTarget();
278
+ this.#isDragging = false;
279
+ target.classList.remove(this.#hoverClass);
280
+ const files = event.dataTransfer.files;
281
+ if (files.length > 0) {
282
+ this.#onDropCallback(files, event);
283
+ }
284
+ }
285
+
286
+ /**
287
+ * Destroys the detector instance, unbinding all event listeners and cleaning up.
288
+ * Should be called when the detector is no longer needed to avoid memory leaks.
289
+ * @returns {void}
290
+ */
291
+ destroy() {
292
+ this.#unbindEvents();
293
+ const target = this.getTarget();
294
+ target.classList.remove(this.#hoverClass);
295
+ }
296
+ }
297
+
298
+ /* harmony default export */ const libs_TinyDragDropDetector = (TinyDragDropDetector);
299
+
300
+ ;// ./src/v1/build/TinyDragDropDetector.mjs
301
+
302
+
303
+
304
+
305
+ window.TinyDragDropDetector = __webpack_exports__.TinyDragDropDetector;
306
+ /******/ })()
307
+ ;
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{TinyDragDropDetector:()=>r});const r=class{#e;#t;#r;#n;#a;#s;#o;#i;constructor(e={}){const{target:t,fullscreen:r=!0,hoverClass:n="dnd-hover",onDrop:a,onEnter:s,onLeave:o}=e;if("boolean"!=typeof r)throw new TypeError('The "fullscreen" option must be a boolean.');const i=r?document.body:t||document.body;if(!(i instanceof HTMLElement))throw new TypeError('The "target" option must be an instance of HTMLElement.');if("string"!=typeof n)throw new TypeError('The "hoverClass" option must be a string.');if("function"!=typeof a)throw new TypeError('The "onDrop" option must be a function.');if("function"!=typeof s)throw new TypeError('The "onEnter" option must be a function.');if("function"!=typeof o)throw new TypeError('The "onLeave" option must be a function.');this.#e=i,this.#t=r,this.#r=n,this.#n=a||(()=>{}),this.#a=s,this.#s=o,this.#o=!1,this.#i=!1,this._handleDragEnter=this._handleDragEnter.bind(this),this._handleDragOver=this._handleDragOver.bind(this),this._handleDragLeave=this._handleDragLeave.bind(this),this._handleDrop=this._handleDrop.bind(this),this.#h()}getTarget(){return this.#e}getHoverClass(){return this.#r}isFullScreen(){return this.#t}isDragging(){return this.#o}bound(){return this.#i}#h(){if(this.#i)return;const e=this.getTarget();e.addEventListener("dragenter",this._handleDragEnter),e.addEventListener("dragover",this._handleDragOver),e.addEventListener("dragleave",this._handleDragLeave),e.addEventListener("drop",this._handleDrop),this.#i=!0}#l(){if(!this.#i)return;const e=this.getTarget();e.removeEventListener("dragenter",this._handleDragEnter),e.removeEventListener("dragover",this._handleDragOver),e.removeEventListener("dragleave",this._handleDragLeave),e.removeEventListener("drop",this._handleDrop),this.#i=!1}_handleDragEnter(e){if(e.preventDefault(),!this.#o){const t=this.getTarget();this.#o=!0,t.classList.add(this.#r),this.#a(e)}}_handleDragOver(e){e.preventDefault(),e.dataTransfer?e.dataTransfer.dropEffect="copy":console.warn("[TinyDragDropDetector] [handleDragOver] DragOver event missing dataTransfer.")}_handleDragLeave(e){e.preventDefault();const t=this.getTarget();null!==e.relatedTarget&&t.contains(e.relatedTarget)||(this.#o=!1,t.classList.remove(this.#r),this.#s(e))}_handleDrop(e){if(e.preventDefault(),!e.dataTransfer)return void console.warn("[TinyDragDropDetector] [handleDrop] DragOver event missing dataTransfer.");const t=this.getTarget();this.#o=!1,t.classList.remove(this.#r);const r=e.dataTransfer.files;r.length>0&&this.#n(r,e)}destroy(){this.#l(),this.getTarget().classList.remove(this.#r)}};window.TinyDragDropDetector=t.TinyDragDropDetector})();