@ar.io/sdk 3.13.0-alpha.1 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -240,7 +240,7 @@ Use Chrome, Firefox or Internet Explorer 11`)},a9=_n.Buffer,Mre=bu.Transform,Bi(
|
|
|
240
240
|
`,`${r?`content-type: ${r.trim()}`:""}\r
|
|
241
241
|
`,t,`\r
|
|
242
242
|
--${n}--\r
|
|
243
|
-
`]);return{boundary:n,body:l}}async function jSt(t){let r=await t.arrayBuffer(),n=await crypto.subtle.digest("SHA-256",r);return DSt.Buffer.from(n)}async function vfe({processId:t,data:r,tags:n,anchor:l}){let i=new Headers;t&&i.append("target",t),l&&i.append("anchor",l),n&&n.forEach(p=>i.append(p.name,p.value)),i.set("Variant","ao.N.1");let d;if(r){let p=i.get("content-type"),v=await USt(r,p);d=v.body,i.set("Content-Type",`multipart/form-data; boundary="${v.boundary}"`);let _=await jSt(d);i.append("Content-Digest",`sha-256=:${qSt(_)}:`)}return{headers:i,body:d}}function bfe({url:t,method:r,headers:n}){return n=new Headers(n),{fields:[...n.keys()].sort(),request:{url:t,method:r,headers:{...Object.fromEntries(n)}}}}function FSt(t){return`http-sig-${[...$St(t).subarray(1,9)].map(r=>r.toString(16).padStart(2,"0")).join("")}`}function zSt({fetch:t,logger:r,HB_URL:n,signer:l}){let i=r.child("deployProcess");return d=>wi(d).chain(Ji(({processId:p,data:v,tags:_})=>vfe({processId:p,data:v,tags:_}))).chain(Ji(({headers:p,body:v})=>l(bfe({url:`${n}/~scheduler@1.0/schedule`,method:"POST",headers:p})).then(_=>({..._,body:v})))).map(i.tap("Sending HTTP signed message to HB MU: %o")).chain(p=>wi(p).chain(Ji(({url:v,method:_,headers:y,body:w})=>t(v,{method:_,headers:y,body:w,redirect:"follow"}))).bichain(v=>Mc(v),Ji(async v=>{if(v.ok)return v.headers.get("process");throw new Error(`${v.status}: ${await v.text()}`)})).bimap(i.tap("Error encountered when deploying process via HB MU"),i.tap("Successfully deployed process via HB MU")).map(v=>({processId:v}))).toPromise()}function HSt({fetch:t,logger:r,HB_URL:n,signer:l}){let i=r.child("deployMessage");return d=>wi(d).chain(Ji(({processId:p,data:v,tags:_,anchor:y})=>vfe({processId:p,data:v,tags:_,anchor:y}))).chain(Ji(({headers:p,body:v})=>l(bfe({url:`${n}/~scheduler@1.0/schedule`,method:"POST",headers:p})).then(_=>({..._,body:v})))).map(i.tap("Sending HTTP signed message to HB MU: %o")).chain(p=>wi(p).chain(Ji(({url:v,method:_,headers:y,body:w})=>t(v,{method:_,headers:y,body:w,redirect:"follow"}))).bichain(v=>Mc(v),Ji(async v=>{if(v.ok)return v.headers.get("slot");throw new Error(`${v.status}: ${await v.text()}`)})).bimap(i.tap("Error encountered when writing message via HB MU"),i.tap("Successfully wrote message via HB MU")).map(v=>({messageId:v}))).toPromise()}function KSt({fetch:t,logger:r,HB_URL:n,signer:l}){let i=r.child("loadResult");return d=>wi(d).chain(Ji(async({id:p,processId:v})=>{let{headers:_,body:y}=await vfe({processId:v});return _.append("slot+integer",p),_.append("accept","application/json"),l(bfe({url:`${n}/~compute-lite@1.0/compute&slot+integer=${p}&process-id=${v}`,method:"POST",headers:_})).then(w=>({...w,body:y}))})).map(i.tap("fetching message result from HB CU: %o")).chain(p=>wi(p).chain(Ji(({url:v,method:_,headers:y,body:w})=>t(v,{method:_,headers:y,body:w,redirect:"follow"}))).bichain(v=>Mc(v),Ji(async v=>{if(v.ok)return v.json();throw new Error(`${v.status}: ${await v.text()}`)})).bimap(i.tap("Error encountered when writing message via HB CU"),i.tap("Successfully wrote message via HB CU"))).toPromise()}function ZSt({fetch:t,logger:r,HB_URL:n,signer:l}){return async(i,d)=>{let p=new URL(i);d.headers=new Headers(d.headers);let v=p.href,_=new URLSearchParams({"relay-path":v}),y=`${n}/~relay@1.0/call?${_.toString()}`;r('Relaying "%s" through HyperBEAM Node "%s"',p.href,y);let{headers:w}=await l({fields:[...d.headers.keys(),"relay-path"].sort(),request:{url:i,...d,headers:{...Object.fromEntries(d.headers),"relay-path":v}}});return t(y,{...d,headers:w})}}var WSt=uN(tyt(),1),jHe=(t="@permaweb/aoconnect")=>{let r=(0,WSt.default)(t);return r.child=n=>jHe(`${r.namespace}:${n}`),r.tap=(n,...l)=>TMt((...i)=>r(n,...l,...i)),r},FHe=({url:t,path:r})=>r?r.startsWith("/")?FHe({url:t,path:r.slice(1)}):(t=new URL(t),t.pathname+=r,t.toString()):t;function GSt(t){return a2(PN([]),a_((r,n)=>a2(xMt([],n.name),N_t(n.value),Nh(n.name,Ip,r))(r),{}),cfe(r=>r.length>1?r:r[0]))(t)}function XNe(t){return wHe([[q9(String),$9(t)],[q9(Array),dMt(t)],[sHe,z9t]])}function c6(t){let r;return q9(sl,t)?(r=new Error(VSt(t)),r.stack+=t.stack):q9(Error,t)?r=t:uMt("message",t)?r=new Error(t.message):q9(String,t)?r=new Error(t):r=new Error("An error occurred"),r}function VSt(t){return a2(r=>function n(l,i,d){return a_((p,v)=>a2(wHe([[$9(cr.invalid_arguments),()=>n(v.argumentsError,422,"Invalid Arguments")],[$9(cr.invalid_return_type),()=>n(v.returnTypeError,500,"Invalid Return")],[$9(cr.invalid_union),()=>V_t(_=>n(_,400,"Invalid Union"),v.unionErrors)],[sHe,()=>[{...v,status:i,contextCode:d}]]]),nMt(p))(v.code),[],l.issues)}(r,400,""),r=>a_((n,l)=>{let{message:i,path:d,contextCode:p}=l,v=d[1]||d[0],_=p?`${p} `:"";return n.push(`${_}'${v}': ${i}.`),n},[],r),yMt(" | "))(t)}var YSt=ar.object({id:ar.string().min(1,{message:"message is required to be a message id"}),processId:ar.string().min(1,{message:"process is required to be a process id"})});function JSt(){return t=>wi(t).map(YSt.parse).map(()=>t)}var B_=ar.object({name:ar.string(),value:ar.string()}),XSt=ar.function().args(ar.object({Id:ar.string(),Target:ar.string(),Owner:ar.string(),Anchor:ar.string().optional(),Data:ar.any().default("1234"),Tags:ar.array(ar.object({name:ar.string(),value:ar.string()}))})).returns(ar.promise(ar.any())),QSt=ar.function().args(ar.object({id:ar.string().min(1,{message:"message id is required"}),processId:ar.string().min(1,{message:"process id is required"})})).returns(ar.promise(ar.any())),ext=ar.function().args(ar.object({process:ar.string().min(1,{message:"process id is required"}),from:ar.string().optional(),to:ar.string().optional(),sort:ar.enum(["ASC","DESC"]).default("ASC"),limit:ar.number().optional()})).returns(ar.promise(ar.object({edges:ar.array(ar.object({cursor:ar.string(),node:ar.object({Output:ar.any().optional(),Messages:ar.array(ar.any()).optional(),Spawns:ar.array(ar.any()).optional(),Error:ar.any().optional()})}))}))),zHe=ar.function().args(ar.object({processId:ar.string(),data:ar.any(),tags:ar.array(B_),anchor:ar.string().optional(),signer:ar.any()})).returns(ar.promise(ar.object({messageId:ar.string()}).passthrough())),txt=ar.function().args(ar.object({data:ar.any(),tags:ar.array(B_),signer:ar.any()})).returns(ar.promise(ar.object({processId:ar.string()}).passthrough())),rxt=ar.function().args(ar.object({process:ar.string(),message:ar.string(),baseLayer:ar.boolean().optional(),exclude:ar.array(ar.string()).optional()})).returns(ar.promise(ar.object({assignmentId:ar.string()}).passthrough())),HHe=zHe,$0r=ar.function().args(ar.object({suUrl:ar.string().url(),processId:ar.string()})).returns(ar.promise(ar.object({tags:ar.array(B_)}).passthrough())),q0r=ar.function().args(ar.string()).returns(ar.promise(ar.object({url:ar.string()}))),ixt=ar.function().args(ar.string()).returns(ar.promise(ar.boolean())),nxt=ar.function().args(ar.string()).returns(ar.promise(ar.object({tags:ar.array(B_)}).passthrough())),ON=ar.function().args(ar.object({data:ar.any(),tags:ar.array(B_),target:ar.string().optional(),anchor:ar.string().optional()})).returns(ar.promise(ar.object({id:ar.string(),raw:ar.any()})));function axt({loadResult:t}){return t=Ji(QSt.implement(t)),r=>wi({id:r.id,processId:r.processId}).chain(t)}function ZX(t){let r=JSt(t),n=axt(t);return({message:l,process:i})=>wi({id:l,processId:i}).chain(r).chain(n).map(t.logger.tap('readResult result for message "%s": %O',l)).map(d=>d).bimap(c6,l6).toPromise()}var u6=(...t)=>r=>t.reduce((n,l)=>l(n),r),gfe=t=>r=>r??t,oxt=t=>r=>u6(n=>n&&n[r],gfe(t)),sxt=t=>r=>{let n={};for(let l in r)r.hasOwnProperty(l)&&(n[l]=t(r[l],l,r));return n},fxt=t=>(...r)=>!t(...r),NN=t=>r=>{let n=r.findIndex(i=>i.name==="Data-Protocol"&&i.value===t);if(n===-1)return[0,0];let l=r.findIndex((i,d)=>d>n&&i.name==="Data-Protocol"&&i.value!==t);return l===-1&&(l=r.length),[n,l]},yfe=t=>{let r=t.findIndex(n=>n.name==="Data-Protocol");return r===-1&&(r=t.length),r},KHe=t=>r=>r.name===t,wfe=(t,r)=>u6(NN(t),([n,l])=>r.slice(n,l))(r),ZHe=(t,r,n)=>u6(l=>wfe(t,l),l=>l.filter(KHe(r)))(n),hxt=(t,r,n)=>u6(l=>ZHe(t,r,l),l=>l[0])(n),CN=(t,r)=>(r=r.filter(n=>n.name!=="Data-Protocol"||n.value!==t),r.length?[{name:"Data-Protocol",value:t},...r]:[]),uxt=(t,r,n)=>{let[l,i]=NN(t)(n),[d,p,v]=[n.slice(0,l),n.slice(l,i),n.slice(i)];return p.length||(r=CN(t,r),d=v,v=[]),[d,p,r,v].flat(1)},lxt=(t,r)=>{let n=yfe(r),[l,i]=[r.slice(0,n),r.slice(n)];return[l,t,i].flat(1)},WHe=(t,r,n)=>{let[l,i]=NN(t)(n),[d,p]=[n.slice(0,l),n.slice(i)];return p.length===n.length&&(d=p,p=[]),[d,CN(t,r),p].flat(1)},cxt=(t,r)=>WHe(t,[],r),dxt=(t,r,n)=>{let[l,i]=NN(t)(n),[d,p,v]=[n.slice(0,l),n.slice(l,i),n.slice(i)];return[d,CN(t,p.filter(fxt(KHe(r)))),v].flat(1)},_fe=(t,r=!1)=>u6(gfe([]),n=>n.reduce((l,i)=>u6(oxt([])(i.name),d=>(d.push(i.value),d),d=>(l[i.name]=d,l))(l),{}),sxt(n=>r?n:n[0]))(t),GHe=(t,r,n)=>u6(gfe([]),l=>wfe(t,l),l=>_fe(l,n))(r),pxt=(t,r)=>GHe(t,r,!0),mxt=(t,r)=>GHe(t,r,!1),vxt=t=>{let r=yfe(t);return _fe(t.slice(0,r),!1)},bxt=t=>{let r=yfe(t);return _fe(t.slice(0,r),!0)},VHe=t=>({findAll:r=>wfe(t,r),findAllByName:(r,n)=>ZHe(t,r,n),findByName:(r,n)=>hxt(t,r,n),create:r=>CN(t,r),update:(r,n)=>WHe(t,r,n),concat:(r,n)=>uxt(t,r,n),removeAll:r=>cxt(t,r),removeAllByName:(r,n)=>dxt(t,r,n),parse:r=>mxt(t,r),parseAll:r=>pxt(t,r),concatUnassoc:lxt,parseUnassoc:vxt,parseAllUnassoc:bxt}),Mfe=VHe("ao"),QNe=O8(Mfe.removeAllByName),gxt=O8(Mfe.concat),eCe=O8(Mfe.concatUnassoc),yxt=ar.array(ar.object({name:ar.string(),value:ar.string()}));function wxt(){return t=>wi(t.tags).map(PN([])).map(QNe("Variant")).map(QNe("Type")).map(gxt([{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"}])).map(yxt.parse).map(Nh("tags",Ip,t))}function _xt({logger:t}){return r=>wi(r).chain(_He(vHe(r.data),()=>o6(r),()=>o6(" ").map(Nh("data",Ip,r)).map(n=>a2(s6("tags"),eCe([{name:"Content-Type",value:"text/plain"}]),Nh("tags",Ip,n))(n)).map(t.tap('added pseudo-random string as message "data"')))).map(n=>a2(s6("tags"),eCe([{name:"SDK",value:"aoconnect"}]),Nh("tags",Ip,n))(n))}function Mxt(t){let r=wxt(t),n=_xt(t),l=zHe.implement(t.deployMessage);return i=>wi(i).chain(r).chain(n).chain(Ji(({id:d,data:p,tags:v,anchor:_,signer:y})=>l({processId:d,data:p,tags:v,anchor:_,signer:ON.implement(y)}))).map(d=>Nh("messageId",d.messageId,i))}function WX(t){let r=Mxt(t);return({process:n,data:l,tags:i,anchor:d,signer:p})=>wi({id:n,data:l,tags:i,anchor:d,signer:p}).chain(r).map(v=>v.messageId).bimap(c6,l6).toPromise()}var U7=(t,r,n)=>l=>r(l[t])?o6(l):Mc(`Tag '${t}': ${n}`);function Sxt({loadTransactionMeta:t,logger:r}){return t=Ji(nxt.implement(t)),n=>wi(n).chain(t).map(s6("tags")).map(GSt).chain(U7("Data-Protocol",XNe("ao"),"value 'ao' was not found on module")).chain(U7("Type",XNe("Module"),"value 'Module' was not found on module")).chain(U7("Module-Format",zX,"was not found on module")).chain(U7("Input-Encoding",zX,"was not found on module")).chain(U7("Output-Encoding",zX,"was not found on module")).bimap(r.tap("Verifying module source failed: %s"),r.tap("Verified module source"))}function xxt({logger:t,validateScheduler:r}){return r=Ji(ixt.implement(r)),n=>wi(n).chain(l=>r(l).chain(i=>i?o6(l):Mc(`Valid Scheduler-Location owned by ${l} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function Ext({logger:t}){return r=>wi(r).map(t.tap("Checking for signer")).chain(n=>n?o6(n):Mc("signer not found"))}function Axt(t){let r=t.logger.child("verifyInput");t={...t,logger:r};let n=Sxt(t),l=xxt(t),i=Ext(t);return d=>wi(d).chain(p=>n(p.module).map(()=>p)).chain(p=>i(p.signer).map(()=>p)).bimap(r.tap("Error when verify input: %s"),r.tap("Successfully verified inputs"))}var Sfe=VHe("ao"),NT=O8(Sfe.removeAllByName),Rxt=O8(Sfe.concat),tCe=O8(Sfe.concatUnassoc),Txt=ar.array(ar.object({name:ar.string(),value:ar.string()}));function Ixt(){return t=>wi(t).map(s6("tags")).map(PN([])).map(NT("Variant")).map(NT("Type")).map(NT("Module")).map(NT("Scheduler")).map(Rxt([{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler}])).map(Txt.parse).map(Nh("tags",Ip,t))}function kxt({logger:t}){return r=>wi(r).chain(_He(vHe(r.data),()=>o6(r),()=>o6(" ").map(Nh("data",Ip,r)).map(n=>a2(s6("tags"),tCe([{name:"Content-Type",value:"text/plain"}]),Nh("tags",Ip,n))(n)).map(t.tap('added pseudo-random string as process "data"')))).map(n=>a2(s6("tags"),tCe([{name:"SDK",value:"aoconnect"}]),Nh("tags",Ip,n))(n))}function Bxt(t){let r=t.logger.child("uploadProcess");t={...t,logger:r};let n=Ixt(t),l=kxt(t),i=txt.implement(t.deployProcess);return d=>wi(d).chain(n).chain(l).chain(Ji(({data:p,tags:v,signer:_})=>i({data:p,tags:v,signer:ON.implement(_)}))).map(p=>Nh("processId",p.processId,d))}function GX(t){let r=Axt(t),n=Bxt(t);return({module:l,scheduler:i,signer:d,tags:p,data:v})=>wi({module:l,scheduler:i,signer:d,tags:p,data:v}).chain(r).chain(n).map(_=>_.processId).bimap(c6,l6).toPromise()}function Pxt(t){let r=HHe.implement(t.deployMonitor);return n=>wi(n).chain(Ji(({id:l,signer:i})=>r({processId:l,signer:ON.implement(i),data:" ",tags:[]}))).map(l=>Nh("monitorId",l.messageId,n))}function rCe(t){let r=Pxt(t);return({process:n,signer:l})=>wi({id:n,signer:l}).chain(r).map(i=>i.monitorId).bimap(c6,l6).toPromise()}function Oxt(t){let r=HHe.implement(t.deployUnmonitor);return n=>wi(n).chain(Ji(({id:l,signer:i})=>r({processId:l,signer:ON.implement(i),data:" ",tags:[]}))).map(l=>Nh("monitorId",l.messageId,n))}function iCe(t){let r=Oxt(t);return({process:n,signer:l})=>wi({id:n,signer:l}).chain(r).map(i=>i.monitorId).bimap(c6,l6).toPromise()}var Nxt=ar.object({process:ar.string().min(1,{message:"process identifier is required"}),from:ar.string().optional(),to:ar.string().optional(),sort:ar.enum(["ASC","DESC"]).default("ASC"),limit:ar.number().optional()});function Cxt(){return t=>wi(t).map(Nxt.parse).map(()=>t)}function Lxt({queryResults:t}){return t=Ji(ext.implement(t)),r=>wi({process:r.process,from:r.from,to:r.to,sort:r.sort,limit:r.limit}).chain(t)}function nCe(t){let r=Cxt(t),n=Lxt(t);return({process:l,from:i,to:d,sort:p,limit:v})=>wi({process:l,from:i,to:d,sort:p,limit:v}).chain(r).chain(n).map(t.logger.tap('readResults result for message "%s": %O',l)).map(_=>_).bimap(c6,l6).toPromise()}var Dxt=ar.object({Id:ar.string(),Target:ar.string(),Owner:ar.string(),Anchor:ar.string().optional(),Data:ar.any().default("1234"),Tags:ar.array(ar.object({name:ar.string(),value:ar.string()}))});function $xt(){return t=>wi(t).map(Dxt.parse).map(r=>(r.Tags=r.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),r))}function qxt({dryrunFetch:t}){return Ji(XSt.implement(t))}function aCe(t){let r=$xt(t),n=qxt(t);return l=>wi(l).map(Uxt).chain(r).chain(n).toPromise()}function Uxt({process:t,data:r,tags:n,anchor:l,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:r||"1234",Tags:n||[],Anchor:l||"0"}}function jxt(t){let r=rxt.implement(t.deployAssign);return n=>wi(n).chain(Ji(({process:l,message:i,baseLayer:d,exclude:p})=>r({process:l,message:i,baseLayer:d,exclude:p}))).map(l=>Nh("assignmentId",l.assignmentId,n))}function oCe(t){let r=jxt(t);return({process:n,message:l,baseLayer:i,exclude:d})=>wi({process:n,message:l,baseLayer:i,exclude:d}).chain(r).map(p=>p.assignmentId).bimap(c6,l6).toPromise()}var Fxt="https://arweave.net",zxt="https://mu.ao-testnet.xyz",Hxt="https://cu.ao-testnet.xyz",Kxt="http://localhost:8734",Zxt="http://localhost:8734",Wxt="http://cu.s451-comm3-main.xyz",Gxt="http://mu.s451-comm3-main.xyz",qg=fetch;function Vxt({createDataItemSigner:t,createHbSigner:r}){let n=jHe();function l({MODE:v,wallet:_,GRAPHQL_URL:y,GRAPHQL_MAX_RETRIES:w,GRAPHQL_RETRY_BACKOFF:S,MU_URL:M=Gxt,CU_URL:x=Wxt,RELAY_URL:E=Kxt,fetch:T=qg}){let I=n.child("relay");I("Mode Activated \u{1F500}");let B=r(_),O=()=>t(_),N=ZSt({fetch:qg,logger:I,HB_URL:E,signer:B}),{validate:H}=Aoe({cacheSize:100,GRAPHQL_URL:y,GRAPHQL_MAX_RETRIES:w,GRAPHQL_RETRY_BACKOFF:S}),K=I.child("result"),J=ZX({loadResult:UNe({fetch:N,CU_URL:x,logger:K}),logger:K}),L=I.child("message"),$=WX({deployMessage:NNe({fetch:N,MU_URL:M,logger:L}),logger:L}),V=I.child("spawn"),h=GX({loadTransactionMeta:KX({fetch:T,GRAPHQL_URL:y,logger:V}),validateScheduler:H,deployProcess:CNe({fetch:N,MU_URL:M,logger:V}),logger:V}),e=I.child("monitor"),a=rCe({deployMonitor:LNe({fetch:N,MU_URL:M,logger:e}),logger:e}),s=I.child("unmonitor"),u=iCe({deployUnmonitor:DNe({fetch:N,MU_URL:M,logger:s}),logger:e}),c=I.child("results"),g=nCe({queryResults:jNe({fetch:N,CU_URL:x,logger:c}),logger:c}),m=I.child("dryrun"),f=aCe({dryrunFetch:qNe({fetch:N,CU_URL:x,logger:m}),logger:m}),o=I.child("assign"),b=oCe({deployAssign:$Ne({fetch:N,MU_URL:M,logger:o}),logger:L});return{MODE:v,result:J,results:g,message:$,spawn:h,monitor:a,unmonitor:u,dryrun:f,assign:b,createDataItemSigner:O}}function i({MODE:v,GRAPHQL_URL:_,GRAPHQL_MAX_RETRIES:y,GRAPHQL_RETRY_BACKOFF:w,MU_URL:S=zxt,CU_URL:M=Hxt,fetch:x=qg,noLog:E}){let T=n.child("legacy");E||T("Mode Activated \u2139\uFE0F");let{validate:I}=Aoe({cacheSize:100,GRAPHQL_URL:_,GRAPHQL_MAX_RETRIES:y,GRAPHQL_RETRY_BACKOFF:w}),B=T.child("result"),O=ZX({loadResult:UNe({fetch:x,CU_URL:M,logger:B}),logger:B}),N=T.child("message"),H=WX({deployMessage:NNe({fetch:x,MU_URL:S,logger:N}),logger:N}),K=T.child("spawn"),J=GX({loadTransactionMeta:KX({fetch:x,GRAPHQL_URL:_,logger:K}),validateScheduler:I,deployProcess:CNe({fetch:x,MU_URL:S,logger:K}),logger:K}),L=T.child("monitor"),$=rCe({deployMonitor:LNe({fetch:x,MU_URL:S,logger:L}),logger:L}),V=T.child("unmonitor"),h=iCe({deployUnmonitor:DNe({fetch:x,MU_URL:S,logger:V}),logger:L}),e=T.child("results"),a=nCe({queryResults:jNe({fetch:x,CU_URL:M,logger:e}),logger:e}),s=T.child("dryrun"),u=aCe({dryrunFetch:qNe({fetch:x,CU_URL:M,logger:s}),logger:s}),c=T.child("assign"),g=oCe({deployAssign:$Ne({fetch:x,MU_URL:S,logger:c}),logger:N});return{MODE:v,result:O,results:a,message:H,spawn:J,monitor:$,unmonitor:h,dryrun:u,assign:g,createDataItemSigner:t}}function d({MODE:v,wallet:_,GRAPHQL_URL:y,AO_URL:w=Zxt,fetch:S=qg}){let M=n.child("mainnet");if(M("Mode Activated \u{1F432}"),!_)throw new Error("mainnet mode requires providing a wallet to connect()");let x=r(_),E=()=>t(_);async function T(J){return M('Mock validation for address "%s"',J),!0}let I=M.child("result"),B=ZX({loadResult:KSt({fetch:qg,logger:I,HB_URL:w,signer:x}),logger:I}),O=M.child("message"),N=WX({deployMessage:HSt({fetch:qg,logger:O,HB_URL:w,signer:x}),logger:O}),H=M.child("spawn"),K=GX({loadTransactionMeta:KX({fetch:S,GRAPHQL_URL:y,logger:H}),validateScheduler:T,deployProcess:zSt({fetch:qg,logger:H,HB_URL:w,signer:x}),logger:H});return{MODE:v,result:B,message:N,spawn:K,createDataItemSigner:E}}function p(v={}){let{GRAPHQL_URL:_,GATEWAY_URL:y=Fxt,...w}=v;_||(_=FHe({url:y,path:"/graphql"}));let S=v.MODE||"legacy";if(S==="legacy")return i({...w,GRAPHQL_URL:_});if(S==="relay")return l({...w,GRAPHQL_URL:_});if(S==="mainnet")return d({...w,GRAPHQL_URL:_});throw new Error(`Unrecognized MODE: ${S}`)}return p}var $oe={};hN($oe,{createDataItemSigner:()=>MEt,createHbSigner:()=>SEt});var xfe=uN(hCe(),1),YHe={};hN(YHe,{AVSCTap:()=>P_,ArweaveSigner:()=>Rfe,DataItem:()=>__,MAX_TAG_BYTES:()=>LN,MIN_BINARY_SIZE:()=>kfe,SIG_CONFIG:()=>x8,SignatureConfig:()=>ol,Signer:()=>eKe,createData:()=>nKe,default:()=>bEt,deserializeTags:()=>sN,indexToType:()=>Tfe,serializeTags:()=>Ife,tagsExceedLimit:()=>iKe,warparbundles:()=>gEt});var Yxt=Object.create,Efe=Object.defineProperty,Jxt=Object.getOwnPropertyDescriptor,Xxt=Object.getOwnPropertyNames,Qxt=Object.getPrototypeOf,eEt=Object.prototype.hasOwnProperty,Np=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),tEt=(t,r)=>{for(var n in r)Efe(t,n,{get:r[n],enumerable:!0})},rEt=(t,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Xxt(r))!eEt.call(t,i)&&i!==n&&Efe(t,i,{get:()=>r[i],enumerable:!(l=Jxt(r,i))||l.enumerable});return t},d6=(t,r,n)=>(n=t!=null?Yxt(Qxt(t)):{},rEt(r||!t||!t.__esModule?Efe(n,"default",{value:t,enumerable:!0}):n,t)),iEt=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(n){var l=4,i=n.length,d=i%l;if(!d)return n;var p=i,v=l-d,_=i+v,y=ze.alloc(_);for(y.write(n);v--;)y.write("=",p++);return y.toString()}t.default=r}),nEt=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=iEt();function n(_,y){return y===void 0&&(y="utf8"),ze.isBuffer(_)?d(_.toString("base64")):d(ze.from(_,y).toString("base64"))}function l(_,y){return y===void 0&&(y="utf8"),ze.from(i(_),"base64").toString(y)}function i(_){return _=_.toString(),r.default(_).replace(/\-/g,"+").replace(/_/g,"/")}function d(_){return _.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function p(_){return ze.from(i(_),"base64")}var v=n;v.encode=n,v.decode=l,v.toBase64=i,v.fromBase64=d,v.toBuffer=p,t.default=v}),Afe=Np((t,r)=>{r.exports=nEt().default,r.exports.default=r.exports}),JHe=Np(t=>{"use strict";t.byteLength=_,t.toByteArray=w,t.fromByteArray=x;var r=[],n=[],l=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,p=i.length;d<p;++d)r[d]=i[d],n[i.charCodeAt(d)]=d;var d,p;n[45]=62,n[95]=63;function v(E){var T=E.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=E.indexOf("=");I===-1&&(I=T);var B=I===T?0:4-I%4;return[I,B]}function _(E){var T=v(E),I=T[0],B=T[1];return(I+B)*3/4-B}function y(E,T,I){return(T+I)*3/4-I}function w(E){var T,I=v(E),B=I[0],O=I[1],N=new l(y(E,B,O)),H=0,K=O>0?B-4:B,J;for(J=0;J<K;J+=4)T=n[E.charCodeAt(J)]<<18|n[E.charCodeAt(J+1)]<<12|n[E.charCodeAt(J+2)]<<6|n[E.charCodeAt(J+3)],N[H++]=T>>16&255,N[H++]=T>>8&255,N[H++]=T&255;return O===2&&(T=n[E.charCodeAt(J)]<<2|n[E.charCodeAt(J+1)]>>4,N[H++]=T&255),O===1&&(T=n[E.charCodeAt(J)]<<10|n[E.charCodeAt(J+1)]<<4|n[E.charCodeAt(J+2)]>>2,N[H++]=T>>8&255,N[H++]=T&255),N}function S(E){return r[E>>18&63]+r[E>>12&63]+r[E>>6&63]+r[E&63]}function M(E,T,I){for(var B,O=[],N=T;N<I;N+=3)B=(E[N]<<16&16711680)+(E[N+1]<<8&65280)+(E[N+2]&255),O.push(S(B));return O.join("")}function x(E){for(var T,I=E.length,B=I%3,O=[],N=16383,H=0,K=I-B;H<K;H+=N)O.push(M(E,H,H+N>K?K:H+N));return B===1?(T=E[I-1],O.push(r[T>>2]+r[T<<4&63]+"==")):B===2&&(T=(E[I-2]<<8)+E[I-1],O.push(r[T>>10]+r[T>>4&63]+r[T<<2&63]+"=")),O.join("")}}),XHe=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var r=JHe();function n(M){let x=0;for(let I=0;I<M.length;I++)x+=M[I].byteLength;let E=new Uint8Array(x),T=0;E.set(new Uint8Array(M[0]),T),T+=M[0].byteLength;for(let I=1;I<M.length;I++)E.set(new Uint8Array(M[I]),T),T+=M[I].byteLength;return E}t.concatBuffers=n;function l(M){let x=v(M);return i(x)}t.b64UrlToString=l;function i(M){return new TextDecoder("utf-8",{fatal:!0}).decode(M)}t.bufferToString=i;function d(M){return new TextEncoder().encode(M)}t.stringToBuffer=d;function p(M){return y(d(M))}t.stringToB64Url=p;function v(M){return new Uint8Array(r.toByteArray(S(M)))}t.b64UrlToBuffer=v;function _(M){return r.fromByteArray(new Uint8Array(M))}t.bufferTob64=_;function y(M){return w(_(M))}t.bufferTob64Url=y;function w(M){return M.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=w;function S(M){M=M.replace(/\-/g,"+").replace(/\_/g,"/");let x;return M.length%4==0?x=0:x=4-M.length%4,M.concat("=".repeat(x))}t.b64UrlDecode=S}),aEt=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=XHe(),n=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let l=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",l.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(l,i,{saltLength:d}={}){let p=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(l),i);return new Uint8Array(p)}async hash(l,i="SHA-256"){let d=await this.driver.digest(i,l);return new Uint8Array(d)}async verify(l,i,d){let p={kty:"RSA",e:"AQAB",n:l},v=await this.jwkToPublicCryptoKey(p),_=await this.driver.digest("SHA-256",i),y=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,d,i),w=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,d,i),S=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-_.byteLength-2},v,d,i);return y||w||S}async jwkToCryptoKey(l){return this.driver.importKey("jwk",l,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(l){return this.driver.importKey("jwk",l,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let l=crypto?.subtle;return l===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof l[i]=="function")}async encrypt(l,i,d){let p=await this.driver.importKey("raw",typeof i=="string"?r.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},p,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),_=new Uint8Array(16);crypto.getRandomValues(_);let y=await this.driver.encrypt({name:"AES-CBC",iv:_},v,l);return r.concatBuffers([_,y])}async decrypt(l,i,d){let p=await this.driver.importKey("raw",typeof i=="string"?r.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},p,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),_=l.slice(0,16),y=await this.driver.decrypt({name:"AES-CBC",iv:_},v,l.slice(16));return r.concatBuffers([y])}};t.default=n}),oEt=Np(t=>{t.read=function(r,n,l,i,d){var p,v,_=d*8-i-1,y=(1<<_)-1,w=y>>1,S=-7,M=l?d-1:0,x=l?-1:1,E=r[n+M];for(M+=x,p=E&(1<<-S)-1,E>>=-S,S+=_;S>0;p=p*256+r[n+M],M+=x,S-=8);for(v=p&(1<<-S)-1,p>>=-S,S+=i;S>0;v=v*256+r[n+M],M+=x,S-=8);if(p===0)p=1-w;else{if(p===y)return v?NaN:(E?-1:1)*(1/0);v=v+Math.pow(2,i),p=p-w}return(E?-1:1)*v*Math.pow(2,p-i)},t.write=function(r,n,l,i,d,p){var v,_,y,w=p*8-d-1,S=(1<<w)-1,M=S>>1,x=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=i?0:p-1,T=i?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(_=isNaN(n)?1:0,v=S):(v=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-v))<1&&(v--,y*=2),v+M>=1?n+=x/y:n+=x*Math.pow(2,1-M),n*y>=2&&(v++,y/=2),v+M>=S?(_=0,v=S):v+M>=1?(_=(n*y-1)*Math.pow(2,d),v=v+M):(_=n*Math.pow(2,M-1)*Math.pow(2,d),v=0));d>=8;r[l+E]=_&255,E+=T,_/=256,d-=8);for(v=v<<d|_,w+=d;w>0;r[l+E]=v&255,E+=T,v/=256,w-=8);r[l+E-T]|=I*128}}),qoe=Np(t=>{"use strict";var r=JHe(),n=oEt(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=O,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let P=new Uint8Array(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,Uint8Array.prototype),Object.setPrototypeOf(P,C),P.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function p(P){if(P>i)throw new RangeError('The value "'+P+'" is invalid for option "size"');let C=new Uint8Array(P);return Object.setPrototypeOf(C,v.prototype),C}function v(P,C,U){if(typeof P=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(P)}return _(P,C,U)}v.poolSize=8192;function _(P,C,U){if(typeof P=="string")return M(P,C);if(ArrayBuffer.isView(P))return E(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(Be(P,ArrayBuffer)||P&&Be(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Be(P,SharedArrayBuffer)||P&&Be(P.buffer,SharedArrayBuffer)))return T(P,C,U);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=P.valueOf&&P.valueOf();if(ee!=null&&ee!==P)return v.from(ee,C,U);let Q=I(P);if(Q)return Q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return v.from(P[Symbol.toPrimitive]("string"),C,U);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}v.from=function(P,C,U){return _(P,C,U)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function y(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function w(P,C,U){return y(P),P<=0?p(P):C!==void 0?typeof U=="string"?p(P).fill(C,U):p(P).fill(C):p(P)}v.alloc=function(P,C,U){return w(P,C,U)};function S(P){return y(P),p(P<0?0:B(P)|0)}v.allocUnsafe=function(P){return S(P)},v.allocUnsafeSlow=function(P){return S(P)};function M(P,C){if((typeof C!="string"||C==="")&&(C="utf8"),!v.isEncoding(C))throw new TypeError("Unknown encoding: "+C);let U=N(P,C)|0,ee=p(U),Q=ee.write(P,C);return Q!==U&&(ee=ee.slice(0,Q)),ee}function x(P){let C=P.length<0?0:B(P.length)|0,U=p(C);for(let ee=0;ee<C;ee+=1)U[ee]=P[ee]&255;return U}function E(P){if(Be(P,Uint8Array)){let C=new Uint8Array(P);return T(C.buffer,C.byteOffset,C.byteLength)}return x(P)}function T(P,C,U){if(C<0||P.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(P.byteLength<C+(U||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return C===void 0&&U===void 0?ee=new Uint8Array(P):U===void 0?ee=new Uint8Array(P,C):ee=new Uint8Array(P,C,U),Object.setPrototypeOf(ee,v.prototype),ee}function I(P){if(v.isBuffer(P)){let C=B(P.length)|0,U=p(C);return U.length===0||P.copy(U,0,0,C),U}if(P.length!==void 0)return typeof P.length!="number"||ge(P.length)?p(0):x(P);if(P.type==="Buffer"&&Array.isArray(P.data))return x(P.data)}function B(P){if(P>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return P|0}function O(P){return+P!=P&&(P=0),v.alloc(+P)}v.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==v.prototype},v.compare=function(P,C){if(Be(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),Be(C,Uint8Array)&&(C=v.from(C,C.offset,C.byteLength)),!v.isBuffer(P)||!v.isBuffer(C))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===C)return 0;let U=P.length,ee=C.length;for(let Q=0,te=Math.min(U,ee);Q<te;++Q)if(P[Q]!==C[Q]){U=P[Q],ee=C[Q];break}return U<ee?-1:ee<U?1:0},v.isEncoding=function(P){switch(String(P).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(P,C){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return v.alloc(0);let U;if(C===void 0)for(C=0,U=0;U<P.length;++U)C+=P[U].length;let ee=v.allocUnsafe(C),Q=0;for(U=0;U<P.length;++U){let te=P[U];if(Be(te,Uint8Array))Q+te.length>ee.length?(v.isBuffer(te)||(te=v.from(te)),te.copy(ee,Q)):Uint8Array.prototype.set.call(ee,te,Q);else if(v.isBuffer(te))te.copy(ee,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=te.length}return ee};function N(P,C){if(v.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||Be(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);let U=P.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&U===0)return 0;let Q=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":return re(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U*2;case"hex":return U>>>1;case"base64":return he(P).length;default:if(Q)return ee?-1:re(P).length;C=(""+C).toLowerCase(),Q=!0}}v.byteLength=N;function H(P,C,U){let ee=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((U===void 0||U>this.length)&&(U=this.length),U<=0)||(U>>>=0,C>>>=0,U<=C))return"";for(P||(P="utf8");;)switch(P){case"hex":return o(this,C,U);case"utf8":case"utf-8":return u(this,C,U);case"ascii":return m(this,C,U);case"latin1":case"binary":return f(this,C,U);case"base64":return s(this,C,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,C,U);default:if(ee)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(P,C,U){let ee=P[C];P[C]=P[U],P[U]=ee}v.prototype.swap16=function(){let P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let C=0;C<P;C+=2)K(this,C,C+1);return this},v.prototype.swap32=function(){let P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let C=0;C<P;C+=4)K(this,C,C+3),K(this,C+1,C+2);return this},v.prototype.swap64=function(){let P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let C=0;C<P;C+=8)K(this,C,C+7),K(this,C+1,C+6),K(this,C+2,C+5),K(this,C+3,C+4);return this},v.prototype.toString=function(){let P=this.length;return P===0?"":arguments.length===0?u(this,0,P):H.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(P){if(!v.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:v.compare(this,P)===0},v.prototype.inspect=function(){let P="",C=t.INSPECT_MAX_BYTES;return P=this.toString("hex",0,C).replace(/(.{2})/g,"$1 ").trim(),this.length>C&&(P+=" ... "),"<Buffer "+P+">"},l&&(v.prototype[l]=v.prototype.inspect),v.prototype.compare=function(P,C,U,ee,Q){if(Be(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),!v.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(C===void 0&&(C=0),U===void 0&&(U=P?P.length:0),ee===void 0&&(ee=0),Q===void 0&&(Q=this.length),C<0||U>P.length||ee<0||Q>this.length)throw new RangeError("out of range index");if(ee>=Q&&C>=U)return 0;if(ee>=Q)return-1;if(C>=U)return 1;if(C>>>=0,U>>>=0,ee>>>=0,Q>>>=0,this===P)return 0;let te=Q-ee,le=U-C,Ie=Math.min(te,le),se=this.slice(ee,Q),Ee=P.slice(C,U);for(let me=0;me<Ie;++me)if(se[me]!==Ee[me]){te=se[me],le=Ee[me];break}return te<le?-1:le<te?1:0};function J(P,C,U,ee,Q){if(P.length===0)return-1;if(typeof U=="string"?(ee=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,ge(U)&&(U=Q?0:P.length-1),U<0&&(U=P.length+U),U>=P.length){if(Q)return-1;U=P.length-1}else if(U<0)if(Q)U=0;else return-1;if(typeof C=="string"&&(C=v.from(C,ee)),v.isBuffer(C))return C.length===0?-1:L(P,C,U,ee,Q);if(typeof C=="number")return C=C&255,typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(P,C,U):Uint8Array.prototype.lastIndexOf.call(P,C,U):L(P,[C],U,ee,Q);throw new TypeError("val must be string, number or Buffer")}function L(P,C,U,ee,Q){let te=1,le=P.length,Ie=C.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(P.length<2||C.length<2)return-1;te=2,le/=2,Ie/=2,U/=2}function se(me,pe){return te===1?me[pe]:me.readUInt16BE(pe*te)}let Ee;if(Q){let me=-1;for(Ee=U;Ee<le;Ee++)if(se(P,Ee)===se(C,me===-1?0:Ee-me)){if(me===-1&&(me=Ee),Ee-me+1===Ie)return me*te}else me!==-1&&(Ee-=Ee-me),me=-1}else for(U+Ie>le&&(U=le-Ie),Ee=U;Ee>=0;Ee--){let me=!0;for(let pe=0;pe<Ie;pe++)if(se(P,Ee+pe)!==se(C,pe)){me=!1;break}if(me)return Ee}return-1}v.prototype.includes=function(P,C,U){return this.indexOf(P,C,U)!==-1},v.prototype.indexOf=function(P,C,U){return J(this,P,C,U,!0)},v.prototype.lastIndexOf=function(P,C,U){return J(this,P,C,U,!1)};function $(P,C,U,ee){U=Number(U)||0;let Q=P.length-U;ee?(ee=Number(ee),ee>Q&&(ee=Q)):ee=Q;let te=C.length;ee>te/2&&(ee=te/2);let le;for(le=0;le<ee;++le){let Ie=parseInt(C.substr(le*2,2),16);if(ge(Ie))return le;P[U+le]=Ie}return le}function V(P,C,U,ee){return Re(re(C,P.length-U),P,U,ee)}function h(P,C,U,ee){return Re(fe(C),P,U,ee)}function e(P,C,U,ee){return Re(he(C),P,U,ee)}function a(P,C,U,ee){return Re(ye(C,P.length-U),P,U,ee)}v.prototype.write=function(P,C,U,ee){if(C===void 0)ee="utf8",U=this.length,C=0;else if(U===void 0&&typeof C=="string")ee=C,U=this.length,C=0;else if(isFinite(C))C=C>>>0,isFinite(U)?(U=U>>>0,ee===void 0&&(ee="utf8")):(ee=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Q=this.length-C;if((U===void 0||U>Q)&&(U=Q),P.length>0&&(U<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");let te=!1;for(;;)switch(ee){case"hex":return $(this,P,C,U);case"utf8":case"utf-8":return V(this,P,C,U);case"ascii":case"latin1":case"binary":return h(this,P,C,U);case"base64":return e(this,P,C,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a(this,P,C,U);default:if(te)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),te=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function s(P,C,U){return C===0&&U===P.length?r.fromByteArray(P):r.fromByteArray(P.slice(C,U))}function u(P,C,U){U=Math.min(P.length,U);let ee=[],Q=C;for(;Q<U;){let te=P[Q],le=null,Ie=te>239?4:te>223?3:te>191?2:1;if(Q+Ie<=U){let se,Ee,me,pe;switch(Ie){case 1:te<128&&(le=te);break;case 2:se=P[Q+1],(se&192)===128&&(pe=(te&31)<<6|se&63,pe>127&&(le=pe));break;case 3:se=P[Q+1],Ee=P[Q+2],(se&192)===128&&(Ee&192)===128&&(pe=(te&15)<<12|(se&63)<<6|Ee&63,pe>2047&&(pe<55296||pe>57343)&&(le=pe));break;case 4:se=P[Q+1],Ee=P[Q+2],me=P[Q+3],(se&192)===128&&(Ee&192)===128&&(me&192)===128&&(pe=(te&15)<<18|(se&63)<<12|(Ee&63)<<6|me&63,pe>65535&&pe<1114112&&(le=pe))}}le===null?(le=65533,Ie=1):le>65535&&(le-=65536,ee.push(le>>>10&1023|55296),le=56320|le&1023),ee.push(le),Q+=Ie}return g(ee)}var c=4096;function g(P){let C=P.length;if(C<=c)return String.fromCharCode.apply(String,P);let U="",ee=0;for(;ee<C;)U+=String.fromCharCode.apply(String,P.slice(ee,ee+=c));return U}function m(P,C,U){let ee="";U=Math.min(P.length,U);for(let Q=C;Q<U;++Q)ee+=String.fromCharCode(P[Q]&127);return ee}function f(P,C,U){let ee="";U=Math.min(P.length,U);for(let Q=C;Q<U;++Q)ee+=String.fromCharCode(P[Q]);return ee}function o(P,C,U){let ee=P.length;(!C||C<0)&&(C=0),(!U||U<0||U>ee)&&(U=ee);let Q="";for(let te=C;te<U;++te)Q+=Ne[P[te]];return Q}function b(P,C,U){let ee=P.slice(C,U),Q="";for(let te=0;te<ee.length-1;te+=2)Q+=String.fromCharCode(ee[te]+ee[te+1]*256);return Q}v.prototype.slice=function(P,C){let U=this.length;P=~~P,C=C===void 0?U:~~C,P<0?(P+=U,P<0&&(P=0)):P>U&&(P=U),C<0?(C+=U,C<0&&(C=0)):C>U&&(C=U),C<P&&(C=P);let ee=this.subarray(P,C);return Object.setPrototypeOf(ee,v.prototype),ee};function A(P,C,U){if(P%1!==0||P<0)throw new RangeError("offset is not uint");if(P+C>U)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=this[P],Q=1,te=0;for(;++te<C&&(Q*=256);)ee+=this[P+te]*Q;return ee},v.prototype.readUintBE=v.prototype.readUIntBE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=this[P+--C],Q=1;for(;C>0&&(Q*=256);)ee+=this[P+--C]*Q;return ee},v.prototype.readUint8=v.prototype.readUInt8=function(P,C){return P=P>>>0,C||A(P,1,this.length),this[P]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(P,C){return P=P>>>0,C||A(P,2,this.length),this[P]|this[P+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(P,C){return P=P>>>0,C||A(P,2,this.length),this[P]<<8|this[P+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(P,C){return P=P>>>0,C||A(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(P,C){return P=P>>>0,C||A(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},v.prototype.readBigUInt64LE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=C+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,Q=this[++P]+this[++P]*2**8+this[++P]*2**16+U*2**24;return BigInt(ee)+(BigInt(Q)<<BigInt(32))}),v.prototype.readBigUInt64BE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=C*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],Q=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+U;return(BigInt(ee)<<BigInt(32))+BigInt(Q)}),v.prototype.readIntLE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=this[P],Q=1,te=0;for(;++te<C&&(Q*=256);)ee+=this[P+te]*Q;return Q*=128,ee>=Q&&(ee-=Math.pow(2,8*C)),ee},v.prototype.readIntBE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=C,Q=1,te=this[P+--ee];for(;ee>0&&(Q*=256);)te+=this[P+--ee]*Q;return Q*=128,te>=Q&&(te-=Math.pow(2,8*C)),te},v.prototype.readInt8=function(P,C){return P=P>>>0,C||A(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},v.prototype.readInt16LE=function(P,C){P=P>>>0,C||A(P,2,this.length);let U=this[P]|this[P+1]<<8;return U&32768?U|4294901760:U},v.prototype.readInt16BE=function(P,C){P=P>>>0,C||A(P,2,this.length);let U=this[P+1]|this[P]<<8;return U&32768?U|4294901760:U},v.prototype.readInt32LE=function(P,C){return P=P>>>0,C||A(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},v.prototype.readInt32BE=function(P,C){return P=P>>>0,C||A(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},v.prototype.readBigInt64LE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(U<<24);return(BigInt(ee)<<BigInt(32))+BigInt(C+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),v.prototype.readBigInt64BE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=(C<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(ee)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+U)}),v.prototype.readFloatLE=function(P,C){return P=P>>>0,C||A(P,4,this.length),n.read(this,P,!0,23,4)},v.prototype.readFloatBE=function(P,C){return P=P>>>0,C||A(P,4,this.length),n.read(this,P,!1,23,4)},v.prototype.readDoubleLE=function(P,C){return P=P>>>0,C||A(P,8,this.length),n.read(this,P,!0,52,8)},v.prototype.readDoubleBE=function(P,C){return P=P>>>0,C||A(P,8,this.length),n.read(this,P,!1,52,8)};function R(P,C,U,ee,Q,te){if(!v.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>Q||C<te)throw new RangeError('"value" argument is out of bounds');if(U+ee>P.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(P,C,U,ee){if(P=+P,C=C>>>0,U=U>>>0,!ee){let le=Math.pow(2,8*U)-1;R(this,P,C,U,le,0)}let Q=1,te=0;for(this[C]=P&255;++te<U&&(Q*=256);)this[C+te]=P/Q&255;return C+U},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(P,C,U,ee){if(P=+P,C=C>>>0,U=U>>>0,!ee){let le=Math.pow(2,8*U)-1;R(this,P,C,U,le,0)}let Q=U-1,te=1;for(this[C+Q]=P&255;--Q>=0&&(te*=256);)this[C+Q]=P/te&255;return C+U},v.prototype.writeUint8=v.prototype.writeUInt8=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,1,255,0),this[C]=P&255,C+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,65535,0),this[C]=P&255,this[C+1]=P>>>8,C+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,65535,0),this[C]=P>>>8,this[C+1]=P&255,C+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,4294967295,0),this[C+3]=P>>>24,this[C+2]=P>>>16,this[C+1]=P>>>8,this[C]=P&255,C+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,4294967295,0),this[C]=P>>>24,this[C+1]=P>>>16,this[C+2]=P>>>8,this[C+3]=P&255,C+4};function k(P,C,U,ee,Q){z(C,ee,Q,P,U,7);let te=Number(C&BigInt(4294967295));P[U++]=te,te=te>>8,P[U++]=te,te=te>>8,P[U++]=te,te=te>>8,P[U++]=te;let le=Number(C>>BigInt(32)&BigInt(4294967295));return P[U++]=le,le=le>>8,P[U++]=le,le=le>>8,P[U++]=le,le=le>>8,P[U++]=le,U}function q(P,C,U,ee,Q){z(C,ee,Q,P,U,7);let te=Number(C&BigInt(4294967295));P[U+7]=te,te=te>>8,P[U+6]=te,te=te>>8,P[U+5]=te,te=te>>8,P[U+4]=te;let le=Number(C>>BigInt(32)&BigInt(4294967295));return P[U+3]=le,le=le>>8,P[U+2]=le,le=le>>8,P[U+1]=le,le=le>>8,P[U]=le,U+8}v.prototype.writeBigUInt64LE=qe(function(P,C=0){return k(this,P,C,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=qe(function(P,C=0){return q(this,P,C,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(P,C,U,ee){if(P=+P,C=C>>>0,!ee){let Ie=Math.pow(2,8*U-1);R(this,P,C,U,Ie-1,-Ie)}let Q=0,te=1,le=0;for(this[C]=P&255;++Q<U&&(te*=256);)P<0&&le===0&&this[C+Q-1]!==0&&(le=1),this[C+Q]=(P/te>>0)-le&255;return C+U},v.prototype.writeIntBE=function(P,C,U,ee){if(P=+P,C=C>>>0,!ee){let Ie=Math.pow(2,8*U-1);R(this,P,C,U,Ie-1,-Ie)}let Q=U-1,te=1,le=0;for(this[C+Q]=P&255;--Q>=0&&(te*=256);)P<0&&le===0&&this[C+Q+1]!==0&&(le=1),this[C+Q]=(P/te>>0)-le&255;return C+U},v.prototype.writeInt8=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,1,127,-128),P<0&&(P=255+P+1),this[C]=P&255,C+1},v.prototype.writeInt16LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,32767,-32768),this[C]=P&255,this[C+1]=P>>>8,C+2},v.prototype.writeInt16BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,32767,-32768),this[C]=P>>>8,this[C+1]=P&255,C+2},v.prototype.writeInt32LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,2147483647,-2147483648),this[C]=P&255,this[C+1]=P>>>8,this[C+2]=P>>>16,this[C+3]=P>>>24,C+4},v.prototype.writeInt32BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[C]=P>>>24,this[C+1]=P>>>16,this[C+2]=P>>>8,this[C+3]=P&255,C+4},v.prototype.writeBigInt64LE=qe(function(P,C=0){return k(this,P,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=qe(function(P,C=0){return q(this,P,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(P,C,U,ee,Q,te){if(U+ee>P.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function ne(P,C,U,ee,Q){return C=+C,U=U>>>0,Q||Z(P,C,U,4,34028234663852886e22,-34028234663852886e22),n.write(P,C,U,ee,23,4),U+4}v.prototype.writeFloatLE=function(P,C,U){return ne(this,P,C,!0,U)},v.prototype.writeFloatBE=function(P,C,U){return ne(this,P,C,!1,U)};function G(P,C,U,ee,Q){return C=+C,U=U>>>0,Q||Z(P,C,U,8,17976931348623157e292,-17976931348623157e292),n.write(P,C,U,ee,52,8),U+8}v.prototype.writeDoubleLE=function(P,C,U){return G(this,P,C,!0,U)},v.prototype.writeDoubleBE=function(P,C,U){return G(this,P,C,!1,U)},v.prototype.copy=function(P,C,U,ee){if(!v.isBuffer(P))throw new TypeError("argument should be a Buffer");if(U||(U=0),!ee&&ee!==0&&(ee=this.length),C>=P.length&&(C=P.length),C||(C=0),ee>0&&ee<U&&(ee=U),ee===U||P.length===0||this.length===0)return 0;if(C<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),P.length-C<ee-U&&(ee=P.length-C+U);let Q=ee-U;return this===P&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(C,U,ee):Uint8Array.prototype.set.call(P,this.subarray(U,ee),C),Q},v.prototype.fill=function(P,C,U,ee){if(typeof P=="string"){if(typeof C=="string"?(ee=C,C=0,U=this.length):typeof U=="string"&&(ee=U,U=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!v.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(P.length===1){let te=P.charCodeAt(0);(ee==="utf8"&&te<128||ee==="latin1")&&(P=te)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(C<0||this.length<C||this.length<U)throw new RangeError("Out of range index");if(U<=C)return this;C=C>>>0,U=U===void 0?this.length:U>>>0,P||(P=0);let Q;if(typeof P=="number")for(Q=C;Q<U;++Q)this[Q]=P;else{let te=v.isBuffer(P)?P:v.from(P,ee),le=te.length;if(le===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(Q=0;Q<U-C;++Q)this[Q+C]=te[Q%le]}return this};var D={};function W(P,C,U){D[P]=class extends U{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${P}]`,this.stack,delete this.name}get code(){return P}set code(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}toString(){return`${this.name} [${P}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(P){return P?`${P} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(P,C){return`The "${P}" argument must be of type number. Received type ${typeof C}`},TypeError),W("ERR_OUT_OF_RANGE",function(P,C,U){let ee=`The value of "${P}" is out of range.`,Q=U;return Number.isInteger(U)&&Math.abs(U)>2**32?Q=ie(String(U)):typeof U=="bigint"&&(Q=String(U),(U>BigInt(2)**BigInt(32)||U<-(BigInt(2)**BigInt(32)))&&(Q=ie(Q)),Q+="n"),ee+=` It must be ${C}. Received ${Q}`,ee},RangeError);function ie(P){let C="",U=P.length,ee=P[0]==="-"?1:0;for(;U>=ee+4;U-=3)C=`_${P.slice(U-3,U)}${C}`;return`${P.slice(0,U)}${C}`}function X(P,C,U){F(C,"offset"),(P[C]===void 0||P[C+U]===void 0)&&Y(C,P.length-(U+1))}function z(P,C,U,ee,Q,te){if(P>U||P<C){let le=typeof C=="bigint"?"n":"",Ie;throw te>3?C===0||C===BigInt(0)?Ie=`>= 0${le} and < 2${le} ** ${(te+1)*8}${le}`:Ie=`>= -(2${le} ** ${(te+1)*8-1}${le}) and < 2 ** ${(te+1)*8-1}${le}`:Ie=`>= ${C}${le} and <= ${U}${le}`,new D.ERR_OUT_OF_RANGE("value",Ie,P)}X(ee,Q,te)}function F(P,C){if(typeof P!="number")throw new D.ERR_INVALID_ARG_TYPE(C,"number",P)}function Y(P,C,U){throw Math.floor(P)!==P?(F(P,U),new D.ERR_OUT_OF_RANGE(U||"offset","an integer",P)):C<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE(U||"offset",`>= ${U?1:0} and <= ${C}`,P)}var ae=/[^+/0-9A-Za-z-_]/g;function de(P){if(P=P.split("=")[0],P=P.trim().replace(ae,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function re(P,C){C=C||1/0;let U,ee=P.length,Q=null,te=[];for(let le=0;le<ee;++le){if(U=P.charCodeAt(le),U>55295&&U<57344){if(!Q){if(U>56319){(C-=3)>-1&&te.push(239,191,189);continue}else if(le+1===ee){(C-=3)>-1&&te.push(239,191,189);continue}Q=U;continue}if(U<56320){(C-=3)>-1&&te.push(239,191,189),Q=U;continue}U=(Q-55296<<10|U-56320)+65536}else Q&&(C-=3)>-1&&te.push(239,191,189);if(Q=null,U<128){if((C-=1)<0)break;te.push(U)}else if(U<2048){if((C-=2)<0)break;te.push(U>>6|192,U&63|128)}else if(U<65536){if((C-=3)<0)break;te.push(U>>12|224,U>>6&63|128,U&63|128)}else if(U<1114112){if((C-=4)<0)break;te.push(U>>18|240,U>>12&63|128,U>>6&63|128,U&63|128)}else throw new Error("Invalid code point")}return te}function fe(P){let C=[];for(let U=0;U<P.length;++U)C.push(P.charCodeAt(U)&255);return C}function ye(P,C){let U,ee,Q,te=[];for(let le=0;le<P.length&&!((C-=2)<0);++le)U=P.charCodeAt(le),ee=U>>8,Q=U%256,te.push(Q),te.push(ee);return te}function he(P){return r.toByteArray(de(P))}function Re(P,C,U,ee){let Q;for(Q=0;Q<ee&&!(Q+U>=C.length||Q>=P.length);++Q)C[Q+U]=P[Q];return Q}function Be(P,C){return P instanceof C||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===C.name}function ge(P){return P!==P}var Ne=function(){let P="0123456789abcdef",C=new Array(256);for(let U=0;U<16;++U){let ee=U*16;for(let Q=0;Q<16;++Q)C[ee+Q]=P[U]+P[Q]}return C}();function qe(P){return typeof BigInt>"u"?j:P}function j(){throw new Error("BigInt not supported")}}),sEt=Np((t,r)=>{typeof window<"u"?(window.global=window,globalThis.fetch=window.fetch,r.exports={Buffer:qoe().Buffer,Crypto:window.crypto}):r.exports={Buffer:qoe().Buffer,Crypto:crypto}}),QHe={};tEt(QHe,{AVSCTap:()=>P_,ArweaveSigner:()=>Rfe,DataItem:()=>__,MAX_TAG_BYTES:()=>LN,MIN_BINARY_SIZE:()=>kfe,SIG_CONFIG:()=>x8,SignatureConfig:()=>ol,Signer:()=>eKe,createData:()=>nKe,deserializeTags:()=>sN,indexToType:()=>Tfe,serializeTags:()=>Ife,tagsExceedLimit:()=>iKe});var eKe=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,r,n,l){throw new Error("You must implement verify method on child")}},fEt=d6(Afe(),1),mc=d6(XHe(),1);async function tKe(t){if(Array.isArray(t)){let i=(0,mc.concatBuffers)([(0,mc.stringToBuffer)("list"),(0,mc.stringToBuffer)(t.length.toString())]);return await rKe(t,await Tp().hash(i,"SHA-384"))}let r=t,n=(0,mc.concatBuffers)([(0,mc.stringToBuffer)("blob"),(0,mc.stringToBuffer)(r.byteLength.toString())]),l=(0,mc.concatBuffers)([await Tp().hash(n,"SHA-384"),await Tp().hash(r,"SHA-384")]);return await Tp().hash(l,"SHA-384")}async function rKe(t,r){if(t.length<1)return r;let n=(0,mc.concatBuffers)([r,await tKe(t[0])]),l=await Tp().hash(n,"SHA-384");return await rKe(t.slice(1),l)}var VX=d6(aEt(),1),hEt=VX.default.default?VX.default.default:VX.default,uEt=class extends hEt{getPublicKey(t){throw new Error("Unimplemented")}},lEt;function Tp(){return lEt??=new uEt}var ol;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(ol||(ol={}));var x8={[ol.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[ol.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[ol.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[ol.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[ol.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[ol.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[ol.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},Rfe=class{signatureType=1;ownerLength=x8[1].pubLength;signatureLength=x8[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return fEt.default.toBuffer(this.pk)}sign(t){return Tp().sign(this.jwk,t)}static async verify(t,r,n){return await Tp().verify(t,r,n)}},Tfe={1:Rfe},Nd=d6(Afe(),1);async function Uoe(t){return tKe([(0,mc.stringToBuffer)("dataitem"),(0,mc.stringToBuffer)("1"),(0,mc.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function cEt(t,r){let n=await Uoe(t),l=await r.sign(n),i=await Tp().hash(l);return{signature:ze.from(l),id:ze.from(i)}}async function dEt(t,r){let{signature:n,id:l}=await cEt(t,r);return t.getRaw().set(n,2),l}var P_=class{buf;pos;constructor(t=ze.alloc(LN),r=0){this.buf=t,this.pos=r}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let r=t.length,n;if(r)for(this.writeLong(r),n=0;n<r;n++){let l=t[n];if(l?.name===void 0||l?.value===void 0)throw new Error(`Invalid tag format for ${l}, expected {name:string, value: string}`);this.writeString(l.name),this.writeString(l.value)}this.writeLong(0)}toBuffer(){let t=ze.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let r=this.buf,n,l;if(t>=-1073741824&&t<1073741824){l=t>=0?t<<1:~t<<1|1;do r[this.pos]=l&127,l>>=7;while(l&&(r[this.pos++]|=128))}else{n=t>=0?t*2:-t*2-1;do r[this.pos]=n&127,n/=128;while(n>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(t){let r=ze.byteLength(t),n=this.buf;this.writeLong(r);let l=this.pos;if(this.pos+=r,!(this.pos>n.length)){if(r>64)this.buf.write(t,this.pos-r,r,"utf8");else{let i,d,p,v;for(i=0,d=r;i<d;i++)p=t.charCodeAt(i),p<128?n[l++]=p:p<2048?(n[l++]=p>>6|192,n[l++]=p&63|128):(p&64512)===55296&&((v=t.charCodeAt(i+1))&64512)===56320?(p=65536+((p&1023)<<10)+(v&1023),i++,n[l++]=p>>18|240,n[l++]=p>>12&63|128,n[l++]=p>>6&63|128,n[l++]=p&63|128):(n[l++]=p>>12|224,n[l++]=p>>6&63|128,n[l++]=p&63|128)}this.buf=n}}readLong(){let t=0,r=0,n=this.buf,l,i,d,p;do l=n[this.pos++],i=l&128,t|=(l&127)<<r,r+=7;while(i&&r<28);if(i){d=t,p=268435456;do l=n[this.pos++],d+=(l&127)*p,p*=128;while(l&128);return(d%2?-(d+1):d)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let n=this.readString(),l=this.readString();t.push({name:n,value:l})}return t}readString(){let t=this.readLong(),r=this.pos,n=this.buf;if(this.pos+=t,!(this.pos>n.length))return this.buf.slice(r,r+t).toString()}};function Ife(t){let r=new P_;return r.writeTags(t),r.toBuffer()}function iKe(t){let r=new P_;return r.writeTags(t),r.tagsExceedLimit()}function sN(t){return new P_(t).readTags()}function Bv(t){let r=0;for(let n=t.length-1;n>=0;n--)r=r*256+t[n];return r}function pEt(t){if(t>29)throw new Error("Short too long");let r=[0,0];for(let n=0;n<r.length;n++){let l=t&255;r[n]=l,t=(t-l)/256}return Uint8Array.from(r)}function sCe(t){let r=[0,0,0,0,0,0,0,0];for(let n=0;n<r.length;n++){let l=t&255;r[n]=l,t=(t-l)/256}return Uint8Array.from(r)}var mEt=d6(sEt(),1),G3=d6(qoe(),1),LN=4096,kfe=80,__=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=Bv(this.binary.subarray(0,2));if(ol?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return __.verify(this.binary)}get id(){return(async()=>Nd.default.encode(await this.rawId))()}set id(t){this._id=Nd.default.toBuffer(t)}get rawId(){return(async()=>G3.Buffer.from(await mEt.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Nd.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return x8[this.signatureType].sigLength}get owner(){return Nd.default.encode(this.rawOwner)}get ownerLength(){return x8[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):G3.Buffer.alloc(0)}get target(){return Nd.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):G3.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),r=Bv(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+r)}get tags(){let t=this.getTagsStart();if(Bv(this.binary.subarray(t,t+8))==0)return[];let r=Bv(this.binary.subarray(t+8,t+16));return sN(G3.Buffer.from(this.binary.subarray(t+16,t+16+r)))}get tagsB64Url(){return this.tags.map(t=>({name:Nd.default.encode(t.name),value:Nd.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),r=this.binary.subarray(t+8,t+16),n=Bv(r);return t+16+n}get rawData(){let t=this.getTagsStart(),r=this.binary.subarray(t+8,t+16),n=Bv(r),l=t+16+n;return this.binary.subarray(l,this.binary.length)}get data(){return Nd.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await dEt(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=G3.Buffer.from(await Tp().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Nd.default.encode(t.name),value:Nd.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<kfe)return!1;let r=new __(t),n=r.signatureType,l=r.getTagsStart(),i=Bv(t.subarray(l,l+8)),d=t.subarray(l+8,l+16),p=Bv(d);if(p>LN)return!1;if(i>0)try{if(sN(G3.Buffer.from(t.subarray(l+16,l+16+p))).length!==i)return!1}catch{return!1}let v=Tfe[n],_=await Uoe(r);return await v.verify(r.rawOwner,_,r.rawSignature)}async getSignatureData(){return Uoe(this)}getTagsStart(){let t=this.getTargetStart(),r=this.binary[t]==1,n=t+(r?33:1),l=this.binary[n]==1;return n+=l?33:1,n}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return t+=r?32:0,t}},vEt=d6(Afe(),1);function nKe(t,r,n){let l=r.publicKey,i=n?.target?vEt.default.toBuffer(n.target):null,d=1+(i?.byteLength??0),p=n?.anchor?ze.from(n.anchor):null,v=1+(p?.byteLength??0),_=(n?.tags?.length??0)>0?Ife(n.tags):null,y=16+(_?_.byteLength:0),w=ze.from(t),S=w.byteLength,M=2+r.signatureLength+r.ownerLength+d+v+y+S,x=ze.alloc(M);if(x.set(pEt(r.signatureType),0),x.set(new Uint8Array(r.signatureLength).fill(0),2),l.byteLength!==r.ownerLength)throw new Error(`Owner must be ${r.ownerLength} bytes, but was incorrectly ${l.byteLength}`);x.set(l,2+r.signatureLength);let E=2+r.signatureLength+r.ownerLength;if(x[E]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);x.set(i,E+1)}let T=E+d,I=T+1;if(x[T]=p?1:0,p){if(I+=p.byteLength,p.byteLength!==32)throw new Error("Anchor must be 32 bytes");x.set(p,T+1)}x.set(sCe(n?.tags?.length??0),I);let B=sCe(_?.byteLength??0);x.set(B,I+8),_&&x.set(_,I+16);let O=I+y;return x.set(w,O),new __(x)}var Bfe={...QHe};globalThis.arbundles??=Bfe;var bEt=Bfe,gEt=Bfe,yEt=uN(Kwt(),1);globalThis.Buffer||(globalThis.Buffer=xfe.Buffer);var{DataItem:wEt}=YHe,{signMessage:_Et}=yEt.httpbis;function MEt(t){return async({data:r,tags:n,target:l,anchor:i,createDataItem:d=p=>new wEt(p)})=>{let p=await t.signDataItem({data:r,tags:n,target:l,anchor:i}),v=d(xfe.Buffer.from(p));return{id:await v.id,raw:await v.getRaw()}}}function SEt(t){let r=["alg","keyid"].sort(),n;return async({fields:l,request:i})=>new Promise(d=>(n||(n=t.connect(["ACCESS_ADDRESS","ACCESS_PUBLIC_KEY","SIGNATURE"]).then(async()=>{let p=await t.getActivePublicKey(),v=await t.getActiveAddress();return{publicKey:p,address:v}})),d(n))).then(({publicKey:d,address:p})=>_Et({key:{id:d,alg:"rsa-pss-sha512",sign:async v=>{let _=await t.signMessage(v,{hashAlgorithm:"SHA-512"});return xfe.Buffer.from(_)}},fields:l,name:FSt(p),params:r},i))}var xEt=globalThis.GATEWAY_URL||void 0,EEt=globalThis.MU_URL||void 0,AEt=globalThis.CU_URL||void 0,REt=globalThis.GRAPHQL_URL||void 0,TEt=globalThis.GRAPHQL_MAX_RETRIES||void 0,IEt=globalThis.GRAPHQL_RETRY_BACKOFF||void 0,kEt=globalThis.RELAY_URL||void 0,BEt=globalThis.AO_URL=void 0,Au=Vxt({createDataItemSigner:$oe.createDataItemSigner,createHbSigner:$oe.createHbSigner}),{result:U0r,results:j0r,message:F0r,spawn:z0r,monitor:H0r,unmonitor:K0r,dryrun:Z0r,assign:W0r,createDataItemSigner:aKe}=Au({MODE:"legacy",GATEWAY_URL:xEt,MU_URL:EEt,CU_URL:AEt,RELAY_URL:kEt,AO_URL:BEt,GRAPHQL_URL:REt,GRAPHQL_MAX_RETRIES:TEt,GRAPHQL_RETRY_BACKOFF:IEt,noLog:!0});we();Me();_e();var XKe=$n(JKe(),1),KN=XKe.default.init({host:"arweave.net",port:443,protocol:"https"});we();Me();_e();we();Me();_e();var Ac=class extends Error{constructor(r){super(r),this.name=this.constructor.name}},QKe=class extends Ac{},eZe=class extends Ac{},tZe=class extends Ac{constructor(r,n){super(`Failed request: ${r}: ${n}`)}},rZe=class extends Ac{},ZN=class extends Ac{},iZe=class extends Ac{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},e1=class extends Ac{constructor(){super("Invalid contract configuration")}},nZe=class extends Ac{constructor(){super("Invalid process configuration")}},aZe=class extends Ac{};we();Me();_e();var Nc=$n(dQe(),1);we();Me();_e();var n4="3.12.2";var zh=class t{logger;silent=!1;static default=new t;constructor({level:r="info"}={}){r==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Nc.createLogger)({level:r,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:n4},format:Nc.format.combine(Nc.format.timestamp(),Nc.format.json()),transports:[new Nc.transports.Console({format:Nc.format.combine(Nc.format.timestamp(),Nc.format.json())})]})}info(r,...n){this.silent||this.logger.info(r,...n)}warn(r,...n){this.silent||this.logger.warn(r,...n)}error(r,...n){this.silent||this.logger.error(r,...n)}debug(r,...n){this.silent||this.logger.debug(r,...n)}setLogLevel(r){this.silent=r==="none","silent"in this.logger&&(this.logger.silent=r==="none"),"level"in this.logger&&(this.logger.level=r)}};we();Me();_e();we();Me();_e();var pQe=t=>{let r=Object.entries(t).sort(([n,l],[i,d])=>n==="@"?-1:i==="@"?1:"priority"in l&&!("priority"in d)?-1:!("priority"in l)&&"priority"in d?1:l.priority!==void 0&&d.priority!==void 0?l.priority===d.priority?n<i?-1:n>i?1:0:l.priority-d.priority:n<i?-1:n>i?1:0);return Object.fromEntries(r.map(([n,l],i)=>[n,{...l,index:i}]))};we();Me();_e();function o1(t,r){let n=t.safeParse(r);if(!n.success)throw new Error(JSON.stringify(n.error.format(),null,2));return n}we();Me();_e();we();Me();_e();we();Me();_e();sd();var mQe="+",vQe="/",bQe="-",gQe="_",yQe="=";function CUt(t){let r=t.length%4;return r&&(t+=yQe.repeat(4-r)),t.replaceAll(bQe,mQe).replaceAll(gQe,vQe)}function LUt(t){return t.replaceAll(mQe,bQe).replaceAll(vQe,gQe).replaceAll(yQe,"")}function Dyr(t){let r=CUt(t);return ze.from(r,"base64")}function a4(t){let r=t.toString("base64");return LUt(r)}function $yr(t){return a4(Ul("sha256").update(Uint8Array.from(t)).digest())}function wQe(t=32){let r=mZ(t);return Array.from(r,n=>n.toString(16).padStart(2,"0")).join("").slice(0,t)}we();Me();_e();we();Me();_e();function q0e(t){try{return JSON.parse(t)}catch{return t}}we();Me();_e();we();Me();_e();var j0e=$n(MQe(),1);we();Me();_e();var qUt=Object.defineProperty,UUt=(t,r,n)=>r in t?qUt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,AM=(t,r,n)=>(UUt(t,typeof r!="symbol"?r+"":r,n),n),F0e=class{constructor(r){AM(this,"value"),AM(this,"next"),this.value=r}},z0e=class{constructor(){AM(this,"head"),AM(this,"tail"),AM(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(r){let n=new F0e(r);return this.head&&this.tail?(this.tail.next=n,this.tail=n):(this.head=n,this.tail=n),this._size++,this._size}pop(){if(!this.head)return;let r=this.head;return this.head=this.head.next,this._size--,r.value}get size(){return this._size}*[Symbol.iterator](){let r=this.head;for(;r;)yield r.value,r=r.next}};function SQe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let r=new z0e,n=0,l=()=>{n--,r.size>0&&r.pop()()},i=async(v,_,y)=>{n++;let w=(async()=>v(...y))();_(w);try{await w}catch{}l()},d=(v,_,y)=>{r.push(i.bind(null,v,_,y)),(async()=>(await Promise.resolve(),n<t&&r.size>0&&r.pop()()))()},p=(v,..._)=>new Promise(y=>{d(v,y,_)});return Object.defineProperties(p,{activeCount:{get:()=>n},pendingCount:{get:()=>r.size},clearQueue:{value:()=>{r.clear()}}}),p}we();Me();_e();var RM=class{static init(r){return r!==void 0&&"signer"in r?new H0e(r):new tL(r)}},tL=class{process;constructor(r){if(r===void 0||Object.keys(r).length===0)this.process=new wo({processId:S3});else if(b2(r))this.process=r.process;else if(g2(r))this.process=new wo({processId:r.processId});else throw new e1}async accessControlList({address:r}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:r}]})}},H0e=class extends tL{signer;constructor({signer:r,...n}){super(n),this.signer=v2(r)}async register({processId:r}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:r}],signer:this.signer})}};we();Me();_e();we();Me();_e();var jUt="https://faucet.ario.permaweb.services";function Z0e({arioInstance:t,faucetApiUrl:r=jUt}){let n=new K0e({faucetUrl:r,processId:t.process.processId});return new Proxy(t,{get(i,d){if(d==="faucet")return n;if(d in i){let p=i[d];return typeof p=="function"?p.bind(i):p}}})}var K0e=class{faucetUrl;processId;constructor({faucetUrl:r,processId:n}){this.faucetUrl=r,this.processId=n}async captchaUrl(){let r=await fetch(`${this.faucetUrl}/api/captcha/url?process-id=${this.processId}`,{method:"GET"});if(!r.ok){let l=await r.json().catch(()=>({error:r.statusText}));throw new Error(l.error)}return await r.json()}async claimWithCaptchaResponse({captchaResponse:r,recipient:n,quantity:l}){let i=await fetch(`${this.faucetUrl}/api/claim/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,recipient:n,quantity:l,captchaResponse:r})});if(!i.ok){let p=await i.json().catch(()=>({error:i.statusText}));throw new Error(p.error)}return await i.json()}async requestAuthToken({captchaResponse:r}){let n=await fetch(`${this.faucetUrl}/api/captcha/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,captchaResponse:r})});if(!n.ok){let i=await n.json().catch(()=>({error:n.statusText}));throw new Error(i.error)}return await n.json()}async claimWithAuthToken({authToken:r,recipient:n,quantity:l}){let i=await fetch(`${this.faucetUrl}/api/claim/async`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({recipient:n,qty:l,processId:this.processId})});if(!i.ok){let p=await i.json().catch(()=>({error:i.statusText}));throw new Error(p.error)}return await i.json()}async verifyAuthToken({authToken:r}){let n=await fetch(`${this.faucetUrl}/api/token/verify?process-id=${this.processId}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});if(!n.ok){let i=await n.json().catch(()=>({error:n.statusText}));throw new Error(i.error)}return await n.json()}};we();Me();_e();we();Me();_e();we();Me();_e();var df=[];for(let t=0;t<256;++t)df.push((t+256).toString(16).slice(1));function xQe(t,r=0){return(df[t[r+0]]+df[t[r+1]]+df[t[r+2]]+df[t[r+3]]+"-"+df[t[r+4]]+df[t[r+5]]+"-"+df[t[r+6]]+df[t[r+7]]+"-"+df[t[r+8]]+df[t[r+9]]+"-"+df[t[r+10]]+df[t[r+11]]+df[t[r+12]]+df[t[r+13]]+df[t[r+14]]+df[t[r+15]]).toLowerCase()}we();Me();_e();var W0e,FUt=new Uint8Array(16);function G0e(){if(!W0e){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");W0e=crypto.getRandomValues.bind(crypto)}return W0e(FUt)}we();Me();_e();we();Me();_e();var zUt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),V0e={randomUUID:zUt};function HUt(t,r,n){if(V0e.randomUUID&&!r&&!t)return V0e.randomUUID();t=t||{};let l=t.random??t.rng?.()??G0e();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,r){if(n=n||0,n<0||n+16>r.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let i=0;i<16;++i)r[n+i]=l[i];return r}return xQe(l)}var Y0e=HUt;we();Me();_e();var J0e=class t{constructor(r){this.positiveFiniteInteger=r;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${r}`)}[Symbol.toPrimitive](r){return r==="string"&&this.toString(),this.positiveFiniteInteger}plus(r){return new t(this.positiveFiniteInteger+r.positiveFiniteInteger)}minus(r){return new t(this.positiveFiniteInteger-r.positiveFiniteInteger)}isGreaterThan(r){return this.positiveFiniteInteger>r.positiveFiniteInteger}isGreaterThanOrEqualTo(r){return this.positiveFiniteInteger>=r.positiveFiniteInteger}isLessThan(r){return this.positiveFiniteInteger<r.positiveFiniteInteger}isLessThanOrEqualTo(r){return this.positiveFiniteInteger<=r.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(r){return this.positiveFiniteInteger===r.positiveFiniteInteger}},X0e=class{value;constructor(r){if(!Number.isFinite(r)||r<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+r.toFixed(6)}valueOf(){return this.value}toMARIO(){return new TM(Math.floor(this.value*IY))}toString(){return`${this.value}`}},TM=class t extends J0e{constructor(r){super(r)}multiply(r){let n=Math.floor(this.valueOf()*r.valueOf());return new t(n)}divide(r){if(r.valueOf()===0)throw new Error("Cannot divide by zero");let n=Math.floor(this.valueOf()/r.valueOf());return new t(n)}plus(r){let n=super.plus(r);return new t(n.valueOf())}minus(r){let n=super.minus(r);return new t(n.valueOf())}toARIO(){return new X0e(this.valueOf()/IY)}};we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();function IM(t,r){return function(){return t.apply(r,arguments)}}var{toString:KUt}=Object.prototype,{getPrototypeOf:ele}=Object,iL=(t=>r=>{let n=KUt.call(r);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cc=t=>(t=t.toLowerCase(),r=>iL(r)===t),nL=t=>r=>typeof r===t,{isArray:o4}=Array,kM=nL("undefined");function ZUt(t){return t!==null&&!kM(t)&&t.constructor!==null&&!kM(t.constructor)&&Ou(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var AQe=Cc("ArrayBuffer");function WUt(t){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(t):r=t&&t.buffer&&AQe(t.buffer),r}var GUt=nL("string"),Ou=nL("function"),RQe=nL("number"),aL=t=>t!==null&&typeof t=="object",VUt=t=>t===!0||t===!1,rL=t=>{if(iL(t)!=="object")return!1;let r=ele(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},YUt=Cc("Date"),JUt=Cc("File"),XUt=Cc("Blob"),QUt=Cc("FileList"),ejt=t=>aL(t)&&Ou(t.pipe),tjt=t=>{let r;return t&&(typeof FormData=="function"&&t instanceof FormData||Ou(t.append)&&((r=iL(t))==="formdata"||r==="object"&&Ou(t.toString)&&t.toString()==="[object FormData]"))},rjt=Cc("URLSearchParams"),[ijt,njt,ajt,ojt]=["ReadableStream","Request","Response","Headers"].map(Cc),sjt=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function BM(t,r,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let l,i;if(typeof t!="object"&&(t=[t]),o4(t))for(l=0,i=t.length;l<i;l++)r.call(null,t[l],l,t);else{let d=n?Object.getOwnPropertyNames(t):Object.keys(t),p=d.length,v;for(l=0;l<p;l++)v=d[l],r.call(null,t[v],v,t)}}function TQe(t,r){r=r.toLowerCase();let n=Object.keys(t),l=n.length,i;for(;l-- >0;)if(i=n[l],r===i.toLowerCase())return i;return null}var P6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,IQe=t=>!kM(t)&&t!==P6;function Q0e(){let{caseless:t}=IQe(this)&&this||{},r={},n=(l,i)=>{let d=t&&TQe(r,i)||i;rL(r[d])&&rL(l)?r[d]=Q0e(r[d],l):rL(l)?r[d]=Q0e({},l):o4(l)?r[d]=l.slice():r[d]=l};for(let l=0,i=arguments.length;l<i;l++)arguments[l]&&BM(arguments[l],n);return r}var fjt=(t,r,n,{allOwnKeys:l}={})=>(BM(r,(i,d)=>{n&&Ou(i)?t[d]=IM(i,n):t[d]=i},{allOwnKeys:l}),t),hjt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ujt=(t,r,n,l)=>{t.prototype=Object.create(r.prototype,l),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:r.prototype}),n&&Object.assign(t.prototype,n)},ljt=(t,r,n,l)=>{let i,d,p,v={};if(r=r||{},t==null)return r;do{for(i=Object.getOwnPropertyNames(t),d=i.length;d-- >0;)p=i[d],(!l||l(p,t,r))&&!v[p]&&(r[p]=t[p],v[p]=!0);t=n!==!1&&ele(t)}while(t&&(!n||n(t,r))&&t!==Object.prototype);return r},cjt=(t,r,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=r.length;let l=t.indexOf(r,n);return l!==-1&&l===n},djt=t=>{if(!t)return null;if(o4(t))return t;let r=t.length;if(!RQe(r))return null;let n=new Array(r);for(;r-- >0;)n[r]=t[r];return n},pjt=(t=>r=>t&&r instanceof t)(typeof Uint8Array<"u"&&ele(Uint8Array)),mjt=(t,r)=>{let l=(t&&t[Symbol.iterator]).call(t),i;for(;(i=l.next())&&!i.done;){let d=i.value;r.call(t,d[0],d[1])}},vjt=(t,r)=>{let n,l=[];for(;(n=t.exec(r))!==null;)l.push(n);return l},bjt=Cc("HTMLFormElement"),gjt=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,l,i){return l.toUpperCase()+i}),EQe=(({hasOwnProperty:t})=>(r,n)=>t.call(r,n))(Object.prototype),yjt=Cc("RegExp"),kQe=(t,r)=>{let n=Object.getOwnPropertyDescriptors(t),l={};BM(n,(i,d)=>{let p;(p=r(i,d,t))!==!1&&(l[d]=p||i)}),Object.defineProperties(t,l)},wjt=t=>{kQe(t,(r,n)=>{if(Ou(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let l=t[n];if(Ou(l)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},_jt=(t,r)=>{let n={},l=i=>{i.forEach(d=>{n[d]=!0})};return o4(t)?l(t):l(String(t).split(r)),n},Mjt=()=>{},Sjt=(t,r)=>t!=null&&Number.isFinite(t=+t)?t:r;function xjt(t){return!!(t&&Ou(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Ejt=t=>{let r=new Array(10),n=(l,i)=>{if(aL(l)){if(r.indexOf(l)>=0)return;if(!("toJSON"in l)){r[i]=l;let d=o4(l)?[]:{};return BM(l,(p,v)=>{let _=n(p,i+1);!kM(_)&&(d[v]=_)}),r[i]=void 0,d}}return l};return n(t,0)},Ajt=Cc("AsyncFunction"),Rjt=t=>t&&(aL(t)||Ou(t))&&Ou(t.then)&&Ou(t.catch),BQe=((t,r)=>t?setImmediate:r?((n,l)=>(P6.addEventListener("message",({source:i,data:d})=>{i===P6&&d===n&&l.length&&l.shift()()},!1),i=>{l.push(i),P6.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ou(P6.postMessage)),Tjt=typeof queueMicrotask<"u"?queueMicrotask.bind(P6):typeof We<"u"&&We.nextTick||BQe,ir={isArray:o4,isArrayBuffer:AQe,isBuffer:ZUt,isFormData:tjt,isArrayBufferView:WUt,isString:GUt,isNumber:RQe,isBoolean:VUt,isObject:aL,isPlainObject:rL,isReadableStream:ijt,isRequest:njt,isResponse:ajt,isHeaders:ojt,isUndefined:kM,isDate:YUt,isFile:JUt,isBlob:XUt,isRegExp:yjt,isFunction:Ou,isStream:ejt,isURLSearchParams:rjt,isTypedArray:pjt,isFileList:QUt,forEach:BM,merge:Q0e,extend:fjt,trim:sjt,stripBOM:hjt,inherits:ujt,toFlatObject:ljt,kindOf:iL,kindOfTest:Cc,endsWith:cjt,toArray:djt,forEachEntry:mjt,matchAll:vjt,isHTMLForm:bjt,hasOwnProperty:EQe,hasOwnProp:EQe,reduceDescriptors:kQe,freezeMethods:wjt,toObjectSet:_jt,toCamelCase:gjt,noop:Mjt,toFiniteNumber:Sjt,findKey:TQe,global:P6,isContextDefined:IQe,isSpecCompliantForm:xjt,toJSONObject:Ejt,isAsyncFn:Ajt,isThenable:Rjt,setImmediate:BQe,asap:Tjt};we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();function s4(t,r,n,l,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),l&&(this.request=l),i&&(this.response=i,this.status=i.status?i.status:null)}ir.inherits(s4,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ir.toJSONObject(this.config),code:this.code,status:this.status}}});var PQe=s4.prototype,OQe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{OQe[t]={value:t}});Object.defineProperties(s4,OQe);Object.defineProperty(PQe,"isAxiosError",{value:!0});s4.from=(t,r,n,l,i,d)=>{let p=Object.create(PQe);return ir.toFlatObject(t,p,function(_){return _!==Error.prototype},v=>v!=="isAxiosError"),s4.call(p,t.message,r,n,l,i),p.cause=t,p.name=t.name,d&&Object.assign(p,d),p};var ci=s4;we();Me();_e();var oL=null;function tle(t){return ir.isPlainObject(t)||ir.isArray(t)}function CQe(t){return ir.endsWith(t,"[]")?t.slice(0,-2):t}function NQe(t,r,n){return t?t.concat(r).map(function(i,d){return i=CQe(i),!n&&d?"["+i+"]":i}).join(n?".":""):r}function Ijt(t){return ir.isArray(t)&&!t.some(tle)}var kjt=ir.toFlatObject(ir,{},null,function(r){return/^is[A-Z]/.test(r)});function Bjt(t,r,n){if(!ir.isObject(t))throw new TypeError("target must be an object");r=r||new(oL||FormData),n=ir.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,I){return!ir.isUndefined(I[T])});let l=n.metaTokens,i=n.visitor||w,d=n.dots,p=n.indexes,_=(n.Blob||typeof Blob<"u"&&Blob)&&ir.isSpecCompliantForm(r);if(!ir.isFunction(i))throw new TypeError("visitor must be a function");function y(E){if(E===null)return"";if(ir.isDate(E))return E.toISOString();if(!_&&ir.isBlob(E))throw new ci("Blob is not supported. Use a Buffer instead.");return ir.isArrayBuffer(E)||ir.isTypedArray(E)?_&&typeof Blob=="function"?new Blob([E]):ze.from(E):E}function w(E,T,I){let B=E;if(E&&!I&&typeof E=="object"){if(ir.endsWith(T,"{}"))T=l?T:T.slice(0,-2),E=JSON.stringify(E);else if(ir.isArray(E)&&Ijt(E)||(ir.isFileList(E)||ir.endsWith(T,"[]"))&&(B=ir.toArray(E)))return T=CQe(T),B.forEach(function(N,H){!(ir.isUndefined(N)||N===null)&&r.append(p===!0?NQe([T],H,d):p===null?T:T+"[]",y(N))}),!1}return tle(E)?!0:(r.append(NQe(I,T,d),y(E)),!1)}let S=[],M=Object.assign(kjt,{defaultVisitor:w,convertValue:y,isVisitable:tle});function x(E,T){if(!ir.isUndefined(E)){if(S.indexOf(E)!==-1)throw Error("Circular reference detected in "+T.join("."));S.push(E),ir.forEach(E,function(B,O){(!(ir.isUndefined(B)||B===null)&&i.call(r,B,ir.isString(O)?O.trim():O,T,M))===!0&&x(B,T?T.concat(O):[O])}),S.pop()}}if(!ir.isObject(t))throw new TypeError("data must be an object");return x(t),r}var y2=Bjt;function LQe(t){let r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(l){return r[l]})}function DQe(t,r){this._pairs=[],t&&y2(t,this,r)}var $Qe=DQe.prototype;$Qe.append=function(r,n){this._pairs.push([r,n])};$Qe.toString=function(r){let n=r?function(l){return r.call(this,l,LQe)}:LQe;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};var sL=DQe;function Pjt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function PM(t,r,n){if(!r)return t;let l=n&&n.encode||Pjt;ir.isFunction(n)&&(n={serialize:n});let i=n&&n.serialize,d;if(i?d=i(r,n):d=ir.isURLSearchParams(r)?r.toString():new sL(r,n).toString(l),d){let p=t.indexOf("#");p!==-1&&(t=t.slice(0,p)),t+=(t.indexOf("?")===-1?"?":"&")+d}return t}we();Me();_e();var rle=class{constructor(){this.handlers=[]}use(r,n,l){return this.handlers.push({fulfilled:r,rejected:n,synchronous:l?l.synchronous:!1,runWhen:l?l.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){ir.forEach(this.handlers,function(l){l!==null&&r(l)})}},ile=rle;we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();var fL={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();var qQe=typeof URLSearchParams<"u"?URLSearchParams:sL;we();Me();_e();var UQe=typeof FormData<"u"?FormData:null;we();Me();_e();var jQe=typeof Blob<"u"?Blob:null;var FQe={isBrowser:!0,classes:{URLSearchParams:qQe,FormData:UQe,Blob:jQe},protocols:["http","https","file","blob","url","data"]};var ole={};Uf(ole,{hasBrowserEnv:()=>ale,hasStandardBrowserEnv:()=>Ojt,hasStandardBrowserWebWorkerEnv:()=>Njt,navigator:()=>nle,origin:()=>Cjt});we();Me();_e();var ale=typeof window<"u"&&typeof document<"u",nle=typeof navigator=="object"&&navigator||void 0,Ojt=ale&&(!nle||["ReactNative","NativeScript","NS"].indexOf(nle.product)<0),Njt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Cjt=ale&&window.location.href||"http://localhost";var _o={...ole,...FQe};function sle(t,r){return y2(t,new _o.classes.URLSearchParams,Object.assign({visitor:function(n,l,i,d){return _o.isNode&&ir.isBuffer(n)?(this.append(l,n.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},r))}we();Me();_e();function Ljt(t){return ir.matchAll(/\w+|\[(\w*)]/g,t).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Djt(t){let r={},n=Object.keys(t),l,i=n.length,d;for(l=0;l<i;l++)d=n[l],r[d]=t[d];return r}function $jt(t){function r(n,l,i,d){let p=n[d++];if(p==="__proto__")return!0;let v=Number.isFinite(+p),_=d>=n.length;return p=!p&&ir.isArray(i)?i.length:p,_?(ir.hasOwnProp(i,p)?i[p]=[i[p],l]:i[p]=l,!v):((!i[p]||!ir.isObject(i[p]))&&(i[p]=[]),r(n,l,i[p],d)&&ir.isArray(i[p])&&(i[p]=Djt(i[p])),!v)}if(ir.isFormData(t)&&ir.isFunction(t.entries)){let n={};return ir.forEachEntry(t,(l,i)=>{r(Ljt(l),i,n,0)}),n}return null}var hL=$jt;function qjt(t,r,n){if(ir.isString(t))try{return(r||JSON.parse)(t),ir.trim(t)}catch(l){if(l.name!=="SyntaxError")throw l}return(n||JSON.stringify)(t)}var fle={transitional:fL,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){let l=n.getContentType()||"",i=l.indexOf("application/json")>-1,d=ir.isObject(r);if(d&&ir.isHTMLForm(r)&&(r=new FormData(r)),ir.isFormData(r))return i?JSON.stringify(hL(r)):r;if(ir.isArrayBuffer(r)||ir.isBuffer(r)||ir.isStream(r)||ir.isFile(r)||ir.isBlob(r)||ir.isReadableStream(r))return r;if(ir.isArrayBufferView(r))return r.buffer;if(ir.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let v;if(d){if(l.indexOf("application/x-www-form-urlencoded")>-1)return sle(r,this.formSerializer).toString();if((v=ir.isFileList(r))||l.indexOf("multipart/form-data")>-1){let _=this.env&&this.env.FormData;return y2(v?{"files[]":r}:r,_&&new _,this.formSerializer)}}return d||i?(n.setContentType("application/json",!1),qjt(r)):r}],transformResponse:[function(r){let n=this.transitional||fle.transitional,l=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ir.isResponse(r)||ir.isReadableStream(r))return r;if(r&&ir.isString(r)&&(l&&!this.responseType||i)){let p=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(r)}catch(v){if(p)throw v.name==="SyntaxError"?ci.from(v,ci.ERR_BAD_RESPONSE,this,null,this.response):v}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_o.classes.FormData,Blob:_o.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ir.forEach(["delete","get","head","post","put","patch"],t=>{fle.headers[t]={}});var f4=fle;we();Me();_e();we();Me();_e();var Ujt=ir.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zQe=t=>{let r={},n,l,i;return t&&t.split(`
|
|
243
|
+
`]);return{boundary:n,body:l}}async function jSt(t){let r=await t.arrayBuffer(),n=await crypto.subtle.digest("SHA-256",r);return DSt.Buffer.from(n)}async function vfe({processId:t,data:r,tags:n,anchor:l}){let i=new Headers;t&&i.append("target",t),l&&i.append("anchor",l),n&&n.forEach(p=>i.append(p.name,p.value)),i.set("Variant","ao.N.1");let d;if(r){let p=i.get("content-type"),v=await USt(r,p);d=v.body,i.set("Content-Type",`multipart/form-data; boundary="${v.boundary}"`);let _=await jSt(d);i.append("Content-Digest",`sha-256=:${qSt(_)}:`)}return{headers:i,body:d}}function bfe({url:t,method:r,headers:n}){return n=new Headers(n),{fields:[...n.keys()].sort(),request:{url:t,method:r,headers:{...Object.fromEntries(n)}}}}function FSt(t){return`http-sig-${[...$St(t).subarray(1,9)].map(r=>r.toString(16).padStart(2,"0")).join("")}`}function zSt({fetch:t,logger:r,HB_URL:n,signer:l}){let i=r.child("deployProcess");return d=>wi(d).chain(Ji(({processId:p,data:v,tags:_})=>vfe({processId:p,data:v,tags:_}))).chain(Ji(({headers:p,body:v})=>l(bfe({url:`${n}/~scheduler@1.0/schedule`,method:"POST",headers:p})).then(_=>({..._,body:v})))).map(i.tap("Sending HTTP signed message to HB MU: %o")).chain(p=>wi(p).chain(Ji(({url:v,method:_,headers:y,body:w})=>t(v,{method:_,headers:y,body:w,redirect:"follow"}))).bichain(v=>Mc(v),Ji(async v=>{if(v.ok)return v.headers.get("process");throw new Error(`${v.status}: ${await v.text()}`)})).bimap(i.tap("Error encountered when deploying process via HB MU"),i.tap("Successfully deployed process via HB MU")).map(v=>({processId:v}))).toPromise()}function HSt({fetch:t,logger:r,HB_URL:n,signer:l}){let i=r.child("deployMessage");return d=>wi(d).chain(Ji(({processId:p,data:v,tags:_,anchor:y})=>vfe({processId:p,data:v,tags:_,anchor:y}))).chain(Ji(({headers:p,body:v})=>l(bfe({url:`${n}/~scheduler@1.0/schedule`,method:"POST",headers:p})).then(_=>({..._,body:v})))).map(i.tap("Sending HTTP signed message to HB MU: %o")).chain(p=>wi(p).chain(Ji(({url:v,method:_,headers:y,body:w})=>t(v,{method:_,headers:y,body:w,redirect:"follow"}))).bichain(v=>Mc(v),Ji(async v=>{if(v.ok)return v.headers.get("slot");throw new Error(`${v.status}: ${await v.text()}`)})).bimap(i.tap("Error encountered when writing message via HB MU"),i.tap("Successfully wrote message via HB MU")).map(v=>({messageId:v}))).toPromise()}function KSt({fetch:t,logger:r,HB_URL:n,signer:l}){let i=r.child("loadResult");return d=>wi(d).chain(Ji(async({id:p,processId:v})=>{let{headers:_,body:y}=await vfe({processId:v});return _.append("slot+integer",p),_.append("accept","application/json"),l(bfe({url:`${n}/~compute-lite@1.0/compute&slot+integer=${p}&process-id=${v}`,method:"POST",headers:_})).then(w=>({...w,body:y}))})).map(i.tap("fetching message result from HB CU: %o")).chain(p=>wi(p).chain(Ji(({url:v,method:_,headers:y,body:w})=>t(v,{method:_,headers:y,body:w,redirect:"follow"}))).bichain(v=>Mc(v),Ji(async v=>{if(v.ok)return v.json();throw new Error(`${v.status}: ${await v.text()}`)})).bimap(i.tap("Error encountered when writing message via HB CU"),i.tap("Successfully wrote message via HB CU"))).toPromise()}function ZSt({fetch:t,logger:r,HB_URL:n,signer:l}){return async(i,d)=>{let p=new URL(i);d.headers=new Headers(d.headers);let v=p.href,_=new URLSearchParams({"relay-path":v}),y=`${n}/~relay@1.0/call?${_.toString()}`;r('Relaying "%s" through HyperBEAM Node "%s"',p.href,y);let{headers:w}=await l({fields:[...d.headers.keys(),"relay-path"].sort(),request:{url:i,...d,headers:{...Object.fromEntries(d.headers),"relay-path":v}}});return t(y,{...d,headers:w})}}var WSt=uN(tyt(),1),jHe=(t="@permaweb/aoconnect")=>{let r=(0,WSt.default)(t);return r.child=n=>jHe(`${r.namespace}:${n}`),r.tap=(n,...l)=>TMt((...i)=>r(n,...l,...i)),r},FHe=({url:t,path:r})=>r?r.startsWith("/")?FHe({url:t,path:r.slice(1)}):(t=new URL(t),t.pathname+=r,t.toString()):t;function GSt(t){return a2(PN([]),a_((r,n)=>a2(xMt([],n.name),N_t(n.value),Nh(n.name,Ip,r))(r),{}),cfe(r=>r.length>1?r:r[0]))(t)}function XNe(t){return wHe([[q9(String),$9(t)],[q9(Array),dMt(t)],[sHe,z9t]])}function c6(t){let r;return q9(sl,t)?(r=new Error(VSt(t)),r.stack+=t.stack):q9(Error,t)?r=t:uMt("message",t)?r=new Error(t.message):q9(String,t)?r=new Error(t):r=new Error("An error occurred"),r}function VSt(t){return a2(r=>function n(l,i,d){return a_((p,v)=>a2(wHe([[$9(cr.invalid_arguments),()=>n(v.argumentsError,422,"Invalid Arguments")],[$9(cr.invalid_return_type),()=>n(v.returnTypeError,500,"Invalid Return")],[$9(cr.invalid_union),()=>V_t(_=>n(_,400,"Invalid Union"),v.unionErrors)],[sHe,()=>[{...v,status:i,contextCode:d}]]]),nMt(p))(v.code),[],l.issues)}(r,400,""),r=>a_((n,l)=>{let{message:i,path:d,contextCode:p}=l,v=d[1]||d[0],_=p?`${p} `:"";return n.push(`${_}'${v}': ${i}.`),n},[],r),yMt(" | "))(t)}var YSt=ar.object({id:ar.string().min(1,{message:"message is required to be a message id"}),processId:ar.string().min(1,{message:"process is required to be a process id"})});function JSt(){return t=>wi(t).map(YSt.parse).map(()=>t)}var B_=ar.object({name:ar.string(),value:ar.string()}),XSt=ar.function().args(ar.object({Id:ar.string(),Target:ar.string(),Owner:ar.string(),Anchor:ar.string().optional(),Data:ar.any().default("1234"),Tags:ar.array(ar.object({name:ar.string(),value:ar.string()}))})).returns(ar.promise(ar.any())),QSt=ar.function().args(ar.object({id:ar.string().min(1,{message:"message id is required"}),processId:ar.string().min(1,{message:"process id is required"})})).returns(ar.promise(ar.any())),ext=ar.function().args(ar.object({process:ar.string().min(1,{message:"process id is required"}),from:ar.string().optional(),to:ar.string().optional(),sort:ar.enum(["ASC","DESC"]).default("ASC"),limit:ar.number().optional()})).returns(ar.promise(ar.object({edges:ar.array(ar.object({cursor:ar.string(),node:ar.object({Output:ar.any().optional(),Messages:ar.array(ar.any()).optional(),Spawns:ar.array(ar.any()).optional(),Error:ar.any().optional()})}))}))),zHe=ar.function().args(ar.object({processId:ar.string(),data:ar.any(),tags:ar.array(B_),anchor:ar.string().optional(),signer:ar.any()})).returns(ar.promise(ar.object({messageId:ar.string()}).passthrough())),txt=ar.function().args(ar.object({data:ar.any(),tags:ar.array(B_),signer:ar.any()})).returns(ar.promise(ar.object({processId:ar.string()}).passthrough())),rxt=ar.function().args(ar.object({process:ar.string(),message:ar.string(),baseLayer:ar.boolean().optional(),exclude:ar.array(ar.string()).optional()})).returns(ar.promise(ar.object({assignmentId:ar.string()}).passthrough())),HHe=zHe,$0r=ar.function().args(ar.object({suUrl:ar.string().url(),processId:ar.string()})).returns(ar.promise(ar.object({tags:ar.array(B_)}).passthrough())),q0r=ar.function().args(ar.string()).returns(ar.promise(ar.object({url:ar.string()}))),ixt=ar.function().args(ar.string()).returns(ar.promise(ar.boolean())),nxt=ar.function().args(ar.string()).returns(ar.promise(ar.object({tags:ar.array(B_)}).passthrough())),ON=ar.function().args(ar.object({data:ar.any(),tags:ar.array(B_),target:ar.string().optional(),anchor:ar.string().optional()})).returns(ar.promise(ar.object({id:ar.string(),raw:ar.any()})));function axt({loadResult:t}){return t=Ji(QSt.implement(t)),r=>wi({id:r.id,processId:r.processId}).chain(t)}function ZX(t){let r=JSt(t),n=axt(t);return({message:l,process:i})=>wi({id:l,processId:i}).chain(r).chain(n).map(t.logger.tap('readResult result for message "%s": %O',l)).map(d=>d).bimap(c6,l6).toPromise()}var u6=(...t)=>r=>t.reduce((n,l)=>l(n),r),gfe=t=>r=>r??t,oxt=t=>r=>u6(n=>n&&n[r],gfe(t)),sxt=t=>r=>{let n={};for(let l in r)r.hasOwnProperty(l)&&(n[l]=t(r[l],l,r));return n},fxt=t=>(...r)=>!t(...r),NN=t=>r=>{let n=r.findIndex(i=>i.name==="Data-Protocol"&&i.value===t);if(n===-1)return[0,0];let l=r.findIndex((i,d)=>d>n&&i.name==="Data-Protocol"&&i.value!==t);return l===-1&&(l=r.length),[n,l]},yfe=t=>{let r=t.findIndex(n=>n.name==="Data-Protocol");return r===-1&&(r=t.length),r},KHe=t=>r=>r.name===t,wfe=(t,r)=>u6(NN(t),([n,l])=>r.slice(n,l))(r),ZHe=(t,r,n)=>u6(l=>wfe(t,l),l=>l.filter(KHe(r)))(n),hxt=(t,r,n)=>u6(l=>ZHe(t,r,l),l=>l[0])(n),CN=(t,r)=>(r=r.filter(n=>n.name!=="Data-Protocol"||n.value!==t),r.length?[{name:"Data-Protocol",value:t},...r]:[]),uxt=(t,r,n)=>{let[l,i]=NN(t)(n),[d,p,v]=[n.slice(0,l),n.slice(l,i),n.slice(i)];return p.length||(r=CN(t,r),d=v,v=[]),[d,p,r,v].flat(1)},lxt=(t,r)=>{let n=yfe(r),[l,i]=[r.slice(0,n),r.slice(n)];return[l,t,i].flat(1)},WHe=(t,r,n)=>{let[l,i]=NN(t)(n),[d,p]=[n.slice(0,l),n.slice(i)];return p.length===n.length&&(d=p,p=[]),[d,CN(t,r),p].flat(1)},cxt=(t,r)=>WHe(t,[],r),dxt=(t,r,n)=>{let[l,i]=NN(t)(n),[d,p,v]=[n.slice(0,l),n.slice(l,i),n.slice(i)];return[d,CN(t,p.filter(fxt(KHe(r)))),v].flat(1)},_fe=(t,r=!1)=>u6(gfe([]),n=>n.reduce((l,i)=>u6(oxt([])(i.name),d=>(d.push(i.value),d),d=>(l[i.name]=d,l))(l),{}),sxt(n=>r?n:n[0]))(t),GHe=(t,r,n)=>u6(gfe([]),l=>wfe(t,l),l=>_fe(l,n))(r),pxt=(t,r)=>GHe(t,r,!0),mxt=(t,r)=>GHe(t,r,!1),vxt=t=>{let r=yfe(t);return _fe(t.slice(0,r),!1)},bxt=t=>{let r=yfe(t);return _fe(t.slice(0,r),!0)},VHe=t=>({findAll:r=>wfe(t,r),findAllByName:(r,n)=>ZHe(t,r,n),findByName:(r,n)=>hxt(t,r,n),create:r=>CN(t,r),update:(r,n)=>WHe(t,r,n),concat:(r,n)=>uxt(t,r,n),removeAll:r=>cxt(t,r),removeAllByName:(r,n)=>dxt(t,r,n),parse:r=>mxt(t,r),parseAll:r=>pxt(t,r),concatUnassoc:lxt,parseUnassoc:vxt,parseAllUnassoc:bxt}),Mfe=VHe("ao"),QNe=O8(Mfe.removeAllByName),gxt=O8(Mfe.concat),eCe=O8(Mfe.concatUnassoc),yxt=ar.array(ar.object({name:ar.string(),value:ar.string()}));function wxt(){return t=>wi(t.tags).map(PN([])).map(QNe("Variant")).map(QNe("Type")).map(gxt([{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"}])).map(yxt.parse).map(Nh("tags",Ip,t))}function _xt({logger:t}){return r=>wi(r).chain(_He(vHe(r.data),()=>o6(r),()=>o6(" ").map(Nh("data",Ip,r)).map(n=>a2(s6("tags"),eCe([{name:"Content-Type",value:"text/plain"}]),Nh("tags",Ip,n))(n)).map(t.tap('added pseudo-random string as message "data"')))).map(n=>a2(s6("tags"),eCe([{name:"SDK",value:"aoconnect"}]),Nh("tags",Ip,n))(n))}function Mxt(t){let r=wxt(t),n=_xt(t),l=zHe.implement(t.deployMessage);return i=>wi(i).chain(r).chain(n).chain(Ji(({id:d,data:p,tags:v,anchor:_,signer:y})=>l({processId:d,data:p,tags:v,anchor:_,signer:ON.implement(y)}))).map(d=>Nh("messageId",d.messageId,i))}function WX(t){let r=Mxt(t);return({process:n,data:l,tags:i,anchor:d,signer:p})=>wi({id:n,data:l,tags:i,anchor:d,signer:p}).chain(r).map(v=>v.messageId).bimap(c6,l6).toPromise()}var U7=(t,r,n)=>l=>r(l[t])?o6(l):Mc(`Tag '${t}': ${n}`);function Sxt({loadTransactionMeta:t,logger:r}){return t=Ji(nxt.implement(t)),n=>wi(n).chain(t).map(s6("tags")).map(GSt).chain(U7("Data-Protocol",XNe("ao"),"value 'ao' was not found on module")).chain(U7("Type",XNe("Module"),"value 'Module' was not found on module")).chain(U7("Module-Format",zX,"was not found on module")).chain(U7("Input-Encoding",zX,"was not found on module")).chain(U7("Output-Encoding",zX,"was not found on module")).bimap(r.tap("Verifying module source failed: %s"),r.tap("Verified module source"))}function xxt({logger:t,validateScheduler:r}){return r=Ji(ixt.implement(r)),n=>wi(n).chain(l=>r(l).chain(i=>i?o6(l):Mc(`Valid Scheduler-Location owned by ${l} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function Ext({logger:t}){return r=>wi(r).map(t.tap("Checking for signer")).chain(n=>n?o6(n):Mc("signer not found"))}function Axt(t){let r=t.logger.child("verifyInput");t={...t,logger:r};let n=Sxt(t),l=xxt(t),i=Ext(t);return d=>wi(d).chain(p=>n(p.module).map(()=>p)).chain(p=>i(p.signer).map(()=>p)).bimap(r.tap("Error when verify input: %s"),r.tap("Successfully verified inputs"))}var Sfe=VHe("ao"),NT=O8(Sfe.removeAllByName),Rxt=O8(Sfe.concat),tCe=O8(Sfe.concatUnassoc),Txt=ar.array(ar.object({name:ar.string(),value:ar.string()}));function Ixt(){return t=>wi(t).map(s6("tags")).map(PN([])).map(NT("Variant")).map(NT("Type")).map(NT("Module")).map(NT("Scheduler")).map(Rxt([{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler}])).map(Txt.parse).map(Nh("tags",Ip,t))}function kxt({logger:t}){return r=>wi(r).chain(_He(vHe(r.data),()=>o6(r),()=>o6(" ").map(Nh("data",Ip,r)).map(n=>a2(s6("tags"),tCe([{name:"Content-Type",value:"text/plain"}]),Nh("tags",Ip,n))(n)).map(t.tap('added pseudo-random string as process "data"')))).map(n=>a2(s6("tags"),tCe([{name:"SDK",value:"aoconnect"}]),Nh("tags",Ip,n))(n))}function Bxt(t){let r=t.logger.child("uploadProcess");t={...t,logger:r};let n=Ixt(t),l=kxt(t),i=txt.implement(t.deployProcess);return d=>wi(d).chain(n).chain(l).chain(Ji(({data:p,tags:v,signer:_})=>i({data:p,tags:v,signer:ON.implement(_)}))).map(p=>Nh("processId",p.processId,d))}function GX(t){let r=Axt(t),n=Bxt(t);return({module:l,scheduler:i,signer:d,tags:p,data:v})=>wi({module:l,scheduler:i,signer:d,tags:p,data:v}).chain(r).chain(n).map(_=>_.processId).bimap(c6,l6).toPromise()}function Pxt(t){let r=HHe.implement(t.deployMonitor);return n=>wi(n).chain(Ji(({id:l,signer:i})=>r({processId:l,signer:ON.implement(i),data:" ",tags:[]}))).map(l=>Nh("monitorId",l.messageId,n))}function rCe(t){let r=Pxt(t);return({process:n,signer:l})=>wi({id:n,signer:l}).chain(r).map(i=>i.monitorId).bimap(c6,l6).toPromise()}function Oxt(t){let r=HHe.implement(t.deployUnmonitor);return n=>wi(n).chain(Ji(({id:l,signer:i})=>r({processId:l,signer:ON.implement(i),data:" ",tags:[]}))).map(l=>Nh("monitorId",l.messageId,n))}function iCe(t){let r=Oxt(t);return({process:n,signer:l})=>wi({id:n,signer:l}).chain(r).map(i=>i.monitorId).bimap(c6,l6).toPromise()}var Nxt=ar.object({process:ar.string().min(1,{message:"process identifier is required"}),from:ar.string().optional(),to:ar.string().optional(),sort:ar.enum(["ASC","DESC"]).default("ASC"),limit:ar.number().optional()});function Cxt(){return t=>wi(t).map(Nxt.parse).map(()=>t)}function Lxt({queryResults:t}){return t=Ji(ext.implement(t)),r=>wi({process:r.process,from:r.from,to:r.to,sort:r.sort,limit:r.limit}).chain(t)}function nCe(t){let r=Cxt(t),n=Lxt(t);return({process:l,from:i,to:d,sort:p,limit:v})=>wi({process:l,from:i,to:d,sort:p,limit:v}).chain(r).chain(n).map(t.logger.tap('readResults result for message "%s": %O',l)).map(_=>_).bimap(c6,l6).toPromise()}var Dxt=ar.object({Id:ar.string(),Target:ar.string(),Owner:ar.string(),Anchor:ar.string().optional(),Data:ar.any().default("1234"),Tags:ar.array(ar.object({name:ar.string(),value:ar.string()}))});function $xt(){return t=>wi(t).map(Dxt.parse).map(r=>(r.Tags=r.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),r))}function qxt({dryrunFetch:t}){return Ji(XSt.implement(t))}function aCe(t){let r=$xt(t),n=qxt(t);return l=>wi(l).map(Uxt).chain(r).chain(n).toPromise()}function Uxt({process:t,data:r,tags:n,anchor:l,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:r||"1234",Tags:n||[],Anchor:l||"0"}}function jxt(t){let r=rxt.implement(t.deployAssign);return n=>wi(n).chain(Ji(({process:l,message:i,baseLayer:d,exclude:p})=>r({process:l,message:i,baseLayer:d,exclude:p}))).map(l=>Nh("assignmentId",l.assignmentId,n))}function oCe(t){let r=jxt(t);return({process:n,message:l,baseLayer:i,exclude:d})=>wi({process:n,message:l,baseLayer:i,exclude:d}).chain(r).map(p=>p.assignmentId).bimap(c6,l6).toPromise()}var Fxt="https://arweave.net",zxt="https://mu.ao-testnet.xyz",Hxt="https://cu.ao-testnet.xyz",Kxt="http://localhost:8734",Zxt="http://localhost:8734",Wxt="http://cu.s451-comm3-main.xyz",Gxt="http://mu.s451-comm3-main.xyz",qg=fetch;function Vxt({createDataItemSigner:t,createHbSigner:r}){let n=jHe();function l({MODE:v,wallet:_,GRAPHQL_URL:y,GRAPHQL_MAX_RETRIES:w,GRAPHQL_RETRY_BACKOFF:S,MU_URL:M=Gxt,CU_URL:x=Wxt,RELAY_URL:E=Kxt,fetch:T=qg}){let I=n.child("relay");I("Mode Activated \u{1F500}");let B=r(_),O=()=>t(_),N=ZSt({fetch:qg,logger:I,HB_URL:E,signer:B}),{validate:H}=Aoe({cacheSize:100,GRAPHQL_URL:y,GRAPHQL_MAX_RETRIES:w,GRAPHQL_RETRY_BACKOFF:S}),K=I.child("result"),J=ZX({loadResult:UNe({fetch:N,CU_URL:x,logger:K}),logger:K}),L=I.child("message"),$=WX({deployMessage:NNe({fetch:N,MU_URL:M,logger:L}),logger:L}),V=I.child("spawn"),h=GX({loadTransactionMeta:KX({fetch:T,GRAPHQL_URL:y,logger:V}),validateScheduler:H,deployProcess:CNe({fetch:N,MU_URL:M,logger:V}),logger:V}),e=I.child("monitor"),a=rCe({deployMonitor:LNe({fetch:N,MU_URL:M,logger:e}),logger:e}),s=I.child("unmonitor"),u=iCe({deployUnmonitor:DNe({fetch:N,MU_URL:M,logger:s}),logger:e}),c=I.child("results"),g=nCe({queryResults:jNe({fetch:N,CU_URL:x,logger:c}),logger:c}),m=I.child("dryrun"),f=aCe({dryrunFetch:qNe({fetch:N,CU_URL:x,logger:m}),logger:m}),o=I.child("assign"),b=oCe({deployAssign:$Ne({fetch:N,MU_URL:M,logger:o}),logger:L});return{MODE:v,result:J,results:g,message:$,spawn:h,monitor:a,unmonitor:u,dryrun:f,assign:b,createDataItemSigner:O}}function i({MODE:v,GRAPHQL_URL:_,GRAPHQL_MAX_RETRIES:y,GRAPHQL_RETRY_BACKOFF:w,MU_URL:S=zxt,CU_URL:M=Hxt,fetch:x=qg,noLog:E}){let T=n.child("legacy");E||T("Mode Activated \u2139\uFE0F");let{validate:I}=Aoe({cacheSize:100,GRAPHQL_URL:_,GRAPHQL_MAX_RETRIES:y,GRAPHQL_RETRY_BACKOFF:w}),B=T.child("result"),O=ZX({loadResult:UNe({fetch:x,CU_URL:M,logger:B}),logger:B}),N=T.child("message"),H=WX({deployMessage:NNe({fetch:x,MU_URL:S,logger:N}),logger:N}),K=T.child("spawn"),J=GX({loadTransactionMeta:KX({fetch:x,GRAPHQL_URL:_,logger:K}),validateScheduler:I,deployProcess:CNe({fetch:x,MU_URL:S,logger:K}),logger:K}),L=T.child("monitor"),$=rCe({deployMonitor:LNe({fetch:x,MU_URL:S,logger:L}),logger:L}),V=T.child("unmonitor"),h=iCe({deployUnmonitor:DNe({fetch:x,MU_URL:S,logger:V}),logger:L}),e=T.child("results"),a=nCe({queryResults:jNe({fetch:x,CU_URL:M,logger:e}),logger:e}),s=T.child("dryrun"),u=aCe({dryrunFetch:qNe({fetch:x,CU_URL:M,logger:s}),logger:s}),c=T.child("assign"),g=oCe({deployAssign:$Ne({fetch:x,MU_URL:S,logger:c}),logger:N});return{MODE:v,result:O,results:a,message:H,spawn:J,monitor:$,unmonitor:h,dryrun:u,assign:g,createDataItemSigner:t}}function d({MODE:v,wallet:_,GRAPHQL_URL:y,AO_URL:w=Zxt,fetch:S=qg}){let M=n.child("mainnet");if(M("Mode Activated \u{1F432}"),!_)throw new Error("mainnet mode requires providing a wallet to connect()");let x=r(_),E=()=>t(_);async function T(J){return M('Mock validation for address "%s"',J),!0}let I=M.child("result"),B=ZX({loadResult:KSt({fetch:qg,logger:I,HB_URL:w,signer:x}),logger:I}),O=M.child("message"),N=WX({deployMessage:HSt({fetch:qg,logger:O,HB_URL:w,signer:x}),logger:O}),H=M.child("spawn"),K=GX({loadTransactionMeta:KX({fetch:S,GRAPHQL_URL:y,logger:H}),validateScheduler:T,deployProcess:zSt({fetch:qg,logger:H,HB_URL:w,signer:x}),logger:H});return{MODE:v,result:B,message:N,spawn:K,createDataItemSigner:E}}function p(v={}){let{GRAPHQL_URL:_,GATEWAY_URL:y=Fxt,...w}=v;_||(_=FHe({url:y,path:"/graphql"}));let S=v.MODE||"legacy";if(S==="legacy")return i({...w,GRAPHQL_URL:_});if(S==="relay")return l({...w,GRAPHQL_URL:_});if(S==="mainnet")return d({...w,GRAPHQL_URL:_});throw new Error(`Unrecognized MODE: ${S}`)}return p}var $oe={};hN($oe,{createDataItemSigner:()=>MEt,createHbSigner:()=>SEt});var xfe=uN(hCe(),1),YHe={};hN(YHe,{AVSCTap:()=>P_,ArweaveSigner:()=>Rfe,DataItem:()=>__,MAX_TAG_BYTES:()=>LN,MIN_BINARY_SIZE:()=>kfe,SIG_CONFIG:()=>x8,SignatureConfig:()=>ol,Signer:()=>eKe,createData:()=>nKe,default:()=>bEt,deserializeTags:()=>sN,indexToType:()=>Tfe,serializeTags:()=>Ife,tagsExceedLimit:()=>iKe,warparbundles:()=>gEt});var Yxt=Object.create,Efe=Object.defineProperty,Jxt=Object.getOwnPropertyDescriptor,Xxt=Object.getOwnPropertyNames,Qxt=Object.getPrototypeOf,eEt=Object.prototype.hasOwnProperty,Np=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),tEt=(t,r)=>{for(var n in r)Efe(t,n,{get:r[n],enumerable:!0})},rEt=(t,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Xxt(r))!eEt.call(t,i)&&i!==n&&Efe(t,i,{get:()=>r[i],enumerable:!(l=Jxt(r,i))||l.enumerable});return t},d6=(t,r,n)=>(n=t!=null?Yxt(Qxt(t)):{},rEt(r||!t||!t.__esModule?Efe(n,"default",{value:t,enumerable:!0}):n,t)),iEt=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(n){var l=4,i=n.length,d=i%l;if(!d)return n;var p=i,v=l-d,_=i+v,y=ze.alloc(_);for(y.write(n);v--;)y.write("=",p++);return y.toString()}t.default=r}),nEt=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=iEt();function n(_,y){return y===void 0&&(y="utf8"),ze.isBuffer(_)?d(_.toString("base64")):d(ze.from(_,y).toString("base64"))}function l(_,y){return y===void 0&&(y="utf8"),ze.from(i(_),"base64").toString(y)}function i(_){return _=_.toString(),r.default(_).replace(/\-/g,"+").replace(/_/g,"/")}function d(_){return _.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function p(_){return ze.from(i(_),"base64")}var v=n;v.encode=n,v.decode=l,v.toBase64=i,v.fromBase64=d,v.toBuffer=p,t.default=v}),Afe=Np((t,r)=>{r.exports=nEt().default,r.exports.default=r.exports}),JHe=Np(t=>{"use strict";t.byteLength=_,t.toByteArray=w,t.fromByteArray=x;var r=[],n=[],l=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,p=i.length;d<p;++d)r[d]=i[d],n[i.charCodeAt(d)]=d;var d,p;n[45]=62,n[95]=63;function v(E){var T=E.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=E.indexOf("=");I===-1&&(I=T);var B=I===T?0:4-I%4;return[I,B]}function _(E){var T=v(E),I=T[0],B=T[1];return(I+B)*3/4-B}function y(E,T,I){return(T+I)*3/4-I}function w(E){var T,I=v(E),B=I[0],O=I[1],N=new l(y(E,B,O)),H=0,K=O>0?B-4:B,J;for(J=0;J<K;J+=4)T=n[E.charCodeAt(J)]<<18|n[E.charCodeAt(J+1)]<<12|n[E.charCodeAt(J+2)]<<6|n[E.charCodeAt(J+3)],N[H++]=T>>16&255,N[H++]=T>>8&255,N[H++]=T&255;return O===2&&(T=n[E.charCodeAt(J)]<<2|n[E.charCodeAt(J+1)]>>4,N[H++]=T&255),O===1&&(T=n[E.charCodeAt(J)]<<10|n[E.charCodeAt(J+1)]<<4|n[E.charCodeAt(J+2)]>>2,N[H++]=T>>8&255,N[H++]=T&255),N}function S(E){return r[E>>18&63]+r[E>>12&63]+r[E>>6&63]+r[E&63]}function M(E,T,I){for(var B,O=[],N=T;N<I;N+=3)B=(E[N]<<16&16711680)+(E[N+1]<<8&65280)+(E[N+2]&255),O.push(S(B));return O.join("")}function x(E){for(var T,I=E.length,B=I%3,O=[],N=16383,H=0,K=I-B;H<K;H+=N)O.push(M(E,H,H+N>K?K:H+N));return B===1?(T=E[I-1],O.push(r[T>>2]+r[T<<4&63]+"==")):B===2&&(T=(E[I-2]<<8)+E[I-1],O.push(r[T>>10]+r[T>>4&63]+r[T<<2&63]+"=")),O.join("")}}),XHe=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var r=JHe();function n(M){let x=0;for(let I=0;I<M.length;I++)x+=M[I].byteLength;let E=new Uint8Array(x),T=0;E.set(new Uint8Array(M[0]),T),T+=M[0].byteLength;for(let I=1;I<M.length;I++)E.set(new Uint8Array(M[I]),T),T+=M[I].byteLength;return E}t.concatBuffers=n;function l(M){let x=v(M);return i(x)}t.b64UrlToString=l;function i(M){return new TextDecoder("utf-8",{fatal:!0}).decode(M)}t.bufferToString=i;function d(M){return new TextEncoder().encode(M)}t.stringToBuffer=d;function p(M){return y(d(M))}t.stringToB64Url=p;function v(M){return new Uint8Array(r.toByteArray(S(M)))}t.b64UrlToBuffer=v;function _(M){return r.fromByteArray(new Uint8Array(M))}t.bufferTob64=_;function y(M){return w(_(M))}t.bufferTob64Url=y;function w(M){return M.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=w;function S(M){M=M.replace(/\-/g,"+").replace(/\_/g,"/");let x;return M.length%4==0?x=0:x=4-M.length%4,M.concat("=".repeat(x))}t.b64UrlDecode=S}),aEt=Np(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=XHe(),n=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let l=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",l.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(l,i,{saltLength:d}={}){let p=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(l),i);return new Uint8Array(p)}async hash(l,i="SHA-256"){let d=await this.driver.digest(i,l);return new Uint8Array(d)}async verify(l,i,d){let p={kty:"RSA",e:"AQAB",n:l},v=await this.jwkToPublicCryptoKey(p),_=await this.driver.digest("SHA-256",i),y=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,d,i),w=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,d,i),S=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-_.byteLength-2},v,d,i);return y||w||S}async jwkToCryptoKey(l){return this.driver.importKey("jwk",l,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(l){return this.driver.importKey("jwk",l,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let l=crypto?.subtle;return l===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof l[i]=="function")}async encrypt(l,i,d){let p=await this.driver.importKey("raw",typeof i=="string"?r.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},p,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),_=new Uint8Array(16);crypto.getRandomValues(_);let y=await this.driver.encrypt({name:"AES-CBC",iv:_},v,l);return r.concatBuffers([_,y])}async decrypt(l,i,d){let p=await this.driver.importKey("raw",typeof i=="string"?r.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},p,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),_=l.slice(0,16),y=await this.driver.decrypt({name:"AES-CBC",iv:_},v,l.slice(16));return r.concatBuffers([y])}};t.default=n}),oEt=Np(t=>{t.read=function(r,n,l,i,d){var p,v,_=d*8-i-1,y=(1<<_)-1,w=y>>1,S=-7,M=l?d-1:0,x=l?-1:1,E=r[n+M];for(M+=x,p=E&(1<<-S)-1,E>>=-S,S+=_;S>0;p=p*256+r[n+M],M+=x,S-=8);for(v=p&(1<<-S)-1,p>>=-S,S+=i;S>0;v=v*256+r[n+M],M+=x,S-=8);if(p===0)p=1-w;else{if(p===y)return v?NaN:(E?-1:1)*(1/0);v=v+Math.pow(2,i),p=p-w}return(E?-1:1)*v*Math.pow(2,p-i)},t.write=function(r,n,l,i,d,p){var v,_,y,w=p*8-d-1,S=(1<<w)-1,M=S>>1,x=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=i?0:p-1,T=i?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(_=isNaN(n)?1:0,v=S):(v=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-v))<1&&(v--,y*=2),v+M>=1?n+=x/y:n+=x*Math.pow(2,1-M),n*y>=2&&(v++,y/=2),v+M>=S?(_=0,v=S):v+M>=1?(_=(n*y-1)*Math.pow(2,d),v=v+M):(_=n*Math.pow(2,M-1)*Math.pow(2,d),v=0));d>=8;r[l+E]=_&255,E+=T,_/=256,d-=8);for(v=v<<d|_,w+=d;w>0;r[l+E]=v&255,E+=T,v/=256,w-=8);r[l+E-T]|=I*128}}),qoe=Np(t=>{"use strict";var r=JHe(),n=oEt(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=O,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let P=new Uint8Array(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,Uint8Array.prototype),Object.setPrototypeOf(P,C),P.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function p(P){if(P>i)throw new RangeError('The value "'+P+'" is invalid for option "size"');let C=new Uint8Array(P);return Object.setPrototypeOf(C,v.prototype),C}function v(P,C,U){if(typeof P=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(P)}return _(P,C,U)}v.poolSize=8192;function _(P,C,U){if(typeof P=="string")return M(P,C);if(ArrayBuffer.isView(P))return E(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(Be(P,ArrayBuffer)||P&&Be(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Be(P,SharedArrayBuffer)||P&&Be(P.buffer,SharedArrayBuffer)))return T(P,C,U);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=P.valueOf&&P.valueOf();if(ee!=null&&ee!==P)return v.from(ee,C,U);let Q=I(P);if(Q)return Q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return v.from(P[Symbol.toPrimitive]("string"),C,U);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}v.from=function(P,C,U){return _(P,C,U)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function y(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function w(P,C,U){return y(P),P<=0?p(P):C!==void 0?typeof U=="string"?p(P).fill(C,U):p(P).fill(C):p(P)}v.alloc=function(P,C,U){return w(P,C,U)};function S(P){return y(P),p(P<0?0:B(P)|0)}v.allocUnsafe=function(P){return S(P)},v.allocUnsafeSlow=function(P){return S(P)};function M(P,C){if((typeof C!="string"||C==="")&&(C="utf8"),!v.isEncoding(C))throw new TypeError("Unknown encoding: "+C);let U=N(P,C)|0,ee=p(U),Q=ee.write(P,C);return Q!==U&&(ee=ee.slice(0,Q)),ee}function x(P){let C=P.length<0?0:B(P.length)|0,U=p(C);for(let ee=0;ee<C;ee+=1)U[ee]=P[ee]&255;return U}function E(P){if(Be(P,Uint8Array)){let C=new Uint8Array(P);return T(C.buffer,C.byteOffset,C.byteLength)}return x(P)}function T(P,C,U){if(C<0||P.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(P.byteLength<C+(U||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return C===void 0&&U===void 0?ee=new Uint8Array(P):U===void 0?ee=new Uint8Array(P,C):ee=new Uint8Array(P,C,U),Object.setPrototypeOf(ee,v.prototype),ee}function I(P){if(v.isBuffer(P)){let C=B(P.length)|0,U=p(C);return U.length===0||P.copy(U,0,0,C),U}if(P.length!==void 0)return typeof P.length!="number"||ge(P.length)?p(0):x(P);if(P.type==="Buffer"&&Array.isArray(P.data))return x(P.data)}function B(P){if(P>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return P|0}function O(P){return+P!=P&&(P=0),v.alloc(+P)}v.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==v.prototype},v.compare=function(P,C){if(Be(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),Be(C,Uint8Array)&&(C=v.from(C,C.offset,C.byteLength)),!v.isBuffer(P)||!v.isBuffer(C))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===C)return 0;let U=P.length,ee=C.length;for(let Q=0,te=Math.min(U,ee);Q<te;++Q)if(P[Q]!==C[Q]){U=P[Q],ee=C[Q];break}return U<ee?-1:ee<U?1:0},v.isEncoding=function(P){switch(String(P).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(P,C){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return v.alloc(0);let U;if(C===void 0)for(C=0,U=0;U<P.length;++U)C+=P[U].length;let ee=v.allocUnsafe(C),Q=0;for(U=0;U<P.length;++U){let te=P[U];if(Be(te,Uint8Array))Q+te.length>ee.length?(v.isBuffer(te)||(te=v.from(te)),te.copy(ee,Q)):Uint8Array.prototype.set.call(ee,te,Q);else if(v.isBuffer(te))te.copy(ee,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=te.length}return ee};function N(P,C){if(v.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||Be(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);let U=P.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&U===0)return 0;let Q=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":return re(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U*2;case"hex":return U>>>1;case"base64":return he(P).length;default:if(Q)return ee?-1:re(P).length;C=(""+C).toLowerCase(),Q=!0}}v.byteLength=N;function H(P,C,U){let ee=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((U===void 0||U>this.length)&&(U=this.length),U<=0)||(U>>>=0,C>>>=0,U<=C))return"";for(P||(P="utf8");;)switch(P){case"hex":return o(this,C,U);case"utf8":case"utf-8":return u(this,C,U);case"ascii":return m(this,C,U);case"latin1":case"binary":return f(this,C,U);case"base64":return s(this,C,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,C,U);default:if(ee)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(P,C,U){let ee=P[C];P[C]=P[U],P[U]=ee}v.prototype.swap16=function(){let P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let C=0;C<P;C+=2)K(this,C,C+1);return this},v.prototype.swap32=function(){let P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let C=0;C<P;C+=4)K(this,C,C+3),K(this,C+1,C+2);return this},v.prototype.swap64=function(){let P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let C=0;C<P;C+=8)K(this,C,C+7),K(this,C+1,C+6),K(this,C+2,C+5),K(this,C+3,C+4);return this},v.prototype.toString=function(){let P=this.length;return P===0?"":arguments.length===0?u(this,0,P):H.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(P){if(!v.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:v.compare(this,P)===0},v.prototype.inspect=function(){let P="",C=t.INSPECT_MAX_BYTES;return P=this.toString("hex",0,C).replace(/(.{2})/g,"$1 ").trim(),this.length>C&&(P+=" ... "),"<Buffer "+P+">"},l&&(v.prototype[l]=v.prototype.inspect),v.prototype.compare=function(P,C,U,ee,Q){if(Be(P,Uint8Array)&&(P=v.from(P,P.offset,P.byteLength)),!v.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(C===void 0&&(C=0),U===void 0&&(U=P?P.length:0),ee===void 0&&(ee=0),Q===void 0&&(Q=this.length),C<0||U>P.length||ee<0||Q>this.length)throw new RangeError("out of range index");if(ee>=Q&&C>=U)return 0;if(ee>=Q)return-1;if(C>=U)return 1;if(C>>>=0,U>>>=0,ee>>>=0,Q>>>=0,this===P)return 0;let te=Q-ee,le=U-C,Ie=Math.min(te,le),se=this.slice(ee,Q),Ee=P.slice(C,U);for(let me=0;me<Ie;++me)if(se[me]!==Ee[me]){te=se[me],le=Ee[me];break}return te<le?-1:le<te?1:0};function J(P,C,U,ee,Q){if(P.length===0)return-1;if(typeof U=="string"?(ee=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,ge(U)&&(U=Q?0:P.length-1),U<0&&(U=P.length+U),U>=P.length){if(Q)return-1;U=P.length-1}else if(U<0)if(Q)U=0;else return-1;if(typeof C=="string"&&(C=v.from(C,ee)),v.isBuffer(C))return C.length===0?-1:L(P,C,U,ee,Q);if(typeof C=="number")return C=C&255,typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(P,C,U):Uint8Array.prototype.lastIndexOf.call(P,C,U):L(P,[C],U,ee,Q);throw new TypeError("val must be string, number or Buffer")}function L(P,C,U,ee,Q){let te=1,le=P.length,Ie=C.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(P.length<2||C.length<2)return-1;te=2,le/=2,Ie/=2,U/=2}function se(me,pe){return te===1?me[pe]:me.readUInt16BE(pe*te)}let Ee;if(Q){let me=-1;for(Ee=U;Ee<le;Ee++)if(se(P,Ee)===se(C,me===-1?0:Ee-me)){if(me===-1&&(me=Ee),Ee-me+1===Ie)return me*te}else me!==-1&&(Ee-=Ee-me),me=-1}else for(U+Ie>le&&(U=le-Ie),Ee=U;Ee>=0;Ee--){let me=!0;for(let pe=0;pe<Ie;pe++)if(se(P,Ee+pe)!==se(C,pe)){me=!1;break}if(me)return Ee}return-1}v.prototype.includes=function(P,C,U){return this.indexOf(P,C,U)!==-1},v.prototype.indexOf=function(P,C,U){return J(this,P,C,U,!0)},v.prototype.lastIndexOf=function(P,C,U){return J(this,P,C,U,!1)};function $(P,C,U,ee){U=Number(U)||0;let Q=P.length-U;ee?(ee=Number(ee),ee>Q&&(ee=Q)):ee=Q;let te=C.length;ee>te/2&&(ee=te/2);let le;for(le=0;le<ee;++le){let Ie=parseInt(C.substr(le*2,2),16);if(ge(Ie))return le;P[U+le]=Ie}return le}function V(P,C,U,ee){return Re(re(C,P.length-U),P,U,ee)}function h(P,C,U,ee){return Re(fe(C),P,U,ee)}function e(P,C,U,ee){return Re(he(C),P,U,ee)}function a(P,C,U,ee){return Re(ye(C,P.length-U),P,U,ee)}v.prototype.write=function(P,C,U,ee){if(C===void 0)ee="utf8",U=this.length,C=0;else if(U===void 0&&typeof C=="string")ee=C,U=this.length,C=0;else if(isFinite(C))C=C>>>0,isFinite(U)?(U=U>>>0,ee===void 0&&(ee="utf8")):(ee=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Q=this.length-C;if((U===void 0||U>Q)&&(U=Q),P.length>0&&(U<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");let te=!1;for(;;)switch(ee){case"hex":return $(this,P,C,U);case"utf8":case"utf-8":return V(this,P,C,U);case"ascii":case"latin1":case"binary":return h(this,P,C,U);case"base64":return e(this,P,C,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a(this,P,C,U);default:if(te)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),te=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function s(P,C,U){return C===0&&U===P.length?r.fromByteArray(P):r.fromByteArray(P.slice(C,U))}function u(P,C,U){U=Math.min(P.length,U);let ee=[],Q=C;for(;Q<U;){let te=P[Q],le=null,Ie=te>239?4:te>223?3:te>191?2:1;if(Q+Ie<=U){let se,Ee,me,pe;switch(Ie){case 1:te<128&&(le=te);break;case 2:se=P[Q+1],(se&192)===128&&(pe=(te&31)<<6|se&63,pe>127&&(le=pe));break;case 3:se=P[Q+1],Ee=P[Q+2],(se&192)===128&&(Ee&192)===128&&(pe=(te&15)<<12|(se&63)<<6|Ee&63,pe>2047&&(pe<55296||pe>57343)&&(le=pe));break;case 4:se=P[Q+1],Ee=P[Q+2],me=P[Q+3],(se&192)===128&&(Ee&192)===128&&(me&192)===128&&(pe=(te&15)<<18|(se&63)<<12|(Ee&63)<<6|me&63,pe>65535&&pe<1114112&&(le=pe))}}le===null?(le=65533,Ie=1):le>65535&&(le-=65536,ee.push(le>>>10&1023|55296),le=56320|le&1023),ee.push(le),Q+=Ie}return g(ee)}var c=4096;function g(P){let C=P.length;if(C<=c)return String.fromCharCode.apply(String,P);let U="",ee=0;for(;ee<C;)U+=String.fromCharCode.apply(String,P.slice(ee,ee+=c));return U}function m(P,C,U){let ee="";U=Math.min(P.length,U);for(let Q=C;Q<U;++Q)ee+=String.fromCharCode(P[Q]&127);return ee}function f(P,C,U){let ee="";U=Math.min(P.length,U);for(let Q=C;Q<U;++Q)ee+=String.fromCharCode(P[Q]);return ee}function o(P,C,U){let ee=P.length;(!C||C<0)&&(C=0),(!U||U<0||U>ee)&&(U=ee);let Q="";for(let te=C;te<U;++te)Q+=Ne[P[te]];return Q}function b(P,C,U){let ee=P.slice(C,U),Q="";for(let te=0;te<ee.length-1;te+=2)Q+=String.fromCharCode(ee[te]+ee[te+1]*256);return Q}v.prototype.slice=function(P,C){let U=this.length;P=~~P,C=C===void 0?U:~~C,P<0?(P+=U,P<0&&(P=0)):P>U&&(P=U),C<0?(C+=U,C<0&&(C=0)):C>U&&(C=U),C<P&&(C=P);let ee=this.subarray(P,C);return Object.setPrototypeOf(ee,v.prototype),ee};function A(P,C,U){if(P%1!==0||P<0)throw new RangeError("offset is not uint");if(P+C>U)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=this[P],Q=1,te=0;for(;++te<C&&(Q*=256);)ee+=this[P+te]*Q;return ee},v.prototype.readUintBE=v.prototype.readUIntBE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=this[P+--C],Q=1;for(;C>0&&(Q*=256);)ee+=this[P+--C]*Q;return ee},v.prototype.readUint8=v.prototype.readUInt8=function(P,C){return P=P>>>0,C||A(P,1,this.length),this[P]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(P,C){return P=P>>>0,C||A(P,2,this.length),this[P]|this[P+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(P,C){return P=P>>>0,C||A(P,2,this.length),this[P]<<8|this[P+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(P,C){return P=P>>>0,C||A(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(P,C){return P=P>>>0,C||A(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},v.prototype.readBigUInt64LE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=C+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,Q=this[++P]+this[++P]*2**8+this[++P]*2**16+U*2**24;return BigInt(ee)+(BigInt(Q)<<BigInt(32))}),v.prototype.readBigUInt64BE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=C*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],Q=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+U;return(BigInt(ee)<<BigInt(32))+BigInt(Q)}),v.prototype.readIntLE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=this[P],Q=1,te=0;for(;++te<C&&(Q*=256);)ee+=this[P+te]*Q;return Q*=128,ee>=Q&&(ee-=Math.pow(2,8*C)),ee},v.prototype.readIntBE=function(P,C,U){P=P>>>0,C=C>>>0,U||A(P,C,this.length);let ee=C,Q=1,te=this[P+--ee];for(;ee>0&&(Q*=256);)te+=this[P+--ee]*Q;return Q*=128,te>=Q&&(te-=Math.pow(2,8*C)),te},v.prototype.readInt8=function(P,C){return P=P>>>0,C||A(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},v.prototype.readInt16LE=function(P,C){P=P>>>0,C||A(P,2,this.length);let U=this[P]|this[P+1]<<8;return U&32768?U|4294901760:U},v.prototype.readInt16BE=function(P,C){P=P>>>0,C||A(P,2,this.length);let U=this[P+1]|this[P]<<8;return U&32768?U|4294901760:U},v.prototype.readInt32LE=function(P,C){return P=P>>>0,C||A(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},v.prototype.readInt32BE=function(P,C){return P=P>>>0,C||A(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},v.prototype.readBigInt64LE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(U<<24);return(BigInt(ee)<<BigInt(32))+BigInt(C+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),v.prototype.readBigInt64BE=qe(function(P){P=P>>>0,F(P,"offset");let C=this[P],U=this[P+7];(C===void 0||U===void 0)&&Y(P,this.length-8);let ee=(C<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(ee)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+U)}),v.prototype.readFloatLE=function(P,C){return P=P>>>0,C||A(P,4,this.length),n.read(this,P,!0,23,4)},v.prototype.readFloatBE=function(P,C){return P=P>>>0,C||A(P,4,this.length),n.read(this,P,!1,23,4)},v.prototype.readDoubleLE=function(P,C){return P=P>>>0,C||A(P,8,this.length),n.read(this,P,!0,52,8)},v.prototype.readDoubleBE=function(P,C){return P=P>>>0,C||A(P,8,this.length),n.read(this,P,!1,52,8)};function R(P,C,U,ee,Q,te){if(!v.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>Q||C<te)throw new RangeError('"value" argument is out of bounds');if(U+ee>P.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(P,C,U,ee){if(P=+P,C=C>>>0,U=U>>>0,!ee){let le=Math.pow(2,8*U)-1;R(this,P,C,U,le,0)}let Q=1,te=0;for(this[C]=P&255;++te<U&&(Q*=256);)this[C+te]=P/Q&255;return C+U},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(P,C,U,ee){if(P=+P,C=C>>>0,U=U>>>0,!ee){let le=Math.pow(2,8*U)-1;R(this,P,C,U,le,0)}let Q=U-1,te=1;for(this[C+Q]=P&255;--Q>=0&&(te*=256);)this[C+Q]=P/te&255;return C+U},v.prototype.writeUint8=v.prototype.writeUInt8=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,1,255,0),this[C]=P&255,C+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,65535,0),this[C]=P&255,this[C+1]=P>>>8,C+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,65535,0),this[C]=P>>>8,this[C+1]=P&255,C+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,4294967295,0),this[C+3]=P>>>24,this[C+2]=P>>>16,this[C+1]=P>>>8,this[C]=P&255,C+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,4294967295,0),this[C]=P>>>24,this[C+1]=P>>>16,this[C+2]=P>>>8,this[C+3]=P&255,C+4};function k(P,C,U,ee,Q){z(C,ee,Q,P,U,7);let te=Number(C&BigInt(4294967295));P[U++]=te,te=te>>8,P[U++]=te,te=te>>8,P[U++]=te,te=te>>8,P[U++]=te;let le=Number(C>>BigInt(32)&BigInt(4294967295));return P[U++]=le,le=le>>8,P[U++]=le,le=le>>8,P[U++]=le,le=le>>8,P[U++]=le,U}function q(P,C,U,ee,Q){z(C,ee,Q,P,U,7);let te=Number(C&BigInt(4294967295));P[U+7]=te,te=te>>8,P[U+6]=te,te=te>>8,P[U+5]=te,te=te>>8,P[U+4]=te;let le=Number(C>>BigInt(32)&BigInt(4294967295));return P[U+3]=le,le=le>>8,P[U+2]=le,le=le>>8,P[U+1]=le,le=le>>8,P[U]=le,U+8}v.prototype.writeBigUInt64LE=qe(function(P,C=0){return k(this,P,C,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=qe(function(P,C=0){return q(this,P,C,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(P,C,U,ee){if(P=+P,C=C>>>0,!ee){let Ie=Math.pow(2,8*U-1);R(this,P,C,U,Ie-1,-Ie)}let Q=0,te=1,le=0;for(this[C]=P&255;++Q<U&&(te*=256);)P<0&&le===0&&this[C+Q-1]!==0&&(le=1),this[C+Q]=(P/te>>0)-le&255;return C+U},v.prototype.writeIntBE=function(P,C,U,ee){if(P=+P,C=C>>>0,!ee){let Ie=Math.pow(2,8*U-1);R(this,P,C,U,Ie-1,-Ie)}let Q=U-1,te=1,le=0;for(this[C+Q]=P&255;--Q>=0&&(te*=256);)P<0&&le===0&&this[C+Q+1]!==0&&(le=1),this[C+Q]=(P/te>>0)-le&255;return C+U},v.prototype.writeInt8=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,1,127,-128),P<0&&(P=255+P+1),this[C]=P&255,C+1},v.prototype.writeInt16LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,32767,-32768),this[C]=P&255,this[C+1]=P>>>8,C+2},v.prototype.writeInt16BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,2,32767,-32768),this[C]=P>>>8,this[C+1]=P&255,C+2},v.prototype.writeInt32LE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,2147483647,-2147483648),this[C]=P&255,this[C+1]=P>>>8,this[C+2]=P>>>16,this[C+3]=P>>>24,C+4},v.prototype.writeInt32BE=function(P,C,U){return P=+P,C=C>>>0,U||R(this,P,C,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[C]=P>>>24,this[C+1]=P>>>16,this[C+2]=P>>>8,this[C+3]=P&255,C+4},v.prototype.writeBigInt64LE=qe(function(P,C=0){return k(this,P,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=qe(function(P,C=0){return q(this,P,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(P,C,U,ee,Q,te){if(U+ee>P.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function ne(P,C,U,ee,Q){return C=+C,U=U>>>0,Q||Z(P,C,U,4,34028234663852886e22,-34028234663852886e22),n.write(P,C,U,ee,23,4),U+4}v.prototype.writeFloatLE=function(P,C,U){return ne(this,P,C,!0,U)},v.prototype.writeFloatBE=function(P,C,U){return ne(this,P,C,!1,U)};function G(P,C,U,ee,Q){return C=+C,U=U>>>0,Q||Z(P,C,U,8,17976931348623157e292,-17976931348623157e292),n.write(P,C,U,ee,52,8),U+8}v.prototype.writeDoubleLE=function(P,C,U){return G(this,P,C,!0,U)},v.prototype.writeDoubleBE=function(P,C,U){return G(this,P,C,!1,U)},v.prototype.copy=function(P,C,U,ee){if(!v.isBuffer(P))throw new TypeError("argument should be a Buffer");if(U||(U=0),!ee&&ee!==0&&(ee=this.length),C>=P.length&&(C=P.length),C||(C=0),ee>0&&ee<U&&(ee=U),ee===U||P.length===0||this.length===0)return 0;if(C<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),P.length-C<ee-U&&(ee=P.length-C+U);let Q=ee-U;return this===P&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(C,U,ee):Uint8Array.prototype.set.call(P,this.subarray(U,ee),C),Q},v.prototype.fill=function(P,C,U,ee){if(typeof P=="string"){if(typeof C=="string"?(ee=C,C=0,U=this.length):typeof U=="string"&&(ee=U,U=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!v.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(P.length===1){let te=P.charCodeAt(0);(ee==="utf8"&&te<128||ee==="latin1")&&(P=te)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(C<0||this.length<C||this.length<U)throw new RangeError("Out of range index");if(U<=C)return this;C=C>>>0,U=U===void 0?this.length:U>>>0,P||(P=0);let Q;if(typeof P=="number")for(Q=C;Q<U;++Q)this[Q]=P;else{let te=v.isBuffer(P)?P:v.from(P,ee),le=te.length;if(le===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(Q=0;Q<U-C;++Q)this[Q+C]=te[Q%le]}return this};var D={};function W(P,C,U){D[P]=class extends U{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${P}]`,this.stack,delete this.name}get code(){return P}set code(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}toString(){return`${this.name} [${P}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(P){return P?`${P} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(P,C){return`The "${P}" argument must be of type number. Received type ${typeof C}`},TypeError),W("ERR_OUT_OF_RANGE",function(P,C,U){let ee=`The value of "${P}" is out of range.`,Q=U;return Number.isInteger(U)&&Math.abs(U)>2**32?Q=ie(String(U)):typeof U=="bigint"&&(Q=String(U),(U>BigInt(2)**BigInt(32)||U<-(BigInt(2)**BigInt(32)))&&(Q=ie(Q)),Q+="n"),ee+=` It must be ${C}. Received ${Q}`,ee},RangeError);function ie(P){let C="",U=P.length,ee=P[0]==="-"?1:0;for(;U>=ee+4;U-=3)C=`_${P.slice(U-3,U)}${C}`;return`${P.slice(0,U)}${C}`}function X(P,C,U){F(C,"offset"),(P[C]===void 0||P[C+U]===void 0)&&Y(C,P.length-(U+1))}function z(P,C,U,ee,Q,te){if(P>U||P<C){let le=typeof C=="bigint"?"n":"",Ie;throw te>3?C===0||C===BigInt(0)?Ie=`>= 0${le} and < 2${le} ** ${(te+1)*8}${le}`:Ie=`>= -(2${le} ** ${(te+1)*8-1}${le}) and < 2 ** ${(te+1)*8-1}${le}`:Ie=`>= ${C}${le} and <= ${U}${le}`,new D.ERR_OUT_OF_RANGE("value",Ie,P)}X(ee,Q,te)}function F(P,C){if(typeof P!="number")throw new D.ERR_INVALID_ARG_TYPE(C,"number",P)}function Y(P,C,U){throw Math.floor(P)!==P?(F(P,U),new D.ERR_OUT_OF_RANGE(U||"offset","an integer",P)):C<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE(U||"offset",`>= ${U?1:0} and <= ${C}`,P)}var ae=/[^+/0-9A-Za-z-_]/g;function de(P){if(P=P.split("=")[0],P=P.trim().replace(ae,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function re(P,C){C=C||1/0;let U,ee=P.length,Q=null,te=[];for(let le=0;le<ee;++le){if(U=P.charCodeAt(le),U>55295&&U<57344){if(!Q){if(U>56319){(C-=3)>-1&&te.push(239,191,189);continue}else if(le+1===ee){(C-=3)>-1&&te.push(239,191,189);continue}Q=U;continue}if(U<56320){(C-=3)>-1&&te.push(239,191,189),Q=U;continue}U=(Q-55296<<10|U-56320)+65536}else Q&&(C-=3)>-1&&te.push(239,191,189);if(Q=null,U<128){if((C-=1)<0)break;te.push(U)}else if(U<2048){if((C-=2)<0)break;te.push(U>>6|192,U&63|128)}else if(U<65536){if((C-=3)<0)break;te.push(U>>12|224,U>>6&63|128,U&63|128)}else if(U<1114112){if((C-=4)<0)break;te.push(U>>18|240,U>>12&63|128,U>>6&63|128,U&63|128)}else throw new Error("Invalid code point")}return te}function fe(P){let C=[];for(let U=0;U<P.length;++U)C.push(P.charCodeAt(U)&255);return C}function ye(P,C){let U,ee,Q,te=[];for(let le=0;le<P.length&&!((C-=2)<0);++le)U=P.charCodeAt(le),ee=U>>8,Q=U%256,te.push(Q),te.push(ee);return te}function he(P){return r.toByteArray(de(P))}function Re(P,C,U,ee){let Q;for(Q=0;Q<ee&&!(Q+U>=C.length||Q>=P.length);++Q)C[Q+U]=P[Q];return Q}function Be(P,C){return P instanceof C||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===C.name}function ge(P){return P!==P}var Ne=function(){let P="0123456789abcdef",C=new Array(256);for(let U=0;U<16;++U){let ee=U*16;for(let Q=0;Q<16;++Q)C[ee+Q]=P[U]+P[Q]}return C}();function qe(P){return typeof BigInt>"u"?j:P}function j(){throw new Error("BigInt not supported")}}),sEt=Np((t,r)=>{typeof window<"u"?(window.global=window,globalThis.fetch=window.fetch,r.exports={Buffer:qoe().Buffer,Crypto:window.crypto}):r.exports={Buffer:qoe().Buffer,Crypto:crypto}}),QHe={};tEt(QHe,{AVSCTap:()=>P_,ArweaveSigner:()=>Rfe,DataItem:()=>__,MAX_TAG_BYTES:()=>LN,MIN_BINARY_SIZE:()=>kfe,SIG_CONFIG:()=>x8,SignatureConfig:()=>ol,Signer:()=>eKe,createData:()=>nKe,deserializeTags:()=>sN,indexToType:()=>Tfe,serializeTags:()=>Ife,tagsExceedLimit:()=>iKe});var eKe=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,r,n,l){throw new Error("You must implement verify method on child")}},fEt=d6(Afe(),1),mc=d6(XHe(),1);async function tKe(t){if(Array.isArray(t)){let i=(0,mc.concatBuffers)([(0,mc.stringToBuffer)("list"),(0,mc.stringToBuffer)(t.length.toString())]);return await rKe(t,await Tp().hash(i,"SHA-384"))}let r=t,n=(0,mc.concatBuffers)([(0,mc.stringToBuffer)("blob"),(0,mc.stringToBuffer)(r.byteLength.toString())]),l=(0,mc.concatBuffers)([await Tp().hash(n,"SHA-384"),await Tp().hash(r,"SHA-384")]);return await Tp().hash(l,"SHA-384")}async function rKe(t,r){if(t.length<1)return r;let n=(0,mc.concatBuffers)([r,await tKe(t[0])]),l=await Tp().hash(n,"SHA-384");return await rKe(t.slice(1),l)}var VX=d6(aEt(),1),hEt=VX.default.default?VX.default.default:VX.default,uEt=class extends hEt{getPublicKey(t){throw new Error("Unimplemented")}},lEt;function Tp(){return lEt??=new uEt}var ol;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(ol||(ol={}));var x8={[ol.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[ol.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[ol.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[ol.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[ol.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[ol.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[ol.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},Rfe=class{signatureType=1;ownerLength=x8[1].pubLength;signatureLength=x8[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return fEt.default.toBuffer(this.pk)}sign(t){return Tp().sign(this.jwk,t)}static async verify(t,r,n){return await Tp().verify(t,r,n)}},Tfe={1:Rfe},Nd=d6(Afe(),1);async function Uoe(t){return tKe([(0,mc.stringToBuffer)("dataitem"),(0,mc.stringToBuffer)("1"),(0,mc.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function cEt(t,r){let n=await Uoe(t),l=await r.sign(n),i=await Tp().hash(l);return{signature:ze.from(l),id:ze.from(i)}}async function dEt(t,r){let{signature:n,id:l}=await cEt(t,r);return t.getRaw().set(n,2),l}var P_=class{buf;pos;constructor(t=ze.alloc(LN),r=0){this.buf=t,this.pos=r}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let r=t.length,n;if(r)for(this.writeLong(r),n=0;n<r;n++){let l=t[n];if(l?.name===void 0||l?.value===void 0)throw new Error(`Invalid tag format for ${l}, expected {name:string, value: string}`);this.writeString(l.name),this.writeString(l.value)}this.writeLong(0)}toBuffer(){let t=ze.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let r=this.buf,n,l;if(t>=-1073741824&&t<1073741824){l=t>=0?t<<1:~t<<1|1;do r[this.pos]=l&127,l>>=7;while(l&&(r[this.pos++]|=128))}else{n=t>=0?t*2:-t*2-1;do r[this.pos]=n&127,n/=128;while(n>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(t){let r=ze.byteLength(t),n=this.buf;this.writeLong(r);let l=this.pos;if(this.pos+=r,!(this.pos>n.length)){if(r>64)this.buf.write(t,this.pos-r,r,"utf8");else{let i,d,p,v;for(i=0,d=r;i<d;i++)p=t.charCodeAt(i),p<128?n[l++]=p:p<2048?(n[l++]=p>>6|192,n[l++]=p&63|128):(p&64512)===55296&&((v=t.charCodeAt(i+1))&64512)===56320?(p=65536+((p&1023)<<10)+(v&1023),i++,n[l++]=p>>18|240,n[l++]=p>>12&63|128,n[l++]=p>>6&63|128,n[l++]=p&63|128):(n[l++]=p>>12|224,n[l++]=p>>6&63|128,n[l++]=p&63|128)}this.buf=n}}readLong(){let t=0,r=0,n=this.buf,l,i,d,p;do l=n[this.pos++],i=l&128,t|=(l&127)<<r,r+=7;while(i&&r<28);if(i){d=t,p=268435456;do l=n[this.pos++],d+=(l&127)*p,p*=128;while(l&128);return(d%2?-(d+1):d)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let n=this.readString(),l=this.readString();t.push({name:n,value:l})}return t}readString(){let t=this.readLong(),r=this.pos,n=this.buf;if(this.pos+=t,!(this.pos>n.length))return this.buf.slice(r,r+t).toString()}};function Ife(t){let r=new P_;return r.writeTags(t),r.toBuffer()}function iKe(t){let r=new P_;return r.writeTags(t),r.tagsExceedLimit()}function sN(t){return new P_(t).readTags()}function Bv(t){let r=0;for(let n=t.length-1;n>=0;n--)r=r*256+t[n];return r}function pEt(t){if(t>29)throw new Error("Short too long");let r=[0,0];for(let n=0;n<r.length;n++){let l=t&255;r[n]=l,t=(t-l)/256}return Uint8Array.from(r)}function sCe(t){let r=[0,0,0,0,0,0,0,0];for(let n=0;n<r.length;n++){let l=t&255;r[n]=l,t=(t-l)/256}return Uint8Array.from(r)}var mEt=d6(sEt(),1),G3=d6(qoe(),1),LN=4096,kfe=80,__=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=Bv(this.binary.subarray(0,2));if(ol?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return __.verify(this.binary)}get id(){return(async()=>Nd.default.encode(await this.rawId))()}set id(t){this._id=Nd.default.toBuffer(t)}get rawId(){return(async()=>G3.Buffer.from(await mEt.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Nd.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return x8[this.signatureType].sigLength}get owner(){return Nd.default.encode(this.rawOwner)}get ownerLength(){return x8[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):G3.Buffer.alloc(0)}get target(){return Nd.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):G3.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),r=Bv(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+r)}get tags(){let t=this.getTagsStart();if(Bv(this.binary.subarray(t,t+8))==0)return[];let r=Bv(this.binary.subarray(t+8,t+16));return sN(G3.Buffer.from(this.binary.subarray(t+16,t+16+r)))}get tagsB64Url(){return this.tags.map(t=>({name:Nd.default.encode(t.name),value:Nd.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),r=this.binary.subarray(t+8,t+16),n=Bv(r);return t+16+n}get rawData(){let t=this.getTagsStart(),r=this.binary.subarray(t+8,t+16),n=Bv(r),l=t+16+n;return this.binary.subarray(l,this.binary.length)}get data(){return Nd.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await dEt(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=G3.Buffer.from(await Tp().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Nd.default.encode(t.name),value:Nd.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<kfe)return!1;let r=new __(t),n=r.signatureType,l=r.getTagsStart(),i=Bv(t.subarray(l,l+8)),d=t.subarray(l+8,l+16),p=Bv(d);if(p>LN)return!1;if(i>0)try{if(sN(G3.Buffer.from(t.subarray(l+16,l+16+p))).length!==i)return!1}catch{return!1}let v=Tfe[n],_=await Uoe(r);return await v.verify(r.rawOwner,_,r.rawSignature)}async getSignatureData(){return Uoe(this)}getTagsStart(){let t=this.getTargetStart(),r=this.binary[t]==1,n=t+(r?33:1),l=this.binary[n]==1;return n+=l?33:1,n}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return t+=r?32:0,t}},vEt=d6(Afe(),1);function nKe(t,r,n){let l=r.publicKey,i=n?.target?vEt.default.toBuffer(n.target):null,d=1+(i?.byteLength??0),p=n?.anchor?ze.from(n.anchor):null,v=1+(p?.byteLength??0),_=(n?.tags?.length??0)>0?Ife(n.tags):null,y=16+(_?_.byteLength:0),w=ze.from(t),S=w.byteLength,M=2+r.signatureLength+r.ownerLength+d+v+y+S,x=ze.alloc(M);if(x.set(pEt(r.signatureType),0),x.set(new Uint8Array(r.signatureLength).fill(0),2),l.byteLength!==r.ownerLength)throw new Error(`Owner must be ${r.ownerLength} bytes, but was incorrectly ${l.byteLength}`);x.set(l,2+r.signatureLength);let E=2+r.signatureLength+r.ownerLength;if(x[E]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);x.set(i,E+1)}let T=E+d,I=T+1;if(x[T]=p?1:0,p){if(I+=p.byteLength,p.byteLength!==32)throw new Error("Anchor must be 32 bytes");x.set(p,T+1)}x.set(sCe(n?.tags?.length??0),I);let B=sCe(_?.byteLength??0);x.set(B,I+8),_&&x.set(_,I+16);let O=I+y;return x.set(w,O),new __(x)}var Bfe={...QHe};globalThis.arbundles??=Bfe;var bEt=Bfe,gEt=Bfe,yEt=uN(Kwt(),1);globalThis.Buffer||(globalThis.Buffer=xfe.Buffer);var{DataItem:wEt}=YHe,{signMessage:_Et}=yEt.httpbis;function MEt(t){return async({data:r,tags:n,target:l,anchor:i,createDataItem:d=p=>new wEt(p)})=>{let p=await t.signDataItem({data:r,tags:n,target:l,anchor:i}),v=d(xfe.Buffer.from(p));return{id:await v.id,raw:await v.getRaw()}}}function SEt(t){let r=["alg","keyid"].sort(),n;return async({fields:l,request:i})=>new Promise(d=>(n||(n=t.connect(["ACCESS_ADDRESS","ACCESS_PUBLIC_KEY","SIGNATURE"]).then(async()=>{let p=await t.getActivePublicKey(),v=await t.getActiveAddress();return{publicKey:p,address:v}})),d(n))).then(({publicKey:d,address:p})=>_Et({key:{id:d,alg:"rsa-pss-sha512",sign:async v=>{let _=await t.signMessage(v,{hashAlgorithm:"SHA-512"});return xfe.Buffer.from(_)}},fields:l,name:FSt(p),params:r},i))}var xEt=globalThis.GATEWAY_URL||void 0,EEt=globalThis.MU_URL||void 0,AEt=globalThis.CU_URL||void 0,REt=globalThis.GRAPHQL_URL||void 0,TEt=globalThis.GRAPHQL_MAX_RETRIES||void 0,IEt=globalThis.GRAPHQL_RETRY_BACKOFF||void 0,kEt=globalThis.RELAY_URL||void 0,BEt=globalThis.AO_URL=void 0,Au=Vxt({createDataItemSigner:$oe.createDataItemSigner,createHbSigner:$oe.createHbSigner}),{result:U0r,results:j0r,message:F0r,spawn:z0r,monitor:H0r,unmonitor:K0r,dryrun:Z0r,assign:W0r,createDataItemSigner:aKe}=Au({MODE:"legacy",GATEWAY_URL:xEt,MU_URL:EEt,CU_URL:AEt,RELAY_URL:kEt,AO_URL:BEt,GRAPHQL_URL:REt,GRAPHQL_MAX_RETRIES:TEt,GRAPHQL_RETRY_BACKOFF:IEt,noLog:!0});we();Me();_e();var XKe=$n(JKe(),1),KN=XKe.default.init({host:"arweave.net",port:443,protocol:"https"});we();Me();_e();we();Me();_e();var Ac=class extends Error{constructor(r){super(r),this.name=this.constructor.name}},QKe=class extends Ac{},eZe=class extends Ac{},tZe=class extends Ac{constructor(r,n){super(`Failed request: ${r}: ${n}`)}},rZe=class extends Ac{},ZN=class extends Ac{},iZe=class extends Ac{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},e1=class extends Ac{constructor(){super("Invalid contract configuration")}},nZe=class extends Ac{constructor(){super("Invalid process configuration")}},aZe=class extends Ac{};we();Me();_e();var Nc=$n(dQe(),1);we();Me();_e();var n4="3.13.0-alpha.1";var zh=class t{logger;silent=!1;static default=new t;constructor({level:r="info"}={}){r==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Nc.createLogger)({level:r,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:n4},format:Nc.format.combine(Nc.format.timestamp(),Nc.format.json()),transports:[new Nc.transports.Console({format:Nc.format.combine(Nc.format.timestamp(),Nc.format.json())})]})}info(r,...n){this.silent||this.logger.info(r,...n)}warn(r,...n){this.silent||this.logger.warn(r,...n)}error(r,...n){this.silent||this.logger.error(r,...n)}debug(r,...n){this.silent||this.logger.debug(r,...n)}setLogLevel(r){this.silent=r==="none","silent"in this.logger&&(this.logger.silent=r==="none"),"level"in this.logger&&(this.logger.level=r)}};we();Me();_e();we();Me();_e();var pQe=t=>{let r=Object.entries(t).sort(([n,l],[i,d])=>n==="@"?-1:i==="@"?1:"priority"in l&&!("priority"in d)?-1:!("priority"in l)&&"priority"in d?1:l.priority!==void 0&&d.priority!==void 0?l.priority===d.priority?n<i?-1:n>i?1:0:l.priority-d.priority:n<i?-1:n>i?1:0);return Object.fromEntries(r.map(([n,l],i)=>[n,{...l,index:i}]))};we();Me();_e();function o1(t,r){let n=t.safeParse(r);if(!n.success)throw new Error(JSON.stringify(n.error.format(),null,2));return n}we();Me();_e();we();Me();_e();we();Me();_e();sd();var mQe="+",vQe="/",bQe="-",gQe="_",yQe="=";function CUt(t){let r=t.length%4;return r&&(t+=yQe.repeat(4-r)),t.replaceAll(bQe,mQe).replaceAll(gQe,vQe)}function LUt(t){return t.replaceAll(mQe,bQe).replaceAll(vQe,gQe).replaceAll(yQe,"")}function Dyr(t){let r=CUt(t);return ze.from(r,"base64")}function a4(t){let r=t.toString("base64");return LUt(r)}function $yr(t){return a4(Ul("sha256").update(Uint8Array.from(t)).digest())}function wQe(t=32){let r=mZ(t);return Array.from(r,n=>n.toString(16).padStart(2,"0")).join("").slice(0,t)}we();Me();_e();we();Me();_e();function q0e(t){try{return JSON.parse(t)}catch{return t}}we();Me();_e();we();Me();_e();var j0e=$n(MQe(),1);we();Me();_e();var qUt=Object.defineProperty,UUt=(t,r,n)=>r in t?qUt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,AM=(t,r,n)=>(UUt(t,typeof r!="symbol"?r+"":r,n),n),F0e=class{constructor(r){AM(this,"value"),AM(this,"next"),this.value=r}},z0e=class{constructor(){AM(this,"head"),AM(this,"tail"),AM(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(r){let n=new F0e(r);return this.head&&this.tail?(this.tail.next=n,this.tail=n):(this.head=n,this.tail=n),this._size++,this._size}pop(){if(!this.head)return;let r=this.head;return this.head=this.head.next,this._size--,r.value}get size(){return this._size}*[Symbol.iterator](){let r=this.head;for(;r;)yield r.value,r=r.next}};function SQe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let r=new z0e,n=0,l=()=>{n--,r.size>0&&r.pop()()},i=async(v,_,y)=>{n++;let w=(async()=>v(...y))();_(w);try{await w}catch{}l()},d=(v,_,y)=>{r.push(i.bind(null,v,_,y)),(async()=>(await Promise.resolve(),n<t&&r.size>0&&r.pop()()))()},p=(v,..._)=>new Promise(y=>{d(v,y,_)});return Object.defineProperties(p,{activeCount:{get:()=>n},pendingCount:{get:()=>r.size},clearQueue:{value:()=>{r.clear()}}}),p}we();Me();_e();var RM=class{static init(r){return r!==void 0&&"signer"in r?new H0e(r):new tL(r)}},tL=class{process;constructor(r){if(r===void 0||Object.keys(r).length===0)this.process=new wo({processId:S3});else if(b2(r))this.process=r.process;else if(g2(r))this.process=new wo({processId:r.processId});else throw new e1}async accessControlList({address:r}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:r}]})}},H0e=class extends tL{signer;constructor({signer:r,...n}){super(n),this.signer=v2(r)}async register({processId:r}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:r}],signer:this.signer})}};we();Me();_e();we();Me();_e();var jUt="https://faucet.ario.permaweb.services";function Z0e({arioInstance:t,faucetApiUrl:r=jUt}){let n=new K0e({faucetUrl:r,processId:t.process.processId});return new Proxy(t,{get(i,d){if(d==="faucet")return n;if(d in i){let p=i[d];return typeof p=="function"?p.bind(i):p}}})}var K0e=class{faucetUrl;processId;constructor({faucetUrl:r,processId:n}){this.faucetUrl=r,this.processId=n}async captchaUrl(){let r=await fetch(`${this.faucetUrl}/api/captcha/url?process-id=${this.processId}`,{method:"GET"});if(!r.ok){let l=await r.json().catch(()=>({error:r.statusText}));throw new Error(l.error)}return await r.json()}async claimWithCaptchaResponse({captchaResponse:r,recipient:n,quantity:l}){let i=await fetch(`${this.faucetUrl}/api/claim/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,recipient:n,quantity:l,captchaResponse:r})});if(!i.ok){let p=await i.json().catch(()=>({error:i.statusText}));throw new Error(p.error)}return await i.json()}async requestAuthToken({captchaResponse:r}){let n=await fetch(`${this.faucetUrl}/api/captcha/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({processId:this.processId,captchaResponse:r})});if(!n.ok){let i=await n.json().catch(()=>({error:n.statusText}));throw new Error(i.error)}return await n.json()}async claimWithAuthToken({authToken:r,recipient:n,quantity:l}){let i=await fetch(`${this.faucetUrl}/api/claim/async`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({recipient:n,qty:l,processId:this.processId})});if(!i.ok){let p=await i.json().catch(()=>({error:i.statusText}));throw new Error(p.error)}return await i.json()}async verifyAuthToken({authToken:r}){let n=await fetch(`${this.faucetUrl}/api/token/verify?process-id=${this.processId}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});if(!n.ok){let i=await n.json().catch(()=>({error:n.statusText}));throw new Error(i.error)}return await n.json()}};we();Me();_e();we();Me();_e();we();Me();_e();var df=[];for(let t=0;t<256;++t)df.push((t+256).toString(16).slice(1));function xQe(t,r=0){return(df[t[r+0]]+df[t[r+1]]+df[t[r+2]]+df[t[r+3]]+"-"+df[t[r+4]]+df[t[r+5]]+"-"+df[t[r+6]]+df[t[r+7]]+"-"+df[t[r+8]]+df[t[r+9]]+"-"+df[t[r+10]]+df[t[r+11]]+df[t[r+12]]+df[t[r+13]]+df[t[r+14]]+df[t[r+15]]).toLowerCase()}we();Me();_e();var W0e,FUt=new Uint8Array(16);function G0e(){if(!W0e){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");W0e=crypto.getRandomValues.bind(crypto)}return W0e(FUt)}we();Me();_e();we();Me();_e();var zUt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),V0e={randomUUID:zUt};function HUt(t,r,n){if(V0e.randomUUID&&!r&&!t)return V0e.randomUUID();t=t||{};let l=t.random??t.rng?.()??G0e();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,r){if(n=n||0,n<0||n+16>r.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let i=0;i<16;++i)r[n+i]=l[i];return r}return xQe(l)}var Y0e=HUt;we();Me();_e();var J0e=class t{constructor(r){this.positiveFiniteInteger=r;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${r}`)}[Symbol.toPrimitive](r){return r==="string"&&this.toString(),this.positiveFiniteInteger}plus(r){return new t(this.positiveFiniteInteger+r.positiveFiniteInteger)}minus(r){return new t(this.positiveFiniteInteger-r.positiveFiniteInteger)}isGreaterThan(r){return this.positiveFiniteInteger>r.positiveFiniteInteger}isGreaterThanOrEqualTo(r){return this.positiveFiniteInteger>=r.positiveFiniteInteger}isLessThan(r){return this.positiveFiniteInteger<r.positiveFiniteInteger}isLessThanOrEqualTo(r){return this.positiveFiniteInteger<=r.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(r){return this.positiveFiniteInteger===r.positiveFiniteInteger}},X0e=class{value;constructor(r){if(!Number.isFinite(r)||r<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+r.toFixed(6)}valueOf(){return this.value}toMARIO(){return new TM(Math.floor(this.value*IY))}toString(){return`${this.value}`}},TM=class t extends J0e{constructor(r){super(r)}multiply(r){let n=Math.floor(this.valueOf()*r.valueOf());return new t(n)}divide(r){if(r.valueOf()===0)throw new Error("Cannot divide by zero");let n=Math.floor(this.valueOf()/r.valueOf());return new t(n)}plus(r){let n=super.plus(r);return new t(n.valueOf())}minus(r){let n=super.minus(r);return new t(n.valueOf())}toARIO(){return new X0e(this.valueOf()/IY)}};we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();function IM(t,r){return function(){return t.apply(r,arguments)}}var{toString:KUt}=Object.prototype,{getPrototypeOf:ele}=Object,iL=(t=>r=>{let n=KUt.call(r);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cc=t=>(t=t.toLowerCase(),r=>iL(r)===t),nL=t=>r=>typeof r===t,{isArray:o4}=Array,kM=nL("undefined");function ZUt(t){return t!==null&&!kM(t)&&t.constructor!==null&&!kM(t.constructor)&&Ou(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var AQe=Cc("ArrayBuffer");function WUt(t){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(t):r=t&&t.buffer&&AQe(t.buffer),r}var GUt=nL("string"),Ou=nL("function"),RQe=nL("number"),aL=t=>t!==null&&typeof t=="object",VUt=t=>t===!0||t===!1,rL=t=>{if(iL(t)!=="object")return!1;let r=ele(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},YUt=Cc("Date"),JUt=Cc("File"),XUt=Cc("Blob"),QUt=Cc("FileList"),ejt=t=>aL(t)&&Ou(t.pipe),tjt=t=>{let r;return t&&(typeof FormData=="function"&&t instanceof FormData||Ou(t.append)&&((r=iL(t))==="formdata"||r==="object"&&Ou(t.toString)&&t.toString()==="[object FormData]"))},rjt=Cc("URLSearchParams"),[ijt,njt,ajt,ojt]=["ReadableStream","Request","Response","Headers"].map(Cc),sjt=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function BM(t,r,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let l,i;if(typeof t!="object"&&(t=[t]),o4(t))for(l=0,i=t.length;l<i;l++)r.call(null,t[l],l,t);else{let d=n?Object.getOwnPropertyNames(t):Object.keys(t),p=d.length,v;for(l=0;l<p;l++)v=d[l],r.call(null,t[v],v,t)}}function TQe(t,r){r=r.toLowerCase();let n=Object.keys(t),l=n.length,i;for(;l-- >0;)if(i=n[l],r===i.toLowerCase())return i;return null}var P6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,IQe=t=>!kM(t)&&t!==P6;function Q0e(){let{caseless:t}=IQe(this)&&this||{},r={},n=(l,i)=>{let d=t&&TQe(r,i)||i;rL(r[d])&&rL(l)?r[d]=Q0e(r[d],l):rL(l)?r[d]=Q0e({},l):o4(l)?r[d]=l.slice():r[d]=l};for(let l=0,i=arguments.length;l<i;l++)arguments[l]&&BM(arguments[l],n);return r}var fjt=(t,r,n,{allOwnKeys:l}={})=>(BM(r,(i,d)=>{n&&Ou(i)?t[d]=IM(i,n):t[d]=i},{allOwnKeys:l}),t),hjt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ujt=(t,r,n,l)=>{t.prototype=Object.create(r.prototype,l),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:r.prototype}),n&&Object.assign(t.prototype,n)},ljt=(t,r,n,l)=>{let i,d,p,v={};if(r=r||{},t==null)return r;do{for(i=Object.getOwnPropertyNames(t),d=i.length;d-- >0;)p=i[d],(!l||l(p,t,r))&&!v[p]&&(r[p]=t[p],v[p]=!0);t=n!==!1&&ele(t)}while(t&&(!n||n(t,r))&&t!==Object.prototype);return r},cjt=(t,r,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=r.length;let l=t.indexOf(r,n);return l!==-1&&l===n},djt=t=>{if(!t)return null;if(o4(t))return t;let r=t.length;if(!RQe(r))return null;let n=new Array(r);for(;r-- >0;)n[r]=t[r];return n},pjt=(t=>r=>t&&r instanceof t)(typeof Uint8Array<"u"&&ele(Uint8Array)),mjt=(t,r)=>{let l=(t&&t[Symbol.iterator]).call(t),i;for(;(i=l.next())&&!i.done;){let d=i.value;r.call(t,d[0],d[1])}},vjt=(t,r)=>{let n,l=[];for(;(n=t.exec(r))!==null;)l.push(n);return l},bjt=Cc("HTMLFormElement"),gjt=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,l,i){return l.toUpperCase()+i}),EQe=(({hasOwnProperty:t})=>(r,n)=>t.call(r,n))(Object.prototype),yjt=Cc("RegExp"),kQe=(t,r)=>{let n=Object.getOwnPropertyDescriptors(t),l={};BM(n,(i,d)=>{let p;(p=r(i,d,t))!==!1&&(l[d]=p||i)}),Object.defineProperties(t,l)},wjt=t=>{kQe(t,(r,n)=>{if(Ou(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let l=t[n];if(Ou(l)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},_jt=(t,r)=>{let n={},l=i=>{i.forEach(d=>{n[d]=!0})};return o4(t)?l(t):l(String(t).split(r)),n},Mjt=()=>{},Sjt=(t,r)=>t!=null&&Number.isFinite(t=+t)?t:r;function xjt(t){return!!(t&&Ou(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var Ejt=t=>{let r=new Array(10),n=(l,i)=>{if(aL(l)){if(r.indexOf(l)>=0)return;if(!("toJSON"in l)){r[i]=l;let d=o4(l)?[]:{};return BM(l,(p,v)=>{let _=n(p,i+1);!kM(_)&&(d[v]=_)}),r[i]=void 0,d}}return l};return n(t,0)},Ajt=Cc("AsyncFunction"),Rjt=t=>t&&(aL(t)||Ou(t))&&Ou(t.then)&&Ou(t.catch),BQe=((t,r)=>t?setImmediate:r?((n,l)=>(P6.addEventListener("message",({source:i,data:d})=>{i===P6&&d===n&&l.length&&l.shift()()},!1),i=>{l.push(i),P6.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ou(P6.postMessage)),Tjt=typeof queueMicrotask<"u"?queueMicrotask.bind(P6):typeof We<"u"&&We.nextTick||BQe,ir={isArray:o4,isArrayBuffer:AQe,isBuffer:ZUt,isFormData:tjt,isArrayBufferView:WUt,isString:GUt,isNumber:RQe,isBoolean:VUt,isObject:aL,isPlainObject:rL,isReadableStream:ijt,isRequest:njt,isResponse:ajt,isHeaders:ojt,isUndefined:kM,isDate:YUt,isFile:JUt,isBlob:XUt,isRegExp:yjt,isFunction:Ou,isStream:ejt,isURLSearchParams:rjt,isTypedArray:pjt,isFileList:QUt,forEach:BM,merge:Q0e,extend:fjt,trim:sjt,stripBOM:hjt,inherits:ujt,toFlatObject:ljt,kindOf:iL,kindOfTest:Cc,endsWith:cjt,toArray:djt,forEachEntry:mjt,matchAll:vjt,isHTMLForm:bjt,hasOwnProperty:EQe,hasOwnProp:EQe,reduceDescriptors:kQe,freezeMethods:wjt,toObjectSet:_jt,toCamelCase:gjt,noop:Mjt,toFiniteNumber:Sjt,findKey:TQe,global:P6,isContextDefined:IQe,isSpecCompliantForm:xjt,toJSONObject:Ejt,isAsyncFn:Ajt,isThenable:Rjt,setImmediate:BQe,asap:Tjt};we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();function s4(t,r,n,l,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),l&&(this.request=l),i&&(this.response=i,this.status=i.status?i.status:null)}ir.inherits(s4,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ir.toJSONObject(this.config),code:this.code,status:this.status}}});var PQe=s4.prototype,OQe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{OQe[t]={value:t}});Object.defineProperties(s4,OQe);Object.defineProperty(PQe,"isAxiosError",{value:!0});s4.from=(t,r,n,l,i,d)=>{let p=Object.create(PQe);return ir.toFlatObject(t,p,function(_){return _!==Error.prototype},v=>v!=="isAxiosError"),s4.call(p,t.message,r,n,l,i),p.cause=t,p.name=t.name,d&&Object.assign(p,d),p};var ci=s4;we();Me();_e();var oL=null;function tle(t){return ir.isPlainObject(t)||ir.isArray(t)}function CQe(t){return ir.endsWith(t,"[]")?t.slice(0,-2):t}function NQe(t,r,n){return t?t.concat(r).map(function(i,d){return i=CQe(i),!n&&d?"["+i+"]":i}).join(n?".":""):r}function Ijt(t){return ir.isArray(t)&&!t.some(tle)}var kjt=ir.toFlatObject(ir,{},null,function(r){return/^is[A-Z]/.test(r)});function Bjt(t,r,n){if(!ir.isObject(t))throw new TypeError("target must be an object");r=r||new(oL||FormData),n=ir.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,I){return!ir.isUndefined(I[T])});let l=n.metaTokens,i=n.visitor||w,d=n.dots,p=n.indexes,_=(n.Blob||typeof Blob<"u"&&Blob)&&ir.isSpecCompliantForm(r);if(!ir.isFunction(i))throw new TypeError("visitor must be a function");function y(E){if(E===null)return"";if(ir.isDate(E))return E.toISOString();if(!_&&ir.isBlob(E))throw new ci("Blob is not supported. Use a Buffer instead.");return ir.isArrayBuffer(E)||ir.isTypedArray(E)?_&&typeof Blob=="function"?new Blob([E]):ze.from(E):E}function w(E,T,I){let B=E;if(E&&!I&&typeof E=="object"){if(ir.endsWith(T,"{}"))T=l?T:T.slice(0,-2),E=JSON.stringify(E);else if(ir.isArray(E)&&Ijt(E)||(ir.isFileList(E)||ir.endsWith(T,"[]"))&&(B=ir.toArray(E)))return T=CQe(T),B.forEach(function(N,H){!(ir.isUndefined(N)||N===null)&&r.append(p===!0?NQe([T],H,d):p===null?T:T+"[]",y(N))}),!1}return tle(E)?!0:(r.append(NQe(I,T,d),y(E)),!1)}let S=[],M=Object.assign(kjt,{defaultVisitor:w,convertValue:y,isVisitable:tle});function x(E,T){if(!ir.isUndefined(E)){if(S.indexOf(E)!==-1)throw Error("Circular reference detected in "+T.join("."));S.push(E),ir.forEach(E,function(B,O){(!(ir.isUndefined(B)||B===null)&&i.call(r,B,ir.isString(O)?O.trim():O,T,M))===!0&&x(B,T?T.concat(O):[O])}),S.pop()}}if(!ir.isObject(t))throw new TypeError("data must be an object");return x(t),r}var y2=Bjt;function LQe(t){let r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(l){return r[l]})}function DQe(t,r){this._pairs=[],t&&y2(t,this,r)}var $Qe=DQe.prototype;$Qe.append=function(r,n){this._pairs.push([r,n])};$Qe.toString=function(r){let n=r?function(l){return r.call(this,l,LQe)}:LQe;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};var sL=DQe;function Pjt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function PM(t,r,n){if(!r)return t;let l=n&&n.encode||Pjt;ir.isFunction(n)&&(n={serialize:n});let i=n&&n.serialize,d;if(i?d=i(r,n):d=ir.isURLSearchParams(r)?r.toString():new sL(r,n).toString(l),d){let p=t.indexOf("#");p!==-1&&(t=t.slice(0,p)),t+=(t.indexOf("?")===-1?"?":"&")+d}return t}we();Me();_e();var rle=class{constructor(){this.handlers=[]}use(r,n,l){return this.handlers.push({fulfilled:r,rejected:n,synchronous:l?l.synchronous:!1,runWhen:l?l.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){ir.forEach(this.handlers,function(l){l!==null&&r(l)})}},ile=rle;we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();var fL={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};we();Me();_e();we();Me();_e();we();Me();_e();we();Me();_e();var qQe=typeof URLSearchParams<"u"?URLSearchParams:sL;we();Me();_e();var UQe=typeof FormData<"u"?FormData:null;we();Me();_e();var jQe=typeof Blob<"u"?Blob:null;var FQe={isBrowser:!0,classes:{URLSearchParams:qQe,FormData:UQe,Blob:jQe},protocols:["http","https","file","blob","url","data"]};var ole={};Uf(ole,{hasBrowserEnv:()=>ale,hasStandardBrowserEnv:()=>Ojt,hasStandardBrowserWebWorkerEnv:()=>Njt,navigator:()=>nle,origin:()=>Cjt});we();Me();_e();var ale=typeof window<"u"&&typeof document<"u",nle=typeof navigator=="object"&&navigator||void 0,Ojt=ale&&(!nle||["ReactNative","NativeScript","NS"].indexOf(nle.product)<0),Njt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Cjt=ale&&window.location.href||"http://localhost";var _o={...ole,...FQe};function sle(t,r){return y2(t,new _o.classes.URLSearchParams,Object.assign({visitor:function(n,l,i,d){return _o.isNode&&ir.isBuffer(n)?(this.append(l,n.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},r))}we();Me();_e();function Ljt(t){return ir.matchAll(/\w+|\[(\w*)]/g,t).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Djt(t){let r={},n=Object.keys(t),l,i=n.length,d;for(l=0;l<i;l++)d=n[l],r[d]=t[d];return r}function $jt(t){function r(n,l,i,d){let p=n[d++];if(p==="__proto__")return!0;let v=Number.isFinite(+p),_=d>=n.length;return p=!p&&ir.isArray(i)?i.length:p,_?(ir.hasOwnProp(i,p)?i[p]=[i[p],l]:i[p]=l,!v):((!i[p]||!ir.isObject(i[p]))&&(i[p]=[]),r(n,l,i[p],d)&&ir.isArray(i[p])&&(i[p]=Djt(i[p])),!v)}if(ir.isFormData(t)&&ir.isFunction(t.entries)){let n={};return ir.forEachEntry(t,(l,i)=>{r(Ljt(l),i,n,0)}),n}return null}var hL=$jt;function qjt(t,r,n){if(ir.isString(t))try{return(r||JSON.parse)(t),ir.trim(t)}catch(l){if(l.name!=="SyntaxError")throw l}return(n||JSON.stringify)(t)}var fle={transitional:fL,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){let l=n.getContentType()||"",i=l.indexOf("application/json")>-1,d=ir.isObject(r);if(d&&ir.isHTMLForm(r)&&(r=new FormData(r)),ir.isFormData(r))return i?JSON.stringify(hL(r)):r;if(ir.isArrayBuffer(r)||ir.isBuffer(r)||ir.isStream(r)||ir.isFile(r)||ir.isBlob(r)||ir.isReadableStream(r))return r;if(ir.isArrayBufferView(r))return r.buffer;if(ir.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let v;if(d){if(l.indexOf("application/x-www-form-urlencoded")>-1)return sle(r,this.formSerializer).toString();if((v=ir.isFileList(r))||l.indexOf("multipart/form-data")>-1){let _=this.env&&this.env.FormData;return y2(v?{"files[]":r}:r,_&&new _,this.formSerializer)}}return d||i?(n.setContentType("application/json",!1),qjt(r)):r}],transformResponse:[function(r){let n=this.transitional||fle.transitional,l=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ir.isResponse(r)||ir.isReadableStream(r))return r;if(r&&ir.isString(r)&&(l&&!this.responseType||i)){let p=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(r)}catch(v){if(p)throw v.name==="SyntaxError"?ci.from(v,ci.ERR_BAD_RESPONSE,this,null,this.response):v}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_o.classes.FormData,Blob:_o.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ir.forEach(["delete","get","head","post","put","patch"],t=>{fle.headers[t]={}});var f4=fle;we();Me();_e();we();Me();_e();var Ujt=ir.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zQe=t=>{let r={},n,l,i;return t&&t.split(`
|
|
244
244
|
`).forEach(function(p){i=p.indexOf(":"),n=p.substring(0,i).trim().toLowerCase(),l=p.substring(i+1).trim(),!(!n||r[n]&&Ujt[n])&&(n==="set-cookie"?r[n]?r[n].push(l):r[n]=[l]:r[n]=r[n]?r[n]+", "+l:l)}),r};var HQe=Symbol("internals");function OM(t){return t&&String(t).trim().toLowerCase()}function uL(t){return t===!1||t==null?t:ir.isArray(t)?t.map(uL):String(t)}function jjt(t){let r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,l;for(;l=n.exec(t);)r[l[1]]=l[2];return r}var Fjt=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function hle(t,r,n,l,i){if(ir.isFunction(l))return l.call(this,r,n);if(i&&(r=n),!!ir.isString(r)){if(ir.isString(l))return r.indexOf(l)!==-1;if(ir.isRegExp(l))return l.test(r)}}function zjt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,n,l)=>n.toUpperCase()+l)}function Hjt(t,r){let n=ir.toCamelCase(" "+r);["get","set","has"].forEach(l=>{Object.defineProperty(t,l+n,{value:function(i,d,p){return this[l].call(this,r,i,d,p)},configurable:!0})})}var h4=class{constructor(r){r&&this.set(r)}set(r,n,l){let i=this;function d(v,_,y){let w=OM(_);if(!w)throw new Error("header name must be a non-empty string");let S=ir.findKey(i,w);(!S||i[S]===void 0||y===!0||y===void 0&&i[S]!==!1)&&(i[S||_]=uL(v))}let p=(v,_)=>ir.forEach(v,(y,w)=>d(y,w,_));if(ir.isPlainObject(r)||r instanceof this.constructor)p(r,n);else if(ir.isString(r)&&(r=r.trim())&&!Fjt(r))p(zQe(r),n);else if(ir.isHeaders(r))for(let[v,_]of r.entries())d(_,v,l);else r!=null&&d(n,r,l);return this}get(r,n){if(r=OM(r),r){let l=ir.findKey(this,r);if(l){let i=this[l];if(!n)return i;if(n===!0)return jjt(i);if(ir.isFunction(n))return n.call(this,i,l);if(ir.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,n){if(r=OM(r),r){let l=ir.findKey(this,r);return!!(l&&this[l]!==void 0&&(!n||hle(this,this[l],l,n)))}return!1}delete(r,n){let l=this,i=!1;function d(p){if(p=OM(p),p){let v=ir.findKey(l,p);v&&(!n||hle(l,l[v],v,n))&&(delete l[v],i=!0)}}return ir.isArray(r)?r.forEach(d):d(r),i}clear(r){let n=Object.keys(this),l=n.length,i=!1;for(;l--;){let d=n[l];(!r||hle(this,this[d],d,r,!0))&&(delete this[d],i=!0)}return i}normalize(r){let n=this,l={};return ir.forEach(this,(i,d)=>{let p=ir.findKey(l,d);if(p){n[p]=uL(i),delete n[d];return}let v=r?zjt(d):String(d).trim();v!==d&&delete n[d],n[v]=uL(i),l[v]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){let n=Object.create(null);return ir.forEach(this,(l,i)=>{l!=null&&l!==!1&&(n[i]=r&&ir.isArray(l)?l.join(", "):l)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,n])=>r+": "+n).join(`
|
|
245
245
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...n){let l=new this(r);return n.forEach(i=>l.set(i)),l}static accessor(r){let l=(this[HQe]=this[HQe]={accessors:{}}).accessors,i=this.prototype;function d(p){let v=OM(p);l[v]||(Hjt(i,p),l[v]=!0)}return ir.isArray(r)?r.forEach(d):d(r),this}};h4.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ir.reduceDescriptors(h4.prototype,({value:t},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>t,set(l){this[n]=l}}});ir.freezeMethods(h4);var _s=h4;function NM(t,r){let n=this||f4,l=r||n,i=_s.from(l.headers),d=l.data;return ir.forEach(t,function(v){d=v.call(n,d,i.normalize(),r?r.status:void 0)}),i.normalize(),d}we();Me();_e();function CM(t){return!!(t&&t.__CANCEL__)}we();Me();_e();function KQe(t,r,n){ci.call(this,t??"canceled",ci.ERR_CANCELED,r,n),this.name="CanceledError"}ir.inherits(KQe,ci,{__CANCEL__:!0});var s1=KQe;we();Me();_e();we();Me();_e();we();Me();_e();function LM(t,r,n){let l=n.config.validateStatus;!n.status||!l||l(n.status)?t(n):r(new ci("Request failed with status code "+n.status,[ci.ERR_BAD_REQUEST,ci.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}we();Me();_e();function ule(t){let r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""}we();Me();_e();we();Me();_e();function Kjt(t,r){t=t||10;let n=new Array(t),l=new Array(t),i=0,d=0,p;return r=r!==void 0?r:1e3,function(_){let y=Date.now(),w=l[d];p||(p=y),n[i]=_,l[i]=y;let S=d,M=0;for(;S!==i;)M+=n[S++],S=S%t;if(i=(i+1)%t,i===d&&(d=(d+1)%t),y-p<r)return;let x=w&&y-w;return x?Math.round(M*1e3/x):void 0}}var ZQe=Kjt;we();Me();_e();function Zjt(t,r){let n=0,l=1e3/r,i,d,p=(y,w=Date.now())=>{n=w,i=null,d&&(clearTimeout(d),d=null),t.apply(null,y)};return[(...y)=>{let w=Date.now(),S=w-n;S>=l?p(y,w):(i=y,d||(d=setTimeout(()=>{d=null,p(i)},l-S)))},()=>i&&p(i)]}var WQe=Zjt;var u4=(t,r,n=3)=>{let l=0,i=ZQe(50,250);return WQe(d=>{let p=d.loaded,v=d.lengthComputable?d.total:void 0,_=p-l,y=i(_),w=p<=v;l=p;let S={loaded:p,total:v,progress:v?p/v:void 0,bytes:_,rate:y||void 0,estimated:y&&v&&w?(v-p)/y:void 0,event:d,lengthComputable:v!=null,[r?"download":"upload"]:!0};t(S)},n)},lle=(t,r)=>{let n=t!=null;return[l=>r[0]({lengthComputable:n,total:t,loaded:l}),r[1]]},cle=t=>(...r)=>ir.asap(()=>t(...r));we();Me();_e();we();Me();_e();var GQe=_o.hasStandardBrowserEnv?((t,r)=>n=>(n=new URL(n,_o.origin),t.protocol===n.protocol&&t.host===n.host&&(r||t.port===n.port)))(new URL(_o.origin),_o.navigator&&/(msie|trident)/i.test(_o.navigator.userAgent)):()=>!0;we();Me();_e();var VQe=_o.hasStandardBrowserEnv?{write(t,r,n,l,i,d){let p=[t+"="+encodeURIComponent(r)];ir.isNumber(n)&&p.push("expires="+new Date(n).toGMTString()),ir.isString(l)&&p.push("path="+l),ir.isString(i)&&p.push("domain="+i),d===!0&&p.push("secure"),document.cookie=p.join("; ")},read(t){let r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};we();Me();_e();we();Me();_e();function dle(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}we();Me();_e();function ple(t,r){return r?t.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):t}function DM(t,r,n){let l=!dle(r);return t&&(l||n==!1)?ple(t,r):r}we();Me();_e();var YQe=t=>t instanceof _s?{...t}:t;function Lc(t,r){r=r||{};let n={};function l(y,w,S,M){return ir.isPlainObject(y)&&ir.isPlainObject(w)?ir.merge.call({caseless:M},y,w):ir.isPlainObject(w)?ir.merge({},w):ir.isArray(w)?w.slice():w}function i(y,w,S,M){if(ir.isUndefined(w)){if(!ir.isUndefined(y))return l(void 0,y,S,M)}else return l(y,w,S,M)}function d(y,w){if(!ir.isUndefined(w))return l(void 0,w)}function p(y,w){if(ir.isUndefined(w)){if(!ir.isUndefined(y))return l(void 0,y)}else return l(void 0,w)}function v(y,w,S){if(S in r)return l(y,w);if(S in t)return l(void 0,y)}let _={url:d,method:d,data:d,baseURL:p,transformRequest:p,transformResponse:p,paramsSerializer:p,timeout:p,timeoutMessage:p,withCredentials:p,withXSRFToken:p,adapter:p,responseType:p,xsrfCookieName:p,xsrfHeaderName:p,onUploadProgress:p,onDownloadProgress:p,decompress:p,maxContentLength:p,maxBodyLength:p,beforeRedirect:p,transport:p,httpAgent:p,httpsAgent:p,cancelToken:p,socketPath:p,responseEncoding:p,validateStatus:v,headers:(y,w,S)=>i(YQe(y),YQe(w),S,!0)};return ir.forEach(Object.keys(Object.assign({},t,r)),function(w){let S=_[w]||i,M=S(t[w],r[w],w);ir.isUndefined(M)&&S!==v||(n[w]=M)}),n}var lL=t=>{let r=Lc({},t),{data:n,withXSRFToken:l,xsrfHeaderName:i,xsrfCookieName:d,headers:p,auth:v}=r;r.headers=p=_s.from(p),r.url=PM(DM(r.baseURL,r.url,r.allowAbsoluteUrls),t.params,t.paramsSerializer),v&&p.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):"")));let _;if(ir.isFormData(n)){if(_o.hasStandardBrowserEnv||_o.hasStandardBrowserWebWorkerEnv)p.setContentType(void 0);else if((_=p.getContentType())!==!1){let[y,...w]=_?_.split(";").map(S=>S.trim()).filter(Boolean):[];p.setContentType([y||"multipart/form-data",...w].join("; "))}}if(_o.hasStandardBrowserEnv&&(l&&ir.isFunction(l)&&(l=l(r)),l||l!==!1&&GQe(r.url))){let y=i&&d&&VQe.read(d);y&&p.set(i,y)}return r};var Wjt=typeof XMLHttpRequest<"u",JQe=Wjt&&function(t){return new Promise(function(n,l){let i=lL(t),d=i.data,p=_s.from(i.headers).normalize(),{responseType:v,onUploadProgress:_,onDownloadProgress:y}=i,w,S,M,x,E;function T(){x&&x(),E&&E(),i.cancelToken&&i.cancelToken.unsubscribe(w),i.signal&&i.signal.removeEventListener("abort",w)}let I=new XMLHttpRequest;I.open(i.method.toUpperCase(),i.url,!0),I.timeout=i.timeout;function B(){if(!I)return;let N=_s.from("getAllResponseHeaders"in I&&I.getAllResponseHeaders()),K={data:!v||v==="text"||v==="json"?I.responseText:I.response,status:I.status,statusText:I.statusText,headers:N,config:t,request:I};LM(function(L){n(L),T()},function(L){l(L),T()},K),I=null}"onloadend"in I?I.onloadend=B:I.onreadystatechange=function(){!I||I.readyState!==4||I.status===0&&!(I.responseURL&&I.responseURL.indexOf("file:")===0)||setTimeout(B)},I.onabort=function(){I&&(l(new ci("Request aborted",ci.ECONNABORTED,t,I)),I=null)},I.onerror=function(){l(new ci("Network Error",ci.ERR_NETWORK,t,I)),I=null},I.ontimeout=function(){let H=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",K=i.transitional||fL;i.timeoutErrorMessage&&(H=i.timeoutErrorMessage),l(new ci(H,K.clarifyTimeoutError?ci.ETIMEDOUT:ci.ECONNABORTED,t,I)),I=null},d===void 0&&p.setContentType(null),"setRequestHeader"in I&&ir.forEach(p.toJSON(),function(H,K){I.setRequestHeader(K,H)}),ir.isUndefined(i.withCredentials)||(I.withCredentials=!!i.withCredentials),v&&v!=="json"&&(I.responseType=i.responseType),y&&([M,E]=u4(y,!0),I.addEventListener("progress",M)),_&&I.upload&&([S,x]=u4(_),I.upload.addEventListener("progress",S),I.upload.addEventListener("loadend",x)),(i.cancelToken||i.signal)&&(w=N=>{I&&(l(!N||N.type?new s1(null,t,I):N),I.abort(),I=null)},i.cancelToken&&i.cancelToken.subscribe(w),i.signal&&(i.signal.aborted?w():i.signal.addEventListener("abort",w)));let O=ule(i.url);if(O&&_o.protocols.indexOf(O)===-1){l(new ci("Unsupported protocol "+O+":",ci.ERR_BAD_REQUEST,t));return}I.send(d||null)})};we();Me();_e();we();Me();_e();var Gjt=(t,r)=>{let{length:n}=t=t?t.filter(Boolean):[];if(r||n){let l=new AbortController,i,d=function(y){if(!i){i=!0,v();let w=y instanceof Error?y:this.reason;l.abort(w instanceof ci?w:new s1(w instanceof Error?w.message:w))}},p=r&&setTimeout(()=>{p=null,d(new ci(`timeout ${r} of ms exceeded`,ci.ETIMEDOUT))},r),v=()=>{t&&(p&&clearTimeout(p),p=null,t.forEach(y=>{y.unsubscribe?y.unsubscribe(d):y.removeEventListener("abort",d)}),t=null)};t.forEach(y=>y.addEventListener("abort",d));let{signal:_}=l;return _.unsubscribe=()=>ir.asap(v),_}},XQe=Gjt;we();Me();_e();var Vjt=function*(t,r){let n=t.byteLength;if(!r||n<r){yield t;return}let l=0,i;for(;l<n;)i=l+r,yield t.slice(l,i),l=i},Yjt=async function*(t,r){for await(let n of Jjt(t))yield*Vjt(n,r)},Jjt=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let r=t.getReader();try{for(;;){let{done:n,value:l}=await r.read();if(n)break;yield l}}finally{await r.cancel()}},mle=(t,r,n,l)=>{let i=Yjt(t,r),d=0,p,v=_=>{p||(p=!0,l&&l(_))};return new ReadableStream({async pull(_){try{let{done:y,value:w}=await i.next();if(y){v(),_.close();return}let S=w.byteLength;if(n){let M=d+=S;n(M)}_.enqueue(new Uint8Array(w))}catch(y){throw v(y),y}},cancel(_){return v(_),i.return()}},{highWaterMark:2})};var dL=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",eet=dL&&typeof ReadableStream=="function",Xjt=dL&&(typeof TextEncoder=="function"?(t=>r=>t.encode(r))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),tet=(t,...r)=>{try{return!!t(...r)}catch{return!1}},Qjt=eet&&tet(()=>{let t=!1,r=new Request(_o.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!r}),QQe=64*1024,vle=eet&&tet(()=>ir.isReadableStream(new Response("").body)),cL={stream:vle&&(t=>t.body)};dL&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(r=>{!cL[r]&&(cL[r]=ir.isFunction(t[r])?n=>n[r]():(n,l)=>{throw new ci(`Response type '${r}' is not supported`,ci.ERR_NOT_SUPPORT,l)})})})(new Response);var eFt=async t=>{if(t==null)return 0;if(ir.isBlob(t))return t.size;if(ir.isSpecCompliantForm(t))return(await new Request(_o.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(ir.isArrayBufferView(t)||ir.isArrayBuffer(t))return t.byteLength;if(ir.isURLSearchParams(t)&&(t=t+""),ir.isString(t))return(await Xjt(t)).byteLength},tFt=async(t,r)=>{let n=ir.toFiniteNumber(t.getContentLength());return n??eFt(r)},ret=dL&&(async t=>{let{url:r,method:n,data:l,signal:i,cancelToken:d,timeout:p,onDownloadProgress:v,onUploadProgress:_,responseType:y,headers:w,withCredentials:S="same-origin",fetchOptions:M}=lL(t);y=y?(y+"").toLowerCase():"text";let x=XQe([i,d&&d.toAbortSignal()],p),E,T=x&&x.unsubscribe&&(()=>{x.unsubscribe()}),I;try{if(_&&Qjt&&n!=="get"&&n!=="head"&&(I=await tFt(w,l))!==0){let K=new Request(r,{method:"POST",body:l,duplex:"half"}),J;if(ir.isFormData(l)&&(J=K.headers.get("content-type"))&&w.setContentType(J),K.body){let[L,$]=lle(I,u4(cle(_)));l=mle(K.body,QQe,L,$)}}ir.isString(S)||(S=S?"include":"omit");let B="credentials"in Request.prototype;E=new Request(r,{...M,signal:x,method:n.toUpperCase(),headers:w.normalize().toJSON(),body:l,duplex:"half",credentials:B?S:void 0});let O=await fetch(E),N=vle&&(y==="stream"||y==="response");if(vle&&(v||N&&T)){let K={};["status","statusText","headers"].forEach(V=>{K[V]=O[V]});let J=ir.toFiniteNumber(O.headers.get("content-length")),[L,$]=v&&lle(J,u4(cle(v),!0))||[];O=new Response(mle(O.body,QQe,L,()=>{$&&$(),T&&T()}),K)}y=y||"text";let H=await cL[ir.findKey(cL,y)||"text"](O,t);return!N&&T&&T(),await new Promise((K,J)=>{LM(K,J,{data:H,headers:_s.from(O.headers),status:O.status,statusText:O.statusText,config:t,request:E})})}catch(B){throw T&&T(),B&&B.name==="TypeError"&&/fetch/i.test(B.message)?Object.assign(new ci("Network Error",ci.ERR_NETWORK,t,E),{cause:B.cause||B}):ci.from(B,B&&B.code,t,E)}});var ble={http:oL,xhr:JQe,fetch:ret};ir.forEach(ble,(t,r)=>{if(t){try{Object.defineProperty(t,"name",{value:r})}catch{}Object.defineProperty(t,"adapterName",{value:r})}});var iet=t=>`- ${t}`,rFt=t=>ir.isFunction(t)||t===null||t===!1,pL={getAdapter:t=>{t=ir.isArray(t)?t:[t];let{length:r}=t,n,l,i={};for(let d=0;d<r;d++){n=t[d];let p;if(l=n,!rFt(n)&&(l=ble[(p=String(n)).toLowerCase()],l===void 0))throw new ci(`Unknown adapter '${p}'`);if(l)break;i[p||"#"+d]=l}if(!l){let d=Object.entries(i).map(([v,_])=>`adapter ${v} `+(_===!1?"is not supported by the environment":"is not available in the build")),p=r?d.length>1?`since :
|
|
246
246
|
`+d.map(iet).join(`
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/version.js
CHANGED
package/lib/types/types/io.d.ts
CHANGED
|
@@ -353,15 +353,12 @@ export type AoBuyRecordParams = AoArNSPurchaseParams & {
|
|
|
353
353
|
years?: number;
|
|
354
354
|
type: 'lease' | 'permabuy';
|
|
355
355
|
processId: string;
|
|
356
|
-
referrer?: string;
|
|
357
356
|
};
|
|
358
357
|
export type AoExtendLeaseParams = AoArNSPurchaseParams & {
|
|
359
358
|
years: number;
|
|
360
|
-
referrer?: string;
|
|
361
359
|
};
|
|
362
360
|
export type AoIncreaseUndernameLimitParams = AoArNSPurchaseParams & {
|
|
363
361
|
increaseCount: number;
|
|
364
|
-
referrer?: string;
|
|
365
362
|
};
|
|
366
363
|
export type AoVaultedTransferParams = {
|
|
367
364
|
recipient: WalletAddress;
|
package/lib/types/version.d.ts
CHANGED