@matchain/matchid-sdk-react 0.1.53-alpha.2 → 0.1.53-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icon/index.d.mts +4 -2
- package/dist/assets/icon/index.d.ts +4 -2
- package/dist/assets/icon/index.js +19 -0
- package/dist/assets/icon/index.js.map +1 -1
- package/dist/assets/icon/index.mjs +3 -1
- package/dist/{chunk-LHNKZISB.mjs → chunk-3USZ4ZZY.mjs} +20 -2
- package/dist/chunk-3USZ4ZZY.mjs.map +1 -0
- package/dist/{chunk-W5A6WY7Y.mjs → chunk-3YF3P77J.mjs} +46 -8
- package/dist/chunk-3YF3P77J.mjs.map +1 -0
- package/dist/{chunk-4A2YPGO3.mjs → chunk-4EVF2PXX.mjs} +2 -2
- package/dist/{chunk-MX7N57AH.mjs → chunk-OCQ2AIM3.mjs} +7 -2
- package/dist/{chunk-MX7N57AH.mjs.map → chunk-OCQ2AIM3.mjs.map} +1 -1
- package/dist/{chunk-FB5MHLWX.mjs → chunk-V2S54LGG.mjs} +2 -2
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +403 -346
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -5
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +47 -44
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +5 -5
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +175 -172
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/{index-K5vXmiRX.d.ts → index-BKHtf1Tu.d.ts} +1 -1
- package/dist/{index-DNJuiNdz.d.mts → index-BSUoL5Jo.d.mts} +2 -2
- package/dist/{index-Df-WlkXq.d.ts → index-BVO4Bt59.d.ts} +2 -2
- package/dist/{index-IwwXQ_QV.d.ts → index-CcN5ls1U.d.ts} +1 -1
- package/dist/{index-BsL6zo6a.d.ts → index-Cul4qlZl.d.ts} +1 -1
- package/dist/{index-yy3VTdFU.d.mts → index-CvVl_Xw1.d.mts} +2 -2
- package/dist/{index-BCGJczpk.d.mts → index-DXRsJY9h.d.mts} +1 -1
- package/dist/{index-Bil_db2f.d.mts → index-DgwlV4ve.d.ts} +1 -1
- package/dist/{index-iWHaT8HV.d.mts → index-DrEKzXYX.d.mts} +1 -1
- package/dist/{index-BS-NO8Y2.d.ts → index-EPwrSSOz.d.mts} +1 -1
- package/dist/{index-CZqdmQu1.d.mts → index-ba3VTkaV.d.mts} +1 -1
- package/dist/{index-B8cUP7cH.d.ts → index-lKJjj0w4.d.ts} +2 -2
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +442 -385
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-CZbR7ERa.d.mts → types-Bgd3Ac92.d.mts} +1 -1
- package/dist/{types-CZbR7ERa.d.ts → types-Bgd3Ac92.d.ts} +1 -1
- package/dist/ui/index.d.mts +3 -3
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +62 -59
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +2 -2
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +3 -1
- package/example/dist/assets/ccip-nxE3Zma4.js +1 -0
- package/example/dist/assets/index-BFAv3rdU.css +1 -0
- package/example/dist/assets/index-DMWWRDPI.js +1658 -0
- package/example/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-LHNKZISB.mjs.map +0 -1
- package/dist/chunk-W5A6WY7Y.mjs.map +0 -1
- package/example/dist/assets/TransportWebHID-BEu7tC0r.js +0 -1
- package/example/dist/assets/bignumber-iG7K-qxw.js +0 -10
- package/example/dist/assets/ccip-a6wQ1Vcb.js +0 -1
- package/example/dist/assets/draggabilly-CRYR_S0q.js +0 -14
- package/example/dist/assets/index--dp9m9Ep.js +0 -1
- package/example/dist/assets/index-BDTHolFv.js +0 -569
- package/example/dist/assets/index-BZl59qLb.js +0 -179
- package/example/dist/assets/index-BmMbYNHO.js +0 -303
- package/example/dist/assets/index-C7cxVRDF.js +0 -1677
- package/example/dist/assets/index-CJk171Yb.js +0 -1
- package/example/dist/assets/index-CQiBesAa.js +0 -3
- package/example/dist/assets/index-D62loNA9.js +0 -3
- package/example/dist/assets/index-DqyX3FG6.js +0 -1
- package/example/dist/assets/index-Gy3FXGhr.css +0 -1
- package/example/dist/assets/inherits_browser-BlmhoU4v.js +0 -1
- package/example/dist/assets/solanaEmbed.esm-Djn-u4Vn.js +0 -38
- /package/dist/{chunk-4A2YPGO3.mjs.map → chunk-4EVF2PXX.mjs.map} +0 -0
- /package/dist/{chunk-FB5MHLWX.mjs.map → chunk-V2S54LGG.mjs.map} +0 -0
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{h as Ti,q as or,e as Ii,g as Z1,c as Ke,r as Vi,j as Cg,s as X1,P as Pg}from"./index-C7cxVRDF.js";import{r as il,a as Q1}from"./bignumber-iG7K-qxw.js";import{a as eR}from"./index-CJk171Yb.js";import{i as Ds}from"./inherits_browser-BlmhoU4v.js";function Cs(e){"@babel/helpers - typeof";return Cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cs(e)}function tR(e,t){if(Cs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(Cs(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nR(e){var t=tR(e,"string");return Cs(t)=="symbol"?t:t+""}function Be(e,t,r){return(t=nR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rR={exports:{}},mc={exports:{}};let iR=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let o=0;o<t.length;o++)r+=` ${t[o].stack}
|
|
2
|
-
`;super(r),this.name="AggregateError",this.errors=t}};var mt={AggregateError:iR,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array},d0={exports:{}},h0={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,o]){const a=t.shift();return o==="f"?a.toFixed(6):o==="j"?JSON.stringify(a):o==="s"&&typeof a=="object"?`${a.constructor!==Object?a.constructor.name:""} {}`.trim():a.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}};const{format:oR,inspect:fu}=h0,{AggregateError:sR}=mt,aR=globalThis.AggregateError||sR,uR=Symbol("kIsNodeError"),fR=["string","function","number","object","Function","Object","boolean","bigint","symbol"],cR=/^([A-Z][a-z0-9]*)+$/,lR="__node_internal_",Eu={};function Ki(e,t){if(!e)throw new Eu.ERR_INTERNAL_ASSERTION(t)}function Bg(e){let t="",r=e.length;const o=e[0]==="-"?1:0;for(;r>=o+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function dR(e,t,r){if(typeof t=="function")return Ki(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const o=(t.match(/%[dfijoOs]/g)||[]).length;return Ki(o===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${o}).`),r.length===0?t:oR(t,...r)}function Vt(e,t,r){r||(r=Error);class o extends r{constructor(...u){super(dR(e,t,u))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[uR]=!0,Eu[e]=o}function Lg(e){const t=lR+e.name;return Object.defineProperty(e,"name",{value:t}),e}function hR(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new aR([t,e],t.message);return r.code=t.code,r}return e||t}let gR=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Eu.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};Vt("ERR_ASSERTION","%s",Error);Vt("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Ki(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let o="The ";e.endsWith(" argument")?o+=`${e} `:o+=`"${e}" ${e.includes(".")?"property":"argument"} `,o+="must be ";const a=[],u=[],f=[];for(const h of t)Ki(typeof h=="string","All expected entries have to be of type string"),fR.includes(h)?a.push(h.toLowerCase()):cR.test(h)?u.push(h):(Ki(h!=="object",'The value "object" should be written as "Object"'),f.push(h));if(u.length>0){const h=a.indexOf("object");h!==-1&&(a.splice(a,h,1),u.push("Object"))}if(a.length>0){switch(a.length){case 1:o+=`of type ${a[0]}`;break;case 2:o+=`one of type ${a[0]} or ${a[1]}`;break;default:{const h=a.pop();o+=`one of type ${a.join(", ")}, or ${h}`}}(u.length>0||f.length>0)&&(o+=" or ")}if(u.length>0){switch(u.length){case 1:o+=`an instance of ${u[0]}`;break;case 2:o+=`an instance of ${u[0]} or ${u[1]}`;break;default:{const h=u.pop();o+=`an instance of ${u.join(", ")}, or ${h}`}}f.length>0&&(o+=" or ")}switch(f.length){case 0:break;case 1:f[0].toLowerCase()!==f[0]&&(o+="an "),o+=`${f[0]}`;break;case 2:o+=`one of ${f[0]} or ${f[1]}`;break;default:{const h=f.pop();o+=`one of ${f.join(", ")}, or ${h}`}}if(r==null)o+=`. Received ${r}`;else if(typeof r=="function"&&r.name)o+=`. Received function ${r.name}`;else if(typeof r=="object"){var l;if((l=r.constructor)!==null&&l!==void 0&&l.name)o+=`. Received an instance of ${r.constructor.name}`;else{const h=fu(r,{depth:-1});o+=`. Received ${h}`}}else{let h=fu(r,{colors:!1});h.length>25&&(h=`${h.slice(0,25)}...`),o+=`. Received type ${typeof r} (${h})`}return o},TypeError);Vt("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let o=fu(t);return o.length>128&&(o=o.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${o}`},TypeError);Vt("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var o;const a=r!=null&&(o=r.constructor)!==null&&o!==void 0&&o.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${a}.`},TypeError);Vt("ERR_MISSING_ARGS",(...e)=>{Ki(e.length>0,"At least one arg needs to be specified");let t;const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(o=>`"${o}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const o=e.pop();t+=`The ${e.join(", ")}, and ${o} arguments`}break}return`${t} must be specified`},TypeError);Vt("ERR_OUT_OF_RANGE",(e,t,r)=>{Ki(t,'Missing "range" argument');let o;if(Number.isInteger(r)&&Math.abs(r)>2**32)o=Bg(String(r));else if(typeof r=="bigint"){o=String(r);const a=BigInt(2)**BigInt(32);(r>a||r<-a)&&(o=Bg(o)),o+="n"}else o=fu(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${o}`},RangeError);Vt("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Vt("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Vt("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Vt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Vt("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Vt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Vt("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Vt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Vt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Vt("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Vt("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var ln={AbortError:gR,aggregateTwoErrors:Lg(hR),hideStackFrames:Lg,codes:Eu},bs={exports:{}},xg;function Ps(){if(xg)return bs.exports;xg=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return bs.exports=e,bs.exports.AbortSignal=t,bs.exports.default=e,bs.exports}(function(e){const t=or,{format:r,inspect:o}=h0,{codes:{ERR_INVALID_ARG_TYPE:a}}=ln,{kResistStopPropagation:u,AggregateError:f,SymbolDispose:l}=mt,h=globalThis.AbortSignal||Ps().AbortSignal,d=globalThis.AbortController||Ps().AbortController,p=Object.getPrototypeOf(async function(){}).constructor,w=globalThis.Blob||t.Blob,T=typeof w<"u"?function(P){return P instanceof w}:function(P){return!1},v=(C,P)=>{if(C!==void 0&&(C===null||typeof C!="object"||!("aborted"in C)))throw new a(P,"AbortSignal",C)},k=(C,P)=>{if(typeof C!="function")throw new a(P,"Function",C)};e.exports={AggregateError:f,kEmptyObject:Object.freeze({}),once(C){let P=!1;return function(...$){P||(P=!0,C.apply(this,$))}},createDeferredPromise:function(){let C,P;return{promise:new Promise((L,S)=>{C=L,P=S}),resolve:C,reject:P}},promisify(C){return new Promise((P,$)=>{C((L,...S)=>L?$(L):P(...S))})},debuglog(){return function(){}},format:r,inspect:o,types:{isAsyncFunction(C){return C instanceof p},isArrayBufferView(C){return ArrayBuffer.isView(C)}},isBlob:T,deprecate(C,P){return C},addAbortListener:Ti.addAbortListener||function(P,$){if(P===void 0)throw new a("signal","AbortSignal",P);v(P,"signal"),k($,"listener");let L;return P.aborted?queueMicrotask(()=>$()):(P.addEventListener("abort",$,{__proto__:null,once:!0,[u]:!0}),L=()=>{P.removeEventListener("abort",$)}),{__proto__:null,[l](){var S;(S=L)===null||S===void 0||S()}}},AbortSignalAny:h.any||function(P){if(P.length===1)return P[0];const $=new d,L=()=>$.abort();return P.forEach(S=>{v(S,"signals"),S.addEventListener("abort",L,{once:!0})}),$.signal.addEventListener("abort",()=>{P.forEach(S=>S.removeEventListener("abort",L))},{once:!0}),$.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(d0);var wn=d0.exports,$l={};const{ArrayIsArray:Dl,ArrayPrototypeIncludes:g0,ArrayPrototypeJoin:p0,ArrayPrototypeMap:pR,NumberIsInteger:jl,NumberIsNaN:bR,NumberMAX_SAFE_INTEGER:yR,NumberMIN_SAFE_INTEGER:_R,NumberParseInt:wR,ObjectPrototypeHasOwnProperty:mR,RegExpPrototypeExec:b0,String:vR,StringPrototypeToUpperCase:ER,StringPrototypeTrim:SR}=mt,{hideStackFrames:zn,codes:{ERR_SOCKET_BAD_PORT:RR,ERR_INVALID_ARG_TYPE:tn,ERR_INVALID_ARG_VALUE:Ho,ERR_OUT_OF_RANGE:Ji,ERR_UNKNOWN_SIGNAL:Ng}}=ln,{normalizeEncoding:AR}=wn,{isAsyncFunction:TR,isArrayBufferView:IR}=wn.types,Mg={};function OR(e){return e===(e|0)}function CR(e){return e===e>>>0}const PR=/^[0-7]+$/,BR="must be a 32-bit unsigned integer or an octal string";function LR(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(b0(PR,e)===null)throw new Ho(t,e,BR);e=wR(e,8)}return y0(e,t),e}const xR=zn((e,t,r=_R,o=yR)=>{if(typeof e!="number")throw new tn(t,"number",e);if(!jl(e))throw new Ji(t,"an integer",e);if(e<r||e>o)throw new Ji(t,`>= ${r} && <= ${o}`,e)}),NR=zn((e,t,r=-2147483648,o=2147483647)=>{if(typeof e!="number")throw new tn(t,"number",e);if(!jl(e))throw new Ji(t,"an integer",e);if(e<r||e>o)throw new Ji(t,`>= ${r} && <= ${o}`,e)}),y0=zn((e,t,r=!1)=>{if(typeof e!="number")throw new tn(t,"number",e);if(!jl(e))throw new Ji(t,"an integer",e);const o=r?1:0,a=4294967295;if(e<o||e>a)throw new Ji(t,`>= ${o} && <= ${a}`,e)});function Ul(e,t){if(typeof e!="string")throw new tn(t,"string",e)}function MR(e,t,r=void 0,o){if(typeof e!="number")throw new tn(t,"number",e);if(r!=null&&e<r||o!=null&&e>o||(r!=null||o!=null)&&bR(e))throw new Ji(t,`${r!=null?`>= ${r}`:""}${r!=null&&o!=null?" && ":""}${o!=null?`<= ${o}`:""}`,e)}const $R=zn((e,t,r)=>{if(!g0(r,e)){const a="must be one of: "+p0(pR(r,u=>typeof u=="string"?`'${u}'`:vR(u)),", ");throw new Ho(t,e,a)}});function _0(e,t){if(typeof e!="boolean")throw new tn(t,"boolean",e)}function vc(e,t,r){return e==null||!mR(e,t)?r:e[t]}const DR=zn((e,t,r=null)=>{const o=vc(r,"allowArray",!1),a=vc(r,"allowFunction",!1);if(!vc(r,"nullable",!1)&&e===null||!o&&Dl(e)||typeof e!="object"&&(!a||typeof e!="function"))throw new tn(t,"Object",e)}),jR=zn((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new tn(t,"a dictionary",e)}),Su=zn((e,t,r=0)=>{if(!Dl(e))throw new tn(t,"Array",e);if(e.length<r){const o=`must be longer than ${r}`;throw new Ho(t,e,o)}});function UR(e,t){Su(e,t);for(let r=0;r<e.length;r++)Ul(e[r],`${t}[${r}]`)}function kR(e,t){Su(e,t);for(let r=0;r<e.length;r++)_0(e[r],`${t}[${r}]`)}function HR(e,t){Su(e,t);for(let r=0;r<e.length;r++){const o=e[r],a=`${t}[${r}]`;if(o==null)throw new tn(a,"AbortSignal",o);w0(o,a)}}function WR(e,t="signal"){if(Ul(e,t),Mg[e]===void 0)throw Mg[ER(e)]!==void 0?new Ng(e+" (signals must use all capital letters)"):new Ng(e)}const FR=zn((e,t="buffer")=>{if(!IR(e))throw new tn(t,["Buffer","TypedArray","DataView"],e)});function qR(e,t){const r=AR(t),o=e.length;if(r==="hex"&&o%2!==0)throw new Ho("encoding",t,`is invalid for data of length ${o}`)}function VR(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&SR(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new RR(t,e,r);return e|0}const w0=zn((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new tn(t,"AbortSignal",e)}),zR=zn((e,t)=>{if(typeof e!="function")throw new tn(t,"Function",e)}),GR=zn((e,t)=>{if(typeof e!="function"||TR(e))throw new tn(t,"Function",e)}),KR=zn((e,t)=>{if(e!==void 0)throw new tn(t,"undefined",e)});function JR(e,t,r){if(!g0(r,e))throw new tn(t,`('${p0(r,"|")}')`,e)}const YR=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function $g(e,t){if(typeof e>"u"||!b0(YR,e))throw new Ho(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ZR(e){if(typeof e=="string")return $g(e,"hints"),e;if(Dl(e)){const t=e.length;let r="";if(t===0)return r;for(let o=0;o<t;o++){const a=e[o];$g(a,"hints"),r+=a,o!==t-1&&(r+=", ")}return r}throw new Ho("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var js={isInt32:OR,isUint32:CR,parseFileMode:LR,validateArray:Su,validateStringArray:UR,validateBooleanArray:kR,validateAbortSignalArray:HR,validateBoolean:_0,validateBuffer:FR,validateDictionary:jR,validateEncoding:qR,validateFunction:zR,validateInt32:NR,validateInteger:xR,validateNumber:MR,validateObject:DR,validateOneOf:$R,validatePlainFunction:GR,validatePort:VR,validateSignalName:WR,validateString:Ul,validateUint32:y0,validateUndefined:KR,validateUnion:JR,validateAbortSignal:w0,validateLinkHeaderValue:ZR},kl={exports:{}},m0={exports:{}},Ot=m0.exports={},mr,vr;function ol(){throw new Error("setTimeout has not been defined")}function sl(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?mr=setTimeout:mr=ol}catch{mr=ol}try{typeof clearTimeout=="function"?vr=clearTimeout:vr=sl}catch{vr=sl}})();function v0(e){if(mr===setTimeout)return setTimeout(e,0);if((mr===ol||!mr)&&setTimeout)return mr=setTimeout,setTimeout(e,0);try{return mr(e,0)}catch{try{return mr.call(null,e,0)}catch{return mr.call(this,e,0)}}}function XR(e){if(vr===clearTimeout)return clearTimeout(e);if((vr===sl||!vr)&&clearTimeout)return vr=clearTimeout,clearTimeout(e);try{return vr(e)}catch{try{return vr.call(null,e)}catch{return vr.call(this,e)}}}var Yr=[],Co=!1,zi,iu=-1;function QR(){!Co||!zi||(Co=!1,zi.length?Yr=zi.concat(Yr):iu=-1,Yr.length&&E0())}function E0(){if(!Co){var e=v0(QR);Co=!0;for(var t=Yr.length;t;){for(zi=Yr,Yr=[];++iu<t;)zi&&zi[iu].run();iu=-1,t=Yr.length}zi=null,Co=!1,XR(e)}}Ot.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Yr.push(new S0(e,t)),Yr.length===1&&!Co&&v0(E0)};function S0(e,t){this.fun=e,this.array=t}S0.prototype.run=function(){this.fun.apply(null,this.array)};Ot.title="browser";Ot.browser=!0;Ot.env={};Ot.argv=[];Ot.version="";Ot.versions={};function ti(){}Ot.on=ti;Ot.addListener=ti;Ot.once=ti;Ot.off=ti;Ot.removeListener=ti;Ot.removeAllListeners=ti;Ot.emit=ti;Ot.prependListener=ti;Ot.prependOnceListener=ti;Ot.listeners=function(e){return[]};Ot.binding=function(e){throw new Error("process.binding is not supported")};Ot.cwd=function(){return"/"};Ot.chdir=function(e){throw new Error("process.chdir is not supported")};Ot.umask=function(){return 0};var Qi=m0.exports;const{SymbolAsyncIterator:Dg,SymbolIterator:jg,SymbolFor:eo}=mt,R0=eo("nodejs.stream.destroyed"),A0=eo("nodejs.stream.errored"),al=eo("nodejs.stream.readable"),ul=eo("nodejs.stream.writable"),T0=eo("nodejs.stream.disturbed"),eA=eo("nodejs.webstream.isClosedPromise"),tA=eo("nodejs.webstream.controllerErrorFunction");function Ru(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Au(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function nA(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function Pr(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function I0(e){return!!(e&&!Pr(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function O0(e){return!!(e&&!Pr(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function C0(e){return!!(e&&!Pr(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function rA(e){return I0(e)||O0(e)||C0(e)}function iA(e,t){return e==null?!1:t===!0?typeof e[Dg]=="function":t===!1?typeof e[jg]=="function":typeof e[Dg]=="function"||typeof e[jg]=="function"}function Tu(e){if(!Pr(e))return null;const t=e._writableState,r=e._readableState,o=t||r;return!!(e.destroyed||e[R0]||o!=null&&o.destroyed)}function P0(e){if(!Au(e))return null;if(e.writableEnded===!0)return!0;const t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function oA(e,t){if(!Au(e))return null;if(e.writableFinished===!0)return!0;const r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function sA(e){if(!Ru(e))return null;if(e.readableEnded===!0)return!0;const t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function B0(e,t){if(!Ru(e))return null;const r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function L0(e){return e&&e[al]!=null?e[al]:typeof(e==null?void 0:e.readable)!="boolean"?null:Tu(e)?!1:Ru(e)&&e.readable&&!B0(e)}function x0(e){return e&&e[ul]!=null?e[ul]:typeof(e==null?void 0:e.writable)!="boolean"?null:Tu(e)?!1:Au(e)&&e.writable&&!P0(e)}function aA(e,t){return Pr(e)?Tu(e)?!0:!((t==null?void 0:t.readable)!==!1&&L0(e)||(t==null?void 0:t.writable)!==!1&&x0(e)):null}function uA(e){var t,r;return Pr(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function fA(e){var t,r;return Pr(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function cA(e){if(!Pr(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&N0(e)?e._closed:null}function N0(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function M0(e){return typeof e._sent100=="boolean"&&N0(e)}function lA(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function dA(e){if(!Pr(e))return null;const t=e._writableState,r=e._readableState,o=t||r;return!o&&M0(e)||!!(o&&o.autoDestroy&&o.emitClose&&o.closed===!1)}function hA(e){var t;return!!(e&&((t=e[T0])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function gA(e){var t,r,o,a,u,f,l,h,d,p;return!!(e&&((t=(r=(o=(a=(u=(f=e[A0])!==null&&f!==void 0?f:e.readableErrored)!==null&&u!==void 0?u:e.writableErrored)!==null&&a!==void 0?a:(l=e._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&o!==void 0?o:(h=e._writableState)===null||h===void 0?void 0:h.errorEmitted)!==null&&r!==void 0?r:(d=e._readableState)===null||d===void 0?void 0:d.errored)!==null&&t!==void 0?t:!((p=e._writableState)===null||p===void 0)&&p.errored))}var ni={isDestroyed:Tu,kIsDestroyed:R0,isDisturbed:hA,kIsDisturbed:T0,isErrored:gA,kIsErrored:A0,isReadable:L0,kIsReadable:al,kIsClosedPromise:eA,kControllerErrorFunction:tA,kIsWritable:ul,isClosed:cA,isDuplexNodeStream:nA,isFinished:aA,isIterable:iA,isReadableNodeStream:Ru,isReadableStream:I0,isReadableEnded:sA,isReadableFinished:B0,isReadableErrored:fA,isNodeStream:Pr,isWebStream:rA,isWritable:x0,isWritableNodeStream:Au,isWritableStream:O0,isWritableEnded:P0,isWritableFinished:oA,isWritableErrored:uA,isServerRequest:lA,isServerResponse:M0,willEmitClose:dA,isTransformStream:C0};const wi=Qi,{AbortError:$0,codes:pA}=ln,{ERR_INVALID_ARG_TYPE:bA,ERR_STREAM_PREMATURE_CLOSE:Ug}=pA,{kEmptyObject:fl,once:cl}=wn,{validateAbortSignal:yA,validateFunction:_A,validateObject:wA,validateBoolean:mA}=js,{Promise:vA,PromisePrototypeThen:EA,SymbolDispose:D0}=mt,{isClosed:SA,isReadable:kg,isReadableNodeStream:Ec,isReadableStream:RA,isReadableFinished:Hg,isReadableErrored:Wg,isWritable:Fg,isWritableNodeStream:qg,isWritableStream:AA,isWritableFinished:Vg,isWritableErrored:zg,isNodeStream:TA,willEmitClose:IA,kIsClosedPromise:OA}=ni;let Po;function CA(e){return e.setHeader&&typeof e.abort=="function"}const ll=()=>{};function j0(e,t,r){var o,a;if(arguments.length===2?(r=t,t=fl):t==null?t=fl:wA(t,"options"),_A(r,"callback"),yA(t.signal,"options.signal"),r=cl(r),RA(e)||AA(e))return PA(e,t,r);if(!TA(e))throw new bA("stream",["ReadableStream","WritableStream","Stream"],e);const u=(o=t.readable)!==null&&o!==void 0?o:Ec(e),f=(a=t.writable)!==null&&a!==void 0?a:qg(e),l=e._writableState,h=e._readableState,d=()=>{e.writable||T()};let p=IA(e)&&Ec(e)===u&&qg(e)===f,w=Vg(e,!1);const T=()=>{w=!0,e.destroyed&&(p=!1),!(p&&(!e.readable||u))&&(!u||v)&&r.call(e)};let v=Hg(e,!1);const k=()=>{v=!0,e.destroyed&&(p=!1),!(p&&(!e.writable||f))&&(!f||w)&&r.call(e)},C=H=>{r.call(e,H)};let P=SA(e);const $=()=>{P=!0;const H=zg(e)||Wg(e);if(H&&typeof H!="boolean")return r.call(e,H);if(u&&!v&&Ec(e,!0)&&!Hg(e,!1))return r.call(e,new Ug);if(f&&!w&&!Vg(e,!1))return r.call(e,new Ug);r.call(e)},L=()=>{P=!0;const H=zg(e)||Wg(e);if(H&&typeof H!="boolean")return r.call(e,H);r.call(e)},S=()=>{e.req.on("finish",T)};CA(e)?(e.on("complete",T),p||e.on("abort",$),e.req?S():e.on("request",S)):f&&!l&&(e.on("end",d),e.on("close",d)),!p&&typeof e.aborted=="boolean"&&e.on("aborted",$),e.on("end",k),e.on("finish",T),t.error!==!1&&e.on("error",C),e.on("close",$),P?wi.nextTick($):l!=null&&l.errorEmitted||h!=null&&h.errorEmitted?p||wi.nextTick(L):(!u&&(!p||kg(e))&&(w||Fg(e)===!1)||!f&&(!p||Fg(e))&&(v||kg(e)===!1)||h&&e.req&&e.aborted)&&wi.nextTick(L);const m=()=>{r=ll,e.removeListener("aborted",$),e.removeListener("complete",T),e.removeListener("abort",$),e.removeListener("request",S),e.req&&e.req.removeListener("finish",T),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",T),e.removeListener("end",k),e.removeListener("error",C),e.removeListener("close",$)};if(t.signal&&!P){const H=()=>{const ee=r;m(),ee.call(e,new $0(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)wi.nextTick(H);else{Po=Po||wn.addAbortListener;const ee=Po(t.signal,H),ge=r;r=cl((...fe)=>{ee[D0](),ge.apply(e,fe)})}}return m}function PA(e,t,r){let o=!1,a=ll;if(t.signal)if(a=()=>{o=!0,r.call(e,new $0(void 0,{cause:t.signal.reason}))},t.signal.aborted)wi.nextTick(a);else{Po=Po||wn.addAbortListener;const f=Po(t.signal,a),l=r;r=cl((...h)=>{f[D0](),l.apply(e,h)})}const u=(...f)=>{o||wi.nextTick(()=>r.apply(e,f))};return EA(e[OA].promise,u,u),ll}function BA(e,t){var r;let o=!1;return t===null&&(t=fl),(r=t)!==null&&r!==void 0&&r.cleanup&&(mA(t.cleanup,"cleanup"),o=t.cleanup),new vA((a,u)=>{const f=j0(e,t,l=>{o&&f(),l?u(l):a()})})}kl.exports=j0;kl.exports.finished=BA;var Oi=kl.exports;const Ir=Qi,{aggregateTwoErrors:LA,codes:{ERR_MULTIPLE_CALLBACK:xA},AbortError:NA}=ln,{Symbol:U0}=mt,{kIsDestroyed:MA,isDestroyed:$A,isFinished:DA,isServerRequest:jA}=ni,k0=U0("kDestroy"),dl=U0("kConstruct");function H0(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function UA(e,t){const r=this._readableState,o=this._writableState,a=o||r;return o!=null&&o.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(H0(e,o,r),o&&(o.destroyed=!0),r&&(r.destroyed=!0),a.constructed?Gg(this,e,t):this.once(k0,function(u){Gg(this,LA(u,e),t)}),this)}function Gg(e,t,r){let o=!1;function a(u){if(o)return;o=!0;const f=e._readableState,l=e._writableState;H0(u,l,f),l&&(l.closed=!0),f&&(f.closed=!0),typeof r=="function"&&r(u),u?Ir.nextTick(kA,e,u):Ir.nextTick(W0,e)}try{e._destroy(t||null,a)}catch(u){a(u)}}function kA(e,t){hl(e,t),W0(e)}function W0(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function hl(e,t){const r=e._readableState,o=e._writableState;o!=null&&o.errorEmitted||r!=null&&r.errorEmitted||(o&&(o.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function HA(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function gl(e,t,r){const o=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||o!=null&&o.destroyed)return this;o!=null&&o.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),o&&!o.errored&&(o.errored=t),r?Ir.nextTick(hl,e,t):hl(e,t))}function WA(e,t){if(typeof e._construct!="function")return;const r=e._readableState,o=e._writableState;r&&(r.constructed=!1),o&&(o.constructed=!1),e.once(dl,t),!(e.listenerCount(dl)>1)&&Ir.nextTick(FA,e)}function FA(e){let t=!1;function r(o){if(t){gl(e,o??new xA);return}t=!0;const a=e._readableState,u=e._writableState,f=u||a;a&&(a.constructed=!0),u&&(u.constructed=!0),f.destroyed?e.emit(k0,o):o?gl(e,o,!0):Ir.nextTick(qA,e)}try{e._construct(o=>{Ir.nextTick(r,o)})}catch(o){Ir.nextTick(r,o)}}function qA(e){e.emit(dl)}function Kg(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function F0(e){e.emit("close")}function VA(e,t){e.emit("error",t),Ir.nextTick(F0,e)}function zA(e,t){!e||$A(e)||(!t&&!DA(e)&&(t=new NA),jA(e)?(e.socket=null,e.destroy(t)):Kg(e)?e.abort():Kg(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Ir.nextTick(VA,e,t):Ir.nextTick(F0,e),e.destroyed||(e[MA]=!0))}var Wo={construct:WA,destroyer:zA,destroy:UA,undestroy:HA,errorOrDestroy:gl};const{ArrayIsArray:GA,ObjectSetPrototypeOf:q0}=mt,{EventEmitter:Iu}=Ti;function Ou(e){Iu.call(this,e)}q0(Ou.prototype,Iu.prototype);q0(Ou,Iu);Ou.prototype.pipe=function(e,t){const r=this;function o(p){e.writable&&e.write(p)===!1&&r.pause&&r.pause()}r.on("data",o);function a(){r.readable&&r.resume&&r.resume()}e.on("drain",a),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",f),r.on("close",l));let u=!1;function f(){u||(u=!0,e.end())}function l(){u||(u=!0,typeof e.destroy=="function"&&e.destroy())}function h(p){d(),Iu.listenerCount(this,"error")===0&&this.emit("error",p)}pl(r,"error",h),pl(e,"error",h);function d(){r.removeListener("data",o),e.removeListener("drain",a),r.removeListener("end",f),r.removeListener("close",l),r.removeListener("error",h),e.removeListener("error",h),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e};function pl(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):GA(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var Hl={Stream:Ou,prependListener:pl},V0={exports:{}};(function(e){const{SymbolDispose:t}=mt,{AbortError:r,codes:o}=ln,{isNodeStream:a,isWebStream:u,kControllerErrorFunction:f}=ni,l=Oi,{ERR_INVALID_ARG_TYPE:h}=o;let d;const p=(w,T)=>{if(typeof w!="object"||!("aborted"in w))throw new h(T,"AbortSignal",w)};e.exports.addAbortSignal=function(T,v){if(p(T,"signal"),!a(v)&&!u(v))throw new h("stream",["ReadableStream","WritableStream","Stream"],v);return e.exports.addAbortSignalNoValidate(T,v)},e.exports.addAbortSignalNoValidate=function(w,T){if(typeof w!="object"||!("aborted"in w))return T;const v=a(T)?()=>{T.destroy(new r(void 0,{cause:w.reason}))}:()=>{T[f](new r(void 0,{cause:w.reason}))};if(w.aborted)v();else{d=d||wn.addAbortListener;const k=d(w,v);l(T,k[t])}return T}})(V0);var Cu=V0.exports;const{StringPrototypeSlice:Jg,SymbolIterator:KA,TypedArrayPrototypeSet:Ja,Uint8Array:JA}=mt,{Buffer:Sc}=or,{inspect:YA}=wn;var ZA=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){const r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,o=""+r.data;for(;(r=r.next)!==null;)o+=t+r.data;return o}concat(t){if(this.length===0)return Sc.alloc(0);const r=Sc.allocUnsafe(t>>>0);let o=this.head,a=0;for(;o;)Ja(r,o.data,a),a+=o.data.length,o=o.next;return r}consume(t,r){const o=this.head.data;if(t<o.length){const a=o.slice(0,t);return this.head.data=o.slice(t),a}return t===o.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[KA](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",o=this.head,a=0;do{const u=o.data;if(t>u.length)r+=u,t-=u.length;else{t===u.length?(r+=u,++a,o.next?this.head=o.next:this.head=this.tail=null):(r+=Jg(u,0,t),this.head=o,o.data=Jg(u,t));break}++a}while((o=o.next)!==null);return this.length-=a,r}_getBuffer(t){const r=Sc.allocUnsafe(t),o=t;let a=this.head,u=0;do{const f=a.data;if(t>f.length)Ja(r,f,o-t),t-=f.length;else{t===f.length?(Ja(r,f,o-t),++u,a.next?this.head=a.next:this.head=this.tail=null):(Ja(r,new JA(f.buffer,f.byteOffset,t),o-t),this.head=a,a.data=f.slice(t));break}++u}while((a=a.next)!==null);return this.length-=u,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return YA(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:XA,NumberIsInteger:QA}=mt,{validateInteger:eT}=js,{ERR_INVALID_ARG_VALUE:tT}=ln.codes;let z0=16*1024,G0=16;function nT(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function K0(e){return e?G0:z0}function rT(e,t){eT(t,"value",0),e?G0=t:z0=t}function iT(e,t,r,o){const a=nT(t,o,r);if(a!=null){if(!QA(a)||a<0){const u=o?`options.${r}`:"options.highWaterMark";throw new tT(u,a)}return XA(a)}return K0(e.objectMode)}var Pu={getHighWaterMark:iT,getDefaultHighWaterMark:K0,setDefaultHighWaterMark:rT};const Yg=Qi,{PromisePrototypeThen:oT,SymbolAsyncIterator:Zg,SymbolIterator:Xg}=mt,{Buffer:sT}=or,{ERR_INVALID_ARG_TYPE:aT,ERR_STREAM_NULL_VALUES:uT}=ln.codes;function fT(e,t,r){let o;if(typeof t=="string"||t instanceof sT)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let a;if(t&&t[Zg])a=!0,o=t[Zg]();else if(t&&t[Xg])a=!1,o=t[Xg]();else throw new aT("iterable",["Iterable"],t);const u=new e({objectMode:!0,highWaterMark:1,...r});let f=!1;u._read=function(){f||(f=!0,h())},u._destroy=function(d,p){oT(l(d),()=>Yg.nextTick(p,d),w=>Yg.nextTick(p,w||d))};async function l(d){const p=d!=null,w=typeof o.throw=="function";if(p&&w){const{value:T,done:v}=await o.throw(d);if(await T,v)return}if(typeof o.return=="function"){const{value:T}=await o.return();await T}}async function h(){for(;;){try{const{value:d,done:p}=a?await o.next():o.next();if(p)u.push(null);else{const w=d&&typeof d.then=="function"?await d:d;if(w===null)throw f=!1,new uT;if(u.push(w))continue;f=!1}}catch(d){u.destroy(d)}break}}return u}var J0=fT,Rc,Qg;function Bu(){if(Qg)return Rc;Qg=1;const e=Qi,{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:u,ObjectKeys:f,ObjectSetPrototypeOf:l,Promise:h,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:w,Symbol:T}=mt;Rc=Ee,Ee.ReadableState=ke;const{EventEmitter:v}=Ti,{Stream:k,prependListener:C}=Hl,{Buffer:P}=or,{addAbortSignal:$}=Cu,L=Oi;let S=wn.debuglog("stream",A=>{S=A});const m=ZA,H=Wo,{getHighWaterMark:ee,getDefaultHighWaterMark:ge}=Pu,{aggregateTwoErrors:fe,codes:{ERR_INVALID_ARG_TYPE:oe,ERR_METHOD_NOT_IMPLEMENTED:Ae,ERR_OUT_OF_RANGE:be,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:D}=ln,{validateObject:K}=js,ne=T("kPaused"),{StringDecoder:J}=il(),ue=J0;l(Ee.prototype,k.prototype),l(Ee,k);const G=()=>{},{errorOrDestroy:Y}=H,ae=1,me=2,te=4,ye=8,we=16,j=32,F=64,Z=128,de=256,Re=512,R=1024,I=2048,b=4096,E=8192,z=16384,re=32768,ie=65536,Oe=1<<17,Le=1<<18;function Ce(A){return{enumerable:!1,get(){return(this.state&A)!==0},set(B){B?this.state|=A:this.state&=~A}}}u(ke.prototype,{objectMode:Ce(ae),ended:Ce(me),endEmitted:Ce(te),reading:Ce(ye),constructed:Ce(we),sync:Ce(j),needReadable:Ce(F),emittedReadable:Ce(Z),readableListening:Ce(de),resumeScheduled:Ce(Re),errorEmitted:Ce(R),emitClose:Ce(I),autoDestroy:Ce(b),destroyed:Ce(E),closed:Ce(z),closeEmitted:Ce(re),multiAwaitDrain:Ce(ie),readingMore:Ce(Oe),dataEmitted:Ce(Le)});function ke(A,B,pe){typeof pe!="boolean"&&(pe=B instanceof Zr()),this.state=I|b|we|j,A&&A.objectMode&&(this.state|=ae),pe&&A&&A.readableObjectMode&&(this.state|=ae),this.highWaterMark=A?ee(this,A,"readableHighWaterMark",pe):ge(!1),this.buffer=new m,this.length=0,this.pipes=[],this.flowing=null,this[ne]=null,A&&A.emitClose===!1&&(this.state&=~I),A&&A.autoDestroy===!1&&(this.state&=~b),this.errored=null,this.defaultEncoding=A&&A.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,A&&A.encoding&&(this.decoder=new J(A.encoding),this.encoding=A.encoding)}function Ee(A){if(!(this instanceof Ee))return new Ee(A);const B=this instanceof Zr();this._readableState=new ke(A,this,B),A&&(typeof A.read=="function"&&(this._read=A.read),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.construct=="function"&&(this._construct=A.construct),A.signal&&!B&&$(A.signal,this)),k.call(this,A),H.construct(this,()=>{this._readableState.needReadable&&st(this,this._readableState)})}Ee.prototype.destroy=H.destroy,Ee.prototype._undestroy=H.undestroy,Ee.prototype._destroy=function(A,B){B(A)},Ee.prototype[v.captureRejectionSymbol]=function(A){this.destroy(A)},Ee.prototype[p]=function(){let A;return this.destroyed||(A=this.readableEnded?null:new D,this.destroy(A)),new h((B,pe)=>L(this,_e=>_e&&_e!==A?pe(_e):B(null)))},Ee.prototype.push=function(A,B){return qe(this,A,B,!1)},Ee.prototype.unshift=function(A,B){return qe(this,A,B,!0)};function qe(A,B,pe,_e){S("readableAddChunk",B);const Se=A._readableState;let bt;if(Se.state&ae||(typeof B=="string"?(pe=pe||Se.defaultEncoding,Se.encoding!==pe&&(_e&&Se.encoding?B=P.from(B,pe).toString(Se.encoding):(B=P.from(B,pe),pe=""))):B instanceof P?pe="":k._isUint8Array(B)?(B=k._uint8ArrayToBuffer(B),pe=""):B!=null&&(bt=new oe("chunk",["string","Buffer","Uint8Array"],B))),bt)Y(A,bt);else if(B===null)Se.state&=~ye,Ze(A,Se);else if(Se.state&ae||B&&B.length>0)if(_e)if(Se.state&te)Y(A,new N);else{if(Se.destroyed||Se.errored)return!1;Rt(A,Se,B,!0)}else if(Se.ended)Y(A,new M);else{if(Se.destroyed||Se.errored)return!1;Se.state&=~ye,Se.decoder&&!pe?(B=Se.decoder.write(B),Se.objectMode||B.length!==0?Rt(A,Se,B,!1):st(A,Se)):Rt(A,Se,B,!1)}else _e||(Se.state&=~ye,st(A,Se));return!Se.ended&&(Se.length<Se.highWaterMark||Se.length===0)}function Rt(A,B,pe,_e){B.flowing&&B.length===0&&!B.sync&&A.listenerCount("data")>0?(B.state&ie?B.awaitDrainWriters.clear():B.awaitDrainWriters=null,B.dataEmitted=!0,A.emit("data",pe)):(B.length+=B.objectMode?1:pe.length,_e?B.buffer.unshift(pe):B.buffer.push(pe),B.state&F&&jt(A)),st(A,B)}Ee.prototype.isPaused=function(){const A=this._readableState;return A[ne]===!0||A.flowing===!1},Ee.prototype.setEncoding=function(A){const B=new J(A);this._readableState.decoder=B,this._readableState.encoding=this._readableState.decoder.encoding;const pe=this._readableState.buffer;let _e="";for(const Se of pe)_e+=B.write(Se);return pe.clear(),_e!==""&&pe.push(_e),this._readableState.length=_e.length,this};const ct=1073741824;function Dt(A){if(A>ct)throw new be("size","<= 1GiB",A);return A--,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A++,A}function it(A,B){return A<=0||B.length===0&&B.ended?0:B.state&ae?1:o(A)?B.flowing&&B.length?B.buffer.first().length:B.length:A<=B.length?A:B.ended?B.length:0}Ee.prototype.read=function(A){S("read",A),A===void 0?A=NaN:r(A)||(A=a(A,10));const B=this._readableState,pe=A;if(A>B.highWaterMark&&(B.highWaterMark=Dt(A)),A!==0&&(B.state&=~Z),A===0&&B.needReadable&&((B.highWaterMark!==0?B.length>=B.highWaterMark:B.length>0)||B.ended))return S("read: emitReadable",B.length,B.ended),B.length===0&&B.ended?Bn(this):jt(this),null;if(A=it(A,B),A===0&&B.ended)return B.length===0&&Bn(this),null;let _e=(B.state&F)!==0;if(S("need readable",_e),(B.length===0||B.length-A<B.highWaterMark)&&(_e=!0,S("length less than watermark",_e)),B.ended||B.reading||B.destroyed||B.errored||!B.constructed)_e=!1,S("reading, ended or constructing",_e);else if(_e){S("do read"),B.state|=ye|j,B.length===0&&(B.state|=F);try{this._read(B.highWaterMark)}catch(bt){Y(this,bt)}B.state&=~j,B.reading||(A=it(pe,B))}let Se;return A>0?Se=rn(A,B):Se=null,Se===null?(B.needReadable=B.length<=B.highWaterMark,A=0):(B.length-=A,B.multiAwaitDrain?B.awaitDrainWriters.clear():B.awaitDrainWriters=null),B.length===0&&(B.ended||(B.needReadable=!0),pe!==A&&B.ended&&Bn(this)),Se!==null&&!B.errorEmitted&&!B.closeEmitted&&(B.dataEmitted=!0,this.emit("data",Se)),Se};function Ze(A,B){if(S("onEofChunk"),!B.ended){if(B.decoder){const pe=B.decoder.end();pe&&pe.length&&(B.buffer.push(pe),B.length+=B.objectMode?1:pe.length)}B.ended=!0,B.sync?jt(A):(B.needReadable=!1,B.emittedReadable=!0,Pt(A))}}function jt(A){const B=A._readableState;S("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(S("emitReadable",B.flowing),B.emittedReadable=!0,e.nextTick(Pt,A))}function Pt(A){const B=A._readableState;S("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&!B.errored&&(B.length||B.ended)&&(A.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,Jn(A)}function st(A,B){!B.readingMore&&B.constructed&&(B.readingMore=!0,e.nextTick(Lt,A,B))}function Lt(A,B){for(;!B.reading&&!B.ended&&(B.length<B.highWaterMark||B.flowing&&B.length===0);){const pe=B.length;if(S("maybeReadMore read 0"),A.read(0),pe===B.length)break}B.readingMore=!1}Ee.prototype._read=function(A){throw new Ae("_read()")},Ee.prototype.pipe=function(A,B){const pe=this,_e=this._readableState;_e.pipes.length===1&&(_e.multiAwaitDrain||(_e.multiAwaitDrain=!0,_e.awaitDrainWriters=new d(_e.awaitDrainWriters?[_e.awaitDrainWriters]:[]))),_e.pipes.push(A),S("pipe count=%d opts=%j",_e.pipes.length,B);const bt=(!B||B.end!==!1)&&A!==e.stdout&&A!==e.stderr?fr:vn;_e.endEmitted?e.nextTick(bt):pe.once("end",bt),A.on("unpipe",vt);function vt(sn,Wt){S("onunpipe"),sn===pe&&Wt&&Wt.hasUnpiped===!1&&(Wt.hasUnpiped=!0,Lr())}function fr(){S("onend"),A.end()}let Bt,cr=!1;function Lr(){S("cleanup"),A.removeListener("close",zt),A.removeListener("finish",Ln),Bt&&A.removeListener("drain",Bt),A.removeListener("error",Zn),A.removeListener("unpipe",vt),pe.removeListener("end",fr),pe.removeListener("end",vn),pe.removeListener("data",dr),cr=!0,Bt&&_e.awaitDrainWriters&&(!A._writableState||A._writableState.needDrain)&&Bt()}function lr(){cr||(_e.pipes.length===1&&_e.pipes[0]===A?(S("false write response, pause",0),_e.awaitDrainWriters=A,_e.multiAwaitDrain=!1):_e.pipes.length>1&&_e.pipes.includes(A)&&(S("false write response, pause",_e.awaitDrainWriters.size),_e.awaitDrainWriters.add(A)),pe.pause()),Bt||(Bt=dn(pe,A),A.on("drain",Bt))}pe.on("data",dr);function dr(sn){S("ondata");const Wt=A.write(sn);S("dest.write",Wt),Wt===!1&&lr()}function Zn(sn){if(S("onerror",sn),vn(),A.removeListener("error",Zn),A.listenerCount("error")===0){const Wt=A._writableState||A._readableState;Wt&&!Wt.errorEmitted?Y(A,sn):A.emit("error",sn)}}C(A,"error",Zn);function zt(){A.removeListener("finish",Ln),vn()}A.once("close",zt);function Ln(){S("onfinish"),A.removeListener("close",zt),vn()}A.once("finish",Ln);function vn(){S("unpipe"),pe.unpipe(A)}return A.emit("pipe",pe),A.writableNeedDrain===!0?lr():_e.flowing||(S("pipe resume"),pe.resume()),A};function dn(A,B){return function(){const _e=A._readableState;_e.awaitDrainWriters===B?(S("pipeOnDrain",1),_e.awaitDrainWriters=null):_e.multiAwaitDrain&&(S("pipeOnDrain",_e.awaitDrainWriters.size),_e.awaitDrainWriters.delete(B)),(!_e.awaitDrainWriters||_e.awaitDrainWriters.size===0)&&A.listenerCount("data")&&A.resume()}}Ee.prototype.unpipe=function(A){const B=this._readableState,pe={hasUnpiped:!1};if(B.pipes.length===0)return this;if(!A){const Se=B.pipes;B.pipes=[],this.pause();for(let bt=0;bt<Se.length;bt++)Se[bt].emit("unpipe",this,{hasUnpiped:!1});return this}const _e=t(B.pipes,A);return _e===-1?this:(B.pipes.splice(_e,1),B.pipes.length===0&&this.pause(),A.emit("unpipe",this,pe),this)},Ee.prototype.on=function(A,B){const pe=k.prototype.on.call(this,A,B),_e=this._readableState;return A==="data"?(_e.readableListening=this.listenerCount("readable")>0,_e.flowing!==!1&&this.resume()):A==="readable"&&!_e.endEmitted&&!_e.readableListening&&(_e.readableListening=_e.needReadable=!0,_e.flowing=!1,_e.emittedReadable=!1,S("on readable",_e.length,_e.reading),_e.length?jt(this):_e.reading||e.nextTick(Ht,this)),pe},Ee.prototype.addListener=Ee.prototype.on,Ee.prototype.removeListener=function(A,B){const pe=k.prototype.removeListener.call(this,A,B);return A==="readable"&&e.nextTick(nn,this),pe},Ee.prototype.off=Ee.prototype.removeListener,Ee.prototype.removeAllListeners=function(A){const B=k.prototype.removeAllListeners.apply(this,arguments);return(A==="readable"||A===void 0)&&e.nextTick(nn,this),B};function nn(A){const B=A._readableState;B.readableListening=A.listenerCount("readable")>0,B.resumeScheduled&&B[ne]===!1?B.flowing=!0:A.listenerCount("data")>0?A.resume():B.readableListening||(B.flowing=null)}function Ht(A){S("readable nexttick read 0"),A.read(0)}Ee.prototype.resume=function(){const A=this._readableState;return A.flowing||(S("resume"),A.flowing=!A.readableListening,hn(this,A)),A[ne]=!1,this};function hn(A,B){B.resumeScheduled||(B.resumeScheduled=!0,e.nextTick(Kn,A,B))}function Kn(A,B){S("resume",B.reading),B.reading||A.read(0),B.resumeScheduled=!1,A.emit("resume"),Jn(A),B.flowing&&!B.reading&&A.read(0)}Ee.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ne]=!0,this};function Jn(A){const B=A._readableState;for(S("flow",B.flowing);B.flowing&&A.read()!==null;);}Ee.prototype.wrap=function(A){let B=!1;A.on("data",_e=>{!this.push(_e)&&A.pause&&(B=!0,A.pause())}),A.on("end",()=>{this.push(null)}),A.on("error",_e=>{Y(this,_e)}),A.on("close",()=>{this.destroy()}),A.on("destroy",()=>{this.destroy()}),this._read=()=>{B&&A.resume&&(B=!1,A.resume())};const pe=f(A);for(let _e=1;_e<pe.length;_e++){const Se=pe[_e];this[Se]===void 0&&typeof A[Se]=="function"&&(this[Se]=A[Se].bind(A))}return this},Ee.prototype[w]=function(){return sr(this)},Ee.prototype.iterator=function(A){return A!==void 0&&K(A,"options"),sr(this,A)};function sr(A,B){typeof A.read!="function"&&(A=Ee.wrap(A,{objectMode:!0}));const pe=ar(A,B);return pe.stream=A,pe}async function*ar(A,B){let pe=G;function _e(vt){this===A?(pe(),pe=G):pe=vt}A.on("readable",_e);let Se;const bt=L(A,{writable:!1},vt=>{Se=vt?fe(Se,vt):null,pe(),pe=G});try{for(;;){const vt=A.destroyed?null:A.read();if(vt!==null)yield vt;else{if(Se)throw Se;if(Se===null)return;await new h(_e)}}}catch(vt){throw Se=fe(Se,vt),Se}finally{(Se||(B==null?void 0:B.destroyOnReturn)!==!1)&&(Se===void 0||A._readableState.autoDestroy)?H.destroyer(A,null):(A.off("readable",_e),bt())}}u(Ee.prototype,{readable:{__proto__:null,get(){const A=this._readableState;return!!A&&A.readable!==!1&&!A.destroyed&&!A.errorEmitted&&!A.endEmitted},set(A){this._readableState&&(this._readableState.readable=!!A)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(A){this._readableState&&(this._readableState.flowing=A)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(A){this._readableState&&(this._readableState.destroyed=A)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(ke.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ne]!==!1},set(A){this[ne]=!!A}}}),Ee._fromList=rn;function rn(A,B){if(B.length===0)return null;let pe;return B.objectMode?pe=B.buffer.shift():!A||A>=B.length?(B.decoder?pe=B.buffer.join(""):B.buffer.length===1?pe=B.buffer.first():pe=B.buffer.concat(B.length),B.buffer.clear()):pe=B.buffer.consume(A,B.decoder),pe}function Bn(A){const B=A._readableState;S("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,e.nextTick(on,B,A))}function on(A,B){if(S("endReadableNT",A.endEmitted,A.length),!A.errored&&!A.closeEmitted&&!A.endEmitted&&A.length===0){if(A.endEmitted=!0,B.emit("end"),B.writable&&B.allowHalfOpen===!1)e.nextTick(Br,B);else if(A.autoDestroy){const pe=B._writableState;(!pe||pe.autoDestroy&&(pe.finished||pe.writable===!1))&&B.destroy()}}}function Br(A){A.writable&&!A.writableEnded&&!A.destroyed&&A.end()}Ee.from=function(A,B){return ue(Ee,A,B)};let Yn;function ur(){return Yn===void 0&&(Yn={}),Yn}return Ee.fromWeb=function(A,B){return ur().newStreamReadableFromReadableStream(A,B)},Ee.toWeb=function(A,B){return ur().newReadableStreamFromStreamReadable(A,B)},Ee.wrap=function(A,B){var pe,_e;return new Ee({objectMode:(pe=(_e=A.readableObjectMode)!==null&&_e!==void 0?_e:A.objectMode)!==null&&pe!==void 0?pe:!0,...B,destroy(Se,bt){H.destroyer(A,Se),bt(Se)}}).wrap(A)},Rc}var Ac,ep;function Wl(){if(ep)return Ac;ep=1;const e=Qi,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:a,ObjectDefineProperties:u,ObjectSetPrototypeOf:f,StringPrototypeToLowerCase:l,Symbol:h,SymbolHasInstance:d}=mt;Ac=K,K.WritableState=N;const{EventEmitter:p}=Ti,w=Hl.Stream,{Buffer:T}=or,v=Wo,{addAbortSignal:k}=Cu,{getHighWaterMark:C,getDefaultHighWaterMark:P}=Pu,{ERR_INVALID_ARG_TYPE:$,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:m,ERR_STREAM_DESTROYED:H,ERR_STREAM_ALREADY_FINISHED:ee,ERR_STREAM_NULL_VALUES:ge,ERR_STREAM_WRITE_AFTER_END:fe,ERR_UNKNOWN_ENCODING:oe}=ln.codes,{errorOrDestroy:Ae}=v;f(K.prototype,w.prototype),f(K,w);function be(){}const M=h("kOnFinished");function N(b,E,z){typeof z!="boolean"&&(z=E instanceof Zr()),this.objectMode=!!(b&&b.objectMode),z&&(this.objectMode=this.objectMode||!!(b&&b.writableObjectMode)),this.highWaterMark=b?C(this,b,"writableHighWaterMark",z):P(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const re=!!(b&&b.decodeStrings===!1);this.decodeStrings=!re,this.defaultEncoding=b&&b.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Y.bind(void 0,E),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,D(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!b||b.emitClose!==!1,this.autoDestroy=!b||b.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[M]=[]}function D(b){b.buffered=[],b.bufferedIndex=0,b.allBuffers=!0,b.allNoop=!0}N.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},a(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function K(b){const E=this instanceof Zr();if(!E&&!o(K,this))return new K(b);this._writableState=new N(b,this,E),b&&(typeof b.write=="function"&&(this._write=b.write),typeof b.writev=="function"&&(this._writev=b.writev),typeof b.destroy=="function"&&(this._destroy=b.destroy),typeof b.final=="function"&&(this._final=b.final),typeof b.construct=="function"&&(this._construct=b.construct),b.signal&&k(b.signal,this)),w.call(this,b),v.construct(this,()=>{const z=this._writableState;z.writing||ye(this,z),Z(this,z)})}a(K,d,{__proto__:null,value:function(b){return o(this,b)?!0:this!==K?!1:b&&b._writableState instanceof N}}),K.prototype.pipe=function(){Ae(this,new m)};function ne(b,E,z,re){const ie=b._writableState;if(typeof z=="function")re=z,z=ie.defaultEncoding;else{if(!z)z=ie.defaultEncoding;else if(z!=="buffer"&&!T.isEncoding(z))throw new oe(z);typeof re!="function"&&(re=be)}if(E===null)throw new ge;if(!ie.objectMode)if(typeof E=="string")ie.decodeStrings!==!1&&(E=T.from(E,z),z="buffer");else if(E instanceof T)z="buffer";else if(w._isUint8Array(E))E=w._uint8ArrayToBuffer(E),z="buffer";else throw new $("chunk",["string","Buffer","Uint8Array"],E);let Oe;return ie.ending?Oe=new fe:ie.destroyed&&(Oe=new H("write")),Oe?(e.nextTick(re,Oe),Ae(b,Oe,!0),Oe):(ie.pendingcb++,J(b,ie,E,z,re))}K.prototype.write=function(b,E,z){return ne(this,b,E,z)===!0},K.prototype.cork=function(){this._writableState.corked++},K.prototype.uncork=function(){const b=this._writableState;b.corked&&(b.corked--,b.writing||ye(this,b))},K.prototype.setDefaultEncoding=function(E){if(typeof E=="string"&&(E=l(E)),!T.isEncoding(E))throw new oe(E);return this._writableState.defaultEncoding=E,this};function J(b,E,z,re,ie){const Oe=E.objectMode?1:z.length;E.length+=Oe;const Le=E.length<E.highWaterMark;return Le||(E.needDrain=!0),E.writing||E.corked||E.errored||!E.constructed?(E.buffered.push({chunk:z,encoding:re,callback:ie}),E.allBuffers&&re!=="buffer"&&(E.allBuffers=!1),E.allNoop&&ie!==be&&(E.allNoop=!1)):(E.writelen=Oe,E.writecb=ie,E.writing=!0,E.sync=!0,b._write(z,re,E.onwrite),E.sync=!1),Le&&!E.errored&&!E.destroyed}function ue(b,E,z,re,ie,Oe,Le){E.writelen=re,E.writecb=Le,E.writing=!0,E.sync=!0,E.destroyed?E.onwrite(new H("write")):z?b._writev(ie,E.onwrite):b._write(ie,Oe,E.onwrite),E.sync=!1}function G(b,E,z,re){--E.pendingcb,re(z),te(E),Ae(b,z)}function Y(b,E){const z=b._writableState,re=z.sync,ie=z.writecb;if(typeof ie!="function"){Ae(b,new S);return}z.writing=!1,z.writecb=null,z.length-=z.writelen,z.writelen=0,E?(E.stack,z.errored||(z.errored=E),b._readableState&&!b._readableState.errored&&(b._readableState.errored=E),re?e.nextTick(G,b,z,E,ie):G(b,z,E,ie)):(z.buffered.length>z.bufferedIndex&&ye(b,z),re?z.afterWriteTickInfo!==null&&z.afterWriteTickInfo.cb===ie?z.afterWriteTickInfo.count++:(z.afterWriteTickInfo={count:1,cb:ie,stream:b,state:z},e.nextTick(ae,z.afterWriteTickInfo)):me(b,z,1,ie))}function ae({stream:b,state:E,count:z,cb:re}){return E.afterWriteTickInfo=null,me(b,E,z,re)}function me(b,E,z,re){for(!E.ending&&!b.destroyed&&E.length===0&&E.needDrain&&(E.needDrain=!1,b.emit("drain"));z-- >0;)E.pendingcb--,re();E.destroyed&&te(E),Z(b,E)}function te(b){if(b.writing)return;for(let ie=b.bufferedIndex;ie<b.buffered.length;++ie){var E;const{chunk:Oe,callback:Le}=b.buffered[ie],Ce=b.objectMode?1:Oe.length;b.length-=Ce,Le((E=b.errored)!==null&&E!==void 0?E:new H("write"))}const z=b[M].splice(0);for(let ie=0;ie<z.length;ie++){var re;z[ie]((re=b.errored)!==null&&re!==void 0?re:new H("end"))}D(b)}function ye(b,E){if(E.corked||E.bufferProcessing||E.destroyed||!E.constructed)return;const{buffered:z,bufferedIndex:re,objectMode:ie}=E,Oe=z.length-re;if(!Oe)return;let Le=re;if(E.bufferProcessing=!0,Oe>1&&b._writev){E.pendingcb-=Oe-1;const Ce=E.allNoop?be:Ee=>{for(let qe=Le;qe<z.length;++qe)z[qe].callback(Ee)},ke=E.allNoop&&Le===0?z:t(z,Le);ke.allBuffers=E.allBuffers,ue(b,E,!0,E.length,ke,"",Ce),D(E)}else{do{const{chunk:Ce,encoding:ke,callback:Ee}=z[Le];z[Le++]=null;const qe=ie?1:Ce.length;ue(b,E,!1,qe,Ce,ke,Ee)}while(Le<z.length&&!E.writing);Le===z.length?D(E):Le>256?(z.splice(0,Le),E.bufferedIndex=0):E.bufferedIndex=Le}E.bufferProcessing=!1}K.prototype._write=function(b,E,z){if(this._writev)this._writev([{chunk:b,encoding:E}],z);else throw new L("_write()")},K.prototype._writev=null,K.prototype.end=function(b,E,z){const re=this._writableState;typeof b=="function"?(z=b,b=null,E=null):typeof E=="function"&&(z=E,E=null);let ie;if(b!=null){const Oe=ne(this,b,E);Oe instanceof r&&(ie=Oe)}return re.corked&&(re.corked=1,this.uncork()),ie||(!re.errored&&!re.ending?(re.ending=!0,Z(this,re,!0),re.ended=!0):re.finished?ie=new ee("end"):re.destroyed&&(ie=new H("end"))),typeof z=="function"&&(ie||re.finished?e.nextTick(z,ie):re[M].push(z)),this};function we(b){return b.ending&&!b.destroyed&&b.constructed&&b.length===0&&!b.errored&&b.buffered.length===0&&!b.finished&&!b.writing&&!b.errorEmitted&&!b.closeEmitted}function j(b,E){let z=!1;function re(ie){if(z){Ae(b,ie??S());return}if(z=!0,E.pendingcb--,ie){const Oe=E[M].splice(0);for(let Le=0;Le<Oe.length;Le++)Oe[Le](ie);Ae(b,ie,E.sync)}else we(E)&&(E.prefinished=!0,b.emit("prefinish"),E.pendingcb++,e.nextTick(de,b,E))}E.sync=!0,E.pendingcb++;try{b._final(re)}catch(ie){re(ie)}E.sync=!1}function F(b,E){!E.prefinished&&!E.finalCalled&&(typeof b._final=="function"&&!E.destroyed?(E.finalCalled=!0,j(b,E)):(E.prefinished=!0,b.emit("prefinish")))}function Z(b,E,z){we(E)&&(F(b,E),E.pendingcb===0&&(z?(E.pendingcb++,e.nextTick((re,ie)=>{we(ie)?de(re,ie):ie.pendingcb--},b,E)):we(E)&&(E.pendingcb++,de(b,E))))}function de(b,E){E.pendingcb--,E.finished=!0;const z=E[M].splice(0);for(let re=0;re<z.length;re++)z[re]();if(b.emit("finish"),E.autoDestroy){const re=b._readableState;(!re||re.autoDestroy&&(re.endEmitted||re.readable===!1))&&b.destroy()}}u(K.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(b){this._writableState&&(this._writableState.destroyed=b)}},writable:{__proto__:null,get(){const b=this._writableState;return!!b&&b.writable!==!1&&!b.destroyed&&!b.errored&&!b.ending&&!b.ended},set(b){this._writableState&&(this._writableState.writable=!!b)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const b=this._writableState;return b?!b.destroyed&&!b.ending&&b.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Re=v.destroy;K.prototype.destroy=function(b,E){const z=this._writableState;return!z.destroyed&&(z.bufferedIndex<z.buffered.length||z[M].length)&&e.nextTick(te,z),Re.call(this,b,E),this},K.prototype._undestroy=v.undestroy,K.prototype._destroy=function(b,E){E(b)},K.prototype[p.captureRejectionSymbol]=function(b){this.destroy(b)};let R;function I(){return R===void 0&&(R={}),R}return K.fromWeb=function(b,E){return I().newStreamWritableFromWritableStream(b,E)},K.toWeb=function(b){return I().newWritableStreamFromStreamWritable(b)},Ac}var Tc,tp;function cT(){if(tp)return Tc;tp=1;const e=Qi,t=or,{isReadable:r,isWritable:o,isIterable:a,isNodeStream:u,isReadableNodeStream:f,isWritableNodeStream:l,isDuplexNodeStream:h,isReadableStream:d,isWritableStream:p}=ni,w=Oi,{AbortError:T,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:k}}=ln,{destroyer:C}=Wo,P=Zr(),$=Bu(),L=Wl(),{createDeferredPromise:S}=wn,m=J0,H=globalThis.Blob||t.Blob,ee=typeof H<"u"?function(N){return N instanceof H}:function(N){return!1},ge=globalThis.AbortController||Ps().AbortController,{FunctionPrototypeCall:fe}=mt;class oe extends P{constructor(N){super(N),(N==null?void 0:N.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(N==null?void 0:N.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Tc=function M(N,D){if(h(N))return N;if(f(N))return be({readable:N});if(l(N))return be({writable:N});if(u(N))return be({writable:!1,readable:!1});if(d(N))return be({readable:$.fromWeb(N)});if(p(N))return be({writable:L.fromWeb(N)});if(typeof N=="function"){const{value:ne,write:J,final:ue,destroy:G}=Ae(N);if(a(ne))return m(oe,ne,{objectMode:!0,write:J,final:ue,destroy:G});const Y=ne==null?void 0:ne.then;if(typeof Y=="function"){let ae;const me=fe(Y,ne,te=>{if(te!=null)throw new k("nully","body",te)},te=>{C(ae,te)});return ae=new oe({objectMode:!0,readable:!1,write:J,final(te){ue(async()=>{try{await me,e.nextTick(te,null)}catch(ye){e.nextTick(te,ye)}})},destroy:G})}throw new k("Iterable, AsyncIterable or AsyncFunction",D,ne)}if(ee(N))return M(N.arrayBuffer());if(a(N))return m(oe,N,{objectMode:!0,writable:!1});if(d(N==null?void 0:N.readable)&&p(N==null?void 0:N.writable))return oe.fromWeb(N);if(typeof(N==null?void 0:N.writable)=="object"||typeof(N==null?void 0:N.readable)=="object"){const ne=N!=null&&N.readable?f(N==null?void 0:N.readable)?N==null?void 0:N.readable:M(N.readable):void 0,J=N!=null&&N.writable?l(N==null?void 0:N.writable)?N==null?void 0:N.writable:M(N.writable):void 0;return be({readable:ne,writable:J})}const K=N==null?void 0:N.then;if(typeof K=="function"){let ne;return fe(K,N,J=>{J!=null&&ne.push(J),ne.push(null)},J=>{C(ne,J)}),ne=new oe({objectMode:!0,writable:!1,read(){}})}throw new v(D,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],N)};function Ae(M){let{promise:N,resolve:D}=S();const K=new ge,ne=K.signal;return{value:M(async function*(){for(;;){const ue=N;N=null;const{chunk:G,done:Y,cb:ae}=await ue;if(e.nextTick(ae),Y)return;if(ne.aborted)throw new T(void 0,{cause:ne.reason});({promise:N,resolve:D}=S()),yield G}}(),{signal:ne}),write(ue,G,Y){const ae=D;D=null,ae({chunk:ue,done:!1,cb:Y})},final(ue){const G=D;D=null,G({done:!0,cb:ue})},destroy(ue,G){K.abort(),G(ue)}}}function be(M){const N=M.readable&&typeof M.readable.read!="function"?$.wrap(M.readable):M.readable,D=M.writable;let K=!!r(N),ne=!!o(D),J,ue,G,Y,ae;function me(te){const ye=Y;Y=null,ye?ye(te):te&&ae.destroy(te)}return ae=new oe({readableObjectMode:!!(N!=null&&N.readableObjectMode),writableObjectMode:!!(D!=null&&D.writableObjectMode),readable:K,writable:ne}),ne&&(w(D,te=>{ne=!1,te&&C(N,te),me(te)}),ae._write=function(te,ye,we){D.write(te,ye)?we():J=we},ae._final=function(te){D.end(),ue=te},D.on("drain",function(){if(J){const te=J;J=null,te()}}),D.on("finish",function(){if(ue){const te=ue;ue=null,te()}})),K&&(w(N,te=>{K=!1,te&&C(N,te),me(te)}),N.on("readable",function(){if(G){const te=G;G=null,te()}}),N.on("end",function(){ae.push(null)}),ae._read=function(){for(;;){const te=N.read();if(te===null){G=ae._read;return}if(!ae.push(te))return}}),ae._destroy=function(te,ye){!te&&Y!==null&&(te=new T),G=null,J=null,ue=null,Y===null?ye(te):(Y=ye,C(D,te),C(N,te))},ae}return Tc}var Ic,np;function Zr(){if(np)return Ic;np=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:o}=mt;Ic=f;const a=Bu(),u=Wl();o(f.prototype,a.prototype),o(f,a);{const p=r(u.prototype);for(let w=0;w<p.length;w++){const T=p[w];f.prototype[T]||(f.prototype[T]=u.prototype[T])}}function f(p){if(!(this instanceof f))return new f(p);a.call(this,p),u.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(f.prototype,{writable:{__proto__:null,...t(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(u.prototype,"writableLength")},writableFinished:{__proto__:null,...t(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});let l;function h(){return l===void 0&&(l={}),l}f.fromWeb=function(p,w){return h().newStreamDuplexFromReadableWritablePair(p,w)},f.toWeb=function(p){return h().newReadableWritablePairFromDuplex(p)};let d;return f.from=function(p){return d||(d=cT()),d(p,"body")},Ic}const{ObjectSetPrototypeOf:Y0,Symbol:lT}=mt;var Z0=Xr;const{ERR_METHOD_NOT_IMPLEMENTED:dT}=ln.codes,Fl=Zr(),{getHighWaterMark:hT}=Pu;Y0(Xr.prototype,Fl.prototype);Y0(Xr,Fl);const Ts=lT("kCallback");function Xr(e){if(!(this instanceof Xr))return new Xr(e);const t=e?hT(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),Fl.call(this,e),this._readableState.sync=!1,this[Ts]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",gT)}function bl(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function gT(){this._final!==bl&&bl.call(this)}Xr.prototype._final=bl;Xr.prototype._transform=function(e,t,r){throw new dT("_transform()")};Xr.prototype._write=function(e,t,r){const o=this._readableState,a=this._writableState,u=o.length;this._transform(e,t,(f,l)=>{if(f){r(f);return}l!=null&&this.push(l),a.ended||u===o.length||o.length<o.highWaterMark?r():this[Ts]=r})};Xr.prototype._read=function(){if(this[Ts]){const e=this[Ts];this[Ts]=null,e()}};const{ObjectSetPrototypeOf:X0}=mt;var Q0=No;const ql=Z0;X0(No.prototype,ql.prototype);X0(No,ql);function No(e){if(!(this instanceof No))return new No(e);ql.call(this,e)}No.prototype._transform=function(e,t,r){r(null,e)};const Rs=Qi,{ArrayIsArray:pT,Promise:bT,SymbolAsyncIterator:yT,SymbolDispose:_T}=mt,cu=Oi,{once:wT}=wn,mT=Wo,rp=Zr(),{aggregateTwoErrors:vT,codes:{ERR_INVALID_ARG_TYPE:yl,ERR_INVALID_RETURN_VALUE:Oc,ERR_MISSING_ARGS:ET,ERR_STREAM_DESTROYED:ST,ERR_STREAM_PREMATURE_CLOSE:RT},AbortError:AT}=ln,{validateFunction:TT,validateAbortSignal:IT}=js,{isIterable:qi,isReadable:Cc,isReadableNodeStream:ou,isNodeStream:ip,isTransformStream:Oo,isWebStream:OT,isReadableStream:Pc,isReadableFinished:CT}=ni,PT=globalThis.AbortController||Ps().AbortController;let Bc,Lc,xc;function op(e,t,r){let o=!1;e.on("close",()=>{o=!0});const a=cu(e,{readable:t,writable:r},u=>{o=!u});return{destroy:u=>{o||(o=!0,mT.destroyer(e,u||new ST("pipe")))},cleanup:a}}function BT(e){return TT(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Nc(e){if(qi(e))return e;if(ou(e))return LT(e);throw new yl("val",["Readable","Iterable","AsyncIterable"],e)}async function*LT(e){Lc||(Lc=Bu()),yield*Lc.prototype[yT].call(e)}async function Ya(e,t,r,{end:o}){let a,u=null;const f=d=>{if(d&&(a=d),u){const p=u;u=null,p()}},l=()=>new bT((d,p)=>{a?p(a):u=()=>{a?p(a):d()}});t.on("drain",f);const h=cu(t,{readable:!1},f);try{t.writableNeedDrain&&await l();for await(const d of e)t.write(d)||await l();o&&(t.end(),await l()),r()}catch(d){r(a!==d?vT(a,d):d)}finally{h(),t.off("drain",f)}}async function Mc(e,t,r,{end:o}){Oo(t)&&(t=t.writable);const a=t.getWriter();try{for await(const u of e)await a.ready,a.write(u).catch(()=>{});await a.ready,o&&await a.close(),r()}catch(u){try{await a.abort(u),r(u)}catch(f){r(f)}}}function xT(...e){return eb(e,wT(BT(e)))}function eb(e,t,r){if(e.length===1&&pT(e[0])&&(e=e[0]),e.length<2)throw new ET("streams");const o=new PT,a=o.signal,u=r==null?void 0:r.signal,f=[];IT(u,"options.signal");function l(){k(new AT)}xc=xc||wn.addAbortListener;let h;u&&(h=xc(u,l));let d,p;const w=[];let T=0;function v(L){k(L,--T===0)}function k(L,S){var m;if(L&&(!d||d.code==="ERR_STREAM_PREMATURE_CLOSE")&&(d=L),!(!d&&!S)){for(;w.length;)w.shift()(d);(m=h)===null||m===void 0||m[_T](),o.abort(),S&&(d||f.forEach(H=>H()),Rs.nextTick(t,d,p))}}let C;for(let L=0;L<e.length;L++){const S=e[L],m=L<e.length-1,H=L>0,ee=m||(r==null?void 0:r.end)!==!1,ge=L===e.length-1;if(ip(S)){let fe=function(oe){oe&&oe.name!=="AbortError"&&oe.code!=="ERR_STREAM_PREMATURE_CLOSE"&&v(oe)};if(ee){const{destroy:oe,cleanup:Ae}=op(S,m,H);w.push(oe),Cc(S)&&ge&&f.push(Ae)}S.on("error",fe),Cc(S)&&ge&&f.push(()=>{S.removeListener("error",fe)})}if(L===0)if(typeof S=="function"){if(C=S({signal:a}),!qi(C))throw new Oc("Iterable, AsyncIterable or Stream","source",C)}else qi(S)||ou(S)||Oo(S)?C=S:C=rp.from(S);else if(typeof S=="function"){if(Oo(C)){var P;C=Nc((P=C)===null||P===void 0?void 0:P.readable)}else C=Nc(C);if(C=S(C,{signal:a}),m){if(!qi(C,!0))throw new Oc("AsyncIterable",`transform[${L-1}]`,C)}else{var $;Bc||(Bc=Q0);const fe=new Bc({objectMode:!0}),oe=($=C)===null||$===void 0?void 0:$.then;if(typeof oe=="function")T++,oe.call(C,M=>{p=M,M!=null&&fe.write(M),ee&&fe.end(),Rs.nextTick(v)},M=>{fe.destroy(M),Rs.nextTick(v,M)});else if(qi(C,!0))T++,Ya(C,fe,v,{end:ee});else if(Pc(C)||Oo(C)){const M=C.readable||C;T++,Ya(M,fe,v,{end:ee})}else throw new Oc("AsyncIterable or Promise","destination",C);C=fe;const{destroy:Ae,cleanup:be}=op(C,!1,!0);w.push(Ae),ge&&f.push(be)}}else if(ip(S)){if(ou(C)){T+=2;const fe=NT(C,S,v,{end:ee});Cc(S)&&ge&&f.push(fe)}else if(Oo(C)||Pc(C)){const fe=C.readable||C;T++,Ya(fe,S,v,{end:ee})}else if(qi(C))T++,Ya(C,S,v,{end:ee});else throw new yl("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=S}else if(OT(S)){if(ou(C))T++,Mc(Nc(C),S,v,{end:ee});else if(Pc(C)||qi(C))T++,Mc(C,S,v,{end:ee});else if(Oo(C))T++,Mc(C.readable,S,v,{end:ee});else throw new yl("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=S}else C=rp.from(S)}return(a!=null&&a.aborted||u!=null&&u.aborted)&&Rs.nextTick(l),C}function NT(e,t,r,{end:o}){let a=!1;if(t.on("close",()=>{a||r(new RT)}),e.pipe(t,{end:!1}),o){let u=function(){a=!0,t.end()};CT(e)?Rs.nextTick(u):e.once("end",u)}else r();return cu(e,{readable:!0,writable:!1},u=>{const f=e._readableState;u&&u.code==="ERR_STREAM_PREMATURE_CLOSE"&&f&&f.ended&&!f.errored&&!f.errorEmitted?e.once("end",r).once("error",r):r(u)}),cu(t,{readable:!1,writable:!0},r)}var Vl={pipelineImpl:eb,pipeline:xT};const{pipeline:MT}=Vl,Za=Zr(),{destroyer:$T}=Wo,{isNodeStream:Xa,isReadable:sp,isWritable:ap,isWebStream:$c,isTransformStream:Fi,isWritableStream:up,isReadableStream:fp}=ni,{AbortError:DT,codes:{ERR_INVALID_ARG_VALUE:cp,ERR_MISSING_ARGS:jT}}=ln,UT=Oi;var tb=function(...t){if(t.length===0)throw new jT("streams");if(t.length===1)return Za.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=Za.from(t[0])),typeof t[t.length-1]=="function"){const v=t.length-1;t[v]=Za.from(t[v])}for(let v=0;v<t.length;++v)if(!(!Xa(t[v])&&!$c(t[v]))){if(v<t.length-1&&!(sp(t[v])||fp(t[v])||Fi(t[v])))throw new cp(`streams[${v}]`,r[v],"must be readable");if(v>0&&!(ap(t[v])||up(t[v])||Fi(t[v])))throw new cp(`streams[${v}]`,r[v],"must be writable")}let o,a,u,f,l;function h(v){const k=f;f=null,k?k(v):v?l.destroy(v):!T&&!w&&l.destroy()}const d=t[0],p=MT(t,h),w=!!(ap(d)||up(d)||Fi(d)),T=!!(sp(p)||fp(p)||Fi(p));if(l=new Za({writableObjectMode:!!(d!=null&&d.writableObjectMode),readableObjectMode:!!(p!=null&&p.readableObjectMode),writable:w,readable:T}),w){if(Xa(d))l._write=function(k,C,P){d.write(k,C)?P():o=P},l._final=function(k){d.end(),a=k},d.on("drain",function(){if(o){const k=o;o=null,k()}});else if($c(d)){const C=(Fi(d)?d.writable:d).getWriter();l._write=async function(P,$,L){try{await C.ready,C.write(P).catch(()=>{}),L()}catch(S){L(S)}},l._final=async function(P){try{await C.ready,C.close().catch(()=>{}),a=P}catch($){P($)}}}const v=Fi(p)?p.readable:p;UT(v,()=>{if(a){const k=a;a=null,k()}})}if(T){if(Xa(p))p.on("readable",function(){if(u){const v=u;u=null,v()}}),p.on("end",function(){l.push(null)}),l._read=function(){for(;;){const v=p.read();if(v===null){u=l._read;return}if(!l.push(v))return}};else if($c(p)){const k=(Fi(p)?p.readable:p).getReader();l._read=async function(){for(;;)try{const{value:C,done:P}=await k.read();if(!l.push(C))return;if(P){l.push(null);return}}catch{return}}}}return l._destroy=function(v,k){!v&&f!==null&&(v=new DT),u=null,o=null,a=null,f===null?k(v):(f=k,Xa(p)&&$T(p,v))},l};const kT=globalThis.AbortController||Ps().AbortController,{codes:{ERR_INVALID_ARG_VALUE:HT,ERR_INVALID_ARG_TYPE:Us,ERR_MISSING_ARGS:WT,ERR_OUT_OF_RANGE:FT},AbortError:Cr}=ln,{validateAbortSignal:to,validateInteger:lp,validateObject:no}=js,qT=mt.Symbol("kWeak"),VT=mt.Symbol("kResistStopPropagation"),{finished:zT}=Oi,GT=tb,{addAbortSignalNoValidate:KT}=Cu,{isWritable:JT,isNodeStream:YT}=ni,{deprecate:ZT}=wn,{ArrayPrototypePush:XT,Boolean:QT,MathFloor:dp,Number:e2,NumberIsNaN:t2,Promise:hp,PromiseReject:gp,PromiseResolve:n2,PromisePrototypeThen:pp,Symbol:nb}=mt,lu=nb("kEmpty"),bp=nb("kEof");function r2(e,t){if(t!=null&&no(t,"options"),(t==null?void 0:t.signal)!=null&&to(t.signal,"options.signal"),YT(e)&&!JT(e))throw new HT("stream",e,"must be writable");const r=GT(this,e);return t!=null&&t.signal&&KT(t.signal,r),r}function Lu(e,t){if(typeof e!="function")throw new Us("fn",["Function","AsyncFunction"],e);t!=null&&no(t,"options"),(t==null?void 0:t.signal)!=null&&to(t.signal,"options.signal");let r=1;(t==null?void 0:t.concurrency)!=null&&(r=dp(t.concurrency));let o=r-1;return(t==null?void 0:t.highWaterMark)!=null&&(o=dp(t.highWaterMark)),lp(r,"options.concurrency",1),lp(o,"options.highWaterMark",0),o+=r,(async function*(){const u=wn.AbortSignalAny([t==null?void 0:t.signal].filter(QT)),f=this,l=[],h={signal:u};let d,p,w=!1,T=0;function v(){w=!0,k()}function k(){T-=1,C()}function C(){p&&!w&&T<r&&l.length<o&&(p(),p=null)}async function P(){try{for await(let $ of f){if(w)return;if(u.aborted)throw new Cr;try{if($=e($,h),$===lu)continue;$=n2($)}catch(L){$=gp(L)}T+=1,pp($,k,v),l.push($),d&&(d(),d=null),!w&&(l.length>=o||T>=r)&&await new hp(L=>{p=L})}l.push(bp)}catch($){const L=gp($);pp(L,k,v),l.push(L)}finally{w=!0,d&&(d(),d=null)}}P();try{for(;;){for(;l.length>0;){const $=await l[0];if($===bp)return;if(u.aborted)throw new Cr;$!==lu&&(yield $),l.shift(),C()}await new hp($=>{d=$})}}finally{w=!0,p&&(p(),p=null)}}).call(this)}function i2(e=void 0){return e!=null&&no(e,"options"),(e==null?void 0:e.signal)!=null&&to(e.signal,"options.signal"),(async function*(){let r=0;for await(const a of this){var o;if(e!=null&&(o=e.signal)!==null&&o!==void 0&&o.aborted)throw new Cr({cause:e.signal.reason});yield[r++,a]}}).call(this)}async function rb(e,t=void 0){for await(const r of zl.call(this,e,t))return!0;return!1}async function o2(e,t=void 0){if(typeof e!="function")throw new Us("fn",["Function","AsyncFunction"],e);return!await rb.call(this,async(...r)=>!await e(...r),t)}async function s2(e,t){for await(const r of zl.call(this,e,t))return r}async function a2(e,t){if(typeof e!="function")throw new Us("fn",["Function","AsyncFunction"],e);async function r(o,a){return await e(o,a),lu}for await(const o of Lu.call(this,r,t));}function zl(e,t){if(typeof e!="function")throw new Us("fn",["Function","AsyncFunction"],e);async function r(o,a){return await e(o,a)?o:lu}return Lu.call(this,r,t)}class u2 extends WT{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function f2(e,t,r){var o;if(typeof e!="function")throw new Us("reducer",["Function","AsyncFunction"],e);r!=null&&no(r,"options"),(r==null?void 0:r.signal)!=null&&to(r.signal,"options.signal");let a=arguments.length>1;if(r!=null&&(o=r.signal)!==null&&o!==void 0&&o.aborted){const d=new Cr(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await zT(this.destroy(d)),d}const u=new kT,f=u.signal;if(r!=null&&r.signal){const d={once:!0,[qT]:this,[VT]:!0};r.signal.addEventListener("abort",()=>u.abort(),d)}let l=!1;try{for await(const d of this){var h;if(l=!0,r!=null&&(h=r.signal)!==null&&h!==void 0&&h.aborted)throw new Cr;a?t=await e(t,d,{signal:f}):(t=d,a=!0)}if(!l&&!a)throw new u2}finally{u.abort()}return t}async function c2(e){e!=null&&no(e,"options"),(e==null?void 0:e.signal)!=null&&to(e.signal,"options.signal");const t=[];for await(const o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Cr(void 0,{cause:e.signal.reason});XT(t,o)}return t}function l2(e,t){const r=Lu.call(this,e,t);return(async function*(){for await(const a of r)yield*a}).call(this)}function ib(e){if(e=e2(e),t2(e))return 0;if(e<0)throw new FT("number",">= 0",e);return e}function d2(e,t=void 0){return t!=null&&no(t,"options"),(t==null?void 0:t.signal)!=null&&to(t.signal,"options.signal"),e=ib(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new Cr;for await(const u of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Cr;e--<=0&&(yield u)}}).call(this)}function h2(e,t=void 0){return t!=null&&no(t,"options"),(t==null?void 0:t.signal)!=null&&to(t.signal,"options.signal"),e=ib(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new Cr;for await(const u of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Cr;if(e-- >0&&(yield u),e<=0)return}}).call(this)}$l.streamReturningOperators={asIndexedPairs:ZT(i2,"readable.asIndexedPairs will be removed in a future version."),drop:d2,filter:zl,flatMap:l2,map:Lu,take:h2,compose:r2};$l.promiseReturningOperators={every:o2,forEach:a2,reduce:f2,toArray:c2,some:rb,find:s2};var Dc,yp;function ob(){if(yp)return Dc;yp=1;const{ArrayPrototypePop:e,Promise:t}=mt,{isIterable:r,isNodeStream:o,isWebStream:a}=ni,{pipelineImpl:u}=Vl,{finished:f}=Oi;sb();function l(...h){return new t((d,p)=>{let w,T;const v=h[h.length-1];if(v&&typeof v=="object"&&!o(v)&&!r(v)&&!a(v)){const k=e(h);w=k.signal,T=k.end}u(h,(k,C)=>{k?p(k):d(C)},{signal:w,end:T})})}return Dc={finished:f,pipeline:l},Dc}var _p;function sb(){if(_p)return mc.exports;_p=1;const{Buffer:e}=or,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:o}=mt,{promisify:{custom:a}}=wn,{streamReturningOperators:u,promiseReturningOperators:f}=$l,{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=ln,h=tb,{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=Pu,{pipeline:w}=Vl,{destroyer:T}=Wo,v=Oi,k=ob(),C=ni,P=mc.exports=Hl.Stream;P.isDestroyed=C.isDestroyed,P.isDisturbed=C.isDisturbed,P.isErrored=C.isErrored,P.isReadable=C.isReadable,P.isWritable=C.isWritable,P.Readable=Bu();for(const L of r(u)){let m=function(...H){if(new.target)throw l();return P.Readable.from(o(S,this,H))};const S=u[L];t(m,"name",{__proto__:null,value:S.name}),t(m,"length",{__proto__:null,value:S.length}),t(P.Readable.prototype,L,{__proto__:null,value:m,enumerable:!1,configurable:!0,writable:!0})}for(const L of r(f)){let m=function(...H){if(new.target)throw l();return o(S,this,H)};const S=f[L];t(m,"name",{__proto__:null,value:S.name}),t(m,"length",{__proto__:null,value:S.length}),t(P.Readable.prototype,L,{__proto__:null,value:m,enumerable:!1,configurable:!0,writable:!0})}P.Writable=Wl(),P.Duplex=Zr(),P.Transform=Z0,P.PassThrough=Q0,P.pipeline=w;const{addAbortSignal:$}=Cu;return P.addAbortSignal=$,P.finished=v,P.destroy=T,P.compose=h,P.setDefaultHighWaterMark=d,P.getDefaultHighWaterMark=p,t(P,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),t(w,a,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),t(v,a,{__proto__:null,enumerable:!0,get(){return k.finished}}),P.Stream=P,P._isUint8Array=function(S){return S instanceof Uint8Array},P._uint8ArrayToBuffer=function(S){return e.from(S.buffer,S.byteOffset,S.byteLength)},mc.exports}(function(e){const t=sb(),r=ob(),o=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=o,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(rR);var Gl=Bs;Bs.default=Bs;Bs.stable=fb;Bs.stableStringify=fb;var du="[...]",ab="[Circular]",Yi=[],Gi=[];function ub(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Bs(e,t,r,o){typeof o>"u"&&(o=ub()),_l(e,"",0,[],void 0,0,o);var a;try{Gi.length===0?a=JSON.stringify(e,t,r):a=JSON.stringify(e,cb(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Yi.length!==0;){var u=Yi.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function Bo(e,t,r,o){var a=Object.getOwnPropertyDescriptor(o,r);a.get!==void 0?a.configurable?(Object.defineProperty(o,r,{value:e}),Yi.push([o,r,t,a])):Gi.push([t,r,e]):(o[r]=e,Yi.push([o,r,t]))}function _l(e,t,r,o,a,u,f){u+=1;var l;if(typeof e=="object"&&e!==null){for(l=0;l<o.length;l++)if(o[l]===e){Bo(ab,e,t,a);return}if(typeof f.depthLimit<"u"&&u>f.depthLimit){Bo(du,e,t,a);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){Bo(du,e,t,a);return}if(o.push(e),Array.isArray(e))for(l=0;l<e.length;l++)_l(e[l],l,l,o,e,u,f);else{var h=Object.keys(e);for(l=0;l<h.length;l++){var d=h[l];_l(e[d],d,l,o,e,u,f)}}o.pop()}}function g2(e,t){return e<t?-1:e>t?1:0}function fb(e,t,r,o){typeof o>"u"&&(o=ub());var a=wl(e,"",0,[],void 0,0,o)||e,u;try{Gi.length===0?u=JSON.stringify(a,t,r):u=JSON.stringify(a,cb(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Yi.length!==0;){var f=Yi.pop();f.length===4?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return u}function wl(e,t,r,o,a,u,f){u+=1;var l;if(typeof e=="object"&&e!==null){for(l=0;l<o.length;l++)if(o[l]===e){Bo(ab,e,t,a);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof f.depthLimit<"u"&&u>f.depthLimit){Bo(du,e,t,a);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){Bo(du,e,t,a);return}if(o.push(e),Array.isArray(e))for(l=0;l<e.length;l++)wl(e[l],l,l,o,e,u,f);else{var h={},d=Object.keys(e).sort(g2);for(l=0;l<d.length;l++){var p=d[l];wl(e[p],p,l,o,e,u,f),h[p]=e[p]}if(typeof a<"u")Yi.push([a,t,e]),a[t]=h;else return h}o.pop()}}function cb(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Gi.length>0)for(var o=0;o<Gi.length;o++){var a=Gi[o];if(a[1]===t&&a[0]===r){r=a[2],Gi.splice(o,1);break}}return e.call(this,t,r)}}const p2=Ii(Gl);var b2={},Zi={},Kl={},qt={};class lb extends TypeError{constructor(t,r){let o;const{message:a,explanation:u,...f}=t,{path:l}=t,h=l.length===0?a:`At path: ${l.join(".")} -- ${a}`;super(u??h),u!=null&&(this.cause=h),Object.assign(this,f),this.name=this.constructor.name,this.failures=()=>o??(o=[t,...r()])}}function y2(e){return Vn(e)&&typeof e[Symbol.iterator]=="function"}function Vn(e){return typeof e=="object"&&e!=null}function wp(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function $t(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function _2(e){const{done:t,value:r}=e.next();return t?void 0:r}function w2(e,t,r,o){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:a,branch:u}=t,{type:f}=r,{refinement:l,message:h=`Expected a value of type \`${f}\`${l?` with refinement \`${l}\``:""}, but received: \`${$t(o)}\``}=e;return{value:o,type:f,refinement:l,key:a[a.length-1],path:a,branch:u,...e,message:h}}function*ml(e,t,r,o){y2(e)||(e=[e]);for(const a of e){const u=w2(a,t,r,o);u&&(yield u)}}function*Jl(e,t,r={}){const{path:o=[],branch:a=[e],coerce:u=!1,mask:f=!1}=r,l={path:o,branch:a};if(u&&(e=t.coercer(e,l),f&&t.type!=="type"&&Vn(t.schema)&&Vn(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let h="valid";for(const d of t.validator(e,l))d.explanation=r.message,h="not_valid",yield[d,void 0];for(let[d,p,w]of t.entries(e,l)){const T=Jl(p,w,{path:d===void 0?o:[...o,d],branch:d===void 0?a:[...a,p],coerce:u,mask:f,message:r.message});for(const v of T)v[0]?(h=v[0].refinement!=null?"not_refined":"not_valid",yield[v[0],void 0]):u&&(p=v[1],d===void 0?e=p:e instanceof Map?e.set(d,p):e instanceof Set?e.add(p):Vn(e)&&(p!==void 0||d in e)&&(e[d]=p))}if(h!=="not_valid")for(const d of t.refiner(e,l))d.explanation=r.message,h="not_refined",yield[d,void 0];h==="valid"&&(yield[void 0,e])}class Ct{constructor(t){const{type:r,schema:o,validator:a,refiner:u,coercer:f=h=>h,entries:l=function*(){}}=t;this.type=r,this.schema=o,this.entries=l,this.coercer=f,a?this.validator=(h,d)=>{const p=a(h,d);return ml(p,d,this,h)}:this.validator=()=>[],u?this.refiner=(h,d)=>{const p=u(h,d);return ml(p,d,this,h)}:this.refiner=()=>[]}assert(t,r){return db(t,this,r)}create(t,r){return hb(t,this,r)}is(t){return Yl(t,this)}mask(t,r){return gb(t,this,r)}validate(t,r={}){return Fo(t,this,r)}}function db(e,t,r){const o=Fo(e,t,{message:r});if(o[0])throw o[0]}function hb(e,t,r){const o=Fo(e,t,{coerce:!0,message:r});if(o[0])throw o[0];return o[1]}function gb(e,t,r){const o=Fo(e,t,{coerce:!0,mask:!0,message:r});if(o[0])throw o[0];return o[1]}function Yl(e,t){return!Fo(e,t)[0]}function Fo(e,t,r={}){const o=Jl(e,t,r),a=_2(o);return a[0]?[new lb(a[0],function*(){for(const f of o)f[0]&&(yield f[0])}),void 0]:[void 0,a[1]]}function m2(...e){const t=e[0].type==="type",r=e.map(a=>a.schema),o=Object.assign({},...r);return t?Hs(o):ks(o)}function mn(e,t){return new Ct({type:e,schema:null,validator:t})}function v2(e,t){return new Ct({...e,refiner:(r,o)=>r===void 0||e.refiner(r,o),validator(r,o){return r===void 0?!0:(t(r,o),e.validator(r,o))}})}function E2(e){return new Ct({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function S2(e){let t;return new Ct({type:"lazy",schema:null,*entries(r,o){t??(t=e()),yield*t.entries(r,o)},validator(r,o){return t??(t=e()),t.validator(r,o)},coercer(r,o){return t??(t=e()),t.coercer(r,o)},refiner(r,o){return t??(t=e()),t.refiner(r,o)}})}function R2(e,t){const{schema:r}=e,o={...r};for(const a of t)delete o[a];switch(e.type){case"type":return Hs(o);default:return ks(o)}}function A2(e){const t=e instanceof Ct,r=t?{...e.schema}:{...e};for(const o in r)r[o]=pb(r[o]);return t&&e.type==="type"?Hs(r):ks(r)}function T2(e,t){const{schema:r}=e,o={};for(const a of t)o[a]=r[a];switch(e.type){case"type":return Hs(o);default:return ks(o)}}function I2(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),mn(e,t)}function O2(){return mn("any",()=>!0)}function C2(e){return new Ct({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,o]of t.entries())yield[r,o,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${$t(t)}`}})}function P2(){return mn("bigint",e=>typeof e=="bigint")}function B2(){return mn("boolean",e=>typeof e=="boolean")}function L2(){return mn("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${$t(e)}`)}function x2(e){const t={},r=e.map(o=>$t(o)).join();for(const o of e)t[o]=o;return new Ct({type:"enums",schema:t,validator(o){return e.includes(o)||`Expected one of \`${r}\`, but received: ${$t(o)}`}})}function N2(){return mn("func",e=>typeof e=="function"||`Expected a function, but received: ${$t(e)}`)}function M2(e){return mn("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${$t(t)}`)}function $2(){return mn("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${$t(e)}`)}function D2(e){return new Ct({type:"intersection",schema:null,*entries(t,r){for(const o of e)yield*o.entries(t,r)},*validator(t,r){for(const o of e)yield*o.validator(t,r)},*refiner(t,r){for(const o of e)yield*o.refiner(t,r)}})}function j2(e){const t=$t(e),r=typeof e;return new Ct({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(o){return o===e||`Expected the literal \`${t}\`, but received: ${$t(o)}`}})}function U2(e,t){return new Ct({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[o,a]of r.entries())yield[o,o,e],yield[o,a,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${$t(r)}`}})}function Zl(){return mn("never",()=>!1)}function k2(e){return new Ct({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function H2(){return mn("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${$t(e)}`)}function ks(e){const t=e?Object.keys(e):[],r=Zl();return new Ct({type:"object",schema:e||null,*entries(o){if(e&&Vn(o)){const a=new Set(Object.keys(o));for(const u of t)a.delete(u),yield[u,o[u],e[u]];for(const u of a)yield[u,o[u],r]}},validator(o){return Vn(o)||`Expected an object, but received: ${$t(o)}`},coercer(o){return Vn(o)?{...o}:o}})}function pb(e){return new Ct({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function W2(e,t){return new Ct({type:"record",schema:null,*entries(r){if(Vn(r))for(const o in r){const a=r[o];yield[o,o,e],yield[o,a,t]}},validator(r){return Vn(r)||`Expected an object, but received: ${$t(r)}`}})}function F2(){return mn("regexp",e=>e instanceof RegExp)}function q2(e){return new Ct({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${$t(t)}`}})}function bb(){return mn("string",e=>typeof e=="string"||`Expected a string, but received: ${$t(e)}`)}function V2(e){const t=Zl();return new Ct({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const o=Math.max(e.length,r.length);for(let a=0;a<o;a++)yield[a,r[a],e[a]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${$t(r)}`}})}function Hs(e){const t=Object.keys(e);return new Ct({type:"type",schema:e,*entries(r){if(Vn(r))for(const o of t)yield[o,r[o],e[o]]},validator(r){return Vn(r)||`Expected an object, but received: ${$t(r)}`},coercer(r){return Vn(r)?{...r}:r}})}function z2(e){const t=e.map(r=>r.type).join(" | ");return new Ct({type:"union",schema:null,coercer(r){for(const o of e){const[a,u]=o.validate(r,{coerce:!0});if(!a)return u}return r},validator(r,o){const a=[];for(const u of e){const[...f]=Jl(r,u,o),[l]=f;if(l[0])for(const[h]of f)h&&a.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${$t(r)}`,...a]}})}function yb(){return mn("unknown",()=>!0)}function Xl(e,t,r){return new Ct({...e,coercer:(o,a)=>Yl(o,t)?e.coercer(r(o,a),a):e.coercer(o,a)})}function G2(e,t,r={}){return Xl(e,yb(),o=>{const a=typeof t=="function"?t():t;if(o===void 0)return a;if(!r.strict&&wp(o)&&wp(a)){const u={...o};let f=!1;for(const l in a)u[l]===void 0&&(u[l]=a[l],f=!0);if(f)return u}return o})}function K2(e){return Xl(e,bb(),t=>t.trim())}function J2(e){return ro(e,"empty",t=>{const r=_b(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function _b(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Y2(e,t,r={}){const{exclusive:o}=r;return ro(e,"max",a=>o?a<t:a<=t||`Expected a ${e.type} less than ${o?"":"or equal to "}${t} but received \`${a}\``)}function Z2(e,t,r={}){const{exclusive:o}=r;return ro(e,"min",a=>o?a>t:a>=t||`Expected a ${e.type} greater than ${o?"":"or equal to "}${t} but received \`${a}\``)}function X2(e){return ro(e,"nonempty",t=>_b(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Q2(e,t){return ro(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function eI(e,t,r=t){const o=`Expected a ${e.type}`,a=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return ro(e,"size",u=>{if(typeof u=="number"||u instanceof Date)return t<=u&&u<=r||`${o} ${a} but received \`${u}\``;if(u instanceof Map||u instanceof Set){const{size:f}=u;return t<=f&&f<=r||`${o} with a size ${a} but received one with a size of \`${f}\``}else{const{length:f}=u;return t<=f&&f<=r||`${o} with a length ${a} but received one with a length of \`${f}\``}})}function ro(e,t,r){return new Ct({...e,*refiner(o,a){yield*e.refiner(o,a);const u=r(o,a),f=ml(u,a,e,o);for(const l of f)yield{...l,refinement:t}}})}const tI=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ct,StructError:lb,any:O2,array:C2,assert:db,assign:m2,bigint:P2,boolean:B2,coerce:Xl,create:hb,date:L2,defaulted:G2,define:mn,deprecated:v2,dynamic:E2,empty:J2,enums:x2,func:N2,instance:M2,integer:$2,intersection:D2,is:Yl,lazy:S2,literal:j2,map:U2,mask:gb,max:Y2,min:Z2,never:Zl,nonempty:X2,nullable:k2,number:H2,object:ks,omit:R2,optional:pb,partial:A2,pattern:Q2,pick:T2,record:W2,refine:ro,regexp:F2,set:q2,size:eI,string:bb,struct:I2,trimmed:K2,tuple:V2,type:Hs,union:z2,unknown:yb,validate:Fo},Symbol.toStringTag,{value:"Module"})),io=Z1(tI);Object.defineProperty(qt,"__esModule",{value:!0});qt.assertExhaustive=qt.assertStruct=qt.assert=qt.AssertionError=void 0;const nI=io;function rI(e){return typeof e=="object"&&e!==null&&"message"in e}function iI(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function oI(e){const t=rI(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function wb(e,t){return iI(e)?new e({message:t}):e({message:t})}class Ql extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}qt.AssertionError=Ql;function sI(e,t="Assertion failed.",r=Ql){if(!e)throw t instanceof Error?t:wb(r,t)}qt.assert=sI;function aI(e,t,r="Assertion failed",o=Ql){try{(0,nI.assert)(e,t)}catch(a){throw wb(o,`${r}: ${oI(a)}.`)}}qt.assertStruct=aI;function uI(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}qt.assertExhaustive=uI;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.base64=void 0;const fI=io,cI=qt,lI=(e,t={})=>{var r,o;const a=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,u=(o=t.characterSet)!==null&&o!==void 0?o:"base64";let f;u==="base64"?f=String.raw`[A-Za-z0-9+\/]`:((0,cI.assert)(u==="base64url"),f=String.raw`[-_A-Za-z0-9]`);let l;return a?l=new RegExp(`^(?:${f}{4})*(?:${f}{3}=|${f}{2}==)?$`,"u"):l=new RegExp(`^(?:${f}{4})*(?:${f}{2,3}|${f}{3}=|${f}{2}==)?$`,"u"),(0,fI.pattern)(e,l)};Ws.base64=lI;var Ye={},Fs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=io,r=qt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function o(d){return(0,t.is)(d,e.HexStruct)}e.isHexString=o;function a(d){return(0,t.is)(d,e.StrictHexStruct)}e.isStrictHexString=a;function u(d){(0,r.assert)(o(d),"Value must be a hexadecimal string.")}e.assertIsHexString=u;function f(d){(0,r.assert)(a(d),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=f;function l(d){return d.startsWith("0x")?d:d.startsWith("0X")?`0x${d.substring(2)}`:`0x${d}`}e.add0x=l;function h(d){return d.startsWith("0x")||d.startsWith("0X")?d.substring(2):d}e.remove0x=h})(Fs);Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createDataView=Ye.concatBytes=Ye.valueToBytes=Ye.stringToBytes=Ye.numberToBytes=Ye.signedBigIntToBytes=Ye.bigIntToBytes=Ye.hexToBytes=Ye.bytesToString=Ye.bytesToNumber=Ye.bytesToSignedBigInt=Ye.bytesToBigInt=Ye.bytesToHex=Ye.assertIsBytes=Ye.isBytes=void 0;const Pn=qt,vl=Fs,mp=48,vp=58,Ep=87;function dI(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const hI=dI();function ed(e){return e instanceof Uint8Array}Ye.isBytes=ed;function qo(e){(0,Pn.assert)(ed(e),"Value must be a Uint8Array.")}Ye.assertIsBytes=qo;function mb(e){if(qo(e),e.length===0)return"0x";const t=hI(),r=new Array(e.length);for(let o=0;o<e.length;o++)r[o]=t[e[o]];return(0,vl.add0x)(r.join(""))}Ye.bytesToHex=mb;function vb(e){qo(e);const t=mb(e);return BigInt(t)}Ye.bytesToBigInt=vb;function gI(e){qo(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}Ye.bytesToSignedBigInt=gI;function pI(e){qo(e);const t=vb(e);return(0,Pn.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}Ye.bytesToNumber=pI;function bI(e){return qo(e),new TextDecoder().decode(e)}Ye.bytesToString=bI;function xu(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,vl.assertIsHexString)(e);const r=(0,vl.remove0x)(e).toLowerCase(),o=r.length%2===0?r:`0${r}`,a=new Uint8Array(o.length/2);for(let u=0;u<a.length;u++){const f=o.charCodeAt(u*2),l=o.charCodeAt(u*2+1),h=f-(f<vp?mp:Ep),d=l-(l<vp?mp:Ep);a[u]=h*16+d}return a}Ye.hexToBytes=xu;function Eb(e){(0,Pn.assert)(typeof e=="bigint","Value must be a bigint."),(0,Pn.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return xu(t)}Ye.bigIntToBytes=Eb;function yI(e,t){(0,Pn.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function _I(e,t){(0,Pn.assert)(typeof e=="bigint","Value must be a bigint."),(0,Pn.assert)(typeof t=="number","Byte length must be a number."),(0,Pn.assert)(t>0,"Byte length must be greater than 0."),(0,Pn.assert)(yI(e,t),"Byte length is too small to represent the given value.");let r=e;const o=new Uint8Array(t);for(let a=0;a<o.length;a++)o[a]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return o.reverse()}Ye.signedBigIntToBytes=_I;function Sb(e){(0,Pn.assert)(typeof e=="number","Value must be a number."),(0,Pn.assert)(e>=0,"Value must be a non-negative number."),(0,Pn.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return xu(t)}Ye.numberToBytes=Sb;function Rb(e){return(0,Pn.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}Ye.stringToBytes=Rb;function Ab(e){if(typeof e=="bigint")return Eb(e);if(typeof e=="number")return Sb(e);if(typeof e=="string")return e.startsWith("0x")?xu(e):Rb(e);if(ed(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}Ye.valueToBytes=Ab;function wI(e){const t=new Array(e.length);let r=0;for(let a=0;a<e.length;a++){const u=Ab(e[a]);t[a]=u,r+=u.length}const o=new Uint8Array(r);for(let a=0,u=0;a<t.length;a++)o.set(t[a],u),u+=t[a].length;return o}Ye.concatBytes=wI;function mI(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}Ye.createDataView=mI;var Nu={};Object.defineProperty(Nu,"__esModule",{value:!0});Nu.ChecksumStruct=void 0;const Sp=io,vI=Ws;Nu.ChecksumStruct=(0,Sp.size)((0,vI.base64)((0,Sp.string)(),{paddingRequired:!0}),44,44);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.createHex=Sr.createBytes=Sr.createBigInt=Sr.createNumber=void 0;const wt=io,EI=qt,Tb=Ye,Mu=Fs,Ib=(0,wt.union)([(0,wt.number)(),(0,wt.bigint)(),(0,wt.string)(),Mu.StrictHexStruct]),SI=(0,wt.coerce)((0,wt.number)(),Ib,Number),RI=(0,wt.coerce)((0,wt.bigint)(),Ib,BigInt);(0,wt.union)([Mu.StrictHexStruct,(0,wt.instance)(Uint8Array)]);const AI=(0,wt.coerce)((0,wt.instance)(Uint8Array),(0,wt.union)([Mu.StrictHexStruct]),Tb.hexToBytes),TI=(0,wt.coerce)(Mu.StrictHexStruct,(0,wt.instance)(Uint8Array),Tb.bytesToHex);function II(e){try{const t=(0,wt.create)(e,SI);return(0,EI.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof wt.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Sr.createNumber=II;function OI(e){try{return(0,wt.create)(e,RI)}catch(t){throw t instanceof wt.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Sr.createBigInt=OI;function CI(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,wt.create)(e,AI)}catch(t){throw t instanceof wt.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Sr.createBytes=CI;function PI(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,wt.create)(e,TI)}catch(t){throw t instanceof wt.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Sr.createHex=PI;var Mo={},Ob=Ke&&Ke.__classPrivateFieldSet||function(e,t,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},cn=Ke&&Ke.__classPrivateFieldGet||function(e,t,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(e):o?o.value:t.get(e)},nr,wr;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.FrozenSet=Mo.FrozenMap=void 0;class td{constructor(t){nr.set(this,void 0),Ob(this,nr,new Map(t),"f"),Object.freeze(this)}get size(){return cn(this,nr,"f").size}[(nr=new WeakMap,Symbol.iterator)](){return cn(this,nr,"f")[Symbol.iterator]()}entries(){return cn(this,nr,"f").entries()}forEach(t,r){return cn(this,nr,"f").forEach((o,a,u)=>t.call(r,o,a,this))}get(t){return cn(this,nr,"f").get(t)}has(t){return cn(this,nr,"f").has(t)}keys(){return cn(this,nr,"f").keys()}values(){return cn(this,nr,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Mo.FrozenMap=td;class nd{constructor(t){wr.set(this,void 0),Ob(this,wr,new Set(t),"f"),Object.freeze(this)}get size(){return cn(this,wr,"f").size}[(wr=new WeakMap,Symbol.iterator)](){return cn(this,wr,"f")[Symbol.iterator]()}entries(){return cn(this,wr,"f").entries()}forEach(t,r){return cn(this,wr,"f").forEach((o,a,u)=>t.call(r,o,a,this))}has(t){return cn(this,wr,"f").has(t)}keys(){return cn(this,wr,"f").keys()}values(){return cn(this,wr,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Mo.FrozenSet=nd;Object.freeze(td);Object.freeze(td.prototype);Object.freeze(nd);Object.freeze(nd.prototype);var Cb={};Object.defineProperty(Cb,"__esModule",{value:!0});var Pb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=io,r=qt,o=()=>(0,t.define)("finite number",H=>(0,t.is)(H,(0,t.number)())&&Number.isFinite(H));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),o(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(H,ee)=>{function ge(fe,oe){const be=[...oe.validator(fe,ee)];return be.length>0?be:!0}try{const fe=ge(H,e.UnsafeJsonStruct);return fe!==!0?fe:ge(JSON.parse(JSON.stringify(H)),e.UnsafeJsonStruct)}catch(fe){return fe instanceof RangeError?"Circular reference detected":!1}});function a(H){return(0,t.is)(H,e.JsonStruct)}e.isValidJson=a;function u(H){(0,r.assertStruct)(H,e.JsonStruct,"Invalid JSON value");const ee=JSON.stringify(H);return new TextEncoder().encode(ee).byteLength}e.getJsonSize=u,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function f(H){return(0,t.is)(H,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=f;function l(H,ee){(0,r.assertStruct)(H,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",ee)}e.assertIsJsonRpcNotification=l;function h(H){return(0,t.is)(H,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function d(H,ee){(0,r.assertStruct)(H,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",ee)}e.assertIsJsonRpcRequest=d,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function p(H){return(0,t.is)(H,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function w(H,ee){(0,r.assertStruct)(H,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",ee)}e.assertIsPendingJsonRpcResponse=w;function T(H){return(0,t.is)(H,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=T;function v(H,ee){(0,r.assertStruct)(H,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",ee)}e.assertIsJsonRpcResponse=v;function k(H){return(0,t.is)(H,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=k;function C(H,ee){(0,r.assertStruct)(H,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",ee)}e.assertIsJsonRpcSuccess=C;function P(H){return(0,t.is)(H,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=P;function $(H,ee){(0,r.assertStruct)(H,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",ee)}e.assertIsJsonRpcFailure=$;function L(H){return(0,t.is)(H,e.JsonRpcErrorStruct)}e.isJsonRpcError=L;function S(H,ee){(0,r.assertStruct)(H,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",ee)}e.assertIsJsonRpcError=S;function m(H){const{permitEmptyString:ee,permitFractions:ge,permitNull:fe}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},H);return Ae=>!!(typeof Ae=="number"&&(ge||Number.isInteger(Ae))||typeof Ae=="string"&&(ee||Ae.length>0)||fe&&Ae===null)}e.getJsonRpcIdValidator=m})(Pb);var Bb={};Object.defineProperty(Bb,"__esModule",{value:!0});var $o={},El={exports:{}},jc,Rp;function BI(){if(Rp)return jc;Rp=1;var e=1e3,t=e*60,r=t*60,o=r*24,a=o*7,u=o*365.25;jc=function(p,w){w=w||{};var T=typeof p;if(T==="string"&&p.length>0)return f(p);if(T==="number"&&isFinite(p))return w.long?h(p):l(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function f(p){if(p=String(p),!(p.length>100)){var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(w){var T=parseFloat(w[1]),v=(w[2]||"ms").toLowerCase();switch(v){case"years":case"year":case"yrs":case"yr":case"y":return T*u;case"weeks":case"week":case"w":return T*a;case"days":case"day":case"d":return T*o;case"hours":case"hour":case"hrs":case"hr":case"h":return T*r;case"minutes":case"minute":case"mins":case"min":case"m":return T*t;case"seconds":case"second":case"secs":case"sec":case"s":return T*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return T;default:return}}}}function l(p){var w=Math.abs(p);return w>=o?Math.round(p/o)+"d":w>=r?Math.round(p/r)+"h":w>=t?Math.round(p/t)+"m":w>=e?Math.round(p/e)+"s":p+"ms"}function h(p){var w=Math.abs(p);return w>=o?d(p,w,o,"day"):w>=r?d(p,w,r,"hour"):w>=t?d(p,w,t,"minute"):w>=e?d(p,w,e,"second"):p+" ms"}function d(p,w,T,v){var k=w>=T*1.5;return Math.round(p/T)+" "+v+(k?"s":"")}return jc}function LI(e){r.debug=r,r.default=r,r.coerce=h,r.disable=u,r.enable=a,r.enabled=f,r.humanize=BI(),r.destroy=d,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let w=0;for(let T=0;T<p.length;T++)w=(w<<5)-w+p.charCodeAt(T),w|=0;return r.colors[Math.abs(w)%r.colors.length]}r.selectColor=t;function r(p){let w,T=null,v,k;function C(...P){if(!C.enabled)return;const $=C,L=Number(new Date),S=L-(w||L);$.diff=S,$.prev=w,$.curr=L,w=L,P[0]=r.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let m=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(ee,ge)=>{if(ee==="%%")return"%";m++;const fe=r.formatters[ge];if(typeof fe=="function"){const oe=P[m];ee=fe.call($,oe),P.splice(m,1),m--}return ee}),r.formatArgs.call($,P),($.log||r.log).apply($,P)}return C.namespace=p,C.useColors=r.useColors(),C.color=r.selectColor(p),C.extend=o,C.destroy=r.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>T!==null?T:(v!==r.namespaces&&(v=r.namespaces,k=r.enabled(p)),k),set:P=>{T=P}}),typeof r.init=="function"&&r.init(C),C}function o(p,w){const T=r(this.namespace+(typeof w>"u"?":":w)+p);return T.log=this.log,T}function a(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let w;const T=(typeof p=="string"?p:"").split(/[\s,]+/),v=T.length;for(w=0;w<v;w++)T[w]&&(p=T[w].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function u(){const p=[...r.names.map(l),...r.skips.map(l).map(w=>"-"+w)].join(",");return r.enable(""),p}function f(p){if(p[p.length-1]==="*")return!0;let w,T;for(w=0,T=r.skips.length;w<T;w++)if(r.skips[w].test(p))return!1;for(w=0,T=r.names.length;w<T;w++)if(r.names[w].test(p))return!0;return!1}function l(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function h(p){return p instanceof Error?p.stack||p.message:p}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var xI=LI;(function(e,t){var r={};t.formatArgs=a,t.save=u,t.load=f,t.useColors=o,t.storage=l(),t.destroy=(()=>{let d=!1;return()=>{d||(d=!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"];function o(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;d.splice(1,0,p,"color: inherit");let w=0,T=0;d[0].replace(/%[a-zA-Z%]/g,v=>{v!=="%%"&&(w++,v==="%c"&&(T=w))}),d.splice(T,0,p)}t.log=console.debug||console.log||(()=>{});function u(d){try{d?t.storage.setItem("debug",d):t.storage.removeItem("debug")}catch{}}function f(){let d;try{d=t.storage.getItem("debug")}catch{}return!d&&typeof process<"u"&&"env"in process&&(d=r.DEBUG),d}function l(){try{return localStorage}catch{}}e.exports=xI(t);const{formatters:h}=e.exports;h.j=function(d){try{return JSON.stringify(d)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(El,El.exports);var NI=El.exports,MI=Ke&&Ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($o,"__esModule",{value:!0});$o.createModuleLogger=$o.createProjectLogger=void 0;const $I=MI(NI),DI=(0,$I.default)("metamask");function jI(e){return DI.extend(e)}$o.createProjectLogger=jI;function UI(e,t){return e.extend(t)}$o.createModuleLogger=UI;var Lb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(d){return Array.isArray(d)&&d.length>0}e.isNonEmptyArray=t;function r(d){return d==null}e.isNullOrUndefined=r;function o(d){return!!d&&typeof d=="object"&&!Array.isArray(d)}e.isObject=o;const a=(d,p)=>Object.hasOwnProperty.call(d,p);e.hasProperty=a,function(d){d[d.Null=4]="Null",d[d.Comma=1]="Comma",d[d.Wrapper=1]="Wrapper",d[d.True=4]="True",d[d.False=5]="False",d[d.Quote=1]="Quote",d[d.Colon=1]="Colon",d[d.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function u(d){if(typeof d!="object"||d===null)return!1;try{let p=d;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(d)===p}catch{return!1}}e.isPlainObject=u;function f(d){return d.charCodeAt(0)<=127}e.isASCII=f;function l(d){var p;return d.split("").reduce((T,v)=>f(v)?T+1:T+2,0)+((p=d.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=l;function h(d){return d.toString().length}e.calculateNumberSize=h})(Lb);var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.hexToBigInt=Rr.hexToNumber=Rr.bigIntToHex=Rr.numberToHex=void 0;const Lo=qt,Ls=Fs,kI=e=>((0,Lo.assert)(typeof e=="number","Value must be a number."),(0,Lo.assert)(e>=0,"Value must be a non-negative number."),(0,Lo.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Ls.add0x)(e.toString(16)));Rr.numberToHex=kI;const HI=e=>((0,Lo.assert)(typeof e=="bigint","Value must be a bigint."),(0,Lo.assert)(e>=0,"Value must be a non-negative bigint."),(0,Ls.add0x)(e.toString(16)));Rr.bigIntToHex=HI;const WI=e=>{(0,Ls.assertIsHexString)(e);const t=parseInt(e,16);return(0,Lo.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Rr.hexToNumber=WI;const FI=e=>((0,Ls.assertIsHexString)(e),BigInt((0,Ls.add0x)(e)));Rr.hexToBigInt=FI;var xb={};Object.defineProperty(xb,"__esModule",{value:!0});var Nb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(u){u[u.Millisecond=1]="Millisecond",u[u.Second=1e3]="Second",u[u.Minute=6e4]="Minute",u[u.Hour=36e5]="Hour",u[u.Day=864e5]="Day",u[u.Week=6048e5]="Week",u[u.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=u=>Number.isInteger(u)&&u>=0,r=(u,f)=>{if(!t(u))throw new Error(`"${f}" must be a non-negative integer. Received: "${u}".`)};function o(u,f){return r(u,"count"),u*f}e.inMilliseconds=o;function a(u){return r(u,"timestamp"),Date.now()-u}e.timeSince=a})(Nb);var Mb={};Object.defineProperty(Mb,"__esModule",{value:!0});var $b={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=eR,r=io,o=qt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",w=>(0,t.valid)(w)===null?`Expected SemVer version, got "${w}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",w=>(0,t.validRange)(w)===null?`Expected SemVer range, got "${w}"`:!0);function a(w){return(0,r.is)(w,e.VersionStruct)}e.isValidSemVerVersion=a;function u(w){return(0,r.is)(w,e.VersionRangeStruct)}e.isValidSemVerRange=u;function f(w){(0,o.assertStruct)(w,e.VersionStruct)}e.assertIsSemVerVersion=f;function l(w){(0,o.assertStruct)(w,e.VersionRangeStruct)}e.assertIsSemVerRange=l;function h(w,T){return(0,t.gt)(w,T)}e.gtVersion=h;function d(w,T){return(0,t.gtr)(w,T)}e.gtRange=d;function p(w,T){return(0,t.satisfies)(w,T,{includePrerelease:!0})}e.satisfiesVersionRange=p})($b);(function(e){var t=Ke&&Ke.__createBinding||(Object.create?function(o,a,u,f){f===void 0&&(f=u);var l=Object.getOwnPropertyDescriptor(a,u);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[u]}}),Object.defineProperty(o,f,l)}:function(o,a,u,f){f===void 0&&(f=u),o[f]=a[u]}),r=Ke&&Ke.__exportStar||function(o,a){for(var u in o)u!=="default"&&!Object.prototype.hasOwnProperty.call(a,u)&&t(a,o,u)};Object.defineProperty(e,"__esModule",{value:!0}),r(qt,e),r(Ws,e),r(Ye,e),r(Nu,e),r(Sr,e),r(Mo,e),r(Cb,e),r(Fs,e),r(Pb,e),r(Bb,e),r($o,e),r(Lb,e),r(Rr,e),r(xb,e),r(Nb,e),r(Mb,e),r($b,e)})(Kl);var $u={},Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.errorValues=Si.errorCodes=void 0;Si.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Si.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeCause=e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Kl,r=Si,o=r.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",u={code:o,message:f(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function f(v,k=a){if(l(v)){const C=v.toString();if((0,t.hasProperty)(r.errorValues,C))return r.errorValues[C].message;if(p(v))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=f;function l(v){return Number.isInteger(v)}e.isValidCode=l;function h(v,{fallbackError:k=u,shouldIncludeStack:C=!0}={}){if(!(0,t.isJsonRpcError)(k))throw new Error("Must provide fallback error with integer number code and string message.");const P=d(v,k);return C||delete P.stack,P}e.serializeError=h;function d(v,k){if(v&&typeof v=="object"&&"serialize"in v&&typeof v.serialize=="function")return v.serialize();if((0,t.isJsonRpcError)(v))return v;const C=w(v);return{...k,data:{cause:C}}}function p(v){return v>=-32099&&v<=-32e3}function w(v){return Array.isArray(v)?v.map(k=>(0,t.isValidJson)(k)?k:(0,t.isObject)(k)?T(k):null):(0,t.isObject)(v)?T(v):(0,t.isValidJson)(v)?v:null}e.serializeCause=w;function T(v){return Object.getOwnPropertyNames(v).reduce((k,C)=>{const P=v[C];return(0,t.isValidJson)(P)&&(k[C]=P),k},{})}})($u);var qI=Ke&&Ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.EthereumProviderError=Zi.JsonRpcError=void 0;const VI=Kl,zI=qI(Gl),GI=$u;class Db extends Error{constructor(t,r,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a non-empty string.');super(r),this.code=t,o!==void 0&&(this.data=o)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data,(0,VI.isPlainObject)(this.data)&&(t.data.cause=(0,GI.serializeCause)(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return(0,zI.default)(this.serialize(),YI,2)}}Zi.JsonRpcError=Db;let KI=class extends Db{constructor(t,r,o){if(!JI(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,o)}};Zi.EthereumProviderError=KI;function JI(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function YI(e,t){if(t!=="[Circular]")return t}var Do={};Object.defineProperty(Do,"__esModule",{value:!0});Do.providerErrors=Do.rpcErrors=void 0;const rd=Zi,Xt=Si,jb=$u;Do.rpcErrors={parse:e=>Hn(Xt.errorCodes.rpc.parse,e),invalidRequest:e=>Hn(Xt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Hn(Xt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Hn(Xt.errorCodes.rpc.methodNotFound,e),internal:e=>Hn(Xt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Hn(t,e)},invalidInput:e=>Hn(Xt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Hn(Xt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Hn(Xt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Hn(Xt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Hn(Xt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Hn(Xt.errorCodes.rpc.limitExceeded,e)};Do.providerErrors={userRejectedRequest:e=>ys(Xt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>ys(Xt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>ys(Xt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>ys(Xt.errorCodes.provider.disconnected,e),chainDisconnected:e=>ys(Xt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:o}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new rd.EthereumProviderError(t,r,o)}};function Hn(e,t){const[r,o]=Ub(t);return new rd.JsonRpcError(e,r??(0,jb.getMessageFromCode)(e),o)}function ys(e,t){const[r,o]=Ub(t);return new rd.EthereumProviderError(e,r??(0,jb.getMessageFromCode)(e),o)}function Ub(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorCodes=e.providerErrors=e.rpcErrors=e.getMessageFromCode=e.serializeError=e.serializeCause=e.EthereumProviderError=e.JsonRpcError=void 0;var t=Zi;Object.defineProperty(e,"JsonRpcError",{enumerable:!0,get:function(){return t.JsonRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});var r=$u;Object.defineProperty(e,"serializeCause",{enumerable:!0,get:function(){return r.serializeCause}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});var o=Do;Object.defineProperty(e,"rpcErrors",{enumerable:!0,get:function(){return o.rpcErrors}}),Object.defineProperty(e,"providerErrors",{enumerable:!0,get:function(){return o.providerErrors}});var a=Si;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})})(b2);var id={exports:{}},ZI=kb;function kb(e,t){if(e&&t)return kb(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(o){r[o]=e[o]}),r;function r(){for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];var u=e.apply(this,o),f=o[o.length-1];return typeof u=="function"&&u!==f&&Object.keys(f).forEach(function(l){u[l]=f[l]}),u}}var Hb=ZI;id.exports=Hb(su);id.exports.strict=Hb(Wb);su.proto=su(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return su(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Wb(this)},configurable:!0})});function su(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Wb(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}var od=id.exports;const XI=Ii(od);var QI=od,eO=function(){},tO=function(e){return e.setHeader&&typeof e.abort=="function"},nO=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},Fb=function(e,t,r){if(typeof t=="function")return Fb(e,null,t);t||(t={}),r=QI(r||eO);var o=e._writableState,a=e._readableState,u=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,l=!1,h=function(){e.writable||d()},d=function(){f=!1,u||r.call(e)},p=function(){u=!1,f||r.call(e)},w=function(P){r.call(e,P?new Error("exited with error code: "+P):null)},T=function(P){r.call(e,P)},v=function(){process.nextTick(k)},k=function(){if(!l){if(u&&!(a&&a.ended&&!a.destroyed))return r.call(e,new Error("premature close"));if(f&&!(o&&o.ended&&!o.destroyed))return r.call(e,new Error("premature close"))}},C=function(){e.req.on("finish",d)};return tO(e)?(e.on("complete",d),e.on("abort",v),e.req?C():e.on("request",C)):f&&!o&&(e.on("end",h),e.on("close",h)),nO(e)&&e.on("exit",w),e.on("end",p),e.on("finish",d),t.error!==!1&&e.on("error",T),e.on("close",v),function(){l=!0,e.removeListener("complete",d),e.removeListener("abort",v),e.removeListener("request",C),e.req&&e.req.removeListener("finish",d),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("exit",w),e.removeListener("end",p),e.removeListener("error",T),e.removeListener("close",v)}},qb=Fb;const Ap=Ii(qb);var rO=od,iO=qb,au;try{au=Vi}catch{}var xs=function(){},oO=/^v?\.0/.test(process.version),Du=function(e){return typeof e=="function"},sO=function(e){return!oO||!au?!1:(e instanceof(au.ReadStream||xs)||e instanceof(au.WriteStream||xs))&&Du(e.close)},aO=function(e){return e.setHeader&&Du(e.abort)},uO=function(e,t,r,o){o=rO(o);var a=!1;e.on("close",function(){a=!0}),iO(e,{readable:t,writable:r},function(f){if(f)return o(f);a=!0,o()});var u=!1;return function(f){if(!a&&!u){if(u=!0,sO(e))return e.close(xs);if(aO(e))return e.abort();if(Du(e.destroy))return e.destroy();o(f||new Error("stream was destroyed"))}}},Tp=function(e){e()},fO=function(e,t){return e.pipe(t)},cO=function(){var e=Array.prototype.slice.call(arguments),t=Du(e[e.length-1]||xs)&&e.pop()||xs;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,o=e.map(function(a,u){var f=u<e.length-1,l=u>0;return uO(a,f,l,function(h){r||(r=h),h&&o.forEach(Tp),!f&&(o.forEach(Tp),t(r))})});return e.reduce(fO)},lO=cO;const Ip=Ii(lO);var ir={},Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.EthereumProviderError=Ri.EthereumRpcError=void 0;const dO=Gl;class Vb extends Error{constructor(t,r,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,o!==void 0&&(this.data=o)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return dO.default(this.serialize(),pO,2)}}Ri.EthereumRpcError=Vb;class hO extends Vb{constructor(t,r,o){if(!gO(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,o)}}Ri.EthereumProviderError=hO;function gO(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function pO(e,t){if(t!=="[Circular]")return t}var sd={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.errorValues=Ai.errorCodes=void 0;Ai.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Ai.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ai,r=Ri,o=t.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",u={code:o,message:f(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function f(T,v=a){if(Number.isInteger(T)){const k=T.toString();if(w(t.errorValues,k))return t.errorValues[k].message;if(d(T))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return v}e.getMessageFromCode=f;function l(T){if(!Number.isInteger(T))return!1;const v=T.toString();return!!(t.errorValues[v]||d(T))}e.isValidCode=l;function h(T,{fallbackError:v=u,shouldIncludeStack:k=!1}={}){var C,P;if(!v||!Number.isInteger(v.code)||typeof v.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(T instanceof r.EthereumRpcError)return T.serialize();const $={};if(T&&typeof T=="object"&&!Array.isArray(T)&&w(T,"code")&&l(T.code)){const S=T;$.code=S.code,S.message&&typeof S.message=="string"?($.message=S.message,w(S,"data")&&($.data=S.data)):($.message=f($.code),$.data={originalError:p(T)})}else{$.code=v.code;const S=(C=T)===null||C===void 0?void 0:C.message;$.message=S&&typeof S=="string"?S:v.message,$.data={originalError:p(T)}}const L=(P=T)===null||P===void 0?void 0:P.stack;return k&&T&&L&&typeof L=="string"&&($.stack=L),$}e.serializeError=h;function d(T){return T>=-32099&&T<=-32e3}function p(T){return T&&typeof T=="object"&&!Array.isArray(T)?Object.assign({},T):T}function w(T,v){return Object.prototype.hasOwnProperty.call(T,v)}})(sd);var ju={};Object.defineProperty(ju,"__esModule",{value:!0});ju.ethErrors=void 0;const ad=Ri,zb=sd,Zt=Ai;ju.ethErrors={rpc:{parse:e=>Wn(Zt.errorCodes.rpc.parse,e),invalidRequest:e=>Wn(Zt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Wn(Zt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Wn(Zt.errorCodes.rpc.methodNotFound,e),internal:e=>Wn(Zt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Wn(t,e)},invalidInput:e=>Wn(Zt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Wn(Zt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Wn(Zt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Wn(Zt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Wn(Zt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Wn(Zt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>_s(Zt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>_s(Zt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>_s(Zt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>_s(Zt.errorCodes.provider.disconnected,e),chainDisconnected:e=>_s(Zt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:o}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ad.EthereumProviderError(t,r,o)}}};function Wn(e,t){const[r,o]=Gb(t);return new ad.EthereumRpcError(e,r||zb.getMessageFromCode(e),o)}function _s(e,t){const[r,o]=Gb(t);return new ad.EthereumProviderError(e,r||zb.getMessageFromCode(e),o)}function Gb(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ri;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=sd;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const o=ju;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const a=Ai;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})})(ir);var bO=yO;function yO(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const _O=Ii(bO);var wO={},Uu={},ku={},Kb={},jo={},Ei={},It={};Object.defineProperty(It,"__esModule",{value:!0});It.output=It.exists=It.hash=It.bytes=It.bool=It.number=It.isBytes=void 0;function hu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}It.number=hu;function Jb(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}It.bool=Jb;function Yb(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}It.isBytes=Yb;function ud(e,...t){if(!Yb(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}It.bytes=ud;function Zb(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");hu(e.outputLen),hu(e.blockLen)}It.hash=Zb;function Xb(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}It.exists=Xb;function Qb(e,t){ud(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}It.output=Qb;const mO={number:hu,bool:Jb,bytes:ud,hash:Zb,exists:Xb,output:Qb};It.default=mO;var Qr={},Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});Hu.crypto=void 0;Hu.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.byteSwap32=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=e.isBytes=void 0;const t=Hu,r=It;function o(M){return M instanceof Uint8Array||M!=null&&typeof M=="object"&&M.constructor.name==="Uint8Array"}e.isBytes=o;const a=M=>new Uint8Array(M.buffer,M.byteOffset,M.byteLength);e.u8=a;const u=M=>new Uint32Array(M.buffer,M.byteOffset,Math.floor(M.byteLength/4));e.u32=u;const f=M=>new DataView(M.buffer,M.byteOffset,M.byteLength);e.createView=f;const l=(M,N)=>M<<32-N|M>>>N;e.rotr=l;const h=(M,N)=>M<<N|M>>>32-N>>>0;e.rotl=h,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const d=M=>M<<24&4278190080|M<<8&16711680|M>>>8&65280|M>>>24&255;e.byteSwap=d,e.byteSwapIfBE=e.isLE?M=>M:M=>(0,e.byteSwap)(M);function p(M){for(let N=0;N<M.length;N++)M[N]=(0,e.byteSwap)(M[N])}e.byteSwap32=p;const w=Array.from({length:256},(M,N)=>N.toString(16).padStart(2,"0"));function T(M){(0,r.bytes)(M);let N="";for(let D=0;D<M.length;D++)N+=w[M[D]];return N}e.bytesToHex=T;const v={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function k(M){if(M>=v._0&&M<=v._9)return M-v._0;if(M>=v._A&&M<=v._F)return M-(v._A-10);if(M>=v._a&&M<=v._f)return M-(v._a-10)}function C(M){if(typeof M!="string")throw new Error("hex string expected, got "+typeof M);const N=M.length,D=N/2;if(N%2)throw new Error("padded hex string expected, got unpadded hex of length "+N);const K=new Uint8Array(D);for(let ne=0,J=0;ne<D;ne++,J+=2){const ue=k(M.charCodeAt(J)),G=k(M.charCodeAt(J+1));if(ue===void 0||G===void 0){const Y=M[J]+M[J+1];throw new Error('hex string expected, got non-hex character "'+Y+'" at index '+J)}K[ne]=ue*16+G}return K}e.hexToBytes=C;const P=async()=>{};e.nextTick=P;async function $(M,N,D){let K=Date.now();for(let ne=0;ne<M;ne++){D(ne);const J=Date.now()-K;J>=0&&J<N||(await(0,e.nextTick)(),K+=J)}}e.asyncLoop=$;function L(M){if(typeof M!="string")throw new Error(`utf8ToBytes expected string, got ${typeof M}`);return new Uint8Array(new TextEncoder().encode(M))}e.utf8ToBytes=L;function S(M){return typeof M=="string"&&(M=L(M)),(0,r.bytes)(M),M}e.toBytes=S;function m(...M){let N=0;for(let K=0;K<M.length;K++){const ne=M[K];(0,r.bytes)(ne),N+=ne.length}const D=new Uint8Array(N);for(let K=0,ne=0;K<M.length;K++){const J=M[K];D.set(J,ne),ne+=J.length}return D}e.concatBytes=m;class H{clone(){return this._cloneInto()}}e.Hash=H;const ee={}.toString;function ge(M,N){if(N!==void 0&&ee.call(N)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(M,N)}e.checkOpts=ge;function fe(M){const N=K=>M().update(S(K)).digest(),D=M();return N.outputLen=D.outputLen,N.blockLen=D.blockLen,N.create=()=>M(),N}e.wrapConstructor=fe;function oe(M){const N=(K,ne)=>M(ne).update(S(K)).digest(),D=M({});return N.outputLen=D.outputLen,N.blockLen=D.blockLen,N.create=K=>M(K),N}e.wrapConstructorWithOpts=oe;function Ae(M){const N=(K,ne)=>M(ne).update(S(K)).digest(),D=M({});return N.outputLen=D.outputLen,N.blockLen=D.blockLen,N.create=K=>M(K),N}e.wrapXOFConstructorWithOpts=Ae;function be(M=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(M));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=be})(Qr);Object.defineProperty(Ei,"__esModule",{value:!0});Ei.HashMD=Ei.Maj=Ei.Chi=void 0;const Uc=It,ws=Qr;function vO(e,t,r,o){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,o);const a=BigInt(32),u=BigInt(4294967295),f=Number(r>>a&u),l=Number(r&u),h=o?4:0,d=o?0:4;e.setUint32(t+h,f,o),e.setUint32(t+d,l,o)}const EO=(e,t,r)=>e&t^~e&r;Ei.Chi=EO;const SO=(e,t,r)=>e&t^e&r^t&r;Ei.Maj=SO;class RO extends ws.Hash{constructor(t,r,o,a){super(),this.blockLen=t,this.outputLen=r,this.padOffset=o,this.isLE=a,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,ws.createView)(this.buffer)}update(t){(0,Uc.exists)(this);const{view:r,buffer:o,blockLen:a}=this;t=(0,ws.toBytes)(t);const u=t.length;for(let f=0;f<u;){const l=Math.min(a-this.pos,u-f);if(l===a){const h=(0,ws.createView)(t);for(;a<=u-f;f+=a)this.process(h,f);continue}o.set(t.subarray(f,f+l),this.pos),this.pos+=l,f+=l,this.pos===a&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,Uc.exists)(this),(0,Uc.output)(t,this),this.finished=!0;const{buffer:r,view:o,blockLen:a,isLE:u}=this;let{pos:f}=this;r[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>a-f&&(this.process(o,0),f=0);for(let w=f;w<a;w++)r[w]=0;vO(o,a-8,BigInt(this.length*8),u),this.process(o,0);const l=(0,ws.createView)(t),h=this.outputLen;if(h%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=h/4,p=this.get();if(d>p.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w<d;w++)l.setUint32(4*w,p[w],u)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const o=t.slice(0,r);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:o,length:a,finished:u,destroyed:f,pos:l}=this;return t.length=a,t.pos=l,t.finished=u,t.destroyed=f,a%r&&t.buffer.set(o),t}}Ei.HashMD=RO;Object.defineProperty(jo,"__esModule",{value:!0});jo.sha224=jo.sha256=void 0;const kc=Ei,Fn=Qr,AO=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_i=new Uint32Array(64);class ey extends kc.HashMD{constructor(){super(64,32,8,!1),this.A=yi[0]|0,this.B=yi[1]|0,this.C=yi[2]|0,this.D=yi[3]|0,this.E=yi[4]|0,this.F=yi[5]|0,this.G=yi[6]|0,this.H=yi[7]|0}get(){const{A:t,B:r,C:o,D:a,E:u,F:f,G:l,H:h}=this;return[t,r,o,a,u,f,l,h]}set(t,r,o,a,u,f,l,h){this.A=t|0,this.B=r|0,this.C=o|0,this.D=a|0,this.E=u|0,this.F=f|0,this.G=l|0,this.H=h|0}process(t,r){for(let w=0;w<16;w++,r+=4)_i[w]=t.getUint32(r,!1);for(let w=16;w<64;w++){const T=_i[w-15],v=_i[w-2],k=(0,Fn.rotr)(T,7)^(0,Fn.rotr)(T,18)^T>>>3,C=(0,Fn.rotr)(v,17)^(0,Fn.rotr)(v,19)^v>>>10;_i[w]=C+_i[w-7]+k+_i[w-16]|0}let{A:o,B:a,C:u,D:f,E:l,F:h,G:d,H:p}=this;for(let w=0;w<64;w++){const T=(0,Fn.rotr)(l,6)^(0,Fn.rotr)(l,11)^(0,Fn.rotr)(l,25),v=p+T+(0,kc.Chi)(l,h,d)+AO[w]+_i[w]|0,C=((0,Fn.rotr)(o,2)^(0,Fn.rotr)(o,13)^(0,Fn.rotr)(o,22))+(0,kc.Maj)(o,a,u)|0;p=d,d=h,h=l,l=f+v|0,f=u,u=a,a=o,o=v+C|0}o=o+this.A|0,a=a+this.B|0,u=u+this.C|0,f=f+this.D|0,l=l+this.E|0,h=h+this.F|0,d=d+this.G|0,p=p+this.H|0,this.set(o,a,u,f,l,h,d,p)}roundClean(){_i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class TO extends ey{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}jo.sha256=(0,Fn.wrapConstructor)(()=>new ey);jo.sha224=(0,Fn.wrapConstructor)(()=>new TO);var Wu={},ty={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=It,r=Qr;class o extends r.Hash{constructor(f,l){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(f);const h=(0,r.toBytes)(l);if(this.iHash=f.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,p=new Uint8Array(d);p.set(h.length>d?f.create().update(h).digest():h);for(let w=0;w<p.length;w++)p[w]^=54;this.iHash.update(p),this.oHash=f.create();for(let w=0;w<p.length;w++)p[w]^=106;this.oHash.update(p),p.fill(0)}update(f){return(0,t.exists)(this),this.iHash.update(f),this}digestInto(f){(0,t.exists)(this),(0,t.bytes)(f,this.outputLen),this.finished=!0,this.iHash.digestInto(f),this.oHash.update(f),this.oHash.digestInto(f),this.destroy()}digest(){const f=new Uint8Array(this.oHash.outputLen);return this.digestInto(f),f}_cloneInto(f){f||(f=Object.create(Object.getPrototypeOf(this),{}));const{oHash:l,iHash:h,finished:d,destroyed:p,blockLen:w,outputLen:T}=this;return f=f,f.finished=d,f.destroyed=p,f.blockLen=w,f.outputLen=T,f.oHash=l._cloneInto(f.oHash),f.iHash=h._cloneInto(f.iHash),f}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=o;const a=(u,f,l)=>new o(u,f).update(l).digest();e.hmac=a,e.hmac.create=(u,f)=>new o(u,f)})(ty);var fd={},Fu={},pt={},rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.bitMask=void 0;rt.isBytes=Vu;rt.abytes=zu;rt.bytesToHex=cd;rt.numberToHexUnpadded=ry;rt.hexToNumber=ld;rt.hexToBytes=Gu;rt.bytesToNumberBE=CO;rt.bytesToNumberLE=PO;rt.numberToBytesBE=iy;rt.numberToBytesLE=BO;rt.numberToVarBytesBE=LO;rt.ensureBytes=xO;rt.concatBytes=oy;rt.equalBytes=NO;rt.utf8ToBytes=MO;rt.bitLen=$O;rt.bitGet=DO;rt.bitSet=jO;rt.createHmacDrbg=kO;rt.validateObject=WO;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ny=BigInt(0),qu=BigInt(1),IO=BigInt(2);function Vu(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function zu(e){if(!Vu(e))throw new Error("Uint8Array expected")}const OO=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function cd(e){zu(e);let t="";for(let r=0;r<e.length;r++)t+=OO[e[r]];return t}function ry(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function ld(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const zr={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Op(e){if(e>=zr._0&&e<=zr._9)return e-zr._0;if(e>=zr._A&&e<=zr._F)return e-(zr._A-10);if(e>=zr._a&&e<=zr._f)return e-(zr._a-10)}function Gu(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const o=new Uint8Array(r);for(let a=0,u=0;a<r;a++,u+=2){const f=Op(e.charCodeAt(u)),l=Op(e.charCodeAt(u+1));if(f===void 0||l===void 0){const h=e[u]+e[u+1];throw new Error('hex string expected, got non-hex character "'+h+'" at index '+u)}o[a]=f*16+l}return o}function CO(e){return ld(cd(e))}function PO(e){return zu(e),ld(cd(Uint8Array.from(e).reverse()))}function iy(e,t){return Gu(e.toString(16).padStart(t*2,"0"))}function BO(e,t){return iy(e,t).reverse()}function LO(e){return Gu(ry(e))}function xO(e,t,r){let o;if(typeof t=="string")try{o=Gu(t)}catch(u){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${u}`)}else if(Vu(t))o=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const a=o.length;if(typeof r=="number"&&a!==r)throw new Error(`${e} expected ${r} bytes, got ${a}`);return o}function oy(...e){let t=0;for(let o=0;o<e.length;o++){const a=e[o];zu(a),t+=a.length}const r=new Uint8Array(t);for(let o=0,a=0;o<e.length;o++){const u=e[o];r.set(u,a),a+=u.length}return r}function NO(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e[o]^t[o];return r===0}function MO(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function $O(e){let t;for(t=0;e>ny;e>>=qu,t+=1);return t}function DO(e,t){return e>>BigInt(t)&qu}function jO(e,t,r){return e|(r?qu:ny)<<BigInt(t)}const UO=e=>(IO<<BigInt(e-1))-qu;rt.bitMask=UO;const Hc=e=>new Uint8Array(e),Cp=e=>Uint8Array.from(e);function kO(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let o=Hc(e),a=Hc(e),u=0;const f=()=>{o.fill(1),a.fill(0),u=0},l=(...w)=>r(a,o,...w),h=(w=Hc())=>{a=l(Cp([0]),w),o=l(),w.length!==0&&(a=l(Cp([1]),w),o=l())},d=()=>{if(u++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const T=[];for(;w<t;){o=l();const v=o.slice();T.push(v),w+=o.length}return oy(...T)};return(w,T)=>{f(),h(w);let v;for(;!(v=T(d()));)h();return f(),v}}const HO={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Vu(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function WO(e,t,r={}){const o=(a,u,f)=>{const l=HO[u];if(typeof l!="function")throw new Error(`Invalid validator "${u}", expected function`);const h=e[a];if(!(f&&h===void 0)&&!l(h,e))throw new Error(`Invalid param ${String(a)}=${h} (${typeof h}), expected ${u}`)};for(const[a,u]of Object.entries(t))o(a,u,!1);for(const[a,u]of Object.entries(r))o(a,u,!0);return e}Object.defineProperty(pt,"__esModule",{value:!0});pt.isNegativeLE=void 0;pt.mod=On;pt.pow=sy;pt.pow2=qO;pt.invert=gu;pt.tonelliShanks=ay;pt.FpSqrt=uy;pt.validateField=GO;pt.FpPow=fy;pt.FpInvertBatch=cy;pt.FpDiv=KO;pt.FpIsSquare=JO;pt.nLength=dd;pt.Field=YO;pt.FpSqrtOdd=ZO;pt.FpSqrtEven=XO;pt.hashToPrivateScalar=QO;pt.getFieldBytesLength=hd;pt.getMinHashLength=ly;pt.mapHashToField=eC;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Cn=rt,kt=BigInt(0),gt=BigInt(1),vi=BigInt(2),FO=BigInt(3),Sl=BigInt(4),Pp=BigInt(5),Bp=BigInt(8);BigInt(9);BigInt(16);function On(e,t){const r=e%t;return r>=kt?r:t+r}function sy(e,t,r){if(r<=kt||t<kt)throw new Error("Expected power/modulo > 0");if(r===gt)return kt;let o=gt;for(;t>kt;)t>&&(o=o*e%r),e=e*e%r,t>>=gt;return o}function qO(e,t,r){let o=e;for(;t-- >kt;)o*=o,o%=r;return o}function gu(e,t){if(e===kt||t<=kt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=On(e,t),o=t,a=kt,u=gt;for(;r!==kt;){const l=o/r,h=o%r,d=a-u*l;o=r,r=h,a=u,u=d}if(o!==gt)throw new Error("invert: does not exist");return On(a,t)}function ay(e){const t=(e-gt)/vi;let r,o,a;for(r=e-gt,o=0;r%vi===kt;r/=vi,o++);for(a=vi;a<e&&sy(a,t,e)!==e-gt;a++);if(o===1){const f=(e+gt)/Sl;return function(h,d){const p=h.pow(d,f);if(!h.eql(h.sqr(p),d))throw new Error("Cannot find square root");return p}}const u=(r+gt)/vi;return function(l,h){if(l.pow(h,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let d=o,p=l.pow(l.mul(l.ONE,a),r),w=l.pow(h,u),T=l.pow(h,r);for(;!l.eql(T,l.ONE);){if(l.eql(T,l.ZERO))return l.ZERO;let v=1;for(let C=l.sqr(T);v<d&&!l.eql(C,l.ONE);v++)C=l.sqr(C);const k=l.pow(p,gt<<BigInt(d-v-1));p=l.sqr(k),w=l.mul(w,k),T=l.mul(T,p),d=v}return w}}function uy(e){if(e%Sl===FO){const t=(e+gt)/Sl;return function(o,a){const u=o.pow(a,t);if(!o.eql(o.sqr(u),a))throw new Error("Cannot find square root");return u}}if(e%Bp===Pp){const t=(e-Pp)/Bp;return function(o,a){const u=o.mul(a,vi),f=o.pow(u,t),l=o.mul(a,f),h=o.mul(o.mul(l,vi),f),d=o.mul(l,o.sub(h,o.ONE));if(!o.eql(o.sqr(d),a))throw new Error("Cannot find square root");return d}}return ay(e)}const VO=(e,t)=>(On(e,t)>)===gt;pt.isNegativeLE=VO;const zO=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function GO(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=zO.reduce((o,a)=>(o[a]="function",o),t);return(0,Cn.validateObject)(e,r)}function fy(e,t,r){if(r<kt)throw new Error("Expected power > 0");if(r===kt)return e.ONE;if(r===gt)return t;let o=e.ONE,a=t;for(;r>kt;)r>&&(o=e.mul(o,a)),a=e.sqr(a),r>>=gt;return o}function cy(e,t){const r=new Array(t.length),o=t.reduce((u,f,l)=>e.is0(f)?u:(r[l]=u,e.mul(u,f)),e.ONE),a=e.inv(o);return t.reduceRight((u,f,l)=>e.is0(f)?u:(r[l]=e.mul(u,r[l]),e.mul(u,f)),a),r}function KO(e,t,r){return e.mul(t,typeof r=="bigint"?gu(r,e.ORDER):e.inv(r))}function JO(e){const t=(e.ORDER-gt)/vi;return r=>{const o=e.pow(r,t);return e.eql(o,e.ZERO)||e.eql(o,e.ONE)}}function dd(e,t){const r=t!==void 0?t:e.toString(2).length,o=Math.ceil(r/8);return{nBitLength:r,nByteLength:o}}function YO(e,t,r=!1,o={}){if(e<=kt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:a,nByteLength:u}=dd(e,t);if(u>2048)throw new Error("Field lengths over 2048 bytes are not supported");const f=uy(e),l=Object.freeze({ORDER:e,BITS:a,BYTES:u,MASK:(0,Cn.bitMask)(a),ZERO:kt,ONE:gt,create:h=>On(h,e),isValid:h=>{if(typeof h!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof h}`);return kt<=h&&h<e},is0:h=>h===kt,isOdd:h=>(h>)===gt,neg:h=>On(-h,e),eql:(h,d)=>h===d,sqr:h=>On(h*h,e),add:(h,d)=>On(h+d,e),sub:(h,d)=>On(h-d,e),mul:(h,d)=>On(h*d,e),pow:(h,d)=>fy(l,h,d),div:(h,d)=>On(h*gu(d,e),e),sqrN:h=>h*h,addN:(h,d)=>h+d,subN:(h,d)=>h-d,mulN:(h,d)=>h*d,inv:h=>gu(h,e),sqrt:o.sqrt||(h=>f(l,h)),invertBatch:h=>cy(l,h),cmov:(h,d,p)=>p?d:h,toBytes:h=>r?(0,Cn.numberToBytesLE)(h,u):(0,Cn.numberToBytesBE)(h,u),fromBytes:h=>{if(h.length!==u)throw new Error(`Fp.fromBytes: expected ${u}, got ${h.length}`);return r?(0,Cn.bytesToNumberLE)(h):(0,Cn.bytesToNumberBE)(h)}});return Object.freeze(l)}function ZO(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}function XO(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function QO(e,t,r=!1){e=(0,Cn.ensureBytes)("privateHash",e);const o=e.length,a=dd(t).nByteLength+8;if(a<24||o<a||o>1024)throw new Error(`hashToPrivateScalar: expected ${a}-1024 bytes of input, got ${o}`);const u=r?(0,Cn.bytesToNumberLE)(e):(0,Cn.bytesToNumberBE)(e);return On(u,t-gt)+gt}function hd(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function ly(e){const t=hd(e);return t+Math.ceil(t/2)}function eC(e,t,r=!1){const o=e.length,a=hd(t),u=ly(t);if(o<16||o<u||o>1024)throw new Error(`expected ${u}-1024 bytes of input, got ${o}`);const f=r?(0,Cn.bytesToNumberBE)(e):(0,Cn.bytesToNumberLE)(e),l=On(f,t-gt)+gt;return r?(0,Cn.numberToBytesLE)(l,a):(0,Cn.numberToBytesBE)(l,a)}Object.defineProperty(Fu,"__esModule",{value:!0});Fu.wNAF=rC;Fu.validateBasic=iC;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Lp=pt,tC=rt,nC=BigInt(0),Wc=BigInt(1);function rC(e,t){const r=(a,u)=>{const f=u.negate();return a?f:u},o=a=>{const u=Math.ceil(t/a)+1,f=2**(a-1);return{windows:u,windowSize:f}};return{constTimeNegate:r,unsafeLadder(a,u){let f=e.ZERO,l=a;for(;u>nC;)u&Wc&&(f=f.add(l)),l=l.double(),u>>=Wc;return f},precomputeWindow(a,u){const{windows:f,windowSize:l}=o(u),h=[];let d=a,p=d;for(let w=0;w<f;w++){p=d,h.push(p);for(let T=1;T<l;T++)p=p.add(d),h.push(p);d=p.double()}return h},wNAF(a,u,f){const{windows:l,windowSize:h}=o(a);let d=e.ZERO,p=e.BASE;const w=BigInt(2**a-1),T=2**a,v=BigInt(a);for(let k=0;k<l;k++){const C=k*h;let P=Number(f&w);f>>=v,P>h&&(P-=T,f+=Wc);const $=C,L=C+Math.abs(P)-1,S=k%2!==0,m=P<0;P===0?p=p.add(r(S,u[$])):d=d.add(r(m,u[L]))}return{p:d,f:p}},wNAFCached(a,u,f,l){const h=a._WINDOW_SIZE||1;let d=u.get(a);return d||(d=this.precomputeWindow(a,h),h!==1&&u.set(a,l(d))),this.wNAF(h,d,f)}}}function iC(e){return(0,Lp.validateField)(e.Fp),(0,tC.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,Lp.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=v,e.weierstrass=C,e.SWUFpSqrtRatio=P,e.mapToCurveSimpleSWU=$;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Fu,r=pt,o=rt,a=rt;function u(L){const S=(0,t.validateBasic)(L);o.validateObject(S,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:m,Fp:H,a:ee}=S;if(m){if(!H.eql(ee,H.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof m!="object"||typeof m.beta!="bigint"||typeof m.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...S})}const{bytesToNumberBE:f,hexToBytes:l}=o;e.DER={Err:class extends Error{constructor(S=""){super(S)}},_parseInt(L){const{Err:S}=e.DER;if(L.length<2||L[0]!==2)throw new S("Invalid signature integer tag");const m=L[1],H=L.subarray(2,m+2);if(!m||H.length!==m)throw new S("Invalid signature integer: wrong length");if(H[0]&128)throw new S("Invalid signature integer: negative");if(H[0]===0&&!(H[1]&128))throw new S("Invalid signature integer: unnecessary leading zero");return{d:f(H),l:L.subarray(m+2)}},toSig(L){const{Err:S}=e.DER,m=typeof L=="string"?l(L):L;o.abytes(m);let H=m.length;if(H<2||m[0]!=48)throw new S("Invalid signature tag");if(m[1]!==H-2)throw new S("Invalid signature: incorrect length");const{d:ee,l:ge}=e.DER._parseInt(m.subarray(2)),{d:fe,l:oe}=e.DER._parseInt(ge);if(oe.length)throw new S("Invalid signature: left bytes after parsing");return{r:ee,s:fe}},hexFromSig(L){const S=be=>Number.parseInt(be[0],16)&8?"00"+be:be,m=be=>{const M=be.toString(16);return M.length&1?`0${M}`:M},H=S(m(L.s)),ee=S(m(L.r)),ge=H.length/2,fe=ee.length/2,oe=m(ge),Ae=m(fe);return`30${m(fe+ge+4)}02${Ae}${ee}02${oe}${H}`}};const h=BigInt(0),d=BigInt(1),p=BigInt(2),w=BigInt(3),T=BigInt(4);function v(L){const S=u(L),{Fp:m}=S,H=S.toBytes||((ne,J,ue)=>{const G=J.toAffine();return o.concatBytes(Uint8Array.from([4]),m.toBytes(G.x),m.toBytes(G.y))}),ee=S.fromBytes||(ne=>{const J=ne.subarray(1),ue=m.fromBytes(J.subarray(0,m.BYTES)),G=m.fromBytes(J.subarray(m.BYTES,2*m.BYTES));return{x:ue,y:G}});function ge(ne){const{a:J,b:ue}=S,G=m.sqr(ne),Y=m.mul(G,ne);return m.add(m.add(Y,m.mul(ne,J)),ue)}if(!m.eql(m.sqr(S.Gy),ge(S.Gx)))throw new Error("bad generator point: equation left != right");function fe(ne){return typeof ne=="bigint"&&h<ne&&ne<S.n}function oe(ne){if(!fe(ne))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function Ae(ne){const{allowedPrivateKeyLengths:J,nByteLength:ue,wrapPrivateKey:G,n:Y}=S;if(J&&typeof ne!="bigint"){if(o.isBytes(ne)&&(ne=o.bytesToHex(ne)),typeof ne!="string"||!J.includes(ne.length))throw new Error("Invalid key");ne=ne.padStart(ue*2,"0")}let ae;try{ae=typeof ne=="bigint"?ne:o.bytesToNumberBE((0,a.ensureBytes)("private key",ne,ue))}catch{throw new Error(`private key must be ${ue} bytes, hex or bigint, not ${typeof ne}`)}return G&&(ae=r.mod(ae,Y)),oe(ae),ae}const be=new Map;function M(ne){if(!(ne instanceof N))throw new Error("ProjectivePoint expected")}class N{constructor(J,ue,G){if(this.px=J,this.py=ue,this.pz=G,J==null||!m.isValid(J))throw new Error("x required");if(ue==null||!m.isValid(ue))throw new Error("y required");if(G==null||!m.isValid(G))throw new Error("z required")}static fromAffine(J){const{x:ue,y:G}=J||{};if(!J||!m.isValid(ue)||!m.isValid(G))throw new Error("invalid affine point");if(J instanceof N)throw new Error("projective point not allowed");const Y=ae=>m.eql(ae,m.ZERO);return Y(ue)&&Y(G)?N.ZERO:new N(ue,G,m.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(J){const ue=m.invertBatch(J.map(G=>G.pz));return J.map((G,Y)=>G.toAffine(ue[Y])).map(N.fromAffine)}static fromHex(J){const ue=N.fromAffine(ee((0,a.ensureBytes)("pointHex",J)));return ue.assertValidity(),ue}static fromPrivateKey(J){return N.BASE.multiply(Ae(J))}_setWindowSize(J){this._WINDOW_SIZE=J,be.delete(this)}assertValidity(){if(this.is0()){if(S.allowInfinityPoint&&!m.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:J,y:ue}=this.toAffine();if(!m.isValid(J)||!m.isValid(ue))throw new Error("bad point: x or y not FE");const G=m.sqr(ue),Y=ge(J);if(!m.eql(G,Y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:J}=this.toAffine();if(m.isOdd)return!m.isOdd(J);throw new Error("Field doesn't support isOdd")}equals(J){M(J);const{px:ue,py:G,pz:Y}=this,{px:ae,py:me,pz:te}=J,ye=m.eql(m.mul(ue,te),m.mul(ae,Y)),we=m.eql(m.mul(G,te),m.mul(me,Y));return ye&&we}negate(){return new N(this.px,m.neg(this.py),this.pz)}double(){const{a:J,b:ue}=S,G=m.mul(ue,w),{px:Y,py:ae,pz:me}=this;let te=m.ZERO,ye=m.ZERO,we=m.ZERO,j=m.mul(Y,Y),F=m.mul(ae,ae),Z=m.mul(me,me),de=m.mul(Y,ae);return de=m.add(de,de),we=m.mul(Y,me),we=m.add(we,we),te=m.mul(J,we),ye=m.mul(G,Z),ye=m.add(te,ye),te=m.sub(F,ye),ye=m.add(F,ye),ye=m.mul(te,ye),te=m.mul(de,te),we=m.mul(G,we),Z=m.mul(J,Z),de=m.sub(j,Z),de=m.mul(J,de),de=m.add(de,we),we=m.add(j,j),j=m.add(we,j),j=m.add(j,Z),j=m.mul(j,de),ye=m.add(ye,j),Z=m.mul(ae,me),Z=m.add(Z,Z),j=m.mul(Z,de),te=m.sub(te,j),we=m.mul(Z,F),we=m.add(we,we),we=m.add(we,we),new N(te,ye,we)}add(J){M(J);const{px:ue,py:G,pz:Y}=this,{px:ae,py:me,pz:te}=J;let ye=m.ZERO,we=m.ZERO,j=m.ZERO;const F=S.a,Z=m.mul(S.b,w);let de=m.mul(ue,ae),Re=m.mul(G,me),R=m.mul(Y,te),I=m.add(ue,G),b=m.add(ae,me);I=m.mul(I,b),b=m.add(de,Re),I=m.sub(I,b),b=m.add(ue,Y);let E=m.add(ae,te);return b=m.mul(b,E),E=m.add(de,R),b=m.sub(b,E),E=m.add(G,Y),ye=m.add(me,te),E=m.mul(E,ye),ye=m.add(Re,R),E=m.sub(E,ye),j=m.mul(F,b),ye=m.mul(Z,R),j=m.add(ye,j),ye=m.sub(Re,j),j=m.add(Re,j),we=m.mul(ye,j),Re=m.add(de,de),Re=m.add(Re,de),R=m.mul(F,R),b=m.mul(Z,b),Re=m.add(Re,R),R=m.sub(de,R),R=m.mul(F,R),b=m.add(b,R),de=m.mul(Re,b),we=m.add(we,de),de=m.mul(E,b),ye=m.mul(I,ye),ye=m.sub(ye,de),de=m.mul(I,Re),j=m.mul(E,j),j=m.add(j,de),new N(ye,we,j)}subtract(J){return this.add(J.negate())}is0(){return this.equals(N.ZERO)}wNAF(J){return K.wNAFCached(this,be,J,ue=>{const G=m.invertBatch(ue.map(Y=>Y.pz));return ue.map((Y,ae)=>Y.toAffine(G[ae])).map(N.fromAffine)})}multiplyUnsafe(J){const ue=N.ZERO;if(J===h)return ue;if(oe(J),J===d)return this;const{endo:G}=S;if(!G)return K.unsafeLadder(this,J);let{k1neg:Y,k1:ae,k2neg:me,k2:te}=G.splitScalar(J),ye=ue,we=ue,j=this;for(;ae>h||te>h;)ae&d&&(ye=ye.add(j)),te&d&&(we=we.add(j)),j=j.double(),ae>>=d,te>>=d;return Y&&(ye=ye.negate()),me&&(we=we.negate()),we=new N(m.mul(we.px,G.beta),we.py,we.pz),ye.add(we)}multiply(J){oe(J);let ue=J,G,Y;const{endo:ae}=S;if(ae){const{k1neg:me,k1:te,k2neg:ye,k2:we}=ae.splitScalar(ue);let{p:j,f:F}=this.wNAF(te),{p:Z,f:de}=this.wNAF(we);j=K.constTimeNegate(me,j),Z=K.constTimeNegate(ye,Z),Z=new N(m.mul(Z.px,ae.beta),Z.py,Z.pz),G=j.add(Z),Y=F.add(de)}else{const{p:me,f:te}=this.wNAF(ue);G=me,Y=te}return N.normalizeZ([G,Y])[0]}multiplyAndAddUnsafe(J,ue,G){const Y=N.BASE,ae=(te,ye)=>ye===h||ye===d||!te.equals(Y)?te.multiplyUnsafe(ye):te.multiply(ye),me=ae(this,ue).add(ae(J,G));return me.is0()?void 0:me}toAffine(J){const{px:ue,py:G,pz:Y}=this,ae=this.is0();J==null&&(J=ae?m.ONE:m.inv(Y));const me=m.mul(ue,J),te=m.mul(G,J),ye=m.mul(Y,J);if(ae)return{x:m.ZERO,y:m.ZERO};if(!m.eql(ye,m.ONE))throw new Error("invZ was invalid");return{x:me,y:te}}isTorsionFree(){const{h:J,isTorsionFree:ue}=S;if(J===d)return!0;if(ue)return ue(N,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:J,clearCofactor:ue}=S;return J===d?this:ue?ue(N,this):this.multiplyUnsafe(S.h)}toRawBytes(J=!0){return this.assertValidity(),H(N,this,J)}toHex(J=!0){return o.bytesToHex(this.toRawBytes(J))}}N.BASE=new N(S.Gx,S.Gy,m.ONE),N.ZERO=new N(m.ZERO,m.ONE,m.ZERO);const D=S.nBitLength,K=(0,t.wNAF)(N,S.endo?Math.ceil(D/2):D);return{CURVE:S,ProjectivePoint:N,normPrivateKeyToScalar:Ae,weierstrassEquation:ge,isWithinCurveOrder:fe}}function k(L){const S=(0,t.validateBasic)(L);return o.validateObject(S,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...S})}function C(L){const S=k(L),{Fp:m,n:H}=S,ee=m.BYTES+1,ge=2*m.BYTES+1;function fe(b){return h<b&&b<m.ORDER}function oe(b){return r.mod(b,H)}function Ae(b){return r.invert(b,H)}const{ProjectivePoint:be,normPrivateKeyToScalar:M,weierstrassEquation:N,isWithinCurveOrder:D}=v({...S,toBytes(b,E,z){const re=E.toAffine(),ie=m.toBytes(re.x),Oe=o.concatBytes;return z?Oe(Uint8Array.from([E.hasEvenY()?2:3]),ie):Oe(Uint8Array.from([4]),ie,m.toBytes(re.y))},fromBytes(b){const E=b.length,z=b[0],re=b.subarray(1);if(E===ee&&(z===2||z===3)){const ie=o.bytesToNumberBE(re);if(!fe(ie))throw new Error("Point is not on curve");const Oe=N(ie);let Le;try{Le=m.sqrt(Oe)}catch(Ee){const qe=Ee instanceof Error?": "+Ee.message:"";throw new Error("Point is not on curve"+qe)}const Ce=(Le&d)===d;return(z&1)===1!==Ce&&(Le=m.neg(Le)),{x:ie,y:Le}}else if(E===ge&&z===4){const ie=m.fromBytes(re.subarray(0,m.BYTES)),Oe=m.fromBytes(re.subarray(m.BYTES,2*m.BYTES));return{x:ie,y:Oe}}else throw new Error(`Point of length ${E} was invalid. Expected ${ee} compressed bytes or ${ge} uncompressed bytes`)}}),K=b=>o.bytesToHex(o.numberToBytesBE(b,S.nByteLength));function ne(b){const E=H>>d;return b>E}function J(b){return ne(b)?oe(-b):b}const ue=(b,E,z)=>o.bytesToNumberBE(b.slice(E,z));class G{constructor(E,z,re){this.r=E,this.s=z,this.recovery=re,this.assertValidity()}static fromCompact(E){const z=S.nByteLength;return E=(0,a.ensureBytes)("compactSignature",E,z*2),new G(ue(E,0,z),ue(E,z,2*z))}static fromDER(E){const{r:z,s:re}=e.DER.toSig((0,a.ensureBytes)("DER",E));return new G(z,re)}assertValidity(){if(!D(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!D(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new G(this.r,this.s,E)}recoverPublicKey(E){const{r:z,s:re,recovery:ie}=this,Oe=we((0,a.ensureBytes)("msgHash",E));if(ie==null||![0,1,2,3].includes(ie))throw new Error("recovery id invalid");const Le=ie===2||ie===3?z+S.n:z;if(Le>=m.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ce=ie&1?"03":"02",ke=be.fromHex(Ce+K(Le)),Ee=Ae(Le),qe=oe(-Oe*Ee),Rt=oe(re*Ee),ct=be.BASE.multiplyAndAddUnsafe(ke,qe,Rt);if(!ct)throw new Error("point at infinify");return ct.assertValidity(),ct}hasHighS(){return ne(this.s)}normalizeS(){return this.hasHighS()?new G(this.r,oe(-this.s),this.recovery):this}toDERRawBytes(){return o.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return o.hexToBytes(this.toCompactHex())}toCompactHex(){return K(this.r)+K(this.s)}}const Y={isValidPrivateKey(b){try{return M(b),!0}catch{return!1}},normPrivateKeyToScalar:M,randomPrivateKey:()=>{const b=r.getMinHashLength(S.n);return r.mapHashToField(S.randomBytes(b),S.n)},precompute(b=8,E=be.BASE){return E._setWindowSize(b),E.multiply(BigInt(3)),E}};function ae(b,E=!0){return be.fromPrivateKey(b).toRawBytes(E)}function me(b){const E=o.isBytes(b),z=typeof b=="string",re=(E||z)&&b.length;return E?re===ee||re===ge:z?re===2*ee||re===2*ge:b instanceof be}function te(b,E,z=!0){if(me(b))throw new Error("first arg must be private key");if(!me(E))throw new Error("second arg must be public key");return be.fromHex(E).multiply(M(b)).toRawBytes(z)}const ye=S.bits2int||function(b){const E=o.bytesToNumberBE(b),z=b.length*8-S.nBitLength;return z>0?E>>BigInt(z):E},we=S.bits2int_modN||function(b){return oe(ye(b))},j=o.bitMask(S.nBitLength);function F(b){if(typeof b!="bigint")throw new Error("bigint expected");if(!(h<=b&&b<j))throw new Error(`bigint expected < 2^${S.nBitLength}`);return o.numberToBytesBE(b,S.nByteLength)}function Z(b,E,z=de){if(["recovered","canonical"].some(it=>it in z))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:ie}=S;let{lowS:Oe,prehash:Le,extraEntropy:Ce}=z;Oe==null&&(Oe=!0),b=(0,a.ensureBytes)("msgHash",b),Le&&(b=(0,a.ensureBytes)("prehashed msgHash",re(b)));const ke=we(b),Ee=M(E),qe=[F(Ee),F(ke)];if(Ce!=null&&Ce!==!1){const it=Ce===!0?ie(m.BYTES):Ce;qe.push((0,a.ensureBytes)("extraEntropy",it))}const Rt=o.concatBytes(...qe),ct=ke;function Dt(it){const Ze=ye(it);if(!D(Ze))return;const jt=Ae(Ze),Pt=be.BASE.multiply(Ze).toAffine(),st=oe(Pt.x);if(st===h)return;const Lt=oe(jt*oe(ct+st*Ee));if(Lt===h)return;let dn=(Pt.x===st?0:2)|Number(Pt.y&d),nn=Lt;return Oe&&ne(Lt)&&(nn=J(Lt),dn^=1),new G(st,nn,dn)}return{seed:Rt,k2sig:Dt}}const de={lowS:S.lowS,prehash:!1},Re={lowS:S.lowS,prehash:!1};function R(b,E,z=de){const{seed:re,k2sig:ie}=Z(b,E,z),Oe=S;return o.createHmacDrbg(Oe.hash.outputLen,Oe.nByteLength,Oe.hmac)(re,ie)}be.BASE._setWindowSize(8);function I(b,E,z,re=Re){var Pt;const ie=b;if(E=(0,a.ensureBytes)("msgHash",E),z=(0,a.ensureBytes)("publicKey",z),"strict"in re)throw new Error("options.strict was renamed to lowS");const{lowS:Oe,prehash:Le}=re;let Ce,ke;try{if(typeof ie=="string"||o.isBytes(ie))try{Ce=G.fromDER(ie)}catch(st){if(!(st instanceof e.DER.Err))throw st;Ce=G.fromCompact(ie)}else if(typeof ie=="object"&&typeof ie.r=="bigint"&&typeof ie.s=="bigint"){const{r:st,s:Lt}=ie;Ce=new G(st,Lt)}else throw new Error("PARSE");ke=be.fromHex(z)}catch(st){if(st.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Oe&&Ce.hasHighS())return!1;Le&&(E=S.hash(E));const{r:Ee,s:qe}=Ce,Rt=we(E),ct=Ae(qe),Dt=oe(Rt*ct),it=oe(Ee*ct),Ze=(Pt=be.BASE.multiplyAndAddUnsafe(ke,Dt,it))==null?void 0:Pt.toAffine();return Ze?oe(Ze.x)===Ee:!1}return{CURVE:S,getPublicKey:ae,getSharedSecret:te,sign:R,verify:I,ProjectivePoint:be,Signature:G,utils:Y}}function P(L,S){const m=L.ORDER;let H=h;for(let ne=m-d;ne%p===h;ne/=p)H+=d;const ee=H,ge=p<<ee-d-d,fe=ge*p,oe=(m-d)/fe,Ae=(oe-d)/p,be=fe-d,M=ge,N=L.pow(S,oe),D=L.pow(S,(oe+d)/p);let K=(ne,J)=>{let ue=N,G=L.pow(J,be),Y=L.sqr(G);Y=L.mul(Y,J);let ae=L.mul(ne,Y);ae=L.pow(ae,Ae),ae=L.mul(ae,G),G=L.mul(ae,J),Y=L.mul(ae,ne);let me=L.mul(Y,G);ae=L.pow(me,M);let te=L.eql(ae,L.ONE);G=L.mul(Y,D),ae=L.mul(me,ue),Y=L.cmov(G,Y,te),me=L.cmov(ae,me,te);for(let ye=ee;ye>d;ye--){let we=ye-p;we=p<<we-d;let j=L.pow(me,we);const F=L.eql(j,L.ONE);G=L.mul(Y,ue),ue=L.mul(ue,ue),j=L.mul(me,ue),Y=L.cmov(G,Y,F),me=L.cmov(j,me,F)}return{isValid:te,value:Y}};if(L.ORDER%T===w){const ne=(L.ORDER-w)/T,J=L.sqrt(L.neg(S));K=(ue,G)=>{let Y=L.sqr(G);const ae=L.mul(ue,G);Y=L.mul(Y,ae);let me=L.pow(Y,ne);me=L.mul(me,ae);const te=L.mul(me,J),ye=L.mul(L.sqr(me),G),we=L.eql(ye,ue);let j=L.cmov(te,me,we);return{isValid:we,value:j}}}return K}function $(L,S){if(r.validateField(L),!L.isValid(S.A)||!L.isValid(S.B)||!L.isValid(S.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const m=P(L,S.Z);if(!L.isOdd)throw new Error("Fp.isOdd is not implemented!");return H=>{let ee,ge,fe,oe,Ae,be,M,N;ee=L.sqr(H),ee=L.mul(ee,S.Z),ge=L.sqr(ee),ge=L.add(ge,ee),fe=L.add(ge,L.ONE),fe=L.mul(fe,S.B),oe=L.cmov(S.Z,L.neg(ge),!L.eql(ge,L.ZERO)),oe=L.mul(oe,S.A),ge=L.sqr(fe),be=L.sqr(oe),Ae=L.mul(be,S.A),ge=L.add(ge,Ae),ge=L.mul(ge,fe),be=L.mul(be,oe),Ae=L.mul(be,S.B),ge=L.add(ge,Ae),M=L.mul(ee,fe);const{isValid:D,value:K}=m(ge,be);N=L.mul(ee,H),N=L.mul(N,K),M=L.cmov(M,fe,D),N=L.cmov(N,K,D);const ne=L.isOdd(H)===L.isOdd(N);return N=L.cmov(L.neg(N),N,ne),M=L.div(M,oe),{x:M,y:N}}}})(fd);Object.defineProperty(Wu,"__esModule",{value:!0});Wu.getHash=dy;Wu.createCurve=aC;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oC=ty,xp=Qr,sC=fd;function dy(e){return{hash:e,hmac:(t,...r)=>(0,oC.hmac)(e,t,(0,xp.concatBytes)(...r)),randomBytes:xp.randomBytes}}function aC(e,t){const r=o=>(0,sC.weierstrass)({...e,...dy(o)});return Object.freeze({...r(t),create:r})}var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.expand_message_xmd=hy;oo.expand_message_xof=gy;oo.hash_to_field=Rl;oo.isogenyMap=lC;oo.createHasher=dC;const uC=pt,Qt=rt,fC=Qt.bytesToNumberBE;function mi(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let o=t-1;o>=0;o--)r[o]=e&255,e>>>=8;return new Uint8Array(r)}function cC(e,t){const r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e[o]^t[o];return r}function gd(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function hy(e,t,r,o){(0,Qt.abytes)(e),(0,Qt.abytes)(t),gd(r),t.length>255&&(t=o((0,Qt.concatBytes)((0,Qt.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:a,blockLen:u}=o,f=Math.ceil(r/a);if(f>255)throw new Error("Invalid xmd length");const l=(0,Qt.concatBytes)(t,mi(t.length,1)),h=mi(0,u),d=mi(r,2),p=new Array(f),w=o((0,Qt.concatBytes)(h,e,d,mi(0,1),l));p[0]=o((0,Qt.concatBytes)(w,mi(1,1),l));for(let v=1;v<=f;v++){const k=[cC(w,p[v-1]),mi(v+1,1),l];p[v]=o((0,Qt.concatBytes)(...k))}return(0,Qt.concatBytes)(...p).slice(0,r)}function gy(e,t,r,o,a){if((0,Qt.abytes)(e),(0,Qt.abytes)(t),gd(r),t.length>255){const u=Math.ceil(2*o/8);t=a.create({dkLen:u}).update((0,Qt.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return a.create({dkLen:r}).update(e).update(mi(r,2)).update(t).update(mi(t.length,1)).digest()}function Rl(e,t,r){(0,Qt.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:o,k:a,m:u,hash:f,expand:l,DST:h}=r;(0,Qt.abytes)(e),gd(t);const d=typeof h=="string"?(0,Qt.utf8ToBytes)(h):h,p=o.toString(2).length,w=Math.ceil((p+a)/8),T=t*u*w;let v;if(l==="xmd")v=hy(e,d,T,f);else if(l==="xof")v=gy(e,d,T,a,f);else if(l==="_internal_pass")v=e;else throw new Error('expand must be "xmd" or "xof"');const k=new Array(t);for(let C=0;C<t;C++){const P=new Array(u);for(let $=0;$<u;$++){const L=w*($+C*u),S=v.subarray(L,L+w);P[$]=(0,uC.mod)(fC(S),o)}k[C]=P}return k}function lC(e,t){const r=t.map(o=>Array.from(o).reverse());return(o,a)=>{const[u,f,l,h]=r.map(d=>d.reduce((p,w)=>e.add(e.mul(p,o),w)));return o=e.div(u,f),a=e.mul(a,e.div(l,h)),{x:o,y:a}}}function dC(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(o,a){const u=Rl(o,2,{...r,DST:r.DST,...a}),f=e.fromAffine(t(u[0])),l=e.fromAffine(t(u[1])),h=f.add(l).clearCofactor();return h.assertValidity(),h},encodeToCurve(o,a){const u=Rl(o,1,{...r,DST:r.encodeDST,...a}),f=e.fromAffine(t(u[0])).clearCofactor();return f.assertValidity(),f},mapToCurve(o){if(!Array.isArray(o))throw new Error("mapToCurve: expected array of bigints");for(const u of o)if(typeof u!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${u} in array`);const a=e.fromAffine(t(o)).clearCofactor();return a.assertValidity(),a}}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=jo,r=Qr,o=Wu,a=oo,u=pt,f=rt,l=fd,h=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),p=BigInt(1),w=BigInt(2),T=(G,Y)=>(G+Y/w)/Y;function v(G){const Y=h,ae=BigInt(3),me=BigInt(6),te=BigInt(11),ye=BigInt(22),we=BigInt(23),j=BigInt(44),F=BigInt(88),Z=G*G*G%Y,de=Z*Z*G%Y,Re=(0,u.pow2)(de,ae,Y)*de%Y,R=(0,u.pow2)(Re,ae,Y)*de%Y,I=(0,u.pow2)(R,w,Y)*Z%Y,b=(0,u.pow2)(I,te,Y)*I%Y,E=(0,u.pow2)(b,ye,Y)*b%Y,z=(0,u.pow2)(E,j,Y)*E%Y,re=(0,u.pow2)(z,F,Y)*z%Y,ie=(0,u.pow2)(re,j,Y)*E%Y,Oe=(0,u.pow2)(ie,ae,Y)*de%Y,Le=(0,u.pow2)(Oe,we,Y)*b%Y,Ce=(0,u.pow2)(Le,me,Y)*Z%Y,ke=(0,u.pow2)(Ce,w,Y);if(!k.eql(k.sqr(ke),G))throw new Error("Cannot find square root");return ke}const k=(0,u.Field)(h,void 0,void 0,{sqrt:v});e.secp256k1=(0,o.createCurve)({a:BigInt(0),b:BigInt(7),Fp:k,n:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:G=>{const Y=d,ae=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),me=-p*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),te=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ye=ae,we=BigInt("0x100000000000000000000000000000000"),j=T(ye*G,Y),F=T(-me*G,Y);let Z=(0,u.mod)(G-j*ae-F*te,Y),de=(0,u.mod)(-j*me-F*ye,Y);const Re=Z>we,R=de>we;if(Re&&(Z=Y-Z),R&&(de=Y-de),Z>we||de>we)throw new Error("splitScalar: Endomorphism failed, k="+G);return{k1neg:Re,k1:Z,k2neg:R,k2:de}}}},t.sha256);const C=BigInt(0),P=G=>typeof G=="bigint"&&C<G&&G<h,$=G=>typeof G=="bigint"&&C<G&&G<d,L={};function S(G,...Y){let ae=L[G];if(ae===void 0){const me=(0,t.sha256)(Uint8Array.from(G,te=>te.charCodeAt(0)));ae=(0,f.concatBytes)(me,me),L[G]=ae}return(0,t.sha256)((0,f.concatBytes)(ae,...Y))}const m=G=>G.toRawBytes(!0).slice(1),H=G=>(0,f.numberToBytesBE)(G,32),ee=G=>(0,u.mod)(G,h),ge=G=>(0,u.mod)(G,d),fe=e.secp256k1.ProjectivePoint,oe=(G,Y,ae)=>fe.BASE.multiplyAndAddUnsafe(G,Y,ae);function Ae(G){let Y=e.secp256k1.utils.normPrivateKeyToScalar(G),ae=fe.fromPrivateKey(Y);return{scalar:ae.hasEvenY()?Y:ge(-Y),bytes:m(ae)}}function be(G){if(!P(G))throw new Error("bad x: need 0 < x < p");const Y=ee(G*G),ae=ee(Y*G+BigInt(7));let me=v(ae);me%w!==C&&(me=ee(-me));const te=new fe(G,me,p);return te.assertValidity(),te}function M(...G){return ge((0,f.bytesToNumberBE)(S("BIP0340/challenge",...G)))}function N(G){return Ae(G).bytes}function D(G,Y,ae=(0,r.randomBytes)(32)){const me=(0,f.ensureBytes)("message",G),{bytes:te,scalar:ye}=Ae(Y),we=(0,f.ensureBytes)("auxRand",ae,32),j=H(ye^(0,f.bytesToNumberBE)(S("BIP0340/aux",we))),F=S("BIP0340/nonce",j,te,me),Z=ge((0,f.bytesToNumberBE)(F));if(Z===C)throw new Error("sign failed: k is zero");const{bytes:de,scalar:Re}=Ae(Z),R=M(de,te,me),I=new Uint8Array(64);if(I.set(de,0),I.set(H(ge(Re+R*ye)),32),!K(I,me,te))throw new Error("sign: Invalid signature produced");return I}function K(G,Y,ae){const me=(0,f.ensureBytes)("signature",G,64),te=(0,f.ensureBytes)("message",Y),ye=(0,f.ensureBytes)("publicKey",ae,32);try{const we=be((0,f.bytesToNumberBE)(ye)),j=(0,f.bytesToNumberBE)(me.subarray(0,32));if(!P(j))return!1;const F=(0,f.bytesToNumberBE)(me.subarray(32,64));if(!$(F))return!1;const Z=M(H(j),m(we),te),de=oe(we,F,ge(-Z));return!(!de||!de.hasEvenY()||de.toAffine().x!==j)}catch{return!1}}e.schnorr={getPublicKey:N,sign:D,verify:K,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:be,pointToBytes:m,numberToBytesBE:f.numberToBytesBE,bytesToNumberBE:f.bytesToNumberBE,taggedHash:S,mod:u.mod}};const ne=(0,a.isogenyMap)(k,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(G=>G.map(Y=>BigInt(Y)))),J=(0,l.mapToCurveSimpleSWU)(k,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:k.create(BigInt("-11"))}),ue=(0,a.createHasher)(e.secp256k1.ProjectivePoint,G=>{const{x:Y,y:ae}=J(k.create(G[0]));return ne(Y,ae)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:k.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=ue.hashToCurve,e.encodeToCurve=ue.encodeToCurve})(Kb);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=Kb;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(ku);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=or,r=ku;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16})(Uu);var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});Ku.GWEI_TO_WEI=void 0;Ku.GWEI_TO_WEI=BigInt(1e9);var pd={},Ar={};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.RLP=Ar.utils=Ar.decode=Ar.encode=void 0;function bd(e){if(Array.isArray(e)){const r=[];let o=0;for(let a=0;a<e.length;a++){const u=bd(e[a]);r.push(u),o+=u.length}return Tl(Mp(o,192),...r)}const t=my(e);return t.length===1&&t[0]<128?t:Tl(Mp(t.length,128),t)}Ar.encode=bd;function To(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function Np(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return yy(by(e))}function Mp(e,t){if(e<56)return Uint8Array.from([e+t]);const r=Il(e),o=r.length/2,a=Il(t+55+o);return Uint8Array.from(pu(a+r))}function py(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const r=my(e),o=Al(r);if(t)return o;if(o.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return o.data}Ar.decode=py;function Al(e){let t,r,o,a,u;const f=[],l=e[0];if(l<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(l<=183){if(t=l-127,l===128?o=Uint8Array.from([]):o=To(e,1,t),t===2&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}else if(l<=191){if(r=l-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=Np(To(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=To(e,r,t+r),{data:o,remainder:e.slice(t+r)}}else if(l<=247){for(t=l-191,a=To(e,1,t);a.length;)u=Al(a),f.push(u.data),a=u.remainder;return{data:f,remainder:e.slice(t)}}else{if(r=l-246,t=Np(To(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const h=r+t;if(h>e.length)throw new Error("invalid RLP: total length is larger than the data");for(a=To(e,r,h);a.length;)u=Al(a),f.push(u.data),a=u.remainder;return{data:f,remainder:e.slice(h)}}}const hC=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function by(e){let t="";for(let r=0;r<e.length;r++)t+=hC[e[r]];return t}function yy(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function pu(e){if(typeof e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const o=r*2;t[r]=yy(e.slice(o,o+2))}return t}function Tl(...e){if(e.length===1)return e[0];const t=e.reduce((o,a)=>o+a.length,0),r=new Uint8Array(t);for(let o=0,a=0;o<e.length;o++){const u=e[o];r.set(u,a),a+=u.length}return r}function _y(e){return new TextEncoder().encode(e)}function Il(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function gC(e){return e.length%2?`0${e}`:e}function wy(e){return e.length>=2&&e[0]==="0"&&e[1]==="x"}function pC(e){return typeof e!="string"?e:wy(e)?e.slice(2):e}function my(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return wy(e)?pu(gC(pC(e))):_y(e);if(typeof e=="number"||typeof e=="bigint")return e?pu(Il(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}Ar.utils={bytesToHex:by,concatBytes:Tl,hexToBytes:pu,utf8ToBytes:_y};Ar.RLP={encode:bd,decode:py};var rr={},dt={},De={};Object.defineProperty(De,"__esModule",{value:!0});De.add5L=De.add5H=De.add4H=De.add4L=De.add3H=De.add3L=De.add=De.rotlBL=De.rotlBH=De.rotlSL=De.rotlSH=De.rotr32L=De.rotr32H=De.rotrBL=De.rotrBH=De.rotrSL=De.rotrSH=De.shrSL=De.shrSH=De.toBig=De.split=De.fromBig=void 0;const Qa=BigInt(2**32-1),Ol=BigInt(32);function yd(e,t=!1){return t?{h:Number(e&Qa),l:Number(e>>Ol&Qa)}:{h:Number(e>>Ol&Qa)|0,l:Number(e&Qa)|0}}De.fromBig=yd;function vy(e,t=!1){let r=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:u,l:f}=yd(e[a],t);[r[a],o[a]]=[u,f]}return[r,o]}De.split=vy;const Ey=(e,t)=>BigInt(e>>>0)<<Ol|BigInt(t>>>0);De.toBig=Ey;const Sy=(e,t,r)=>e>>>r;De.shrSH=Sy;const Ry=(e,t,r)=>e<<32-r|t>>>r;De.shrSL=Ry;const Ay=(e,t,r)=>e>>>r|t<<32-r;De.rotrSH=Ay;const Ty=(e,t,r)=>e<<32-r|t>>>r;De.rotrSL=Ty;const Iy=(e,t,r)=>e<<64-r|t>>>r-32;De.rotrBH=Iy;const Oy=(e,t,r)=>e>>>r-32|t<<64-r;De.rotrBL=Oy;const Cy=(e,t)=>t;De.rotr32H=Cy;const Py=(e,t)=>e;De.rotr32L=Py;const By=(e,t,r)=>e<<r|t>>>32-r;De.rotlSH=By;const Ly=(e,t,r)=>t<<r|e>>>32-r;De.rotlSL=Ly;const xy=(e,t,r)=>t<<r-32|e>>>64-r;De.rotlBH=xy;const Ny=(e,t,r)=>e<<r-32|t>>>64-r;De.rotlBL=Ny;function My(e,t,r,o){const a=(t>>>0)+(o>>>0);return{h:e+r+(a/2**32|0)|0,l:a|0}}De.add=My;const $y=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);De.add3L=$y;const Dy=(e,t,r,o)=>t+r+o+(e/2**32|0)|0;De.add3H=Dy;const jy=(e,t,r,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0);De.add4L=jy;const Uy=(e,t,r,o,a)=>t+r+o+a+(e/2**32|0)|0;De.add4H=Uy;const ky=(e,t,r,o,a)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0)+(a>>>0);De.add5L=ky;const Hy=(e,t,r,o,a,u)=>t+r+o+a+u+(e/2**32|0)|0;De.add5H=Hy;const bC={fromBig:yd,split:vy,toBig:Ey,shrSH:Sy,shrSL:Ry,rotrSH:Ay,rotrSL:Ty,rotrBH:Iy,rotrBL:Oy,rotr32H:Cy,rotr32L:Py,rotlSH:By,rotlSL:Ly,rotlBH:xy,rotlBL:Ny,add:My,add3L:$y,add3H:Dy,add4L:jy,add4H:Uy,add5H:Hy,add5L:ky};De.default=bC;Object.defineProperty(dt,"__esModule",{value:!0});dt.shake256=dt.shake128=dt.keccak_512=dt.keccak_384=dt.keccak_256=dt.keccak_224=dt.sha3_512=dt.sha3_384=dt.sha3_256=dt.sha3_224=dt.Keccak=dt.keccakP=void 0;const Io=It,Ns=De,Gr=Qr,Wy=[],Fy=[],qy=[],yC=BigInt(0),ms=BigInt(1),_C=BigInt(2),wC=BigInt(7),mC=BigInt(256),vC=BigInt(113);for(let e=0,t=ms,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],Wy.push(2*(5*o+r)),Fy.push((e+1)*(e+2)/2%64);let a=yC;for(let u=0;u<7;u++)t=(t<<ms^(t>>wC)*vC)%mC,t&_C&&(a^=ms<<(ms<<BigInt(u))-ms);qy.push(a)}const[EC,SC]=(0,Ns.split)(qy,!0),$p=(e,t,r)=>r>32?(0,Ns.rotlBH)(e,t,r):(0,Ns.rotlSH)(e,t,r),Dp=(e,t,r)=>r>32?(0,Ns.rotlBL)(e,t,r):(0,Ns.rotlSL)(e,t,r);function Vy(e,t=24){const r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let f=0;f<10;f++)r[f]=e[f]^e[f+10]^e[f+20]^e[f+30]^e[f+40];for(let f=0;f<10;f+=2){const l=(f+8)%10,h=(f+2)%10,d=r[h],p=r[h+1],w=$p(d,p,1)^r[l],T=Dp(d,p,1)^r[l+1];for(let v=0;v<50;v+=10)e[f+v]^=w,e[f+v+1]^=T}let a=e[2],u=e[3];for(let f=0;f<24;f++){const l=Fy[f],h=$p(a,u,l),d=Dp(a,u,l),p=Wy[f];a=e[p],u=e[p+1],e[p]=h,e[p+1]=d}for(let f=0;f<50;f+=10){for(let l=0;l<10;l++)r[l]=e[f+l];for(let l=0;l<10;l++)e[f+l]^=~r[(l+2)%10]&r[(l+4)%10]}e[0]^=EC[o],e[1]^=SC[o]}r.fill(0)}dt.keccakP=Vy;let _d=class zy extends Gr.Hash{constructor(t,r,o,a=!1,u=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=o,this.enableXOF=a,this.rounds=u,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Io.number)(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Gr.u32)(this.state)}keccak(){Gr.isLE||(0,Gr.byteSwap32)(this.state32),Vy(this.state32,this.rounds),Gr.isLE||(0,Gr.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Io.exists)(this);const{blockLen:r,state:o}=this;t=(0,Gr.toBytes)(t);const a=t.length;for(let u=0;u<a;){const f=Math.min(r-this.pos,a-u);for(let l=0;l<f;l++)o[this.pos++]^=t[u++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:o,blockLen:a}=this;t[o]^=r,r&128&&o===a-1&&this.keccak(),t[a-1]^=128,this.keccak()}writeInto(t){(0,Io.exists)(this,!1),(0,Io.bytes)(t),this.finish();const r=this.state,{blockLen:o}=this;for(let a=0,u=t.length;a<u;){this.posOut>=o&&this.keccak();const f=Math.min(o-this.posOut,u-a);t.set(r.subarray(this.posOut,this.posOut+f),a),this.posOut+=f,a+=f}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Io.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Io.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:o,outputLen:a,rounds:u,enableXOF:f}=this;return t||(t=new zy(r,o,a,f,u)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=u,t.suffix=o,t.outputLen=a,t.enableXOF=f,t.destroyed=this.destroyed,t}};dt.Keccak=_d;const Ci=(e,t,r)=>(0,Gr.wrapConstructor)(()=>new _d(t,e,r));dt.sha3_224=Ci(6,144,224/8);dt.sha3_256=Ci(6,136,256/8);dt.sha3_384=Ci(6,104,384/8);dt.sha3_512=Ci(6,72,512/8);dt.keccak_224=Ci(1,144,224/8);dt.keccak_256=Ci(1,136,256/8);dt.keccak_384=Ci(1,104,384/8);dt.keccak_512=Ci(1,72,512/8);const Gy=(e,t,r)=>(0,Gr.wrapXOFConstructorWithOpts)((o={})=>new _d(t,e,o.dkLen===void 0?r:o.dkLen,!0));dt.shake128=Gy(31,168,128/8);dt.shake256=Gy(31,136,256/8);var bu={exports:{}};bu.exports;(function(e,t){var r=Ke&&Ke.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0,t.bytesToUtf8=h,t.hexToBytes=d,t.equalsBytes=p,t.wrapHash=w;const o=r(It),a=Qr,u=o.default.bool;t.assertBool=u;const f=o.default.bytes;t.assertBytes=f;var l=Qr;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return l.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return l.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return l.utf8ToBytes}});function h(T){if(!(T instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof T}`);return new TextDecoder().decode(T)}function d(T){const v=T.startsWith("0x")?T.substring(2):T;return(0,a.hexToBytes)(v)}function p(T,v){if(T.length!==v.length)return!1;for(let k=0;k<T.length;k++)if(T[k]!==v[k])return!1;return!0}function w(T){return v=>(o.default.bytes(v),T(v))}t.crypto=(()=>{const T=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,v=typeof Cg=="function"&&Cg.bind(e);return{node:v&&!T?v("crypto"):void 0,web:T}})()})(bu,bu.exports);var Ky=bu.exports;Object.defineProperty(rr,"__esModule",{value:!0});rr.keccak512=rr.keccak384=rr.keccak256=rr.keccak224=void 0;const Ms=dt,Ju=Ky;rr.keccak224=(0,Ju.wrapHash)(Ms.keccak_224);rr.keccak256=(()=>{const e=(0,Ju.wrapHash)(Ms.keccak_256);return e.create=Ms.keccak_256.create,e})();rr.keccak384=(0,Ju.wrapHash)(Ms.keccak_384);rr.keccak512=(0,Ju.wrapHash)(Ms.keccak_512);var so={},qn={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.isHexString=ht.getKeys=ht.fromAscii=ht.fromUtf8=ht.toAscii=ht.arrayContainsArray=ht.getBinarySize=ht.padToEven=ht.stripHexPrefix=ht.isHexPrefixed=void 0;function Jy(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}ht.isHexPrefixed=Jy;const RC=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Jy(e)?e.slice(2):e};ht.stripHexPrefix=RC;function Yy(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}ht.padToEven=Yy;function AC(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return Buffer.byteLength(e,"utf8")}ht.getBinarySize=AC;function TC(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](o=>e.indexOf(o)>=0)}ht.arrayContainsArray=TC;function IC(e){let t="",r=0;const o=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<o;r+=2){const a=parseInt(e.substr(r,2),16);t+=String.fromCharCode(a)}return t}ht.toAscii=IC;function OC(e){const t=Buffer.from(e,"utf8");return`0x${Yy(t.toString("hex")).replace(/^0+|0+$/g,"")}`}ht.fromUtf8=OC;function CC(e){let t="";for(let r=0;r<e.length;r++){const a=e.charCodeAt(r).toString(16);t+=a.length<2?`0${a}`:a}return`0x${t}`}ht.fromAscii=CC;function PC(e,t,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const o=[];for(let a=0;a<e.length;a++){let u=e[a][t];if(r===!0&&!u)u="";else if(typeof u!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof u}`);o.push(u)}return o}ht.getKeys=PC;function BC(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}ht.isHexString=BC;Object.defineProperty(qn,"__esModule",{value:!0});qn.assertIsString=qn.assertIsArray=qn.assertIsBuffer=qn.assertIsHexString=void 0;const LC=ht,xC=function(e){if(!(0,LC.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};qn.assertIsHexString=xC;const NC=function(e){if(!Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};qn.assertIsBuffer=NC;const MC=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};qn.assertIsArray=MC;const $C=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};qn.assertIsString=$C;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=qn,r=ht,o=function(D){if(!Number.isSafeInteger(D)||D<0)throw new Error(`Received an invalid integer type: ${D}`);return`0x${D.toString(16)}`};e.intToHex=o;const a=function(D){const K=(0,e.intToHex)(D);return Buffer.from((0,r.padToEven)(K.slice(2)),"hex")};e.intToBuffer=a;const u=function(D){return Buffer.allocUnsafe(D).fill(0)};e.zeros=u;const f=function(D,K,ne){const J=(0,e.zeros)(K);return ne?D.length<K?(D.copy(J),J):D.slice(0,K):D.length<K?(D.copy(J,K-D.length),J):D.slice(-K)},l=function(D,K){return(0,t.assertIsBuffer)(D),f(D,K,!1)};e.setLengthLeft=l;const h=function(D,K){return(0,t.assertIsBuffer)(D),f(D,K,!0)};e.setLengthRight=h;const d=function(D){let K=D[0];for(;D.length>0&&K.toString()==="0";)D=D.slice(1),K=D[0];return D},p=function(D){return(0,t.assertIsBuffer)(D),d(D)};e.unpadBuffer=p;const w=function(D){return(0,t.assertIsArray)(D),d(D)};e.unpadArray=w;const T=function(D){return(0,t.assertIsHexString)(D),D=(0,r.stripHexPrefix)(D),"0x"+d(D)};e.unpadHexString=T;const v=function(D){if(D==null)return Buffer.allocUnsafe(0);if(Buffer.isBuffer(D)||Array.isArray(D)||D instanceof Uint8Array)return Buffer.from(D);if(typeof D=="string"){if(!(0,r.isHexString)(D))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${D}`);return Buffer.from((0,r.padToEven)((0,r.stripHexPrefix)(D)),"hex")}if(typeof D=="number")return(0,e.intToBuffer)(D);if(typeof D=="bigint"){if(D<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${D}`);let K=D.toString(16);return K.length%2&&(K="0"+K),Buffer.from(K,"hex")}if(D.toArray)return Buffer.from(D.toArray());if(D.toBuffer)return Buffer.from(D.toBuffer());throw new Error("invalid type")};e.toBuffer=v;const k=function(D){return D=(0,e.toBuffer)(D),"0x"+D.toString("hex")};e.bufferToHex=k;function C(D){const K=(0,e.bufferToHex)(D);return BigInt(K==="0x"?0:K)}e.bufferToBigInt=C;function P(D){return(0,e.toBuffer)("0x"+D.toString(16))}e.bigIntToBuffer=P;const $=function(D){const K=Number(C(D));if(!Number.isSafeInteger(K))throw new Error("Number exceeds 53 bits");return K};e.bufferToInt=$;const L=function(D){return BigInt.asIntN(256,C(D))};e.fromSigned=L;const S=function(D){return P(BigInt.asUintN(256,D))};e.toUnsigned=S;const m=function(D){return typeof D!="string"||(0,r.isHexPrefixed)(D)?D:"0x"+D};e.addHexPrefix=m;function H(D,K=50){const ne=Buffer.isBuffer(D)?D.toString("hex"):D;return ne.length<=K?ne:ne.slice(0,K)+"…"}e.short=H;const ee=function(D){const K=/^(00)+|(00)+$/g;if(D=(0,r.stripHexPrefix)(D),D.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return Buffer.from(D.replace(K,""),"hex").toString("utf8")};e.toUtf8=ee;const ge=function(D){if(Buffer.isBuffer(D))return`0x${D.toString("hex")}`;if(D instanceof Array){const K=[];for(let ne=0;ne<D.length;ne++)K.push((0,e.baToJSON)(D[ne]));return K}};e.baToJSON=ge;const fe=function(D){for(const[K,ne]of Object.entries(D))if(ne!==void 0&&ne.length>0&&ne[0]===0)throw new Error(`${K} cannot have leading zeroes, received: ${ne.toString("hex")}`)};e.validateNoLeadingZeroes=fe;function oe(D){return Array.isArray(D)?D.map(K=>oe(K)):Buffer.from(D)}e.arrToBufArr=oe;function Ae(D){return Array.isArray(D)?D.map(K=>Ae(K)):Uint8Array.from(D??[])}e.bufArrToArr=Ae;const be=D=>"0x"+D.toString(16);e.bigIntToHex=be;function M(D){return(0,e.unpadBuffer)(P(D))}e.bigIntToUnpaddedBuffer=M;function N(D){return(0,e.unpadBuffer)((0,e.intToBuffer)(D))}e.intToUnpaddedBuffer=N})(so);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=Ar,r=rr,o=ku,a=Ky,u=so,f=Uu,l=qn,h=ht,d=BigInt(0);class p{constructor(N=d,D=d,K=f.KECCAK256_RLP,ne=f.KECCAK256_NULL){this.nonce=N,this.balance=D,this.storageRoot=K,this.codeHash=ne,this._validate()}static fromAccountData(N){const{nonce:D,balance:K,storageRoot:ne,codeHash:J}=N;return new p(D!==void 0?(0,u.bufferToBigInt)((0,u.toBuffer)(D)):void 0,K!==void 0?(0,u.bufferToBigInt)((0,u.toBuffer)(K)):void 0,ne!==void 0?(0,u.toBuffer)(ne):void 0,J!==void 0?(0,u.toBuffer)(J):void 0)}static fromRlpSerializedAccount(N){const D=(0,u.arrToBufArr)(t.RLP.decode(Uint8Array.from(N)));if(!Array.isArray(D))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(D)}static fromValuesArray(N){const[D,K,ne,J]=N;return new p((0,u.bufferToBigInt)(D),(0,u.bufferToBigInt)(K),ne,J)}_validate(){if(this.nonce<d)throw new Error("nonce must be greater than zero");if(this.balance<d)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[(0,u.bigIntToUnpaddedBuffer)(this.nonce),(0,u.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return Buffer.from(t.RLP.encode((0,u.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(f.KECCAK256_NULL)}isEmpty(){return this.balance===d&&this.nonce===d&&this.codeHash.equals(f.KECCAK256_NULL)}}e.Account=p;const w=function(M){try{(0,l.assertIsString)(M)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(M)};e.isValidAddress=w;const T=function(M,N){(0,l.assertIsHexString)(M);const D=(0,h.stripHexPrefix)(M).toLowerCase();let K="";N!==void 0&&(K=(0,u.bufferToBigInt)((0,u.toBuffer)(N)).toString()+"0x");const ne=Buffer.from(K+D,"utf8"),J=(0,a.bytesToHex)((0,r.keccak256)(ne));let ue="0x";for(let G=0;G<D.length;G++)parseInt(J[G],16)>=8?ue+=D[G].toUpperCase():ue+=D[G];return ue};e.toChecksumAddress=T;const v=function(M,N){return(0,e.isValidAddress)(M)&&(0,e.toChecksumAddress)(M,N)===M};e.isValidChecksumAddress=v;const k=function(M,N){return(0,l.assertIsBuffer)(M),(0,l.assertIsBuffer)(N),(0,u.bufferToBigInt)(N)===BigInt(0)?Buffer.from((0,r.keccak256)(t.RLP.encode((0,u.bufArrToArr)([M,null])))).slice(-20):Buffer.from((0,r.keccak256)(t.RLP.encode((0,u.bufArrToArr)([M,N])))).slice(-20)};e.generateAddress=k;const C=function(M,N,D){if((0,l.assertIsBuffer)(M),(0,l.assertIsBuffer)(N),(0,l.assertIsBuffer)(D),M.length!==20)throw new Error("Expected from to be of length 20");if(N.length!==32)throw new Error("Expected salt to be of length 32");const K=(0,r.keccak256)(Buffer.concat([Buffer.from("ff","hex"),M,N,(0,r.keccak256)(D)]));return(0,u.toBuffer)(K).slice(-20)};e.generateAddress2=C;const P=function(M){return o.secp256k1.utils.isValidPrivateKey(M)};e.isValidPrivate=P;const $=function(M,N=!1){if((0,l.assertIsBuffer)(M),M.length===64)try{return o.secp256k1.ProjectivePoint.fromHex(Buffer.concat([Buffer.from([4]),M])),!0}catch{return!1}if(!N)return!1;try{return o.secp256k1.ProjectivePoint.fromHex(M),!0}catch{return!1}};e.isValidPublic=$;const L=function(M,N=!1){if((0,l.assertIsBuffer)(M),N&&M.length!==64&&(M=Buffer.from(o.secp256k1.ProjectivePoint.fromHex(M).toRawBytes(!1).slice(1))),M.length!==64)throw new Error("Expected pubKey to be of length 64");return Buffer.from((0,r.keccak256)(M)).slice(-20)};e.pubToAddress=L,e.publicToAddress=e.pubToAddress;const S=function(M){return(0,l.assertIsBuffer)(M),Buffer.from(o.secp256k1.ProjectivePoint.fromPrivateKey(M).toRawBytes(!1).slice(1))};e.privateToPublic=S;const m=function(M){return(0,e.publicToAddress)((0,e.privateToPublic)(M))};e.privateToAddress=m;const H=function(M){return(0,l.assertIsBuffer)(M),M.length!==64&&(M=Buffer.from(o.secp256k1.ProjectivePoint.fromHex(M).toRawBytes(!1).slice(1))),M};e.importPublic=H;const ee=function(){const N=(0,u.zeros)(20);return(0,u.bufferToHex)(N)};e.zeroAddress=ee;const ge=function(M){try{(0,l.assertIsString)(M)}catch{return!1}return(0,e.zeroAddress)()===M};e.isZeroAddress=ge;function fe(M){const[N,D,K,ne]=M;return[N,D,(0,u.arrToBufArr)(K).length===0?f.KECCAK256_RLP:K,(0,u.arrToBufArr)(ne).length===0?f.KECCAK256_NULL:ne]}e.accountBodyFromSlim=fe;const oe=new Uint8Array(0);function Ae(M){const[N,D,K,ne]=M;return[N,D,(0,u.arrToBufArr)(K).equals(f.KECCAK256_RLP)?oe:K,(0,u.arrToBufArr)(ne).equals(f.KECCAK256_NULL)?oe:ne]}e.accountBodyToSlim=Ae;function be(M,N=!0){const D=N?fe(M):M;return(0,u.arrToBufArr)(t.RLP.encode(D))}e.accountBodyToRLP=be})(pd);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.Address=void 0;const vs=pd,eu=so;class Kr{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new Kr((0,eu.zeros)(20))}static fromString(t){if(!(0,vs.isValidAddress)(t))throw new Error("Invalid address");return new Kr((0,eu.toBuffer)(t))}static fromPublicKey(t){if(!Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const r=(0,vs.pubToAddress)(t);return new Kr(r)}static fromPrivateKey(t){if(!Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const r=(0,vs.privateToAddress)(t);return new Kr(r)}static generate(t,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new Kr((0,vs.generateAddress)(t.buf,(0,eu.bigIntToBuffer)(r)))}static generate2(t,r,o){if(!Buffer.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!Buffer.isBuffer(o))throw new Error("Expected initCode to be a Buffer");return new Kr((0,vs.generateAddress2)(t.buf,r,o))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(Kr.zero())}isPrecompileOrSystemAddress(){const t=(0,eu.bufferToBigInt)(this.buf),r=BigInt(0),o=BigInt("0xffff");return t>=r&&t<=o}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return Buffer.from(this.buf)}}qs.Address=Kr;var Yu={},wd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=so,r=ht;var o;(function(u){u[u.Number=0]="Number",u[u.BigInt=1]="BigInt",u[u.Buffer=2]="Buffer",u[u.PrefixedHexString=3]="PrefixedHexString"})(o=e.TypeOutput||(e.TypeOutput={}));function a(u,f){if(u===null)return null;if(u===void 0)return;if(typeof u=="string"&&!(0,r.isHexString)(u))throw new Error(`A string must be provided with a 0x-prefix, given: ${u}`);if(typeof u=="number"&&!Number.isSafeInteger(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const l=(0,t.toBuffer)(u);switch(f){case o.Buffer:return l;case o.BigInt:return(0,t.bufferToBigInt)(l);case o.Number:{const h=(0,t.bufferToBigInt)(l);if(h>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(h)}case o.PrefixedHexString:return(0,t.bufferToHex)(l);default:throw new Error("unknown outputType")}}e.toType=a})(wd);Object.defineProperty(Yu,"__esModule",{value:!0});Yu.Withdrawal=void 0;const jp=qs,Fc=so,St=wd;class Is{constructor(t,r,o,a){this.index=t,this.validatorIndex=r,this.address=o,this.amount=a}static fromWithdrawalData(t){const{index:r,validatorIndex:o,address:a,amount:u}=t,f=(0,St.toType)(r,St.TypeOutput.BigInt),l=(0,St.toType)(o,St.TypeOutput.BigInt),h=new jp.Address((0,St.toType)(a,St.TypeOutput.Buffer)),d=(0,St.toType)(u,St.TypeOutput.BigInt);return new Is(f,l,h,d)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[r,o,a,u]=t;return Is.fromWithdrawalData({index:r,validatorIndex:o,address:a,amount:u})}static toBufferArray(t){const{index:r,validatorIndex:o,address:a,amount:u}=t,f=(0,St.toType)(r,St.TypeOutput.BigInt)===BigInt(0)?Buffer.alloc(0):(0,St.toType)(r,St.TypeOutput.Buffer),l=(0,St.toType)(o,St.TypeOutput.BigInt)===BigInt(0)?Buffer.alloc(0):(0,St.toType)(o,St.TypeOutput.Buffer);let h;a instanceof jp.Address?h=a.buf:h=(0,St.toType)(a,St.TypeOutput.Buffer);const d=(0,St.toType)(u,St.TypeOutput.BigInt)===BigInt(0)?Buffer.alloc(0):(0,St.toType)(u,St.TypeOutput.Buffer);return[f,l,h,d]}raw(){return Is.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,Fc.bigIntToHex)(this.index),validatorIndex:(0,Fc.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,Fc.bigIntToHex)(this.amount)}}}Yu.Withdrawal=Is;var en={};Object.defineProperty(en,"__esModule",{value:!0});en.hashPersonalMessage=en.isValidSignature=en.fromRpcSig=en.toCompactSig=en.toRpcSig=en.ecrecover=en.ecsign=void 0;const DC=rr,Zy=ku,_n=so,qc=Uu,jC=qn;function UC(e,t,r){const o=Zy.secp256k1.sign(e,t),a=o.toCompactRawBytes(),u=Buffer.from(a.slice(0,32)),f=Buffer.from(a.slice(32,64)),l=r===void 0?BigInt(o.recovery+27):BigInt(o.recovery+35)+BigInt(r)*BigInt(2);return{r:u,s:f,v:l}}en.ecsign=UC;function Zu(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function Xu(e){return e===BigInt(0)||e===BigInt(1)}const kC=function(e,t,r,o,a){const u=Buffer.concat([(0,_n.setLengthLeft)(r,32),(0,_n.setLengthLeft)(o,32)],64),f=Zu(t,a);if(!Xu(f))throw new Error("Invalid signature v value");const h=Zy.secp256k1.Signature.fromCompact(u).addRecoveryBit(Number(f)).recoverPublicKey(e);return Buffer.from(h.toRawBytes(!1).slice(1))};en.ecrecover=kC;const HC=function(e,t,r,o){const a=Zu(e,o);if(!Xu(a))throw new Error("Invalid signature v value");return(0,_n.bufferToHex)(Buffer.concat([(0,_n.setLengthLeft)(t,32),(0,_n.setLengthLeft)(r,32),(0,_n.toBuffer)(e)]))};en.toRpcSig=HC;const WC=function(e,t,r,o){const a=Zu(e,o);if(!Xu(a))throw new Error("Invalid signature v value");let u=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(u=Buffer.from(r),u[0]|=128),(0,_n.bufferToHex)(Buffer.concat([(0,_n.setLengthLeft)(t,32),(0,_n.setLengthLeft)(u,32)]))};en.toCompactSig=WC;const FC=function(e){const t=(0,_n.toBuffer)(e);let r,o,a;if(t.length>=65)r=t.slice(0,32),o=t.slice(32,64),a=(0,_n.bufferToBigInt)(t.slice(64));else if(t.length===64)r=t.slice(0,32),o=t.slice(32,64),a=BigInt((0,_n.bufferToInt)(t.slice(32,33))>>7),o[0]&=127;else throw new Error("Invalid signature length");return a<27&&(a=a+BigInt(27)),{v:a,r,s:o}};en.fromRpcSig=FC;const qC=function(e,t,r,o=!0,a){if(t.length!==32||r.length!==32||!Xu(Zu(e,a)))return!1;const u=(0,_n.bufferToBigInt)(t),f=(0,_n.bufferToBigInt)(r);return!(u===BigInt(0)||u>=qc.SECP256K1_ORDER||f===BigInt(0)||f>=qc.SECP256K1_ORDER||o&&f>=qc.SECP256K1_ORDER_DIV_2)};en.isValidSignature=qC;const VC=function(e){(0,jC.assertIsBuffer)(e);const t=Buffer.from(`Ethereum Signed Message:
|
|
3
|
-
${e.length}`,"utf-8");return Buffer.from((0,DC.keccak256)(Buffer.concat([t,e])))};en.hashPersonalMessage=VC;var Xy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=f=>f.length>0&&f[f.length-1]===16;e.hasTerminator=t;const r=(f,l)=>{for(let h=0,d=0;d<f.length;h+=1,d+=2)l[h]=f[d]<<4|f[d+1]};e.nibblesToBytes=r;const o=f=>{let l=0;(0,e.hasTerminator)(f)&&(l=1,f=f.subarray(0,f.length-1));const h=new Uint8Array(f.length/2+1);return h[0]=l<<5,(f.length&1)===1&&(h[0]|=16,h[0]|=f[0],f=f.subarray(1)),(0,e.nibblesToBytes)(f,h.subarray(1)),h};e.nibblesToCompactBytes=o;const a=f=>{const l=f.length*2+1,h=new Uint8Array(l);for(let d=0;d<f.length;d++){const p=f[d];h[d*2]=p/16,h[d*2+1]=p%16}return h[l-1]=16,h};e.bytesToNibbles=a;const u=f=>{if(f.length===0)return f;let l=(0,e.bytesToNibbles)(f);l[0]<2&&(l=l.subarray(0,l.length-1));const h=2-(l[0]&1);return l.subarray(h)};e.compactBytesToNibbles=u})(Xy);var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0});Qu.AsyncEventEmitter=void 0;const zC=Ti;async function GC(e,t,r){let o;for await(const a of t)try{a.length<2?a.call(e,r):await new Promise((u,f)=>{a.call(e,r,l=>{l?f(l):u()})})}catch(u){o=u}if(o)throw o}class KC extends zC.EventEmitter{emit(t,...r){let[o,a]=r;const u=this;let f=u._events[t]??[];return a===void 0&&typeof o=="function"&&(a=o,o=void 0),(t==="newListener"||t==="removeListener")&&(o={event:o,fn:a},a=void 0),f=Array.isArray(f)?f:[f],GC(u,f.slice(),o).then(a).catch(a),u.listenerCount(t)>0}once(t,r){const o=this;let a;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?a=function(u,f){o.removeListener(t,a),r(u,f)}:a=function(u){o.removeListener(t,a),r(u,a)},o.on(t,a),o}first(t,r){let o=this._events[t]??[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(o)||(this._events[t]=o=[o]),o.unshift(r),this}before(t,r,o){return this.beforeOrAfter(t,r,o)}after(t,r,o){return this.beforeOrAfter(t,r,o,"after")}beforeOrAfter(t,r,o,a){let u=this._events[t]??[],f,l;const h=a==="after"?1:0;if(typeof o!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(u)||(this._events[t]=u=[u]),l=u.length,f=u.length;f--;)if(u[f]===r){l=f+h;break}return u.splice(l,0,o),this}on(t,r){return super.on(t,r)}addListener(t,r){return super.addListener(t,r)}prependListener(t,r){return super.prependListener(t,r)}prependOnceListener(t,r){return super.prependOnceListener(t,r)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,r){return super.removeListener(t,r)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}Qu.AsyncEventEmitter=KC;var ef={};Object.defineProperty(ef,"__esModule",{value:!0});ef.Lock=void 0;class JC{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(t=>this.promiseResolverQueue.push(t))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}ef.Lock=JC;var Uo={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.InvalidStatusCodeError=Xi.InvalidCertError=void 0;const Qy=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class Cl extends Error{constructor(t,r){super(t),this.fingerprint256=r}}Xi.InvalidCertError=Cl;class md extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}Xi.InvalidStatusCodeError=md;function e_(e,t){if(!t||t==="text"||t==="json")try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return r;try{return JSON.parse(r)}catch(o){if(t==="json")throw o;return r}}catch(r){if(t==="text"||t==="json")throw r}return e}let Up={};function Pl(e,t){var T;let r={...Qy,...t};const o=Vi,a=Vi,u=Vi,{promisify:f}=Q1(),{resolve:l}=Vi,h=!!/^https/.test(e);let d={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const p=v=>v.replace(/:| /g,"").toLowerCase();if(r.keepAlive){const v={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},k=[h,h&&((T=r.sslPinnedCertificates)==null?void 0:T.map(C=>p(C)).sort())].join();d.agent=Up[k]||(Up[k]=new(h?a:o).Agent(v))}r.type==="json"&&(d.headers["Content-Type"]="application/json"),r.data&&(r.method||(d.method="POST"),d.body=r.type==="json"?JSON.stringify(r.data):r.data),d.headers={...d.headers,...r.headers},r.sslAllowSelfSigned&&(d.rejectUnauthorized=!1);const w=async v=>{const k=v.statusCode;if(r.redirect&&300<=k&&k<400&&v.headers.location){if(r._redirectCount==10)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await Pl(l(e,v.headers.location),r)}if(r.expectStatusCode&&k!==r.expectStatusCode)throw v.resume(),new md(k);let C=[];for await(const S of v)C.push(S);let P=Buffer.concat(C);const $=v.headers["content-encoding"];$==="br"&&(P=await f(u.brotliDecompress)(P)),($==="gzip"||$==="deflate")&&(P=await f(u.unzip)(P));const L=e_(P,r.type);return r.full?{headers:v.headers,status:k,body:L}:L};return new Promise((v,k)=>{var S;const C=async m=>{if(m&&m.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await Pl(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(H){H&&H.fingerprint256&&(m=new Cl(`Self-signed SSL certificate: ${H.fingerprint256}`,H.fingerprint256))}k(m)},P=(h?a:o).request(e,d,m=>{m.on("error",C),(async()=>{try{v(await w(m))}catch(H){k(H)}})()});P.on("error",C);const $=(S=r.sslPinnedCertificates)==null?void 0:S.map(m=>p(m)),L=m=>{var ee;const H=p(((ee=m.getPeerCertificate())==null?void 0:ee.fingerprint256)||"");if(!(!H&&m.isSessionReused())&&!$.includes(H))return P.emit("error",new Cl(`Invalid SSL certificate: ${H} Expected: ${$}`,H)),P.abort()};r.sslPinnedCertificates&&P.on("socket",m=>{m.listeners("secureConnect").map(ee=>(ee.name||"").replace("bound ","")).includes("mfetchSecureConnect")||m.on("secureConnect",L.bind(null,m))}),r.keepAlive&&P.setNoDelay(!0),d.body&&P.write(d.body),P.end()})}const YC=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),ZC=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map(e=>e.toLowerCase()));async function XC(e,t){let r={...Qy,...t};const o=new Headers;r.type==="json"&&o.set("Content-Type","application/json");let a=new URL(e);if(a.username){const h=btoa(`${a.username}:${a.password}`);o.set("Authorization",`Basic ${h}`),a.username="",a.password=""}e=""+a;for(let h in r.headers){const d=h.toLowerCase();(YC.has(d)||r.cors&&!ZC.has(d))&&o.set(h,r.headers[h])}let u={headers:o,redirect:r.redirect?"follow":"manual"};r.referrer||(u.referrerPolicy="no-referrer"),r.cors&&(u.mode="cors"),r.data&&(r.method||(u.method="POST"),u.body=r.type==="json"?JSON.stringify(r.data):r.data);const f=await fetch(e,u);if(r.expectStatusCode&&f.status!==r.expectStatusCode)throw new md(f.status);const l=e_(new Uint8Array(await f.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(f.headers.entries()),status:f.status,body:l}:l}const QC=!!(typeof process=="object"&&process.versions&&process.versions.node&&process.versions.v8);function eP(e,t){return(QC?Pl:XC)(e,t)}Xi.default=eP;Object.defineProperty(Uo,"__esModule",{value:!0});Uo.getProvider=Uo.fetchFromProvider=void 0;const tP=Xi,nP=async(e,t)=>(await(0,tP.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;Uo.fetchFromProvider=nP;const rP=e=>{var t;if(typeof e=="string")return e;if(((t=e==null?void 0:e.connection)==null?void 0:t.url)!==void 0)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};Uo.getProvider=rP;(function(e){var t=Ke&&Ke.__createBinding||(Object.create?function(a,u,f,l){l===void 0&&(l=f);var h=Object.getOwnPropertyDescriptor(u,f);(!h||("get"in h?!u.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return u[f]}}),Object.defineProperty(a,l,h)}:function(a,u,f,l){l===void 0&&(l=f),a[l]=u[f]}),r=Ke&&Ke.__exportStar||function(a,u){for(var f in a)f!=="default"&&!Object.prototype.hasOwnProperty.call(u,f)&&t(u,a,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,r(Uu,e),r(Ku,e),r(pd,e),r(qs,e),r(Yu,e),r(en,e),r(so,e),r(wd,e),r(Xy,e),r(Qu,e);var o=ht;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return o.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),r(ef,e),r(Uo,e)})(wO);var t_={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():t.log=r()})(Ke,function(){var t=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),a=["trace","debug","info","warn","error"],u={},f=null;function l(C,P){var $=C[P];if(typeof $.bind=="function")return $.bind(C);try{return Function.prototype.bind.call($,C)}catch{return function(){return Function.prototype.apply.apply($,[C,arguments])}}}function h(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(C){return C==="debug"&&(C="log"),typeof console===r?!1:C==="trace"&&o?h:console[C]!==void 0?l(console,C):console.log!==void 0?l(console,"log"):t}function p(){for(var C=this.getLevel(),P=0;P<a.length;P++){var $=a[P];this[$]=P<C?t:this.methodFactory($,C,this.name)}if(this.log=this.debug,typeof console===r&&C<this.levels.SILENT)return"No console available for logging"}function w(C){return function(){typeof console!==r&&(p.call(this),this[C].apply(this,arguments))}}function T(C,P,$){return d(C)||w.apply(this,arguments)}function v(C,P){var $=this,L,S,m,H="loglevel";typeof C=="string"?H+=":"+C:typeof C=="symbol"&&(H=void 0);function ee(be){var M=(a[be]||"silent").toUpperCase();if(!(typeof window===r||!H)){try{window.localStorage[H]=M;return}catch{}try{window.document.cookie=encodeURIComponent(H)+"="+M+";"}catch{}}}function ge(){var be;if(!(typeof window===r||!H)){try{be=window.localStorage[H]}catch{}if(typeof be===r)try{var M=window.document.cookie,N=encodeURIComponent(H),D=M.indexOf(N+"=");D!==-1&&(be=/^([^;]+)/.exec(M.slice(D+N.length+1))[1])}catch{}return $.levels[be]===void 0&&(be=void 0),be}}function fe(){if(!(typeof window===r||!H)){try{window.localStorage.removeItem(H)}catch{}try{window.document.cookie=encodeURIComponent(H)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function oe(be){var M=be;if(typeof M=="string"&&$.levels[M.toUpperCase()]!==void 0&&(M=$.levels[M.toUpperCase()]),typeof M=="number"&&M>=0&&M<=$.levels.SILENT)return M;throw new TypeError("log.setLevel() called with invalid level: "+be)}$.name=C,$.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},$.methodFactory=P||T,$.getLevel=function(){return m??S??L},$.setLevel=function(be,M){return m=oe(be),M!==!1&&ee(m),p.call($)},$.setDefaultLevel=function(be){S=oe(be),ge()||$.setLevel(be,!1)},$.resetLevel=function(){m=null,fe(),p.call($)},$.enableAll=function(be){$.setLevel($.levels.TRACE,be)},$.disableAll=function(be){$.setLevel($.levels.SILENT,be)},$.rebuild=function(){if(f!==$&&(L=oe(f.getLevel())),p.call($),f===$)for(var be in u)u[be].rebuild()},L=oe(f?f.getLevel():"WARN");var Ae=ge();Ae!=null&&(m=oe(Ae)),p.call($)}f=new v,f.getLogger=function(P){if(typeof P!="symbol"&&typeof P!="string"||P==="")throw new TypeError("You must supply a name when creating a logger.");var $=u[P];return $||($=u[P]=new v(P,f.methodFactory)),$};var k=typeof window!==r?window.log:void 0;return f.noConflict=function(){return typeof window!==r&&window.log===f&&(window.log=k),f},f.getLoggers=function(){return u},f.default=f,f})})(t_);var n_=t_.exports;const yu=Ii(n_);var _u={exports:{}};_u.exports;(function(e,t){var r=200,o="__lodash_hash_undefined__",a=800,u=16,f=9007199254740991,l="[object Arguments]",h="[object Array]",d="[object AsyncFunction]",p="[object Boolean]",w="[object Date]",T="[object Error]",v="[object Function]",k="[object GeneratorFunction]",C="[object Map]",P="[object Number]",$="[object Null]",L="[object Object]",S="[object Proxy]",m="[object RegExp]",H="[object Set]",ee="[object String]",ge="[object Undefined]",fe="[object WeakMap]",oe="[object ArrayBuffer]",Ae="[object DataView]",be="[object Float32Array]",M="[object Float64Array]",N="[object Int8Array]",D="[object Int16Array]",K="[object Int32Array]",ne="[object Uint8Array]",J="[object Uint8ClampedArray]",ue="[object Uint16Array]",G="[object Uint32Array]",Y=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,me=/^(?:0|[1-9]\d*)$/,te={};te[be]=te[M]=te[N]=te[D]=te[K]=te[ne]=te[J]=te[ue]=te[G]=!0,te[l]=te[h]=te[oe]=te[p]=te[Ae]=te[w]=te[T]=te[v]=te[C]=te[P]=te[L]=te[m]=te[H]=te[ee]=te[fe]=!1;var ye=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,we=typeof self=="object"&&self&&self.Object===Object&&self,j=ye||we||Function("return this")(),F=t&&!t.nodeType&&t,Z=F&&!0&&e&&!e.nodeType&&e,de=Z&&Z.exports===F,Re=de&&ye.process,R=function(){try{var O=Z&&Z.require&&Z.require("util").types;return O||Re&&Re.binding&&Re.binding("util")}catch{}}(),I=R&&R.isTypedArray;function b(O,W,Q){switch(Q.length){case 0:return O.call(W);case 1:return O.call(W,Q[0]);case 2:return O.call(W,Q[0],Q[1]);case 3:return O.call(W,Q[0],Q[1],Q[2])}return O.apply(W,Q)}function E(O,W){for(var Q=-1,Ie=Array(O);++Q<O;)Ie[Q]=W(Q);return Ie}function z(O){return function(W){return O(W)}}function re(O,W){return O==null?void 0:O[W]}function ie(O,W){return function(Q){return O(W(Q))}}var Oe=Array.prototype,Le=Function.prototype,Ce=Object.prototype,ke=j["__core-js_shared__"],Ee=Le.toString,qe=Ce.hasOwnProperty,Rt=function(){var O=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return O?"Symbol(src)_1."+O:""}(),ct=Ce.toString,Dt=Ee.call(Object),it=RegExp("^"+Ee.call(qe).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ze=de?j.Buffer:void 0,jt=j.Symbol,Pt=j.Uint8Array;Ze&&Ze.allocUnsafe;var st=ie(Object.getPrototypeOf,Object),Lt=Object.create,dn=Ce.propertyIsEnumerable,nn=Oe.splice,Ht=jt?jt.toStringTag:void 0,hn=function(){try{var O=Go(Object,"defineProperty");return O({},"",{}),O}catch{}}(),Kn=Ze?Ze.isBuffer:void 0,Jn=Math.max,sr=Date.now,ar=Go(j,"Map"),rn=Go(Object,"create"),Bn=function(){function O(){}return function(W){if(!Nr(W))return{};if(Lt)return Lt(W);O.prototype=W;var Q=new O;return O.prototype=void 0,Q}}();function on(O){var W=-1,Q=O==null?0:O.length;for(this.clear();++W<Q;){var Ie=O[W];this.set(Ie[0],Ie[1])}}function Br(){this.__data__=rn?rn(null):{},this.size=0}function Yn(O){var W=this.has(O)&&delete this.__data__[O];return this.size-=W?1:0,W}function ur(O){var W=this.__data__;if(rn){var Q=W[O];return Q===o?void 0:Q}return qe.call(W,O)?W[O]:void 0}function A(O){var W=this.__data__;return rn?W[O]!==void 0:qe.call(W,O)}function B(O,W){var Q=this.__data__;return this.size+=this.has(O)?0:1,Q[O]=rn&&W===void 0?o:W,this}on.prototype.clear=Br,on.prototype.delete=Yn,on.prototype.get=ur,on.prototype.has=A,on.prototype.set=B;function pe(O){var W=-1,Q=O==null?0:O.length;for(this.clear();++W<Q;){var Ie=O[W];this.set(Ie[0],Ie[1])}}function _e(){this.__data__=[],this.size=0}function Se(O){var W=this.__data__,Q=gr(W,O);if(Q<0)return!1;var Ie=W.length-1;return Q==Ie?W.pop():nn.call(W,Q,1),--this.size,!0}function bt(O){var W=this.__data__,Q=gr(W,O);return Q<0?void 0:W[Q][1]}function vt(O){return gr(this.__data__,O)>-1}function fr(O,W){var Q=this.__data__,Ie=gr(Q,O);return Ie<0?(++this.size,Q.push([O,W])):Q[Ie][1]=W,this}pe.prototype.clear=_e,pe.prototype.delete=Se,pe.prototype.get=bt,pe.prototype.has=vt,pe.prototype.set=fr;function Bt(O){var W=-1,Q=O==null?0:O.length;for(this.clear();++W<Q;){var Ie=O[W];this.set(Ie[0],Ie[1])}}function cr(){this.size=0,this.__data__={hash:new on,map:new(ar||pe),string:new on}}function Lr(O){var W=xi(this,O).delete(O);return this.size-=W?1:0,W}function lr(O){return xi(this,O).get(O)}function dr(O){return xi(this,O).has(O)}function Zn(O,W){var Q=xi(this,O),Ie=Q.size;return Q.set(O,W),this.size+=Q.size==Ie?0:1,this}Bt.prototype.clear=cr,Bt.prototype.delete=Lr,Bt.prototype.get=lr,Bt.prototype.has=dr,Bt.prototype.set=Zn;function zt(O){var W=this.__data__=new pe(O);this.size=W.size}function Ln(){this.__data__=new pe,this.size=0}function vn(O){var W=this.__data__,Q=W.delete(O);return this.size=W.size,Q}function sn(O){return this.__data__.get(O)}function Wt(O){return this.__data__.has(O)}function Pi(O,W){var Q=this.__data__;if(Q instanceof pe){var Ie=Q.__data__;if(!ar||Ie.length<r-1)return Ie.push([O,W]),this.size=++Q.size,this;Q=this.__data__=new Bt(Ie)}return Q.set(O,W),this.size=Q.size,this}zt.prototype.clear=Ln,zt.prototype.delete=vn,zt.prototype.get=sn,zt.prototype.has=Wt,zt.prototype.set=Pi;function Bi(O,W){var Q=Zo(O),Ie=!Q&&Yo(O),ze=!Q&&!Ie&&sa(O),Qe=!Q&&!Ie&&!ze&&ua(O),lt=Q||Ie||ze||Qe,$e=lt?E(O.length,String):[],ot=$e.length;for(var xt in O)lt&&(xt=="length"||ze&&(xt=="offset"||xt=="parent")||Qe&&(xt=="buffer"||xt=="byteLength"||xt=="byteOffset")||fo(xt,ot))||$e.push(xt);return $e}function xr(O,W,Q){(Q!==void 0&&!Ni(O[W],Q)||Q===void 0&&!(W in O))&&xn(O,W,Q)}function hr(O,W,Q){var Ie=O[W];(!(qe.call(O,W)&&Ni(Ie,Q))||Q===void 0&&!(W in O))&&xn(O,W,Q)}function gr(O,W){for(var Q=O.length;Q--;)if(Ni(O[Q][0],W))return Q;return-1}function xn(O,W,Q){W=="__proto__"&&hn?hn(O,W,{configurable:!0,enumerable:!0,value:Q,writable:!0}):O[W]=Q}var Li=uo();function pr(O){return O==null?O===void 0?ge:$:Ht&&Ht in Object(O)?Zs(O):ea(O)}function ri(O){return Mr(O)&&pr(O)==l}function ii(O){if(!Nr(O)||Ko(O))return!1;var W=Qo(O)?it:ae;return W.test(ia(O))}function oi(O){return Mr(O)&&aa(O.length)&&!!te[pr(O)]}function si(O){if(!Nr(O))return ai(O);var W=co(O),Q=[];for(var Ie in O)Ie=="constructor"&&(W||!qe.call(O,Ie))||Q.push(Ie);return Q}function zs(O,W,Q,Ie,ze){O!==W&&Li(W,function(Qe,lt){if(ze||(ze=new zt),Nr(Qe))uf(O,W,lt,Q,zs,Ie,ze);else{var $e=Ie?Ie(Jo(O,lt),Qe,lt+"",O,W,ze):void 0;$e===void 0&&($e=Qe),xr(O,lt,$e)}},fa)}function uf(O,W,Q,Ie,ze,Qe,lt){var $e=Jo(O,Q),ot=Jo(W,Q),xt=lt.get(ot);if(xt){xr(O,Q,xt);return}var Gt=Qe?Qe($e,ot,Q+"",O,W,lt):void 0,$r=Gt===void 0;if($r){var Kt=Zo(ot),lo=!Kt&&sa(ot),es=!Kt&&!lo&&ua(ot);Gt=ot,Kt||lo||es?Zo($e)?Gt=$e:oa($e)?Gt=zo($e):lo?($r=!1,Gt=Gs(ot)):es?($r=!1,Gt=Js(ot)):Gt=[]:hf(ot)||Yo(ot)?(Gt=$e,Yo($e)?Gt=gf($e):(!Nr($e)||Qo($e))&&(Gt=Xs(ot))):$r=!1}$r&&(lt.set(ot,Gt),ze(Gt,ot,Ie,Qe,lt),lt.delete(ot)),xr(O,Q,Gt)}function ff(O,W){return na(ta(O,W,tt),O+"")}var cf=hn?function(O,W){return hn(O,"toString",{configurable:!0,enumerable:!1,value:at(W),writable:!0})}:tt;function Gs(O,W){return O.slice()}function Ks(O){var W=new O.constructor(O.byteLength);return new Pt(W).set(new Pt(O)),W}function Js(O,W){var Q=Ks(O.buffer);return new O.constructor(Q,O.byteOffset,O.length)}function zo(O,W){var Q=-1,Ie=O.length;for(W||(W=Array(Ie));++Q<Ie;)W[Q]=O[Q];return W}function lf(O,W,Q,Ie){var ze=!Q;Q||(Q={});for(var Qe=-1,lt=W.length;++Qe<lt;){var $e=W[Qe],ot=void 0;ot===void 0&&(ot=O[$e]),ze?xn(Q,$e,ot):hr(Q,$e,ot)}return Q}function Ys(O){return ff(function(W,Q){var Ie=-1,ze=Q.length,Qe=ze>1?Q[ze-1]:void 0,lt=ze>2?Q[2]:void 0;for(Qe=O.length>3&&typeof Qe=="function"?(ze--,Qe):void 0,lt&&df(Q[0],Q[1],lt)&&(Qe=ze<3?void 0:Qe,ze=1),W=Object(W);++Ie<ze;){var $e=Q[Ie];$e&&O(W,$e,Ie,Qe)}return W})}function uo(O){return function(W,Q,Ie){for(var ze=-1,Qe=Object(W),lt=Ie(W),$e=lt.length;$e--;){var ot=lt[++ze];if(Q(Qe[ot],ot,Qe)===!1)break}return W}}function xi(O,W){var Q=O.__data__;return Qs(W)?Q[typeof W=="string"?"string":"hash"]:Q.map}function Go(O,W){var Q=re(O,W);return ii(Q)?Q:void 0}function Zs(O){var W=qe.call(O,Ht),Q=O[Ht];try{O[Ht]=void 0;var Ie=!0}catch{}var ze=ct.call(O);return Ie&&(W?O[Ht]=Q:delete O[Ht]),ze}function Xs(O){return typeof O.constructor=="function"&&!co(O)?Bn(st(O)):{}}function fo(O,W){var Q=typeof O;return W=W??f,!!W&&(Q=="number"||Q!="symbol"&&me.test(O))&&O>-1&&O%1==0&&O<W}function df(O,W,Q){if(!Nr(Q))return!1;var Ie=typeof W;return(Ie=="number"?Xo(Q)&&fo(W,Q.length):Ie=="string"&&W in Q)?Ni(Q[W],O):!1}function Qs(O){var W=typeof O;return W=="string"||W=="number"||W=="symbol"||W=="boolean"?O!=="__proto__":O===null}function Ko(O){return!!Rt&&Rt in O}function co(O){var W=O&&O.constructor,Q=typeof W=="function"&&W.prototype||Ce;return O===Q}function ai(O){var W=[];if(O!=null)for(var Q in Object(O))W.push(Q);return W}function ea(O){return ct.call(O)}function ta(O,W,Q){return W=Jn(W===void 0?O.length-1:W,0),function(){for(var Ie=arguments,ze=-1,Qe=Jn(Ie.length-W,0),lt=Array(Qe);++ze<Qe;)lt[ze]=Ie[W+ze];ze=-1;for(var $e=Array(W+1);++ze<W;)$e[ze]=Ie[ze];return $e[W]=Q(lt),b(O,this,$e)}}function Jo(O,W){if(!(W==="constructor"&&typeof O[W]=="function")&&W!="__proto__")return O[W]}var na=ra(cf);function ra(O){var W=0,Q=0;return function(){var Ie=sr(),ze=u-(Ie-Q);if(Q=Ie,ze>0){if(++W>=a)return arguments[0]}else W=0;return O.apply(void 0,arguments)}}function ia(O){if(O!=null){try{return Ee.call(O)}catch{}try{return O+""}catch{}}return""}function Ni(O,W){return O===W||O!==O&&W!==W}var Yo=ri(function(){return arguments}())?ri:function(O){return Mr(O)&&qe.call(O,"callee")&&!dn.call(O,"callee")},Zo=Array.isArray;function Xo(O){return O!=null&&aa(O.length)&&!Qo(O)}function oa(O){return Mr(O)&&Xo(O)}var sa=Kn||bf;function Qo(O){if(!Nr(O))return!1;var W=pr(O);return W==v||W==k||W==d||W==S}function aa(O){return typeof O=="number"&&O>-1&&O%1==0&&O<=f}function Nr(O){var W=typeof O;return O!=null&&(W=="object"||W=="function")}function Mr(O){return O!=null&&typeof O=="object"}function hf(O){if(!Mr(O)||pr(O)!=L)return!1;var W=st(O);if(W===null)return!0;var Q=qe.call(W,"constructor")&&W.constructor;return typeof Q=="function"&&Q instanceof Q&&Ee.call(Q)==Dt}var ua=I?z(I):oi;function gf(O){return lf(O,fa(O))}function fa(O){return Xo(O)?Bi(O):si(O)}var pf=Ys(function(O,W,Q){zs(O,W,Q)});function at(O){return function(){return O}}function tt(O){return O}function bf(){return!1}e.exports=pf})(_u,_u.exports);_u.exports;const iP=yu.getLogger("http-helpers");iP.setLevel(n_.levels.INFO);var wu={exports:{}};/**
|
|
4
|
-
* @license
|
|
5
|
-
* Lodash <https://lodash.com/>
|
|
6
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
-
* Released under MIT license <https://lodash.com/license>
|
|
8
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
9
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
10
|
-
*/wu.exports;(function(e,t){(function(){var r,o="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",d=500,p="__lodash_placeholder__",w=1,T=2,v=4,k=1,C=2,P=1,$=2,L=4,S=8,m=16,H=32,ee=64,ge=128,fe=256,oe=512,Ae=30,be="...",M=800,N=16,D=1,K=2,ne=3,J=1/0,ue=9007199254740991,G=17976931348623157e292,Y=NaN,ae=4294967295,me=ae-1,te=ae>>>1,ye=[["ary",ge],["bind",P],["bindKey",$],["curry",S],["curryRight",m],["flip",oe],["partial",H],["partialRight",ee],["rearg",fe]],we="[object Arguments]",j="[object Array]",F="[object AsyncFunction]",Z="[object Boolean]",de="[object Date]",Re="[object DOMException]",R="[object Error]",I="[object Function]",b="[object GeneratorFunction]",E="[object Map]",z="[object Number]",re="[object Null]",ie="[object Object]",Oe="[object Promise]",Le="[object Proxy]",Ce="[object RegExp]",ke="[object Set]",Ee="[object String]",qe="[object Symbol]",Rt="[object Undefined]",ct="[object WeakMap]",Dt="[object WeakSet]",it="[object ArrayBuffer]",Ze="[object DataView]",jt="[object Float32Array]",Pt="[object Float64Array]",st="[object Int8Array]",Lt="[object Int16Array]",dn="[object Int32Array]",nn="[object Uint8Array]",Ht="[object Uint8ClampedArray]",hn="[object Uint16Array]",Kn="[object Uint32Array]",Jn=/\b__p \+= '';/g,sr=/\b(__p \+=) '' \+/g,ar=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rn=/&(?:amp|lt|gt|quot|#39);/g,Bn=/[&<>"']/g,on=RegExp(rn.source),Br=RegExp(Bn.source),Yn=/<%-([\s\S]+?)%>/g,ur=/<%([\s\S]+?)%>/g,A=/<%=([\s\S]+?)%>/g,B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pe=/^\w*$/,_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Se=/[\\^$.*+?()[\]{}|]/g,bt=RegExp(Se.source),vt=/^\s+/,fr=/\s/,Bt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cr=/\{\n\/\* \[wrapped with (.+)\] \*/,Lr=/,? & /,lr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dr=/[()=,{}\[\]\/\s]/,Zn=/\\(\\)?/g,zt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ln=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,sn=/^0b[01]+$/i,Wt=/^\[object .+?Constructor\]$/,Pi=/^0o[0-7]+$/i,Bi=/^(?:0|[1-9]\d*)$/,xr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hr=/($^)/,gr=/['\n\r\u2028\u2029\\]/g,xn="\\ud800-\\udfff",Li="\\u0300-\\u036f",pr="\\ufe20-\\ufe2f",ri="\\u20d0-\\u20ff",ii=Li+pr+ri,oi="\\u2700-\\u27bf",si="a-z\\xdf-\\xf6\\xf8-\\xff",zs="\\xac\\xb1\\xd7\\xf7",uf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ff="\\u2000-\\u206f",cf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gs="A-Z\\xc0-\\xd6\\xd8-\\xde",Ks="\\ufe0e\\ufe0f",Js=zs+uf+ff+cf,zo="['’]",lf="["+xn+"]",Ys="["+Js+"]",uo="["+ii+"]",xi="\\d+",Go="["+oi+"]",Zs="["+si+"]",Xs="[^"+xn+Js+xi+oi+si+Gs+"]",fo="\\ud83c[\\udffb-\\udfff]",df="(?:"+uo+"|"+fo+")",Qs="[^"+xn+"]",Ko="(?:\\ud83c[\\udde6-\\uddff]){2}",co="[\\ud800-\\udbff][\\udc00-\\udfff]",ai="["+Gs+"]",ea="\\u200d",ta="(?:"+Zs+"|"+Xs+")",Jo="(?:"+ai+"|"+Xs+")",na="(?:"+zo+"(?:d|ll|m|re|s|t|ve))?",ra="(?:"+zo+"(?:D|LL|M|RE|S|T|VE))?",ia=df+"?",Ni="["+Ks+"]?",Yo="(?:"+ea+"(?:"+[Qs,Ko,co].join("|")+")"+Ni+ia+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",oa=Ni+ia+Yo,sa="(?:"+[Go,Ko,co].join("|")+")"+oa,Qo="(?:"+[Qs+uo+"?",uo,Ko,co,lf].join("|")+")",aa=RegExp(zo,"g"),Nr=RegExp(uo,"g"),Mr=RegExp(fo+"(?="+fo+")|"+Qo+oa,"g"),hf=RegExp([ai+"?"+Zs+"+"+na+"(?="+[Ys,ai,"$"].join("|")+")",Jo+"+"+ra+"(?="+[Ys,ai+ta,"$"].join("|")+")",ai+"?"+ta+"+"+na,ai+"+"+ra,Xo,Zo,xi,sa].join("|"),"g"),ua=RegExp("["+ea+xn+ii+Ks+"]"),gf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fa=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],pf=-1,at={};at[jt]=at[Pt]=at[st]=at[Lt]=at[dn]=at[nn]=at[Ht]=at[hn]=at[Kn]=!0,at[we]=at[j]=at[it]=at[Z]=at[Ze]=at[de]=at[R]=at[I]=at[E]=at[z]=at[ie]=at[Ce]=at[ke]=at[Ee]=at[ct]=!1;var tt={};tt[we]=tt[j]=tt[it]=tt[Ze]=tt[Z]=tt[de]=tt[jt]=tt[Pt]=tt[st]=tt[Lt]=tt[dn]=tt[E]=tt[z]=tt[ie]=tt[Ce]=tt[ke]=tt[Ee]=tt[qe]=tt[nn]=tt[Ht]=tt[hn]=tt[Kn]=!0,tt[R]=tt[I]=tt[ct]=!1;var bf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},O={"&":"&","<":"<",">":">",'"':""","'":"'"},W={"&":"&","<":"<",">":">",""":'"',"'":"'"},Q={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ie=parseFloat,ze=parseInt,Qe=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,lt=typeof self=="object"&&self&&self.Object===Object&&self,$e=Qe||lt||Function("return this")(),ot=t&&!t.nodeType&&t,xt=ot&&!0&&e&&!e.nodeType&&e,Gt=xt&&xt.exports===ot,$r=Gt&&Qe.process,Kt=function(){try{var q=xt&&xt.require&&xt.require("util").types;return q||$r&&$r.binding&&$r.binding("util")}catch{}}(),lo=Kt&&Kt.isArrayBuffer,es=Kt&&Kt.isDate,Td=Kt&&Kt.isMap,Id=Kt&&Kt.isRegExp,Od=Kt&&Kt.isSet,Cd=Kt&&Kt.isTypedArray;function En(q,se,X){switch(X.length){case 0:return q.call(se);case 1:return q.call(se,X[0]);case 2:return q.call(se,X[0],X[1]);case 3:return q.call(se,X[0],X[1],X[2])}return q.apply(se,X)}function m_(q,se,X,Te){for(var je=-1,Xe=q==null?0:q.length;++je<Xe;){var Nt=q[je];se(Te,Nt,X(Nt),q)}return Te}function Nn(q,se){for(var X=-1,Te=q==null?0:q.length;++X<Te&&se(q[X],X,q)!==!1;);return q}function v_(q,se){for(var X=q==null?0:q.length;X--&&se(q[X],X,q)!==!1;);return q}function Pd(q,se){for(var X=-1,Te=q==null?0:q.length;++X<Te;)if(!se(q[X],X,q))return!1;return!0}function ui(q,se){for(var X=-1,Te=q==null?0:q.length,je=0,Xe=[];++X<Te;){var Nt=q[X];se(Nt,X,q)&&(Xe[je++]=Nt)}return Xe}function ca(q,se){var X=q==null?0:q.length;return!!X&&ho(q,se,0)>-1}function yf(q,se,X){for(var Te=-1,je=q==null?0:q.length;++Te<je;)if(X(se,q[Te]))return!0;return!1}function yt(q,se){for(var X=-1,Te=q==null?0:q.length,je=Array(Te);++X<Te;)je[X]=se(q[X],X,q);return je}function fi(q,se){for(var X=-1,Te=se.length,je=q.length;++X<Te;)q[je+X]=se[X];return q}function _f(q,se,X,Te){var je=-1,Xe=q==null?0:q.length;for(Te&&Xe&&(X=q[++je]);++je<Xe;)X=se(X,q[je],je,q);return X}function E_(q,se,X,Te){var je=q==null?0:q.length;for(Te&&je&&(X=q[--je]);je--;)X=se(X,q[je],je,q);return X}function wf(q,se){for(var X=-1,Te=q==null?0:q.length;++X<Te;)if(se(q[X],X,q))return!0;return!1}var S_=mf("length");function R_(q){return q.split("")}function A_(q){return q.match(lr)||[]}function Bd(q,se,X){var Te;return X(q,function(je,Xe,Nt){if(se(je,Xe,Nt))return Te=Xe,!1}),Te}function la(q,se,X,Te){for(var je=q.length,Xe=X+(Te?1:-1);Te?Xe--:++Xe<je;)if(se(q[Xe],Xe,q))return Xe;return-1}function ho(q,se,X){return se===se?D_(q,se,X):la(q,Ld,X)}function T_(q,se,X,Te){for(var je=X-1,Xe=q.length;++je<Xe;)if(Te(q[je],se))return je;return-1}function Ld(q){return q!==q}function xd(q,se){var X=q==null?0:q.length;return X?Ef(q,se)/X:Y}function mf(q){return function(se){return se==null?r:se[q]}}function vf(q){return function(se){return q==null?r:q[se]}}function Nd(q,se,X,Te,je){return je(q,function(Xe,Nt,ut){X=Te?(Te=!1,Xe):se(X,Xe,Nt,ut)}),X}function I_(q,se){var X=q.length;for(q.sort(se);X--;)q[X]=q[X].value;return q}function Ef(q,se){for(var X,Te=-1,je=q.length;++Te<je;){var Xe=se(q[Te]);Xe!==r&&(X=X===r?Xe:X+Xe)}return X}function Sf(q,se){for(var X=-1,Te=Array(q);++X<q;)Te[X]=se(X);return Te}function O_(q,se){return yt(se,function(X){return[X,q[X]]})}function Md(q){return q&&q.slice(0,Ud(q)+1).replace(vt,"")}function Sn(q){return function(se){return q(se)}}function Rf(q,se){return yt(se,function(X){return q[X]})}function ts(q,se){return q.has(se)}function $d(q,se){for(var X=-1,Te=q.length;++X<Te&&ho(se,q[X],0)>-1;);return X}function Dd(q,se){for(var X=q.length;X--&&ho(se,q[X],0)>-1;);return X}function C_(q,se){for(var X=q.length,Te=0;X--;)q[X]===se&&++Te;return Te}var P_=vf(bf),B_=vf(O);function L_(q){return"\\"+Q[q]}function x_(q,se){return q==null?r:q[se]}function go(q){return ua.test(q)}function N_(q){return gf.test(q)}function M_(q){for(var se,X=[];!(se=q.next()).done;)X.push(se.value);return X}function Af(q){var se=-1,X=Array(q.size);return q.forEach(function(Te,je){X[++se]=[je,Te]}),X}function jd(q,se){return function(X){return q(se(X))}}function ci(q,se){for(var X=-1,Te=q.length,je=0,Xe=[];++X<Te;){var Nt=q[X];(Nt===se||Nt===p)&&(q[X]=p,Xe[je++]=X)}return Xe}function da(q){var se=-1,X=Array(q.size);return q.forEach(function(Te){X[++se]=Te}),X}function $_(q){var se=-1,X=Array(q.size);return q.forEach(function(Te){X[++se]=[Te,Te]}),X}function D_(q,se,X){for(var Te=X-1,je=q.length;++Te<je;)if(q[Te]===se)return Te;return-1}function j_(q,se,X){for(var Te=X+1;Te--;)if(q[Te]===se)return Te;return Te}function po(q){return go(q)?k_(q):S_(q)}function Xn(q){return go(q)?H_(q):R_(q)}function Ud(q){for(var se=q.length;se--&&fr.test(q.charAt(se)););return se}var U_=vf(W);function k_(q){for(var se=Mr.lastIndex=0;Mr.test(q);)++se;return se}function H_(q){return q.match(Mr)||[]}function W_(q){return q.match(hf)||[]}var F_=function q(se){se=se==null?$e:bo.defaults($e.Object(),se,bo.pick($e,fa));var X=se.Array,Te=se.Date,je=se.Error,Xe=se.Function,Nt=se.Math,ut=se.Object,Tf=se.RegExp,q_=se.String,Mn=se.TypeError,ha=X.prototype,V_=Xe.prototype,yo=ut.prototype,ga=se["__core-js_shared__"],pa=V_.toString,nt=yo.hasOwnProperty,z_=0,kd=function(){var n=/[^.]+$/.exec(ga&&ga.keys&&ga.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ba=yo.toString,G_=pa.call(ut),K_=$e._,J_=Tf("^"+pa.call(nt).replace(Se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ya=Gt?se.Buffer:r,li=se.Symbol,_a=se.Uint8Array,Hd=ya?ya.allocUnsafe:r,wa=jd(ut.getPrototypeOf,ut),Wd=ut.create,Fd=yo.propertyIsEnumerable,ma=ha.splice,qd=li?li.isConcatSpreadable:r,ns=li?li.iterator:r,Mi=li?li.toStringTag:r,va=function(){try{var n=ki(ut,"defineProperty");return n({},"",{}),n}catch{}}(),Y_=se.clearTimeout!==$e.clearTimeout&&se.clearTimeout,Z_=Te&&Te.now!==$e.Date.now&&Te.now,X_=se.setTimeout!==$e.setTimeout&&se.setTimeout,Ea=Nt.ceil,Sa=Nt.floor,If=ut.getOwnPropertySymbols,Q_=ya?ya.isBuffer:r,Vd=se.isFinite,ew=ha.join,tw=jd(ut.keys,ut),Mt=Nt.max,Jt=Nt.min,nw=Te.now,rw=se.parseInt,zd=Nt.random,iw=ha.reverse,Of=ki(se,"DataView"),rs=ki(se,"Map"),Cf=ki(se,"Promise"),_o=ki(se,"Set"),is=ki(se,"WeakMap"),os=ki(ut,"create"),Ra=is&&new is,wo={},ow=Hi(Of),sw=Hi(rs),aw=Hi(Cf),uw=Hi(_o),fw=Hi(is),Aa=li?li.prototype:r,ss=Aa?Aa.valueOf:r,Gd=Aa?Aa.toString:r;function y(n){if(Et(n)&&!Ue(n)&&!(n instanceof Ge)){if(n instanceof $n)return n;if(nt.call(n,"__wrapped__"))return Kh(n)}return new $n(n)}var mo=function(){function n(){}return function(i){if(!_t(i))return{};if(Wd)return Wd(i);n.prototype=i;var s=new n;return n.prototype=r,s}}();function Ta(){}function $n(n,i){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=r}y.templateSettings={escape:Yn,evaluate:ur,interpolate:A,variable:"",imports:{_:y}},y.prototype=Ta.prototype,y.prototype.constructor=y,$n.prototype=mo(Ta.prototype),$n.prototype.constructor=$n;function Ge(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function cw(){var n=new Ge(this.__wrapped__);return n.__actions__=gn(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=gn(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=gn(this.__views__),n}function lw(){if(this.__filtered__){var n=new Ge(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function dw(){var n=this.__wrapped__.value(),i=this.__dir__,s=Ue(n),c=i<0,g=s?n.length:0,_=Rm(0,g,this.__views__),x=_.start,U=_.end,V=U-x,ce=c?U:x-1,le=this.__iteratees__,he=le.length,ve=0,Pe=Jt(V,this.__takeCount__);if(!s||!c&&g==V&&Pe==V)return yh(n,this.__actions__);var Ne=[];e:for(;V--&&ve<Pe;){ce+=i;for(var We=-1,Me=n[ce];++We<he;){var Ve=le[We],Je=Ve.iteratee,Tn=Ve.type,fn=Je(Me);if(Tn==K)Me=fn;else if(!fn){if(Tn==D)continue e;break e}}Ne[ve++]=Me}return Ne}Ge.prototype=mo(Ta.prototype),Ge.prototype.constructor=Ge;function $i(n){var i=-1,s=n==null?0:n.length;for(this.clear();++i<s;){var c=n[i];this.set(c[0],c[1])}}function hw(){this.__data__=os?os(null):{},this.size=0}function gw(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}function pw(n){var i=this.__data__;if(os){var s=i[n];return s===h?r:s}return nt.call(i,n)?i[n]:r}function bw(n){var i=this.__data__;return os?i[n]!==r:nt.call(i,n)}function yw(n,i){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=os&&i===r?h:i,this}$i.prototype.clear=hw,$i.prototype.delete=gw,$i.prototype.get=pw,$i.prototype.has=bw,$i.prototype.set=yw;function Dr(n){var i=-1,s=n==null?0:n.length;for(this.clear();++i<s;){var c=n[i];this.set(c[0],c[1])}}function _w(){this.__data__=[],this.size=0}function ww(n){var i=this.__data__,s=Ia(i,n);if(s<0)return!1;var c=i.length-1;return s==c?i.pop():ma.call(i,s,1),--this.size,!0}function mw(n){var i=this.__data__,s=Ia(i,n);return s<0?r:i[s][1]}function vw(n){return Ia(this.__data__,n)>-1}function Ew(n,i){var s=this.__data__,c=Ia(s,n);return c<0?(++this.size,s.push([n,i])):s[c][1]=i,this}Dr.prototype.clear=_w,Dr.prototype.delete=ww,Dr.prototype.get=mw,Dr.prototype.has=vw,Dr.prototype.set=Ew;function jr(n){var i=-1,s=n==null?0:n.length;for(this.clear();++i<s;){var c=n[i];this.set(c[0],c[1])}}function Sw(){this.size=0,this.__data__={hash:new $i,map:new(rs||Dr),string:new $i}}function Rw(n){var i=Ua(this,n).delete(n);return this.size-=i?1:0,i}function Aw(n){return Ua(this,n).get(n)}function Tw(n){return Ua(this,n).has(n)}function Iw(n,i){var s=Ua(this,n),c=s.size;return s.set(n,i),this.size+=s.size==c?0:1,this}jr.prototype.clear=Sw,jr.prototype.delete=Rw,jr.prototype.get=Aw,jr.prototype.has=Tw,jr.prototype.set=Iw;function Di(n){var i=-1,s=n==null?0:n.length;for(this.__data__=new jr;++i<s;)this.add(n[i])}function Ow(n){return this.__data__.set(n,h),this}function Cw(n){return this.__data__.has(n)}Di.prototype.add=Di.prototype.push=Ow,Di.prototype.has=Cw;function Qn(n){var i=this.__data__=new Dr(n);this.size=i.size}function Pw(){this.__data__=new Dr,this.size=0}function Bw(n){var i=this.__data__,s=i.delete(n);return this.size=i.size,s}function Lw(n){return this.__data__.get(n)}function xw(n){return this.__data__.has(n)}function Nw(n,i){var s=this.__data__;if(s instanceof Dr){var c=s.__data__;if(!rs||c.length<a-1)return c.push([n,i]),this.size=++s.size,this;s=this.__data__=new jr(c)}return s.set(n,i),this.size=s.size,this}Qn.prototype.clear=Pw,Qn.prototype.delete=Bw,Qn.prototype.get=Lw,Qn.prototype.has=xw,Qn.prototype.set=Nw;function Kd(n,i){var s=Ue(n),c=!s&&Wi(n),g=!s&&!c&&bi(n),_=!s&&!c&&!g&&Ro(n),x=s||c||g||_,U=x?Sf(n.length,q_):[],V=U.length;for(var ce in n)(i||nt.call(n,ce))&&!(x&&(ce=="length"||g&&(ce=="offset"||ce=="parent")||_&&(ce=="buffer"||ce=="byteLength"||ce=="byteOffset")||Wr(ce,V)))&&U.push(ce);return U}function Jd(n){var i=n.length;return i?n[kf(0,i-1)]:r}function Mw(n,i){return ka(gn(n),ji(i,0,n.length))}function $w(n){return ka(gn(n))}function Pf(n,i,s){(s!==r&&!er(n[i],s)||s===r&&!(i in n))&&Ur(n,i,s)}function as(n,i,s){var c=n[i];(!(nt.call(n,i)&&er(c,s))||s===r&&!(i in n))&&Ur(n,i,s)}function Ia(n,i){for(var s=n.length;s--;)if(er(n[s][0],i))return s;return-1}function Dw(n,i,s,c){return di(n,function(g,_,x){i(c,g,s(g),x)}),c}function Yd(n,i){return n&&yr(i,Ut(i),n)}function jw(n,i){return n&&yr(i,bn(i),n)}function Ur(n,i,s){i=="__proto__"&&va?va(n,i,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[i]=s}function Bf(n,i){for(var s=-1,c=i.length,g=X(c),_=n==null;++s<c;)g[s]=_?r:lc(n,i[s]);return g}function ji(n,i,s){return n===n&&(s!==r&&(n=n<=s?n:s),i!==r&&(n=n>=i?n:i)),n}function Dn(n,i,s,c,g,_){var x,U=i&w,V=i&T,ce=i&v;if(s&&(x=g?s(n,c,g,_):s(n)),x!==r)return x;if(!_t(n))return n;var le=Ue(n);if(le){if(x=Tm(n),!U)return gn(n,x)}else{var he=Yt(n),ve=he==I||he==b;if(bi(n))return mh(n,U);if(he==ie||he==we||ve&&!g){if(x=V||ve?{}:Uh(n),!U)return V?pm(n,jw(x,n)):gm(n,Yd(x,n))}else{if(!tt[he])return g?n:{};x=Im(n,he,U)}}_||(_=new Qn);var Pe=_.get(n);if(Pe)return Pe;_.set(n,x),gg(n)?n.forEach(function(Me){x.add(Dn(Me,i,s,Me,n,_))}):dg(n)&&n.forEach(function(Me,Ve){x.set(Ve,Dn(Me,i,s,Ve,n,_))});var Ne=ce?V?Zf:Yf:V?bn:Ut,We=le?r:Ne(n);return Nn(We||n,function(Me,Ve){We&&(Ve=Me,Me=n[Ve]),as(x,Ve,Dn(Me,i,s,Ve,n,_))}),x}function Uw(n){var i=Ut(n);return function(s){return Zd(s,n,i)}}function Zd(n,i,s){var c=s.length;if(n==null)return!c;for(n=ut(n);c--;){var g=s[c],_=i[g],x=n[g];if(x===r&&!(g in n)||!_(x))return!1}return!0}function Xd(n,i,s){if(typeof n!="function")throw new Mn(f);return gs(function(){n.apply(r,s)},i)}function us(n,i,s,c){var g=-1,_=ca,x=!0,U=n.length,V=[],ce=i.length;if(!U)return V;s&&(i=yt(i,Sn(s))),c?(_=yf,x=!1):i.length>=a&&(_=ts,x=!1,i=new Di(i));e:for(;++g<U;){var le=n[g],he=s==null?le:s(le);if(le=c||le!==0?le:0,x&&he===he){for(var ve=ce;ve--;)if(i[ve]===he)continue e;V.push(le)}else _(i,he,c)||V.push(le)}return V}var di=Ah(br),Qd=Ah(xf,!0);function kw(n,i){var s=!0;return di(n,function(c,g,_){return s=!!i(c,g,_),s}),s}function Oa(n,i,s){for(var c=-1,g=n.length;++c<g;){var _=n[c],x=i(_);if(x!=null&&(U===r?x===x&&!An(x):s(x,U)))var U=x,V=_}return V}function Hw(n,i,s,c){var g=n.length;for(s=He(s),s<0&&(s=-s>g?0:g+s),c=c===r||c>g?g:He(c),c<0&&(c+=g),c=s>c?0:bg(c);s<c;)n[s++]=i;return n}function eh(n,i){var s=[];return di(n,function(c,g,_){i(c,g,_)&&s.push(c)}),s}function Ft(n,i,s,c,g){var _=-1,x=n.length;for(s||(s=Cm),g||(g=[]);++_<x;){var U=n[_];i>0&&s(U)?i>1?Ft(U,i-1,s,c,g):fi(g,U):c||(g[g.length]=U)}return g}var Lf=Th(),th=Th(!0);function br(n,i){return n&&Lf(n,i,Ut)}function xf(n,i){return n&&th(n,i,Ut)}function Ca(n,i){return ui(i,function(s){return Fr(n[s])})}function Ui(n,i){i=gi(i,n);for(var s=0,c=i.length;n!=null&&s<c;)n=n[_r(i[s++])];return s&&s==c?n:r}function nh(n,i,s){var c=i(n);return Ue(n)?c:fi(c,s(n))}function an(n){return n==null?n===r?Rt:re:Mi&&Mi in ut(n)?Sm(n):$m(n)}function Nf(n,i){return n>i}function Ww(n,i){return n!=null&&nt.call(n,i)}function Fw(n,i){return n!=null&&i in ut(n)}function qw(n,i,s){return n>=Jt(i,s)&&n<Mt(i,s)}function Mf(n,i,s){for(var c=s?yf:ca,g=n[0].length,_=n.length,x=_,U=X(_),V=1/0,ce=[];x--;){var le=n[x];x&&i&&(le=yt(le,Sn(i))),V=Jt(le.length,V),U[x]=!s&&(i||g>=120&&le.length>=120)?new Di(x&&le):r}le=n[0];var he=-1,ve=U[0];e:for(;++he<g&&ce.length<V;){var Pe=le[he],Ne=i?i(Pe):Pe;if(Pe=s||Pe!==0?Pe:0,!(ve?ts(ve,Ne):c(ce,Ne,s))){for(x=_;--x;){var We=U[x];if(!(We?ts(We,Ne):c(n[x],Ne,s)))continue e}ve&&ve.push(Ne),ce.push(Pe)}}return ce}function Vw(n,i,s,c){return br(n,function(g,_,x){i(c,s(g),_,x)}),c}function fs(n,i,s){i=gi(i,n),n=Fh(n,i);var c=n==null?n:n[_r(Un(i))];return c==null?r:En(c,n,s)}function rh(n){return Et(n)&&an(n)==we}function zw(n){return Et(n)&&an(n)==it}function Gw(n){return Et(n)&&an(n)==de}function cs(n,i,s,c,g){return n===i?!0:n==null||i==null||!Et(n)&&!Et(i)?n!==n&&i!==i:Kw(n,i,s,c,cs,g)}function Kw(n,i,s,c,g,_){var x=Ue(n),U=Ue(i),V=x?j:Yt(n),ce=U?j:Yt(i);V=V==we?ie:V,ce=ce==we?ie:ce;var le=V==ie,he=ce==ie,ve=V==ce;if(ve&&bi(n)){if(!bi(i))return!1;x=!0,le=!1}if(ve&&!le)return _||(_=new Qn),x||Ro(n)?$h(n,i,s,c,g,_):vm(n,i,V,s,c,g,_);if(!(s&k)){var Pe=le&&nt.call(n,"__wrapped__"),Ne=he&&nt.call(i,"__wrapped__");if(Pe||Ne){var We=Pe?n.value():n,Me=Ne?i.value():i;return _||(_=new Qn),g(We,Me,s,c,_)}}return ve?(_||(_=new Qn),Em(n,i,s,c,g,_)):!1}function Jw(n){return Et(n)&&Yt(n)==E}function $f(n,i,s,c){var g=s.length,_=g,x=!c;if(n==null)return!_;for(n=ut(n);g--;){var U=s[g];if(x&&U[2]?U[1]!==n[U[0]]:!(U[0]in n))return!1}for(;++g<_;){U=s[g];var V=U[0],ce=n[V],le=U[1];if(x&&U[2]){if(ce===r&&!(V in n))return!1}else{var he=new Qn;if(c)var ve=c(ce,le,V,n,i,he);if(!(ve===r?cs(le,ce,k|C,c,he):ve))return!1}}return!0}function ih(n){if(!_t(n)||Bm(n))return!1;var i=Fr(n)?J_:Wt;return i.test(Hi(n))}function Yw(n){return Et(n)&&an(n)==Ce}function Zw(n){return Et(n)&&Yt(n)==ke}function Xw(n){return Et(n)&&za(n.length)&&!!at[an(n)]}function oh(n){return typeof n=="function"?n:n==null?yn:typeof n=="object"?Ue(n)?uh(n[0],n[1]):ah(n):Ig(n)}function Df(n){if(!hs(n))return tw(n);var i=[];for(var s in ut(n))nt.call(n,s)&&s!="constructor"&&i.push(s);return i}function Qw(n){if(!_t(n))return Mm(n);var i=hs(n),s=[];for(var c in n)c=="constructor"&&(i||!nt.call(n,c))||s.push(c);return s}function jf(n,i){return n<i}function sh(n,i){var s=-1,c=pn(n)?X(n.length):[];return di(n,function(g,_,x){c[++s]=i(g,_,x)}),c}function ah(n){var i=Qf(n);return i.length==1&&i[0][2]?Hh(i[0][0],i[0][1]):function(s){return s===n||$f(s,n,i)}}function uh(n,i){return tc(n)&&kh(i)?Hh(_r(n),i):function(s){var c=lc(s,n);return c===r&&c===i?dc(s,n):cs(i,c,k|C)}}function Pa(n,i,s,c,g){n!==i&&Lf(i,function(_,x){if(g||(g=new Qn),_t(_))em(n,i,x,s,Pa,c,g);else{var U=c?c(rc(n,x),_,x+"",n,i,g):r;U===r&&(U=_),Pf(n,x,U)}},bn)}function em(n,i,s,c,g,_,x){var U=rc(n,s),V=rc(i,s),ce=x.get(V);if(ce){Pf(n,s,ce);return}var le=_?_(U,V,s+"",n,i,x):r,he=le===r;if(he){var ve=Ue(V),Pe=!ve&&bi(V),Ne=!ve&&!Pe&&Ro(V);le=V,ve||Pe||Ne?Ue(U)?le=U:At(U)?le=gn(U):Pe?(he=!1,le=mh(V,!0)):Ne?(he=!1,le=vh(V,!0)):le=[]:ps(V)||Wi(V)?(le=U,Wi(U)?le=yg(U):(!_t(U)||Fr(U))&&(le=Uh(V))):he=!1}he&&(x.set(V,le),g(le,V,c,_,x),x.delete(V)),Pf(n,s,le)}function fh(n,i){var s=n.length;if(s)return i+=i<0?s:0,Wr(i,s)?n[i]:r}function ch(n,i,s){i.length?i=yt(i,function(_){return Ue(_)?function(x){return Ui(x,_.length===1?_[0]:_)}:_}):i=[yn];var c=-1;i=yt(i,Sn(xe()));var g=sh(n,function(_,x,U){var V=yt(i,function(ce){return ce(_)});return{criteria:V,index:++c,value:_}});return I_(g,function(_,x){return hm(_,x,s)})}function tm(n,i){return lh(n,i,function(s,c){return dc(n,c)})}function lh(n,i,s){for(var c=-1,g=i.length,_={};++c<g;){var x=i[c],U=Ui(n,x);s(U,x)&&ls(_,gi(x,n),U)}return _}function nm(n){return function(i){return Ui(i,n)}}function Uf(n,i,s,c){var g=c?T_:ho,_=-1,x=i.length,U=n;for(n===i&&(i=gn(i)),s&&(U=yt(n,Sn(s)));++_<x;)for(var V=0,ce=i[_],le=s?s(ce):ce;(V=g(U,le,V,c))>-1;)U!==n&&ma.call(U,V,1),ma.call(n,V,1);return n}function dh(n,i){for(var s=n?i.length:0,c=s-1;s--;){var g=i[s];if(s==c||g!==_){var _=g;Wr(g)?ma.call(n,g,1):Ff(n,g)}}return n}function kf(n,i){return n+Sa(zd()*(i-n+1))}function rm(n,i,s,c){for(var g=-1,_=Mt(Ea((i-n)/(s||1)),0),x=X(_);_--;)x[c?_:++g]=n,n+=s;return x}function Hf(n,i){var s="";if(!n||i<1||i>ue)return s;do i%2&&(s+=n),i=Sa(i/2),i&&(n+=n);while(i);return s}function Fe(n,i){return ic(Wh(n,i,yn),n+"")}function im(n){return Jd(Ao(n))}function om(n,i){var s=Ao(n);return ka(s,ji(i,0,s.length))}function ls(n,i,s,c){if(!_t(n))return n;i=gi(i,n);for(var g=-1,_=i.length,x=_-1,U=n;U!=null&&++g<_;){var V=_r(i[g]),ce=s;if(V==="__proto__"||V==="constructor"||V==="prototype")return n;if(g!=x){var le=U[V];ce=c?c(le,V,U):r,ce===r&&(ce=_t(le)?le:Wr(i[g+1])?[]:{})}as(U,V,ce),U=U[V]}return n}var hh=Ra?function(n,i){return Ra.set(n,i),n}:yn,sm=va?function(n,i){return va(n,"toString",{configurable:!0,enumerable:!1,value:gc(i),writable:!0})}:yn;function am(n){return ka(Ao(n))}function jn(n,i,s){var c=-1,g=n.length;i<0&&(i=-i>g?0:g+i),s=s>g?g:s,s<0&&(s+=g),g=i>s?0:s-i>>>0,i>>>=0;for(var _=X(g);++c<g;)_[c]=n[c+i];return _}function um(n,i){var s;return di(n,function(c,g,_){return s=i(c,g,_),!s}),!!s}function Ba(n,i,s){var c=0,g=n==null?c:n.length;if(typeof i=="number"&&i===i&&g<=te){for(;c<g;){var _=c+g>>>1,x=n[_];x!==null&&!An(x)&&(s?x<=i:x<i)?c=_+1:g=_}return g}return Wf(n,i,yn,s)}function Wf(n,i,s,c){var g=0,_=n==null?0:n.length;if(_===0)return 0;i=s(i);for(var x=i!==i,U=i===null,V=An(i),ce=i===r;g<_;){var le=Sa((g+_)/2),he=s(n[le]),ve=he!==r,Pe=he===null,Ne=he===he,We=An(he);if(x)var Me=c||Ne;else ce?Me=Ne&&(c||ve):U?Me=Ne&&ve&&(c||!Pe):V?Me=Ne&&ve&&!Pe&&(c||!We):Pe||We?Me=!1:Me=c?he<=i:he<i;Me?g=le+1:_=le}return Jt(_,me)}function gh(n,i){for(var s=-1,c=n.length,g=0,_=[];++s<c;){var x=n[s],U=i?i(x):x;if(!s||!er(U,V)){var V=U;_[g++]=x===0?0:x}}return _}function ph(n){return typeof n=="number"?n:An(n)?Y:+n}function Rn(n){if(typeof n=="string")return n;if(Ue(n))return yt(n,Rn)+"";if(An(n))return Gd?Gd.call(n):"";var i=n+"";return i=="0"&&1/n==-J?"-0":i}function hi(n,i,s){var c=-1,g=ca,_=n.length,x=!0,U=[],V=U;if(s)x=!1,g=yf;else if(_>=a){var ce=i?null:wm(n);if(ce)return da(ce);x=!1,g=ts,V=new Di}else V=i?[]:U;e:for(;++c<_;){var le=n[c],he=i?i(le):le;if(le=s||le!==0?le:0,x&&he===he){for(var ve=V.length;ve--;)if(V[ve]===he)continue e;i&&V.push(he),U.push(le)}else g(V,he,s)||(V!==U&&V.push(he),U.push(le))}return U}function Ff(n,i){return i=gi(i,n),n=Fh(n,i),n==null||delete n[_r(Un(i))]}function bh(n,i,s,c){return ls(n,i,s(Ui(n,i)),c)}function La(n,i,s,c){for(var g=n.length,_=c?g:-1;(c?_--:++_<g)&&i(n[_],_,n););return s?jn(n,c?0:_,c?_+1:g):jn(n,c?_+1:0,c?g:_)}function yh(n,i){var s=n;return s instanceof Ge&&(s=s.value()),_f(i,function(c,g){return g.func.apply(g.thisArg,fi([c],g.args))},s)}function qf(n,i,s){var c=n.length;if(c<2)return c?hi(n[0]):[];for(var g=-1,_=X(c);++g<c;)for(var x=n[g],U=-1;++U<c;)U!=g&&(_[g]=us(_[g]||x,n[U],i,s));return hi(Ft(_,1),i,s)}function _h(n,i,s){for(var c=-1,g=n.length,_=i.length,x={};++c<g;){var U=c<_?i[c]:r;s(x,n[c],U)}return x}function Vf(n){return At(n)?n:[]}function zf(n){return typeof n=="function"?n:yn}function gi(n,i){return Ue(n)?n:tc(n,i)?[n]:Gh(et(n))}var fm=Fe;function pi(n,i,s){var c=n.length;return s=s===r?c:s,!i&&s>=c?n:jn(n,i,s)}var wh=Y_||function(n){return $e.clearTimeout(n)};function mh(n,i){if(i)return n.slice();var s=n.length,c=Hd?Hd(s):new n.constructor(s);return n.copy(c),c}function Gf(n){var i=new n.constructor(n.byteLength);return new _a(i).set(new _a(n)),i}function cm(n,i){var s=i?Gf(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}function lm(n){var i=new n.constructor(n.source,Ln.exec(n));return i.lastIndex=n.lastIndex,i}function dm(n){return ss?ut(ss.call(n)):{}}function vh(n,i){var s=i?Gf(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}function Eh(n,i){if(n!==i){var s=n!==r,c=n===null,g=n===n,_=An(n),x=i!==r,U=i===null,V=i===i,ce=An(i);if(!U&&!ce&&!_&&n>i||_&&x&&V&&!U&&!ce||c&&x&&V||!s&&V||!g)return 1;if(!c&&!_&&!ce&&n<i||ce&&s&&g&&!c&&!_||U&&s&&g||!x&&g||!V)return-1}return 0}function hm(n,i,s){for(var c=-1,g=n.criteria,_=i.criteria,x=g.length,U=s.length;++c<x;){var V=Eh(g[c],_[c]);if(V){if(c>=U)return V;var ce=s[c];return V*(ce=="desc"?-1:1)}}return n.index-i.index}function Sh(n,i,s,c){for(var g=-1,_=n.length,x=s.length,U=-1,V=i.length,ce=Mt(_-x,0),le=X(V+ce),he=!c;++U<V;)le[U]=i[U];for(;++g<x;)(he||g<_)&&(le[s[g]]=n[g]);for(;ce--;)le[U++]=n[g++];return le}function Rh(n,i,s,c){for(var g=-1,_=n.length,x=-1,U=s.length,V=-1,ce=i.length,le=Mt(_-U,0),he=X(le+ce),ve=!c;++g<le;)he[g]=n[g];for(var Pe=g;++V<ce;)he[Pe+V]=i[V];for(;++x<U;)(ve||g<_)&&(he[Pe+s[x]]=n[g++]);return he}function gn(n,i){var s=-1,c=n.length;for(i||(i=X(c));++s<c;)i[s]=n[s];return i}function yr(n,i,s,c){var g=!s;s||(s={});for(var _=-1,x=i.length;++_<x;){var U=i[_],V=c?c(s[U],n[U],U,s,n):r;V===r&&(V=n[U]),g?Ur(s,U,V):as(s,U,V)}return s}function gm(n,i){return yr(n,ec(n),i)}function pm(n,i){return yr(n,Dh(n),i)}function xa(n,i){return function(s,c){var g=Ue(s)?m_:Dw,_=i?i():{};return g(s,n,xe(c,2),_)}}function vo(n){return Fe(function(i,s){var c=-1,g=s.length,_=g>1?s[g-1]:r,x=g>2?s[2]:r;for(_=n.length>3&&typeof _=="function"?(g--,_):r,x&&un(s[0],s[1],x)&&(_=g<3?r:_,g=1),i=ut(i);++c<g;){var U=s[c];U&&n(i,U,c,_)}return i})}function Ah(n,i){return function(s,c){if(s==null)return s;if(!pn(s))return n(s,c);for(var g=s.length,_=i?g:-1,x=ut(s);(i?_--:++_<g)&&c(x[_],_,x)!==!1;);return s}}function Th(n){return function(i,s,c){for(var g=-1,_=ut(i),x=c(i),U=x.length;U--;){var V=x[n?U:++g];if(s(_[V],V,_)===!1)break}return i}}function bm(n,i,s){var c=i&P,g=ds(n);function _(){var x=this&&this!==$e&&this instanceof _?g:n;return x.apply(c?s:this,arguments)}return _}function Ih(n){return function(i){i=et(i);var s=go(i)?Xn(i):r,c=s?s[0]:i.charAt(0),g=s?pi(s,1).join(""):i.slice(1);return c[n]()+g}}function Eo(n){return function(i){return _f(Ag(Rg(i).replace(aa,"")),n,"")}}function ds(n){return function(){var i=arguments;switch(i.length){case 0:return new n;case 1:return new n(i[0]);case 2:return new n(i[0],i[1]);case 3:return new n(i[0],i[1],i[2]);case 4:return new n(i[0],i[1],i[2],i[3]);case 5:return new n(i[0],i[1],i[2],i[3],i[4]);case 6:return new n(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new n(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var s=mo(n.prototype),c=n.apply(s,i);return _t(c)?c:s}}function ym(n,i,s){var c=ds(n);function g(){for(var _=arguments.length,x=X(_),U=_,V=So(g);U--;)x[U]=arguments[U];var ce=_<3&&x[0]!==V&&x[_-1]!==V?[]:ci(x,V);if(_-=ce.length,_<s)return Lh(n,i,Na,g.placeholder,r,x,ce,r,r,s-_);var le=this&&this!==$e&&this instanceof g?c:n;return En(le,this,x)}return g}function Oh(n){return function(i,s,c){var g=ut(i);if(!pn(i)){var _=xe(s,3);i=Ut(i),s=function(U){return _(g[U],U,g)}}var x=n(i,s,c);return x>-1?g[_?i[x]:x]:r}}function Ch(n){return Hr(function(i){var s=i.length,c=s,g=$n.prototype.thru;for(n&&i.reverse();c--;){var _=i[c];if(typeof _!="function")throw new Mn(f);if(g&&!x&&ja(_)=="wrapper")var x=new $n([],!0)}for(c=x?c:s;++c<s;){_=i[c];var U=ja(_),V=U=="wrapper"?Xf(_):r;V&&nc(V[0])&&V[1]==(ge|S|H|fe)&&!V[4].length&&V[9]==1?x=x[ja(V[0])].apply(x,V[3]):x=_.length==1&&nc(_)?x[U]():x.thru(_)}return function(){var ce=arguments,le=ce[0];if(x&&ce.length==1&&Ue(le))return x.plant(le).value();for(var he=0,ve=s?i[he].apply(this,ce):le;++he<s;)ve=i[he].call(this,ve);return ve}})}function Na(n,i,s,c,g,_,x,U,V,ce){var le=i&ge,he=i&P,ve=i&$,Pe=i&(S|m),Ne=i&oe,We=ve?r:ds(n);function Me(){for(var Ve=arguments.length,Je=X(Ve),Tn=Ve;Tn--;)Je[Tn]=arguments[Tn];if(Pe)var fn=So(Me),In=C_(Je,fn);if(c&&(Je=Sh(Je,c,g,Pe)),_&&(Je=Rh(Je,_,x,Pe)),Ve-=In,Pe&&Ve<ce){var Tt=ci(Je,fn);return Lh(n,i,Na,Me.placeholder,s,Je,Tt,U,V,ce-Ve)}var tr=he?s:this,Vr=ve?tr[n]:n;return Ve=Je.length,U?Je=Dm(Je,U):Ne&&Ve>1&&Je.reverse(),le&&V<Ve&&(Je.length=V),this&&this!==$e&&this instanceof Me&&(Vr=We||ds(Vr)),Vr.apply(tr,Je)}return Me}function Ph(n,i){return function(s,c){return Vw(s,n,i(c),{})}}function Ma(n,i){return function(s,c){var g;if(s===r&&c===r)return i;if(s!==r&&(g=s),c!==r){if(g===r)return c;typeof s=="string"||typeof c=="string"?(s=Rn(s),c=Rn(c)):(s=ph(s),c=ph(c)),g=n(s,c)}return g}}function Kf(n){return Hr(function(i){return i=yt(i,Sn(xe())),Fe(function(s){var c=this;return n(i,function(g){return En(g,c,s)})})})}function $a(n,i){i=i===r?" ":Rn(i);var s=i.length;if(s<2)return s?Hf(i,n):i;var c=Hf(i,Ea(n/po(i)));return go(i)?pi(Xn(c),0,n).join(""):c.slice(0,n)}function _m(n,i,s,c){var g=i&P,_=ds(n);function x(){for(var U=-1,V=arguments.length,ce=-1,le=c.length,he=X(le+V),ve=this&&this!==$e&&this instanceof x?_:n;++ce<le;)he[ce]=c[ce];for(;V--;)he[ce++]=arguments[++U];return En(ve,g?s:this,he)}return x}function Bh(n){return function(i,s,c){return c&&typeof c!="number"&&un(i,s,c)&&(s=c=r),i=qr(i),s===r?(s=i,i=0):s=qr(s),c=c===r?i<s?1:-1:qr(c),rm(i,s,c,n)}}function Da(n){return function(i,s){return typeof i=="string"&&typeof s=="string"||(i=kn(i),s=kn(s)),n(i,s)}}function Lh(n,i,s,c,g,_,x,U,V,ce){var le=i&S,he=le?x:r,ve=le?r:x,Pe=le?_:r,Ne=le?r:_;i|=le?H:ee,i&=~(le?ee:H),i&L||(i&=~(P|$));var We=[n,i,g,Pe,he,Ne,ve,U,V,ce],Me=s.apply(r,We);return nc(n)&&qh(Me,We),Me.placeholder=c,Vh(Me,n,i)}function Jf(n){var i=Nt[n];return function(s,c){if(s=kn(s),c=c==null?0:Jt(He(c),292),c&&Vd(s)){var g=(et(s)+"e").split("e"),_=i(g[0]+"e"+(+g[1]+c));return g=(et(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-c))}return i(s)}}var wm=_o&&1/da(new _o([,-0]))[1]==J?function(n){return new _o(n)}:yc;function xh(n){return function(i){var s=Yt(i);return s==E?Af(i):s==ke?$_(i):O_(i,n(i))}}function kr(n,i,s,c,g,_,x,U){var V=i&$;if(!V&&typeof n!="function")throw new Mn(f);var ce=c?c.length:0;if(ce||(i&=~(H|ee),c=g=r),x=x===r?x:Mt(He(x),0),U=U===r?U:He(U),ce-=g?g.length:0,i&ee){var le=c,he=g;c=g=r}var ve=V?r:Xf(n),Pe=[n,i,s,c,g,le,he,_,x,U];if(ve&&Nm(Pe,ve),n=Pe[0],i=Pe[1],s=Pe[2],c=Pe[3],g=Pe[4],U=Pe[9]=Pe[9]===r?V?0:n.length:Mt(Pe[9]-ce,0),!U&&i&(S|m)&&(i&=~(S|m)),!i||i==P)var Ne=bm(n,i,s);else i==S||i==m?Ne=ym(n,i,U):(i==H||i==(P|H))&&!g.length?Ne=_m(n,i,s,c):Ne=Na.apply(r,Pe);var We=ve?hh:qh;return Vh(We(Ne,Pe),n,i)}function Nh(n,i,s,c){return n===r||er(n,yo[s])&&!nt.call(c,s)?i:n}function Mh(n,i,s,c,g,_){return _t(n)&&_t(i)&&(_.set(i,n),Pa(n,i,r,Mh,_),_.delete(i)),n}function mm(n){return ps(n)?r:n}function $h(n,i,s,c,g,_){var x=s&k,U=n.length,V=i.length;if(U!=V&&!(x&&V>U))return!1;var ce=_.get(n),le=_.get(i);if(ce&&le)return ce==i&&le==n;var he=-1,ve=!0,Pe=s&C?new Di:r;for(_.set(n,i),_.set(i,n);++he<U;){var Ne=n[he],We=i[he];if(c)var Me=x?c(We,Ne,he,i,n,_):c(Ne,We,he,n,i,_);if(Me!==r){if(Me)continue;ve=!1;break}if(Pe){if(!wf(i,function(Ve,Je){if(!ts(Pe,Je)&&(Ne===Ve||g(Ne,Ve,s,c,_)))return Pe.push(Je)})){ve=!1;break}}else if(!(Ne===We||g(Ne,We,s,c,_))){ve=!1;break}}return _.delete(n),_.delete(i),ve}function vm(n,i,s,c,g,_,x){switch(s){case Ze:if(n.byteLength!=i.byteLength||n.byteOffset!=i.byteOffset)return!1;n=n.buffer,i=i.buffer;case it:return!(n.byteLength!=i.byteLength||!_(new _a(n),new _a(i)));case Z:case de:case z:return er(+n,+i);case R:return n.name==i.name&&n.message==i.message;case Ce:case Ee:return n==i+"";case E:var U=Af;case ke:var V=c&k;if(U||(U=da),n.size!=i.size&&!V)return!1;var ce=x.get(n);if(ce)return ce==i;c|=C,x.set(n,i);var le=$h(U(n),U(i),c,g,_,x);return x.delete(n),le;case qe:if(ss)return ss.call(n)==ss.call(i)}return!1}function Em(n,i,s,c,g,_){var x=s&k,U=Yf(n),V=U.length,ce=Yf(i),le=ce.length;if(V!=le&&!x)return!1;for(var he=V;he--;){var ve=U[he];if(!(x?ve in i:nt.call(i,ve)))return!1}var Pe=_.get(n),Ne=_.get(i);if(Pe&&Ne)return Pe==i&&Ne==n;var We=!0;_.set(n,i),_.set(i,n);for(var Me=x;++he<V;){ve=U[he];var Ve=n[ve],Je=i[ve];if(c)var Tn=x?c(Je,Ve,ve,i,n,_):c(Ve,Je,ve,n,i,_);if(!(Tn===r?Ve===Je||g(Ve,Je,s,c,_):Tn)){We=!1;break}Me||(Me=ve=="constructor")}if(We&&!Me){var fn=n.constructor,In=i.constructor;fn!=In&&"constructor"in n&&"constructor"in i&&!(typeof fn=="function"&&fn instanceof fn&&typeof In=="function"&&In instanceof In)&&(We=!1)}return _.delete(n),_.delete(i),We}function Hr(n){return ic(Wh(n,r,Zh),n+"")}function Yf(n){return nh(n,Ut,ec)}function Zf(n){return nh(n,bn,Dh)}var Xf=Ra?function(n){return Ra.get(n)}:yc;function ja(n){for(var i=n.name+"",s=wo[i],c=nt.call(wo,i)?s.length:0;c--;){var g=s[c],_=g.func;if(_==null||_==n)return g.name}return i}function So(n){var i=nt.call(y,"placeholder")?y:n;return i.placeholder}function xe(){var n=y.iteratee||pc;return n=n===pc?oh:n,arguments.length?n(arguments[0],arguments[1]):n}function Ua(n,i){var s=n.__data__;return Pm(i)?s[typeof i=="string"?"string":"hash"]:s.map}function Qf(n){for(var i=Ut(n),s=i.length;s--;){var c=i[s],g=n[c];i[s]=[c,g,kh(g)]}return i}function ki(n,i){var s=x_(n,i);return ih(s)?s:r}function Sm(n){var i=nt.call(n,Mi),s=n[Mi];try{n[Mi]=r;var c=!0}catch{}var g=ba.call(n);return c&&(i?n[Mi]=s:delete n[Mi]),g}var ec=If?function(n){return n==null?[]:(n=ut(n),ui(If(n),function(i){return Fd.call(n,i)}))}:_c,Dh=If?function(n){for(var i=[];n;)fi(i,ec(n)),n=wa(n);return i}:_c,Yt=an;(Of&&Yt(new Of(new ArrayBuffer(1)))!=Ze||rs&&Yt(new rs)!=E||Cf&&Yt(Cf.resolve())!=Oe||_o&&Yt(new _o)!=ke||is&&Yt(new is)!=ct)&&(Yt=function(n){var i=an(n),s=i==ie?n.constructor:r,c=s?Hi(s):"";if(c)switch(c){case ow:return Ze;case sw:return E;case aw:return Oe;case uw:return ke;case fw:return ct}return i});function Rm(n,i,s){for(var c=-1,g=s.length;++c<g;){var _=s[c],x=_.size;switch(_.type){case"drop":n+=x;break;case"dropRight":i-=x;break;case"take":i=Jt(i,n+x);break;case"takeRight":n=Mt(n,i-x);break}}return{start:n,end:i}}function Am(n){var i=n.match(cr);return i?i[1].split(Lr):[]}function jh(n,i,s){i=gi(i,n);for(var c=-1,g=i.length,_=!1;++c<g;){var x=_r(i[c]);if(!(_=n!=null&&s(n,x)))break;n=n[x]}return _||++c!=g?_:(g=n==null?0:n.length,!!g&&za(g)&&Wr(x,g)&&(Ue(n)||Wi(n)))}function Tm(n){var i=n.length,s=new n.constructor(i);return i&&typeof n[0]=="string"&&nt.call(n,"index")&&(s.index=n.index,s.input=n.input),s}function Uh(n){return typeof n.constructor=="function"&&!hs(n)?mo(wa(n)):{}}function Im(n,i,s){var c=n.constructor;switch(i){case it:return Gf(n);case Z:case de:return new c(+n);case Ze:return cm(n,s);case jt:case Pt:case st:case Lt:case dn:case nn:case Ht:case hn:case Kn:return vh(n,s);case E:return new c;case z:case Ee:return new c(n);case Ce:return lm(n);case ke:return new c;case qe:return dm(n)}}function Om(n,i){var s=i.length;if(!s)return n;var c=s-1;return i[c]=(s>1?"& ":"")+i[c],i=i.join(s>2?", ":" "),n.replace(Bt,`{
|
|
11
|
-
/* [wrapped with `+i+`] */
|
|
12
|
-
`)}function Cm(n){return Ue(n)||Wi(n)||!!(qd&&n&&n[qd])}function Wr(n,i){var s=typeof n;return i=i??ue,!!i&&(s=="number"||s!="symbol"&&Bi.test(n))&&n>-1&&n%1==0&&n<i}function un(n,i,s){if(!_t(s))return!1;var c=typeof i;return(c=="number"?pn(s)&&Wr(i,s.length):c=="string"&&i in s)?er(s[i],n):!1}function tc(n,i){if(Ue(n))return!1;var s=typeof n;return s=="number"||s=="symbol"||s=="boolean"||n==null||An(n)?!0:pe.test(n)||!B.test(n)||i!=null&&n in ut(i)}function Pm(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}function nc(n){var i=ja(n),s=y[i];if(typeof s!="function"||!(i in Ge.prototype))return!1;if(n===s)return!0;var c=Xf(s);return!!c&&n===c[0]}function Bm(n){return!!kd&&kd in n}var Lm=ga?Fr:wc;function hs(n){var i=n&&n.constructor,s=typeof i=="function"&&i.prototype||yo;return n===s}function kh(n){return n===n&&!_t(n)}function Hh(n,i){return function(s){return s==null?!1:s[n]===i&&(i!==r||n in ut(s))}}function xm(n){var i=qa(n,function(c){return s.size===d&&s.clear(),c}),s=i.cache;return i}function Nm(n,i){var s=n[1],c=i[1],g=s|c,_=g<(P|$|ge),x=c==ge&&s==S||c==ge&&s==fe&&n[7].length<=i[8]||c==(ge|fe)&&i[7].length<=i[8]&&s==S;if(!(_||x))return n;c&P&&(n[2]=i[2],g|=s&P?0:L);var U=i[3];if(U){var V=n[3];n[3]=V?Sh(V,U,i[4]):U,n[4]=V?ci(n[3],p):i[4]}return U=i[5],U&&(V=n[5],n[5]=V?Rh(V,U,i[6]):U,n[6]=V?ci(n[5],p):i[6]),U=i[7],U&&(n[7]=U),c&ge&&(n[8]=n[8]==null?i[8]:Jt(n[8],i[8])),n[9]==null&&(n[9]=i[9]),n[0]=i[0],n[1]=g,n}function Mm(n){var i=[];if(n!=null)for(var s in ut(n))i.push(s);return i}function $m(n){return ba.call(n)}function Wh(n,i,s){return i=Mt(i===r?n.length-1:i,0),function(){for(var c=arguments,g=-1,_=Mt(c.length-i,0),x=X(_);++g<_;)x[g]=c[i+g];g=-1;for(var U=X(i+1);++g<i;)U[g]=c[g];return U[i]=s(x),En(n,this,U)}}function Fh(n,i){return i.length<2?n:Ui(n,jn(i,0,-1))}function Dm(n,i){for(var s=n.length,c=Jt(i.length,s),g=gn(n);c--;){var _=i[c];n[c]=Wr(_,s)?g[_]:r}return n}function rc(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}var qh=zh(hh),gs=X_||function(n,i){return $e.setTimeout(n,i)},ic=zh(sm);function Vh(n,i,s){var c=i+"";return ic(n,Om(c,jm(Am(c),s)))}function zh(n){var i=0,s=0;return function(){var c=nw(),g=N-(c-s);if(s=c,g>0){if(++i>=M)return arguments[0]}else i=0;return n.apply(r,arguments)}}function ka(n,i){var s=-1,c=n.length,g=c-1;for(i=i===r?c:i;++s<i;){var _=kf(s,g),x=n[_];n[_]=n[s],n[s]=x}return n.length=i,n}var Gh=xm(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(_e,function(s,c,g,_){i.push(g?_.replace(Zn,"$1"):c||s)}),i});function _r(n){if(typeof n=="string"||An(n))return n;var i=n+"";return i=="0"&&1/n==-J?"-0":i}function Hi(n){if(n!=null){try{return pa.call(n)}catch{}try{return n+""}catch{}}return""}function jm(n,i){return Nn(ye,function(s){var c="_."+s[0];i&s[1]&&!ca(n,c)&&n.push(c)}),n.sort()}function Kh(n){if(n instanceof Ge)return n.clone();var i=new $n(n.__wrapped__,n.__chain__);return i.__actions__=gn(n.__actions__),i.__index__=n.__index__,i.__values__=n.__values__,i}function Um(n,i,s){(s?un(n,i,s):i===r)?i=1:i=Mt(He(i),0);var c=n==null?0:n.length;if(!c||i<1)return[];for(var g=0,_=0,x=X(Ea(c/i));g<c;)x[_++]=jn(n,g,g+=i);return x}function km(n){for(var i=-1,s=n==null?0:n.length,c=0,g=[];++i<s;){var _=n[i];_&&(g[c++]=_)}return g}function Hm(){var n=arguments.length;if(!n)return[];for(var i=X(n-1),s=arguments[0],c=n;c--;)i[c-1]=arguments[c];return fi(Ue(s)?gn(s):[s],Ft(i,1))}var Wm=Fe(function(n,i){return At(n)?us(n,Ft(i,1,At,!0)):[]}),Fm=Fe(function(n,i){var s=Un(i);return At(s)&&(s=r),At(n)?us(n,Ft(i,1,At,!0),xe(s,2)):[]}),qm=Fe(function(n,i){var s=Un(i);return At(s)&&(s=r),At(n)?us(n,Ft(i,1,At,!0),r,s):[]});function Vm(n,i,s){var c=n==null?0:n.length;return c?(i=s||i===r?1:He(i),jn(n,i<0?0:i,c)):[]}function zm(n,i,s){var c=n==null?0:n.length;return c?(i=s||i===r?1:He(i),i=c-i,jn(n,0,i<0?0:i)):[]}function Gm(n,i){return n&&n.length?La(n,xe(i,3),!0,!0):[]}function Km(n,i){return n&&n.length?La(n,xe(i,3),!0):[]}function Jm(n,i,s,c){var g=n==null?0:n.length;return g?(s&&typeof s!="number"&&un(n,i,s)&&(s=0,c=g),Hw(n,i,s,c)):[]}function Jh(n,i,s){var c=n==null?0:n.length;if(!c)return-1;var g=s==null?0:He(s);return g<0&&(g=Mt(c+g,0)),la(n,xe(i,3),g)}function Yh(n,i,s){var c=n==null?0:n.length;if(!c)return-1;var g=c-1;return s!==r&&(g=He(s),g=s<0?Mt(c+g,0):Jt(g,c-1)),la(n,xe(i,3),g,!0)}function Zh(n){var i=n==null?0:n.length;return i?Ft(n,1):[]}function Ym(n){var i=n==null?0:n.length;return i?Ft(n,J):[]}function Zm(n,i){var s=n==null?0:n.length;return s?(i=i===r?1:He(i),Ft(n,i)):[]}function Xm(n){for(var i=-1,s=n==null?0:n.length,c={};++i<s;){var g=n[i];c[g[0]]=g[1]}return c}function Xh(n){return n&&n.length?n[0]:r}function Qm(n,i,s){var c=n==null?0:n.length;if(!c)return-1;var g=s==null?0:He(s);return g<0&&(g=Mt(c+g,0)),ho(n,i,g)}function ev(n){var i=n==null?0:n.length;return i?jn(n,0,-1):[]}var tv=Fe(function(n){var i=yt(n,Vf);return i.length&&i[0]===n[0]?Mf(i):[]}),nv=Fe(function(n){var i=Un(n),s=yt(n,Vf);return i===Un(s)?i=r:s.pop(),s.length&&s[0]===n[0]?Mf(s,xe(i,2)):[]}),rv=Fe(function(n){var i=Un(n),s=yt(n,Vf);return i=typeof i=="function"?i:r,i&&s.pop(),s.length&&s[0]===n[0]?Mf(s,r,i):[]});function iv(n,i){return n==null?"":ew.call(n,i)}function Un(n){var i=n==null?0:n.length;return i?n[i-1]:r}function ov(n,i,s){var c=n==null?0:n.length;if(!c)return-1;var g=c;return s!==r&&(g=He(s),g=g<0?Mt(c+g,0):Jt(g,c-1)),i===i?j_(n,i,g):la(n,Ld,g,!0)}function sv(n,i){return n&&n.length?fh(n,He(i)):r}var av=Fe(Qh);function Qh(n,i){return n&&n.length&&i&&i.length?Uf(n,i):n}function uv(n,i,s){return n&&n.length&&i&&i.length?Uf(n,i,xe(s,2)):n}function fv(n,i,s){return n&&n.length&&i&&i.length?Uf(n,i,r,s):n}var cv=Hr(function(n,i){var s=n==null?0:n.length,c=Bf(n,i);return dh(n,yt(i,function(g){return Wr(g,s)?+g:g}).sort(Eh)),c});function lv(n,i){var s=[];if(!(n&&n.length))return s;var c=-1,g=[],_=n.length;for(i=xe(i,3);++c<_;){var x=n[c];i(x,c,n)&&(s.push(x),g.push(c))}return dh(n,g),s}function oc(n){return n==null?n:iw.call(n)}function dv(n,i,s){var c=n==null?0:n.length;return c?(s&&typeof s!="number"&&un(n,i,s)?(i=0,s=c):(i=i==null?0:He(i),s=s===r?c:He(s)),jn(n,i,s)):[]}function hv(n,i){return Ba(n,i)}function gv(n,i,s){return Wf(n,i,xe(s,2))}function pv(n,i){var s=n==null?0:n.length;if(s){var c=Ba(n,i);if(c<s&&er(n[c],i))return c}return-1}function bv(n,i){return Ba(n,i,!0)}function yv(n,i,s){return Wf(n,i,xe(s,2),!0)}function _v(n,i){var s=n==null?0:n.length;if(s){var c=Ba(n,i,!0)-1;if(er(n[c],i))return c}return-1}function wv(n){return n&&n.length?gh(n):[]}function mv(n,i){return n&&n.length?gh(n,xe(i,2)):[]}function vv(n){var i=n==null?0:n.length;return i?jn(n,1,i):[]}function Ev(n,i,s){return n&&n.length?(i=s||i===r?1:He(i),jn(n,0,i<0?0:i)):[]}function Sv(n,i,s){var c=n==null?0:n.length;return c?(i=s||i===r?1:He(i),i=c-i,jn(n,i<0?0:i,c)):[]}function Rv(n,i){return n&&n.length?La(n,xe(i,3),!1,!0):[]}function Av(n,i){return n&&n.length?La(n,xe(i,3)):[]}var Tv=Fe(function(n){return hi(Ft(n,1,At,!0))}),Iv=Fe(function(n){var i=Un(n);return At(i)&&(i=r),hi(Ft(n,1,At,!0),xe(i,2))}),Ov=Fe(function(n){var i=Un(n);return i=typeof i=="function"?i:r,hi(Ft(n,1,At,!0),r,i)});function Cv(n){return n&&n.length?hi(n):[]}function Pv(n,i){return n&&n.length?hi(n,xe(i,2)):[]}function Bv(n,i){return i=typeof i=="function"?i:r,n&&n.length?hi(n,r,i):[]}function sc(n){if(!(n&&n.length))return[];var i=0;return n=ui(n,function(s){if(At(s))return i=Mt(s.length,i),!0}),Sf(i,function(s){return yt(n,mf(s))})}function eg(n,i){if(!(n&&n.length))return[];var s=sc(n);return i==null?s:yt(s,function(c){return En(i,r,c)})}var Lv=Fe(function(n,i){return At(n)?us(n,i):[]}),xv=Fe(function(n){return qf(ui(n,At))}),Nv=Fe(function(n){var i=Un(n);return At(i)&&(i=r),qf(ui(n,At),xe(i,2))}),Mv=Fe(function(n){var i=Un(n);return i=typeof i=="function"?i:r,qf(ui(n,At),r,i)}),$v=Fe(sc);function Dv(n,i){return _h(n||[],i||[],as)}function jv(n,i){return _h(n||[],i||[],ls)}var Uv=Fe(function(n){var i=n.length,s=i>1?n[i-1]:r;return s=typeof s=="function"?(n.pop(),s):r,eg(n,s)});function tg(n){var i=y(n);return i.__chain__=!0,i}function kv(n,i){return i(n),n}function Ha(n,i){return i(n)}var Hv=Hr(function(n){var i=n.length,s=i?n[0]:0,c=this.__wrapped__,g=function(_){return Bf(_,n)};return i>1||this.__actions__.length||!(c instanceof Ge)||!Wr(s)?this.thru(g):(c=c.slice(s,+s+(i?1:0)),c.__actions__.push({func:Ha,args:[g],thisArg:r}),new $n(c,this.__chain__).thru(function(_){return i&&!_.length&&_.push(r),_}))});function Wv(){return tg(this)}function Fv(){return new $n(this.value(),this.__chain__)}function qv(){this.__values__===r&&(this.__values__=pg(this.value()));var n=this.__index__>=this.__values__.length,i=n?r:this.__values__[this.__index__++];return{done:n,value:i}}function Vv(){return this}function zv(n){for(var i,s=this;s instanceof Ta;){var c=Kh(s);c.__index__=0,c.__values__=r,i?g.__wrapped__=c:i=c;var g=c;s=s.__wrapped__}return g.__wrapped__=n,i}function Gv(){var n=this.__wrapped__;if(n instanceof Ge){var i=n;return this.__actions__.length&&(i=new Ge(this)),i=i.reverse(),i.__actions__.push({func:Ha,args:[oc],thisArg:r}),new $n(i,this.__chain__)}return this.thru(oc)}function Kv(){return yh(this.__wrapped__,this.__actions__)}var Jv=xa(function(n,i,s){nt.call(n,s)?++n[s]:Ur(n,s,1)});function Yv(n,i,s){var c=Ue(n)?Pd:kw;return s&&un(n,i,s)&&(i=r),c(n,xe(i,3))}function Zv(n,i){var s=Ue(n)?ui:eh;return s(n,xe(i,3))}var Xv=Oh(Jh),Qv=Oh(Yh);function eE(n,i){return Ft(Wa(n,i),1)}function tE(n,i){return Ft(Wa(n,i),J)}function nE(n,i,s){return s=s===r?1:He(s),Ft(Wa(n,i),s)}function ng(n,i){var s=Ue(n)?Nn:di;return s(n,xe(i,3))}function rg(n,i){var s=Ue(n)?v_:Qd;return s(n,xe(i,3))}var rE=xa(function(n,i,s){nt.call(n,s)?n[s].push(i):Ur(n,s,[i])});function iE(n,i,s,c){n=pn(n)?n:Ao(n),s=s&&!c?He(s):0;var g=n.length;return s<0&&(s=Mt(g+s,0)),Ga(n)?s<=g&&n.indexOf(i,s)>-1:!!g&&ho(n,i,s)>-1}var oE=Fe(function(n,i,s){var c=-1,g=typeof i=="function",_=pn(n)?X(n.length):[];return di(n,function(x){_[++c]=g?En(i,x,s):fs(x,i,s)}),_}),sE=xa(function(n,i,s){Ur(n,s,i)});function Wa(n,i){var s=Ue(n)?yt:sh;return s(n,xe(i,3))}function aE(n,i,s,c){return n==null?[]:(Ue(i)||(i=i==null?[]:[i]),s=c?r:s,Ue(s)||(s=s==null?[]:[s]),ch(n,i,s))}var uE=xa(function(n,i,s){n[s?0:1].push(i)},function(){return[[],[]]});function fE(n,i,s){var c=Ue(n)?_f:Nd,g=arguments.length<3;return c(n,xe(i,4),s,g,di)}function cE(n,i,s){var c=Ue(n)?E_:Nd,g=arguments.length<3;return c(n,xe(i,4),s,g,Qd)}function lE(n,i){var s=Ue(n)?ui:eh;return s(n,Va(xe(i,3)))}function dE(n){var i=Ue(n)?Jd:im;return i(n)}function hE(n,i,s){(s?un(n,i,s):i===r)?i=1:i=He(i);var c=Ue(n)?Mw:om;return c(n,i)}function gE(n){var i=Ue(n)?$w:am;return i(n)}function pE(n){if(n==null)return 0;if(pn(n))return Ga(n)?po(n):n.length;var i=Yt(n);return i==E||i==ke?n.size:Df(n).length}function bE(n,i,s){var c=Ue(n)?wf:um;return s&&un(n,i,s)&&(i=r),c(n,xe(i,3))}var yE=Fe(function(n,i){if(n==null)return[];var s=i.length;return s>1&&un(n,i[0],i[1])?i=[]:s>2&&un(i[0],i[1],i[2])&&(i=[i[0]]),ch(n,Ft(i,1),[])}),Fa=Z_||function(){return $e.Date.now()};function _E(n,i){if(typeof i!="function")throw new Mn(f);return n=He(n),function(){if(--n<1)return i.apply(this,arguments)}}function ig(n,i,s){return i=s?r:i,i=n&&i==null?n.length:i,kr(n,ge,r,r,r,r,i)}function og(n,i){var s;if(typeof i!="function")throw new Mn(f);return n=He(n),function(){return--n>0&&(s=i.apply(this,arguments)),n<=1&&(i=r),s}}var ac=Fe(function(n,i,s){var c=P;if(s.length){var g=ci(s,So(ac));c|=H}return kr(n,c,i,s,g)}),sg=Fe(function(n,i,s){var c=P|$;if(s.length){var g=ci(s,So(sg));c|=H}return kr(i,c,n,s,g)});function ag(n,i,s){i=s?r:i;var c=kr(n,S,r,r,r,r,r,i);return c.placeholder=ag.placeholder,c}function ug(n,i,s){i=s?r:i;var c=kr(n,m,r,r,r,r,r,i);return c.placeholder=ug.placeholder,c}function fg(n,i,s){var c,g,_,x,U,V,ce=0,le=!1,he=!1,ve=!0;if(typeof n!="function")throw new Mn(f);i=kn(i)||0,_t(s)&&(le=!!s.leading,he="maxWait"in s,_=he?Mt(kn(s.maxWait)||0,i):_,ve="trailing"in s?!!s.trailing:ve);function Pe(Tt){var tr=c,Vr=g;return c=g=r,ce=Tt,x=n.apply(Vr,tr),x}function Ne(Tt){return ce=Tt,U=gs(Ve,i),le?Pe(Tt):x}function We(Tt){var tr=Tt-V,Vr=Tt-ce,Og=i-tr;return he?Jt(Og,_-Vr):Og}function Me(Tt){var tr=Tt-V,Vr=Tt-ce;return V===r||tr>=i||tr<0||he&&Vr>=_}function Ve(){var Tt=Fa();if(Me(Tt))return Je(Tt);U=gs(Ve,We(Tt))}function Je(Tt){return U=r,ve&&c?Pe(Tt):(c=g=r,x)}function Tn(){U!==r&&wh(U),ce=0,c=V=g=U=r}function fn(){return U===r?x:Je(Fa())}function In(){var Tt=Fa(),tr=Me(Tt);if(c=arguments,g=this,V=Tt,tr){if(U===r)return Ne(V);if(he)return wh(U),U=gs(Ve,i),Pe(V)}return U===r&&(U=gs(Ve,i)),x}return In.cancel=Tn,In.flush=fn,In}var wE=Fe(function(n,i){return Xd(n,1,i)}),mE=Fe(function(n,i,s){return Xd(n,kn(i)||0,s)});function vE(n){return kr(n,oe)}function qa(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new Mn(f);var s=function(){var c=arguments,g=i?i.apply(this,c):c[0],_=s.cache;if(_.has(g))return _.get(g);var x=n.apply(this,c);return s.cache=_.set(g,x)||_,x};return s.cache=new(qa.Cache||jr),s}qa.Cache=jr;function Va(n){if(typeof n!="function")throw new Mn(f);return function(){var i=arguments;switch(i.length){case 0:return!n.call(this);case 1:return!n.call(this,i[0]);case 2:return!n.call(this,i[0],i[1]);case 3:return!n.call(this,i[0],i[1],i[2])}return!n.apply(this,i)}}function EE(n){return og(2,n)}var SE=fm(function(n,i){i=i.length==1&&Ue(i[0])?yt(i[0],Sn(xe())):yt(Ft(i,1),Sn(xe()));var s=i.length;return Fe(function(c){for(var g=-1,_=Jt(c.length,s);++g<_;)c[g]=i[g].call(this,c[g]);return En(n,this,c)})}),uc=Fe(function(n,i){var s=ci(i,So(uc));return kr(n,H,r,i,s)}),cg=Fe(function(n,i){var s=ci(i,So(cg));return kr(n,ee,r,i,s)}),RE=Hr(function(n,i){return kr(n,fe,r,r,r,i)});function AE(n,i){if(typeof n!="function")throw new Mn(f);return i=i===r?i:He(i),Fe(n,i)}function TE(n,i){if(typeof n!="function")throw new Mn(f);return i=i==null?0:Mt(He(i),0),Fe(function(s){var c=s[i],g=pi(s,0,i);return c&&fi(g,c),En(n,this,g)})}function IE(n,i,s){var c=!0,g=!0;if(typeof n!="function")throw new Mn(f);return _t(s)&&(c="leading"in s?!!s.leading:c,g="trailing"in s?!!s.trailing:g),fg(n,i,{leading:c,maxWait:i,trailing:g})}function OE(n){return ig(n,1)}function CE(n,i){return uc(zf(i),n)}function PE(){if(!arguments.length)return[];var n=arguments[0];return Ue(n)?n:[n]}function BE(n){return Dn(n,v)}function LE(n,i){return i=typeof i=="function"?i:r,Dn(n,v,i)}function xE(n){return Dn(n,w|v)}function NE(n,i){return i=typeof i=="function"?i:r,Dn(n,w|v,i)}function ME(n,i){return i==null||Zd(n,i,Ut(i))}function er(n,i){return n===i||n!==n&&i!==i}var $E=Da(Nf),DE=Da(function(n,i){return n>=i}),Wi=rh(function(){return arguments}())?rh:function(n){return Et(n)&&nt.call(n,"callee")&&!Fd.call(n,"callee")},Ue=X.isArray,jE=lo?Sn(lo):zw;function pn(n){return n!=null&&za(n.length)&&!Fr(n)}function At(n){return Et(n)&&pn(n)}function UE(n){return n===!0||n===!1||Et(n)&&an(n)==Z}var bi=Q_||wc,kE=es?Sn(es):Gw;function HE(n){return Et(n)&&n.nodeType===1&&!ps(n)}function WE(n){if(n==null)return!0;if(pn(n)&&(Ue(n)||typeof n=="string"||typeof n.splice=="function"||bi(n)||Ro(n)||Wi(n)))return!n.length;var i=Yt(n);if(i==E||i==ke)return!n.size;if(hs(n))return!Df(n).length;for(var s in n)if(nt.call(n,s))return!1;return!0}function FE(n,i){return cs(n,i)}function qE(n,i,s){s=typeof s=="function"?s:r;var c=s?s(n,i):r;return c===r?cs(n,i,r,s):!!c}function fc(n){if(!Et(n))return!1;var i=an(n);return i==R||i==Re||typeof n.message=="string"&&typeof n.name=="string"&&!ps(n)}function VE(n){return typeof n=="number"&&Vd(n)}function Fr(n){if(!_t(n))return!1;var i=an(n);return i==I||i==b||i==F||i==Le}function lg(n){return typeof n=="number"&&n==He(n)}function za(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ue}function _t(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}function Et(n){return n!=null&&typeof n=="object"}var dg=Td?Sn(Td):Jw;function zE(n,i){return n===i||$f(n,i,Qf(i))}function GE(n,i,s){return s=typeof s=="function"?s:r,$f(n,i,Qf(i),s)}function KE(n){return hg(n)&&n!=+n}function JE(n){if(Lm(n))throw new je(u);return ih(n)}function YE(n){return n===null}function ZE(n){return n==null}function hg(n){return typeof n=="number"||Et(n)&&an(n)==z}function ps(n){if(!Et(n)||an(n)!=ie)return!1;var i=wa(n);if(i===null)return!0;var s=nt.call(i,"constructor")&&i.constructor;return typeof s=="function"&&s instanceof s&&pa.call(s)==G_}var cc=Id?Sn(Id):Yw;function XE(n){return lg(n)&&n>=-ue&&n<=ue}var gg=Od?Sn(Od):Zw;function Ga(n){return typeof n=="string"||!Ue(n)&&Et(n)&&an(n)==Ee}function An(n){return typeof n=="symbol"||Et(n)&&an(n)==qe}var Ro=Cd?Sn(Cd):Xw;function QE(n){return n===r}function eS(n){return Et(n)&&Yt(n)==ct}function tS(n){return Et(n)&&an(n)==Dt}var nS=Da(jf),rS=Da(function(n,i){return n<=i});function pg(n){if(!n)return[];if(pn(n))return Ga(n)?Xn(n):gn(n);if(ns&&n[ns])return M_(n[ns]());var i=Yt(n),s=i==E?Af:i==ke?da:Ao;return s(n)}function qr(n){if(!n)return n===0?n:0;if(n=kn(n),n===J||n===-J){var i=n<0?-1:1;return i*G}return n===n?n:0}function He(n){var i=qr(n),s=i%1;return i===i?s?i-s:i:0}function bg(n){return n?ji(He(n),0,ae):0}function kn(n){if(typeof n=="number")return n;if(An(n))return Y;if(_t(n)){var i=typeof n.valueOf=="function"?n.valueOf():n;n=_t(i)?i+"":i}if(typeof n!="string")return n===0?n:+n;n=Md(n);var s=sn.test(n);return s||Pi.test(n)?ze(n.slice(2),s?2:8):vn.test(n)?Y:+n}function yg(n){return yr(n,bn(n))}function iS(n){return n?ji(He(n),-ue,ue):n===0?n:0}function et(n){return n==null?"":Rn(n)}var oS=vo(function(n,i){if(hs(i)||pn(i)){yr(i,Ut(i),n);return}for(var s in i)nt.call(i,s)&&as(n,s,i[s])}),_g=vo(function(n,i){yr(i,bn(i),n)}),Ka=vo(function(n,i,s,c){yr(i,bn(i),n,c)}),sS=vo(function(n,i,s,c){yr(i,Ut(i),n,c)}),aS=Hr(Bf);function uS(n,i){var s=mo(n);return i==null?s:Yd(s,i)}var fS=Fe(function(n,i){n=ut(n);var s=-1,c=i.length,g=c>2?i[2]:r;for(g&&un(i[0],i[1],g)&&(c=1);++s<c;)for(var _=i[s],x=bn(_),U=-1,V=x.length;++U<V;){var ce=x[U],le=n[ce];(le===r||er(le,yo[ce])&&!nt.call(n,ce))&&(n[ce]=_[ce])}return n}),cS=Fe(function(n){return n.push(r,Mh),En(wg,r,n)});function lS(n,i){return Bd(n,xe(i,3),br)}function dS(n,i){return Bd(n,xe(i,3),xf)}function hS(n,i){return n==null?n:Lf(n,xe(i,3),bn)}function gS(n,i){return n==null?n:th(n,xe(i,3),bn)}function pS(n,i){return n&&br(n,xe(i,3))}function bS(n,i){return n&&xf(n,xe(i,3))}function yS(n){return n==null?[]:Ca(n,Ut(n))}function _S(n){return n==null?[]:Ca(n,bn(n))}function lc(n,i,s){var c=n==null?r:Ui(n,i);return c===r?s:c}function wS(n,i){return n!=null&&jh(n,i,Ww)}function dc(n,i){return n!=null&&jh(n,i,Fw)}var mS=Ph(function(n,i,s){i!=null&&typeof i.toString!="function"&&(i=ba.call(i)),n[i]=s},gc(yn)),vS=Ph(function(n,i,s){i!=null&&typeof i.toString!="function"&&(i=ba.call(i)),nt.call(n,i)?n[i].push(s):n[i]=[s]},xe),ES=Fe(fs);function Ut(n){return pn(n)?Kd(n):Df(n)}function bn(n){return pn(n)?Kd(n,!0):Qw(n)}function SS(n,i){var s={};return i=xe(i,3),br(n,function(c,g,_){Ur(s,i(c,g,_),c)}),s}function RS(n,i){var s={};return i=xe(i,3),br(n,function(c,g,_){Ur(s,g,i(c,g,_))}),s}var AS=vo(function(n,i,s){Pa(n,i,s)}),wg=vo(function(n,i,s,c){Pa(n,i,s,c)}),TS=Hr(function(n,i){var s={};if(n==null)return s;var c=!1;i=yt(i,function(_){return _=gi(_,n),c||(c=_.length>1),_}),yr(n,Zf(n),s),c&&(s=Dn(s,w|T|v,mm));for(var g=i.length;g--;)Ff(s,i[g]);return s});function IS(n,i){return mg(n,Va(xe(i)))}var OS=Hr(function(n,i){return n==null?{}:tm(n,i)});function mg(n,i){if(n==null)return{};var s=yt(Zf(n),function(c){return[c]});return i=xe(i),lh(n,s,function(c,g){return i(c,g[0])})}function CS(n,i,s){i=gi(i,n);var c=-1,g=i.length;for(g||(g=1,n=r);++c<g;){var _=n==null?r:n[_r(i[c])];_===r&&(c=g,_=s),n=Fr(_)?_.call(n):_}return n}function PS(n,i,s){return n==null?n:ls(n,i,s)}function BS(n,i,s,c){return c=typeof c=="function"?c:r,n==null?n:ls(n,i,s,c)}var vg=xh(Ut),Eg=xh(bn);function LS(n,i,s){var c=Ue(n),g=c||bi(n)||Ro(n);if(i=xe(i,4),s==null){var _=n&&n.constructor;g?s=c?new _:[]:_t(n)?s=Fr(_)?mo(wa(n)):{}:s={}}return(g?Nn:br)(n,function(x,U,V){return i(s,x,U,V)}),s}function xS(n,i){return n==null?!0:Ff(n,i)}function NS(n,i,s){return n==null?n:bh(n,i,zf(s))}function MS(n,i,s,c){return c=typeof c=="function"?c:r,n==null?n:bh(n,i,zf(s),c)}function Ao(n){return n==null?[]:Rf(n,Ut(n))}function $S(n){return n==null?[]:Rf(n,bn(n))}function DS(n,i,s){return s===r&&(s=i,i=r),s!==r&&(s=kn(s),s=s===s?s:0),i!==r&&(i=kn(i),i=i===i?i:0),ji(kn(n),i,s)}function jS(n,i,s){return i=qr(i),s===r?(s=i,i=0):s=qr(s),n=kn(n),qw(n,i,s)}function US(n,i,s){if(s&&typeof s!="boolean"&&un(n,i,s)&&(i=s=r),s===r&&(typeof i=="boolean"?(s=i,i=r):typeof n=="boolean"&&(s=n,n=r)),n===r&&i===r?(n=0,i=1):(n=qr(n),i===r?(i=n,n=0):i=qr(i)),n>i){var c=n;n=i,i=c}if(s||n%1||i%1){var g=zd();return Jt(n+g*(i-n+Ie("1e-"+((g+"").length-1))),i)}return kf(n,i)}var kS=Eo(function(n,i,s){return i=i.toLowerCase(),n+(s?Sg(i):i)});function Sg(n){return hc(et(n).toLowerCase())}function Rg(n){return n=et(n),n&&n.replace(xr,P_).replace(Nr,"")}function HS(n,i,s){n=et(n),i=Rn(i);var c=n.length;s=s===r?c:ji(He(s),0,c);var g=s;return s-=i.length,s>=0&&n.slice(s,g)==i}function WS(n){return n=et(n),n&&Br.test(n)?n.replace(Bn,B_):n}function FS(n){return n=et(n),n&&bt.test(n)?n.replace(Se,"\\$&"):n}var qS=Eo(function(n,i,s){return n+(s?"-":"")+i.toLowerCase()}),VS=Eo(function(n,i,s){return n+(s?" ":"")+i.toLowerCase()}),zS=Ih("toLowerCase");function GS(n,i,s){n=et(n),i=He(i);var c=i?po(n):0;if(!i||c>=i)return n;var g=(i-c)/2;return $a(Sa(g),s)+n+$a(Ea(g),s)}function KS(n,i,s){n=et(n),i=He(i);var c=i?po(n):0;return i&&c<i?n+$a(i-c,s):n}function JS(n,i,s){n=et(n),i=He(i);var c=i?po(n):0;return i&&c<i?$a(i-c,s)+n:n}function YS(n,i,s){return s||i==null?i=0:i&&(i=+i),rw(et(n).replace(vt,""),i||0)}function ZS(n,i,s){return(s?un(n,i,s):i===r)?i=1:i=He(i),Hf(et(n),i)}function XS(){var n=arguments,i=et(n[0]);return n.length<3?i:i.replace(n[1],n[2])}var QS=Eo(function(n,i,s){return n+(s?"_":"")+i.toLowerCase()});function e1(n,i,s){return s&&typeof s!="number"&&un(n,i,s)&&(i=s=r),s=s===r?ae:s>>>0,s?(n=et(n),n&&(typeof i=="string"||i!=null&&!cc(i))&&(i=Rn(i),!i&&go(n))?pi(Xn(n),0,s):n.split(i,s)):[]}var t1=Eo(function(n,i,s){return n+(s?" ":"")+hc(i)});function n1(n,i,s){return n=et(n),s=s==null?0:ji(He(s),0,n.length),i=Rn(i),n.slice(s,s+i.length)==i}function r1(n,i,s){var c=y.templateSettings;s&&un(n,i,s)&&(i=r),n=et(n),i=Ka({},i,c,Nh);var g=Ka({},i.imports,c.imports,Nh),_=Ut(g),x=Rf(g,_),U,V,ce=0,le=i.interpolate||hr,he="__p += '",ve=Tf((i.escape||hr).source+"|"+le.source+"|"+(le===A?zt:hr).source+"|"+(i.evaluate||hr).source+"|$","g"),Pe="//# sourceURL="+(nt.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++pf+"]")+`
|
|
13
|
-
`;n.replace(ve,function(Me,Ve,Je,Tn,fn,In){return Je||(Je=Tn),he+=n.slice(ce,In).replace(gr,L_),Ve&&(U=!0,he+=`' +
|
|
14
|
-
__e(`+Ve+`) +
|
|
15
|
-
'`),fn&&(V=!0,he+=`';
|
|
16
|
-
`+fn+`;
|
|
17
|
-
__p += '`),Je&&(he+=`' +
|
|
18
|
-
((__t = (`+Je+`)) == null ? '' : __t) +
|
|
19
|
-
'`),ce=In+Me.length,Me}),he+=`';
|
|
20
|
-
`;var Ne=nt.call(i,"variable")&&i.variable;if(!Ne)he=`with (obj) {
|
|
21
|
-
`+he+`
|
|
22
|
-
}
|
|
23
|
-
`;else if(dr.test(Ne))throw new je(l);he=(V?he.replace(Jn,""):he).replace(sr,"$1").replace(ar,"$1;"),he="function("+(Ne||"obj")+`) {
|
|
24
|
-
`+(Ne?"":`obj || (obj = {});
|
|
25
|
-
`)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(V?`, __j = Array.prototype.join;
|
|
26
|
-
function print() { __p += __j.call(arguments, '') }
|
|
27
|
-
`:`;
|
|
28
|
-
`)+he+`return __p
|
|
29
|
-
}`;var We=Tg(function(){return Xe(_,Pe+"return "+he).apply(r,x)});if(We.source=he,fc(We))throw We;return We}function i1(n){return et(n).toLowerCase()}function o1(n){return et(n).toUpperCase()}function s1(n,i,s){if(n=et(n),n&&(s||i===r))return Md(n);if(!n||!(i=Rn(i)))return n;var c=Xn(n),g=Xn(i),_=$d(c,g),x=Dd(c,g)+1;return pi(c,_,x).join("")}function a1(n,i,s){if(n=et(n),n&&(s||i===r))return n.slice(0,Ud(n)+1);if(!n||!(i=Rn(i)))return n;var c=Xn(n),g=Dd(c,Xn(i))+1;return pi(c,0,g).join("")}function u1(n,i,s){if(n=et(n),n&&(s||i===r))return n.replace(vt,"");if(!n||!(i=Rn(i)))return n;var c=Xn(n),g=$d(c,Xn(i));return pi(c,g).join("")}function f1(n,i){var s=Ae,c=be;if(_t(i)){var g="separator"in i?i.separator:g;s="length"in i?He(i.length):s,c="omission"in i?Rn(i.omission):c}n=et(n);var _=n.length;if(go(n)){var x=Xn(n);_=x.length}if(s>=_)return n;var U=s-po(c);if(U<1)return c;var V=x?pi(x,0,U).join(""):n.slice(0,U);if(g===r)return V+c;if(x&&(U+=V.length-U),cc(g)){if(n.slice(U).search(g)){var ce,le=V;for(g.global||(g=Tf(g.source,et(Ln.exec(g))+"g")),g.lastIndex=0;ce=g.exec(le);)var he=ce.index;V=V.slice(0,he===r?U:he)}}else if(n.indexOf(Rn(g),U)!=U){var ve=V.lastIndexOf(g);ve>-1&&(V=V.slice(0,ve))}return V+c}function c1(n){return n=et(n),n&&on.test(n)?n.replace(rn,U_):n}var l1=Eo(function(n,i,s){return n+(s?" ":"")+i.toUpperCase()}),hc=Ih("toUpperCase");function Ag(n,i,s){return n=et(n),i=s?r:i,i===r?N_(n)?W_(n):A_(n):n.match(i)||[]}var Tg=Fe(function(n,i){try{return En(n,r,i)}catch(s){return fc(s)?s:new je(s)}}),d1=Hr(function(n,i){return Nn(i,function(s){s=_r(s),Ur(n,s,ac(n[s],n))}),n});function h1(n){var i=n==null?0:n.length,s=xe();return n=i?yt(n,function(c){if(typeof c[1]!="function")throw new Mn(f);return[s(c[0]),c[1]]}):[],Fe(function(c){for(var g=-1;++g<i;){var _=n[g];if(En(_[0],this,c))return En(_[1],this,c)}})}function g1(n){return Uw(Dn(n,w))}function gc(n){return function(){return n}}function p1(n,i){return n==null||n!==n?i:n}var b1=Ch(),y1=Ch(!0);function yn(n){return n}function pc(n){return oh(typeof n=="function"?n:Dn(n,w))}function _1(n){return ah(Dn(n,w))}function w1(n,i){return uh(n,Dn(i,w))}var m1=Fe(function(n,i){return function(s){return fs(s,n,i)}}),v1=Fe(function(n,i){return function(s){return fs(n,s,i)}});function bc(n,i,s){var c=Ut(i),g=Ca(i,c);s==null&&!(_t(i)&&(g.length||!c.length))&&(s=i,i=n,n=this,g=Ca(i,Ut(i)));var _=!(_t(s)&&"chain"in s)||!!s.chain,x=Fr(n);return Nn(g,function(U){var V=i[U];n[U]=V,x&&(n.prototype[U]=function(){var ce=this.__chain__;if(_||ce){var le=n(this.__wrapped__),he=le.__actions__=gn(this.__actions__);return he.push({func:V,args:arguments,thisArg:n}),le.__chain__=ce,le}return V.apply(n,fi([this.value()],arguments))})}),n}function E1(){return $e._===this&&($e._=K_),this}function yc(){}function S1(n){return n=He(n),Fe(function(i){return fh(i,n)})}var R1=Kf(yt),A1=Kf(Pd),T1=Kf(wf);function Ig(n){return tc(n)?mf(_r(n)):nm(n)}function I1(n){return function(i){return n==null?r:Ui(n,i)}}var O1=Bh(),C1=Bh(!0);function _c(){return[]}function wc(){return!1}function P1(){return{}}function B1(){return""}function L1(){return!0}function x1(n,i){if(n=He(n),n<1||n>ue)return[];var s=ae,c=Jt(n,ae);i=xe(i),n-=ae;for(var g=Sf(c,i);++s<n;)i(s);return g}function N1(n){return Ue(n)?yt(n,_r):An(n)?[n]:gn(Gh(et(n)))}function M1(n){var i=++z_;return et(n)+i}var $1=Ma(function(n,i){return n+i},0),D1=Jf("ceil"),j1=Ma(function(n,i){return n/i},1),U1=Jf("floor");function k1(n){return n&&n.length?Oa(n,yn,Nf):r}function H1(n,i){return n&&n.length?Oa(n,xe(i,2),Nf):r}function W1(n){return xd(n,yn)}function F1(n,i){return xd(n,xe(i,2))}function q1(n){return n&&n.length?Oa(n,yn,jf):r}function V1(n,i){return n&&n.length?Oa(n,xe(i,2),jf):r}var z1=Ma(function(n,i){return n*i},1),G1=Jf("round"),K1=Ma(function(n,i){return n-i},0);function J1(n){return n&&n.length?Ef(n,yn):0}function Y1(n,i){return n&&n.length?Ef(n,xe(i,2)):0}return y.after=_E,y.ary=ig,y.assign=oS,y.assignIn=_g,y.assignInWith=Ka,y.assignWith=sS,y.at=aS,y.before=og,y.bind=ac,y.bindAll=d1,y.bindKey=sg,y.castArray=PE,y.chain=tg,y.chunk=Um,y.compact=km,y.concat=Hm,y.cond=h1,y.conforms=g1,y.constant=gc,y.countBy=Jv,y.create=uS,y.curry=ag,y.curryRight=ug,y.debounce=fg,y.defaults=fS,y.defaultsDeep=cS,y.defer=wE,y.delay=mE,y.difference=Wm,y.differenceBy=Fm,y.differenceWith=qm,y.drop=Vm,y.dropRight=zm,y.dropRightWhile=Gm,y.dropWhile=Km,y.fill=Jm,y.filter=Zv,y.flatMap=eE,y.flatMapDeep=tE,y.flatMapDepth=nE,y.flatten=Zh,y.flattenDeep=Ym,y.flattenDepth=Zm,y.flip=vE,y.flow=b1,y.flowRight=y1,y.fromPairs=Xm,y.functions=yS,y.functionsIn=_S,y.groupBy=rE,y.initial=ev,y.intersection=tv,y.intersectionBy=nv,y.intersectionWith=rv,y.invert=mS,y.invertBy=vS,y.invokeMap=oE,y.iteratee=pc,y.keyBy=sE,y.keys=Ut,y.keysIn=bn,y.map=Wa,y.mapKeys=SS,y.mapValues=RS,y.matches=_1,y.matchesProperty=w1,y.memoize=qa,y.merge=AS,y.mergeWith=wg,y.method=m1,y.methodOf=v1,y.mixin=bc,y.negate=Va,y.nthArg=S1,y.omit=TS,y.omitBy=IS,y.once=EE,y.orderBy=aE,y.over=R1,y.overArgs=SE,y.overEvery=A1,y.overSome=T1,y.partial=uc,y.partialRight=cg,y.partition=uE,y.pick=OS,y.pickBy=mg,y.property=Ig,y.propertyOf=I1,y.pull=av,y.pullAll=Qh,y.pullAllBy=uv,y.pullAllWith=fv,y.pullAt=cv,y.range=O1,y.rangeRight=C1,y.rearg=RE,y.reject=lE,y.remove=lv,y.rest=AE,y.reverse=oc,y.sampleSize=hE,y.set=PS,y.setWith=BS,y.shuffle=gE,y.slice=dv,y.sortBy=yE,y.sortedUniq=wv,y.sortedUniqBy=mv,y.split=e1,y.spread=TE,y.tail=vv,y.take=Ev,y.takeRight=Sv,y.takeRightWhile=Rv,y.takeWhile=Av,y.tap=kv,y.throttle=IE,y.thru=Ha,y.toArray=pg,y.toPairs=vg,y.toPairsIn=Eg,y.toPath=N1,y.toPlainObject=yg,y.transform=LS,y.unary=OE,y.union=Tv,y.unionBy=Iv,y.unionWith=Ov,y.uniq=Cv,y.uniqBy=Pv,y.uniqWith=Bv,y.unset=xS,y.unzip=sc,y.unzipWith=eg,y.update=NS,y.updateWith=MS,y.values=Ao,y.valuesIn=$S,y.without=Lv,y.words=Ag,y.wrap=CE,y.xor=xv,y.xorBy=Nv,y.xorWith=Mv,y.zip=$v,y.zipObject=Dv,y.zipObjectDeep=jv,y.zipWith=Uv,y.entries=vg,y.entriesIn=Eg,y.extend=_g,y.extendWith=Ka,bc(y,y),y.add=$1,y.attempt=Tg,y.camelCase=kS,y.capitalize=Sg,y.ceil=D1,y.clamp=DS,y.clone=BE,y.cloneDeep=xE,y.cloneDeepWith=NE,y.cloneWith=LE,y.conformsTo=ME,y.deburr=Rg,y.defaultTo=p1,y.divide=j1,y.endsWith=HS,y.eq=er,y.escape=WS,y.escapeRegExp=FS,y.every=Yv,y.find=Xv,y.findIndex=Jh,y.findKey=lS,y.findLast=Qv,y.findLastIndex=Yh,y.findLastKey=dS,y.floor=U1,y.forEach=ng,y.forEachRight=rg,y.forIn=hS,y.forInRight=gS,y.forOwn=pS,y.forOwnRight=bS,y.get=lc,y.gt=$E,y.gte=DE,y.has=wS,y.hasIn=dc,y.head=Xh,y.identity=yn,y.includes=iE,y.indexOf=Qm,y.inRange=jS,y.invoke=ES,y.isArguments=Wi,y.isArray=Ue,y.isArrayBuffer=jE,y.isArrayLike=pn,y.isArrayLikeObject=At,y.isBoolean=UE,y.isBuffer=bi,y.isDate=kE,y.isElement=HE,y.isEmpty=WE,y.isEqual=FE,y.isEqualWith=qE,y.isError=fc,y.isFinite=VE,y.isFunction=Fr,y.isInteger=lg,y.isLength=za,y.isMap=dg,y.isMatch=zE,y.isMatchWith=GE,y.isNaN=KE,y.isNative=JE,y.isNil=ZE,y.isNull=YE,y.isNumber=hg,y.isObject=_t,y.isObjectLike=Et,y.isPlainObject=ps,y.isRegExp=cc,y.isSafeInteger=XE,y.isSet=gg,y.isString=Ga,y.isSymbol=An,y.isTypedArray=Ro,y.isUndefined=QE,y.isWeakMap=eS,y.isWeakSet=tS,y.join=iv,y.kebabCase=qS,y.last=Un,y.lastIndexOf=ov,y.lowerCase=VS,y.lowerFirst=zS,y.lt=nS,y.lte=rS,y.max=k1,y.maxBy=H1,y.mean=W1,y.meanBy=F1,y.min=q1,y.minBy=V1,y.stubArray=_c,y.stubFalse=wc,y.stubObject=P1,y.stubString=B1,y.stubTrue=L1,y.multiply=z1,y.nth=sv,y.noConflict=E1,y.noop=yc,y.now=Fa,y.pad=GS,y.padEnd=KS,y.padStart=JS,y.parseInt=YS,y.random=US,y.reduce=fE,y.reduceRight=cE,y.repeat=ZS,y.replace=XS,y.result=CS,y.round=G1,y.runInContext=q,y.sample=dE,y.size=pE,y.snakeCase=QS,y.some=bE,y.sortedIndex=hv,y.sortedIndexBy=gv,y.sortedIndexOf=pv,y.sortedLastIndex=bv,y.sortedLastIndexBy=yv,y.sortedLastIndexOf=_v,y.startCase=t1,y.startsWith=n1,y.subtract=K1,y.sum=J1,y.sumBy=Y1,y.template=r1,y.times=x1,y.toFinite=qr,y.toInteger=He,y.toLength=bg,y.toLower=i1,y.toNumber=kn,y.toSafeInteger=iS,y.toString=et,y.toUpper=o1,y.trim=s1,y.trimEnd=a1,y.trimStart=u1,y.truncate=f1,y.unescape=c1,y.uniqueId=M1,y.upperCase=l1,y.upperFirst=hc,y.each=ng,y.eachRight=rg,y.first=Xh,bc(y,function(){var n={};return br(y,function(i,s){nt.call(y.prototype,s)||(n[s]=i)}),n}(),{chain:!1}),y.VERSION=o,Nn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){y[n].placeholder=y}),Nn(["drop","take"],function(n,i){Ge.prototype[n]=function(s){s=s===r?1:Mt(He(s),0);var c=this.__filtered__&&!i?new Ge(this):this.clone();return c.__filtered__?c.__takeCount__=Jt(s,c.__takeCount__):c.__views__.push({size:Jt(s,ae),type:n+(c.__dir__<0?"Right":"")}),c},Ge.prototype[n+"Right"]=function(s){return this.reverse()[n](s).reverse()}}),Nn(["filter","map","takeWhile"],function(n,i){var s=i+1,c=s==D||s==ne;Ge.prototype[n]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:xe(g,3),type:s}),_.__filtered__=_.__filtered__||c,_}}),Nn(["head","last"],function(n,i){var s="take"+(i?"Right":"");Ge.prototype[n]=function(){return this[s](1).value()[0]}}),Nn(["initial","tail"],function(n,i){var s="drop"+(i?"":"Right");Ge.prototype[n]=function(){return this.__filtered__?new Ge(this):this[s](1)}}),Ge.prototype.compact=function(){return this.filter(yn)},Ge.prototype.find=function(n){return this.filter(n).head()},Ge.prototype.findLast=function(n){return this.reverse().find(n)},Ge.prototype.invokeMap=Fe(function(n,i){return typeof n=="function"?new Ge(this):this.map(function(s){return fs(s,n,i)})}),Ge.prototype.reject=function(n){return this.filter(Va(xe(n)))},Ge.prototype.slice=function(n,i){n=He(n);var s=this;return s.__filtered__&&(n>0||i<0)?new Ge(s):(n<0?s=s.takeRight(-n):n&&(s=s.drop(n)),i!==r&&(i=He(i),s=i<0?s.dropRight(-i):s.take(i-n)),s)},Ge.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ge.prototype.toArray=function(){return this.take(ae)},br(Ge.prototype,function(n,i){var s=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),g=y[c?"take"+(i=="last"?"Right":""):i],_=c||/^find/.test(i);g&&(y.prototype[i]=function(){var x=this.__wrapped__,U=c?[1]:arguments,V=x instanceof Ge,ce=U[0],le=V||Ue(x),he=function(Ve){var Je=g.apply(y,fi([Ve],U));return c&&ve?Je[0]:Je};le&&s&&typeof ce=="function"&&ce.length!=1&&(V=le=!1);var ve=this.__chain__,Pe=!!this.__actions__.length,Ne=_&&!ve,We=V&&!Pe;if(!_&&le){x=We?x:new Ge(this);var Me=n.apply(x,U);return Me.__actions__.push({func:Ha,args:[he],thisArg:r}),new $n(Me,ve)}return Ne&&We?n.apply(this,U):(Me=this.thru(he),Ne?c?Me.value()[0]:Me.value():Me)})}),Nn(["pop","push","shift","sort","splice","unshift"],function(n){var i=ha[n],s=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",c=/^(?:pop|shift)$/.test(n);y.prototype[n]=function(){var g=arguments;if(c&&!this.__chain__){var _=this.value();return i.apply(Ue(_)?_:[],g)}return this[s](function(x){return i.apply(Ue(x)?x:[],g)})}}),br(Ge.prototype,function(n,i){var s=y[i];if(s){var c=s.name+"";nt.call(wo,c)||(wo[c]=[]),wo[c].push({name:i,func:s})}}),wo[Na(r,$).name]=[{name:"wrapper",func:r}],Ge.prototype.clone=cw,Ge.prototype.reverse=lw,Ge.prototype.value=dw,y.prototype.at=Hv,y.prototype.chain=Wv,y.prototype.commit=Fv,y.prototype.next=qv,y.prototype.plant=zv,y.prototype.reverse=Gv,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=Kv,y.prototype.first=y.prototype.head,ns&&(y.prototype[ns]=Vv),y},bo=F_();xt?((xt.exports=bo)._=bo,ot._=bo):$e._=bo}).call(Ke)})(wu,wu.exports);wu.exports;_O();const Es={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},Er={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key"},oP={GET_PROVIDER_STATE:"wallet_get_provider_state"},Vc={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function sP(e){return function(r,o,a){a(u=>{o.error&&yu.warn(`Error in RPC response:
|
|
30
|
-
`,o),!r.isTorusInternal&&(yu.info(`RPC (${e.origin}):`,r,"->",o),u())})}}var kp;(function(e){e.approved="approved",e.cancelled="cancelled",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired"})(kp||(kp={}));var Bl={exports:{}},r_=Ti.EventEmitter,zc,Hp;function aP(){if(Hp)return zc;Hp=1;function e(k,C){var P=Object.keys(k);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(k);C&&($=$.filter(function(L){return Object.getOwnPropertyDescriptor(k,L).enumerable})),P.push.apply(P,$)}return P}function t(k){for(var C=1;C<arguments.length;C++){var P=arguments[C]!=null?arguments[C]:{};C%2?e(Object(P),!0).forEach(function($){r(k,$,P[$])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(P)):e(Object(P)).forEach(function($){Object.defineProperty(k,$,Object.getOwnPropertyDescriptor(P,$))})}return k}function r(k,C,P){return C=f(C),C in k?Object.defineProperty(k,C,{value:P,enumerable:!0,configurable:!0,writable:!0}):k[C]=P,k}function o(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}function a(k,C){for(var P=0;P<C.length;P++){var $=C[P];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(k,f($.key),$)}}function u(k,C,P){return C&&a(k.prototype,C),Object.defineProperty(k,"prototype",{writable:!1}),k}function f(k){var C=l(k,"string");return typeof C=="symbol"?C:String(C)}function l(k,C){if(typeof k!="object"||k===null)return k;var P=k[Symbol.toPrimitive];if(P!==void 0){var $=P.call(k,C||"default");if(typeof $!="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(k)}var h=or,d=h.Buffer,p=Vi,w=p.inspect,T=w&&w.custom||"inspect";function v(k,C,P){d.prototype.copy.call(k,C,P)}return zc=function(){function k(){o(this,k),this.head=null,this.tail=null,this.length=0}return u(k,[{key:"push",value:function(P){var $={data:P,next:null};this.length>0?this.tail.next=$:this.head=$,this.tail=$,++this.length}},{key:"unshift",value:function(P){var $={data:P,next:this.head};this.length===0&&(this.tail=$),this.head=$,++this.length}},{key:"shift",value:function(){if(this.length!==0){var P=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(this.length===0)return"";for(var $=this.head,L=""+$.data;$=$.next;)L+=P+$.data;return L}},{key:"concat",value:function(P){if(this.length===0)return d.alloc(0);for(var $=d.allocUnsafe(P>>>0),L=this.head,S=0;L;)v(L.data,$,S),S+=L.data.length,L=L.next;return $}},{key:"consume",value:function(P,$){var L;return P<this.head.data.length?(L=this.head.data.slice(0,P),this.head.data=this.head.data.slice(P)):P===this.head.data.length?L=this.shift():L=$?this._getString(P):this._getBuffer(P),L}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(P){var $=this.head,L=1,S=$.data;for(P-=S.length;$=$.next;){var m=$.data,H=P>m.length?m.length:P;if(H===m.length?S+=m:S+=m.slice(0,P),P-=H,P===0){H===m.length?(++L,$.next?this.head=$.next:this.head=this.tail=null):(this.head=$,$.data=m.slice(H));break}++L}return this.length-=L,S}},{key:"_getBuffer",value:function(P){var $=d.allocUnsafe(P),L=this.head,S=1;for(L.data.copy($),P-=L.data.length;L=L.next;){var m=L.data,H=P>m.length?m.length:P;if(m.copy($,$.length-P,0,H),P-=H,P===0){H===m.length?(++S,L.next?this.head=L.next:this.head=this.tail=null):(this.head=L,L.data=m.slice(H));break}++S}return this.length-=S,$}},{key:T,value:function(P,$){return w(this,t(t({},$),{},{depth:0,customInspect:!1}))}}]),k}(),zc}function uP(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ll,this,e)):process.nextTick(Ll,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(u){!t&&u?r._writableState?r._writableState.errorEmitted?process.nextTick(uu,r):(r._writableState.errorEmitted=!0,process.nextTick(Wp,r,u)):process.nextTick(Wp,r,u):t?(process.nextTick(uu,r),t(u)):process.nextTick(uu,r)}),this)}function Wp(e,t){Ll(e,t),uu(e)}function uu(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function fP(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ll(e,t){e.emit("error",t)}function cP(e,t){var r=e._readableState,o=e._writableState;r&&r.autoDestroy||o&&o.autoDestroy?e.destroy(t):e.emit("error",t)}var i_={destroy:uP,undestroy:fP,errorOrDestroy:cP},ao={};function lP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var o_={};function Gn(e,t,r){r||(r=Error);function o(u,f,l){return typeof t=="string"?t:t(u,f,l)}var a=function(u){lP(f,u);function f(l,h,d){return u.call(this,o(l,h,d))||this}return f}(r);a.prototype.name=r.name,a.prototype.code=e,o_[e]=a}function Fp(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(o){return String(o)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function dP(e,t,r){return e.substr(0,t.length)===t}function hP(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function gP(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Gn("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Gn("ERR_INVALID_ARG_TYPE",function(e,t,r){var o;typeof t=="string"&&dP(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be";var a;if(hP(e," argument"))a="The ".concat(e," ").concat(o," ").concat(Fp(t,"type"));else{var u=gP(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(Fp(t,"type"))}return a+=". Received type ".concat(typeof r),a},TypeError);Gn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Gn("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Gn("ERR_STREAM_PREMATURE_CLOSE","Premature close");Gn("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Gn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Gn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Gn("ERR_STREAM_WRITE_AFTER_END","write after end");Gn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Gn("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Gn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");ao.codes=o_;var pP=ao.codes.ERR_INVALID_OPT_VALUE;function bP(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function yP(e,t,r,o){var a=bP(t,o,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var u=o?r:"highWaterMark";throw new pP(u,a)}return Math.floor(a)}return e.objectMode?16:16*1024}var s_={getHighWaterMark:yP},_P=wP;function wP(e,t){if(Gc("noDeprecation"))return e;var r=!1;function o(){if(!r){if(Gc("throwDeprecation"))throw new Error(t);Gc("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return o}function Gc(e){try{if(!Ke.localStorage)return!1}catch{return!1}var t=Ke.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Kc,qp;function a_(){if(qp)return Kc;qp=1,Kc=fe;function e(j){var F=this;this.next=null,this.entry=null,this.finish=function(){we(F,j)}}var t;fe.WritableState=ee;var r={deprecate:_P},o=r_,a=or.Buffer,u=(typeof Ke<"u"?Ke:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(j){return a.from(j)}function l(j){return a.isBuffer(j)||j instanceof u}var h=i_,d=s_,p=d.getHighWaterMark,w=ao.codes,T=w.ERR_INVALID_ARG_TYPE,v=w.ERR_METHOD_NOT_IMPLEMENTED,k=w.ERR_MULTIPLE_CALLBACK,C=w.ERR_STREAM_CANNOT_PIPE,P=w.ERR_STREAM_DESTROYED,$=w.ERR_STREAM_NULL_VALUES,L=w.ERR_STREAM_WRITE_AFTER_END,S=w.ERR_UNKNOWN_ENCODING,m=h.errorOrDestroy;Ds(fe,o);function H(){}function ee(j,F,Z){t=t||ko(),j=j||{},typeof Z!="boolean"&&(Z=F instanceof t),this.objectMode=!!j.objectMode,Z&&(this.objectMode=this.objectMode||!!j.writableObjectMode),this.highWaterMark=p(this,j,"writableHighWaterMark",Z),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var de=j.decodeStrings===!1;this.decodeStrings=!de,this.defaultEncoding=j.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Re){ne(F,Re)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}ee.prototype.getBuffer=function(){for(var F=this.bufferedRequest,Z=[];F;)Z.push(F),F=F.next;return Z},function(){try{Object.defineProperty(ee.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ge;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ge=Function.prototype[Symbol.hasInstance],Object.defineProperty(fe,Symbol.hasInstance,{value:function(F){return ge.call(this,F)?!0:this!==fe?!1:F&&F._writableState instanceof ee}})):ge=function(F){return F instanceof this};function fe(j){t=t||ko();var F=this instanceof t;if(!F&&!ge.call(fe,this))return new fe(j);this._writableState=new ee(j,this,F),this.writable=!0,j&&(typeof j.write=="function"&&(this._write=j.write),typeof j.writev=="function"&&(this._writev=j.writev),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.final=="function"&&(this._final=j.final)),o.call(this)}fe.prototype.pipe=function(){m(this,new C)};function oe(j,F){var Z=new L;m(j,Z),process.nextTick(F,Z)}function Ae(j,F,Z,de){var Re;return Z===null?Re=new $:typeof Z!="string"&&!F.objectMode&&(Re=new T("chunk",["string","Buffer"],Z)),Re?(m(j,Re),process.nextTick(de,Re),!1):!0}fe.prototype.write=function(j,F,Z){var de=this._writableState,Re=!1,R=!de.objectMode&&l(j);return R&&!a.isBuffer(j)&&(j=f(j)),typeof F=="function"&&(Z=F,F=null),R?F="buffer":F||(F=de.defaultEncoding),typeof Z!="function"&&(Z=H),de.ending?oe(this,Z):(R||Ae(this,de,j,Z))&&(de.pendingcb++,Re=M(this,de,R,j,F,Z)),Re},fe.prototype.cork=function(){this._writableState.corked++},fe.prototype.uncork=function(){var j=this._writableState;j.corked&&(j.corked--,!j.writing&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&G(this,j))},fe.prototype.setDefaultEncoding=function(F){if(typeof F=="string"&&(F=F.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new S(F);return this._writableState.defaultEncoding=F,this},Object.defineProperty(fe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function be(j,F,Z){return!j.objectMode&&j.decodeStrings!==!1&&typeof F=="string"&&(F=a.from(F,Z)),F}Object.defineProperty(fe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function M(j,F,Z,de,Re,R){if(!Z){var I=be(F,de,Re);de!==I&&(Z=!0,Re="buffer",de=I)}var b=F.objectMode?1:de.length;F.length+=b;var E=F.length<F.highWaterMark;if(E||(F.needDrain=!0),F.writing||F.corked){var z=F.lastBufferedRequest;F.lastBufferedRequest={chunk:de,encoding:Re,isBuf:Z,callback:R,next:null},z?z.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else N(j,F,!1,b,de,Re,R);return E}function N(j,F,Z,de,Re,R,I){F.writelen=de,F.writecb=I,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new P("write")):Z?j._writev(Re,F.onwrite):j._write(Re,R,F.onwrite),F.sync=!1}function D(j,F,Z,de,Re){--F.pendingcb,Z?(process.nextTick(Re,de),process.nextTick(te,j,F),j._writableState.errorEmitted=!0,m(j,de)):(Re(de),j._writableState.errorEmitted=!0,m(j,de),te(j,F))}function K(j){j.writing=!1,j.writecb=null,j.length-=j.writelen,j.writelen=0}function ne(j,F){var Z=j._writableState,de=Z.sync,Re=Z.writecb;if(typeof Re!="function")throw new k;if(K(Z),F)D(j,Z,de,F,Re);else{var R=Y(Z)||j.destroyed;!R&&!Z.corked&&!Z.bufferProcessing&&Z.bufferedRequest&&G(j,Z),de?process.nextTick(J,j,Z,R,Re):J(j,Z,R,Re)}}function J(j,F,Z,de){Z||ue(j,F),F.pendingcb--,de(),te(j,F)}function ue(j,F){F.length===0&&F.needDrain&&(F.needDrain=!1,j.emit("drain"))}function G(j,F){F.bufferProcessing=!0;var Z=F.bufferedRequest;if(j._writev&&Z&&Z.next){var de=F.bufferedRequestCount,Re=new Array(de),R=F.corkedRequestsFree;R.entry=Z;for(var I=0,b=!0;Z;)Re[I]=Z,Z.isBuf||(b=!1),Z=Z.next,I+=1;Re.allBuffers=b,N(j,F,!0,F.length,Re,"",R.finish),F.pendingcb++,F.lastBufferedRequest=null,R.next?(F.corkedRequestsFree=R.next,R.next=null):F.corkedRequestsFree=new e(F),F.bufferedRequestCount=0}else{for(;Z;){var E=Z.chunk,z=Z.encoding,re=Z.callback,ie=F.objectMode?1:E.length;if(N(j,F,!1,ie,E,z,re),Z=Z.next,F.bufferedRequestCount--,F.writing)break}Z===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=Z,F.bufferProcessing=!1}fe.prototype._write=function(j,F,Z){Z(new v("_write()"))},fe.prototype._writev=null,fe.prototype.end=function(j,F,Z){var de=this._writableState;return typeof j=="function"?(Z=j,j=null,F=null):typeof F=="function"&&(Z=F,F=null),j!=null&&this.write(j,F),de.corked&&(de.corked=1,this.uncork()),de.ending||ye(this,de,Z),this},Object.defineProperty(fe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Y(j){return j.ending&&j.length===0&&j.bufferedRequest===null&&!j.finished&&!j.writing}function ae(j,F){j._final(function(Z){F.pendingcb--,Z&&m(j,Z),F.prefinished=!0,j.emit("prefinish"),te(j,F)})}function me(j,F){!F.prefinished&&!F.finalCalled&&(typeof j._final=="function"&&!F.destroyed?(F.pendingcb++,F.finalCalled=!0,process.nextTick(ae,j,F)):(F.prefinished=!0,j.emit("prefinish")))}function te(j,F){var Z=Y(F);if(Z&&(me(j,F),F.pendingcb===0&&(F.finished=!0,j.emit("finish"),F.autoDestroy))){var de=j._readableState;(!de||de.autoDestroy&&de.endEmitted)&&j.destroy()}return Z}function ye(j,F,Z){F.ending=!0,te(j,F),Z&&(F.finished?process.nextTick(Z):j.once("finish",Z)),F.ended=!0,j.writable=!1}function we(j,F,Z){var de=j.entry;for(j.entry=null;de;){var Re=de.callback;F.pendingcb--,Re(Z),de=de.next}F.corkedRequestsFree.next=j}return Object.defineProperty(fe.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(F){this._writableState&&(this._writableState.destroyed=F)}}),fe.prototype.destroy=h.destroy,fe.prototype._undestroy=h.undestroy,fe.prototype._destroy=function(j,F){F(j)},Kc}var Jc,Vp;function ko(){if(Vp)return Jc;Vp=1;var e=Object.keys||function(d){var p=[];for(var w in d)p.push(w);return p};Jc=f;var t=f_(),r=a_();Ds(f,t);for(var o=e(r.prototype),a=0;a<o.length;a++){var u=o[a];f.prototype[u]||(f.prototype[u]=r.prototype[u])}function f(d){if(!(this instanceof f))return new f(d);t.call(this,d),r.call(this,d),this.allowHalfOpen=!0,d&&(d.readable===!1&&(this.readable=!1),d.writable===!1&&(this.writable=!1),d.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",l)))}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||process.nextTick(h,this)}function h(d){d.end()}return Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=p,this._writableState.destroyed=p)}}),Jc}var zp=ao.codes.ERR_STREAM_PREMATURE_CLOSE;function mP(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];e.apply(this,o)}}}function vP(){}function EP(e){return e.setHeader&&typeof e.abort=="function"}function u_(e,t,r){if(typeof t=="function")return u_(e,null,t);t||(t={}),r=mP(r||vP);var o=t.readable||t.readable!==!1&&e.readable,a=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||l()},f=e._writableState&&e._writableState.finished,l=function(){a=!1,f=!0,o||r.call(e)},h=e._readableState&&e._readableState.endEmitted,d=function(){o=!1,h=!0,a||r.call(e)},p=function(k){r.call(e,k)},w=function(){var k;if(o&&!h)return(!e._readableState||!e._readableState.ended)&&(k=new zp),r.call(e,k);if(a&&!f)return(!e._writableState||!e._writableState.ended)&&(k=new zp),r.call(e,k)},T=function(){e.req.on("finish",l)};return EP(e)?(e.on("complete",l),e.on("abort",w),e.req?T():e.on("request",T)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",d),e.on("finish",l),t.error!==!1&&e.on("error",p),e.on("close",w),function(){e.removeListener("complete",l),e.removeListener("abort",w),e.removeListener("request",T),e.req&&e.req.removeListener("finish",l),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("end",d),e.removeListener("error",p),e.removeListener("close",w)}}var vd=u_,Yc,Gp;function SP(){if(Gp)return Yc;Gp=1;var e;function t(S,m,H){return m=r(m),m in S?Object.defineProperty(S,m,{value:H,enumerable:!0,configurable:!0,writable:!0}):S[m]=H,S}function r(S){var m=o(S,"string");return typeof m=="symbol"?m:String(m)}function o(S,m){if(typeof S!="object"||S===null)return S;var H=S[Symbol.toPrimitive];if(H!==void 0){var ee=H.call(S,m||"default");if(typeof ee!="object")return ee;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(S)}var a=vd,u=Symbol("lastResolve"),f=Symbol("lastReject"),l=Symbol("error"),h=Symbol("ended"),d=Symbol("lastPromise"),p=Symbol("handlePromise"),w=Symbol("stream");function T(S,m){return{value:S,done:m}}function v(S){var m=S[u];if(m!==null){var H=S[w].read();H!==null&&(S[d]=null,S[u]=null,S[f]=null,m(T(H,!1)))}}function k(S){process.nextTick(v,S)}function C(S,m){return function(H,ee){S.then(function(){if(m[h]){H(T(void 0,!0));return}m[p](H,ee)},ee)}}var P=Object.getPrototypeOf(function(){}),$=Object.setPrototypeOf((e={get stream(){return this[w]},next:function(){var m=this,H=this[l];if(H!==null)return Promise.reject(H);if(this[h])return Promise.resolve(T(void 0,!0));if(this[w].destroyed)return new Promise(function(oe,Ae){process.nextTick(function(){m[l]?Ae(m[l]):oe(T(void 0,!0))})});var ee=this[d],ge;if(ee)ge=new Promise(C(ee,this));else{var fe=this[w].read();if(fe!==null)return Promise.resolve(T(fe,!1));ge=new Promise(this[p])}return this[d]=ge,ge}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var m=this;return new Promise(function(H,ee){m[w].destroy(null,function(ge){if(ge){ee(ge);return}H(T(void 0,!0))})})}),e),P),L=function(m){var H,ee=Object.create($,(H={},t(H,w,{value:m,writable:!0}),t(H,u,{value:null,writable:!0}),t(H,f,{value:null,writable:!0}),t(H,l,{value:null,writable:!0}),t(H,h,{value:m._readableState.endEmitted,writable:!0}),t(H,p,{value:function(fe,oe){var Ae=ee[w].read();Ae?(ee[d]=null,ee[u]=null,ee[f]=null,fe(T(Ae,!1))):(ee[u]=fe,ee[f]=oe)},writable:!0}),H));return ee[d]=null,a(m,function(ge){if(ge&&ge.code!=="ERR_STREAM_PREMATURE_CLOSE"){var fe=ee[f];fe!==null&&(ee[d]=null,ee[u]=null,ee[f]=null,fe(ge)),ee[l]=ge;return}var oe=ee[u];oe!==null&&(ee[d]=null,ee[u]=null,ee[f]=null,oe(T(void 0,!0))),ee[h]=!0}),m.on("readable",k.bind(null,ee)),ee};return Yc=L,Yc}var Zc,Kp;function RP(){return Kp||(Kp=1,Zc=function(){throw new Error("Readable.from is not available in the browser")}),Zc}var Xc,Jp;function f_(){if(Jp)return Xc;Jp=1,Xc=oe;var e;oe.ReadableState=fe,Ti.EventEmitter;var t=function(I,b){return I.listeners(b).length},r=r_,o=or.Buffer,a=(typeof Ke<"u"?Ke:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(R){return o.from(R)}function f(R){return o.isBuffer(R)||R instanceof a}var l=Vi,h;l&&l.debuglog?h=l.debuglog("stream"):h=function(){};var d=aP(),p=i_,w=s_,T=w.getHighWaterMark,v=ao.codes,k=v.ERR_INVALID_ARG_TYPE,C=v.ERR_STREAM_PUSH_AFTER_EOF,P=v.ERR_METHOD_NOT_IMPLEMENTED,$=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,L,S,m;Ds(oe,r);var H=p.errorOrDestroy,ee=["error","close","destroy","pause","resume"];function ge(R,I,b){if(typeof R.prependListener=="function")return R.prependListener(I,b);!R._events||!R._events[I]?R.on(I,b):Array.isArray(R._events[I])?R._events[I].unshift(b):R._events[I]=[b,R._events[I]]}function fe(R,I,b){e=e||ko(),R=R||{},typeof b!="boolean"&&(b=I instanceof e),this.objectMode=!!R.objectMode,b&&(this.objectMode=this.objectMode||!!R.readableObjectMode),this.highWaterMark=T(this,R,"readableHighWaterMark",b),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(L||(L=il().StringDecoder),this.decoder=new L(R.encoding),this.encoding=R.encoding)}function oe(R){if(e=e||ko(),!(this instanceof oe))return new oe(R);var I=this instanceof e;this._readableState=new fe(R,this,I),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),r.call(this)}Object.defineProperty(oe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(I){this._readableState&&(this._readableState.destroyed=I)}}),oe.prototype.destroy=p.destroy,oe.prototype._undestroy=p.undestroy,oe.prototype._destroy=function(R,I){I(R)},oe.prototype.push=function(R,I){var b=this._readableState,E;return b.objectMode?E=!0:typeof R=="string"&&(I=I||b.defaultEncoding,I!==b.encoding&&(R=o.from(R,I),I=""),E=!0),Ae(this,R,I,!1,E)},oe.prototype.unshift=function(R){return Ae(this,R,null,!0,!1)};function Ae(R,I,b,E,z){h("readableAddChunk",I);var re=R._readableState;if(I===null)re.reading=!1,ne(R,re);else{var ie;if(z||(ie=M(re,I)),ie)H(R,ie);else if(re.objectMode||I&&I.length>0)if(typeof I!="string"&&!re.objectMode&&Object.getPrototypeOf(I)!==o.prototype&&(I=u(I)),E)re.endEmitted?H(R,new $):be(R,re,I,!0);else if(re.ended)H(R,new C);else{if(re.destroyed)return!1;re.reading=!1,re.decoder&&!b?(I=re.decoder.write(I),re.objectMode||I.length!==0?be(R,re,I,!1):G(R,re)):be(R,re,I,!1)}else E||(re.reading=!1,G(R,re))}return!re.ended&&(re.length<re.highWaterMark||re.length===0)}function be(R,I,b,E){I.flowing&&I.length===0&&!I.sync?(I.awaitDrain=0,R.emit("data",b)):(I.length+=I.objectMode?1:b.length,E?I.buffer.unshift(b):I.buffer.push(b),I.needReadable&&J(R)),G(R,I)}function M(R,I){var b;return!f(I)&&typeof I!="string"&&I!==void 0&&!R.objectMode&&(b=new k("chunk",["string","Buffer","Uint8Array"],I)),b}oe.prototype.isPaused=function(){return this._readableState.flowing===!1},oe.prototype.setEncoding=function(R){L||(L=il().StringDecoder);var I=new L(R);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;for(var b=this._readableState.buffer.head,E="";b!==null;)E+=I.write(b.data),b=b.next;return this._readableState.buffer.clear(),E!==""&&this._readableState.buffer.push(E),this._readableState.length=E.length,this};var N=1073741824;function D(R){return R>=N?R=N:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function K(R,I){return R<=0||I.length===0&&I.ended?0:I.objectMode?1:R!==R?I.flowing&&I.length?I.buffer.head.data.length:I.length:(R>I.highWaterMark&&(I.highWaterMark=D(R)),R<=I.length?R:I.ended?I.length:(I.needReadable=!0,0))}oe.prototype.read=function(R){h("read",R),R=parseInt(R,10);var I=this._readableState,b=R;if(R!==0&&(I.emittedReadable=!1),R===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return h("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?Z(this):J(this),null;if(R=K(R,I),R===0&&I.ended)return I.length===0&&Z(this),null;var E=I.needReadable;h("need readable",E),(I.length===0||I.length-R<I.highWaterMark)&&(E=!0,h("length less than watermark",E)),I.ended||I.reading?(E=!1,h("reading or ended",E)):E&&(h("do read"),I.reading=!0,I.sync=!0,I.length===0&&(I.needReadable=!0),this._read(I.highWaterMark),I.sync=!1,I.reading||(R=K(b,I)));var z;return R>0?z=F(R,I):z=null,z===null?(I.needReadable=I.length<=I.highWaterMark,R=0):(I.length-=R,I.awaitDrain=0),I.length===0&&(I.ended||(I.needReadable=!0),b!==R&&I.ended&&Z(this)),z!==null&&this.emit("data",z),z};function ne(R,I){if(h("onEofChunk"),!I.ended){if(I.decoder){var b=I.decoder.end();b&&b.length&&(I.buffer.push(b),I.length+=I.objectMode?1:b.length)}I.ended=!0,I.sync?J(R):(I.needReadable=!1,I.emittedReadable||(I.emittedReadable=!0,ue(R)))}}function J(R){var I=R._readableState;h("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(h("emitReadable",I.flowing),I.emittedReadable=!0,process.nextTick(ue,R))}function ue(R){var I=R._readableState;h("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&(I.length||I.ended)&&(R.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,j(R)}function G(R,I){I.readingMore||(I.readingMore=!0,process.nextTick(Y,R,I))}function Y(R,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){var b=I.length;if(h("maybeReadMore read 0"),R.read(0),b===I.length)break}I.readingMore=!1}oe.prototype._read=function(R){H(this,new P("_read()"))},oe.prototype.pipe=function(R,I){var b=this,E=this._readableState;switch(E.pipesCount){case 0:E.pipes=R;break;case 1:E.pipes=[E.pipes,R];break;default:E.pipes.push(R);break}E.pipesCount+=1,h("pipe count=%d opts=%j",E.pipesCount,I);var z=(!I||I.end!==!1)&&R!==process.stdout&&R!==process.stderr,re=z?Oe:Dt;E.endEmitted?process.nextTick(re):b.once("end",re),R.on("unpipe",ie);function ie(it,Ze){h("onunpipe"),it===b&&Ze&&Ze.hasUnpiped===!1&&(Ze.hasUnpiped=!0,ke())}function Oe(){h("onend"),R.end()}var Le=ae(b);R.on("drain",Le);var Ce=!1;function ke(){h("cleanup"),R.removeListener("close",Rt),R.removeListener("finish",ct),R.removeListener("drain",Le),R.removeListener("error",qe),R.removeListener("unpipe",ie),b.removeListener("end",Oe),b.removeListener("end",Dt),b.removeListener("data",Ee),Ce=!0,E.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&Le()}b.on("data",Ee);function Ee(it){h("ondata");var Ze=R.write(it);h("dest.write",Ze),Ze===!1&&((E.pipesCount===1&&E.pipes===R||E.pipesCount>1&&Re(E.pipes,R)!==-1)&&!Ce&&(h("false write response, pause",E.awaitDrain),E.awaitDrain++),b.pause())}function qe(it){h("onerror",it),Dt(),R.removeListener("error",qe),t(R,"error")===0&&H(R,it)}ge(R,"error",qe);function Rt(){R.removeListener("finish",ct),Dt()}R.once("close",Rt);function ct(){h("onfinish"),R.removeListener("close",Rt),Dt()}R.once("finish",ct);function Dt(){h("unpipe"),b.unpipe(R)}return R.emit("pipe",b),E.flowing||(h("pipe resume"),b.resume()),R};function ae(R){return function(){var b=R._readableState;h("pipeOnDrain",b.awaitDrain),b.awaitDrain&&b.awaitDrain--,b.awaitDrain===0&&t(R,"data")&&(b.flowing=!0,j(R))}}oe.prototype.unpipe=function(R){var I=this._readableState,b={hasUnpiped:!1};if(I.pipesCount===0)return this;if(I.pipesCount===1)return R&&R!==I.pipes?this:(R||(R=I.pipes),I.pipes=null,I.pipesCount=0,I.flowing=!1,R&&R.emit("unpipe",this,b),this);if(!R){var E=I.pipes,z=I.pipesCount;I.pipes=null,I.pipesCount=0,I.flowing=!1;for(var re=0;re<z;re++)E[re].emit("unpipe",this,{hasUnpiped:!1});return this}var ie=Re(I.pipes,R);return ie===-1?this:(I.pipes.splice(ie,1),I.pipesCount-=1,I.pipesCount===1&&(I.pipes=I.pipes[0]),R.emit("unpipe",this,b),this)},oe.prototype.on=function(R,I){var b=r.prototype.on.call(this,R,I),E=this._readableState;return R==="data"?(E.readableListening=this.listenerCount("readable")>0,E.flowing!==!1&&this.resume()):R==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,h("on readable",E.length,E.reading),E.length?J(this):E.reading||process.nextTick(te,this)),b},oe.prototype.addListener=oe.prototype.on,oe.prototype.removeListener=function(R,I){var b=r.prototype.removeListener.call(this,R,I);return R==="readable"&&process.nextTick(me,this),b},oe.prototype.removeAllListeners=function(R){var I=r.prototype.removeAllListeners.apply(this,arguments);return(R==="readable"||R===void 0)&&process.nextTick(me,this),I};function me(R){var I=R._readableState;I.readableListening=R.listenerCount("readable")>0,I.resumeScheduled&&!I.paused?I.flowing=!0:R.listenerCount("data")>0&&R.resume()}function te(R){h("readable nexttick read 0"),R.read(0)}oe.prototype.resume=function(){var R=this._readableState;return R.flowing||(h("resume"),R.flowing=!R.readableListening,ye(this,R)),R.paused=!1,this};function ye(R,I){I.resumeScheduled||(I.resumeScheduled=!0,process.nextTick(we,R,I))}function we(R,I){h("resume",I.reading),I.reading||R.read(0),I.resumeScheduled=!1,R.emit("resume"),j(R),I.flowing&&!I.reading&&R.read(0)}oe.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function j(R){var I=R._readableState;for(h("flow",I.flowing);I.flowing&&R.read()!==null;);}oe.prototype.wrap=function(R){var I=this,b=this._readableState,E=!1;R.on("end",function(){if(h("wrapped end"),b.decoder&&!b.ended){var ie=b.decoder.end();ie&&ie.length&&I.push(ie)}I.push(null)}),R.on("data",function(ie){if(h("wrapped data"),b.decoder&&(ie=b.decoder.write(ie)),!(b.objectMode&&ie==null)&&!(!b.objectMode&&(!ie||!ie.length))){var Oe=I.push(ie);Oe||(E=!0,R.pause())}});for(var z in R)this[z]===void 0&&typeof R[z]=="function"&&(this[z]=function(Oe){return function(){return R[Oe].apply(R,arguments)}}(z));for(var re=0;re<ee.length;re++)R.on(ee[re],this.emit.bind(this,ee[re]));return this._read=function(ie){h("wrapped _read",ie),E&&(E=!1,R.resume())},this},typeof Symbol=="function"&&(oe.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=SP()),S(this)}),Object.defineProperty(oe.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(oe.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(oe.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(I){this._readableState&&(this._readableState.flowing=I)}}),oe._fromList=F,Object.defineProperty(oe.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function F(R,I){if(I.length===0)return null;var b;return I.objectMode?b=I.buffer.shift():!R||R>=I.length?(I.decoder?b=I.buffer.join(""):I.buffer.length===1?b=I.buffer.first():b=I.buffer.concat(I.length),I.buffer.clear()):b=I.buffer.consume(R,I.decoder),b}function Z(R){var I=R._readableState;h("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,process.nextTick(de,I,R))}function de(R,I){if(h("endReadableNT",R.endEmitted,R.length),!R.endEmitted&&R.length===0&&(R.endEmitted=!0,I.readable=!1,I.emit("end"),R.autoDestroy)){var b=I._writableState;(!b||b.autoDestroy&&b.finished)&&I.destroy()}}typeof Symbol=="function"&&(oe.from=function(R,I){return m===void 0&&(m=RP()),m(oe,R,I)});function Re(R,I){for(var b=0,E=R.length;b<E;b++)if(R[b]===I)return b;return-1}return Xc}var c_=ei,tf=ao.codes,AP=tf.ERR_METHOD_NOT_IMPLEMENTED,TP=tf.ERR_MULTIPLE_CALLBACK,IP=tf.ERR_TRANSFORM_ALREADY_TRANSFORMING,OP=tf.ERR_TRANSFORM_WITH_LENGTH_0,nf=ko();Ds(ei,nf);function CP(e,t){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(o===null)return this.emit("error",new TP);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),o(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function ei(e){if(!(this instanceof ei))return new ei(e);nf.call(this,e),this._transformState={afterTransform:CP.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",PP)}function PP(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Yp(e,t,r)}):Yp(this,null,null)}ei.prototype.push=function(e,t){return this._transformState.needTransform=!1,nf.prototype.push.call(this,e,t)};ei.prototype._transform=function(e,t,r){r(new AP("_transform()"))};ei.prototype._write=function(e,t,r){var o=this._transformState;if(o.writecb=r,o.writechunk=e,o.writeencoding=t,!o.transforming){var a=this._readableState;(o.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}};ei.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ei.prototype._destroy=function(e,t){nf.prototype._destroy.call(this,e,function(r){t(r)})};function Yp(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new OP;if(e._transformState.transforming)throw new IP;return e.push(null)}var BP=$s,l_=c_;Ds($s,l_);function $s(e){if(!(this instanceof $s))return new $s(e);l_.call(this,e)}$s.prototype._transform=function(e,t,r){r(null,e)};var Qc;function LP(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var d_=ao.codes,xP=d_.ERR_MISSING_ARGS,NP=d_.ERR_STREAM_DESTROYED;function Zp(e){if(e)throw e}function MP(e){return e.setHeader&&typeof e.abort=="function"}function $P(e,t,r,o){o=LP(o);var a=!1;e.on("close",function(){a=!0}),Qc===void 0&&(Qc=vd),Qc(e,{readable:t,writable:r},function(f){if(f)return o(f);a=!0,o()});var u=!1;return function(f){if(!a&&!u){if(u=!0,MP(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();o(f||new NP("pipe"))}}}function Xp(e){e()}function DP(e,t){return e.pipe(t)}function jP(e){return!e.length||typeof e[e.length-1]!="function"?Zp:e.pop()}function UP(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=jP(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new xP("streams");var a,u=t.map(function(f,l){var h=l<t.length-1,d=l>0;return $P(f,h,d,function(p){a||(a=p),p&&u.forEach(Xp),!h&&(u.forEach(Xp),o(a))})});return t.reduce(DP)}var kP=UP;(function(e,t){t=e.exports=f_(),t.Stream=t,t.Readable=t,t.Writable=a_(),t.Duplex=ko(),t.Transform=c_,t.PassThrough=BP,t.finished=vd,t.pipeline=kP})(Bl,Bl.exports);var rf=Bl.exports,xl={exports:{}},el=65536,HP=4294967295;function WP(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
31
|
-
Use Chrome, Firefox or Internet Explorer 11`)}var FP=X1.Buffer,mu=Ke.crypto||Ke.msCrypto;mu&&mu.getRandomValues?xl.exports=qP:xl.exports=WP;function qP(e,t){if(e>HP)throw new RangeError("requested too many random bytes");var r=FP.allocUnsafe(e);if(e>0)if(e>el)for(var o=0;o<e;o+=el)mu.getRandomValues(r.slice(o,o+el));else mu.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}var VP=xl.exports;const zP=Ii(VP);var GP={exports:{}},Ed={},Sd={};Object.defineProperty(Sd,"__esModule",{value:!0});function KP(e){var t=4,r=e.length,o=r%t;if(!o)return e;var a=r,u=t-o,f=r+u,l=Buffer.alloc(f);for(l.write(e);u--;)l.write("=",a++);return l.toString()}Sd.default=KP;Object.defineProperty(Ed,"__esModule",{value:!0});var JP=Sd;function h_(e,t){return t===void 0&&(t="utf8"),Buffer.isBuffer(e)?Nl(e.toString("base64")):Nl(Buffer.from(e,t).toString("base64"))}function YP(e,t){return t===void 0&&(t="utf8"),Buffer.from(Rd(e),"base64").toString(t)}function Rd(e){return e=e.toString(),JP.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function Nl(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ZP(e){return Buffer.from(Rd(e),"base64")}var Vo=h_;Vo.encode=h_;Vo.decode=YP;Vo.toBase64=Rd;Vo.fromBase64=Nl;Vo.toBuffer=ZP;Ed.default=Vo;(function(e){e.exports=Ed.default,e.exports.default=e.exports})(GP);var g_={};const Qp=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];g_.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],w=e[9]^e[19]^e[29]^e[39]^e[49];let T=p^(a<<1|u>>>31),v=w^(u<<1|a>>>31);const k=e[0]^T,C=e[1]^v,P=e[10]^T,$=e[11]^v,L=e[20]^T,S=e[21]^v,m=e[30]^T,H=e[31]^v,ee=e[40]^T,ge=e[41]^v;T=r^(f<<1|l>>>31),v=o^(l<<1|f>>>31);const fe=e[2]^T,oe=e[3]^v,Ae=e[12]^T,be=e[13]^v,M=e[22]^T,N=e[23]^v,D=e[32]^T,K=e[33]^v,ne=e[42]^T,J=e[43]^v;T=a^(h<<1|d>>>31),v=u^(d<<1|h>>>31);const ue=e[4]^T,G=e[5]^v,Y=e[14]^T,ae=e[15]^v,me=e[24]^T,te=e[25]^v,ye=e[34]^T,we=e[35]^v,j=e[44]^T,F=e[45]^v;T=f^(p<<1|w>>>31),v=l^(w<<1|p>>>31);const Z=e[6]^T,de=e[7]^v,Re=e[16]^T,R=e[17]^v,I=e[26]^T,b=e[27]^v,E=e[36]^T,z=e[37]^v,re=e[46]^T,ie=e[47]^v;T=h^(r<<1|o>>>31),v=d^(o<<1|r>>>31);const Oe=e[8]^T,Le=e[9]^v,Ce=e[18]^T,ke=e[19]^v,Ee=e[28]^T,qe=e[29]^v,Rt=e[38]^T,ct=e[39]^v,Dt=e[48]^T,it=e[49]^v,Ze=k,jt=C,Pt=$<<4|P>>>28,st=P<<4|$>>>28,Lt=L<<3|S>>>29,dn=S<<3|L>>>29,nn=H<<9|m>>>23,Ht=m<<9|H>>>23,hn=ee<<18|ge>>>14,Kn=ge<<18|ee>>>14,Jn=fe<<1|oe>>>31,sr=oe<<1|fe>>>31,ar=be<<12|Ae>>>20,rn=Ae<<12|be>>>20,Bn=M<<10|N>>>22,on=N<<10|M>>>22,Br=K<<13|D>>>19,Yn=D<<13|K>>>19,ur=ne<<2|J>>>30,A=J<<2|ne>>>30,B=G<<30|ue>>>2,pe=ue<<30|G>>>2,_e=Y<<6|ae>>>26,Se=ae<<6|Y>>>26,bt=te<<11|me>>>21,vt=me<<11|te>>>21,fr=ye<<15|we>>>17,Bt=we<<15|ye>>>17,cr=F<<29|j>>>3,Lr=j<<29|F>>>3,lr=Z<<28|de>>>4,dr=de<<28|Z>>>4,Zn=R<<23|Re>>>9,zt=Re<<23|R>>>9,Ln=I<<25|b>>>7,vn=b<<25|I>>>7,sn=E<<21|z>>>11,Wt=z<<21|E>>>11,Pi=ie<<24|re>>>8,Bi=re<<24|ie>>>8,xr=Oe<<27|Le>>>5,hr=Le<<27|Oe>>>5,gr=Ce<<20|ke>>>12,xn=ke<<20|Ce>>>12,Li=qe<<7|Ee>>>25,pr=Ee<<7|qe>>>25,ri=Rt<<8|ct>>>24,ii=ct<<8|Rt>>>24,oi=Dt<<14|it>>>18,si=it<<14|Dt>>>18;e[0]=Ze^~ar&bt,e[1]=jt^~rn&vt,e[10]=lr^~gr&Lt,e[11]=dr^~xn&dn,e[20]=Jn^~_e&Ln,e[21]=sr^~Se&vn,e[30]=xr^~Pt&Bn,e[31]=hr^~st&on,e[40]=B^~Zn&Li,e[41]=pe^~zt&pr,e[2]=ar^~bt&sn,e[3]=rn^~vt&Wt,e[12]=gr^~Lt&Br,e[13]=xn^~dn&Yn,e[22]=_e^~Ln&ri,e[23]=Se^~vn&ii,e[32]=Pt^~Bn&fr,e[33]=st^~on&Bt,e[42]=Zn^~Li&nn,e[43]=zt^~pr&Ht,e[4]=bt^~sn&oi,e[5]=vt^~Wt&si,e[14]=Lt^~Br&cr,e[15]=dn^~Yn&Lr,e[24]=Ln^~ri&hn,e[25]=vn^~ii&Kn,e[34]=Bn^~fr&Pi,e[35]=on^~Bt&Bi,e[44]=Li^~nn&ur,e[45]=pr^~Ht&A,e[6]=sn^~oi&Ze,e[7]=Wt^~si&jt,e[16]=Br^~cr&lr,e[17]=Yn^~Lr&dr,e[26]=ri^~hn&Jn,e[27]=ii^~Kn&sr,e[36]=fr^~Pi&xr,e[37]=Bt^~Bi&hr,e[46]=nn^~ur&B,e[47]=Ht^~A&pe,e[8]=oi^~Ze&ar,e[9]=si^~jt&rn,e[18]=cr^~lr&gr,e[19]=Lr^~dr&xn,e[28]=hn^~Jn&_e,e[29]=Kn^~sr&Se,e[38]=Pi^~xr&Pt,e[39]=Bi^~hr&st,e[48]=ur^~B&Zn,e[49]=A^~pe&zt,e[0]^=Qp[t*2],e[1]^=Qp[t*2+1]}};const vu=g_;function Vs(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Vs.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Vs.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(vu.p1600(this.state),this.count=0)};Vs.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&vu.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),vu.p1600(this.state),this.count=0,this.squeezing=!0};Vs.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(vu.p1600(this.state),this.count=0);return t};Vs.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};const XP=()=>zP(32).toString("hex");function tu(){}const e0="SYN",tl="ACK",t0="BRK";class n0 extends rf.Duplex{constructor(t){let{name:r,target:o,targetWindow:a=window,targetOrigin:u="*"}=t;if(super({objectMode:!0}),Be(this,"_init",void 0),Be(this,"_haveSyn",void 0),Be(this,"_name",void 0),Be(this,"_target",void 0),Be(this,"_targetWindow",void 0),Be(this,"_targetOrigin",void 0),Be(this,"_onMessage",void 0),Be(this,"_synIntervalId",void 0),!r||!o)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=r,this._target=o,this._targetWindow=a,this._targetOrigin=u,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(t0,null,tu),this._haveSyn=!1,this._init=!1}_handShake(){this._write(e0,null,tu),this.cork()}_onData(t){if(!this._init)t===e0?(this._haveSyn=!0,this._write(tl,null,tu)):t===tl&&(this._init=!0,this._haveSyn||this._write(tl,null,tu),this.uncork());else if(t===t0)this._break();else try{this.push(t)}catch(r){this.emit("error",r)}}_postMessage(t){const r=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:t},r)}onMessage(t){const r=t.data;this._targetOrigin!=="*"&&t.origin!==this._targetOrigin||t.source!==this._targetWindow||typeof r!="object"||r.target!==this._name||!r.data||this._onData(r.data)}_read(){}_write(t,r,o){this._postMessage(t),o()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function r0(e,t,r){try{Reflect.apply(e,t,r)}catch(o){setTimeout(()=>{throw o})}}function QP(e){const t=e.length,r=new Array(t);for(let o=0;o<t;o+=1)r[o]=e[o];return r}class of extends Ti.EventEmitter{emit(t){let r=t==="error";const o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;for(var a=arguments.length,u=new Array(a>1?a-1:0),f=1;f<a;f++)u[f-1]=arguments[f];if(r){let h;if(u.length>0&&([h]=u),h instanceof Error)throw h;const d=new Error(`Unhandled error.${h?` (${h.message})`:""}`);throw d.context=h,d}const l=o[t];if(l===void 0)return!1;if(typeof l=="function")r0(l,this,u);else{const h=l.length,d=QP(l);for(let p=0;p<h;p+=1)r0(d[p],this,u)}return!0}}class Ss extends Error{constructor(t){let{code:r,message:o,data:a}=t;if(!Number.isInteger(r))throw new Error("code must be an integer");if(!o||typeof o!="string")throw new Error("message must be string");super(o),Be(this,"code",void 0),Be(this,"data",void 0),this.code=r,a!==void 0&&(this.data=a)}toString(){return p2({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const Ml=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(o,a)=>{o||a.error?t(o||a.error):!r||Array.isArray(a)?e(a):e(a.result)}};function eB(){const e={};function t(){return!1}const r=new of;function o(h){const d=e[h.id];if(!d)throw new Error(`StreamMiddleware - Unknown response id "${h.id}"`);delete e[h.id],Object.assign(d.res,h),setTimeout(d.end)}function a(h){r.emit("notification",h)}function u(h,d,p){let w;try{!h.id?a(h):o(h)}catch(T){w=T}p(w)}const f=new rf.Duplex({objectMode:!0,read:t,write:u});return{events:r,middleware:(h,d,p,w)=>{f.push(h),e[h.id]={req:h,res:d,next:p,end:w}},stream:f}}function tB(){return(e,t,r,o)=>{const a=e.id,u=XP();e.id=u,t.id=u,r(f=>{e.id=a,t.id=a,f()})}}function i0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function nB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?i0(Object(r),!0).forEach(function(o){Be(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i0(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class Jr extends of{constructor(){super(),Be(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(t,r,o){const a=[];let u=null,f=!1;for(const l of o)if([u,f]=await Jr._runMiddleware(t,r,l,a),f)break;return[u,f,a.reverse()]}static _runMiddleware(t,r,o,a){return new Promise(u=>{const f=h=>{const d=h||r.error;d&&(r.error=ir.serializeError(d)),u([d,!0])},l=h=>{r.error?f(r.error):(h&&(typeof h!="function"&&f(new Ss({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),a.push(h)),u([null,!1]))};try{o(t,r,l,f)}catch(h){f(h)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((o,a)=>{r(u=>u?a(u):o())})}static _checkForCompletion(t,r,o){if(!("result"in r)&&!("error"in r))throw new Ss({code:-32603,message:"Response has no error or result for request"});if(!o)throw new Ss({code:-32603,message:"Nothing ended request"})}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,o,a)=>{try{const[u,f,l]=await Jr._runAllMiddleware(t,r,this._middleware);return f?(await Jr._runReturnHandlers(l),a(u)):o(async h=>{try{await Jr._runReturnHandlers(l)}catch(d){return h(d)}return h()})}catch(u){return a(u)}}}async _handleBatch(t,r){try{const o=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,o):o}catch(o){if(r)return r(o);throw o}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(o,a)=>{r(a)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const f=new Ss({code:-32603,message:"request must be plain object"});return r(f,{id:void 0,jsonrpc:"2.0",error:f})}if(typeof t.method!="string"){const f=new Ss({code:-32603,message:"method must be string"});return r(f,{id:t.id,jsonrpc:"2.0",error:f})}const o=nB({},t),a={id:o.id,jsonrpc:o.jsonrpc};let u=null;try{await this._processRequest(o,a)}catch(f){u=f}return u&&(delete a.result,a.error||(a.error=ir.serializeError(u))),r(u,a)}async _processRequest(t,r){const[o,a,u]=await Jr._runAllMiddleware(t,r,this._middleware);if(Jr._checkForCompletion(t,r,a),await Jr._runReturnHandlers(u),o)throw o}}class rB extends rf.Duplex{constructor(t){let{parent:r,name:o}=t;super({objectMode:!0}),Be(this,"_parent",void 0),Be(this,"_name",void 0),this._parent=r,this._name=o}_read(){}_write(t,r,o){this._parent.push({name:this._name,data:t}),o()}}function o0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function s0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o0(Object(r),!0).forEach(function(o){Be(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o0(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}const a0=Symbol("IGNORE_SUBSTREAM");class iB extends rf.Duplex{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(s0(s0({},t),{},{objectMode:!0})),Be(this,"_substreams",void 0),Be(this,"getStream",void 0),this._substreams={}}createStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);const r=new rB({parent:this,name:t});return this._substreams[t]=r,oB(this,o=>r.destroy(o||void 0)),r}ignoreStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);this._substreams[t]=a0}_read(){}_write(t,r,o){const{name:a,data:u}=t;if(!a)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${t}"`),o();const f=this._substreams[a];return f?(f!==a0&&f.push(u),o()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${a}"`),o())}}function oB(e,t){const r=XI(t);Ap(e,{readable:!1},r),Ap(e,{writable:!1},r)}const Or=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";Or.writable=e=>Or(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";Or.readable=e=>Or(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";Or.duplex=e=>Or.writable(e)&&Or.readable(e);Or.transform=e=>Or.duplex(e)&&typeof e._transform=="function";var sB=Or,aB=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,a,u;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(a=o;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(u=Object.keys(t),o=u.length,o!==Object.keys(r).length)return!1;for(a=o;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,u[a]))return!1;for(a=o;a--!==0;){var f=u[a];if(!e(t[f],r[f]))return!1}return!0}return t!==t&&r!==r};const uB=Ii(aB);var fB="0.3.4",Tr={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:e=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:e=>`Invalid options. Received: { maxEventListeners: ${e}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`Torus: Connected to chain with ID "${e}".`},warnings:{}};const cB={PRODUCTION:"production",DEVELOPMENT:"development",TESTING:"testing"},As={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},nl={GOOGLE:"google",FACEBOOK:"facebook",REDDIT:"reddit",DISCORD:"discord",TWITCH:"twitch",APPLE:"apple",LINE:"line",GITHUB:"github",KAKAO:"kakao",LINKEDIN:"linkedin",TWITTER:"twitter",WEIBO:"weibo",WECHAT:"wechat",EMAIL_PASSWORDLESS:"email_passwordless"},lB={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var Ad={supportedVerifierList:[nl.GOOGLE,nl.REDDIT,nl.DISCORD],api:"https://api.tor.us",translations:lB,prodTorusUrl:"",localStorageKeyPrefix:"torus-"},ft=yu.getLogger("solana-embed");function dB(){return(e,t,r)=>{(typeof e.method!="string"||!e.method)&&(t.error=ir.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),r(o=>{const{error:a}=t;return a&&ft.error(`Torus - RPC Error: ${a.message}`,a),o()})}}function hB(e,t,r){let o=`Torus: Lost connection to "${e}".`;t!=null&&t.stack&&(o+=`
|
|
32
|
-
${t.stack}`),ft.warn(o),r&&r.listenerCount("error")>0&&r.emit("error",o)}const nu=()=>Math.random().toString(36).slice(2),p_=async e=>{let t,r;switch(e){case"testing":t="https://solana-testing.tor.us",r="debug";break;case"development":t="http://localhost:8080",r="debug";break;default:t="https://solana.tor.us",r="error";break}return{torusUrl:t,logLevel:r}},gB=()=>{let e=window.navigator.language||"en-US";const t=e.split("-");return e=Object.prototype.hasOwnProperty.call(Ad.translations,t[0])?t[0]:"en",e},pB={height:660,width:375},bB={height:740,width:1315},yB={height:700,width:1200},b_={height:600,width:400};function _B(e){let t;try{t=window[e];const r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return r&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0}}function Os(e){let{width:t,height:r}=e;const o=window.screenLeft!==void 0?window.screenLeft:window.screenX,a=window.screenTop!==void 0?window.screenTop:window.screenY,u=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,f=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,l=1,h=Math.abs((u-t)/2/l+o),d=Math.abs((f-r)/2/l+a);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${r/l},width=${t/l},top=${d},left=${h}`}class y_ extends of{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:a="provider"}=r;if(super(),Be(this,"isTorus",void 0),Be(this,"_rpcEngine",void 0),Be(this,"jsonRpcConnectionEvents",void 0),Be(this,"_state",void 0),!sB.duplex(t))throw new Error(Tr.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(o),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this);const u=new iB;Ip(t,u,t,this._handleStreamDisconnect.bind(this,"Torus")),u.ignoreStream("phishing");const f=eB();Ip(f.stream,u.createStream(a),f.stream,this._handleStreamDisconnect.bind(this,"Torus RpcProvider"));const l=new Jr;l.push(tB()),l.push(dB()),l.push(sP({origin:location.origin})),l.push(f.middleware),this._rpcEngine=l,this.jsonRpcConnectionEvents=f.events}async request(t){if(!t||typeof t!="object"||Array.isArray(t))throw ir.ethErrors.rpc.invalidRequest({message:Tr.errors.invalidRequestArgs(),data:t});const{method:r,params:o}=t;if(typeof r!="string"||r.length===0)throw ir.ethErrors.rpc.invalidRequest({message:Tr.errors.invalidRequestMethod(),data:t});if(o!==void 0&&!Array.isArray(o)&&(typeof o!="object"||o===null))throw ir.ethErrors.rpc.invalidRequest({message:Tr.errors.invalidRequestParams(),data:t});return new Promise((a,u)=>{this._rpcRequest({method:r,params:o},Ml(a,u))})}send(t,r){this._rpcRequest(t,r)}sendAsync(t){return new Promise((r,o)=>{this._rpcRequest(t,Ml(r,o))})}_handleStreamDisconnect(t,r){hB(t,r,this),this._handleDisconnect(!1,r?r.message:void 0)}}const wB=function(e,t,r){for(var o=arguments.length,a=new Array(o>3?o-3:0),u=3;u<o;u++)a[u-3]=arguments[u];const f=()=>{r(...a),e.removeEventListener(t,f)};e.addEventListener(t,f)};async function __(){return new Promise(e=>{document.readyState!=="loading"?e():wB(document,"DOMContentLoaded",e)})}const xo=e=>{const t=window.document.createElement("template"),r=e.trim();return t.innerHTML=r,t.content.firstChild};function ru(e){return e.version===void 0}class w_ extends of{constructor(t){let{url:r,target:o,features:a}=t;super(),Be(this,"url",void 0),Be(this,"target",void 0),Be(this,"features",void 0),Be(this,"window",void 0),Be(this,"windowTimer",void 0),Be(this,"iClosedWindow",void 0),this.url=r,this.target=o||"_blank",this.features=a||Os(yB),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){var t;return this.window=window.open(this.url.href,this.target,this.features),(t=this.window)!=null&&t.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(t){t?window.location.replace(this.url.href):window.location.href=this.url.href}}function u0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function mB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u0(Object(r),!0).forEach(function(o){Be(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u0(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class sf extends y_{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:a="provider"}=r;super(t,{maxEventListeners:o,jsonRpcStreamName:a}),Be(this,"embedTranslations",void 0),Be(this,"torusUrl",void 0),Be(this,"dappStorageKey",void 0),Be(this,"windowRefs",void 0),Be(this,"tryWindowHandle",void 0),Be(this,"torusAlertContainer",void 0),Be(this,"torusIframe",void 0),this._state=mB({},sf._defaultState),this.torusUrl="",this.dappStorageKey="";const u=Ad.translations[gB()];this.embedTranslations=u.embed,this.windowRefs={},this.on("connect",()=>{this._state.isConnected=!0});const f=l=>{const{method:h,params:d}=l;if(h===Es.IFRAME_STATUS){const{isFullScreen:p,rid:w}=d;this._displayIframe({isFull:p,rid:w})}else if(h===Es.CREATE_WINDOW){const{windowId:p,url:w}=d;this._createPopupBlockAlert(p,w)}else if(h===Es.CLOSE_WINDOW)this._handleCloseWindow(d);else if(h===Es.USER_LOGGED_IN){const{currentLoginProvider:p}=d;this._state.isLoggedIn=!0,this._state.currentLoginProvider=p}else h===Es.USER_LOGGED_OUT&&(this._state.isLoggedIn=!1,this._state.currentLoginProvider=null,this._displayIframe())};this.jsonRpcConnectionEvents.on("notification",f)}get isLoggedIn(){return this._state.isLoggedIn}get isIFrameFullScreen(){return this._state.isIFrameFullScreen}isConnected(){return this._state.isConnected}async _initializeState(t){try{const{torusUrl:r,dappStorageKey:o,torusAlertContainer:a,torusIframe:u}=t;this.torusUrl=r,this.dappStorageKey=o,this.torusAlertContainer=a,this.torusIframe=u,this.torusIframe.addEventListener("load",()=>{this._state.isIFrameFullScreen||this._displayIframe()});const{currentLoginProvider:f,isLoggedIn:l}=await this.request({method:Er.GET_PROVIDER_STATE,params:[]});this._handleConnect(f,l)}catch(r){ft.error("Torus: Failed to get initial state. Please report this bug.",r)}finally{ft.info("initialized communication state"),this._state.initialized=!0,this.emit("_initialized")}}_handleWindow(t){let{url:r,target:o,features:a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const u=new URL(r||`${this.torusUrl}/redirect?windowId=${t}`);this.dappStorageKey&&(u.hash?u.hash+=`&dappStorageKey=${this.dappStorageKey}`:u.hash=`#dappStorageKey=${this.dappStorageKey}`);const f=new w_({url:u,target:o,features:a});if(f.open(),!f.window){this._createPopupBlockAlert(t,u.href);return}this.windowRefs[t]=f,this.request({method:Er.OPENED_WINDOW,params:{windowId:t}}),f.once("close",()=>{delete this.windowRefs[t],this.request({method:Er.CLOSED_WINDOW,params:{windowId:t}})})}_displayIframe(){let{isFull:t=!1,rid:r=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const o={};if(t)o.display="block",o.width="100%",o.height="100%",o.top="0px",o.right="0px",o.left="0px",o.bottom="0px";else switch(o.display=this._state.torusWidgetVisibility?"block":"none",o.height="70px",o.width="70px",this._state.buttonPosition){case As.TOP_LEFT:o.top="0px",o.left="0px",o.right="auto",o.bottom="auto";break;case As.TOP_RIGHT:o.top="0px",o.right="0px",o.left="auto",o.bottom="auto";break;case As.BOTTOM_RIGHT:o.bottom="0px",o.right="0px",o.top="auto",o.left="auto";break;case As.BOTTOM_LEFT:default:o.bottom="0px",o.left="0px",o.top="auto",o.right="auto";break}Object.assign(this.torusIframe.style,o),this._state.isIFrameFullScreen=t,this.request({method:Er.IFRAME_STATUS,params:{isIFrameFullScreen:t,rid:r}})}hideTorusButton(){this._state.torusWidgetVisibility=!1,this._displayIframe()}showTorusButton(){this._state.torusWidgetVisibility=!0,this._displayIframe()}_rpcRequest(t,r){const o=r,a=t;Array.isArray(a)||a.jsonrpc||(a.jsonrpc="2.0"),this.tryWindowHandle(a,o)}_handleConnect(t,r){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{currentLoginProvider:t,isLoggedIn:r}),ft.debug(Tr.info.connected(t)))}_handleDisconnect(t,r){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){this._state.isConnected=!1;let o;t?(o=new ir.EthereumRpcError(1013,r||Tr.errors.disconnected()),ft.debug(o)):(o=new ir.EthereumRpcError(1011,r||Tr.errors.permanentlyDisconnected()),ft.error(o),this._state.currentLoginProvider=null,this._state.isLoggedIn=!1,this._state.torusWidgetVisibility=!1,this._state.isIFrameFullScreen=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",o)}}_handleCloseWindow(t){const{windowId:r}=t;this.windowRefs[r]&&(this.windowRefs[r].close(),delete this.windowRefs[r])}async _createPopupBlockAlert(t,r){const o=this.getLogoUrl(),a=xo(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${o}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),u=xo(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),f=xo('<div id="torusAlert__btn-container"></div>');f.appendChild(u),a.appendChild(f);const l=()=>{u.addEventListener("click",()=>{this._handleWindow(t,{url:r,target:"_blank",features:Os(b_)}),a.remove(),this.torusAlertContainer.children.length===0&&(this.torusAlertContainer.style.display="none")})},h=()=>{this.torusAlertContainer.appendChild(a)};await __(),h(),l(),this.torusAlertContainer.style.display="block"}getLogoUrl(){return`${this.torusUrl}/images/torus_icon-blue.svg`}}Be(sf,"_defaultState",{buttonPosition:"bottom-left",currentLoginProvider:null,isIFrameFullScreen:!1,hasEmittedConnection:!1,torusWidgetVisibility:!1,initialized:!1,isLoggedIn:!1,isPermanentlyDisconnected:!1,isConnected:!1});function f0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function vB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?f0(Object(r),!0).forEach(function(o){Be(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f0(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}class af extends y_{constructor(t,r){let{maxEventListeners:o=100,jsonRpcStreamName:a="provider"}=r;super(t,{maxEventListeners:o,jsonRpcStreamName:a}),Be(this,"chainId",void 0),Be(this,"selectedAddress",void 0),Be(this,"tryWindowHandle",void 0),this._state=vB({},af._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this.on("connect",()=>{this._state.isConnected=!0});const u=f=>{const{method:l,params:h}=f;l===Vc.ACCOUNTS_CHANGED?this._handleAccountsChanged(h):l===Vc.UNLOCK_STATE_CHANGED?this._handleUnlockStateChanged(h):l===Vc.CHAIN_CHANGED&&this._handleChainChanged(h)};this.jsonRpcConnectionEvents.on("notification",u)}isConnected(){return this._state.isConnected}async _initializeState(){try{const{accounts:t,chainId:r,isUnlocked:o}=await this.request({method:oP.GET_PROVIDER_STATE,params:[]});this.emit("connect",{chainId:r}),this._handleChainChanged({chainId:r}),this._handleUnlockStateChanged({accounts:t,isUnlocked:o}),this._handleAccountsChanged(t)}catch(t){ft.error("Torus: Failed to get initial state. Please report this bug.",t)}finally{ft.info("initialized provider state"),this._state.initialized=!0,this.emit("_initialized")}}_rpcRequest(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=r;const u=t;if(!Array.isArray(u)){if(u.jsonrpc||(u.jsonrpc="2.0"),u.method==="solana_accounts"||u.method==="solana_requestAccounts")a=(f,l)=>{this._handleAccountsChanged(l.result||[],u.method==="solana_accounts",o),r(f,l)};else if(u.method==="wallet_getProviderState"){this._rpcEngine.handle(t,a);return}}this.tryWindowHandle(u,a)}_handleConnect(t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:t}),ft.debug(Tr.info.connected(t)))}_handleDisconnect(t,r){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){this._state.isConnected=!1;let o;t?(o=new ir.EthereumRpcError(1013,r||Tr.errors.disconnected()),ft.debug(o)):(o=new ir.EthereumRpcError(1011,r||Tr.errors.permanentlyDisconnected()),ft.error(o),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",o)}}_handleAccountsChanged(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=t;Array.isArray(a)||(ft.error("Torus: Received non-array accounts parameter. Please report this bug.",a),a=[]);for(const u of t)if(typeof u!="string"){ft.error("Torus: Received non-string account. Please report this bug.",t),a=[];break}uB(this._state.accounts,a)||(r&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!o&&ft.error('Torus: "solana_accounts" unexpectedly updated accounts. Please report this bug.',a),this._state.accounts=a,this.emit("accountsChanged",a)),this.selectedAddress!==a[0]&&(this.selectedAddress=a[0]||null)}_handleChainChanged(){let{chainId:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!t){ft.error("Torus: Received invalid network parameters. Please report this bug.",{chainId:t});return}t==="loading"?this._handleDisconnect(!0):(this._handleConnect(t),t!==this.chainId&&(this.chainId=t,this._state.initialized&&this.emit("chainChanged",this.chainId)))}_handleUnlockStateChanged(){let{accounts:t,isUnlocked:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof r!="boolean"){ft.error("Torus: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:r});return}r!==this._state.isUnlocked&&(this._state.isUnlocked=r,this._handleAccountsChanged(t||[]))}}Be(af,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});function c0(e){return new Promise((t,r)=>{try{const o=document.createElement("img");o.onload=()=>t(!0),o.onerror=()=>t(!1),o.src=e}catch(o){r(o)}})}const EB=e=>{const{document:t}=e,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;const o=t.querySelector('head > meta[name="title"]');return o?o.content:t.title&&t.title.length>0?t.title:e.location.hostname};async function SB(e){try{const{document:t}=e;let r=t.querySelector('head > link[rel="shortcut icon"]');return r&&await c0(r.href)||(r=Array.from(t.querySelectorAll('head > link[rel="icon"]')).find(o=>!!o.href),r&&await c0(r.href))?r.href:""}catch{return""}}const RB=async()=>({name:EB(window),icon:await SB(window)});function l0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function rl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l0(Object(r),!0).forEach(function(o){Be(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l0(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}const AB=["send_transaction","sign_transaction","sign_all_transactions","sign_message","connect"],TB=[Er.SET_PROVIDER],IB=_B("localStorage");(async function(){try{if(typeof document>"u")return;const t=document.createElement("link"),{torusUrl:r}=await p_("production");t.href=`${r}/frame`,t.crossOrigin="anonymous",t.type="text/html",t.rel="prefetch",t.relList&&t.relList.supports&&t.relList.supports("prefetch")&&document.head.appendChild(t)}catch(t){ft.warn(t)}})();class DB{constructor(){let{modalZIndex:t=99999}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Be(this,"isInitialized",void 0),Be(this,"torusAlert",void 0),Be(this,"modalZIndex",void 0),Be(this,"alertZIndex",void 0),Be(this,"requestedLoginProvider",void 0),Be(this,"provider",void 0),Be(this,"communicationProvider",void 0),Be(this,"dappStorageKey",void 0),Be(this,"isTopupHidden",!1),Be(this,"torusAlertContainer",void 0),Be(this,"torusUrl",void 0),Be(this,"torusIframe",void 0),Be(this,"styleLink",void 0),this.torusUrl="",this.isInitialized=!1,this.requestedLoginProvider=null,this.modalZIndex=t,this.alertZIndex=t+1e3,this.dappStorageKey=""}get isLoggedIn(){return this.communicationProvider?this.communicationProvider.isLoggedIn:!1}async init(){let{buildEnv:t=cB.PRODUCTION,enableLogging:r=!1,network:o,showTorusButton:a=!1,useLocalStorage:u=!1,buttonPosition:f=As.BOTTOM_LEFT,apiKey:l="torus-default",extraParams:h={},whiteLabel:d}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.isInitialized)throw new Error("Already initialized");const{torusUrl:p,logLevel:w}=await p_(t);ft.enableAll(),ft.info(p,"url loaded"),ft.info(`Solana Embed Version :${fB}`),this.torusUrl=p,ft.setDefaultLevel(w),r?ft.enableAll():ft.disableAll();const T=this.handleDappStorageKey(u),v=new URL(p);v.pathname.endsWith("/")?v.pathname+="frame":v.pathname+="/frame";const k=new URLSearchParams;T&&k.append("dappStorageKey",T),k.append("origin",window.location.origin),v.hash=k.toString(),this.torusIframe=xo(`<iframe
|
|
33
|
-
id="torusIframe"
|
|
34
|
-
class="torusIframe"
|
|
35
|
-
src="${v.href}"
|
|
36
|
-
style="display: none; position: fixed; top: 0; right: 0; width: 100%;
|
|
37
|
-
height: 100%; border: none; border-radius: 0; z-index: ${this.modalZIndex.toString()}"
|
|
38
|
-
></iframe>`),this.torusAlertContainer=xo(`<div id="torusAlertContainer" style="display:none; z-index: ${this.alertZIndex.toString()}"></div>`),this.styleLink=xo(`<link href="${p}/css/widget.css" rel="stylesheet" type="text/css">`);const C=async()=>new Promise((P,$)=>{try{window.document.head.appendChild(this.styleLink),window.document.body.appendChild(this.torusIframe),window.document.body.appendChild(this.torusAlertContainer),this.torusIframe.addEventListener("load",async()=>{const L=await RB();this.torusIframe.contentWindow.postMessage({buttonPosition:f,apiKey:l,network:o,dappMetadata:L,extraParams:h,whiteLabel:d},v.origin),await this._setupWeb3({torusUrl:p}),a&&this.showTorusButton(),d!=null&&d.topupHide?this.isTopupHidden=d.topupHide:this.hideTorusButton(),this.isInitialized=!0,window.torus=this,P()})}catch(L){$(L)}});await __(),await C()}async login(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.isInitialized)throw new Error("Call init() first");try{this.requestedLoginProvider=t.loginProvider||null,this.requestedLoginProvider||this.communicationProvider._displayIframe({isFull:!0});const r=await new Promise((o,a)=>{this.provider._rpcRequest({method:"solana_requestAccounts",params:[this.requestedLoginProvider,t.login_hint]},Ml(o,a))});if(Array.isArray(r)&&r.length>0)return r;throw new Error("Login failed")}catch(r){throw ft.error("login failed",r),r}finally{this.communicationProvider.isIFrameFullScreen&&this.communicationProvider._displayIframe()}}async loginWithPrivateKey(t){if(!this.isInitialized)throw new Error("Call init() first");const{privateKey:r,userInfo:o}=t,{success:a}=await this.communicationProvider.request({method:"login_with_private_key",params:{privateKey:r,userInfo:o}});if(!a)throw new Error("Login Failed")}async logout(){if(!this.communicationProvider.isLoggedIn)throw new Error("Not logged in");await this.communicationProvider.request({method:Er.LOGOUT,params:[]}),this.requestedLoginProvider=null}async cleanUp(){this.communicationProvider.isLoggedIn&&await this.logout(),this.clearInit()}clearInit(){function t(r){return r instanceof Element||r instanceof Document}t(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink=void 0),t(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe=void 0),t(this.torusAlertContainer)&&window.document.body.contains(this.torusAlertContainer)&&(this.torusAlert=void 0,this.torusAlertContainer.remove(),this.torusAlertContainer=void 0),this.isInitialized=!1}hideTorusButton(){this.communicationProvider.hideTorusButton()}showTorusButton(){this.communicationProvider.showTorusButton()}async setProvider(t){await this.communicationProvider.request({method:Er.SET_PROVIDER,params:rl({},t)})}async showWallet(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=await this.communicationProvider.request({method:Er.WALLET_INSTANCE_ID,params:[]}),a=t?`/${t}`:"",u=new URL(`${this.torusUrl}/wallet${a}`);u.searchParams.append("instanceId",o),Object.keys(r).forEach(l=>{u.searchParams.append(l,r[l])}),this.dappStorageKey&&(u.hash=`#dappStorageKey=${this.dappStorageKey}`),new w_({url:u,features:Os(bB)}).open()}async getUserInfo(){return await this.communicationProvider.request({method:Er.USER_INFO,params:[]})}async initiateTopup(t,r){if(!this.isInitialized)throw new Error("Torus is not initialized");const o=nu();return this.communicationProvider._handleWindow(o),await this.communicationProvider.request({method:Er.TOPUP,params:{provider:t,params:r,windowId:o}})}async getAccounts(){return await this.provider.request({method:"getAccounts",params:[]})}async sendTransaction(t){const r=ru(t),o=r?t.serialize({requireAllSignatures:!1}).toString("hex"):Buffer.from(t.serialize()).toString("hex");return await this.provider.request({method:"send_transaction",params:{message:o,isLegacyTransaction:r}})}async signAndSendTransaction(t,r){const o=ru(t),a=o?t.serialize({requireAllSignatures:!1}).toString("hex"):Buffer.from(t.serialize()).toString("hex");return{signature:await this.provider.request({method:"send_transaction",params:{message:a,options:r,isLegacyTransaction:o}})}}async signTransaction(t){const r=ru(t),o=r?t.serializeMessage().toString("hex"):Buffer.from(t.message.serialize()).toString("hex"),a=await this.provider.request({method:"sign_transaction",params:{message:o,messageOnly:!0,isLegacyTransaction:r}}),u=JSON.parse(a),f={publicKey:new Pg(u.publicKey),signature:Buffer.from(u.signature,"hex")};return t.addSignature(f.publicKey,f.signature),t}async signAllTransactions(t){let r;const o=t.map(f=>(r=ru(f),r?f.serializeMessage().toString("hex"):Buffer.from(f.message.serialize()).toString("hex"))),u=(await this.provider.request({method:"sign_all_transactions",params:{message:o,messageOnly:!0,isLegacyTransaction:r}})).map(f=>{const l=JSON.parse(f);return{publicKey:new Pg(l.publicKey),signature:Buffer.from(l.signature,"hex")}});return t.forEach((f,l)=>(f.addSignature(u[l].publicKey,u[l].signature),f)),t}async signMessage(t){return await this.provider.request({method:"sign_message",params:{data:t}})}async getGaslessPublicKey(){return await this.provider.request({method:"get_gasless_public_key",params:[]})}handleDappStorageKey(t){const r=`${Ad.localStorageKeyPrefix}${window.location.hostname}`;let o="";if(IB&&t){const a=window.localStorage.getItem(r);if(a)o=a;else{const u=`torus-app-${nu()}`;window.localStorage.setItem(r,u),o=u}}return this.dappStorageKey=o,o}async _setupWeb3(t){ft.info("setupWeb3 running");const r=new n0({name:"embed_torus",target:"iframe_torus",targetWindow:this.torusIframe.contentWindow}),o=new n0({name:"embed_communication",target:"iframe_communication",targetWindow:this.torusIframe.contentWindow}),a=new af(r,{}),u=new sf(o,{});a.tryWindowHandle=(d,p)=>{const w=d;if(!Array.isArray(w)&&AB.includes(w.method)){if(!this.communicationProvider.isLoggedIn)throw new Error("User Not Logged In");const T=nu();u._handleWindow(T,{target:"_blank",features:Os(b_)}),w.windowId=T}a._rpcEngine.handle(w,p)},u.tryWindowHandle=(d,p)=>{const w=d;if(!Array.isArray(w)&&TB.includes(w.method)){const T=nu();u._handleWindow(T,{target:"_blank",features:Os(pB)}),w.params.windowId=T}u._rpcEngine.handle(w,p)};const f=d=>{const p=a[d],w=this;a[d]=function(v,k){const{method:C,params:P=[]}=v;if(C==="solana_requestAccounts"){if(!k)return w.login({loginProvider:P[0]});w.login({loginProvider:P[0]}).then($=>k(null,$)).catch($=>k($))}return p.apply(this,[v,k])}};f("request"),f("sendAsync"),f("send");const l=new Proxy(a,{deleteProperty:()=>!0}),h=new Proxy(u,{deleteProperty:()=>!0});this.provider=l,this.communicationProvider=h,await Promise.all([a._initializeState(),u._initializeState(rl(rl({},t),{},{dappStorageKey:this.dappStorageKey,torusAlertContainer:this.torusAlertContainer,torusIframe:this.torusIframe}))]),ft.debug("Torus - injected provider")}}export{As as BUTTON_POSITION,nl as LOGIN_PROVIDER,cB as TORUS_BUILD_ENV,af as TorusInPageProvider,DB as default};
|