@ethersphere/bee-js 12.1.0 → 12.2.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.
@@ -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={20(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(W(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 h(e){if(!e.length)throw Error("Received empty array");return e[e.length-1]}function f(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 a of n){if(null===r[a]||void 0===r[a])return null;r=r[a]}return r}function p(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 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||"AbortController"==e.constructor.name||"AbortSignal"==e.constructor.name||"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 E(e){return"[object String]"===Object.prototype.toString.call(e)}function R(e){return"number"==typeof e&&isFinite(e)}function T(e){return!0===e||!1===e}function v(e){return"[object Date]"===Object.prototype.toString.call(e)}function O(e){return!E(e)||0===e.trim().length}function S(e){return R(e)&&Number.isInteger(e)&&e>=1}function A(e){return E(e)&&null!==e.match(/^-?\d+$/)}function x(e){return E(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.c_=t.Ox=t.ij=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(""),C="abcdefghijklmnopqrstuvwxyz",V=C+"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",N=V+"!@#$%^&*()_+-=[]{}|;:<>?,./",F=["—","\\","東","京","都","𝖆","𝖇","𝖈","👾","🙇","💁","🙅","ᚠ","ᛇ","ᚻ","ᛦ"],I="0123456789abcdef";function P(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 $(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 k(e,t){if(R(e))return t&&$(e,t),e;if(!E(e)||!e.match(/^-?\d+(\.\d+)?$/))throw new TypeError(`Expected number${t?.name?` for ${t.name}`:""}, got: `+e);const n=parseFloat(e);return t&&$(n,t),n}function U(e,t){return Math.trunc(k(e,t))}function L(e,t){if(!b(e))throw new TypeError(`Expected object${t?.name?` for ${t.name}`:""}, got: `+e);return e}function z(e){return E(e)&&null!==e.match(/^https?:\/\/.+/)}function j(e){return"bigint"==typeof e}function M(e,t){if(!j(e))throw new TypeError(`Expected bigint${t?.name?` for ${t.name}`:""}, got: `+e);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}`);return e}function _(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 G(e,t){if(b(e)&&b(t))for(const n in t)b(t[n])?(e[n]||(e[n]={}),G(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 q(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 H(e,t){Array.prototype.push.apply(e,t)}function W(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function K(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 X(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 J={"&amp;":"&","&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<"};function Z(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(0,n)}function Q(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(n+t.length)}function Y(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(0,n)}function ee(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(n+t.length)}function te(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 ne(e,t){let n=[e];for(const r of t)n=n.flatMap((e=>e.split(r)));return n.filter((e=>e))}function re(e){const t=h(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?"":t.slice(n+1)}function ae(e){const t=h(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?t:t.slice(0,n)}function ie(e){return e.split("\n").map((e=>e.trim().replace(/\s+/g," "))).filter((e=>e.length>0)).join("\n")}function oe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function se(e){return e.charAt(0).toLowerCase()+e.slice(1)}function ce(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122}function ue(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function le(e){return ce(e)||ue(e)}const he=" \n\t\r.,?!:;\"'`(){}[]~@#$%^&*-+=|<>/\\".split("");function fe(e){return he.includes(e)}function de(e,t,n=0){const r=t.exec(e.slice(n));return r?{index:r.index,match:r[0]}:null}function pe(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=de(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 me(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 ge(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 be(e,t=0){for(let n=t;n<e.length;n++)if(fe(e[n]))return n;return-1}function ye(e,t=0){for(let n=t;n<e.length;n++)if("#"===e[n]&&le(e[n+1]))return n;return-1}function we(e,t,n=0){return e.slice(0,n).lastIndexOf(t)}function Be(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 Ee(e,t){const n=t.wordBoundary?ge(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 Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Te="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function ve(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 Oe(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 Se(e,t,n){const r=[];for(const a of n)a!==t&&r.push(e.replace(t,a));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 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 De(e,t){return new RegExp(`\\b${t}\\b`).test(e)}function Ce(e,t,n=[]){let r="";for(;t<e.length&&(le(e[t])||n.includes(e[t]));)r+=e[t++];return r}function Ve(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=Ce(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 Ne(e,t="$",n=":"){let r=e.indexOf(t);for(;-1!==r;){const a=Ce(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=Ce(e,r+a.length+2);e=e.replace(`${t}${a}${n}${i}`,i)}r=e.indexOf(t,r+1)}return e}function Fe(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 Pe(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 $e(e){return Math.floor((v(e)?e.getTime():e)/864e5)}const ke={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 Ue={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 Le(e,n){const r=n?.now??Date.now(),a=n?.labels||Ue;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 ze={};const je={s:1e3,m:6e4,h:36e5,d:864e5};const Me={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function _e(e){return{zeroBasedIndex:e,day:Me[e]}}function Ge(e){return _e(e.getDay())}const qe={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 He={b:0,byte:0,bytes:0,kb:1,kilobyte:1,kilobytes:1,mb:2,megabyte:2,megabytes:2,gb:3,gigabyte:3,gigabytes:3,tb:4,terabyte:4,terabytes:4};const We=new Map;function Ke(e,t=!1){e=e.filter((e=>e)),t&&E(e[1])&&(e[1]="../"+e[1]);let n="";E(e[0])&&e[0].includes("://")&&(n=Z(e[0],"://")??"",e[0]=Q(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 Xe(e){const t=Object.keys(e).sort(((e,t)=>e.localeCompare(t))),n={};for(const r of t)n[r]=Ze(e[r]);return n}function Je(e){const t=[];return e.sort(((e,t)=>JSON.stringify(Ze(e)).localeCompare(JSON.stringify(Ze(t))))).forEach((e=>t.push(Ze(e)))),t}function Ze(e){return Array.isArray(e)?Je(e):g(e)?Xe(e):e}function Qe(e,t){return JSON.stringify(Ze(e))===JSON.stringify(Ze(t))}function Ye(e){const t=Object.keys(e);return t[Math.floor(Math.random()*t.length)]}const et=[1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24,1e27,1e30,1e9,1e16,1e18,1e18,1e18,1e33],tt=["thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","gwei","bzz","btc","eth","dai","decillion"],nt=["K","M","B","T","Qa","Qi","Sx","Sp","O","N","gwei","bzz","eth","btc","dai","D"];function rt(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeNumber got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim(),r=nt.findIndex((e=>e.toLowerCase()===n.toLowerCase()));return-1===r?t:t*et[r]}function at(e,t,n){return e<t?t:e>n?n:e}function it(e,t,n){return e+(n?"["+t+"]":(e.length?".":"")+t)}function ot(e,t,n,r,a){if(!g(t))return t;for(const[i,o]of Object.entries(t)){const t=it(n,i,r);Array.isArray(o)?a?ot(e,o,t,!0,a):e[t]=o.map((e=>ot(Array.isArray(e)?[]:{},e,"",!1,a))):g(o)?ot(e,o,t,!1,a):e[t]=o}return e}function st(e,t){const n={};for(const r of e){n[t(r)]=r}return n}function ct(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 ut(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 lt(e,t){return Object.fromEntries(Object.entries(e).sort(t))}function ht(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 ft(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 dt{constructor(e){this.value=e}static of(e){return new dt(e)}static empty(){return new dt(null)}map(e){return new dt(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=>dt.of(e))):Promise.resolve(dt.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=dt;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 pt{constructor(e){this.value=e,this.children=[]}}function mt(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 gt(...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 bt(e){return 137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]}function yt(e){return 255===e[0]&&216===e[1]}function wt(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 Et(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 Rt(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 Tt(e,t){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.subarray(r,r+t));return n}const vt=[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 Ot(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],h=e[9]^e[19]^e[29]^e[39]^e[49],f=l^(a<<1|i>>>31),d=h^(i<<1|a>>>31),p=n^(o<<1|s>>>31),m=r^(s<<1|o>>>31),g=a^(c<<1|u>>>31),b=i^(u<<1|c>>>31),y=o^(l<<1|h>>>31),w=s^(h<<1|l>>>31),B=c^(n<<1|r>>>31),E=u^(r<<1|n>>>31);e[0]^=f,e[1]^=d,e[2]^=p,e[3]^=m,e[4]^=g,e[5]^=b,e[6]^=y,e[7]^=w,e[8]^=B,e[9]^=E,e[10]^=f,e[11]^=d,e[12]^=p,e[13]^=m,e[14]^=g,e[15]^=b,e[16]^=y,e[17]^=w,e[18]^=B,e[19]^=E,e[20]^=f,e[21]^=d,e[22]^=p,e[23]^=m,e[24]^=g,e[25]^=b,e[26]^=y,e[27]^=w,e[28]^=B,e[29]^=E,e[30]^=f,e[31]^=d,e[32]^=p,e[33]^=m,e[34]^=g,e[35]^=b,e[36]^=y,e[37]^=w,e[38]^=B,e[39]^=E,e[40]^=f,e[41]^=d,e[42]^=p,e[43]^=m,e[44]^=g,e[45]^=b,e[46]^=y,e[47]^=w,e[48]^=B,e[49]^=E;const R=e[0],T=e[1],v=e[2]<<1|e[3]>>>31,O=e[3]<<1|e[2]>>>31,S=e[5]<<30|e[4]>>>2,A=e[4]<<30|e[5]>>>2,x=e[6]<<28|e[7]>>>4,D=e[7]<<28|e[6]>>>4,C=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,N=e[11]<<4|e[10]>>>28,F=e[10]<<4|e[11]>>>28,I=e[13]<<12|e[12]>>>20,P=e[12]<<12|e[13]>>>20,$=e[14]<<6|e[15]>>>26,k=e[15]<<6|e[14]>>>26,U=e[17]<<23|e[16]>>>9,L=e[16]<<23|e[17]>>>9,z=e[18]<<20|e[19]>>>12,j=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,he=e[43]<<2|e[42]>>>30,fe=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,be=e[49]<<14|e[48]>>>18;e[0]=R^~I&H,e[1]=T^~P&W,e[2]=I^~H&ae,e[3]=P^~W&ie,e[4]=H^~ae&ge,e[5]=W^~ie&be,e[6]=ae^~ge&R,e[7]=ie^~be&T,e[8]=ge^~R&I,e[9]=be^~T&P,e[10]=x^~z&M,e[11]=D^~j&_,e[12]=z^~M&ee,e[13]=j^~_&te,e[14]=M^~ee&fe,e[15]=_^~te&de,e[16]=ee^~fe&x,e[17]=te^~de&D,e[18]=fe^~x&z,e[19]=de^~D&j,e[20]=v^~$&K,e[21]=O^~k&X,e[22]=$^~K&oe,e[23]=k^~X&se,e[24]=K^~oe&ce,e[25]=X^~se&ue,e[26]=oe^~ce&v,e[27]=se^~ue&O,e[28]=ce^~v&$,e[29]=ue^~O&k,e[30]=C^~N&G,e[31]=V^~F&q,e[32]=N^~G&ne,e[33]=F^~q&re,e[34]=G^~ne&pe,e[35]=q^~re&me,e[36]=ne^~pe&C,e[37]=re^~me&V,e[38]=pe^~C&N,e[39]=me^~V&F,e[40]=S^~U&J,e[41]=A^~L&Z,e[42]=U^~J&Q,e[43]=L^~Z&Y,e[44]=J^~Q&le,e[45]=Z^~Y&he,e[46]=Q^~le&S,e[47]=Y^~he&A,e[48]=le^~S&U,e[49]=he^~A&L,e[0]^=vt[2*t],e[1]^=vt[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=Tt(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 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];Ot(e)}return e}function Dt(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 Ct(e){return Dt(xt(new Array(50).fill(0),At(e,1)))}function Vt(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 Nt(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 Ft(e,t){return(e%t+t)%t}function It(e,t){e=Ft(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 Pt(e,t){return 0n===Ft(e,t)?0n:t%4n===3n?function(e,t,n){let r=1n;for(e=Ft(e,n);t>0;)t%2n===1n&&(r=Ft(r*e,n)),e=Ft(e*e,n),t/=2n;return r}(e,(t+1n)/4n,t):null}const $t=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,kt=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,Ut=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Lt=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n;function zt(e,t,n){if(0n===t)return[0n,0n];const r=Ft(3n*e*e*It(2n*t,n),n),a=Ft(r*r-2n*e,n);return[a,Ft(r*(e-a)-t,n)]}function jt(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===Ft(-r,a))return[0n,0n];if(e===n&&t===r)return zt(e,t,a);const i=Ft((r-t)*It(n-e,a),a),o=Ft(i*i-e-n,a);return[o,Ft(i*(e-o)-t,a)]}function Mt(e,t,n,r){let a=[0n,0n],i=[e,t];const o=n.toString(2);for(const s of o)"0"===s?(i=jt(a[0],a[1],i[0],i[1],r),a=zt(a[0],a[1],r)):(a=jt(a[0],a[1],i[0],i[1],r),i=zt(i[0],i[1],r));return a}function _t(e,t,n){if(t<=0n||t>=kt)throw new Error("Invalid private key");if(n||(n=Ft(Rt(Ct(gt(Ct(Et(t,"BE")),Et(e,"BE"))),"BE"),kt)),n<=0n||n>=kt)throw new Error("Invalid nonce");const r=Ft(e,kt),a=Mt(Ut,Lt,n,$t),i=Ft(a[0],kt);let o=Ft((r+Ft(i,kt)*t)*It(n,kt),kt);if(0n===i||0n===o)throw new Error("Invalid r or s value");let s=a[1]%2n===0n?27n:28n;return o>kt/2n&&(o=kt-o,s=27n===s?28n:27n),[i,o,s]}class Gt{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=Gt;class qt{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=qt;class Ht{constructor(e,t=0n){this.span=t,this.writer=new qt(new Uint8Array(e))}build(){return gt(Bt(this.span,"LE"),this.writer.buffer)}hash(){const e=mt(Tt(this.writer.buffer,32),((e,t)=>Ht.hashFunction(gt(e,t))));return Ht.hashFunction(gt(Bt(this.span,"LE"),e))}}t.AA=Ht,Ht.hashFunction=Ct;class Wt{constructor(e,t=4096){this.counters=[1],this.capacity=t,this.chunks=[new Ht(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 Gt(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 Ht(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 Ht(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=Wt,n=Wt,Wt.NOOP=async e=>{};class Kt{constructor(e,t){if(t<0)throw Error("Scale must be non-negative");this.value=BigInt(e),this.scale=t}static cast(e){if(!e)throw Error("Cannot cast falsy value to FixedPointNumber");if(e instanceof Kt)return e;const t=M(e.value),n=k(e.scale);return new Kt(t,n)}static fromDecimalString(e,t){/e\-\d+$/i.test(e)&&(e=parseFloat(e).toFixed(t));let[n,r]=e.split(".");return r=(r||"").padEnd(t,"0").slice(0,t),new Kt(BigInt(n+r),t)}static fromFloat(e,t){return Kt.fromDecimalString(e.toString(),t)}add(e){return this.assertSameScale(e),new Kt(this.value+e.value,this.scale)}subtract(e){return this.assertSameScale(e),new Kt(this.value-e.value,this.scale)}multiply(e){return new Kt(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 Kt(t,this.scale),new Kt(n,this.scale)]}exchange(e,t,n){if("*"===e){const e=this.value*t.value/10n**BigInt(this.scale);return new Kt(e,n)}this.assertSameScale(t);const r=this.value*10n**BigInt(n)/t.value;return new Kt(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()}toFloat(){return parseFloat(this.toDecimalString())}assertSameScale(e){if(this.scale!==e.scale)throw new Error(`Scale mismatch: expected ${this.scale}, but got ${e.scale}`)}}function Xt(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 Jt(e,t,n,r){const a=Xt(e,t,n,r);if(!a)throw new Error(`Missing argument ${t}`);return a}function Zt(e,t){const n=e[t];e.splice(t,1),e.unshift(n)}function Qt(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Yt(e,t){return{x:e.x*t,y:e.y*t}}function en(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function tn(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function nn(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 rn(e,t,n){return!e[t-1]?.[n]}function an(e,t,n){return!e[t+1]?.[n]}function on(e,t,n){return!e[t][n-1]}function sn(e,t,n){return!e[t][n+1]}function cn(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]&&rn(e,t,n)&&on(e,t,n)&&r.push({x:t,y:n}),!e[t+1]?.[n-1]&&an(e,t,n)&&on(e,t,n)&&r.push({x:t+1,y:n}),!e[t-1]?.[n+1]&&rn(e,t,n)&&sn(e,t,n)&&r.push({x:t,y:n+1}),!e[t+1]?.[n+1]&&an(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 un(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 ln(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 hn(e,t,n){const r=[],a=en(e,n,1e4);for(const i of t){const t=ln(e,a,i.start,i.end);t&&r.push(t)}return r.length?r.reduce(((t,n)=>tn(e,n)<tn(e,t)?n:t)):null}t.ie=Kt;class fn{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=fn;t.O3=class{constructor(e,t){this.queue=[],this.running=0,this.onProcessed=new fn,this.onDrained=new fn,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 dn{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 dn;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$=dn;t.ij=class{constructor(e){this.index=0,this.values=e}current(){return this.values[this.index]}next(){return this.index=(this.index+1)%this.values.length,this.values[this.index]}};t.Ox=class{constructor(){this.status="pending",this.steps=[],this.onStatusChange=async()=>{},this.onStepChange=async()=>{},this.onFinish=async()=>{},this.onError=async()=>{},this.context=new Map}getStatus(){return this.status}createInitialState(){return Object.fromEntries(this.steps.map((e=>[e.name,"pending"])))}setHooks(e){e.onStatusChange&&(this.onStatusChange=e.onStatusChange),e.onStepChange&&(this.onStepChange=e.onStepChange),e.onFinish&&(this.onFinish=e.onFinish),e.onError&&(this.onError=e.onError)}addStep(e){if(this.steps.find((t=>t.name===e.name)))throw Error(`Step with name ${e.name} already exists`);this.steps.push(e)}async execute(){if("pending"!==this.status)throw Error(`Cannot execute solver in status ${this.status}`);this.status="in-progress",await this.onStatusChange(this.status);let e=this.createInitialState();for(const n of this.steps)try{if(n.transientSkipStepName){const t=e[n.transientSkipStepName];if("skipped"===t||"failed"===t){e={...e,[n.name]:"skipped"},await this.onStepChange(e);continue}}if(n.precondition&&!await n.precondition(this.context)){e={...e,[n.name]:"skipped"},await this.onStepChange(e);continue}e={...e,[n.name]:"in-progress"},await this.onStepChange(e);for(let e=0;"retry"===await n.action(this.context,e);e++);e={...e,[n.name]:"completed"},await this.onStepChange(e)}catch(t){throw e={...e,[n.name]:"failed"},this.status="failed",await this.onStatusChange(this.status),await this.onStepChange(e),await this.onError(t),t}return this.status="completed",await this.onStatusChange(this.status),await this.onFinish(),this.context}};t.c_=class{constructor(e){this.queryFunction=e.queryFunction,this.lockFunction=e.lockFunction,this.unlockFunction=e.unlockFunction,this.timeoutMillis=e.timeoutMillis}async couldLock(){const e=await this.queryFunction();try{const t=U(e);if(Date.now()<t+this.timeoutMillis)return new Date(t+this.timeoutMillis)}catch{}return await this.lockFunction(Date.now().toString()),!0}async unlock(){await this.unlockFunction()}},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 ve(e,Re)},uint8ArrayToBase64:function(e){return Oe(e,Re)},base32ToUint8Array:function(e){return ve(e,Te)},uint8ArrayToBase32:function(e){return Oe(e,Te)},log2Reduce:mt,partition:Tt,concatBytes:gt,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:Et,uint256ToNumber:Rt,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:Ct,sha3_256:function(e){return Dt(xt(new Array(50).fill(0),At(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:Vt,padStartToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:Vt(e,e.length+t-r,n)},padEnd:Nt,padEndToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:Nt(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>=kt)throw new Error("Invalid private key");return Mt(Ut,Lt,e,$t)},compressPublicKey:function(e){const t=e[1]%2n===0n?2:3;return new Uint8Array([t,...Et(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=Rt(e.slice(1),"BE"),n=Pt(Ft(t**3n+7n,$t),$t);if(!n)throw Error("Invalid x: does not correspond to a valid curve point");const r=Ft(-n,$t),a=n%2n===0n;return[t,2===e[0]?a?n:r:a?r:n]},publicKeyToAddress:function(e){const t=new Uint8Array(20),n=Ct(gt(Et(e[0],"BE"),Et(e[1],"BE")));return t.set(n.subarray(12)),t},signMessage:function(e,t,n){return _t(Rt(Ct(e),"BE"),t,n)},signHash:_t,verifySignature:function(e,t,n,r){const a=Ft(Rt(Ct(e),"BE"),kt),i=It(r,kt),o=Ft(a*i,kt),s=Ft(n*i,kt),c=Mt(Ut,Lt,o,$t),u=Mt(t[0],t[1],s,$t);return n===Ft(jt(c[0],c[1],u[0],u[1],$t)[0],kt)},recoverPublicKey:function(e,t,n,r){const a=Pt(Ft(t**3n+7n,$t),$t);if(!a)throw new Error("Invalid r: does not correspond to a valid curve point");const i=a%2n===(27n===r?0n:1n)?a:$t-a,o=Ft(Rt(Ct(e),"BE"),kt),s=Mt(t,i,n,$t),c=Mt(Ut,Lt,o,$t),u=jt(s[0],s[1],c[0],Ft(-c[1],$t),$t);return Mt(u[0],u[1],It(t,kt),$t)},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?lt(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(st(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:ct,index:st,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 h(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:h,pipe:f,makePipe:function(e,t){return n=>f(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:H,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])&&H(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:ht,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:Xt,getBooleanArgument:function(e,t,n,r){const a=e.some((e=>e.endsWith("-"+t))),i=Xt(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=Xt(e,t,n,r);if(!a)return null;try{return rt(a)}catch{throw new Error(`Invalid number argument ${t}: ${a}`)}},requireStringArgument:Jt,requireNumberArgument:function(e,t,n,r){const a=Jt(e,t,n,r);try{return rt(a)}catch{throw new Error(`Invalid argument ${t}: ${a}`)}},bringToFront:function(e,t){const n=[...e];return Zt(n,t),n},bringToFrontInPlace:Zt,findInstance:function(e,t){const n=e.find((e=>e instanceof t));return dt.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 pt(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))},minBy:function(e,t){return e.reduce(((e,n)=>t(e)<t(n)?e:n))},allIndexOf:function(e,t){const n=[];return e.forEach(((e,r)=>{t(e)&&n.push(r)})),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(E(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"},withRetries:async function(e,t,n,r,i,o){let s=null;for(let u=0;u<=t;u++)try{return await e()}catch(c){if(s=c,u===t)break;const e=n+u/(t-1)*(r-n);i&&i("Error in withRetries, retrying",{attempt:u+1,allowedFailures:t,delayMillis:e,error:c}),o&&o(),await a(e)}throw s}},t.FQ={make:rt,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:at,range:W,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?tt:nt,i=t?.precision??1;if(e<et[0])return`${e}${r}`;for(let o=0;o<et.length-1;o++)if(e<et[o+1])return`${(e/et[o]).toFixed(i)}${n?" ":""}${a[o]}${r}`;return`${(e/et[et.length-1]).toFixed(i)}${n?" ":""}${a[et.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,t=1024){const n=parseFloat(e);if(isNaN(n))throw Error("makeStorage got NaN for input");const r=e.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),a=""===r?0:He[r];if(null==a)throw Error(`Unknown unit: "${r}"`);return Math.ceil(n*t**a)},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: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])},binomialSample:function(e,t,n=Math.random){const r=e*t,a=Math.sqrt(e*t*(1-t)),i=(n()+n()+n()+n()+n()+n()-3)*Math.SQRT2,o=Math.round(r+a*i);return Math.max(0,Math.min(e,o))},toSignificantDigits:function(e,t){if(!e.includes("."))return e;if(0===parseFloat(e))return"0";const[n,r]=e.split("."),a=n.replace("-",""),i=a.length;if(i>=t)return n;if("0"!==a){const e=t-i,a=r.slice(0,e);return/[1-9]/.test(a)?`${n}.${a.replace(/0+$/,"")}`:n}const o=t+(r.match(/^0*/)?.[0].length??0);return`${n}.${r.slice(0,o)}`}},t.HC={raceFulfilled:async function(e){return r(Promise.all(e.map(r)))},invert:r,runInParallelBatches:async function(e,t=1){const n=ct(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||ke,a=v(e)?e:new Date(e);if($e(n)===$e(a))return r.today(a.getUTCHours(),a.getUTCMinutes(),a.getUTCHours()>12);if($e(n)-$e(a)==1)return r.yesterday();const i=Ge(a);return $e(n)-$e(a)<7?r[i.day]():r.weeks(Math.round((n.getTime()-a.getTime())/6048e5))},getTimeDelta:Le,secondsToHumanTime:function(e,t=Ue){return Le(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(!ze[e]||Date.now()>ze[e])&&(ze[e]=Date.now()+t,!0)},timeSince:function(e,t,n){return t=v(t)?t.getTime():t,((n=n?v(n)?n.getTime():n:Date.now())-t)/je[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:Pe,humanizeProgress:function(e){return`[${Math.floor(100*e.progress)}%] ${Pe(e.deltaMs)} out of ${Pe(e.totalTimeMs)} (${Pe(e.remainingTimeMs)} left) [${Math.round(e.baseTimeMs)} ms each]`},createTimeDigits:Ie,mapDayNumber:_e,getDayInfoFromDate:Ge,getDayInfoFromDateTimeString:function(e){return Ge(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=""===n?1:qe[n];if(!r)throw Error(`Unknown unit: "${n}"`);return Math.ceil(t*r)},normalizeTime:function(e){let[t,n]=e.split(":");R(parseInt(t,10))||(t="0"),R(parseInt(n,10))||(n="0");let r=at(U(t),0,23),a=at(U(n),0,59);return`${Ie(r)}:${Ie(a)}`},absoluteDays:$e},t.Rb={safeParse:function(e){try{return JSON.parse(e)}catch{return null}},deleteDeep:function(e,t){const n=Y(t,"."),r=ee(t,".");if(!n||!r)return;const a=d(e,n);a&&delete a[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:G,deepMerge2:function(e,t){const n={};return G(n,e),G(n,t),n},deepMerge3:function(e,t,n){const r={};return G(r,e),G(r,t),G(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:Xe,sortArray:Je,sortAny:Ze,deepEquals:Qe,deepEqualsEvery:function(...e){for(let t=1;t<e.length;t++)if(!Qe(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:q,zipSum:function(e){return q(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]||E(t[1])&&O(t[1]))&&delete e[t[0]];return e},flatten:function(e,t=!1,n){return ot({},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)?p(n,r,a.map((t=>e(t)))):p(n,r,a);return n},match:function(e,t,n){return t[e]?t[e]:n},sort:lt,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=d(n,r);null!=a&&p(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:ft,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){ft(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:Ye,mapRandomKey:function(e,t){const n=Ye(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(",","&comma;")})`))).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("&comma;",","),JSON.parse(e)},toQueryString:Fe,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)=>k(e[t])-k(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=>te(e,t))).map((e=>e[0]&&e[1]?[ie(e[0]),ie(e[1])]:null)).filter((e=>e)))},errorMatches:function(e,t){if(!e)return!1;const n=e.message;return"string"==typeof n&&n.includes(t)}},t.Or={isFunction:B,isObject:g,isStrictlyObject:b,isEmptyArray:y,isEmptyObject:function(e){return b(e)&&0===Object.keys(e).length},isUndefined:w,isString:E,isNumber:R,isBoolean:T,isDate:v,isBlank:O,isId:S,isIntegerString:A,isHexString:x,isUrl:z,isBigint:j,isNullable:function(e,t){return null==t||e(t)},asString:P,asHexString:function(e,t){if(!x(e))throw new TypeError(`Expected hex string${t?.name?` for ${t.name}`:""}, got: `+e);if(t?.strictPrefix&&!e.startsWith("0x")&&!e.startsWith("0X"))throw new TypeError(`Expected hex string with 0x prefix${t?.name?` for ${t.name}`:""}, got: `+e);const n=e.replace(/^0x/i,"");if(n.length%2!=0&&!t?.uneven)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`0x${n}`},asSafeString:function(e,t){if(!P(e,t).split("").every((e=>"_"===e||le(e))))throw new TypeError(`Expected safe string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asIntegerString:function(e,t){if(!A(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:k,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(!T(e))throw new TypeError(`Expected boolean${t?.name?` for ${t.name}`:""}, got: `+e);return e},asDate:function(e,t){if(!v(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(!E(e))throw new TypeError(`Expected string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asId:function(e,t){if(S(e))return e;const n=parseInt(e,10);if(!S(n))throw new TypeError(`Expected id${t?.name?` for ${t.name}`:""}, got: `+e);return n},asTime:function(e,t){if(!E(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(!R(r)||!R(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(!E(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(E)||!a.every(R))throw new TypeError(`Expected numeric dictionary${t?.name?` for ${t.name}`:""}, got: `+e);return n},asUrl:function(e,t){if(!z(e))throw new TypeError(`Expected url${t?.name?` for ${t.name}`:""}, got: `+e);return e},asBigint:M,asEmptiable:function(e,t){return""===t?void 0:e(t)},asNullable:function(e,t){return null==t?null:e(t)},asOptional:function(e,t){return null==t?void 0:e(t)},enforceObjectShape:_,enforceArrayShape:function(e,t){return e.every((e=>_(e,t)))},isPng:bt,isJpg:yt,isWebp:wt,isImage:function(e){return bt(e)||yt(e)||wt(e)}},t.DH={tokenizeByCount:function(e,t){return ut(e,Math.ceil(e.length/t))},tokenizeByLength:ut,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=ne(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+=I[Math.floor(16*t())];return n},randomLetter:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=C[Math.floor(26*t())];return n},randomAlphanumeric:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=V[Math.floor(62*t())];return n},randomRichAscii:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=N[Math.floor(89*t())];return n},randomUnicode:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=F[Math.floor(t()*F.length)];return n},includesAny:function(e,t){return t.some((t=>e.includes(t)))},slugify:K,normalForm:function(e){return K(e).replaceAll("-","")},enumify:function(e){return K(e).replace(/-/g,"_").toUpperCase()},escapeHtml:function(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},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(J))t=t.replaceAll(n,r);return t},after:Q,afterLast:ee,before:Z,beforeLast:Y,betweenWide:function(e,t,n){const r=Y(e,n);return r?Q(r,t):null},betweenNarrow:function(e,t,n){const r=Q(e,t);return r?Z(r,n):null},getPreLine:function(e){return e.replace(/ +/g," ").replace(/^ /gm,"")},containsWord:De,containsWords:function(e,t,n){return"any"===n?t.some((t=>De(e,t))):t.every((t=>De(e,t)))},joinUrl:Ke,getFuzzyMatchScore:X,sortByFuzzyScore:function(e,t){return e.filter((e=>X(e,t))).sort(((e,n)=>X(n,t)-X(e,t)))},splitOnce:te,splitAll:ne,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:ie,capitalize:oe,decapitalize:se,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:re,getBasename:ae,normalizeEmail:function(e){let[t,n]=e.split("@");t=ie(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=ie(n.toLowerCase()).replaceAll(" ",""),`${r}@${n}`},normalizeFilename:function(e){const t=ae(e),n=re(e);return n?`${t}.${n}`:t},parseFilename:function(e){const t=ae(e),n=re(e);return{basename:t,extension:n,filename:n?`${t}.${n}`:t}},camelToTitle:function(e){return oe(e.replace(/([A-Z])/g," $1"))},slugToTitle:function(e){return e.split("-").map(oe).join(" ")},slugToCamel:function(e){return se(e.split("-").map(oe).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:Ee,extractAllBlocks:function(e,t){const n=[];let r=t.wordBoundary?ge(e,[`${t.opening} `,`${t.opening}\n`],t.start||0):e.indexOf(t.opening,t.start||0);for(;;){if(-1===r)return n;const a=Ee(e,{...t,start:r});if(!a)return n;n.push(a),r=t.wordBoundary?ge(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:ge,lastIndexOfBefore:we,parseHtmlAttributes:function(e){const t={},n=e.match(/([a-z\-]+)="([^"]+)"/g);if(n)for(const r of n){const[e,n]=te(r,"=");t[e]=n.slice(1,n.length-1)}return t},readNextWord:Ce,readWordsAfterAll:function(e,t,n=[]){const r=me(e,t),a=[];for(const i of r)a.push(Ce(e,i+t.length,n));return a},resolveVariables:function(e,t,n="$",r=":"){for(const a in t)e=Ve(e,a,t[a],n,r);return e=Ne(e)},resolveVariableWithDefaultSyntax:Ve,resolveRemainingVariablesWithDefaults:Ne,isLetter:ce,isDigit:ue,isLetterOrDigit:le,isValidObjectPathCharacter:function(e){return le(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:de,allIndexOf:me,lineMatches:pe,linesMatchInOrder:function(e,t,n=!0){let r=0;for(const a of t){let t=!1;for(;!t&&r<e.length;)pe(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(E(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=we(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 Ke([e,t])+Fe(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=ye(e,n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const a=be(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=ge(e,["http://","https://"],n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const a=ge(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:Se,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&&(H(o,Se(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&&(H(o,Se(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:Ae,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}=Ae(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=We.get(e);if(a&&a.validUntil>r)return a.value;const i=await n(),o=r+t;return We.set(e,{value:i,validUntil:o}),i},delete:function(e){We.delete(e)},deleteExpired:function(){const e=Date.now();for(const[t,n]of We.entries())n.validUntil<=e&&We.delete(t)},size:function(){return We.size}},t.Mi={addPoint:Qt,subtractPoint:function(e,t){return{x:e.x-t.x,y:e.y-t.y}},multiplyPoint:Yt,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:en,filterCoordinates:nn,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=cn(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=nn(e,((t,n)=>0===e[t][n]&&0!==e[t][n+1]),"row-first").map((e=>({...e,dx:1,dy:0}))),r=nn(e,((t,n)=>0===e[t][n]&&0!==e[t][n-1]),"row-first").map((e=>({...e,dx:1,dy:0}))),a=nn(e,((t,n)=>0===e[t][n]&&0!==e[t-1]?.[n]),"column-first").map((e=>({...e,dx:0,dy:1}))),i=nn(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++)),[...ht([...a,...i],((e,t)=>e.x===t.x&&e.y-1===t.y)),...ht([...r,...n],((e,t)=>e.y===t.y&&e.x-1===t.x))].map((e=>({start:e[0],end:h(e)}))).map((e=>({start:Yt(e.start,t),end:Yt(Qt(e.end,{x:e.start.dx,y:e.start.dy}),t)})))},raycast:hn,raycastCircle:function(e,t,n){const r=un(e,n),a=[];for(const i of r){const n=hn(e,t,i-.001),r=hn(e,t,i+.001);n&&a.push(n),r&&a.push(r)}return a},getLineIntersectionPoint:ln}},878(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(a=r))})),t.splice(a,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(n){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(945)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},945(e,t,n){e.exports=function(e){function t(e){let n,a,i,o=null;function s(...e){if(!s.enabled)return;const r=s,a=Number(new Date),i=a-(n||a);r.diff=i,r.prev=n,r.curr=a,n=a,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,a)=>{if("%%"===n)return"%";o++;const i=t.formatters[a];if("function"==typeof i){const t=e[o];n=i.call(r,t),e.splice(o,1),o--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(a!==t.namespaces&&(a=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function a(e,t){let n=0,r=0,a=-1,i=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(a=r,i=n,r++):(n++,r++);else{if(-1===a)return!1;r=a+1,i++,n=i}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const r of n)"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(const n of t.skips)if(a(e,n))return!1;for(const n of t.names)if(a(e,n))return!0;return!1},t.humanize=n(192),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},666(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},192(e){var t=1e3,n=60*t,r=60*n,a=24*r,i=7*a,o=365.25*a;function s(e,t,n,r){var a=t>=1.5*n;return Math.round(e/n)+" "+r+(a?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*a;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var i=Math.abs(e);if(i>=a)return s(e,i,a,"day");if(i>=r)return s(e,i,r,"hour");if(i>=n)return s(e,i,n,"minute");if(i>=t)return s(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=a)return Math.round(e/a)+"d";if(i>=r)return Math.round(e/r)+"h";if(i>=n)return Math.round(e/n)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},963(e,t,n){"use strict";const r=n(527),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=n(197),{safeRe:o,t:s}=n(423),c=n(676),{compareIdentifiers:u}=n(956);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)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}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){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?o[s.PRERELEASELOOSE]:o[s.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}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"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;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(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},359(e,t,n){"use strict";const r=n(963);e.exports=(e,t)=>new r(e,t).major},197(e){"use strict";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}},527(e){"use strict";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},956(e){"use strict";const t=/^[0-9]+$/,n=(e,n)=>{if("number"==typeof e&&"number"==typeof n)return e===n?0:e<n?-1:1;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){"use strict";const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},423(e,t,n){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=n(197),o=n(527),s=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],h=t.t={};let f=0;const d="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[d,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),h[e]=a,u[a]=t,l[a]=r,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-]${d}*`),m("MAINVERSION",`(${u[h.NUMERICIDENTIFIER]})\\.(${u[h.NUMERICIDENTIFIER]})\\.(${u[h.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[h.NUMERICIDENTIFIERLOOSE]})\\.(${u[h.NUMERICIDENTIFIERLOOSE]})\\.(${u[h.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[h.NONNUMERICIDENTIFIER]}|${u[h.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[h.NONNUMERICIDENTIFIER]}|${u[h.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[h.PRERELEASEIDENTIFIER]}(?:\\.${u[h.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[h.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${d}+`),m("BUILD",`(?:\\+(${u[h.BUILDIDENTIFIER]}(?:\\.${u[h.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[h.MAINVERSION]}${u[h.PRERELEASE]}?${u[h.BUILD]}?`),m("FULL",`^${u[h.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[h.MAINVERSIONLOOSE]}${u[h.PRERELEASELOOSE]}?${u[h.BUILD]}?`),m("LOOSE",`^${u[h.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[h.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[h.XRANGEIDENTIFIER]})(?:\\.(${u[h.XRANGEIDENTIFIER]})(?:\\.(${u[h.XRANGEIDENTIFIER]})(?:${u[h.PRERELEASE]})?${u[h.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[h.XRANGEIDENTIFIERLOOSE]})(?:${u[h.PRERELEASELOOSE]})?${u[h.BUILD]}?)?)?`),m("XRANGE",`^${u[h.GTLT]}\\s*${u[h.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[h.GTLT]}\\s*${u[h.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${u[h.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[h.COERCEPLAIN]+`(?:${u[h.PRERELEASE]})?`+`(?:${u[h.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[h.COERCE],!0),m("COERCERTLFULL",u[h.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[h.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[h.LONETILDE]}${u[h.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[h.LONETILDE]}${u[h.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[h.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[h.LONECARET]}${u[h.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[h.LONECARET]}${u[h.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[h.GTLT]}\\s*(${u[h.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[h.GTLT]}\\s*(${u[h.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[h.GTLT]}\\s*(${u[h.LOOSEPLAIN]}|${u[h.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[h.XRANGEPLAIN]})\\s+-\\s+(${u[h.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[h.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},497(){},61(){},320(){}},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:()=>k,Bee:()=>Ha,BeeArgumentError:()=>_,BeeDev:()=>Wa,BeeError:()=>M,BeeModes:()=>W,BeeResponseError:()=>G,Bytes:()=>T,CHUNK_SIZE:()=>Z,DAI:()=>ue,Duration:()=>oe,EthAddress:()=>V,FeedIndex:()=>j,Identifier:()=>N,MantarayNode:()=>$a,MerkleTree:()=>p,NULL_ADDRESS:()=>Qa,NULL_IDENTIFIER:()=>Ya,NULL_OWNER:()=>ei,NULL_STAMP:()=>Ja,NULL_TOPIC:()=>Za,PSS_TARGET_HEX_LENGTH_MAX:()=>Q,PeerAddress:()=>$,PrivateKey:()=>D,PublicKey:()=>C,RedundancyLevel:()=>re,RedundancyStrategy:()=>ae,Reference:()=>F,SECTION_SIZE:()=>X,STAMPS_DEPTH_MAX:()=>ee,STAMPS_DEPTH_MIN:()=>Y,SUPPORTED_BEE_VERSION:()=>ma,SUPPORTED_BEE_VERSION_EXACT:()=>pa,SWARM_GATEWAY_URL:()=>Xa,Signature:()=>U,Size:()=>se,Span:()=>P,Stamper:()=>Ka,TAGS_LIMIT_MAX:()=>ne,TAGS_LIMIT_MIN:()=>te,Topic:()=>L,TransactionId:()=>I,Utils:()=>t,capacityBreakpoints:()=>ie,toBeeMode:()=>K});var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>qt,hasStandardBrowserEnv:()=>Wt,hasStandardBrowserWebWorkerEnv:()=>Kt,navigator:()=>Ht,origin:()=>Xt});var t={};n.r(t),n.d(t,{approximateOverheadForRedundancyLevel:()=>li,convertEnvelopeToMarshaledStamp:()=>Ve,getAmountForDuration:()=>De,getCollectionSize:()=>qr,getDepthForSize:()=>Ce,getFolderSize:()=>ja,getRedundancyStat:()=>gi,getRedundancyStats:()=>mi,getStampCost:()=>Ae,getStampDuration:()=>xe,getStampEffectiveBytes:()=>Oe,getStampEffectiveBytesBreakpoints:()=>Se,getStampTheoreticalBytes:()=>Te,getStampUsage:()=>Re,makeCollectionFromFileList:()=>Gr,makeMaxTarget:()=>ti,mapPostageBatch:()=>Ne,unmapPostageBatch:()=>Fe});var a=n(20);a.DO,a.mW;const i=a.yI,o=(a.l2,a.AO),s=a.LQ,c=a.FQ,u=a.Rb,l=(a.Pagination,a.HC,a.o8,a.DH),h=a.iQ,f=a.Or,d=a.Xx,p=(a.Mi,a.Dj,a.AA,a.vU),m=a.ie,g=(a.dF,a.f7,a.O3),b=a.pp;a.$i,a.g$,a.ij,a.Ox,a.c_;var y=n(878),w=n.n(y);const B=w()("bee-js:bytes"),E=new TextDecoder,R=new TextEncoder;class T{constructor(e,t){if(!e)throw Error(`Bytes#constructor: constructor parameter is falsy: ${e}`);if(e instanceof T)this.bytes=e.bytes;else if("string"==typeof e)this.bytes=i.hexToUint8Array(f.asHexString(e,{name:"Bytes#constructor(bytes)"}));else if(e instanceof ArrayBuffer)this.bytes=new Uint8Array(e);else if(e instanceof Uint8Array)this.bytes=e;else{const t=e,n=u.getDeep(t,"toHex");if(!f.isFunction(n))throw B("bytes",e),new Error("Bytes#constructor: unsupported type: "+typeof e);{const e=n.call(t);this.bytes=i.hexToUint8Array(f.asHexString(e,{name:"Bytes#constructor(bytes)"}))}}if(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 T(i.keccak256(new T(e).toUint8Array()))}static fromUtf8(e){return new T(R.encode(e))}static fromSlice(e,t,n){return new T(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 i.uint8ArrayToHex(this.bytes)}toBase64(){return i.uint8ArrayToBase64(this.bytes)}toBase32(){return i.uint8ArrayToBase32(this.bytes)}toString(){return this.toHex()}toUtf8(){return E.decode(this.bytes)}toJSON(){return JSON.parse(this.toUtf8())}equals(e){return this.toHex()===new T(e).toHex()}represent(){return this.toHex()}}function v(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 O=250,S=251,A={[O]:"manifest",[S]:"feed"};const x=new TextEncoder;class D extends T{static LENGTH=32;constructor(e){super(e,32)}publicKey(){const[e,t]=s.privateKeyToPublicKey(i.uint256ToNumber(this.bytes,"BE"));return new C(i.concatBytes(i.numberToUint256(e,"BE"),i.numberToUint256(t,"BE")))}sign(e){const t=i.concatBytes(x.encode("Ethereum Signed Message:\n32"),i.keccak256(e instanceof Uint8Array?e:x.encode(e))),[n,r,a]=s.signMessage(t,i.uint256ToNumber(this.bytes,"BE"));return new U(i.concatBytes(i.numberToUint256(n,"BE"),i.numberToUint256(r,"BE"),new Uint8Array([Number(a)])))}}class C extends T{static LENGTH=64;constructor(e){const t=new T(e);if(33===t.length){const[e,n]=s.publicKeyFromCompressed(t.toUint8Array());super(i.concatBytes(i.numberToUint256(e,"BE"),i.numberToUint256(n,"BE")),64)}else super(e,64)}address(){const e=i.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=i.uint256ToNumber(this.bytes.slice(32,64),"BE");return new V(s.publicKeyToAddress([e,t]))}toCompressedUint8Array(){const e=i.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=i.uint256ToNumber(this.bytes.slice(32,64),"BE");return s.compressPublicKey([e,t])}toCompressedHex(){return i.uint8ArrayToHex(this.toCompressedUint8Array())}}class V extends T{static LENGTH=20;constructor(e){super(e,20)}toChecksum(){return s.checksumEncode(this.bytes)}}class N extends T{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new N(i.keccak256(x.encode(e)))}}class F extends T{static LENGTH=32;constructor(e){if("string"==typeof e&&e.startsWith("bah5")){const t=function(e){const t=i.base32ToUint8Array(e.toUpperCase().slice(1)),n=t[1];if(!A[n])throw new Error("Unknown codec");const r=new F(t.slice(-32));return{type:A[n],reference:r}}(e);super(t.reference.bytes,32)}else super(e,[32,64])}toCid(e){return function(e,t){e=new F(e);const n=new Uint8Array([1]),r=new Uint8Array(["feed"===t?251:250]),a=new Uint8Array([1]),o=new Uint8Array([27]),s=new Uint8Array([32]);return`b${i.uint8ArrayToBase32(i.concatBytes(n,r,a,o,s)).replace(/\=+$/,"")}${e.toBase32().replace(/\=+$/,"")}`.toLowerCase()}(this.bytes,e)}static isValid(e){try{return new F(e),!0}catch{return!1}}}class I extends T{static LENGTH=32;constructor(e){super(e,32)}}class P extends T{static LENGTH=8;constructor(e){super(e,8)}static fromBigInt(e){return new P(i.numberToUint64(e,"LE"))}toBigInt(){return i.uint64ToNumber(this.bytes,"LE")}static fromSlice(e,t){return new P(e.slice(t,t+P.LENGTH))}}class $ extends T{static LENGTH=32;constructor(e){super(e,32)}}class k extends T{static LENGTH=32;constructor(e){super(e,32)}}class U extends T{static LENGTH=65;constructor(e){super(e,65)}static fromSlice(e,t){return new U(e.slice(t,t+U.LENGTH))}recoverPublicKey(e){const t=i.uint256ToNumber(this.bytes.slice(0,32),"BE"),n=i.uint256ToNumber(this.bytes.slice(32,64),"BE"),r=BigInt(this.bytes[64]),[a,o]=s.recoverPublicKey(i.concatBytes(x.encode("Ethereum Signed Message:\n32"),i.keccak256(e instanceof Uint8Array?e:x.encode(e))),t,n,r);return new C(i.concatBytes(i.numberToUint256(a,"BE"),i.numberToUint256(o,"BE")))}isValid(e,t){return this.recoverPublicKey(e).address().equals(t)}}class L extends T{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new L(i.keccak256(x.encode(e)))}}const z=new Uint8Array(8).fill(255,0,8);class j extends T{static LENGTH=8;static MINUS_ONE=new j(z);constructor(e){super(e,8)}static fromBigInt(e){return new j(i.numberToUint64(e,"BE"))}toBigInt(){return i.uint64ToNumber(this.bytes,"BE")}next(){return i.equals(this.bytes,z)?j.fromBigInt(0n):j.fromBigInt(this.toBigInt()+1n)}}class M extends Error{constructor(e){super(e)}}class _ extends M{constructor(e,t){super(e),this.value=t}}class G extends M{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 q=4096;function H(e){const t=e.slice(0,P.LENGTH),n=function(e){if(e.length>q)throw new _(`payload size ${e.length} exceeds maximum chunk payload size 4096`,e);const t=new Uint8Array(q);return t.set(e),i.log2Reduce(i.partition(t,32),((e,t)=>i.keccak256(i.concatBytes(e,t))))}(e.slice(P.LENGTH)),r=i.keccak256(i.concatBytes(t,n));return new F(r)}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;let re=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}({}),ae=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 ie={ENCRYPTION_OFF:{[re.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%"}],[re.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%"}],[re.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%"}],[re.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%"}],[re.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:{[re.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%"}],[re.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%"}],[re.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%"}],[re.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%"}],[re.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 oe{static ZERO=new oe(0);constructor(e){this.seconds=Math.ceil(e),e<0&&(this.seconds=0)}static fromMilliseconds(e){return new oe(e/1e3)}static fromSeconds(e){return new oe(e)}static fromHours(e){return new oe(60*e*60)}static fromDays(e){return new oe(24*e*60*60)}static fromWeeks(e){return new oe(7*e*24*60*60)}static fromYears(e){return new oe(365*e*24*60*60)}static fromEndDate(e,t){return new oe((e.getTime()-(t??new Date).getTime())/1e3)}static parseFromString(e){return oe.fromSeconds(o.make(e)/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 o.secondsToHumanTime(this.seconds)}isZero(){return 0===this.seconds}}class se{constructor(e){if(this.bytes=Math.ceil(e),e<0)throw Error("Size must be at least 0")}static fromBytes(e){return new se(e)}static fromKilobytes(e){return new se(1e3*e)}static fromMegabytes(e){return new se(1e3*e*1e3)}static fromGigabytes(e){return new se(1e3*e*1e3*1e3)}static parseFromString(e){return se.fromBytes(c.makeStorage(e,1e3))}toBytes(){return this.bytes}toGigabytes(){return this.bytes/1e3/1e3/1e3}toFormattedString(){return c.convertBytes(this.bytes,1e3)}represent(){return this.toFormattedString()}}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))}static fromFloat(e){return new ce(m.fromFloat(e,ce.DIGITS))}toPLURString(){return this.state.toString()}toPLURBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toFloat(){return this.state.toFloat()}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))}static fromFloat(e){return new ue(m.fromFloat(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)}toFloat(){return this.state.toFloat()}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(320);function he(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 fe(e){return void 0!==le.Readable&&e instanceof le.Readable}function de(e,t){return"bigint"==typeof e&&(e=e.toString()),f.asIntegerString(e,t)}function pe(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 C(e)),t.actPublisher),actHistoryAddress:f.asOptional((e=>new F(e)),t.actHistoryAddress),actTimestamp:f.asOptional((e=>f.asNumber(e,{name:"actTimestamp"})),t.actTimestamp)}}function me(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 F(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=me(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=>de(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=>de(e,{name:"gasLimit",min:0n})),n.gasLimit),gasPrice:f.asOptional((e=>de(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 Ee=.9;function Re(e,t,n){return e/Math.pow(2,t-n)}function Te(e){return 4096*2**e}const ve=[[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=ie[t?"ENCRYPTION_ON":"ENCRYPTION_OFF"][n].find((t=>t.batchDepth===e));if(r?.effectiveVolume)return v(r.effectiveVolume)}else{const t=ve.find((([t,n])=>{if(e===t)return n}));if(t)return 1e3*t[1]*1e3*1e3}return Math.ceil(Te(e)*Ee)}function Se(e,t){const n=new Map;for(let r=17;r<35;r++)n.set(r,Oe(r,e,t));return n}function Ae(e,t){return ce.fromPLUR(2n**BigInt(e)*BigInt(t))}function xe(e,t,n){const r=BigInt(de(e));return oe.fromSeconds(Number(r*BigInt(n)/BigInt(t)))}function De(e,t,n){return BigInt(e.toSeconds())/BigInt(n)*BigInt(t)+1n}function Ce(e,t,n){if(void 0!==t&&void 0!==n){const r=ie[t?"ENCRYPTION_ON":"ENCRYPTION_OFF"][n].find((t=>e.toBytes()<=v(t.effectiveVolume)));if(r?.effectiveVolume)return r.batchDepth}else for(const[r,a]of ve)if(e.toBytes()<=1e3*a*1e3*1e3)return r;return 35}function Ve(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 T(i.concatBytes(t,r,n,e))}(e.signature,e.batchId.toUint8Array(),e.timestamp,e.index)}function Ne(e,t,n){const r=Re(e.utilization,e.depth,e.bucketDepth),a=function(e){return Number.isInteger(e)?e<1?1:e>3155695200?3155695200:e:1}(e.batchTTL),i=oe.fromSeconds(a),o=Oe(e.depth,t,n);return{batchID:new k(e.batchID),utilization:e.utilization,usable:e.usable,label:e.label,depth:e.depth,amount:de(e.amount),bucketDepth:e.bucketDepth,blockNumber:e.blockNumber,immutableFlag:e.immutableFlag,usage:r,usageText:`${Math.round(100*r)}%`,size:se.fromBytes(o),remainingSize:se.fromBytes(Math.ceil(o*(1-r))),theoreticalSize:se.fromBytes(Te(e.depth)),duration:i,calculateSize(t,n){const r=Oe(e.depth,t,n);return se.fromBytes(r)},calculateRemainingSize(t,n){const r=Oe(e.depth,t,n);return se.fromBytes(Math.ceil(r*(1-this.usage)))}}}function Fe(e){return{batchID:e.batchID.toHex(),utilization:e.utilization,usable:e.usable,label:e.label,depth:e.depth,amount:e.amount,bucketDepth:e.bucketDepth,blockNumber:e.blockNumber,immutableFlag:e.immutableFlag,batchTTL:e.duration.toSeconds()}}function Ie(e){return{name:function(e){if(!e)throw new M("missing content-disposition header");const t=e.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);if(t&&t.length>0)return t[1];throw new M("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 Pe(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"]=Ve(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 C(r.actPublisher).toCompressedHex()),r.actHistoryAddress&&(n["swarm-act-history-address"]=new F(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}function $e(e,t){return function(){return e.apply(t,arguments)}}const{toString:ke}=Object.prototype,{getPrototypeOf:Ue}=Object,{iterator:Le,toStringTag:ze}=Symbol,je=(Me=Object.create(null),e=>{const t=ke.call(e);return Me[t]||(Me[t]=t.slice(8,-1).toLowerCase())});var Me;const _e=e=>(e=e.toLowerCase(),t=>je(t)===e),Ge=e=>t=>typeof t===e,{isArray:qe}=Array,He=Ge("undefined");function We(e){return null!==e&&!He(e)&&null!==e.constructor&&!He(e.constructor)&&Je(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ke=_e("ArrayBuffer");const Xe=Ge("string"),Je=Ge("function"),Ze=Ge("number"),Qe=e=>null!==e&&"object"==typeof e,Ye=e=>{if("object"!==je(e))return!1;const t=Ue(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ze in e||Le in e)},et=_e("Date"),tt=_e("File"),nt=_e("Blob"),rt=_e("FileList");const at="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},it=void 0!==at.FormData?at.FormData:void 0,ot=_e("URLSearchParams"),[st,ct,ut,lt]=["ReadableStream","Request","Response","Headers"].map(_e);function ht(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),qe(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(We(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let o;for(r=0;r<i;r++)o=a[r],t.call(null,e[o],o,e)}}function ft(e,t){if(We(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,a=n.length;for(;a-- >0;)if(r=n[a],t===r.toLowerCase())return r;return null}const dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,pt=e=>!He(e)&&e!==dt;const mt=(gt="undefined"!=typeof Uint8Array&&Ue(Uint8Array),e=>gt&&e instanceof gt);var gt;const bt=_e("HTMLFormElement"),yt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),wt=_e("RegExp"),Bt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ht(n,((n,a)=>{let i;!1!==(i=t(n,a,e))&&(r[a]=i||n)})),Object.defineProperties(e,r)};const Et=_e("AsyncFunction"),Rt=(Tt="function"==typeof setImmediate,vt=Je(dt.postMessage),Tt?setImmediate:vt?(Ot=`axios@${Math.random()}`,St=[],dt.addEventListener("message",(({source:e,data:t})=>{e===dt&&t===Ot&&St.length&&St.shift()()}),!1),e=>{St.push(e),dt.postMessage(Ot,"*")}):e=>setTimeout(e));var Tt,vt,Ot,St;const At="undefined"!=typeof queueMicrotask?queueMicrotask.bind(dt):"undefined"!=typeof process&&process.nextTick||Rt,xt={isArray:qe,isArrayBuffer:Ke,isBuffer:We,isFormData:e=>{if(!e)return!1;if(it&&e instanceof it)return!0;const t=Ue(e);if(!t||t===Object.prototype)return!1;if(!Je(e.append))return!1;const n=je(e);return"formdata"===n||"object"===n&&Je(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Ke(e.buffer),t},isString:Xe,isNumber:Ze,isBoolean:e=>!0===e||!1===e,isObject:Qe,isPlainObject:Ye,isEmptyObject:e=>{if(!Qe(e)||We(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:st,isRequest:ct,isResponse:ut,isHeaders:lt,isUndefined:He,isDate:et,isFile:tt,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:nt,isRegExp:wt,isFunction:Je,isStream:e=>Qe(e)&&Je(e.pipe),isURLSearchParams:ot,isTypedArray:mt,isFileList:rt,forEach:ht,merge:function e(){const{caseless:t,skipUndefined:n}=pt(this)&&this||{},r={},a=(a,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const o=t&&ft(r,i)||i;Ye(r[o])&&Ye(a)?r[o]=e(r[o],a):Ye(a)?r[o]=e({},a):qe(a)?r[o]=a.slice():n&&He(a)||(r[o]=a)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&ht(arguments[i],a);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(ht(t,((t,r)=>{n&&Je(t)?Object.defineProperty(e,r,{value:$e(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let a,i,o;const s={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)o=a[i],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&Ue(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:je,kindOfTest:_e,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(qe(e))return e;let t=e.length;if(!Ze(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Le]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:bt,hasOwnProperty:yt,hasOwnProp:yt,reduceDescriptors:Bt,freezeMethods:e=>{Bt(e,((t,n)=>{if(Je(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Je(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return qe(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ft,global:dt,isContextDefined:pt,isSpecCompliantForm:function(e){return!!(e&&Je(e.append)&&"FormData"===e[ze]&&e[Le])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Qe(e)){if(t.indexOf(e)>=0)return;if(We(e))return e;if(!("toJSON"in e)){t[r]=e;const a=qe(e)?[]:{};return ht(e,((e,t)=>{const i=n(e,r+1);!He(i)&&(a[t]=i)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:Et,isThenable:e=>e&&(Qe(e)||Je(e))&&Je(e.then)&&Je(e.catch),setImmediate:Rt,asap:At,isIterable:e=>null!=e&&Je(e[Le])};class Dt extends Error{static from(e,t,n,r,a,i){const o=new Dt(e.message,t||e.code,n,r,a);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),i&&Object.assign(o,i),o}constructor(e,t,n,r,a){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status)}toJSON(){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:xt.toJSONObject(this.config),code:this.code,status:this.status}}}Dt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Dt.ERR_BAD_OPTION="ERR_BAD_OPTION",Dt.ECONNABORTED="ECONNABORTED",Dt.ETIMEDOUT="ETIMEDOUT",Dt.ERR_NETWORK="ERR_NETWORK",Dt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Dt.ERR_DEPRECATED="ERR_DEPRECATED",Dt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Dt.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Dt.ERR_CANCELED="ERR_CANCELED",Dt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Dt.ERR_INVALID_URL="ERR_INVALID_URL",Dt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ct=Dt;function Vt(e){return xt.isPlainObject(e)||xt.isArray(e)}function Nt(e){return xt.endsWith(e,"[]")?e.slice(0,-2):e}function Ft(e,t,n){return e?e.concat(t).map((function(e,t){return e=Nt(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const It=xt.toFlatObject(xt,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Pt=function(e,t,n){if(!xt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=xt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!xt.isUndefined(t[e])}))).metaTokens,a=n.visitor||h,i=n.dots,o=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,u=s&&xt.isSpecCompliantForm(t);if(!xt.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(xt.isDate(e))return e.toISOString();if(xt.isBoolean(e))return e.toString();if(!u&&xt.isBlob(e))throw new Ct("Blob is not supported. Use a Buffer instead.");return xt.isArrayBuffer(e)||xt.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function h(e,n,a){let s=e;if(xt.isReactNative(t)&&xt.isReactNativeBlob(e))return t.append(Ft(a,n,i),l(e)),!1;if(e&&!a&&"object"==typeof e)if(xt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(xt.isArray(e)&&function(e){return xt.isArray(e)&&!e.some(Vt)}(e)||(xt.isFileList(e)||xt.endsWith(n,"[]"))&&(s=xt.toArray(e)))return n=Nt(n),s.forEach((function(e,r){!xt.isUndefined(e)&&null!==e&&t.append(!0===o?Ft([n],r,i):null===o?n:n+"[]",l(e))})),!1;return!!Vt(e)||(t.append(Ft(a,n,i),l(e)),!1)}const f=[],d=Object.assign(It,{defaultVisitor:h,convertValue:l,isVisitable:Vt});if(!xt.isObject(e))throw new TypeError("data must be an object");return function e(n,r,i=0){if(!xt.isUndefined(n)){if(i>c)throw new Ct("Object is too deeply nested ("+i+" levels). Max depth: "+c,Ct.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),xt.forEach(n,(function(n,o){!0===(!(xt.isUndefined(n)||null===n)&&a.call(t,n,xt.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o],i+1)})),f.pop()}}(e),t};function $t(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function kt(e,t){this._pairs=[],e&&Pt(e,this,t)}const Ut=kt.prototype;Ut.append=function(e,t){this._pairs.push([e,t])},Ut.toString=function(e){const t=e?function(t){return e.call(this,t,$t)}:$t;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Lt=kt;function zt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jt(e,t,n){if(!t)return e;const r=n&&n.encode||zt,a=xt.isFunction(n)?{serialize:n}:n,i=a&&a.serialize;let o;if(o=i?i(t,a):xt.isURLSearchParams(t)?t.toString():new Lt(t,a).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Mt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){xt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},_t={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Gt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Lt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qt="undefined"!=typeof window&&"undefined"!=typeof document,Ht="object"==typeof navigator&&navigator||void 0,Wt=qt&&(!Ht||["ReactNative","NativeScript","NS"].indexOf(Ht.product)<0),Kt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xt=qt&&window.location.href||"http://localhost",Jt={...e,...Gt};const Zt=function(e){function t(e,n,r,a){let i=e[a++];if("__proto__"===i)return!0;const o=Number.isFinite(+i),s=a>=e.length;if(i=!i&&xt.isArray(r)?r.length:i,s)return xt.hasOwnProp(r,i)?r[i]=xt.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!o;r[i]&&xt.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],a)&&xt.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r<a;r++)i=n[r],t[i]=e[i];return t}(r[i])),!o}if(xt.isFormData(e)&&xt.isFunction(e.entries)){const n={};return xt.forEachEntry(e,((e,r)=>{t(function(e){return xt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Qt=(e,t)=>null!=e&&xt.hasOwnProp(e,t)?e[t]:void 0;const Yt={transitional:_t,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=xt.isObject(e);a&&xt.isHTMLForm(e)&&(e=new FormData(e));if(xt.isFormData(e))return r?JSON.stringify(Zt(e)):e;if(xt.isArrayBuffer(e)||xt.isBuffer(e)||xt.isStream(e)||xt.isFile(e)||xt.isBlob(e)||xt.isReadableStream(e))return e;if(xt.isArrayBufferView(e))return e.buffer;if(xt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(a){const t=Qt(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pt(e,new Jt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Jt.isNode&&xt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=xt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Qt(this,"env"),r=n&&n.FormData;return Pt(i?{"files[]":e}:e,r&&new r,t)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(xt.isString(e))try{return(t||JSON.parse)(e),xt.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Qt(this,"transitional")||Yt.transitional,n=t&&t.forcedJSONParsing,r=Qt(this,"responseType"),a="json"===r;if(xt.isResponse(e)||xt.isReadableStream(e))return e;if(e&&xt.isString(e)&&(n&&!r||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,Qt(this,"parseReviver"))}catch(i){if(n){if("SyntaxError"===i.name)throw Ct.from(i,Ct.ERR_BAD_RESPONSE,this,null,Qt(this,"response"));throw i}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Jt.classes.FormData,Blob:Jt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xt.forEach(["delete","get","head","post","put","patch"],(e=>{Yt.headers[e]={}}));const en=Yt,tn=xt.toObjectSet(["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"]),nn=e=>{const t={};let n,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!n||t[n]&&tn[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t};(Object.getOwnPropertyDescriptor(nn,"name")||{}).writable||Object.defineProperty(nn,"name",{value:"default",configurable:!0});const rn=Symbol("internals"),an=/[^\x09\x20-\x7E\x80-\xFF]/g;function on(e){return e&&String(e).trim().toLowerCase()}function sn(e){return!1===e||null==e?e:xt.isArray(e)?e.map(sn):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(an,""))}function cn(e,t,n,r,a){return xt.isFunction(r)?r.call(this,t,n):(a&&(t=n),xt.isString(t)?xt.isString(r)?-1!==t.indexOf(r):xt.isRegExp(r)?r.test(t):void 0:void 0)}class un{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=on(t);if(!a)throw new Error("header name must be a non-empty string");const i=xt.findKey(r,a);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=sn(e))}const i=(e,t)=>xt.forEach(e,((e,n)=>a(e,n,t)));if(xt.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(xt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(nn(e),t);else if(xt.isObject(e)&&xt.isIterable(e)){let n,r,a={};for(const t of e){if(!xt.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[r=t[0]]=(n=a[r])?xt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=on(e)){const n=xt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(xt.isFunction(t))return t.call(this,e,n);if(xt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=on(e)){const n=xt.findKey(this,e);return!(!n||void 0===this[n]||t&&!cn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=on(e)){const a=xt.findKey(n,e);!a||t&&!cn(0,n[a],a,t)||(delete n[a],r=!0)}}return xt.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!cn(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return xt.forEach(this,((r,a)=>{const i=xt.findKey(n,a);if(i)return t[i]=sn(r),void delete t[a];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();o!==a&&delete t[a],t[o]=sn(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return xt.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&xt.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[rn]=this[rn]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=on(e);t[r]||(!function(e,t){const n=xt.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return xt.isArray(e)?e.forEach(r):r(e),this}}un.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),xt.reduceDescriptors(un.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),xt.freezeMethods(un);const ln=un;function hn(e,t){const n=this||en,r=t||n,a=ln.from(r.headers);let i=r.data;return xt.forEach(e,(function(e){i=e.call(n,i,a.normalize(),t?t.status:void 0)})),a.normalize(),i}function fn(e){return!(!e||!e.__CANCEL__)}const dn=class extends Ct{constructor(e,t,n){super(null==e?"canceled":e,Ct.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function pn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ct("Request failed with status code "+n.status,[Ct.ERR_BAD_REQUEST,Ct.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const mn=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,i=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[o];a||(a=c),n[i]=s,r[i]=c;let l=o,h=0;for(;l!==i;)h+=n[l++],l%=e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-a<t)return;const f=u&&c-u;return f?Math.round(1e3*h/f):void 0}};const gn=function(e,t){let n,r,a=0,i=1e3/t;const o=(t,i=Date.now())=>{a=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-a;s>=i?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),i-s)))},()=>n&&o(n)]},bn=(e,t,n=3)=>{let r=0;const a=mn(50,250);return gn((n=>{const i=n.loaded,o=n.lengthComputable?n.total:void 0,s=null!=o?Math.min(i,o):i,c=Math.max(0,s-r),u=a(c);r=Math.max(r,s);e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o?(o-s)/u:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},yn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wn=e=>(...t)=>xt.asap((()=>e(...t))),Bn=Jt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Jt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Jt.origin),Jt.navigator&&/(msie|trident)/i.test(Jt.navigator.userAgent)):()=>!0,En=Jt.hasStandardBrowserEnv?{write(e,t,n,r,a,i,o){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];xt.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),xt.isString(r)&&s.push(`path=${r}`),xt.isString(a)&&s.push(`domain=${a}`),!0===i&&s.push("secure"),xt.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Rn(e,t,n){let r=!("string"==typeof(a=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a));var a;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Tn=e=>e instanceof ln?{...e}:e;function vn(e,t){t=t||{};const n={};function r(e,t,n,r){return xt.isPlainObject(e)&&xt.isPlainObject(t)?xt.merge.call({caseless:r},e,t):xt.isPlainObject(t)?xt.merge({},t):xt.isArray(t)?t.slice():t}function a(e,t,n,a){return xt.isUndefined(t)?xt.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function i(e,t){if(!xt.isUndefined(t))return r(void 0,t)}function o(e,t){return xt.isUndefined(t)?xt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,a,i){return xt.hasOwnProp(t,i)?r(n,a):xt.hasOwnProp(e,i)?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>a(Tn(e),Tn(t),0,!0)};return xt.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=xt.hasOwnProp(c,r)?c[r]:a,o=i(xt.hasOwnProp(e,r)?e[r]:void 0,xt.hasOwnProp(t,r)?t[r]:void 0,r);xt.isUndefined(o)&&i!==s||(n[r]=o)})),n}const On=e=>{const t=vn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:s}=t;if(t.headers=o=ln.from(o),t.url=jt(Rn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),xt.isFormData(n))if(Jt.hasStandardBrowserEnv||Jt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(xt.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)}))}if(Jt.hasStandardBrowserEnv){xt.isFunction(r)&&(r=r(t));if(!0===r||null==r&&Bn(t.url)){const e=a&&i&&En.read(i);e&&o.set(a,e)}}return t};(Object.getOwnPropertyDescriptor(On,"name")||{}).writable||Object.defineProperty(On,"name",{value:"default",configurable:!0});const Sn="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=On(e);let a=r.data;const i=ln.from(r.headers).normalize();let o,s,c,u,l,{responseType:h,onUploadProgress:f,onDownloadProgress:d}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=ln.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());pn((function(e){t(e),p()}),(function(e){n(e),p()}),{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ct("Request aborted",Ct.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",a=new Ct(r,Ct.ERR_NETWORK,e,m);a.event=t||null,n(a),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||_t;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ct(t,a.clarifyTimeoutError?Ct.ETIMEDOUT:Ct.ECONNABORTED,e,m)),m=null},void 0===a&&i.setContentType(null),"setRequestHeader"in m&&xt.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),xt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),d&&([c,l]=bn(d,!0),m.addEventListener("progress",c)),f&&m.upload&&([s,u]=bn(f),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new dn(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Jt.protocols.indexOf(b)?n(new Ct("Unsupported protocol "+b+":",Ct.ERR_BAD_REQUEST,e)):m.send(a||null)}))},An=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const a=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ct?t:new dn(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,a(new Ct(`timeout of ${t}ms exceeded`,Ct.ETIMEDOUT))}),t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)})),e=null)};e.forEach((e=>e.addEventListener("abort",a)));const{signal:s}=r;return s.unsubscribe=()=>xt.asap(o),s}},xn=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,a=0;for(;a<n;)r=a+t,yield e.slice(a,r),a=r},Dn=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Cn=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of Dn(e))yield*xn(n,t)}(e,t);let i,o=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=o+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw s(t),t}},cancel:e=>(s(e),a.return())},{highWaterMark:2})},{isFunction:Vn}=xt,Nn=(({Request:e,Response:t})=>({Request:e,Response:t}))(xt.global),{ReadableStream:Fn,TextEncoder:In}=xt.global,Pn=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},$n=e=>{e=xt.merge.call({skipUndefined:!0},Nn,e);const{fetch:t,Request:n,Response:r}=e,a=t?Vn(t):"function"==typeof fetch,i=Vn(n),o=Vn(r);if(!a)return!1;const s=a&&Vn(Fn),c=a&&("function"==typeof In?(u=new In,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Pn((()=>{let e=!1;const t=new n(Jt.origin,{body:new Fn,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),h=o&&s&&Pn((()=>xt.isReadableStream(new r("").body))),f={stream:h&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ct(`Response type '${e}' is not supported`,Ct.ERR_NOT_SUPPORT,n)})}));const d=async(e,t)=>{const r=xt.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(xt.isBlob(e))return e.size;if(xt.isSpecCompliantForm(e)){const t=new n(Jt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return xt.isArrayBufferView(e)||xt.isArrayBuffer(e)?e.byteLength:(xt.isURLSearchParams(e)&&(e+=""),xt.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:a,method:o,data:s,signal:c,cancelToken:u,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:B}=On(e),E=t||fetch;b=b?(b+"").toLowerCase():"text";let R=An([c,u&&u.toAbortSignal()],p),T=null;const v=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let O;try{if(g&&l&&"get"!==o&&"head"!==o&&0!==(O=await d(y,s))){let e,t=new n(a,{method:"POST",body:s,duplex:"half"});if(xt.isFormData(s)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=yn(O,bn(wn(g)));s=Cn(t.body,65536,e,n)}}xt.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in n.prototype;if(xt.isFormData(s)){const e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete("content-type")}const c={...B,signal:R,method:o.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:t?w:void 0};T=i&&new n(a,c);let u=await(i?E(T,B):E(a,c));const p=h&&("stream"===b||"response"===b);if(h&&(m||p&&v)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=xt.toFiniteNumber(u.headers.get("content-length")),[n,a]=m&&yn(t,bn(wn(m),!0))||[];u=new r(Cn(u.body,65536,n,(()=>{a&&a(),v&&v()})),e)}b=b||"text";let S=await f[xt.findKey(f,b)||"text"](u,e);return!p&&v&&v(),await new Promise(((t,n)=>{pn(t,n,{data:S,headers:ln.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:T})}))}catch(S){if(v&&v(),S&&"TypeError"===S.name&&/Load failed|fetch/i.test(S.message))throw Object.assign(new Ct("Network Error",Ct.ERR_NETWORK,e,T,S&&S.response),{cause:S.cause||S});throw Ct.from(S,S&&S.code,e,T,S&&S.response)}}},kn=new Map,Un=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,i=[r,a,n];let o,s,c=i.length,u=kn;for(;c--;)o=i[c],s=u.get(o),void 0===s&&u.set(o,s=c?new Map:$n(t)),u=s;return s},Ln=(Un(),{http:null,xhr:Sn,fetch:{get:Un}});xt.forEach(Ln,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const zn=e=>`- ${e}`,jn=e=>xt.isFunction(e)||null===e||!1===e;const Mn={getAdapter:function(e,t){e=xt.isArray(e)?e:[e];const{length:n}=e;let r,a;const i={};for(let o=0;o<n;o++){let n;if(r=e[o],a=r,!jn(r)&&(a=Ln[(n=String(r)).toLowerCase()],void 0===a))throw new Ct(`Unknown adapter '${n}'`);if(a&&(xt.isFunction(a)||(a=a.get(t))))break;i[n||"#"+o]=a}if(!a){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(zn).join("\n"):" "+zn(e[0]):"as no adapter specified";throw new Ct("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return a},adapters:Ln};function _n(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new dn(null,e)}function Gn(e){_n(e),e.headers=ln.from(e.headers),e.data=hn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Mn.getAdapter(e.adapter||en.adapter,e)(e).then((function(t){return _n(e),t.data=hn.call(e,e.transformResponse,t),t.headers=ln.from(t.headers),t}),(function(t){return fn(t)||(_n(e),t&&t.response&&(t.response.data=hn.call(e,e.transformResponse,t.response),t.response.headers=ln.from(t.response.headers))),Promise.reject(t)}))}const qn="1.15.1",Hn={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Hn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Wn={};Hn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+qn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,i)=>{if(!1===e)throw new Ct(r(a," has been removed"+(t?" in "+t:"")),Ct.ERR_DEPRECATED);return t&&!Wn[a]&&(Wn[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,i)}},Hn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Kn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ct("options must be an object",Ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],o=t[i];if(o){const t=e[i],n=void 0===t||o(t,i,e);if(!0!==n)throw new Ct("option "+i+" must be "+n,Ct.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ct("Unknown option "+i,Ct.ERR_BAD_OPTION)}},validators:Hn},Xn=Kn.validators;class Jn{constructor(e){this.defaults=e||{},this.interceptors={request:new Mt,response:new Mt}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=(()=>{if(!e.stack)return"";const t=e.stack.indexOf("\n");return-1===t?"":e.stack.slice(t+1)})();try{if(n.stack){if(t){const e=t.indexOf("\n"),r=-1===e?-1:t.indexOf("\n",e+1),a=-1===r?"":t.slice(r+1);String(n.stack).endsWith(a)||(n.stack+="\n"+t)}}else n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=vn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Kn.assertOptions(n,{silentJSONParsing:Xn.transitional(Xn.boolean),forcedJSONParsing:Xn.transitional(Xn.boolean),clarifyTimeoutError:Xn.transitional(Xn.boolean),legacyInterceptorReqResOrdering:Xn.transitional(Xn.boolean)},!1),null!=r&&(xt.isFunction(r)?t.paramsSerializer={serialize:r}:Kn.assertOptions(r,{encode:Xn.function,serialize:Xn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Kn.assertOptions(t,{baseUrl:Xn.spelling("baseURL"),withXsrfToken:Xn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=a&&xt.merge(a.common,a[t.method]);a&&xt.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=ln.concat(i,a);const o=[];let s=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||_t;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,h=0;if(!s){const e=[Gn.bind(this),void 0];for(e.unshift(...o),e.push(...c),l=e.length,u=Promise.resolve(t);h<l;)u=u.then(e[h++],e[h++]);return u}l=o.length;let f=t;for(;h<l;){const e=o[h++],t=o[h++];try{f=e(f)}catch(d){t.call(this,d);break}}try{u=Gn.call(this,f)}catch(d){return Promise.reject(d)}for(h=0,l=c.length;h<l;)u=u.then(c[h++],c[h++]);return u}getUri(e){return jt(Rn((e=vn(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}xt.forEach(["delete","get","head","options"],(function(e){Jn.prototype[e]=function(t,n){return this.request(vn(n||{},{method:e,url:t,data:(n||{}).data}))}})),xt.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,a){return this.request(vn(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Jn.prototype[e]=t(),Jn.prototype[e+"Form"]=t(!0)}));const Zn=Jn;class Qn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,a){n.reason||(n.reason=new dn(e,r,a),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Qn((function(t){e=t})),cancel:e}}}const Yn=Qn;const er={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(er).forEach((([e,t])=>{er[t]=e}));const tr=er;const nr=function e(t){const n=new Zn(t),r=$e(Zn.prototype.request,n);return xt.extend(r,Zn.prototype,n,{allOwnKeys:!0}),xt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(vn(t,n))},r}(en);nr.Axios=Zn,nr.CanceledError=dn,nr.CancelToken=Yn,nr.isCancel=fn,nr.VERSION=qn,nr.toFormData=Pt,nr.AxiosError=Ct,nr.Cancel=nr.CanceledError,nr.all=function(e){return Promise.all(e)},nr.spread=function(e){return function(t){return e.apply(null,t)}},nr.isAxiosError=function(e){return xt.isObject(e)&&!0===e.isAxiosError},nr.mergeConfig=vn,nr.AxiosHeaders=ln,nr.formToJSON=e=>Zt(xt.isHTMLForm(e)?new FormData(e):e),nr.getAdapter=Mn.getAdapter,nr.HttpStatusCode=tr,nr.default=nr;const rr=nr,ar=w()("bee-js:http"),{AxiosError:ir}=rr,or=o.minutes(1)/200,sr={headers:{accept:"application/json, text/plain, */*"},maxBodyLength:1/0,maxContentLength:1/0};function cr(e,t,n,r){if(e?.aborted)throw new G(t.method||"get",t.url||"<unknown>","Request aborted",n,r,"ERR_CANCELED")}async function ur(e,t){const n=u.deepMerge3(sr,t,e);if(e.signal&&(n.signal=e.signal,cr(e.signal,t)),function(e){e.data&&e.data instanceof Uint8Array&&(e.data=e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength));e.data&&"undefined"!=typeof Buffer&&Buffer.isBuffer(e.data)&&(e.data=e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength))}(n),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;){cr(e.signal,t);try{ar(`${n.method||"get"} ${l.joinUrl([n.baseURL,n.url])}`,{headers:{...n.headers},params:n.params}),lr(e,n);return await rr(n)}catch(a){if(!(a instanceof ir))throw a;if("ERR_CANCELED"===a.code&&cr({aborted:!0},t,a.response?.data,a.response?.status),"ECONNABORTED"!==a.code||!e.endlesslyRetry)throw new G(t.method||"get",t.url||"<unknown>",a.message,a.response?.data,a.response?.status,a.response?.statusText);r++,await h.sleepMillis(r<or?200:1e3)}}throw Error("Max number of failed attempts reached")}function lr(e,t){e.onRequest&&e.onRequest({method:t.method||"GET",url:l.joinUrl([t.baseURL,t.url]),headers:{...t.headers},params:t.params})}const hr="chunks";async function fr(e,t,n){t=new F(t);const r=await ur(e,{responseType:"arraybuffer",url:`${hr}/${t}`,headers:Pe(null,n)});return new Uint8Array(r.data)}const dr=N.LENGTH,pr=N.LENGTH+U.LENGTH,mr=N.LENGTH+U.LENGTH+P.LENGTH;function gr(e,t){e=e instanceof T?e.toUint8Array():e,t=new F(t);const n=function(e){const t=H(e.slice(pr)),n=U.fromSlice(e,dr),r=T.fromSlice(e,0,N.LENGTH),a=i.concatBytes(r.toUint8Array(),t.toUint8Array());return n.recoverPublicKey(a).address()}(e),r=T.fromSlice(e,0,N.LENGTH),a=new F(i.keccak256(i.concatBytes(r.toUint8Array(),n.toUint8Array())));if(!i.equals(t.toUint8Array(),a.toUint8Array()))throw new M("SOC data does not match given address!");return{data:e,identifier:r,signature:U.fromSlice(e,dr),span:P.fromSlice(e,pr),payload:T.fromSlice(e,mr),address:a,owner:n}}function br(e,t){return new F(i.keccak256(i.concatBytes(e.toUint8Array(),t.toUint8Array())))}function yr(e,t,n,r,a){const o=br(r=new N(r),(a=new D(a)).publicKey().address()),s=a.sign(i.concatBytes(r.toUint8Array(),e.toUint8Array()));return{data:i.concatBytes(r.toUint8Array(),s.toUint8Array(),t.toUint8Array(),n.toUint8Array()),identifier:r,signature:s,span:t,payload:n,address:o,owner:a.publicKey().address()}}async function wr(e,t,n,r){const a=i.concatBytes(t.span.toUint8Array(),t.payload.toUint8Array());return async function(e,t,n,r,a,i,o){const s=await ur(e,{method:"post",url:`soc/${t}/${n}`,data:a,headers:{"content-type":"application/octet-stream",...Pe(i,o)},responseType:"json",params:{sig:r.toHex()}}),c=f.asObject(s.data,{name:"response.data"});return{reference:new F(f.asHexString(c.reference)),tagUid:s.headers["swarm-tag"]?Be(s.headers["swarm-tag"]):void 0,historyAddress:s.headers["swarm-act-history-address"]?d.of(new F(s.headers["swarm-act-history-address"])):d.empty()}}(e,t.owner,t.identifier,t.signature,a,n,r)}async function Br(e,t,n,r,a,i){t=new D(t),r=new N(r);return wr(e,Or(a).toSingleOwnerChunk(r,t),n,i)}async function Er(e,t,n){const r=br(n=new N(n),t=new V(t));return gr(await fr(e,r.toHex()),r)}const Rr=1,Tr=4096;function vr(e){return Or((e=new T(e)).toUint8Array().slice(P.LENGTH),P.fromSlice(e.toUint8Array(),0))}function Or(e,t){if(f.isString(e)&&(e=T.fromUtf8(e)),e.length<Rr||e.length>Tr)throw new RangeError(`payload size ${e.length} exceeds limits [${Rr}, ${Tr}]`);const n=t?"bigint"==typeof t?P.fromBigInt(t):t:P.fromBigInt(BigInt(e.length)),r=new T(e),a=i.concatBytes(n.toUint8Array(),r.toUint8Array()),o=H(a);return{data:a,span:n,payload:r,address:o,toSingleOwnerChunk:(e,t)=>yr(o,n,r,e,t)}}const Sr="bytes";async function Ar(e,t,n,r){const a=await ur(e,{url:Sr,method:"post",responseType:"json",data:t,headers:{"content-type":"application/octet-stream",...Pe(n,r)}}),i=f.asObject(a.data,{name:"response.data"});return{reference:new F(f.asHexString(i.reference)),tagUid:a.headers["swarm-tag"]?Be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?d.of(new F(a.headers["swarm-act-history-address"])):d.empty()}}async function xr(e,t,n){n&&(n=pe(n));const r=await ur(e,{responseType:"arraybuffer",url:`${Sr}/${t}`,headers:Pe(null,n)});return new T(r.data)}const Dr="feeds";function Cr(e){const t=e["swarm-feed-index"],n=e["swarm-feed-index-next"];if(!t)throw new M("Response did not contain expected swarm-feed-index!");if(!n)throw new M("Response did not contain expected swarm-feed-index-next!");return{feedIndex:new j(t),feedIndexNext:new j(n)}}async function Vr(e,t,n,r){const a=await ur(e,{responseType:"arraybuffer",url:`${Dr}/${t}/${n}`,params:r});return{payload:new T(a.data),...Cr(a.headers)}}class Nr{constructor(e){this.raw=e}toString(){return f.isString(this.raw)&&this.raw.includes(".eth")?this.raw:new F(this.raw).toHex()}}function Fr(e,t){return t="number"==typeof t?j.fromBigInt(BigInt(t)):t,new N(i.keccak256(i.concatBytes(e.toUint8Array(),t.toUint8Array())))}async function Ir(e,t,n){try{const r=await Vr(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 G)return j.fromBigInt(0n);throw r}}async function Pr(e,t,n,r,a,i){const o=Fr(n,i?.index??await Ir(e,t.publicKey().address(),n));if(r.length>4096){const n=await Ar(e,r,a,i);return async function(e,t,n,r,a,i){return t=new D(t),r=new N(r),wr(e,a.toSingleOwnerChunk(r,t),n,i)}(e,t,a,o,vr(await fr(e,n.reference)),i)}return Br(e,t,a,o,f.isString(r)?T.fromUtf8(r).toUint8Array():r,i)}function $r(e,t,n){const r=Fr(t,n);return new F(i.keccak256(i.concatBytes(r.toUint8Array(),e.toUint8Array())))}async function kr(e,t,n,r,a=!1){const o=$r(t,n,r="number"==typeof r?j.fromBigInt(BigInt(r)):r),s=gr(await fr(e,o.toHex()),o);let c=d.empty();if(a){const e=T.fromSlice(s.payload.toUint8Array(),0,8);c=d.of(Number(i.uint64ToNumber(e.toUint8Array(),"BE")))}return{timestamp:c,payload:new T(s.payload.offset(a?8:0))}}async function Ur(e,t,n,r){const a=$r(t,n,r="number"==typeof r?j.fromBigInt(BigInt(r)):r),i=gr(await fr(e,a),a);return Or(i.payload,i.span)}function Lr(e,t,n){const r=async r=>{if(void 0===r?.index)return Vr(e,n,t);const a=await kr(e,n,t,r.index,r.hasTimestamp??!0),i="number"==typeof r.index?j.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 Vr(e,n,t);const a=await Ur(e,n,t,r.index),i=a.span.toBigInt()<=4096n?a.payload:await xr(e,new Nr(a.address)),o="number"==typeof r.index?j.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 Cr((await ur(e,{responseType:"arraybuffer",url:`${Dr}/${t}/${n}`,params:{"Swarm-Only-Root-Chunk":!0}})).headers)}(e,n,t)).feedIndex);const o=await r({...a,index:i});return{reference:new F(o.payload.toUint8Array()),feedIndex:o.feedIndex,feedIndexNext:o.feedIndexNext??o.feedIndex.next()}},owner:n,topic:t}}function zr(e,t,n){const r=async(r,a,o)=>async function(e,t,n,r,a,o){r=new F(r);const s=Fr(n,o?.index??await Ir(e,t.publicKey().address(),n)),c=o?.at??Date.now()/1e3,u=i.numberToUint64(BigInt(Math.floor(c)),"BE");return Br(e,t,a,s,i.concatBytes(u,r.toUint8Array()),o)}(e,n,t,a,r,o);return{...Lr(e,t,n.publicKey().address()),upload:r,uploadReference:r,uploadPayload:async(r,a,i)=>Pr(e,n,t,a,r,i)}}async function jr(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($r(e,t,j.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=u.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 Mr(e){if(!function(e){return!!Array.isArray(e)&&e.every((e=>"object"==typeof e&&e.path&&void 0!==e.size))}(e))throw new _("invalid collection",e)}function _r(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 Gr(e){return Array.from(e).map((e=>({path:_r(e),size:e.size,file:e})))}function qr(e){return Array.from(e).reduce(((e,t)=>e+t.size),0)}class Hr{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 Wr=n(497),Kr=n.n(Wr);async function Xr(e,t,n,r){const a=new Hr,i=ur(e,{method:"post",url:"bzz",data:a.output,responseType:"json",headers:{"content-type":"application/x-tar","swarm-collection":"true",...Pe(n,r)}});await async function(e,t){for(const n of e)if(t.beginFile(n.path,n.size),n.fsPath){const e=(0,Wr.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 Jr="bzz";async function Zr(e,t,n,r,a){fe(t)&&!a?.contentType&&(a||(a={}),a.contentType="application/octet-stream");const i=await ur(e,{method:"post",url:Jr,data:t,headers:Pe(n,a),params:{name:r},responseType:"json"}),o=f.asObject(i.data,{name:"response.data"});return{reference:new F(f.asHexString(o.reference)),tagUid:i.headers["swarm-tag"]?Be(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?d.of(new F(i.headers["swarm-act-history-address"])):d.empty()}}async function Qr(e,t,n,r){Mr(t);const a=await Xr(e,t,n,r),i=f.asObject(a.data,{name:"response.data"});return{reference:new F(f.asHexString(i.reference)),tagUid:a.headers["swarm-tag"]?Be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?d.of(new F(a.headers["swarm-act-history-address"])):d.empty()}}const Yr="balances",ea="consumed";const ta="chequebook";async function na(e,t){const n=await ur(e,{url:ta+`/cashout/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),uncashedAmount:ce.fromPLUR(de(r.uncashedAmount,{name:"uncashedAmount"})),transactionHash:f.asNullableString(r.transactionHash),lastCashedCheque:f.asNullable((e=>ra(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(de(t.lastPayout,{name:"lastPayout"})),bounced:f.asBoolean(t.bounced,{name:"bounced"})}}(e)),r.result)}}function ra(e){const t=f.asObject(e,{name:"cheque"});return{beneficiary:new V(f.asString(t.beneficiary,{name:"beneficiary"})),chequebook:new V(f.asString(t.chequebook,{name:"chequebook"})),payout:ce.fromPLUR(de(t.payout,{name:"payout"}))}}function aa(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 ia="settlements";const oa="stake";const sa="stamps";async function ca(e){const t=await ur(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 V(f.asString(e.owner,{name:"owner"})),start:f.asNumber(e.start,{name:"start"}),value:de(e.value,{name:"value"})})))}async function ua(e){const t=await ur(e,{method:"get",url:`${sa}`,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=>Ne(la(e))))}function la(e){return{amount:de(e.amount,{name:"amount"}),batchID:f.asString(e.batchID,{name:"batchID"}),batchTTL:f.asNumber(e.batchTTL,{name:"batchTTL"}),bucketDepth:f.asNumber(e.bucketDepth,{name:"bucketDepth"}),blockNumber:f.asNumber(e.blockNumber,{name:"blockNumber"}),depth:f.asNumber(e.depth,{name:"depth"}),immutableFlag:f.asBoolean(e.immutableFlag,{name:"immutableFlag"}),label:f.asEmptiableString(e.label,{name:"label"}),usable:f.asBoolean(e.usable,{name:"usable"}),utilization:f.asNumber(e.utilization,{name:"utilization"})}}const ha="wallet";var fa=n(359),da=n.n(fa);const pa="2.7.0-6ddf9b45",ma=pa.split("-")[0],ga="7.3.0";async function ba(e){const t=await ur(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 ya="transactions";function wa(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:de(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:de(t.value,{name:"value"})}}const Ba="grantee";var Ea=n(666),Ra=n.n(Ea);const Ta="gsoc";const va="pins";const Oa="pss";async function Sa(e,t,n,r,a,i){await ur(e,{method:"post",url:`${Oa}/send/${t}/${n}`,data:r,responseType:"json",params:{recipient:i},headers:Pe(a)})}async function Aa(e){await ur(e,{url:""})}const xa="stewardship";const Da="tags";const Ca=w()("bee-js:manifest"),Va=new TextEncoder,Na=new TextDecoder,Fa=new Uint8Array([47]),Ia=i.hexToUint8Array("5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b");class Pa{constructor(e,t){this.prefix=e,this.node=t}static split(e,t){const n=i.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 $a({path:n}),a=new Pa(e.prefix.slice(n.length),e.node),o=new Pa(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 Pa(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(i.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),Ca("marshalling fork",{prefixLength:this.prefix.length,prefix:Na.decode(this.prefix),address:i.uint8ArrayToHex(this.node.selfAddress)}),this.node.metadata){const t=i.padEndToMultiple(new Uint8Array([0,0,...Va.encode(JSON.stringify(this.node.metadata))]),32,10),n=i.numberToUint16(t.length-2,"BE");t.set(n,0),e.push(t)}return i.concatBytes(...e)}static unmarshal(e,t){const n=i.uint8ToNumber(e.read(1)),r=i.uint8ToNumber(e.read(1)),a=e.read(r);r<30&&e.read(30-r);const o=e.read(t);let s;if(Ca("unmarshalling fork",{type:n,prefixLength:r,prefix:Na.decode(a),addressLength:t,address:i.uint8ArrayToHex(o)}),function(e,t){return(e&t)===t}(n,16)){const t=i.uint16ToNumber(e.read(2),"BE");s=JSON.parse(Na.decode(e.read(t)))}return new Pa(a,new $a({selfAddress:o,metadata:s,path:a}))}}class $a{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 i.concatBytes(this.parent?.fullPath??new Uint8Array(0),this.path)}get fullPathString(){return Na.decode(this.fullPath)}getRootMetadata(){const e=this.find("/");return e&&e.metadata?d.of(e.metadata):d.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 d.empty();const r=n.metadata["swarm-feed-owner"],a=n.metadata["swarm-feed-topic"];return r&&a?d.of(await e.fetchLatestFeedUpdate(a,r,t)):d.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(Ia,0),e.set(i.equals(this.targetAddress,Qa)&&i.equals(this.path,new Uint8Array([47]))?i.numberToUint8(0):i.numberToUint8(this.targetAddress.length),31);const t=new Uint8Array(32);for(const a of this.forks.keys())i.setBit(t,a,1,"LE");const n=[];for(let a=0;a<256;a++)i.getBit(t,a,"LE")&&n.push(this.forks.get(a).marshal());const r=i.xorCypher(i.concatBytes(e,i.equals(this.targetAddress,Qa)&&i.equals(this.path,new Uint8Array([47]))?new Uint8Array(0):this.targetAddress,t,...n),this.obfuscationKey);return i.concatBytes(this.obfuscationKey,r)}static async unmarshal(e,t,n,r){t=new F(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=i.xorCypher(e.subarray(32),n),a=new b(r),o=a.read(31);if(!i.equals(o,Ia.slice(0,31)))throw new Error("MantarayNode#unmarshal invalid version hash");const s=i.uint8ToNumber(a.read(1)),c=s?a.read(s):Qa,u=new $a({selfAddress:t,targetAddress:c,obfuscationKey:n}),l=a.read(32);for(let h=0;h<256;h++)if(i.getBit(l,h,"LE")){const e=Pa.unmarshal(a,t.length);u.forks.set(h,e),e.node.parent=u}return u}addFork(e,t,n){this.selfAddress=null,e=e instanceof Uint8Array?e:Va.encode(e),Ca("adding fork",{path:Na.decode(e),reference:new F(t).represent()});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 Pa(c,new $a({targetAddress:i?new F(t).toUint8Array():void 0,metadata:i?n:void 0,path:c})),l=o.forks.get(c[0]);if(l){const e=Pa.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:Va.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(i.concatBytes(t.path,a.prefix),a.node.targetAddress,a.node.metadata)}async calculateSelfAddress(){return this.selfAddress?new F(this.selfAddress):new F((await p.root(await this.marshal())).hash())}async saveRecursively(e,t,n,r){for(const i of this.forks.values()){const a=await i.node.saveRecursively(e,t,n,r);if(n?.act){let e;a.historyAddress.ifPresent((t=>e=t)),e&&(i.node.metadata||(i.node.metadata={}),i.node.metadata["swarm-act-history-address"]=e.toHex())}}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");let a=t;r.node.metadata&&r.node.metadata["swarm-act-history-address"]&&(a={...t,actHistoryAddress:r.node.metadata["swarm-act-history-address"]});const i=await $a.unmarshal(e,r.node.selfAddress,a,n);r.node.targetAddress=i.targetAddress,r.node.forks=i.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:Va.encode(e)).length)return[this,t];const n=this.forks.get(e[0]);return n&&i.commonPrefix(n.prefix,e).length===n.prefix.length?n.node.findClosest(e.slice(n.prefix.length),i.concatBytes(t,n.prefix)):[this,t]}collect(e=[]){for(const t of this.forks.values())i.equals(t.node.targetAddress,Qa)||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 F(n.targetAddress).toHex();return t}determineType(){let e=0;return i.equals(this.targetAddress,Qa)&&!i.equals(this.path,Fa)||(e|=2),this.forks.size>0&&(e|=4),-1===i.indexOf(this.path,Fa)||i.equals(this.path,Fa)||(e|=8),this.metadata&&(e|=16),e}}var ka=n(61),Ua=n.n(ka);async function La(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 za(e,"")}async function za(e,t){const n=Ua().join(e,t),r=await Kr().promises.opendir(n);let a=[];for await(const i of r){const n=Ua().join(e,t,i.name),r=Ua().join(t,i.name);i.isFile()?a.push({path:r,size:(await Kr().promises.stat(n)).size,fsPath:n}):i.isDirectory()&&(a=[...await za(e,r),...a])}return a}async function ja(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 Kr().promises.opendir(e);let n=0;for await(const r of t)if(r.isFile()){n+=(await Kr().promises.stat(Ua().join(e,r.name))).size}else r.isDirectory()&&(n+=await ja(Ua().join(e,r.name)));return n}const Ma={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 _a(e){return["text/html","text/css"].includes(e)?`${e}; charset=utf-8`:e}async function Ga(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 qa(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 _("URL is not valid!",e)}class Ha{constructor(e,t){qa(e),this.url=function(e){return e.endsWith("/")?e.slice(0,-1):e}(e),t?.signer&&(this.signer=new D(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),we(t),n&&(n=function(e,t="UploadOptions"){const n=me(e,t),r=f.asObject(e,{name:t});return{...n,redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),r.redundancyLevel)}}(n)),Ar(this.getRequestOptionsForCall(r),t,e,n)}async probeData(e,t){return e=new F(e),async function(e,t){t=new F(t);const n=await ur(e,{url:`${Sr}/${t}`,method:"head",responseType:"json"});return{contentLength:parseInt(n.headers["content-length"])}}(this.getRequestOptionsForCall(t),e)}async downloadData(e,t,n){return t&&(t=pe(t)),xr(this.getRequestOptionsForCall(n),new Nr(e),t)}async downloadReadableData(e,t,n){return t&&(t=pe(t)),async function(e,t,n){return n&&(n=pe(n)),(await ur(e,{responseType:"stream",url:`${Sr}/${t}`,headers:Pe(null,n)})).data}(this.getRequestOptionsForCall(n),new Nr(e),t)}async uploadChunk(e,t,n,r){const a="identifier"in t&&"signature"in t&&"owner"in t;if(t=t instanceof Uint8Array?t:t.data,n&&(n=me(n)),t.length<P.LENGTH)throw new _(`Chunk has to have size of at least ${P.LENGTH}.`,t);if(!a&&t.length>Z+P.LENGTH)throw new _(`Content Addressed Chunk must not exceed ${Z+P.LENGTH} bytes.`,t);if(a&&t.length>Z+P.LENGTH+U.LENGTH+N.LENGTH)throw new _(`Single Owner Chunk must not exceed ${Z+P.LENGTH+U.LENGTH+N.LENGTH} bytes.`,t);return async function(e,t,n,r){const a=await ur(e,{method:"post",url:`${hr}`,data:t,headers:{"content-type":"application/octet-stream",...Pe(n,r)},responseType:"json"}),i=f.asObject(a.data,{name:"response.data"});return{reference:new F(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"]?d.of(new F(a.headers["swarm-act-history-address"])):d.empty()}}(this.getRequestOptionsForCall(r),t,e,n)}async downloadChunk(e,t,n){return e=new F(e),t&&(t=pe(t)),fr(this.getRequestOptionsForCall(n),e,t)}async createGrantees(e,t,n){return e=new k(e),t=t.map((e=>new C(e))),async function(e,t,n){const r=await ur(e,{method:"post",url:Ba,data:{grantees:n.map((e=>e.toCompressedHex()))},headers:Pe(t),responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return{status:r.status,statusText:r.statusText,ref:new F(f.asString(a.ref,{name:"ref"})),historyref:new F(f.asString(a.historyref,{name:"historyref"}))}}(this.getRequestOptionsForCall(n),e,t)}async getGrantees(e,t){return async function(e,t){const n=await ur(t,{method:"get",url:`${Ba}/${e}`,responseType:"json"}),r=f.asArray(n.data,{name:"response.data"}).map((e=>new C(f.asString(e,{name:"grantee"}))));return{status:n.status,statusText:n.statusText,grantees:r}}(e=new F(e),this.getRequestOptionsForCall(t))}async patchGrantees(e,t,n,r,a){return async function(e,t,n,r,a){const i=await ur(a,{method:"patch",url:`${Ba}/${t}`,data:{add:r.add?.map((e=>e.toCompressedHex())),revoke:r.revoke?.map((e=>e.toCompressedHex()))},headers:{...Pe(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 F(f.asString(o.ref,{name:"ref"})),historyref:new F(f.asString(o.historyref,{name:"historyref"}))}}(e=new k(e),t=new F(t),n=new F(n),{add:r.add?.map((e=>new C(e)))??[],revoke:r.revoke?.map((e=>new C(e)))??[]},this.getRequestOptionsForCall(a))}async uploadFile(e,t,n,r,a){if(e=new k(e),function(e){if(!("string"==typeof e||e instanceof Uint8Array||he(e)||fe(e)))throw new TypeError("Data must be either string, Readable, Uint8Array or File!")}(t),r&&(r=function(e){const t=me(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(he(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 Zr(this.getRequestOptionsForCall(a),i,e,o,s)}return Zr(this.getRequestOptionsForCall(a),t,e,n,r)}async downloadFile(e,t="",n,r){return n&&(n=pe(n)),async function(e,t,n="",r){const a=await ur(e,{method:"GET",responseType:"arraybuffer",url:`${Jr}/${t}/${n}`,headers:Pe(null,r)});return{...Ie(a.headers),data:new T(a.data)}}(this.getRequestOptionsForCall(r),new Nr(e),t,n)}async downloadReadableFile(e,t="",n,r){return e=new F(e),n&&(n=pe(n)),async function(e,t,n="",r){t=new F(t);const a=await ur(e,{method:"GET",responseType:"stream",url:`${Jr}/${t}/${n}`,headers:Pe(null,r)});return{...Ie(a.headers),data:a.data}}(this.getRequestOptionsForCall(r),e,t,n)}async uploadFiles(e,t,n,r){e=new k(e),n&&(n=ge(n));const a=Gr(t);return Qr(this.getRequestOptionsForCall(r),a,e,n)}async hashDirectory(e){return async function(e){const t=await La(e),n=new $a;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,Wr.createReadStream)(r.fsPath);for await(const n of t)await e.append(n);const a=await e.finalize(),{filename:i,extension:o}=l.parseFilename(r.path);n.addFork(r.path,a.hash(),{"Content-Type":_a(Ma[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 g(64,64);let s=0,c=0;n=new k(n);const u=await La(t);for(const l of u)s+=(h=l.size,function e(t){return t<=1?t:t+e(Math.ceil(t/128))}(Math.ceil(h/4096)));var h;let f=!1;async function d(t){await o.enqueue((async()=>{await e.uploadChunk(n,t.build(),a,i),r?.({total:s,processed:++c})}))}const m=new $a;for(const g of u){if(!g.fsPath)throw Error("File does not have fsPath, which should never happen in node. Please report this issue.");const e=(0,Wr.createReadStream)(g.fsPath),t=new p(d);for await(const i of e)await t.append(i);const n=await t.finalize();await o.drain();const{filename:r,extension:a}=l.parseFilename(g.path);m.addFork(g.path,n.hash(),{"Content-Type":_a(Ma[a.toLowerCase()]||"application/octet-stream"),Filename:r}),"index.html"===g.path&&(f=!0)}if(f||a?.indexDocument||a?.errorDocument){const e={};a?.indexDocument?e["website-index-document"]=a.indexDocument:f&&(e["website-index-document"]="index.html"),a?.errorDocument&&(e["website-error-document"]=a.errorDocument),m.addFork("/",Qa,e)}return m.saveRecursively(e,n,a,i)}(this,t,e=new k(e),n,r,this.getRequestOptionsForCall(a))}async streamFiles(e,t,n,r,a){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(a))}async uploadCollection(e,t,n,r){return e=new k(e),Mr(t),n&&(n=ge(n)),Qr(this.getRequestOptionsForCall(r),t,e,n)}async uploadFilesFromDirectory(e,t,n,r){e=new k(e),n&&(n=ge(n));const a=await La(t);return Qr(this.getRequestOptionsForCall(r),a,e,n)}async createTag(e){return async function(e){const t=await ur(e,{method:"post",url:Da,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 ur(e,{url:Da,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 ur(e,{url:`${Da}/${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 ur(e,{method:"delete",url:`${Da}/${t}`})}(this.getRequestOptionsForCall(t),e)}async updateTag(e,t,n){return t=new F(t),e=Be(e),async function(e,t,n){await ur(e,{method:"patch",url:`${Da}/${t}`,data:{reference:n}})}(this.getRequestOptionsForCall(n),e,t)}async pin(e,t){return e=new F(e),async function(e,t){await ur(e,{method:"post",responseType:"json",url:`${va}/${t}`})}(this.getRequestOptionsForCall(t),e)}async unpin(e,t){return e=new F(e),async function(e,t){await ur(e,{method:"delete",responseType:"json",url:`${va}/${t}`})}(this.getRequestOptionsForCall(t),e)}async getAllPins(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:`${va}`}),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 F(e)))}(this.getRequestOptionsForCall(e))}async getPin(e,t){return e=new F(e),async function(e,t){const n=await ur(e,{method:"get",responseType:"json",url:`${va}/${t}`}),r=f.asObject(n.data,{name:"response.data"});return{reference:new F(f.asString(r.reference,{name:"reference"}))}}(this.getRequestOptionsForCall(t),e)}async reuploadPinnedData(e,t,n){e=new k(e),t=new F(t),await async function(e,t,n){await ur(e,{method:"put",url:`${xa}/${n}`,headers:{"swarm-postage-batch-id":t.toHex()}})}(this.getRequestOptionsForCall(n),e,t)}async isReferenceRetrievable(e,t){return e=new F(e),async function(e,t){t=new F(t);const n=await ur(e,{method:"get",responseType:"json",url:`${xa}/${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 V(e),t=new L(t),r&&(r=pe(r)),!n)try{return await this.makeFeedReader(t,e,a).download(),!0}catch(i){const e=u.getDeep(i,"status");if(404===e||500===e)return!1;throw i}return jr(this,e,t,n,r,this.getRequestOptionsForCall(a))}async pssSend(e,t,n,r,a,i){return e=new k(e),we(r),a?(a=new C(a),Sa(this.getRequestOptionsForCall(i),t,n,r,e,a)):Sa(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"}),onClose:f.asFunction(t.onClose,{name:"onClose"})}}(t);const n=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===h.whereAmI()?new(Ra())(`${r}/${Oa}/subscribe/${t.toHex()}`):new(Ra())(`${r}/${Oa}/subscribe/${t.toHex()}`,{headers:n})}(this.url,e,this.requestOptions.headers);let r=!1;const a={topic:e,cancel:()=>{r||(r=!0,n.terminate?n.terminate():n.close())}};return n.onmessage=async e=>{const n=await Ga(e.data);n.length&&t.onMessage(new T(n),a)},n.onerror=e=>{r||t.onError(new M(e.message),a)},n.onclose=()=>{t.onClose(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)},onClose:()=>{clearTimeout(a),i.cancel()}});t>0&&(a=setTimeout((()=>{i.cancel(),r(new M("pssReceive timeout"))}),t))}))}gsocMine(e,t,n=12){e=new $(e),t=new N(t);for(let r=0n;r<0xffffn;r++){const a=new D(i.numberToUint256(2867n+r,"BE")),o=br(t,a.publicKey().address());if(256-i.proximity(o.toUint8Array(),e.toUint8Array())<=256-n)return a}throw Error("Could not mine a valid signer")}async gsocSend(e,t,n,r,a,i){e=new k(e),t=new D(t),n=new N(n);const o=Or(r).toSingleOwnerChunk(n,t);return async function(e,t,n,r){return wr(e,t,n,r)}(this.getRequestOptionsForCall(i),o,e,a)}gsocSubscribe(e,t,n){e=new V(e),t=new N(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"}),onClose:f.asFunction(t.onClose,{name:"onClose"})}}(n);const r=br(t,e),a=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===h.whereAmI()?new(Ra())(`${r}/${Ta}/subscribe/${t.toHex()}`):new(Ra())(`${r}/${Ta}/subscribe/${t.toHex()}`,{headers:n})}(this.url,r,this.requestOptions.headers);let i=!1;const o={address:e,cancel:()=>{i||(i=!0,a.terminate?a.terminate():a.close())}};return a.onmessage=async e=>{const t=await Ga(e.data);t.length&&n.onMessage(new T(t),o)},a.onerror=e=>{i||n.onError(new M(e.message),o)},a.onclose=()=>{n.onClose(o)},o}async createFeedManifest(e,t,n,r,a){return e=new k(e),t=new L(t),n=new V(n),r&&(r=me(r)),async function(e,t,n,r,a){const i=await ur(e,{method:"post",responseType:"json",url:`${Dr}/${t}/${n}`,headers:Pe(r,a)}),o=f.asObject(i.data,{name:"response.data"});return new F(f.asHexString(o.reference))}(this.getRequestOptionsForCall(a),n,t,e,r)}makeFeedReader(e,t,n){return e=new L(e),t=new V(t),Lr(this.getRequestOptionsForCall(n),e,t)}makeFeedWriter(e,t,n){if(e=new L(e),!(t=t?new D(t):this.signer))throw Error("No signer provided");return zr(this.getRequestOptionsForCall(n),e,t)}async fetchLatestFeedUpdate(e,t,n){return e=new L(e),t=new V(t),Vr(this.getRequestOptionsForCall(n),t,e)}makeContentAddressedChunk(e,t){return Or(e,t)}unmarshalContentAddressedChunk(e){return vr(e)}makeSingleOwnerChunk(e,t,n,r,a){return yr(e,t,n,r,a)}calculateSingleOwnerChunkAddress(e,t){return br(e,t)}unmarshalSingleOwnerChunk(e,t){return gr(e,t)}makeSOCReader(e,t){return{owner:e=new V(e),download:Er.bind(null,this.getRequestOptionsForCall(t),e)}}makeSOCWriter(e,t){if(!(e=e?new D(e):this.signer))throw Error("No signer provided");return{...this.makeSOCReader(e.publicKey().address(),t),upload:Br.bind(null,this.getRequestOptionsForCall(t),e)}}async createEnvelope(e,t,n){return e=new k(e),t=new F(t),async function(e,t,n){const r=await ur(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:i.hexToUint8Array(f.asHexString(a.issuer,{name:"issuer",byteLength:20})),index:i.hexToUint8Array(f.asHexString(a.index,{name:"index",byteLength:8})),timestamp:i.hexToUint8Array(f.asHexString(a.timestamp,{name:"timestamp",byteLength:8})),signature:i.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 a=await ur(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 Aa(this.getRequestOptionsForCall(e))}async isConnected(e){try{await Aa(this.getRequestOptionsForCall(e))}catch(t){return!1}return!0}async isGateway(e){return async function(e){try{const t=await ur(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 ur(e,{url:"addresses",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{overlay:new $(f.asString(n.overlay,{name:"overlay"})),underlay:f.asArray(n.underlay,{name:"underlay"}).map((e=>f.asString(e,{name:"underlay"}))),ethereum:new V(f.asString(n.ethereum,{name:"ethereum"})),publicKey:new C(f.asString(n.publicKey,{name:"publicKey"})),pssPublicKey:new C(f.asString(n.pssPublicKey,{name:"pssPublicKey"}))}}(this.getRequestOptionsForCall(e))}async getBlocklist(e){return async function(e){return(await ur(e,{url:"blocklist",responseType:"json"})).data.peers}(this.getRequestOptionsForCall(e))}async getPeers(e){return async function(e){const t=await ur(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 $(e),async function(e,t){return(await ur(e,{url:`peers/${t}`,responseType:"json",method:"DELETE"})).data}(this.getRequestOptionsForCall(t),e)}async getTopology(e){return async function(e){const t=await ur(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:aa(r.bin_0,"bin_0"),bin_1:aa(r.bin_1,"bin_1"),bin_2:aa(r.bin_2,"bin_2"),bin_3:aa(r.bin_3,"bin_3"),bin_4:aa(r.bin_4,"bin_4"),bin_5:aa(r.bin_5,"bin_5"),bin_6:aa(r.bin_6,"bin_6"),bin_7:aa(r.bin_7,"bin_7"),bin_8:aa(r.bin_8,"bin_8"),bin_9:aa(r.bin_9,"bin_9"),bin_10:aa(r.bin_10,"bin_10"),bin_11:aa(r.bin_11,"bin_11"),bin_12:aa(r.bin_12,"bin_12"),bin_13:aa(r.bin_13,"bin_13"),bin_14:aa(r.bin_14,"bin_14"),bin_15:aa(r.bin_15,"bin_15"),bin_16:aa(r.bin_16,"bin_16"),bin_17:aa(r.bin_17,"bin_17"),bin_18:aa(r.bin_18,"bin_18"),bin_19:aa(r.bin_19,"bin_19"),bin_20:aa(r.bin_20,"bin_20"),bin_21:aa(r.bin_21,"bin_21"),bin_22:aa(r.bin_22,"bin_22"),bin_23:aa(r.bin_23,"bin_23"),bin_24:aa(r.bin_24,"bin_24"),bin_25:aa(r.bin_25,"bin_25"),bin_26:aa(r.bin_26,"bin_26"),bin_27:aa(r.bin_27,"bin_27"),bin_28:aa(r.bin_28,"bin_28"),bin_29:aa(r.bin_29,"bin_29"),bin_30:aa(r.bin_30,"bin_30"),bin_31:aa(r.bin_31,"bin_31")}}}(this.getRequestOptionsForCall(e))}async pingPeer(e,t){return e=new $(e),async function(e,t){return(await ur(e,{url:`pingpong/${t}`,responseType:"json",method:"POST"})).data}(this.getRequestOptionsForCall(t),e)}async getAllBalances(e){return async function(e){const t=await ur(e,{url:Yr,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(de(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPeerBalance(e,t){return e=new $(e),async function(e,t){const n=await ur(e,{url:`${Yr}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:ce.fromPLUR(de(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getPastDueConsumptionBalances(e){return async function(e){const t=await ur(e,{url:ea,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(de(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPastDueConsumptionPeerBalance(e,t){return e=new $(e),async function(e,t){const n=await ur(e,{url:`${ea}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:ce.fromPLUR(de(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getChequebookAddress(e){return async function(e){const t=await ur(e,{url:ta+"/address",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{chequebookAddress:new V(f.asString(n.chequebookAddress,{name:"chequebookAddress"}))}}(this.getRequestOptionsForCall(e))}async getChequebookBalance(e){return async function(e){const t=await ur(e,{url:ta+"/balance",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{availableBalance:ce.fromPLUR(de(n.availableBalance,{name:"availableBalance"})),totalBalance:ce.fromPLUR(de(n.totalBalance,{name:"totalBalance"}))}}(this.getRequestOptionsForCall(e))}async getLastCheques(e){return async function(e){const t=await ur(e,{url:ta+"/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=>ra(e)),e.lastreceived),lastsent:f.asNullable((e=>ra(e)),e.lastsent)})))}}(this.getRequestOptionsForCall(e))}async getLastChequesForPeer(e,t){return e=new $(e),async function(e,t){const n=await ur(e,{url:ta+`/cheque/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),lastreceived:f.asNullable((e=>ra(e)),r.lastreceived),lastsent:f.asNullable((e=>ra(e)),r.lastsent)}}(this.getRequestOptionsForCall(t),e)}async getLastCashoutAction(e,t){return e=new $(e),na(this.getRequestOptionsForCall(t),e)}async cashoutLastCheque(e,t,n){return e=new $(e),t&&ye(t),async function(e,t,n){const r=await ur(e,{method:"post",url:ta+`/cashout/${t}`,responseType:"json",headers:Pe(null,n)}),a=f.asObject(r.data,{name:"response.data"});return new I(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():de(e,{min:1n,name:"amount"});let a;return t&&(a=de(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await ur(e,{method:"post",url:ta+"/deposit",responseType:"json",params:{amount:t.toString(10)},headers:r}),i=f.asObject(a.data,{name:"response.data"});return new I(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():de(e,{min:1n,name:"amount"});let a;return t&&(a=de(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await ur(e,{method:"post",url:ta+"/withdraw",responseType:"json",params:{amount:t.toString(10)},headers:r}),i=f.asObject(a.data,{name:"response.data"});return new I(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 V(t),async function(e,t,n){const r=await ur(e,{method:"post",url:`${ha}/withdraw/bzz`,responseType:"json",params:{amount:t.toPLURString(),address:n.toHex()}}),a=f.asObject(r.data,{name:"response.data"});return new I(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 V(t),async function(e,t,n){const r=await ur(e,{method:"post",url:`${ha}/withdraw/nativetoken`,responseType:"json",params:{amount:t.toWeiString(),address:n.toHex()}}),a=f.asObject(r.data,{name:"response.data"});return new I(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,t)}async getSettlements(e,t){return e=new $(e),async function(e,t){const n=await ur(e,{url:`${ia}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),sent:ce.fromPLUR(de(r.sent,{name:"sent"})),received:ce.fromPLUR(de(r.received,{name:"received"}))}}(this.getRequestOptionsForCall(t),e)}async getAllSettlements(e){return async function(e){const t=await ur(e,{url:ia,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{totalSent:ce.fromPLUR(de(n.totalSent,{name:"totalSent"})),totalReceived:ce.fromPLUR(de(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(de(e.sent,{name:"sent"})),received:ce.fromPLUR(de(e.received,{name:"received"}))})))}}(this.getRequestOptionsForCall(e))}async getStatus(e){return async function(e){const t=await ur(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 ba(this.getRequestOptionsForCall(e))}async getReadiness(e){return async function(e){const t=await ur(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 ur(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 ba(e);return t===pa}(this.getRequestOptionsForCall(e))}async isSupportedApiVersion(e){return async function(e){const{apiVersion:t}=await ba(e);return da()(t)===da()(ga)}(this.getRequestOptionsForCall(e))}async getVersions(e){return async function(e){const{version:t,apiVersion:n}=await ba(e);return{supportedBeeVersion:pa,supportedBeeApiVersion:ga,beeVersion:t,beeApiVersion:n}}(this.getRequestOptionsForCall(e))}async getReserveState(e){return async function(e){const t=await ur(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"}),reserveCapacityDoubling:f.asNumber(n.reserveCapacityDoubling,{name:"reserveCapacityDoubling"})}}(this.getRequestOptionsForCall(e))}async getChainState(e){return async function(e){const t=await ur(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:de(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 ur(e,{method:"get",url:`${ha}`,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{bzzBalance:ce.fromPLUR(de(n.bzzBalance,{name:"bzzBalance"})),nativeTokenBalance:ue.fromWei(de(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=de(e,{min:0n,name:"amount"});if(n&&(n=be(n)),t<Y||t>ee)throw new _(`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 _(`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 ur(e,{method:"post",url:`${sa}/${t}/${n}`,responseType:"json",params:{label:r?.label},headers:a}),o=f.asObject(i.data,{name:"response.data"});return new k(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=Ce(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 Ae(Ce(e,r,a),i)}async extendStorage(e,t,n,r,a,i){const o=await this.getPostageBatch(e,r),s=Ce(t,a,i),c=await this.getChainState(r),u=s-o.depth,l=u<=0?1n:2n**BigInt(u),h="gnosis"===this.network?5:15,f=De(n,c.currentPrice,h),d=De(o.duration,c.currentPrice,h),p=(n.isZero()?d*l:(d+f)*l)-d,m=await this.topUpBatch(o.batchID,p,r);return u>0?this.diluteBatch(o.batchID,s,r):m}async extendStorageSize(e,t,n,r,a){const i=await this.getChainState(n),o=await this.getPostageBatch(e,n),s=Ce(t,r,a),c=s-o.depth;if(c<=0)throw new _("New depth has to be greater than the original depth",s);const u=De(o.duration,i.currentPrice,"gnosis"===this.network?5:15);return await this.topUpBatch(o.batchID,u*(2n**BigInt(c)-1n)+1n,n),this.diluteBatch(o.batchID,s,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=await this.getChainState(r),c="gnosis"===this.network?5:15,u=n.isZero()?0n:De(n,s.currentPrice,c),l=Ce(t,a,i),h=De(o.duration,s.currentPrice,c),f=Ae(o.depth,h);return Ae(Math.max(o.depth,l),h+u).minus(f)}async getSizeExtensionCost(e,t,n,r,a){const i=await this.getPostageBatch(e,n),o=await this.getChainState(n),s=Ce(t,r,a);if(s-i.depth<=0)throw new _("New depth has to be greater than the original depth",s);const c=De(i.duration,o.currentPrice,"gnosis"===this.network?5:15),u=Ae(i.depth,c);return Ae(s,c).minus(u)}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 Ae(r.depth,a)}async calculateTopUpForBzz(e,t,n){const r=await this.getChainState(n),a="gnosis"===this.network?5:15,i=t.toPLURBigInt()/2n**BigInt(e);return{amount:i,duration:xe(i,r.currentPrice,a)}}async topUpBatch(e,t,n){e=new k(e);const r=de(t,{min:1n,name:"amount"});return async function(e,t,n){const r=await ur(e,{method:"patch",url:`${sa}/topup/${t}/${n}`,responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return new k(f.asString(a.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 ur(e,{method:"patch",url:`${sa}/dilute/${t}/${n}`,responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return new k(f.asString(a.batchID,{name:"batchID"}))}(this.getRequestOptionsForCall(n),e,t)}async getPostageBatch(e,t,n,r){return e=new k(e),async function(e,t,n,r){const a=await ur(e,{method:"get",url:`${sa}/${t}`,responseType:"json"});return Ne(la(f.asObject(a.data,{name:"response.data"})),n,r)}(this.getRequestOptionsForCall(t),e,n,r)}async getPostageBatchBuckets(e,t){return e=new k(e),async function(e,t){const n=await ur(e,{method:"get",url:`${sa}/${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 ua(this.getRequestOptionsForCall(e))}async getAllGlobalPostageBatch(e){return ca(this.getRequestOptionsForCall(e))}async getPostageBatches(e){return ua(this.getRequestOptionsForCall(e))}async getGlobalPostageBatches(e){return ca(this.getRequestOptionsForCall(e))}async getAllPendingTransactions(e){return async function(e){const t=await ur(e,{url:ya,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.pendingTransactions,{name:"pendingTransactions"}).map(wa)}(this.getRequestOptionsForCall(e))}async getPendingTransaction(e,t){return e=new I(e),async function(e,t){const n=await ur(e,{url:`${ya}/${t}`,responseType:"json"});return wa(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 ur(e,{method:"post",url:`${ya}/${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=de(t,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await ur(e,{method:"delete",headers:r,url:`${ya}/${t}`,responseType:"json"}),i=f.asObject(a.data,{name:"response.data"});return new I(f.asString(i.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,r)}async getStake(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:`${oa}`}),n=f.asObject(t.data,{name:"response.data"});return ce.fromPLUR(de(n.stakedAmount,{name:"stakedAmount"}))}(this.getRequestOptionsForCall(e))}async getWithdrawableStake(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:`${oa}/withdrawable`}),n=f.asObject(t.data,{name:"response.data"});return ce.fromPLUR(de(n.withdrawableAmount,{name:"withdrawableAmount"}))}(this.getRequestOptionsForCall(e))}async withdrawSurplusStake(e){return async function(e){const t=await ur(e,{method:"delete",responseType:"json",url:`${oa}/withdrawable`}),n=f.asObject(t.data,{name:"response.data"});return new I(f.asHexString(n.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(e))}async migrateStake(e){return async function(e){const t=await ur(e,{method:"delete",responseType:"json",url:oa}),n=f.asObject(t.data,{name:"response.data"});return new I(f.asHexString(n.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(e))}async depositStake(e,t,n){const r=e instanceof ce?e.toPLURString():de(e,{min:1n,name:"amount"});return t&&(t=ye(t)),async function(e,t,n){const r=await ur(e,{method:"post",responseType:"json",url:`${oa}/${t}`,headers:Pe(null,n)}),a=f.asObject(r.data,{name:"response.data"});return new I(f.asHexString(a.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(n),r,t)}async getRedistributionState(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:"redistributionstate"}),n=f.asObject(t.data,{name:"response.data"});return{minimumGasFunds:ue.fromWei(de(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(de(n.reward,{name:"reward"})),fees:ue.fromWei(de(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 h.sleepMillis(3e3)}throw new M("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),signal:t.signal}}(e)),e?u.deepMerge2(this.requestOptions,e):this.requestOptions}}class Wa extends Ha{async getNodeAddresses(e){const t=super.getRequestOptionsForCall(e),n=await ur(t,{url:"addresses",responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{overlay:new $(f.asString(r.overlay,{name:"overlay"})),underlay:[],ethereum:new V(f.asString(r.ethereum,{name:"ethereum"})),publicKey:new C(f.asString(r.publicKey,{name:"publicKey"})),pssPublicKey:new C(f.asString(r.pssPublicKey,{name:"pssPublicKey"}))}}async getTopology(e){const t=super.getRequestOptionsForCall(e),n=await ur(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:aa(a.bin_0,"bin_0"),bin_1:aa(a.bin_1,"bin_1"),bin_2:aa(a.bin_2,"bin_2"),bin_3:aa(a.bin_3,"bin_3"),bin_4:aa(a.bin_4,"bin_4"),bin_5:aa(a.bin_5,"bin_5"),bin_6:aa(a.bin_6,"bin_6"),bin_7:aa(a.bin_7,"bin_7"),bin_8:aa(a.bin_8,"bin_8"),bin_9:aa(a.bin_9,"bin_9"),bin_10:aa(a.bin_10,"bin_10"),bin_11:aa(a.bin_11,"bin_11"),bin_12:aa(a.bin_12,"bin_12"),bin_13:aa(a.bin_13,"bin_13"),bin_14:aa(a.bin_14,"bin_14"),bin_15:aa(a.bin_15,"bin_15"),bin_16:aa(a.bin_16,"bin_16"),bin_17:aa(a.bin_17,"bin_17"),bin_18:aa(a.bin_18,"bin_18"),bin_19:aa(a.bin_19,"bin_19"),bin_20:aa(a.bin_20,"bin_20"),bin_21:aa(a.bin_21,"bin_21"),bin_22:aa(a.bin_22,"bin_22"),bin_23:aa(a.bin_23,"bin_23"),bin_24:aa(a.bin_24,"bin_24"),bin_25:aa(a.bin_25,"bin_25"),bin_26:aa(a.bin_26,"bin_26"),bin_27:aa(a.bin_27,"bin_27"),bin_28:aa(a.bin_28,"bin_28"),bin_29:aa(a.bin_29,"bin_29"),bin_30:aa(a.bin_30,"bin_30"),bin_31:aa(a.bin_31,"bin_31")}}}}class Ka{constructor(e,t,n,r){this.signer=new D(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 Ka(e,t,new Uint32Array(65536),n)}static fromState(e,t,n,r){return new Ka(e,t,n,r)}stamp(e){const t=e.hash(),n=i.uint16ToNumber(t,"BE"),r=this.buckets[n];if(r>=this.maxSlot)throw Error("Bucket is full");this.buckets[n]++;const a=i.concatBytes(i.numberToUint32(n,"BE"),i.numberToUint32(r,"BE")),o=i.numberToUint64(BigInt(Date.now()),"BE"),s=this.signer.sign(i.concatBytes(t,this.batchId.toUint8Array(),a,o));return{batchId:this.batchId,index:a,issuer:this.signer.publicKey().address().toUint8Array(),signature:s.toUint8Array(),timestamp:o}}getState(){return this.buckets}}const Xa="https://api.gateway.ethswarm.org",Ja=new k("0000000000000000000000000000000000000000000000000000000000000000"),Za=new L("0000000000000000000000000000000000000000000000000000000000000000"),Qa=new Uint8Array(32),Ya=new Uint8Array(32),ei=new Uint8Array(20);function ti(e){return(e=new $(e)).toHex().slice(0,Q)}const ni=[[94,68,46,28,14,5,1],[9,8,7,6,5,4,3]],ri=[[47,34,23,14,7,2],[9,8,7,6,5,4]],ai=[[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]],ii=[[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]],oi=[[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]],si=[[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]],ci=[[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]],ui=[[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 li(e,t,n){if(t===re.OFF)return 0;const r=function(e,t){switch(e){case re.MEDIUM:return t?ri:ni;case re.STRONG:return t?ii:ai;case re.INSANE:return t?si:oi;case re.PARANOID:return t?ui:ci;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 hi={label:"medium",value:re.MEDIUM,errorTolerance:.01},fi={label:"strong",value:re.STRONG,errorTolerance:.05},di={label:"insane",value:re.INSANE,errorTolerance:.1},pi={label:"paranoid",value:re.PARANOID,errorTolerance:.5};function mi(){return{medium:hi,strong:fi,insane:di,paranoid:pi}}function gi(e){if("string"==typeof e)switch(e.toLowerCase()){case"medium":return hi;case"strong":return fi;case"insane":return di;case"paranoid":return pi;default:throw new Error(`Unknown redundancy level '${e}'`)}switch(e){case re.MEDIUM:return hi;case re.STRONG:return fi;case re.INSANE:return di;case re.PARANOID:return pi;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={20(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(W(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 h(e){if(!e.length)throw Error("Received empty array");return e[e.length-1]}function f(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 a of n){if(null===r[a]||void 0===r[a])return null;r=r[a]}return r}function p(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 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||"AbortController"==e.constructor.name||"AbortSignal"==e.constructor.name||"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 E(e){return"[object String]"===Object.prototype.toString.call(e)}function R(e){return"number"==typeof e&&isFinite(e)}function T(e){return!0===e||!1===e}function v(e){return"[object Date]"===Object.prototype.toString.call(e)}function O(e){return!E(e)||0===e.trim().length}function S(e){return R(e)&&Number.isInteger(e)&&e>=1}function x(e){return E(e)&&null!==e.match(/^-?\d+$/)}function A(e){return E(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.c_=t.Ox=t.ij=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(""),C="abcdefghijklmnopqrstuvwxyz",V=C+"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",N=V+"!@#$%^&*()_+-=[]{}|;:<>?,./",F=["—","\\","東","京","都","𝖆","𝖇","𝖈","👾","🙇","💁","🙅","ᚠ","ᛇ","ᚻ","ᛦ"],I="0123456789abcdef";function P(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 $(e,t){if(R(e))return t&&k(e,t),e;if(!E(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 L(e,t){return Math.trunc($(e,t))}function U(e,t){if(!b(e))throw new TypeError(`Expected object${t?.name?` for ${t.name}`:""}, got: `+e);return e}function z(e){return E(e)&&null!==e.match(/^https?:\/\/.+/)}function j(e){return"bigint"==typeof e}function M(e,t){if(!j(e))throw new TypeError(`Expected bigint${t?.name?` for ${t.name}`:""}, got: `+e);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}`);return e}function _(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 G(e,t){if(b(e)&&b(t))for(const n in t)b(t[n])?(e[n]||(e[n]={}),G(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 q(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 H(e,t){Array.prototype.push.apply(e,t)}function W(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function K(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 X(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 J={"&amp;":"&","&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<"};function Z(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(0,n)}function Q(e,t){const n=e.indexOf(t);return-1===n?null:e.slice(n+t.length)}function Y(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(0,n)}function ee(e,t){const n=e.lastIndexOf(t);return-1===n?null:e.slice(n+t.length)}function te(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 ne(e,t){let n=[e];for(const r of t)n=n.flatMap((e=>e.split(r)));return n.filter((e=>e))}function re(e){const t=h(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?"":t.slice(n+1)}function ae(e){const t=h(e.split(/\\|\//g)),n=t.lastIndexOf(".",t.length-1);return n<=0?t:t.slice(0,n)}function ie(e){return e.split("\n").map((e=>e.trim().replace(/\s+/g," "))).filter((e=>e.length>0)).join("\n")}function oe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function se(e){return e.charAt(0).toLowerCase()+e.slice(1)}function ce(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122}function ue(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function le(e){return ce(e)||ue(e)}const he=" \n\t\r.,?!:;\"'`(){}[]~@#$%^&*-+=|<>/\\".split("");function fe(e){return he.includes(e)}function de(e,t,n=0){const r=t.exec(e.slice(n));return r?{index:r.index,match:r[0]}:null}function pe(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=de(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 me(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 ge(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 be(e,t=0){for(let n=t;n<e.length;n++)if(fe(e[n]))return n;return-1}function ye(e,t=0){for(let n=t;n<e.length;n++)if("#"===e[n]&&le(e[n+1]))return n;return-1}function we(e,t,n=0){return e.slice(0,n).lastIndexOf(t)}function Be(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 Ee(e,t){const n=t.wordBoundary?ge(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 Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Te="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function ve(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 Oe(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 Se(e,t,n){const r=[];for(const a of n)a!==t&&r.push(e.replace(t,a));return r}function xe(e){const t=e.lastIndexOf(" ");if(-1===t)return{line:e,rest:""};return{line:e.slice(0,t),rest:e.slice(t+1)}}function Ae(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 De(e,t){return new RegExp(`\\b${t}\\b`).test(e)}function Ce(e,t,n=[]){let r="";for(;t<e.length&&(le(e[t])||n.includes(e[t]));)r+=e[t++];return r}function Ve(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=Ce(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 Ne(e,t="$",n=":"){let r=e.indexOf(t);for(;-1!==r;){const a=Ce(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=Ce(e,r+a.length+2);e=e.replace(`${t}${a}${n}${i}`,i)}r=e.indexOf(t,r+1)}return e}function Fe(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 Pe(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 ke(e){return Math.floor((v(e)?e.getTime():e)/864e5)}const $e={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 Le={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 Ue(e,n){const r=n?.now??Date.now(),a=n?.labels||Le;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 ze={};const je={s:1e3,m:6e4,h:36e5,d:864e5};const Me={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function _e(e){return{zeroBasedIndex:e,day:Me[e]}}function Ge(e){return _e(e.getDay())}const qe={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 He={b:0,byte:0,bytes:0,kb:1,kilobyte:1,kilobytes:1,mb:2,megabyte:2,megabytes:2,gb:3,gigabyte:3,gigabytes:3,tb:4,terabyte:4,terabytes:4};const We=new Map;function Ke(e,t=!1){e=e.filter((e=>e)),t&&E(e[1])&&(e[1]="../"+e[1]);let n="";E(e[0])&&e[0].includes("://")&&(n=Z(e[0],"://")??"",e[0]=Q(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 Xe(e){const t=Object.keys(e).sort(((e,t)=>e.localeCompare(t))),n={};for(const r of t)n[r]=Ze(e[r]);return n}function Je(e){const t=[];return e.sort(((e,t)=>JSON.stringify(Ze(e)).localeCompare(JSON.stringify(Ze(t))))).forEach((e=>t.push(Ze(e)))),t}function Ze(e){return Array.isArray(e)?Je(e):g(e)?Xe(e):e}function Qe(e,t){return JSON.stringify(Ze(e))===JSON.stringify(Ze(t))}function Ye(e){const t=Object.keys(e);return t[Math.floor(Math.random()*t.length)]}const et=[1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24,1e27,1e30,1e9,1e16,1e18,1e18,1e18,1e33],tt=["thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","gwei","bzz","btc","eth","dai","decillion"],nt=["K","M","B","T","Qa","Qi","Sx","Sp","O","N","gwei","bzz","eth","btc","dai","D"];function rt(e){const t=parseFloat(e);if(isNaN(t))throw Error("makeNumber got NaN for input");const n=e.replace(/^-?[0-9.]+/,"").trim(),r=nt.findIndex((e=>e.toLowerCase()===n.toLowerCase()));return-1===r?t:t*et[r]}function at(e,t,n){return e<t?t:e>n?n:e}function it(e,t,n){return e+(n?"["+t+"]":(e.length?".":"")+t)}function ot(e,t,n,r,a){if(!g(t))return t;for(const[i,o]of Object.entries(t)){const t=it(n,i,r);Array.isArray(o)?a?ot(e,o,t,!0,a):e[t]=o.map((e=>ot(Array.isArray(e)?[]:{},e,"",!1,a))):g(o)?ot(e,o,t,!1,a):e[t]=o}return e}function st(e,t){const n={};for(const r of e){n[t(r)]=r}return n}function ct(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 ut(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 lt(e,t){return Object.fromEntries(Object.entries(e).sort(t))}function ht(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 ft(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 dt{constructor(e){this.value=e}static of(e){return new dt(e)}static empty(){return new dt(null)}map(e){return new dt(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=>dt.of(e))):Promise.resolve(dt.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=dt;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 pt{constructor(e){this.value=e,this.children=[]}}function mt(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 gt(...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 bt(e){return 137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]}function yt(e){return 255===e[0]&&216===e[1]}function wt(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 Et(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 Rt(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 Tt(e,t){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.subarray(r,r+t));return n}const vt=[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 Ot(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],h=e[9]^e[19]^e[29]^e[39]^e[49],f=l^(a<<1|i>>>31),d=h^(i<<1|a>>>31),p=n^(o<<1|s>>>31),m=r^(s<<1|o>>>31),g=a^(c<<1|u>>>31),b=i^(u<<1|c>>>31),y=o^(l<<1|h>>>31),w=s^(h<<1|l>>>31),B=c^(n<<1|r>>>31),E=u^(r<<1|n>>>31);e[0]^=f,e[1]^=d,e[2]^=p,e[3]^=m,e[4]^=g,e[5]^=b,e[6]^=y,e[7]^=w,e[8]^=B,e[9]^=E,e[10]^=f,e[11]^=d,e[12]^=p,e[13]^=m,e[14]^=g,e[15]^=b,e[16]^=y,e[17]^=w,e[18]^=B,e[19]^=E,e[20]^=f,e[21]^=d,e[22]^=p,e[23]^=m,e[24]^=g,e[25]^=b,e[26]^=y,e[27]^=w,e[28]^=B,e[29]^=E,e[30]^=f,e[31]^=d,e[32]^=p,e[33]^=m,e[34]^=g,e[35]^=b,e[36]^=y,e[37]^=w,e[38]^=B,e[39]^=E,e[40]^=f,e[41]^=d,e[42]^=p,e[43]^=m,e[44]^=g,e[45]^=b,e[46]^=y,e[47]^=w,e[48]^=B,e[49]^=E;const R=e[0],T=e[1],v=e[2]<<1|e[3]>>>31,O=e[3]<<1|e[2]>>>31,S=e[5]<<30|e[4]>>>2,x=e[4]<<30|e[5]>>>2,A=e[6]<<28|e[7]>>>4,D=e[7]<<28|e[6]>>>4,C=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,N=e[11]<<4|e[10]>>>28,F=e[10]<<4|e[11]>>>28,I=e[13]<<12|e[12]>>>20,P=e[12]<<12|e[13]>>>20,k=e[14]<<6|e[15]>>>26,$=e[15]<<6|e[14]>>>26,L=e[17]<<23|e[16]>>>9,U=e[16]<<23|e[17]>>>9,z=e[18]<<20|e[19]>>>12,j=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,he=e[43]<<2|e[42]>>>30,fe=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,be=e[49]<<14|e[48]>>>18;e[0]=R^~I&H,e[1]=T^~P&W,e[2]=I^~H&ae,e[3]=P^~W&ie,e[4]=H^~ae&ge,e[5]=W^~ie&be,e[6]=ae^~ge&R,e[7]=ie^~be&T,e[8]=ge^~R&I,e[9]=be^~T&P,e[10]=A^~z&M,e[11]=D^~j&_,e[12]=z^~M&ee,e[13]=j^~_&te,e[14]=M^~ee&fe,e[15]=_^~te&de,e[16]=ee^~fe&A,e[17]=te^~de&D,e[18]=fe^~A&z,e[19]=de^~D&j,e[20]=v^~k&K,e[21]=O^~$&X,e[22]=k^~K&oe,e[23]=$^~X&se,e[24]=K^~oe&ce,e[25]=X^~se&ue,e[26]=oe^~ce&v,e[27]=se^~ue&O,e[28]=ce^~v&k,e[29]=ue^~O&$,e[30]=C^~N&G,e[31]=V^~F&q,e[32]=N^~G&ne,e[33]=F^~q&re,e[34]=G^~ne&pe,e[35]=q^~re&me,e[36]=ne^~pe&C,e[37]=re^~me&V,e[38]=pe^~C&N,e[39]=me^~V&F,e[40]=S^~L&J,e[41]=x^~U&Z,e[42]=L^~J&Q,e[43]=U^~Z&Y,e[44]=J^~Q&le,e[45]=Z^~Y&he,e[46]=Q^~le&S,e[47]=Y^~he&x,e[48]=le^~S&L,e[49]=he^~x&U,e[0]^=vt[2*t],e[1]^=vt[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 xt(e,t){if(!e.length){const e=new Uint8Array(136);return e[0]=t,e[135]=128,[St(e)]}const n=Tt(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 At(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];Ot(e)}return e}function Dt(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 Ct(e){return Dt(At(new Array(50).fill(0),xt(e,1)))}function Vt(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 Nt(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 Ft(e,t){return(e%t+t)%t}function It(e,t){e=Ft(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 Pt(e,t){return 0n===Ft(e,t)?0n:t%4n===3n?function(e,t,n){let r=1n;for(e=Ft(e,n);t>0;)t%2n===1n&&(r=Ft(r*e,n)),e=Ft(e*e,n),t/=2n;return r}(e,(t+1n)/4n,t):null}const kt=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,$t=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,Lt=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Ut=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n;function zt(e,t,n){if(0n===t)return[0n,0n];const r=Ft(3n*e*e*It(2n*t,n),n),a=Ft(r*r-2n*e,n);return[a,Ft(r*(e-a)-t,n)]}function jt(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===Ft(-r,a))return[0n,0n];if(e===n&&t===r)return zt(e,t,a);const i=Ft((r-t)*It(n-e,a),a),o=Ft(i*i-e-n,a);return[o,Ft(i*(e-o)-t,a)]}function Mt(e,t,n,r){let a=[0n,0n],i=[e,t];const o=n.toString(2);for(const s of o)"0"===s?(i=jt(a[0],a[1],i[0],i[1],r),a=zt(a[0],a[1],r)):(a=jt(a[0],a[1],i[0],i[1],r),i=zt(i[0],i[1],r));return a}function _t(e,t,n){if(t<=0n||t>=$t)throw new Error("Invalid private key");if(n||(n=Ft(Rt(Ct(gt(Ct(Et(t,"BE")),Et(e,"BE"))),"BE"),$t)),n<=0n||n>=$t)throw new Error("Invalid nonce");const r=Ft(e,$t),a=Mt(Lt,Ut,n,kt),i=Ft(a[0],$t);let o=Ft((r+Ft(i,$t)*t)*It(n,$t),$t);if(0n===i||0n===o)throw new Error("Invalid r or s value");let s=a[1]%2n===0n?27n:28n;return o>$t/2n&&(o=$t-o,s=27n===s?28n:27n),[i,o,s]}class Gt{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=Gt;class qt{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=qt;class Ht{constructor(e,t=0n){this.span=t,this.writer=new qt(new Uint8Array(e))}build(){return gt(Bt(this.span,"LE"),this.writer.buffer)}hash(){const e=mt(Tt(this.writer.buffer,32),((e,t)=>Ht.hashFunction(gt(e,t))));return Ht.hashFunction(gt(Bt(this.span,"LE"),e))}}t.AA=Ht,Ht.hashFunction=Ct;class Wt{constructor(e,t=4096){this.counters=[1],this.capacity=t,this.chunks=[new Ht(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 Gt(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 Ht(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 Ht(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=Wt,n=Wt,Wt.NOOP=async e=>{};class Kt{constructor(e,t){if(t<0)throw Error("Scale must be non-negative");this.value=BigInt(e),this.scale=t}static cast(e){if(!e)throw Error("Cannot cast falsy value to FixedPointNumber");if(e instanceof Kt)return e;const t=M(e.value),n=$(e.scale);return new Kt(t,n)}static fromDecimalString(e,t){/e\-\d+$/i.test(e)&&(e=parseFloat(e).toFixed(t));let[n,r]=e.split(".");return r=(r||"").padEnd(t,"0").slice(0,t),new Kt(BigInt(n+r),t)}static fromFloat(e,t){return Kt.fromDecimalString(e.toString(),t)}add(e){return this.assertSameScale(e),new Kt(this.value+e.value,this.scale)}subtract(e){return this.assertSameScale(e),new Kt(this.value-e.value,this.scale)}multiply(e){return new Kt(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 Kt(t,this.scale),new Kt(n,this.scale)]}exchange(e,t,n){if("*"===e){const e=this.value*t.value/10n**BigInt(this.scale);return new Kt(e,n)}this.assertSameScale(t);const r=this.value*10n**BigInt(n)/t.value;return new Kt(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()}toFloat(){return parseFloat(this.toDecimalString())}assertSameScale(e){if(this.scale!==e.scale)throw new Error(`Scale mismatch: expected ${this.scale}, but got ${e.scale}`)}}function Xt(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 Jt(e,t,n,r){const a=Xt(e,t,n,r);if(!a)throw new Error(`Missing argument ${t}`);return a}function Zt(e,t){const n=e[t];e.splice(t,1),e.unshift(n)}function Qt(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Yt(e,t){return{x:e.x*t,y:e.y*t}}function en(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function tn(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function nn(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 rn(e,t,n){return!e[t-1]?.[n]}function an(e,t,n){return!e[t+1]?.[n]}function on(e,t,n){return!e[t][n-1]}function sn(e,t,n){return!e[t][n+1]}function cn(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]&&rn(e,t,n)&&on(e,t,n)&&r.push({x:t,y:n}),!e[t+1]?.[n-1]&&an(e,t,n)&&on(e,t,n)&&r.push({x:t+1,y:n}),!e[t-1]?.[n+1]&&rn(e,t,n)&&sn(e,t,n)&&r.push({x:t,y:n+1}),!e[t+1]?.[n+1]&&an(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 un(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 ln(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 hn(e,t,n){const r=[],a=en(e,n,1e4);for(const i of t){const t=ln(e,a,i.start,i.end);t&&r.push(t)}return r.length?r.reduce(((t,n)=>tn(e,n)<tn(e,t)?n:t)):null}t.ie=Kt;class fn{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=fn;t.O3=class{constructor(e,t){this.queue=[],this.running=0,this.onProcessed=new fn,this.onDrained=new fn,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 dn{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 dn;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$=dn;t.ij=class{constructor(e){this.index=0,this.values=e}current(){return this.values[this.index]}next(){return this.index=(this.index+1)%this.values.length,this.values[this.index]}};t.Ox=class{constructor(){this.status="pending",this.steps=[],this.onStatusChange=async()=>{},this.onStepChange=async()=>{},this.onFinish=async()=>{},this.onError=async()=>{},this.context=new Map}getStatus(){return this.status}createInitialState(){return Object.fromEntries(this.steps.map((e=>[e.name,"pending"])))}setHooks(e){e.onStatusChange&&(this.onStatusChange=e.onStatusChange),e.onStepChange&&(this.onStepChange=e.onStepChange),e.onFinish&&(this.onFinish=e.onFinish),e.onError&&(this.onError=e.onError)}addStep(e){if(this.steps.find((t=>t.name===e.name)))throw Error(`Step with name ${e.name} already exists`);this.steps.push(e)}async execute(){if("pending"!==this.status)throw Error(`Cannot execute solver in status ${this.status}`);this.status="in-progress",await this.onStatusChange(this.status);let e=this.createInitialState();for(const n of this.steps)try{if(n.transientSkipStepName){const t=e[n.transientSkipStepName];if("skipped"===t||"failed"===t){e={...e,[n.name]:"skipped"},await this.onStepChange(e);continue}}if(n.precondition&&!await n.precondition(this.context)){e={...e,[n.name]:"skipped"},await this.onStepChange(e);continue}e={...e,[n.name]:"in-progress"},await this.onStepChange(e);for(let e=0;"retry"===await n.action(this.context,e);e++);e={...e,[n.name]:"completed"},await this.onStepChange(e)}catch(t){throw e={...e,[n.name]:"failed"},this.status="failed",await this.onStatusChange(this.status),await this.onStepChange(e),await this.onError(t),t}return this.status="completed",await this.onStatusChange(this.status),await this.onFinish(),this.context}};t.c_=class{constructor(e){this.queryFunction=e.queryFunction,this.lockFunction=e.lockFunction,this.unlockFunction=e.unlockFunction,this.timeoutMillis=e.timeoutMillis}async couldLock(){const e=await this.queryFunction();try{const t=L(e);if(Date.now()<t+this.timeoutMillis)return new Date(t+this.timeoutMillis)}catch{}return await this.lockFunction(Date.now().toString()),!0}async unlock(){await this.unlockFunction()}},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 ve(e,Re)},uint8ArrayToBase64:function(e){return Oe(e,Re)},base32ToUint8Array:function(e){return ve(e,Te)},uint8ArrayToBase32:function(e){return Oe(e,Te)},log2Reduce:mt,partition:Tt,concatBytes:gt,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:Et,uint256ToNumber:Rt,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:Ct,sha3_256:function(e){return Dt(At(new Array(50).fill(0),xt(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:Vt,padStartToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:Vt(e,e.length+t-r,n)},padEnd:Nt,padEndToMultiple:function(e,t,n=0){const r=e.length%t;return 0===r?e:Nt(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>=$t)throw new Error("Invalid private key");return Mt(Lt,Ut,e,kt)},compressPublicKey:function(e){const t=e[1]%2n===0n?2:3;return new Uint8Array([t,...Et(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=Rt(e.slice(1),"BE"),n=Pt(Ft(t**3n+7n,kt),kt);if(!n)throw Error("Invalid x: does not correspond to a valid curve point");const r=Ft(-n,kt),a=n%2n===0n;return[t,2===e[0]?a?n:r:a?r:n]},publicKeyToAddress:function(e){const t=new Uint8Array(20),n=Ct(gt(Et(e[0],"BE"),Et(e[1],"BE")));return t.set(n.subarray(12)),t},signMessage:function(e,t,n){return _t(Rt(Ct(e),"BE"),t,n)},signHash:_t,verifySignature:function(e,t,n,r){const a=Ft(Rt(Ct(e),"BE"),$t),i=It(r,$t),o=Ft(a*i,$t),s=Ft(n*i,$t),c=Mt(Lt,Ut,o,kt),u=Mt(t[0],t[1],s,kt);return n===Ft(jt(c[0],c[1],u[0],u[1],kt)[0],$t)},recoverPublicKey:function(e,t,n,r){const a=Pt(Ft(t**3n+7n,kt),kt);if(!a)throw new Error("Invalid r: does not correspond to a valid curve point");const i=a%2n===(27n===r?0n:1n)?a:kt-a,o=Ft(Rt(Ct(e),"BE"),$t),s=Mt(t,i,n,kt),c=Mt(Lt,Ut,o,kt),u=jt(s[0],s[1],c[0],Ft(-c[1],kt),kt);return Mt(u[0],u[1],It(t,$t),kt)},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?lt(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(st(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:ct,index:st,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 h(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:h,pipe:f,makePipe:function(e,t){return n=>f(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:H,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])&&H(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:ht,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:Xt,getBooleanArgument:function(e,t,n,r){const a=e.some((e=>e.endsWith("-"+t))),i=Xt(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=Xt(e,t,n,r);if(!a)return null;try{return rt(a)}catch{throw new Error(`Invalid number argument ${t}: ${a}`)}},requireStringArgument:Jt,requireNumberArgument:function(e,t,n,r){const a=Jt(e,t,n,r);try{return rt(a)}catch{throw new Error(`Invalid argument ${t}: ${a}`)}},bringToFront:function(e,t){const n=[...e];return Zt(n,t),n},bringToFrontInPlace:Zt,findInstance:function(e,t){const n=e.find((e=>e instanceof t));return dt.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 pt(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))},minBy:function(e,t){return e.reduce(((e,n)=>t(e)<t(n)?e:n))},allIndexOf:function(e,t){const n=[];return e.forEach(((e,r)=>{t(e)&&n.push(r)})),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(E(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"},withRetries:async function(e,t,n,r,i,o){let s=null;for(let u=0;u<=t;u++)try{return await e()}catch(c){if(s=c,u===t)break;const e=n+u/(t-1)*(r-n);i&&i("Error in withRetries, retrying",{attempt:u+1,allowedFailures:t,delayMillis:e,error:c}),o&&o(),await a(e)}throw s}},t.FQ={make:rt,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:at,range:W,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?tt:nt,i=t?.precision??1;if(e<et[0])return`${e}${r}`;for(let o=0;o<et.length-1;o++)if(e<et[o+1])return`${(e/et[o]).toFixed(i)}${n?" ":""}${a[o]}${r}`;return`${(e/et[et.length-1]).toFixed(i)}${n?" ":""}${a[et.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,t=1024){const n=parseFloat(e);if(isNaN(n))throw Error("makeStorage got NaN for input");const r=e.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),a=""===r?0:He[r];if(null==a)throw Error(`Unknown unit: "${r}"`);return Math.ceil(n*t**a)},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: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])},binomialSample:function(e,t,n=Math.random){const r=e*t,a=Math.sqrt(e*t*(1-t)),i=(n()+n()+n()+n()+n()+n()-3)*Math.SQRT2,o=Math.round(r+a*i);return Math.max(0,Math.min(e,o))},toSignificantDigits:function(e,t){if(!e.includes("."))return e;if(0===parseFloat(e))return"0";const[n,r]=e.split("."),a=n.replace("-",""),i=a.length;if(i>=t)return n;if("0"!==a){const e=t-i,a=r.slice(0,e);return/[1-9]/.test(a)?`${n}.${a.replace(/0+$/,"")}`:n}const o=t+(r.match(/^0*/)?.[0].length??0);return`${n}.${r.slice(0,o)}`}},t.HC={raceFulfilled:async function(e){return r(Promise.all(e.map(r)))},invert:r,runInParallelBatches:async function(e,t=1){const n=ct(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||$e,a=v(e)?e:new Date(e);if(ke(n)===ke(a))return r.today(a.getUTCHours(),a.getUTCMinutes(),a.getUTCHours()>12);if(ke(n)-ke(a)==1)return r.yesterday();const i=Ge(a);return ke(n)-ke(a)<7?r[i.day]():r.weeks(Math.round((n.getTime()-a.getTime())/6048e5))},getTimeDelta:Ue,secondsToHumanTime:function(e,t=Le){return Ue(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(!ze[e]||Date.now()>ze[e])&&(ze[e]=Date.now()+t,!0)},timeSince:function(e,t,n){return t=v(t)?t.getTime():t,((n=n?v(n)?n.getTime():n:Date.now())-t)/je[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:Pe,humanizeProgress:function(e){return`[${Math.floor(100*e.progress)}%] ${Pe(e.deltaMs)} out of ${Pe(e.totalTimeMs)} (${Pe(e.remainingTimeMs)} left) [${Math.round(e.baseTimeMs)} ms each]`},createTimeDigits:Ie,mapDayNumber:_e,getDayInfoFromDate:Ge,getDayInfoFromDateTimeString:function(e){return Ge(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=""===n?1:qe[n];if(!r)throw Error(`Unknown unit: "${n}"`);return Math.ceil(t*r)},normalizeTime:function(e){let[t,n]=e.split(":");R(parseInt(t,10))||(t="0"),R(parseInt(n,10))||(n="0");let r=at(L(t),0,23),a=at(L(n),0,59);return`${Ie(r)}:${Ie(a)}`},absoluteDays:ke},t.Rb={safeParse:function(e){try{return JSON.parse(e)}catch{return null}},deleteDeep:function(e,t){const n=Y(t,"."),r=ee(t,".");if(!n||!r)return;const a=d(e,n);a&&delete a[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:G,deepMerge2:function(e,t){const n={};return G(n,e),G(n,t),n},deepMerge3:function(e,t,n){const r={};return G(r,e),G(r,t),G(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:Xe,sortArray:Je,sortAny:Ze,deepEquals:Qe,deepEqualsEvery:function(...e){for(let t=1;t<e.length;t++)if(!Qe(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:q,zipSum:function(e){return q(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]||E(t[1])&&O(t[1]))&&delete e[t[0]];return e},flatten:function(e,t=!1,n){return ot({},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)?p(n,r,a.map((t=>e(t)))):p(n,r,a);return n},match:function(e,t,n){return t[e]?t[e]:n},sort:lt,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=d(n,r);null!=a&&p(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:ft,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){ft(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:Ye,mapRandomKey:function(e,t){const n=Ye(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(",","&comma;")})`))).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("&comma;",","),JSON.parse(e)},toQueryString:Fe,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)=>$(e[t])-$(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=>te(e,t))).map((e=>e[0]&&e[1]?[ie(e[0]),ie(e[1])]:null)).filter((e=>e)))},errorMatches:function(e,t){if(!e)return!1;const n=e.message;return"string"==typeof n&&n.includes(t)}},t.Or={isFunction:B,isObject:g,isStrictlyObject:b,isEmptyArray:y,isEmptyObject:function(e){return b(e)&&0===Object.keys(e).length},isUndefined:w,isString:E,isNumber:R,isBoolean:T,isDate:v,isBlank:O,isId:S,isIntegerString:x,isHexString:A,isUrl:z,isBigint:j,isNullable:function(e,t){return null==t||e(t)},asString:P,asHexString:function(e,t){if(!A(e))throw new TypeError(`Expected hex string${t?.name?` for ${t.name}`:""}, got: `+e);if(t?.strictPrefix&&!e.startsWith("0x")&&!e.startsWith("0X"))throw new TypeError(`Expected hex string with 0x prefix${t?.name?` for ${t.name}`:""}, got: `+e);const n=e.replace(/^0x/i,"");if(n.length%2!=0&&!t?.uneven)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`0x${n}`},asSafeString:function(e,t){if(!P(e,t).split("").every((e=>"_"===e||le(e))))throw new TypeError(`Expected safe string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asIntegerString:function(e,t){if(!x(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:$,asFunction:function(e,t){if(!B(e))throw new TypeError(`Expected function${t?.name?` for ${t.name}`:""}, got: `+e);return e},asInteger:L,asBoolean:function(e,t){if("true"===e)return!0;if("false"===e)return!1;if(!T(e))throw new TypeError(`Expected boolean${t?.name?` for ${t.name}`:""}, got: `+e);return e},asDate:function(e,t){if(!v(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(!E(e))throw new TypeError(`Expected string${t?.name?` for ${t.name}`:""}, got: `+e);return e},asId:function(e,t){if(S(e))return e;const n=parseInt(e,10);if(!S(n))throw new TypeError(`Expected id${t?.name?` for ${t.name}`:""}, got: `+e);return n},asTime:function(e,t){if(!E(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(!R(r)||!R(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:U,asNullableObject:function(e,t){return null===e?null:U(e,t)},asStringMap:function(e,t){const n=U(e,t);for(const r of Object.keys(n))if(!E(n[r]))throw new TypeError(`Expected string map${t?.name?` for ${t.name}`:""}, got: `+e);return n},asNumericDictionary:function(e,t){const n=U(e),r=Object.keys(n),a=Object.values(n);if(!r.every(E)||!a.every(R))throw new TypeError(`Expected numeric dictionary${t?.name?` for ${t.name}`:""}, got: `+e);return n},asUrl:function(e,t){if(!z(e))throw new TypeError(`Expected url${t?.name?` for ${t.name}`:""}, got: `+e);return e},asBigint:M,asEmptiable:function(e,t){return""===t?void 0:e(t)},asNullable:function(e,t){return null==t?null:e(t)},asOptional:function(e,t){return null==t?void 0:e(t)},enforceObjectShape:_,enforceArrayShape:function(e,t){return e.every((e=>_(e,t)))},isPng:bt,isJpg:yt,isWebp:wt,isImage:function(e){return bt(e)||yt(e)||wt(e)}},t.DH={tokenizeByCount:function(e,t){return ut(e,Math.ceil(e.length/t))},tokenizeByLength:ut,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=ne(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+=I[Math.floor(16*t())];return n},randomLetter:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=C[Math.floor(26*t())];return n},randomAlphanumeric:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=V[Math.floor(62*t())];return n},randomRichAscii:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=N[Math.floor(89*t())];return n},randomUnicode:function(e,t=Math.random){let n="";for(let r=0;r<e;r++)n+=F[Math.floor(t()*F.length)];return n},includesAny:function(e,t){return t.some((t=>e.includes(t)))},slugify:K,normalForm:function(e){return K(e).replaceAll("-","")},enumify:function(e){return K(e).replace(/-/g,"_").toUpperCase()},escapeHtml:function(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},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(J))t=t.replaceAll(n,r);return t},after:Q,afterLast:ee,before:Z,beforeLast:Y,betweenWide:function(e,t,n){const r=Y(e,n);return r?Q(r,t):null},betweenNarrow:function(e,t,n){const r=Q(e,t);return r?Z(r,n):null},getPreLine:function(e){return e.replace(/ +/g," ").replace(/^ /gm,"")},containsWord:De,containsWords:function(e,t,n){return"any"===n?t.some((t=>De(e,t))):t.every((t=>De(e,t)))},joinUrl:Ke,getFuzzyMatchScore:X,sortByFuzzyScore:function(e,t){return e.filter((e=>X(e,t))).sort(((e,n)=>X(n,t)-X(e,t)))},splitOnce:te,splitAll:ne,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:ie,capitalize:oe,decapitalize:se,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:re,getBasename:ae,normalizeEmail:function(e){let[t,n]=e.split("@");t=ie(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=ie(n.toLowerCase()).replaceAll(" ",""),`${r}@${n}`},normalizeFilename:function(e){const t=ae(e),n=re(e);return n?`${t}.${n}`:t},parseFilename:function(e){const t=ae(e),n=re(e);return{basename:t,extension:n,filename:n?`${t}.${n}`:t}},camelToTitle:function(e){return oe(e.replace(/([A-Z])/g," $1"))},slugToTitle:function(e){return e.split("-").map(oe).join(" ")},slugToCamel:function(e){return se(e.split("-").map(oe).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:Ee,extractAllBlocks:function(e,t){const n=[];let r=t.wordBoundary?ge(e,[`${t.opening} `,`${t.opening}\n`],t.start||0):e.indexOf(t.opening,t.start||0);for(;;){if(-1===r)return n;const a=Ee(e,{...t,start:r});if(!a)return n;n.push(a),r=t.wordBoundary?ge(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:ge,lastIndexOfBefore:we,parseHtmlAttributes:function(e){const t={},n=e.match(/([a-z\-]+)="([^"]+)"/g);if(n)for(const r of n){const[e,n]=te(r,"=");t[e]=n.slice(1,n.length-1)}return t},readNextWord:Ce,readWordsAfterAll:function(e,t,n=[]){const r=me(e,t),a=[];for(const i of r)a.push(Ce(e,i+t.length,n));return a},resolveVariables:function(e,t,n="$",r=":"){for(const a in t)e=Ve(e,a,t[a],n,r);return e=Ne(e)},resolveVariableWithDefaultSyntax:Ve,resolveRemainingVariablesWithDefaults:Ne,isLetter:ce,isDigit:ue,isLetterOrDigit:le,isValidObjectPathCharacter:function(e){return le(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:de,allIndexOf:me,lineMatches:pe,linesMatchInOrder:function(e,t,n=!0){let r=0;for(const a of t){let t=!1;for(;!t&&r<e.length;)pe(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(E(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=we(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 Ke([e,t])+Fe(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=ye(e,n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const a=be(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=ge(e,["http://","https://"],n);if(-1===r){t.push({string:e.slice(n),symbol:null});break}const a=ge(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:Se,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&&(H(o,Se(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&&(H(o,Se(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:xe,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}=xe(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:Ae,findCommonDirectory:function(e){const t=Ae(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=We.get(e);if(a&&a.validUntil>r)return a.value;const i=await n(),o=r+t;return We.set(e,{value:i,validUntil:o}),i},delete:function(e){We.delete(e)},deleteExpired:function(){const e=Date.now();for(const[t,n]of We.entries())n.validUntil<=e&&We.delete(t)},size:function(){return We.size}},t.Mi={addPoint:Qt,subtractPoint:function(e,t){return{x:e.x-t.x,y:e.y-t.y}},multiplyPoint:Yt,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:en,filterCoordinates:nn,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=cn(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=nn(e,((t,n)=>0===e[t][n]&&0!==e[t][n+1]),"row-first").map((e=>({...e,dx:1,dy:0}))),r=nn(e,((t,n)=>0===e[t][n]&&0!==e[t][n-1]),"row-first").map((e=>({...e,dx:1,dy:0}))),a=nn(e,((t,n)=>0===e[t][n]&&0!==e[t-1]?.[n]),"column-first").map((e=>({...e,dx:0,dy:1}))),i=nn(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++)),[...ht([...a,...i],((e,t)=>e.x===t.x&&e.y-1===t.y)),...ht([...r,...n],((e,t)=>e.y===t.y&&e.x-1===t.x))].map((e=>({start:e[0],end:h(e)}))).map((e=>({start:Yt(e.start,t),end:Yt(Qt(e.end,{x:e.start.dx,y:e.start.dy}),t)})))},raycast:hn,raycastCircle:function(e,t,n){const r=un(e,n),a=[];for(const i of r){const n=hn(e,t,i-.001),r=hn(e,t,i+.001);n&&a.push(n),r&&a.push(r)}return a},getLineIntersectionPoint:ln}},878(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(a=r))})),t.splice(a,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(n){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(945)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},945(e,t,n){e.exports=function(e){function t(e){let n,a,i,o=null;function s(...e){if(!s.enabled)return;const r=s,a=Number(new Date),i=a-(n||a);r.diff=i,r.prev=n,r.curr=a,n=a,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,a)=>{if("%%"===n)return"%";o++;const i=t.formatters[a];if("function"==typeof i){const t=e[o];n=i.call(r,t),e.splice(o,1),o--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(a!==t.namespaces&&(a=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function a(e,t){let n=0,r=0,a=-1,i=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(a=r,i=n,r++):(n++,r++);else{if(-1===a)return!1;r=a+1,i++,n=i}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const r of n)"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(const n of t.skips)if(a(e,n))return!1;for(const n of t.names)if(a(e,n))return!0;return!1},t.humanize=n(192),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},666(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},192(e){var t=1e3,n=60*t,r=60*n,a=24*r,i=7*a,o=365.25*a;function s(e,t,n,r){var a=t>=1.5*n;return Math.round(e/n)+" "+r+(a?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*a;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var i=Math.abs(e);if(i>=a)return s(e,i,a,"day");if(i>=r)return s(e,i,r,"hour");if(i>=n)return s(e,i,n,"minute");if(i>=t)return s(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=a)return Math.round(e/a)+"d";if(i>=r)return Math.round(e/r)+"h";if(i>=n)return Math.round(e/n)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},963(e,t,n){"use strict";const r=n(527),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=n(197),{safeRe:o,t:s}=n(423),c=n(676),{compareIdentifiers:u}=n(956);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)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}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){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?o[s.PRERELEASELOOSE]:o[s.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}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"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;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(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},359(e,t,n){"use strict";const r=n(963);e.exports=(e,t)=>new r(e,t).major},197(e){"use strict";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}},527(e){"use strict";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},956(e){"use strict";const t=/^[0-9]+$/,n=(e,n)=>{if("number"==typeof e&&"number"==typeof n)return e===n?0:e<n?-1:1;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){"use strict";const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},423(e,t,n){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=n(197),o=n(527),s=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],h=t.t={};let f=0;const d="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[d,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),h[e]=a,u[a]=t,l[a]=r,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-]${d}*`),m("MAINVERSION",`(${u[h.NUMERICIDENTIFIER]})\\.(${u[h.NUMERICIDENTIFIER]})\\.(${u[h.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[h.NUMERICIDENTIFIERLOOSE]})\\.(${u[h.NUMERICIDENTIFIERLOOSE]})\\.(${u[h.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[h.NONNUMERICIDENTIFIER]}|${u[h.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[h.NONNUMERICIDENTIFIER]}|${u[h.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[h.PRERELEASEIDENTIFIER]}(?:\\.${u[h.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[h.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${d}+`),m("BUILD",`(?:\\+(${u[h.BUILDIDENTIFIER]}(?:\\.${u[h.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[h.MAINVERSION]}${u[h.PRERELEASE]}?${u[h.BUILD]}?`),m("FULL",`^${u[h.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[h.MAINVERSIONLOOSE]}${u[h.PRERELEASELOOSE]}?${u[h.BUILD]}?`),m("LOOSE",`^${u[h.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[h.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[h.XRANGEIDENTIFIER]})(?:\\.(${u[h.XRANGEIDENTIFIER]})(?:\\.(${u[h.XRANGEIDENTIFIER]})(?:${u[h.PRERELEASE]})?${u[h.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[h.XRANGEIDENTIFIERLOOSE]})(?:${u[h.PRERELEASELOOSE]})?${u[h.BUILD]}?)?)?`),m("XRANGE",`^${u[h.GTLT]}\\s*${u[h.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[h.GTLT]}\\s*${u[h.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${u[h.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[h.COERCEPLAIN]+`(?:${u[h.PRERELEASE]})?`+`(?:${u[h.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[h.COERCE],!0),m("COERCERTLFULL",u[h.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[h.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[h.LONETILDE]}${u[h.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[h.LONETILDE]}${u[h.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[h.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[h.LONECARET]}${u[h.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[h.LONECARET]}${u[h.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[h.GTLT]}\\s*(${u[h.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[h.GTLT]}\\s*(${u[h.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[h.GTLT]}\\s*(${u[h.LOOSEPLAIN]}|${u[h.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[h.XRANGEPLAIN]})\\s+-\\s+(${u[h.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[h.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},497(){},61(){},320(){}},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:()=>Ha,BeeArgumentError:()=>_,BeeDev:()=>Wa,BeeError:()=>M,BeeModes:()=>W,BeeResponseError:()=>G,Bytes:()=>T,CHUNK_SIZE:()=>Z,DAI:()=>ue,Duration:()=>oe,EthAddress:()=>V,FeedIndex:()=>j,Identifier:()=>N,MantarayNode:()=>ka,MerkleTree:()=>p,NULL_ADDRESS:()=>Qa,NULL_IDENTIFIER:()=>Ya,NULL_OWNER:()=>ei,NULL_STAMP:()=>Ja,NULL_TOPIC:()=>Za,PSS_TARGET_HEX_LENGTH_MAX:()=>Q,PeerAddress:()=>k,PrivateKey:()=>D,PublicKey:()=>C,RedundancyLevel:()=>re,RedundancyStrategy:()=>ae,Reference:()=>F,SECTION_SIZE:()=>X,STAMPS_DEPTH_MAX:()=>ee,STAMPS_DEPTH_MIN:()=>Y,SUPPORTED_BEE_VERSION:()=>ma,SUPPORTED_BEE_VERSION_EXACT:()=>pa,SWARM_GATEWAY_URL:()=>Xa,Signature:()=>L,Size:()=>se,Span:()=>P,Stamper:()=>Ka,TAGS_LIMIT_MAX:()=>ne,TAGS_LIMIT_MIN:()=>te,Topic:()=>U,TransactionId:()=>I,Utils:()=>t,capacityBreakpoints:()=>ie,toBeeMode:()=>K});var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>qt,hasStandardBrowserEnv:()=>Wt,hasStandardBrowserWebWorkerEnv:()=>Kt,navigator:()=>Ht,origin:()=>Xt});var t={};n.r(t),n.d(t,{approximateOverheadForRedundancyLevel:()=>li,convertEnvelopeToMarshaledStamp:()=>Ve,getAmountForDuration:()=>De,getCollectionSize:()=>qr,getDepthForSize:()=>Ce,getFolderSize:()=>ja,getRedundancyStat:()=>gi,getRedundancyStats:()=>mi,getStampCost:()=>xe,getStampDuration:()=>Ae,getStampEffectiveBytes:()=>Oe,getStampEffectiveBytesBreakpoints:()=>Se,getStampTheoreticalBytes:()=>Te,getStampUsage:()=>Re,makeCollectionFromFileList:()=>Gr,makeMaxTarget:()=>ti,mapPostageBatch:()=>Ne,unmapPostageBatch:()=>Fe});var a=n(20);a.DO,a.mW;const i=a.yI,o=(a.l2,a.AO),s=a.LQ,c=a.FQ,u=a.Rb,l=(a.Pagination,a.HC,a.o8,a.DH),h=a.iQ,f=a.Or,d=a.Xx,p=(a.Mi,a.Dj,a.AA,a.vU),m=a.ie,g=(a.dF,a.f7,a.O3),b=a.pp;a.$i,a.g$,a.ij,a.Ox,a.c_;var y=n(878),w=n.n(y);const B=w()("bee-js:bytes"),E=new TextDecoder,R=new TextEncoder;class T{constructor(e,t){if(!e)throw Error(`Bytes#constructor: constructor parameter is falsy: ${e}`);if(e instanceof T)this.bytes=e.bytes;else if("string"==typeof e)this.bytes=i.hexToUint8Array(f.asHexString(e,{name:"Bytes#constructor(bytes)"}));else if(e instanceof ArrayBuffer)this.bytes=new Uint8Array(e);else if(e instanceof Uint8Array)this.bytes=e;else{const t=e,n=u.getDeep(t,"toHex");if(!f.isFunction(n))throw B("bytes",e),new Error("Bytes#constructor: unsupported type: "+typeof e);{const e=n.call(t);this.bytes=i.hexToUint8Array(f.asHexString(e,{name:"Bytes#constructor(bytes)"}))}}if(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 T(i.keccak256(new T(e).toUint8Array()))}static fromUtf8(e){return new T(R.encode(e))}static fromSlice(e,t,n){return new T(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 i.uint8ArrayToHex(this.bytes)}toBase64(){return i.uint8ArrayToBase64(this.bytes)}toBase32(){return i.uint8ArrayToBase32(this.bytes)}toString(){return this.toHex()}toUtf8(){return E.decode(this.bytes)}toJSON(){return JSON.parse(this.toUtf8())}equals(e){return this.toHex()===new T(e).toHex()}represent(){return this.toHex()}}function v(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 O=250,S=251,x={[O]:"manifest",[S]:"feed"};const A=new TextEncoder;class D extends T{static LENGTH=32;constructor(e){super(e,32)}publicKey(){const[e,t]=s.privateKeyToPublicKey(i.uint256ToNumber(this.bytes,"BE"));return new C(i.concatBytes(i.numberToUint256(e,"BE"),i.numberToUint256(t,"BE")))}sign(e){const t=i.concatBytes(A.encode("Ethereum Signed Message:\n32"),i.keccak256(e instanceof Uint8Array?e:A.encode(e))),[n,r,a]=s.signMessage(t,i.uint256ToNumber(this.bytes,"BE"));return new L(i.concatBytes(i.numberToUint256(n,"BE"),i.numberToUint256(r,"BE"),new Uint8Array([Number(a)])))}}class C extends T{static LENGTH=64;constructor(e){const t=new T(e);if(33===t.length){const[e,n]=s.publicKeyFromCompressed(t.toUint8Array());super(i.concatBytes(i.numberToUint256(e,"BE"),i.numberToUint256(n,"BE")),64)}else super(e,64)}address(){const e=i.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=i.uint256ToNumber(this.bytes.slice(32,64),"BE");return new V(s.publicKeyToAddress([e,t]))}toCompressedUint8Array(){const e=i.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=i.uint256ToNumber(this.bytes.slice(32,64),"BE");return s.compressPublicKey([e,t])}toCompressedHex(){return i.uint8ArrayToHex(this.toCompressedUint8Array())}}class V extends T{static LENGTH=20;constructor(e){super(e,20)}toChecksum(){return s.checksumEncode(this.bytes)}}class N extends T{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new N(i.keccak256(A.encode(e)))}}class F extends T{static LENGTH=32;constructor(e){if("string"==typeof e&&e.startsWith("bah5")){const t=function(e){const t=i.base32ToUint8Array(e.toUpperCase().slice(1)),n=t[1];if(!x[n])throw new Error("Unknown codec");const r=new F(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 F(e);const n=new Uint8Array([1]),r=new Uint8Array(["feed"===t?251:250]),a=new Uint8Array([1]),o=new Uint8Array([27]),s=new Uint8Array([32]);return`b${i.uint8ArrayToBase32(i.concatBytes(n,r,a,o,s)).replace(/\=+$/,"")}${e.toBase32().replace(/\=+$/,"")}`.toLowerCase()}(this.bytes,e)}static isValid(e){try{return new F(e),!0}catch{return!1}}}class I extends T{static LENGTH=32;constructor(e){super(e,32)}}class P extends T{static LENGTH=8;constructor(e){super(e,8)}static fromBigInt(e){return new P(i.numberToUint64(e,"LE"))}toBigInt(){return i.uint64ToNumber(this.bytes,"LE")}static fromSlice(e,t){return new P(e.slice(t,t+P.LENGTH))}}class k extends T{static LENGTH=32;constructor(e){super(e,32)}}class $ extends T{static LENGTH=32;constructor(e){super(e,32)}}class L extends T{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=i.uint256ToNumber(this.bytes.slice(0,32),"BE"),n=i.uint256ToNumber(this.bytes.slice(32,64),"BE"),r=BigInt(this.bytes[64]),[a,o]=s.recoverPublicKey(i.concatBytes(A.encode("Ethereum Signed Message:\n32"),i.keccak256(e instanceof Uint8Array?e:A.encode(e))),t,n,r);return new C(i.concatBytes(i.numberToUint256(a,"BE"),i.numberToUint256(o,"BE")))}isValid(e,t){return this.recoverPublicKey(e).address().equals(t)}}class U extends T{static LENGTH=32;constructor(e){super(e,32)}static fromString(e){return new U(i.keccak256(A.encode(e)))}}const z=new Uint8Array(8).fill(255,0,8);class j extends T{static LENGTH=8;static MINUS_ONE=new j(z);constructor(e){super(e,8)}static fromBigInt(e){return new j(i.numberToUint64(e,"BE"))}toBigInt(){return i.uint64ToNumber(this.bytes,"BE")}next(){return i.equals(this.bytes,z)?j.fromBigInt(0n):j.fromBigInt(this.toBigInt()+1n)}}class M extends Error{constructor(e){super(e)}}class _ extends M{constructor(e,t){super(e),this.value=t}}class G extends M{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 q=4096;function H(e){const t=e.slice(0,P.LENGTH),n=function(e){if(e.length>q)throw new _(`payload size ${e.length} exceeds maximum chunk payload size 4096`,e);const t=new Uint8Array(q);return t.set(e),i.log2Reduce(i.partition(t,32),((e,t)=>i.keccak256(i.concatBytes(e,t))))}(e.slice(P.LENGTH)),r=i.keccak256(i.concatBytes(t,n));return new F(r)}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;let re=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}({}),ae=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 ie={ENCRYPTION_OFF:{[re.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%"}],[re.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%"}],[re.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%"}],[re.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%"}],[re.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:{[re.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%"}],[re.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%"}],[re.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%"}],[re.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%"}],[re.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 oe{static ZERO=new oe(0);constructor(e){this.seconds=Math.ceil(e),e<0&&(this.seconds=0)}static fromMilliseconds(e){return new oe(e/1e3)}static fromSeconds(e){return new oe(e)}static fromHours(e){return new oe(60*e*60)}static fromDays(e){return new oe(24*e*60*60)}static fromWeeks(e){return new oe(7*e*24*60*60)}static fromYears(e){return new oe(365*e*24*60*60)}static fromEndDate(e,t){return new oe((e.getTime()-(t??new Date).getTime())/1e3)}static parseFromString(e){return oe.fromSeconds(o.make(e)/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 o.secondsToHumanTime(this.seconds)}isZero(){return 0===this.seconds}}class se{constructor(e){if(this.bytes=Math.ceil(e),e<0)throw Error("Size must be at least 0")}static fromBytes(e){return new se(e)}static fromKilobytes(e){return new se(1e3*e)}static fromMegabytes(e){return new se(1e3*e*1e3)}static fromGigabytes(e){return new se(1e3*e*1e3*1e3)}static parseFromString(e){return se.fromBytes(c.makeStorage(e,1e3))}toBytes(){return this.bytes}toGigabytes(){return this.bytes/1e3/1e3/1e3}toFormattedString(){return c.convertBytes(this.bytes,1e3)}represent(){return this.toFormattedString()}}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))}static fromFloat(e){return new ce(m.fromFloat(e,ce.DIGITS))}toPLURString(){return this.state.toString()}toPLURBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toFloat(){return this.state.toFloat()}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))}static fromFloat(e){return new ue(m.fromFloat(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)}toFloat(){return this.state.toFloat()}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(320);function he(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 fe(e){return void 0!==le.Readable&&e instanceof le.Readable}function de(e,t){return"bigint"==typeof e&&(e=e.toString()),f.asIntegerString(e,t)}function pe(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 C(e)),t.actPublisher),actHistoryAddress:f.asOptional((e=>new F(e)),t.actHistoryAddress),actTimestamp:f.asOptional((e=>f.asNumber(e,{name:"actTimestamp"})),t.actTimestamp)}}function me(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 F(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=me(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=>de(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=>de(e,{name:"gasLimit",min:0n})),n.gasLimit),gasPrice:f.asOptional((e=>de(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 Ee=.9;function Re(e,t,n){return e/Math.pow(2,t-n)}function Te(e){return 4096*2**e}const ve=[[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=ie[t?"ENCRYPTION_ON":"ENCRYPTION_OFF"][n].find((t=>t.batchDepth===e));if(r?.effectiveVolume)return v(r.effectiveVolume)}else{const t=ve.find((([t,n])=>{if(e===t)return n}));if(t)return 1e3*t[1]*1e3*1e3}return Math.ceil(Te(e)*Ee)}function Se(e,t){const n=new Map;for(let r=17;r<35;r++)n.set(r,Oe(r,e,t));return n}function xe(e,t){return ce.fromPLUR(2n**BigInt(e)*BigInt(t))}function Ae(e,t,n){const r=BigInt(de(e));return oe.fromSeconds(Number(r*BigInt(n)/BigInt(t)))}function De(e,t,n){return BigInt(e.toSeconds())/BigInt(n)*BigInt(t)+1n}function Ce(e,t,n){if(void 0!==t&&void 0!==n){const r=ie[t?"ENCRYPTION_ON":"ENCRYPTION_OFF"][n].find((t=>e.toBytes()<=v(t.effectiveVolume)));if(r?.effectiveVolume)return r.batchDepth}else for(const[r,a]of ve)if(e.toBytes()<=1e3*a*1e3*1e3)return r;return 35}function Ve(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 T(i.concatBytes(t,r,n,e))}(e.signature,e.batchId.toUint8Array(),e.timestamp,e.index)}function Ne(e,t,n){const r=Re(e.utilization,e.depth,e.bucketDepth),a=function(e){return Number.isInteger(e)?e<1?1:e>3155695200?3155695200:e:1}(e.batchTTL),i=oe.fromSeconds(a),o=Oe(e.depth,t,n);return{batchID:new $(e.batchID),utilization:e.utilization,usable:e.usable,label:e.label,depth:e.depth,amount:de(e.amount),bucketDepth:e.bucketDepth,blockNumber:e.blockNumber,immutableFlag:e.immutableFlag,usage:r,usageText:`${Math.round(100*r)}%`,size:se.fromBytes(o),remainingSize:se.fromBytes(Math.ceil(o*(1-r))),theoreticalSize:se.fromBytes(Te(e.depth)),duration:i,calculateSize(t,n){const r=Oe(e.depth,t,n);return se.fromBytes(r)},calculateRemainingSize(t,n){const r=Oe(e.depth,t,n);return se.fromBytes(Math.ceil(r*(1-this.usage)))}}}function Fe(e){return{batchID:e.batchID.toHex(),utilization:e.utilization,usable:e.usable,label:e.label,depth:e.depth,amount:e.amount,bucketDepth:e.bucketDepth,blockNumber:e.blockNumber,immutableFlag:e.immutableFlag,batchTTL:e.duration.toSeconds()}}function Ie(e){return{name:function(e){if(!e)throw new M("missing content-disposition header");const t=e.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);if(t&&t.length>0)return t[1];throw new M("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 Pe(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"]=Ve(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 C(r.actPublisher).toCompressedHex()),r.actHistoryAddress&&(n["swarm-act-history-address"]=new F(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}function ke(e,t){return function(){return e.apply(t,arguments)}}const{toString:$e}=Object.prototype,{getPrototypeOf:Le}=Object,{iterator:Ue,toStringTag:ze}=Symbol,je=(Me=Object.create(null),e=>{const t=$e.call(e);return Me[t]||(Me[t]=t.slice(8,-1).toLowerCase())});var Me;const _e=e=>(e=e.toLowerCase(),t=>je(t)===e),Ge=e=>t=>typeof t===e,{isArray:qe}=Array,He=Ge("undefined");function We(e){return null!==e&&!He(e)&&null!==e.constructor&&!He(e.constructor)&&Je(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ke=_e("ArrayBuffer");const Xe=Ge("string"),Je=Ge("function"),Ze=Ge("number"),Qe=e=>null!==e&&"object"==typeof e,Ye=e=>{if("object"!==je(e))return!1;const t=Le(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ze in e||Ue in e)},et=_e("Date"),tt=_e("File"),nt=_e("Blob"),rt=_e("FileList");const at="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},it=void 0!==at.FormData?at.FormData:void 0,ot=_e("URLSearchParams"),[st,ct,ut,lt]=["ReadableStream","Request","Response","Headers"].map(_e);function ht(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),qe(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(We(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let o;for(r=0;r<i;r++)o=a[r],t.call(null,e[o],o,e)}}function ft(e,t){if(We(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,a=n.length;for(;a-- >0;)if(r=n[a],t===r.toLowerCase())return r;return null}const dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,pt=e=>!He(e)&&e!==dt;const mt=(gt="undefined"!=typeof Uint8Array&&Le(Uint8Array),e=>gt&&e instanceof gt);var gt;const bt=_e("HTMLFormElement"),yt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),wt=_e("RegExp"),Bt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ht(n,((n,a)=>{let i;!1!==(i=t(n,a,e))&&(r[a]=i||n)})),Object.defineProperties(e,r)};const Et=_e("AsyncFunction"),Rt=(Tt="function"==typeof setImmediate,vt=Je(dt.postMessage),Tt?setImmediate:vt?(Ot=`axios@${Math.random()}`,St=[],dt.addEventListener("message",(({source:e,data:t})=>{e===dt&&t===Ot&&St.length&&St.shift()()}),!1),e=>{St.push(e),dt.postMessage(Ot,"*")}):e=>setTimeout(e));var Tt,vt,Ot,St;const xt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(dt):"undefined"!=typeof process&&process.nextTick||Rt,At={isArray:qe,isArrayBuffer:Ke,isBuffer:We,isFormData:e=>{if(!e)return!1;if(it&&e instanceof it)return!0;const t=Le(e);if(!t||t===Object.prototype)return!1;if(!Je(e.append))return!1;const n=je(e);return"formdata"===n||"object"===n&&Je(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Ke(e.buffer),t},isString:Xe,isNumber:Ze,isBoolean:e=>!0===e||!1===e,isObject:Qe,isPlainObject:Ye,isEmptyObject:e=>{if(!Qe(e)||We(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:st,isRequest:ct,isResponse:ut,isHeaders:lt,isUndefined:He,isDate:et,isFile:tt,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:nt,isRegExp:wt,isFunction:Je,isStream:e=>Qe(e)&&Je(e.pipe),isURLSearchParams:ot,isTypedArray:mt,isFileList:rt,forEach:ht,merge:function e(){const{caseless:t,skipUndefined:n}=pt(this)&&this||{},r={},a=(a,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const o=t&&ft(r,i)||i;Ye(r[o])&&Ye(a)?r[o]=e(r[o],a):Ye(a)?r[o]=e({},a):qe(a)?r[o]=a.slice():n&&He(a)||(r[o]=a)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&ht(arguments[i],a);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(ht(t,((t,r)=>{n&&Je(t)?Object.defineProperty(e,r,{value:ke(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let a,i,o;const s={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)o=a[i],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&Le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:je,kindOfTest:_e,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(qe(e))return e;let t=e.length;if(!Ze(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ue]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:bt,hasOwnProperty:yt,hasOwnProp:yt,reduceDescriptors:Bt,freezeMethods:e=>{Bt(e,((t,n)=>{if(Je(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Je(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return qe(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ft,global:dt,isContextDefined:pt,isSpecCompliantForm:function(e){return!!(e&&Je(e.append)&&"FormData"===e[ze]&&e[Ue])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Qe(e)){if(t.indexOf(e)>=0)return;if(We(e))return e;if(!("toJSON"in e)){t[r]=e;const a=qe(e)?[]:{};return ht(e,((e,t)=>{const i=n(e,r+1);!He(i)&&(a[t]=i)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:Et,isThenable:e=>e&&(Qe(e)||Je(e))&&Je(e.then)&&Je(e.catch),setImmediate:Rt,asap:xt,isIterable:e=>null!=e&&Je(e[Ue])};class Dt extends Error{static from(e,t,n,r,a,i){const o=new Dt(e.message,t||e.code,n,r,a);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),i&&Object.assign(o,i),o}constructor(e,t,n,r,a){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status)}toJSON(){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:At.toJSONObject(this.config),code:this.code,status:this.status}}}Dt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Dt.ERR_BAD_OPTION="ERR_BAD_OPTION",Dt.ECONNABORTED="ECONNABORTED",Dt.ETIMEDOUT="ETIMEDOUT",Dt.ERR_NETWORK="ERR_NETWORK",Dt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Dt.ERR_DEPRECATED="ERR_DEPRECATED",Dt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Dt.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Dt.ERR_CANCELED="ERR_CANCELED",Dt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Dt.ERR_INVALID_URL="ERR_INVALID_URL",Dt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ct=Dt;function Vt(e){return At.isPlainObject(e)||At.isArray(e)}function Nt(e){return At.endsWith(e,"[]")?e.slice(0,-2):e}function Ft(e,t,n){return e?e.concat(t).map((function(e,t){return e=Nt(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const It=At.toFlatObject(At,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Pt=function(e,t,n){if(!At.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=At.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!At.isUndefined(t[e])}))).metaTokens,a=n.visitor||h,i=n.dots,o=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,u=s&&At.isSpecCompliantForm(t);if(!At.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(At.isDate(e))return e.toISOString();if(At.isBoolean(e))return e.toString();if(!u&&At.isBlob(e))throw new Ct("Blob is not supported. Use a Buffer instead.");return At.isArrayBuffer(e)||At.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function h(e,n,a){let s=e;if(At.isReactNative(t)&&At.isReactNativeBlob(e))return t.append(Ft(a,n,i),l(e)),!1;if(e&&!a&&"object"==typeof e)if(At.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(At.isArray(e)&&function(e){return At.isArray(e)&&!e.some(Vt)}(e)||(At.isFileList(e)||At.endsWith(n,"[]"))&&(s=At.toArray(e)))return n=Nt(n),s.forEach((function(e,r){!At.isUndefined(e)&&null!==e&&t.append(!0===o?Ft([n],r,i):null===o?n:n+"[]",l(e))})),!1;return!!Vt(e)||(t.append(Ft(a,n,i),l(e)),!1)}const f=[],d=Object.assign(It,{defaultVisitor:h,convertValue:l,isVisitable:Vt});if(!At.isObject(e))throw new TypeError("data must be an object");return function e(n,r,i=0){if(!At.isUndefined(n)){if(i>c)throw new Ct("Object is too deeply nested ("+i+" levels). Max depth: "+c,Ct.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),At.forEach(n,(function(n,o){!0===(!(At.isUndefined(n)||null===n)&&a.call(t,n,At.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o],i+1)})),f.pop()}}(e),t};function kt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function $t(e,t){this._pairs=[],e&&Pt(e,this,t)}const Lt=$t.prototype;Lt.append=function(e,t){this._pairs.push([e,t])},Lt.toString=function(e){const t=e?function(t){return e.call(this,t,kt)}:kt;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ut=$t;function zt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jt(e,t,n){if(!t)return e;const r=n&&n.encode||zt,a=At.isFunction(n)?{serialize:n}:n,i=a&&a.serialize;let o;if(o=i?i(t,a):At.isURLSearchParams(t)?t.toString():new Ut(t,a).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Mt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){At.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},_t={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Gt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ut,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qt="undefined"!=typeof window&&"undefined"!=typeof document,Ht="object"==typeof navigator&&navigator||void 0,Wt=qt&&(!Ht||["ReactNative","NativeScript","NS"].indexOf(Ht.product)<0),Kt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xt=qt&&window.location.href||"http://localhost",Jt={...e,...Gt};const Zt=function(e){function t(e,n,r,a){let i=e[a++];if("__proto__"===i)return!0;const o=Number.isFinite(+i),s=a>=e.length;if(i=!i&&At.isArray(r)?r.length:i,s)return At.hasOwnProp(r,i)?r[i]=At.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!o;r[i]&&At.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],a)&&At.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r<a;r++)i=n[r],t[i]=e[i];return t}(r[i])),!o}if(At.isFormData(e)&&At.isFunction(e.entries)){const n={};return At.forEachEntry(e,((e,r)=>{t(function(e){return At.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Qt=(e,t)=>null!=e&&At.hasOwnProp(e,t)?e[t]:void 0;const Yt={transitional:_t,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=At.isObject(e);a&&At.isHTMLForm(e)&&(e=new FormData(e));if(At.isFormData(e))return r?JSON.stringify(Zt(e)):e;if(At.isArrayBuffer(e)||At.isBuffer(e)||At.isStream(e)||At.isFile(e)||At.isBlob(e)||At.isReadableStream(e))return e;if(At.isArrayBufferView(e))return e.buffer;if(At.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(a){const t=Qt(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Pt(e,new Jt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Jt.isNode&&At.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=At.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Qt(this,"env"),r=n&&n.FormData;return Pt(i?{"files[]":e}:e,r&&new r,t)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(At.isString(e))try{return(t||JSON.parse)(e),At.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Qt(this,"transitional")||Yt.transitional,n=t&&t.forcedJSONParsing,r=Qt(this,"responseType"),a="json"===r;if(At.isResponse(e)||At.isReadableStream(e))return e;if(e&&At.isString(e)&&(n&&!r||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,Qt(this,"parseReviver"))}catch(i){if(n){if("SyntaxError"===i.name)throw Ct.from(i,Ct.ERR_BAD_RESPONSE,this,null,Qt(this,"response"));throw i}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Jt.classes.FormData,Blob:Jt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};At.forEach(["delete","get","head","post","put","patch"],(e=>{Yt.headers[e]={}}));const en=Yt,tn=At.toObjectSet(["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"]),nn=e=>{const t={};let n,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!n||t[n]&&tn[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t};(Object.getOwnPropertyDescriptor(nn,"name")||{}).writable||Object.defineProperty(nn,"name",{value:"default",configurable:!0});const rn=Symbol("internals"),an=/[^\x09\x20-\x7E\x80-\xFF]/g;function on(e){return e&&String(e).trim().toLowerCase()}function sn(e){return!1===e||null==e?e:At.isArray(e)?e.map(sn):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(an,""))}function cn(e,t,n,r,a){return At.isFunction(r)?r.call(this,t,n):(a&&(t=n),At.isString(t)?At.isString(r)?-1!==t.indexOf(r):At.isRegExp(r)?r.test(t):void 0:void 0)}class un{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=on(t);if(!a)throw new Error("header name must be a non-empty string");const i=At.findKey(r,a);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=sn(e))}const i=(e,t)=>At.forEach(e,((e,n)=>a(e,n,t)));if(At.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(At.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(nn(e),t);else if(At.isObject(e)&&At.isIterable(e)){let n,r,a={};for(const t of e){if(!At.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[r=t[0]]=(n=a[r])?At.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=on(e)){const n=At.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(At.isFunction(t))return t.call(this,e,n);if(At.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=on(e)){const n=At.findKey(this,e);return!(!n||void 0===this[n]||t&&!cn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=on(e)){const a=At.findKey(n,e);!a||t&&!cn(0,n[a],a,t)||(delete n[a],r=!0)}}return At.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!cn(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return At.forEach(this,((r,a)=>{const i=At.findKey(n,a);if(i)return t[i]=sn(r),void delete t[a];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();o!==a&&delete t[a],t[o]=sn(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return At.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&At.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[rn]=this[rn]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=on(e);t[r]||(!function(e,t){const n=At.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return At.isArray(e)?e.forEach(r):r(e),this}}un.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),At.reduceDescriptors(un.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),At.freezeMethods(un);const ln=un;function hn(e,t){const n=this||en,r=t||n,a=ln.from(r.headers);let i=r.data;return At.forEach(e,(function(e){i=e.call(n,i,a.normalize(),t?t.status:void 0)})),a.normalize(),i}function fn(e){return!(!e||!e.__CANCEL__)}const dn=class extends Ct{constructor(e,t,n){super(null==e?"canceled":e,Ct.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function pn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ct("Request failed with status code "+n.status,[Ct.ERR_BAD_REQUEST,Ct.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const mn=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,i=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[o];a||(a=c),n[i]=s,r[i]=c;let l=o,h=0;for(;l!==i;)h+=n[l++],l%=e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-a<t)return;const f=u&&c-u;return f?Math.round(1e3*h/f):void 0}};const gn=function(e,t){let n,r,a=0,i=1e3/t;const o=(t,i=Date.now())=>{a=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-a;s>=i?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),i-s)))},()=>n&&o(n)]},bn=(e,t,n=3)=>{let r=0;const a=mn(50,250);return gn((n=>{const i=n.loaded,o=n.lengthComputable?n.total:void 0,s=null!=o?Math.min(i,o):i,c=Math.max(0,s-r),u=a(c);r=Math.max(r,s);e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o?(o-s)/u:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},yn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wn=e=>(...t)=>At.asap((()=>e(...t))),Bn=Jt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Jt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Jt.origin),Jt.navigator&&/(msie|trident)/i.test(Jt.navigator.userAgent)):()=>!0,En=Jt.hasStandardBrowserEnv?{write(e,t,n,r,a,i,o){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];At.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),At.isString(r)&&s.push(`path=${r}`),At.isString(a)&&s.push(`domain=${a}`),!0===i&&s.push("secure"),At.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Rn(e,t,n){let r=!("string"==typeof(a=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a));var a;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Tn=e=>e instanceof ln?{...e}:e;function vn(e,t){t=t||{};const n={};function r(e,t,n,r){return At.isPlainObject(e)&&At.isPlainObject(t)?At.merge.call({caseless:r},e,t):At.isPlainObject(t)?At.merge({},t):At.isArray(t)?t.slice():t}function a(e,t,n,a){return At.isUndefined(t)?At.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function i(e,t){if(!At.isUndefined(t))return r(void 0,t)}function o(e,t){return At.isUndefined(t)?At.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,a,i){return At.hasOwnProp(t,i)?r(n,a):At.hasOwnProp(e,i)?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>a(Tn(e),Tn(t),0,!0)};return At.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=At.hasOwnProp(c,r)?c[r]:a,o=i(At.hasOwnProp(e,r)?e[r]:void 0,At.hasOwnProp(t,r)?t[r]:void 0,r);At.isUndefined(o)&&i!==s||(n[r]=o)})),n}const On=e=>{const t=vn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:s}=t;if(t.headers=o=ln.from(o),t.url=jt(Rn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),At.isFormData(n))if(Jt.hasStandardBrowserEnv||Jt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(At.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)}))}if(Jt.hasStandardBrowserEnv){At.isFunction(r)&&(r=r(t));if(!0===r||null==r&&Bn(t.url)){const e=a&&i&&En.read(i);e&&o.set(a,e)}}return t};(Object.getOwnPropertyDescriptor(On,"name")||{}).writable||Object.defineProperty(On,"name",{value:"default",configurable:!0});const Sn="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=On(e);let a=r.data;const i=ln.from(r.headers).normalize();let o,s,c,u,l,{responseType:h,onUploadProgress:f,onDownloadProgress:d}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=ln.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());pn((function(e){t(e),p()}),(function(e){n(e),p()}),{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ct("Request aborted",Ct.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",a=new Ct(r,Ct.ERR_NETWORK,e,m);a.event=t||null,n(a),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||_t;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ct(t,a.clarifyTimeoutError?Ct.ETIMEDOUT:Ct.ECONNABORTED,e,m)),m=null},void 0===a&&i.setContentType(null),"setRequestHeader"in m&&At.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),At.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),d&&([c,l]=bn(d,!0),m.addEventListener("progress",c)),f&&m.upload&&([s,u]=bn(f),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new dn(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Jt.protocols.indexOf(b)?n(new Ct("Unsupported protocol "+b+":",Ct.ERR_BAD_REQUEST,e)):m.send(a||null)}))},xn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const a=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ct?t:new dn(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,a(new Ct(`timeout of ${t}ms exceeded`,Ct.ETIMEDOUT))}),t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)})),e=null)};e.forEach((e=>e.addEventListener("abort",a)));const{signal:s}=r;return s.unsubscribe=()=>At.asap(o),s}},An=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,a=0;for(;a<n;)r=a+t,yield e.slice(a,r),a=r},Dn=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Cn=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of Dn(e))yield*An(n,t)}(e,t);let i,o=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=o+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw s(t),t}},cancel:e=>(s(e),a.return())},{highWaterMark:2})},{isFunction:Vn}=At,Nn=(({Request:e,Response:t})=>({Request:e,Response:t}))(At.global),{ReadableStream:Fn,TextEncoder:In}=At.global,Pn=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},kn=e=>{e=At.merge.call({skipUndefined:!0},Nn,e);const{fetch:t,Request:n,Response:r}=e,a=t?Vn(t):"function"==typeof fetch,i=Vn(n),o=Vn(r);if(!a)return!1;const s=a&&Vn(Fn),c=a&&("function"==typeof In?(u=new In,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Pn((()=>{let e=!1;const t=new n(Jt.origin,{body:new Fn,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),h=o&&s&&Pn((()=>At.isReadableStream(new r("").body))),f={stream:h&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ct(`Response type '${e}' is not supported`,Ct.ERR_NOT_SUPPORT,n)})}));const d=async(e,t)=>{const r=At.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(At.isBlob(e))return e.size;if(At.isSpecCompliantForm(e)){const t=new n(Jt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return At.isArrayBufferView(e)||At.isArrayBuffer(e)?e.byteLength:(At.isURLSearchParams(e)&&(e+=""),At.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:a,method:o,data:s,signal:c,cancelToken:u,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:B}=On(e),E=t||fetch;b=b?(b+"").toLowerCase():"text";let R=xn([c,u&&u.toAbortSignal()],p),T=null;const v=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let O;try{if(g&&l&&"get"!==o&&"head"!==o&&0!==(O=await d(y,s))){let e,t=new n(a,{method:"POST",body:s,duplex:"half"});if(At.isFormData(s)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=yn(O,bn(wn(g)));s=Cn(t.body,65536,e,n)}}At.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in n.prototype;if(At.isFormData(s)){const e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete("content-type")}const c={...B,signal:R,method:o.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:t?w:void 0};T=i&&new n(a,c);let u=await(i?E(T,B):E(a,c));const p=h&&("stream"===b||"response"===b);if(h&&(m||p&&v)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=At.toFiniteNumber(u.headers.get("content-length")),[n,a]=m&&yn(t,bn(wn(m),!0))||[];u=new r(Cn(u.body,65536,n,(()=>{a&&a(),v&&v()})),e)}b=b||"text";let S=await f[At.findKey(f,b)||"text"](u,e);return!p&&v&&v(),await new Promise(((t,n)=>{pn(t,n,{data:S,headers:ln.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:T})}))}catch(S){if(v&&v(),S&&"TypeError"===S.name&&/Load failed|fetch/i.test(S.message))throw Object.assign(new Ct("Network Error",Ct.ERR_NETWORK,e,T,S&&S.response),{cause:S.cause||S});throw Ct.from(S,S&&S.code,e,T,S&&S.response)}}},$n=new Map,Ln=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,i=[r,a,n];let o,s,c=i.length,u=$n;for(;c--;)o=i[c],s=u.get(o),void 0===s&&u.set(o,s=c?new Map:kn(t)),u=s;return s},Un=(Ln(),{http:null,xhr:Sn,fetch:{get:Ln}});At.forEach(Un,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const zn=e=>`- ${e}`,jn=e=>At.isFunction(e)||null===e||!1===e;const Mn={getAdapter:function(e,t){e=At.isArray(e)?e:[e];const{length:n}=e;let r,a;const i={};for(let o=0;o<n;o++){let n;if(r=e[o],a=r,!jn(r)&&(a=Un[(n=String(r)).toLowerCase()],void 0===a))throw new Ct(`Unknown adapter '${n}'`);if(a&&(At.isFunction(a)||(a=a.get(t))))break;i[n||"#"+o]=a}if(!a){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(zn).join("\n"):" "+zn(e[0]):"as no adapter specified";throw new Ct("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return a},adapters:Un};function _n(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new dn(null,e)}function Gn(e){_n(e),e.headers=ln.from(e.headers),e.data=hn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Mn.getAdapter(e.adapter||en.adapter,e)(e).then((function(t){return _n(e),t.data=hn.call(e,e.transformResponse,t),t.headers=ln.from(t.headers),t}),(function(t){return fn(t)||(_n(e),t&&t.response&&(t.response.data=hn.call(e,e.transformResponse,t.response),t.response.headers=ln.from(t.response.headers))),Promise.reject(t)}))}const qn="1.15.1",Hn={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Hn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Wn={};Hn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+qn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,i)=>{if(!1===e)throw new Ct(r(a," has been removed"+(t?" in "+t:"")),Ct.ERR_DEPRECATED);return t&&!Wn[a]&&(Wn[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,i)}},Hn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Kn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ct("options must be an object",Ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],o=t[i];if(o){const t=e[i],n=void 0===t||o(t,i,e);if(!0!==n)throw new Ct("option "+i+" must be "+n,Ct.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ct("Unknown option "+i,Ct.ERR_BAD_OPTION)}},validators:Hn},Xn=Kn.validators;class Jn{constructor(e){this.defaults=e||{},this.interceptors={request:new Mt,response:new Mt}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=(()=>{if(!e.stack)return"";const t=e.stack.indexOf("\n");return-1===t?"":e.stack.slice(t+1)})();try{if(n.stack){if(t){const e=t.indexOf("\n"),r=-1===e?-1:t.indexOf("\n",e+1),a=-1===r?"":t.slice(r+1);String(n.stack).endsWith(a)||(n.stack+="\n"+t)}}else n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=vn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Kn.assertOptions(n,{silentJSONParsing:Xn.transitional(Xn.boolean),forcedJSONParsing:Xn.transitional(Xn.boolean),clarifyTimeoutError:Xn.transitional(Xn.boolean),legacyInterceptorReqResOrdering:Xn.transitional(Xn.boolean)},!1),null!=r&&(At.isFunction(r)?t.paramsSerializer={serialize:r}:Kn.assertOptions(r,{encode:Xn.function,serialize:Xn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Kn.assertOptions(t,{baseUrl:Xn.spelling("baseURL"),withXsrfToken:Xn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=a&&At.merge(a.common,a[t.method]);a&&At.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=ln.concat(i,a);const o=[];let s=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||_t;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,h=0;if(!s){const e=[Gn.bind(this),void 0];for(e.unshift(...o),e.push(...c),l=e.length,u=Promise.resolve(t);h<l;)u=u.then(e[h++],e[h++]);return u}l=o.length;let f=t;for(;h<l;){const e=o[h++],t=o[h++];try{f=e(f)}catch(d){t.call(this,d);break}}try{u=Gn.call(this,f)}catch(d){return Promise.reject(d)}for(h=0,l=c.length;h<l;)u=u.then(c[h++],c[h++]);return u}getUri(e){return jt(Rn((e=vn(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}At.forEach(["delete","get","head","options"],(function(e){Jn.prototype[e]=function(t,n){return this.request(vn(n||{},{method:e,url:t,data:(n||{}).data}))}})),At.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,a){return this.request(vn(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Jn.prototype[e]=t(),Jn.prototype[e+"Form"]=t(!0)}));const Zn=Jn;class Qn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,a){n.reason||(n.reason=new dn(e,r,a),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Qn((function(t){e=t})),cancel:e}}}const Yn=Qn;const er={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(er).forEach((([e,t])=>{er[t]=e}));const tr=er;const nr=function e(t){const n=new Zn(t),r=ke(Zn.prototype.request,n);return At.extend(r,Zn.prototype,n,{allOwnKeys:!0}),At.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(vn(t,n))},r}(en);nr.Axios=Zn,nr.CanceledError=dn,nr.CancelToken=Yn,nr.isCancel=fn,nr.VERSION=qn,nr.toFormData=Pt,nr.AxiosError=Ct,nr.Cancel=nr.CanceledError,nr.all=function(e){return Promise.all(e)},nr.spread=function(e){return function(t){return e.apply(null,t)}},nr.isAxiosError=function(e){return At.isObject(e)&&!0===e.isAxiosError},nr.mergeConfig=vn,nr.AxiosHeaders=ln,nr.formToJSON=e=>Zt(At.isHTMLForm(e)?new FormData(e):e),nr.getAdapter=Mn.getAdapter,nr.HttpStatusCode=tr,nr.default=nr;const rr=nr,ar=w()("bee-js:http"),{AxiosError:ir}=rr,or=o.minutes(1)/200,sr={headers:{accept:"application/json, text/plain, */*"},maxBodyLength:1/0,maxContentLength:1/0};function cr(e,t,n,r){if(e?.aborted)throw new G(t.method||"get",t.url||"<unknown>","Request aborted",n,r,"ERR_CANCELED")}async function ur(e,t){const n=u.deepMerge3(sr,t,e);if(e.signal&&(n.signal=e.signal,cr(e.signal,t)),function(e){e.data&&e.data instanceof Uint8Array&&(e.data=e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength));e.data&&"undefined"!=typeof Buffer&&Buffer.isBuffer(e.data)&&(e.data=e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength))}(n),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;){cr(e.signal,t);try{ar(`${n.method||"get"} ${l.joinUrl([n.baseURL,n.url])}`,{headers:{...n.headers},params:n.params}),lr(e,n);return await rr(n)}catch(a){if(!(a instanceof ir))throw a;if("ERR_CANCELED"===a.code&&cr({aborted:!0},t,a.response?.data,a.response?.status),"ECONNABORTED"!==a.code||!e.endlesslyRetry)throw new G(t.method||"get",t.url||"<unknown>",a.message,a.response?.data,a.response?.status,a.response?.statusText);r++,await h.sleepMillis(r<or?200:1e3)}}throw Error("Max number of failed attempts reached")}function lr(e,t){e.onRequest&&e.onRequest({method:t.method||"GET",url:l.joinUrl([t.baseURL,t.url]),headers:{...t.headers},params:t.params})}const hr="chunks";async function fr(e,t,n){t=new F(t);const r=await ur(e,{responseType:"arraybuffer",url:`${hr}/${t}`,headers:Pe(null,n)});return new Uint8Array(r.data)}const dr=N.LENGTH,pr=N.LENGTH+L.LENGTH,mr=N.LENGTH+L.LENGTH+P.LENGTH;function gr(e,t){e=e instanceof T?e.toUint8Array():e,t=new F(t);const n=function(e){const t=H(e.slice(pr)),n=L.fromSlice(e,dr),r=T.fromSlice(e,0,N.LENGTH),a=i.concatBytes(r.toUint8Array(),t.toUint8Array());return n.recoverPublicKey(a).address()}(e),r=T.fromSlice(e,0,N.LENGTH),a=new F(i.keccak256(i.concatBytes(r.toUint8Array(),n.toUint8Array())));if(!i.equals(t.toUint8Array(),a.toUint8Array()))throw new M("SOC data does not match given address!");return{data:e,identifier:r,signature:L.fromSlice(e,dr),span:P.fromSlice(e,pr),payload:T.fromSlice(e,mr),address:a,owner:n}}function br(e,t){return new F(i.keccak256(i.concatBytes(e.toUint8Array(),t.toUint8Array())))}function yr(e,t,n,r,a){const o=br(r=new N(r),(a=new D(a)).publicKey().address()),s=a.sign(i.concatBytes(r.toUint8Array(),e.toUint8Array()));return{data:i.concatBytes(r.toUint8Array(),s.toUint8Array(),t.toUint8Array(),n.toUint8Array()),identifier:r,signature:s,span:t,payload:n,address:o,owner:a.publicKey().address()}}async function wr(e,t,n,r){const a=i.concatBytes(t.span.toUint8Array(),t.payload.toUint8Array());return async function(e,t,n,r,a,i,o){const s=await ur(e,{method:"post",url:`soc/${t}/${n}`,data:a,headers:{"content-type":"application/octet-stream",...Pe(i,o)},responseType:"json",params:{sig:r.toHex()}}),c=f.asObject(s.data,{name:"response.data"});return{reference:new F(f.asHexString(c.reference)),tagUid:s.headers["swarm-tag"]?Be(s.headers["swarm-tag"]):void 0,historyAddress:s.headers["swarm-act-history-address"]?d.of(new F(s.headers["swarm-act-history-address"])):d.empty()}}(e,t.owner,t.identifier,t.signature,a,n,r)}async function Br(e,t,n,r,a,i){t=new D(t),r=new N(r);return wr(e,Or(a).toSingleOwnerChunk(r,t),n,i)}async function Er(e,t,n){const r=br(n=new N(n),t=new V(t));return gr(await fr(e,r.toHex()),r)}const Rr=1,Tr=4096;function vr(e){return Or((e=new T(e)).toUint8Array().slice(P.LENGTH),P.fromSlice(e.toUint8Array(),0))}function Or(e,t){if(f.isString(e)&&(e=T.fromUtf8(e)),e.length<Rr||e.length>Tr)throw new RangeError(`payload size ${e.length} exceeds limits [${Rr}, ${Tr}]`);const n=t?"bigint"==typeof t?P.fromBigInt(t):t:P.fromBigInt(BigInt(e.length)),r=new T(e),a=i.concatBytes(n.toUint8Array(),r.toUint8Array()),o=H(a);return{data:a,span:n,payload:r,address:o,toSingleOwnerChunk:(e,t)=>yr(o,n,r,e,t)}}const Sr="bytes";async function xr(e,t,n,r){const a=await ur(e,{url:Sr,method:"post",responseType:"json",data:t,headers:{"content-type":"application/octet-stream",...Pe(n,r)}}),i=f.asObject(a.data,{name:"response.data"});return{reference:new F(f.asHexString(i.reference)),tagUid:a.headers["swarm-tag"]?Be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?d.of(new F(a.headers["swarm-act-history-address"])):d.empty()}}async function Ar(e,t,n){n&&(n=pe(n));const r=await ur(e,{responseType:"arraybuffer",url:`${Sr}/${t}`,headers:Pe(null,n)});return new T(r.data)}const Dr="feeds";function Cr(e){const t=e["swarm-feed-index"],n=e["swarm-feed-index-next"];if(!t)throw new M("Response did not contain expected swarm-feed-index!");if(!n)throw new M("Response did not contain expected swarm-feed-index-next!");return{feedIndex:new j(t),feedIndexNext:new j(n)}}async function Vr(e,t,n,r){const a=await ur(e,{responseType:"arraybuffer",url:`${Dr}/${t}/${n}`,params:r});return{payload:new T(a.data),...Cr(a.headers)}}class Nr{constructor(e){this.raw=e}toString(){return f.isString(this.raw)&&this.raw.includes(".eth")?this.raw:new F(this.raw).toHex()}}function Fr(e,t){return t="number"==typeof t?j.fromBigInt(BigInt(t)):t,new N(i.keccak256(i.concatBytes(e.toUint8Array(),t.toUint8Array())))}async function Ir(e,t,n){try{const r=await Vr(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 G)return j.fromBigInt(0n);throw r}}async function Pr(e,t,n,r,a,i){const o=Fr(n,i?.index??await Ir(e,t.publicKey().address(),n));if(r.length>4096){const n=await xr(e,r,a,i);return async function(e,t,n,r,a,i){return t=new D(t),r=new N(r),wr(e,a.toSingleOwnerChunk(r,t),n,i)}(e,t,a,o,vr(await fr(e,n.reference)),i)}return Br(e,t,a,o,f.isString(r)?T.fromUtf8(r).toUint8Array():r,i)}function kr(e,t,n){const r=Fr(t,n);return new F(i.keccak256(i.concatBytes(r.toUint8Array(),e.toUint8Array())))}async function $r(e,t,n,r,a=!1){const o=kr(t,n,r="number"==typeof r?j.fromBigInt(BigInt(r)):r),s=gr(await fr(e,o.toHex()),o);let c=d.empty();if(a){const e=T.fromSlice(s.payload.toUint8Array(),0,8);c=d.of(Number(i.uint64ToNumber(e.toUint8Array(),"BE")))}return{timestamp:c,payload:new T(s.payload.offset(a?8:0))}}async function Lr(e,t,n,r){const a=kr(t,n,r="number"==typeof r?j.fromBigInt(BigInt(r)):r),i=gr(await fr(e,a),a);return Or(i.payload,i.span)}function Ur(e,t,n){const r=async r=>{if(void 0===r?.index)return Vr(e,n,t);const a=await $r(e,n,t,r.index,r.hasTimestamp??!0),i="number"==typeof r.index?j.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 Vr(e,n,t);const a=await Lr(e,n,t,r.index),i=a.span.toBigInt()<=4096n?a.payload:await Ar(e,new Nr(a.address)),o="number"==typeof r.index?j.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 Cr((await ur(e,{responseType:"arraybuffer",url:`${Dr}/${t}/${n}`,params:{"Swarm-Only-Root-Chunk":!0}})).headers)}(e,n,t)).feedIndex);const o=await r({...a,index:i});return{reference:new F(o.payload.toUint8Array()),feedIndex:o.feedIndex,feedIndexNext:o.feedIndexNext??o.feedIndex.next()}},owner:n,topic:t}}function zr(e,t,n){const r=async(r,a,o)=>async function(e,t,n,r,a,o){r=new F(r);const s=Fr(n,o?.index??await Ir(e,t.publicKey().address(),n)),c=o?.at??Date.now()/1e3,u=i.numberToUint64(BigInt(Math.floor(c)),"BE");return Br(e,t,a,s,i.concatBytes(u,r.toUint8Array()),o)}(e,n,t,a,r,o);return{...Ur(e,t,n.publicKey().address()),upload:r,uploadReference:r,uploadPayload:async(r,a,i)=>Pr(e,n,t,a,r,i)}}async function jr(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(kr(e,t,j.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=u.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 Mr(e){if(!function(e){return!!Array.isArray(e)&&e.every((e=>"object"==typeof e&&e.path&&void 0!==e.size))}(e))throw new _("invalid collection",e)}function _r(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 Gr(e){return Array.from(e).map((e=>({path:_r(e),size:e.size,file:e})))}function qr(e){return Array.from(e).reduce(((e,t)=>e+t.size),0)}class Hr{output=new le.PassThrough;currentFileSize=0;beginFile(e,t){const{name:n,prefix:r,longLink:a}=function(e){if(e.length<=100)return{name:e,prefix:"",longLink:!1};for(let r=e.length-1;r>=0;r--)if("/"===e[r]){const t=e.substring(r+1),n=e.substring(0,r);if(t.length<=100&&n.length<=155)return{name:t,prefix:n,longLink:!1}}const t=e.lastIndexOf("/"),n=(t>=0?e.substring(t+1):e).slice(0,100);return{name:n,prefix:"",longLink:!0}}(e);if(a){const t=Buffer.from(e+"\0");this.output.write(function(e){const t=Buffer.alloc(512,0);t.write("././@LongLink",0,100),t.write("0000644\0",100,8),t.write("0000000\0",108,8),t.write("0000000\0",116,8),t.write(e.toString(8).padStart(11,"0")+"\0",124,12),t.write("00000000000\0",136,12),t.write(" ",148,8),t.write("L",156,1),t.write("ustar\0\0",257,8);let n=0;for(let r=0;r<512;r++)n+=t[r];return t.write(n.toString(8).padStart(6,"0")+"\0 ",148,8),t}(t.length)),this.output.write(t);const n=t.length%512==0?0:512-t.length%512;n>0&&this.output.write(Buffer.alloc(n,0))}const i=function(e,t,n){const r=Buffer.alloc(512,0);r.write(e.slice(0,100).padEnd(100,"\0"),0,100),r.write("0000777\0",100,8),r.write("0001750\0",108,8),r.write("0001750\0",116,8),r.write(n.toString(8).padStart(11,"0")+"\0",124,12);const a=Math.floor((new Date).getTime()/1e3);r.write(a.toString(8).padStart(11,"0")+"\0",136,12),r.write(" ",148,8),r.write("0",156,1),r.write("ustar\0\0",257,8),t&&r.write(t.slice(0,155).padEnd(155,"\0"),345,155);let i=0;for(let o=0;o<512;o++)i+=r[o];return r.write(i.toString(8).padStart(6,"0")+"\0 ",148,8),r}(n,r,t);this.output.write(i),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 Wr=n(497),Kr=n.n(Wr);async function Xr(e,t,n,r){const a=new Hr,i=ur(e,{method:"post",url:"bzz",data:a.output,responseType:"json",headers:{"content-type":"application/x-tar","swarm-collection":"true",...Pe(n,r)}});await async function(e,t){for(const n of e)if(t.beginFile(n.path,n.size),n.fsPath){const e=(0,Wr.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 Jr="bzz";async function Zr(e,t,n,r,a){fe(t)&&!a?.contentType&&(a||(a={}),a.contentType="application/octet-stream");const i=await ur(e,{method:"post",url:Jr,data:t,headers:Pe(n,a),params:{name:r},responseType:"json"}),o=f.asObject(i.data,{name:"response.data"});return{reference:new F(f.asHexString(o.reference)),tagUid:i.headers["swarm-tag"]?Be(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?d.of(new F(i.headers["swarm-act-history-address"])):d.empty()}}async function Qr(e,t,n,r){Mr(t);const a=await Xr(e,t,n,r),i=f.asObject(a.data,{name:"response.data"});return{reference:new F(f.asHexString(i.reference)),tagUid:a.headers["swarm-tag"]?Be(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?d.of(new F(a.headers["swarm-act-history-address"])):d.empty()}}const Yr="balances",ea="consumed";const ta="chequebook";async function na(e,t){const n=await ur(e,{url:ta+`/cashout/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),uncashedAmount:ce.fromPLUR(de(r.uncashedAmount,{name:"uncashedAmount"})),transactionHash:f.asNullableString(r.transactionHash),lastCashedCheque:f.asNullable((e=>ra(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(de(t.lastPayout,{name:"lastPayout"})),bounced:f.asBoolean(t.bounced,{name:"bounced"})}}(e)),r.result)}}function ra(e){const t=f.asObject(e,{name:"cheque"});return{beneficiary:new V(f.asString(t.beneficiary,{name:"beneficiary"})),chequebook:new V(f.asString(t.chequebook,{name:"chequebook"})),payout:ce.fromPLUR(de(t.payout,{name:"payout"}))}}function aa(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 ia="settlements";const oa="stake";const sa="stamps";async function ca(e){const t=await ur(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 V(f.asString(e.owner,{name:"owner"})),start:f.asNumber(e.start,{name:"start"}),value:de(e.value,{name:"value"})})))}async function ua(e){const t=await ur(e,{method:"get",url:`${sa}`,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=>Ne(la(e))))}function la(e){return{amount:de(e.amount,{name:"amount"}),batchID:f.asString(e.batchID,{name:"batchID"}),batchTTL:f.asNumber(e.batchTTL,{name:"batchTTL"}),bucketDepth:f.asNumber(e.bucketDepth,{name:"bucketDepth"}),blockNumber:f.asNumber(e.blockNumber,{name:"blockNumber"}),depth:f.asNumber(e.depth,{name:"depth"}),immutableFlag:f.asBoolean(e.immutableFlag,{name:"immutableFlag"}),label:f.asEmptiableString(e.label,{name:"label"}),usable:f.asBoolean(e.usable,{name:"usable"}),utilization:f.asNumber(e.utilization,{name:"utilization"})}}const ha="wallet";var fa=n(359),da=n.n(fa);const pa="2.7.0-6ddf9b45",ma=pa.split("-")[0],ga="7.3.0";async function ba(e){const t=await ur(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 ya="transactions";function wa(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:de(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:de(t.value,{name:"value"})}}const Ba="grantee";var Ea=n(666),Ra=n.n(Ea);const Ta="gsoc";const va="pins";const Oa="pss";async function Sa(e,t,n,r,a,i){await ur(e,{method:"post",url:`${Oa}/send/${t}/${n}`,data:r,responseType:"json",params:{recipient:i},headers:Pe(a)})}async function xa(e){await ur(e,{url:""})}const Aa="stewardship";const Da="tags";const Ca=w()("bee-js:manifest"),Va=new TextEncoder,Na=new TextDecoder,Fa=new Uint8Array([47]),Ia=i.hexToUint8Array("5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b");class Pa{constructor(e,t){this.prefix=e,this.node=t}static split(e,t){const n=i.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 ka({path:n}),a=new Pa(e.prefix.slice(n.length),e.node),o=new Pa(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 Pa(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(i.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),Ca("marshalling fork",{prefixLength:this.prefix.length,prefix:Na.decode(this.prefix),address:i.uint8ArrayToHex(this.node.selfAddress)}),this.node.metadata){const t=i.padEndToMultiple(new Uint8Array([0,0,...Va.encode(JSON.stringify(this.node.metadata))]),32,10),n=i.numberToUint16(t.length-2,"BE");t.set(n,0),e.push(t)}return i.concatBytes(...e)}static unmarshal(e,t){const n=i.uint8ToNumber(e.read(1)),r=i.uint8ToNumber(e.read(1)),a=e.read(r);r<30&&e.read(30-r);const o=e.read(t);let s;if(Ca("unmarshalling fork",{type:n,prefixLength:r,prefix:Na.decode(a),addressLength:t,address:i.uint8ArrayToHex(o)}),function(e,t){return(e&t)===t}(n,16)){const t=i.uint16ToNumber(e.read(2),"BE");s=JSON.parse(Na.decode(e.read(t)))}return new Pa(a,new ka({selfAddress:o,metadata:s,path:a}))}}class ka{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 i.concatBytes(this.parent?.fullPath??new Uint8Array(0),this.path)}get fullPathString(){return Na.decode(this.fullPath)}getRootMetadata(){const e=this.find("/");return e&&e.metadata?d.of(e.metadata):d.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 d.empty();const r=n.metadata["swarm-feed-owner"],a=n.metadata["swarm-feed-topic"];return r&&a?d.of(await e.fetchLatestFeedUpdate(a,r,t)):d.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(Ia,0),e.set(i.equals(this.targetAddress,Qa)&&i.equals(this.path,new Uint8Array([47]))?i.numberToUint8(0):i.numberToUint8(this.targetAddress.length),31);const t=new Uint8Array(32);for(const a of this.forks.keys())i.setBit(t,a,1,"LE");const n=[];for(let a=0;a<256;a++)i.getBit(t,a,"LE")&&n.push(this.forks.get(a).marshal());const r=i.xorCypher(i.concatBytes(e,i.equals(this.targetAddress,Qa)&&i.equals(this.path,new Uint8Array([47]))?new Uint8Array(0):this.targetAddress,t,...n),this.obfuscationKey);return i.concatBytes(this.obfuscationKey,r)}static async unmarshal(e,t,n,r){t=new F(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=i.xorCypher(e.subarray(32),n),a=new b(r),o=a.read(31);if(!i.equals(o,Ia.slice(0,31)))throw new Error("MantarayNode#unmarshal invalid version hash");const s=i.uint8ToNumber(a.read(1)),c=s?a.read(s):Qa,u=new ka({selfAddress:t,targetAddress:c,obfuscationKey:n}),l=a.read(32);for(let h=0;h<256;h++)if(i.getBit(l,h,"LE")){const e=Pa.unmarshal(a,t.length);u.forks.set(h,e),e.node.parent=u}return u}addFork(e,t,n){this.selfAddress=null,e=e instanceof Uint8Array?e:Va.encode(e),Ca("adding fork",{path:Na.decode(e),reference:new F(t).represent()});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 Pa(c,new ka({targetAddress:i?new F(t).toUint8Array():void 0,metadata:i?n:void 0,path:c})),l=o.forks.get(c[0]);if(l){const e=Pa.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:Va.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(i.concatBytes(t.path,a.prefix),a.node.targetAddress,a.node.metadata)}async calculateSelfAddress(){return this.selfAddress?new F(this.selfAddress):new F((await p.root(await this.marshal())).hash())}async saveRecursively(e,t,n,r){for(const i of this.forks.values()){const a=await i.node.saveRecursively(e,t,n,r);if(n?.act){let e;a.historyAddress.ifPresent((t=>e=t)),e&&(i.node.metadata||(i.node.metadata={}),i.node.metadata["swarm-act-history-address"]=e.toHex())}}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");let a=t;r.node.metadata&&r.node.metadata["swarm-act-history-address"]&&(a={...t,actHistoryAddress:r.node.metadata["swarm-act-history-address"]});const i=await ka.unmarshal(e,r.node.selfAddress,a,n);r.node.targetAddress=i.targetAddress,r.node.forks=i.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:Va.encode(e)).length)return[this,t];const n=this.forks.get(e[0]);return n&&i.commonPrefix(n.prefix,e).length===n.prefix.length?n.node.findClosest(e.slice(n.prefix.length),i.concatBytes(t,n.prefix)):[this,t]}collect(e=[]){for(const t of this.forks.values())i.equals(t.node.targetAddress,Qa)||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 F(n.targetAddress).toHex();return t}determineType(){let e=0;return i.equals(this.targetAddress,Qa)&&!i.equals(this.path,Fa)||(e|=2),this.forks.size>0&&(e|=4),-1===i.indexOf(this.path,Fa)||i.equals(this.path,Fa)||(e|=8),this.metadata&&(e|=16),e}}var $a=n(61),La=n.n($a);async function Ua(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 za(e,"")}async function za(e,t){const n=La().join(e,t),r=await Kr().promises.opendir(n);let a=[];for await(const i of r){const n=La().join(e,t,i.name),r=La().join(t,i.name);i.isFile()?a.push({path:r,size:(await Kr().promises.stat(n)).size,fsPath:n}):i.isDirectory()&&(a=[...await za(e,r),...a])}return a}async function ja(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 Kr().promises.opendir(e);let n=0;for await(const r of t)if(r.isFile()){n+=(await Kr().promises.stat(La().join(e,r.name))).size}else r.isDirectory()&&(n+=await ja(La().join(e,r.name)));return n}const Ma={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 _a(e){return["text/html","text/css"].includes(e)?`${e}; charset=utf-8`:e}async function Ga(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 qa(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 _("URL is not valid!",e)}class Ha{constructor(e,t){qa(e),this.url=function(e){return e.endsWith("/")?e.slice(0,-1):e}(e),t?.signer&&(this.signer=new D(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=me(e,t),r=f.asObject(e,{name:t});return{...n,redundancyLevel:f.asOptional((e=>f.asInteger(e,{name:"redundancyLevel",min:0})),r.redundancyLevel)}}(n)),xr(this.getRequestOptionsForCall(r),t,e,n)}async probeData(e,t){return e=new F(e),async function(e,t){t=new F(t);const n=await ur(e,{url:`${Sr}/${t}`,method:"head",responseType:"json"});return{contentLength:parseInt(n.headers["content-length"])}}(this.getRequestOptionsForCall(t),e)}async downloadData(e,t,n){return t&&(t=pe(t)),Ar(this.getRequestOptionsForCall(n),new Nr(e),t)}async downloadReadableData(e,t,n){return t&&(t=pe(t)),async function(e,t,n){return n&&(n=pe(n)),(await ur(e,{responseType:"stream",url:`${Sr}/${t}`,headers:Pe(null,n)})).data}(this.getRequestOptionsForCall(n),new Nr(e),t)}async uploadChunk(e,t,n,r){const a="identifier"in t&&"signature"in t&&"owner"in t;if(t=t instanceof Uint8Array?t:t.data,n&&(n=me(n)),t.length<P.LENGTH)throw new _(`Chunk has to have size of at least ${P.LENGTH}.`,t);if(!a&&t.length>Z+P.LENGTH)throw new _(`Content Addressed Chunk must not exceed ${Z+P.LENGTH} bytes.`,t);if(a&&t.length>Z+P.LENGTH+L.LENGTH+N.LENGTH)throw new _(`Single Owner Chunk must not exceed ${Z+P.LENGTH+L.LENGTH+N.LENGTH} bytes.`,t);return async function(e,t,n,r){const a=await ur(e,{method:"post",url:`${hr}`,data:t,headers:{"content-type":"application/octet-stream",...Pe(n,r)},responseType:"json"}),i=f.asObject(a.data,{name:"response.data"});return{reference:new F(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"]?d.of(new F(a.headers["swarm-act-history-address"])):d.empty()}}(this.getRequestOptionsForCall(r),t,e,n)}async downloadChunk(e,t,n){return e=new F(e),t&&(t=pe(t)),fr(this.getRequestOptionsForCall(n),e,t)}async createGrantees(e,t,n){return e=new $(e),t=t.map((e=>new C(e))),async function(e,t,n){const r=await ur(e,{method:"post",url:Ba,data:{grantees:n.map((e=>e.toCompressedHex()))},headers:Pe(t),responseType:"json"}),a=f.asObject(r.data,{name:"response.data"});return{status:r.status,statusText:r.statusText,ref:new F(f.asString(a.ref,{name:"ref"})),historyref:new F(f.asString(a.historyref,{name:"historyref"}))}}(this.getRequestOptionsForCall(n),e,t)}async getGrantees(e,t){return async function(e,t){const n=await ur(t,{method:"get",url:`${Ba}/${e}`,responseType:"json"}),r=f.asArray(n.data,{name:"response.data"}).map((e=>new C(f.asString(e,{name:"grantee"}))));return{status:n.status,statusText:n.statusText,grantees:r}}(e=new F(e),this.getRequestOptionsForCall(t))}async patchGrantees(e,t,n,r,a){return async function(e,t,n,r,a){const i=await ur(a,{method:"patch",url:`${Ba}/${t}`,data:{add:r.add?.map((e=>e.toCompressedHex())),revoke:r.revoke?.map((e=>e.toCompressedHex()))},headers:{...Pe(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 F(f.asString(o.ref,{name:"ref"})),historyref:new F(f.asString(o.historyref,{name:"historyref"}))}}(e=new $(e),t=new F(t),n=new F(n),{add:r.add?.map((e=>new C(e)))??[],revoke:r.revoke?.map((e=>new C(e)))??[]},this.getRequestOptionsForCall(a))}async uploadFile(e,t,n,r,a){if(e=new $(e),function(e){if(!("string"==typeof e||e instanceof Uint8Array||he(e)||fe(e)))throw new TypeError("Data must be either string, Readable, Uint8Array or File!")}(t),r&&(r=function(e){const t=me(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(he(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 Zr(this.getRequestOptionsForCall(a),i,e,o,s)}return Zr(this.getRequestOptionsForCall(a),t,e,n,r)}async downloadFile(e,t="",n,r){return n&&(n=pe(n)),async function(e,t,n="",r){const a=await ur(e,{method:"GET",responseType:"arraybuffer",url:`${Jr}/${t}/${n}`,headers:Pe(null,r)});return{...Ie(a.headers),data:new T(a.data)}}(this.getRequestOptionsForCall(r),new Nr(e),t,n)}async downloadReadableFile(e,t="",n,r){return e=new F(e),n&&(n=pe(n)),async function(e,t,n="",r){t=new F(t);const a=await ur(e,{method:"GET",responseType:"stream",url:`${Jr}/${t}/${n}`,headers:Pe(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=Gr(t);return Qr(this.getRequestOptionsForCall(r),a,e,n)}async hashDirectory(e){return async function(e){const t=await Ua(e),n=new ka;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,Wr.createReadStream)(r.fsPath);for await(const n of t)await e.append(n);const a=await e.finalize(),{filename:i,extension:o}=l.parseFilename(r.path);n.addFork(r.path,a.hash(),{"Content-Type":_a(Ma[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 g(64,64);let s=0,c=0;n=new $(n);const u=await Ua(t);for(const l of u)s+=(h=l.size,function e(t){return t<=1?t:t+e(Math.ceil(t/128))}(Math.ceil(h/4096)));var h;let f=!1;async function d(t){await o.enqueue((async()=>{await e.uploadChunk(n,t.build(),a,i),r?.({total:s,processed:++c})}))}const m=new ka;for(const g of u){if(!g.fsPath)throw Error("File does not have fsPath, which should never happen in node. Please report this issue.");const e=(0,Wr.createReadStream)(g.fsPath),t=new p(d);for await(const i of e)await t.append(i);const n=await t.finalize();await o.drain();const{filename:r,extension:a}=l.parseFilename(g.path);m.addFork(g.path,n.hash(),{"Content-Type":_a(Ma[a.toLowerCase()]||"application/octet-stream"),Filename:r}),"index.html"===g.path&&(f=!0)}if(f||a?.indexDocument||a?.errorDocument){const e={};a?.indexDocument?e["website-index-document"]=a.indexDocument:f&&(e["website-index-document"]="index.html"),a?.errorDocument&&(e["website-error-document"]=a.errorDocument),m.addFork("/",Qa,e)}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),Mr(t),n&&(n=ge(n)),Qr(this.getRequestOptionsForCall(r),t,e,n)}async uploadFilesFromDirectory(e,t,n,r){e=new $(e),n&&(n=ge(n));const a=await Ua(t);return Qr(this.getRequestOptionsForCall(r),a,e,n)}async createTag(e){return async function(e){const t=await ur(e,{method:"post",url:Da,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 ur(e,{url:Da,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 ur(e,{url:`${Da}/${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 ur(e,{method:"delete",url:`${Da}/${t}`})}(this.getRequestOptionsForCall(t),e)}async updateTag(e,t,n){return t=new F(t),e=Be(e),async function(e,t,n){await ur(e,{method:"patch",url:`${Da}/${t}`,data:{reference:n}})}(this.getRequestOptionsForCall(n),e,t)}async pin(e,t){return e=new F(e),async function(e,t){await ur(e,{method:"post",responseType:"json",url:`${va}/${t}`})}(this.getRequestOptionsForCall(t),e)}async unpin(e,t){return e=new F(e),async function(e,t){await ur(e,{method:"delete",responseType:"json",url:`${va}/${t}`})}(this.getRequestOptionsForCall(t),e)}async getAllPins(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:`${va}`}),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 F(e)))}(this.getRequestOptionsForCall(e))}async getPin(e,t){return e=new F(e),async function(e,t){const n=await ur(e,{method:"get",responseType:"json",url:`${va}/${t}`}),r=f.asObject(n.data,{name:"response.data"});return{reference:new F(f.asString(r.reference,{name:"reference"}))}}(this.getRequestOptionsForCall(t),e)}async reuploadPinnedData(e,t,n){e=new $(e),t=new F(t),await async function(e,t,n){await ur(e,{method:"put",url:`${Aa}/${n}`,headers:{"swarm-postage-batch-id":t.toHex()}})}(this.getRequestOptionsForCall(n),e,t)}async isReferenceRetrievable(e,t){return e=new F(e),async function(e,t){t=new F(t);const n=await ur(e,{method:"get",responseType:"json",url:`${Aa}/${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 V(e),t=new U(t),r&&(r=pe(r)),!n)try{return await this.makeFeedReader(t,e,a).download(),!0}catch(i){const e=u.getDeep(i,"status");if(404===e||500===e)return!1;throw i}return jr(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 C(a),Sa(this.getRequestOptionsForCall(i),t,n,r,e,a)):Sa(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"}),onClose:f.asFunction(t.onClose,{name:"onClose"})}}(t);const n=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===h.whereAmI()?new(Ra())(`${r}/${Oa}/subscribe/${t.toHex()}`):new(Ra())(`${r}/${Oa}/subscribe/${t.toHex()}`,{headers:n})}(this.url,e,this.requestOptions.headers);let r=!1;const a={topic:e,cancel:()=>{r||(r=!0,n.terminate?n.terminate():n.close())}};return n.onmessage=async e=>{const n=await Ga(e.data);n.length&&t.onMessage(new T(n),a)},n.onerror=e=>{r||t.onError(new M(e.message),a)},n.onclose=()=>{t.onClose(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)},onClose:()=>{clearTimeout(a),i.cancel()}});t>0&&(a=setTimeout((()=>{i.cancel(),r(new M("pssReceive timeout"))}),t))}))}gsocMine(e,t,n=12){e=new k(e),t=new N(t);for(let r=0n;r<0xffffn;r++){const a=new D(i.numberToUint256(2867n+r,"BE")),o=br(t,a.publicKey().address());if(256-i.proximity(o.toUint8Array(),e.toUint8Array())<=256-n)return a}throw Error("Could not mine a valid signer")}async gsocSend(e,t,n,r,a,i){e=new $(e),t=new D(t),n=new N(n);const o=Or(r).toSingleOwnerChunk(n,t);return async function(e,t,n,r){return wr(e,t,n,r)}(this.getRequestOptionsForCall(i),o,e,a)}gsocSubscribe(e,t,n){e=new V(e),t=new N(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"}),onClose:f.asFunction(t.onClose,{name:"onClose"})}}(n);const r=br(t,e),a=function(e,t,n){const r=e.replace(/^http/i,"ws");return"browser"===h.whereAmI()?new(Ra())(`${r}/${Ta}/subscribe/${t.toHex()}`):new(Ra())(`${r}/${Ta}/subscribe/${t.toHex()}`,{headers:n})}(this.url,r,this.requestOptions.headers);let i=!1;const o={address:e,cancel:()=>{i||(i=!0,a.terminate?a.terminate():a.close())}};return a.onmessage=async e=>{const t=await Ga(e.data);t.length&&n.onMessage(new T(t),o)},a.onerror=e=>{i||n.onError(new M(e.message),o)},a.onclose=()=>{n.onClose(o)},o}async createFeedManifest(e,t,n,r,a){return e=new $(e),t=new U(t),n=new V(n),r&&(r=me(r)),async function(e,t,n,r,a){const i=await ur(e,{method:"post",responseType:"json",url:`${Dr}/${t}/${n}`,headers:Pe(r,a)}),o=f.asObject(i.data,{name:"response.data"});return new F(f.asHexString(o.reference))}(this.getRequestOptionsForCall(a),n,t,e,r)}makeFeedReader(e,t,n){return e=new U(e),t=new V(t),Ur(this.getRequestOptionsForCall(n),e,t)}makeFeedWriter(e,t,n){if(e=new U(e),!(t=t?new D(t):this.signer))throw Error("No signer provided");return zr(this.getRequestOptionsForCall(n),e,t)}async fetchLatestFeedUpdate(e,t,n){return e=new U(e),t=new V(t),Vr(this.getRequestOptionsForCall(n),t,e)}makeContentAddressedChunk(e,t){return Or(e,t)}unmarshalContentAddressedChunk(e){return vr(e)}makeSingleOwnerChunk(e,t,n,r,a){return yr(e,t,n,r,a)}calculateSingleOwnerChunkAddress(e,t){return br(e,t)}unmarshalSingleOwnerChunk(e,t){return gr(e,t)}makeSOCReader(e,t){return{owner:e=new V(e),download:Er.bind(null,this.getRequestOptionsForCall(t),e)}}makeSOCWriter(e,t){if(!(e=e?new D(e):this.signer))throw Error("No signer provided");return{...this.makeSOCReader(e.publicKey().address(),t),upload:Br.bind(null,this.getRequestOptionsForCall(t),e)}}async createEnvelope(e,t,n){return e=new $(e),t=new F(t),async function(e,t,n){const r=await ur(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:i.hexToUint8Array(f.asHexString(a.issuer,{name:"issuer",byteLength:20})),index:i.hexToUint8Array(f.asHexString(a.index,{name:"index",byteLength:8})),timestamp:i.hexToUint8Array(f.asHexString(a.timestamp,{name:"timestamp",byteLength:8})),signature:i.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 a=await ur(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 xa(this.getRequestOptionsForCall(e))}async isConnected(e){try{await xa(this.getRequestOptionsForCall(e))}catch(t){return!1}return!0}async isGateway(e){return async function(e){try{const t=await ur(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 ur(e,{url:"addresses",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{overlay:new k(f.asString(n.overlay,{name:"overlay"})),underlay:f.asArray(n.underlay,{name:"underlay"}).map((e=>f.asString(e,{name:"underlay"}))),ethereum:new V(f.asString(n.ethereum,{name:"ethereum"})),publicKey:new C(f.asString(n.publicKey,{name:"publicKey"})),pssPublicKey:new C(f.asString(n.pssPublicKey,{name:"pssPublicKey"}))}}(this.getRequestOptionsForCall(e))}async getBlocklist(e){return async function(e){return(await ur(e,{url:"blocklist",responseType:"json"})).data.peers}(this.getRequestOptionsForCall(e))}async getPeers(e){return async function(e){const t=await ur(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 k(e),async function(e,t){return(await ur(e,{url:`peers/${t}`,responseType:"json",method:"DELETE"})).data}(this.getRequestOptionsForCall(t),e)}async getTopology(e){return async function(e){const t=await ur(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:aa(r.bin_0,"bin_0"),bin_1:aa(r.bin_1,"bin_1"),bin_2:aa(r.bin_2,"bin_2"),bin_3:aa(r.bin_3,"bin_3"),bin_4:aa(r.bin_4,"bin_4"),bin_5:aa(r.bin_5,"bin_5"),bin_6:aa(r.bin_6,"bin_6"),bin_7:aa(r.bin_7,"bin_7"),bin_8:aa(r.bin_8,"bin_8"),bin_9:aa(r.bin_9,"bin_9"),bin_10:aa(r.bin_10,"bin_10"),bin_11:aa(r.bin_11,"bin_11"),bin_12:aa(r.bin_12,"bin_12"),bin_13:aa(r.bin_13,"bin_13"),bin_14:aa(r.bin_14,"bin_14"),bin_15:aa(r.bin_15,"bin_15"),bin_16:aa(r.bin_16,"bin_16"),bin_17:aa(r.bin_17,"bin_17"),bin_18:aa(r.bin_18,"bin_18"),bin_19:aa(r.bin_19,"bin_19"),bin_20:aa(r.bin_20,"bin_20"),bin_21:aa(r.bin_21,"bin_21"),bin_22:aa(r.bin_22,"bin_22"),bin_23:aa(r.bin_23,"bin_23"),bin_24:aa(r.bin_24,"bin_24"),bin_25:aa(r.bin_25,"bin_25"),bin_26:aa(r.bin_26,"bin_26"),bin_27:aa(r.bin_27,"bin_27"),bin_28:aa(r.bin_28,"bin_28"),bin_29:aa(r.bin_29,"bin_29"),bin_30:aa(r.bin_30,"bin_30"),bin_31:aa(r.bin_31,"bin_31")}}}(this.getRequestOptionsForCall(e))}async pingPeer(e,t){return e=new k(e),async function(e,t){return(await ur(e,{url:`pingpong/${t}`,responseType:"json",method:"POST"})).data}(this.getRequestOptionsForCall(t),e)}async getAllBalances(e){return async function(e){const t=await ur(e,{url:Yr,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(de(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPeerBalance(e,t){return e=new k(e),async function(e,t){const n=await ur(e,{url:`${Yr}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:ce.fromPLUR(de(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getPastDueConsumptionBalances(e){return async function(e){const t=await ur(e,{url:ea,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(de(e.balance,{name:"balance"}))})))}}(this.getRequestOptionsForCall(e))}async getPastDueConsumptionPeerBalance(e,t){return e=new k(e),async function(e,t){const n=await ur(e,{url:`${ea}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),balance:ce.fromPLUR(de(r.balance,{name:"balance"}))}}(this.getRequestOptionsForCall(t),e)}async getChequebookAddress(e){return async function(e){const t=await ur(e,{url:ta+"/address",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{chequebookAddress:new V(f.asString(n.chequebookAddress,{name:"chequebookAddress"}))}}(this.getRequestOptionsForCall(e))}async getChequebookBalance(e){return async function(e){const t=await ur(e,{url:ta+"/balance",responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{availableBalance:ce.fromPLUR(de(n.availableBalance,{name:"availableBalance"})),totalBalance:ce.fromPLUR(de(n.totalBalance,{name:"totalBalance"}))}}(this.getRequestOptionsForCall(e))}async getLastCheques(e){return async function(e){const t=await ur(e,{url:ta+"/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=>ra(e)),e.lastreceived),lastsent:f.asNullable((e=>ra(e)),e.lastsent)})))}}(this.getRequestOptionsForCall(e))}async getLastChequesForPeer(e,t){return e=new k(e),async function(e,t){const n=await ur(e,{url:ta+`/cheque/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),lastreceived:f.asNullable((e=>ra(e)),r.lastreceived),lastsent:f.asNullable((e=>ra(e)),r.lastsent)}}(this.getRequestOptionsForCall(t),e)}async getLastCashoutAction(e,t){return e=new k(e),na(this.getRequestOptionsForCall(t),e)}async cashoutLastCheque(e,t,n){return e=new k(e),t&&ye(t),async function(e,t,n){const r=await ur(e,{method:"post",url:ta+`/cashout/${t}`,responseType:"json",headers:Pe(null,n)}),a=f.asObject(r.data,{name:"response.data"});return new I(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():de(e,{min:1n,name:"amount"});let a;return t&&(a=de(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await ur(e,{method:"post",url:ta+"/deposit",responseType:"json",params:{amount:t.toString(10)},headers:r}),i=f.asObject(a.data,{name:"response.data"});return new I(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():de(e,{min:1n,name:"amount"});let a;return t&&(a=de(e,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await ur(e,{method:"post",url:ta+"/withdraw",responseType:"json",params:{amount:t.toString(10)},headers:r}),i=f.asObject(a.data,{name:"response.data"});return new I(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 V(t),async function(e,t,n){const r=await ur(e,{method:"post",url:`${ha}/withdraw/bzz`,responseType:"json",params:{amount:t.toPLURString(),address:n.toHex()}}),a=f.asObject(r.data,{name:"response.data"});return new I(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 V(t),async function(e,t,n){const r=await ur(e,{method:"post",url:`${ha}/withdraw/nativetoken`,responseType:"json",params:{amount:t.toWeiString(),address:n.toHex()}}),a=f.asObject(r.data,{name:"response.data"});return new I(f.asString(a.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,t)}async getSettlements(e,t){return e=new k(e),async function(e,t){const n=await ur(e,{url:`${ia}/${t}`,responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{peer:f.asString(r.peer,{name:"peer"}),sent:ce.fromPLUR(de(r.sent,{name:"sent"})),received:ce.fromPLUR(de(r.received,{name:"received"}))}}(this.getRequestOptionsForCall(t),e)}async getAllSettlements(e){return async function(e){const t=await ur(e,{url:ia,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{totalSent:ce.fromPLUR(de(n.totalSent,{name:"totalSent"})),totalReceived:ce.fromPLUR(de(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(de(e.sent,{name:"sent"})),received:ce.fromPLUR(de(e.received,{name:"received"}))})))}}(this.getRequestOptionsForCall(e))}async getStatus(e){return async function(e){const t=await ur(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 ba(this.getRequestOptionsForCall(e))}async getReadiness(e){return async function(e){const t=await ur(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 ur(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 ba(e);return t===pa}(this.getRequestOptionsForCall(e))}async isSupportedApiVersion(e){return async function(e){const{apiVersion:t}=await ba(e);return da()(t)===da()(ga)}(this.getRequestOptionsForCall(e))}async getVersions(e){return async function(e){const{version:t,apiVersion:n}=await ba(e);return{supportedBeeVersion:pa,supportedBeeApiVersion:ga,beeVersion:t,beeApiVersion:n}}(this.getRequestOptionsForCall(e))}async getReserveState(e){return async function(e){const t=await ur(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"}),reserveCapacityDoubling:f.asNumber(n.reserveCapacityDoubling,{name:"reserveCapacityDoubling"})}}(this.getRequestOptionsForCall(e))}async getChainState(e){return async function(e){const t=await ur(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:de(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 ur(e,{method:"get",url:`${ha}`,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return{bzzBalance:ce.fromPLUR(de(n.bzzBalance,{name:"bzzBalance"})),nativeTokenBalance:ue.fromWei(de(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=de(e,{min:0n,name:"amount"});if(n&&(n=be(n)),t<Y||t>ee)throw new _(`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 _(`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 ur(e,{method:"post",url:`${sa}/${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=Ce(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 xe(Ce(e,r,a),i)}async extendStorage(e,t,n,r,a,i){const o=await this.getPostageBatch(e,r),s=Ce(t,a,i),c=await this.getChainState(r),u=s-o.depth,l=u<=0?1n:2n**BigInt(u),h="gnosis"===this.network?5:15,f=De(n,c.currentPrice,h),d=De(o.duration,c.currentPrice,h),p=(n.isZero()?d*l:(d+f)*l)-d,m=await this.topUpBatch(o.batchID,p,r);return u>0?this.diluteBatch(o.batchID,s,r):m}async extendStorageSize(e,t,n,r,a){const i=await this.getChainState(n),o=await this.getPostageBatch(e,n),s=Ce(t,r,a),c=s-o.depth;if(c<=0)throw new _("New depth has to be greater than the original depth",s);const u=De(o.duration,i.currentPrice,"gnosis"===this.network?5:15);return await this.topUpBatch(o.batchID,u*(2n**BigInt(c)-1n)+1n,n),this.diluteBatch(o.batchID,s,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=await this.getChainState(r),c="gnosis"===this.network?5:15,u=n.isZero()?0n:De(n,s.currentPrice,c),l=Ce(t,a,i),h=De(o.duration,s.currentPrice,c),f=xe(o.depth,h);return xe(Math.max(o.depth,l),h+u).minus(f)}async getSizeExtensionCost(e,t,n,r,a){const i=await this.getPostageBatch(e,n),o=await this.getChainState(n),s=Ce(t,r,a);if(s-i.depth<=0)throw new _("New depth has to be greater than the original depth",s);const c=De(i.duration,o.currentPrice,"gnosis"===this.network?5:15),u=xe(i.depth,c);return xe(s,c).minus(u)}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 xe(r.depth,a)}async calculateTopUpForBzz(e,t,n){const r=await this.getChainState(n),a="gnosis"===this.network?5:15,i=t.toPLURBigInt()/2n**BigInt(e);return{amount:i,duration:Ae(i,r.currentPrice,a)}}async topUpBatch(e,t,n){e=new $(e);const r=de(t,{min:1n,name:"amount"});return async function(e,t,n){const r=await ur(e,{method:"patch",url:`${sa}/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 ur(e,{method:"patch",url:`${sa}/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,n,r){return e=new $(e),async function(e,t,n,r){const a=await ur(e,{method:"get",url:`${sa}/${t}`,responseType:"json"});return Ne(la(f.asObject(a.data,{name:"response.data"})),n,r)}(this.getRequestOptionsForCall(t),e,n,r)}async getPostageBatchBuckets(e,t){return e=new $(e),async function(e,t){const n=await ur(e,{method:"get",url:`${sa}/${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 ua(this.getRequestOptionsForCall(e))}async getAllGlobalPostageBatch(e){return ca(this.getRequestOptionsForCall(e))}async getPostageBatches(e){return ua(this.getRequestOptionsForCall(e))}async getGlobalPostageBatches(e){return ca(this.getRequestOptionsForCall(e))}async getAllPendingTransactions(e){return async function(e){const t=await ur(e,{url:ya,responseType:"json"}),n=f.asObject(t.data,{name:"response.data"});return f.asArray(n.pendingTransactions,{name:"pendingTransactions"}).map(wa)}(this.getRequestOptionsForCall(e))}async getPendingTransaction(e,t){return e=new I(e),async function(e,t){const n=await ur(e,{url:`${ya}/${t}`,responseType:"json"});return wa(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 ur(e,{method:"post",url:`${ya}/${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=de(t,{min:0n,name:"gasPrice"})),async function(e,t,n){const r={};n&&(r["gas-price"]=n.toString());const a=await ur(e,{method:"delete",headers:r,url:`${ya}/${t}`,responseType:"json"}),i=f.asObject(a.data,{name:"response.data"});return new I(f.asString(i.transactionHash,{name:"transactionHash"}))}(this.getRequestOptionsForCall(n),e,r)}async getStake(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:`${oa}`}),n=f.asObject(t.data,{name:"response.data"});return ce.fromPLUR(de(n.stakedAmount,{name:"stakedAmount"}))}(this.getRequestOptionsForCall(e))}async getWithdrawableStake(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:`${oa}/withdrawable`}),n=f.asObject(t.data,{name:"response.data"});return ce.fromPLUR(de(n.withdrawableAmount,{name:"withdrawableAmount"}))}(this.getRequestOptionsForCall(e))}async withdrawSurplusStake(e){return async function(e){const t=await ur(e,{method:"delete",responseType:"json",url:`${oa}/withdrawable`}),n=f.asObject(t.data,{name:"response.data"});return new I(f.asHexString(n.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(e))}async migrateStake(e){return async function(e){const t=await ur(e,{method:"delete",responseType:"json",url:oa}),n=f.asObject(t.data,{name:"response.data"});return new I(f.asHexString(n.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(e))}async depositStake(e,t,n){const r=e instanceof ce?e.toPLURString():de(e,{min:1n,name:"amount"});return t&&(t=ye(t)),async function(e,t,n){const r=await ur(e,{method:"post",responseType:"json",url:`${oa}/${t}`,headers:Pe(null,n)}),a=f.asObject(r.data,{name:"response.data"});return new I(f.asHexString(a.txHash,{name:"txHash"}))}(this.getRequestOptionsForCall(n),r,t)}async getRedistributionState(e){return async function(e){const t=await ur(e,{method:"get",responseType:"json",url:"redistributionstate"}),n=f.asObject(t.data,{name:"response.data"});return{minimumGasFunds:ue.fromWei(de(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(de(n.reward,{name:"reward"})),fees:ue.fromWei(de(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 h.sleepMillis(3e3)}throw new M("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),signal:t.signal}}(e)),e?u.deepMerge2(this.requestOptions,e):this.requestOptions}}class Wa extends Ha{async getNodeAddresses(e){const t=super.getRequestOptionsForCall(e),n=await ur(t,{url:"addresses",responseType:"json"}),r=f.asObject(n.data,{name:"response.data"});return{overlay:new k(f.asString(r.overlay,{name:"overlay"})),underlay:[],ethereum:new V(f.asString(r.ethereum,{name:"ethereum"})),publicKey:new C(f.asString(r.publicKey,{name:"publicKey"})),pssPublicKey:new C(f.asString(r.pssPublicKey,{name:"pssPublicKey"}))}}async getTopology(e){const t=super.getRequestOptionsForCall(e),n=await ur(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:aa(a.bin_0,"bin_0"),bin_1:aa(a.bin_1,"bin_1"),bin_2:aa(a.bin_2,"bin_2"),bin_3:aa(a.bin_3,"bin_3"),bin_4:aa(a.bin_4,"bin_4"),bin_5:aa(a.bin_5,"bin_5"),bin_6:aa(a.bin_6,"bin_6"),bin_7:aa(a.bin_7,"bin_7"),bin_8:aa(a.bin_8,"bin_8"),bin_9:aa(a.bin_9,"bin_9"),bin_10:aa(a.bin_10,"bin_10"),bin_11:aa(a.bin_11,"bin_11"),bin_12:aa(a.bin_12,"bin_12"),bin_13:aa(a.bin_13,"bin_13"),bin_14:aa(a.bin_14,"bin_14"),bin_15:aa(a.bin_15,"bin_15"),bin_16:aa(a.bin_16,"bin_16"),bin_17:aa(a.bin_17,"bin_17"),bin_18:aa(a.bin_18,"bin_18"),bin_19:aa(a.bin_19,"bin_19"),bin_20:aa(a.bin_20,"bin_20"),bin_21:aa(a.bin_21,"bin_21"),bin_22:aa(a.bin_22,"bin_22"),bin_23:aa(a.bin_23,"bin_23"),bin_24:aa(a.bin_24,"bin_24"),bin_25:aa(a.bin_25,"bin_25"),bin_26:aa(a.bin_26,"bin_26"),bin_27:aa(a.bin_27,"bin_27"),bin_28:aa(a.bin_28,"bin_28"),bin_29:aa(a.bin_29,"bin_29"),bin_30:aa(a.bin_30,"bin_30"),bin_31:aa(a.bin_31,"bin_31")}}}}class Ka{constructor(e,t,n,r){this.signer=new D(e),this.batchId=new $(t),this.buckets=n,this.depth=r,this.maxSlot=2**(this.depth-16)}static fromBlank(e,t,n){return new Ka(e,t,new Uint32Array(65536),n)}static fromState(e,t,n,r){return new Ka(e,t,n,r)}stamp(e){const t=e.hash(),n=i.uint16ToNumber(t,"BE"),r=this.buckets[n];if(r>=this.maxSlot)throw Error("Bucket is full");this.buckets[n]++;const a=i.concatBytes(i.numberToUint32(n,"BE"),i.numberToUint32(r,"BE")),o=i.numberToUint64(BigInt(Date.now()),"BE"),s=this.signer.sign(i.concatBytes(t,this.batchId.toUint8Array(),a,o));return{batchId:this.batchId,index:a,issuer:this.signer.publicKey().address().toUint8Array(),signature:s.toUint8Array(),timestamp:o}}getState(){return this.buckets}}const Xa="https://api.gateway.ethswarm.org",Ja=new $("0000000000000000000000000000000000000000000000000000000000000000"),Za=new U("0000000000000000000000000000000000000000000000000000000000000000"),Qa=new Uint8Array(32),Ya=new Uint8Array(32),ei=new Uint8Array(20);function ti(e){return(e=new k(e)).toHex().slice(0,Q)}const ni=[[94,68,46,28,14,5,1],[9,8,7,6,5,4,3]],ri=[[47,34,23,14,7,2],[9,8,7,6,5,4]],ai=[[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]],ii=[[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]],oi=[[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]],si=[[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]],ci=[[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]],ui=[[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 li(e,t,n){if(t===re.OFF)return 0;const r=function(e,t){switch(e){case re.MEDIUM:return t?ri:ni;case re.STRONG:return t?ii:ai;case re.INSANE:return t?si:oi;case re.PARANOID:return t?ui:ci;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 hi={label:"medium",value:re.MEDIUM,errorTolerance:.01},fi={label:"strong",value:re.STRONG,errorTolerance:.05},di={label:"insane",value:re.INSANE,errorTolerance:.1},pi={label:"paranoid",value:re.PARANOID,errorTolerance:.5};function mi(){return{medium:hi,strong:fi,insane:di,paranoid:pi}}function gi(e){if("string"==typeof e)switch(e.toLowerCase()){case"medium":return hi;case"strong":return fi;case"insane":return di;case"paranoid":return pi;default:throw new Error(`Unknown redundancy level '${e}'`)}switch(e){case re.MEDIUM:return hi;case re.STRONG:return fi;case re.INSANE:return di;case re.PARANOID:return pi;default:throw new Error(`Unknown redundancy level '${e}'`)}}})(),r})()));
2
2
  //# sourceMappingURL=index.browser.min.js.map