From 6ca2f8a2ea342fcfcf0e3d5d453aaffccc3c2f9d Mon Sep 17 00:00:00 2001 From: Alexandr Balasyan Date: Tue, 27 Feb 2024 15:34:53 +0300 Subject: [PATCH] upgraded deps --- dist/client/spreadable.client.js | 6 ++-- package-lock.json | 47 ++++++-------------------------- package.json | 6 ++-- src/client.js | 4 +-- src/node.js | 4 +-- test/tools.js | 4 +-- 6 files changed, 21 insertions(+), 50 deletions(-) diff --git a/dist/client/spreadable.client.js b/dist/client/spreadable.client.js index 013228f..261570e 100644 --- a/dist/client/spreadable.client.js +++ b/dist/client/spreadable.client.js @@ -1,6 +1,6 @@ /*! * spreadable client - * @version 0.3.7 + * @version 0.3.8 * {@link https://github.com/ortexx/spreadable} */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClientSpreadable=e():t.ClientSpreadable=e()}(self,(()=>(()=>{var t={6104:(t,e,r)=>{"use strict";var n=r(6512),o=r(320);function i(t){return i="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},i(t)}function a(t,e){for(var r=0;r1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;o{"use strict";var n=r(6512);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;et.length)&&(r=t.length),t.substring(r-e.length,r)===e}var w="",E="",A="",j="",O={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function S(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function _(t){return b(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function x(t,e,r){var o="",i="",a=0,s="",c=!1,u=_(t),f=u.split("\n"),l=_(e).split("\n"),p=0,h="";if("strictEqual"===r&&"object"===d(t)&&"object"===d(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===f.length&&1===l.length&&f[0]!==l[0]){var y=f[0].length+l[0].length;if(y<=10){if(!("object"===d(t)&&null!==t||"object"===d(e)&&null!==e||0===t&&0===e))return"".concat(O[r],"\n\n")+"".concat(f[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;f[0][p]===l[0][p];)p++;p>2&&(h="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}}for(var g=f[f.length-1],b=l[l.length-1];g===b&&(p++<2?s="\n ".concat(g).concat(s):o=g,f.pop(),l.pop(),0!==f.length&&0!==l.length);)g=f[f.length-1],b=l[l.length-1];var v=Math.max(f.length,l.length);if(0===v){var S=u.split("\n");if(S.length>30)for(S[26]="".concat(w,"...").concat(j);S.length>27;)S.pop();return"".concat(O.notIdentical,"\n\n").concat(S.join("\n"),"\n")}p>3&&(s="\n".concat(w,"...").concat(j).concat(s),c=!0),""!==o&&(s="\n ".concat(o).concat(s),o="");var x=0,P=O[r]+"\n".concat(E,"+ actual").concat(j," ").concat(A,"- expected").concat(j),R=" ".concat(w,"...").concat(j," Lines skipped");for(p=0;p1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(j),c=!0):I>3&&(i+="\n ".concat(l[p-2]),x++),i+="\n ".concat(l[p-1]),x++),a=p,o+="\n".concat(A,"-").concat(j," ").concat(l[p]),x++;else if(l.length1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(j),c=!0):I>3&&(i+="\n ".concat(f[p-2]),x++),i+="\n ".concat(f[p-1]),x++),a=p,i+="\n".concat(E,"+").concat(j," ").concat(f[p]),x++;else{var T=l[p],B=f[p],k=B!==T&&(!m(B,",")||B.slice(0,-1)!==T);k&&m(T,",")&&T.slice(0,-1)===B&&(k=!1,B+=","),k?(I>1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(j),c=!0):I>3&&(i+="\n ".concat(f[p-2]),x++),i+="\n ".concat(f[p-1]),x++),a=p,i+="\n".concat(E,"+").concat(j," ").concat(B),o+="\n".concat(A,"-").concat(j," ").concat(T),x+=2):(i+=o,o="",1!==I&&0!==p||(i+="\n ".concat(B),x++))}if(x>20&&p30)for(h[26]="".concat(w,"...").concat(j);h.length>27;)h.pop();e=1===h.length?p.call(this,"".concat(l," ").concat(h[0])):p.call(this,"".concat(l,"\n\n").concat(h.join("\n"),"\n"))}else{var y=_(a),g="",b=O[o];"notDeepEqual"===o||"notEqual"===o?(y="".concat(O[o],"\n\n").concat(y)).length>1024&&(y="".concat(y.slice(0,1021),"...")):(g="".concat(_(s)),y.length>512&&(y="".concat(y.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===o||"equal"===o?y="".concat(b,"\n\n").concat(y,"\n\nshould equal\n\n"):g=" ".concat(o," ").concat(g)),e=p.call(this,"".concat(y).concat(g))}return Error.stackTraceLimit=c,e.generatedMessage=!r,Object.defineProperty(f(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=s,e.operator=o,Error.captureStackTrace&&Error.captureStackTrace(f(e),i),e.stack,e.name="AssertionError",u(e)}return a=m,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return b(this,i(i({},e),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,c),l&&s(a,l),Object.defineProperty(a,"prototype",{writable:!1}),m}(l(Error),b.custom);t.exports=P},988:(t,e,r)=>{"use strict";function n(t){return n="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},n(t)}function o(t,e){for(var r=0;r2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(t,e,o){var i,a,s,u;if(void 0===c&&(c=r(6104)),c("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(!s||s<0?0:+s,a.length)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))u="The ".concat(t," ").concat(i," ").concat(p(e,"type"));else{var f=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";u='The "'.concat(t,'" ').concat(f," ").concat(i," ").concat(p(e,"type"))}return u+=". Received type ".concat(n(o))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(3912));var o=u.inspect(e);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(o,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n0,"At least one arg needs to be specified");var o="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:o+="".concat(e[0]," argument");break;case 2:o+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:o+=e.slice(0,i-1).join(", "),o+=", and ".concat(e[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),t.exports.codes=f},5856:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t,e)||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 o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function k(t){return Object.keys(t).filter(B).concat(f(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))} @@ -22,6 +22,6 @@ const o=r(5704),i=r(4404),a="function"==typeof Symbol&&"function"==typeof Symbol * Copyright(c) 2012-2014 TJ Holowaychuk * Copyright(c) 2015 Jed Watson * MIT Licensed - */t.exports=function(t,e){if("string"==typeof t)return a(t);if("number"==typeof t)return i(t,e);return null},t.exports.format=i,t.exports.parse=a;var e=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,n={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},o=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function i(t,o){if(!Number.isFinite(t))return null;var i=Math.abs(t),a=o&&o.thousandsSeparator||"",s=o&&o.unitSeparator||"",c=o&&void 0!==o.decimalPlaces?o.decimalPlaces:2,u=Boolean(o&&o.fixedDecimals),f=o&&o.unit||"";f&&n[f.toLowerCase()]||(f=i>=n.pb?"PB":i>=n.tb?"TB":i>=n.gb?"GB":i>=n.mb?"MB":i>=n.kb?"KB":"B");var l=(t/n[f.toLowerCase()]).toFixed(c);return u||(l=l.replace(r,"$1")),a&&(l=l.split(".").map((function(t,r){return 0===r?t.replace(e,a):t})).join(".")),l+s+f}function a(t){if("number"==typeof t&&!isNaN(t))return t;if("string"!=typeof t)return null;var e,r=o.exec(t),i="b";return r?(e=parseFloat(r[1]),i=r[4].toLowerCase()):(e=parseInt(t,10),i="b"),isNaN(e)?null:Math.floor(n[i]*e)}},2768:(t,e,r)=>{"use strict";var n=r(6604),o=r(4572),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},4572:(t,e,r)=>{"use strict";var n=r(268),o=r(6604),i=r(2392),a=r(6556),s=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||n.call(c,s),f=r(8252),l=o("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=u(n,c,arguments);return i(e,1+l(0,t.length-(arguments.length-1)),!0)};var p=function(){return u(n,s,arguments)};f?f(t.exports,"apply",{value:p}):t.exports.apply=p},320:(t,e,r)=>{var n=r(3912),o=r(6104);function i(){return(new Date).getTime()}var a,s=Array.prototype.slice,c={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){c[t]=i()},"time"],[function(t){var e=c[t];if(!e)throw new Error("No such label: "+t);delete c[t];var r=i()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);o.ok(!1,n.format.apply(null,e))}},"assert"]],f=0;f{"use strict";var n=r(8252),o=r(7668),i=r(6556),a=r(872);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],l=!!a&&a(t,e);if(n)n(t,e,{configurable:null===u&&l?l.configurable:!u,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===c&&l?l.writable:!c});else{if(!f&&(s||c||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},5728:(t,e,r)=>{"use strict";var n=r(7056),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(5456),c=r(1188)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?s(t,e,r,!0):s(t,e,r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s{"use strict";var n=r(6604)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},9576:t=>{"use strict";t.exports=EvalError},2772:t=>{"use strict";t.exports=Error},5360:t=>{"use strict";t.exports=RangeError},2380:t=>{"use strict";t.exports=ReferenceError},7668:t=>{"use strict";t.exports=SyntaxError},6556:t=>{"use strict";t.exports=TypeError},568:t=>{"use strict";t.exports=URIError},7040:(t,e,r)=>{"use strict";var n=r(8528),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===o.call(t)?function(t,e,r){for(var n=0,o=t.length;n{t.exports="object"==typeof self?self.FormData:window.FormData},7840:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(7840);t.exports=Function.prototype.bind||n},6604:(t,e,r)=>{"use strict";var n,o=r(2772),i=r(9576),a=r(5360),s=r(2380),c=r(7668),u=r(6556),f=r(568),l=Function,p=function(t){try{return l('"use strict"; return ('+t+").constructor;")()}catch(t){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(t){h=null}var y=function(){throw new u},g=h?function(){try{return y}catch(t){try{return h(arguments,"callee").get}catch(t){return y}}}():y,d=r(4308)(),b=r(7636)(),v=Object.getPrototypeOf||(b?function(t){return t.__proto__}:null),m={},w="undefined"!=typeof Uint8Array&&v?v(Uint8Array):n,E={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":d&&v?v([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":m,"%AsyncGenerator%":m,"%AsyncGeneratorFunction%":m,"%AsyncIteratorPrototype%":m,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":m,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d&&v?v(v([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&d&&v?v((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&d&&v?v((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d&&v?v(""[Symbol.iterator]()):n,"%Symbol%":d?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":g,"%TypedArray%":w,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(v)try{null.error}catch(t){var A=v(v(t));E["%Error.prototype%"]=A}var j=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&v&&(r=v(o.prototype))}return E[e]=r,r},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},S=r(268),_=r(5176),x=S.call(Function.call,Array.prototype.concat),P=S.call(Function.apply,Array.prototype.splice),R=S.call(Function.call,String.prototype.replace),I=S.call(Function.call,String.prototype.slice),T=S.call(Function.call,RegExp.prototype.exec),B=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,U=function(t,e){var r,n=t;if(_(O,n)&&(n="%"+(r=O[n])[0]+"%"),_(E,n)){var o=E[n];if(o===m&&(o=j(n)),void 0===o&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=I(t,0,1),r=I(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,B,(function(t,e,r,o){n[n.length]=r?R(o,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=U("%"+n+"%",e),i=o.name,a=o.value,s=!1,f=o.alias;f&&(n=f[0],P(r,x([0,1],f)));for(var l=1,p=!0;l=r.length){var b=h(a,y);a=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:a[y]}else p=_(a,y),a=a[y];p&&!s&&(E[i]=a)}}return a}},872:(t,e,r)=>{"use strict";var n=r(6604)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},1188:(t,e,r)=>{"use strict";var n=r(8252),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7636:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},4308:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(1968);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},1968:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3804:(t,e,r)=>{"use strict";var n=r(1968);t.exports=function(){return n()&&!!Symbol.toStringTag}},5176:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(268);t.exports=i.call(n,o)},4404:(t,e)=>{ + */t.exports=function(t,e){if("string"==typeof t)return a(t);if("number"==typeof t)return i(t,e);return null},t.exports.format=i,t.exports.parse=a;var e=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,n={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},o=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function i(t,o){if(!Number.isFinite(t))return null;var i=Math.abs(t),a=o&&o.thousandsSeparator||"",s=o&&o.unitSeparator||"",c=o&&void 0!==o.decimalPlaces?o.decimalPlaces:2,u=Boolean(o&&o.fixedDecimals),f=o&&o.unit||"";f&&n[f.toLowerCase()]||(f=i>=n.pb?"PB":i>=n.tb?"TB":i>=n.gb?"GB":i>=n.mb?"MB":i>=n.kb?"KB":"B");var l=(t/n[f.toLowerCase()]).toFixed(c);return u||(l=l.replace(r,"$1")),a&&(l=l.split(".").map((function(t,r){return 0===r?t.replace(e,a):t})).join(".")),l+s+f}function a(t){if("number"==typeof t&&!isNaN(t))return t;if("string"!=typeof t)return null;var e,r=o.exec(t),i="b";return r?(e=parseFloat(r[1]),i=r[4].toLowerCase()):(e=parseInt(t,10),i="b"),isNaN(e)?null:Math.floor(n[i]*e)}},2768:(t,e,r)=>{"use strict";var n=r(6604),o=r(4572),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},4572:(t,e,r)=>{"use strict";var n=r(268),o=r(6604),i=r(2392),a=r(6556),s=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||n.call(c,s),f=r(8252),l=o("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=u(n,c,arguments);return i(e,1+l(0,t.length-(arguments.length-1)),!0)};var p=function(){return u(n,s,arguments)};f?f(t.exports,"apply",{value:p}):t.exports.apply=p},320:(t,e,r)=>{var n=r(3912),o=r(6104);function i(){return(new Date).getTime()}var a,s=Array.prototype.slice,c={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){c[t]=i()},"time"],[function(t){var e=c[t];if(!e)throw new Error("No such label: "+t);delete c[t];var r=i()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);o.ok(!1,n.format.apply(null,e))}},"assert"]],f=0;f{"use strict";var n=r(8252),o=r(7668),i=r(6556),a=r(872);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],l=!!a&&a(t,e);if(n)n(t,e,{configurable:null===u&&l?l.configurable:!u,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===c&&l?l.writable:!c});else{if(!f&&(s||c||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},5728:(t,e,r)=>{"use strict";var n=r(7056),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(5456),c=r(1188)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?s(t,e,r,!0):s(t,e,r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s{"use strict";var n=r(6604)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},9576:t=>{"use strict";t.exports=EvalError},2772:t=>{"use strict";t.exports=Error},5360:t=>{"use strict";t.exports=RangeError},2380:t=>{"use strict";t.exports=ReferenceError},7668:t=>{"use strict";t.exports=SyntaxError},6556:t=>{"use strict";t.exports=TypeError},568:t=>{"use strict";t.exports=URIError},7040:(t,e,r)=>{"use strict";var n=r(8528),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===o.call(t)?function(t,e,r){for(var n=0,o=t.length;n{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(7840);t.exports=Function.prototype.bind||n},6604:(t,e,r)=>{"use strict";var n,o=r(2772),i=r(9576),a=r(5360),s=r(2380),c=r(7668),u=r(6556),f=r(568),l=Function,p=function(t){try{return l('"use strict"; return ('+t+").constructor;")()}catch(t){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(t){h=null}var y=function(){throw new u},g=h?function(){try{return y}catch(t){try{return h(arguments,"callee").get}catch(t){return y}}}():y,d=r(4308)(),b=r(7636)(),v=Object.getPrototypeOf||(b?function(t){return t.__proto__}:null),m={},w="undefined"!=typeof Uint8Array&&v?v(Uint8Array):n,E={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":d&&v?v([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":m,"%AsyncGenerator%":m,"%AsyncGeneratorFunction%":m,"%AsyncIteratorPrototype%":m,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":m,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d&&v?v(v([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&d&&v?v((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&d&&v?v((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d&&v?v(""[Symbol.iterator]()):n,"%Symbol%":d?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":g,"%TypedArray%":w,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(v)try{null.error}catch(t){var A=v(v(t));E["%Error.prototype%"]=A}var j=function t(e){var r;if("%AsyncFunction%"===e)r=p("async function () {}");else if("%GeneratorFunction%"===e)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=p("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&v&&(r=v(o.prototype))}return E[e]=r,r},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},S=r(268),_=r(5176),x=S.call(Function.call,Array.prototype.concat),P=S.call(Function.apply,Array.prototype.splice),R=S.call(Function.call,String.prototype.replace),I=S.call(Function.call,String.prototype.slice),T=S.call(Function.call,RegExp.prototype.exec),B=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,U=function(t,e){var r,n=t;if(_(O,n)&&(n="%"+(r=O[n])[0]+"%"),_(E,n)){var o=E[n];if(o===m&&(o=j(n)),void 0===o&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=I(t,0,1),r=I(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return R(t,B,(function(t,e,r,o){n[n.length]=r?R(o,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=U("%"+n+"%",e),i=o.name,a=o.value,s=!1,f=o.alias;f&&(n=f[0],P(r,x([0,1],f)));for(var l=1,p=!0;l=r.length){var b=h(a,y);a=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:a[y]}else p=_(a,y),a=a[y];p&&!s&&(E[i]=a)}}return a}},872:(t,e,r)=>{"use strict";var n=r(6604)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},1188:(t,e,r)=>{"use strict";var n=r(8252),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},7636:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},4308:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(1968);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},1968:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3804:(t,e,r)=>{"use strict";var n=r(1968);t.exports=function(){return n()&&!!Symbol.toStringTag}},5176:(t,e,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(268);t.exports=i.call(n,o)},4404:(t,e)=>{ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,f=-7,l=r?o-1:0,p=r?-1:1,h=t[e+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+t[e+l],l+=p,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=u}return(h?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,c,u=8*i-o-1,f=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=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?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?p/c:p*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*c-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=y,s/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=y,a/=256,u-=8);t[r+h-y]|=128*g}},8248:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2816:(t,e,r)=>{"use strict";var n=r(3804)(),o=r(2768)("Object.prototype.toString"),i=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=s?i:a},8528:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),l=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(l=function(t){if((f||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(l(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(l(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return s(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},7700:(t,e,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(3804)(),c=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(t);if(!c)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&c(e)}return c(t)===n}},5108:t=>{"use strict";t.exports=function(t){return t!=t}},2796:(t,e,r)=>{"use strict";var n=r(4572),o=r(5728),i=r(5108),a=r(4312),s=r(5528),c=n(a(),Number);o(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},4312:(t,e,r)=>{"use strict";var n=r(5108);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},5528:(t,e,r)=>{"use strict";var n=r(5728),o=r(4312);t.exports=function(){var t=o();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},3340:(t,e,r)=>{"use strict";var n=r(8488);t.exports=function(t){return!!n(t)}},6952:t=>{var e=1e3,r=60*e,n=60*r,o=24*n,i=7*o,a=365.25*o;function s(t,e,r,n){var o=e>=1.5*r;return Math.round(t/r)+" "+n+(o?"s":"")}t.exports=function(t,c){c=c||{};var u=typeof t;if("string"===u&&t.length>0)return function(t){if((t=String(t)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(t);if("number"===u&&isFinite(t))return c.long?function(t){var i=Math.abs(t);if(i>=o)return s(t,i,o,"day");if(i>=n)return s(t,i,n,"hour");if(i>=r)return s(t,i,r,"minute");if(i>=e)return s(t,i,e,"second");return t+" ms"}(t):function(t){var i=Math.abs(t);if(i>=o)return Math.round(t/o)+"d";if(i>=n)return Math.round(t/n)+"h";if(i>=r)return Math.round(t/r)+"m";if(i>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},6e3:(t,e,r)=>{"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,n.fetch&&(e.default=n.fetch.bind(n)),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},7344:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},1620:(t,e,r)=>{"use strict";var n=r(5728),o=r(4572),i=r(7344),a=r(9756),s=r(8116),c=o(a(),Object);n(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},9756:(t,e,r)=>{"use strict";var n=r(7344);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},8116:(t,e,r)=>{"use strict";var n=r(9756),o=r(5728);t.exports=function(){var t=n();return o(Object,{is:t},{is:function(){return Object.is!==t}}),t}},3816:(t,e,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(3428),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{l(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),s=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var y=u&&r;if(s&&t.length>0&&!o.call(t,0))for(var g=0;g0)for(var d=0;d{"use strict";var n=Array.prototype.slice,o=r(3428),i=Object.keys,a=i?function(t){return i(t)}:r(3816),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?s(n.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},3428:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7928:(t,e,r)=>{"use strict";var n=r(7056),o=r(1968)(),i=r(2768),a=Object,s=i("Array.prototype.push"),c=i("Object.prototype.propertyIsEnumerable"),u=o?Object.getOwnPropertySymbols:null;t.exports=function(t,e){if(null==t)throw new TypeError("target must be an object");var r=a(t);if(1===arguments.length)return r;for(var i=1;i{"use strict";var n=r(7928);t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var s,c=[],u=!1,f=-1;function l(){u&&s&&(u=!1,s.length?c=s.concat(c):f=-1,c.length&&p())}function p(){if(!u){var t=a(l);u=!0;for(var e=c.length;e;){for(s=c,c=[];++f1)for(var r=1;r{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,n,o,i){n=n||"&",o=o||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(n);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var u=t.length;c>0&&u>c&&(u=c);for(var f=0;f=0?(l=g.substr(0,d),p=g.substr(d+1)):(l=g,p=""),h=decodeURIComponent(l),y=decodeURIComponent(p),e(a,h)?r(a[h])?a[h].push(y):a[h]=[a[h],y]:a[h]=y}return a};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},9504:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,i,a,s){return i=i||"&",a=a||"=",null===t&&(t=void 0),"object"==typeof t?n(o(t),(function(o){var s=encodeURIComponent(e(o))+a;return r(t[o])?n(t[o],(function(t){return s+encodeURIComponent(e(t))})).join(i):s+encodeURIComponent(e(t[o]))})).join(i):s?encodeURIComponent(e(s))+a+encodeURIComponent(e(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n{"use strict";e.decode=e.parse=r(2664),e.encode=e.stringify=r(9504)},2392:(t,e,r)=>{"use strict";var n=r(6604),o=r(5456),i=r(1188)(),a=r(872),s=r(6556),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&a){var f=a(t,"length");f&&!f.configurable&&(n=!1),f&&!f.writable&&(u=!1)}return(n||u||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},2848:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},9032:(t,e,r)=>{"use strict";var n=r(2816),o=r(7700),i=r(8488),a=r(3340);function s(t){return t.call.bind(t)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,f=s(Object.prototype.toString),l=s(Number.prototype.valueOf),p=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(c)var y=s(BigInt.prototype.valueOf);if(u)var g=s(Symbol.prototype.valueOf);function d(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function v(t){return"[object Set]"===f(t)}function m(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function A(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function j(t){return"[object DataView]"===f(t)}function O(t){return"undefined"!=typeof DataView&&(j.working?j(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=o,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||O(t)},e.isUint8Array=function(t){return"Uint8Array"===i(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===i(t)},e.isUint16Array=function(t){return"Uint16Array"===i(t)},e.isUint32Array=function(t){return"Uint32Array"===i(t)},e.isInt8Array=function(t){return"Int8Array"===i(t)},e.isInt16Array=function(t){return"Int16Array"===i(t)},e.isInt32Array=function(t){return"Int32Array"===i(t)},e.isFloat32Array=function(t){return"Float32Array"===i(t)},e.isFloat64Array=function(t){return"Float64Array"===i(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===i(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===i(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(v.working?v(t):t instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(m.working?m(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=A,j.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&j(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=O;var S="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function _(t){return"[object SharedArrayBuffer]"===f(t)}function x(t){return void 0!==S&&(void 0===_.working&&(_.working=_(new S)),_.working?_(t):t instanceof S)}function P(t){return d(t,l)}function R(t){return d(t,p)}function I(t){return d(t,h)}function T(t){return c&&d(t,y)}function B(t){return u&&d(t,g)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=P,e.isStringObject=R,e.isBooleanObject=I,e.isBigIntObject=T,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return P(t)||R(t)||I(t)||T(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(A(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},3912:(t,e,r)=>{var n=r(6512),o=r(320),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&e._extend(n,r),E(n.showHidden)&&(n.showHidden=!1),E(n.depth)&&(n.depth=2),E(n.colors)&&(n.colors=!1),E(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=f.styles[e];return r?"["+f.colors[r][0]+"m"+t+"["+f.colors[r][1]+"m":t}function p(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&_(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return w(o)||(o=h(t,o,n)),o}var i=function(t,e){if(E(e))return t.stylize("undefined","undefined");if(w(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(b(e))return t.stylize(""+e,"boolean");if(v(e))return t.stylize("null","null")}(t,r);if(i)return i;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return y(r);if(0===a.length){if(_(r)){var c=r.name?": "+r.name:"";return t.stylize("[Function"+c+"]","special")}if(A(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(O(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return y(r)}var u,f="",l=!1,p=["{","}"];(d(r)&&(l=!0,p=["[","]"]),_(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return A(r)&&(f=" "+RegExp.prototype.toString.call(r)),O(r)&&(f=" "+Date.prototype.toUTCString.call(r)),S(r)&&(f=" "+y(r)),0!==a.length||l&&0!=r.length?n<0?A(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=l?function(t,e,r,n,o){for(var i=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(u,f,p)):p[0]+f+p[1]}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function g(t,e,r,n,o,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?s=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(s=t.stylize("[Setter]","special")),I(n,o)||(a="["+o+"]"),s||(t.seen.indexOf(c.value)<0?(s=v(r)?h(t,c.value,null):h(t,c.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),E(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function v(t){return null===t}function m(t){return"number"==typeof t}function w(t){return"string"==typeof t}function E(t){return void 0===t}function A(t){return j(t)&&"[object RegExp]"===x(t)}function j(t){return"object"==typeof t&&null!==t}function O(t){return j(t)&&"[object Date]"===x(t)}function S(t){return j(t)&&("[object Error]"===x(t)||t instanceof Error)}function _(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(c.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);o.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(9032),e.isArray=d,e.isBoolean=b,e.isNull=v,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=E,e.isRegExp=A,e.types.isRegExp=A,e.isObject=j,e.isDate=O,e.types.isDate=O,e.isError=S,e.types.isNativeError=S,e.isFunction=_,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(2848);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;o.log("%s - %s",(t=new Date,r=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":"),[t.getDate(),R[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(8248),e._extend=function(t,e){if(!e||!j(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e;if("function"!=typeof(e=t[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i{"use strict";var n=r(7040),o=r(7236),i=r(4572),a=r(2768),s=r(872),c=a("Object.prototype.toString"),u=r(3804)(),f="undefined"==typeof globalThis?r.g:globalThis,l=o(),p=a("String.prototype.slice"),h=Object.getPrototypeOf,y=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(g,(function(r,n){if(!e)try{r(t),e=p(n,1)}catch(t){}})),e}(t)}return s?function(t){var e=!1;return n(g,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=p(n,1))}catch(t){}})),e}(t):null}},7236:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),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={};return(()=>{"use strict";r.d(n,{default:()=>Xn});var t={};r.r(t),r.d(t,{AccessError:()=>qn,AuthError:()=>Mn,NotFoundError:()=>Dn,WorkError:()=>Nn});const e=function(){this.__data__=[],this.size=0};const o=function(t,e){return t===e||t!=t&&e!=e};const i=function(t,e){for(var r=t.length;r--;)if(o(t[r][0],e))return r;return-1};var a=Array.prototype.splice;const s=function(t){var e=this.__data__,r=i(e,t);return!(r<0)&&(r==e.length-1?e.pop():a.call(e,r,1),--this.size,!0)};const c=function(t){var e=this.__data__,r=i(e,t);return r<0?void 0:e[r][1]};const u=function(t){return i(this.__data__,t)>-1};const f=function(t,e){var r=this.__data__,n=i(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991};const Vt=function(t){return null!=t&&zt(t.length)&&!T(t)};const Gt=function(t){return Lt(t)&&Vt(t)};const Wt=function(){return!1};var Ht="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=Ht&&"object"==typeof module&&module&&!module.nodeType&&module,Yt=Jt&&Jt.exports===Ht?m.Buffer:void 0;const Qt=(Yt?Yt.isBuffer:void 0)||Wt;var Kt=Function.prototype,Zt=Object.prototype,Xt=Kt.toString,te=Zt.hasOwnProperty,ee=Xt.call(Object);const re=function(t){if(!Lt(t)||"[object Object]"!=R(t))return!1;var e=Bt(t);if(null===e)return!0;var r=te.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Xt.call(r)==ee};var ne={};ne["[object Float32Array]"]=ne["[object Float64Array]"]=ne["[object Int8Array]"]=ne["[object Int16Array]"]=ne["[object Int32Array]"]=ne["[object Uint8Array]"]=ne["[object Uint8ClampedArray]"]=ne["[object Uint16Array]"]=ne["[object Uint32Array]"]=!0,ne["[object Arguments]"]=ne["[object Array]"]=ne["[object ArrayBuffer]"]=ne["[object Boolean]"]=ne["[object DataView]"]=ne["[object Date]"]=ne["[object Error]"]=ne["[object Function]"]=ne["[object Map]"]=ne["[object Number]"]=ne["[object Object]"]=ne["[object RegExp]"]=ne["[object Set]"]=ne["[object String]"]=ne["[object WeakMap]"]=!1;const oe=function(t){return Lt(t)&&zt(t.length)&&!!ne[R(t)]};const ie=function(t){return function(e){return t(e)}};var ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,se=ae&&"object"==typeof module&&module&&!module.nodeType&&module,ce=se&&se.exports===ae&&b.process,ue=function(){try{var t=se&&se.require&&se.require("util").types;return t||ce&&ce.binding&&ce.binding("util")}catch(t){}}();var fe=ue&&ue.isTypedArray;const le=fe?ie(fe):oe;const pe=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var he=Object.prototype.hasOwnProperty;const ye=function(t,e,r){var n=t[e];he.call(t,e)&&o(n,r)&&(void 0!==r||e in t)||bt(t,e,r)};const ge=function(t,e,r,n){var o=!r;r||(r={});for(var i=-1,a=e.length;++i-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ke);const Le=function(t,e){return Fe(Te(t,e,Pe),t+"")};const Ne=function(t,e,r){if(!I(r))return!1;var n=typeof e;return!!("number"==n?Vt(r)&&ve(e,r.length):"string"==n&&e in r)&&o(r[e],t)};const Me=function(t){return Le((function(e,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&Ne(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++ns))return!1;var u=i.get(t),f=i.get(e);if(u&&f)return u==e&&f==t;var l=-1,p=!0,h=2&r?new cr:void 0;for(i.set(t,e),i.set(e,t);++l-1};const Tn=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n=200){var u=e?null:Un(t);if(u)return hr(u);a=!1,o=fr,c=new cr}else c=e?[]:s;t:for(;++nJSON.stringify(e,null,2);let i=null,a=!1;for(let t=0;tJSON.stringify(s,null,2);try{if(s.type!=n){const t=`Wrong data type "${n}" instead of "${s.type}" ${o()} for ${c()}`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_WRONG_DATA_TYPE")}if("array"==n){const t="function"==typeof s.minLength?t(e):s.minLength,r="function"==typeof s.maxLength?r(e):s.maxLength;if(t&&e.lengthr){const t=`Wrong array max length ${o()} for ${c()}`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_WRONG_ARRAY_MAX_LENGTH")}if(s.uniq){if((!0===s.uniq?Ln(e):Ln(e,s.uniq)).length!=e.length){const t=`Wrong array uniqueness ${o()} for ${c()}`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_WRONG_ARRAY_UNIQUENESS")}}s.items&&e.forEach((t=>this.validateSchema(s.items,t)))}else if("object"==n){const t=s.props||{},r=s.required;if(r&&!Array.isArray(r))throw new Error(`Option "required" for ${c()} must be an array`);if(s.canBeNull&&null===e){a=!0;continue}if(!1===s.canBeNull&&null===e){const t=`Data for ${c()} can't be null`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_NULL")}if(s.strict){const r=Object.keys(t).sort(),n=Object.keys(e).sort();if(r.toString()!=n.toString()){const t=`Wrong strict object structure ${o()} for ${c()}`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_STRICT")}}if(s.expected)for(let r in e)if(!Object.prototype.hasOwnProperty.call(t,r)){const t=`Wrong expected object structure ${o()} for ${c()}`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_EXPECTED")}const n={};r&&r.forEach((t=>n[t]=!0));for(let i in t)if(Object.prototype.hasOwnProperty.call(e,i))this.validateSchema(t[i],e[i]);else if(r&&n[i]){const t=`Property "${i}" is required in ${o()} for ${c()}`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_REQUIRED_PROPS")}}if(!Object.prototype.hasOwnProperty.call(s,"value")){a=!0;continue}let t;if("function"==typeof s.value)t=s.value(e);else if(s.value instanceof RegExp)t=String(e).match(s.value);else{t=-1!=(Array.isArray(s.value)?s.value:[s.value]).indexOf(e)}if(!t){const t=`Validation is failed for ${o()}`;throw new Nn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_VALUE")}a=!0}catch(t){i=t}}if(!a&&i)throw i},isBrowserEnv:function(){return"object"==typeof window},getRandomElement:function(t){return t[Math.floor(Math.random()*t.length)]},getMs:function(t){return"string"!=typeof t||"auto"==t?t:or(t)},getBytes:function(t){return"string"!=typeof t||t.match("%")||"auto"==t?t:nr(t)},getCpuUsage:async function(t={}){return await new Promise(((e,r)=>{const n=$n.cpuUsage(),o=$n.hrtime();setTimeout((()=>{try{const t=$n.cpuUsage(n),r=$n.hrtime(o),i=1e6*r[0]+r[1]/1e3,a=100*(t.user+t.system)/i;e(a)}catch(t){r(t)}}),t.timeout||1e3)}))},isPortUsed:async function(t){return await tr.check(+t,"localhost")},getHostIp:async function(t){if("localhost"==t)return"127.0.0.1";if(this.isValidIp(t))return t;const e=this.dnsCache.get(t);if(e){if(e.createdAt+this.dnsCachePeriod>Date.now())return e.value;this.dnsCache.delete(t)}return await new Promise((e=>{tr.lookup(t,((r,n)=>{if(r||!n||/^127/.test(n))return e(null);if(this.isIpv6(n)&&(n=this.getFullIpv6(n)),this.dnsCache.set(t,{value:n,createdAt:Date.now()}),this.dnsCache.size>this.dnsCacheLimit){Array.from(this.dnsCache.keys()).slice(0,this.dnsCache.size-this.dnsCacheLimit).forEach((t=>this.dnsCache.delete(t)))}return e(n)}))}))},getAddressIp:async function(t){return await this.getHostIp(this.splitAddress(t)[0])},getRequestTimer:function(t,e={}){let r=Date.now();return(n,o)=>{if(o=Object.assign({},e,o),n&&!Array.isArray(n)&&(n=[n]),void 0===t)return n?n[0]:void 0;const i=Date.now();if(t-=i-r,r=i,n){let e=o.min,r=n.reduce(((t,e)=>t+e)),i=r/t,a=i>1?n[0]/i:n[0];return a>n[0]&&(a=n[0]),o.grabFree&&t>r&&(a+=(t-r)/n.length),e&&at&&(a=t),a>0?a:0}return t}},getExternalIp:async function(){let t=null;for(let e of this.ipLookupPoints)try{const r=await er(e,{signal:AbortSignal.timeout(1e3)}),n=await r.text();if(this.isValidIp(n)){t=n;break}}catch(t){continue}return t},getLocalIp:function(){const t=tr.networkInterfaces();let e;for(let r in t)for(let n in t[r]){const o=t[r][n];"IPv4"!==o.family||o.internal||(e=o.address)}return e},getRemoteIp:function(t,e={}){let r=t.connection.remoteAddress||t.socket.remoteAddress,n=!0;if(!r)return"";const o=t=>{if(!e.trusted||!e.trusted.length)return!0;for(let r=0;rt.trim())),i=n.slice(1);if(e.trusted){i.reduce(((t,e)=>o(e)?t+1:t),0)===i.length&&(r=n[0])}else r=n[0]}return r&&this.isIpv6(r)&&(r=this.getFullIpv6(r)),r},getFullIpv6:function(t){return tr.parse(t).toString({format:"v6",zeroElide:!1,zeroPad:!0})},isIpv6:function(t){return!("string"!=typeof t||!t.match(":")||!tr(t))},ipv4Tov6:function(t){return this.getFullIpv6("::ffff:"+t)},isIpEqual:function(t,e){return 0==tr.compare(tr.parse(t),tr.parse(e))},createAddress:function(t,e){return this.isIpv6(t)?`[${this.getFullIpv6(t)}]:${e}`:`${t}:${e}`},isValidPort:function(t){return!!["number","string"].includes(typeof t)&&(+t>=0&&+t<=65535)},isValidIp:function(t){return tr(t)},isValidDomain:function(t){return"string"==typeof t&&this.domainValidationRegex.test(t)},isValidHostname:function(t){return this.isValidDomain(t)||this.isValidIp(t)},isValidAddress:function(t){if(!t||"string"!=typeof t)return!1;const e=this.splitAddress(t),r=e[0],n=e[1];return this.isValidHostname(r)&&this.isValidPort(n)},splitAddress:function(t){let e;return t&&"string"==typeof t?t.match("]")?(e=t.split("]:"),[this.getFullIpv6(e[0].slice(1)),+e[1]]):(e=t.split(":"),[e[0],+e[1]]):[]},createDataHash:function(t){return tr.createHash("md5").update(t.join("+")).digest("hex")},getClosestPeriodTime:function(t,e){return Math.floor(t/e)*e},isHexColor:function(t){return"string"==typeof t&&/^#[0-9A-F]{6}$/i.test(t)},getRandomHexColor:function(){return"#"+Math.floor(16777216*Math.random()).toString(16).padStart(6,0)},invertHexColor:function(t){return"#"+(16777215^Number(`0x1${t.slice(1)}`)).toString(16).slice(1).toUpperCase()},createRequestTimeoutError:function(){const t=new Error("Request timed out");return t.code="ERR_SPREADABLE_REQUEST_TIMEDOUT",t},isRequestTimeoutError:function(t){return t instanceof Error&&(["ESOCKETTIMEDOUT","ETIMEDOUT","ERR_SPREADABLE_REQUEST_TIMEDOUT"].includes(t.code)||["request-timeout","body-timeout"].includes(t.type))},FilesQueue:class{constructor(t,e={}){this.folderPath=t,this.options=Object.assign({limit:5,ext:""},e),this.files=[],this.__queue=[]}async init(){await this.normalize()}async sort(){return this.files.sort(((t,e)=>t.index-e.index))}async info(t){return{filePath:t,stat:await tr.stat(t),index:parseInt(tr.basename(t))}}async normalize(){await tr.ensureDir(this.folderPath),this.files=await tr.readdir(this.folderPath);for(let t=0;t{const n=async()=>{let n,o;try{o=await t()}catch(t){n=t}n?r(n):e(o),this.__queue.shift(),this.__queue.length&&this.__queue[0]()};this.__queue.push(n),this.__queue.length<=1&&n()}))}getLast(){return this.files[this.files.length-1]||null}getFirst(){return this.files[0]||null}createName(t){return`${t}${this.options.ext?"."+this.options.ext:""}`}createNewName(){const t=this.getLast(),e=t?t.index+1:1;return this.createName(e)}}},zn=Cn;class Vn{constructor(){this.__services=[]}async init(){if(!this.node&&!this.__isMasterService)throw new Error(`You have to register the service "${this.constructor.name}" at first`);await this.initServices(),this.__initialized=Date.now()}async deinit(){await this.deinitServices(),this.__initialized=!1}async destroy(){await this.destroyServices(),await this.deinit()}async addService(t,e,r){const n=this.__services.findIndex((e=>e.name===t&&e.type===r));return-1!=n&&this.__services.splice(n,1),this.__services.push({service:e,name:t,type:r}),e.name=t,e.node=this,this.__initialized&&!e.__initialized&&await e.init(),e}async getService(t,e){const r=this.__services.find((r=>r.name===t&&r.type==e));return r?r.service:null}async removeService(t,e){const r=this.__services.findIndex((r=>r.name===t&&r.type==e));if(-1==r)return;const n=this.__services[r];await n.service.destroy(),this.__services.splice(r,1)}async initServices(){for(let t=0;t=0;t--)await this.__services[t].service.deinit()}async destroyServices(){for(let t=this.__services.length-1;t>=0;t--)await this.__services[t].service.destroy();this.__services=[]}isInitialized(){return!!this.__initialized}getVersion(){return`${this.constructor.codename}-${this.constructor.version.split(".").slice(0,-1).join(".")}`}}var Gn=r(320);const Wn=class extends(Hn||Vn){constructor(t={}){super(...arguments),this.options=t,this.levels=["info","warn","error"],this.defaultLevel="info"}async init(){this.setLevel(void 0===this.options.level?this.defaultLevel:this.options.level),await super.init.apply(this,arguments)}async deinit(){this.setLevel(!1),await super.deinit.apply(this,arguments)}async log(){throw new Error('Method "log" is required for logger transport')}async info(...t){await this.log("info",...t)}async warn(...t){await this.log("warn",...t)}async error(...t){await this.log("error",...t)}isLevelActive(t){return!!this.level&&this.levels.indexOf(t)>=this.levels.indexOf(this.level)}setLevel(t){if(!1===t)return this.level=!1;if(-1==this.levels.indexOf(t))throw new Error(`Wrong logger level "${t}"`);this.level=t}};var Hn;const Jn=(t=>class extends(t||Vn){constructor(t={}){super(...arguments),this.options=Me({showCompletionLogs:!0,showFailLogs:!0},t),this.tasks={}}async add(t,e,r,n){const o=Me({interval:e,fn:r,name:t},n);return void 0===o.isStopped&&(o.isStopped=!0),this.tasks[t]=o,o.isStopped||(await this.stop(o),await this.start(o)),o}async get(t){return this.tasks[t]||null}async remove(t){const e=this.tasks[t];e&&(!e.isStopped&&await this.stop(e),delete this.tasks[t])}async init(){this.startAll(),await super.init.apply(this,arguments)}async deinit(){this.stopAll(),await super.deinit.apply(this,arguments)}async startAll(){for(let t in this.tasks)await this.start(this.tasks[t])}async stopAll(){for(let t in this.tasks)await this.stop(this.tasks[t])}async run(t){if(t.isStopped)this.options.showFailLogs&&this.node.logger.warn(`Task "${t.name}" should be started at first`);else if(t.isRun)this.options.showFailLogs&&this.node.logger.warn(`Task "${t.name}" has blocking operations`);else{t.isRun=!0;try{await t.fn(),this.options.showCompletionLogs&&this.node.logger.info(`Task "${t.name}" has been completed`)}catch(e){this.options.showFailLogs&&this.node.logger.error(`Task "${t.name}", ${e.stack}`)}t.isRun=!1}}async start(t){t.isStopped=!1}async stop(t){t.isStopped=!0}})(),Yn=JSON.parse('{"N9":"spreadable","WU":"0.3.7"}');var Qn=r(3296).Sn;const Kn=(t=>class extends(t||Wn){constructor(){super(...arguments),this.colors={info:"white",warn:"yellow",error:"red"}}async log(t,e){this.isLevelActive(t)&&(Gn[t]||Gn.log)(zn.isBrowserEnv()?e:tr[this.colors[t]](e))}})(),Zn=(t=>class extends(t||Jn){async add(t,e,r,n){return super.add(t,zn.getMs(e),r,n)}async start(t){await super.start(t);const e=setInterval((()=>this.run(t)),t.interval);t.intervalObject=e}async stop(t){clearInterval(t.intervalObject),await super.stop(t)}})(),Xn=(e=>class extends(e||Vn){static get version(){return Yn.WU}static get codename(){return Yn.N9}static get utils(){return zn}static get errors(){return t}static get LoggerTransport(){return Kn}static get TaskTransport(){return Zn}static getAuthCookieValue(){if("object"!=typeof location||!location.hostname)return null;const t=`spreadableNetworkAuth[${this.getPageAddress()}]`,e=("; "+document.cookie).split("; "+t+"="),r=2==e.length&&e.pop().split(";").shift();return r?JSON.parse(atob(r)):null}static getPageAddress(){return"object"==typeof location&&location.hostname?`${location.hostname}:${location.port||("https"==this.getPageProtocol()?443:80)}`:""}static getPageProtocol(){return"object"==typeof location&&location.protocol?location.protocol.split(":")[0]:""}constructor(t={}){super(...arguments),this.options=Me({request:{pingTimeout:"1s",clientTimeout:"10s",approvalQuestionTimeout:"20s",ignoreVersion:!1},auth:this.constructor.getAuthCookieValue(),address:this.constructor.getPageAddress(),https:"https"==this.constructor.getPageProtocol(),logger:{level:"info"},task:{workerChangeInterval:"30s"}},t),!this.options.logger&&(this.options.logger={level:!1}),"string"==typeof this.options.logger&&(this.options.logger={level:this.options.logger}),this.LoggerTransport=this.constructor.LoggerTransport,this.TaskTransport=this.constructor.TaskTransport,this.address=this.options.address,this.__isMasterService=!0,this.prepareOptions()}async init(){if(!this.address)throw new Error("You must pass the node address");await this.prepareServices(),await super.init.apply(this,arguments);let t=this.address;if(Array.isArray(t)&&(t=Ze(t)),this.availableAddress=await this.getAvailableAddress(t),!this.availableAddress)throw new Error("Provided addresses are not available");this.workerAddress=this.availableAddress}async prepareServices(){await this.prepareLogger(),await this.prepareTask()}async prepareLogger(){this.logger=await this.addService("logger",new this.LoggerTransport(this.options.logger))}async prepareTask(){this.options.task&&(this.task=await this.addService("task",new this.TaskTransport(this.options.task))),this.task&&this.options.task.workerChangeInterval&&await this.task.add("workerChange",this.options.task.workerChangeInterval,(()=>this.changeWorker()))}async getAvailableAddress(t){let e;!Array.isArray(t)&&(t=[t]);for(let r=0;r({address:t}))),p=await this.requestGroup(l,"add-approval-info",Object.assign({},r,{includeErrors:!0,timeout:o(this.options.request.clientTimeout),body:{action:t,key:s,info:e,startedAt:c}}));for(let t=0;t{this.request(e,Me({address:a},r,i.options)).then(t).catch(t)})))}let o=await Promise.all(n);return!r.includeErrors&&(o=o.filter((t=>!(t instanceof Error)))),o}async request(t,e={}){let r=(e=Me(this.createDefaultRequestOptions(),e)).formData||e.body||{};if(r.timeout=e.timeout,r.timestamp=Date.now(),e.approvalInfo){const t=e.approvalInfo;if(delete t.question,!Object.prototype.hasOwnProperty.call(t,"answer"))throw new Error('Request "approvalInfo" option must include "answer" property');r.approvalInfo=e.formData?JSON.stringify(t):t}if(e.formData){const t=new Xe;for(let e in r){let n=r[e];"object"==typeof n?t.append(e,n.value,n.options):t.append(e,n)}e.body=t,delete e.formData}else e.headers["content-type"]="application/json",e.body=JSON.stringify(r);e.timeout&&!e.signal&&(e.signal=AbortSignal.timeout(Math.floor(e.timeout))),e.url=this.createRequestUrl(t,e);const n=Date.now();let o={};try{if(o=await er(e.url,e),this.logger.info(`Request to "${e.url}": ${or(Date.now()-n)}`),o.ok)return e.getFullResponse?o:await o.json();const t=(o.headers.get("content-type")||"").match("application/json")?"json":"text",r=await o[t]();if(!r||"object"!=typeof r)throw new Error(r||"Unknown error");if(!r.code)throw new Error(r.message||r);throw new Nn(r.message,r.code)}catch(t){throw e.timeout&&"aborted"==t.type&&(t.type="request-timeout"),zn.isRequestTimeoutError(t)&&(t=zn.createRequestTimeoutError()),t.response=o,t.requestOptions=e,t}}createRequestUrl(t,e={}){const r=e.query?rr.stringify(e.query):null,n=e.address||this.workerAddress;let o=`${this.getRequestProtocol()}://${n}/client/${t}`;return r&&(o+="?"+r),o}createDefaultRequestOptions(t={}){const e={method:"POST",timeout:this.options.request.clientTimeout};if(this.options.request.ignoreVersion||(e.headers={"client-version":this.getVersion()}),this.options.auth){const t=this.options.auth.username,r=this.options.auth.password;let n="Basic ";n+="function"==typeof Qn?Qn.from(t+":"+r).toString("base64"):btoa(t+":"+r),e.headers.authorization=n}return t.timeout&&(t.timeout=zn.getMs(t.timeout)),"object"==typeof this.options.https&&this.options.https.ca&&(tr.Agent?(t.agent=t.agent||new tr.Agent,t.agent.options.ca=this.options.https.ca):(t.agent=t.agent||{},t.agent.ca=this.options.https.ca)),Me({},e,t)}createRequestTimer(t,e={}){return e=Object.assign({min:this.options.request.pingTimeout},e),zn.getRequestTimer(t,e)}prepareOptions(){this.options.request.pingTimeout=zn.getMs(this.options.request.pingTimeout),this.options.request.clientTimeout=zn.getMs(this.options.request.clientTimeout),this.options.request.approvalQuestionTimeout=zn.getMs(this.options.request.approvalQuestionTimeout)}getRequestProtocol(){return this.options.https?"https":"http"}envTest(t,e){const r=zn.isBrowserEnv();if(t&&!r)throw new Error(`You can't use "${e}" method in the nodejs environment`);if(!t&&r)throw new Error(`You can't use "${e}" method in the browser environment`)}})()})(),n=n.default})())); \ No newline at end of file +e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,f=-7,l=r?o-1:0,p=r?-1:1,h=t[e+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+t[e+l],l+=p,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=u}return(h?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,c,u=8*i-o-1,f=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=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?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?p/c:p*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*c-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=y,s/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=y,a/=256,u-=8);t[r+h-y]|=128*g}},8248:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2816:(t,e,r)=>{"use strict";var n=r(3804)(),o=r(2768)("Object.prototype.toString"),i=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=s?i:a},8528:t=>{"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),l=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(l=function(t){if((f||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(l(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(l(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return s(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},7700:(t,e,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(3804)(),c=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(t);if(!c)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&c(e)}return c(t)===n}},5108:t=>{"use strict";t.exports=function(t){return t!=t}},2796:(t,e,r)=>{"use strict";var n=r(4572),o=r(5728),i=r(5108),a=r(4312),s=r(5528),c=n(a(),Number);o(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},4312:(t,e,r)=>{"use strict";var n=r(5108);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},5528:(t,e,r)=>{"use strict";var n=r(5728),o=r(4312);t.exports=function(){var t=o();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},3340:(t,e,r)=>{"use strict";var n=r(8488);t.exports=function(t){return!!n(t)}},6952:t=>{var e=1e3,r=60*e,n=60*r,o=24*n,i=7*o,a=365.25*o;function s(t,e,r,n){var o=e>=1.5*r;return Math.round(t/r)+" "+n+(o?"s":"")}t.exports=function(t,c){c=c||{};var u=typeof t;if("string"===u&&t.length>0)return function(t){if((t=String(t)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(t);if("number"===u&&isFinite(t))return c.long?function(t){var i=Math.abs(t);if(i>=o)return s(t,i,o,"day");if(i>=n)return s(t,i,n,"hour");if(i>=r)return s(t,i,r,"minute");if(i>=e)return s(t,i,e,"second");return t+" ms"}(t):function(t){var i=Math.abs(t);if(i>=o)return Math.round(t/o)+"d";if(i>=n)return Math.round(t/n)+"h";if(i>=r)return Math.round(t/r)+"m";if(i>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},6e3:(t,e,r)=>{"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,n.fetch&&(e.default=n.fetch.bind(n)),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},7344:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},1620:(t,e,r)=>{"use strict";var n=r(5728),o=r(4572),i=r(7344),a=r(9756),s=r(8116),c=o(a(),Object);n(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},9756:(t,e,r)=>{"use strict";var n=r(7344);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},8116:(t,e,r)=>{"use strict";var n=r(9756),o=r(5728);t.exports=function(){var t=n();return o(Object,{is:t},{is:function(){return Object.is!==t}}),t}},3816:(t,e,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(3428),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{l(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),s=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var y=u&&r;if(s&&t.length>0&&!o.call(t,0))for(var g=0;g0)for(var d=0;d{"use strict";var n=Array.prototype.slice,o=r(3428),i=Object.keys,a=i?function(t){return i(t)}:r(3816),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?s(n.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},3428:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},7928:(t,e,r)=>{"use strict";var n=r(7056),o=r(1968)(),i=r(2768),a=Object,s=i("Array.prototype.push"),c=i("Object.prototype.propertyIsEnumerable"),u=o?Object.getOwnPropertySymbols:null;t.exports=function(t,e){if(null==t)throw new TypeError("target must be an object");var r=a(t);if(1===arguments.length)return r;for(var i=1;i{"use strict";var n=r(7928);t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var s,c=[],u=!1,f=-1;function l(){u&&s&&(u=!1,s.length?c=s.concat(c):f=-1,c.length&&p())}function p(){if(!u){var t=a(l);u=!0;for(var e=c.length;e;){for(s=c,c=[];++f1)for(var r=1;r{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,n,o,i){n=n||"&",o=o||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(n);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var u=t.length;c>0&&u>c&&(u=c);for(var f=0;f=0?(l=g.substr(0,d),p=g.substr(d+1)):(l=g,p=""),h=decodeURIComponent(l),y=decodeURIComponent(p),e(a,h)?r(a[h])?a[h].push(y):a[h]=[a[h],y]:a[h]=y}return a};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},9504:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,i,a,s){return i=i||"&",a=a||"=",null===t&&(t=void 0),"object"==typeof t?n(o(t),(function(o){var s=encodeURIComponent(e(o))+a;return r(t[o])?n(t[o],(function(t){return s+encodeURIComponent(e(t))})).join(i):s+encodeURIComponent(e(t[o]))})).join(i):s?encodeURIComponent(e(s))+a+encodeURIComponent(e(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n{"use strict";e.decode=e.parse=r(2664),e.encode=e.stringify=r(9504)},2392:(t,e,r)=>{"use strict";var n=r(6604),o=r(5456),i=r(1188)(),a=r(872),s=r(6556),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&a){var f=a(t,"length");f&&!f.configurable&&(n=!1),f&&!f.writable&&(u=!1)}return(n||u||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},2848:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},9032:(t,e,r)=>{"use strict";var n=r(2816),o=r(7700),i=r(8488),a=r(3340);function s(t){return t.call.bind(t)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,f=s(Object.prototype.toString),l=s(Number.prototype.valueOf),p=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(c)var y=s(BigInt.prototype.valueOf);if(u)var g=s(Symbol.prototype.valueOf);function d(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function v(t){return"[object Set]"===f(t)}function m(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function A(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function j(t){return"[object DataView]"===f(t)}function O(t){return"undefined"!=typeof DataView&&(j.working?j(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=o,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||O(t)},e.isUint8Array=function(t){return"Uint8Array"===i(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===i(t)},e.isUint16Array=function(t){return"Uint16Array"===i(t)},e.isUint32Array=function(t){return"Uint32Array"===i(t)},e.isInt8Array=function(t){return"Int8Array"===i(t)},e.isInt16Array=function(t){return"Int16Array"===i(t)},e.isInt32Array=function(t){return"Int32Array"===i(t)},e.isFloat32Array=function(t){return"Float32Array"===i(t)},e.isFloat64Array=function(t){return"Float64Array"===i(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===i(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===i(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(v.working?v(t):t instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(m.working?m(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=A,j.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&j(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=O;var S="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function _(t){return"[object SharedArrayBuffer]"===f(t)}function x(t){return void 0!==S&&(void 0===_.working&&(_.working=_(new S)),_.working?_(t):t instanceof S)}function P(t){return d(t,l)}function R(t){return d(t,p)}function I(t){return d(t,h)}function T(t){return c&&d(t,y)}function B(t){return u&&d(t,g)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=P,e.isStringObject=R,e.isBooleanObject=I,e.isBigIntObject=T,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return P(t)||R(t)||I(t)||T(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(A(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},3912:(t,e,r)=>{var n=r(6512),o=r(320),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&e._extend(n,r),E(n.showHidden)&&(n.showHidden=!1),E(n.depth)&&(n.depth=2),E(n.colors)&&(n.colors=!1),E(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=f.styles[e];return r?"["+f.colors[r][0]+"m"+t+"["+f.colors[r][1]+"m":t}function p(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&_(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return w(o)||(o=h(t,o,n)),o}var i=function(t,e){if(E(e))return t.stylize("undefined","undefined");if(w(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(b(e))return t.stylize(""+e,"boolean");if(v(e))return t.stylize("null","null")}(t,r);if(i)return i;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return y(r);if(0===a.length){if(_(r)){var c=r.name?": "+r.name:"";return t.stylize("[Function"+c+"]","special")}if(A(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(O(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return y(r)}var u,f="",l=!1,p=["{","}"];(d(r)&&(l=!0,p=["[","]"]),_(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return A(r)&&(f=" "+RegExp.prototype.toString.call(r)),O(r)&&(f=" "+Date.prototype.toUTCString.call(r)),S(r)&&(f=" "+y(r)),0!==a.length||l&&0!=r.length?n<0?A(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=l?function(t,e,r,n,o){for(var i=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(u,f,p)):p[0]+f+p[1]}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function g(t,e,r,n,o,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?s=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(s=t.stylize("[Setter]","special")),I(n,o)||(a="["+o+"]"),s||(t.seen.indexOf(c.value)<0?(s=v(r)?h(t,c.value,null):h(t,c.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),E(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function v(t){return null===t}function m(t){return"number"==typeof t}function w(t){return"string"==typeof t}function E(t){return void 0===t}function A(t){return j(t)&&"[object RegExp]"===x(t)}function j(t){return"object"==typeof t&&null!==t}function O(t){return j(t)&&"[object Date]"===x(t)}function S(t){return j(t)&&("[object Error]"===x(t)||t instanceof Error)}function _(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(c.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);o.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(9032),e.isArray=d,e.isBoolean=b,e.isNull=v,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=E,e.isRegExp=A,e.types.isRegExp=A,e.isObject=j,e.isDate=O,e.types.isDate=O,e.isError=S,e.types.isNativeError=S,e.isFunction=_,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(2848);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;o.log("%s - %s",(t=new Date,r=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":"),[t.getDate(),R[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(8248),e._extend=function(t,e){if(!e||!j(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e;if("function"!=typeof(e=t[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i{"use strict";var n=r(7040),o=r(7236),i=r(4572),a=r(2768),s=r(872),c=a("Object.prototype.toString"),u=r(3804)(),f="undefined"==typeof globalThis?r.g:globalThis,l=o(),p=a("String.prototype.slice"),h=Object.getPrototypeOf,y=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(g,(function(r,n){if(!e)try{r(t),e=p(n,1)}catch(t){}})),e}(t)}return s?function(t){var e=!1;return n(g,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=p(n,1))}catch(t){}})),e}(t):null}},7236:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),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={};return(()=>{"use strict";r.d(n,{default:()=>ro});var t={};r.r(t),r.d(t,{AccessError:()=>Cn,AuthError:()=>$n,NotFoundError:()=>zn,WorkError:()=>Dn});const e=function(){this.__data__=[],this.size=0};const o=function(t,e){return t===e||t!=t&&e!=e};const i=function(t,e){for(var r=t.length;r--;)if(o(t[r][0],e))return r;return-1};var a=Array.prototype.splice;const s=function(t){var e=this.__data__,r=i(e,t);return!(r<0)&&(r==e.length-1?e.pop():a.call(e,r,1),--this.size,!0)};const c=function(t){var e=this.__data__,r=i(e,t);return r<0?void 0:e[r][1]};const u=function(t){return i(this.__data__,t)>-1};const f=function(t,e){var r=this.__data__,n=i(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991};const Vt=function(t){return null!=t&&zt(t.length)&&!T(t)};const Gt=function(t){return Lt(t)&&Vt(t)};const Wt=function(){return!1};var Ht="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=Ht&&"object"==typeof module&&module&&!module.nodeType&&module,Yt=Jt&&Jt.exports===Ht?m.Buffer:void 0;const Qt=(Yt?Yt.isBuffer:void 0)||Wt;var Kt=Function.prototype,Zt=Object.prototype,Xt=Kt.toString,te=Zt.hasOwnProperty,ee=Xt.call(Object);const re=function(t){if(!Lt(t)||"[object Object]"!=R(t))return!1;var e=Bt(t);if(null===e)return!0;var r=te.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Xt.call(r)==ee};var ne={};ne["[object Float32Array]"]=ne["[object Float64Array]"]=ne["[object Int8Array]"]=ne["[object Int16Array]"]=ne["[object Int32Array]"]=ne["[object Uint8Array]"]=ne["[object Uint8ClampedArray]"]=ne["[object Uint16Array]"]=ne["[object Uint32Array]"]=!0,ne["[object Arguments]"]=ne["[object Array]"]=ne["[object ArrayBuffer]"]=ne["[object Boolean]"]=ne["[object DataView]"]=ne["[object Date]"]=ne["[object Error]"]=ne["[object Function]"]=ne["[object Map]"]=ne["[object Number]"]=ne["[object Object]"]=ne["[object RegExp]"]=ne["[object Set]"]=ne["[object String]"]=ne["[object WeakMap]"]=!1;const oe=function(t){return Lt(t)&&zt(t.length)&&!!ne[R(t)]};const ie=function(t){return function(e){return t(e)}};var ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,se=ae&&"object"==typeof module&&module&&!module.nodeType&&module,ce=se&&se.exports===ae&&b.process,ue=function(){try{var t=se&&se.require&&se.require("util").types;return t||ce&&ce.binding&&ce.binding("util")}catch(t){}}();var fe=ue&&ue.isTypedArray;const le=fe?ie(fe):oe;const pe=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var he=Object.prototype.hasOwnProperty;const ye=function(t,e,r){var n=t[e];he.call(t,e)&&o(n,r)&&(void 0!==r||e in t)||bt(t,e,r)};const ge=function(t,e,r,n){var o=!r;r||(r={});for(var i=-1,a=e.length;++i-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ke);const Le=function(t,e){return Fe(Te(t,e,Pe),t+"")};const Ne=function(t,e,r){if(!I(r))return!1;var n=typeof e;return!!("number"==n?Vt(r)&&ve(e,r.length):"string"==n&&e in r)&&o(r[e],t)};const Me=function(t){return Le((function(e,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&Ne(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++ns))return!1;var u=i.get(t),f=i.get(e);if(u&&f)return u==e&&f==t;var l=-1,p=!0,h=2&r?new lr:void 0;for(i.set(t,e),i.set(e,t);++l-1};const Un=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n=200){var u=e?null:Nn(t);if(u)return dr(u);a=!1,o=hr,c=new lr}else c=e?[]:s;t:for(;++nJSON.stringify(e,null,2);let i=null,a=!1;for(let t=0;tJSON.stringify(s,null,2);try{if(s.type!=n){const t=`Wrong data type "${n}" instead of "${s.type}" ${o()} for ${c()}`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_WRONG_DATA_TYPE")}if("array"==n){const t="function"==typeof s.minLength?t(e):s.minLength,r="function"==typeof s.maxLength?r(e):s.maxLength;if(t&&e.lengthr){const t=`Wrong array max length ${o()} for ${c()}`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_WRONG_ARRAY_MAX_LENGTH")}if(s.uniq){if((!0===s.uniq?qn(e):qn(e,s.uniq)).length!=e.length){const t=`Wrong array uniqueness ${o()} for ${c()}`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_WRONG_ARRAY_UNIQUENESS")}}s.items&&e.forEach((t=>this.validateSchema(s.items,t)))}else if("object"==n){const t=s.props||{},r=s.required;if(r&&!Array.isArray(r))throw new Error(`Option "required" for ${c()} must be an array`);if(s.canBeNull&&null===e){a=!0;continue}if(!1===s.canBeNull&&null===e){const t=`Data for ${c()} can't be null`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_NULL")}if(s.strict){const r=Object.keys(t).sort(),n=Object.keys(e).sort();if(r.toString()!=n.toString()){const t=`Wrong strict object structure ${o()} for ${c()}`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_STRICT")}}if(s.expected)for(let r in e)if(!Object.prototype.hasOwnProperty.call(t,r)){const t=`Wrong expected object structure ${o()} for ${c()}`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_EXPECTED")}const n={};r&&r.forEach((t=>n[t]=!0));for(let i in t)if(Object.prototype.hasOwnProperty.call(e,i))this.validateSchema(t[i],e[i]);else if(r&&n[i]){const t=`Property "${i}" is required in ${o()} for ${c()}`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_REQUIRED_PROPS")}}if(!Object.prototype.hasOwnProperty.call(s,"value")){a=!0;continue}let t;if("function"==typeof s.value)t=s.value(e);else if(s.value instanceof RegExp)t=String(e).match(s.value);else{t=-1!=(Array.isArray(s.value)?s.value:[s.value]).indexOf(e)}if(!t){const t=`Validation is failed for ${o()}`;throw new Dn(t,"ERR_SPREADABLE_VALIDATE_SCHEMA_VALUE")}a=!0}catch(t){i=t}}if(!a&&i)throw i},isBrowserEnv:function(){return"object"==typeof window},getRandomElement:function(t){return t[Math.floor(Math.random()*t.length)]},getMs:function(t){return"string"!=typeof t||"auto"==t?t:sr(t)},getBytes:function(t){return"string"!=typeof t||t.match("%")||"auto"==t?t:ar(t)},getCpuUsage:async function(t={}){return await new Promise(((e,r)=>{const n=Vn.cpuUsage(),o=Vn.hrtime();setTimeout((()=>{try{const t=Vn.cpuUsage(n),r=Vn.hrtime(o),i=1e6*r[0]+r[1]/1e3,a=100*(t.user+t.system)/i;e(a)}catch(t){r(t)}}),t.timeout||1e3)}))},isPortUsed:async function(t){return await nr.check(+t,"localhost")},getHostIp:async function(t){if("localhost"==t)return"127.0.0.1";if(this.isValidIp(t))return t;const e=this.dnsCache.get(t);if(e){if(e.createdAt+this.dnsCachePeriod>Date.now())return e.value;this.dnsCache.delete(t)}return await new Promise((e=>{nr.lookup(t,((r,n)=>{if(r||!n||/^127/.test(n))return e(null);if(this.isIpv6(n)&&(n=this.getFullIpv6(n)),this.dnsCache.set(t,{value:n,createdAt:Date.now()}),this.dnsCache.size>this.dnsCacheLimit){Array.from(this.dnsCache.keys()).slice(0,this.dnsCache.size-this.dnsCacheLimit).forEach((t=>this.dnsCache.delete(t)))}return e(n)}))}))},getAddressIp:async function(t){return await this.getHostIp(this.splitAddress(t)[0])},getRequestTimer:function(t,e={}){let r=Date.now();return(n,o)=>{if(o=Object.assign({},e,o),n&&!Array.isArray(n)&&(n=[n]),void 0===t)return n?n[0]:void 0;const i=Date.now();if(t-=i-r,r=i,n){let e=o.min,r=n.reduce(((t,e)=>t+e)),i=r/t,a=i>1?n[0]/i:n[0];return a>n[0]&&(a=n[0]),o.grabFree&&t>r&&(a+=(t-r)/n.length),e&&at&&(a=t),a>0?a:0}return t}},getExternalIp:async function(){let t=null;for(let e of this.ipLookupPoints)try{const r=await or(e,{signal:AbortSignal.timeout(1e3)}),n=await r.text();if(this.isValidIp(n)){t=n;break}}catch(t){continue}return t},getLocalIp:function(){const t=nr.networkInterfaces();let e;for(let r in t)for(let n in t[r]){const o=t[r][n];"IPv4"!==o.family||o.internal||(e=o.address)}return e},getRemoteIp:function(t,e={}){let r=t.connection.remoteAddress||t.socket.remoteAddress,n=!0;if(!r)return"";const o=t=>{if(!e.trusted||!e.trusted.length)return!0;for(let r=0;rt.trim())),i=n.slice(1);if(e.trusted){i.reduce(((t,e)=>o(e)?t+1:t),0)===i.length&&(r=n[0])}else r=n[0]}return r&&this.isIpv6(r)&&(r=this.getFullIpv6(r)),r},getFullIpv6:function(t){return nr.parse(t).toString({format:"v6",zeroElide:!1,zeroPad:!0})},isIpv6:function(t){return!("string"!=typeof t||!t.match(":")||!nr(t))},ipv4Tov6:function(t){return this.getFullIpv6("::ffff:"+t)},isIpEqual:function(t,e){return 0==nr.compare(nr.parse(t),nr.parse(e))},createAddress:function(t,e){return this.isIpv6(t)?`[${this.getFullIpv6(t)}]:${e}`:`${t}:${e}`},isValidPort:function(t){return!!["number","string"].includes(typeof t)&&(+t>=0&&+t<=65535)},isValidIp:function(t){return nr(t)},isValidDomain:function(t){return"string"==typeof t&&this.domainValidationRegex.test(t)},isValidHostname:function(t){return this.isValidDomain(t)||this.isValidIp(t)},isValidAddress:function(t){if(!t||"string"!=typeof t)return!1;const e=this.splitAddress(t),r=e[0],n=e[1];return this.isValidHostname(r)&&this.isValidPort(n)},splitAddress:function(t){let e;return t&&"string"==typeof t?t.match("]")?(e=t.split("]:"),[this.getFullIpv6(e[0].slice(1)),+e[1]]):(e=t.split(":"),[e[0],+e[1]]):[]},createDataHash:function(t){return nr.createHash("md5").update(t.join("+")).digest("hex")},getClosestPeriodTime:function(t,e){return Math.floor(t/e)*e},isHexColor:function(t){return"string"==typeof t&&/^#[0-9A-F]{6}$/i.test(t)},getRandomHexColor:function(){return"#"+Math.floor(16777216*Math.random()).toString(16).padStart(6,0)},invertHexColor:function(t){return"#"+(16777215^Number(`0x1${t.slice(1)}`)).toString(16).slice(1).toUpperCase()},createRequestTimeoutError:function(){const t=new Error("Request timed out");return t.code="ERR_SPREADABLE_REQUEST_TIMEDOUT",t},isRequestTimeoutError:function(t){return t instanceof Error&&(["ESOCKETTIMEDOUT","ETIMEDOUT","ERR_SPREADABLE_REQUEST_TIMEDOUT"].includes(t.code)||["request-timeout","body-timeout"].includes(t.type))},FilesQueue:class{constructor(t,e={}){this.folderPath=t,this.options=Object.assign({limit:5,ext:""},e),this.files=[],this.__queue=[]}async init(){await this.normalize()}async sort(){return this.files.sort(((t,e)=>t.index-e.index))}async info(t){return{filePath:t,stat:await nr.stat(t),index:parseInt(nr.basename(t))}}async normalize(){await nr.ensureDir(this.folderPath),this.files=await nr.readdir(this.folderPath);for(let t=0;t{const n=async()=>{let n,o;try{o=await t()}catch(t){n=t}n?r(n):e(o),this.__queue.shift(),this.__queue.length&&this.__queue[0]()};this.__queue.push(n),this.__queue.length<=1&&n()}))}getLast(){return this.files[this.files.length-1]||null}getFirst(){return this.files[0]||null}createName(t){return`${t}${this.options.ext?"."+this.options.ext:""}`}createNewName(){const t=this.getLast(),e=t?t.index+1:1;return this.createName(e)}}},Wn=Gn;class Hn{constructor(){this.__services=[]}async init(){if(!this.node&&!this.__isMasterService)throw new Error(`You have to register the service "${this.constructor.name}" at first`);await this.initServices(),this.__initialized=Date.now()}async deinit(){await this.deinitServices(),this.__initialized=!1}async destroy(){await this.destroyServices(),await this.deinit()}async addService(t,e,r){const n=this.__services.findIndex((e=>e.name===t&&e.type===r));return-1!=n&&this.__services.splice(n,1),this.__services.push({service:e,name:t,type:r}),e.name=t,e.node=this,this.__initialized&&!e.__initialized&&await e.init(),e}async getService(t,e){const r=this.__services.find((r=>r.name===t&&r.type==e));return r?r.service:null}async removeService(t,e){const r=this.__services.findIndex((r=>r.name===t&&r.type==e));if(-1==r)return;const n=this.__services[r];await n.service.destroy(),this.__services.splice(r,1)}async initServices(){for(let t=0;t=0;t--)await this.__services[t].service.deinit()}async destroyServices(){for(let t=this.__services.length-1;t>=0;t--)await this.__services[t].service.destroy();this.__services=[]}isInitialized(){return!!this.__initialized}getVersion(){return`${this.constructor.codename}-${this.constructor.version.split(".").slice(0,-1).join(".")}`}}var Jn=r(320);const Yn=class extends(Qn||Hn){constructor(t={}){super(...arguments),this.options=t,this.levels=["info","warn","error"],this.defaultLevel="info"}async init(){this.setLevel(void 0===this.options.level?this.defaultLevel:this.options.level),await super.init.apply(this,arguments)}async deinit(){this.setLevel(!1),await super.deinit.apply(this,arguments)}async log(){throw new Error('Method "log" is required for logger transport')}async info(...t){await this.log("info",...t)}async warn(...t){await this.log("warn",...t)}async error(...t){await this.log("error",...t)}isLevelActive(t){return!!this.level&&this.levels.indexOf(t)>=this.levels.indexOf(this.level)}setLevel(t){if(!1===t)return this.level=!1;if(-1==this.levels.indexOf(t))throw new Error(`Wrong logger level "${t}"`);this.level=t}};var Qn;const Kn=(t=>class extends(t||Hn){constructor(t={}){super(...arguments),this.options=Me({showCompletionLogs:!0,showFailLogs:!0},t),this.tasks={}}async add(t,e,r,n){const o=Me({interval:e,fn:r,name:t},n);return void 0===o.isStopped&&(o.isStopped=!0),this.tasks[t]=o,o.isStopped||(await this.stop(o),await this.start(o)),o}async get(t){return this.tasks[t]||null}async remove(t){const e=this.tasks[t];e&&(!e.isStopped&&await this.stop(e),delete this.tasks[t])}async init(){this.startAll(),await super.init.apply(this,arguments)}async deinit(){this.stopAll(),await super.deinit.apply(this,arguments)}async startAll(){for(let t in this.tasks)await this.start(this.tasks[t])}async stopAll(){for(let t in this.tasks)await this.stop(this.tasks[t])}async run(t){if(t.isStopped)this.options.showFailLogs&&this.node.logger.warn(`Task "${t.name}" should be started at first`);else if(t.isRun)this.options.showFailLogs&&this.node.logger.warn(`Task "${t.name}" has blocking operations`);else{t.isRun=!0;try{await t.fn(),this.options.showCompletionLogs&&this.node.logger.info(`Task "${t.name}" has been completed`)}catch(e){this.options.showFailLogs&&this.node.logger.error(`Task "${t.name}", ${e.stack}`)}t.isRun=!1}}async start(t){t.isStopped=!1}async stop(t){t.isStopped=!0}})(),Zn=JSON.parse('{"N9":"spreadable","WU":"0.3.8"}');var Xn=r(3296).Sn;const to=(t=>class extends(t||Yn){constructor(){super(...arguments),this.colors={info:"white",warn:"yellow",error:"red"}}async log(t,e){this.isLevelActive(t)&&(Jn[t]||Jn.log)(Wn.isBrowserEnv()?e:nr[this.colors[t]](e))}})(),eo=(t=>class extends(t||Kn){async add(t,e,r,n){return super.add(t,Wn.getMs(e),r,n)}async start(t){await super.start(t);const e=setInterval((()=>this.run(t)),t.interval);t.intervalObject=e}async stop(t){clearInterval(t.intervalObject),await super.stop(t)}})(),ro=(e=>class extends(e||Hn){static get version(){return Zn.WU}static get codename(){return Zn.N9}static get utils(){return Wn}static get errors(){return t}static get LoggerTransport(){return to}static get TaskTransport(){return eo}static getAuthCookieValue(){if("object"!=typeof location||!location.hostname)return null;const t=`spreadableNetworkAuth[${this.getPageAddress()}]`,e=("; "+document.cookie).split("; "+t+"="),r=2==e.length&&e.pop().split(";").shift();return r?JSON.parse(atob(r)):null}static getPageAddress(){return"object"==typeof location&&location.hostname?`${location.hostname}:${location.port||("https"==this.getPageProtocol()?443:80)}`:""}static getPageProtocol(){return"object"==typeof location&&location.protocol?location.protocol.split(":")[0]:""}constructor(t={}){super(...arguments),this.options=Me({request:{pingTimeout:"1s",clientTimeout:"10s",approvalQuestionTimeout:"20s",ignoreVersion:!1},auth:this.constructor.getAuthCookieValue(),address:this.constructor.getPageAddress(),https:"https"==this.constructor.getPageProtocol(),logger:{level:"info"},task:{workerChangeInterval:"30s"}},t),!this.options.logger&&(this.options.logger={level:!1}),"string"==typeof this.options.logger&&(this.options.logger={level:this.options.logger}),this.LoggerTransport=this.constructor.LoggerTransport,this.TaskTransport=this.constructor.TaskTransport,this.address=this.options.address,this.__isMasterService=!0,this.prepareOptions()}async init(){if(!this.address)throw new Error("You must pass the node address");await this.prepareServices(),await super.init.apply(this,arguments);let t=this.address;if(Array.isArray(t)&&(t=Ze(t)),this.availableAddress=await this.getAvailableAddress(t),!this.availableAddress)throw new Error("Provided addresses are not available");this.workerAddress=this.availableAddress}async prepareServices(){await this.prepareLogger(),await this.prepareTask()}async prepareLogger(){this.logger=await this.addService("logger",new this.LoggerTransport(this.options.logger))}async prepareTask(){this.options.task&&(this.task=await this.addService("task",new this.TaskTransport(this.options.task))),this.task&&this.options.task.workerChangeInterval&&await this.task.add("workerChange",this.options.task.workerChangeInterval,(()=>this.changeWorker()))}async getAvailableAddress(t){let e;!Array.isArray(t)&&(t=[t]);for(let r=0;r({address:t}))),p=await this.requestGroup(l,"add-approval-info",Object.assign({},r,{includeErrors:!0,timeout:o(this.options.request.clientTimeout),body:{action:t,key:s,info:e,startedAt:c}}));for(let t=0;t{this.request(e,Me({address:a},r,i.options)).then(t).catch(t)})))}let o=await Promise.all(n);return!r.includeErrors&&(o=o.filter((t=>!(t instanceof Error)))),o}async request(t,e={}){let r=(e=Me(this.createDefaultRequestOptions(),e)).formData||e.body||{};if(r.timeout=e.timeout,r.timestamp=Date.now(),e.approvalInfo){const t=e.approvalInfo;if(delete t.question,!Object.prototype.hasOwnProperty.call(t,"answer"))throw new Error('Request "approvalInfo" option must include "answer" property');r.approvalInfo=e.formData?JSON.stringify(t):t}if(e.formData){const t=new tr;for(let e in r){let n=r[e];"object"==typeof n?t.append(e,n.value,n.options):t.append(e,n)}e.body=t,delete e.formData}else e.headers["content-type"]="application/json",e.body=JSON.stringify(r);e.timeout&&!e.signal&&(e.signal=AbortSignal.timeout(Math.floor(e.timeout))),e.url=this.createRequestUrl(t,e);const n=Date.now();let o={};try{if(o=await or(e.url,e),this.logger.info(`Request to "${e.url}": ${sr(Date.now()-n)}`),o.ok)return e.getFullResponse?o:await o.json();const t=(o.headers.get("content-type")||"").match("application/json")?"json":"text",r=await o[t]();if(!r||"object"!=typeof r)throw new Error(r||"Unknown error");if(!r.code)throw new Error(r.message||r);throw new Dn(r.message,r.code)}catch(t){throw e.timeout&&"aborted"==t.type&&(t.type="request-timeout"),Wn.isRequestTimeoutError(t)&&(t=Wn.createRequestTimeoutError()),t.response=o,t.requestOptions=e,t}}createRequestUrl(t,e={}){const r=e.query?ir.stringify(e.query):null,n=e.address||this.workerAddress;let o=`${this.getRequestProtocol()}://${n}/client/${t}`;return r&&(o+="?"+r),o}createDefaultRequestOptions(t={}){const e={method:"POST",timeout:this.options.request.clientTimeout};if(this.options.request.ignoreVersion||(e.headers={"client-version":this.getVersion()}),this.options.auth){const t=this.options.auth.username,r=this.options.auth.password;let n="Basic ";n+="function"==typeof Xn?Xn.from(t+":"+r).toString("base64"):btoa(t+":"+r),e.headers.authorization=n}return t.timeout&&(t.timeout=Wn.getMs(t.timeout)),"object"==typeof this.options.https&&this.options.https.ca&&(nr.Agent?(t.agent=t.agent||new nr.Agent,t.agent.options.ca=this.options.https.ca):(t.agent=t.agent||{},t.agent.ca=this.options.https.ca)),Me({},e,t)}createRequestTimer(t,e={}){return e=Object.assign({min:this.options.request.pingTimeout},e),Wn.getRequestTimer(t,e)}prepareOptions(){this.options.request.pingTimeout=Wn.getMs(this.options.request.pingTimeout),this.options.request.clientTimeout=Wn.getMs(this.options.request.clientTimeout),this.options.request.approvalQuestionTimeout=Wn.getMs(this.options.request.approvalQuestionTimeout)}getRequestProtocol(){return this.options.https?"https":"http"}envTest(t,e){const r=Wn.isBrowserEnv();if(t&&!r)throw new Error(`You can't use "${e}" method in the nodejs environment`);if(!t&&r)throw new Error(`You can't use "${e}" method in the browser environment`)}})()})(),n=n.default})())); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5e26e45..c9035f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "spreadable", - "version": "0.3.1", + "version": "0.3.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "spreadable", - "version": "0.3.1", + "version": "0.3.7", "license": "MIT", "dependencies": { "basic-auth": "^2.0.1", @@ -18,7 +18,7 @@ "cors": "^2.8.5", "cron": "^3.1.6", "express": "^4.18.2", - "form-data": "^4.0.0", + "formdata-node": "^6.0.3", "fs-extra": "^11.2.0", "get-port": "^7.0.0", "ip6addr": "^0.2.5", @@ -60,7 +60,7 @@ "webpack-cli": "^5.1.4" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3287,11 +3287,6 @@ "node": ">=12" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, "node_modules/available-typed-arrays": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", @@ -3944,17 +3939,6 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -4563,14 +4547,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -5432,17 +5408,12 @@ "is-callable": "^1.1.3" } }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, + "node_modules/formdata-node": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-6.0.3.tgz", + "integrity": "sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg==", "engines": { - "node": ">= 6" + "node": ">= 18" } }, "node_modules/forwarded": { diff --git a/package.json b/package.json index 9a48e0e..bcb23f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spreadable", - "version": "0.3.7", + "version": "0.3.8", "description": "Decentralized network mechanism", "bin": { "spreadable": "./bin/index.js" @@ -68,7 +68,7 @@ "cors": "^2.8.5", "cron": "^3.1.6", "express": "^4.18.2", - "form-data": "^4.0.0", + "formdata-node": "^6.0.3", "fs-extra": "^11.2.0", "get-port": "^7.0.0", "ip6addr": "^0.2.5", @@ -81,7 +81,7 @@ "signal-exit": "^4.1.0", "tcp-port-used": "^1.0.2", "text-to-svg": "^3.1.5", - "validate-ip-node": "^1.0.8", + "validate-ip-node": "^1.0.8", "yargs": "^17.7.2" }, "repository": { diff --git a/src/client.js b/src/client.js index a48c5da..4c28ad5 100644 --- a/src/client.js +++ b/src/client.js @@ -1,6 +1,6 @@ import merge from "lodash-es/merge.js"; import shuffle from "lodash-es/shuffle.js"; -import FormData from "form-data"; +import { FormData } from "formdata-node"; import https from "https"; import fetch from "node-fetch"; import qs from "querystring"; @@ -67,7 +67,7 @@ export default (Parent) => { if (typeof location != 'object' || !location.protocol) { return ''; } - + return location.protocol.split(':')[0]; } diff --git a/src/node.js b/src/node.js index 40cc59c..bedbdff 100644 --- a/src/node.js +++ b/src/node.js @@ -1,8 +1,8 @@ -import FormData from "form-data"; import fse from "fs-extra"; import http from "http"; import https from "https"; import { capitalize, isPlainObject, merge, orderBy, pick, shuffle, uniqBy } from "lodash-es"; +import { FormData } from "formdata-node"; import ms from "ms"; import fetch from "node-fetch"; import path from "path"; @@ -1199,7 +1199,7 @@ export default (Parent) => { form.append(key, val); } } - + options.body = form; delete options.formData; } diff --git a/test/tools.js b/test/tools.js index 82229a8..e5e345e 100644 --- a/test/tools.js +++ b/test/tools.js @@ -2,7 +2,7 @@ import path from "path"; import merge from "lodash-es/merge.js"; import shuffle from "lodash-es/shuffle.js"; import getPort from "get-port"; -import FormData from "form-data"; +import { FormData } from "formdata-node"; import fse from "fs-extra"; const tools = {}; tools.tmpPath = path.join(process.cwd(), 'test/tmp'); @@ -164,7 +164,7 @@ tools.wait = async function (timeout) { */ tools.nodesSync = async function (nodes, count = 1) { nodes = shuffle(nodes); - + for (let i = 0; i < count; i++) { for (let k = 0; k < nodes.length; k++) { try {