@upcoming/bee-js 9.4.1 → 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bee.js +94 -22
- package/dist/cjs/manifest/manifest.js +3 -3
- package/dist/cjs/modules/debug/stake.js +37 -3
- package/dist/cjs/modules/debug/states.js +24 -1
- package/dist/cjs/modules/debug/status.js +3 -2
- package/dist/cjs/modules/status.js +15 -1
- package/dist/cjs/types/index.js +277 -1
- package/dist/cjs/utils/bytes.js +19 -1
- package/dist/cjs/utils/http.js +2 -2
- package/dist/cjs/utils/stamps.js +36 -13
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +95 -23
- package/dist/mjs/manifest/manifest.js +3 -3
- package/dist/mjs/modules/debug/stake.js +45 -2
- package/dist/mjs/modules/debug/states.js +35 -0
- package/dist/mjs/modules/debug/status.js +5 -2
- package/dist/mjs/modules/status.js +12 -0
- package/dist/mjs/types/index.js +1267 -1
- package/dist/mjs/utils/bytes.js +17 -0
- package/dist/mjs/utils/http.js +2 -2
- package/dist/mjs/utils/stamps.js +35 -14
- package/dist/types/bee.d.ts +69 -18
- package/dist/types/manifest/manifest.d.ts +1 -1
- package/dist/types/modules/debug/stake.d.ts +9 -2
- package/dist/types/modules/debug/states.d.ts +4 -0
- package/dist/types/modules/debug/status.d.ts +2 -2
- package/dist/types/modules/status.d.ts +1 -0
- package/dist/types/types/debug.d.ts +1 -0
- package/dist/types/types/index.d.ts +66 -0
- package/dist/types/utils/bytes.d.ts +1 -0
- package/dist/types/utils/stamps.d.ts +4 -4
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BeeJs=t():e.BeeJs=t()}(this,(()=>(()=>{var e={8266:(e,t,n)=>{e.exports=n(9092)},2585:(e,t,n)=>{"use strict";var r=n(9279),s=n(3769),a=n(8595),o=n(9275),i=n(7090),c=n(177),u=n(5077),l=n(59),f=n(2778),h=n(6198),d=n(7671),p=n(3976);e.exports=function(e){return new Promise((function(t,n){var m,g=e.data,y=e.headers,b=e.responseType,w=e.withXSRFToken;function E(){e.cancelToken&&e.cancelToken.unsubscribe(m),e.signal&&e.signal.removeEventListener("abort",m)}r.isFormData(g)&&r.isStandardBrowserEnv()&&delete y["Content-Type"];var O=new XMLHttpRequest;if(e.auth){var x=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(x+":"+v)}var S=i(e.baseURL,e.url,e.allowAbsoluteUrls);function A(){if(O){var r="getAllResponseHeaders"in O?c(O.getAllResponseHeaders()):null,a={data:b&&"text"!==b&&"json"!==b?O.response:O.responseText,status:O.status,statusText:O.statusText,headers:r,config:e,request:O};s((function(e){t(e),E()}),(function(e){n(e),E()}),a),O=null}}if(O.open(e.method.toUpperCase(),o(S,e.params,e.paramsSerializer),!0),O.timeout=e.timeout,"onloadend"in O?O.onloadend=A:O.onreadystatechange=function(){O&&4===O.readyState&&(0!==O.status||O.responseURL&&0===O.responseURL.indexOf("file:"))&&setTimeout(A)},O.onabort=function(){O&&(n(new f("Request aborted",f.ECONNABORTED,e,O)),O=null)},O.onerror=function(){n(new f("Network Error",f.ERR_NETWORK,e,O)),O=null},O.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new f(t,r.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,e,O)),O=null},r.isStandardBrowserEnv()&&(w&&r.isFunction(w)&&(w=w(e)),w||!1!==w&&u(S))){var T=e.xsrfHeaderName&&e.xsrfCookieName&&a.read(e.xsrfCookieName);T&&(y[e.xsrfHeaderName]=T)}"setRequestHeader"in O&&r.forEach(y,(function(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete y[t]:O.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(O.withCredentials=!!e.withCredentials),b&&"json"!==b&&(O.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&O.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&O.upload&&O.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(m=function(t){O&&(n(!t||t.type?new h(null,e,O):t),O.abort(),O=null)},e.cancelToken&&e.cancelToken.subscribe(m),e.signal&&(e.signal.aborted?m():e.signal.addEventListener("abort",m))),g||!1===g||0===g||""===g||(g=null);var R=d(S);R&&-1===p.protocols.indexOf(R)?n(new f("Unsupported protocol "+R+":",f.ERR_BAD_REQUEST,e)):O.send(g)}))}},9092:(e,t,n)=>{"use strict";var r=n(9279),s=n(8337),a=n(8062),o=n(2018),i=n(8785),c=n(6619);var u=function e(t){var n=new a(t),i=s(a.prototype.request,n);return r.extend(i,a.prototype,n),r.extend(i,n),i.create=function(n){return e(o(t,n))},i}(i);u.Axios=a,u.CanceledError=n(6198),u.CancelToken=n(8294),u.isCancel=n(6747),u.VERSION=n(6532).version,u.toFormData=n(5765),u.AxiosError=n(2778),u.Cancel=u.CanceledError,u.all=function(e){return Promise.all(e)},u.spread=n(2225),u.isAxiosError=n(2446),u.formToJSON=function(e){return c(r.isHTMLForm(e)?new FormData(e):e)},e.exports=u,e.exports.default=u},8294:(e,t,n)=>{"use strict";var r=n(6198);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){for(var t=n._listeners.length;t-- >0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,s,a){n.reason||(n.reason=new r(e,s,a),t(n.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},s.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},s.source=function(){var e;return{token:new s((function(t){e=t})),cancel:e}},e.exports=s},6198:(e,t,n)=>{"use strict";var r=n(2778);function s(e,t,n){r.call(this,null==e?"canceled":e,r.ERR_CANCELED,t,n),this.name="CanceledError"}n(9279).inherits(s,r,{__CANCEL__:!0}),e.exports=s},6747:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},8062:(e,t,n)=>{"use strict";var r=n(9279),s=n(9275),a=n(5132),o=n(6839),i=n(2018),c=n(7090),u=n(2370),l=u.validators;function f(e){this.defaults=e,this.interceptors={request:new a,response:new a}}f.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=i(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&u.assertOptions(n,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var s=t.paramsSerializer;null!=s&&(r.isFunction(s)?t.paramsSerializer={serialize:s}:u.assertOptions(s,{encode:l.function,serialize:l.function},!0));var a=[],c=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(c=c&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));var f,h=[];if(this.interceptors.response.forEach((function(e){h.push(e.fulfilled,e.rejected)})),!c){var d=[o,void 0];for(Array.prototype.unshift.apply(d,a),d=d.concat(h),f=Promise.resolve(t);d.length;)f=f.then(d.shift(),d.shift());return f}for(var p=t;a.length;){var m=a.shift(),g=a.shift();try{p=m(p)}catch(y){g(y);break}}try{f=o(p)}catch(y){return Promise.reject(y)}for(;h.length;)f=f.then(h.shift(),h.shift());return f},f.prototype.getUri=function(e){e=i(this.defaults,e);var t=c(e.baseURL,e.url,e.allowAbsoluteUrls);return s(t,e.params,e.paramsSerializer)},r.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,n){return this.request(i(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,s){return this.request(i(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}f.prototype[e]=t(),f.prototype[e+"Form"]=t(!0)})),e.exports=f},2778:(e,t,n)=>{"use strict";var r=n(9279);function s(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}r.inherits(s,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var a=s.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){o[e]={value:e}})),Object.defineProperties(s,o),Object.defineProperty(a,"isAxiosError",{value:!0}),s.from=function(e,t,n,o,i,c){var u=Object.create(a);return r.toFlatObject(e,u,(function(e){return e!==Error.prototype})),s.call(u,e.message,t,n,o,i),u.cause=e,u.name=e.name,c&&Object.assign(u,c),u},e.exports=s},5132:(e,t,n)=>{"use strict";var r=n(9279);function s(){this.handlers=[]}s.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.clear=function(){this.handlers&&(this.handlers=[])},s.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},7090:(e,t,n)=>{"use strict";var r=n(4238),s=n(2015);e.exports=function(e,t,n){var a=!r(t);return e&&(a||!1===n)?s(e,t):t}},6839:(e,t,n)=>{"use strict";var r=n(9279),s=n(5636),a=n(6747),o=n(8785),i=n(6198),c=n(3661);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new i}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=s.call(e,e.data,e.headers,null,e.transformRequest),c(e.headers,"Accept"),c(e.headers,"Content-Type"),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return u(e),t.data=s.call(e,t.data,t.headers,t.status,e.transformResponse),t}),(function(t){return a(t)||(u(e),t&&t.response&&(t.response.data=s.call(e,t.response.data,t.response.headers,t.response.status,e.transformResponse))),Promise.reject(t)}))}},2018:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e,t){t=t||{};var n={};function s(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isEmptyObject(t)?r.merge({},e):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:s(void 0,e[n]):s(e[n],t[n])}function o(e){if(!r.isUndefined(t[e]))return s(void 0,t[e])}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:s(void 0,e[n]):s(void 0,t[n])}function c(n){return n in t?s(e[n],t[n]):n in e?s(void 0,e[n]):void 0}var u={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||a;console.log(e,t);var s=t(e);r.isUndefined(s)&&t!==c||(n[e]=s)})),n}},3769:(e,t,n)=>{"use strict";var r=n(2778);e.exports=function(e,t,n){var s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(new r("Request failed with status code "+n.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}},5636:(e,t,n)=>{"use strict";var r=n(9279),s=n(8785);e.exports=function(e,t,n,a){var o=this||s;return r.forEach(a,(function(r){e=r.call(o,e,t,n)})),e}},8785:(e,t,n)=>{"use strict";var r=n(9279),s=n(3661),a=n(2778),o=n(59),i=n(5765),c=n(176),u=n(3976),l=n(6619),f={"Content-Type":"application/x-www-form-urlencoded"};function h(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var d,p={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(d=n(2585)),d),transformRequest:[function(e,t){s(t,"Accept"),s(t,"Content-Type");var n,a=t&&t["Content-Type"]||"",o=a.indexOf("application/json")>-1,u=r.isObject(e);if(u&&r.isHTMLForm(e)&&(e=new FormData(e)),r.isFormData(e))return o?JSON.stringify(l(e)):e;if(r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return h(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(u){if(-1!==a.indexOf("application/x-www-form-urlencoded"))return c(e,this.formSerializer).toString();if((n=r.isFileList(e))||a.indexOf("multipart/form-data")>-1){var f=this.env&&this.env.FormData;return i(n?{"files[]":e}:e,f&&new f,this.formSerializer)}}return u||o?(h(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(s){if("SyntaxError"!==s.name)throw s}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||p.transitional,n=t&&t.forcedJSONParsing,s="json"===this.responseType;if(e&&r.isString(e)&&(n&&!this.responseType||s)){var o=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(i){if(o){if("SyntaxError"===i.name)throw a.from(i,a.ERR_BAD_RESPONSE,this,null,this.response);throw i}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u.classes.FormData,Blob:u.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){p.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){p.headers[e]=r.merge(f)})),e.exports=p},59:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},6183:(e,t,n)=>{e.exports=n(2909)},6532:e=>{e.exports={version:"0.30.0"}},8047:(e,t,n)=>{"use strict";var r=n(5765);function s(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function a(e,t){this._pairs=[],e&&r(e,this,t)}var o=a.prototype;o.append=function(e,t){this._pairs.push([e,t])},o.toString=function(e){var t=e?function(t){return e.call(this,t,s)}:s;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")},e.exports=a},8337:e=>{"use strict";e.exports=function(e,t){return function(){return e.apply(t,arguments)}}},9275:(e,t,n)=>{"use strict";var r=n(9279),s=n(8047);function a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o));var i,c=n&&n.encode||a,u=n&&n.serialize;return(i=u?u(t,n):r.isURLSearchParams(t)?t.toString():new s(t,n).toString(c))&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},2015:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}},8595:(e,t,n)=>{"use strict";var r=n(9279);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,s,a,o){var i=[];i.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),r.isString(s)&&i.push("path="+s),r.isString(a)&&i.push("domain="+a),!0===o&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},6619:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e){function t(e,n,s,a){var o=e[a++];if("__proto__"===o)return!0;var i=Number.isFinite(+o),c=a>=e.length;return o=!o&&r.isArray(s)?s.length:o,c?(r.hasOwnProperty(s,o)?s[o]=[s[o],n]:s[o]=n,!i):(s[o]&&r.isObject(s[o])||(s[o]=[]),t(e,n,s[o],a)&&r.isArray(s[o])&&(s[o]=function(e){var t,n,r={},s=Object.keys(e),a=s.length;for(t=0;t<a;t++)r[n=s[t]]=e[n];return r}(s[o])),!i)}if(r.isFormData(e)&&r.isFunction(e.entries)){var n={};return r.forEachEntry(e,(function(e,s){t(function(e){return r.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e),s,n,0)})),n}return null}},4238:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},2446:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},5077:(e,t,n)=>{"use strict";var r=n(9279);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function s(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=s(window.location.href),function(t){var n=r.isString(t)?s(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},3661:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},177:(e,t,n)=>{"use strict";var r=n(9279),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,a,o={};return e?(r.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=r.trim(e.slice(0,a)).toLowerCase(),n=r.trim(e.slice(a+1)),t){if(o[t]&&s.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},7671:e=>{"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},2225:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},5765:(e,t,n)=>{"use strict";var r=n(9279),s=n(2778),a=n(6183);function o(e){return r.isPlainObject(e)||r.isArray(e)}function i(e){return r.endsWith(e,"[]")?e.slice(0,-2):e}function c(e,t,n){return e?e.concat(t).map((function(e,t){return e=i(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var u=r.toFlatObject(r,{},null,(function(e){return/^is[A-Z]/.test(e)}));e.exports=function(e,t,n){if(!r.isObject(e))throw new TypeError("target must be an object");t=t||new(a||FormData);var l,f=(n=r.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.isUndefined(t[e])}))).metaTokens,h=n.visitor||y,d=n.dots,p=n.indexes,m=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((l=t)&&r.isFunction(l.append)&&"FormData"===l[Symbol.toStringTag]&&l[Symbol.iterator]);if(!r.isFunction(h))throw new TypeError("visitor must be a function");function g(e){if(null===e)return"";if(r.isDate(e))return e.toISOString();if(!m&&r.isBlob(e))throw new s("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(e)||r.isTypedArray(e)?m&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function y(e,n,s){var a=e;if(e&&!s&&"object"==typeof e)if(r.endsWith(n,"{}"))n=f?n:n.slice(0,-2),e=JSON.stringify(e);else if(r.isArray(e)&&function(e){return r.isArray(e)&&!e.some(o)}(e)||r.isFileList(e)||r.endsWith(n,"[]")&&(a=r.toArray(e)))return n=i(n),a.forEach((function(e,s){!r.isUndefined(e)&&null!==e&&t.append(!0===p?c([n],s,d):null===p?n:n+"[]",g(e))})),!1;return!!o(e)||(t.append(c(s,n,d),g(e)),!1)}var b=[],w=Object.assign(u,{defaultVisitor:y,convertValue:g,isVisitable:o});if(!r.isObject(e))throw new TypeError("data must be an object");return function e(n,s){if(!r.isUndefined(n)){if(-1!==b.indexOf(n))throw Error("Circular reference detected in "+s.join("."));b.push(n),r.forEach(n,(function(n,a){!0===(!(r.isUndefined(n)||null===n)&&h.call(t,n,r.isString(a)?a.trim():a,s,w))&&e(n,s?s.concat(a):[a])})),b.pop()}}(e),t}},176:(e,t,n)=>{"use strict";var r=n(9279),s=n(5765),a=n(3976);e.exports=function(e,t){return s(e,new a.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,s){return a.isNode&&r.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}},2370:(e,t,n)=>{"use strict";var r=n(6532).version,s=n(2778),a={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){a[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={};a.transitional=function(e,t,n){function a(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,i){if(!1===e)throw new s(a(r," has been removed"+(t?" in "+t:"")),s.ERR_DEPRECATED);return t&&!o[r]&&(o[r]=!0,console.warn(a(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new s("options must be an object",s.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),a=r.length;a-- >0;){var o=r[a],i=t[o];if(i){var c=e[o],u=void 0===c||i(c,o,e);if(!0!==u)throw new s("option "+o+" must be "+u,s.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new s("Unknown option "+o,s.ERR_BAD_OPTION)}},validators:a}},4984:e=>{"use strict";e.exports=FormData},8455:(e,t,n)=>{"use strict";var r=n(8047);e.exports="undefined"!=typeof URLSearchParams?URLSearchParams:r},7115:(e,t,n)=>{"use strict";e.exports={isBrowser:!0,classes:{URLSearchParams:n(8455),FormData:n(4984),Blob:Blob},protocols:["http","https","file","blob","url","data"]}},3976:(e,t,n)=>{"use strict";e.exports=n(7115)},9279:(e,t,n)=>{"use strict";var r,s=n(8337),a=Object.prototype.toString,o=(r=Object.create(null),function(e){var t=a.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function i(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function c(e){return Array.isArray(e)}function u(e){return void 0===e}var l=i("ArrayBuffer");function f(e){return"number"==typeof e}function h(e){return null!==e&&"object"==typeof e}function d(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var p=i("Date"),m=i("File"),g=i("Blob"),y=i("FileList");function b(e){return"[object Function]"===a.call(e)}var w=i("URLSearchParams");function E(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}var O,x=(O="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return O&&e instanceof O});var v,S=i("HTMLFormElement"),A=(v=Object.prototype.hasOwnProperty,function(e,t){return v.call(e,t)});e.exports={isArray:c,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||a.call(e)===t||b(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:f,isObject:h,isPlainObject:d,isEmptyObject:function(e){return e&&0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype},isUndefined:u,isDate:p,isFile:m,isBlob:g,isFunction:b,isStream:function(e){return h(e)&&b(e.pipe)},isURLSearchParams:w,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:E,merge:function e(){var t={};function n(n,r){d(t[r])&&d(n)?t[r]=e(t[r],n):d(n)?t[r]=e({},n):c(n)?t[r]=n.slice():t[r]=n}for(var r=0,s=arguments.length;r<s;r++)E(arguments[r],n);return t},extend:function(e,t,n){return E(t,(function(t,r){e[r]=n&&"function"==typeof t?s(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var s,a,o,i={};if(t=t||{},null==e)return t;do{for(a=(s=Object.getOwnPropertyNames(e)).length;a-- >0;)o=s[a],r&&!r(o,e,t)||i[o]||(t[o]=e[o],i[o]=!0);e=!1!==n&&Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:i,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(c(e))return e;var t=e.length;if(!f(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:x,isFileList:y,forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var s=n.value;t.call(e,s[0],s[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:S,hasOwnProperty:A}},7020:(e,t)=>{"use strict";var n;async function r(e){return new Promise(((t,n)=>e.then(n,t)))}async function s(e){return new Promise((t=>setTimeout((()=>{t(!0)}),e)))}function a(e,t=Math.random){for(let n=e.length-1;n>0;n--){const r=Math.floor(t()*(n+1)),s=e[n];e[n]=e[r],e[r]=s}return e}function o(e,t,n=Math.random){return a(G(0,e.length-1),n).slice(0,t)}function i(e,t,n=Math.random){return Math.floor(n()*(t-e+1))+e}function c(e,t,n){return t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height}function u(e,t=Math.random){return t()<e}function l(e,t=Math.random){return e[Math.floor(e.length*t())]}function f(e){if(!e.length)throw Error("Received empty array");return e[e.length-1]}function h(e,t,n){return n(t.reduce(((e,t)=>t(e)),e))}function d(e,t){if(null==e)return null;const n=t.split(".");let r=e;for(const s of n){if(null===r[s]||void 0===r[s])return null;r=r[s]}return r}function p(e,t,n){const r=t.split(/\.|\[/);let s=e;for(let a=0;a<r.length;a++){const e=r[a],t=a<r.length-1&&r[a+1].includes("]"),o=e.includes("]")?e.replace(/\[|\]/g,""):e;if(a===r.length-1)return s[o]=n,n;g(s[o])||(s[o]=t?[]:{}),s=s[o]}return n}function m(e,t){return Math.round(e/t)*t}function g(e,t=!0){return!(!e||t&&!w(e._readableState)||t&&e.constructor&&(e.constructor.isBuffer||"Uint8Array"==e.constructor.name||"ArrayBuffer"===e.constructor.name||"ReadableStream"===e.constructor.name))&&"object"==typeof e}function y(e){return g(e)&&!Array.isArray(e)}function b(e){return Array.isArray(e)&&0===e.length}function w(e){return void 0===e}function E(e){return"[object Function]"===Object.prototype.toString.call(e)||"[object AsyncFunction]"===Object.prototype.toString.call(e)}function O(e){return"[object String]"===Object.prototype.toString.call(e)}function x(e){return"number"==typeof e&&isFinite(e)}function v(e){return!0===e||!1===e}function S(e){return"[object Date]"===Object.prototype.toString.call(e)}function A(e){return!O(e)||0===e.trim().length}function T(e){return x(e)&&Number.isInteger(e)&&e>=1}function R(e){return O(e)&&null!==e.match(/^-?\d+$/)}function N(e){return O(e)&&null!==e.match(/^(0x)?[0-9a-f]+$/i)}t.Mi=t.l2=t.mW=t.DH=t.Or=t.Rb=t.AO=t.HC=t.FQ=t.iQ=t.DO=t.o8=t.LQ=t.yI=t.g$=t.O3=t.Dj=t.ie=t.vU=t.AA=t.$i=t.pp=t.f7=t.dF=t.Xx=void 0;const I="!@#$%^&*()_+-=[]{}|;:<>?,./".split(""),$="abcdefghijklmnopqrstuvwxyz",B=$+"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",k=B+"!@#$%^&*()_+-=[]{}|;:<>?,./",L=["—","\\","東","京","都","𝖆","𝖇","𝖈","👾","🙇","💁","🙅","ᚠ","ᛇ","ᚻ","ᛦ"],U="0123456789abcdef";function F(e,t){if(A(e))throw new TypeError(`Expected string${t?.name?` for ${t.name}`:""}, got: `+e);if(t&&(void 0!==t.min&&e.length<t.min||void 0!==t.max&&e.length>t.max))throw RangeError(`Expected string${t?.name?` for ${t.name}`:""} length in range: ${t.min??"-inf"}..${t.max??"inf"}; got: ${e.length}`);return e}function j(e,t){if(void 0!==t.min&&e<t.min||void 0!==t.max&&e>t.max)throw RangeError(`Expected value${t?.name?` for ${t.name}`:""} in range: ${t.min??"-inf"}..${t.max??"inf"}; got: ${e}`)}function D(e,t){if(x(e))return t&&j(e,t),e;if(!O(e)||!e.match(/^-?\d+(\.\d+)?$/))throw new TypeError(`Expected number${t?.name?` for ${t.name}`:""}, got: `+e);const n=parseFloat(e);return t&&j(n,t),n}function P(e,t){return 0|D(e,t)}function C(e,t){if(!y(e))throw new TypeError(`Expected object${t?.name?` for ${t.name}`:""}, got: `+e);return e}function _(e){return O(e)&&null!==e.match(/^https?:\/\/.+/)}function M(e,t){for(const[n,r]of Object.entries(t))if(!r(e[n]))throw TypeError(`${n} in value does not exist or match shape`);for(const n of Object.keys(e))if(!t[n])throw TypeError(`${n} exists in value but not in shape`);return!0}function q(e,t){if(y(e)&&y(t))for(const n in t)y(t[n])?(e[n]||(e[n]={}),q(e[n],t[n])):Array.isArray(t[n])?e[n]=[...t[n]]:(null!==t[n]&&void 0!==t[n]||null===e[n]||void 0===e[n])&&(e[n]=t[n]);return e}function H(e,t){const n={};for(const r of e)for(const e of Object.keys(r))n[e]?n[e]=t(n[e],r[e]):n[e]=r[e];return n}function z(e,t){Array.prototype.push.apply(e,t)}function G(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function W(e,t=()=>!1){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").split("").map((e=>/[a-z0-9]/.test(e)||t(e)?e:"-")).join("").replace(/-+/g,"-").replace(/^-|-$/g,"")}function K(e,t){if(0===t.length)return 0;const n=e.toLowerCase(),r=t.toLowerCase();return e===t?1e4:n.startsWith(r)?1e4-e.length:n.includes(r)?5e3-e.length:new RegExp(".*"+r.split("").join(".*")+".*").test(n)?1e3-e.length:0}const V={"&":"&",""":'"',"'":"'",">":">","<":"<"};function X(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(0,n)}function J(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(n+t.length)}function Z(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(0,n)}function Q(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(n+t.length)}function Y(e,t,n=!1){const r=n?e.lastIndexOf(t):e.indexOf(t);return-1===r?n?[null,e]:[e,null]:[e.slice(0,r),e.slice(r+t.length)]}function ee(e,t){let n=[e];for(const r of t)n=n.flatMap((e=>e.split(r)));return n.filter((e=>e))}function te(e){const t=f(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?"":t.slice(n+1)}function ne(e){const t=f(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?t:t.slice(0,n)}function re(e){return e.split("\n").map((e=>e.trim().replace(/\s+/g," "))).filter((e=>e.length>0)).join("\n")}function se(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ae(e){return e.charAt(0).toLowerCase()+e.slice(1)}function oe(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122}function ie(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function ce(e){return oe(e)||ie(e)}const ue=" \n\t\r.,?!:;\"'`(){}[]~@#$%^&*-+=|<>/\\".split("");function le(e){return ue.includes(e)}function fe(e,t,n=0){const r=t.exec(e.slice(n));return r?{index:r.index,match:r[0]}:null}function he(e,t,n=!0){if(!n)return t.every((t=>t instanceof RegExp?t.test(e):-1!==e.indexOf(t,0)));let r=0;for(const s of t)if(s instanceof RegExp){const t=fe(e,s,r);if(!t)return!1;r=t.index+t.match.length}else{const t=e.indexOf(s,r);if(-1===t)return!1;r=t+s.length}return!0}function de(e,t,n=0){const r=[];let s=e.indexOf(t,n);for(;-1!==s;)r.push(s),s=e.indexOf(t,s+t.length);return r}function pe(e,t,n=0){let r=-1;for(const s of t){const t=e.indexOf(s,n);-1!==t&&(-1===r||t<r)&&(r=t)}return r}function me(e,t=0){for(let n=t;n<e.length;n++)if(le(e[n]))return n;return-1}function ge(e,t=0){for(let n=t;n<e.length;n++)if("#"===e[n]&&ce(e[n+1]))return n;return-1}function ye(e,t,n=0){return e.slice(0,n).lastIndexOf(t)}function be(e,t=0,n="{",r="}"){let s=1;for(let a=t;a<e.length;a++)if(e.slice(a,a+r.length)===r){if(0==--s)return a}else e.slice(a,a+n.length)===n&&s++;return-1}function we(e,t){const n=t.wordBoundary?pe(e,[`${t.opening} `,`${t.opening}\n`],t.start||0):e.indexOf(t.opening,t.start||0);if(-1===n)return null;const r=be(e,n+t.opening.length,t.opening,t.closing);return-1===r?null:t.exclusive?e.slice(n+t.opening.length,r):e.slice(n,r+t.closing.length)}const Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function xe(e,t){const n=t.length;let r=0,s=0;const a=[];for(let o=0;o<e.length;o++){const i=e[o];if("="===i)break;const c=t.indexOf(i);if(-1===c)throw new Error(`Invalid character: ${i}`);s=s<<Math.log2(n)|c,r+=Math.log2(n),r>=8&&(r-=8,a.push(s>>r&255))}return new Uint8Array(a)}function ve(e,t){const n=t.length;let r=0,s=0,a="";for(let o=0;o<e.length;o++)for(s=s<<8|e[o],r+=8;r>=Math.log2(n);)r-=Math.log2(n),a+=t[s>>r&n-1];return r>0&&(a+=t[s<<Math.log2(n)-r&n-1]),a.length%4!=0&&(a+="=".repeat(4-a.length%4)),a}function Se(e,t,n){const r=[];for(const s of n)s!==t&&r.push(e.replace(t,s));return r}function Ae(e){const t=e.lastIndexOf(" ");if(-1===t)return{line:e,rest:""};return{line:e.slice(0,t),rest:e.slice(t+1)}}function Te(e){const t=e.reduce(((e,t)=>e.length<t.length?e:t));let n="";for(let r=0;r<t.length;r++){const s=t[r];if(!e.every((e=>e[r]===s)))break;n+=s}return n}function Re(e,t){return new RegExp(`\\b${t}\\b`).test(e)}function Ne(e,t,n=[]){let r="";for(;t<e.length&&(ce(e[t])||n.includes(e[t]));)r+=e[t++];return r}function Ie(e,t,n,r="$",s=":"){if(""===n)return e;let a=e.indexOf(`${r}${t}`);for(;-1!==a;){if(e[a+t.length+1]===s)if(e[a+t.length+2]===s)e=e.replace(`${r}${t}${s}${s}`,n);else{const o=Ne(e,a+t.length+2,["_"]);e=e.replace(`${r}${t}${s}${o}`,n)}else e=e.replace(`${r}${t}`,n);a=e.indexOf(`${r}${t}`,a+n.length)}return e}function $e(e,t="$",n=":"){let r=e.indexOf(t);for(;-1!==r;){const s=Ne(e,r+1);if(e[r+s.length+1]===n)if(e[r+s.length+2]===n)e=e.replace(`${t}${s}${n}${n}`,"");else{const a=Ne(e,r+s.length+2);e=e.replace(`${t}${s}${n}${a}`,a)}r=e.indexOf(t,r+1)}return e}function Be(e,t=!0){const n=Object.entries(e).filter((([e,t])=>null!=t)).map((([e,t])=>`${e}=${encodeURIComponent(t)}`)).join("&");return n?(t?"?":"")+n:""}function ke(e){return String(Math.floor(e)).padStart(2,"0")}function Le(e){const t=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const r=Math.floor(e/1e3);return t?`${ke(t)}:${ke(n)}:${ke(r)}`:`${ke(n)}:${ke(r)}`}function Ue(e){return Math.floor((S(e)?e.getTime():e)/864e5)}const Fe={today:(e,t)=>ke(e)+":"+ke(t),yesterday:()=>"Yesterday",monday:()=>"Mon",tuesday:()=>"Tue",wednesday:()=>"Wed",thursday:()=>"Thu",friday:()=>"Fri",saturday:()=>"Sat",sunday:()=>"Sun",weeks:e=>`${e}w`};const je={now:()=>"A few seconds",seconds:e=>`${e} seconds`,minutes:e=>`${e} minutes`,hours:e=>`${e} hours`,days:e=>`${e} days`,weeks:e=>`${e} weeks`};function De(e,n){const r=n?.now??Date.now(),s=n?.labels||je;let a=(r-(t.Or.isDate(e)?e.getTime():e))/1e3;return a<10?s.now():a<120?s.seconds(Math.floor(a)):(a/=60,a<120?s.minutes(Math.floor(a)):(a/=60,a<48?s.hours(Math.floor(a)):(a/=24,a<14?s.days(Math.floor(a)):(a/=7,s.weeks(Math.floor(a))))))}const Pe={};const Ce={s:1e3,m:6e4,h:36e5,d:864e5};const _e={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function Me(e){return{zeroBasedIndex:e,day:_e[e]}}function qe(e){return Me(e.getDay())}const He={ms:1,milli:1,millis:1,millisecond:1,milliseconds:1,s:1e3,sec:1e3,second:1e3,seconds:1e3,m:6e4,min:6e4,minute:6e4,minutes:6e4,h:36e5,hour:36e5,hours:36e5,d:864e5,day:864e5,days:864e5,w:6048e5,week:6048e5,weeks:6048e5,month:2592e6,months:2592e6,y:31536e6,year:31536e6,years:31536e6};const ze={b:1,byte:1,bytes:1,kb:1024,kilobyte:1024,kilobytes:1024,mb:1048576,megabyte:1048576,megabytes:1048576,gb:1024**3,gigabyte:1024**3,gigabytes:1024**3,tb:1024**4,terabyte:1024**4,terabytes:1024**4};const Ge={};function We(...e){return e.filter((e=>e)).join("/").replace(/(?<!:)\/+/g,"/")}function Ke(e){const t=Object.keys(e).sort(((e,t)=>e.localeCompare(t))),n={};for(const r of t)n[r]=Xe(e[r]);return n}function Ve(e){const t=[];return e.sort(((e,t)=>JSON.stringify(Xe(e)).localeCompare(JSON.stringify(Xe(t))))).forEach((e=>t.push(Xe(e)))),t}function Xe(e){return Array.isArray(e)?Ve(e):g(e)?Ke(e):e}function Je(e,t){return JSON.stringify(Xe(e))===JSON.stringify(Xe(t))}function Ze(e){const t=Object.keys(e);return t[Math.floor(Math.random()*t.length)]}const Qe=[1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24,1e27,1e30,1e9,1e16,1e18,1e18,1e18,1e33],Ye=["thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","gwei","bzz","btc","eth","dai","decillion"],et=["K","M","B","T","Qa","Qi","Sx","Sp","O","N","gwei","bzz","eth","btc","dai","D"];function tt(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeNumber got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim(),r=et.findIndex((e=>e.toLowerCase()===n.toLowerCase()));return-1===r?t:t*Qe[r]}function nt(e,t,n){return e<t?t:e>n?n:e}function rt(e,t,n){return e+(n?"["+t+"]":(e.length?".":"")+t)}function st(e,t,n,r,s){if(!g(t))return t;for(const[a,o]of Object.entries(t)){const t=rt(n,a,r);Array.isArray(o)?s?st(e,o,t,!0,s):e[t]=o.map((e=>st(Array.isArray(e)?[]:{},e,"",!1,s))):g(o)?st(e,o,t,!1,s):e[t]=o}return e}function at(e,t){const n={};for(const r of e){n[t(r)]=r}return n}function ot(e,t){const n=Math.ceil(e.length/t),r=[];for(let s=0;s<e.length;s+=n)r.push(e.slice(s,s+n));return r}function it(e,t){const n=[],r=Math.ceil(e.length/t);for(let s=0;s<r;s++)n.push(e.slice(s*t,s*t+t));return n}function ct(e,t){return Object.fromEntries(Object.entries(e).sort(t))}function ut(e,t){const n=[];let r=[];return e.forEach(((s,a)=>{(0===a||!t(s,e[a-1]))&&(r=[],n.push(r)),r.push(s)})),n}function lt(e,t,n,r=100){if(e.map.has(t)){const n=e.keys.indexOf(t);e.keys.splice(n,1)}if(e.map.set(t,n),e.keys.push(t),e.keys.length>r){const t=e.keys.shift();t&&e.map.delete(t)}}class ft{constructor(e){this.value=e}static of(e){return new ft(e)}static empty(){return new ft(null)}map(e){return new ft(null!==this.value&&void 0!==this.value?e(this.value):null)}mapAsync(e){return null!==this.value&&void 0!==this.value?e(this.value).then((e=>ft.of(e))):Promise.resolve(ft.empty())}ifPresent(e){return null!==this.value&&void 0!==this.value&&e(this.value),this}ifPresentAsync(e){return null!==this.value&&void 0!==this.value?e(this.value).then((()=>this)):Promise.resolve(this)}ifAbsent(e){return(null===this.value||void 0===this.value)&&e(),this}ifAbsentAsync(e){return null===this.value||void 0===this.value?e().then((()=>this)):Promise.resolve(this)}getOrFallback(e){return this.value??e()}getOrFallbackAsync(e){return null!==this.value&&void 0!==this.value?Promise.resolve(this.value):e()}getOrThrow(){if(null===this.value||void 0===this.value)throw Error("Optional.value is empty");return this.value}}t.Xx=ft;t.dF=class{constructor(e){this.supplier=e,this.value=null}get(){return this.value||(this.value=this.supplier()),this.value}};t.f7=class{constructor(e){this.supplier=e,this.value=null}async get(){return this.value||(this.value=await this.supplier()),this.value}};class ht{constructor(e){this.value=e,this.children=[]}}function dt(e,t){if(Math.log2(e.length)%1!=0)throw new Error("Array length must be a power of 2");let n=[...e];for(;n.length>1;){const e=[];for(let r=0;r<n.length;r+=2){const s=n[r+1];e.push(t(n[r],s))}n=e}return n[0]}function pt(...e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;return e.forEach((e=>{n.set(e,r),r+=e.length})),n}function mt(e){return 137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]}function gt(e){return 255===e[0]&&216===e[1]}function yt(e){return 87===e[8]&&69===e[9]&&66===e[10]&&80===e[11]}function bt(e,t){const n=new ArrayBuffer(8);return new DataView(n).setBigUint64(0,BigInt(e),"LE"===t),new Uint8Array(n)}function wt(e,t){const n=new Uint8Array(32);let r=e;if("LE"===t){for(let e=0;e<32;e++)n[e]=Number(0xffn&r),r>>=8n;return n}for(let s=31;s>=0;s--)n[s]=Number(0xffn&r),r>>=8n;return n}function Et(e,t){let n=0n;if("LE"===t){for(let t=31;t>=0;t--)n=n<<8n|BigInt(e[t]);return n}for(let r=0;r<32;r++)n=n<<8n|BigInt(e[r]);return n}function Ot(e,t){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.subarray(r,r+t));return n}const xt=[0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424];function vt(e){for(let t=0;t<24;t++){const n=e[0]^e[10]^e[20]^e[30]^e[40],r=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],i=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49],h=l^(s<<1|a>>>31),d=f^(a<<1|s>>>31),p=n^(o<<1|i>>>31),m=r^(i<<1|o>>>31),g=s^(c<<1|u>>>31),y=a^(u<<1|c>>>31),b=o^(l<<1|f>>>31),w=i^(f<<1|l>>>31),E=c^(n<<1|r>>>31),O=u^(r<<1|n>>>31);e[0]^=h,e[1]^=d,e[2]^=p,e[3]^=m,e[4]^=g,e[5]^=y,e[6]^=b,e[7]^=w,e[8]^=E,e[9]^=O,e[10]^=h,e[11]^=d,e[12]^=p,e[13]^=m,e[14]^=g,e[15]^=y,e[16]^=b,e[17]^=w,e[18]^=E,e[19]^=O,e[20]^=h,e[21]^=d,e[22]^=p,e[23]^=m,e[24]^=g,e[25]^=y,e[26]^=b,e[27]^=w,e[28]^=E,e[29]^=O,e[30]^=h,e[31]^=d,e[32]^=p,e[33]^=m,e[34]^=g,e[35]^=y,e[36]^=b,e[37]^=w,e[38]^=E,e[39]^=O,e[40]^=h,e[41]^=d,e[42]^=p,e[43]^=m,e[44]^=g,e[45]^=y,e[46]^=b,e[47]^=w,e[48]^=E,e[49]^=O;const x=e[0],v=e[1],S=e[2]<<1|e[3]>>>31,A=e[3]<<1|e[2]>>>31,T=e[5]<<30|e[4]>>>2,R=e[4]<<30|e[5]>>>2,N=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,$=e[8]<<27|e[9]>>>5,B=e[9]<<27|e[8]>>>5,k=e[11]<<4|e[10]>>>28,L=e[10]<<4|e[11]>>>28,U=e[13]<<12|e[12]>>>20,F=e[12]<<12|e[13]>>>20,j=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,P=e[17]<<23|e[16]>>>9,C=e[16]<<23|e[17]>>>9,_=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,q=e[20]<<3|e[21]>>>29,H=e[21]<<3|e[20]>>>29,z=e[22]<<10|e[23]>>>22,G=e[23]<<10|e[22]>>>22,W=e[25]<<11|e[24]>>>21,K=e[24]<<11|e[25]>>>21,V=e[26]<<25|e[27]>>>7,X=e[27]<<25|e[26]>>>7,J=e[29]<<7|e[28]>>>25,Z=e[28]<<7|e[29]>>>25,Q=e[31]<<9|e[30]>>>23,Y=e[30]<<9|e[31]>>>23,ee=e[33]<<13|e[32]>>>19,te=e[32]<<13|e[33]>>>19,ne=e[34]<<15|e[35]>>>17,re=e[35]<<15|e[34]>>>17,se=e[36]<<21|e[37]>>>11,ae=e[37]<<21|e[36]>>>11,oe=e[38]<<8|e[39]>>>24,ie=e[39]<<8|e[38]>>>24,ce=e[40]<<18|e[41]>>>14,ue=e[41]<<18|e[40]>>>14,le=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,he=e[45]<<29|e[44]>>>3,de=e[44]<<29|e[45]>>>3,pe=e[47]<<24|e[46]>>>8,me=e[46]<<24|e[47]>>>8,ge=e[48]<<14|e[49]>>>18,ye=e[49]<<14|e[48]>>>18;e[0]=x^~U&W,e[1]=v^~F&K,e[2]=U^~W&se,e[3]=F^~K&ae,e[4]=W^~se&ge,e[5]=K^~ae&ye,e[6]=se^~ge&x,e[7]=ae^~ye&v,e[8]=ge^~x&U,e[9]=ye^~v&F,e[10]=N^~_&q,e[11]=I^~M&H,e[12]=_^~q&ee,e[13]=M^~H&te,e[14]=q^~ee&he,e[15]=H^~te&de,e[16]=ee^~he&N,e[17]=te^~de&I,e[18]=he^~N&_,e[19]=de^~I&M,e[20]=S^~j&V,e[21]=A^~D&X,e[22]=j^~V&oe,e[23]=D^~X&ie,e[24]=V^~oe&ce,e[25]=X^~ie&ue,e[26]=oe^~ce&S,e[27]=ie^~ue&A,e[28]=ce^~S&j,e[29]=ue^~A&D,e[30]=$^~k&z,e[31]=B^~L&G,e[32]=k^~z&ne,e[33]=L^~G&re,e[34]=z^~ne&pe,e[35]=G^~re&me,e[36]=ne^~pe&$,e[37]=re^~me&B,e[38]=pe^~$&k,e[39]=me^~B&L,e[40]=T^~P&J,e[41]=R^~C&Z,e[42]=P^~J&Q,e[43]=C^~Z&Y,e[44]=J^~Q&le,e[45]=Z^~Y&fe,e[46]=Q^~le&T,e[47]=Y^~fe&R,e[48]=le^~T&P,e[49]=fe^~R&C,e[0]^=xt[2*t],e[1]^=xt[2*t+1]}}function St(e){const t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24);return t}function At(e,t){if(!e.length){const e=new Uint8Array(136);return e[0]=t,e[135]=128,[St(e)]}const n=Ot(e,136),r=n[n.length-1];if(r.length<136){const e=new Uint8Array(136);e.set(r),e[r.length]=t,e[135]|=128,n[n.length-1]=e}if(136===r.length){const e=new Uint8Array(136);e[0]=t,e[135]=128,n.push(e)}return n.map(St)}function Tt(e,t){for(const n of t){for(let t=0;t<34;t+=2)e[t]^=n[t+1],e[t+1]^=n[t];vt(e)}return e}function Rt(e){return new Uint8Array([e[1],e[1]>>-24,e[1]>>-16,e[1]>>-8,e[0],e[0]>>8,e[0]>>16,e[0]>>24,e[3],e[3]>>-24,e[3]>>-16,e[3]>>-8,e[2],e[2]>>8,e[2]>>16,e[2]>>24,e[5],e[5]>>-24,e[5]>>-16,e[5]>>-8,e[4],e[4]>>8,e[4]>>16,e[4]>>24,e[7],e[7]>>-24,e[7]>>-16,e[7]>>-8,e[6],e[6]>>8,e[6]>>16,e[6]>>24])}function Nt(e){return Rt(Tt(new Array(50).fill(0),At(e,1)))}function It(e,t,n=0){if(e.length>=t)return e;const r=new Uint8Array(t);return r.fill(n),r.set(e,t-e.length),r}function $t(e,t,n=0){if(e.length>=t)return e;const r=new Uint8Array(t);return r.fill(n),r.set(e,0),r}function Bt(e,t){return(e%t+t)%t}function kt(e,t){e=Bt(e,t);let[n,r]=[0n,1n],[s,a]=[t,e];for(;0n!==a;){const e=s/a;[n,r]=[r,n-e*r],[s,a]=[a,s-e*a]}if(s>1n)throw new Error("a is not invertible");return n<0n&&(n+=t),n}function Lt(e,t){return 0n===Bt(e,t)?0n:t%4n===3n?function(e,t,n){let r=1n;for(e=Bt(e,n);t>0;)t%2n===1n&&(r=Bt(r*e,n)),e=Bt(e*e,n),t/=2n;return r}(e,(t+1n)/4n,t):null}const Ut=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,Ft=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,jt=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Dt=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n;function Pt(e,t,n){if(0n===t)return[0n,0n];const r=Bt(3n*e*e*kt(2n*t,n),n),s=Bt(r*r-2n*e,n);return[s,Bt(r*(e-s)-t,n)]}function Ct(e,t,n,r,s){if(0n===e&&0n===t)return[n,r];if(0n===n&&0n===r)return[e,t];if(e===n&&t===Bt(-r,s))return[0n,0n];if(e===n&&t===r)return Pt(e,t,s);const a=Bt((r-t)*kt(n-e,s),s),o=Bt(a*a-e-n,s);return[o,Bt(a*(e-o)-t,s)]}function _t(e,t,n,r){let s=[0n,0n],a=[e,t];const o=n.toString(2);for(const i of o)"0"===i?(a=Ct(s[0],s[1],a[0],a[1],r),s=Pt(s[0],s[1],r)):(s=Ct(s[0],s[1],a[0],a[1],r),a=Pt(a[0],a[1],r));return s}function Mt(e,t,n){if(t<=0n||t>=Ft)throw new Error("Invalid private key");if(n||(n=Bt(Et(Nt(pt(Nt(wt(t,"BE")),wt(e,"BE"))),"BE"),Ft)),n<=0n||n>=Ft)throw new Error("Invalid nonce");const r=Bt(e,Ft),s=_t(jt,Dt,n,Ut),a=Bt(s[0],Ft);let o=Bt((r+Bt(a,Ft)*t)*kt(n,Ft),Ft);if(0n===a||0n===o)throw new Error("Invalid r or s value");let i=s[1]%2n===0n?27n:28n;return o>Ft/2n&&(o=Ft-o,i=27n===i?28n:27n),[a,o,i]}class qt{constructor(e){this.cursor=0,this.buffer=e}read(e){const t=this.buffer.subarray(this.cursor,this.cursor+e);return this.cursor+=e,t}max(){return this.buffer.length-this.cursor}}t.pp=qt;class Ht{constructor(e){this.buffer=e,this.cursor=0}write(e){const t=Math.min(this.max(),e.max());return this.buffer.set(e.read(t),this.cursor),this.cursor+=t,t}max(){return this.buffer.length-this.cursor}}t.$i=Ht;class zt{constructor(e,t=0n){this.span=t,this.writer=new Ht(new Uint8Array(e))}build(){return pt(bt(this.span,"LE"),this.writer.buffer)}hash(){const e=dt(Ot(this.writer.buffer,32),((e,t)=>zt.hashFunction(pt(e,t))));return zt.hashFunction(pt(bt(this.span,"LE"),e))}}t.AA=zt,zt.hashFunction=Nt;class Gt{constructor(e,t=4096){this.counters=[1],this.capacity=t,this.chunks=[new zt(t)],this.onChunk=e}static async root(e,t=4096){const r=new n(n.NOOP,t);return await r.append(e),r.finalize()}async append(e,t=0,n=0n){const r=new qt(e);for(;r.max()>0;){0===this.chunks[t].writer.max()&&await this.elevate(t);const e=this.chunks[t].writer.write(r);n?this.chunks[t].span+=n:this.chunks[0].span+=BigInt(e)}}async elevate(e){this.counters[e]=++this.counters[e]%(this.capacity/32),this.chunks[e+1]||(this.chunks.push(new zt(this.capacity)),this.counters.push(1)),await this.append(this.chunks[e].hash(),e+1,this.chunks[e].span),await this.onChunk(this.chunks[e]),this.chunks[e]=new zt(this.capacity)}async finalize(e=0){return this.chunks[e+1]?1===this.counters[e]?(await this.elevate(e+1),this.chunks[e+1]=this.chunks[e],this.finalize(e+1)):(await this.elevate(e),this.finalize(e+1)):(await this.onChunk(this.chunks[e]),this.chunks[e])}}t.vU=Gt,n=Gt,Gt.NOOP=async e=>{};class Wt{constructor(e,t){if(t<0)throw Error("Scale must be non-negative");this.value=BigInt(e),this.scale=t}static fromDecimalString(e,t){let[n,r]=e.split(".");return r=(r||"").padEnd(t,"0").slice(0,t),new Wt(BigInt(n+r),t)}add(e){return this.assertSameScale(e),new Wt(this.value+e.value,this.scale)}subtract(e){return this.assertSameScale(e),new Wt(this.value-e.value,this.scale)}multiply(e){return new Wt(this.value*e,this.scale)}divmod(e){if(0n===e)throw new Error("Division by zero is not allowed");const t=this.value/e,n=this.value%e;return[new Wt(t,this.scale),new Wt(n,this.scale)]}exchange(e,t,n){if("*"===e){const e=this.value*t.value/10n**BigInt(this.scale);return new Wt(e,n)}this.assertSameScale(t);const r=this.value*10n**BigInt(n)/t.value;return new Wt(r,n)}compare(e){return this.assertSameScale(e),this.value>e.value?1:this.value<e.value?-1:0}toDecimalString(){if(0===this.scale)return this.value.toString();const e=this.value.toString();return`${e.slice(0,-this.scale)||"0"}.${e.slice(-this.scale).padStart(this.scale,"0")}`}toString(){return this.value.toString()}toJSON(){return this.toString()}assertSameScale(e){if(this.scale!==e.scale)throw new Error(`Scale mismatch: expected ${this.scale}, but got ${e.scale}`)}}function Kt(e,t,n,r){const s=e.findIndex((e=>e===`--${t}`||e.startsWith(`--${t}=`))),a=e[s];if(!a)return(n||{})[r||t||""]||null;if(a.includes("="))return a.split("=")[1];const o=e[s+1];return o&&!o.startsWith("-")?o:(n||{})[r||t||""]||null}function Vt(e,t,n,r){const s=Kt(e,t,n,r);if(!s)throw new Error(`Missing argument ${t}`);return s}function Xt(e,t){const n=e[t];e.splice(t,1),e.unshift(n)}function Jt(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Zt(e,t){return{x:e.x*t,y:e.y*t}}function Qt(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function Yt(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function en(e,t,n="row-first"){const r=[];if("column-first"===n)for(let s=0;s<e.length;s++)for(let n=0;n<e[0].length;n++)t(s,n)&&r.push({x:s,y:n});else for(let s=0;s<e[0].length;s++)for(let n=0;n<e.length;n++)t(n,s)&&r.push({x:n,y:s});return r}function tn(e,t,n){return!e[t-1]?.[n]}function nn(e,t,n){return!e[t+1]?.[n]}function rn(e,t,n){return!e[t][n-1]}function sn(e,t,n){return!e[t][n+1]}function an(e,t,n){const r=[];return e[t][n]?function(e,t,n){return e[t+1]?.[n]&&e[t-1]?.[n]&&!e[t][n-1]&&!e[t][n+1]}(e,t,n)||function(e,t,n){return e[t][n+1]&&e[t][n-1]&&!e[t-1]?.[n]&&!e[t+1]?.[n]}(e,t,n)?[]:(!e[t-1]?.[n-1]&&tn(e,t,n)&&rn(e,t,n)&&r.push({x:t,y:n}),!e[t+1]?.[n-1]&&nn(e,t,n)&&rn(e,t,n)&&r.push({x:t+1,y:n}),!e[t-1]?.[n+1]&&tn(e,t,n)&&sn(e,t,n)&&r.push({x:t,y:n+1}),!e[t+1]?.[n+1]&&nn(e,t,n)&&sn(e,t,n)&&r.push({x:t+1,y:n+1}),r):(e[t-1]?.[n]&&e[t][n-1]&&r.push({x:t,y:n}),e[t+1]?.[n]&&e[t][n-1]&&r.push({x:t+1,y:n}),e[t-1]?.[n]&&e[t][n+1]&&r.push({x:t,y:n+1}),e[t+1]?.[n]&&e[t][n+1]&&r.push({x:t+1,y:n+1}),r)}function on(e,t){return t.map((t=>function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}(e,t))).sort(((e,t)=>e-t))}function cn(e,t,n,r){const s=(r.y-n.y)*(t.x-e.x)-(r.x-n.x)*(t.y-e.y);if(0===s)return null;let a=e.y-n.y,o=e.x-n.x;const i=(r.x-n.x)*a-(r.y-n.y)*o,c=(t.x-e.x)*a-(t.y-e.y)*o;return a=i/s,o=c/s,a>0&&a<1&&o>0&&o<1?{x:e.x+a*(t.x-e.x),y:e.y+a*(t.y-e.y)}:null}function un(e,t,n){const r=[],s=Qt(e,n,1e4);for(const a of t){const t=cn(e,s,a.start,a.end);t&&r.push(t)}return r.length?r.reduce(((t,n)=>Yt(e,n)<Yt(e,t)?n:t)):null}t.ie=Wt;class ln{constructor(){this.subscribers=[]}subscribe(e){return this.subscribers.push(e),()=>{this.subscribers=this.subscribers.filter((t=>t!==e))}}publish(e){this.subscribers.forEach((t=>t(e)))}clear(){this.subscribers=[]}getSubscriberCount(){return this.subscribers.length}}t.Dj=ln;t.O3=class{constructor(e,t){this.queue=[],this.running=0,this.onProcessed=new ln,this.onDrained=new ln,this.concurrency=e,this.capacity=t}process(){if(this.running>=this.concurrency)return;const e=this.queue.shift();e&&(this.running++,e().finally((()=>{this.running--,this.process(),this.onProcessed.publish(),0===this.running&&this.onDrained.publish()})))}enqueue(e){if(this.queue.length<this.capacity)return this.queue.push(e),this.process(),Promise.resolve();if(this.onProcessed.getSubscriberCount())throw Error("Queue capacity is full");return new Promise((t=>{this.onProcessed.subscribe((()=>{this.queue.length<this.capacity&&(this.queue.push(e),this.process(),this.onProcessed.clear(),t())}))}))}drain(){if(0===this.running)return Promise.resolve();if(this.onDrained.getSubscriberCount())throw Error("Already draining");return new Promise((e=>{this.onDrained.subscribe((()=>{this.onDrained.clear(),e()}))}))}};class fn{constructor(){this.forks=new Map}insert(e,t){if(0===e.length)return void(this.handler=t);const n=e[0];let r,s=n;if(n.startsWith(":")&&(s=":",r=n.slice(1)),!this.forks.has(s)){const e=new fn;r&&(e.variableName=r),this.forks.set(s,e)}this.forks.get(s).insert(e.slice(1),t)}async handle(e,t,n,r){if(0===e.length)return!!this.handler&&(await this.handler(t,n,r),!0);const s=e[0],a=this.forks.get(s);if(a)return a.handle(e.slice(1),t,n,r);const o=this.forks.get(":");if(o)return o.variableName&&r.set(o.variableName,decodeURIComponent(s)),o.handle(e.slice(1),t,n,r);const i=this.forks.get("*");return!!i&&(r.set("wildcard",e.join("/")),!!i.handler&&(await i.handler(t,n,r),!0))}}t.g$=fn,t.yI={hexToUint8Array:function(e){(e.startsWith("0x")||e.startsWith("0X"))&&(e=e.slice(2));const t=e.length/2,n=new Uint8Array(t);for(let r=0;r<t;r++){const t=parseInt(e.slice(2*r,2*r+2),16);n[r]=t}return n},uint8ArrayToHex:function(e){return Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")},base64ToUint8Array:function(e){return xe(e,Ee)},uint8ArrayToBase64:function(e){return ve(e,Ee)},base32ToUint8Array:function(e){return xe(e,Oe)},uint8ArrayToBase32:function(e){return ve(e,Oe)},log2Reduce:dt,partition:Ot,concatBytes:pt,numberToUint8:function(e){return new Uint8Array([e])},uint8ToNumber:function(e){return e[0]},numberToUint16:function(e,t){const n=new ArrayBuffer(2);return new DataView(n).setUint16(0,e,"LE"===t),new Uint8Array(n)},uint16ToNumber:function(e,t){return new DataView(e.buffer).getUint16(e.byteOffset,"LE"===t)},numberToUint32:function(e,t){const n=new ArrayBuffer(4);return new DataView(n).setUint32(0,e,"LE"===t),new Uint8Array(n)},uint32ToNumber:function(e,t){return new DataView(e.buffer).getUint32(e.byteOffset,"LE"===t)},numberToUint64:bt,uint64ToNumber:function(e,t){return new DataView(e.buffer).getBigUint64(e.byteOffset,"LE"===t)},numberToUint256:wt,uint256ToNumber:Et,sliceBytes:function(e,t){const n=[];let r=0;for(const s of t)n.push(e.subarray(r,r+s)),r+=s;return n},keccak256:Nt,sha3_256:function(e){return Rt(Tt(new Array(50).fill(0),At(e,6)))},proximity:function(e,t,n){const r=Math.min(e.length,t.length,n/8+1);for(let s=0;s<r;s++){const n=e[s]^t[s];for(let e=0;e<8;e++)if(n>>7-e&1)return 8*s+e}return n},commonPrefix:function(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.subarray(0,r);return e.subarray(0,n)},setBit:function(e,t,n,r){const s=Math.floor(t/8),a=t%8;1===n?e[s]|=1<<("BE"===r?7-a:a):e[s]&=~(1<<("BE"===r?7-a:a))},getBit:function(e,t,n){const r=t%8;return e[Math.floor(t/8)]>>("BE"===n?7-r:r)&1},indexOf:function(e,t,n=0){for(let r=n;r<e.length;r++)for(let n=0;n<t.length&&e[r+n]===t[n];n++)if(n===t.length-1)return r;return-1},equals:function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},padStart:It,padStartToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:It(e,e.length+t-r,n)},padEnd:$t,padEndToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:$t(e,e.length+t-r,n)},xorCypher:function(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r%t.length];return n}},t.LQ={privateKeyToPublicKey:function(e){if(e<=0n||e>=Ft)throw new Error("Invalid private key");return _t(jt,Dt,e,Ut)},compressPublicKey:function(e){const t=e[1]%2n===0n?2:3;return new Uint8Array([t,...wt(e[0],"BE")])},publicKeyFromCompressed:function(e){if(33!==e.length||2!==e[0]&&3!==e[0])throw new Error("Invalid compressed public key");const t=Et(e.slice(1),"BE"),n=Lt(Bt(t**3n+7n,Ut),Ut);if(!n)throw Error("Invalid x: does not correspond to a valid curve point");const r=Bt(-n,Ut),s=n%2n===0n;return[t,2===e[0]?s?n:r:s?r:n]},publicKeyToAddress:function(e){const t=new Uint8Array(20),n=Nt(pt(wt(e[0],"BE"),wt(e[1],"BE")));return t.set(n.subarray(12)),t},signMessage:function(e,t,n){return Mt(Et(Nt(e),"BE"),t,n)},signHash:Mt,verifySignature:function(e,t,n,r){const s=Bt(Et(Nt(e),"BE"),Ft),a=kt(r,Ft),o=Bt(s*a,Ft),i=Bt(n*a,Ft),c=_t(jt,Dt,o,Ut),u=_t(t[0],t[1],i,Ut);return n===Bt(Ct(c[0],c[1],u[0],u[1],Ut)[0],Ft)},recoverPublicKey:function(e,t,n,r){const s=Lt(Bt(t**3n+7n,Ut),Ut);if(!s)throw new Error("Invalid r: does not correspond to a valid curve point");const a=s%2n===(27n===r?0n:1n)?s:Ut-s,o=Bt(Et(Nt(e),"BE"),Ft),i=_t(t,a,n,Ut),c=_t(jt,Dt,o,Ut),u=Ct(i[0],i[1],c[0],Bt(-c[1],Ut),Ut);return _t(u[0],u[1],kt(t,Ft),Ut)},checksumEncode:function(e){const n=t.yI.uint8ArrayToHex(e),r=t.yI.uint8ArrayToHex(t.yI.keccak256(new Uint8Array([...n].map((e=>e.charCodeAt(0))))));let s="0x";for(let t=0;t<n.length;t++)parseInt(r[t],16)>7?s+=n[t].toUpperCase():s+=n[t];return s}},t.o8={intBetween:i,floatBetween:function(e,t,n=Math.random){return n()*(t-e)+e},chance:u,signed:function(){return 2*Math.random()-1},makeSeededRng:function(e){let t=e,n=3405648695,r=3735928559;return function(){return t+=n,n^=t<<7,t*=r,r^=t<<13,t^=n^r,(t>>>0)/4294967296}},point:function(e,t,n,r=Math.random){let s,a;do{s=i(0,e-1,r),a=i(0,t-1,r)}while(n&&c(n,s,a));return[s,a]},procs:function(e,t=Math.random){const n=Math.floor(e);return u(e-n,t)?n+1:n}},t.DO={countUnique:function(e,t,n,r,s){const a=t?e.map(t):e,o={};for(const c of a)o[c]=(o[c]||0)+1;const i=r?ct(o,s?(e,t)=>e[1]-t[1]:(e,t)=>t[1]-e[1]):o;return n?Object.keys(i):i},makeUnique:function(e,t){return Object.values(at(e,t))},splitBySize:function(e,t){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},splitByCount:ot,index:at,indexCollection:function(e,t){const n={};for(const r of e){const e=t(r);n[e]||(n[e]=[]),n[e].push(r)}return n},onlyOrThrow:function(e){if(1===e.length)return e[0];throw Error(`Expected exactly one element, actual: ${e.length}`)},onlyOrNull:function(e){return 1===e.length?e[0]:null},firstOrThrow:function(e){if(!e.length)throw Error("Received empty array");return e[0]},firstOrNull:function(e){return e.length>0?e[0]:null},shuffle:a,initialize:function(e,t){const n=[];for(let r=0;r<e;r++)n.push(t(r));return n},initialize2D:function(e,t,n){const r=[];for(let s=0;s<e;s++){r.push([]);for(let e=0;e<t;e++)r[s].push(n)}return r},rotate2D:function(e){const t=[];for(let n=0;n<e[0].length;n++){t.push([]);for(let r=0;r<e.length;r++)t[n].push(e[r][n])}return t},containsShape:function(e,t,n,r){if(n<0||r<0||r+t[0].length>e[0].length||n+t.length>e.length)return!1;for(let s=0;s<t.length;s++)for(let a=0;a<t[s].length;a++)if(void 0!==t[s][a]&&e[n+s][r+a]!==t[s][a])return!1;return!0},glue:function(e,t){const n=[];for(let r=0;r<e.length;r++)n.push(e[r]),r<e.length-1&&(E(t)?n.push(t()):n.push(t));return n},pluck:function(e,t){return e.map((e=>e[t]))},pick:l,pickMany:function(e,t,n=Math.random){if(t>e.length)throw new Error(`Count (${t}) is greater than array length (${e.length})`);return o(e,t,n).map((t=>e[t]))},pickManyUnique:function(e,t,n,r=Math.random){if(t>e.length)throw new Error(`Count (${t}) is greater than array length (${e.length})`);const s=[];for(;s.length<t;){const t=l(e,r);s.some((e=>n(e,t)))||s.push(t)}return s},pickWeighted:function(e,t,n){if(void 0===n&&(n=Math.random()),e.length!==t.length)throw new Error("Array length mismatch");let r=t.reduce(((e,t)=>e+t),0);const s=n*r;for(let a=0;a<e.length-1;a++)if(r-=t[a],s>=r)return e[a];return f(e)},pickRandomIndices:o,pickGuaranteed:function(e,n,r,s,o,i=Math.random){const c=e.filter((e=>e!==n&&e!==r)),u=[];for(null!==n&&u.push(n);c.length&&u.length<s;){const e=t.o8.intBetween(0,c.length-1,i);o(c[e],u)&&u.push(c[e]),c.splice(e,1)}return a(u,i),{values:u,indexOfGuaranteed:null!==n?u.indexOf(n):-1}},last:f,pipe:h,makePipe:function(e,t){return n=>h(n,e,t)},sortWeighted:function(e,t,n=Math.random){const r=t.map((e=>n()*e)),s=[];for(let a=0;a<e.length;a++)s.push([e[a],r[a]]);return s.sort(((e,t)=>t[1]-e[1])).map((e=>e[0]))},pushAll:z,unshiftAll:function(e,t){Array.prototype.unshift.apply(e,t)},filterAndRemove:function(e,t){const n=[];for(let r=e.length-1;r>=0;r--)t(e[r])&&n.push(e.splice(r,1)[0]);return n},merge:function(e,t){const n=Object.keys(t);for(const r of n)Array.isArray(t[r])&&Array.isArray(e[r])&&z(e[r],t[r])},empty:function(e){return e.splice(0,e.length),e},pushToBucket:function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)},unshiftAndLimit:function(e,t,n){for(e.unshift(t);e.length>n;)e.pop()},atRolling:function(e,t){let n=t%e.length;return n<0&&(n+=e.length),e[n]},group:ut,createOscillator:function(e){let t=0;return{next:()=>e[t++%e.length]}},organiseWithLimits:function(e,t,n,r,s){const a={};for(const o of Object.keys(t))a[o]=[];a[r]=[],s&&(e=e.sort(s));for(const o of e){const e=o[n],s=t[e]?e:r;a[s].length>=t[s]?a[r].push(o):a[s].push(o)}return a},tickPlaybook:function(e){if(0===e.length)return null;const t=e[0];return t.ttlMax?--t.ttl<=0&&e.shift():t.ttlMax=t.ttl,{progress:(t.ttlMax-t.ttl)/t.ttlMax,data:t.data}},getArgument:Kt,getBooleanArgument:function(e,t,n,r){const s=e.some((e=>e.endsWith("-"+t))),a=Kt(e,t,n,r);if(!a&&s)return!0;if(!a&&!s)return null;if(["true","1","yes","y","on"].includes(a.toLowerCase()))return!0;if(["false","0","no","n","off"].includes(a.toLowerCase()))return!1;throw Error(`Invalid boolean argument ${t}: ${a}`)},getNumberArgument:function(e,t,n,r){const s=Kt(e,t,n,r);if(!s)return null;try{return tt(s)}catch{throw new Error(`Invalid number argument ${t}: ${s}`)}},requireStringArgument:Vt,requireNumberArgument:function(e,t,n,r){const s=Vt(e,t,n,r);try{return tt(s)}catch{throw new Error(`Invalid argument ${t}: ${s}`)}},bringToFront:function(e,t){const n=[...e];return Xt(n,t),n},bringToFrontInPlace:Xt,findInstance:function(e,t){const n=e.find((e=>e instanceof t));return ft.of(n)},filterInstances:function(e,t){return e.filter((e=>e instanceof t))},interleave:function(e,t){const n=[],r=Math.max(e.length,t.length);for(let s=0;s<r;s++)e[s]&&n.push(e[s]),t[s]&&n.push(t[s]);return n},toggle:function(e,t){return e.includes(t)?e.filter((e=>e!==t)):[...e,t]},createHierarchy:function(e,t,n,r,s=!1){const a=new Map,o=[];e.forEach((e=>{const n=new ht(e);a.set(e[t],n)})),e.forEach((e=>{const r=a.get(e[t]);if(!r)return;const s=e[n];if(s){const e=a.get(s);e&&e.children.push(r)}else o.push(r)}));const i=e=>{e.children.sort(((e,t)=>{const n=e.value[r],a=t.value[r];return s?a-n:n-a})),e.children.forEach(i)};return o.forEach(i),o},multicall:function(e){return()=>e.forEach((e=>e()))},maxBy:function(e,t){return e.reduce(((e,n)=>t(e)>t(n)?e:n))}},t.iQ={sleepMillis:s,forever:async function(e,t,n){for(;;){try{await e()}catch(r){n&&n("Error in forever",r)}await s(t)}},scheduleMany:function(e,t){for(let n=0;n<e.length;n++){const r=e[n],s=t[n],a=Math.max(0,s.getTime()-Date.now());setTimeout(r,a)}},waitFor:async function(e,t,n){for(let r=0;r<n;r++){try{if(await e())return}catch{}r<n-1&&await s(t)}throw Error("Timed out waiting for predicate")},expandError:function(e,t){if(O(e))return e;const n=Object.keys(e);e.message&&!n.includes("message")&&n.push("message");const r=n.map((t=>`${t}: ${e[t]}`)).join("; ");return t&&e.stack?r+"\n"+e.stack:r},runAndSetInterval:function(e,t){e();const n=setInterval((()=>{e()}),t);return()=>clearInterval(n)},whereAmI:function(){const e=globalThis.process;return e?!0===e.browser?"browser":"node":"browser"}},t.FQ={make:tt,sum:function(e){return e.reduce(((e,t)=>e+t),0)},average:function(e){return e.reduce(((e,t)=>e+t),0)/e.length},median:function(e){const t=[...e].sort(((e,t)=>e-t)),n=Math.floor(t.length/2);return t.length%2==0?(t[n]+t[n-1])/2:t[n]},getDistanceFromMidpoint:function(e,t){return e-(t-1)/2},clamp:nt,range:G,interpolate:function(e,t,n){return e+(t-e)*n},createSequence:function(){let e=0;return{next:()=>e++}},increment:function(e,t,n){const r=e+t;return r>n?n:r},decrement:function(e,t,n){const r=e-t;return r<n?n:r},format:function(e,t){const n=t?.longForm??!1,r=t?.unit?` ${t.unit}`:"",s=n?Ye:et,a=t?.precision??1;if(e<Qe[0])return`${e}${r}`;for(let o=0;o<Qe.length-1;o++)if(e<Qe[o+1])return`${(e/Qe[o]).toFixed(a)}${n?" ":""}${s[o]}${r}`;return`${(e/Qe[Qe.length-1]).toFixed(a)}${n?" ":""}${s[Qe.length-1]}${r}`},fromDecimals:function(e,t,n){let r=e.length-t;if(r<=0)return"0."+"0".repeat(-r)+e+(n?" "+n:"");let s=e.substring(0,r);return""===s&&(s="0"),s+"."+e.substring(r)+(n?" "+n:"")},makeStorage:function(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeDate got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),r=ze[n];if(!r)throw Error(`Unknown unit: "${n}"`);return t*r},asMegabytes:function(e){return e/1024/1024},convertBytes:function(e,t=1024){return e>=t*t*t*t?(e/t/t/t/t).toFixed(3)+" TB":e>=t*t*t?(e/t/t/t).toFixed(3)+" GB":e>=t*t?(e/t/t).toFixed(3)+" MB":e>=t?(e/t).toFixed(3)+" KB":e+" B"},hexToRgb:function(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e.toLowerCase());if(!t)throw new Error("Invalid hex color: "+e);return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]},rgbToHex:function(e){return"#"+e.map((e=>e.toString(16).padStart(2,"0"))).join("")},haversineDistanceToMeters:function(e,t,n,r){const s=e*Math.PI/180,a=n*Math.PI/180,o=(n-e)*Math.PI/180,i=(r-t)*Math.PI/180,c=Math.sin(o/2)*Math.sin(o/2)+Math.cos(s)*Math.cos(a)*Math.sin(i/2)*Math.sin(i/2);return 2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))*6371e3},roundToNearest:m,formatDistance:function(e){return e>1e3?(e/1e3).toFixed(0)+" km":e>=500?m(e,100)+" m":e>=100?m(e,50)+" m":m(e,10)+" m"},triangularNumber:function(e){return e*(e+1)/2},searchFloat:function(e){const t=e.match(/-?\d+(\.\d+)?/);if(!t)throw Error("No float found in "+e);return parseFloat(t[0])}},t.HC={raceFulfilled:async function(e){return r(Promise.all(e.map(r)))},invert:r,runInParallelBatches:async function(e,t=1){const n=ot(e,t),r=[],s=n.map((async e=>{for(const t of e)r.push(await t())}));return await Promise.all(s),r}},t.AO={getTimestamp:function(e,t){const n=new Date(t?.now||Date.now()),r=t?.labels||Fe,s=S(e)?e:new Date(e);if(Ue(n)===Ue(s))return r.today(s.getUTCHours(),s.getUTCMinutes(),s.getUTCHours()>12);if(Ue(n)-Ue(s)==1)return r.yesterday();const a=qe(s);return Ue(n)-Ue(s)<7?r[a.day]():r.weeks(Math.round((n.getTime()-s.getTime())/6048e5))},getTimeDelta:De,secondsToHumanTime:function(e,t=je){return De(0,{now:1e3*e,labels:t})},countCycles:function(e,t,n){const r=(n?.now??Date.now())-e;return{cycles:Math.floor(r/t),remaining:t/(n?.precision??1)-Math.ceil(r%t/(n?.precision??1))}},isoDate:function(e){return(e||new Date).toISOString().slice(0,10)},throttle:function(e,t){return(!Pe[e]||Date.now()>Pe[e])&&(Pe[e]=Date.now()+t,!0)},timeSince:function(e,t,n){return t=S(t)?t.getTime():t,((n=n?S(n)?n.getTime():n:Date.now())-t)/Ce[e]},dateTimeSlug:function(e){return(e||new Date).toISOString().slice(0,19).replace(/T|:/g,"-")},unixTimestamp:function(e){return Math.ceil((e||Date.now())/1e3)},fromUtcString:function(e){const t=new Date(e);return new Date(t.getTime()-6e4*t.getTimezoneOffset())},fromMillis:function(e){return new Date(e)},getProgress:function(e,t,n,r){r||(r=Date.now());const s=r-e,a=s/t,o=a*n;return{deltaMs:s,progress:t/n,baseTimeMs:a,totalTimeMs:o,remainingTimeMs:o-s}},humanizeTime:Le,humanizeProgress:function(e){return`[${Math.floor(100*e.progress)}%] ${Le(e.deltaMs)} out of ${Le(e.totalTimeMs)} (${Le(e.remainingTimeMs)} left) [${Math.round(e.baseTimeMs)} ms each]`},createTimeDigits:ke,mapDayNumber:Me,getDayInfoFromDate:qe,getDayInfoFromDateTimeString:function(e){return qe(new Date(e))},seconds:function(e){return 1e3*e},minutes:function(e){return 6e4*e},hours:function(e){return 36e5*e},days:function(e){return 864e5*e},make:function(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeDate got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),r=He[n];if(!r)throw Error(`Unknown unit: "${n}"`);return t*r},normalizeTime:function(e){let[t,n]=e.split(":");x(parseInt(t,10))||(t="0"),x(parseInt(n,10))||(n="0");let r=nt(P(t),0,23),s=nt(P(n),0,59);return`${ke(r)}:${ke(s)}`},absoluteDays:Ue},t.Rb={safeParse:function(e){try{return JSON.parse(e)}catch{return null}},deleteDeep:function(e,t){const n=Z(t,"."),r=Q(t,".");if(!n||!r)return;const s=d(e,n);s&&delete s[r]},getDeep:d,setDeep:p,incrementDeep:function(e,t,n=1){const r=d(e,t)||0;return p(e,t,r+n),r},ensureDeep:function(e,t,n){return d(e,t)||p(e,t,n)},replaceDeep:function(e,t,n){const r=d(e,t);if(!r)throw new Error("Key '"+t+"' does not exist.");return p(e,t,n),r},getFirstDeep:function(e,t,n){for(const r of t){const t=d(e,r);if(t)return t}if(n){const t=Object.values(e);if(t.length)return t[0]}return null},deepMergeInPlace:q,deepMerge2:function(e,t){const n={};return q(n,e),q(n,t),n},deepMerge3:function(e,t,n){const r={};return q(r,e),q(r,t),q(r,n),r},mapAllAsync:async function(e,t){const n=[];for(const r of e)n.push(await t(r));return n},cloneWithJson:function(e){return JSON.parse(JSON.stringify(e))},sortObject:Ke,sortArray:Ve,sortAny:Xe,deepEquals:Je,deepEqualsEvery:function(...e){for(let t=1;t<e.length;t++)if(!Je(e[t-1],e[t]))return!1;return!0},runOn:function(e,t){return t(e),e},ifPresent:function(e,t){e&&t(e)},zip:H,zipSum:function(e){return H(e,((e,t)=>e+t))},removeEmptyArrays:function(e){for(const t of Object.keys(e))(b(e[t])||Array.isArray(e[t])&&e[t].every((e=>null==e)))&&delete e[t];return e},removeEmptyValues:function(e){for(const t of Object.entries(e))(null===t[1]||void 0===t[1]||O(t[1])&&A(t[1]))&&delete e[t[0]];return e},flatten:function(e,t=!1,n){return st({},e,n||"",!1,t)},unflatten:function e(t){if(!g(t))return t;const n=Array.isArray(t)?[]:{};for(const[r,s]of Object.entries(t))Array.isArray(s)?p(n,r,s.map((t=>e(t)))):p(n,r,s);return n},match:function(e,t,n){return t[e]?t[e]:n},sort:ct,map:function(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n},mapIterable:function(e,t){const n=[];let r=0;for(const s of e)n.push(t(s,r++));return n},filterKeys:function(e,t){const n={};for(const[r,s]of Object.entries(e))t(r)&&(n[r]=s);return n},filterValues:function(e,t){const n={};for(const[r,s]of Object.entries(e))t(s)&&(n[r]=s);return n},rethrow:async function(e,t){try{return await e()}catch{throw t}},setSomeOnObject:function(e,t,n){null!=n&&(e[t]=n)},setSomeDeep:function(e,t,n,r){const s=d(n,r);null!=s&&p(e,t,s)},flip:function(e){const t={};for(const[n,r]of Object.entries(e))t[r]=n;return t},getAllPermutations:function(e){const t=Object.keys(e),n=t.map((t=>e[t].length)),r=n.reduce(((e,t)=>e*t));let s=1;const a=[1];for(let i=0;i<n.length-1;i++)s*=n[i],a.push(s);const o=[];for(let i=0;i<r;i++){const n={};for(let r=0;r<t.length;r++){const s=e[t[r]],o=Math.floor(i/a[r])%s.length;n[t[r]]=s[o]}o.push(n)}return o},countTruthyValues:function(e){return Object.values(e).filter((e=>e)).length},transformToArray:function(e){const t=[],n=Object.keys(e),r=e[n[0]].length;for(let s=0;s<r;s++){const r={};for(const t of n)r[t]=e[t][s];t.push(r)}return t},setMulti:function(e,t,n){for(const r of e)r[t]=n},incrementMulti:function(e,t,n=1){for(const r of e)r[t]+=n},createBidirectionalMap:function(){return{map:new Map,keys:[]}},createTemporalBidirectionalMap:function(){return{map:new Map,keys:[]}},pushToBidirectionalMap:lt,unshiftToBidirectionalMap:function(e,t,n,r=100){if(e.map.has(t)){const n=e.keys.indexOf(t);e.keys.splice(n,1)}if(e.map.set(t,n),e.keys.unshift(t),e.keys.length>r){const t=e.keys.shift();t&&e.map.delete(t)}},addToTemporalBidirectionalMap:function(e,t,n,r,s=100){lt(e,t,{validUntil:Date.now()+r,data:n},s)},getFromTemporalBidirectionalMap:function(e,t){const n=e.map.get(t);return n&&n.validUntil>Date.now()?n.data:null},createStatefulToggle:function(e){let t;return n=>{const r=n===e&&t!==e;return t=n,r}},diffKeys:function(e,t){const n=Object.keys(e),r=Object.keys(t);return{uniqueToA:n.filter((e=>!r.includes(e))),uniqueToB:r.filter((e=>!n.includes(e)))}},pickRandomKey:Ze,mapRandomKey:function(e,t){const n=Ze(e);return e[n]=t(e[n]),n},fromObjectString:function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/(\w+)\((.+)\)/g,((e,t,n)=>`${t}(${n.replaceAll(",",",")})`))).replace(/(,)(\s+})/g,"$2")).replace(/\.\.\..+?,/g,"")).replace(/({\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',")).replace(/(,\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',")).replace(/:(.+)\?(.+):/g,((e,t,n)=>`: (${t.trim()} && ${n.trim()}) ||`))).replace(/([a-zA-Z0-9]+)( ?: ?{)/g,'"$1"$2')).replace(/([a-zA-Z0-9]+) ?: ?(.+?)(,|\n|})/g,((e,t,n,r)=>`"${t}":"${n.trim()}"${r}`))).replace(/("'|'")/g,'"')).replaceAll(",",","),JSON.parse(e)},toQueryString:Be,parseQueryString:function(e){const t={},n=e.split("&");for(const r of n){const[e,n]=r.split("=");e&&n&&(t[e]=decodeURIComponent(n))}return t},hasKey:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},selectMax:function(e,t){let n=null,r=-1/0;for(const[s,a]of Object.entries(e)){const e=t(a);e>r&&(r=e,n=s)}return n?[n,e[n]]:null},reposition:function(e,t,n,r){const s=e.find((e=>e[t]===n)),a=e.find((e=>e[t]===n+r));s&&a?(s[t]=n+r,a[t]=n):s&&(s[t]=n+r),e.sort(((e,n)=>D(e[t])-D(n[t]))),e.forEach(((e,n)=>e[t]=n+1))},unwrapSingleKey:function(e){const t=Object.keys(e);if(1===t.length)return e[t[0]];throw new Error("Expected object to have a single key")},parseKeyValues:function(e,t=":"){return Object.fromEntries(e.map((e=>Y(e,t))).map((e=>e[0]&&e[1]?[re(e[0]),re(e[1])]:null)).filter((e=>e)))}},t.Or={isFunction:E,isObject:g,isStrictlyObject:y,isEmptyArray:b,isEmptyObject:function(e){return y(e)&&0===Object.keys(e).length},isUndefined:w,isString:O,isNumber:x,isBoolean:v,isDate:S,isBlank:A,isId:T,isIntegerString:R,isHexString:N,isUrl:_,isNullable:function(e,t){return null==t||e(t)},asString:F,asHexString:function(e,t){if(!N(e))throw new TypeError(`Expected hex string${t?.name?` for ${t.name}`:""}, got: `+e);const n=e.replace(/^0x/,"");if(n.length%2!=0)throw RangeError(`Expected even number of hex digits${t?.name?` for ${t.name}`:""}; got: `+e);if(t&&t.byteLength&&n.length!==2*t.byteLength)throw RangeError(`Expected hex string${t?.name?` for ${t.name}`:""} of byte length ${t.byteLength}; got: `+n);return n},asSafeString:function(e,t){if(!F(e,t).split("").every((e=>"_"===e||ce(e))))throw new TypeError(`Expected safe string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asIntegerString:function(e,t){if(!R(e))throw new TypeError(`Expected integer string${t?.name?` for ${t.name}`:""}, got: `+e);const n=BigInt(e);if(t&&(t.min&&n<t.min||t.max&&n>t.max))throw RangeError(`Expected integer string${t?.name?` for ${t.name}`:""} in range: ${t.min??"-inf"}..${t.max??"inf"}; got: `+n);return e},asNumber:D,asFunction:function(e,t){if(!E(e))throw new TypeError(`Expected function${t?.name?` for ${t.name}`:""}, got: `+e);return e},asInteger:P,asBoolean:function(e,t){if("true"===e)return!0;if("false"===e)return!1;if(!v(e))throw new TypeError(`Expected boolean${t?.name?` for ${t.name}`:""}, got: `+e);return e},asDate:function(e,t){if(!S(e))throw new TypeError(`Expected date${t?.name?` for ${t.name}`:""}, got: `+e);return e},asNullableString:function(e){return A(e)?null:e},asEmptiableString:function(e,t){if(!O(e))throw new TypeError(`Expected string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asId:function(e,t){if(T(e))return e;const n=parseInt(e,10);if(!T(n))throw new TypeError(`Expected id${t?.name?` for ${t.name}`:""}, got: `+e);return n},asTime:function(e,t){if(!O(e))throw new TypeError(`Expected time${t?.name?` for ${t.name}`:""}, got: `+e);const n=e.split(":");if(2!==n.length)throw new TypeError(`Expected time${t?.name?` for ${t.name}`:""}, got: `+e);const r=parseInt(n[0],10),s=parseInt(n[1],10);if(!x(r)||!x(s)||r<0||r>23||s<0||s>59)throw new TypeError(`Expected time, got${t?.name?` for ${t.name}`:""}: `+e);return`${String(r).padStart(2,"0")}:${String(s).padStart(2,"0")}`},asArray:function(e,t){if(!Array.isArray(e))throw new TypeError(`Expected array${t?.name?` for ${t.name}`:""}, got: `+e);return e},asObject:C,asNullableObject:function(e,t){return null===e?null:C(e,t)},asStringMap:function(e,t){const n=C(e,t);for(const r of Object.keys(n))if(!O(n[r]))throw new TypeError(`Expected string map${t?.name?` for ${t.name}`:""}, got: `+e);return n},asNumericDictionary:function(e,t){const n=C(e),r=Object.keys(n),s=Object.values(n);if(!r.every(O)||!s.every(x))throw new TypeError(`Expected numeric dictionary${t?.name?` for ${t.name}`:""}, got: `+e);return n},asUrl:function(e,t){if(!_(e))throw new TypeError(`Expected url${t?.name?` for ${t.name}`:""}, got: `+e);return e},asNullable:function(e,t){return null==t?null:e(t)},asOptional:function(e,t){return null==t?void 0:e(t)},enforceObjectShape:M,enforceArrayShape:function(e,t){return e.every((e=>M(e,t)))},isPng:mt,isJpg:gt,isWebp:yt,isImage:function(e){return mt(e)||gt(e)||yt(e)}},t.DH={tokenizeByCount:function(e,t){return it(e,Math.ceil(e.length/t))},tokenizeByLength:it,searchHex:function(e,t){const n=new RegExp(`[0-9a-f]{${t}}`,"i"),r=e.match(n);return r?r[0]:null},searchSubstring:function(e,t,n=I){const r=ee(e,n);for(const s of r)if(t(s))return s;return null},randomHex:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=U[Math.floor(16*t())];return n},randomLetter:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=$[Math.floor(26*t())];return n},randomAlphanumeric:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=B[Math.floor(62*t())];return n},randomRichAscii:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=k[Math.floor(89*t())];return n},randomUnicode:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=L[Math.floor(t()*L.length)];return n},includesAny:function(e,t){return t.some((t=>e.includes(t)))},slugify:W,normalForm:function(e){return W(e).replaceAll("-","")},enumify:function(e){return W(e).replace(/-/g,"_").toUpperCase()},escapeHtml:function(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},decodeHtmlEntities:function(e){let t=e.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(t))).replace(/&#x(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,16))));for(const[n,r]of Object.entries(V))t=t.replaceAll(n,r);return t},after:J,afterLast:Q,before:X,beforeLast:Z,betweenWide:function(e,t,n){const r=Z(e,n);return r?J(r,t):null},betweenNarrow:function(e,t,n){const r=J(e,t);return r?X(r,n):null},getPreLine:function(e){return e.replace(/ +/g," ").replace(/^ /gm,"")},containsWord:Re,containsWords:function(e,t,n){return"any"===n?t.some((t=>Re(e,t))):t.every((t=>Re(e,t)))},joinUrl:We,getFuzzyMatchScore:K,sortByFuzzyScore:function(e,t){return e.filter((e=>K(e,t))).sort(((e,n)=>K(n,t)-K(e,t)))},splitOnce:Y,splitAll:ee,randomize:function(e,t=Math.random){return e.replace(/\{(.+?)\}/g,((e,n)=>l(n.split("|"),t)))},expand:function e(t){const n=t.match(/\{(.+?)\}/);if(!n||!n.index)return[t];const r=n[1].split(","),s=t.slice(0,n.index),a=t.slice(n.index+n[0].length);let o=[];for(const i of r){const t=e(s+i+a);o=o.concat(t)}return o},shrinkTrim:re,capitalize:se,decapitalize:ae,csvEscape:function(e){return e.match(/"|,/)?`"${e.replace(/"/g,'""')}"`:e},parseCsv:function(e,t=",",n='"'){const r=[];let s="",a=!1;const o=e.split("");for(const i of o)i!==t||a?i!==n||(s||a)&&!a?s+=i:a=!a:(r.push(s),s="");return r.push(s),r},surroundInOut:function(e,t){return t+e.split("").join(t)+t},getExtension:te,getBasename:ne,normalizeEmail:function(e){let[t,n]=e.split("@");t=re(t.replaceAll(".","").toLowerCase()).replaceAll(" ","");const[r]=t.split("+");if(!r||!n||-1===n.indexOf(".")||n.indexOf(".")===n.length-1)throw new Error("Invalid email");return n=re(n.toLowerCase()).replaceAll(" ",""),`${r}@${n}`},normalizeFilename:function(e){const t=ne(e),n=te(e);return n?`${t}.${n}`:t},parseFilename:function(e){const t=ne(e),n=te(e);return{basename:t,extension:n,filename:n?`${t}.${n}`:t}},camelToTitle:function(e){return se(e.replace(/([A-Z])/g," $1"))},slugToTitle:function(e){return e.split("-").map(se).join(" ")},slugToCamel:function(e){return ae(e.split("-").map(se).join(""))},joinHumanly:function(e,t=", ",n=" and "){return e&&e.length?1===e.length?e[0]:2===e.length?`${e[0]}${n}${e[1]}`:`${e.slice(0,e.length-1).join(t)}${n}${e[e.length-1]}`:""},findWeightedPair:be,extractBlock:we,extractAllBlocks:function(e,t){const n=[];let r=t.wordBoundary?pe(e,[`${t.opening} `,`${t.opening}\n`],t.start||0):e.indexOf(t.opening,t.start||0);for(;;){if(-1===r)return n;const s=we(e,{...t,start:r});if(!s)return n;n.push(s),r=t.wordBoundary?pe(e,[`${t.opening} `,`${t.opening}\n`],r+s.length):e.indexOf(t.opening,r+s.length)}},replaceBlocks:function(e,n,r){let s=0;for(;;){const a=t.DH.extractBlock(e,{...r,start:s});if(!a)return e;const o=n(a);s=e.indexOf(a,s)+o.length,e=e.replace(a,o)}},indexOfEarliest:pe,lastIndexOfBefore:ye,parseHtmlAttributes:function(e){const t={},n=e.match(/([a-z\-]+)="([^"]+)"/g);if(n)for(const r of n){const[e,n]=Y(r,"=");t[e]=n.slice(1,n.length-1)}return t},readNextWord:Ne,readWordsAfterAll:function(e,t,n=[]){const r=de(e,t),s=[];for(const a of r)s.push(Ne(e,a+t.length,n));return s},resolveVariables:function(e,t,n="$",r=":"){for(const s in t)e=Ie(e,s,t[s],n,r);return e=$e(e)},resolveVariableWithDefaultSyntax:Ie,resolveRemainingVariablesWithDefaults:$e,isLetter:oe,isDigit:ie,isLetterOrDigit:ce,isValidObjectPathCharacter:function(e){return ce(e)||"."===e||"["===e||"]"===e||"_"===e},insert:function(e,t,n,r,s){return e.slice(0,t)+r+e.slice(t,t+n)+s+e.slice(t+n)},indexOfRegex:fe,allIndexOf:de,lineMatches:he,linesMatchInOrder:function(e,t,n=!0){let r=0;for(const s of t){let t=!1;for(;!t&&r<e.length;)he(e[r],s,n)&&(t=!0),r++;if(!t)return!1}return!0},represent:function e(t,n="json",r=0){if(t&&E(t.represent)){const e=t.represent();if(O(e))return"json"===n&&0===r?JSON.stringify(e):e}if(g(t,!1)){if(r>1)return"[object Object]";if("json"===n){if(Array.isArray(t)){const n=t.map((t=>e(t,"json",r+1)));return 0===r?JSON.stringify(n):n}const n={};t.message&&(n.message=e(t.message,"json",r+1));for(const[s,a]of Object.entries(t))n[s]=e(a,"json",r+1);return 0===r?JSON.stringify(n):n}if("key-value"===n){const n=Object.keys(t);return t.message&&!n.includes("message")&&n.unshift("message"),n.map((n=>`${n}=${JSON.stringify(e(t[n],"json",r+1))}`)).join(" ")}}return w(t)&&(t="undefined"),0===r?JSON.stringify(t):t},resolveMarkdownLinks:function(e,t){let n=e.indexOf("](");for(;-1!==n;){const r=ye(e,"[",n),s=e.indexOf(")",n);if(-1!==r&&-1!==s){const[n,a]=e.slice(r+1,s).split("]("),o=t(n,a);e=e.slice(0,r)+o+e.slice(s+1)}n=e.indexOf("](",n+1)}return e},buildUrl:function(e,t,n){return We(e,t)+Be(n||{})},isChinese:function(e){return/^[\u4E00-\u9FA5]+$/.test(e)},replaceBetweenStrings:function(e,t,n,r,s=!0){const a=e.indexOf(t),o=e.indexOf(n,a+t.length);if(-1===a||-1===o)throw Error("Start or end not found");return s?e.substring(0,a+t.length)+r+e.substring(o):e.substring(0,a)+r+e.substring(o+n.length)},describeMarkdown:function(e){let t="p";return e.startsWith("#")?(t="h1",e=e.slice(1).trim()):e.startsWith("-")&&(t="li",e=e.slice(1).trim()),{type:t,isCapitalized:e[0]===e[0].toUpperCase(),hasPunctuation:/[.?!]$/.test(e),endsWithColon:/:$/.test(e)}},isBalanced:function(e,t="(",n=")"){let r=0,s=0;for(;s<e.length;)if(e.startsWith(t,s)?(r++,s+=t.length):e.startsWith(n,s)?(r--,s+=n.length):s++,r<0)return!1;return t===n?r%2==0:0===r},textToFormat:function(e){let t=(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).length;for(;(e=e.replace(/(\w+)[\s,']+\w+/g,"$1")).length!==t;)t=e.length;return e=(e=(e=e.replaceAll(/[A-Z][a-zA-Z0-9]*/g,"A")).replaceAll(/[a-z][a-zA-Z0-9]*/g,"a")).replaceAll(/[\u4E00-\u9FA5]+/g,"Z")},splitFormatting:function(e,t){const n=[];let r=0;for(;r<e.length;){const s=e.indexOf(t,r);if(-1===s){n.push({string:e.slice(r),symbol:null});break}const a=e.indexOf(t,s+t.length);if(s>r&&-1!==a&&n.push({string:e.slice(r,s),symbol:null}),-1===a){n.push({string:e.slice(r),symbol:null});break}n.push({string:e.slice(s+t.length,a),symbol:t}),r=a+t.length}return n},splitHashtags:function(e){const t=[];let n=0;for(;n<e.length;){const r=ge(e,n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const s=me(e,r+1);if(-1===s){t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r+1),symbol:"#"});break}r>n&&t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r+1,s),symbol:"#"}),n=s}return t},splitUrls:function(e){const t=[];let n=0;for(;n<e.length;){const r=pe(e,["http://","https://"],n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const s=pe(e,[" ","\n"],r);if(-1===s){r>n&&t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r),symbol:"http"});break}r>n&&t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r,s),symbol:"http"}),n=s}return t},route:function(e,t){const n=e.split("/").filter((e=>e)),r=t.split("/").filter((e=>e));if(n.length!==r.length)return null;const s={};for(let a=0;a<n.length;a++){const e=n[a];if(e.startsWith(":"))s[e.slice(1)]=r[a];else if(e!==r[a])return null}return s},explodeReplace:Se,generateVariants:function(e,n,r,s=Math.random){const a=t.DO.shuffle(n.map((e=>({variants:t.DO.shuffle(e.variants.map((e=>e)),s),avoid:e.avoid}))),s),o=[];for(const t of a){const n=t.variants.filter((e=>e!==t.avoid)),s=n.find((t=>e.includes(t)));if(s&&(z(o,Se(e,s,n)),o.length>=r))break}if(o.length<r)for(const t of a){const n=t.variants.find((t=>e.includes(t)));if(n&&(z(o,Se(e,n,t.variants)),o.length>=r))break}return o.slice(0,r)},replaceWord:function(e,t,n,r=!1){const s=new RegExp(r?`(?<=\\s|^)${t}(?=\\s|$)`:`\\b${t}\\b`,"g");return e.replace(s,n)},replacePascalCaseWords:function(e,t){return e.replace(/\b[A-Z][a-zA-Z0-9]*\b/g,(e=>e.toUpperCase()===e?e:t(e)))},stripHtml:function(e){return e.replace(/<[^>]*>/g,"")},breakLine:Ae,measureTextWidth:function(e,t={}){return[...e].reduce(((e,n)=>e+(t[n]||1)),0)},toLines:function(e,t,n={}){const r=[];let s="",a=0;for(let o=0;o<e.length;o++){const i=e[o];if(s+=i,a+=n[i]||1,a>t){const{line:e,rest:t}=Ae(s);r.push(e),s=t,a=t.split("").map((e=>n[e]||1)).reduce(((e,t)=>e+t),0)}}return s&&r.push(s),r},levenshteinDistance:function(e,t){const n=[];for(let r=0;r<=e.length;r++)n[r]=[r];for(let r=0;r<=t.length;r++)n[0][r]=r;for(let r=1;r<=e.length;r++)for(let s=1;s<=t.length;s++){const a=e[r-1]===t[s-1]?0:1;n[r][s]=Math.min(n[r-1][s]+1,n[r][s-1]+1,n[r-1][s-1]+a)}return n[e.length][t.length]},findCommonPrefix:Te,findCommonDirectory:function(e){const t=Te(e),n=t.lastIndexOf("/");return-1===n?"":t.slice(0,n+1)}},t.mW={asEqual:function(e,t){if(e!==t)throw Error(`Expected [${e}] to equal [${t}]`);return[e,t]},asTrue:function(e){if(!0!==e)throw Error(`Expected [true], got: [${e}]`);return e},asTruthy:function(e){if(!e)throw Error(`Expected truthy value, got: [${e}]`);return e},asFalse:function(e){if(!1!==e)throw Error(`Expected [false], got: [${e}]`);return e},asFalsy:function(e){if(e)throw Error(`Expected falsy value, got: [${e}]`);return e},asEither:function(e,t){if(!t.includes(e))throw Error(`Expected any of [${t.join(", ")}], got: [${e}]`);return e}},t.l2={get:async function(e,t,n){const r=Date.now(),s=Ge[e];if(s&&s.validUntil>r)return s.value;const a=await n(),o=r+t;return Ge[e]={value:a,validUntil:o},a},invalidate:function(e){delete Ge[e]}},t.Mi={addPoint:Jt,subtractPoint:function(e,t){return{x:e.x-t.x,y:e.y-t.y}},multiplyPoint:Zt,normalizePoint:function(e){const t=Math.sqrt(e.x*e.x+e.y*e.y);return{x:e.x/t,y:e.y/t}},pushPoint:Qt,filterCoordinates:en,findCorners:function(e,t,n,r){const s=[{x:0,y:0},{x:n,y:0},{x:0,y:r},{x:n,y:r}];for(let a=0;a<e.length;a++)for(let t=0;t<e[0].length;t++){const n=an(e,a,t);for(const e of n)s.some((t=>t.x===e.x&&t.y===e.y))||s.push(e)}return s.map((e=>({x:e.x*t,y:e.y*t})))},findLines:function(e,t){const n=en(e,((t,n)=>0===e[t][n]&&0!==e[t][n+1]),"row-first").map((e=>({...e,dx:1,dy:0}))),r=en(e,((t,n)=>0===e[t][n]&&0!==e[t][n-1]),"row-first").map((e=>({...e,dx:1,dy:0}))),s=en(e,((t,n)=>0===e[t][n]&&0!==e[t-1]?.[n]),"column-first").map((e=>({...e,dx:0,dy:1}))),a=en(e,((t,n)=>0===e[t][n]&&0!==e[t+1]?.[n]),"column-first").map((e=>({...e,dx:0,dy:1})));return n.forEach((e=>e.y++)),a.forEach((e=>e.x++)),[...ut([...s,...a],((e,t)=>e.x===t.x&&e.y-1===t.y)),...ut([...r,...n],((e,t)=>e.y===t.y&&e.x-1===t.x))].map((e=>({start:e[0],end:f(e)}))).map((e=>({start:Zt(e.start,t),end:Zt(Jt(e.end,{x:e.start.dx,y:e.start.dy}),t)})))},raycast:un,raycastCircle:function(e,t,n){const r=on(e,n),s=[];for(const a of r){const n=un(e,t,a-.001),r=un(e,t,a+.001);n&&s.push(n),r&&s.push(r)}return s},getLineIntersectionPoint:cn}},2909:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},7666:(e,t,n)=>{var r=null;"undefined"!=typeof WebSocket?r=WebSocket:"undefined"!=typeof MozWebSocket?r=MozWebSocket:void 0!==n.g?r=n.g.WebSocket||n.g.MozWebSocket:"undefined"!=typeof window?r=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(r=self.WebSocket||self.MozWebSocket),e.exports=r},5963:(e,t,n)=>{const r=n(9527),{MAX_LENGTH:s,MAX_SAFE_INTEGER:a}=n(7197),{safeRe:o,t:i}=n(3423),c=n(676),{compareIdentifiers:u}=n(9956);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>s)throw new TypeError(`version is longer than ${s} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?o[i.LOOSE]:o[i.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<a)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],s=e.prerelease[t];if(r("prerelease compare",t,n,s),void 0===n&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===n)return-1;if(n!==s)return u(n,s)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const n=this.build[t],s=e.build[t];if(r("build compare",t,n,s),void 0===n&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===n)return-1;if(n!==s)return u(n,s)}while(++t)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},5359:(e,t,n)=>{const r=n(5963);e.exports=(e,t)=>new r(e,t).major},7197:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},9527:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},9956:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const r=t.test(e),s=t.test(n);return r&&s&&(e=+e,n=+n),e===n?0:r&&!s?-1:s&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},676:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},3423:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:a}=n(7197),o=n(9527),i=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.t={};let f=0;const h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",a],[h,s]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),s=f++;o(e,s,t),l[e]=s,u[s]=t,i[s]=new RegExp(t,n?"g":void 0),c[s]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?`+`(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},6497:()=>{},4061:()=>{},7320:()=>{}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{BRANCHES:()=>Y,BZZ:()=>K,BatchId:()=>k,Bee:()=>gn,BeeArgumentError:()=>P,BeeDev:()=>yn,BeeError:()=>D,BeeModes:()=>J,BeeResponseError:()=>C,Bytes:()=>w,CHUNK_SIZE:()=>ee,DAI:()=>V,Duration:()=>W,EthAddress:()=>T,FEED_INDEX_HEX_LENGTH:()=>oe,FeedIndex:()=>j,Identifier:()=>R,MantarayNode:()=>an,MerkleTree:()=>d,NULL_ADDRESS:()=>xn,NULL_IDENTIFIER:()=>vn,NULL_OWNER:()=>Sn,NULL_STAMP:()=>En,NULL_TOPIC:()=>On,PSS_TARGET_HEX_LENGTH_MAX:()=>te,PeerAddress:()=>B,PrivateKey:()=>S,PublicKey:()=>A,RedundancyLevel:()=>ie,RedundancyStrategy:()=>ce,Reference:()=>N,SECTION_SIZE:()=>Q,STAMPS_DEPTH_MAX:()=>re,STAMPS_DEPTH_MIN:()=>ne,SUPPORTED_BEE_VERSION:()=>Ct,SUPPORTED_BEE_VERSION_EXACT:()=>Pt,SWARM_GATEWAY_URL:()=>wn,Signature:()=>L,Size:()=>Bt,Span:()=>$,Stamper:()=>bn,TAGS_LIMIT_MAX:()=>ae,TAGS_LIMIT_MIN:()=>se,Topic:()=>U,TransactionId:()=>I,Utils:()=>e,toBeeMode:()=>Z});var e={};n.r(e),n.d(e,{approximateOverheadForRedundancyLevel:()=>Un,getAmountForDuration:()=>Re,getCollectionSize:()=>mt,getDepthForSize:()=>Ne,getFolderSize:()=>fn,getRedundancyStat:()=>_n,getRedundancyStats:()=>Cn,getStampCost:()=>Ae,getStampDuration:()=>Te,getStampEffectiveBytes:()=>ve,getStampEffectiveBytesBreakpoints:()=>Se,getStampTheoreticalBytes:()=>Oe,getStampUsage:()=>Ee,makeCollectionFromFileList:()=>pt,makeMaxTarget:()=>An});var t=n(7020);t.DO,t.mW;const s=t.yI,a=(t.l2,t.AO),o=t.LQ,i=t.FQ,c=t.Rb,u=(t.Pagination,t.HC,t.o8,t.DH),l=t.iQ,f=t.Or,h=t.Xx,d=(t.Mi,t.Dj,t.AA,t.vU),p=t.ie,m=(t.dF,t.f7,t.O3),g=t.pp,y=(t.$i,t.g$,new TextDecoder),b=new TextEncoder;class w{constructor(e,t){if(e instanceof w?this.bytes=e.bytes:"string"==typeof e?this.bytes=s.hexToUint8Array(f.asHexString(e,{name:"Bytes#constructor(bytes)"})):e instanceof ArrayBuffer?this.bytes=new Uint8Array(e):this.bytes=e,this.length=this.bytes.length,t)if(Array.isArray(t)){if(!t.includes(this.length))throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t.join(" or ")}`)}else if(this.length!==t)throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t}`)}static keccak256(e){return new w(s.keccak256(new w(e).toUint8Array()))}static fromUtf8(e){return new w(b.encode(e))}static fromSlice(e,t,n){return new w(void 0===n?e.slice(t):e.slice(t,t+n))}offset(e){return new Uint8Array(this.bytes.slice(e))}toUint8Array(){return new Uint8Array(this.bytes)}toHex(){return s.uint8ArrayToHex(this.bytes)}toBase64(){return s.uint8ArrayToBase64(this.bytes)}toBase32(){return s.uint8ArrayToBase32(this.bytes)}toString(){return this.toHex()}toUtf8(){return y.decode(this.bytes)}toJSON(){return JSON.parse(this.toUtf8())}equals(e){return this.toHex()===new w(e).toHex()}represent(){return this.toHex()}}const E=250,O=251,x={[E]:"manifest",[O]:"feed"};const v=new TextEncoder;class S extends w{static LENGTH=32;constructor(e){super(e,32)}publicKey(){const[e,t]=o.privateKeyToPublicKey(s.uint256ToNumber(this.bytes,"BE"));return new A(s.concatBytes(s.numberToUint256(e,"BE"),s.numberToUint256(t,"BE")))}sign(e){const t=s.concatBytes(v.encode("Ethereum Signed Message:\n32"),s.keccak256(e instanceof Uint8Array?e:v.encode(e))),[n,r,a]=o.signMessage(t,s.uint256ToNumber(this.bytes,"BE"));return new L(s.concatBytes(s.numberToUint256(n,"BE"),s.numberToUint256(r,"BE"),new Uint8Array([Number(a)])))}}class A extends w{static LENGTH=64;constructor(e){const t=new w(e);if(33===t.length){const[e,n]=o.publicKeyFromCompressed(t.toUint8Array());super(s.concatBytes(s.numberToUint256(e,"BE"),s.numberToUint256(n,"BE")),64)}else super(e,64)}address(){const e=s.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=s.uint256ToNumber(this.bytes.slice(32,64),"BE");return new T(o.publicKeyToAddress([e,t]))}toCompressedUint8Array(){const e=s.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=s.uint256ToNumber(this.bytes.slice(32,64),"BE");return o.compressPublicKey([e,t])}toCompressedHex(){return s.uint8ArrayToHex(this.toCompressedUint8Array())}}class T extends w{static LENGTH=20;constructor(e){super(e,20)}toChecksum(){return o.checksumEncode(this.bytes)}}class R extends w{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new R(s.keccak256(v.encode(e)))}}class N extends w{static LENGTH=32;constructor(e){if("string"==typeof e&&e.startsWith("bah5")){const t=function(e){const t=s.base32ToUint8Array(e.toUpperCase().slice(1)),n=t[1];if(!x[n])throw new Error("Unknown codec");const r=new N(t.slice(-32));return{type:x[n],reference:r}}(e);super(t.reference.bytes,32)}else super(e,[32,64])}toCid(e){return function(e,t){e=new N(e);const n=new Uint8Array([1]),r=new Uint8Array(["feed"===t?251:250]),a=new Uint8Array([1]),o=new Uint8Array([27]),i=new Uint8Array([32]);return`b${s.uint8ArrayToBase32(s.concatBytes(n,r,a,o,i)).replace(/\=+$/,"")}${e.toBase32().replace(/\=+$/,"")}`.toLowerCase()}(this.bytes,e)}static isValid(e){try{return new N(e),!0}catch{return!1}}}class I extends w{static LENGTH=32;constructor(e){super(e,32)}}class $ extends w{static LENGTH=8;constructor(e){super(e,8)}static fromBigInt(e){return new $(s.numberToUint64(e,"LE"))}toBigInt(){return s.uint64ToNumber(this.bytes,"LE")}static fromSlice(e,t){return new $(e.slice(t,t+$.LENGTH))}}class B extends w{static LENGTH=32;constructor(e){super(e,32)}}class k extends w{static LENGTH=32;constructor(e){super(e,32)}}class L extends w{static LENGTH=65;constructor(e){super(e,65)}static fromSlice(e,t){return new L(e.slice(t,t+L.LENGTH))}recoverPublicKey(e){const t=s.uint256ToNumber(this.bytes.slice(0,32),"BE"),n=s.uint256ToNumber(this.bytes.slice(32,64),"BE"),r=BigInt(this.bytes[64]),[a,i]=o.recoverPublicKey(s.concatBytes(v.encode("Ethereum Signed Message:\n32"),s.keccak256(e instanceof Uint8Array?e:v.encode(e))),t,n,r);return new A(s.concatBytes(s.numberToUint256(a,"BE"),s.numberToUint256(i,"BE")))}isValid(e,t){return this.recoverPublicKey(e).address().equals(t)}}class U extends w{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new U(s.keccak256(v.encode(e)))}}const F=new Uint8Array(8).fill(255,0,8);class j extends w{static LENGTH=8;static MINUS_ONE=new j(F);constructor(e){super(e,8)}static fromBigInt(e){return new j(s.numberToUint64(e,"BE"))}toBigInt(){return s.uint64ToNumber(this.bytes,"BE")}next(){return s.equals(this.bytes,F)?j.fromBigInt(0n):j.fromBigInt(this.toBigInt()+1n)}}class D extends Error{constructor(e){super(e)}}class P extends D{constructor(e,t){super(e),this.value=t}}class C extends D{constructor(e,t,n,r,s,a){super(n),this.method=e,this.url=t,this.responseBody=r,this.status=s,this.statusText=a}}const _=4096;function M(e){const t=e.slice(0,$.LENGTH),n=function(e){if(e.length>_)throw new P(`payload size ${e.length} exceeds maximum chunk payload size 4096`,e);const t=new Uint8Array(_);return t.set(e),s.log2Reduce(s.partition(t,32),((e,t)=>s.keccak256(s.concatBytes(e,t))))}(e.slice($.LENGTH)),r=s.keccak256(s.concatBytes(t,n));return new N(r)}const q=4096,H=new TextEncoder;function z(e){if(e instanceof Uint8Array||(e=H.encode(e)),e.length<1||e.length>q)throw new RangeError(`payload size ${e.length} exceeds limits [1, 4096]`);const t=$.fromBigInt(BigInt(e.length)),n=s.concatBytes(t.toUint8Array(),e);return{data:n,span:t,payload:w.fromSlice(n,$.LENGTH),address:M(n)}}function G(e){if(e.length<1+$.LENGTH||e.length>q+$.LENGTH)throw new RangeError(`chunk size ${e.length} exceeds limits [${1+$.LENGTH}, ${$.LENGTH}]`);const t=$.fromSlice(e,0),n=s.concatBytes(t.toUint8Array(),e.slice($.LENGTH));return{data:n,span:t,payload:w.fromSlice(n,$.LENGTH),address:M(n)}}class W{constructor(e){if(this.seconds=Math.ceil(e),e<=0)throw Error("Duration must be greater than 0")}static fromMilliseconds(e){return new W(e/1e3)}static fromSeconds(e){return new W(e)}static fromHours(e){return new W(60*e*60)}static fromDays(e){return new W(24*e*60*60)}static fromWeeks(e){return new W(7*e*24*60*60)}static fromYears(e){return new W(365*e*24*60*60)}static fromEndDate(e,t){return new W((e.getTime()-(t??new Date).getTime())/1e3)}toSeconds(){return this.seconds}toHours(){return this.seconds/60/60}toDays(){return this.seconds/24/60/60}toWeeks(){return this.seconds/7/24/60/60}toYears(){return this.seconds/365/24/60/60}toEndDate(e){return new Date((e??new Date).getTime()+1e3*this.seconds)}represent(){return a.secondsToHumanTime(this.seconds)}}class K{static DIGITS=16;constructor(e){this.state=e}static fromDecimalString(e){return new K(p.fromDecimalString(e,K.DIGITS))}static fromPLUR(e){return new K(new p(e,K.DIGITS))}toPLURString(){return this.state.toString()}toPLURBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new K(this.state.add(e instanceof K?e.state:new p(e,K.DIGITS)))}minus(e){return new K(this.state.subtract(e instanceof K?e.state:new p(e,K.DIGITS)))}divide(e){return new K(this.state.divmod(e)[0])}gt(e){return 1===this.state.compare(e.state)}gte(e){return-1!==this.state.compare(e.state)}lt(e){return-1===this.state.compare(e.state)}lte(e){return 1!==this.state.compare(e.state)}eq(e){return 0===this.state.compare(e.state)}exchangeToDAI(e){return V.fromWei(this.state.exchange("*",new p(e.toWeiBigInt(),V.DIGITS),V.DIGITS).value)}}class V{static DIGITS=18;constructor(e){this.state=e}static fromDecimalString(e){return new V(p.fromDecimalString(e,V.DIGITS))}static fromWei(e){return new V(new p(e,V.DIGITS))}toWeiString(){return this.state.toString()}toWeiBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new V(this.state.add(e instanceof V?e.state:new p(e,V.DIGITS)))}minus(e){return new V(this.state.subtract(e instanceof V?e.state:new p(e,V.DIGITS)))}divide(e){return new V(this.state.divmod(e)[0])}gt(e){return 1===this.state.compare(e.state)}gte(e){return-1!==this.state.compare(e.state)}lt(e){return-1===this.state.compare(e.state)}lte(e){return 1!==this.state.compare(e.state)}eq(e){return 0===this.state.compare(e.state)}exchangeToBZZ(e){return K.fromPLUR(this.state.exchange("/",new p(e.toWeiBigInt(),V.DIGITS),K.DIGITS).value)}}var X=n(7320);let J=function(e){return e.FULL="full",e.LIGHT="light",e.ULTRA_LIGHT="ultra-light",e.DEV="dev",e}({});function Z(e){switch(e){case"full":return J.FULL;case"light":return J.LIGHT;case"ultra-light":return J.ULTRA_LIGHT;case"dev":return J.DEV;default:throw new Error(`Unknown Bee mode: ${e}`)}}const Q=32,Y=128,ee=Q*Y,te=4,ne=17,re=255,se=1,ae=1e3,oe=16;let ie=function(e){return e[e.OFF=0]="OFF",e[e.MEDIUM=1]="MEDIUM",e[e.STRONG=2]="STRONG",e[e.INSANE=3]="INSANE",e[e.PARANOID=4]="PARANOID",e}({}),ce=function(e){return e[e.NONE=0]="NONE",e[e.DATA=1]="DATA",e[e.PROX=2]="PROX",e[e.RACE=3]="RACE",e}({});function ue(e){if("function"==typeof File&&e instanceof File)return!0;const t=e;return"object"==typeof t&&"string"==typeof t.name&&("function"==typeof t.stream||"function"==typeof t.arrayBuffer)}function le(e){return void 0!==X.Readable&&e instanceof X.Readable}function fe(e,t){return"bigint"==typeof e&&(e=e.toString()),f.asIntegerString(e,t)}function he(e){const t=f.asObject(e,{name:"DownloadOptions"});return{redundancyStrategy:f.asOptional((e=>f.asInteger(e,{name:"redundancyStrategy"})),t.redundancyStrategy),fallback:f.asOptional((e=>f.asBoolean(e,{name:"fallback"})),t.fallback),timeoutMs:f.asOptional((e=>f.asInteger(e,{name:"timeoutMs",min:0})),t.timeoutMs),actPublisher:f.asOptional((e=>new A(e)),t.actPublisher),actHistoryAddress:f.asOptional((e=>new N(e)),t.actHistoryAddress),actTimestamp:f.asOptional((e=>f.asNumber(e,{name:"actTimestamp"})),t.actTimestamp)}}function de(e,t="UploadOptions"){const n=f.asObject(e,{name:t});return{act:f.asOptional((e=>f.asBoolean(e,{name:"act"})),n.act),actHistoryAddress:f.asOptional((e=>new N(e)),n.actHistoryAddress),deferred:f.asOptional((e=>f.asBoolean(e,{name:"deferred"})),n.deferred),encrypt:f.asOptional((e=>f.asBoolean(e,{name:"encrypt"})),n.encrypt),pin:f.asOptional((e=>f.asBoolean(e,{name:"pin"})),n.pin),tag:f.asOptional((e=>f.asInteger(e,{name:"tag",min:0})),n.tag)}}function pe(e){const t=de(e,"CollectionUploadOptions"),n=f.asObject(e,{name:"CollectionUploadOptions"});return{...t,errorDocument:f.asOptional((e=>f.asString(e,{name:"errorDocument"})),n.errorDocument),indexDocument:f.asOptional((e=>f.asString(e,{name:"indexDocument"})),n.indexDocument),redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),n.redundancyLevel)}}function me(e){const t=f.asObject(e,{name:"PostageBatchOptions"});return{gasPrice:f.asOptional((e=>fe(e,{name:"gasPrice"})),t.gasPrice),immutableFlag:f.asOptional((e=>f.asBoolean(e,{name:"immutableFlag"})),t.immutableFlag),label:f.asOptional((e=>f.asString(e,{name:"label"})),t.label),waitForUsable:f.asOptional((e=>f.asBoolean(e,{name:"waitForUsable"})),t.waitForUsable),waitForUsableTimeout:f.asOptional((e=>f.asInteger(e,{name:"waitForUsableTimeout",min:0})),t.waitForUsableTimeout)}}function ge(e,t="TransactionOptions"){const n=f.asObject(e,{name:t});return{gasLimit:f.asOptional((e=>fe(e,{name:"gasLimit",min:0n})),n.gasLimit),gasPrice:f.asOptional((e=>fe(e,{name:"gasPrice",min:0n})),n.gasPrice)}}function ye(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new TypeError("Data must be either string or Uint8Array!")}function be(e){if(null==e)throw new TypeError(`Expected number | Tag | string from tagUid, got: ${e}`);if(function(e){try{const t=f.asObject(e,{name:"Tag"});return f.asInteger(t.uid,{name:"Tag.uid"}),!0}catch{return!1}}(e))return e.uid;if("number"==typeof e||"string"==typeof e)return f.asNumber(e,{name:"tagUid",min:0});throw new TypeError(`Expected number | Tag | string from tagUid, got: ${e}`)}const we=.9;function Ee(e,t,n){return e/Math.pow(2,t-n)}function Oe(e){return 4096*2**e}const xe=[[17,4089e-8],[18,.00609],[19,.10249],[20,.62891],[21,2.38],[22,7.07],[23,18.24],[24,43.04],[25,96.5],[26,208.52],[27,435.98],[28,908.81],[29,1870],[30,3810],[31,7730],[32,15610],[33,31430],[34,63150]];function ve(e){if(e<17)return 0;const t=xe.find((([t,n])=>{if(e===t)return n}));return t?1e3*t[1]*1e3*1e3:Math.ceil(Oe(e)*we)}function Se(){const e=new Map;for(let t=17;t<35;t++)e.set(t,ve(t));return e}function Ae(e,t){return K.fromPLUR(2n**BigInt(e)*BigInt(t))}function Te(e,t,n){const r=BigInt(fe(e));return W.fromSeconds(Number(r*BigInt(n)/BigInt(t)))}function Re(e,t,n){return BigInt(e.toSeconds())/BigInt(n)*BigInt(t)+1n}function Ne(e){for(const[t,n]of xe)if(e.toBytes()<=1e3*n*1e3*1e3)return t;return 35}function Ie(e){return function(e,t,n,r){if(65!==e.length)throw Error("invalid signature length");if(32!==t.length)throw Error("invalid batch ID length");if(8!==n.length)throw Error("invalid timestamp length");if(8!==r.length)throw Error("invalid index length");return new w(s.concatBytes(t,r,n,e))}(e.signature,e.batchId.toUint8Array(),e.timestamp,e.index)}function $e(e){return{name:function(e){if(!e)throw new D("missing content-disposition header");const t=e.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);if(t&&t.length>0)return t[1];throw new D("invalid content-disposition header")}(e["content-disposition"]),tagUid:function(e){if(!e)return;return parseInt(e,10)}(e["swarm-tag-uid"]),contentType:e["content-type"]||void 0}}function Be(e,t){const n={};if(!function(e){if(!f.isObject(e))return!1;const t=e;return void 0!==t.issuer&&void 0!==t.index&&void 0!==t.signature&&void 0!==t.timestamp&&void 0!==t.batchId}(e)?e&&(e=new k(e),n["swarm-postage-batch-id"]=e.toHex()):n["swarm-postage-stamp"]=Ie(e).toHex(),!t)return n;const r=f.asObject(t);return r.size&&(n["content-length"]=String(r.size)),r.contentType&&(n["content-type"]=String(r.contentType)),r.redundancyLevel&&(n["swarm-redundancy-level"]=String(r.redundancyLevel)),f.isBoolean(r.act)&&(n["swarm-act"]=String(r.act)),f.isBoolean(r.pin)&&(n["swarm-pin"]=String(r.pin)),f.isBoolean(r.encrypt)&&(n["swarm-encrypt"]=r.encrypt.toString()),r.tag&&(n["swarm-tag"]=String(r.tag)),f.isBoolean(r.deferred)&&(n["swarm-deferred-upload"]=r.deferred.toString()),r.redundancyStrategy&&(n["swarm-redundancy-strategy"]=String(r.redundancyStrategy)),f.isBoolean(r.fallback)&&(n["swarm-redundancy-fallback-mode"]=r.fallback.toString()),r.timeoutMs&&(n["swarm-chunk-retrieval-timeout"]=String(r.timeoutMs)),r.indexDocument&&(n["swarm-index-document"]=String(r.indexDocument)),r.errorDocument&&(n["swarm-error-document"]=String(r.errorDocument)),r.actPublisher&&(n["swarm-act-publisher"]=new A(r.actPublisher).toCompressedHex()),r.actHistoryAddress&&(n["swarm-act-history-address"]=new N(r.actHistoryAddress).toHex()),r.actTimestamp&&(n["swarm-act-timestamp"]=String(r.actTimestamp)),(r.actPublisher||r.actHistoryAddress||r.actTimestamp)&&(n["swarm-act"]="true"),r.gasPrice&&(n["gas-price"]=String(r.gasPrice)),r.gasLimit&&(n["gas-limit"]=String(r.gasLimit)),n}var ke=n(8266),Le=n.n(ke);const{AxiosError:Ue}=Le(),Fe=a.minutes(1)/200,je={headers:{accept:"application/json, text/plain, */*"},maxBodyLength:1/0,maxContentLength:1/0};async function De(e,t){const n=c.deepMerge3(je,t,e);if(n.data&&"undefined"!=typeof Buffer&&Buffer.isBuffer(n.data)&&(n.data=n.data.buffer),n.params){const e=Object.keys(n.params);for(const t of e){void 0===n.params[t]&&delete n.params[t]}}let r=0;for(;r<1e5;)try{Pe(e,n);return await Le()(n)}catch(s){if(!(s instanceof Ue))throw s;if("ECONNABORTED"!==s.code||!e.endlesslyRetry)throw new C(t.method||"get",t.url||"<unknown>",s.message,s.response?.data,s.response?.status,s.code);r++,await l.sleepMillis(r<Fe?200:1e3)}throw Error("Max number of failed attempts reached")}function Pe(e,t){e.onRequest&&e.onRequest({method:t.method||"GET",url:u.joinUrl(t.baseURL,t.url),headers:{...t.headers},params:t.params})}const Ce="chunks";async function _e(e,t,n){t=new N(t);const r=await De(e,{responseType:"arraybuffer",url:`${Ce}/${t}`,headers:Be(null,n)});return new Uint8Array(r.data)}const Me=R.LENGTH,qe=Me+L.LENGTH,He=qe+$.LENGTH;function ze(e,t){e=e instanceof w?e.toUint8Array():e,t=new N(t);const n=function(e){const t=M(e.slice(qe)),n=L.fromSlice(e,Me),r=w.fromSlice(e,0,R.LENGTH),a=s.concatBytes(r.toUint8Array(),t.toUint8Array());return n.recoverPublicKey(a).address()}(e),r=w.fromSlice(e,0,R.LENGTH),a=new N(s.keccak256(s.concatBytes(r.toUint8Array(),n.toUint8Array())));if(!s.equals(t.toUint8Array(),a.toUint8Array()))throw new D("SOC Data does not match given address!");return{data:e,identifier:r,signature:L.fromSlice(e,Me),span:$.fromSlice(e,qe),payload:w.fromSlice(e,He),address:a,owner:n}}function Ge(e,t){return new N(s.keccak256(s.concatBytes(e.toUint8Array(),t.toUint8Array())))}function We(e,t,n){const r=Ge(t=new R(t),(n=new S(n)).publicKey().address()),a=n.sign(s.concatBytes(t.toUint8Array(),e.address.toUint8Array()));return{data:s.concatBytes(t.toUint8Array(),a.toUint8Array(),e.data),identifier:t,signature:a,span:$.fromSlice(e.data,0),payload:w.fromSlice(e.data,$.LENGTH),address:r,owner:n.publicKey().address()}}async function Ke(e,t,n,r){const a=s.concatBytes(t.span.toUint8Array(),t.payload.toUint8Array());return async function(e,t,n,r,s,a,o){const i=await De(e,{method:"post",url:`soc/${t}/${n}`,data:s,headers:{"content-type":"application/octet-stream",...Be(a,o)},responseType:"json",params:{sig:r.toHex()}}),c=f.asObject(i.data,{name:"response.data"});return{reference:new N(f.asHexString(c.reference)),tagUid:i.headers["swarm-tag"]?be(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?h.of(new N(i.headers["swarm-act-history-address"])):h.empty()}}(e,t.owner,t.identifier,t.signature,a,n,r)}async function Ve(e,t,n,r,s,a){t=new S(t),r=new R(r);return Ke(e,We(z(s),r,t),n,a)}async function Xe(e,t,n){const r=Ge(n=new R(n),t=new T(t));return ze(await _e(e,r.toHex()),r)}const Je="bytes";async function Ze(e,t,n,r){const s=await De(e,{url:Je,method:"post",responseType:"json",data:t,headers:{"content-type":"application/octet-stream",...Be(n,r)}}),a=f.asObject(s.data,{name:"response.data"});return{reference:new N(f.asHexString(a.reference)),tagUid:s.headers["swarm-tag"]?be(s.headers["swarm-tag"]):void 0,historyAddress:s.headers["swarm-act-history-address"]?h.of(new N(s.headers["swarm-act-history-address"])):h.empty()}}async function Qe(e,t,n){n&&(n=he(n));const r=await De(e,{responseType:"arraybuffer",url:`${Je}/${t}`,headers:Be(null,n)});return new w(r.data)}const Ye="feeds";function et(e){const t=e["swarm-feed-index"],n=e["swarm-feed-index-next"];if(!t)throw new D("Response did not contain expected swarm-feed-index!");if(!n)throw new D("Response did not contain expected swarm-feed-index-next!");return{feedIndex:new j(t),feedIndexNext:new j(n)}}async function tt(e,t,n,r){const s=await De(e,{responseType:"arraybuffer",url:`${Ye}/${t}/${n}`,params:r});return{payload:new w(s.data),...et(s.headers)}}class nt{constructor(e){this.raw=e}toString(){return f.isString(this.raw)&&this.raw.includes(".eth")?this.raw:new N(this.raw).toHex()}}function rt(e,t){return t="number"==typeof t?j.fromBigInt(BigInt(t)):t,new R(s.keccak256(s.concatBytes(e.toUint8Array(),t.toUint8Array())))}async function st(e,t,n){try{const r=await tt(e,t,n);if(!r.feedIndexNext)throw Error("Feed index next is not defined. This should happen when fetching an exact index.");return r.feedIndexNext}catch(r){if(r instanceof C)return j.fromBigInt(0n);throw r}}async function at(e,t,n,r,s,a){const o=rt(n,a?.index??await st(e,t.publicKey().address(),n));if(r.length>4096){const n=await Ze(e,r,s,a);return async function(e,t,n,r,s,a){return t=new S(t),r=new R(r),Ke(e,We(G(s),r,t),n,a)}(e,t,s,o,await _e(e,n.reference),a)}return Ve(e,t,s,o,f.isString(r)?w.fromUtf8(r).toUint8Array():r,a)}function ot(e,t,n){const r=rt(t,n);return new N(s.keccak256(s.concatBytes(r.toUint8Array(),e.toUint8Array())))}async function it(e,t,n,r,a=!1){const o=ot(t,n,r="number"==typeof r?j.fromBigInt(BigInt(r)):r),i=ze(await _e(e,o.toHex()),o);let c=h.empty();if(a){const e=w.fromSlice(i.payload.toUint8Array(),0,8);c=h.of(Number(s.uint64ToNumber(e.toUint8Array(),"BE")))}return{timestamp:c,payload:new w(i.payload.offset(a?8:0))}}async function ct(e,t,n,r){const s=ot(t,n,r="number"==typeof r?j.fromBigInt(BigInt(r)):r);return G((await _e(e,s)).slice(R.LENGTH+L.LENGTH))}function ut(e,t,n){const r=async r=>{if(void 0===r?.index)return tt(e,n,t);const s=await it(e,n,t,r.index,r.hasTimestamp??!0),a="number"==typeof r.index?j.fromBigInt(BigInt(r.index)):r.index;return{payload:s.payload,feedIndex:a,feedIndexNext:a.next()}};return{download:r,downloadPayload:async r=>{if(void 0===r?.index)return tt(e,n,t);const s=await ct(e,n,t,r.index),a=s.span.toBigInt()<=4096n?s.payload:await Qe(e,new nt(s.address)),o="number"==typeof r.index?j.fromBigInt(BigInt(r.index)):r.index;return{payload:a,feedIndex:o,feedIndexNext:o.next()}},downloadReference:async s=>{let a=s?.index;void 0===a&&(a=(await async function(e,t,n){return et((await De(e,{responseType:"arraybuffer",url:`${Ye}/${t}/${n}`,params:{"Swarm-Only-Root-Chunk":!0}})).headers)}(e,n,t)).feedIndex);const o=await r({...s,index:a});return{reference:new N(o.payload.toUint8Array()),feedIndex:o.feedIndex,feedIndexNext:o.feedIndexNext??o.feedIndex.next()}},owner:n,topic:t}}function lt(e,t,n){const r=async(r,a,o)=>async function(e,t,n,r,a,o){r=new N(r);const i=rt(n,o?.index??await st(e,t.publicKey().address(),n)),c=o?.at??Date.now()/1e3,u=s.numberToUint64(BigInt(Math.floor(c)),"BE");return Ve(e,t,a,i,s.concatBytes(u,r.toUint8Array()),o)}(e,n,t,a,r,o);return{...ut(e,t,n.publicKey().address()),upload:r,uploadReference:r,uploadPayload:async(r,s,a)=>at(e,n,t,s,r,a)}}async function ft(e,t,n,r,s,a){const o=function(e,t,n){const r=n.toBigInt(),s=[];for(let a=0n;a<=r;a++)s.push(ot(e,t,j.fromBigInt(a)));return s}(t,n,r).map((async t=>async function(e,t,n,r){try{return await e.downloadChunk(t,n,r),!0}catch(s){const e=c.getDeep(s,"status");if(404===e||500===e)return!1;throw s}}(e,t,s,a)));return(await Promise.all(o)).every((e=>e))}function ht(e){if(!function(e){return!!Array.isArray(e)&&e.every((e=>"object"==typeof e&&e.path&&void 0!==e.size))}(e))throw new P("invalid collection",e)}function dt(e){if(e.webkitRelativePath&&""!==e.webkitRelativePath)return e.webkitRelativePath.replace(/.*?\//i,"");if(e.name)return e.name;throw new TypeError("file is not valid File object")}function pt(e){return Array.from(e).map((e=>({path:dt(e),size:e.size,file:e})))}function mt(e){return Array.from(e).reduce(((e,t)=>e+t.size),0)}class gt{output=new X.PassThrough;currentFileSize=0;beginFile(e,t){if(e.length>100)throw new Error(`File name too long: ${e}`);const n=function(e,t){const n=Buffer.alloc(512,0);n.write(e.slice(0,100).padEnd(100,"\0"),0,100),n.write("0000777\0",100,8),n.write("0001750\0",108,8),n.write("0001750\0",116,8),n.write(t.toString(8).padStart(11,"0")+"\0",124,12);const r=Math.floor((new Date).getTime()/1e3);n.write(r.toString(8).padStart(11,"0")+"\0",136,12),n.write(" ",148,8),n.write("0",156,1),n.write("ustar\0\0",257,8);let s=0;for(let a=0;a<512;a++)s+=n[a];return n.write(s.toString(8).padStart(6,"0")+"\0 ",148,8),n}(e,t);this.output.write(n),this.currentFileSize=0}async appendFile(e){return new Promise((t=>{this.output.write(e)?t():this.output.once("drain",(()=>{t()})),this.currentFileSize+=e.length}))}async endFile(){const e=this.currentFileSize%512==0?0:512-this.currentFileSize%512;e>0&&this.output.write(Buffer.alloc(e,0))}async end(){return new Promise((e=>{this.output.write(Buffer.alloc(1024,0)),this.output.end((()=>{e()}))}))}}var yt=n(6497),bt=n.n(yt);async function wt(e,t,n,r){const s=new gt,a=De(e,{method:"post",url:"bzz",data:s.output,responseType:"json",headers:{"content-type":"application/x-tar","swarm-collection":"true",...Be(n,r)}});await async function(e,t){for(const n of e)if(t.beginFile(n.path,n.size),n.fsPath){const e=(0,yt.createReadStream)(n.fsPath);for await(const n of e)await t.appendFile(n);await t.endFile(),e.close()}else{if(!n.file)throw new Error("Invalid collection item");await t.appendFile(new Uint8Array(await n.file.arrayBuffer())),await t.endFile()}}(t,s),await s.end();return await a}const Et="bzz";async function Ot(e,t,n,r,s){le(t)&&!s?.contentType&&(s||(s={}),s.contentType="application/octet-stream");const a=await De(e,{method:"post",url:Et,data:t,headers:Be(n,s),params:{name:r},responseType:"json"}),o=f.asObject(a.data,{name:"response.data"});return{reference:new N(f.asHexString(o.reference)),tagUid:a.headers["swarm-tag"]?be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?h.of(new N(a.headers["swarm-act-history-address"])):h.empty()}}async function xt(e,t,n,r){ht(t);const s=await wt(e,t,n,r),a=f.asObject(s.data,{name:"response.data"});return{reference:new N(f.asHexString(a.reference)),tagUid:s.headers["swarm-tag"]?be(s.headers["swarm-tag"]):void 0,historyAddress:s.headers["swarm-act-history-address"]?h.of(new N(s.headers["swarm-act-history-address"])):h.empty()}}const vt="balances",St="consumed";const At="chequebook";async function Tt(e,t){const n=await De(e,{url:At+`/cashout/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),uncashedAmount:K.fromPLUR(fe(r.uncashedAmount,{name:"uncashedAmount"})),transactionHash:f.asNullableString(r.transactionHash),lastCashedCheque:f.asNullable((e=>Rt(e)),r.lastCashedCheque),result:f.asNullable((e=>function(e){const t=f.asObject(e,{name:"cashout result"});return{recipient:f.asString(t.recipient,{name:"recipient"}),lastPayout:K.fromPLUR(fe(t.lastPayout,{name:"lastPayout"})),bounced:f.asBoolean(t.bounced,{name:"bounced"})}}(e)),r.result)}}function Rt(e){const t=f.asObject(e,{name:"cheque"});return{beneficiary:new T(f.asString(t.beneficiary,{name:"beneficiary"})),chequebook:new T(f.asString(t.chequebook,{name:"chequebook"})),payout:K.fromPLUR(fe(t.payout,{name:"payout"}))}}function Nt(e,t){const n=f.asObject(e,{name:t});return n.disconnectedPeers||(n.disconnectedPeers=[]),n.connectedPeers||(n.connectedPeers=[]),{population:f.asNumber(n.population,{name:"population"}),connected:f.asNumber(n.connected,{name:"connected"}),connectedPeers:f.asArray(n.connectedPeers,{name:"connectedPeers"}).map((e=>({address:f.asString(f.asObject(e,{name:"connectedPeer"}).address,{name:"address"})}))),disconnectedPeers:f.asArray(n.disconnectedPeers,{name:"disconnectedPeers"}).map((e=>({address:f.asString(f.asObject(e,{name:"disconnectedPeer"}).address,{name:"address"})})))}}const It="settlements";const $t="stake";class Bt{constructor(e){if(this.bytes=Math.ceil(e),e<0)throw Error("Size must be at least 0")}static fromBytes(e){return new Bt(e)}static fromKilobytes(e){return new Bt(1e3*e)}static fromMegabytes(e){return new Bt(1e3*e*1e3)}static fromGigabytes(e){return new Bt(1e3*e*1e3*1e3)}toBytes(){return this.bytes}toGigabytes(){return this.bytes/1e3/1e3/1e3}toFormattedString(){return i.convertBytes(this.bytes,1e3)}represent(){return this.toFormattedString()}}function kt(e){return Number.isInteger(e)?e<1?1:e>315569260?315569260:e:1}const Lt="stamps";async function Ut(e){const t=await De(e,{method:"get",url:"batches",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.batches,{name:"batches"}).map((e=>f.asObject(e,{name:"batch"}))).map((e=>({batchID:new k(f.asString(e.batchID,{name:"batchID"})),batchTTL:f.asNumber(e.batchTTL,{name:"batchTTL"}),bucketDepth:f.asNumber(e.bucketDepth,{name:"bucketDepth"}),depth:f.asNumber(e.depth,{name:"depth"}),immutable:f.asBoolean(e.immutable,{name:"immutable"}),owner:new T(f.asString(e.owner,{name:"owner"})),start:f.asNumber(e.start,{name:"start"}),value:fe(e.value,{name:"value"})})))}async function Ft(e){const t=await De(e,{method:"get",url:`${Lt}`,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.stamps,{name:"stamps"}).map((e=>f.asObject(e,{name:"stamp"}))).map((e=>{const t=f.asNumber(e.utilization,{name:"utilization"}),n=f.asNumber(e.depth,{name:"depth"}),r=f.asNumber(e.bucketDepth,{name:"bucketDepth"}),s=Ee(t,n,r),a=kt(f.asNumber(e.batchTTL,{name:"batchTTL"})),o=W.fromSeconds(a);return{batchID:new k(f.asString(e.batchID,{name:"batchID"})),utilization:t,usable:f.asBoolean(e.usable,{name:"usable"}),label:f.asEmptiableString(e.label,{name:"label"}),depth:n,amount:fe(e.amount,{name:"amount"}),bucketDepth:r,blockNumber:f.asNumber(e.blockNumber,{name:"blockNumber"}),immutableFlag:f.asBoolean(e.immutableFlag,{name:"immutableFlag"}),usage:s,usageText:`${Math.round(100*s)}%`,size:Bt.fromBytes(ve(n)),remainingSize:Bt.fromBytes(Math.ceil(ve(n)*(1-s))),theoreticalSize:Bt.fromBytes(Oe(n)),duration:o}}))}var jt=n(5359),Dt=n.n(jt);const Pt="2.4.0-390a402e",Ct=Pt.split("-")[0],_t="7.2.0";async function Mt(e){const t=await De(e,{method:"get",url:"health",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{apiVersion:f.asString(n.apiVersion,{name:"apiVersion"}),version:f.asString(n.version,{name:"version"}),status:f.asString(n.status,{name:"status"})}}const qt="transactions";function Ht(e){const t=f.asObject(e,{name:"transaction"});return{transactionHash:new I(f.asString(t.transactionHash,{name:"transactionHash"})),to:f.asString(t.to,{name:"to"}),nonce:f.asNumber(t.nonce,{name:"nonce"}),gasPrice:fe(t.gasPrice,{name:"gasPrice"}),gasLimit:f.asNumber(t.gasLimit,{name:"gasLimit"}),data:f.asString(t.data,{name:"data"}),created:f.asString(t.created,{name:"created"}),description:f.asString(t.description,{name:"description"}),value:fe(t.value,{name:"value"})}}const zt="grantee";var Gt=n(7666),Wt=n.n(Gt);const Kt="gsoc";const Vt="pins";const Xt="pss";async function Jt(e,t,n,r,s,a){await De(e,{method:"post",url:`${Xt}/send/${t}/${n}`,data:r,responseType:"json",params:{recipient:a},headers:Be(s)})}async function Zt(e){await De(e,{url:""})}const Qt="stewardship";const Yt="tags";const en=new TextEncoder,tn=new TextDecoder,nn=new Uint8Array([47]),rn=s.hexToUint8Array("5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b");class sn{constructor(e,t){this.prefix=e,this.node=t}static split(e,t){const n=s.commonPrefix(e.prefix,t.prefix);if(n.length===e.prefix.length){const r=t.prefix.slice(n.length);return t.node.path=t.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),t.node.parent=e.node,e.node.forks.set(r[0],t),e}if(n.length===t.prefix.length){const r=e.prefix.slice(n.length);return e.node.path=e.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),e.node.parent=t.node,t.node.forks.set(r[0],e),t}const r=new an({path:n}),a=new sn(e.prefix.slice(n.length),e.node),o=new sn(t.prefix.slice(n.length),t.node);return e.node.path=e.prefix.slice(n.length),t.node.path=t.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),r.forks.set(a.prefix[0],a),r.forks.set(o.prefix[0],o),a.node.parent=r,o.node.parent=r,new sn(n,r)}marshal(){if(!this.node.selfAddress)throw Error("Fork#marshal node.selfAddress is not set");const e=[];if(e.push(new Uint8Array([this.node.determineType()])),e.push(s.numberToUint8(this.prefix.length)),e.push(this.prefix),this.prefix.length<30&&e.push(new Uint8Array(30-this.prefix.length)),e.push(this.node.selfAddress),this.node.metadata){const t=s.padEndToMultiple(new Uint8Array([0,0,...en.encode(JSON.stringify(this.node.metadata))]),32,10),n=s.numberToUint16(t.length-2,"BE");t.set(n,0),e.push(t)}return s.concatBytes(...e)}static unmarshal(e){const t=s.uint8ToNumber(e.read(1)),n=s.uint8ToNumber(e.read(1)),r=e.read(n);e.read(30-n);const a=e.read(32);let o;if(function(e,t){return(e&t)===t}(t,16)){const t=s.uint16ToNumber(e.read(2),"BE");o=JSON.parse(tn.decode(e.read(t)))}return new sn(r,new an({selfAddress:a,metadata:o,path:r}))}}class an{obfuscationKey=new Uint8Array(32);selfAddress=null;targetAddress=new Uint8Array(32);metadata=null;path=new Uint8Array(0);forks=new Map;parent=null;constructor(e){e?.targetAddress&&(this.targetAddress=e.targetAddress),e?.selfAddress&&(this.selfAddress=e.selfAddress),e?.metadata&&(this.metadata=e.metadata),e?.obfuscationKey&&(this.obfuscationKey=e.obfuscationKey),e?.path&&(this.path=e.path),e?.parent&&(this.parent=e.parent)}get fullPath(){return s.concatBytes(this.parent?.fullPath??new Uint8Array(0),this.path)}get fullPathString(){return tn.decode(this.fullPath)}getRootMetadata(){const e=this.find("/");return e&&e.metadata?h.of(e.metadata):h.empty()}getDocsMetadata(){const e=this.find("/");return e&&e.metadata?{indexDocument:e.metadata["website-index-document"]??null,errorDocument:e.metadata["website-error-document"]??null}:{indexDocument:null,errorDocument:null}}async resolveFeed(e,t){const n=this.find("/");if(!n||!n.metadata)return h.empty();const r=n.metadata["swarm-feed-owner"],s=n.metadata["swarm-feed-topic"];return r&&s?h.of(await e.fetchLatestFeedUpdate(s,r,t)):h.empty()}async marshal(){for(const s of this.forks.values())s.node.selfAddress||(s.node.selfAddress=(await s.node.calculateSelfAddress()).toUint8Array());const e=new Uint8Array(32);e.set(rn,0),e.set(s.equals(this.targetAddress,xn)&&s.equals(this.path,new Uint8Array([47]))?s.numberToUint8(0):s.numberToUint8(this.targetAddress.length),31);const t=new Uint8Array(32);for(const a of this.forks.keys())s.setBit(t,a,1,"LE");const n=[];for(let a=0;a<256;a++)s.getBit(t,a,"LE")&&n.push(this.forks.get(a).marshal());const r=s.xorCypher(s.concatBytes(e,s.equals(this.targetAddress,xn)&&s.equals(this.path,new Uint8Array([47]))?new Uint8Array(0):this.targetAddress,t,...n),this.obfuscationKey);return s.concatBytes(this.obfuscationKey,r)}static async unmarshal(e,t,n,r){t=new N(t);const s=(await e.downloadData(t,n,r)).toUint8Array();return this.unmarshalFromData(s,t.toUint8Array())}static unmarshalFromData(e,t){const n=e.subarray(0,32),r=s.xorCypher(e.subarray(32),n),a=new g(r),o=a.read(31);if(!s.equals(o,rn.slice(0,31)))throw new Error("MantarayNode#unmarshal invalid version hash");const i=s.uint8ToNumber(a.read(1)),c=0===i?xn:a.read(i),u=new an({selfAddress:t,targetAddress:c,obfuscationKey:n}),l=a.read(32);for(let f=0;f<256;f++)if(s.getBit(l,f,"LE")){const e=sn.unmarshal(a);u.forks.set(f,e),e.node.parent=u}return u}addFork(e,t,n){this.selfAddress=null,e=e instanceof Uint8Array?e:en.encode(e);let r=this;for(;e.length;){const s=e.slice(0,30),a=0===(e=e.slice(30)).length,[o,i]=r.findClosest(s),c=s.slice(i.length);if(i.length&&(r=o),!c.length)continue;const u=new sn(c,new an({targetAddress:a?new N(t).toUint8Array():void 0,metadata:a?n:void 0,path:c})),l=o.forks.get(c[0]);if(l){const e=sn.split(u,l);r.forks.set(c[0],e),e.node.parent=r,r.selfAddress=null,r=u.node}else r.forks.set(c[0],u),u.node.parent=r,r.selfAddress=null,r=u.node}}removeFork(e){if(this.selfAddress=null,0===(e=e instanceof Uint8Array?e:en.encode(e)).length)throw Error("MantarayNode#removeFork [path] parameter cannot be empty");const t=this.find(e);if(!t)throw Error("MantarayNode#removeFork fork not found");const[n,r]=this.findClosest(e.slice(0,e.length-1));n.forks.delete(e.slice(r.length)[0]);for(const a of t.forks.values())n.addFork(s.concatBytes(t.path,a.prefix),a.node.targetAddress,a.node.metadata)}async calculateSelfAddress(){return this.selfAddress?new N(this.selfAddress):new N((await d.root(await this.marshal())).hash())}async saveRecursively(e,t,n,r){for(const a of this.forks.values())await a.node.saveRecursively(e,t,n,r);const s=await e.uploadData(t,await this.marshal(),n,r);return this.selfAddress=s.reference.toUint8Array(),s}async loadRecursively(e,t,n){for(const r of this.forks.values()){if(!r.node.selfAddress)throw Error("MantarayNode#loadRecursively fork.node.selfAddress is not set");const s=await an.unmarshal(e,r.node.selfAddress,t,n);r.node.targetAddress=s.targetAddress,r.node.forks=s.forks,r.node.path=r.prefix,r.node.parent=this,await r.node.loadRecursively(e,t,n)}}find(e){const[t,n]=this.findClosest(e);return n.length===e.length?t:null}findClosest(e,t=new Uint8Array){if(0===(e=e instanceof Uint8Array?e:en.encode(e)).length)return[this,t];const n=this.forks.get(e[0]);return n&&s.commonPrefix(n.prefix,e).length===n.prefix.length?n.node.findClosest(e.slice(n.prefix.length),s.concatBytes(t,n.prefix)):[this,t]}collect(e=[]){for(const t of this.forks.values())s.equals(t.node.targetAddress,xn)||e.push(t.node),t.node.collect(e);return e}collectAndMap(){const e=this.collect(),t={};for(const n of e)t[n.fullPathString]=new N(n.targetAddress).toHex();return t}determineType(){let e=0;return s.equals(this.targetAddress,xn)&&!s.equals(this.path,nn)||(e|=2),this.forks.size>0&&(e|=4),-1===s.indexOf(this.path,nn)||s.equals(this.path,nn)||(e|=8),this.metadata&&(e|=16),e}}var on=n(4061),cn=n.n(on);async function un(e){if("string"!=typeof e)throw new TypeError("dir has to be string!");if(""===e)throw new TypeError("dir must not be empty string!");return ln(e,"")}async function ln(e,t){const n=cn().join(e,t),r=await bt().promises.opendir(n);let s=[];for await(const a of r){const n=cn().join(e,t,a.name),r=cn().join(t,a.name);a.isFile()?s.push({path:r,size:(await bt().promises.stat(n)).size,fsPath:n}):a.isDirectory()&&(s=[...await ln(e,r),...s])}return s}async function fn(e){if("string"!=typeof e)throw new TypeError("dir has to be string!");if(""===e)throw new TypeError("dir must not be empty string!");const t=await bt().promises.opendir(e);let n=0;for await(const r of t)if(r.isFile()){n+=(await bt().promises.stat(cn().join(e,r.name))).size}else r.isDirectory()&&(n+=await fn(cn().join(e,r.name)));return n}const hn={aac:"audio/aac",abw:"application/x-abiword",ai:"application/postscript",arc:"application/octet-stream",avi:"video/x-msvideo",azw:"application/vnd.amazon.ebook",bin:"application/octet-stream",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",css:"text/css",csv:"text/csv",doc:"application/msword",dll:"application/octet-stream",dmg:"application/x-apple-diskimage",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gif:"image/gif",htm:"text/html",html:"text/html",ico:"image/x-icon",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/javascript",json:"application/json",mid:"audio/midi",midi:"audio/midi",mp2:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpkg:"application/vnd.apple.installer+xml",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",otf:"font/otf",png:"image/png",pdf:"application/pdf",ppt:"application/vnd.ms-powerpoint",rar:"application/x-rar-compressed",rtf:"application/rtf",sh:"application/x-sh",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",ts:"application/typescript",ttf:"font/ttf",txt:"text/plain",vsd:"application/vnd.visio",wav:"audio/x-wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xlsx:"application/vnd.ms-excel",xml:"application/xml",xul:"application/vnd.mozilla.xul+xml",zip:"application/zip","3gp":"video/3gpp","3gp2":"video/3gpp2","7z":"application/x-7z-compressed"};function dn(e){return["text/html","text/css"].includes(e)?`${e}; charset=utf-8`:e}async function pn(e){if("string"==typeof e)return(new TextEncoder).encode(e);if(e instanceof Buffer)return new Uint8Array(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(t=e,Array.isArray(t)&&t.length>0&&t.every((e=>e instanceof Buffer)))return new Uint8Array(Buffer.concat(e));var t;throw new TypeError("unknown websocket data type")}function mn(e){if(!function(e){try{if("string"!=typeof e)return!1;const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(t){return!1}}(e))throw new P("URL is not valid!",e)}class gn{constructor(e,t){mn(e),this.url=function(e){return e.endsWith("/")?e.slice(0,-1):e}(e),t?.signer&&(this.signer=new S(t.signer)),this.network=t?.network??"gnosis",this.requestOptions={baseURL:this.url,timeout:t?.timeout??0,headers:t?.headers,onRequest:t?.onRequest,httpAgent:t?.httpAgent,httpsAgent:t?.httpsAgent}}async uploadData(e,t,n,r){return e=new k(e),ye(t),n&&(n=function(e,t="UploadOptions"){const n=de(e,t),r=f.asObject(e,{name:t});return{...n,redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),r.redundancyLevel)}}(n)),Ze(this.getRequestOptionsForCall(r),t,e,n)}async probeData(e,t){return e=new N(e),async function(e,t){t=new N(t);const n=await De(e,{url:`${Je}/${t}`,method:"head",responseType:"json"});return{contentLength:parseInt(n.headers["content-length"])}}(this.getRequestOptionsForCall(t),e)}async downloadData(e,t,n){return t&&(t=he(t)),Qe(this.getRequestOptionsForCall(n),new nt(e),t)}async downloadReadableData(e,t,n){return t&&(t=he(t)),async function(e,t,n){return n&&(n=he(n)),(await De(e,{responseType:"stream",url:`${Je}/${t}`,headers:Be(null,n)})).data}(this.getRequestOptionsForCall(n),new nt(e),t)}async uploadChunk(e,t,n,r){if(t=t instanceof Uint8Array?t:t.data,n&&(n=de(n)),t.length<$.LENGTH)throw new P(`Chunk has to have size of at least ${$.LENGTH}.`,t);if(t.length>ee+$.LENGTH)throw new P(`Chunk has to have size of at most ${ee+$.LENGTH}.`,t);return async function(e,t,n,r){const s=await De(e,{method:"post",url:`${Ce}`,data:t,headers:{"content-type":"application/octet-stream",...Be(n,r)},responseType:"json"}),a=f.asObject(s.data,{name:"response.data"});return{reference:new N(f.asString(a.reference,{name:"reference"})),tagUid:s.headers["swarm-tag"]?be(s.headers["swarm-tag"]):void 0,historyAddress:s.headers["swarm-act-history-address"]?h.of(new N(s.headers["swarm-act-history-address"])):h.empty()}}(this.getRequestOptionsForCall(r),t,e,n)}async downloadChunk(e,t,n){return e=new N(e),t&&(t=he(t)),_e(this.getRequestOptionsForCall(n),e,t)}async createGrantees(e,t,n){return e=new k(e),t=t.map((e=>new A(e))),async function(e,t,n){const r=await De(e,{method:"post",url:zt,data:{grantees:n.map((e=>e.toCompressedHex()))},headers:Be(t),responseType:"json"}),s=f.asObject(r.data,{name:"response.data"});return{status:r.status,statusText:r.statusText,ref:new N(f.asString(s.ref,{name:"ref"})),historyref:new N(f.asString(s.historyref,{name:"historyref"}))}}(this.getRequestOptionsForCall(n),e,t)}async getGrantees(e,t){return async function(e,t){const n=await De(t,{method:"get",url:`${zt}/${e}`,responseType:"json"}),r=f.asArray(n.data,{name:"response.data"}).map((e=>new A(f.asString(e,{name:"grantee"}))));return{status:n.status,statusText:n.statusText,grantees:r}}(e=new N(e),this.getRequestOptionsForCall(t))}async patchGrantees(e,t,n,r,s){return async function(e,t,n,r,s){const a=await De(s,{method:"patch",url:`${zt}/${t}`,data:{add:r.add?.map((e=>e.toCompressedHex())),revoke:r.revoke?.map((e=>e.toCompressedHex()))},headers:{...Be(e),"swarm-act-history-address":n.toHex()},responseType:"json"}),o=f.asObject(a.data,{name:"response.data"});return{status:a.status,statusText:a.statusText,ref:new N(f.asString(o.ref,{name:"ref"})),historyref:new N(f.asString(o.historyref,{name:"historyref"}))}}(e=new k(e),t=new N(t),n=new N(n),{add:r.add?.map((e=>new A(e)))??[],revoke:r.revoke?.map((e=>new A(e)))??[]},this.getRequestOptionsForCall(s))}async uploadFile(e,t,n,r,s){if(e=new k(e),function(e){if(!("string"==typeof e||e instanceof Uint8Array||ue(e)||le(e)))throw new TypeError("Data must be either string, Readable, Uint8Array or File!")}(t),r&&(r=function(e){const t=de(e,"FileUploadOptions"),n=f.asObject(e,{name:"FileUploadOptions"});return{...t,size:f.asOptional((e=>f.asInteger(e,{name:"size",min:0})),n.size),contentType:f.asOptional((e=>f.asString(e,{name:"contentType"})),n.contentType),redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),n.redundancyLevel)}}(r)),n&&"string"!=typeof n)throw new TypeError("name has to be string or undefined!");if(ue(t)){const a=await async function(e){return e.arrayBuffer?e.arrayBuffer():new Promise((t=>{const n=new FileReader;n.onload=()=>t(n.result),n.readAsArrayBuffer(e)}))}(t),o=n??t.name,i={contentType:t.type,...r};return Ot(this.getRequestOptionsForCall(s),a,e,o,i)}return Ot(this.getRequestOptionsForCall(s),t,e,n,r)}async downloadFile(e,t="",n,r){return n&&(n=he(n)),async function(e,t,n="",r){const s=await De(e,{method:"GET",responseType:"arraybuffer",url:`${Et}/${t}/${n}`,headers:Be(null,r)});return{...$e(s.headers),data:new w(s.data)}}(this.getRequestOptionsForCall(r),new nt(e),t,n)}async downloadReadableFile(e,t="",n,r){return e=new N(e),n&&(n=he(n)),async function(e,t,n="",r){t=new N(t);const s=await De(e,{method:"GET",responseType:"stream",url:`${Et}/${t}/${n}`,headers:Be(null,r)});return{...$e(s.headers),data:s.data}}(this.getRequestOptionsForCall(r),e,t,n)}async uploadFiles(e,t,n,r){e=new k(e),n&&(n=pe(n));const s=pt(t);return xt(this.getRequestOptionsForCall(r),s,e,n)}async hashDirectory(e){return async function(e){const t=await un(e),n=new an;for(const r of t){const e=new d(d.NOOP);if(!r.fsPath)throw Error("File does not have fsPath, which should never happen in node. Please report this issue.");const t=(0,yt.createReadStream)(r.fsPath);for await(const n of t)await e.append(n);const s=await e.finalize(),{filename:a,extension:o}=u.parseFilename(r.path);n.addFork(r.path,s.hash(),{"Content-Type":dn(hn[o.toLowerCase()]||"application/octet-stream"),Filename:a})}return n.calculateSelfAddress()}(e)}async streamDirectory(e,t,n,r,s){return async function(e,t,n,r,s,a){const o=new m(64,64);let i=0,c=0;n=new k(n);const l=await un(t);for(const u of l)i+=(f=u.size,function e(t){return t<=1?t:t+e(Math.ceil(t/128))}(Math.ceil(f/4096)));var f;async function h(t){await o.enqueue((async()=>{await e.uploadChunk(n,t.build(),s,a),r?.({total:i,processed:++c})}))}const p=new an;for(const m of l){if(!m.fsPath)throw Error("File does not have fsPath, which should never happen in node. Please report this issue.");const e=(0,yt.createReadStream)(m.fsPath),t=new d(h);for await(const a of e)await t.append(a);const n=await t.finalize();await o.drain();const{filename:r,extension:s}=u.parseFilename(m.path);p.addFork(m.path,n.hash(),{"Content-Type":dn(hn[s.toLowerCase()]||"application/octet-stream"),Filename:r}),"index.html"===m.path&&p.addFork("/",xn,{"website-index-document":"index.html"})}return p.saveRecursively(e,n,s,a)}(this,t,e=new k(e),n,r,this.getRequestOptionsForCall(s))}async streamFiles(e,t,n,r,s){return e=new k(e),async function(){throw new Error("Streaming files is not supported in Node.js")}(0,0,0,0,0,this.getRequestOptionsForCall(s))}async uploadCollection(e,t,n,r){return e=new k(e),ht(t),n&&(n=pe(n)),xt(this.getRequestOptionsForCall(r),t,e,n)}async uploadFilesFromDirectory(e,t,n,r){e=new k(e),n&&(n=pe(n));const s=await un(t);return xt(this.getRequestOptionsForCall(r),s,e,n)}async createTag(e){return async function(e){const t=await De(e,{method:"post",url:Yt,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{address:f.asEmptiableString(n.address,{name:"address"}),seen:f.asNumber(n.seen,{name:"seen"}),sent:f.asNumber(n.sent,{name:"sent"}),split:f.asNumber(n.split,{name:"split"}),startedAt:f.asString(n.startedAt,{name:"startedAt"}),stored:f.asNumber(n.stored,{name:"stored"}),synced:f.asNumber(n.synced,{name:"synced"}),uid:f.asNumber(n.uid,{name:"uid"})}}(this.getRequestOptionsForCall(e))}async getAllTags(e,t){return e&&(e=function(e){const t=f.asObject(e,{name:"AllTagsOptions"});return{limit:f.asOptional((e=>f.asInteger(e,{name:"limit",min:se,max:ae})),t.limit),offset:f.asOptional((e=>f.asInteger(e,{name:"offset",min:0})),t.offset)}}(e)),async function(e,t,n){const r=await De(e,{url:Yt,params:{offset:t,limit:n},responseType:"json"}),s=f.asObject(r.data,{name:"response.data"});return f.asArray(s.tags,{name:"tags"}).map((e=>f.asObject(e,{name:"tag"}))).map((e=>({address:f.asEmptiableString(e.address,{name:"address"}),seen:f.asNumber(e.seen,{name:"seen"}),sent:f.asNumber(e.sent,{name:"sent"}),split:f.asNumber(e.split,{name:"split"}),startedAt:f.asString(e.startedAt,{name:"startedAt"}),stored:f.asNumber(e.stored,{name:"stored"}),synced:f.asNumber(e.synced,{name:"synced"}),uid:f.asNumber(e.uid,{name:"uid"})})))}(this.getRequestOptionsForCall(t),e?.offset,e?.limit)}async retrieveTag(e,t){return e=be(e),async function(e,t){const n=await De(e,{url:`${Yt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{address:f.asEmptiableString(r.address,{name:"address"}),seen:f.asNumber(r.seen,{name:"seen"}),sent:f.asNumber(r.sent,{name:"sent"}),split:f.asNumber(r.split,{name:"split"}),startedAt:f.asString(r.startedAt,{name:"startedAt"}),stored:f.asNumber(r.stored,{name:"stored"}),synced:f.asNumber(r.synced,{name:"synced"}),uid:f.asNumber(r.uid,{name:"uid"})}}(this.getRequestOptionsForCall(t),e)}async deleteTag(e,t){return e=be(e),async function(e,t){await De(e,{method:"delete",url:`${Yt}/${t}`})}(this.getRequestOptionsForCall(t),e)}async updateTag(e,t,n){return t=new N(t),e=be(e),async function(e,t,n){await De(e,{method:"patch",url:`${Yt}/${t}`,data:{reference:n}})}(this.getRequestOptionsForCall(n),e,t)}async pin(e,t){return e=new N(e),async function(e,t){await De(e,{method:"post",responseType:"json",url:`${Vt}/${t}`})}(this.getRequestOptionsForCall(t),e)}async unpin(e,t){return e=new N(e),async function(e,t){await De(e,{method:"delete",responseType:"json",url:`${Vt}/${t}`})}(this.getRequestOptionsForCall(t),e)}async getAllPins(e){return async function(e){const t=await De(e,{method:"get",responseType:"json",url:`${Vt}`}),n=f.asObject(t.data,{name:"response.data"});return null===n.references?[]:f.asArray(n.references,{name:"references"}).map((e=>f.asString(e,{name:"reference"}))).map((e=>new N(e)))}(this.getRequestOptionsForCall(e))}async getPin(e,t){return e=new N(e),async function(e,t){const n=await De(e,{method:"get",responseType:"json",url:`${Vt}/${t}`}),r=f.asObject(n.data,{name:"response.data"});return{reference:new N(f.asString(r.reference,{name:"reference"}))}}(this.getRequestOptionsForCall(t),e)}async reuploadPinnedData(e,t,n){e=new k(e),t=new N(t),await async function(e,t,n){await De(e,{method:"put",url:`${Qt}/${n}`,headers:{"swarm-postage-batch-id":t.toHex()}})}(this.getRequestOptionsForCall(n),e,t)}async isReferenceRetrievable(e,t){return e=new N(e),async function(e,t){t=new N(t);const n=await De(e,{method:"get",responseType:"json",url:`${Qt}/${t}`}),r=f.asObject(n.data,{name:"response.data"});return f.asBoolean(r.isRetrievable,{name:"isRetrievable"})}(this.getRequestOptionsForCall(t),e)}async isFeedRetrievable(e,t,n,r,s){if(e=new T(e),t=new U(t),r&&(r=he(r)),!n)try{return await this.makeFeedReader(t,e,s).download(),!0}catch(a){const e=c.getDeep(a,"status");if(404===e||500===e)return!1;throw a}return ft(this,e,t,n,r,this.getRequestOptionsForCall(s))}async pssSend(e,t,n,r,s,a){return e=new k(e),ye(r),s?(s=new A(s),Jt(this.getRequestOptionsForCall(a),t,n,r,e,s)):Jt(this.getRequestOptionsForCall(a),t,n,r,e)}pssSubscribe(e,t){t=function(e){const t=f.asObject(e,{name:"PssMessageHandler"});return{onMessage:f.asFunction(t.onMessage,{name:"onMessage"}),onError:f.asFunction(t.onError,{name:"onError"})}}(t);const n=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===l.whereAmI()?new(Wt())(`${r}/${Xt}/subscribe/${t.toHex()}`):new(Wt())(`${r}/${Xt}/subscribe/${t.toHex()}`,{headers:n})}(this.url,e,this.requestOptions.headers);let r=!1;const s={topic:e,cancel:()=>{!1===r&&(r=!0,n.terminate?n.terminate():n.close())}};return n.onmessage=async e=>{const n=await pn(e.data);n.length&&t.onMessage(new w(n),s)},n.onerror=e=>{r||t.onError(new D(e.message),s)},s}async pssReceive(e,t=0){if("number"!=typeof t)throw new TypeError("timeoutMsc parameter has to be a number!");return new Promise(((n,r)=>{let s;const a=this.pssSubscribe(e,{onError:e=>{clearTimeout(s),a.cancel(),r(e.message)},onMessage:e=>{clearTimeout(s),a.cancel(),n(e)}});t>0&&(s=setTimeout((()=>{a.cancel(),r(new D("pssReceive timeout"))}),t))}))}gsocMine(e,t,n=12){e=new B(e),t=new R(t);for(let r=0n;r<0xffffn;r++){const a=new S(s.numberToUint256(2867n+r,"BE")),o=Ge(t,a.publicKey().address());if(256-s.proximity(o.toUint8Array(),e.toUint8Array(),256)<=256-n)return a}throw Error("Could not mine a valid signer")}async gsocSend(e,t,n,r,s,a){e=new k(e),t=new S(t),n=new R(n);const o=We(z(r),n,t);return async function(e,t,n,r){return Ke(e,t,n,r)}(this.getRequestOptionsForCall(a),o,e,s)}gsocSubscribe(e,t,n){e=new T(e),t=new R(t),n=function(e){const t=f.asObject(e,{name:"GsocMessageHandler"});return{onMessage:f.asFunction(t.onMessage,{name:"onMessage"}),onError:f.asFunction(t.onError,{name:"onError"})}}(n);const r=Ge(t,e),s=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===l.whereAmI()?new(Wt())(`${r}/${Kt}/subscribe/${t.toHex()}`):new(Wt())(`${r}/${Kt}/subscribe/${t.toHex()}`,{headers:n})}(this.url,r,this.requestOptions.headers);let a=!1;const o={address:e,cancel:()=>{!1===a&&(a=!0,s.terminate?s.terminate():s.close())}};return s.onmessage=async e=>{const t=await pn(e.data);t.length&&n.onMessage(new w(t),o)},s.onerror=e=>{a||n.onError(new D(e.message),o)},o}async createFeedManifest(e,t,n,r,s){return e=new k(e),t=new U(t),n=new T(n),r&&(r=de(r)),async function(e,t,n,r,s){const a=await De(e,{method:"post",responseType:"json",url:`${Ye}/${t}/${n}`,headers:Be(r,s)}),o=f.asObject(a.data,{name:"response.data"});return new N(f.asHexString(o.reference))}(this.getRequestOptionsForCall(s),n,t,e,r)}makeFeedReader(e,t,n){return e=new U(e),t=new T(t),ut(this.getRequestOptionsForCall(n),e,t)}makeFeedWriter(e,t,n){if(e=new U(e),!(t=t?new S(t):this.signer))throw Error("No signer provided");return lt(this.getRequestOptionsForCall(n),e,t)}async fetchLatestFeedUpdate(e,t,n){return e=new U(e),t=new T(t),tt(this.getRequestOptionsForCall(n),t,e)}makeSOCReader(e,t){return{owner:e=new T(e),download:Xe.bind(null,this.getRequestOptionsForCall(t),e)}}makeSOCWriter(e,t){if(!(e=e?new S(e):this.signer))throw Error("No signer provided");return{...this.makeSOCReader(e.publicKey().address(),t),upload:Ve.bind(null,this.getRequestOptionsForCall(t),e)}}async createEnvelope(e,t,n){return e=new k(e),t=new N(t),async function(e,t,n){const r=await De(e,{method:"post",responseType:"json",url:`envelope/${n}`,headers:{"swarm-postage-batch-id":t.toHex()}}),a=f.asObject(r.data,{name:"response.data"});return{issuer:s.hexToUint8Array(f.asHexString(a.issuer,{name:"issuer",byteLength:20})),index:s.hexToUint8Array(f.asHexString(a.index,{name:"index",byteLength:8})),timestamp:s.hexToUint8Array(f.asHexString(a.timestamp,{name:"timestamp",byteLength:8})),signature:s.hexToUint8Array(f.asHexString(a.signature,{name:"signature",byteLength:65})),batchId:t}}(this.getRequestOptionsForCall(n),e,t)}async rchash(e,t,n,r){return async function(e,t,n,r){const s=await De(e,{responseType:"json",url:`rchash/${t}/${n}/${r}`}),a=f.asObject(s.data,{name:"response.data"});return f.asNumber(a.durationSeconds,{name:"durationSeconds"})}(this.getRequestOptionsForCall(r),e,t,n)}async checkConnection(e){return Zt(this.getRequestOptionsForCall(e))}async isConnected(e){try{await Zt(this.getRequestOptionsForCall(e))}catch(t){return!1}return!0}async getNodeAddresses(e){return async function(e){const t=await De(e,{url:"addresses",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{overlay:new B(f.asString(n.overlay,{name:"overlay"})),underlay:f.asArray(n.underlay,{name:"underlay"}).map((e=>f.asString(e,{name:"underlay"}))),ethereum:new T(f.asString(n.ethereum,{name:"ethereum"})),publicKey:new A(f.asString(n.publicKey,{name:"publicKey"})),pssPublicKey:new A(f.asString(n.pssPublicKey,{name:"pssPublicKey"}))}}(this.getRequestOptionsForCall(e))}async getBlocklist(e){return async function(e){return(await De(e,{url:"blocklist",responseType:"json"})).data.peers}(this.getRequestOptionsForCall(e))}async getPeers(e){return async function(e){const t=await De(e,{url:"peers",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.peers,{name:"peers"}).map((e=>({address:f.asString(f.asObject(e,{name:"peer"}).address,{name:"address"}),fullNode:f.asBoolean(f.asObject(e,{name:"peer"}).fullNode,{name:"fullNode"})})))}(this.getRequestOptionsForCall(e))}async removePeer(e,t){return e=new B(e),async function(e,t){return(await De(e,{url:`peers/${t}`,responseType:"json",method:"DELETE"})).data}(this.getRequestOptionsForCall(t),e)}async getTopology(e){return async function(e){const t=await De(e,{url:"topology",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"}),r=f.asObject(n.bins,{name:"bins"});return{baseAddr:f.asString(n.baseAddr,{name:"baseAddr"}),population:f.asNumber(n.population,{name:"population"}),connected:f.asNumber(n.connected,{name:"connected"}),timestamp:f.asString(n.timestamp,{name:"timestamp"}),nnLowWatermark:f.asNumber(n.nnLowWatermark,{name:"nnLowWatermark"}),depth:f.asNumber(n.depth,{name:"depth"}),reachability:f.asString(n.reachability,{name:"reachability"}),networkAvailability:f.asString(n.networkAvailability,{name:"networkAvailability"}),bins:{bin_0:Nt(r.bin_0,"bin_0"),bin_1:Nt(r.bin_1,"bin_1"),bin_2:Nt(r.bin_2,"bin_2"),bin_3:Nt(r.bin_3,"bin_3"),bin_4:Nt(r.bin_4,"bin_4"),bin_5:Nt(r.bin_5,"bin_5"),bin_6:Nt(r.bin_6,"bin_6"),bin_7:Nt(r.bin_7,"bin_7"),bin_8:Nt(r.bin_8,"bin_8"),bin_9:Nt(r.bin_9,"bin_9"),bin_10:Nt(r.bin_10,"bin_10"),bin_11:Nt(r.bin_11,"bin_11"),bin_12:Nt(r.bin_12,"bin_12"),bin_13:Nt(r.bin_13,"bin_13"),bin_14:Nt(r.bin_14,"bin_14"),bin_15:Nt(r.bin_15,"bin_15"),bin_16:Nt(r.bin_16,"bin_16"),bin_17:Nt(r.bin_17,"bin_17"),bin_18:Nt(r.bin_18,"bin_18"),bin_19:Nt(r.bin_19,"bin_19"),bin_20:Nt(r.bin_20,"bin_20"),bin_21:Nt(r.bin_21,"bin_21"),bin_22:Nt(r.bin_22,"bin_22"),bin_23:Nt(r.bin_23,"bin_23"),bin_24:Nt(r.bin_24,"bin_24"),bin_25:Nt(r.bin_25,"bin_25"),bin_26:Nt(r.bin_26,"bin_26"),bin_27:Nt(r.bin_27,"bin_27"),bin_28:Nt(r.bin_28,"bin_28"),bin_29:Nt(r.bin_29,"bin_29"),bin_30:Nt(r.bin_30,"bin_30"),bin_31:Nt(r.bin_31,"bin_31")}}}(this.getRequestOptionsForCall(e))}async pingPeer(e,t){return e=new B(e),async function(e,t){return(await De(e,{url:`pingpong/${t}`,responseType:"json",method:"POST"})).data}(this.getRequestOptionsForCall(t),e)}async getAllBalances(e){return async function(e){const t=await De(e,{url:vt,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{balances:f.asArray(n.balances,{name:"balances"}).map((e=>f.asObject(e,{name:"balance"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),balance:K.fromPLUR(fe(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPeerBalance(e,t){return e=new B(e),async function(e,t){const n=await De(e,{url:`${vt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:K.fromPLUR(fe(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getPastDueConsumptionBalances(e){return async function(e){const t=await De(e,{url:St,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{balances:f.asArray(n.balances,{name:"balances"}).map((e=>f.asObject(e,{name:"balance"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),balance:K.fromPLUR(fe(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPastDueConsumptionPeerBalance(e,t){return e=new B(e),async function(e,t){const n=await De(e,{url:`${St}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:K.fromPLUR(fe(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getChequebookAddress(e){return async function(e){const t=await De(e,{url:At+"/address",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{chequebookAddress:f.asString(n.chequebookAddress,{name:"chequebookAddress"})}}(this.getRequestOptionsForCall(e))}async getChequebookBalance(e){return async function(e){const t=await De(e,{url:At+"/balance",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{availableBalance:K.fromPLUR(fe(n.availableBalance,{name:"availableBalance"})),totalBalance:K.fromPLUR(fe(n.totalBalance,{name:"totalBalance"}))}}(this.getRequestOptionsForCall(e))}async getLastCheques(e){return async function(e){const t=await De(e,{url:At+"/cheque",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{lastcheques:f.asArray(n.lastcheques,{name:"lastcheques"}).map((e=>f.asObject(e,{name:"lastcheque"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),lastreceived:f.asNullable((e=>Rt(e)),e.lastreceived),lastsent:f.asNullable((e=>Rt(e)),e.lastsent)})))}}(this.getRequestOptionsForCall(e))}async getLastChequesForPeer(e,t){return e=new B(e),async function(e,t){const n=await De(e,{url:At+`/cheque/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),lastreceived:f.asNullable((e=>Rt(e)),r.lastreceived),lastsent:f.asNullable((e=>Rt(e)),r.lastsent)}}(this.getRequestOptionsForCall(t),e)}async getLastCashoutAction(e,t){return e=new B(e),Tt(this.getRequestOptionsForCall(t),e)}async cashoutLastCheque(e,t,n){return e=new B(e),t&&ge(t),async function(e,t,n){const r=await De(e,{method:"post",url:At+`/cashout/${t}`,responseType:"json",headers:Be(null,n)}),s=f.asObject(r.data,{name:"response.data"});return new I(f.asString(s.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,t)}async depositTokens(e,t,n){const r=e instanceof K?e.toPLURString():fe(e,{min:1n,name:"amount"});let s;return t&&(s=fe(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const s=await De(e,{method:"post",url:At+"/deposit",responseType:"json",params:{amount:t.toString(10)},headers:r}),a=f.asObject(s.data,{name:"response.data"});return new I(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),r,s)}async withdrawTokens(e,t,n){const r=e instanceof K?e.toPLURString():fe(e,{min:1n,name:"amount"});let s;return t&&(s=fe(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const s=await De(e,{method:"post",url:At+"/withdraw",responseType:"json",params:{amount:t.toString(10)},headers:r}),a=f.asObject(s.data,{name:"response.data"});return new I(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),r,s)}async getSettlements(e,t){return e=new B(e),async function(e,t){const n=await De(e,{url:`${It}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),sent:K.fromPLUR(fe(r.sent,{name:"sent"})),received:K.fromPLUR(fe(r.received,{name:"received"}))}}(this.getRequestOptionsForCall(t),e)}async getAllSettlements(e){return async function(e){const t=await De(e,{url:It,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{totalSent:K.fromPLUR(fe(n.totalSent,{name:"totalSent"})),totalReceived:K.fromPLUR(fe(n.totalReceived,{name:"totalReceived"})),settlements:f.asArray(n.settlements,{name:"settlements"}).map((e=>f.asObject(e,{name:"settlement"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),sent:K.fromPLUR(fe(e.sent,{name:"sent"})),received:K.fromPLUR(fe(e.received,{name:"received"}))})))}}(this.getRequestOptionsForCall(e))}async getStatus(e){return async function(e){const t=await De(e,{method:"get",url:"status",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{overlay:f.asString(n.overlay,{name:"overlay"}),proximity:f.asNumber(n.proximity,{name:"proximity"}),beeMode:Z(f.asString(n.beeMode,{name:"beeMode"})),reserveSize:f.asNumber(n.reserveSize,{name:"reserveSize"}),reserveSizeWithinRadius:f.asNumber(n.reserveSizeWithinRadius,{name:"reserveSizeWithinRadius"}),pullsyncRate:f.asNumber(n.pullsyncRate,{name:"pullsyncRate"}),storageRadius:f.asNumber(n.storageRadius,{name:"storageRadius"}),connectedPeers:f.asNumber(n.connectedPeers,{name:"connectedPeers"}),neighborhoodSize:f.asNumber(n.neighborhoodSize,{name:"neighborhoodSize"}),batchCommitment:f.asNumber(n.batchCommitment,{name:"batchCommitment"}),isReachable:f.asBoolean(n.isReachable,{name:"isReachable"}),lastSyncedBlock:f.asNumber(n.lastSyncedBlock,{name:"lastSyncedBlock"}),committedDepth:f.asNumber(n.committedDepth,{name:"committedDepth"})}}(this.getRequestOptionsForCall(e))}async getHealth(e){return Mt(this.getRequestOptionsForCall(e))}async getReadiness(e){return async function(e){const t=await De(e,{method:"get",url:"readiness"}),n=f.asObject(t.data,{name:"response.data"});return{apiVersion:f.asString(n.apiVersion,{name:"apiVersion"}),version:f.asString(n.version,{name:"version"}),status:f.asString(n.status,{name:"status"})}}(this.getRequestOptionsForCall(e))}async getNodeInfo(e){return async function(e){const t=await De(e,{method:"get",url:"node",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{beeMode:Z(f.asString(n.beeMode,{name:"beeMode"})),chequebookEnabled:f.asBoolean(n.chequebookEnabled,{name:"chequebookEnabled"}),swapEnabled:f.asBoolean(n.swapEnabled,{name:"swapEnabled"})}}(this.getRequestOptionsForCall(e))}async isSupportedExactVersion(e){return async function(e){const{version:t}=await Mt(e);return t===Pt}(this.getRequestOptionsForCall(e))}async isSupportedApiVersion(e){return async function(e){const{apiVersion:t}=await Mt(e);return Dt()(t)===Dt()(_t)}(this.getRequestOptionsForCall(e))}async getVersions(e){return async function(e){const{version:t,apiVersion:n}=await Mt(e);return{supportedBeeVersion:Pt,supportedBeeApiVersion:_t,beeVersion:t,beeApiVersion:n}}(this.getRequestOptionsForCall(e))}async getReserveState(e){return async function(e){const t=await De(e,{method:"get",url:"reservestate",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{commitment:f.asNumber(n.commitment,{name:"commitment"}),radius:f.asNumber(n.radius,{name:"radius"}),storageRadius:f.asNumber(n.storageRadius,{name:"storageRadius"})}}(this.getRequestOptionsForCall(e))}async getChainState(e){return async function(e){const t=await De(e,{method:"get",url:"chainstate",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{block:f.asNumber(n.block,{name:"block"}),chainTip:f.asNumber(n.chainTip,{name:"chainTip"}),totalAmount:fe(n.totalAmount,{name:"totalAmount"}),currentPrice:(r=f.asNumber(n.currentPrice,{name:"currentPrice"}),Number.isInteger(r)?r<24e3?24e3:r:24e3)};var r}(this.getRequestOptionsForCall(e))}async getWalletBalance(e){return async function(e){const t=await De(e,{method:"get",url:"wallet",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{bzzBalance:K.fromPLUR(fe(n.bzzBalance,{name:"bzzBalance"})),nativeTokenBalance:V.fromWei(fe(n.nativeTokenBalance,{name:"nativeTokenBalance"})),chainID:f.asNumber(n.chainID,{name:"chainID"}),chequebookContractAddress:f.asString(n.chequebookContractAddress,{name:"chequebookContractAddress"}),walletAddress:f.asString(n.walletAddress,{name:"walletAddress"})}}(this.getRequestOptionsForCall(e))}async createPostageBatch(e,t,n,r){const s=fe(e,{min:0n,name:"amount"});if(n&&(n=me(n)),t<ne||t>re)throw new P(`Depth has to be between ${ne}..${re}`,t);const a=await this.getChainState(),o=17280n*BigInt(a.currentPrice)+1n;if(BigInt(s)<o)throw new P(`Amount has to be at least ${o} (1 day at current price ${a.currentPrice})`,s);const i=await async function(e,t,n,r){const s={};r?.gasPrice&&(s["gas-price"]=r.gasPrice.toString()),void 0!==r?.immutableFlag&&(s.immutable=String(r.immutableFlag));const a=await De(e,{method:"post",url:`${Lt}/${t}/${n}`,responseType:"json",params:{label:r?.label},headers:s}),o=f.asObject(a.data,{name:"response.data"});return new k(f.asString(o.batchID,{name:"batchID"}))}(this.getRequestOptionsForCall(r),s,t,n);return!1!==n?.waitForUsable&&await this.waitForUsablePostageStamp(i,n?.waitForUsableTimeout),i}async buyStorage(e,t,n,r){const s=Re(t,(await this.getChainState(r)).currentPrice,"gnosis"===this.network?5:15),a=Ne(e);return n&&(n=me(n)),this.createPostageBatch(s,a,n,r)}async getStorageCost(e,t,n){const r=Re(t,(await this.getChainState(n)).currentPrice,"gnosis"===this.network?5:15);return Ae(Ne(e),r)}async extendStorageSize(e,t,n){const r=await this.getPostageBatch(e,n),s=Ne(t),a=s-r.depth;if(a<=0)throw new P("New depth has to be greater than the original depth",s);return await this.topUpBatch(r.batchID,BigInt(r.amount)*2n**BigInt(a-1)+1n,n),this.diluteBatch(r.batchID,s,n)}async extendStorageDuration(e,t,n){const r=await this.getPostageBatch(e,n),s=Re(t,(await this.getChainState(n)).currentPrice,"gnosis"===this.network?5:15);return this.topUpBatch(r.batchID,s,n)}async getExtensionCost(e,t,n,r){const s=await this.getPostageBatch(e,r),a=Re(n,(await this.getChainState(r)).currentPrice,"gnosis"===this.network?5:15),o=Ne(t),i=Ae(s.depth,s.amount);return Ae(o,a).minus(i)}async getSizeExtensionCost(e,t,n){const r=await this.getPostageBatch(e,n),s=Ne(t);if(s-r.depth<=0)throw new P("New depth has to be greater than the original depth",s);const a=Ae(r.depth,r.amount);return Ae(s,r.amount).minus(a)}async getDurationExtensionCost(e,t,n){const r=await this.getPostageBatch(e,n),s=Re(t,(await this.getChainState(n)).currentPrice,"gnosis"===this.network?5:15);return Ae(r.depth,s)}async topUpBatch(e,t,n){e=new k(e);const r=fe(t,{min:1n,name:"amount"});return async function(e,t,n){const r=await De(e,{method:"patch",url:`${Lt}/topup/${t}/${n}`,responseType:"json"}),s=f.asObject(r.data,{name:"response.data"});return new k(f.asString(s.batchID,{name:"batchID"}))}(this.getRequestOptionsForCall(n),e,r)}async diluteBatch(e,t,n){return e=new k(e),t=f.asNumber(t,{name:"depth",min:18,max:255}),async function(e,t,n){const r=await De(e,{method:"patch",url:`${Lt}/dilute/${t}/${n}`,responseType:"json"}),s=f.asObject(r.data,{name:"response.data"});return new k(f.asString(s.batchID,{name:"batchID"}))}(this.getRequestOptionsForCall(n),e,t)}async getPostageBatch(e,t){return e=new k(e),async function(e,t){const n=await De(e,{method:"get",url:`${Lt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"}),s=f.asNumber(r.utilization,{name:"utilization"}),a=f.asNumber(r.depth,{name:"depth"}),o=f.asNumber(r.bucketDepth,{name:"bucketDepth"}),i=Ee(s,a,o),c=kt(f.asNumber(r.batchTTL,{name:"batchTTL"})),u=W.fromSeconds(c);return{batchID:new k(f.asString(r.batchID,{name:"batchID"})),utilization:s,usable:f.asBoolean(r.usable,{name:"usable"}),label:f.asEmptiableString(r.label,{name:"label"}),depth:a,amount:fe(r.amount,{name:"amount"}),bucketDepth:o,blockNumber:f.asNumber(r.blockNumber,{name:"blockNumber"}),immutableFlag:f.asBoolean(r.immutableFlag,{name:"immutableFlag"}),usage:i,usageText:`${Math.round(100*i)}%`,size:Bt.fromBytes(ve(a)),remainingSize:Bt.fromBytes(Math.ceil(ve(a)*(1-i))),theoreticalSize:Bt.fromBytes(Oe(a)),duration:u}}(this.getRequestOptionsForCall(t),e)}async getPostageBatchBuckets(e,t){return e=new k(e),async function(e,t){const n=await De(e,{method:"get",url:`${Lt}/${t}/buckets`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{depth:f.asNumber(r.depth,{name:"depth"}),bucketDepth:f.asNumber(r.bucketDepth,{name:"bucketDepth"}),bucketUpperBound:f.asNumber(r.bucketUpperBound,{name:"bucketUpperBound"}),buckets:f.asArray(r.buckets,{name:"buckets"}).map((e=>f.asObject(e,{name:"bucket"}))).map((e=>({bucketID:f.asNumber(e.bucketID,{name:"bucketID"}),collisions:f.asNumber(e.collisions,{name:"collisions"})})))}}(this.getRequestOptionsForCall(t),e)}async getAllPostageBatch(e){return Ft(this.getRequestOptionsForCall(e))}async getAllGlobalPostageBatch(e){return Ut(this.getRequestOptionsForCall(e))}async getPostageBatches(e){return Ft(this.getRequestOptionsForCall(e))}async getGlobalPostageBatches(e){return Ut(this.getRequestOptionsForCall(e))}async getAllPendingTransactions(e){return async function(e){const t=await De(e,{url:qt,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.pendingTransactions,{name:"pendingTransactions"}).map(Ht)}(this.getRequestOptionsForCall(e))}async getPendingTransaction(e,t){return e=new I(e),async function(e,t){const n=await De(e,{url:`${qt}/${t}`,responseType:"json"});return Ht(f.asObject(n.data,{name:"response.data"}))}(this.getRequestOptionsForCall(t),e)}async rebroadcastPendingTransaction(e,t){return e=new I(e),async function(e,t){const n=await De(e,{method:"post",url:`${qt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return new I(f.asString(r.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(t),e)}async cancelPendingTransaction(e,t,n){let r;return e=new I(e),t&&(r=fe(t,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const s=await De(e,{method:"delete",headers:r,url:`${qt}/${t}`,responseType:"json"}),a=f.asObject(s.data,{name:"response.data"});return new I(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,r)}async getStake(e){return async function(e){const t=await De(e,{method:"get",responseType:"json",url:`${$t}`}),n=f.asObject(t.data,{name:"response.data"});return K.fromPLUR(fe(n.stakedAmount,{name:"stakedAmount"}))}(this.getRequestOptionsForCall(e))}async depositStake(e,t,n){const r=e instanceof K?e.toPLURString():fe(e,{min:1n,name:"amount"});return t&&(t=ge(t)),async function(e,t,n){const r=await De(e,{method:"post",responseType:"json",url:`${$t}/${t}`,headers:Be(null,n)}),s=f.asObject(r.data,{name:"response.data"});return new I(f.asHexString(s.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(n),r,t)}async getRedistributionState(e){return async function(e){const t=await De(e,{method:"get",responseType:"json",url:"redistributionstate"}),n=f.asObject(t.data,{name:"response.data"});return{minimumGasFunds:V.fromWei(fe(n.minimumGasFunds,{name:"minimumGasFunds"})),hasSufficientFunds:f.asBoolean(n.hasSufficientFunds,{name:"hasSufficientFunds"}),isFrozen:f.asBoolean(n.isFrozen,{name:"isFrozen"}),isFullySynced:f.asBoolean(n.isFullySynced,{name:"isFullySynced"}),phase:f.asString(n.phase,{name:"phase"}),round:f.asNumber(n.round,{name:"round"}),lastWonRound:f.asNumber(n.lastWonRound,{name:"lastWonRound"}),lastPlayedRound:f.asNumber(n.lastPlayedRound,{name:"lastPlayedRound"}),lastFrozenRound:f.asNumber(n.lastFrozenRound,{name:"lastFrozenRound"}),lastSelectedRound:f.asNumber(n.lastSelectedRound,{name:"lastSelectedRound"}),lastSampleDurationSeconds:f.asNumber(n.lastSampleDurationSeconds,{name:"lastSampleDurationSeconds"}),block:f.asNumber(n.block,{name:"block"}),reward:K.fromPLUR(fe(n.reward,{name:"reward"})),fees:V.fromWei(fe(n.fees,{name:"fees"})),isHealthy:f.asBoolean(n.isHealthy,{name:"isHealthy"})}}(this.getRequestOptionsForCall(e))}async waitForUsablePostageStamp(e,t=24e4){for(let r=0;r<t;r+=3e3){try{if((await this.getPostageBatch(e)).usable)return}catch(n){}await l.sleepMillis(3e3)}throw new D("Timeout on waiting for postage stamp to become usable")}getRequestOptionsForCall(e){return e&&(e=function(e){const t=f.asObject(e,{name:"BeeRequestOptions"});return{baseURL:f.asOptional((e=>f.asString(e,{name:"baseURL"})),t.baseURL),timeout:f.asOptional((e=>f.asInteger(e,{name:"timeout",min:0})),t.timeout),headers:f.asOptional((e=>f.asStringMap(e,{name:"headers"})),t.headers),onRequest:f.asOptional((e=>f.asFunction(e,{name:"onRequest"})),t.onRequest),httpAgent:t.httpAgent,httpsAgent:t.httpsAgent,endlesslyRetry:f.asOptional((e=>f.asBoolean(e,{name:"endlesslyRetry"})),t.endlesslyRetry)}}(e)),e?c.deepMerge2(this.requestOptions,e):this.requestOptions}}class yn extends gn{async getNodeAddresses(e){const t=super.getRequestOptionsForCall(e),n=await De(t,{url:"addresses",responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{overlay:new B(f.asString(r.overlay,{name:"overlay"})),underlay:[],ethereum:new T(f.asString(r.ethereum,{name:"ethereum"})),publicKey:new A(f.asString(r.publicKey,{name:"publicKey"})),pssPublicKey:new A(f.asString(r.pssPublicKey,{name:"pssPublicKey"}))}}async getTopology(e){const t=super.getRequestOptionsForCall(e),n=await De(t,{url:"topology",responseType:"json"}),r=f.asObject(n.data,{name:"response.data"}),s=f.asObject(r.bins,{name:"bins"});return{baseAddr:"0bab5ca208a980950604f900f2791613fc980676c2dee7dd92a4fdda5a54bf26",population:f.asNumber(r.population,{name:"population"}),connected:f.asNumber(r.connected,{name:"connected"}),timestamp:f.asString(r.timestamp,{name:"timestamp"}),nnLowWatermark:f.asNumber(r.nnLowWatermark,{name:"nnLowWatermark"}),depth:f.asNumber(r.depth,{name:"depth"}),reachability:"Public",networkAvailability:"Available",bins:{bin_0:Nt(s.bin_0,"bin_0"),bin_1:Nt(s.bin_1,"bin_1"),bin_2:Nt(s.bin_2,"bin_2"),bin_3:Nt(s.bin_3,"bin_3"),bin_4:Nt(s.bin_4,"bin_4"),bin_5:Nt(s.bin_5,"bin_5"),bin_6:Nt(s.bin_6,"bin_6"),bin_7:Nt(s.bin_7,"bin_7"),bin_8:Nt(s.bin_8,"bin_8"),bin_9:Nt(s.bin_9,"bin_9"),bin_10:Nt(s.bin_10,"bin_10"),bin_11:Nt(s.bin_11,"bin_11"),bin_12:Nt(s.bin_12,"bin_12"),bin_13:Nt(s.bin_13,"bin_13"),bin_14:Nt(s.bin_14,"bin_14"),bin_15:Nt(s.bin_15,"bin_15"),bin_16:Nt(s.bin_16,"bin_16"),bin_17:Nt(s.bin_17,"bin_17"),bin_18:Nt(s.bin_18,"bin_18"),bin_19:Nt(s.bin_19,"bin_19"),bin_20:Nt(s.bin_20,"bin_20"),bin_21:Nt(s.bin_21,"bin_21"),bin_22:Nt(s.bin_22,"bin_22"),bin_23:Nt(s.bin_23,"bin_23"),bin_24:Nt(s.bin_24,"bin_24"),bin_25:Nt(s.bin_25,"bin_25"),bin_26:Nt(s.bin_26,"bin_26"),bin_27:Nt(s.bin_27,"bin_27"),bin_28:Nt(s.bin_28,"bin_28"),bin_29:Nt(s.bin_29,"bin_29"),bin_30:Nt(s.bin_30,"bin_30"),bin_31:Nt(s.bin_31,"bin_31")}}}}class bn{constructor(e,t,n,r){this.signer=new S(e),this.batchId=new k(t),this.buckets=n,this.depth=r,this.maxSlot=2**(this.depth-16)}static fromBlank(e,t,n){return new bn(e,t,new Uint32Array(65536),n)}static fromState(e,t,n,r){return new bn(e,t,n,r)}stamp(e){const t=e.hash(),n=s.uint16ToNumber(t,"BE"),r=this.buckets[n];if(r>=this.maxSlot)throw Error("Bucket is full");this.buckets[n]++;const a=s.concatBytes(s.numberToUint32(n,"BE"),s.numberToUint32(r,"BE")),o=s.numberToUint64(BigInt(Date.now()),"BE"),i=this.signer.sign(s.concatBytes(t,this.batchId.toUint8Array(),a,o));return{batchId:this.batchId,index:a,issuer:this.signer.publicKey().address().toUint8Array(),signature:i.toUint8Array(),timestamp:o}}getState(){return this.buckets}}const wn="https://api.gateway.ethswarm.org",En=new k("0000000000000000000000000000000000000000000000000000000000000000"),On=new U("0000000000000000000000000000000000000000000000000000000000000000"),xn=new Uint8Array(32),vn=new Uint8Array(32),Sn=new Uint8Array(20);function An(e){return(e=new B(e)).toHex().slice(0,te)}const Tn=[[94,68,46,28,14,5,1],[9,8,7,6,5,4,3]],Rn=[[47,34,23,14,7,2],[9,8,7,6,5,4]],Nn=[[104,95,86,77,69,61,53,46,39,32,26,20,15,10,6,3,1],[21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5]],In=[[52,47,43,38,34,30,26,23,19,16,13,10,7,5,3,1],[21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6]],$n=[[92,87,82,77,73,68,63,59,54,50,45,41,37,33,29,26,22,19,16,13,10,8,5,3,2,1],[31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6]],Bn=[[46,43,41,38,36,34,31,29,27,25,22,20,18,16,14,13,11,9,8,6,5,4,2,1],[31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,7]],kn=[[37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1],[90,88,87,85,84,82,81,79,77,76,74,72,71,69,67,66,64,62,60,59,57,55,53,51,49,48,46,44,41,39,37,35,32,30,27,24,20]],Ln=[[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1],[88,85,82,79,76,72,69,66,62,59,55,51,48,44,39,35,30,24]];function Un(e,t,n){if(t===ie.OFF)return 0;const r=function(e,t){switch(e){case ie.MEDIUM:return t?Rn:Tn;case ie.STRONG:return t?In:Nn;case ie.INSANE:return t?Bn:$n;case ie.PARANOID:return t?Ln:kn;default:throw new Error(`Unknown redundancy level ${e}`)}}(t,n),[s,a]=r;for(let o=0;o<s.length;o++)if(e>=s[o])return a[o]/s[o];return a[a.length-1]/s[s.length-1]}const Fn={label:"medium",value:ie.MEDIUM,errorTolerance:.01},jn={label:"strong",value:ie.STRONG,errorTolerance:.05},Dn={label:"insane",value:ie.INSANE,errorTolerance:.1},Pn={label:"paranoid",value:ie.PARANOID,errorTolerance:.5};function Cn(){return{medium:Fn,strong:jn,insane:Dn,paranoid:Pn}}function _n(e){if("string"==typeof e)switch(e.toLowerCase()){case"medium":return Fn;case"strong":return jn;case"insane":return Dn;case"paranoid":return Pn;default:throw new Error(`Unknown redundancy level '${e}'`)}switch(e){case ie.MEDIUM:return Fn;case ie.STRONG:return jn;case ie.INSANE:return Dn;case ie.PARANOID:return Pn;default:throw new Error(`Unknown redundancy level '${e}'`)}}})(),r})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BeeJs=t():e.BeeJs=t()}(this,(()=>(()=>{var e={8266:(e,t,n)=>{e.exports=n(9092)},2585:(e,t,n)=>{"use strict";var r=n(9279),a=n(3769),i=n(8595),o=n(9275),s=n(7090),c=n(177),u=n(5077),l=n(59),f=n(2778),h=n(6198),p=n(7671),m=n(3976);e.exports=function(e){return new Promise((function(t,n){var d,g=e.data,b=e.headers,y=e.responseType,w=e.withXSRFToken;function B(){e.cancelToken&&e.cancelToken.unsubscribe(d),e.signal&&e.signal.removeEventListener("abort",d)}r.isFormData(g)&&r.isStandardBrowserEnv()&&delete b["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var T=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";b.Authorization="Basic "+btoa(T+":"+E)}var R=s(e.baseURL,e.url,e.allowAbsoluteUrls);function O(){if(v){var r="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,i={data:y&&"text"!==y&&"json"!==y?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v};a((function(e){t(e),B()}),(function(e){n(e),B()}),i),v=null}}if(v.open(e.method.toUpperCase(),o(R,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=O:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(O)},v.onabort=function(){v&&(n(new f("Request aborted",f.ECONNABORTED,e,v)),v=null)},v.onerror=function(){n(new f("Network Error",f.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new f(t,r.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,e,v)),v=null},r.isStandardBrowserEnv()&&(w&&r.isFunction(w)&&(w=w(e)),w||!1!==w&&u(R))){var x=e.xsrfHeaderName&&e.xsrfCookieName&&i.read(e.xsrfCookieName);x&&(b[e.xsrfHeaderName]=x)}"setRequestHeader"in v&&r.forEach(b,(function(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete b[t]:v.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),y&&"json"!==y&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(d=function(t){v&&(n(!t||t.type?new h(null,e,v):t),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(d),e.signal&&(e.signal.aborted?d():e.signal.addEventListener("abort",d))),g||!1===g||0===g||""===g||(g=null);var S=p(R);S&&-1===m.protocols.indexOf(S)?n(new f("Unsupported protocol "+S+":",f.ERR_BAD_REQUEST,e)):v.send(g)}))}},9092:(e,t,n)=>{"use strict";var r=n(9279),a=n(8337),i=n(8062),o=n(2018),s=n(8785),c=n(6619);var u=function e(t){var n=new i(t),s=a(i.prototype.request,n);return r.extend(s,i.prototype,n),r.extend(s,n),s.create=function(n){return e(o(t,n))},s}(s);u.Axios=i,u.CanceledError=n(6198),u.CancelToken=n(8294),u.isCancel=n(6747),u.VERSION=n(6532).version,u.toFormData=n(5765),u.AxiosError=n(2778),u.Cancel=u.CanceledError,u.all=function(e){return Promise.all(e)},u.spread=n(2225),u.isAxiosError=n(2446),u.formToJSON=function(e){return c(r.isHTMLForm(e)?new FormData(e):e)},e.exports=u,e.exports.default=u},8294:(e,t,n)=>{"use strict";var r=n(6198);function a(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){for(var t=n._listeners.length;t-- >0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,a,i){n.reason||(n.reason=new r(e,a,i),t(n.reason))}))}a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},a.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},a.source=function(){var e;return{token:new a((function(t){e=t})),cancel:e}},e.exports=a},6198:(e,t,n)=>{"use strict";var r=n(2778);function a(e,t,n){r.call(this,null==e?"canceled":e,r.ERR_CANCELED,t,n),this.name="CanceledError"}n(9279).inherits(a,r,{__CANCEL__:!0}),e.exports=a},6747:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},8062:(e,t,n)=>{"use strict";var r=n(9279),a=n(9275),i=n(5132),o=n(6839),s=n(2018),c=n(7090),u=n(2370),l=u.validators;function f(e){this.defaults=e,this.interceptors={request:new i,response:new i}}f.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&u.assertOptions(n,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var a=t.paramsSerializer;null!=a&&(r.isFunction(a)?t.paramsSerializer={serialize:a}:u.assertOptions(a,{encode:l.function,serialize:l.function},!0));var i=[],c=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(c=c&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var f,h=[];if(this.interceptors.response.forEach((function(e){h.push(e.fulfilled,e.rejected)})),!c){var p=[o,void 0];for(Array.prototype.unshift.apply(p,i),p=p.concat(h),f=Promise.resolve(t);p.length;)f=f.then(p.shift(),p.shift());return f}for(var m=t;i.length;){var d=i.shift(),g=i.shift();try{m=d(m)}catch(b){g(b);break}}try{f=o(m)}catch(b){return Promise.reject(b)}for(;h.length;)f=f.then(h.shift(),h.shift());return f},f.prototype.getUri=function(e){e=s(this.defaults,e);var t=c(e.baseURL,e.url,e.allowAbsoluteUrls);return a(t,e.params,e.paramsSerializer)},r.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,a){return this.request(s(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}f.prototype[e]=t(),f.prototype[e+"Form"]=t(!0)})),e.exports=f},2778:(e,t,n)=>{"use strict";var r=n(9279);function a(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a)}r.inherits(a,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var i=a.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){o[e]={value:e}})),Object.defineProperties(a,o),Object.defineProperty(i,"isAxiosError",{value:!0}),a.from=function(e,t,n,o,s,c){var u=Object.create(i);return r.toFlatObject(e,u,(function(e){return e!==Error.prototype})),a.call(u,e.message,t,n,o,s),u.cause=e,u.name=e.name,c&&Object.assign(u,c),u},e.exports=a},5132:(e,t,n)=>{"use strict";var r=n(9279);function a(){this.handlers=[]}a.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.clear=function(){this.handlers&&(this.handlers=[])},a.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=a},7090:(e,t,n)=>{"use strict";var r=n(4238),a=n(2015);e.exports=function(e,t,n){var i=!r(t);return e&&(i||!1===n)?a(e,t):t}},6839:(e,t,n)=>{"use strict";var r=n(9279),a=n(5636),i=n(6747),o=n(8785),s=n(6198),c=n(3661);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=a.call(e,e.data,e.headers,null,e.transformRequest),c(e.headers,"Accept"),c(e.headers,"Content-Type"),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return u(e),t.data=a.call(e,t.data,t.headers,t.status,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=a.call(e,t.response.data,t.response.headers,t.response.status,e.transformResponse))),Promise.reject(t)}))}},2018:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e,t){t=t||{};var n={};function a(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isEmptyObject(t)?r.merge({},e):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:a(void 0,e[n]):a(e[n],t[n])}function o(e){if(!r.isUndefined(t[e]))return a(void 0,t[e])}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:a(void 0,e[n]):a(void 0,t[n])}function c(n){return n in t?a(e[n],t[n]):n in e?a(void 0,e[n]):void 0}var u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,a=t(e);r.isUndefined(a)&&t!==c||(n[e]=a)})),n}},3769:(e,t,n)=>{"use strict";var r=n(2778);e.exports=function(e,t,n){var a=n.config.validateStatus;n.status&&a&&!a(n.status)?t(new r("Request failed with status code "+n.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}},5636:(e,t,n)=>{"use strict";var r=n(9279),a=n(8785);e.exports=function(e,t,n,i){var o=this||a;return r.forEach(i,(function(r){e=r.call(o,e,t,n)})),e}},8785:(e,t,n)=>{"use strict";var r=n(9279),a=n(3661),i=n(2778),o=n(59),s=n(5765),c=n(176),u=n(3976),l=n(6619),f={"Content-Type":"application/x-www-form-urlencoded"};function h(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var p,m={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(p=n(2585)),p),transformRequest:[function(e,t){a(t,"Accept"),a(t,"Content-Type");var n,i=t&&t["Content-Type"]||"",o=i.indexOf("application/json")>-1,u=r.isObject(e);if(u&&r.isHTMLForm(e)&&(e=new FormData(e)),r.isFormData(e))return o?JSON.stringify(l(e)):e;if(r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return h(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(u){if(-1!==i.indexOf("application/x-www-form-urlencoded"))return c(e,this.formSerializer).toString();if((n=r.isFileList(e))||i.indexOf("multipart/form-data")>-1){var f=this.env&&this.env.FormData;return s(n?{"files[]":e}:e,f&&new f,this.formSerializer)}}return u||o?(h(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(a){if("SyntaxError"!==a.name)throw a}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||m.transitional,n=t&&t.forcedJSONParsing,a="json"===this.responseType;if(e&&r.isString(e)&&(n&&!this.responseType||a)){var o=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e)}catch(s){if(o){if("SyntaxError"===s.name)throw i.from(s,i.ERR_BAD_RESPONSE,this,null,this.response);throw s}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u.classes.FormData,Blob:u.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){m.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){m.headers[e]=r.merge(f)})),e.exports=m},59:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},6183:(e,t,n)=>{e.exports=n(2909)},6532:e=>{e.exports={version:"0.30.0"}},8047:(e,t,n)=>{"use strict";var r=n(5765);function a(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function i(e,t){this._pairs=[],e&&r(e,this,t)}var o=i.prototype;o.append=function(e,t){this._pairs.push([e,t])},o.toString=function(e){var t=e?function(t){return e.call(this,t,a)}:a;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")},e.exports=i},8337:e=>{"use strict";e.exports=function(e,t){return function(){return e.apply(t,arguments)}}},9275:(e,t,n)=>{"use strict";var r=n(9279),a=n(8047);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o));var s,c=n&&n.encode||i,u=n&&n.serialize;return(s=u?u(t,n):r.isURLSearchParams(t)?t.toString():new a(t,n).toString(c))&&(e+=(-1===e.indexOf("?")?"?":"&")+s),e}},2015:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}},8595:(e,t,n)=>{"use strict";var r=n(9279);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,a,i,o){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(a)&&s.push("path="+a),r.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},6619:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e){function t(e,n,a,i){var o=e[i++];if("__proto__"===o)return!0;var s=Number.isFinite(+o),c=i>=e.length;return o=!o&&r.isArray(a)?a.length:o,c?(r.hasOwnProperty(a,o)?a[o]=[a[o],n]:a[o]=n,!s):(a[o]&&r.isObject(a[o])||(a[o]=[]),t(e,n,a[o],i)&&r.isArray(a[o])&&(a[o]=function(e){var t,n,r={},a=Object.keys(e),i=a.length;for(t=0;t<i;t++)r[n=a[t]]=e[n];return r}(a[o])),!s)}if(r.isFormData(e)&&r.isFunction(e.entries)){var n={};return r.forEachEntry(e,(function(e,a){t(function(e){return r.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e),a,n,0)})),n}return null}},4238:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},2446:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},5077:(e,t,n)=>{"use strict";var r=n(9279);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function a(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=a(window.location.href),function(t){var n=r.isString(t)?a(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},3661:(e,t,n)=>{"use strict";var r=n(9279);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},177:(e,t,n)=>{"use strict";var r=n(9279),a=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,o={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.slice(0,i)).toLowerCase(),n=r.trim(e.slice(i+1)),t){if(o[t]&&a.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},7671:e=>{"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},2225:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},5765:(e,t,n)=>{"use strict";var r=n(9279),a=n(2778),i=n(6183);function o(e){return r.isPlainObject(e)||r.isArray(e)}function s(e){return r.endsWith(e,"[]")?e.slice(0,-2):e}function c(e,t,n){return e?e.concat(t).map((function(e,t){return e=s(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var u=r.toFlatObject(r,{},null,(function(e){return/^is[A-Z]/.test(e)}));e.exports=function(e,t,n){if(!r.isObject(e))throw new TypeError("target must be an object");t=t||new(i||FormData);var l,f=(n=r.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.isUndefined(t[e])}))).metaTokens,h=n.visitor||b,p=n.dots,m=n.indexes,d=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((l=t)&&r.isFunction(l.append)&&"FormData"===l[Symbol.toStringTag]&&l[Symbol.iterator]);if(!r.isFunction(h))throw new TypeError("visitor must be a function");function g(e){if(null===e)return"";if(r.isDate(e))return e.toISOString();if(!d&&r.isBlob(e))throw new a("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(e)||r.isTypedArray(e)?d&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function b(e,n,a){var i=e;if(e&&!a&&"object"==typeof e)if(r.endsWith(n,"{}"))n=f?n:n.slice(0,-2),e=JSON.stringify(e);else if(r.isArray(e)&&function(e){return r.isArray(e)&&!e.some(o)}(e)||r.isFileList(e)||r.endsWith(n,"[]")&&(i=r.toArray(e)))return n=s(n),i.forEach((function(e,a){!r.isUndefined(e)&&null!==e&&t.append(!0===m?c([n],a,p):null===m?n:n+"[]",g(e))})),!1;return!!o(e)||(t.append(c(a,n,p),g(e)),!1)}var y=[],w=Object.assign(u,{defaultVisitor:b,convertValue:g,isVisitable:o});if(!r.isObject(e))throw new TypeError("data must be an object");return function e(n,a){if(!r.isUndefined(n)){if(-1!==y.indexOf(n))throw Error("Circular reference detected in "+a.join("."));y.push(n),r.forEach(n,(function(n,i){!0===(!(r.isUndefined(n)||null===n)&&h.call(t,n,r.isString(i)?i.trim():i,a,w))&&e(n,a?a.concat(i):[i])})),y.pop()}}(e),t}},176:(e,t,n)=>{"use strict";var r=n(9279),a=n(5765),i=n(3976);e.exports=function(e,t){return a(e,new i.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,a){return i.isNode&&r.isBuffer(e)?(this.append(t,e.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}},2370:(e,t,n)=>{"use strict";var r=n(6532).version,a=n(2778),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new a(i(r," has been removed"+(t?" in "+t:"")),a.ERR_DEPRECATED);return t&&!o[r]&&(o[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new a("options must be an object",a.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),i=r.length;i-- >0;){var o=r[i],s=t[o];if(s){var c=e[o],u=void 0===c||s(c,o,e);if(!0!==u)throw new a("option "+o+" must be "+u,a.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new a("Unknown option "+o,a.ERR_BAD_OPTION)}},validators:i}},4984:e=>{"use strict";e.exports=FormData},8455:(e,t,n)=>{"use strict";var r=n(8047);e.exports="undefined"!=typeof URLSearchParams?URLSearchParams:r},7115:(e,t,n)=>{"use strict";e.exports={isBrowser:!0,classes:{URLSearchParams:n(8455),FormData:n(4984),Blob:Blob},protocols:["http","https","file","blob","url","data"]}},3976:(e,t,n)=>{"use strict";e.exports=n(7115)},9279:(e,t,n)=>{"use strict";var r,a=n(8337),i=Object.prototype.toString,o=(r=Object.create(null),function(e){var t=i.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function s(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function c(e){return Array.isArray(e)}function u(e){return void 0===e}var l=s("ArrayBuffer");function f(e){return"number"==typeof e}function h(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var m=s("Date"),d=s("File"),g=s("Blob"),b=s("FileList");function y(e){return"[object Function]"===i.call(e)}var w=s("URLSearchParams");function B(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}var v,T=(v="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return v&&e instanceof v});var E,R=s("HTMLFormElement"),O=(E=Object.prototype.hasOwnProperty,function(e,t){return E.call(e,t)});e.exports={isArray:c,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||i.call(e)===t||y(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:f,isObject:h,isPlainObject:p,isEmptyObject:function(e){return e&&0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype},isUndefined:u,isDate:m,isFile:d,isBlob:g,isFunction:y,isStream:function(e){return h(e)&&y(e.pipe)},isURLSearchParams:w,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:B,merge:function e(){var t={};function n(n,r){p(t[r])&&p(n)?t[r]=e(t[r],n):p(n)?t[r]=e({},n):c(n)?t[r]=n.slice():t[r]=n}for(var r=0,a=arguments.length;r<a;r++)B(arguments[r],n);return t},extend:function(e,t,n){return B(t,(function(t,r){e[r]=n&&"function"==typeof t?a(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var a,i,o,s={};if(t=t||{},null==e)return t;do{for(i=(a=Object.getOwnPropertyNames(e)).length;i-- >0;)o=a[i],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:s,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(c(e))return e;var t=e.length;if(!f(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:T,isFileList:b,forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var a=n.value;t.call(e,a[0],a[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:R,hasOwnProperty:O}},7020:(e,t)=>{"use strict";var n;async function r(e){return new Promise(((t,n)=>e.then(n,t)))}async function a(e){return new Promise((t=>setTimeout((()=>{t(!0)}),e)))}function i(e,t=Math.random){for(let n=e.length-1;n>0;n--){const r=Math.floor(t()*(n+1)),a=e[n];e[n]=e[r],e[r]=a}return e}function o(e,t,n=Math.random){return i(q(0,e.length-1),n).slice(0,t)}function s(e,t,n=Math.random){return Math.floor(n()*(t-e+1))+e}function c(e,t,n){return t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height}function u(e,t=Math.random){return t()<e}function l(e,t=Math.random){return e[Math.floor(e.length*t())]}function f(e){if(!e.length)throw Error("Received empty array");return e[e.length-1]}function h(e,t,n){return n(t.reduce(((e,t)=>t(e)),e))}function p(e,t){if(null==e)return null;const n=t.split(".");let r=e;for(const a of n){if(null===r[a]||void 0===r[a])return null;r=r[a]}return r}function m(e,t,n){const r=t.split(/\.|\[/);let a=e;for(let i=0;i<r.length;i++){const e=r[i],t=i<r.length-1&&r[i+1].includes("]"),o=e.includes("]")?e.replace(/\[|\]/g,""):e;if(i===r.length-1)return a[o]=n,n;g(a[o])||(a[o]=t?[]:{}),a=a[o]}return n}function d(e,t){return Math.round(e/t)*t}function g(e,t=!0){return!(!e||t&&!w(e._readableState)||t&&e.constructor&&(e.constructor.isBuffer||"Uint8Array"==e.constructor.name||"ArrayBuffer"===e.constructor.name||"ReadableStream"===e.constructor.name))&&"object"==typeof e}function b(e){return g(e)&&!Array.isArray(e)}function y(e){return Array.isArray(e)&&0===e.length}function w(e){return void 0===e}function B(e){return"[object Function]"===Object.prototype.toString.call(e)||"[object AsyncFunction]"===Object.prototype.toString.call(e)}function v(e){return"[object String]"===Object.prototype.toString.call(e)}function T(e){return"number"==typeof e&&isFinite(e)}function E(e){return!0===e||!1===e}function R(e){return"[object Date]"===Object.prototype.toString.call(e)}function O(e){return!v(e)||0===e.trim().length}function x(e){return T(e)&&Number.isInteger(e)&&e>=1}function S(e){return v(e)&&null!==e.match(/^-?\d+$/)}function A(e){return v(e)&&null!==e.match(/^(0x)?[0-9a-f]+$/i)}t.Mi=t.l2=t.mW=t.DH=t.Or=t.Rb=t.AO=t.HC=t.FQ=t.iQ=t.DO=t.o8=t.LQ=t.yI=t.g$=t.O3=t.Dj=t.ie=t.vU=t.AA=t.$i=t.pp=t.f7=t.dF=t.Xx=void 0;const D="!@#$%^&*()_+-=[]{}|;:<>?,./".split(""),V="abcdefghijklmnopqrstuvwxyz",N=V+"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",I=N+"!@#$%^&*()_+-=[]{}|;:<>?,./",$=["—","\\","東","京","都","𝖆","𝖇","𝖈","👾","🙇","💁","🙅","ᚠ","ᛇ","ᚻ","ᛦ"],P="0123456789abcdef";function z(e,t){if(O(e))throw new TypeError(`Expected string${t?.name?` for ${t.name}`:""}, got: `+e);if(t&&(void 0!==t.min&&e.length<t.min||void 0!==t.max&&e.length>t.max))throw RangeError(`Expected string${t?.name?` for ${t.name}`:""} length in range: ${t.min??"-inf"}..${t.max??"inf"}; got: ${e.length}`);return e}function k(e,t){if(void 0!==t.min&&e<t.min||void 0!==t.max&&e>t.max)throw RangeError(`Expected value${t?.name?` for ${t.name}`:""} in range: ${t.min??"-inf"}..${t.max??"inf"}; got: ${e}`)}function F(e,t){if(T(e))return t&&k(e,t),e;if(!v(e)||!e.match(/^-?\d+(\.\d+)?$/))throw new TypeError(`Expected number${t?.name?` for ${t.name}`:""}, got: `+e);const n=parseFloat(e);return t&&k(n,t),n}function U(e,t){return 0|F(e,t)}function L(e,t){if(!b(e))throw new TypeError(`Expected object${t?.name?` for ${t.name}`:""}, got: `+e);return e}function j(e){return v(e)&&null!==e.match(/^https?:\/\/.+/)}function C(e,t){for(const[n,r]of Object.entries(t))if(!r(e[n]))throw TypeError(`${n} in value does not exist or match shape`);for(const n of Object.keys(e))if(!t[n])throw TypeError(`${n} exists in value but not in shape`);return!0}function M(e,t){if(b(e)&&b(t))for(const n in t)b(t[n])?(e[n]||(e[n]={}),M(e[n],t[n])):Array.isArray(t[n])?e[n]=[...t[n]]:(null!==t[n]&&void 0!==t[n]||null===e[n]||void 0===e[n])&&(e[n]=t[n]);return e}function _(e,t){const n={};for(const r of e)for(const e of Object.keys(r))n[e]?n[e]=t(n[e],r[e]):n[e]=r[e];return n}function G(e,t){Array.prototype.push.apply(e,t)}function q(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function H(e,t=()=>!1){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").split("").map((e=>/[a-z0-9]/.test(e)||t(e)?e:"-")).join("").replace(/-+/g,"-").replace(/^-|-$/g,"")}function W(e,t){if(0===t.length)return 0;const n=e.toLowerCase(),r=t.toLowerCase();return e===t?1e4:n.startsWith(r)?1e4-e.length:n.includes(r)?5e3-e.length:new RegExp(".*"+r.split("").join(".*")+".*").test(n)?1e3-e.length:0}const K={"&":"&",""":'"',"'":"'",">":">","<":"<"};function X(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(0,n)}function J(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(n+t.length)}function Z(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(0,n)}function Q(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(n+t.length)}function Y(e,t,n=!1){const r=n?e.lastIndexOf(t):e.indexOf(t);return-1===r?n?[null,e]:[e,null]:[e.slice(0,r),e.slice(r+t.length)]}function ee(e,t){let n=[e];for(const r of t)n=n.flatMap((e=>e.split(r)));return n.filter((e=>e))}function te(e){const t=f(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?"":t.slice(n+1)}function ne(e){const t=f(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?t:t.slice(0,n)}function re(e){return e.split("\n").map((e=>e.trim().replace(/\s+/g," "))).filter((e=>e.length>0)).join("\n")}function ae(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ie(e){return e.charAt(0).toLowerCase()+e.slice(1)}function oe(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122}function se(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function ce(e){return oe(e)||se(e)}const ue=" \n\t\r.,?!:;\"'`(){}[]~@#$%^&*-+=|<>/\\".split("");function le(e){return ue.includes(e)}function fe(e,t,n=0){const r=t.exec(e.slice(n));return r?{index:r.index,match:r[0]}:null}function he(e,t,n=!0){if(!n)return t.every((t=>t instanceof RegExp?t.test(e):-1!==e.indexOf(t,0)));let r=0;for(const a of t)if(a instanceof RegExp){const t=fe(e,a,r);if(!t)return!1;r=t.index+t.match.length}else{const t=e.indexOf(a,r);if(-1===t)return!1;r=t+a.length}return!0}function pe(e,t,n=0){const r=[];let a=e.indexOf(t,n);for(;-1!==a;)r.push(a),a=e.indexOf(t,a+t.length);return r}function me(e,t,n=0){let r=-1;for(const a of t){const t=e.indexOf(a,n);-1!==t&&(-1===r||t<r)&&(r=t)}return r}function de(e,t=0){for(let n=t;n<e.length;n++)if(le(e[n]))return n;return-1}function ge(e,t=0){for(let n=t;n<e.length;n++)if("#"===e[n]&&ce(e[n+1]))return n;return-1}function be(e,t,n=0){return e.slice(0,n).lastIndexOf(t)}function ye(e,t=0,n="{",r="}"){let a=1;for(let i=t;i<e.length;i++)if(e.slice(i,i+r.length)===r){if(0==--a)return i}else e.slice(i,i+n.length)===n&&a++;return-1}function we(e,t){const n=t.wordBoundary?me(e,[`${t.opening} `,`${t.opening}\n`],t.start||0):e.indexOf(t.opening,t.start||0);if(-1===n)return null;const r=ye(e,n+t.opening.length,t.opening,t.closing);return-1===r?null:t.exclusive?e.slice(n+t.opening.length,r):e.slice(n,r+t.closing.length)}const Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ve="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Te(e,t){const n=t.length;let r=0,a=0;const i=[];for(let o=0;o<e.length;o++){const s=e[o];if("="===s)break;const c=t.indexOf(s);if(-1===c)throw new Error(`Invalid character: ${s}`);a=a<<Math.log2(n)|c,r+=Math.log2(n),r>=8&&(r-=8,i.push(a>>r&255))}return new Uint8Array(i)}function Ee(e,t){const n=t.length;let r=0,a=0,i="";for(let o=0;o<e.length;o++)for(a=a<<8|e[o],r+=8;r>=Math.log2(n);)r-=Math.log2(n),i+=t[a>>r&n-1];return r>0&&(i+=t[a<<Math.log2(n)-r&n-1]),i.length%4!=0&&(i+="=".repeat(4-i.length%4)),i}function Re(e,t,n){const r=[];for(const a of n)a!==t&&r.push(e.replace(t,a));return r}function Oe(e){const t=e.lastIndexOf(" ");if(-1===t)return{line:e,rest:""};return{line:e.slice(0,t),rest:e.slice(t+1)}}function xe(e){const t=e.reduce(((e,t)=>e.length<t.length?e:t));let n="";for(let r=0;r<t.length;r++){const a=t[r];if(!e.every((e=>e[r]===a)))break;n+=a}return n}function Se(e,t){return new RegExp(`\\b${t}\\b`).test(e)}function Ae(e,t,n=[]){let r="";for(;t<e.length&&(ce(e[t])||n.includes(e[t]));)r+=e[t++];return r}function De(e,t,n,r="$",a=":"){if(""===n)return e;let i=e.indexOf(`${r}${t}`);for(;-1!==i;){if(e[i+t.length+1]===a)if(e[i+t.length+2]===a)e=e.replace(`${r}${t}${a}${a}`,n);else{const o=Ae(e,i+t.length+2,["_"]);e=e.replace(`${r}${t}${a}${o}`,n)}else e=e.replace(`${r}${t}`,n);i=e.indexOf(`${r}${t}`,i+n.length)}return e}function Ve(e,t="$",n=":"){let r=e.indexOf(t);for(;-1!==r;){const a=Ae(e,r+1);if(e[r+a.length+1]===n)if(e[r+a.length+2]===n)e=e.replace(`${t}${a}${n}${n}`,"");else{const i=Ae(e,r+a.length+2);e=e.replace(`${t}${a}${n}${i}`,i)}r=e.indexOf(t,r+1)}return e}function Ne(e,t=!0){const n=Object.entries(e).filter((([e,t])=>null!=t)).map((([e,t])=>`${e}=${encodeURIComponent(t)}`)).join("&");return n?(t?"?":"")+n:""}function Ie(e){return String(Math.floor(e)).padStart(2,"0")}function $e(e){const t=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const r=Math.floor(e/1e3);return t?`${Ie(t)}:${Ie(n)}:${Ie(r)}`:`${Ie(n)}:${Ie(r)}`}function Pe(e){return Math.floor((R(e)?e.getTime():e)/864e5)}const ze={today:(e,t)=>Ie(e)+":"+Ie(t),yesterday:()=>"Yesterday",monday:()=>"Mon",tuesday:()=>"Tue",wednesday:()=>"Wed",thursday:()=>"Thu",friday:()=>"Fri",saturday:()=>"Sat",sunday:()=>"Sun",weeks:e=>`${e}w`};const ke={now:()=>"A few seconds",seconds:e=>`${e} seconds`,minutes:e=>`${e} minutes`,hours:e=>`${e} hours`,days:e=>`${e} days`,weeks:e=>`${e} weeks`};function Fe(e,n){const r=n?.now??Date.now(),a=n?.labels||ke;let i=(r-(t.Or.isDate(e)?e.getTime():e))/1e3;return i<10?a.now():i<120?a.seconds(Math.floor(i)):(i/=60,i<120?a.minutes(Math.floor(i)):(i/=60,i<48?a.hours(Math.floor(i)):(i/=24,i<14?a.days(Math.floor(i)):(i/=7,a.weeks(Math.floor(i))))))}const Ue={};const Le={s:1e3,m:6e4,h:36e5,d:864e5};const je={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function Ce(e){return{zeroBasedIndex:e,day:je[e]}}function Me(e){return Ce(e.getDay())}const _e={ms:1,milli:1,millis:1,millisecond:1,milliseconds:1,s:1e3,sec:1e3,second:1e3,seconds:1e3,m:6e4,min:6e4,minute:6e4,minutes:6e4,h:36e5,hour:36e5,hours:36e5,d:864e5,day:864e5,days:864e5,w:6048e5,week:6048e5,weeks:6048e5,month:2592e6,months:2592e6,y:31536e6,year:31536e6,years:31536e6};const Ge={b:1,byte:1,bytes:1,kb:1024,kilobyte:1024,kilobytes:1024,mb:1048576,megabyte:1048576,megabytes:1048576,gb:1024**3,gigabyte:1024**3,gigabytes:1024**3,tb:1024**4,terabyte:1024**4,terabytes:1024**4};const qe={};function He(e,t=!1){e=e.filter((e=>e)),t&&v(e[1])&&(e[1]="../"+e[1]);let n="";v(e[0])&&e[0].includes("://")&&(n=X(e[0],"://")??"",e[0]=J(e[0],"://")??"");const r=e.map((e=>String(e))).flatMap((e=>e.split("/"))),a=[];for(let i=0;i<r.length;i++)"."!==r[i]&&(".."===r[i]?(!n||a.length>1)&&a.pop():a.push(r[i]));return(n?n+"://":"")+a.join("/").replaceAll(/\/{2,}/g,"/")}function We(e){const t=Object.keys(e).sort(((e,t)=>e.localeCompare(t))),n={};for(const r of t)n[r]=Xe(e[r]);return n}function Ke(e){const t=[];return e.sort(((e,t)=>JSON.stringify(Xe(e)).localeCompare(JSON.stringify(Xe(t))))).forEach((e=>t.push(Xe(e)))),t}function Xe(e){return Array.isArray(e)?Ke(e):g(e)?We(e):e}function Je(e,t){return JSON.stringify(Xe(e))===JSON.stringify(Xe(t))}function Ze(e){const t=Object.keys(e);return t[Math.floor(Math.random()*t.length)]}const Qe=[1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24,1e27,1e30,1e9,1e16,1e18,1e18,1e18,1e33],Ye=["thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","gwei","bzz","btc","eth","dai","decillion"],et=["K","M","B","T","Qa","Qi","Sx","Sp","O","N","gwei","bzz","eth","btc","dai","D"];function tt(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeNumber got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim(),r=et.findIndex((e=>e.toLowerCase()===n.toLowerCase()));return-1===r?t:t*Qe[r]}function nt(e,t,n){return e<t?t:e>n?n:e}function rt(e,t,n){return e+(n?"["+t+"]":(e.length?".":"")+t)}function at(e,t,n,r,a){if(!g(t))return t;for(const[i,o]of Object.entries(t)){const t=rt(n,i,r);Array.isArray(o)?a?at(e,o,t,!0,a):e[t]=o.map((e=>at(Array.isArray(e)?[]:{},e,"",!1,a))):g(o)?at(e,o,t,!1,a):e[t]=o}return e}function it(e,t){const n={};for(const r of e){n[t(r)]=r}return n}function ot(e,t){const n=Math.ceil(e.length/t),r=[];for(let a=0;a<e.length;a+=n)r.push(e.slice(a,a+n));return r}function st(e,t){const n=[],r=Math.ceil(e.length/t);for(let a=0;a<r;a++)n.push(e.slice(a*t,a*t+t));return n}function ct(e,t){return Object.fromEntries(Object.entries(e).sort(t))}function ut(e,t){const n=[];let r=[];return e.forEach(((a,i)=>{(0===i||!t(a,e[i-1]))&&(r=[],n.push(r)),r.push(a)})),n}function lt(e,t,n,r=100){if(e.map.has(t)){const n=e.keys.indexOf(t);e.keys.splice(n,1)}if(e.map.set(t,n),e.keys.push(t),e.keys.length>r){const t=e.keys.shift();t&&e.map.delete(t)}}class ft{constructor(e){this.value=e}static of(e){return new ft(e)}static empty(){return new ft(null)}map(e){return new ft(null!==this.value&&void 0!==this.value?e(this.value):null)}mapAsync(e){return null!==this.value&&void 0!==this.value?e(this.value).then((e=>ft.of(e))):Promise.resolve(ft.empty())}ifPresent(e){return null!==this.value&&void 0!==this.value&&e(this.value),this}ifPresentAsync(e){return null!==this.value&&void 0!==this.value?e(this.value).then((()=>this)):Promise.resolve(this)}ifAbsent(e){return(null===this.value||void 0===this.value)&&e(),this}ifAbsentAsync(e){return null===this.value||void 0===this.value?e().then((()=>this)):Promise.resolve(this)}getOrFallback(e){return this.value??e()}getOrFallbackAsync(e){return null!==this.value&&void 0!==this.value?Promise.resolve(this.value):e()}getOrThrow(){if(null===this.value||void 0===this.value)throw Error("Optional.value is empty");return this.value}}t.Xx=ft;t.dF=class{constructor(e){this.supplier=e,this.value=null}get(){return this.value||(this.value=this.supplier()),this.value}};t.f7=class{constructor(e){this.supplier=e,this.value=null}async get(){return this.value||(this.value=await this.supplier()),this.value}};class ht{constructor(e){this.value=e,this.children=[]}}function pt(e,t){if(Math.log2(e.length)%1!=0)throw new Error("Array length must be a power of 2");let n=[...e];for(;n.length>1;){const e=[];for(let r=0;r<n.length;r+=2){const a=n[r+1];e.push(t(n[r],a))}n=e}return n[0]}function mt(...e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;return e.forEach((e=>{n.set(e,r),r+=e.length})),n}function dt(e){return 137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]}function gt(e){return 255===e[0]&&216===e[1]}function bt(e){return 87===e[8]&&69===e[9]&&66===e[10]&&80===e[11]}function yt(e,t){const n=new ArrayBuffer(8);return new DataView(n).setBigUint64(0,BigInt(e),"LE"===t),new Uint8Array(n)}function wt(e,t){const n=new Uint8Array(32);let r=e;if("LE"===t){for(let e=0;e<32;e++)n[e]=Number(0xffn&r),r>>=8n;return n}for(let a=31;a>=0;a--)n[a]=Number(0xffn&r),r>>=8n;return n}function Bt(e,t){let n=0n;if("LE"===t){for(let t=31;t>=0;t--)n=n<<8n|BigInt(e[t]);return n}for(let r=0;r<32;r++)n=n<<8n|BigInt(e[r]);return n}function vt(e,t){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.subarray(r,r+t));return n}const Tt=[0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424];function Et(e){for(let t=0;t<24;t++){const n=e[0]^e[10]^e[20]^e[30]^e[40],r=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49],h=l^(a<<1|i>>>31),p=f^(i<<1|a>>>31),m=n^(o<<1|s>>>31),d=r^(s<<1|o>>>31),g=a^(c<<1|u>>>31),b=i^(u<<1|c>>>31),y=o^(l<<1|f>>>31),w=s^(f<<1|l>>>31),B=c^(n<<1|r>>>31),v=u^(r<<1|n>>>31);e[0]^=h,e[1]^=p,e[2]^=m,e[3]^=d,e[4]^=g,e[5]^=b,e[6]^=y,e[7]^=w,e[8]^=B,e[9]^=v,e[10]^=h,e[11]^=p,e[12]^=m,e[13]^=d,e[14]^=g,e[15]^=b,e[16]^=y,e[17]^=w,e[18]^=B,e[19]^=v,e[20]^=h,e[21]^=p,e[22]^=m,e[23]^=d,e[24]^=g,e[25]^=b,e[26]^=y,e[27]^=w,e[28]^=B,e[29]^=v,e[30]^=h,e[31]^=p,e[32]^=m,e[33]^=d,e[34]^=g,e[35]^=b,e[36]^=y,e[37]^=w,e[38]^=B,e[39]^=v,e[40]^=h,e[41]^=p,e[42]^=m,e[43]^=d,e[44]^=g,e[45]^=b,e[46]^=y,e[47]^=w,e[48]^=B,e[49]^=v;const T=e[0],E=e[1],R=e[2]<<1|e[3]>>>31,O=e[3]<<1|e[2]>>>31,x=e[5]<<30|e[4]>>>2,S=e[4]<<30|e[5]>>>2,A=e[6]<<28|e[7]>>>4,D=e[7]<<28|e[6]>>>4,V=e[8]<<27|e[9]>>>5,N=e[9]<<27|e[8]>>>5,I=e[11]<<4|e[10]>>>28,$=e[10]<<4|e[11]>>>28,P=e[13]<<12|e[12]>>>20,z=e[12]<<12|e[13]>>>20,k=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,U=e[17]<<23|e[16]>>>9,L=e[16]<<23|e[17]>>>9,j=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,M=e[20]<<3|e[21]>>>29,_=e[21]<<3|e[20]>>>29,G=e[22]<<10|e[23]>>>22,q=e[23]<<10|e[22]>>>22,H=e[25]<<11|e[24]>>>21,W=e[24]<<11|e[25]>>>21,K=e[26]<<25|e[27]>>>7,X=e[27]<<25|e[26]>>>7,J=e[29]<<7|e[28]>>>25,Z=e[28]<<7|e[29]>>>25,Q=e[31]<<9|e[30]>>>23,Y=e[30]<<9|e[31]>>>23,ee=e[33]<<13|e[32]>>>19,te=e[32]<<13|e[33]>>>19,ne=e[34]<<15|e[35]>>>17,re=e[35]<<15|e[34]>>>17,ae=e[36]<<21|e[37]>>>11,ie=e[37]<<21|e[36]>>>11,oe=e[38]<<8|e[39]>>>24,se=e[39]<<8|e[38]>>>24,ce=e[40]<<18|e[41]>>>14,ue=e[41]<<18|e[40]>>>14,le=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,he=e[45]<<29|e[44]>>>3,pe=e[44]<<29|e[45]>>>3,me=e[47]<<24|e[46]>>>8,de=e[46]<<24|e[47]>>>8,ge=e[48]<<14|e[49]>>>18,be=e[49]<<14|e[48]>>>18;e[0]=T^~P&H,e[1]=E^~z&W,e[2]=P^~H&ae,e[3]=z^~W&ie,e[4]=H^~ae&ge,e[5]=W^~ie&be,e[6]=ae^~ge&T,e[7]=ie^~be&E,e[8]=ge^~T&P,e[9]=be^~E&z,e[10]=A^~j&M,e[11]=D^~C&_,e[12]=j^~M&ee,e[13]=C^~_&te,e[14]=M^~ee&he,e[15]=_^~te&pe,e[16]=ee^~he&A,e[17]=te^~pe&D,e[18]=he^~A&j,e[19]=pe^~D&C,e[20]=R^~k&K,e[21]=O^~F&X,e[22]=k^~K&oe,e[23]=F^~X&se,e[24]=K^~oe&ce,e[25]=X^~se&ue,e[26]=oe^~ce&R,e[27]=se^~ue&O,e[28]=ce^~R&k,e[29]=ue^~O&F,e[30]=V^~I&G,e[31]=N^~$&q,e[32]=I^~G&ne,e[33]=$^~q&re,e[34]=G^~ne&me,e[35]=q^~re&de,e[36]=ne^~me&V,e[37]=re^~de&N,e[38]=me^~V&I,e[39]=de^~N&$,e[40]=x^~U&J,e[41]=S^~L&Z,e[42]=U^~J&Q,e[43]=L^~Z&Y,e[44]=J^~Q&le,e[45]=Z^~Y&fe,e[46]=Q^~le&x,e[47]=Y^~fe&S,e[48]=le^~x&U,e[49]=fe^~S&L,e[0]^=Tt[2*t],e[1]^=Tt[2*t+1]}}function Rt(e){const t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24);return t}function Ot(e,t){if(!e.length){const e=new Uint8Array(136);return e[0]=t,e[135]=128,[Rt(e)]}const n=vt(e,136),r=n[n.length-1];if(r.length<136){const e=new Uint8Array(136);e.set(r),e[r.length]=t,e[135]|=128,n[n.length-1]=e}if(136===r.length){const e=new Uint8Array(136);e[0]=t,e[135]=128,n.push(e)}return n.map(Rt)}function xt(e,t){for(const n of t){for(let t=0;t<34;t+=2)e[t]^=n[t+1],e[t+1]^=n[t];Et(e)}return e}function St(e){return new Uint8Array([e[1],e[1]>>-24,e[1]>>-16,e[1]>>-8,e[0],e[0]>>8,e[0]>>16,e[0]>>24,e[3],e[3]>>-24,e[3]>>-16,e[3]>>-8,e[2],e[2]>>8,e[2]>>16,e[2]>>24,e[5],e[5]>>-24,e[5]>>-16,e[5]>>-8,e[4],e[4]>>8,e[4]>>16,e[4]>>24,e[7],e[7]>>-24,e[7]>>-16,e[7]>>-8,e[6],e[6]>>8,e[6]>>16,e[6]>>24])}function At(e){return St(xt(new Array(50).fill(0),Ot(e,1)))}function Dt(e,t,n=0){if(e.length>=t)return e;const r=new Uint8Array(t);return r.fill(n),r.set(e,t-e.length),r}function Vt(e,t,n=0){if(e.length>=t)return e;const r=new Uint8Array(t);return r.fill(n),r.set(e,0),r}function Nt(e,t){return(e%t+t)%t}function It(e,t){e=Nt(e,t);let[n,r]=[0n,1n],[a,i]=[t,e];for(;0n!==i;){const e=a/i;[n,r]=[r,n-e*r],[a,i]=[i,a-e*i]}if(a>1n)throw new Error("a is not invertible");return n<0n&&(n+=t),n}function $t(e,t){return 0n===Nt(e,t)?0n:t%4n===3n?function(e,t,n){let r=1n;for(e=Nt(e,n);t>0;)t%2n===1n&&(r=Nt(r*e,n)),e=Nt(e*e,n),t/=2n;return r}(e,(t+1n)/4n,t):null}const Pt=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,zt=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,kt=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Ft=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n;function Ut(e,t,n){if(0n===t)return[0n,0n];const r=Nt(3n*e*e*It(2n*t,n),n),a=Nt(r*r-2n*e,n);return[a,Nt(r*(e-a)-t,n)]}function Lt(e,t,n,r,a){if(0n===e&&0n===t)return[n,r];if(0n===n&&0n===r)return[e,t];if(e===n&&t===Nt(-r,a))return[0n,0n];if(e===n&&t===r)return Ut(e,t,a);const i=Nt((r-t)*It(n-e,a),a),o=Nt(i*i-e-n,a);return[o,Nt(i*(e-o)-t,a)]}function jt(e,t,n,r){let a=[0n,0n],i=[e,t];const o=n.toString(2);for(const s of o)"0"===s?(i=Lt(a[0],a[1],i[0],i[1],r),a=Ut(a[0],a[1],r)):(a=Lt(a[0],a[1],i[0],i[1],r),i=Ut(i[0],i[1],r));return a}function Ct(e,t,n){if(t<=0n||t>=zt)throw new Error("Invalid private key");if(n||(n=Nt(Bt(At(mt(At(wt(t,"BE")),wt(e,"BE"))),"BE"),zt)),n<=0n||n>=zt)throw new Error("Invalid nonce");const r=Nt(e,zt),a=jt(kt,Ft,n,Pt),i=Nt(a[0],zt);let o=Nt((r+Nt(i,zt)*t)*It(n,zt),zt);if(0n===i||0n===o)throw new Error("Invalid r or s value");let s=a[1]%2n===0n?27n:28n;return o>zt/2n&&(o=zt-o,s=27n===s?28n:27n),[i,o,s]}class Mt{constructor(e){this.cursor=0,this.buffer=e}read(e){const t=this.buffer.subarray(this.cursor,this.cursor+e);return this.cursor+=e,t}max(){return this.buffer.length-this.cursor}}t.pp=Mt;class _t{constructor(e){this.buffer=e,this.cursor=0}write(e){const t=Math.min(this.max(),e.max());return this.buffer.set(e.read(t),this.cursor),this.cursor+=t,t}max(){return this.buffer.length-this.cursor}}t.$i=_t;class Gt{constructor(e,t=0n){this.span=t,this.writer=new _t(new Uint8Array(e))}build(){return mt(yt(this.span,"LE"),this.writer.buffer)}hash(){const e=pt(vt(this.writer.buffer,32),((e,t)=>Gt.hashFunction(mt(e,t))));return Gt.hashFunction(mt(yt(this.span,"LE"),e))}}t.AA=Gt,Gt.hashFunction=At;class qt{constructor(e,t=4096){this.counters=[1],this.capacity=t,this.chunks=[new Gt(t)],this.onChunk=e}static async root(e,t=4096){const r=new n(n.NOOP,t);return await r.append(e),r.finalize()}async append(e,t=0,n=0n){const r=new Mt(e);for(;r.max()>0;){0===this.chunks[t].writer.max()&&await this.elevate(t);const e=this.chunks[t].writer.write(r);n?this.chunks[t].span+=n:this.chunks[0].span+=BigInt(e)}}async elevate(e){this.counters[e]=++this.counters[e]%(this.capacity/32),this.chunks[e+1]||(this.chunks.push(new Gt(this.capacity)),this.counters.push(1)),await this.append(this.chunks[e].hash(),e+1,this.chunks[e].span),await this.onChunk(this.chunks[e]),this.chunks[e]=new Gt(this.capacity)}async finalize(e=0){return this.chunks[e+1]?1===this.counters[e]?(await this.elevate(e+1),this.chunks[e+1]=this.chunks[e],this.finalize(e+1)):(await this.elevate(e),this.finalize(e+1)):(await this.onChunk(this.chunks[e]),this.chunks[e])}}t.vU=qt,n=qt,qt.NOOP=async e=>{};class Ht{constructor(e,t){if(t<0)throw Error("Scale must be non-negative");this.value=BigInt(e),this.scale=t}static fromDecimalString(e,t){let[n,r]=e.split(".");return r=(r||"").padEnd(t,"0").slice(0,t),new Ht(BigInt(n+r),t)}add(e){return this.assertSameScale(e),new Ht(this.value+e.value,this.scale)}subtract(e){return this.assertSameScale(e),new Ht(this.value-e.value,this.scale)}multiply(e){return new Ht(this.value*e,this.scale)}divmod(e){if(0n===e)throw new Error("Division by zero is not allowed");const t=this.value/e,n=this.value%e;return[new Ht(t,this.scale),new Ht(n,this.scale)]}exchange(e,t,n){if("*"===e){const e=this.value*t.value/10n**BigInt(this.scale);return new Ht(e,n)}this.assertSameScale(t);const r=this.value*10n**BigInt(n)/t.value;return new Ht(r,n)}compare(e){return this.assertSameScale(e),this.value>e.value?1:this.value<e.value?-1:0}toDecimalString(){if(0===this.scale)return this.value.toString();const e=this.value.toString();return`${e.slice(0,-this.scale)||"0"}.${e.slice(-this.scale).padStart(this.scale,"0")}`}toString(){return this.value.toString()}toJSON(){return this.toString()}assertSameScale(e){if(this.scale!==e.scale)throw new Error(`Scale mismatch: expected ${this.scale}, but got ${e.scale}`)}}function Wt(e,t,n,r){const a=e.findIndex((e=>e===`--${t}`||e.startsWith(`--${t}=`))),i=e[a];if(!i)return(n||{})[r||t||""]||null;if(i.includes("="))return i.split("=")[1];const o=e[a+1];return o&&!o.startsWith("-")?o:(n||{})[r||t||""]||null}function Kt(e,t,n,r){const a=Wt(e,t,n,r);if(!a)throw new Error(`Missing argument ${t}`);return a}function Xt(e,t){const n=e[t];e.splice(t,1),e.unshift(n)}function Jt(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Zt(e,t){return{x:e.x*t,y:e.y*t}}function Qt(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function Yt(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function en(e,t,n="row-first"){const r=[];if("column-first"===n)for(let a=0;a<e.length;a++)for(let n=0;n<e[0].length;n++)t(a,n)&&r.push({x:a,y:n});else for(let a=0;a<e[0].length;a++)for(let n=0;n<e.length;n++)t(n,a)&&r.push({x:n,y:a});return r}function tn(e,t,n){return!e[t-1]?.[n]}function nn(e,t,n){return!e[t+1]?.[n]}function rn(e,t,n){return!e[t][n-1]}function an(e,t,n){return!e[t][n+1]}function on(e,t,n){const r=[];return e[t][n]?function(e,t,n){return e[t+1]?.[n]&&e[t-1]?.[n]&&!e[t][n-1]&&!e[t][n+1]}(e,t,n)||function(e,t,n){return e[t][n+1]&&e[t][n-1]&&!e[t-1]?.[n]&&!e[t+1]?.[n]}(e,t,n)?[]:(!e[t-1]?.[n-1]&&tn(e,t,n)&&rn(e,t,n)&&r.push({x:t,y:n}),!e[t+1]?.[n-1]&&nn(e,t,n)&&rn(e,t,n)&&r.push({x:t+1,y:n}),!e[t-1]?.[n+1]&&tn(e,t,n)&&an(e,t,n)&&r.push({x:t,y:n+1}),!e[t+1]?.[n+1]&&nn(e,t,n)&&an(e,t,n)&&r.push({x:t+1,y:n+1}),r):(e[t-1]?.[n]&&e[t][n-1]&&r.push({x:t,y:n}),e[t+1]?.[n]&&e[t][n-1]&&r.push({x:t+1,y:n}),e[t-1]?.[n]&&e[t][n+1]&&r.push({x:t,y:n+1}),e[t+1]?.[n]&&e[t][n+1]&&r.push({x:t+1,y:n+1}),r)}function sn(e,t){return t.map((t=>function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}(e,t))).sort(((e,t)=>e-t))}function cn(e,t,n,r){const a=(r.y-n.y)*(t.x-e.x)-(r.x-n.x)*(t.y-e.y);if(0===a)return null;let i=e.y-n.y,o=e.x-n.x;const s=(r.x-n.x)*i-(r.y-n.y)*o,c=(t.x-e.x)*i-(t.y-e.y)*o;return i=s/a,o=c/a,i>0&&i<1&&o>0&&o<1?{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}:null}function un(e,t,n){const r=[],a=Qt(e,n,1e4);for(const i of t){const t=cn(e,a,i.start,i.end);t&&r.push(t)}return r.length?r.reduce(((t,n)=>Yt(e,n)<Yt(e,t)?n:t)):null}t.ie=Ht;class ln{constructor(){this.subscribers=[]}subscribe(e){return this.subscribers.push(e),()=>{this.subscribers=this.subscribers.filter((t=>t!==e))}}publish(e){this.subscribers.forEach((t=>t(e)))}clear(){this.subscribers=[]}getSubscriberCount(){return this.subscribers.length}}t.Dj=ln;t.O3=class{constructor(e,t){this.queue=[],this.running=0,this.onProcessed=new ln,this.onDrained=new ln,this.concurrency=e,this.capacity=t}process(){if(this.running>=this.concurrency)return;const e=this.queue.shift();e&&(this.running++,e().finally((()=>{this.running--,this.process(),this.onProcessed.publish(),0===this.running&&this.onDrained.publish()})))}enqueue(e){if(this.queue.length<this.capacity)return this.queue.push(e),this.process(),Promise.resolve();if(this.onProcessed.getSubscriberCount())throw Error("Queue capacity is full");return new Promise((t=>{this.onProcessed.subscribe((()=>{this.queue.length<this.capacity&&(this.queue.push(e),this.process(),this.onProcessed.clear(),t())}))}))}drain(){if(0===this.running)return Promise.resolve();if(this.onDrained.getSubscriberCount())throw Error("Already draining");return new Promise((e=>{this.onDrained.subscribe((()=>{this.onDrained.clear(),e()}))}))}};class fn{constructor(){this.forks=new Map}insert(e,t){if(0===e.length)return void(this.handler=t);const n=e[0];let r,a=n;if(n.startsWith(":")&&(a=":",r=n.slice(1)),!this.forks.has(a)){const e=new fn;r&&(e.variableName=r),this.forks.set(a,e)}this.forks.get(a).insert(e.slice(1),t)}async handle(e,t,n,r){if(0===e.length)return!!this.handler&&(await this.handler(t,n,r),!0);const a=e[0],i=this.forks.get(a);if(i)return i.handle(e.slice(1),t,n,r);const o=this.forks.get(":");if(o)return o.variableName&&r.set(o.variableName,decodeURIComponent(a)),o.handle(e.slice(1),t,n,r);const s=this.forks.get("*");return!!s&&(r.set("wildcard",e.join("/")),!!s.handler&&(await s.handler(t,n,r),!0))}}t.g$=fn,t.yI={hexToUint8Array:function(e){(e.startsWith("0x")||e.startsWith("0X"))&&(e=e.slice(2));const t=e.length/2,n=new Uint8Array(t);for(let r=0;r<t;r++){const t=parseInt(e.slice(2*r,2*r+2),16);n[r]=t}return n},uint8ArrayToHex:function(e){return Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")},binaryToUint8Array:function(e){const t=Math.ceil(e.length/8),n=new Uint8Array(t);for(let r=0;r<t;r++){const t=parseInt(e.slice(8*r,8*r+8),2);n[r]=t}return n},uint8ArrayToBinary:function(e){return Array.from(e).map((e=>e.toString(2).padStart(8,"0"))).join("")},base64ToUint8Array:function(e){return Te(e,Be)},uint8ArrayToBase64:function(e){return Ee(e,Be)},base32ToUint8Array:function(e){return Te(e,ve)},uint8ArrayToBase32:function(e){return Ee(e,ve)},log2Reduce:pt,partition:vt,concatBytes:mt,numberToUint8:function(e){return new Uint8Array([e])},uint8ToNumber:function(e){return e[0]},numberToUint16:function(e,t){const n=new ArrayBuffer(2);return new DataView(n).setUint16(0,e,"LE"===t),new Uint8Array(n)},uint16ToNumber:function(e,t){return new DataView(e.buffer).getUint16(e.byteOffset,"LE"===t)},numberToUint32:function(e,t){const n=new ArrayBuffer(4);return new DataView(n).setUint32(0,e,"LE"===t),new Uint8Array(n)},uint32ToNumber:function(e,t){return new DataView(e.buffer).getUint32(e.byteOffset,"LE"===t)},numberToUint64:yt,uint64ToNumber:function(e,t){return new DataView(e.buffer).getBigUint64(e.byteOffset,"LE"===t)},numberToUint256:wt,uint256ToNumber:Bt,sliceBytes:function(e,t){const n=[];let r=0;for(const a of t)n.push(e.subarray(r,r+a)),r+=a;return n},keccak256:At,sha3_256:function(e){return St(xt(new Array(50).fill(0),Ot(e,6)))},proximity:function(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++){const n=e[r]^t[r];for(let e=0;e<8;e++)if(n>>7-e&1)return 8*r+e}return 8*Math.min(e.length,t.length)},commonPrefix:function(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.subarray(0,r);return e.subarray(0,n)},setBit:function(e,t,n,r){const a=Math.floor(t/8),i=t%8;1===n?e[a]|=1<<("BE"===r?7-i:i):e[a]&=~(1<<("BE"===r?7-i:i))},getBit:function(e,t,n){const r=t%8;return e[Math.floor(t/8)]>>("BE"===n?7-r:r)&1},indexOf:function(e,t,n=0){for(let r=n;r<e.length;r++)for(let n=0;n<t.length&&e[r+n]===t[n];n++)if(n===t.length-1)return r;return-1},equals:function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},padStart:Dt,padStartToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:Dt(e,e.length+t-r,n)},padEnd:Vt,padEndToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:Vt(e,e.length+t-r,n)},xorCypher:function(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r%t.length];return n},isUtf8:function(e){for(let t=0;t<e.length;t++){const n=e[t];if(!(n<128))if(192==(224&n)){if(t+1>=e.length||128!=(192&e[t+1]))return!1;t+=1}else if(224==(240&n)){if(t+2>=e.length||128!=(192&e[t+1])||128!=(192&e[t+2]))return!1;t+=2}else{if(240!=(248&n))return!1;if(t+3>=e.length||128!=(192&e[t+1])||128!=(192&e[t+2])||128!=(192&e[t+3]))return!1;t+=3}}return!0}},t.LQ={privateKeyToPublicKey:function(e){if(e<=0n||e>=zt)throw new Error("Invalid private key");return jt(kt,Ft,e,Pt)},compressPublicKey:function(e){const t=e[1]%2n===0n?2:3;return new Uint8Array([t,...wt(e[0],"BE")])},publicKeyFromCompressed:function(e){if(33!==e.length||2!==e[0]&&3!==e[0])throw new Error("Invalid compressed public key");const t=Bt(e.slice(1),"BE"),n=$t(Nt(t**3n+7n,Pt),Pt);if(!n)throw Error("Invalid x: does not correspond to a valid curve point");const r=Nt(-n,Pt),a=n%2n===0n;return[t,2===e[0]?a?n:r:a?r:n]},publicKeyToAddress:function(e){const t=new Uint8Array(20),n=At(mt(wt(e[0],"BE"),wt(e[1],"BE")));return t.set(n.subarray(12)),t},signMessage:function(e,t,n){return Ct(Bt(At(e),"BE"),t,n)},signHash:Ct,verifySignature:function(e,t,n,r){const a=Nt(Bt(At(e),"BE"),zt),i=It(r,zt),o=Nt(a*i,zt),s=Nt(n*i,zt),c=jt(kt,Ft,o,Pt),u=jt(t[0],t[1],s,Pt);return n===Nt(Lt(c[0],c[1],u[0],u[1],Pt)[0],zt)},recoverPublicKey:function(e,t,n,r){const a=$t(Nt(t**3n+7n,Pt),Pt);if(!a)throw new Error("Invalid r: does not correspond to a valid curve point");const i=a%2n===(27n===r?0n:1n)?a:Pt-a,o=Nt(Bt(At(e),"BE"),zt),s=jt(t,i,n,Pt),c=jt(kt,Ft,o,Pt),u=Lt(s[0],s[1],c[0],Nt(-c[1],Pt),Pt);return jt(u[0],u[1],It(t,zt),Pt)},checksumEncode:function(e){const n=t.yI.uint8ArrayToHex(e),r=t.yI.uint8ArrayToHex(t.yI.keccak256(new Uint8Array([...n].map((e=>e.charCodeAt(0))))));let a="0x";for(let t=0;t<n.length;t++)parseInt(r[t],16)>7?a+=n[t].toUpperCase():a+=n[t];return a}},t.o8={intBetween:s,floatBetween:function(e,t,n=Math.random){return n()*(t-e)+e},chance:u,signed:function(){return 2*Math.random()-1},makeSeededRng:function(e){let t=e,n=3405648695,r=3735928559;return function(){return t+=n,n^=t<<7,t*=r,r^=t<<13,t^=n^r,(t>>>0)/4294967296}},point:function(e,t,n,r=Math.random){let a,i;do{a=s(0,e-1,r),i=s(0,t-1,r)}while(n&&c(n,a,i));return[a,i]},procs:function(e,t=Math.random){const n=Math.floor(e);return u(e-n,t)?n+1:n}},t.DO={countUnique:function(e,t,n,r,a){const i=t?e.map(t):e,o={};for(const c of i)o[c]=(o[c]||0)+1;const s=r?ct(o,a?(e,t)=>e[1]-t[1]:(e,t)=>t[1]-e[1]):o;return n?Object.keys(s):s},makeUnique:function(e,t){return Object.values(it(e,t))},splitBySize:function(e,t){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},splitByCount:ot,index:it,indexCollection:function(e,t){const n={};for(const r of e){const e=t(r);n[e]||(n[e]=[]),n[e].push(r)}return n},onlyOrThrow:function(e){if(1===e.length)return e[0];throw Error(`Expected exactly one element, actual: ${e.length}`)},onlyOrNull:function(e){return 1===e.length?e[0]:null},firstOrThrow:function(e){if(!e.length)throw Error("Received empty array");return e[0]},firstOrNull:function(e){return e.length>0?e[0]:null},shuffle:i,initialize:function(e,t){const n=[];for(let r=0;r<e;r++)n.push(t(r));return n},initialize2D:function(e,t,n){const r=[];for(let a=0;a<e;a++){r.push([]);for(let e=0;e<t;e++)r[a].push(n)}return r},rotate2D:function(e){const t=[];for(let n=0;n<e[0].length;n++){t.push([]);for(let r=0;r<e.length;r++)t[n].push(e[r][n])}return t},containsShape:function(e,t,n,r){if(n<0||r<0||r+t[0].length>e[0].length||n+t.length>e.length)return!1;for(let a=0;a<t.length;a++)for(let i=0;i<t[a].length;i++)if(void 0!==t[a][i]&&e[n+a][r+i]!==t[a][i])return!1;return!0},glue:function(e,t){const n=[];for(let r=0;r<e.length;r++)n.push(e[r]),r<e.length-1&&(B(t)?n.push(t()):n.push(t));return n},pluck:function(e,t){return e.map((e=>e[t]))},pick:l,pickMany:function(e,t,n=Math.random){if(t>e.length)throw new Error(`Count (${t}) is greater than array length (${e.length})`);return o(e,t,n).map((t=>e[t]))},pickManyUnique:function(e,t,n,r=Math.random){if(t>e.length)throw new Error(`Count (${t}) is greater than array length (${e.length})`);const a=[];for(;a.length<t;){const t=l(e,r);a.some((e=>n(e,t)))||a.push(t)}return a},pickWeighted:function(e,t,n){if(void 0===n&&(n=Math.random()),e.length!==t.length)throw new Error("Array length mismatch");let r=t.reduce(((e,t)=>e+t),0);const a=n*r;for(let i=0;i<e.length-1;i++)if(r-=t[i],a>=r)return e[i];return f(e)},pickRandomIndices:o,pickGuaranteed:function(e,n,r,a,o,s=Math.random){const c=e.filter((e=>e!==n&&e!==r)),u=[];for(null!==n&&u.push(n);c.length&&u.length<a;){const e=t.o8.intBetween(0,c.length-1,s);o(c[e],u)&&u.push(c[e]),c.splice(e,1)}return i(u,s),{values:u,indexOfGuaranteed:null!==n?u.indexOf(n):-1}},last:f,pipe:h,makePipe:function(e,t){return n=>h(n,e,t)},sortWeighted:function(e,t,n=Math.random){const r=t.map((e=>n()*e)),a=[];for(let i=0;i<e.length;i++)a.push([e[i],r[i]]);return a.sort(((e,t)=>t[1]-e[1])).map((e=>e[0]))},pushAll:G,unshiftAll:function(e,t){Array.prototype.unshift.apply(e,t)},filterAndRemove:function(e,t){const n=[];for(let r=e.length-1;r>=0;r--)t(e[r])&&n.push(e.splice(r,1)[0]);return n},merge:function(e,t){const n=Object.keys(t);for(const r of n)Array.isArray(t[r])&&Array.isArray(e[r])&&G(e[r],t[r])},empty:function(e){return e.splice(0,e.length),e},pushToBucket:function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)},unshiftAndLimit:function(e,t,n){for(e.unshift(t);e.length>n;)e.pop()},atRolling:function(e,t){let n=t%e.length;return n<0&&(n+=e.length),e[n]},group:ut,createOscillator:function(e){let t=0;return{next:()=>e[t++%e.length]}},organiseWithLimits:function(e,t,n,r,a){const i={};for(const o of Object.keys(t))i[o]=[];i[r]=[],a&&(e=e.sort(a));for(const o of e){const e=o[n],a=t[e]?e:r;i[a].length>=t[a]?i[r].push(o):i[a].push(o)}return i},tickPlaybook:function(e){if(0===e.length)return null;const t=e[0];return t.ttlMax?--t.ttl<=0&&e.shift():t.ttlMax=t.ttl,{progress:(t.ttlMax-t.ttl)/t.ttlMax,data:t.data}},getArgument:Wt,getBooleanArgument:function(e,t,n,r){const a=e.some((e=>e.endsWith("-"+t))),i=Wt(e,t,n,r);if(!i&&a)return!0;if(!i&&!a)return null;if(["true","1","yes","y","on"].includes(i.toLowerCase()))return!0;if(["false","0","no","n","off"].includes(i.toLowerCase()))return!1;throw Error(`Invalid boolean argument ${t}: ${i}`)},getNumberArgument:function(e,t,n,r){const a=Wt(e,t,n,r);if(!a)return null;try{return tt(a)}catch{throw new Error(`Invalid number argument ${t}: ${a}`)}},requireStringArgument:Kt,requireNumberArgument:function(e,t,n,r){const a=Kt(e,t,n,r);try{return tt(a)}catch{throw new Error(`Invalid argument ${t}: ${a}`)}},bringToFront:function(e,t){const n=[...e];return Xt(n,t),n},bringToFrontInPlace:Xt,findInstance:function(e,t){const n=e.find((e=>e instanceof t));return ft.of(n)},filterInstances:function(e,t){return e.filter((e=>e instanceof t))},interleave:function(e,t){const n=[],r=Math.max(e.length,t.length);for(let a=0;a<r;a++)e[a]&&n.push(e[a]),t[a]&&n.push(t[a]);return n},toggle:function(e,t){return e.includes(t)?e.filter((e=>e!==t)):[...e,t]},createHierarchy:function(e,t,n,r,a=!1){const i=new Map,o=[];e.forEach((e=>{const n=new ht(e);i.set(e[t],n)})),e.forEach((e=>{const r=i.get(e[t]);if(!r)return;const a=e[n];if(a){const e=i.get(a);e&&e.children.push(r)}else o.push(r)}));const s=e=>{e.children.sort(((e,t)=>{const n=e.value[r],i=t.value[r];return a?i-n:n-i})),e.children.forEach(s)};return o.forEach(s),o},multicall:function(e){return()=>e.forEach((e=>e()))},maxBy:function(e,t){return e.reduce(((e,n)=>t(e)>t(n)?e:n))}},t.iQ={sleepMillis:a,forever:async function(e,t,n){for(;;){try{await e()}catch(r){n&&n("Error in forever",r)}await a(t)}},scheduleMany:function(e,t){for(let n=0;n<e.length;n++){const r=e[n],a=t[n],i=Math.max(0,a.getTime()-Date.now());setTimeout(r,i)}},waitFor:async function(e,t){let n=t.requiredConsecutivePasses||1,r=0;for(let i=0;i<t.attempts;i++){try{if(await e()){if(r++,r>=n)return}else r=0}catch{r=0}i<t.attempts-1&&await a(t.waitMillis)}throw Error("Timed out waiting for predicate")},expandError:function(e,t){if(v(e))return e;const n=Object.keys(e);e.message&&!n.includes("message")&&n.push("message");const r=n.map((t=>`${t}: ${e[t]}`)).join("; ");return t&&e.stack?r+"\n"+e.stack:r},runAndSetInterval:function(e,t){e();const n=setInterval((()=>{e()}),t);return()=>clearInterval(n)},whereAmI:function(){const e=globalThis.process;return e?!0===e.browser?"browser":"node":"browser"}},t.FQ={make:tt,sum:function(e){return e.reduce(((e,t)=>e+t),0)},average:function(e){return e.reduce(((e,t)=>e+t),0)/e.length},median:function(e){const t=[...e].sort(((e,t)=>e-t)),n=Math.floor(t.length/2);return t.length%2==0?(t[n]+t[n-1])/2:t[n]},getDistanceFromMidpoint:function(e,t){return e-(t-1)/2},clamp:nt,range:q,interpolate:function(e,t,n){return e+(t-e)*n},createSequence:function(){let e=0;return{next:()=>e++}},increment:function(e,t,n){const r=e+t;return r>n?n:r},decrement:function(e,t,n){const r=e-t;return r<n?n:r},format:function(e,t){const n=t?.longForm??!1,r=t?.unit?` ${t.unit}`:"",a=n?Ye:et,i=t?.precision??1;if(e<Qe[0])return`${e}${r}`;for(let o=0;o<Qe.length-1;o++)if(e<Qe[o+1])return`${(e/Qe[o]).toFixed(i)}${n?" ":""}${a[o]}${r}`;return`${(e/Qe[Qe.length-1]).toFixed(i)}${n?" ":""}${a[Qe.length-1]}${r}`},fromDecimals:function(e,t,n){let r=e.length-t;if(r<=0)return"0."+"0".repeat(-r)+e+(n?" "+n:"");let a=e.substring(0,r);return""===a&&(a="0"),a+"."+e.substring(r)+(n?" "+n:"")},makeStorage:function(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeDate got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),r=Ge[n];if(!r)throw Error(`Unknown unit: "${n}"`);return t*r},asMegabytes:function(e){return e/1024/1024},convertBytes:function(e,t=1024){return e>=t*t*t*t?(e/t/t/t/t).toFixed(3)+" TB":e>=t*t*t?(e/t/t/t).toFixed(3)+" GB":e>=t*t?(e/t/t).toFixed(3)+" MB":e>=t?(e/t).toFixed(3)+" KB":e+" B"},hexToRgb:function(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e.toLowerCase());if(!t)throw new Error("Invalid hex color: "+e);return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]},rgbToHex:function(e){return"#"+e.map((e=>e.toString(16).padStart(2,"0"))).join("")},haversineDistanceToMeters:function(e,t,n,r){const a=e*Math.PI/180,i=n*Math.PI/180,o=(n-e)*Math.PI/180,s=(r-t)*Math.PI/180,c=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2);return 2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))*6371e3},roundToNearest:d,formatDistance:function(e){return e>1e3?(e/1e3).toFixed(0)+" km":e>=500?d(e,100)+" m":e>=100?d(e,50)+" m":d(e,10)+" m"},triangularNumber:function(e){return e*(e+1)/2},searchFloat:function(e){const t=e.match(/-?\d+(\.\d+)?/);if(!t)throw Error("No float found in "+e);return parseFloat(t[0])}},t.HC={raceFulfilled:async function(e){return r(Promise.all(e.map(r)))},invert:r,runInParallelBatches:async function(e,t=1){const n=ot(e,t),r=[],a=n.map((async e=>{for(const t of e)r.push(await t())}));return await Promise.all(a),r}},t.AO={getTimestamp:function(e,t){const n=new Date(t?.now||Date.now()),r=t?.labels||ze,a=R(e)?e:new Date(e);if(Pe(n)===Pe(a))return r.today(a.getUTCHours(),a.getUTCMinutes(),a.getUTCHours()>12);if(Pe(n)-Pe(a)==1)return r.yesterday();const i=Me(a);return Pe(n)-Pe(a)<7?r[i.day]():r.weeks(Math.round((n.getTime()-a.getTime())/6048e5))},getTimeDelta:Fe,secondsToHumanTime:function(e,t=ke){return Fe(0,{now:1e3*e,labels:t})},countCycles:function(e,t,n){const r=(n?.now??Date.now())-e;return{cycles:Math.floor(r/t),remaining:t/(n?.precision??1)-Math.ceil(r%t/(n?.precision??1))}},isoDate:function(e){return(e||new Date).toISOString().slice(0,10)},throttle:function(e,t){return(!Ue[e]||Date.now()>Ue[e])&&(Ue[e]=Date.now()+t,!0)},timeSince:function(e,t,n){return t=R(t)?t.getTime():t,((n=n?R(n)?n.getTime():n:Date.now())-t)/Le[e]},dateTimeSlug:function(e){return(e||new Date).toISOString().slice(0,19).replace(/T|:/g,"-")},unixTimestamp:function(e){return Math.ceil((e||Date.now())/1e3)},fromUtcString:function(e){const t=new Date(e);return new Date(t.getTime()-6e4*t.getTimezoneOffset())},fromMillis:function(e){return new Date(e)},getProgress:function(e,t,n,r){r||(r=Date.now());const a=r-e,i=a/t,o=i*n;return{deltaMs:a,progress:t/n,baseTimeMs:i,totalTimeMs:o,remainingTimeMs:o-a}},humanizeTime:$e,humanizeProgress:function(e){return`[${Math.floor(100*e.progress)}%] ${$e(e.deltaMs)} out of ${$e(e.totalTimeMs)} (${$e(e.remainingTimeMs)} left) [${Math.round(e.baseTimeMs)} ms each]`},createTimeDigits:Ie,mapDayNumber:Ce,getDayInfoFromDate:Me,getDayInfoFromDateTimeString:function(e){return Me(new Date(e))},seconds:function(e){return 1e3*e},minutes:function(e){return 6e4*e},hours:function(e){return 36e5*e},days:function(e){return 864e5*e},make:function(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeDate got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),r=_e[n];if(!r)throw Error(`Unknown unit: "${n}"`);return t*r},normalizeTime:function(e){let[t,n]=e.split(":");T(parseInt(t,10))||(t="0"),T(parseInt(n,10))||(n="0");let r=nt(U(t),0,23),a=nt(U(n),0,59);return`${Ie(r)}:${Ie(a)}`},absoluteDays:Pe},t.Rb={safeParse:function(e){try{return JSON.parse(e)}catch{return null}},deleteDeep:function(e,t){const n=Z(t,"."),r=Q(t,".");if(!n||!r)return;const a=p(e,n);a&&delete a[r]},getDeep:p,setDeep:m,incrementDeep:function(e,t,n=1){const r=p(e,t)||0;return m(e,t,r+n),r},ensureDeep:function(e,t,n){return p(e,t)||m(e,t,n)},replaceDeep:function(e,t,n){const r=p(e,t);if(!r)throw new Error("Key '"+t+"' does not exist.");return m(e,t,n),r},getFirstDeep:function(e,t,n){for(const r of t){const t=p(e,r);if(t)return t}if(n){const t=Object.values(e);if(t.length)return t[0]}return null},deepMergeInPlace:M,deepMerge2:function(e,t){const n={};return M(n,e),M(n,t),n},deepMerge3:function(e,t,n){const r={};return M(r,e),M(r,t),M(r,n),r},mapAllAsync:async function(e,t){const n=[];for(const r of e)n.push(await t(r));return n},cloneWithJson:function(e){return JSON.parse(JSON.stringify(e))},sortObject:We,sortArray:Ke,sortAny:Xe,deepEquals:Je,deepEqualsEvery:function(...e){for(let t=1;t<e.length;t++)if(!Je(e[t-1],e[t]))return!1;return!0},runOn:function(e,t){return t(e),e},ifPresent:function(e,t){e&&t(e)},zip:_,zipSum:function(e){return _(e,((e,t)=>e+t))},removeEmptyArrays:function(e){for(const t of Object.keys(e))(y(e[t])||Array.isArray(e[t])&&e[t].every((e=>null==e)))&&delete e[t];return e},removeEmptyValues:function(e){for(const t of Object.entries(e))(null===t[1]||void 0===t[1]||v(t[1])&&O(t[1]))&&delete e[t[0]];return e},flatten:function(e,t=!1,n){return at({},e,n||"",!1,t)},unflatten:function e(t){if(!g(t))return t;const n=Array.isArray(t)?[]:{};for(const[r,a]of Object.entries(t))Array.isArray(a)?m(n,r,a.map((t=>e(t)))):m(n,r,a);return n},match:function(e,t,n){return t[e]?t[e]:n},sort:ct,map:function(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n},mapIterable:function(e,t){const n=[];let r=0;for(const a of e)n.push(t(a,r++));return n},filterKeys:function(e,t){const n={};for(const[r,a]of Object.entries(e))t(r)&&(n[r]=a);return n},filterValues:function(e,t){const n={};for(const[r,a]of Object.entries(e))t(a)&&(n[r]=a);return n},rethrow:async function(e,t){try{return await e()}catch{throw t}},setSomeOnObject:function(e,t,n){null!=n&&(e[t]=n)},setSomeDeep:function(e,t,n,r){const a=p(n,r);null!=a&&m(e,t,a)},flip:function(e){const t={};for(const[n,r]of Object.entries(e))t[r]=n;return t},getAllPermutations:function(e){const t=Object.keys(e),n=t.map((t=>e[t].length)),r=n.reduce(((e,t)=>e*t));let a=1;const i=[1];for(let s=0;s<n.length-1;s++)a*=n[s],i.push(a);const o=[];for(let s=0;s<r;s++){const n={};for(let r=0;r<t.length;r++){const a=e[t[r]],o=Math.floor(s/i[r])%a.length;n[t[r]]=a[o]}o.push(n)}return o},countTruthyValues:function(e){return Object.values(e).filter((e=>e)).length},transformToArray:function(e){const t=[],n=Object.keys(e),r=e[n[0]].length;for(let a=0;a<r;a++){const r={};for(const t of n)r[t]=e[t][a];t.push(r)}return t},setMulti:function(e,t,n){for(const r of e)r[t]=n},incrementMulti:function(e,t,n=1){for(const r of e)r[t]+=n},createBidirectionalMap:function(){return{map:new Map,keys:[]}},createTemporalBidirectionalMap:function(){return{map:new Map,keys:[]}},pushToBidirectionalMap:lt,unshiftToBidirectionalMap:function(e,t,n,r=100){if(e.map.has(t)){const n=e.keys.indexOf(t);e.keys.splice(n,1)}if(e.map.set(t,n),e.keys.unshift(t),e.keys.length>r){const t=e.keys.shift();t&&e.map.delete(t)}},addToTemporalBidirectionalMap:function(e,t,n,r,a=100){lt(e,t,{validUntil:Date.now()+r,data:n},a)},getFromTemporalBidirectionalMap:function(e,t){const n=e.map.get(t);return n&&n.validUntil>Date.now()?n.data:null},createStatefulToggle:function(e){let t;return n=>{const r=n===e&&t!==e;return t=n,r}},diffKeys:function(e,t){const n=Object.keys(e),r=Object.keys(t);return{uniqueToA:n.filter((e=>!r.includes(e))),uniqueToB:r.filter((e=>!n.includes(e)))}},pickRandomKey:Ze,mapRandomKey:function(e,t){const n=Ze(e);return e[n]=t(e[n]),n},fromObjectString:function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/(\w+)\((.+)\)/g,((e,t,n)=>`${t}(${n.replaceAll(",",",")})`))).replace(/(,)(\s+})/g,"$2")).replace(/\.\.\..+?,/g,"")).replace(/({\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',")).replace(/(,\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',")).replace(/:(.+)\?(.+):/g,((e,t,n)=>`: (${t.trim()} && ${n.trim()}) ||`))).replace(/([a-zA-Z0-9]+)( ?: ?{)/g,'"$1"$2')).replace(/([a-zA-Z0-9]+) ?: ?(.+?)(,|\n|})/g,((e,t,n,r)=>`"${t}":"${n.trim()}"${r}`))).replace(/("'|'")/g,'"')).replaceAll(",",","),JSON.parse(e)},toQueryString:Ne,parseQueryString:function(e){const t={},n=e.split("&");for(const r of n){const[e,n]=r.split("=");e&&n&&(t[e]=decodeURIComponent(n))}return t},hasKey:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},selectMax:function(e,t){let n=null,r=-1/0;for(const[a,i]of Object.entries(e)){const e=t(i);e>r&&(r=e,n=a)}return n?[n,e[n]]:null},reposition:function(e,t,n,r){const a=e.find((e=>e[t]===n)),i=e.find((e=>e[t]===n+r));a&&i?(a[t]=n+r,i[t]=n):a&&(a[t]=n+r),e.sort(((e,n)=>F(e[t])-F(n[t]))),e.forEach(((e,n)=>e[t]=n+1))},unwrapSingleKey:function(e){const t=Object.keys(e);if(1===t.length)return e[t[0]];throw new Error("Expected object to have a single key")},parseKeyValues:function(e,t=":"){return Object.fromEntries(e.map((e=>Y(e,t))).map((e=>e[0]&&e[1]?[re(e[0]),re(e[1])]:null)).filter((e=>e)))}},t.Or={isFunction:B,isObject:g,isStrictlyObject:b,isEmptyArray:y,isEmptyObject:function(e){return b(e)&&0===Object.keys(e).length},isUndefined:w,isString:v,isNumber:T,isBoolean:E,isDate:R,isBlank:O,isId:x,isIntegerString:S,isHexString:A,isUrl:j,isNullable:function(e,t){return null==t||e(t)},asString:z,asHexString:function(e,t){if(!A(e))throw new TypeError(`Expected hex string${t?.name?` for ${t.name}`:""}, got: `+e);const n=e.replace(/^0x/,"");if(n.length%2!=0)throw RangeError(`Expected even number of hex digits${t?.name?` for ${t.name}`:""}; got: `+e);if(t&&t.byteLength&&n.length!==2*t.byteLength)throw RangeError(`Expected hex string${t?.name?` for ${t.name}`:""} of byte length ${t.byteLength}; got: `+n);return n},asSafeString:function(e,t){if(!z(e,t).split("").every((e=>"_"===e||ce(e))))throw new TypeError(`Expected safe string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asIntegerString:function(e,t){if(!S(e))throw new TypeError(`Expected integer string${t?.name?` for ${t.name}`:""}, got: `+e);const n=BigInt(e);if(t&&(t.min&&n<t.min||t.max&&n>t.max))throw RangeError(`Expected integer string${t?.name?` for ${t.name}`:""} in range: ${t.min??"-inf"}..${t.max??"inf"}; got: `+n);return e},asNumber:F,asFunction:function(e,t){if(!B(e))throw new TypeError(`Expected function${t?.name?` for ${t.name}`:""}, got: `+e);return e},asInteger:U,asBoolean:function(e,t){if("true"===e)return!0;if("false"===e)return!1;if(!E(e))throw new TypeError(`Expected boolean${t?.name?` for ${t.name}`:""}, got: `+e);return e},asDate:function(e,t){if(!R(e))throw new TypeError(`Expected date${t?.name?` for ${t.name}`:""}, got: `+e);return e},asNullableString:function(e){return O(e)?null:e},asEmptiableString:function(e,t){if(!v(e))throw new TypeError(`Expected string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asId:function(e,t){if(x(e))return e;const n=parseInt(e,10);if(!x(n))throw new TypeError(`Expected id${t?.name?` for ${t.name}`:""}, got: `+e);return n},asTime:function(e,t){if(!v(e))throw new TypeError(`Expected time${t?.name?` for ${t.name}`:""}, got: `+e);const n=e.split(":");if(2!==n.length)throw new TypeError(`Expected time${t?.name?` for ${t.name}`:""}, got: `+e);const r=parseInt(n[0],10),a=parseInt(n[1],10);if(!T(r)||!T(a)||r<0||r>23||a<0||a>59)throw new TypeError(`Expected time, got${t?.name?` for ${t.name}`:""}: `+e);return`${String(r).padStart(2,"0")}:${String(a).padStart(2,"0")}`},asArray:function(e,t){if(!Array.isArray(e))throw new TypeError(`Expected array${t?.name?` for ${t.name}`:""}, got: `+e);return e},asObject:L,asNullableObject:function(e,t){return null===e?null:L(e,t)},asStringMap:function(e,t){const n=L(e,t);for(const r of Object.keys(n))if(!v(n[r]))throw new TypeError(`Expected string map${t?.name?` for ${t.name}`:""}, got: `+e);return n},asNumericDictionary:function(e,t){const n=L(e),r=Object.keys(n),a=Object.values(n);if(!r.every(v)||!a.every(T))throw new TypeError(`Expected numeric dictionary${t?.name?` for ${t.name}`:""}, got: `+e);return n},asUrl:function(e,t){if(!j(e))throw new TypeError(`Expected url${t?.name?` for ${t.name}`:""}, got: `+e);return e},asNullable:function(e,t){return null==t?null:e(t)},asOptional:function(e,t){return null==t?void 0:e(t)},enforceObjectShape:C,enforceArrayShape:function(e,t){return e.every((e=>C(e,t)))},isPng:dt,isJpg:gt,isWebp:bt,isImage:function(e){return dt(e)||gt(e)||bt(e)}},t.DH={tokenizeByCount:function(e,t){return st(e,Math.ceil(e.length/t))},tokenizeByLength:st,searchHex:function(e,t){const n=new RegExp(`[0-9a-f]{${t}}`,"i"),r=e.match(n);return r?r[0]:null},searchSubstring:function(e,t,n=D){const r=ee(e,n);for(const a of r)if(t(a))return a;return null},randomHex:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=P[Math.floor(16*t())];return n},randomLetter:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=V[Math.floor(26*t())];return n},randomAlphanumeric:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=N[Math.floor(62*t())];return n},randomRichAscii:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=I[Math.floor(89*t())];return n},randomUnicode:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=$[Math.floor(t()*$.length)];return n},includesAny:function(e,t){return t.some((t=>e.includes(t)))},slugify:H,normalForm:function(e){return H(e).replaceAll("-","")},enumify:function(e){return H(e).replace(/-/g,"_").toUpperCase()},escapeHtml:function(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},decodeHtmlEntities:function(e){let t=e.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(t))).replace(/&#x(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,16))));for(const[n,r]of Object.entries(K))t=t.replaceAll(n,r);return t},after:J,afterLast:Q,before:X,beforeLast:Z,betweenWide:function(e,t,n){const r=Z(e,n);return r?J(r,t):null},betweenNarrow:function(e,t,n){const r=J(e,t);return r?X(r,n):null},getPreLine:function(e){return e.replace(/ +/g," ").replace(/^ /gm,"")},containsWord:Se,containsWords:function(e,t,n){return"any"===n?t.some((t=>Se(e,t))):t.every((t=>Se(e,t)))},joinUrl:He,getFuzzyMatchScore:W,sortByFuzzyScore:function(e,t){return e.filter((e=>W(e,t))).sort(((e,n)=>W(n,t)-W(e,t)))},splitOnce:Y,splitAll:ee,randomize:function(e,t=Math.random){return e.replace(/\{(.+?)\}/g,((e,n)=>l(n.split("|"),t)))},expand:function e(t){const n=t.match(/\{(.+?)\}/);if(!n||!n.index)return[t];const r=n[1].split(","),a=t.slice(0,n.index),i=t.slice(n.index+n[0].length);let o=[];for(const s of r){const t=e(a+s+i);o=o.concat(t)}return o},shrinkTrim:re,capitalize:ae,decapitalize:ie,csvEscape:function(e){return e.match(/"|,/)?`"${e.replace(/"/g,'""')}"`:e},parseCsv:function(e,t=",",n='"'){const r=[];let a="",i=!1;const o=e.split("");for(const s of o)s!==t||i?s!==n||(a||i)&&!i?a+=s:i=!i:(r.push(a),a="");return r.push(a),r},surroundInOut:function(e,t){return t+e.split("").join(t)+t},getExtension:te,getBasename:ne,normalizeEmail:function(e){let[t,n]=e.split("@");t=re(t.replaceAll(".","").toLowerCase()).replaceAll(" ","");const[r]=t.split("+");if(!r||!n||-1===n.indexOf(".")||n.indexOf(".")===n.length-1)throw new Error("Invalid email");return n=re(n.toLowerCase()).replaceAll(" ",""),`${r}@${n}`},normalizeFilename:function(e){const t=ne(e),n=te(e);return n?`${t}.${n}`:t},parseFilename:function(e){const t=ne(e),n=te(e);return{basename:t,extension:n,filename:n?`${t}.${n}`:t}},camelToTitle:function(e){return ae(e.replace(/([A-Z])/g," $1"))},slugToTitle:function(e){return e.split("-").map(ae).join(" ")},slugToCamel:function(e){return ie(e.split("-").map(ae).join(""))},joinHumanly:function(e,t=", ",n=" and "){return e&&e.length?1===e.length?e[0]:2===e.length?`${e[0]}${n}${e[1]}`:`${e.slice(0,e.length-1).join(t)}${n}${e[e.length-1]}`:""},findWeightedPair:ye,extractBlock:we,extractAllBlocks:function(e,t){const n=[];let r=t.wordBoundary?me(e,[`${t.opening} `,`${t.opening}\n`],t.start||0):e.indexOf(t.opening,t.start||0);for(;;){if(-1===r)return n;const a=we(e,{...t,start:r});if(!a)return n;n.push(a),r=t.wordBoundary?me(e,[`${t.opening} `,`${t.opening}\n`],r+a.length):e.indexOf(t.opening,r+a.length)}},replaceBlocks:function(e,n,r){let a=0;for(;;){const i=t.DH.extractBlock(e,{...r,start:a});if(!i)return e;const o=n(i);a=e.indexOf(i,a)+o.length,e=e.replace(i,o)}},indexOfEarliest:me,lastIndexOfBefore:be,parseHtmlAttributes:function(e){const t={},n=e.match(/([a-z\-]+)="([^"]+)"/g);if(n)for(const r of n){const[e,n]=Y(r,"=");t[e]=n.slice(1,n.length-1)}return t},readNextWord:Ae,readWordsAfterAll:function(e,t,n=[]){const r=pe(e,t),a=[];for(const i of r)a.push(Ae(e,i+t.length,n));return a},resolveVariables:function(e,t,n="$",r=":"){for(const a in t)e=De(e,a,t[a],n,r);return e=Ve(e)},resolveVariableWithDefaultSyntax:De,resolveRemainingVariablesWithDefaults:Ve,isLetter:oe,isDigit:se,isLetterOrDigit:ce,isValidObjectPathCharacter:function(e){return ce(e)||"."===e||"["===e||"]"===e||"_"===e},insert:function(e,t,n,r,a){return e.slice(0,t)+r+e.slice(t,t+n)+a+e.slice(t+n)},indexOfRegex:fe,allIndexOf:pe,lineMatches:he,linesMatchInOrder:function(e,t,n=!0){let r=0;for(const a of t){let t=!1;for(;!t&&r<e.length;)he(e[r],a,n)&&(t=!0),r++;if(!t)return!1}return!0},represent:function e(t,n="json",r=0){if(t&&B(t.represent)){const e=t.represent();if(v(e))return"json"===n&&0===r?JSON.stringify(e):e}if(g(t,!1)){if(r>1)return"[object Object]";if("json"===n){if(Array.isArray(t)){const n=t.map((t=>e(t,"json",r+1)));return 0===r?JSON.stringify(n):n}const n={};t.message&&(n.message=e(t.message,"json",r+1));for(const[a,i]of Object.entries(t))n[a]=e(i,"json",r+1);return 0===r?JSON.stringify(n):n}if("key-value"===n){const n=Object.keys(t);return t.message&&!n.includes("message")&&n.unshift("message"),n.map((n=>`${n}=${JSON.stringify(e(t[n],"json",r+1))}`)).join(" ")}}return w(t)&&(t="undefined"),0===r?JSON.stringify(t):t},resolveMarkdownLinks:function(e,t){let n=e.indexOf("](");for(;-1!==n;){const r=be(e,"[",n),a=e.indexOf(")",n);if(-1!==r&&-1!==a){const[n,i]=e.slice(r+1,a).split("]("),o=t(n,i);e=e.slice(0,r)+o+e.slice(a+1)}n=e.indexOf("](",n+1)}return e},buildUrl:function(e,t,n){return He([e,t])+Ne(n||{})},isChinese:function(e){return/^[\u4E00-\u9FA5]+$/.test(e)},replaceBetweenStrings:function(e,t,n,r,a=!0){const i=e.indexOf(t),o=e.indexOf(n,i+t.length);if(-1===i||-1===o)throw Error("Start or end not found");return a?e.substring(0,i+t.length)+r+e.substring(o):e.substring(0,i)+r+e.substring(o+n.length)},describeMarkdown:function(e){let t="p";return e.startsWith("#")?(t="h1",e=e.slice(1).trim()):e.startsWith("-")&&(t="li",e=e.slice(1).trim()),{type:t,isCapitalized:e[0]===e[0].toUpperCase(),hasPunctuation:/[.?!]$/.test(e),endsWithColon:/:$/.test(e)}},isBalanced:function(e,t="(",n=")"){let r=0,a=0;for(;a<e.length;)if(e.startsWith(t,a)?(r++,a+=t.length):e.startsWith(n,a)?(r--,a+=n.length):a++,r<0)return!1;return t===n?r%2==0:0===r},textToFormat:function(e){let t=(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).length;for(;(e=e.replace(/(\w+)[\s,']+\w+/g,"$1")).length!==t;)t=e.length;return e=(e=(e=e.replaceAll(/[A-Z][a-zA-Z0-9]*/g,"A")).replaceAll(/[a-z][a-zA-Z0-9]*/g,"a")).replaceAll(/[\u4E00-\u9FA5]+/g,"Z")},splitFormatting:function(e,t){const n=[];let r=0;for(;r<e.length;){const a=e.indexOf(t,r);if(-1===a){n.push({string:e.slice(r),symbol:null});break}const i=e.indexOf(t,a+t.length);if(a>r&&-1!==i&&n.push({string:e.slice(r,a),symbol:null}),-1===i){n.push({string:e.slice(r),symbol:null});break}n.push({string:e.slice(a+t.length,i),symbol:t}),r=i+t.length}return n},splitHashtags:function(e){const t=[];let n=0;for(;n<e.length;){const r=ge(e,n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const a=de(e,r+1);if(-1===a){t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r+1),symbol:"#"});break}r>n&&t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r+1,a),symbol:"#"}),n=a}return t},splitUrls:function(e){const t=[];let n=0;for(;n<e.length;){const r=me(e,["http://","https://"],n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const a=me(e,[" ","\n"],r);if(-1===a){r>n&&t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r),symbol:"http"});break}r>n&&t.push({string:e.slice(n,r),symbol:null}),t.push({string:e.slice(r,a),symbol:"http"}),n=a}return t},route:function(e,t){const n=e.split("/").filter((e=>e)),r=t.split("/").filter((e=>e));if(n.length!==r.length)return null;const a={};for(let i=0;i<n.length;i++){const e=n[i];if(e.startsWith(":"))a[e.slice(1)]=r[i];else if(e!==r[i])return null}return a},explodeReplace:Re,generateVariants:function(e,n,r,a=Math.random){const i=t.DO.shuffle(n.map((e=>({variants:t.DO.shuffle(e.variants.map((e=>e)),a),avoid:e.avoid}))),a),o=[];for(const t of i){const n=t.variants.filter((e=>e!==t.avoid)),a=n.find((t=>e.includes(t)));if(a&&(G(o,Re(e,a,n)),o.length>=r))break}if(o.length<r)for(const t of i){const n=t.variants.find((t=>e.includes(t)));if(n&&(G(o,Re(e,n,t.variants)),o.length>=r))break}return o.slice(0,r)},replaceWord:function(e,t,n,r=!1){const a=new RegExp(r?`(?<=\\s|^)${t}(?=\\s|$)`:`\\b${t}\\b`,"g");return e.replace(a,n)},replacePascalCaseWords:function(e,t){return e.replace(/\b[A-Z][a-zA-Z0-9]*\b/g,(e=>e.toUpperCase()===e?e:t(e)))},stripHtml:function(e){return e.replace(/<[^>]*>/g,"")},breakLine:Oe,measureTextWidth:function(e,t={}){return[...e].reduce(((e,n)=>e+(t[n]||1)),0)},toLines:function(e,t,n={}){const r=[];let a="",i=0;for(let o=0;o<e.length;o++){const s=e[o];if(a+=s,i+=n[s]||1,i>t){const{line:e,rest:t}=Oe(a);r.push(e),a=t,i=t.split("").map((e=>n[e]||1)).reduce(((e,t)=>e+t),0)}}return a&&r.push(a),r},levenshteinDistance:function(e,t){const n=[];for(let r=0;r<=e.length;r++)n[r]=[r];for(let r=0;r<=t.length;r++)n[0][r]=r;for(let r=1;r<=e.length;r++)for(let a=1;a<=t.length;a++){const i=e[r-1]===t[a-1]?0:1;n[r][a]=Math.min(n[r-1][a]+1,n[r][a-1]+1,n[r-1][a-1]+i)}return n[e.length][t.length]},findCommonPrefix:xe,findCommonDirectory:function(e){const t=xe(e),n=t.lastIndexOf("/");return-1===n?"":t.slice(0,n+1)}},t.mW={asEqual:function(e,t){if(e!==t)throw Error(`Expected [${e}] to equal [${t}]`);return[e,t]},asTrue:function(e){if(!0!==e)throw Error(`Expected [true], got: [${e}]`);return e},asTruthy:function(e){if(!e)throw Error(`Expected truthy value, got: [${e}]`);return e},asFalse:function(e){if(!1!==e)throw Error(`Expected [false], got: [${e}]`);return e},asFalsy:function(e){if(e)throw Error(`Expected falsy value, got: [${e}]`);return e},asEither:function(e,t){if(!t.includes(e))throw Error(`Expected any of [${t.join(", ")}], got: [${e}]`);return e}},t.l2={get:async function(e,t,n){const r=Date.now(),a=qe[e];if(a&&a.validUntil>r)return a.value;const i=await n(),o=r+t;return qe[e]={value:i,validUntil:o},i},invalidate:function(e){delete qe[e]}},t.Mi={addPoint:Jt,subtractPoint:function(e,t){return{x:e.x-t.x,y:e.y-t.y}},multiplyPoint:Zt,normalizePoint:function(e){const t=Math.sqrt(e.x*e.x+e.y*e.y);return{x:e.x/t,y:e.y/t}},pushPoint:Qt,filterCoordinates:en,findCorners:function(e,t,n,r){const a=[{x:0,y:0},{x:n,y:0},{x:0,y:r},{x:n,y:r}];for(let i=0;i<e.length;i++)for(let t=0;t<e[0].length;t++){const n=on(e,i,t);for(const e of n)a.some((t=>t.x===e.x&&t.y===e.y))||a.push(e)}return a.map((e=>({x:e.x*t,y:e.y*t})))},findLines:function(e,t){const n=en(e,((t,n)=>0===e[t][n]&&0!==e[t][n+1]),"row-first").map((e=>({...e,dx:1,dy:0}))),r=en(e,((t,n)=>0===e[t][n]&&0!==e[t][n-1]),"row-first").map((e=>({...e,dx:1,dy:0}))),a=en(e,((t,n)=>0===e[t][n]&&0!==e[t-1]?.[n]),"column-first").map((e=>({...e,dx:0,dy:1}))),i=en(e,((t,n)=>0===e[t][n]&&0!==e[t+1]?.[n]),"column-first").map((e=>({...e,dx:0,dy:1})));return n.forEach((e=>e.y++)),i.forEach((e=>e.x++)),[...ut([...a,...i],((e,t)=>e.x===t.x&&e.y-1===t.y)),...ut([...r,...n],((e,t)=>e.y===t.y&&e.x-1===t.x))].map((e=>({start:e[0],end:f(e)}))).map((e=>({start:Zt(e.start,t),end:Zt(Jt(e.end,{x:e.start.dx,y:e.start.dy}),t)})))},raycast:un,raycastCircle:function(e,t,n){const r=sn(e,n),a=[];for(const i of r){const n=un(e,t,i-.001),r=un(e,t,i+.001);n&&a.push(n),r&&a.push(r)}return a},getLineIntersectionPoint:cn}},2909:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},7666:(e,t,n)=>{var r=null;"undefined"!=typeof WebSocket?r=WebSocket:"undefined"!=typeof MozWebSocket?r=MozWebSocket:void 0!==n.g?r=n.g.WebSocket||n.g.MozWebSocket:"undefined"!=typeof window?r=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(r=self.WebSocket||self.MozWebSocket),e.exports=r},5963:(e,t,n)=>{const r=n(9527),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=n(7197),{safeRe:o,t:s}=n(3423),c=n(676),{compareIdentifiers:u}=n(9956);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw new TypeError(`version is longer than ${a} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?o[s.LOOSE]:o[s.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],a=e.prerelease[t];if(r("prerelease compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return-1;if(n!==a)return u(n,a)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const n=this.build[t],a=e.build[t];if(r("build compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return-1;if(n!==a)return u(n,a)}while(++t)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},5359:(e,t,n)=>{const r=n(5963);e.exports=(e,t)=>new r(e,t).major},7197:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},9527:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},9956:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const r=t.test(e),a=t.test(n);return r&&a&&(e=+e,n=+n),e===n?0:r&&!a?-1:a&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},676:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},3423:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=n(7197),o=n(9527),s=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.t={};let f=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[h,a]],m=(e,t,n)=>{const r=(e=>{for(const[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),a=f++;o(e,a,t),l[e]=a,u[a]=t,s[a]=new RegExp(t,n?"g":void 0),c[a]=new RegExp(r,n?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),m("FULL",`^${u[l.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),m("LOOSE",`^${u[l.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),m("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?`+`(?:${u[l.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[l.COERCE],!0),m("COERCERTLFULL",u[l.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},6497:()=>{},4061:()=>{},7320:()=>{}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{BRANCHES:()=>J,BZZ:()=>ce,BatchId:()=>$,Bee:()=>wn,BeeArgumentError:()=>L,BeeDev:()=>Bn,BeeError:()=>U,BeeModes:()=>W,BeeResponseError:()=>j,Bytes:()=>w,CHUNK_SIZE:()=>Z,DAI:()=>ue,Duration:()=>se,EthAddress:()=>S,FEED_INDEX_HEX_LENGTH:()=>re,FeedIndex:()=>F,Identifier:()=>A,MantarayNode:()=>un,MerkleTree:()=>p,NULL_ADDRESS:()=>On,NULL_IDENTIFIER:()=>xn,NULL_OWNER:()=>Sn,NULL_STAMP:()=>En,NULL_TOPIC:()=>Rn,PSS_TARGET_HEX_LENGTH_MAX:()=>Q,PeerAddress:()=>I,PrivateKey:()=>O,PublicKey:()=>x,RedundancyLevel:()=>ae,RedundancyStrategy:()=>ie,Reference:()=>D,SECTION_SIZE:()=>X,STAMPS_DEPTH_MAX:()=>ee,STAMPS_DEPTH_MIN:()=>Y,SUPPORTED_BEE_VERSION:()=>Mt,SUPPORTED_BEE_VERSION_EXACT:()=>Ct,SWARM_GATEWAY_URL:()=>Tn,Signature:()=>P,Size:()=>$t,Span:()=>N,Stamper:()=>vn,TAGS_LIMIT_MAX:()=>ne,TAGS_LIMIT_MIN:()=>te,Topic:()=>z,TransactionId:()=>V,Utils:()=>e,capacityBreakpoints:()=>oe,toBeeMode:()=>K});var e={};n.r(e),n.d(e,{approximateOverheadForRedundancyLevel:()=>Fn,getAmountForDuration:()=>De,getCollectionSize:()=>bt,getDepthForSize:()=>Ve,getFolderSize:()=>mn,getRedundancyStat:()=>_n,getRedundancyStats:()=>Mn,getStampCost:()=>Se,getStampDuration:()=>Ae,getStampEffectiveBytes:()=>Oe,getStampEffectiveBytesBreakpoints:()=>xe,getStampTheoreticalBytes:()=>Ee,getStampUsage:()=>Te,makeCollectionFromFileList:()=>gt,makeMaxTarget:()=>An});var t=n(7020);t.DO,t.mW;const a=t.yI,i=(t.l2,t.AO),o=t.LQ,s=t.FQ,c=t.Rb,u=(t.Pagination,t.HC,t.o8,t.DH),l=t.iQ,f=t.Or,h=t.Xx,p=(t.Mi,t.Dj,t.AA,t.vU),m=t.ie,d=(t.dF,t.f7,t.O3),g=t.pp,b=(t.$i,t.g$,new TextDecoder),y=new TextEncoder;class w{constructor(e,t){if(e instanceof w?this.bytes=e.bytes:"string"==typeof e?this.bytes=a.hexToUint8Array(f.asHexString(e,{name:"Bytes#constructor(bytes)"})):e instanceof ArrayBuffer?this.bytes=new Uint8Array(e):this.bytes=e,this.length=this.bytes.length,t)if(Array.isArray(t)){if(!t.includes(this.length))throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t.join(" or ")}`)}else if(this.length!==t)throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t}`)}static keccak256(e){return new w(a.keccak256(new w(e).toUint8Array()))}static fromUtf8(e){return new w(y.encode(e))}static fromSlice(e,t,n){return new w(void 0===n?e.slice(t):e.slice(t,t+n))}offset(e){return new Uint8Array(this.bytes.slice(e))}toUint8Array(){return new Uint8Array(this.bytes)}toHex(){return a.uint8ArrayToHex(this.bytes)}toBase64(){return a.uint8ArrayToBase64(this.bytes)}toBase32(){return a.uint8ArrayToBase32(this.bytes)}toString(){return this.toHex()}toUtf8(){return b.decode(this.bytes)}toJSON(){return JSON.parse(this.toUtf8())}equals(e){return this.toHex()===new w(e).toHex()}represent(){return this.toHex()}}function B(e){const t=e.match(/^([\d.]+)\s*(B|kB|MB|GB|TB|PB)$/);if(!t)throw new Error(`Invalid size format: ${e}`);const n=parseFloat(t[1]),r=t[2];return Math.ceil(n*{B:1,kB:1e3,MB:1e6,GB:1e3**3,TB:1e3**4,PB:1e3**5}[r])}const v=250,T=251,E={[v]:"manifest",[T]:"feed"};const R=new TextEncoder;class O extends w{static LENGTH=32;constructor(e){super(e,32)}publicKey(){const[e,t]=o.privateKeyToPublicKey(a.uint256ToNumber(this.bytes,"BE"));return new x(a.concatBytes(a.numberToUint256(e,"BE"),a.numberToUint256(t,"BE")))}sign(e){const t=a.concatBytes(R.encode("Ethereum Signed Message:\n32"),a.keccak256(e instanceof Uint8Array?e:R.encode(e))),[n,r,i]=o.signMessage(t,a.uint256ToNumber(this.bytes,"BE"));return new P(a.concatBytes(a.numberToUint256(n,"BE"),a.numberToUint256(r,"BE"),new Uint8Array([Number(i)])))}}class x extends w{static LENGTH=64;constructor(e){const t=new w(e);if(33===t.length){const[e,n]=o.publicKeyFromCompressed(t.toUint8Array());super(a.concatBytes(a.numberToUint256(e,"BE"),a.numberToUint256(n,"BE")),64)}else super(e,64)}address(){const e=a.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=a.uint256ToNumber(this.bytes.slice(32,64),"BE");return new S(o.publicKeyToAddress([e,t]))}toCompressedUint8Array(){const e=a.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=a.uint256ToNumber(this.bytes.slice(32,64),"BE");return o.compressPublicKey([e,t])}toCompressedHex(){return a.uint8ArrayToHex(this.toCompressedUint8Array())}}class S extends w{static LENGTH=20;constructor(e){super(e,20)}toChecksum(){return o.checksumEncode(this.bytes)}}class A extends w{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new A(a.keccak256(R.encode(e)))}}class D extends w{static LENGTH=32;constructor(e){if("string"==typeof e&&e.startsWith("bah5")){const t=function(e){const t=a.base32ToUint8Array(e.toUpperCase().slice(1)),n=t[1];if(!E[n])throw new Error("Unknown codec");const r=new D(t.slice(-32));return{type:E[n],reference:r}}(e);super(t.reference.bytes,32)}else super(e,[32,64])}toCid(e){return function(e,t){e=new D(e);const n=new Uint8Array([1]),r=new Uint8Array(["feed"===t?251:250]),i=new Uint8Array([1]),o=new Uint8Array([27]),s=new Uint8Array([32]);return`b${a.uint8ArrayToBase32(a.concatBytes(n,r,i,o,s)).replace(/\=+$/,"")}${e.toBase32().replace(/\=+$/,"")}`.toLowerCase()}(this.bytes,e)}static isValid(e){try{return new D(e),!0}catch{return!1}}}class V extends w{static LENGTH=32;constructor(e){super(e,32)}}class N extends w{static LENGTH=8;constructor(e){super(e,8)}static fromBigInt(e){return new N(a.numberToUint64(e,"LE"))}toBigInt(){return a.uint64ToNumber(this.bytes,"LE")}static fromSlice(e,t){return new N(e.slice(t,t+N.LENGTH))}}class I extends w{static LENGTH=32;constructor(e){super(e,32)}}class $ extends w{static LENGTH=32;constructor(e){super(e,32)}}class P extends w{static LENGTH=65;constructor(e){super(e,65)}static fromSlice(e,t){return new P(e.slice(t,t+P.LENGTH))}recoverPublicKey(e){const t=a.uint256ToNumber(this.bytes.slice(0,32),"BE"),n=a.uint256ToNumber(this.bytes.slice(32,64),"BE"),r=BigInt(this.bytes[64]),[i,s]=o.recoverPublicKey(a.concatBytes(R.encode("Ethereum Signed Message:\n32"),a.keccak256(e instanceof Uint8Array?e:R.encode(e))),t,n,r);return new x(a.concatBytes(a.numberToUint256(i,"BE"),a.numberToUint256(s,"BE")))}isValid(e,t){return this.recoverPublicKey(e).address().equals(t)}}class z extends w{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new z(a.keccak256(R.encode(e)))}}const k=new Uint8Array(8).fill(255,0,8);class F extends w{static LENGTH=8;static MINUS_ONE=new F(k);constructor(e){super(e,8)}static fromBigInt(e){return new F(a.numberToUint64(e,"BE"))}toBigInt(){return a.uint64ToNumber(this.bytes,"BE")}next(){return a.equals(this.bytes,k)?F.fromBigInt(0n):F.fromBigInt(this.toBigInt()+1n)}}class U extends Error{constructor(e){super(e)}}class L extends U{constructor(e,t){super(e),this.value=t}}class j extends U{constructor(e,t,n,r,a,i){super(n),this.method=e,this.url=t,this.responseBody=r,this.status=a,this.statusText=i}}const C=4096;function M(e){const t=e.slice(0,N.LENGTH),n=function(e){if(e.length>C)throw new L(`payload size ${e.length} exceeds maximum chunk payload size 4096`,e);const t=new Uint8Array(C);return t.set(e),a.log2Reduce(a.partition(t,32),((e,t)=>a.keccak256(a.concatBytes(e,t))))}(e.slice(N.LENGTH)),r=a.keccak256(a.concatBytes(t,n));return new D(r)}const _=4096,G=new TextEncoder;function q(e){if(e instanceof Uint8Array||(e=G.encode(e)),e.length<1||e.length>_)throw new RangeError(`payload size ${e.length} exceeds limits [1, 4096]`);const t=N.fromBigInt(BigInt(e.length)),n=a.concatBytes(t.toUint8Array(),e);return{data:n,span:t,payload:w.fromSlice(n,N.LENGTH),address:M(n)}}function H(e){if(e.length<1+N.LENGTH||e.length>_+N.LENGTH)throw new RangeError(`chunk size ${e.length} exceeds limits [${1+N.LENGTH}, ${N.LENGTH}]`);const t=N.fromSlice(e,0),n=a.concatBytes(t.toUint8Array(),e.slice(N.LENGTH));return{data:n,span:t,payload:w.fromSlice(n,N.LENGTH),address:M(n)}}let W=function(e){return e.FULL="full",e.LIGHT="light",e.ULTRA_LIGHT="ultra-light",e.DEV="dev",e}({});function K(e){switch(e){case"full":return W.FULL;case"light":return W.LIGHT;case"ultra-light":return W.ULTRA_LIGHT;case"dev":return W.DEV;default:throw new Error(`Unknown Bee mode: ${e}`)}}const X=32,J=128,Z=X*J,Q=4,Y=17,ee=255,te=1,ne=1e3,re=16;let ae=function(e){return e[e.OFF=0]="OFF",e[e.MEDIUM=1]="MEDIUM",e[e.STRONG=2]="STRONG",e[e.INSANE=3]="INSANE",e[e.PARANOID=4]="PARANOID",e}({}),ie=function(e){return e[e.NONE=0]="NONE",e[e.DATA=1]="DATA",e[e.PROX=2]="PROX",e[e.RACE=3]="RACE",e}({});const oe={ENCRYPTION_OFF:{[ae.OFF]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"44.70 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.66 MB",batchDepth:18,utilizationRate:"0.61%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"112.06 MB",batchDepth:19,utilizationRate:"5.09%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"687.62 MB",batchDepth:20,utilizationRate:"15.65%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.60 GB",batchDepth:21,utilizationRate:"30.27%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.73 GB",batchDepth:22,utilizationRate:"44.99%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"19.94 GB",batchDepth:23,utilizationRate:"58.03%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"47.06 GB",batchDepth:24,utilizationRate:"68.48%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"105.51 GB",batchDepth:25,utilizationRate:"76.77%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"227.98 GB",batchDepth:26,utilizationRate:"82.94%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"476.68 GB",batchDepth:27,utilizationRate:"86.71%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"993.65 GB",batchDepth:28,utilizationRate:"88.37%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"2.04 TB",batchDepth:29,utilizationRate:"92.88%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"4.17 TB",batchDepth:30,utilizationRate:"94.81%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"8.45 TB",batchDepth:31,utilizationRate:"96.06%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"17.07 TB",batchDepth:32,utilizationRate:"97.01%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"34.36 TB",batchDepth:33,utilizationRate:"97.65%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"69.04 TB",batchDepth:34,utilizationRate:"98.11%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"138.54 TB",batchDepth:35,utilizationRate:"98.44%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"277.72 TB",batchDepth:36,utilizationRate:"98.67%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"556.35 TB",batchDepth:37,utilizationRate:"98.83%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.11 PB",batchDepth:38,utilizationRate:"98.91%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.23 PB",batchDepth:39,utilizationRate:"98.96%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.46 PB",batchDepth:40,utilizationRate:"98.98%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.93 PB",batchDepth:41,utilizationRate:"99.11%"}],[ae.MEDIUM]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"41.56 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.19 MB",batchDepth:18,utilizationRate:"0.57%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"104.18 MB",batchDepth:19,utilizationRate:"4.73%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"639.27 MB",batchDepth:20,utilizationRate:"14.54%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.41 GB",batchDepth:21,utilizationRate:"28.11%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.18 GB",batchDepth:22,utilizationRate:"41.79%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"18.54 GB",batchDepth:23,utilizationRate:"53.95%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"43.75 GB",batchDepth:24,utilizationRate:"63.66%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"98.09 GB",batchDepth:25,utilizationRate:"71.37%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"211.95 GB",batchDepth:26,utilizationRate:"77.11%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"443.16 GB",batchDepth:27,utilizationRate:"80.61%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"923.78 GB",batchDepth:28,utilizationRate:"82.16%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.90 TB",batchDepth:29,utilizationRate:"86.30%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.88 TB",batchDepth:30,utilizationRate:"88.14%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.86 TB",batchDepth:31,utilizationRate:"89.26%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"15.87 TB",batchDepth:32,utilizationRate:"90.21%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"31.94 TB",batchDepth:33,utilizationRate:"90.77%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"64.19 TB",batchDepth:34,utilizationRate:"91.22%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"128.80 TB",batchDepth:35,utilizationRate:"91.52%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"258.19 TB",batchDepth:36,utilizationRate:"91.73%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"517.23 TB",batchDepth:37,utilizationRate:"91.88%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.04 PB",batchDepth:38,utilizationRate:"91.95%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.07 PB",batchDepth:39,utilizationRate:"92.00%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.15 PB",batchDepth:40,utilizationRate:"92.15%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.30 PB",batchDepth:41,utilizationRate:"92.14%"}],[ae.STRONG]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"37.37 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.57 MB",batchDepth:18,utilizationRate:"0.51%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"93.68 MB",batchDepth:19,utilizationRate:"4.25%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"574.81 MB",batchDepth:20,utilizationRate:"13.07%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.17 GB",batchDepth:21,utilizationRate:"25.26%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"6.46 GB",batchDepth:22,utilizationRate:"37.58%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"16.67 GB",batchDepth:23,utilizationRate:"48.50%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"39.34 GB",batchDepth:24,utilizationRate:"57.24%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"88.20 GB",batchDepth:25,utilizationRate:"64.17%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"190.58 GB",batchDepth:26,utilizationRate:"69.33%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"398.47 GB",batchDepth:27,utilizationRate:"72.48%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"830.63 GB",batchDepth:28,utilizationRate:"73.85%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.71 TB",batchDepth:29,utilizationRate:"77.59%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.49 TB",batchDepth:30,utilizationRate:"79.27%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.07 TB",batchDepth:31,utilizationRate:"80.34%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"14.27 TB",batchDepth:32,utilizationRate:"81.12%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"28.72 TB",batchDepth:33,utilizationRate:"81.63%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"57.71 TB",batchDepth:34,utilizationRate:"82.01%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"115.81 TB",batchDepth:35,utilizationRate:"82.29%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"232.16 TB",batchDepth:36,utilizationRate:"82.48%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"465.07 TB",batchDepth:37,utilizationRate:"82.61%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"931.23 TB",batchDepth:38,utilizationRate:"82.67%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.86 PB",batchDepth:39,utilizationRate:"82.71%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.73 PB",batchDepth:40,utilizationRate:"82.78%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"7.46 PB",batchDepth:41,utilizationRate:"82.79%"}],[ae.INSANE]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"33.88 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.05 MB",batchDepth:18,utilizationRate:"0.46%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"84.92 MB",batchDepth:19,utilizationRate:"3.86%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"521.09 MB",batchDepth:20,utilizationRate:"11.85%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"1.97 GB",batchDepth:21,utilizationRate:"22.90%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"5.86 GB",batchDepth:22,utilizationRate:"34.09%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"15.11 GB",batchDepth:23,utilizationRate:"43.97%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"35.66 GB",batchDepth:24,utilizationRate:"51.90%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"79.96 GB",batchDepth:25,utilizationRate:"58.18%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"172.77 GB",batchDepth:26,utilizationRate:"62.85%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"361.23 GB",batchDepth:27,utilizationRate:"65.70%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"753.00 GB",batchDepth:28,utilizationRate:"66.95%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.55 TB",batchDepth:29,utilizationRate:"70.38%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.16 TB",batchDepth:30,utilizationRate:"71.92%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.41 TB",batchDepth:31,utilizationRate:"72.85%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"12.93 TB",batchDepth:32,utilizationRate:"73.53%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"26.04 TB",batchDepth:33,utilizationRate:"74.01%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"52.32 TB",batchDepth:34,utilizationRate:"74.35%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"104.99 TB",batchDepth:35,utilizationRate:"74.60%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"210.46 TB",batchDepth:36,utilizationRate:"74.77%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"421.61 TB",batchDepth:37,utilizationRate:"74.89%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"844.20 TB",batchDepth:38,utilizationRate:"74.94%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.69 PB",batchDepth:39,utilizationRate:"74.98%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.38 PB",batchDepth:40,utilizationRate:"75.03%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"6.77 PB",batchDepth:41,utilizationRate:"75.10%"}],[ae.PARANOID]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"13.27 kB",batchDepth:17,utilizationRate:"0.00%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"1.98 MB",batchDepth:18,utilizationRate:"0.18%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"33.27 MB",batchDepth:19,utilizationRate:"1.51%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"204.14 MB",batchDepth:20,utilizationRate:"4.64%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"771.13 MB",batchDepth:21,utilizationRate:"8.75%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"2.29 GB",batchDepth:22,utilizationRate:"13.34%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"5.92 GB",batchDepth:23,utilizationRate:"17.22%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"13.97 GB",batchDepth:24,utilizationRate:"20.33%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"31.32 GB",batchDepth:25,utilizationRate:"22.79%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"67.68 GB",batchDepth:26,utilizationRate:"24.62%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"141.51 GB",batchDepth:27,utilizationRate:"25.74%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"294.99 GB",batchDepth:28,utilizationRate:"26.23%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"606.90 GB",batchDepth:29,utilizationRate:"27.56%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"1.24 TB",batchDepth:30,utilizationRate:"28.15%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"2.51 TB",batchDepth:31,utilizationRate:"28.54%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"5.07 TB",batchDepth:32,utilizationRate:"28.82%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"10.20 TB",batchDepth:33,utilizationRate:"28.99%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"20.50 TB",batchDepth:34,utilizationRate:"29.13%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"41.13 TB",batchDepth:35,utilizationRate:"29.22%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"82.45 TB",batchDepth:36,utilizationRate:"29.29%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"165.17 TB",batchDepth:37,utilizationRate:"29.34%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"330.72 TB",batchDepth:38,utilizationRate:"29.37%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"661.97 TB",batchDepth:39,utilizationRate:"29.39%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"1.32 PB",batchDepth:40,utilizationRate:"29.41%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"2.65 PB",batchDepth:41,utilizationRate:"29.43%"}]},ENCRYPTION_ON:{[ae.OFF]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"44.35 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.61 MB",batchDepth:18,utilizationRate:"0.60%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"111.18 MB",batchDepth:19,utilizationRate:"5.05%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"682.21 MB",batchDepth:20,utilizationRate:"15.52%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.58 GB",batchDepth:21,utilizationRate:"30.04%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.67 GB",batchDepth:22,utilizationRate:"44.62%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"19.78 GB",batchDepth:23,utilizationRate:"57.56%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"46.69 GB",batchDepth:24,utilizationRate:"67.93%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"104.68 GB",batchDepth:25,utilizationRate:"76.16%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"226.19 GB",batchDepth:26,utilizationRate:"82.29%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"472.93 GB",batchDepth:27,utilizationRate:"86.02%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"985.83 GB",batchDepth:28,utilizationRate:"87.66%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"2.03 TB",batchDepth:29,utilizationRate:"92.25%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"4.14 TB",batchDepth:30,utilizationRate:"94.21%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"8.39 TB",batchDepth:31,utilizationRate:"95.37%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"16.93 TB",batchDepth:32,utilizationRate:"96.22%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"34.09 TB",batchDepth:33,utilizationRate:"96.88%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"68.50 TB",batchDepth:34,utilizationRate:"97.34%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"137.45 TB",batchDepth:35,utilizationRate:"97.67%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"275.53 TB",batchDepth:36,utilizationRate:"97.89%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"551.97 TB",batchDepth:37,utilizationRate:"98.05%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.11 PB",batchDepth:38,utilizationRate:"98.13%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.21 PB",batchDepth:39,utilizationRate:"98.18%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.43 PB",batchDepth:40,utilizationRate:"98.36%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.86 PB",batchDepth:41,utilizationRate:"98.37%"}],[ae.MEDIUM]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"40.89 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.09 MB",batchDepth:18,utilizationRate:"0.56%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"102.49 MB",batchDepth:19,utilizationRate:"4.65%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"628.91 MB",batchDepth:20,utilizationRate:"14.30%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.38 GB",batchDepth:21,utilizationRate:"27.68%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.07 GB",batchDepth:22,utilizationRate:"41.15%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"18.24 GB",batchDepth:23,utilizationRate:"53.09%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"43.04 GB",batchDepth:24,utilizationRate:"62.63%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"96.50 GB",batchDepth:25,utilizationRate:"70.21%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"208.52 GB",batchDepth:26,utilizationRate:"75.86%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"435.98 GB",batchDepth:27,utilizationRate:"79.30%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"908.81 GB",batchDepth:28,utilizationRate:"80.82%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.87 TB",batchDepth:29,utilizationRate:"84.98%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.81 TB",batchDepth:30,utilizationRate:"86.67%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.73 TB",batchDepth:31,utilizationRate:"87.84%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"15.61 TB",batchDepth:32,utilizationRate:"88.74%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"31.43 TB",batchDepth:33,utilizationRate:"89.34%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"63.15 TB",batchDepth:34,utilizationRate:"89.74%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"126.71 TB",batchDepth:35,utilizationRate:"90.03%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"254.01 TB",batchDepth:36,utilizationRate:"90.24%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"508.85 TB",batchDepth:37,utilizationRate:"90.39%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.02 PB",batchDepth:38,utilizationRate:"90.47%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.04 PB",batchDepth:39,utilizationRate:"90.51%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.08 PB",batchDepth:40,utilizationRate:"90.64%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.17 PB",batchDepth:41,utilizationRate:"90.65%"}],[ae.STRONG]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"36.73 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.47 MB",batchDepth:18,utilizationRate:"0.50%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"92.07 MB",batchDepth:19,utilizationRate:"4.18%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"564.95 MB",batchDepth:20,utilizationRate:"12.85%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.13 GB",batchDepth:21,utilizationRate:"24.86%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"6.35 GB",batchDepth:22,utilizationRate:"36.97%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"16.38 GB",batchDepth:23,utilizationRate:"47.67%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"38.66 GB",batchDepth:24,utilizationRate:"56.26%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"86.69 GB",batchDepth:25,utilizationRate:"63.07%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"187.31 GB",batchDepth:26,utilizationRate:"68.14%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"391.64 GB",batchDepth:27,utilizationRate:"71.24%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"816.39 GB",batchDepth:28,utilizationRate:"72.59%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.68 TB",batchDepth:29,utilizationRate:"76.34%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.43 TB",batchDepth:30,utilizationRate:"77.89%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.94 TB",batchDepth:31,utilizationRate:"78.86%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"14.02 TB",batchDepth:32,utilizationRate:"79.71%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"28.23 TB",batchDepth:33,utilizationRate:"80.23%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"56.72 TB",batchDepth:34,utilizationRate:"80.60%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"113.82 TB",batchDepth:35,utilizationRate:"80.88%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"228.18 TB",batchDepth:36,utilizationRate:"81.06%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"457.10 TB",batchDepth:37,utilizationRate:"81.20%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"915.26 TB",batchDepth:38,utilizationRate:"81.26%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.83 PB",batchDepth:39,utilizationRate:"81.30%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.67 PB",batchDepth:40,utilizationRate:"81.43%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"7.34 PB",batchDepth:41,utilizationRate:"81.45%"}],[ae.INSANE]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"33.26 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"4.96 MB",batchDepth:18,utilizationRate:"0.45%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"83.38 MB",batchDepth:19,utilizationRate:"3.79%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"511.65 MB",batchDepth:20,utilizationRate:"11.64%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"1.93 GB",batchDepth:21,utilizationRate:"22.52%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"5.75 GB",batchDepth:22,utilizationRate:"33.50%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"14.84 GB",batchDepth:23,utilizationRate:"43.19%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"35.02 GB",batchDepth:24,utilizationRate:"50.96%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"78.51 GB",batchDepth:25,utilizationRate:"57.12%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"169.64 GB",batchDepth:26,utilizationRate:"61.71%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"354.69 GB",batchDepth:27,utilizationRate:"64.52%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"739.37 GB",batchDepth:28,utilizationRate:"65.74%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.52 TB",batchDepth:29,utilizationRate:"69.15%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.10 TB",batchDepth:30,utilizationRate:"70.56%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.29 TB",batchDepth:31,utilizationRate:"71.48%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"12.70 TB",batchDepth:32,utilizationRate:"72.18%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"25.57 TB",batchDepth:33,utilizationRate:"72.67%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"51.37 TB",batchDepth:34,utilizationRate:"73.00%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"103.08 TB",batchDepth:35,utilizationRate:"73.24%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"206.65 TB",batchDepth:36,utilizationRate:"73.42%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"413.98 TB",batchDepth:37,utilizationRate:"73.54%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"828.91 TB",batchDepth:38,utilizationRate:"73.59%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.66 PB",batchDepth:39,utilizationRate:"73.62%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.32 PB",batchDepth:40,utilizationRate:"73.72%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"6.64 PB",batchDepth:41,utilizationRate:"73.74%"}],[ae.PARANOID]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"13.17 kB",batchDepth:17,utilizationRate:"0.00%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"1.96 MB",batchDepth:18,utilizationRate:"0.18%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"33.01 MB",batchDepth:19,utilizationRate:"1.50%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"202.53 MB",batchDepth:20,utilizationRate:"4.61%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"765.05 MB",batchDepth:21,utilizationRate:"8.68%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"2.28 GB",batchDepth:22,utilizationRate:"13.27%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"5.87 GB",batchDepth:23,utilizationRate:"17.08%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"13.86 GB",batchDepth:24,utilizationRate:"20.17%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"31.08 GB",batchDepth:25,utilizationRate:"22.61%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"67.15 GB",batchDepth:26,utilizationRate:"24.43%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"140.40 GB",batchDepth:27,utilizationRate:"25.54%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"292.67 GB",batchDepth:28,utilizationRate:"26.03%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"602.12 GB",batchDepth:29,utilizationRate:"27.35%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"1.23 TB",batchDepth:30,utilizationRate:"27.94%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"2.49 TB",batchDepth:31,utilizationRate:"28.32%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"5.03 TB",batchDepth:32,utilizationRate:"28.60%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"10.12 TB",batchDepth:33,utilizationRate:"28.77%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"20.34 TB",batchDepth:34,utilizationRate:"28.91%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"40.80 TB",batchDepth:35,utilizationRate:"29.00%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"81.80 TB",batchDepth:36,utilizationRate:"29.06%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"163.87 TB",batchDepth:37,utilizationRate:"29.11%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"328.11 TB",batchDepth:38,utilizationRate:"29.14%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"656.76 TB",batchDepth:39,utilizationRate:"29.16%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"1.31 PB",batchDepth:40,utilizationRate:"29.18%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"2.63 PB",batchDepth:41,utilizationRate:"29.19%"}]}};class se{constructor(e){if(this.seconds=Math.ceil(e),e<=0)throw Error("Duration must be greater than 0")}static fromMilliseconds(e){return new se(e/1e3)}static fromSeconds(e){return new se(e)}static fromHours(e){return new se(60*e*60)}static fromDays(e){return new se(24*e*60*60)}static fromWeeks(e){return new se(7*e*24*60*60)}static fromYears(e){return new se(365*e*24*60*60)}static fromEndDate(e,t){return new se((e.getTime()-(t??new Date).getTime())/1e3)}toSeconds(){return this.seconds}toHours(){return this.seconds/60/60}toDays(){return this.seconds/24/60/60}toWeeks(){return this.seconds/7/24/60/60}toYears(){return this.seconds/365/24/60/60}toEndDate(e){return new Date((e??new Date).getTime()+1e3*this.seconds)}represent(){return i.secondsToHumanTime(this.seconds)}}class ce{static DIGITS=16;constructor(e){this.state=e}static fromDecimalString(e){return new ce(m.fromDecimalString(e,ce.DIGITS))}static fromPLUR(e){return new ce(new m(e,ce.DIGITS))}toPLURString(){return this.state.toString()}toPLURBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new ce(this.state.add(e instanceof ce?e.state:new m(e,ce.DIGITS)))}minus(e){return new ce(this.state.subtract(e instanceof ce?e.state:new m(e,ce.DIGITS)))}divide(e){return new ce(this.state.divmod(e)[0])}gt(e){return 1===this.state.compare(e.state)}gte(e){return-1!==this.state.compare(e.state)}lt(e){return-1===this.state.compare(e.state)}lte(e){return 1!==this.state.compare(e.state)}eq(e){return 0===this.state.compare(e.state)}exchangeToDAI(e){return ue.fromWei(this.state.exchange("*",new m(e.toWeiBigInt(),ue.DIGITS),ue.DIGITS).value)}}class ue{static DIGITS=18;constructor(e){this.state=e}static fromDecimalString(e){return new ue(m.fromDecimalString(e,ue.DIGITS))}static fromWei(e){return new ue(new m(e,ue.DIGITS))}toWeiString(){return this.state.toString()}toWeiBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new ue(this.state.add(e instanceof ue?e.state:new m(e,ue.DIGITS)))}minus(e){return new ue(this.state.subtract(e instanceof ue?e.state:new m(e,ue.DIGITS)))}divide(e){return new ue(this.state.divmod(e)[0])}gt(e){return 1===this.state.compare(e.state)}gte(e){return-1!==this.state.compare(e.state)}lt(e){return-1===this.state.compare(e.state)}lte(e){return 1!==this.state.compare(e.state)}eq(e){return 0===this.state.compare(e.state)}exchangeToBZZ(e){return ce.fromPLUR(this.state.exchange("/",new m(e.toWeiBigInt(),ue.DIGITS),ce.DIGITS).value)}}var le=n(7320);function fe(e){if("function"==typeof File&&e instanceof File)return!0;const t=e;return"object"==typeof t&&"string"==typeof t.name&&("function"==typeof t.stream||"function"==typeof t.arrayBuffer)}function he(e){return void 0!==le.Readable&&e instanceof le.Readable}function pe(e,t){return"bigint"==typeof e&&(e=e.toString()),f.asIntegerString(e,t)}function me(e){const t=f.asObject(e,{name:"DownloadOptions"});return{redundancyStrategy:f.asOptional((e=>f.asInteger(e,{name:"redundancyStrategy"})),t.redundancyStrategy),fallback:f.asOptional((e=>f.asBoolean(e,{name:"fallback"})),t.fallback),timeoutMs:f.asOptional((e=>f.asInteger(e,{name:"timeoutMs",min:0})),t.timeoutMs),actPublisher:f.asOptional((e=>new x(e)),t.actPublisher),actHistoryAddress:f.asOptional((e=>new D(e)),t.actHistoryAddress),actTimestamp:f.asOptional((e=>f.asNumber(e,{name:"actTimestamp"})),t.actTimestamp)}}function de(e,t="UploadOptions"){const n=f.asObject(e,{name:t});return{act:f.asOptional((e=>f.asBoolean(e,{name:"act"})),n.act),actHistoryAddress:f.asOptional((e=>new D(e)),n.actHistoryAddress),deferred:f.asOptional((e=>f.asBoolean(e,{name:"deferred"})),n.deferred),encrypt:f.asOptional((e=>f.asBoolean(e,{name:"encrypt"})),n.encrypt),pin:f.asOptional((e=>f.asBoolean(e,{name:"pin"})),n.pin),tag:f.asOptional((e=>f.asInteger(e,{name:"tag",min:0})),n.tag)}}function ge(e){const t=de(e,"CollectionUploadOptions"),n=f.asObject(e,{name:"CollectionUploadOptions"});return{...t,errorDocument:f.asOptional((e=>f.asString(e,{name:"errorDocument"})),n.errorDocument),indexDocument:f.asOptional((e=>f.asString(e,{name:"indexDocument"})),n.indexDocument),redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),n.redundancyLevel)}}function be(e){const t=f.asObject(e,{name:"PostageBatchOptions"});return{gasPrice:f.asOptional((e=>pe(e,{name:"gasPrice"})),t.gasPrice),immutableFlag:f.asOptional((e=>f.asBoolean(e,{name:"immutableFlag"})),t.immutableFlag),label:f.asOptional((e=>f.asString(e,{name:"label"})),t.label),waitForUsable:f.asOptional((e=>f.asBoolean(e,{name:"waitForUsable"})),t.waitForUsable),waitForUsableTimeout:f.asOptional((e=>f.asInteger(e,{name:"waitForUsableTimeout",min:0})),t.waitForUsableTimeout)}}function ye(e,t="TransactionOptions"){const n=f.asObject(e,{name:t});return{gasLimit:f.asOptional((e=>pe(e,{name:"gasLimit",min:0n})),n.gasLimit),gasPrice:f.asOptional((e=>pe(e,{name:"gasPrice",min:0n})),n.gasPrice)}}function we(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new TypeError("Data must be either string or Uint8Array!")}function Be(e){if(null==e)throw new TypeError(`Expected number | Tag | string from tagUid, got: ${e}`);if(function(e){try{const t=f.asObject(e,{name:"Tag"});return f.asInteger(t.uid,{name:"Tag.uid"}),!0}catch{return!1}}(e))return e.uid;if("number"==typeof e||"string"==typeof e)return f.asNumber(e,{name:"tagUid",min:0});throw new TypeError(`Expected number | Tag | string from tagUid, got: ${e}`)}const ve=.9;function Te(e,t,n){return e/Math.pow(2,t-n)}function Ee(e){return 4096*2**e}const Re=[[17,4089e-8],[18,.00609],[19,.10249],[20,.62891],[21,2.38],[22,7.07],[23,18.24],[24,43.04],[25,96.5],[26,208.52],[27,435.98],[28,908.81],[29,1870],[30,3810],[31,7730],[32,15610],[33,31430],[34,63150]];function Oe(e,t,n){if(e<17)return 0;if(void 0!==t&&void 0!==n){const r=oe[t?"ENCRYPTION_ON":"ENCRYPTION_OFF"][n].find((t=>t.batchDepth===e));if(r?.effectiveVolume)return B(r.effectiveVolume)}else{const t=Re.find((([t,n])=>{if(e===t)return n}));if(t)return 1e3*t[1]*1e3*1e3}return Math.ceil(Ee(e)*ve)}function xe(e,t){const n=new Map;for(let r=17;r<35;r++)n.set(r,Oe(r,e,t));return n}function Se(e,t){return ce.fromPLUR(2n**BigInt(e)*BigInt(t))}function Ae(e,t,n){const r=BigInt(pe(e));return se.fromSeconds(Number(r*BigInt(n)/BigInt(t)))}function De(e,t,n){return BigInt(e.toSeconds())/BigInt(n)*BigInt(t)+1n}function Ve(e,t,n){if(void 0!==t&&void 0!==n){const r=oe[t?"ENCRYPTION_ON":"ENCRYPTION_OFF"][n].find((t=>e.toBytes()<=B(t.effectiveVolume)));if(r?.effectiveVolume)return r.batchDepth}else for(const[r,a]of Re)if(e.toBytes()<=1e3*a*1e3*1e3)return r;return 35}function Ne(e){return function(e,t,n,r){if(65!==e.length)throw Error("invalid signature length");if(32!==t.length)throw Error("invalid batch ID length");if(8!==n.length)throw Error("invalid timestamp length");if(8!==r.length)throw Error("invalid index length");return new w(a.concatBytes(t,r,n,e))}(e.signature,e.batchId.toUint8Array(),e.timestamp,e.index)}function Ie(e){return{name:function(e){if(!e)throw new U("missing content-disposition header");const t=e.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);if(t&&t.length>0)return t[1];throw new U("invalid content-disposition header")}(e["content-disposition"]),tagUid:function(e){if(!e)return;return parseInt(e,10)}(e["swarm-tag-uid"]),contentType:e["content-type"]||void 0}}function $e(e,t){const n={};if(!function(e){if(!f.isObject(e))return!1;const t=e;return void 0!==t.issuer&&void 0!==t.index&&void 0!==t.signature&&void 0!==t.timestamp&&void 0!==t.batchId}(e)?e&&(e=new $(e),n["swarm-postage-batch-id"]=e.toHex()):n["swarm-postage-stamp"]=Ne(e).toHex(),!t)return n;const r=f.asObject(t);return r.size&&(n["content-length"]=String(r.size)),r.contentType&&(n["content-type"]=String(r.contentType)),r.redundancyLevel&&(n["swarm-redundancy-level"]=String(r.redundancyLevel)),f.isBoolean(r.act)&&(n["swarm-act"]=String(r.act)),f.isBoolean(r.pin)&&(n["swarm-pin"]=String(r.pin)),f.isBoolean(r.encrypt)&&(n["swarm-encrypt"]=r.encrypt.toString()),r.tag&&(n["swarm-tag"]=String(r.tag)),f.isBoolean(r.deferred)&&(n["swarm-deferred-upload"]=r.deferred.toString()),r.redundancyStrategy&&(n["swarm-redundancy-strategy"]=String(r.redundancyStrategy)),f.isBoolean(r.fallback)&&(n["swarm-redundancy-fallback-mode"]=r.fallback.toString()),r.timeoutMs&&(n["swarm-chunk-retrieval-timeout"]=String(r.timeoutMs)),r.indexDocument&&(n["swarm-index-document"]=String(r.indexDocument)),r.errorDocument&&(n["swarm-error-document"]=String(r.errorDocument)),r.actPublisher&&(n["swarm-act-publisher"]=new x(r.actPublisher).toCompressedHex()),r.actHistoryAddress&&(n["swarm-act-history-address"]=new D(r.actHistoryAddress).toHex()),r.actTimestamp&&(n["swarm-act-timestamp"]=String(r.actTimestamp)),(r.actPublisher||r.actHistoryAddress||r.actTimestamp)&&(n["swarm-act"]="true"),r.gasPrice&&(n["gas-price"]=String(r.gasPrice)),r.gasLimit&&(n["gas-limit"]=String(r.gasLimit)),n}var Pe=n(8266),ze=n.n(Pe);const{AxiosError:ke}=ze(),Fe=i.minutes(1)/200,Ue={headers:{accept:"application/json, text/plain, */*"},maxBodyLength:1/0,maxContentLength:1/0};async function Le(e,t){const n=c.deepMerge3(Ue,t,e);if(n.data&&"undefined"!=typeof Buffer&&Buffer.isBuffer(n.data)&&(n.data=n.data.buffer.slice(n.data.byteOffset,n.data.byteOffset+n.data.byteLength)),n.params){const e=Object.keys(n.params);for(const t of e){void 0===n.params[t]&&delete n.params[t]}}let r=0;for(;r<1e5;)try{je(e,n);return await ze()(n)}catch(a){if(!(a instanceof ke))throw a;if("ECONNABORTED"!==a.code||!e.endlesslyRetry)throw new j(t.method||"get",t.url||"<unknown>",a.message,a.response?.data,a.response?.status,a.code);r++,await l.sleepMillis(r<Fe?200:1e3)}throw Error("Max number of failed attempts reached")}function je(e,t){e.onRequest&&e.onRequest({method:t.method||"GET",url:u.joinUrl([t.baseURL,t.url]),headers:{...t.headers},params:t.params})}const Ce="chunks";async function Me(e,t,n){t=new D(t);const r=await Le(e,{responseType:"arraybuffer",url:`${Ce}/${t}`,headers:$e(null,n)});return new Uint8Array(r.data)}const _e=A.LENGTH,Ge=_e+P.LENGTH,qe=Ge+N.LENGTH;function He(e,t){e=e instanceof w?e.toUint8Array():e,t=new D(t);const n=function(e){const t=M(e.slice(Ge)),n=P.fromSlice(e,_e),r=w.fromSlice(e,0,A.LENGTH),i=a.concatBytes(r.toUint8Array(),t.toUint8Array());return n.recoverPublicKey(i).address()}(e),r=w.fromSlice(e,0,A.LENGTH),i=new D(a.keccak256(a.concatBytes(r.toUint8Array(),n.toUint8Array())));if(!a.equals(t.toUint8Array(),i.toUint8Array()))throw new U("SOC Data does not match given address!");return{data:e,identifier:r,signature:P.fromSlice(e,_e),span:N.fromSlice(e,Ge),payload:w.fromSlice(e,qe),address:i,owner:n}}function We(e,t){return new D(a.keccak256(a.concatBytes(e.toUint8Array(),t.toUint8Array())))}function Ke(e,t,n){const r=We(t=new A(t),(n=new O(n)).publicKey().address()),i=n.sign(a.concatBytes(t.toUint8Array(),e.address.toUint8Array()));return{data:a.concatBytes(t.toUint8Array(),i.toUint8Array(),e.data),identifier:t,signature:i,span:N.fromSlice(e.data,0),payload:w.fromSlice(e.data,N.LENGTH),address:r,owner:n.publicKey().address()}}async function Xe(e,t,n,r){const i=a.concatBytes(t.span.toUint8Array(),t.payload.toUint8Array());return async function(e,t,n,r,a,i,o){const s=await Le(e,{method:"post",url:`soc/${t}/${n}`,data:a,headers:{"content-type":"application/octet-stream",...$e(i,o)},responseType:"json",params:{sig:r.toHex()}}),c=f.asObject(s.data,{name:"response.data"});return{reference:new D(f.asHexString(c.reference)),tagUid:s.headers["swarm-tag"]?Be(s.headers["swarm-tag"]):void 0,historyAddress:s.headers["swarm-act-history-address"]?h.of(new D(s.headers["swarm-act-history-address"])):h.empty()}}(e,t.owner,t.identifier,t.signature,i,n,r)}async function Je(e,t,n,r,a,i){t=new O(t),r=new A(r);return Xe(e,Ke(q(a),r,t),n,i)}async function Ze(e,t,n){const r=We(n=new A(n),t=new S(t));return He(await Me(e,r.toHex()),r)}const Qe="bytes";async function Ye(e,t,n,r){const a=await Le(e,{url:Qe,method:"post",responseType:"json",data:t,headers:{"content-type":"application/octet-stream",...$e(n,r)}}),i=f.asObject(a.data,{name:"response.data"});return{reference:new D(f.asHexString(i.reference)),tagUid:a.headers["swarm-tag"]?Be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?h.of(new D(a.headers["swarm-act-history-address"])):h.empty()}}async function et(e,t,n){n&&(n=me(n));const r=await Le(e,{responseType:"arraybuffer",url:`${Qe}/${t}`,headers:$e(null,n)});return new w(r.data)}const tt="feeds";function nt(e){const t=e["swarm-feed-index"],n=e["swarm-feed-index-next"];if(!t)throw new U("Response did not contain expected swarm-feed-index!");if(!n)throw new U("Response did not contain expected swarm-feed-index-next!");return{feedIndex:new F(t),feedIndexNext:new F(n)}}async function rt(e,t,n,r){const a=await Le(e,{responseType:"arraybuffer",url:`${tt}/${t}/${n}`,params:r});return{payload:new w(a.data),...nt(a.headers)}}class at{constructor(e){this.raw=e}toString(){return f.isString(this.raw)&&this.raw.includes(".eth")?this.raw:new D(this.raw).toHex()}}function it(e,t){return t="number"==typeof t?F.fromBigInt(BigInt(t)):t,new A(a.keccak256(a.concatBytes(e.toUint8Array(),t.toUint8Array())))}async function ot(e,t,n){try{const r=await rt(e,t,n);if(!r.feedIndexNext)throw Error("Feed index next is not defined. This should happen when fetching an exact index.");return r.feedIndexNext}catch(r){if(r instanceof j)return F.fromBigInt(0n);throw r}}async function st(e,t,n,r,a,i){const o=it(n,i?.index??await ot(e,t.publicKey().address(),n));if(r.length>4096){const n=await Ye(e,r,a,i);return async function(e,t,n,r,a,i){return t=new O(t),r=new A(r),Xe(e,Ke(H(a),r,t),n,i)}(e,t,a,o,await Me(e,n.reference),i)}return Je(e,t,a,o,f.isString(r)?w.fromUtf8(r).toUint8Array():r,i)}function ct(e,t,n){const r=it(t,n);return new D(a.keccak256(a.concatBytes(r.toUint8Array(),e.toUint8Array())))}async function ut(e,t,n,r,i=!1){const o=ct(t,n,r="number"==typeof r?F.fromBigInt(BigInt(r)):r),s=He(await Me(e,o.toHex()),o);let c=h.empty();if(i){const e=w.fromSlice(s.payload.toUint8Array(),0,8);c=h.of(Number(a.uint64ToNumber(e.toUint8Array(),"BE")))}return{timestamp:c,payload:new w(s.payload.offset(i?8:0))}}async function lt(e,t,n,r){const a=ct(t,n,r="number"==typeof r?F.fromBigInt(BigInt(r)):r);return H((await Me(e,a)).slice(A.LENGTH+P.LENGTH))}function ft(e,t,n){const r=async r=>{if(void 0===r?.index)return rt(e,n,t);const a=await ut(e,n,t,r.index,r.hasTimestamp??!0),i="number"==typeof r.index?F.fromBigInt(BigInt(r.index)):r.index;return{payload:a.payload,feedIndex:i,feedIndexNext:i.next()}};return{download:r,downloadPayload:async r=>{if(void 0===r?.index)return rt(e,n,t);const a=await lt(e,n,t,r.index),i=a.span.toBigInt()<=4096n?a.payload:await et(e,new at(a.address)),o="number"==typeof r.index?F.fromBigInt(BigInt(r.index)):r.index;return{payload:i,feedIndex:o,feedIndexNext:o.next()}},downloadReference:async a=>{let i=a?.index;void 0===i&&(i=(await async function(e,t,n){return nt((await Le(e,{responseType:"arraybuffer",url:`${tt}/${t}/${n}`,params:{"Swarm-Only-Root-Chunk":!0}})).headers)}(e,n,t)).feedIndex);const o=await r({...a,index:i});return{reference:new D(o.payload.toUint8Array()),feedIndex:o.feedIndex,feedIndexNext:o.feedIndexNext??o.feedIndex.next()}},owner:n,topic:t}}function ht(e,t,n){const r=async(r,i,o)=>async function(e,t,n,r,i,o){r=new D(r);const s=it(n,o?.index??await ot(e,t.publicKey().address(),n)),c=o?.at??Date.now()/1e3,u=a.numberToUint64(BigInt(Math.floor(c)),"BE");return Je(e,t,i,s,a.concatBytes(u,r.toUint8Array()),o)}(e,n,t,i,r,o);return{...ft(e,t,n.publicKey().address()),upload:r,uploadReference:r,uploadPayload:async(r,a,i)=>st(e,n,t,a,r,i)}}async function pt(e,t,n,r,a,i){const o=function(e,t,n){const r=n.toBigInt(),a=[];for(let i=0n;i<=r;i++)a.push(ct(e,t,F.fromBigInt(i)));return a}(t,n,r).map((async t=>async function(e,t,n,r){try{return await e.downloadChunk(t,n,r),!0}catch(a){const e=c.getDeep(a,"status");if(404===e||500===e)return!1;throw a}}(e,t,a,i)));return(await Promise.all(o)).every((e=>e))}function mt(e){if(!function(e){return!!Array.isArray(e)&&e.every((e=>"object"==typeof e&&e.path&&void 0!==e.size))}(e))throw new L("invalid collection",e)}function dt(e){if(e.webkitRelativePath&&""!==e.webkitRelativePath)return e.webkitRelativePath.replace(/.*?\//i,"");if(e.name)return e.name;throw new TypeError("file is not valid File object")}function gt(e){return Array.from(e).map((e=>({path:dt(e),size:e.size,file:e})))}function bt(e){return Array.from(e).reduce(((e,t)=>e+t.size),0)}class yt{output=new le.PassThrough;currentFileSize=0;beginFile(e,t){if(e.length>100)throw new Error(`File name too long: ${e}`);const n=function(e,t){const n=Buffer.alloc(512,0);n.write(e.slice(0,100).padEnd(100,"\0"),0,100),n.write("0000777\0",100,8),n.write("0001750\0",108,8),n.write("0001750\0",116,8),n.write(t.toString(8).padStart(11,"0")+"\0",124,12);const r=Math.floor((new Date).getTime()/1e3);n.write(r.toString(8).padStart(11,"0")+"\0",136,12),n.write(" ",148,8),n.write("0",156,1),n.write("ustar\0\0",257,8);let a=0;for(let i=0;i<512;i++)a+=n[i];return n.write(a.toString(8).padStart(6,"0")+"\0 ",148,8),n}(e,t);this.output.write(n),this.currentFileSize=0}async appendFile(e){return new Promise((t=>{this.output.write(e)?t():this.output.once("drain",(()=>{t()})),this.currentFileSize+=e.length}))}async endFile(){const e=this.currentFileSize%512==0?0:512-this.currentFileSize%512;e>0&&this.output.write(Buffer.alloc(e,0))}async end(){return new Promise((e=>{this.output.write(Buffer.alloc(1024,0)),this.output.end((()=>{e()}))}))}}var wt=n(6497),Bt=n.n(wt);async function vt(e,t,n,r){const a=new yt,i=Le(e,{method:"post",url:"bzz",data:a.output,responseType:"json",headers:{"content-type":"application/x-tar","swarm-collection":"true",...$e(n,r)}});await async function(e,t){for(const n of e)if(t.beginFile(n.path,n.size),n.fsPath){const e=(0,wt.createReadStream)(n.fsPath);for await(const n of e)await t.appendFile(n);await t.endFile(),e.close()}else{if(!n.file)throw new Error("Invalid collection item");await t.appendFile(new Uint8Array(await n.file.arrayBuffer())),await t.endFile()}}(t,a),await a.end();return await i}const Tt="bzz";async function Et(e,t,n,r,a){he(t)&&!a?.contentType&&(a||(a={}),a.contentType="application/octet-stream");const i=await Le(e,{method:"post",url:Tt,data:t,headers:$e(n,a),params:{name:r},responseType:"json"}),o=f.asObject(i.data,{name:"response.data"});return{reference:new D(f.asHexString(o.reference)),tagUid:i.headers["swarm-tag"]?Be(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?h.of(new D(i.headers["swarm-act-history-address"])):h.empty()}}async function Rt(e,t,n,r){mt(t);const a=await vt(e,t,n,r),i=f.asObject(a.data,{name:"response.data"});return{reference:new D(f.asHexString(i.reference)),tagUid:a.headers["swarm-tag"]?Be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?h.of(new D(a.headers["swarm-act-history-address"])):h.empty()}}const Ot="balances",xt="consumed";const St="chequebook";async function At(e,t){const n=await Le(e,{url:St+`/cashout/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),uncashedAmount:ce.fromPLUR(pe(r.uncashedAmount,{name:"uncashedAmount"})),transactionHash:f.asNullableString(r.transactionHash),lastCashedCheque:f.asNullable((e=>Dt(e)),r.lastCashedCheque),result:f.asNullable((e=>function(e){const t=f.asObject(e,{name:"cashout result"});return{recipient:f.asString(t.recipient,{name:"recipient"}),lastPayout:ce.fromPLUR(pe(t.lastPayout,{name:"lastPayout"})),bounced:f.asBoolean(t.bounced,{name:"bounced"})}}(e)),r.result)}}function Dt(e){const t=f.asObject(e,{name:"cheque"});return{beneficiary:new S(f.asString(t.beneficiary,{name:"beneficiary"})),chequebook:new S(f.asString(t.chequebook,{name:"chequebook"})),payout:ce.fromPLUR(pe(t.payout,{name:"payout"}))}}function Vt(e,t){const n=f.asObject(e,{name:t});return n.disconnectedPeers||(n.disconnectedPeers=[]),n.connectedPeers||(n.connectedPeers=[]),{population:f.asNumber(n.population,{name:"population"}),connected:f.asNumber(n.connected,{name:"connected"}),connectedPeers:f.asArray(n.connectedPeers,{name:"connectedPeers"}).map((e=>({address:f.asString(f.asObject(e,{name:"connectedPeer"}).address,{name:"address"})}))),disconnectedPeers:f.asArray(n.disconnectedPeers,{name:"disconnectedPeers"}).map((e=>({address:f.asString(f.asObject(e,{name:"disconnectedPeer"}).address,{name:"address"})})))}}const Nt="settlements";const It="stake";class $t{constructor(e){if(this.bytes=Math.ceil(e),e<0)throw Error("Size must be at least 0")}static fromBytes(e){return new $t(e)}static fromKilobytes(e){return new $t(1e3*e)}static fromMegabytes(e){return new $t(1e3*e*1e3)}static fromGigabytes(e){return new $t(1e3*e*1e3*1e3)}toBytes(){return this.bytes}toGigabytes(){return this.bytes/1e3/1e3/1e3}toFormattedString(){return s.convertBytes(this.bytes,1e3)}represent(){return this.toFormattedString()}}function Pt(e){return Number.isInteger(e)?e<1?1:e>315569260?315569260:e:1}const zt="stamps";async function kt(e){const t=await Le(e,{method:"get",url:"batches",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.batches,{name:"batches"}).map((e=>f.asObject(e,{name:"batch"}))).map((e=>({batchID:new $(f.asString(e.batchID,{name:"batchID"})),batchTTL:f.asNumber(e.batchTTL,{name:"batchTTL"}),bucketDepth:f.asNumber(e.bucketDepth,{name:"bucketDepth"}),depth:f.asNumber(e.depth,{name:"depth"}),immutable:f.asBoolean(e.immutable,{name:"immutable"}),owner:new S(f.asString(e.owner,{name:"owner"})),start:f.asNumber(e.start,{name:"start"}),value:pe(e.value,{name:"value"})})))}async function Ft(e){const t=await Le(e,{method:"get",url:`${zt}`,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.stamps,{name:"stamps"}).map((e=>f.asObject(e,{name:"stamp"}))).map((e=>{const t=f.asNumber(e.utilization,{name:"utilization"}),n=f.asNumber(e.depth,{name:"depth"}),r=f.asNumber(e.bucketDepth,{name:"bucketDepth"}),a=Te(t,n,r),i=Pt(f.asNumber(e.batchTTL,{name:"batchTTL"})),o=se.fromSeconds(i);return{batchID:new $(f.asString(e.batchID,{name:"batchID"})),utilization:t,usable:f.asBoolean(e.usable,{name:"usable"}),label:f.asEmptiableString(e.label,{name:"label"}),depth:n,amount:pe(e.amount,{name:"amount"}),bucketDepth:r,blockNumber:f.asNumber(e.blockNumber,{name:"blockNumber"}),immutableFlag:f.asBoolean(e.immutableFlag,{name:"immutableFlag"}),usage:a,usageText:`${Math.round(100*a)}%`,size:$t.fromBytes(Oe(n)),remainingSize:$t.fromBytes(Math.ceil(Oe(n)*(1-a))),theoreticalSize:$t.fromBytes(Ee(n)),duration:o}}))}const Ut="wallet";var Lt=n(5359),jt=n.n(Lt);const Ct="2.6.0-d0aa8b93",Mt=Ct.split("-")[0],_t="7.3.0";async function Gt(e){const t=await Le(e,{method:"get",url:"health",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{apiVersion:f.asString(n.apiVersion,{name:"apiVersion"}),version:f.asString(n.version,{name:"version"}),status:f.asString(n.status,{name:"status"})}}const qt="transactions";function Ht(e){const t=f.asObject(e,{name:"transaction"});return{transactionHash:new V(f.asString(t.transactionHash,{name:"transactionHash"})),to:f.asString(t.to,{name:"to"}),nonce:f.asNumber(t.nonce,{name:"nonce"}),gasPrice:pe(t.gasPrice,{name:"gasPrice"}),gasLimit:f.asNumber(t.gasLimit,{name:"gasLimit"}),data:f.asString(t.data,{name:"data"}),created:f.asString(t.created,{name:"created"}),description:f.asString(t.description,{name:"description"}),value:pe(t.value,{name:"value"})}}const Wt="grantee";var Kt=n(7666),Xt=n.n(Kt);const Jt="gsoc";const Zt="pins";const Qt="pss";async function Yt(e,t,n,r,a,i){await Le(e,{method:"post",url:`${Qt}/send/${t}/${n}`,data:r,responseType:"json",params:{recipient:i},headers:$e(a)})}async function en(e){await Le(e,{url:""})}const tn="stewardship";const nn="tags";const rn=new TextEncoder,an=new TextDecoder,on=new Uint8Array([47]),sn=a.hexToUint8Array("5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b");class cn{constructor(e,t){this.prefix=e,this.node=t}static split(e,t){const n=a.commonPrefix(e.prefix,t.prefix);if(n.length===e.prefix.length){const r=t.prefix.slice(n.length);return t.node.path=t.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),t.node.parent=e.node,e.node.forks.set(r[0],t),e}if(n.length===t.prefix.length){const r=e.prefix.slice(n.length);return e.node.path=e.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),e.node.parent=t.node,t.node.forks.set(r[0],e),t}const r=new un({path:n}),i=new cn(e.prefix.slice(n.length),e.node),o=new cn(t.prefix.slice(n.length),t.node);return e.node.path=e.prefix.slice(n.length),t.node.path=t.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),r.forks.set(i.prefix[0],i),r.forks.set(o.prefix[0],o),i.node.parent=r,o.node.parent=r,new cn(n,r)}marshal(){if(!this.node.selfAddress)throw Error("Fork#marshal node.selfAddress is not set");const e=[];if(e.push(new Uint8Array([this.node.determineType()])),e.push(a.numberToUint8(this.prefix.length)),e.push(this.prefix),this.prefix.length<30&&e.push(new Uint8Array(30-this.prefix.length)),e.push(this.node.selfAddress),this.node.metadata){const t=a.padEndToMultiple(new Uint8Array([0,0,...rn.encode(JSON.stringify(this.node.metadata))]),32,10),n=a.numberToUint16(t.length-2,"BE");t.set(n,0),e.push(t)}return a.concatBytes(...e)}static unmarshal(e,t){const n=a.uint8ToNumber(e.read(1)),r=a.uint8ToNumber(e.read(1)),i=e.read(r);e.read(30-r);const o=e.read(t);let s;if(function(e,t){return(e&t)===t}(n,16)){const t=a.uint16ToNumber(e.read(2),"BE");s=JSON.parse(an.decode(e.read(t)))}return new cn(i,new un({selfAddress:o,metadata:s,path:i}))}}class un{obfuscationKey=new Uint8Array(32);selfAddress=null;targetAddress=new Uint8Array(32);metadata=null;path=new Uint8Array(0);forks=new Map;parent=null;constructor(e){e?.targetAddress&&(this.targetAddress=e.targetAddress),e?.selfAddress&&(this.selfAddress=e.selfAddress),e?.metadata&&(this.metadata=e.metadata),e?.obfuscationKey&&(this.obfuscationKey=e.obfuscationKey),e?.path&&(this.path=e.path),e?.parent&&(this.parent=e.parent)}get fullPath(){return a.concatBytes(this.parent?.fullPath??new Uint8Array(0),this.path)}get fullPathString(){return an.decode(this.fullPath)}getRootMetadata(){const e=this.find("/");return e&&e.metadata?h.of(e.metadata):h.empty()}getDocsMetadata(){const e=this.find("/");return e&&e.metadata?{indexDocument:e.metadata["website-index-document"]??null,errorDocument:e.metadata["website-error-document"]??null}:{indexDocument:null,errorDocument:null}}async resolveFeed(e,t){const n=this.find("/");if(!n||!n.metadata)return h.empty();const r=n.metadata["swarm-feed-owner"],a=n.metadata["swarm-feed-topic"];return r&&a?h.of(await e.fetchLatestFeedUpdate(a,r,t)):h.empty()}async marshal(){for(const a of this.forks.values())a.node.selfAddress||(a.node.selfAddress=(await a.node.calculateSelfAddress()).toUint8Array());const e=new Uint8Array(32);e.set(sn,0),e.set(a.equals(this.targetAddress,On)&&a.equals(this.path,new Uint8Array([47]))?a.numberToUint8(0):a.numberToUint8(this.targetAddress.length),31);const t=new Uint8Array(32);for(const i of this.forks.keys())a.setBit(t,i,1,"LE");const n=[];for(let i=0;i<256;i++)a.getBit(t,i,"LE")&&n.push(this.forks.get(i).marshal());const r=a.xorCypher(a.concatBytes(e,a.equals(this.targetAddress,On)&&a.equals(this.path,new Uint8Array([47]))?new Uint8Array(0):this.targetAddress,t,...n),this.obfuscationKey);return a.concatBytes(this.obfuscationKey,r)}static async unmarshal(e,t,n,r){t=new D(t);const a=(await e.downloadData(t,n,r)).toUint8Array();return this.unmarshalFromData(a,t.toUint8Array())}static unmarshalFromData(e,t){const n=e.subarray(0,32),r=a.xorCypher(e.subarray(32),n),i=new g(r),o=i.read(31);if(!a.equals(o,sn.slice(0,31)))throw new Error("MantarayNode#unmarshal invalid version hash");const s=a.uint8ToNumber(i.read(1)),c=0===s?On:i.read(s),u=new un({selfAddress:t,targetAddress:c,obfuscationKey:n}),l=i.read(32);for(let f=0;f<256;f++)if(a.getBit(l,f,"LE")){const e=cn.unmarshal(i,s);u.forks.set(f,e),e.node.parent=u}return u}addFork(e,t,n){this.selfAddress=null,e=e instanceof Uint8Array?e:rn.encode(e);let r=this;for(;e.length;){const a=e.slice(0,30),i=0===(e=e.slice(30)).length,[o,s]=r.findClosest(a),c=a.slice(s.length);if(s.length&&(r=o),!c.length)continue;const u=new cn(c,new un({targetAddress:i?new D(t).toUint8Array():void 0,metadata:i?n:void 0,path:c})),l=o.forks.get(c[0]);if(l){const e=cn.split(u,l);r.forks.set(c[0],e),e.node.parent=r,r.selfAddress=null,r=u.node}else r.forks.set(c[0],u),u.node.parent=r,r.selfAddress=null,r=u.node}}removeFork(e){if(this.selfAddress=null,0===(e=e instanceof Uint8Array?e:rn.encode(e)).length)throw Error("MantarayNode#removeFork [path] parameter cannot be empty");const t=this.find(e);if(!t)throw Error("MantarayNode#removeFork fork not found");const[n,r]=this.findClosest(e.slice(0,e.length-1));n.forks.delete(e.slice(r.length)[0]);for(const i of t.forks.values())n.addFork(a.concatBytes(t.path,i.prefix),i.node.targetAddress,i.node.metadata)}async calculateSelfAddress(){return this.selfAddress?new D(this.selfAddress):new D((await p.root(await this.marshal())).hash())}async saveRecursively(e,t,n,r){for(const i of this.forks.values())await i.node.saveRecursively(e,t,n,r);const a=await e.uploadData(t,await this.marshal(),n,r);return this.selfAddress=a.reference.toUint8Array(),a}async loadRecursively(e,t,n){for(const r of this.forks.values()){if(!r.node.selfAddress)throw Error("MantarayNode#loadRecursively fork.node.selfAddress is not set");const a=await un.unmarshal(e,r.node.selfAddress,t,n);r.node.targetAddress=a.targetAddress,r.node.forks=a.forks,r.node.path=r.prefix,r.node.parent=this,await r.node.loadRecursively(e,t,n)}}find(e){const[t,n]=this.findClosest(e);return n.length===e.length?t:null}findClosest(e,t=new Uint8Array){if(0===(e=e instanceof Uint8Array?e:rn.encode(e)).length)return[this,t];const n=this.forks.get(e[0]);return n&&a.commonPrefix(n.prefix,e).length===n.prefix.length?n.node.findClosest(e.slice(n.prefix.length),a.concatBytes(t,n.prefix)):[this,t]}collect(e=[]){for(const t of this.forks.values())a.equals(t.node.targetAddress,On)||e.push(t.node),t.node.collect(e);return e}collectAndMap(){const e=this.collect(),t={};for(const n of e)t[n.fullPathString]=new D(n.targetAddress).toHex();return t}determineType(){let e=0;return a.equals(this.targetAddress,On)&&!a.equals(this.path,on)||(e|=2),this.forks.size>0&&(e|=4),-1===a.indexOf(this.path,on)||a.equals(this.path,on)||(e|=8),this.metadata&&(e|=16),e}}var ln=n(4061),fn=n.n(ln);async function hn(e){if("string"!=typeof e)throw new TypeError("dir has to be string!");if(""===e)throw new TypeError("dir must not be empty string!");return pn(e,"")}async function pn(e,t){const n=fn().join(e,t),r=await Bt().promises.opendir(n);let a=[];for await(const i of r){const n=fn().join(e,t,i.name),r=fn().join(t,i.name);i.isFile()?a.push({path:r,size:(await Bt().promises.stat(n)).size,fsPath:n}):i.isDirectory()&&(a=[...await pn(e,r),...a])}return a}async function mn(e){if("string"!=typeof e)throw new TypeError("dir has to be string!");if(""===e)throw new TypeError("dir must not be empty string!");const t=await Bt().promises.opendir(e);let n=0;for await(const r of t)if(r.isFile()){n+=(await Bt().promises.stat(fn().join(e,r.name))).size}else r.isDirectory()&&(n+=await mn(fn().join(e,r.name)));return n}const dn={aac:"audio/aac",abw:"application/x-abiword",ai:"application/postscript",arc:"application/octet-stream",avi:"video/x-msvideo",azw:"application/vnd.amazon.ebook",bin:"application/octet-stream",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",css:"text/css",csv:"text/csv",doc:"application/msword",dll:"application/octet-stream",dmg:"application/x-apple-diskimage",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gif:"image/gif",htm:"text/html",html:"text/html",ico:"image/x-icon",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/javascript",json:"application/json",mid:"audio/midi",midi:"audio/midi",mp2:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpkg:"application/vnd.apple.installer+xml",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",otf:"font/otf",png:"image/png",pdf:"application/pdf",ppt:"application/vnd.ms-powerpoint",rar:"application/x-rar-compressed",rtf:"application/rtf",sh:"application/x-sh",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",ts:"application/typescript",ttf:"font/ttf",txt:"text/plain",vsd:"application/vnd.visio",wav:"audio/x-wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xlsx:"application/vnd.ms-excel",xml:"application/xml",xul:"application/vnd.mozilla.xul+xml",zip:"application/zip","3gp":"video/3gpp","3gp2":"video/3gpp2","7z":"application/x-7z-compressed"};function gn(e){return["text/html","text/css"].includes(e)?`${e}; charset=utf-8`:e}async function bn(e){if("string"==typeof e)return(new TextEncoder).encode(e);if(e instanceof Buffer)return new Uint8Array(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(t=e,Array.isArray(t)&&t.length>0&&t.every((e=>e instanceof Buffer)))return new Uint8Array(Buffer.concat(e));var t;throw new TypeError("unknown websocket data type")}function yn(e){if(!function(e){try{if("string"!=typeof e)return!1;const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(t){return!1}}(e))throw new L("URL is not valid!",e)}class wn{constructor(e,t){yn(e),this.url=function(e){return e.endsWith("/")?e.slice(0,-1):e}(e),t?.signer&&(this.signer=new O(t.signer)),this.network=t?.network??"gnosis",this.requestOptions={baseURL:this.url,timeout:t?.timeout??0,headers:t?.headers,onRequest:t?.onRequest,httpAgent:t?.httpAgent,httpsAgent:t?.httpsAgent}}async uploadData(e,t,n,r){return e=new $(e),we(t),n&&(n=function(e,t="UploadOptions"){const n=de(e,t),r=f.asObject(e,{name:t});return{...n,redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),r.redundancyLevel)}}(n)),Ye(this.getRequestOptionsForCall(r),t,e,n)}async probeData(e,t){return e=new D(e),async function(e,t){t=new D(t);const n=await Le(e,{url:`${Qe}/${t}`,method:"head",responseType:"json"});return{contentLength:parseInt(n.headers["content-length"])}}(this.getRequestOptionsForCall(t),e)}async downloadData(e,t,n){return t&&(t=me(t)),et(this.getRequestOptionsForCall(n),new at(e),t)}async downloadReadableData(e,t,n){return t&&(t=me(t)),async function(e,t,n){return n&&(n=me(n)),(await Le(e,{responseType:"stream",url:`${Qe}/${t}`,headers:$e(null,n)})).data}(this.getRequestOptionsForCall(n),new at(e),t)}async uploadChunk(e,t,n,r){if(t=t instanceof Uint8Array?t:t.data,n&&(n=de(n)),t.length<N.LENGTH)throw new L(`Chunk has to have size of at least ${N.LENGTH}.`,t);if(t.length>Z+N.LENGTH)throw new L(`Chunk has to have size of at most ${Z+N.LENGTH}.`,t);return async function(e,t,n,r){const a=await Le(e,{method:"post",url:`${Ce}`,data:t,headers:{"content-type":"application/octet-stream",...$e(n,r)},responseType:"json"}),i=f.asObject(a.data,{name:"response.data"});return{reference:new D(f.asString(i.reference,{name:"reference"})),tagUid:a.headers["swarm-tag"]?Be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?h.of(new D(a.headers["swarm-act-history-address"])):h.empty()}}(this.getRequestOptionsForCall(r),t,e,n)}async downloadChunk(e,t,n){return e=new D(e),t&&(t=me(t)),Me(this.getRequestOptionsForCall(n),e,t)}async createGrantees(e,t,n){return e=new $(e),t=t.map((e=>new x(e))),async function(e,t,n){const r=await Le(e,{method:"post",url:Wt,data:{grantees:n.map((e=>e.toCompressedHex()))},headers:$e(t),responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return{status:r.status,statusText:r.statusText,ref:new D(f.asString(a.ref,{name:"ref"})),historyref:new D(f.asString(a.historyref,{name:"historyref"}))}}(this.getRequestOptionsForCall(n),e,t)}async getGrantees(e,t){return async function(e,t){const n=await Le(t,{method:"get",url:`${Wt}/${e}`,responseType:"json"}),r=f.asArray(n.data,{name:"response.data"}).map((e=>new x(f.asString(e,{name:"grantee"}))));return{status:n.status,statusText:n.statusText,grantees:r}}(e=new D(e),this.getRequestOptionsForCall(t))}async patchGrantees(e,t,n,r,a){return async function(e,t,n,r,a){const i=await Le(a,{method:"patch",url:`${Wt}/${t}`,data:{add:r.add?.map((e=>e.toCompressedHex())),revoke:r.revoke?.map((e=>e.toCompressedHex()))},headers:{...$e(e),"swarm-act-history-address":n.toHex()},responseType:"json"}),o=f.asObject(i.data,{name:"response.data"});return{status:i.status,statusText:i.statusText,ref:new D(f.asString(o.ref,{name:"ref"})),historyref:new D(f.asString(o.historyref,{name:"historyref"}))}}(e=new $(e),t=new D(t),n=new D(n),{add:r.add?.map((e=>new x(e)))??[],revoke:r.revoke?.map((e=>new x(e)))??[]},this.getRequestOptionsForCall(a))}async uploadFile(e,t,n,r,a){if(e=new $(e),function(e){if(!("string"==typeof e||e instanceof Uint8Array||fe(e)||he(e)))throw new TypeError("Data must be either string, Readable, Uint8Array or File!")}(t),r&&(r=function(e){const t=de(e,"FileUploadOptions"),n=f.asObject(e,{name:"FileUploadOptions"});return{...t,size:f.asOptional((e=>f.asInteger(e,{name:"size",min:0})),n.size),contentType:f.asOptional((e=>f.asString(e,{name:"contentType"})),n.contentType),redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),n.redundancyLevel)}}(r)),n&&"string"!=typeof n)throw new TypeError("name has to be string or undefined!");if(fe(t)){const i=await async function(e){return e.arrayBuffer?e.arrayBuffer():new Promise((t=>{const n=new FileReader;n.onload=()=>t(n.result),n.readAsArrayBuffer(e)}))}(t),o=n??t.name,s={contentType:t.type,...r};return Et(this.getRequestOptionsForCall(a),i,e,o,s)}return Et(this.getRequestOptionsForCall(a),t,e,n,r)}async downloadFile(e,t="",n,r){return n&&(n=me(n)),async function(e,t,n="",r){const a=await Le(e,{method:"GET",responseType:"arraybuffer",url:`${Tt}/${t}/${n}`,headers:$e(null,r)});return{...Ie(a.headers),data:new w(a.data)}}(this.getRequestOptionsForCall(r),new at(e),t,n)}async downloadReadableFile(e,t="",n,r){return e=new D(e),n&&(n=me(n)),async function(e,t,n="",r){t=new D(t);const a=await Le(e,{method:"GET",responseType:"stream",url:`${Tt}/${t}/${n}`,headers:$e(null,r)});return{...Ie(a.headers),data:a.data}}(this.getRequestOptionsForCall(r),e,t,n)}async uploadFiles(e,t,n,r){e=new $(e),n&&(n=ge(n));const a=gt(t);return Rt(this.getRequestOptionsForCall(r),a,e,n)}async hashDirectory(e){return async function(e){const t=await hn(e),n=new un;for(const r of t){const e=new p(p.NOOP);if(!r.fsPath)throw Error("File does not have fsPath, which should never happen in node. Please report this issue.");const t=(0,wt.createReadStream)(r.fsPath);for await(const n of t)await e.append(n);const a=await e.finalize(),{filename:i,extension:o}=u.parseFilename(r.path);n.addFork(r.path,a.hash(),{"Content-Type":gn(dn[o.toLowerCase()]||"application/octet-stream"),Filename:i})}return n.calculateSelfAddress()}(e)}async streamDirectory(e,t,n,r,a){return async function(e,t,n,r,a,i){const o=new d(64,64);let s=0,c=0;n=new $(n);const l=await hn(t);for(const u of l)s+=(f=u.size,function e(t){return t<=1?t:t+e(Math.ceil(t/128))}(Math.ceil(f/4096)));var f;async function h(t){await o.enqueue((async()=>{await e.uploadChunk(n,t.build(),a,i),r?.({total:s,processed:++c})}))}const m=new un;for(const d of l){if(!d.fsPath)throw Error("File does not have fsPath, which should never happen in node. Please report this issue.");const e=(0,wt.createReadStream)(d.fsPath),t=new p(h);for await(const i of e)await t.append(i);const n=await t.finalize();await o.drain();const{filename:r,extension:a}=u.parseFilename(d.path);m.addFork(d.path,n.hash(),{"Content-Type":gn(dn[a.toLowerCase()]||"application/octet-stream"),Filename:r}),"index.html"===d.path&&m.addFork("/",On,{"website-index-document":"index.html"})}return m.saveRecursively(e,n,a,i)}(this,t,e=new $(e),n,r,this.getRequestOptionsForCall(a))}async streamFiles(e,t,n,r,a){return e=new $(e),async function(){throw new Error("Streaming files is not supported in Node.js")}(0,0,0,0,0,this.getRequestOptionsForCall(a))}async uploadCollection(e,t,n,r){return e=new $(e),mt(t),n&&(n=ge(n)),Rt(this.getRequestOptionsForCall(r),t,e,n)}async uploadFilesFromDirectory(e,t,n,r){e=new $(e),n&&(n=ge(n));const a=await hn(t);return Rt(this.getRequestOptionsForCall(r),a,e,n)}async createTag(e){return async function(e){const t=await Le(e,{method:"post",url:nn,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{address:f.asEmptiableString(n.address,{name:"address"}),seen:f.asNumber(n.seen,{name:"seen"}),sent:f.asNumber(n.sent,{name:"sent"}),split:f.asNumber(n.split,{name:"split"}),startedAt:f.asString(n.startedAt,{name:"startedAt"}),stored:f.asNumber(n.stored,{name:"stored"}),synced:f.asNumber(n.synced,{name:"synced"}),uid:f.asNumber(n.uid,{name:"uid"})}}(this.getRequestOptionsForCall(e))}async getAllTags(e,t){return e&&(e=function(e){const t=f.asObject(e,{name:"AllTagsOptions"});return{limit:f.asOptional((e=>f.asInteger(e,{name:"limit",min:te,max:ne})),t.limit),offset:f.asOptional((e=>f.asInteger(e,{name:"offset",min:0})),t.offset)}}(e)),async function(e,t,n){const r=await Le(e,{url:nn,params:{offset:t,limit:n},responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return f.asArray(a.tags,{name:"tags"}).map((e=>f.asObject(e,{name:"tag"}))).map((e=>({address:f.asEmptiableString(e.address,{name:"address"}),seen:f.asNumber(e.seen,{name:"seen"}),sent:f.asNumber(e.sent,{name:"sent"}),split:f.asNumber(e.split,{name:"split"}),startedAt:f.asString(e.startedAt,{name:"startedAt"}),stored:f.asNumber(e.stored,{name:"stored"}),synced:f.asNumber(e.synced,{name:"synced"}),uid:f.asNumber(e.uid,{name:"uid"})})))}(this.getRequestOptionsForCall(t),e?.offset,e?.limit)}async retrieveTag(e,t){return e=Be(e),async function(e,t){const n=await Le(e,{url:`${nn}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{address:f.asEmptiableString(r.address,{name:"address"}),seen:f.asNumber(r.seen,{name:"seen"}),sent:f.asNumber(r.sent,{name:"sent"}),split:f.asNumber(r.split,{name:"split"}),startedAt:f.asString(r.startedAt,{name:"startedAt"}),stored:f.asNumber(r.stored,{name:"stored"}),synced:f.asNumber(r.synced,{name:"synced"}),uid:f.asNumber(r.uid,{name:"uid"})}}(this.getRequestOptionsForCall(t),e)}async deleteTag(e,t){return e=Be(e),async function(e,t){await Le(e,{method:"delete",url:`${nn}/${t}`})}(this.getRequestOptionsForCall(t),e)}async updateTag(e,t,n){return t=new D(t),e=Be(e),async function(e,t,n){await Le(e,{method:"patch",url:`${nn}/${t}`,data:{reference:n}})}(this.getRequestOptionsForCall(n),e,t)}async pin(e,t){return e=new D(e),async function(e,t){await Le(e,{method:"post",responseType:"json",url:`${Zt}/${t}`})}(this.getRequestOptionsForCall(t),e)}async unpin(e,t){return e=new D(e),async function(e,t){await Le(e,{method:"delete",responseType:"json",url:`${Zt}/${t}`})}(this.getRequestOptionsForCall(t),e)}async getAllPins(e){return async function(e){const t=await Le(e,{method:"get",responseType:"json",url:`${Zt}`}),n=f.asObject(t.data,{name:"response.data"});return null===n.references?[]:f.asArray(n.references,{name:"references"}).map((e=>f.asString(e,{name:"reference"}))).map((e=>new D(e)))}(this.getRequestOptionsForCall(e))}async getPin(e,t){return e=new D(e),async function(e,t){const n=await Le(e,{method:"get",responseType:"json",url:`${Zt}/${t}`}),r=f.asObject(n.data,{name:"response.data"});return{reference:new D(f.asString(r.reference,{name:"reference"}))}}(this.getRequestOptionsForCall(t),e)}async reuploadPinnedData(e,t,n){e=new $(e),t=new D(t),await async function(e,t,n){await Le(e,{method:"put",url:`${tn}/${n}`,headers:{"swarm-postage-batch-id":t.toHex()}})}(this.getRequestOptionsForCall(n),e,t)}async isReferenceRetrievable(e,t){return e=new D(e),async function(e,t){t=new D(t);const n=await Le(e,{method:"get",responseType:"json",url:`${tn}/${t}`}),r=f.asObject(n.data,{name:"response.data"});return f.asBoolean(r.isRetrievable,{name:"isRetrievable"})}(this.getRequestOptionsForCall(t),e)}async isFeedRetrievable(e,t,n,r,a){if(e=new S(e),t=new z(t),r&&(r=me(r)),!n)try{return await this.makeFeedReader(t,e,a).download(),!0}catch(i){const e=c.getDeep(i,"status");if(404===e||500===e)return!1;throw i}return pt(this,e,t,n,r,this.getRequestOptionsForCall(a))}async pssSend(e,t,n,r,a,i){return e=new $(e),we(r),a?(a=new x(a),Yt(this.getRequestOptionsForCall(i),t,n,r,e,a)):Yt(this.getRequestOptionsForCall(i),t,n,r,e)}pssSubscribe(e,t){t=function(e){const t=f.asObject(e,{name:"PssMessageHandler"});return{onMessage:f.asFunction(t.onMessage,{name:"onMessage"}),onError:f.asFunction(t.onError,{name:"onError"})}}(t);const n=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===l.whereAmI()?new(Xt())(`${r}/${Qt}/subscribe/${t.toHex()}`):new(Xt())(`${r}/${Qt}/subscribe/${t.toHex()}`,{headers:n})}(this.url,e,this.requestOptions.headers);let r=!1;const a={topic:e,cancel:()=>{!1===r&&(r=!0,n.terminate?n.terminate():n.close())}};return n.onmessage=async e=>{const n=await bn(e.data);n.length&&t.onMessage(new w(n),a)},n.onerror=e=>{r||t.onError(new U(e.message),a)},a}async pssReceive(e,t=0){if("number"!=typeof t)throw new TypeError("timeoutMsc parameter has to be a number!");return new Promise(((n,r)=>{let a;const i=this.pssSubscribe(e,{onError:e=>{clearTimeout(a),i.cancel(),r(e.message)},onMessage:e=>{clearTimeout(a),i.cancel(),n(e)}});t>0&&(a=setTimeout((()=>{i.cancel(),r(new U("pssReceive timeout"))}),t))}))}gsocMine(e,t,n=12){e=new I(e),t=new A(t);for(let r=0n;r<0xffffn;r++){const i=new O(a.numberToUint256(2867n+r,"BE")),o=We(t,i.publicKey().address());if(256-a.proximity(o.toUint8Array(),e.toUint8Array())<=256-n)return i}throw Error("Could not mine a valid signer")}async gsocSend(e,t,n,r,a,i){e=new $(e),t=new O(t),n=new A(n);const o=Ke(q(r),n,t);return async function(e,t,n,r){return Xe(e,t,n,r)}(this.getRequestOptionsForCall(i),o,e,a)}gsocSubscribe(e,t,n){e=new S(e),t=new A(t),n=function(e){const t=f.asObject(e,{name:"GsocMessageHandler"});return{onMessage:f.asFunction(t.onMessage,{name:"onMessage"}),onError:f.asFunction(t.onError,{name:"onError"})}}(n);const r=We(t,e),a=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===l.whereAmI()?new(Xt())(`${r}/${Jt}/subscribe/${t.toHex()}`):new(Xt())(`${r}/${Jt}/subscribe/${t.toHex()}`,{headers:n})}(this.url,r,this.requestOptions.headers);let i=!1;const o={address:e,cancel:()=>{!1===i&&(i=!0,a.terminate?a.terminate():a.close())}};return a.onmessage=async e=>{const t=await bn(e.data);t.length&&n.onMessage(new w(t),o)},a.onerror=e=>{i||n.onError(new U(e.message),o)},o}async createFeedManifest(e,t,n,r,a){return e=new $(e),t=new z(t),n=new S(n),r&&(r=de(r)),async function(e,t,n,r,a){const i=await Le(e,{method:"post",responseType:"json",url:`${tt}/${t}/${n}`,headers:$e(r,a)}),o=f.asObject(i.data,{name:"response.data"});return new D(f.asHexString(o.reference))}(this.getRequestOptionsForCall(a),n,t,e,r)}makeFeedReader(e,t,n){return e=new z(e),t=new S(t),ft(this.getRequestOptionsForCall(n),e,t)}makeFeedWriter(e,t,n){if(e=new z(e),!(t=t?new O(t):this.signer))throw Error("No signer provided");return ht(this.getRequestOptionsForCall(n),e,t)}async fetchLatestFeedUpdate(e,t,n){return e=new z(e),t=new S(t),rt(this.getRequestOptionsForCall(n),t,e)}makeSOCReader(e,t){return{owner:e=new S(e),download:Ze.bind(null,this.getRequestOptionsForCall(t),e)}}makeSOCWriter(e,t){if(!(e=e?new O(e):this.signer))throw Error("No signer provided");return{...this.makeSOCReader(e.publicKey().address(),t),upload:Je.bind(null,this.getRequestOptionsForCall(t),e)}}async createEnvelope(e,t,n){return e=new $(e),t=new D(t),async function(e,t,n){const r=await Le(e,{method:"post",responseType:"json",url:`envelope/${n}`,headers:{"swarm-postage-batch-id":t.toHex()}}),i=f.asObject(r.data,{name:"response.data"});return{issuer:a.hexToUint8Array(f.asHexString(i.issuer,{name:"issuer",byteLength:20})),index:a.hexToUint8Array(f.asHexString(i.index,{name:"index",byteLength:8})),timestamp:a.hexToUint8Array(f.asHexString(i.timestamp,{name:"timestamp",byteLength:8})),signature:a.hexToUint8Array(f.asHexString(i.signature,{name:"signature",byteLength:65})),batchId:t}}(this.getRequestOptionsForCall(n),e,t)}async rchash(e,t,n,r){return async function(e,t,n,r){const a=await Le(e,{responseType:"json",url:`rchash/${t}/${n}/${r}`}),i=f.asObject(a.data,{name:"response.data"});return f.asNumber(i.durationSeconds,{name:"durationSeconds"})}(this.getRequestOptionsForCall(r),e,t,n)}async checkConnection(e){return en(this.getRequestOptionsForCall(e))}async isConnected(e){try{await en(this.getRequestOptionsForCall(e))}catch(t){return!1}return!0}async isGateway(e){return async function(e){try{const t=await Le(e,{url:"/gateway"}),n=f.asObject(t.data);return f.asBoolean(n.gateway)}catch(t){return!1}}(this.getRequestOptionsForCall(e))}async getNodeAddresses(e){return async function(e){const t=await Le(e,{url:"addresses",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{overlay:new I(f.asString(n.overlay,{name:"overlay"})),underlay:f.asArray(n.underlay,{name:"underlay"}).map((e=>f.asString(e,{name:"underlay"}))),ethereum:new S(f.asString(n.ethereum,{name:"ethereum"})),publicKey:new x(f.asString(n.publicKey,{name:"publicKey"})),pssPublicKey:new x(f.asString(n.pssPublicKey,{name:"pssPublicKey"}))}}(this.getRequestOptionsForCall(e))}async getBlocklist(e){return async function(e){return(await Le(e,{url:"blocklist",responseType:"json"})).data.peers}(this.getRequestOptionsForCall(e))}async getPeers(e){return async function(e){const t=await Le(e,{url:"peers",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.peers,{name:"peers"}).map((e=>({address:f.asString(f.asObject(e,{name:"peer"}).address,{name:"address"}),fullNode:f.asBoolean(f.asObject(e,{name:"peer"}).fullNode,{name:"fullNode"})})))}(this.getRequestOptionsForCall(e))}async removePeer(e,t){return e=new I(e),async function(e,t){return(await Le(e,{url:`peers/${t}`,responseType:"json",method:"DELETE"})).data}(this.getRequestOptionsForCall(t),e)}async getTopology(e){return async function(e){const t=await Le(e,{url:"topology",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"}),r=f.asObject(n.bins,{name:"bins"});return{baseAddr:f.asString(n.baseAddr,{name:"baseAddr"}),population:f.asNumber(n.population,{name:"population"}),connected:f.asNumber(n.connected,{name:"connected"}),timestamp:f.asString(n.timestamp,{name:"timestamp"}),nnLowWatermark:f.asNumber(n.nnLowWatermark,{name:"nnLowWatermark"}),depth:f.asNumber(n.depth,{name:"depth"}),reachability:f.asString(n.reachability,{name:"reachability"}),networkAvailability:f.asString(n.networkAvailability,{name:"networkAvailability"}),bins:{bin_0:Vt(r.bin_0,"bin_0"),bin_1:Vt(r.bin_1,"bin_1"),bin_2:Vt(r.bin_2,"bin_2"),bin_3:Vt(r.bin_3,"bin_3"),bin_4:Vt(r.bin_4,"bin_4"),bin_5:Vt(r.bin_5,"bin_5"),bin_6:Vt(r.bin_6,"bin_6"),bin_7:Vt(r.bin_7,"bin_7"),bin_8:Vt(r.bin_8,"bin_8"),bin_9:Vt(r.bin_9,"bin_9"),bin_10:Vt(r.bin_10,"bin_10"),bin_11:Vt(r.bin_11,"bin_11"),bin_12:Vt(r.bin_12,"bin_12"),bin_13:Vt(r.bin_13,"bin_13"),bin_14:Vt(r.bin_14,"bin_14"),bin_15:Vt(r.bin_15,"bin_15"),bin_16:Vt(r.bin_16,"bin_16"),bin_17:Vt(r.bin_17,"bin_17"),bin_18:Vt(r.bin_18,"bin_18"),bin_19:Vt(r.bin_19,"bin_19"),bin_20:Vt(r.bin_20,"bin_20"),bin_21:Vt(r.bin_21,"bin_21"),bin_22:Vt(r.bin_22,"bin_22"),bin_23:Vt(r.bin_23,"bin_23"),bin_24:Vt(r.bin_24,"bin_24"),bin_25:Vt(r.bin_25,"bin_25"),bin_26:Vt(r.bin_26,"bin_26"),bin_27:Vt(r.bin_27,"bin_27"),bin_28:Vt(r.bin_28,"bin_28"),bin_29:Vt(r.bin_29,"bin_29"),bin_30:Vt(r.bin_30,"bin_30"),bin_31:Vt(r.bin_31,"bin_31")}}}(this.getRequestOptionsForCall(e))}async pingPeer(e,t){return e=new I(e),async function(e,t){return(await Le(e,{url:`pingpong/${t}`,responseType:"json",method:"POST"})).data}(this.getRequestOptionsForCall(t),e)}async getAllBalances(e){return async function(e){const t=await Le(e,{url:Ot,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{balances:f.asArray(n.balances,{name:"balances"}).map((e=>f.asObject(e,{name:"balance"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),balance:ce.fromPLUR(pe(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPeerBalance(e,t){return e=new I(e),async function(e,t){const n=await Le(e,{url:`${Ot}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:ce.fromPLUR(pe(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getPastDueConsumptionBalances(e){return async function(e){const t=await Le(e,{url:xt,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{balances:f.asArray(n.balances,{name:"balances"}).map((e=>f.asObject(e,{name:"balance"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),balance:ce.fromPLUR(pe(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPastDueConsumptionPeerBalance(e,t){return e=new I(e),async function(e,t){const n=await Le(e,{url:`${xt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:ce.fromPLUR(pe(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getChequebookAddress(e){return async function(e){const t=await Le(e,{url:St+"/address",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{chequebookAddress:f.asString(n.chequebookAddress,{name:"chequebookAddress"})}}(this.getRequestOptionsForCall(e))}async getChequebookBalance(e){return async function(e){const t=await Le(e,{url:St+"/balance",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{availableBalance:ce.fromPLUR(pe(n.availableBalance,{name:"availableBalance"})),totalBalance:ce.fromPLUR(pe(n.totalBalance,{name:"totalBalance"}))}}(this.getRequestOptionsForCall(e))}async getLastCheques(e){return async function(e){const t=await Le(e,{url:St+"/cheque",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{lastcheques:f.asArray(n.lastcheques,{name:"lastcheques"}).map((e=>f.asObject(e,{name:"lastcheque"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),lastreceived:f.asNullable((e=>Dt(e)),e.lastreceived),lastsent:f.asNullable((e=>Dt(e)),e.lastsent)})))}}(this.getRequestOptionsForCall(e))}async getLastChequesForPeer(e,t){return e=new I(e),async function(e,t){const n=await Le(e,{url:St+`/cheque/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),lastreceived:f.asNullable((e=>Dt(e)),r.lastreceived),lastsent:f.asNullable((e=>Dt(e)),r.lastsent)}}(this.getRequestOptionsForCall(t),e)}async getLastCashoutAction(e,t){return e=new I(e),At(this.getRequestOptionsForCall(t),e)}async cashoutLastCheque(e,t,n){return e=new I(e),t&&ye(t),async function(e,t,n){const r=await Le(e,{method:"post",url:St+`/cashout/${t}`,responseType:"json",headers:$e(null,n)}),a=f.asObject(r.data,{name:"response.data"});return new V(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,t)}async depositTokens(e,t,n){return this.depositBZZToChequebook(e,t,n)}async depositBZZToChequebook(e,t,n){const r=e instanceof ce?e.toPLURString():pe(e,{min:1n,name:"amount"});let a;return t&&(a=pe(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await Le(e,{method:"post",url:St+"/deposit",responseType:"json",params:{amount:t.toString(10)},headers:r}),i=f.asObject(a.data,{name:"response.data"});return new V(f.asString(i.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),r,a)}async withdrawTokens(e,t,n){return this.withdrawBZZFromChequebook(e,t,n)}async withdrawBZZFromChequebook(e,t,n){const r=e instanceof ce?e.toPLURString():pe(e,{min:1n,name:"amount"});let a;return t&&(a=pe(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await Le(e,{method:"post",url:St+"/withdraw",responseType:"json",params:{amount:t.toString(10)},headers:r}),i=f.asObject(a.data,{name:"response.data"});return new V(f.asString(i.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),r,a)}async withdrawBZZToExternalWallet(e,t,n){return e=e instanceof ce?e:ce.fromPLUR(e),t=new S(t),async function(e,t,n){const r=await Le(e,{method:"post",url:`${Ut}/withdraw/bzz`,responseType:"json",params:{amount:t.toPLURString(),address:n.toHex()}}),a=f.asObject(r.data,{name:"response.data"});return new V(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,t)}async withdrawDAIToExternalWallet(e,t,n){return e=e instanceof ue?e:ue.fromWei(e),t=new S(t),async function(e,t,n){const r=await Le(e,{method:"post",url:`${Ut}/withdraw/nativetoken`,responseType:"json",params:{amount:t.toWeiString(),address:n.toHex()}}),a=f.asObject(r.data,{name:"response.data"});return new V(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,t)}async getSettlements(e,t){return e=new I(e),async function(e,t){const n=await Le(e,{url:`${Nt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),sent:ce.fromPLUR(pe(r.sent,{name:"sent"})),received:ce.fromPLUR(pe(r.received,{name:"received"}))}}(this.getRequestOptionsForCall(t),e)}async getAllSettlements(e){return async function(e){const t=await Le(e,{url:Nt,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{totalSent:ce.fromPLUR(pe(n.totalSent,{name:"totalSent"})),totalReceived:ce.fromPLUR(pe(n.totalReceived,{name:"totalReceived"})),settlements:f.asArray(n.settlements,{name:"settlements"}).map((e=>f.asObject(e,{name:"settlement"}))).map((e=>({peer:f.asString(e.peer,{name:"peer"}),sent:ce.fromPLUR(pe(e.sent,{name:"sent"})),received:ce.fromPLUR(pe(e.received,{name:"received"}))})))}}(this.getRequestOptionsForCall(e))}async getStatus(e){return async function(e){const t=await Le(e,{method:"get",url:"status",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{overlay:f.asString(n.overlay,{name:"overlay"}),proximity:f.asNumber(n.proximity,{name:"proximity"}),beeMode:K(f.asString(n.beeMode,{name:"beeMode"})),reserveSize:f.asNumber(n.reserveSize,{name:"reserveSize"}),reserveSizeWithinRadius:f.asNumber(n.reserveSizeWithinRadius,{name:"reserveSizeWithinRadius"}),pullsyncRate:f.asNumber(n.pullsyncRate,{name:"pullsyncRate"}),storageRadius:f.asNumber(n.storageRadius,{name:"storageRadius"}),connectedPeers:f.asNumber(n.connectedPeers,{name:"connectedPeers"}),neighborhoodSize:f.asNumber(n.neighborhoodSize,{name:"neighborhoodSize"}),batchCommitment:f.asNumber(n.batchCommitment,{name:"batchCommitment"}),isReachable:f.asBoolean(n.isReachable,{name:"isReachable"}),lastSyncedBlock:f.asNumber(n.lastSyncedBlock,{name:"lastSyncedBlock"}),committedDepth:f.asNumber(n.committedDepth,{name:"committedDepth"}),isWarmingUp:f.asBoolean(n.isWarmingUp,{name:"isWarmingUp"})}}(this.getRequestOptionsForCall(e))}async getHealth(e){return Gt(this.getRequestOptionsForCall(e))}async getReadiness(e){return async function(e){const t=await Le(e,{method:"get",url:"readiness"}),n=f.asObject(t.data,{name:"response.data"});return{apiVersion:f.asString(n.apiVersion,{name:"apiVersion"}),version:f.asString(n.version,{name:"version"}),status:f.asString(n.status,{name:"status"})}}(this.getRequestOptionsForCall(e))}async getNodeInfo(e){return async function(e){const t=await Le(e,{method:"get",url:"node",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{beeMode:K(f.asString(n.beeMode,{name:"beeMode"})),chequebookEnabled:f.asBoolean(n.chequebookEnabled,{name:"chequebookEnabled"}),swapEnabled:f.asBoolean(n.swapEnabled,{name:"swapEnabled"})}}(this.getRequestOptionsForCall(e))}async isSupportedExactVersion(e){return async function(e){const{version:t}=await Gt(e);return t===Ct}(this.getRequestOptionsForCall(e))}async isSupportedApiVersion(e){return async function(e){const{apiVersion:t}=await Gt(e);return jt()(t)===jt()(_t)}(this.getRequestOptionsForCall(e))}async getVersions(e){return async function(e){const{version:t,apiVersion:n}=await Gt(e);return{supportedBeeVersion:Ct,supportedBeeApiVersion:_t,beeVersion:t,beeApiVersion:n}}(this.getRequestOptionsForCall(e))}async getReserveState(e){return async function(e){const t=await Le(e,{method:"get",url:"reservestate",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{commitment:f.asNumber(n.commitment,{name:"commitment"}),radius:f.asNumber(n.radius,{name:"radius"}),storageRadius:f.asNumber(n.storageRadius,{name:"storageRadius"})}}(this.getRequestOptionsForCall(e))}async getChainState(e){return async function(e){const t=await Le(e,{method:"get",url:"chainstate",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{block:f.asNumber(n.block,{name:"block"}),chainTip:f.asNumber(n.chainTip,{name:"chainTip"}),totalAmount:pe(n.totalAmount,{name:"totalAmount"}),currentPrice:(r=f.asNumber(n.currentPrice,{name:"currentPrice"}),Number.isInteger(r)?r<24e3?24e3:r:24e3)};var r}(this.getRequestOptionsForCall(e))}async getWalletBalance(e){return async function(e){const t=await Le(e,{method:"get",url:`${Ut}`,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{bzzBalance:ce.fromPLUR(pe(n.bzzBalance,{name:"bzzBalance"})),nativeTokenBalance:ue.fromWei(pe(n.nativeTokenBalance,{name:"nativeTokenBalance"})),chainID:f.asNumber(n.chainID,{name:"chainID"}),chequebookContractAddress:f.asString(n.chequebookContractAddress,{name:"chequebookContractAddress"}),walletAddress:f.asString(n.walletAddress,{name:"walletAddress"})}}(this.getRequestOptionsForCall(e))}async createPostageBatch(e,t,n,r){const a=pe(e,{min:0n,name:"amount"});if(n&&(n=be(n)),t<Y||t>ee)throw new L(`Depth has to be between ${Y}..${ee}`,t);const i=await this.getChainState(),o=17280n*BigInt(i.currentPrice)+1n;if(BigInt(a)<o)throw new L(`Amount has to be at least ${o} (1 day at current price ${i.currentPrice})`,a);const s=await async function(e,t,n,r){const a={};r?.gasPrice&&(a["gas-price"]=r.gasPrice.toString()),void 0!==r?.immutableFlag&&(a.immutable=String(r.immutableFlag));const i=await Le(e,{method:"post",url:`${zt}/${t}/${n}`,responseType:"json",params:{label:r?.label},headers:a}),o=f.asObject(i.data,{name:"response.data"});return new $(f.asString(o.batchID,{name:"batchID"}))}(this.getRequestOptionsForCall(r),a,t,n);return!1!==n?.waitForUsable&&await this.waitForUsablePostageStamp(s,n?.waitForUsableTimeout),s}async buyStorage(e,t,n,r,a,i){const o=De(t,(await this.getChainState(r)).currentPrice,"gnosis"===this.network?5:15),s=Ve(e,a,i);return n&&(n=be(n)),this.createPostageBatch(o,s,n,r)}async getStorageCost(e,t,n,r,a){const i=De(t,(await this.getChainState(n)).currentPrice,"gnosis"===this.network?5:15);return Se(Ve(e,r,a),i)}async extendStorageSize(e,t,n,r,a){const i=await this.getPostageBatch(e,n),o=Ve(t,r,a),s=o-i.depth;if(s<=0)throw new L("New depth has to be greater than the original depth",o);return await this.topUpBatch(i.batchID,BigInt(i.amount)*2n**BigInt(s-1)+1n,n),this.diluteBatch(i.batchID,o,n)}async extendStorageDuration(e,t,n){const r=await this.getPostageBatch(e,n),a=De(t,(await this.getChainState(n)).currentPrice,"gnosis"===this.network?5:15);return this.topUpBatch(r.batchID,a,n)}async getExtensionCost(e,t,n,r,a,i){const o=await this.getPostageBatch(e,r),s=De(n,(await this.getChainState(r)).currentPrice,"gnosis"===this.network?5:15),c=Ve(t,a,i),u=Se(o.depth,o.amount);return Se(c,s).minus(u)}async getSizeExtensionCost(e,t,n,r,a){const i=await this.getPostageBatch(e,n),o=Ve(t,r,a);if(o-i.depth<=0)throw new L("New depth has to be greater than the original depth",o);const s=Se(i.depth,i.amount);return Se(o,i.amount).minus(s)}async getDurationExtensionCost(e,t,n){const r=await this.getPostageBatch(e,n),a=De(t,(await this.getChainState(n)).currentPrice,"gnosis"===this.network?5:15);return Se(r.depth,a)}async topUpBatch(e,t,n){e=new $(e);const r=pe(t,{min:1n,name:"amount"});return async function(e,t,n){const r=await Le(e,{method:"patch",url:`${zt}/topup/${t}/${n}`,responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return new $(f.asString(a.batchID,{name:"batchID"}))}(this.getRequestOptionsForCall(n),e,r)}async diluteBatch(e,t,n){return e=new $(e),t=f.asNumber(t,{name:"depth",min:18,max:255}),async function(e,t,n){const r=await Le(e,{method:"patch",url:`${zt}/dilute/${t}/${n}`,responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return new $(f.asString(a.batchID,{name:"batchID"}))}(this.getRequestOptionsForCall(n),e,t)}async getPostageBatch(e,t){return e=new $(e),async function(e,t){const n=await Le(e,{method:"get",url:`${zt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"}),a=f.asNumber(r.utilization,{name:"utilization"}),i=f.asNumber(r.depth,{name:"depth"}),o=f.asNumber(r.bucketDepth,{name:"bucketDepth"}),s=Te(a,i,o),c=Pt(f.asNumber(r.batchTTL,{name:"batchTTL"})),u=se.fromSeconds(c);return{batchID:new $(f.asString(r.batchID,{name:"batchID"})),utilization:a,usable:f.asBoolean(r.usable,{name:"usable"}),label:f.asEmptiableString(r.label,{name:"label"}),depth:i,amount:pe(r.amount,{name:"amount"}),bucketDepth:o,blockNumber:f.asNumber(r.blockNumber,{name:"blockNumber"}),immutableFlag:f.asBoolean(r.immutableFlag,{name:"immutableFlag"}),usage:s,usageText:`${Math.round(100*s)}%`,size:$t.fromBytes(Oe(i)),remainingSize:$t.fromBytes(Math.ceil(Oe(i)*(1-s))),theoreticalSize:$t.fromBytes(Ee(i)),duration:u}}(this.getRequestOptionsForCall(t),e)}async getPostageBatchBuckets(e,t){return e=new $(e),async function(e,t){const n=await Le(e,{method:"get",url:`${zt}/${t}/buckets`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{depth:f.asNumber(r.depth,{name:"depth"}),bucketDepth:f.asNumber(r.bucketDepth,{name:"bucketDepth"}),bucketUpperBound:f.asNumber(r.bucketUpperBound,{name:"bucketUpperBound"}),buckets:f.asArray(r.buckets,{name:"buckets"}).map((e=>f.asObject(e,{name:"bucket"}))).map((e=>({bucketID:f.asNumber(e.bucketID,{name:"bucketID"}),collisions:f.asNumber(e.collisions,{name:"collisions"})})))}}(this.getRequestOptionsForCall(t),e)}async getAllPostageBatch(e){return Ft(this.getRequestOptionsForCall(e))}async getAllGlobalPostageBatch(e){return kt(this.getRequestOptionsForCall(e))}async getPostageBatches(e){return Ft(this.getRequestOptionsForCall(e))}async getGlobalPostageBatches(e){return kt(this.getRequestOptionsForCall(e))}async getAllPendingTransactions(e){return async function(e){const t=await Le(e,{url:qt,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.pendingTransactions,{name:"pendingTransactions"}).map(Ht)}(this.getRequestOptionsForCall(e))}async getPendingTransaction(e,t){return e=new V(e),async function(e,t){const n=await Le(e,{url:`${qt}/${t}`,responseType:"json"});return Ht(f.asObject(n.data,{name:"response.data"}))}(this.getRequestOptionsForCall(t),e)}async rebroadcastPendingTransaction(e,t){return e=new V(e),async function(e,t){const n=await Le(e,{method:"post",url:`${qt}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return new V(f.asString(r.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(t),e)}async cancelPendingTransaction(e,t,n){let r;return e=new V(e),t&&(r=pe(t,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await Le(e,{method:"delete",headers:r,url:`${qt}/${t}`,responseType:"json"}),i=f.asObject(a.data,{name:"response.data"});return new V(f.asString(i.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,r)}async getStake(e){return async function(e){const t=await Le(e,{method:"get",responseType:"json",url:`${It}`}),n=f.asObject(t.data,{name:"response.data"});return ce.fromPLUR(pe(n.stakedAmount,{name:"stakedAmount"}))}(this.getRequestOptionsForCall(e))}async getWithdrawableStake(e){return async function(e){const t=await Le(e,{method:"get",responseType:"json",url:`${It}/withdrawable`}),n=f.asObject(t.data,{name:"response.data"});return ce.fromPLUR(pe(n.withdrawableAmount,{name:"withdrawableAmount"}))}(this.getRequestOptionsForCall(e))}async withdrawSurplusStake(e){return async function(e){const t=await Le(e,{method:"delete",responseType:"json",url:`${It}/withdrawable`}),n=f.asObject(t.data,{name:"response.data"});return new V(f.asHexString(n.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(e))}async migrateStake(e){return async function(e){const t=await Le(e,{method:"delete",responseType:"json",url:It}),n=f.asObject(t.data,{name:"response.data"});return new V(f.asHexString(n.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(e))}async depositStake(e,t,n){const r=e instanceof ce?e.toPLURString():pe(e,{min:1n,name:"amount"});return t&&(t=ye(t)),async function(e,t,n){const r=await Le(e,{method:"post",responseType:"json",url:`${It}/${t}`,headers:$e(null,n)}),a=f.asObject(r.data,{name:"response.data"});return new V(f.asHexString(a.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(n),r,t)}async getRedistributionState(e){return async function(e){const t=await Le(e,{method:"get",responseType:"json",url:"redistributionstate"}),n=f.asObject(t.data,{name:"response.data"});return{minimumGasFunds:ue.fromWei(pe(n.minimumGasFunds,{name:"minimumGasFunds"})),hasSufficientFunds:f.asBoolean(n.hasSufficientFunds,{name:"hasSufficientFunds"}),isFrozen:f.asBoolean(n.isFrozen,{name:"isFrozen"}),isFullySynced:f.asBoolean(n.isFullySynced,{name:"isFullySynced"}),phase:f.asString(n.phase,{name:"phase"}),round:f.asNumber(n.round,{name:"round"}),lastWonRound:f.asNumber(n.lastWonRound,{name:"lastWonRound"}),lastPlayedRound:f.asNumber(n.lastPlayedRound,{name:"lastPlayedRound"}),lastFrozenRound:f.asNumber(n.lastFrozenRound,{name:"lastFrozenRound"}),lastSelectedRound:f.asNumber(n.lastSelectedRound,{name:"lastSelectedRound"}),lastSampleDurationSeconds:f.asNumber(n.lastSampleDurationSeconds,{name:"lastSampleDurationSeconds"}),block:f.asNumber(n.block,{name:"block"}),reward:ce.fromPLUR(pe(n.reward,{name:"reward"})),fees:ue.fromWei(pe(n.fees,{name:"fees"})),isHealthy:f.asBoolean(n.isHealthy,{name:"isHealthy"})}}(this.getRequestOptionsForCall(e))}async waitForUsablePostageStamp(e,t=24e4){for(let r=0;r<t;r+=3e3){try{if((await this.getPostageBatch(e)).usable)return}catch(n){}await l.sleepMillis(3e3)}throw new U("Timeout on waiting for postage stamp to become usable")}getRequestOptionsForCall(e){return e&&(e=function(e){const t=f.asObject(e,{name:"BeeRequestOptions"});return{baseURL:f.asOptional((e=>f.asString(e,{name:"baseURL"})),t.baseURL),timeout:f.asOptional((e=>f.asInteger(e,{name:"timeout",min:0})),t.timeout),headers:f.asOptional((e=>f.asStringMap(e,{name:"headers"})),t.headers),onRequest:f.asOptional((e=>f.asFunction(e,{name:"onRequest"})),t.onRequest),httpAgent:t.httpAgent,httpsAgent:t.httpsAgent,endlesslyRetry:f.asOptional((e=>f.asBoolean(e,{name:"endlesslyRetry"})),t.endlesslyRetry)}}(e)),e?c.deepMerge2(this.requestOptions,e):this.requestOptions}}class Bn extends wn{async getNodeAddresses(e){const t=super.getRequestOptionsForCall(e),n=await Le(t,{url:"addresses",responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{overlay:new I(f.asString(r.overlay,{name:"overlay"})),underlay:[],ethereum:new S(f.asString(r.ethereum,{name:"ethereum"})),publicKey:new x(f.asString(r.publicKey,{name:"publicKey"})),pssPublicKey:new x(f.asString(r.pssPublicKey,{name:"pssPublicKey"}))}}async getTopology(e){const t=super.getRequestOptionsForCall(e),n=await Le(t,{url:"topology",responseType:"json"}),r=f.asObject(n.data,{name:"response.data"}),a=f.asObject(r.bins,{name:"bins"});return{baseAddr:"0bab5ca208a980950604f900f2791613fc980676c2dee7dd92a4fdda5a54bf26",population:f.asNumber(r.population,{name:"population"}),connected:f.asNumber(r.connected,{name:"connected"}),timestamp:f.asString(r.timestamp,{name:"timestamp"}),nnLowWatermark:f.asNumber(r.nnLowWatermark,{name:"nnLowWatermark"}),depth:f.asNumber(r.depth,{name:"depth"}),reachability:"Public",networkAvailability:"Available",bins:{bin_0:Vt(a.bin_0,"bin_0"),bin_1:Vt(a.bin_1,"bin_1"),bin_2:Vt(a.bin_2,"bin_2"),bin_3:Vt(a.bin_3,"bin_3"),bin_4:Vt(a.bin_4,"bin_4"),bin_5:Vt(a.bin_5,"bin_5"),bin_6:Vt(a.bin_6,"bin_6"),bin_7:Vt(a.bin_7,"bin_7"),bin_8:Vt(a.bin_8,"bin_8"),bin_9:Vt(a.bin_9,"bin_9"),bin_10:Vt(a.bin_10,"bin_10"),bin_11:Vt(a.bin_11,"bin_11"),bin_12:Vt(a.bin_12,"bin_12"),bin_13:Vt(a.bin_13,"bin_13"),bin_14:Vt(a.bin_14,"bin_14"),bin_15:Vt(a.bin_15,"bin_15"),bin_16:Vt(a.bin_16,"bin_16"),bin_17:Vt(a.bin_17,"bin_17"),bin_18:Vt(a.bin_18,"bin_18"),bin_19:Vt(a.bin_19,"bin_19"),bin_20:Vt(a.bin_20,"bin_20"),bin_21:Vt(a.bin_21,"bin_21"),bin_22:Vt(a.bin_22,"bin_22"),bin_23:Vt(a.bin_23,"bin_23"),bin_24:Vt(a.bin_24,"bin_24"),bin_25:Vt(a.bin_25,"bin_25"),bin_26:Vt(a.bin_26,"bin_26"),bin_27:Vt(a.bin_27,"bin_27"),bin_28:Vt(a.bin_28,"bin_28"),bin_29:Vt(a.bin_29,"bin_29"),bin_30:Vt(a.bin_30,"bin_30"),bin_31:Vt(a.bin_31,"bin_31")}}}}class vn{constructor(e,t,n,r){this.signer=new O(e),this.batchId=new $(t),this.buckets=n,this.depth=r,this.maxSlot=2**(this.depth-16)}static fromBlank(e,t,n){return new vn(e,t,new Uint32Array(65536),n)}static fromState(e,t,n,r){return new vn(e,t,n,r)}stamp(e){const t=e.hash(),n=a.uint16ToNumber(t,"BE"),r=this.buckets[n];if(r>=this.maxSlot)throw Error("Bucket is full");this.buckets[n]++;const i=a.concatBytes(a.numberToUint32(n,"BE"),a.numberToUint32(r,"BE")),o=a.numberToUint64(BigInt(Date.now()),"BE"),s=this.signer.sign(a.concatBytes(t,this.batchId.toUint8Array(),i,o));return{batchId:this.batchId,index:i,issuer:this.signer.publicKey().address().toUint8Array(),signature:s.toUint8Array(),timestamp:o}}getState(){return this.buckets}}const Tn="https://api.gateway.ethswarm.org",En=new $("0000000000000000000000000000000000000000000000000000000000000000"),Rn=new z("0000000000000000000000000000000000000000000000000000000000000000"),On=new Uint8Array(32),xn=new Uint8Array(32),Sn=new Uint8Array(20);function An(e){return(e=new I(e)).toHex().slice(0,Q)}const Dn=[[94,68,46,28,14,5,1],[9,8,7,6,5,4,3]],Vn=[[47,34,23,14,7,2],[9,8,7,6,5,4]],Nn=[[104,95,86,77,69,61,53,46,39,32,26,20,15,10,6,3,1],[21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5]],In=[[52,47,43,38,34,30,26,23,19,16,13,10,7,5,3,1],[21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6]],$n=[[92,87,82,77,73,68,63,59,54,50,45,41,37,33,29,26,22,19,16,13,10,8,5,3,2,1],[31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6]],Pn=[[46,43,41,38,36,34,31,29,27,25,22,20,18,16,14,13,11,9,8,6,5,4,2,1],[31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,7]],zn=[[37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1],[90,88,87,85,84,82,81,79,77,76,74,72,71,69,67,66,64,62,60,59,57,55,53,51,49,48,46,44,41,39,37,35,32,30,27,24,20]],kn=[[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1],[88,85,82,79,76,72,69,66,62,59,55,51,48,44,39,35,30,24]];function Fn(e,t,n){if(t===ae.OFF)return 0;const r=function(e,t){switch(e){case ae.MEDIUM:return t?Vn:Dn;case ae.STRONG:return t?In:Nn;case ae.INSANE:return t?Pn:$n;case ae.PARANOID:return t?kn:zn;default:throw new Error(`Unknown redundancy level ${e}`)}}(t,n),[a,i]=r;for(let o=0;o<a.length;o++)if(e>=a[o])return i[o]/a[o];return i[i.length-1]/a[a.length-1]}const Un={label:"medium",value:ae.MEDIUM,errorTolerance:.01},Ln={label:"strong",value:ae.STRONG,errorTolerance:.05},jn={label:"insane",value:ae.INSANE,errorTolerance:.1},Cn={label:"paranoid",value:ae.PARANOID,errorTolerance:.5};function Mn(){return{medium:Un,strong:Ln,insane:jn,paranoid:Cn}}function _n(e){if("string"==typeof e)switch(e.toLowerCase()){case"medium":return Un;case"strong":return Ln;case"insane":return jn;case"paranoid":return Cn;default:throw new Error(`Unknown redundancy level '${e}'`)}switch(e){case ae.MEDIUM:return Un;case ae.STRONG:return Ln;case ae.INSANE:return jn;case ae.PARANOID:return Cn;default:throw new Error(`Unknown redundancy level '${e}'`)}}})(),r})()));
|
|
2
2
|
//# sourceMappingURL=index.browser.min.js.map
|