@devlander/utils
Version:
Comprehensive JavaScript and TypeScript utilities for seamless development. Includes object manipulation, data validation, and more.
1 lines • 54.3 kB
JavaScript
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).DevlanderUtils={})}(this,(function(t){"use strict";var r;function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function n(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=s(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}function o(t,r,e){return(r=function(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function i(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function a(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?i(Object(e),!0).forEach((function(r){o(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function u(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],f=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;f=!1}else for(;!(f=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);f=!0);}catch(t){c=!0,o=t}finally{try{if(!f&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,r)||s(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||s(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function s(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}t.DeduplicateInputType=void 0,(r=t.DeduplicateInputType||(t.DeduplicateInputType={})).STRING="string",r.OBJECT="object",r.ARRAY="array",r.NUMBER="number",r.MATRIX="matrix";var l=["and","to",".","the",",","of","in","for","&","a","an","with","on","at","from","as","by","or","but","into","is","are","was","were","be","being","been","have","has","had","having","do","does","did","doing","will","would","should","can","could","may","might","must","ought","shall","should","there","their","they","them","these","those","this","that","then","than","thus","so","such","if","else","not","no","yes","i","you","he","she","it","we","me","him","her","us","my","your","his","its","our","mine","yours","hers","ours","theirs","who","whom","which","what","when","where","why","how","up","about","into","with","over","before","after","between","among","through","during","above","below","out","off","down","under","again","further","once","here","all","any","both","each","few","more","most","other","some","such","both","each"];function h(t,r){var e=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,n=void 0!==e&&e;if(null!=t)if("object"!==c(t)&&(t=[t]),Array.isArray(t))for(var o=0,i=t.length;o<i;o++)r.call(null,t[o],o,t);else for(var a=n?Object.getOwnPropertyNames(t):Object.keys(t),u=a.length,f=0;f<u;f++){var s=a[f];r.call(null,t[s],s,t)}}var p="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},g=[],d=[],y="undefined"!=typeof Uint8Array?Uint8Array:Array,v=!1;function m(){v=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)g[r]=t[r],d[t.charCodeAt(r)]=r;d["-".charCodeAt(0)]=62,d["_".charCodeAt(0)]=63}function b(t,r,e){for(var n,o,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(g[(o=n)>>18&63]+g[o>>12&63]+g[o>>6&63]+g[63&o]);return i.join("")}function w(t){var r;v||m();for(var e=t.length,n=e%3,o="",i=[],a=16383,u=0,f=e-n;u<f;u+=a)i.push(b(t,u,u+a>f?f:u+a));return 1===n?(r=t[e-1],o+=g[r>>2],o+=g[r<<4&63],o+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],o+=g[r>>10],o+=g[r>>4&63],o+=g[r<<2&63],o+="="),i.push(o),i.join("")}function A(t,r,e,n,o){var i,a,u=8*o-n-1,f=(1<<u)-1,c=f>>1,s=-7,l=e?o-1:0,h=e?-1:1,p=t[r+l];for(l+=h,i=p&(1<<-s)-1,p>>=-s,s+=u;s>0;i=256*i+t[r+l],l+=h,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[r+l],l+=h,s-=8);if(0===i)i=1-c;else{if(i===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)}function E(t,r,e,n,o,i){var a,u,f,c=8*i-o-1,s=(1<<c)-1,l=s>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,g=n?1:-1,d=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=s):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),(r+=a+l>=1?h/f:h*Math.pow(2,1-l))*f>=2&&(a++,f/=2),a+l>=s?(u=0,a=s):a+l>=1?(u=(r*f-1)*Math.pow(2,o),a+=l):(u=r*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[e+p]=255&u,p+=g,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;t[e+p]=255&a,p+=g,a/=256,c-=8);t[e+p-g]|=128*d}var S={}.toString,O=Array.isArray||function(t){return"[object Array]"==S.call(t)};function R(){return T.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function P(t,r){if(R()<r)throw new RangeError("Invalid typed array length");return T.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=T.prototype:(null===t&&(t=new T(r)),t.length=r),t}function T(t,r,e){if(!(T.TYPED_ARRAY_SUPPORT||this instanceof T))return new T(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return I(this,t)}return j(this,t,r,e)}function j(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);T.TYPED_ARRAY_SUPPORT?(t=r).__proto__=T.prototype:t=B(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!T.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|M(r,e);t=P(t,n);var o=t.write(r,e);o!==n&&(t=t.slice(0,o));return t}(t,r,e):function(t,r){if(C(r)){var e=0|N(r.length);return 0===(t=P(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?P(t,0):B(t,r);if("Buffer"===r.type&&O(r.data))return B(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function x(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function I(t,r){if(x(r),t=P(t,r<0?0:0|N(r)),!T.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function B(t,r){var e=r.length<0?0:0|N(r.length);t=P(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function N(t){if(t>=R())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R().toString(16)+" bytes");return 0|t}function C(t){return!(null==t||!t._isBuffer)}function M(t,r){if(C(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return ut(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return ft(t).length;default:if(n)return ut(t).length;r=(""+r).toLowerCase(),n=!0}}function U(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return G(this,r,e);case"utf8":case"utf-8":return V(this,r,e);case"ascii":return K(this,r,e);case"latin1":case"binary":return H(this,r,e);case"base64":return J(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function L(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=T.from(r,n)),C(r))return 0===r.length?-1:D(t,r,e,n,o);if("number"==typeof r)return r&=255,T.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):D(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function D(t,r,e,n,o){var i,a=1,u=t.length,f=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;a=2,u/=2,f/=2,e/=2}function c(t,r){return 1===a?t[r]:t.readUInt16BE(r*a)}if(o){var s=-1;for(i=e;i<u;i++)if(c(t,i)===c(r,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===f)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(e+f>u&&(e=u-f),i=e;i>=0;i--){for(var l=!0,h=0;h<f;h++)if(c(t,i+h)!==c(r,h)){l=!1;break}if(l)return i}return-1}function Y(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(r.substr(2*a,2),16);if(isNaN(u))return a;t[e+a]=u}return a}function k(t,r,e,n){return ct(ut(r,t.length-e),t,e,n)}function F(t,r,e,n){return ct(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function z(t,r,e,n){return F(t,r,e,n)}function W(t,r,e,n){return ct(ft(r),t,e,n)}function $(t,r,e,n){return ct(function(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)n=(e=t.charCodeAt(a))>>8,o=e%256,i.push(o),i.push(n);return i}(r,t.length-e),t,e,n)}function J(t,r,e){return 0===r&&e===t.length?w(t):w(t.slice(r,e))}function V(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,a,u,f,c=t[o],s=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=e)switch(l){case 1:c<128&&(s=c);break;case 2:128==(192&(i=t[o+1]))&&(f=(31&c)<<6|63&i)>127&&(s=f);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(f=(15&c)<<12|(63&i)<<6|63&a)>2047&&(f<55296||f>57343)&&(s=f);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(f=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(s=f)}null===s?(s=65533,l=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=l}return function(t){var r=t.length;if(r<=Z)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Z));return e}(n)}T.TYPED_ARRAY_SUPPORT=void 0===p.TYPED_ARRAY_SUPPORT||p.TYPED_ARRAY_SUPPORT,T.poolSize=8192,T._augment=function(t){return t.__proto__=T.prototype,t},T.from=function(t,r,e){return j(null,t,r,e)},T.TYPED_ARRAY_SUPPORT&&(T.prototype.__proto__=Uint8Array.prototype,T.__proto__=Uint8Array),T.alloc=function(t,r,e){return function(t,r,e,n){return x(r),r<=0?P(t,r):void 0!==e?"string"==typeof n?P(t,r).fill(e,n):P(t,r).fill(e):P(t,r)}(null,t,r,e)},T.allocUnsafe=function(t){return I(null,t)},T.allocUnsafeSlow=function(t){return I(null,t)},T.isBuffer=function(t){return null!=t&&(!!t._isBuffer||st(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&st(t.slice(0,0))}(t))},T.compare=function(t,r){if(!C(t)||!C(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},T.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}},T.concat=function(t,r){if(!O(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return T.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=T.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var i=t[e];if(!C(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},T.byteLength=M,T.prototype._isBuffer=!0,T.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 r=0;r<t;r+=2)_(this,r,r+1);return this},T.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 r=0;r<t;r+=4)_(this,r,r+3),_(this,r+1,r+2);return this},T.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 r=0;r<t;r+=8)_(this,r,r+7),_(this,r+1,r+6),_(this,r+2,r+5),_(this,r+3,r+4);return this},T.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?V(this,0,t):U.apply(this,arguments)},T.prototype.equals=function(t){if(!C(t))throw new TypeError("Argument must be a Buffer");return this===t||0===T.compare(this,t)},T.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},T.prototype.compare=function(t,r,e,n,o){if(!C(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(e>>>=0)-(r>>>=0),u=Math.min(i,a),f=this.slice(n,o),c=t.slice(r,e),s=0;s<u;++s)if(f[s]!==c[s]){i=f[s],a=c[s];break}return i<a?-1:a<i?1:0},T.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},T.prototype.indexOf=function(t,r,e){return L(this,t,r,e,!0)},T.prototype.lastIndexOf=function(t,r,e){return L(this,t,r,e,!1)},T.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return Y(this,t,r,e);case"utf8":case"utf-8":return k(this,t,r,e);case"ascii":return F(this,t,r,e);case"latin1":case"binary":return z(this,t,r,e);case"base64":return W(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;function K(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function H(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function G(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=at(t[i]);return o}function X(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function q(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function Q(t,r,e,n,o,i){if(!C(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function tt(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function rt(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function et(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function nt(t,r,e,n,o){return o||et(t,0,e,4),E(t,r,e,n,23,4),e+4}function ot(t,r,e,n,o){return o||et(t,0,e,8),E(t,r,e,n,52,8),e+8}T.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),T.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=T.prototype;else{var o=r-t;e=new T(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},T.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||q(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},T.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||q(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},T.prototype.readUInt8=function(t,r){return r||q(t,1,this.length),this[t]},T.prototype.readUInt16LE=function(t,r){return r||q(t,2,this.length),this[t]|this[t+1]<<8},T.prototype.readUInt16BE=function(t,r){return r||q(t,2,this.length),this[t]<<8|this[t+1]},T.prototype.readUInt32LE=function(t,r){return r||q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},T.prototype.readUInt32BE=function(t,r){return r||q(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},T.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||q(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},T.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||q(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},T.prototype.readInt8=function(t,r){return r||q(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},T.prototype.readInt16LE=function(t,r){r||q(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},T.prototype.readInt16BE=function(t,r){r||q(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},T.prototype.readInt32LE=function(t,r){return r||q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},T.prototype.readInt32BE=function(t,r){return r||q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},T.prototype.readFloatLE=function(t,r){return r||q(t,4,this.length),A(this,t,!0,23,4)},T.prototype.readFloatBE=function(t,r){return r||q(t,4,this.length),A(this,t,!1,23,4)},T.prototype.readDoubleLE=function(t,r){return r||q(t,8,this.length),A(this,t,!0,52,8)},T.prototype.readDoubleBE=function(t,r){return r||q(t,8,this.length),A(this,t,!1,52,8)},T.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||Q(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},T.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||Q(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},T.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,1,255,0),T.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},T.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,2,65535,0),T.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):tt(this,t,r,!0),r+2},T.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,2,65535,0),T.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):tt(this,t,r,!1),r+2},T.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,4,4294967295,0),T.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):rt(this,t,r,!0),r+4},T.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,4,4294967295,0),T.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):rt(this,t,r,!1),r+4},T.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);Q(this,t,r,e,o-1,-o)}var i=0,a=1,u=0;for(this[r]=255&t;++i<e&&(a*=256);)t<0&&0===u&&0!==this[r+i-1]&&(u=1),this[r+i]=(t/a>>0)-u&255;return r+e},T.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);Q(this,t,r,e,o-1,-o)}var i=e-1,a=1,u=0;for(this[r+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[r+i+1]&&(u=1),this[r+i]=(t/a>>0)-u&255;return r+e},T.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,1,127,-128),T.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},T.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,2,32767,-32768),T.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):tt(this,t,r,!0),r+2},T.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,2,32767,-32768),T.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):tt(this,t,r,!1),r+2},T.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,4,2147483647,-2147483648),T.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):rt(this,t,r,!0),r+4},T.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||Q(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),T.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):rt(this,t,r,!1),r+4},T.prototype.writeFloatLE=function(t,r,e){return nt(this,t,r,!0,e)},T.prototype.writeFloatBE=function(t,r,e){return nt(this,t,r,!1,e)},T.prototype.writeDoubleLE=function(t,r,e){return ot(this,t,r,!0,e)},T.prototype.writeDoubleBE=function(t,r,e){return ot(this,t,r,!1,e)},T.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(i<1e3||!T.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},T.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!T.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var a=C(t)?t:ut(new T(t,n).toString()),u=a.length;for(i=0;i<e-r;++i)this[i+r]=a[i%u]}return this};var it=/[^+\/0-9A-Za-z-_]/g;function at(t){return t<16?"0"+t.toString(16):t.toString(16)}function ut(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((e=t.charCodeAt(a))>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function ft(t){return function(t){var r,e,n,o,i,a;v||m();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===t[u-2]?2:"="===t[u-1]?1:0,a=new y(3*u/4-i),n=i>0?u-4:u;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)o=d[t.charCodeAt(r)]<<18|d[t.charCodeAt(r+1)]<<12|d[t.charCodeAt(r+2)]<<6|d[t.charCodeAt(r+3)],a[f++]=o>>16&255,a[f++]=o>>8&255,a[f++]=255&o;return 2===i?(o=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,a[f++]=255&o):1===i&&(o=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,a[f++]=o>>8&255,a[f++]=255&o),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(it,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function ct(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function st(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var lt=Object.prototype.toString;var ht=function(t,r){var e={},n=function(t){t.forEach((function(t){e[t]=!0}))};return Array.isArray(t)?n(t):"string"==typeof t&&void 0!==r&&n(String(t).split(r)),Object.keys(e).forEach((function(t){t||delete e[t]})),e};var pt,gt=function(t,r){for(var e,n=[];null!==(e=t.exec(r));)n.push(e);return n};t.AbbreviateNumberSuffix=void 0,(pt=t.AbbreviateNumberSuffix||(t.AbbreviateNumberSuffix={})).NONE="",pt.K="K",pt.M="M",pt.B="B",pt.T="T",pt.P="P",pt.E="E";var dt,yt,vt;t.SingleItemLabelPrefix=void 0,(dt=t.SingleItemLabelPrefix||(t.SingleItemLabelPrefix={})).Only="Only",dt.Exclusive="Exclusive to",dt.Solely="Solely in",t.MultipleItemsLabelPrefix=void 0,(yt=t.MultipleItemsLabelPrefix||(t.MultipleItemsLabelPrefix={})).IncludedIn="Included in",yt.FoundWithin="Found in",yt.PresentIn="Present in",t.ListConjunction=void 0,(vt=t.ListConjunction||(t.ListConjunction={})).And="and",vt.AsWellAs="as well as",vt.AlongWith="along with";var mt,bt;t.RangeOrAmountEnum=void 0,(mt=t.RangeOrAmountEnum||(t.RangeOrAmountEnum={})).None=" ",mt.Range="Range",mt.Amount="Amount",t.PercentagePrefixEnum=void 0,(bt=t.PercentagePrefixEnum||(t.PercentagePrefixEnum={})).Empty=" ",bt.UpTo="up to",bt.About="about",bt.Around="around",bt.Approximately="approximately";var wt=function(t){return null==t||"object"===c(t)&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length},At=function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"message";if(!wt(r)&&Object.prototype.hasOwnProperty.call(r,e)){var n=r[e];if(n&&Array.isArray(n))return n.find((function(r){return r.includes(String(t))}))||null}return null};function Et(t,r){return r.hasOwnProperty(t)?r[t]:null}var St;t.ProtocolPrefixEnum=void 0,(St=t.ProtocolPrefixEnum||(t.ProtocolPrefixEnum={})).HTTPS="https://",St.HTTP="http://",St.NONE="";var Ot=["visa","mastercard","amex","discover","jcb","dinersclub"];var Rt=function(t){try{var r="string"==typeof t?t:JSON.stringify(t);return JSON.parse(r)}catch(t){return!1}},Pt=function(t){var r=Rt(t);if(!r)throw new Error("Invalid JSON string.");if("boolean"!=typeof r)return function t(r){for(var e in r){if("string"==typeof r[e]&&r[e].includes("\n"))return!0;if("object"===c(r[e])&&null!==r[e]&&t(r[e]))return!0}return!1}(r);throw new Error("Invalid input: input must be a JSON string or an object.")};var Tt={blue:"[34m",green:"[32m",red:"[31m",yellow:"[33m",magenta:"[35m",bgBlue:"[44m",bgGreen:"[42m",bgRed:"[41m",reset:"[0m"},jt=function(t,r,e){var n=Tt[t]||Tt.reset;void 0!==e?console.log("".concat(n,"%s").concat(Tt.reset),r,e):console.log("".concat(n,"%s").concat(Tt.reset),r)},xt=function(t){jt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bgBlue",t)},It=function(){console.log("\n==============================================\n")},Bt=function(t,r){var e,o=n(Object.getOwnPropertyNames(t));try{for(o.s();!(e=o.n()).done;){var i=e.value,a=Object.getOwnPropertyDescriptor(t,i);if(a){var u=r(a,i);!1!==u&&Object.defineProperty(t,i,u||a)}}}catch(t){o.e(t)}finally{o.f()}},Nt=["align-items","align-self","align-content","aspect-ratio","backface-visibility","border-bottom-width","border-end-width","border-left-width","border-right-width","border-start-width","border-top-width","border-width","bottom","color","display","elevation","flex","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","font-family","font-size","font-style","font-weight","height","justify-content","left","letter-spacing","line-height","margin","margin-bottom","margin-end","margin-horizontal","margin-left","margin-right","margin-start","margin-top","margin-vertical","max-height","max-width","min-height","min-width","opacity","overflow","padding","padding-bottom","padding-end","padding-horizontal","padding-left","padding-right","padding-start","padding-top","padding-vertical","position","right","text-align","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-shadow-color","text-shadow-offset","text-shadow-radius","text-transform","top","width","z-index"];var Ct;t.AspectRatioEnum=void 0,(Ct=t.AspectRatioEnum||(t.AspectRatioEnum={}))["4:3"]="4:3",Ct["16:9"]="16:9",Ct["1:1"]="1:1",Ct["3:2"]="3:2",Ct["8:5"]="8:5";function Mt(t,r){"number"==typeof r&&(r=r.toString());for(var e=r.toLowerCase(),n=Object.keys(t),o=n.length;o-- >0;){var i=n[o];if(e===i.toString().toLowerCase())return i}return null}var Ut=function(t){return"[object Object]"===Object.prototype.toString.call(t)};function _t(t,r,e,n){var o=a({},e),i=Mt(e,r)||r;Ut(e[i])&&Ut(t)?e[i]=n(o,r,t):Ut(t)?e[i]=n({},r,t):Array.isArray(t)?e[i]=t.slice():e[i]=t}function Lt(t,r){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.apply(r,n)}}var Dt,Yt=(Dt=Object.create(null),function(t){var r=toString.call(t);return Dt[r]||(Dt[r]=r.slice(8,-1).toLowerCase())}),kt=function(t){return t=t.toLowerCase(),function(r){return Yt(r)===t}};function Ft(t){return kt("function")(t)}var zt=function(t){return t.replace(/\n/g,"")},Wt=function(t){return t.replace(/\s+/g,"")};var $t,Jt=($t=Object.prototype.hasOwnProperty,function(t,r){return $t.call(t,r)}),Vt=kt("undefined"),Zt=function(t){return t=t.toLowerCase(),function(r){return Yt(r)===t}};var Kt=Zt("ArrayBuffer"),Ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Gt=Zt("Date");var Xt=Zt("File"),qt=function(t){var r=kt("object"),e=kt("array");return null!==t&&(r(t)||e(t))},Qt=kt("number");t.abbreviateNumber=function(r,e){var n=[t.AbbreviateNumberSuffix.NONE,t.AbbreviateNumberSuffix.K,t.AbbreviateNumberSuffix.M,t.AbbreviateNumberSuffix.B,t.AbbreviateNumberSuffix.T,t.AbbreviateNumberSuffix.P,t.AbbreviateNumberSuffix.E];if(void 0===r)return"";var o="string"==typeof r?parseFloat(r):r;if(isNaN(o))return"Invalid input";var i=Math.log10(Math.abs(o))/3|0;if(0===i)return o.toString();var a=n[i],u=o/Math.pow(10,3*i);if(null!=e&&e.rounding)switch(e.rounding){case"up":u=Math.ceil(10*u)/10;break;case"down":u=Math.floor(10*u)/10}return"lower"===(null==e?void 0:e.case)?a=a.toLowerCase():"upper"===(null==e?void 0:e.case)&&(a=a.toUpperCase()),u.toFixed(1)+a},t.arrayToObject=function(t){for(var r={},e=0;e<t.length;e++)r[e.toString()]=t[e];return r},t.assignValue=_t,t.binaryToHex=function(t){if(!/^[01]+$/.test(t))throw new Error("Invalid binary input");return(t.length%4==0?t:"0".repeat(4-t.length%4)+t).match(/.{1,4}/g).map((function(t){return parseInt(t,2).toString(16)})).join("")},t.bind=Lt,t.calculatePercentage=function(t,r){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof t||"number"!=typeof r||0===r)throw new Error("Both inputs must be numbers and 'whole' cannot be zero.");var n=t/r*100;return e?Math.trunc(n):n},t.capitalize=function(t){return"string"!=typeof t||0===t.length?t:t.charAt(0).toUpperCase()+t.slice(1)},t.chunkArray=function(t,r){if(!Array.isArray(t)||"number"!=typeof r||r<=0)return[];for(var e=[],n=0;n<t.length;n+=r)e.push(t.slice(n,n+r));return e},t.clamp=function(t,r,e){if("number"!=typeof t||isNaN(t))return r;if("number"!=typeof r||"number"!=typeof e||isNaN(r)||isNaN(e))return t;if(r>e){var n=[e,r];r=n[0],e=n[1]}return Math.min(Math.max(t,r),e)},t.composeLabelFromItems=function(r){var e=r.items,n=r.labelKey,o=r.singleItemPrefix,i=void 0===o?t.SingleItemLabelPrefix.Only:o,a=r.multipleItemsPrefix,u=void 0===a?t.MultipleItemsLabelPrefix.FoundWithin:a,f=r.conjunctionWord,c=void 0===f?t.ListConjunction.And:f;if(!e||0===e.length)return"";var s=t.SingleItemLabelPrefix[i]||i,l=t.MultipleItemsLabelPrefix[u]||u,h=t.ListConjunction[c]||c;if(1===e.length)return"".concat(s," ").concat(e[0][n],":");var p=e.map((function(t,r){var o=r===e.length-1,i=t[n];return o?"".concat(h," ").concat(i):i})).join(", ");return"".concat(l," ").concat(p,":")},t.convertBlobToBase64NativeAsync=function(t){return new Promise((function(r,e){if("undefined"==typeof Blob||!(t instanceof Blob))return e(new Error("The provided value is not a valid Blob."));var n=new FileReader;n.readAsArrayBuffer(t),n.onloadend=function(){var e=n.result,o="data:".concat(t.type,";base64,").concat(T.from(e).toString("base64"));r(o)},n.onerror=function(){e(new Error("Error occurred while reading the Blob."))}}))},t.convertBlobToBase64WebAsync=function(t){return new Promise((function(r,e){if("undefined"==typeof Blob||!(t instanceof Blob))return e(new Error("The provided value is not a valid Blob."));if("undefined"==typeof FileReader)return e(new Error("FileReader is not available in this environment."));var n=new FileReader;n.readAsDataURL(t),n.onloadend=function(){r(n.result)},n.onerror=function(){e(new Error("Error occurred while reading the Blob."))}}))},t.convertVideoTimeStampToSeconds=function(t){var r=t.split(":");if(3!==r.length)throw new Error('Invalid timestamp format. Expected format: "HH:MM:SS"');var e=parseInt(r[0],10),n=parseInt(r[1],10),o=parseInt(r[2],10);if(isNaN(e)||isNaN(n)||isNaN(o))throw new Error('Invalid timestamp format. Expected format: "HH:MM:SS"');if(e<0||n<0||o<0)throw new Error("Invalid timestamp. Negative values are not allowed.");return 3600*e+60*n+o},t.createTransitionalMessage=function(t,r,e){return function(n){var o=n.option,i=n.description,a="[".concat(r," v").concat(t,"] Transitional option '").concat(o,"' ").concat(i);return e?e.replace("{baseMessage}",a):a}},t.dashToCamelCase=function(t){return t.replace(/^-+/,"").replace(/-+$/,"").toLowerCase().replace(/-([a-z])/g,(function(t,r){return r.toUpperCase()}))},t.debounce=function(t,r){var e=null;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];e&&clearTimeout(e),e=setTimeout((function(){t.apply(void 0,o)}),r)}},t.decodeBase64ToString=function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"base64").toString("utf8");if("undefined"!=typeof atob)try{return decodeURIComponent(Array.prototype.map.call(atob(t),(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))}catch(r){return atob(t)}throw new Error("No base64 decoder available in this environment.")},t.deduplicate=function(r,e){if(!e)if("string"==typeof r)e=t.DeduplicateInputType.STRING;else if(Array.isArray(r))e=r.length>0&&r.every(Array.isArray)?t.DeduplicateInputType.MATRIX:t.DeduplicateInputType.ARRAY;else if("number"==typeof r)e=t.DeduplicateInputType.NUMBER;else{if("object"!==c(r)||null===r)throw new Error("Unsupported input type: ".concat(c(r)));e=t.DeduplicateInputType.OBJECT}return function(){switch(e){case t.DeduplicateInputType.STRING:case"STRING":case"string":if("string"==typeof r)return r.split("").filter((function(t,r,e){return e.indexOf(t)===r})).join("");break;case t.DeduplicateInputType.ARRAY:case"ARRAY":case"array":if(Array.isArray(r))return r.filter((function(t,r,e){return e.indexOf(t)===r}));break;case t.DeduplicateInputType.OBJECT:case"OBJECT":case"object":if("object"===c(r)&&!Array.isArray(r)){var n=new Set,o=Object.entries(r).filter((function(t){var r=u(t,2)[1];return!n.has(r)&&(n.add(r),!0)}));return Object.fromEntries(o)}break;case t.DeduplicateInputType.NUMBER:case"NUMBER":case"number":if("number"==typeof r){var i=r.toString().split("").filter((function(t,r,e){return e.indexOf(t)===r})).join("");return parseInt(i,10)}break;case t.DeduplicateInputType.MATRIX:case"MATRIX":case"matrix":if(Array.isArray(r)&&r.every(Array.isArray))return r.map((function(t){return Array.from(new Set(t))}))}throw new Error("Unsupported type or input format for: ".concat(e))}()},t.deepClone=function t(r){if(null===r||"object"!==c(r))return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map((function(r){return t(r)}));if("object"===c(r)){var e={};for(var n in r)r.hasOwnProperty(n)&&(e[n]=t(r[n]));return e}return r},t.defaultStopWords=l,t.encodeStringToBase64=function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"utf8").toString("base64");if("undefined"!=typeof btoa)try{return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(t,r){return String.fromCharCode(parseInt(r,16))})))}catch(r){return btoa(t)}throw new Error("No base64 encoder available in this environment.")},t.endsWith=function(t,r,e){(void 0===e||e>t.length)&&(e=t.length),e-=r.length;var n=t.indexOf(r,e);return-1!==n&&n===e},t.ensureValidStyle=function(t){return t.replace(/([a-z-]+)\s+([^;:]+)(;|$)/gi,(function(t,r,e,n){return"".concat(r,": ").concat(e).concat(";"===n?";":"")})).replace(/([^;])\s*$/gm,"$1;")},t.extend=function(t,r,e){return h(r,(function(r,n){e&&Ft(r)?t[n]=Lt(r,e):t[n]=r}),{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),t},t.extractKeysAndValues=function(t){return{keys:Object.keys(t),values:Object.values(t)}},t.filterAndSuggestItems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["name"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"_id",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:l,u=[];if(!t.trim()||!r.length)return u;var f=t.toLowerCase().split(" ").filter((function(t){return t&&!a.includes(t)}));if(0===f.length)return u;var c,s=new Set(Array.isArray(e)?e.map(String):[String(e)]),h=n(r);try{var p=function(){var t=c.value,r=String(t[i]);if(s.has(r))return 1;o.some((function(r){var e=t[r];if(!e||"string"!=typeof e)return!1;var n=e.toLowerCase().split(" ").filter((function(t){return!a.includes(t)}));return f.every((function(t){return n.includes(t)}))}))&&u.push(t)};for(h.s();!(c=h.n()).done;)p()}catch(t){h.e(t)}finally{h.f()}return u},t.findKey=Mt,t.flattenArray=function(t){return Array.isArray(t)?t.reduce((function(t,r){return Array.isArray(r)?t.concat(r):t.concat([r])}),[]):[]},t.forEach=h,t.forEachEntry=function(t,r){if(!t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Object is not iterable");for(var e,n=t[Symbol.iterator]();!(e=n.next()).done;){var o=u(e.value,2),i=o[0],a=o[1];r.call(t,i,a)}},t.formatNumberWithCommas=function(t){return"number"!=typeof t||isNaN(t)?"0":t.toLocaleString("en-US")},t.formatRangeOrPercentage=function(r){var e=r.details,n=void 0===e?"":e,o=r.formatAsRangeOrAmount,i=void 0===o?t.RangeOrAmountEnum.None:o,a=r.percentagePrefix,u=void 0===a?t.PercentagePrefixEnum.Empty:a,f=r.percentageSuffix,c=void 0===f?"":f,s=r.percent,l=void 0===s?0:s,h=r.minPercent,p=void 0===h?0:h,g=r.maxPercent,d=void 0===g?0:g,y=function(r,e,n){return""!==r.trim()||""!==e.trim()||n===t.RangeOrAmountEnum.Range||n===t.RangeOrAmountEnum.Amount}(u,c,i),v=i===t.RangeOrAmountEnum.Amount?"".concat(l,"%"):i===t.RangeOrAmountEnum.Range?"".concat(p," - ").concat(d).concat(c.includes("%")?"":"%"):"",m="";return i===t.RangeOrAmountEnum.Range?m="".concat(y?"(":"").concat(u.trim()?"".concat(u," "):"").concat(v).concat(c.trim()?c:"").concat(y?")":""," ").concat(n.trim()):i===t.RangeOrAmountEnum.Amount?m="(".concat(u.trim()?"".concat(u," "):"").concat(l,"%").concat(c.trim()?" ".concat(c):"",") ").concat(n.trim()):i===t.RangeOrAmountEnum.None&&(m=n.trim()),m},t.freezeMethods=function(t){Bt(t,(function(r,e){return(!Ft(t)||!["arguments","caller","callee"].includes(e))&&(Ft(t[e])?(r.enumerable=!1,"writable"in r?r.writable=!1:r.set||(r.set=function(){throw new Error("Cannot rewrite read-only method '".concat(e,"'"))}),r):void 0)}))},t.generateAllowedOrigins=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.values(t.ProtocolPrefixEnum),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{includeWww:!0,validateDomains:!0},o=new Set;return r.forEach((function(r){var i=function(t){return t.replace(/^(https?:\/\/)?(www\.)?/,"").toLowerCase()}(r);!n.validateDomains||function(t){return!(!t||""===t.trim())&&(t.startsWith("localhost")?/^localhost(:\d+)?$/.test(t):/^([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.[a-zA-Z]{2,}$/.test(t))}(i)?(e.forEach((function(r){if(!Object.values(t.ProtocolPrefixEnum).includes(r))throw new Error("Invalid prefix: ".concat(r));o.add("".concat(r).concat(i)),n.includeWww&&!i.startsWith("localhost")&&o.add("".concat(r,"www.").concat(i))})),o.add(i),n.includeWww&&!i.startsWith("localhost")&&o.add("www.".concat(i))):console.warn("Skipping invalid domain: ".concat(r))})),Array.from(o)},t.generateStripeCard=function(){var t=Ot[Math.floor(Math.random()*Ot.length)],r=Math.floor(9e15*Math.random())+1e15,e="amex"===t?4:3,n=Math.floor(Math.random()*Math.pow(10,e)).toString().padStart(e,"0"),o=(new Date).getFullYear(),i=Math.floor(12*Math.random())+1,a=o+Math.floor(10*Math.random())+1;return{brand:t,number:r.toString(),cvv:n,expirationDate:"".concat(i.toString().padStart(2,"0"),"/").concat(a)}},t.getAspectRatio=function(r){var e,n=r.width,o=r.orientation,i=void 0===o?"landscape":o,a=r.aspectRatio||t.AspectRatioEnum["16:9"],f=(null===(e=t.AspectRatioEnum[a])||void 0===e?void 0:e.split(":").map(Number))||[16,9];switch(a){case"4:3":f=[4,3];break;case"16:9":default:f=[16,9];break;case"1:1":f=[1,1];break;case"3:2":f=[3,2];break;case"8:5":f=[8,5]}var c,s=u(f,2),l=s[0],h=s[1];return c="landscape"===i?n/(l/h):n*(h/l),{width:n,height:Math.round(c)}},t.getAverage=function(t){if(!Array.isArray(t)||0===t.length)throw new Error("Input must be a non-empty array of numbers.");if(!t.every((function(t){return"number"==typeof t&&!isNaN(t)})))throw new Error("All elements in the array must be valid numbers.");return t.reduce((function(t,r){return t+r}),0)/t.length},t.getFirstWordCapitalized=function(t){try{var r=t.trim().split(" ");if(0===r.length||""===r[0])return"";if(r&&r.length>1&&r[0]){var e=r[0];return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}return""}catch(t){throw new Error(String(t))}},t.getMessageByField=function(t,r){var e=function(t){if(!wt(r)&&Et(t,r)){var e=Et(t,r);if("string"==typeof e)return e}else if(!wt(r)){var n=At(t,r);if(n)return n}};if("string"==typeof t)return e(t)||void 0;if(Array.isArray(t)){var o,i=n(t);try{for(i.s();!(o=i.n()).done;){var a=e(o.value);if(a)return a}}catch(t){i.e(t)}finally{i.f()}}else;},t.getMessageFromObject=At,t.getRandomValFromArray=function(t,r){var e;return 0===t.length?r:null!==(e=t[Math.floor(Math.random()*t.length)])&&void 0!==e?e:r},t.getRange=function(t,r){return r<0?[]:Array.apply(0,Array(r)).map((function(r,e){return e+t}))},t.getUniqueObjects=function(t,r){return t.map((function(t){return t[r]})).filter((function(t,r,e){return e.indexOf(t)===r})).map((function(r,e){return t[e]}))},t.getValueFromObject=Et,t.hasItemByLetterAndFilter=function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"name",n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.some((function(r){if(1!==t.length)throw new Error("Letter must be a single character.");var i=r[e]||null;if(!i)return!1;var a=function(t){return!o||[o,o.toLowerCase()].every((function(r){return t.includes(r)}))}(i),u=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return void 0===e&&(e=0),[r,r.toLowerCase()].some((function(r){return r.charAt(e)===t}))}(i,n);return!(!a||!u)}))},t.hasOwnProp=Jt,t.isArrayBuffer=Kt,t.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Kt(t.buffer)},t.isBoolean=function(t){return!0===t||!1===t},t.isBuffer=function(t){return null!==t&&!Vt(t)&&null!==t.constructor&&!Vt(t.constructor)&&Ft(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},t.isContextDefined=function(t){return!Vt(t)&&t!==Ht},t.isDate=Gt,t.isDeepEqual=function t(r,e){if(r===e)return!0;if("object"!==c(r)||null===r||"object"!==c(e)||null===e)return!1;var n=Object.keys(r),o=Object.keys(e);if(n.length!==o.length)return!1;for(var i=0,a=n;i<a.length;i++){var u=a[i];if(!o.includes(u)||!t(r[u],e[u]))return!1}return!0},t.isEmpty=wt,t.isFile=Xt,t.isFormData=function(t){var r;return!!t&&("function"==typeof FormData&&t instanceof FormData||qt(t)&&Object.prototype.hasOwnProperty.call(t,"append")&&Ft(t.append)&&("formdata"===(r=Yt(t))||"object"===r&&Ft(t.toString)&&"[object FormData]"===t.toString()))},t.isFunction=Ft,t.isGlobalDefined=Ht,t.isJson=Rt,t.isNumber=Qt,t.isNumeric=function(t){return"string"==typeof t?""!==t.trim()&&t.trim()===t&&(!isNaN(Number(t))&&isFinite(Number(t))):"number"==typeof t?!isNaN(t)&&isFinite(t):Qt(t)},t.isObject=qt,t.isPlainObject=Ut,t.isRegExp=function(t){return Zt("RegExp")(t)},t.isString=function(t){return kt("string")(t)},t.isUndefined=Vt,t.isValidBase64=function(t){if("string"!=typeof t)return!1;if(0===t.length)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(t))return!1;var r=t.length%4;if(1===r)return!1;if(0===r||2===r||3===r)return!0;var e=t.slice(-r);return!!/^=*$/.test(e)},t.isValidBinary=function(t){return/^[01]+$/.test(t)},t.isValidBlob=function(t){return"undefined"!=typeof Blob&&t instanceof Blob&&"[object Blob]"===lt.call(t)},t.isValidStyle=function(t,r){var e=[].concat(f(Nt),f(r||[])),o=new Set(e.map((function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()})));if(!(t=t.trim()))return!1;var i=t.split(";").filter((function(t){return t.trim()}));if(t&&!t.endsWith(";"))return!1;var a,c=n(i);try{for(c.s();!(a=c.n()).done;){var s=a.value.split(":").map((function(t){return t.trim()}));if(2!==s.length)return!1;var l=u(s,2),h=l[0],p=l[1];if(!o.has(h)||!p)return!1}}catch(t){c.e(t)}finally{c.f()}return!0},t.jsonContainsNewLine=Pt,t.kebabCase=function(t){return"string"!=typeof t?"":t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").toLowerCase().replace(/^-+|-+$/g,"")},t.kindOf=Yt,t.kindOfTest=Zt,t.log=jt,t.logCondition=function(t,r){jt(r?"green":"red",t)},t.logEnd=function(t,r){It();var e=r?" (".concat(r,")"):"";jt("blue","==== END: ".concat(t).concat(e," ====")),It()},t.logError=function(t,r){var e="string"==typeof r?r:JSON.stringify(r,null,2);xt("Error in ".concat(t,": ").concat(e),"red")},t.logFunction=function(t,r,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bgBlue",o="object"===c(r)?JSON.stringify(r,null,2):String(r),i="Function: ".concat(t," ").concat(e?"- ".concat(e):""," | Variables: ").concat(o);jt(n,i)},t.logMessage=xt,t.logSeparator=It,t.logStart=function(t,r){It();var e=r?" (".concat(r,")"):"";jt("blue","==== START: ".concat(t).concat(e," ====")),It()},t.matchAll=gt,t.merge=function t(){for(var r={},e=function(e,n){_t(e,n,r,t)},n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];for(var a=0,u=o;a<u.length;a++){var f=u[a];f&&h(f,e)}return r},t.mergeObjects=function t(r,e){var n=a({},r);return Object.keys(e).forEach((function(r){var o=e[r],i=n[r];Array.isArray(o)&&Array.isArray(i)?n[r]=[].concat(f(i),f(o)):"object"!==c(o)||null===o||Array.isArray(o)||"object"!==c(i)||Array.isArray(i)?n[r]=o:n[r]=t(i,o)})),n},t.parseHeaders=function(t){var r={},e=ht(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);return null==t||t.split("\n").forEach((function(t){var n=t.indexOf(":"),o=t.substring(0,n).trim().toLowerCase(),i=t.substring(n+1).trim();!o||r[o]&&e[o]||(r[o]="set-cookie"===o?r[o]?[].concat(f(r[o]),[i]):[i]:r[o]?"".concat(r[o],", ").concat(i):i)})),r},t.parsePropPath=function(t){var r,e=[],o=n(gt(/\w+|\[(\w*)]/g,t));try{for(o.s();!(r=o.n()).done;){var i=u(r.value,2),a=i[0],f=i[1]||a;e.push(f)}}catch(t){o.