tiny-essentials 1.3.2 → 1.5.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.
Files changed (121) hide show
  1. package/dist/TinyBasicsEs.js +45 -22
  2. package/dist/TinyBasicsEs.min.js +1 -1
  3. package/dist/TinyEssentials.js +223 -22
  4. package/dist/TinyEssentials.min.js +1 -1
  5. package/dist/TinyPromiseQueue.js +214 -0
  6. package/dist/TinyPromiseQueue.min.js +1 -0
  7. package/dist/legacy/crypto/decrypt.d.mts +1 -0
  8. package/dist/legacy/crypto/default.d.mts +1 -0
  9. package/dist/legacy/crypto/encrypt.d.mts +1 -0
  10. package/dist/legacy/crypto/index.d.mts +1 -0
  11. package/dist/legacy/firebase/cookieSession.d.mts +1 -0
  12. package/dist/legacy/firebase/database/index.d.mts +1 -0
  13. package/dist/legacy/firebase/database/presence.d.mts +1 -0
  14. package/dist/legacy/firebase/database/saveAsync.d.mts +1 -0
  15. package/dist/legacy/firebase/databaseEscape.d.mts +1 -0
  16. package/dist/legacy/firebase/databaseLogger.d.mts +1 -0
  17. package/dist/legacy/firebase/discord/api/addGuildMember.d.mts +1 -0
  18. package/dist/legacy/firebase/discord/api/getGuildWidget.d.mts +1 -0
  19. package/dist/legacy/firebase/discord/api/getToken.d.mts +1 -0
  20. package/dist/legacy/firebase/discord/api/getUser.d.mts +1 -0
  21. package/dist/legacy/firebase/discord/api/getUserConnections.d.mts +1 -0
  22. package/dist/legacy/firebase/discord/api/getUserGuilds.d.mts +1 -0
  23. package/dist/legacy/firebase/discord/api/index.d.mts +1 -0
  24. package/dist/legacy/firebase/discord/api/refreshToken.d.mts +1 -0
  25. package/dist/legacy/firebase/discord/api/revokeToken.d.mts +1 -0
  26. package/dist/legacy/firebase/discord/config.d.mts +1 -0
  27. package/dist/legacy/firebase/discord/firebase_redirect/index.d.mts +1 -0
  28. package/dist/legacy/firebase/discord/firebase_redirect/login.d.mts +1 -0
  29. package/dist/legacy/firebase/discord/firebase_redirect/logout.d.mts +1 -0
  30. package/dist/legacy/firebase/discord/get/authURLGenerator.d.mts +1 -0
  31. package/dist/legacy/firebase/discord/get/cookie-session.d.mts +1 -0
  32. package/dist/legacy/firebase/discord/get/credentials.d.mts +1 -0
  33. package/dist/legacy/firebase/discord/get/errorValidator.d.mts +1 -0
  34. package/dist/legacy/firebase/discord/get/index.d.mts +1 -0
  35. package/dist/legacy/firebase/discord/get/randomAvatar.d.mts +1 -0
  36. package/dist/legacy/firebase/discord/http/index.d.mts +1 -0
  37. package/dist/legacy/firebase/discord/http/login.d.mts +1 -0
  38. package/dist/legacy/firebase/discord/http/logout.d.mts +1 -0
  39. package/dist/legacy/firebase/discord/http/redirect.d.mts +1 -0
  40. package/dist/legacy/firebase/discord/http/refreshToken.d.mts +1 -0
  41. package/dist/legacy/firebase/discord/index.d.mts +1 -0
  42. package/dist/legacy/firebase/discord/template/cookie-session.d.mts +1 -0
  43. package/dist/legacy/firebase/domainRedirect.d.mts +1 -0
  44. package/dist/legacy/firebase/escape.d.mts +1 -0
  45. package/dist/legacy/firebase/getDBAsync.d.mts +1 -0
  46. package/dist/legacy/firebase/getDBData.d.mts +1 -0
  47. package/dist/legacy/firebase/getDBValue.d.mts +1 -0
  48. package/dist/legacy/firebase/index.d.mts +1 -0
  49. package/dist/legacy/firebase/isEmulator.d.mts +1 -0
  50. package/dist/legacy/firebase/logger.d.mts +1 -0
  51. package/dist/legacy/firebase/mySQL.d.mts +1 -0
  52. package/dist/legacy/firebase/mysqlConnector/create.d.mts +1 -0
  53. package/dist/legacy/firebase/mysqlConnector/index.d.mts +1 -0
  54. package/dist/legacy/firebase/mysqlConnector/nextPrev.d.mts +1 -0
  55. package/dist/legacy/firebase/mysqlConnector/pagination.d.mts +1 -0
  56. package/dist/legacy/firebase/mysqlConnector/sameUser.d.mts +1 -0
  57. package/dist/legacy/firebase/transactionDBAsync.d.mts +1 -0
  58. package/dist/legacy/get/countObj.d.mts +1 -0
  59. package/dist/legacy/get/decimalColor.d.mts +1 -0
  60. package/dist/legacy/get/objType.d.mts +1 -0
  61. package/dist/legacy/get/pagination.d.mts +1 -0
  62. package/dist/legacy/get/queryUrlByName.d.mts +1 -0
  63. package/dist/legacy/get/queryUrlJSON.d.mts +1 -0
  64. package/dist/legacy/get/super_string_filter.d.mts +1 -0
  65. package/dist/legacy/get/versionCheck.d.mts +1 -0
  66. package/dist/legacy/http/HTTP-1.0.d.mts +1 -0
  67. package/dist/legacy/http/auth.d.mts +1 -0
  68. package/dist/legacy/http/check_domain.d.mts +1 -0
  69. package/dist/legacy/http/csrfTokenAnalyze.d.mts +1 -0
  70. package/dist/legacy/http/domainValidator.d.mts +1 -0
  71. package/dist/legacy/http/errorsCallback.d.mts +1 -0
  72. package/dist/legacy/http/fetch/json.d.mts +1 -0
  73. package/dist/legacy/http/fetch/text.d.mts +1 -0
  74. package/dist/legacy/http/fileCache.d.mts +1 -0
  75. package/dist/legacy/http/getDomainURL.d.mts +1 -0
  76. package/dist/legacy/http/userIP.d.mts +1 -0
  77. package/dist/legacy/index.d.mts +1 -0
  78. package/dist/legacy/libs/arraySortPositions.d.mts +1 -0
  79. package/dist/legacy/libs/capitalize.d.mts +1 -0
  80. package/dist/legacy/libs/convertBytes.d.mts +1 -0
  81. package/dist/legacy/libs/custom_module_loader.d.mts +1 -0
  82. package/dist/legacy/libs/dice.d.mts +1 -0
  83. package/dist/legacy/libs/markdown.d.mts +1 -0
  84. package/dist/legacy/libs/percentage.d.mts +1 -0
  85. package/dist/legacy/libs/regex/getLetter.d.mts +1 -0
  86. package/dist/legacy/libs/replaceAsync.d.mts +1 -0
  87. package/dist/legacy/libs/rule3.d.mts +1 -0
  88. package/dist/legacy/libs/userLevel.d.mts +1 -0
  89. package/dist/legacy/momentjs/getAge.d.mts +1 -0
  90. package/dist/legacy/momentjs/index.d.mts +1 -0
  91. package/dist/legacy/momentjs/timeDuration.d.mts +1 -0
  92. package/dist/legacy/socket.io/antiFlood/index.d.mts +1 -0
  93. package/dist/legacy/socket.io/antiFlood/install.d.mts +1 -0
  94. package/dist/legacy/socket.io/antiFlood/verify.d.mts +1 -0
  95. package/dist/legacy/socket.io/cookie-session.d.mts +1 -0
  96. package/dist/legacy/socket.io/discord.d.mts +1 -0
  97. package/dist/legacy/socket.io/index.d.mts +1 -0
  98. package/dist/v1/basics/array.d.mts +1 -0
  99. package/dist/v1/basics/clock.d.mts +1 -0
  100. package/dist/v1/basics/index.d.mts +1 -0
  101. package/dist/v1/basics/objFilter.cjs +46 -22
  102. package/dist/v1/basics/objFilter.d.mts +13 -2
  103. package/dist/v1/basics/objFilter.mjs +43 -22
  104. package/dist/v1/basics/simpleMath.d.mts +1 -0
  105. package/dist/v1/basics/text.d.mts +1 -0
  106. package/dist/v1/build/TinyLevelUp.d.mts +1 -0
  107. package/dist/v1/build/TinyPromiseQueue.cjs +7 -0
  108. package/dist/v1/build/TinyPromiseQueue.d.mts +3 -0
  109. package/dist/v1/build/TinyPromiseQueue.mjs +2 -0
  110. package/dist/v1/index.cjs +3 -0
  111. package/dist/v1/index.d.mts +4 -1
  112. package/dist/v1/index.mjs +3 -2
  113. package/dist/v1/libs/TinyPromiseQueue.cjs +175 -0
  114. package/dist/v1/libs/TinyPromiseQueue.d.mts +63 -0
  115. package/dist/v1/libs/TinyPromiseQueue.mjs +159 -0
  116. package/docs/README.md +5 -0
  117. package/docs/basics/asyncReplace.md +39 -0
  118. package/docs/basics/objFilter.md +33 -0
  119. package/docs/libs/TinyLevelUp.md +108 -0
  120. package/docs/libs/TinyPromiseQueue.md +126 -0
  121. package/package.json +4 -2
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see TinyEssentials.min.js.LICENSE.txt */
2
- (()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,f=8*o-n-1,u=(1<<f)-1,a=u>>1,h=-7,l=r?o-1:0,p=r?-1:1,c=t[e+l];for(l+=p,i=c&(1<<-h)-1,c>>=-h,h+=f;h>0;i=256*i+t[e+l],l+=p,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=256*s+t[e+l],l+=p,h-=8);if(0===i)i=1-a;else{if(i===u)return s?NaN:1/0*(c?-1:1);s+=Math.pow(2,n),i-=a}return(c?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,f,u,a=8*i-o-1,h=(1<<a)-1,l=h>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,c=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,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=h?(f=0,s=h):s+l>=1?(f=(e*u-1)*Math.pow(2,o),s+=l):(f=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+c]=255&f,c+=y,f/=256,o-=8);for(s=s<<o|f,a+=o;a>0;t[r+c]=255&s,c+=y,s/=256,a-=8);t[r+c-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=u,e.IS=50;var s=2147483647;function f(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(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 l(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"),!u.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 c(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(_(t,ArrayBuffer)||t&&_(t.buffer,ArrayBuffer))return c(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(_(t,SharedArrayBuffer)||t&&_(t.buffer,SharedArrayBuffer)))return c(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 u.from(n,e,r);var o=function(t){if(u.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):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 u.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 l(t){return h(t),f(t<0?0:0|y(t))}function p(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 c(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,u.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(u.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 k(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:k(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 S(this,e,r);case"utf8":case"utf-8":return U(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,s=1,f=t.length,u=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,f/=2,u/=2,r/=2}function a(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}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===u)return h*s}else-1!==h&&(i-=i-h),h=-1}else for(r+u>f&&(r=f-u),i=r;i>=0;i--){for(var l=!0,p=0;p<u;p++)if(a(t,i+p)!==a(e,p)){l=!1;break}if(l)return i}return-1}function b(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 f=parseInt(e.substr(2*s,2),16);if(z(f))return s;t[r+s]=f}return s}function E(t,e,r,n){return Y(k(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 x(t,e,r,n){return Y(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function U(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,f,u,a=t[o],h=null,l=a>239?4:a>223?3:a>191?2:1;if(o+l<=r)switch(l){case 1:a<128&&(h=a);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&a)<<6|63&i)>127&&(h=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&a)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:i=t[o+1],s=t[o+2],f=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&f)&&(u=(15&a)<<18|(63&i)<<12|(63&s)<<6|63&f)>65535&&u<1114112&&(h=u)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=l}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=L));return r}(n)}u.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}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.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)},u.allocUnsafe=function(t){return l(t)},u.allocUnsafeSlow=function(t){return l(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(_(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),_(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.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},u.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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(_(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.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},u.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},u.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},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?U(this,0,t):d.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.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&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,o){if(_(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),f=Math.min(i,s),a=this.slice(n,o),h=t.slice(e,r),l=0;l<f;++l)if(a[l]!==h[l]){i=a[l],s=h[l];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},u.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 b(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 x(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function O(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 S(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+=V[t[i]];return o}function N(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 C(t,e,r,n,o,i){if(!u.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 R(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 j(t,e,r,n,i){return e=+e,r>>>=0,i||R(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||R(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.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,u.prototype),n},u.prototype.readUintLE=u.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},u.prototype.readUintBE=u.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},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.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]},u.prototype.readUint32BE=u.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])},u.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},u.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},u.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.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},u.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},u.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},u.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]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(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},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,s=1,f=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===f&&0!==this[e+i-1]&&(f=1),this[e+i]=(t/s|0)-f&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,s=1,f=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===f&&0!==this[e+i+1]&&(f=1),this[e+i]=(t/s|0)-f&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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},u.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&&!u.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=u.isBuffer(t)?t:u.from(t,n),f=s.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]=s[i%f]}return this};var P=/[^+/0-9A-Za-z-_]/g;function k(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 F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).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 V=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),s=i[0],u=i[1],a=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),h=0,l=u>0?s-4:s;for(r=0;r<l;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===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,a[h++]=255&e),1===u&&(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=[],s=16383,f=0,a=n-o;f<a;f+=s)i.push(u(t,f,f+s>a?a:f+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 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 u(t,e,n){for(var o,i,s=[],f=e;f<n;f+=3)o=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(255&t[f+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";async function t(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()))}r.r(n),r.d(n,{TinyLevelUp:()=>e,asyncReplace:()=>t,cloneObjTypeOrder:()=>c,countObj:()=>d,extendObjType:()=>l,formatCustomTimer:()=>s,formatDayTimer:()=>u,formatTimer:()=>f,getAge:()=>v,getSimplePerc:()=>m,getTimeDuration:()=>i,objType:()=>g,reorderObjTypeOrder:()=>p,ruleOfThree:()=>w,shuffleArray:()=>o,toTitleCase:()=>b,toTitleCaseLowerFirst:()=>E});const e=class{constructor(t,e){this.giveExp=t,this.expLevel=e}expValidator(t){let e=0;const r=this.expLevel*t.level;return t.exp>=r&&(t.level++,e=t.exp-r,t.exp=0,e>0)?this.give(t,e,"extra"):t.exp<1&&t.level>1&&(t.level--,e=Math.abs(t.exp),t.exp=this.expLevel*t.level,e>0)?this.remove(t,e,"extra"):t}getTotalExp(t){let e=0;for(let r=1;r<=t.level;r++)e+=this.expLevel*r;return e+=t.exp,e}expGenerator(t=1){return Math.floor(Math.random()*this.giveExp)+1*t}progress(t){return this.expLevel*t.level}getProgress(t){return this.expLevel*t.level}set(t,e){return t.exp=e,this.expValidator(t),t.totalExp=this.getTotalExp(t),t}give(t,e=0,r="add",n=1){return"add"===r?t.exp+=this.expGenerator(n)+e:"extra"===r&&(t.exp+=e),this.expValidator(t),t.totalExp=this.getTotalExp(t),t}remove(t,e=0,r="add",n=1){return"add"===r?t.exp-=this.expGenerator(n)+e:"extra"===r&&(t.exp-=e),this.expValidator(t),t.totalExp=this.getTotalExp(t),t}};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,f=n>=2,u=n>=1,a=n>=0,h={years:o?0:NaN,months:i?0:NaN,days:s?0:NaN,hours:f?0:NaN,minutes:u?0:NaN,seconds:a?0:NaN,total:NaN};let l=t;if(o||i||s){const t=new Date(1980,0,1),e=new Date(t.getTime()+1e3*l),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(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=e.getTime();)r.setDate(r.getDate()+1),h.days++;l=Math.floor((e.getTime()-r.getTime())/1e3)}f&&(h.hours=Math.floor(l/3600),l%=3600),u&&(h.minutes=Math.floor(l/60),l%=60),a&&(h.seconds=l);const p={seconds:a?t:NaN,minutes:u?t/60:NaN,hours:f?t/3600:NaN,days:s?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=+(p[e]||0).toFixed(2).replace(/\.00$/,"");const c=t=>{const e="string"==typeof t?parseInt(t):t;return Number.isNaN(e)?"NaN":String(e).padStart(2,"0")},y=[f?c(h.hours):null,u?c(h.minutes):null,a?c(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,c(h.hours)).replace(/\{minutes\}/g,c(h.minutes)).replace(/\{seconds\}/g,c(h.seconds)).replace(/\{time\}/g,y).replace(/\{total\}/g,String(h.total)).trim()}function f(t){return s(t,"hours","{hours}:{minutes}:{seconds}")}function u(t){return s(t,"days","{days}d {hours}:{minutes}:{seconds}")}var a=r(287);const h={items:{undefined:t=>void 0===t,null:t=>null===t,boolean:t=>"boolean"==typeof t,number:t=>"number"==typeof t&&!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),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,buffer:t=>void 0!==a.hp&&a.hp.isBuffer(t),file:t=>"undefined"!=typeof File&&t instanceof File,htmlelement:t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement,object:t=>"object"==typeof t&&null!==t},order:["undefined","null","boolean","number","bigint","string","symbol","function","array","buffer","file","date","regexp","map","set","weakmap","weakset","promise","htmlelement","object"]};function l(t,e){const r=[];for(const[n,o]of Object.entries(t))if(!h.items.hasOwnProperty(n)){h.items[n]=o;let t="number"==typeof e?e:-1;if(-1===t){const e=h.order.indexOf("object");t=e>-1?e:h.order.length}t=Math.min(Math.max(0,t),h.order.length),h.order.splice(t,0,n),r.push(n)}return r}function p(t){const e=[...h.order];return!!t.every((t=>e.includes(t)))&&(h.order=t.slice(),!0)}function c(){return[...h.order]}const y=t=>{if(null===t)return"null";for(const e of h.order)if(!h.items[e]||h.items[e](t))return e;return"unknown"};function g(t,e){if(void 0===t)return null;const r=y(t);return"string"==typeof e?r===e.toLowerCase():r}function d(t){return Array.isArray(t)?t.length:g(t,"object")?Object.keys(t).length:0}function w(t,e,r,n=!1){return n?Number(t*e)/r:Number(r*e)/t}function m(t,e){return t*(e/100)}function v(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(),f=n.getDate(),u=r.getDate();return(i<s||i===s&&f<u)&&o--,Math.abs(o)}return null}function b(t){return t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function E(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)}})(),window.TinyEssentials=n})();
2
+ (()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,u=8*o-n-1,f=(1<<u)-1,a=f>>1,h=-7,l=r?o-1:0,c=r?-1:1,p=t[e+l];for(l+=c,i=p&(1<<-h)-1,p>>=-h,h+=u;h>0;i=256*i+t[e+l],l+=c,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=256*s+t[e+l],l+=c,h-=8);if(0===i)i=1-a;else{if(i===f)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=a}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,u,f,a=8*i-o-1,h=(1<<a)-1,l=h>>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+l>=1?c/f:c*Math.pow(2,1-l))*f>=2&&(s++,f/=2),s+l>=h?(u=0,s=h):s+l>=1?(u=(e*f-1)*Math.pow(2,o),s+=l):(u=e*Math.pow(2,l-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,a+=o;a>0;t[r+p]=255&s,p+=y,s/=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=f,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,f.prototype),e}function f(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 l(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"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|g(t,e),n=u(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(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 f.from(n,e,r);var o=function(t){if(f.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||_(t.length)?u(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.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 l(t){return h(t),u(t<0?0:0|y(t))}function c(t){for(var e=t.length<0?0:0|y(t.length),r=u(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(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 F(t).length;default:if(o)return n?-1:D(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 S(this,e,r);case"utf8":case"utf-8":return U(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(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),_(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=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,s=1,u=t.length,f=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,f/=2,r/=2}function a(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var h=-1;for(i=r;i<u;i++)if(a(t,i)===a(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===f)return h*s}else-1!==h&&(i-=i-h),h=-1}else for(r+f>u&&(r=u-f),i=r;i>=0;i--){for(var l=!0,c=0;c<f;c++)if(a(t,i+c)!==a(e,c)){l=!1;break}if(l)return i}return-1}function b(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(_(u))return s;t[r+s]=u}return s}function E(t,e,r,n){return q(D(e,t.length-r),t,r,n)}function A(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function x(t,e,r,n){return q(F(e),t,r,n)}function B(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function U(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,u,f,a=t[o],h=null,l=a>239?4:a>223?3:a>191?2:1;if(o+l<=r)switch(l){case 1:a<128&&(h=a);break;case 2:128==(192&(i=t[o+1]))&&(f=(31&a)<<6|63&i)>127&&(h=f);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(f=(15&a)<<12|(63&i)<<6|63&s)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:i=t[o+1],s=t[o+2],u=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&u)&&(f=(15&a)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&f<1114112&&(h=f)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=l}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=L));return r}(n)}f.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}}(),f.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(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return h(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)},f.allocUnsafe=function(t){return l(t)},f.allocUnsafeSlow=function(t){return l(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(Y(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),Y(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.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},f.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}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(Y(i,Uint8Array))o+i.length>n.length?f.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!f.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},f.byteLength=g,f.prototype._isBuffer=!0,f.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},f.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},f.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},f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?U(this,0,t):d.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.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&&(f.prototype[i]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,o){if(Y(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.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),a=this.slice(n,o),h=t.slice(e,r),l=0;l<u;++l)if(a[l]!==h[l]){i=a[l],s=h[l];break}return i<s?-1:s<i?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},f.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 b(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 x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function O(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 S(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+=z[t[i]];return o}function N(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 C(t,e,r,n,o,i){if(!f.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 k(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 R(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}f.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,f.prototype),n},f.prototype.readUintLE=f.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},f.prototype.readUintBE=f.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},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.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]},f.prototype.readUint32BE=f.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])},f.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},f.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},f.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.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},f.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},f.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},f.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]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(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},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(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},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);C(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},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);C(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},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},f.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.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},f.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&&!f.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=f.isBuffer(t)?t:f.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 P=/[^+/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 F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(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 Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function _(t){return t!=t}var z=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],f=i[1],a=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,f)),h=0,l=f>0?s-4:s;for(r=0;r<l;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===f&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,a[h++]=255&e),1===f&&(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=[],s=16383,u=0,a=n-o;u<a;u+=s)i.push(f(t,u,u+s>a?a: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 f(t,e,n){for(var o,i,s=[],u=e;u<n;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";async function t(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()))}r.r(n),r.d(n,{TinyLevelUp:()=>e,TinyPromiseQueue:()=>x,asyncReplace:()=>t,checkObj:()=>d,cloneObjTypeOrder:()=>p,countObj:()=>m,extendObjType:()=>l,formatCustomTimer:()=>s,formatDayTimer:()=>f,formatTimer:()=>u,getAge:()=>b,getSimplePerc:()=>v,getTimeDuration:()=>i,objType:()=>g,reorderObjTypeOrder:()=>c,ruleOfThree:()=>w,shuffleArray:()=>o,toTitleCase:()=>E,toTitleCaseLowerFirst:()=>A});const e=class{constructor(t,e){this.giveExp=t,this.expLevel=e}expValidator(t){let e=0;const r=this.expLevel*t.level;return t.exp>=r&&(t.level++,e=t.exp-r,t.exp=0,e>0)?this.give(t,e,"extra"):t.exp<1&&t.level>1&&(t.level--,e=Math.abs(t.exp),t.exp=this.expLevel*t.level,e>0)?this.remove(t,e,"extra"):t}getTotalExp(t){let e=0;for(let r=1;r<=t.level;r++)e+=this.expLevel*r;return e+=t.exp,e}expGenerator(t=1){return Math.floor(Math.random()*this.giveExp)+1*t}progress(t){return this.expLevel*t.level}getProgress(t){return this.expLevel*t.level}set(t,e){return t.exp=e,this.expValidator(t),t.totalExp=this.getTotalExp(t),t}give(t,e=0,r="add",n=1){return"add"===r?t.exp+=this.expGenerator(n)+e:"extra"===r&&(t.exp+=e),this.expValidator(t),t.totalExp=this.getTotalExp(t),t}remove(t,e=0,r="add",n=1){return"add"===r?t.exp-=this.expGenerator(n)+e:"extra"===r&&(t.exp-=e),this.expValidator(t),t.totalExp=this.getTotalExp(t),t}};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,f=n>=1,a=n>=0,h={years:o?0:NaN,months:i?0:NaN,days:s?0:NaN,hours:u?0:NaN,minutes:f?0:NaN,seconds:a?0:NaN,total:NaN};let l=t;if(o||i||s){const t=new Date(1980,0,1),e=new Date(t.getTime()+1e3*l),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(s)for(;new Date(r.getFullYear(),r.getMonth(),r.getDate()+1).getTime()<=e.getTime();)r.setDate(r.getDate()+1),h.days++;l=Math.floor((e.getTime()-r.getTime())/1e3)}u&&(h.hours=Math.floor(l/3600),l%=3600),f&&(h.minutes=Math.floor(l/60),l%=60),a&&(h.seconds=l);const c={seconds:a?t:NaN,minutes:f?t/60:NaN,hours:u?t/3600:NaN,days:s?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=+(c[e]||0).toFixed(2).replace(/\.00$/,"");const p=t=>{const e="string"==typeof t?parseInt(t):t;return Number.isNaN(e)?"NaN":String(e).padStart(2,"0")},y=[u?p(h.hours):null,f?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 u(t){return s(t,"hours","{hours}:{minutes}:{seconds}")}function f(t){return s(t,"days","{days}d {hours}:{minutes}:{seconds}")}var a=r(287);const h={items:{undefined:t=>void 0===t,null:t=>null===t,boolean:t=>"boolean"==typeof t,number:t=>"number"==typeof t&&!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),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,buffer:t=>void 0!==a.hp&&a.hp.isBuffer(t),file:t=>"undefined"!=typeof File&&t instanceof File,htmlelement:t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement,object:t=>"object"==typeof t&&null!==t},order:["undefined","null","boolean","number","bigint","string","symbol","function","array","buffer","file","date","regexp","map","set","weakmap","weakset","promise","htmlelement","object"]};function l(t,e){const r=[];for(const[n,o]of Object.entries(t))if(!h.items.hasOwnProperty(n)){h.items[n]=o;let t="number"==typeof e?e:-1;if(-1===t){const e=h.order.indexOf("object");t=e>-1?e:h.order.length}t=Math.min(Math.max(0,t),h.order.length),h.order.splice(t,0,n),r.push(n)}return r}function c(t){const e=[...h.order];return!!t.every((t=>e.includes(t)))&&(h.order=t.slice(),!0)}function p(){return[...h.order]}const y=t=>{if(null===t)return"null";for(const e of h.order)if("function"!=typeof h.items[e]||h.items[e](t))return e;return"unknown"};function g(t,e){if(void 0===t)return null;const r=y(t);return"string"==typeof e?r===e.toLowerCase():r}function d(t){const e={valid:null,type:null};for(const r of h.order)if("function"==typeof h.items[r]){const n=h.items[r](t);if(n){e.valid=n,e.type=r;break}}return e}function m(t){return Array.isArray(t)?t.length:g(t,"object")?Object.keys(t).length:0}function w(t,e,r,n=!1){return n?Number(t*e)/r:Number(r*e)/t}function v(t,e){return t*(e/100)}function b(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(),f=r.getDate();return(i<s||i===s&&u<f)&&o--,Math.abs(o)}return null}function E(t){return t.replace(/\w\S*/g,(t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function A(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)}const x=class{#t=[];#e=!1;#r={};#n=new Set;isRunning(){return this.#e}async#o(){if(this.#e||0===this.#t.length)return;this.#e=!0;const t=this.#t.shift();if(t&&"function"==typeof t.task&&"function"==typeof t.resolve&&"function"==typeof t.reject){const{task:e,resolve:r,reject:n,delay:o,id:i}=t;try{if(o&&i&&await new Promise((t=>{const e=setTimeout((()=>{delete this.#r[i],t(null)}),o);this.#r[i]=e})),i&&this.#n.has(i))return n(new Error("The function was canceled on TinyPromiseQueue.")),this.#n.delete(i),this.#e=!1,void this.#o();r(await e())}catch(t){n(t)}finally{this.#e=!1,this.#o()}}}getIndexById(t){return this.#t.findIndex((e=>e.id===t))}getQueuedIds(){return this.#t.map(((t,e)=>({index:e,id:t.id}))).filter((t=>"string"==typeof t.id))}reorderQueue(t,e){if("number"!=typeof t||"number"!=typeof e||t<0||e<0||t>=this.#t.length||e>=this.#t.length)return;const[r]=this.#t.splice(t,1);this.#t.splice(e,0,r)}enqueue(t,e,r){return new Promise(((n,o)=>{this.#t.push({task:t,resolve:n,reject:o,id:r,delay:e}),this.#o()}))}cancelTask(t){if(!t)return!1;let e=!1;t in this.#r&&(clearTimeout(this.#r[t]),delete this.#r[t],e=!0);const r=this.getIndexById(t);return-1!==r&&(this.#t.splice(r,1),e=!0),e&&this.#n.add(t),e}}})(),window.TinyEssentials=n})();
@@ -0,0 +1,214 @@
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
+ TinyPromiseQueue: () => (/* reexport */ libs_TinyPromiseQueue)
30
+ });
31
+
32
+ ;// ./src/v1/libs/TinyPromiseQueue.mjs
33
+ /**
34
+ * A queue system for managing and executing asynchronous tasks sequentially, one at a time.
35
+ *
36
+ * Tasks can be delayed, reordered, canceled, and processed in strict order. The queue ensures that each task
37
+ * is executed after the previous one finishes, and any task can be skipped or canceled if needed.
38
+ *
39
+ * @class
40
+ */
41
+ class TinyPromiseQueue {
42
+ /**
43
+ * @typedef {Object} QueuedTask
44
+ * @property {() => Promise<any>} task - The async task to execute.
45
+ * @property {(value: any) => any} resolve - The resolve function from the Promise.
46
+ * @property {(reason?: any) => any} reject - The reject function from the Promise.
47
+ * @property {string|undefined} [id] - Optional identifier for the task.
48
+ * @property {number|null|undefined} [delay] - Optional delay (in ms) before the task is executed.
49
+ */
50
+
51
+ /** @type {Array<QueuedTask>} */
52
+ #queue = [];
53
+ #running = false;
54
+ /** @type {Record<string, *>} */
55
+ #timeouts = {};
56
+ /** @type {Set<string>} */
57
+ #blacklist = new Set();
58
+
59
+ /**
60
+ * Returns whether the queue is currently processing a task.
61
+ *
62
+ * @returns {boolean}
63
+ */
64
+ isRunning() {
65
+ return this.#running;
66
+ }
67
+
68
+ /**
69
+ * Processes the next task in the queue if not already running.
70
+ * Ensures tasks are executed in order, one at a time.
71
+ *
72
+ * @returns {Promise<void>}
73
+ */
74
+ async #processQueue() {
75
+ if (this.#running || this.#queue.length === 0) return;
76
+ this.#running = true;
77
+ const data = this.#queue.shift();
78
+ if (
79
+ data &&
80
+ typeof data.task === 'function' &&
81
+ typeof data.resolve === 'function' &&
82
+ typeof data.reject === 'function'
83
+ ) {
84
+ const { task, resolve, reject, delay, id } = data;
85
+ try {
86
+ if (delay && id) {
87
+ await new Promise((resolveDelay) => {
88
+ const timeoutId = setTimeout(() => {
89
+ delete this.#timeouts[id];
90
+ resolveDelay(null);
91
+ }, delay);
92
+ this.#timeouts[id] = timeoutId;
93
+ });
94
+ }
95
+
96
+ if (id && this.#blacklist.has(id)) {
97
+ reject(new Error('The function was canceled on TinyPromiseQueue.'));
98
+ this.#blacklist.delete(id);
99
+ this.#running = false;
100
+ this.#processQueue();
101
+ return;
102
+ }
103
+
104
+ const result = await task();
105
+ resolve(result);
106
+ } catch (error) {
107
+ reject(error);
108
+ } finally {
109
+ this.#running = false;
110
+ this.#processQueue();
111
+ }
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Returns the index of a task by its ID.
117
+ *
118
+ * @param {string} id The ID of the task to locate.
119
+ * @returns {number} The index of the task in the queue, or -1 if not found.
120
+ */
121
+ getIndexById(id) {
122
+ return this.#queue.findIndex((item) => item.id === id);
123
+ }
124
+
125
+ /**
126
+ * Returns a list of IDs for all tasks currently in the queue.
127
+ *
128
+ * @returns {{ index: number, id: string }[]} An array of task IDs currently queued.
129
+ */
130
+ getQueuedIds() {
131
+ // @ts-ignore
132
+ return this.#queue
133
+ .map((item, index) => ({ index, id: item.id }))
134
+ .filter((entry) => typeof entry.id === 'string');
135
+ }
136
+
137
+ /**
138
+ * Reorders a task in the queue from one index to another.
139
+ *
140
+ * @param {number} fromIndex The current index of the task to move.
141
+ * @param {number} toIndex The index where the task should be placed.
142
+ */
143
+ reorderQueue(fromIndex, toIndex) {
144
+ if (
145
+ typeof fromIndex !== 'number' ||
146
+ typeof toIndex !== 'number' ||
147
+ fromIndex < 0 ||
148
+ toIndex < 0 ||
149
+ fromIndex >= this.#queue.length ||
150
+ toIndex >= this.#queue.length
151
+ )
152
+ return;
153
+ const [item] = this.#queue.splice(fromIndex, 1);
154
+ this.#queue.splice(toIndex, 0, item);
155
+ }
156
+
157
+ /**
158
+ * Adds a new async task to the queue and ensures it runs in order after previous tasks.
159
+ * Optionally, a delay can be added before the task is executed.
160
+ *
161
+ * If the task is canceled before execution, it will be rejected with the message:
162
+ * "The function was canceled on TinyPromiseQueue."
163
+ *
164
+ * @param {(...args: any[]) => Promise<any>} task A function that returns a Promise to be executed sequentially.
165
+ * @param {number|null} [delay] Optional delay (in ms) before the task is executed.
166
+ * @param {string} [id] Optional ID to identify the task in the queue.
167
+ * @returns {Promise<any>} A Promise that resolves or rejects with the result of the task once it's processed.
168
+ */
169
+ enqueue(task, delay, id) {
170
+ return new Promise((resolve, reject) => {
171
+ this.#queue.push({ task, resolve, reject, id, delay });
172
+ this.#processQueue();
173
+ });
174
+ }
175
+
176
+ /**
177
+ * Cancels a scheduled delay and removes the task from the queue.
178
+ * Adds the ID to a blacklist so the task is skipped if already being processed.
179
+ *
180
+ * @param {string} id The ID of the task to cancel.
181
+ * @returns {boolean} True if a delay was cancelled and the task was removed.
182
+ */
183
+ cancelTask(id) {
184
+ if (!id) return false;
185
+ let cancelled = false;
186
+
187
+ if (id in this.#timeouts) {
188
+ clearTimeout(this.#timeouts[id]);
189
+ delete this.#timeouts[id];
190
+ cancelled = true;
191
+ }
192
+
193
+ const index = this.getIndexById(id);
194
+ if (index !== -1) {
195
+ this.#queue.splice(index, 1);
196
+ cancelled = true;
197
+ }
198
+
199
+ if (cancelled) this.#blacklist.add(id);
200
+
201
+ return cancelled;
202
+ }
203
+ }
204
+
205
+ /* harmony default export */ const libs_TinyPromiseQueue = (TinyPromiseQueue);
206
+
207
+ ;// ./src/v1/build/TinyPromiseQueue.mjs
208
+
209
+
210
+
211
+
212
+ window.TinyPromiseQueue = __webpack_exports__.TinyPromiseQueue;
213
+ /******/ })()
214
+ ;
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{TinyPromiseQueue:()=>i});const i=class{#e=[];#t=!1;#i={};#s=new Set;isRunning(){return this.#t}async#u(){if(this.#t||0===this.#e.length)return;this.#t=!0;const e=this.#e.shift();if(e&&"function"==typeof e.task&&"function"==typeof e.resolve&&"function"==typeof e.reject){const{task:t,resolve:i,reject:s,delay:u,id:n}=e;try{if(u&&n&&await new Promise((e=>{const t=setTimeout((()=>{delete this.#i[n],e(null)}),u);this.#i[n]=t})),n&&this.#s.has(n))return s(new Error("The function was canceled on TinyPromiseQueue.")),this.#s.delete(n),this.#t=!1,void this.#u();i(await t())}catch(e){s(e)}finally{this.#t=!1,this.#u()}}}getIndexById(e){return this.#e.findIndex((t=>t.id===e))}getQueuedIds(){return this.#e.map(((e,t)=>({index:t,id:e.id}))).filter((e=>"string"==typeof e.id))}reorderQueue(e,t){if("number"!=typeof e||"number"!=typeof t||e<0||t<0||e>=this.#e.length||t>=this.#e.length)return;const[i]=this.#e.splice(e,1);this.#e.splice(t,0,i)}enqueue(e,t,i){return new Promise(((s,u)=>{this.#e.push({task:e,resolve:s,reject:u,id:i,delay:t}),this.#u()}))}cancelTask(e){if(!e)return!1;let t=!1;e in this.#i&&(clearTimeout(this.#i[e]),delete this.#i[e],t=!0);const i=this.getIndexById(e);return-1!==i&&(this.#e.splice(i,1),t=!0),t&&this.#s.add(e),t}};window.TinyPromiseQueue=t.TinyPromiseQueue})();
@@ -16,3 +16,4 @@ export function decrypt(tinyCrypto: {
16
16
  algorithm: string;
17
17
  stringType: BufferEncoding;
18
18
  }, text: string): string;
19
+ //# sourceMappingURL=decrypt.d.mts.map
@@ -33,3 +33,4 @@ export type DefaultCrypto = {
33
33
  * @type {DefaultCrypto}
34
34
  */
35
35
  declare const defaultCrypto: DefaultCrypto;
36
+ //# sourceMappingURL=default.d.mts.map
@@ -17,3 +17,4 @@ export function encrypt(tinyCrypto: {
17
17
  algorithm: string;
18
18
  stringType: BufferEncoding;
19
19
  }, text: string): string;
20
+ //# sourceMappingURL=encrypt.d.mts.map
@@ -2,3 +2,4 @@ import defaultCrypto from './default.mjs';
2
2
  import { encrypt } from './encrypt.mjs';
3
3
  import { decrypt } from './decrypt.mjs';
4
4
  export { defaultCrypto, encrypt, decrypt };
5
+ //# sourceMappingURL=index.d.mts.map
@@ -54,3 +54,4 @@ declare class AuthSystem {
54
54
  */
55
55
  genCookieSession(auth: Record<string, any>, token: string): Promise<string>;
56
56
  }
57
+ //# sourceMappingURL=cookieSession.d.mts.map
@@ -5,3 +5,4 @@ declare namespace database {
5
5
  }
6
6
  import presenceSystem from './presence.mjs';
7
7
  import SaveAsync from './saveAsync.mjs';
8
+ //# sourceMappingURL=index.d.mts.map
@@ -7,3 +7,4 @@ declare namespace presenceSystem {
7
7
  getDate?: Function | undefined;
8
8
  }): void;
9
9
  }
10
+ //# sourceMappingURL=presence.d.mts.map
@@ -52,3 +52,4 @@ declare class SaveAsync {
52
52
  */
53
53
  insert(data?: object, type?: string, where?: string | null): void;
54
54
  }
55
+ //# sourceMappingURL=saveAsync.d.mts.map
@@ -9,3 +9,4 @@
9
9
  * @returns {string|null} The escaped string or null if the input is neither a string nor a number.
10
10
  */
11
11
  export default function databaseEscape(text: string | number, keepPath?: boolean): string | null;
12
+ //# sourceMappingURL=databaseEscape.d.mts.map
@@ -5,3 +5,4 @@ declare namespace databaseLogger {
5
5
  function changeCacheLimit(value: number): void;
6
6
  function setDebugMode(value: boolean): void;
7
7
  }
8
+ //# sourceMappingURL=databaseLogger.d.mts.map
@@ -36,3 +36,4 @@ export default function addGuildMember(bot_token: string, data: {
36
36
  mute?: boolean | undefined;
37
37
  deaf?: boolean | undefined;
38
38
  }): Promise<Record<string, any>>;
39
+ //# sourceMappingURL=addGuildMember.d.mts.map
@@ -15,3 +15,4 @@
15
15
  * .catch((err) => console.error('Widget error:', err));
16
16
  */
17
17
  export default function getGuildWidget(guildID: string): Promise<Record<string, any>>;
18
+ //# sourceMappingURL=getGuildWidget.d.mts.map
@@ -33,3 +33,4 @@ export default function getToken(dsData: {
33
33
  redirect_uri: string;
34
34
  scope?: string | undefined;
35
35
  }): Promise<Record<string, any>>;
36
+ //# sourceMappingURL=getToken.d.mts.map
@@ -25,3 +25,4 @@
25
25
  * .catch(err => console.error('Error:', err));
26
26
  */
27
27
  export default function getUser(access_token: string, type?: string, user?: string, version?: string): Promise<Record<string, any>>;
28
+ //# sourceMappingURL=getUser.d.mts.map
@@ -24,3 +24,4 @@
24
24
  * .catch(err => console.error('Failed to get connections:', err));
25
25
  */
26
26
  export default function getUserConnections(access_token: string): Promise<Array<Record<string, any>>>;
27
+ //# sourceMappingURL=getUserConnections.d.mts.map
@@ -23,3 +23,4 @@
23
23
  * .catch(err => console.error('Failed to get guilds:', err));
24
24
  */
25
25
  export default function getUserGuilds(access_token: string): Promise<Array<Record<string, any>>>;
26
+ //# sourceMappingURL=getUserGuilds.d.mts.map
@@ -17,3 +17,4 @@ import getGuildWidget from './getGuildWidget.mjs';
17
17
  import getUserConnections from './getUserConnections.mjs';
18
18
  import addGuildMember from './addGuildMember.mjs';
19
19
  import refreshToken from './refreshToken.mjs';
20
+ //# sourceMappingURL=index.d.mts.map
@@ -43,3 +43,4 @@ export default function refreshToken(dsData: {
43
43
  redirect_uri: string;
44
44
  scope: string;
45
45
  }): Promise<Record<string, any>>;
46
+ //# sourceMappingURL=refreshToken.d.mts.map
@@ -27,3 +27,4 @@ export default function revokeToken(access_token: string, tinyAuth: {
27
27
  client_id: string;
28
28
  client_secret: string;
29
29
  }): Promise<Record<string, any>>;
30
+ //# sourceMappingURL=revokeToken.d.mts.map
@@ -25,3 +25,4 @@ export type Config = {
25
25
  * @type {Config}
26
26
  */
27
27
  declare const config: Config;
28
+ //# sourceMappingURL=config.d.mts.map
@@ -5,3 +5,4 @@ declare namespace getItems {
5
5
  }
6
6
  import login from './login.mjs';
7
7
  import logout from './logout.mjs';
8
+ //# sourceMappingURL=index.d.mts.map
@@ -2,3 +2,4 @@ export default login;
2
2
  declare namespace login {
3
3
  function run(token: string, redirect_url: string, csrfToken: string, callback?: Function): void;
4
4
  }
5
+ //# sourceMappingURL=login.d.mts.map
@@ -2,3 +2,4 @@ export default logout;
2
2
  declare namespace logout {
3
3
  function run(token: string, redirect_url: string, csrfToken: string, original_csrfToken: string, callback?: Function): void;
4
4
  }
5
+ //# sourceMappingURL=logout.d.mts.map
@@ -21,3 +21,4 @@
21
21
  * console.log(webhookAuthUrl);
22
22
  */
23
23
  export default function authURLGenerator(tinyCfg: Record<string, any>, jsonState: Record<string, any>, tinyCrypto: Record<string, any>, type: string): string;
24
+ //# sourceMappingURL=authURLGenerator.d.mts.map
@@ -18,3 +18,4 @@
18
18
  * }
19
19
  */
20
20
  export default function cookieSession(req: Record<string, any>, where: string): string | null;
21
+ //# sourceMappingURL=cookie-session.d.mts.map
@@ -17,3 +17,4 @@ export default function credentials(tinyAuth: {
17
17
  client_id: string;
18
18
  client_secret: string;
19
19
  }): string;
20
+ //# sourceMappingURL=credentials.d.mts.map
@@ -26,3 +26,4 @@
26
26
  * console.log(result); // { data: null, error: { code: 500, message: 'Invalid HTTP Result!' } }
27
27
  */
28
28
  export default function errorValidator(data: Object | any[]): Record<string, any>;
29
+ //# sourceMappingURL=errorValidator.d.mts.map
@@ -11,3 +11,4 @@ import authURLGenerator from './authURLGenerator.mjs';
11
11
  import credentials from './credentials.mjs';
12
12
  import errorValidator from './errorValidator.mjs';
13
13
  import randomAvatar from './randomAvatar.mjs';
14
+ //# sourceMappingURL=index.d.mts.map
@@ -20,3 +20,4 @@
20
20
  * console.log(avatarURL); // Example output: https://cdn.discordapp.com/embed/avatars/2.png
21
21
  */
22
22
  export default function randomAvatar(value?: string | number | null, url?: string): string;
23
+ //# sourceMappingURL=randomAvatar.d.mts.map
@@ -9,3 +9,4 @@ import login from './login.mjs';
9
9
  import logout from './logout.mjs';
10
10
  import redirect from './redirect.mjs';
11
11
  import refreshToken from './refreshToken.mjs';
12
+ //# sourceMappingURL=index.d.mts.map
@@ -19,3 +19,4 @@
19
19
  * });
20
20
  */
21
21
  export default function login(req: Record<string, any>, res: Record<string, any>, cfg: Record<string, any>, existSession: boolean): void;
22
+ //# sourceMappingURL=login.d.mts.map
@@ -20,3 +20,4 @@
20
20
  * });
21
21
  */
22
22
  export default function logout(req: Record<string, any>, access_token: string | number, cfg: Record<string, any>, existSession: boolean): Promise<Record<string, any>>;
23
+ //# sourceMappingURL=logout.d.mts.map
@@ -22,3 +22,4 @@
22
22
  * });
23
23
  */
24
24
  export default function redirect(req: Record<string, any>, cfg: Record<string, any>, existSession: boolean): Promise<Record<string, any>>;
25
+ //# sourceMappingURL=redirect.d.mts.map
@@ -22,3 +22,4 @@
22
22
  * }
23
23
  */
24
24
  export default function refreshToken(req: Record<string, any>, cfg: Record<string, any>, existSession: boolean): Promise<Record<string, any>>;
25
+ //# sourceMappingURL=refreshToken.d.mts.map
@@ -13,3 +13,4 @@ import login from './http/login.mjs';
13
13
  import logout from './http/logout.mjs';
14
14
  import redirect from './http/redirect.mjs';
15
15
  import refreshToken from './http/refreshToken.mjs';
16
+ //# sourceMappingURL=index.d.mts.map
@@ -20,3 +20,4 @@ export default function cookieSession(app: Record<string, any>, cfg: Record<stri
20
20
  getUserGuilds: (req: any, res: any, next: any) => void;
21
21
  };
22
22
  };
23
+ //# sourceMappingURL=cookie-session.d.mts.map
@@ -10,3 +10,4 @@
10
10
  * @returns {Function} A middleware function for use in an Express.js application.
11
11
  */
12
12
  export default function domainRedirect(domains?: string[], baseurl?: string, callback?: Function): Function;
13
+ //# sourceMappingURL=domainRedirect.d.mts.map
@@ -15,3 +15,4 @@ export const encode: any;
15
15
  export const decode: any;
16
16
  export const encodeComponents: any;
17
17
  export const decodeComponents: any;
18
+ //# sourceMappingURL=escape.d.mts.map