From d76257a2c41812d4375789809344fb5d6da32a80 Mon Sep 17 00:00:00 2001 From: innkeeping Date: Tue, 15 Oct 2024 09:16:22 -0500 Subject: [PATCH] Updates --- ...or-BcjjWJJf.js => MarkdownEditor-Bk-WrKMy.js} | 6 +++--- assets/{ccip-BrPrqTPA.js => ccip-DXiuzO4m.js} | 2 +- ...dule-Cgj3tfPN.js => hooks.module-CVqc1jrB.js} | 2 +- assets/{index-Be5skDjq.js => index-A8JLZe8e.js} | 2 +- assets/{index-aa7UOF77.js => index-B5Pv1XMp.js} | 2 +- assets/{index-CqhMBQeO.js => index-B7VpxOmb.js} | 2 +- assets/{index-heZ9DadS.js => index-BIHNXQx0.js} | 2 +- assets/{index-C9IGeZlS.js => index-BK4Ob9ME.js} | 2 +- assets/{index-DJ_EjEfy.js => index-Bcq5aE4i.js} | 2 +- assets/{index-C1_8NCHf.js => index-Bn7sbfQV.js} | 2 +- assets/{index-hDIYmWL4.js => index-BpiWtdP0.js} | 2 +- assets/{index-CxE5KQvT.js => index-C43Yg2RY.js} | 2 +- assets/{index-DsQCzYbi.js => index-C5noiB26.js} | 2 +- assets/{index-Biv_8wwF.js => index-CE1nPMQM.js} | 2 +- assets/{index-B5fhD1y5.js => index-CG3ncPiq.js} | 2 +- assets/{index-kavLhC2I.js => index-CM2WSMdR.js} | 2 +- assets/{index-DLoYlX0n.js => index-D0FpL0lt.js} | 2 +- assets/{index-B8vW3wT0.js => index-D58BRKR5.js} | 2 +- assets/{index-PJUOLX06.js => index-D93eCjLG.js} | 2 +- assets/{index-BzFGR1qi.js => index-DASPBQ9R.js} | 2 +- assets/{index-BP0nGub4.js => index-DHgdPR2R.js} | 2 +- assets/{index-DGE4TJz4.js => index-DMnbdnsj.js} | 2 +- assets/{index-CI8FOYx1.js => index-Dje23Sct.js} | 16 ++++++++-------- assets/{index-D1OvKKI2.js => index-U6IpoprS.js} | 2 +- ...x.lazy-DRoQcysg.js => index.lazy-Cf4BJ7np.js} | 2 +- ...x.lazy-B3BXRqZi.js => index.lazy-D7Gh5HMF.js} | 6 +++--- ...al-Cr_byQ5I.js => isAddressEqual-CzhKTe3O.js} | 2 +- ...cp256k1-B_ijNduS.js => secp256k1-B-W0FJZ_.js} | 2 +- ...m-modal-fwmTGh44.js => w3m-modal-DG2UkRHg.js} | 8 ++++---- index.html | 2 +- 30 files changed, 44 insertions(+), 44 deletions(-) rename assets/{MarkdownEditor-BcjjWJJf.js => MarkdownEditor-Bk-WrKMy.js} (99%) rename assets/{ccip-BrPrqTPA.js => ccip-DXiuzO4m.js} (95%) rename assets/{hooks.module-Cgj3tfPN.js => hooks.module-CVqc1jrB.js} (99%) rename assets/{index-Be5skDjq.js => index-A8JLZe8e.js} (99%) rename assets/{index-aa7UOF77.js => index-B5Pv1XMp.js} (99%) rename assets/{index-CqhMBQeO.js => index-B7VpxOmb.js} (98%) rename assets/{index-heZ9DadS.js => index-BIHNXQx0.js} (99%) rename assets/{index-C9IGeZlS.js => index-BK4Ob9ME.js} (99%) rename assets/{index-DJ_EjEfy.js => index-Bcq5aE4i.js} (99%) rename assets/{index-C1_8NCHf.js => index-Bn7sbfQV.js} (98%) rename assets/{index-hDIYmWL4.js => index-BpiWtdP0.js} (98%) rename assets/{index-CxE5KQvT.js => index-C43Yg2RY.js} (98%) rename assets/{index-DsQCzYbi.js => index-C5noiB26.js} (99%) rename assets/{index-Biv_8wwF.js => index-CE1nPMQM.js} (96%) rename assets/{index-B5fhD1y5.js => index-CG3ncPiq.js} (92%) rename assets/{index-kavLhC2I.js => index-CM2WSMdR.js} (98%) rename assets/{index-DLoYlX0n.js => index-D0FpL0lt.js} (98%) rename assets/{index-B8vW3wT0.js => index-D58BRKR5.js} (99%) rename assets/{index-PJUOLX06.js => index-D93eCjLG.js} (99%) rename assets/{index-BzFGR1qi.js => index-DASPBQ9R.js} (99%) rename assets/{index-BP0nGub4.js => index-DHgdPR2R.js} (99%) rename assets/{index-DGE4TJz4.js => index-DMnbdnsj.js} (94%) rename assets/{index-CI8FOYx1.js => index-Dje23Sct.js} (95%) rename assets/{index-D1OvKKI2.js => index-U6IpoprS.js} (92%) rename assets/{index.lazy-DRoQcysg.js => index.lazy-Cf4BJ7np.js} (99%) rename assets/{index.lazy-B3BXRqZi.js => index.lazy-D7Gh5HMF.js} (97%) rename assets/{isAddressEqual-Cr_byQ5I.js => isAddressEqual-CzhKTe3O.js} (70%) rename assets/{secp256k1-B_ijNduS.js => secp256k1-B-W0FJZ_.js} (99%) rename assets/{w3m-modal-fwmTGh44.js => w3m-modal-DG2UkRHg.js} (95%) diff --git a/assets/MarkdownEditor-BcjjWJJf.js b/assets/MarkdownEditor-Bk-WrKMy.js similarity index 99% rename from assets/MarkdownEditor-BcjjWJJf.js rename to assets/MarkdownEditor-Bk-WrKMy.js index 339a2a5..7317cc4 100644 --- a/assets/MarkdownEditor-BcjjWJJf.js +++ b/assets/MarkdownEditor-Bk-WrKMy.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BzFGR1qi.js","assets/index-CI8FOYx1.js","assets/index-DQLbHeQa.css","assets/index.lazy-B3BXRqZi.js","assets/isAddressEqual-Cr_byQ5I.js","assets/secp256k1-B_ijNduS.js","assets/index-lHEOM186.css","assets/index-aa7UOF77.js","assets/index-heZ9DadS.js","assets/index-DsQCzYbi.js","assets/index-D1OvKKI2.js","assets/index-kavLhC2I.js","assets/index-CxE5KQvT.js","assets/index-Be5skDjq.js","assets/index-B8vW3wT0.js","assets/index-BP0nGub4.js","assets/index-PJUOLX06.js","assets/index-B5fhD1y5.js","assets/index-DLoYlX0n.js","assets/index-CqhMBQeO.js","assets/dockerfile-BuNIbK2j.js","assets/simple-mode-C4Nsj8zu.js","assets/factor-D8pE9siL.js","assets/nsis-CEAdamBV.js","assets/pug-BmUsPMDj.js","assets/javascript-iSgyE4tI.js","assets/index-DGE4TJz4.js","assets/index-Biv_8wwF.js"])))=>i.map(i=>d[i]); -import{b6 as w,e as k,j as R,cM as Lo,g as dC,cN as v7,cO as w7,b8 as V,f as vx}from"./index-CI8FOYx1.js";import{s as ip,r as S7,c as wx,d as Sx,V as sn,o as sr,a as eu,m as on,b as Ar,f as li,e as $r,u as Pi,g as Jn,h as _l,v as k7,E as C7,t as pC,i as _7,j as P7,k as T7,l as E7}from"./index.lazy-B3BXRqZi.js";var $7=Object.defineProperty,A7=(n,e,t)=>e in n?$7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ai=(n,e,t)=>(A7(n,typeof e!="symbol"?e+"":e,t),t);let Q7=class gC{constructor(e=new Map){this.map=e}clone(){return new gC(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},tu=class{constructor(){Ai(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function vo(n,e){return e(n),n}function n1(){}function kx(n,e){return n===e}const Bf=new Map;let R7=class{constructor(e={}){Ai(this,"subscriptions",new tu),Ai(this,"singletonSubscriptions",new Map),Ai(this,"graph",new tu),Ai(this,"state",new Map),Ai(this,"distinctNodes",new Map),Ai(this,"executionMaps",new Map),Ai(this,"definitionRegistry",new Set);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?kx:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?kx:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!==void 0&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.subscriptions.use(u,p=>{for(const g of p)g(d)}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>vo(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return vo(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Bf.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),vo(t.type==="cell"?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{t.init(this,r)}))}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new tu,s=new Q7,o=new tu,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function be(n,e=n1,t=!0){return vo(Symbol(),r=>{Bf.set(r,{type:"cell",distinct:t,initial:n,init:e})})}function gt(n=n1,e=!1){return vo(Symbol(),t=>{Bf.set(t,{type:"signal",distinct:e,init:n})})}function os(n=n1){return vo(Symbol(),e=>{Bf.set(e,{type:"signal",distinct:!1,init:n})})}const mC=w.createContext(null);function lc(){const n=w.useContext(mC);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function Nt(n){const e=lc();e.register(n);const t=w.useCallback(r=>e.sub(n,r),[e,n]);return w.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function yt(...n){const e=lc(),t=w.useMemo(()=>e.getValues(n),[]),r=w.useRef(t),i=w.useCallback(s=>{const o=l=>{r.current=l,s()};return e.subMultiple(n,o)},[e,...n]);return w.useSyncExternalStore(i,()=>r.current,()=>r.current)}function at(n){const e=lc();return e.register(n),w.useCallback(t=>{e.pub(n,t)},[e,n])}function ui(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function ct(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function OC(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function ac(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function bC(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function M7(n,e){return e(n),n}function Es(){}function Nn(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function L7({children:n,plugins:e}){const t=w.useMemo(()=>M7(new R7,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return w.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),w.createElement(mC.Provider,{value:t},n)}function I7(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D7=I7(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;ti.map(i=>d[i]); +import{b6 as w,e as k,j as R,cM as Lo,g as dC,cN as v7,cO as w7,b8 as V,f as vx}from"./index-Dje23Sct.js";import{s as ip,r as S7,c as wx,d as Sx,V as sn,o as sr,a as eu,m as on,b as Ar,f as li,e as $r,u as Pi,g as Jn,h as _l,v as k7,E as C7,t as pC,i as _7,j as P7,k as T7,l as E7}from"./index.lazy-D7Gh5HMF.js";var $7=Object.defineProperty,A7=(n,e,t)=>e in n?$7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ai=(n,e,t)=>(A7(n,typeof e!="symbol"?e+"":e,t),t);let Q7=class gC{constructor(e=new Map){this.map=e}clone(){return new gC(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},tu=class{constructor(){Ai(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function vo(n,e){return e(n),n}function n1(){}function kx(n,e){return n===e}const Bf=new Map;let R7=class{constructor(e={}){Ai(this,"subscriptions",new tu),Ai(this,"singletonSubscriptions",new Map),Ai(this,"graph",new tu),Ai(this,"state",new Map),Ai(this,"distinctNodes",new Map),Ai(this,"executionMaps",new Map),Ai(this,"definitionRegistry",new Set);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?kx:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?kx:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!==void 0&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.subscriptions.use(u,p=>{for(const g of p)g(d)}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>vo(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return vo(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Bf.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),vo(t.type==="cell"?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{t.init(this,r)}))}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new tu,s=new Q7,o=new tu,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function be(n,e=n1,t=!0){return vo(Symbol(),r=>{Bf.set(r,{type:"cell",distinct:t,initial:n,init:e})})}function gt(n=n1,e=!1){return vo(Symbol(),t=>{Bf.set(t,{type:"signal",distinct:e,init:n})})}function os(n=n1){return vo(Symbol(),e=>{Bf.set(e,{type:"signal",distinct:!1,init:n})})}const mC=w.createContext(null);function lc(){const n=w.useContext(mC);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function Nt(n){const e=lc();e.register(n);const t=w.useCallback(r=>e.sub(n,r),[e,n]);return w.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function yt(...n){const e=lc(),t=w.useMemo(()=>e.getValues(n),[]),r=w.useRef(t),i=w.useCallback(s=>{const o=l=>{r.current=l,s()};return e.subMultiple(n,o)},[e,...n]);return w.useSyncExternalStore(i,()=>r.current,()=>r.current)}function at(n){const e=lc();return e.register(n),w.useCallback(t=>{e.pub(n,t)},[e,n])}function ui(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function ct(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function OC(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function ac(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function bC(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function M7(n,e){return e(n),n}function Es(){}function Nn(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function L7({children:n,plugins:e}){const t=w.useMemo(()=>M7(new R7,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return w.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),w.createElement(mC.Provider,{value:t},n)}function I7(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D7=I7(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;to8;try{An(n,()=>{const i=le()||function(f){return f.getEditorState().read(()=>{const d=le();return d!==null?d.clone():null})}(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f0){let y=0;for(let v=0;v0)for(const[f,d]of s)if(z(d)){const p=d.getChildrenKeys();let g=f.firstChild;for(let m=0;m0){for(let f=0;f{TC(n,e,t)})}function _x(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style;return!(t!==null&&t!==s||r!==null&&r!==o||i!==null&&i!==l)}function Px(n,e){const t=n.mergeWithSibling(e),r=pt()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Tx(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&oe(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(_x(e,r)){r=Px(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&oe(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(_x(r,t)){r=Px(r,t);break}break}t.remove()}}else r.remove()}function k1(n){return Ex(n.anchor),Ex(n.focus),n}function Ex(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),oe(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!z(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let u8=1;const h8=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function C1(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return Xe(jr(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Kf(e)==null)}function fc(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!C1(e)&&P1(e)===n}catch{return!1}}function _1(n){return n instanceof ld}function P1(n){let e=n;for(;e!=null;){const t=Kf(e);if(_1(t))return t;e=ed(e)}return null}function Kf(n){return n?n.__lexicalEditor:null}function ao(n){return n.isToken()||n.isSegmented()}function f8(n){return n.nodeType===ls}function Th(n){let e=n;for(;e!=null;){if(f8(e))return e;e=e.firstChild}return null}function Dg(n,e,t){const r=hi[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~hi.superscript:e==="superscript"&&(i&=~hi.subscript),i}function AC(n){return oe(n)||fi(n)||Xe(n)}function QC(n,e){if(e!=null)return void(n.__key=e);bn(),s2();const t=pt(),r=ki(),i=""+u8++;r._nodeMap.set(i,n),z(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=CC,n.__key=i}function As(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling();if(i===null)if(s!==null){const o=s.getWritable();r.__first=s.__key,o.__prev=null}else r.__first=null;else{const o=i.getWritable();if(s!==null){const l=s.getWritable();l.__prev=o.__key,o.__next=l.__key}else o.__next=null;t.__prev=null}if(s===null)if(i!==null){const o=i.getWritable();r.__last=i.__key,o.__next=null}else r.__last=null;else{const o=s.getWritable();if(i!==null){const l=i.getWritable();l.__next=o.__key,o.__prev=l.__key}else o.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Eh(n){s2();const e=n.getLatest(),t=e.__parent,r=ki(),i=pt(),s=r._nodeMap,o=i._dirtyElements;t!==null&&function(a,c,u){let h=a;for(;h!==null;){if(u.has(h))return;const f=c.get(h);if(f===void 0)break;u.set(h,!1),h=f.__parent}}(t,s,o);const l=e.__key;i._dirtyType=CC,z(n)?o.set(l,!0):i._dirtyLeaves.add(l)}function zt(n){bn();const e=pt(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=ht(t);r!==null&&r.getWritable()}if(n!==null){const r=ht(n);r!==null&&r.getWritable()}}}function Zi(){return gc()?null:pt()._compositionKey}function ht(n,e){const t=(e||ki())._nodeMap.get(n);return t===void 0?null:t}function RC(n,e){const t=n[`__lexicalKey_${pt()._key}`];return t!==void 0?ht(t,e):null}function jr(n,e){let t=n;for(;t!=null;){const r=RC(t,e);if(r!==null)return r;t=ed(t)}return null}function MC(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function $x(n){return n.read(()=>ze().getTextContent())}function ze(){return LC(ki())}function LC(n){return n._nodeMap.get("root")}function en(n){bn();const e=ki();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function mo(n){const e=pt(),t=function(r,i){let s=r;for(;s!=null;){const o=s[`__lexicalKey_${i._key}`];if(o!==void 0)return o;s=ed(s)}return null}(n,e);return t===null?n===e.getRootElement()?ht("root"):null:ht(t)}function Ax(n,e){return e?n.getTextContentSize():0}function IC(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function T1(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function DC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function NC(n){return n.nodeType===ls?n.nodeValue:null}function E1(n,e,t){const r=Xr(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let l=NC(i);const a=jr(i);if(l!==null&&oe(a)){if(l===Gf&&t){const c=t.length;l=t,s=c,o=c}l!==null&&$1(a,l,s,o,n)}}}function $1(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let l=e;(o||i)&&e[e.length-1]===Gf&&(l=e.slice(0,-1));const a=s.getTextContent();if(i||l!==a){if(l===""){if(zt(null),p1||Uf||g1)s.remove();else{const g=pt();setTimeout(()=>{g.update(()=>{s.isAttached()&&s.remove()})},20)}return}const c=s.getParent(),u=ol(),h=s.getTextContentSize(),f=Zi(),d=s.getKey();if(s.isToken()||f!==null&&d===f&&!o||U(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!o||u.focus.key===n.__key&&u.focus.offset===h&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const p=le();if(!U(p)||t===null||r===null)return void s.setTextContent(l);if(p.setTextNodeRange(s,t,s,r),s.isSegmented()){const g=Ot(s.getTextContent());s.replace(g),s=g}s.setTextContent(l)}}}function d8(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(s){const o=s.getPreviousSibling();return(oe(o)||z(o)&&o.isInline())&&!o.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function Qx(n){return n==="ArrowLeft"}function Rx(n){return n==="ArrowRight"}function jl(n,e){return nr?n:e}function Mx(n){return n==="Enter"}function Pl(n){return n==="Backspace"}function Tl(n){return n==="Delete"}function Lx(n,e,t){return n.toLowerCase()==="a"&&jl(e,t)}function p8(){const n=ze();en(k1(n.select(0,n.getChildrenSize())))}function ra(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const s=Ph(i);return t[e]=s,s}return i}function A1(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,l=e.get(s);l===void 0&&ue(33,s);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(o),h=u==="destroyed"&&i==="created";(u===void 0||h)&&c.set(o,h?"updated":i)}function Ix(n,e,t){const r=n.getParent();let i=t,s=n;return r!==null&&(e&&t===0?(i=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function Ca(n,e){const t=n.offset;if(n.type==="element")return Ix(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?Ix(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function VC(n){const e=td(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function ge(n,e,t){return l2(n,e,t)}function Jf(n){return!Ht(n)&&!n.isLastChild()&&!n.isInline()}function $h(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&ue(75,e),t}function ed(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Ng(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function td(n){const e=n._window;return e===null&&ue(78),e}function g8(n){let e=n.getParentOrThrow();for(;e!==null;){if(Qt(e))return e;e=e.getParentOrThrow()}return e}function Qt(n){return Ht(n)||z(n)&&n.isShadowRoot()}function m8(n){const e=n.constructor.clone(n);return QC(e,null),e}function Zn(n){const e=pt(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&ue(97);const i=r.replace;if(i!==null){const s=i(n);return s instanceof n.constructor||ue(98),s}return n}function op(n,e){!Ht(n.getParent())||z(e)||Xe(e)||ue(99)}function lp(n){return(Xe(n)||z(n)&&!n.canBeEmpty())&&!n.isInline()}function Q1(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function O8(n,e,t){let r=n._blockCursorElement;if(U(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,s=i.getNode(),o=i.offset;let l=!1,a=null;if(o===s.getChildrenSize())lp(s.getChildAtIndex(o-1))&&(l=!0);else{const c=s.getChildAtIndex(o);if(lp(c)){const u=c.getPreviousSibling();(u===null||lp(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(s.__key);return r===null&&(n._blockCursorElement=r=function(u){const h=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let d=h.blockCursor;if(d!==void 0){if(typeof d=="string"){const p=Ph(d);d=h.blockCursor=p}d!==void 0&&f.classList.add(...d)}return f}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Q1(r,n,e)}function Xr(n){return br?(n||window).getSelection():null}function b8(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),Qt(n)&&ue(102);const r=o=>{const l=o.getParentOrThrow(),a=Qt(l),c=o!==t||a?m8(o):o;if(a)return z(o)&&z(c)||ue(133),o.insertAfter(c),[o,c,c];{const[u,h,f]=r(l),d=o.getNextSiblings();return f.append(c,...d),[u,h,c]}},[i,s]=r(t);return[i,s]}function x8(n){return ur(n)&&n.tagName==="A"}function ur(n){return n.nodeType===1}function Vg(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Ah(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function co(n){if(Ht(n)||Xe(n)&&!n.isInline())return!0;if(!z(n)||Qt(n))return!1;const e=n.getFirstChild(),t=e===null||fi(e)||oe(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function ap(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function y8(){return pt()}const Dx=new WeakMap,v8=new Map;function w8(n){if(!n._readOnly&&n.isEmpty())return v8;n._readOnly||ue(192);let e=Dx.get(n);if(!e){e=new Map,Dx.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let s=e.get(i);s||(s=new Map,e.set(i,s)),s.set(t,r)}}return e}function R1(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ZC(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(z(o)&&ZC(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}let Gi,an,_a,nd,Zg,Bg,Ls,ar,Fg,Pa,At="",ln="",Er=null,rr="",si="",BC=!1,Ta=!1,eh=null;function Qh(n,e){const t=Ls.get(n);if(e!==null){const r=Xg(n);r.parentNode===e&&e.removeChild(r)}if(ar.has(n)||an._keyToDOMMap.delete(n),z(t)){const r=Mh(t,Ls);zg(r,0,r.length-1,null)}t!==void 0&&A1(Pa,_a,nd,t,"destroyed")}function zg(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&Qh(s,r)}}function xs(n,e){n.setProperty("text-align",e)}const S8="40px";function FC(n,e){const t=Gi.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||S8;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function zC(n,e){const t=n.style;e===0?xs(t,""):e===O1?xs(t,"left"):e===b1?xs(t,"center"):e===x1?xs(t,"right"):e===y1?xs(t,"justify"):e===v1?xs(t,"start"):e===w1&&xs(t,"end")}function Rh(n,e,t){const r=ar.get(n);r===void 0&&ue(60);const i=r.createDOM(Gi,an);if(function(s,o,l){const a=l._keyToDOMMap;o["__lexicalKey_"+l._key]=s,a.set(s,o)}(n,i,an),oe(r)?i.setAttribute("data-lexical-text","true"):Xe(r)&&i.setAttribute("data-lexical-decorator","true"),z(r)){const s=r.__indent,o=r.__size;if(s!==0&&FC(i,s),o!==0){const a=o-1;(function(c,u,h,f){const d=ln;ln="",jg(c,h,0,u,f,null),XC(h,f),ln=d})(Mh(r,ar),a,r,i)}const l=r.__format;l!==0&&zC(i,l),r.isInline()||jC(null,r,i),Jf(r)&&(At+=mi,si+=mi)}else{const s=r.getTextContent();if(Xe(r)){const o=r.decorate(an,Gi);o!==null&&qC(n,o),i.contentEditable="false"}else oe(r)&&(r.isDirectionless()||(ln+=s));At+=s,si+=s}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const s=e.__lexicalLineBreak;s!=null?e.insertBefore(i,s):e.appendChild(i)}return A1(Pa,_a,nd,r,"created"),i}function jg(n,e,t,r,i,s){const o=At;At="";let l=t;for(;l<=r;++l){Rh(n[l],i,s);const a=ar.get(n[l]);a!==null&&oe(a)&&(Er===null&&(Er=a.getFormat()),rr===""&&(rr=a.getStyle()))}Jf(e)&&(At+=mi),i.__lexicalTextContent=At,At=o+At}function Nx(n,e){const t=e.get(n);return fi(t)||Xe(t)&&t.isInline()}function jC(n,e,t){const r=n!==null&&(n.__size===0||Nx(n.__last,Ls)),i=e.__size===0||Nx(e.__last,ar);if(r){if(!i){const s=t.__lexicalLineBreak;if(s!=null)try{t.removeChild(s)}catch(o){if(typeof o=="object"&&o!=null){const l=`${o.toString()} Parent: ${t.tagName}, child: ${s.tagName}.`;throw new Error(l)}throw o}t.__lexicalLineBreak=null}}else if(i){const s=document.createElement("br");t.__lexicalLineBreak=s,t.appendChild(s)}}function XC(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ln||r!==eh){const s=ln==="",o=s?eh:(i=ln,J7.test(i)?"rtl":e8.test(i)?"ltr":null);if(o!==r){const l=e.classList,a=Gi.theme;let c=r!==null?a[r]:void 0,u=o!==null?a[o]:void 0;if(c!==void 0){if(typeof c=="string"){const h=Ph(c);c=a[r]=h}l.remove(...c)}if(o===null||s&&o==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const h=Ph(u);u=a[o]=h}u!==void 0&&l.add(...u)}e.dir=o}Ta||(n.getWritable().__dir=o)}eh=o,e.__lexicalDirTextContent=ln,e.__lexicalDir=o}var i}function k8(n,e,t){const r=ln;var i;ln="",Er=null,rr="",function(s,o,l){const a=At,c=s.__size,u=o.__size;if(At="",c===1&&u===1){const h=s.__first,f=o.__first;if(h===f)Xl(h,l);else{const p=Xg(h),g=Rh(f,null,null);try{l.replaceChild(g,p)}catch(m){if(typeof m=="object"&&m!=null){const b=`${m.toString()} Parent: ${l.tagName}, new child: {tag: ${g.tagName} key: ${f}}, old child: {tag: ${p.tagName}, key: ${h}}.`;throw new Error(b)}throw m}Qh(h,null)}const d=ar.get(f);oe(d)&&(Er===null&&(Er=d.getFormat()),rr===""&&(rr=d.getStyle()))}else{const h=Mh(s,Ls),f=Mh(o,ar);if(c===0)u!==0&&jg(f,o,0,u-1,l,null);else if(u===0){if(c!==0){const d=l.__lexicalLineBreak==null;zg(h,0,c-1,d?null:l),d&&(l.textContent="")}}else(function(d,p,g,m,b,O){const x=m-1,y=b-1;let v,C,S=(T=O,T.firstChild),_=0,P=0;for(var T;_<=x&&P<=y;){const D=p[_],N=g[P];if(D===N)S=cp(Xl(N,O)),_++,P++;else{v===void 0&&(v=new Set(p)),C===void 0&&(C=new Set(g));const H=C.has(D),X=v.has(N);if(H)if(X){const Y=$h(an,N);Y===S?S=cp(Xl(N,O)):(S!=null?O.insertBefore(Y,S):O.appendChild(Y),Xl(N,O)),_++,P++}else Rh(N,O,S),P++;else S=cp(Xg(D)),Qh(D,O),_++}const Z=ar.get(N);Z!==null&&oe(Z)&&(Er===null&&(Er=Z.getFormat()),rr===""&&(rr=Z.getStyle()))}const M=_>x,Q=P>y;if(M&&!Q){const D=g[y+1];jg(g,d,P,y,O,D===void 0?null:an.getElementByKey(D))}else Q&&!M&&zg(p,_,x,O)})(o,h,f,c,u,l)}Jf(o)&&(At+=mi),l.__lexicalTextContent=At,At=a+At}(n,e,t),XC(e,t),No(i=e)&&Er!=null&&Er!==i.__textFormat&&!Ta&&(i.setTextFormat(Er),i.setTextStyle(rr)),function(s){No(s)&&rr!==""&&rr!==s.__textStyle&&!Ta&&s.setTextStyle(rr)}(e),ln=r}function Mh(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&ue(101),t.push(r),r=i.__next}return t}function Xl(n,e){const t=Ls.get(n);let r=ar.get(n);t!==void 0&&r!==void 0||ue(61);const i=BC||Bg.has(n)||Zg.has(n),s=$h(an,n);if(t===r&&!i){if(z(t)){const o=s.__lexicalTextContent;o!==void 0&&(At+=o,si+=o);const l=s.__lexicalDirTextContent;l!==void 0&&(ln+=l)}else{const o=t.getTextContent();oe(t)&&!t.isDirectionless()&&(ln+=o),si+=o,At+=o}return s}if(t!==r&&i&&A1(Pa,_a,nd,r,"updated"),r.updateDOM(t,s,Gi)){const o=Rh(n,null,null);return e===null&&ue(62),e.replaceChild(o,s),Qh(n,null),o}if(z(t)&&z(r)){const o=r.__indent;o!==t.__indent&&FC(s,o);const l=r.__format;l!==t.__format&&zC(s,l),i&&(k8(t,r,s),Ht(r)||r.isInline()||jC(t,r,s)),Jf(r)&&(At+=mi,si+=mi)}else{const o=r.getTextContent();if(Xe(r)){const l=r.decorate(an,Gi);l!==null&&qC(n,l)}else oe(r)&&!r.isDirectionless()&&(ln+=o);At+=o,si+=o}if(!Ta&&Ht(r)&&r.__cachedText!==si){const o=r.getWritable();o.__cachedText=si,r=o}return s}function qC(n,e){let t=an._pendingDecorators;const r=an._decorators;if(t===null){if(r[n]===e)return;t=MC(an)}t[n]=e}function cp(n){let e=n.nextSibling;return e!==null&&e===an._blockCursorElement&&(e=e.nextSibling),e}function C8(n,e,t,r,i,s){At="",si="",ln="",BC=r===Do,eh=null,an=t,Gi=t._config,_a=t._nodes,nd=an._listeners.mutation,Zg=i,Bg=s,Ls=n._nodeMap,ar=e._nodeMap,Ta=e._readOnly,Fg=new Map(t._keyToDOMMap);const o=new Map;return Pa=o,Xl("root",null),an=void 0,_a=void 0,Zg=void 0,Bg=void 0,Ls=void 0,ar=void 0,Gi=void 0,Fg=void 0,Pa=void 0,o}function Xg(n){const e=Fg.get(n);return e===void 0&&ue(75,n),e}const ti=Object.freeze({}),qg=30,Wg=[["keydown",function(n,e){if(ia=n.timeStamp,WC=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:s,altKey:o}=n;ge(e,r1,n)||t!=null&&(function(l,a,c,u){return Rx(l)&&!a&&!u&&!c}(t,i,o,s)?ge(e,yC,n):function(l,a,c,u,h){return Rx(l)&&!u&&!c&&(a||h)}(t,i,r,o,s)?ge(e,V7,n):function(l,a,c,u){return Qx(l)&&!a&&!u&&!c}(t,i,o,s)?ge(e,i1,n):function(l,a,c,u,h){return Qx(l)&&!u&&!c&&(a||h)}(t,i,r,o,s)?ge(e,Z7,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,s)?ge(e,s1,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,s)?ge(e,o1,n):function(l,a){return Mx(l)&&a}(t,r)?(sa=!0,ge(e,Io,n)):function(l){return l===" "}(t)?ge(e,vC,n):function(l,a){return nr&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),sa=!0,ge(e,wo,!0)):function(l,a){return Mx(l)&&!a}(t,r)?(sa=!1,ge(e,Io,n)):function(l,a,c,u){return nr?!a&&!c&&(Pl(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Pl(l)}(t,o,s,i)?Pl(t)?ge(e,qf,n):(n.preventDefault(),ge(e,$s,!0)):function(l){return l==="Escape"}(t)?ge(e,uc,n):function(l,a,c,u,h){return nr?!(c||u||h)&&(Tl(l)||l.toLowerCase()==="d"&&a):!(a||u||h)&&Tl(l)}(t,i,r,o,s)?Tl(t)?ge(e,Wf,n):(n.preventDefault(),ge(e,$s,!1)):function(l,a,c){return Pl(l)&&(nr?a:c)}(t,o,i)?(n.preventDefault(),ge(e,Sa,!0)):function(l,a,c){return Tl(l)&&(nr?a:c)}(t,o,i)?(n.preventDefault(),ge(e,Sa,!1)):function(l,a){return nr&&a&&Pl(l)}(t,s)?(n.preventDefault(),ge(e,ka,!0)):function(l,a){return nr&&a&&Tl(l)}(t,s)?(n.preventDefault(),ge(e,ka,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&jl(c,u)}(t,o,s,i)?(n.preventDefault(),ge(e,ai,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&jl(c,u)}(t,o,s,i)?(n.preventDefault(),ge(e,ai,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&jl(c,u)}(t,o,s,i)?(n.preventDefault(),ge(e,ai,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,o,i,s)?ge(e,l1,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&jl(c,u)}(t,r,s,i)?(n.preventDefault(),ge(e,jf,void 0)):function(l,a,c,u){return nr?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,s,i)?(n.preventDefault(),ge(e,Xf,void 0)):$t(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(nr?c:u)}(t,r,s,i)?(n.preventDefault(),ge(e,Yf,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(nr?c:u)}(t,r,s,i)?(n.preventDefault(),ge(e,h1,n)):Lx(t,s,i)&&(n.preventDefault(),ge(e,Lg,n)):!Wi&&Lx(t,s,i)&&(n.preventDefault(),ge(e,Lg,n)),function(l,a,c,u){return l||a||c||u}(i,r,o,s)&&ge(e,SC,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&An(e,()=>{Xe(jr(t))||(Yg=!0)})}],["compositionstart",function(n,e){An(e,()=>{const t=le();if(U(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();zt(r.key),(n.timeStamp{up(e,n.data)})}],["input",function(n,e){n.stopPropagation(),An(e,()=>{const t=le(),r=n.data,i=GC(n);if(r!=null&&U(t)&&UC(t,i,r,n.timeStamp,!1)){El&&(up(e,r),El=!1);const s=t.anchor.getNode(),o=Xr(e._window);if(o===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;kh&&!t.isCollapsed()&&oe(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+c)===NC(o.anchorNode)||ge(e,So,r);const u=r.length;Wi&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),p1||Uf||g1||!e.isComposing()||(ia=0,zt(null))}else E1(!1,e,r!==null?r:void 0),El&&(up(e,r||void 0),El=!1);bn(),EC(pt())}),uo=null}],["click",function(n,e){An(e,()=>{const t=le(),r=Xr(e._window),i=ol();if(r){if(U(t)){const s=t.anchor,o=s.getNode();s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Ht(o)&&ze().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()&&(z(o)?o.select(0):o.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const s=r.anchorNode;if(s!==null){const o=s.nodeType;(o===hc||o===ls)&&en(I1(i,r,e,n))}}}ge(e,Ff,n)})}],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];kh&&Wg.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,s=GC(t);i==="deleteCompositionText"||Wi&&VC(r)||i!=="insertCompositionText"&&An(r,()=>{const o=le();if(i==="deleteContentBackward"){if(o===null){const d=ol();if(!U(d))return;en(d.clone())}if(U(o)){const d=o.anchor.key===o.focus.key;if(l=t.timeStamp,WC==="MediaLast"&&l{An(r,()=>{zt(null)})},qg),U(o)){const p=o.anchor.getNode();p.markDirty(),o.format=p.getFormat(),oe(p)||ue(142),o.style=p.getStyle()}}else{zt(null),t.preventDefault();const p=o.anchor.getNode().getTextContent(),g=o.anchor.offset===0&&o.focus.offset===p.length;W7&&d&&!g||ge(r,$s,!0)}return}}var l;if(!U(o))return;const a=t.data;uo!==null&&E1(!1,r,uo),o.dirty&&uo===null||!o.isCollapsed()||Ht(o.anchor.getNode())||s===null||o.applyDOMRange(s),uo=null;const c=o.anchor,u=o.focus,h=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ge(r,So,t);break;case"insertFromComposition":zt(null),ge(r,So,t);break;case"insertLineBreak":zt(null),ge(r,wo,!1);break;case"insertParagraph":zt(null),sa&&!Uf?(sa=!1,ge(r,wo,!1)):ge(r,wa,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ge(r,zf,t);break;case"deleteByComposition":(function(d,p){return d!==p||z(d)||z(p)||!d.isToken()||!p.isToken()})(h,f)&&ge(r,Rg,t);break;case"deleteByDrag":case"deleteByCut":ge(r,Rg,t);break;case"deleteContent":ge(r,$s,!1);break;case"deleteWordBackward":ge(r,Sa,!0);break;case"deleteWordForward":ge(r,Sa,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ge(r,ka,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ge(r,ka,!1);break;case"formatStrikeThrough":ge(r,ai,"strikethrough");break;case"formatBold":ge(r,ai,"bold");break;case"formatItalic":ge(r,ai,"italic");break;case"formatUnderline":ge(r,ai,"underline");break;case"historyUndo":ge(r,jf,void 0);break;case"historyRedo":ge(r,Xf,void 0)}else{if(a===` `)t.preventDefault(),ge(r,wo,!1);else if(a===mi)t.preventDefault(),ge(r,wa,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(d)}else a!=null&&UC(o,s,a,t.timeStamp,!0)?(t.preventDefault(),ge(r,So,a)):uo=a;HC=t.timeStamp}})}(n,e)]);let ia=0,WC=null,HC=0,uo=null;const Lh=new WeakMap;let Hg=!1,Yg=!1,sa=!1,El=!1,YC=[0,"",0,"root",0];function UC(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=pt(),c=Xr(a._window),u=c!==null?c.anchorNode:null,h=s.key,f=a.getElementByKey(h),d=t.length;return h!==o.key||!oe(l)||(!i&&(!kh||HC1||(i||!kh)&&f!==null&&!l.isComposing()&&u!==Th(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||d8(n,l)}function Vx(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===ls&&e!==0&&e!==n.nodeValue.length}function Zx(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;Hg&&(Hg=!1,Vx(r,i)&&Vx(s,o))||An(e,()=>{if(!t)return void en(null);if(!fc(e,r,s))return;const l=le();if(U(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=td(e).event,h=u?u.timeStamp:performance.now(),[f,d,p,g,m]=YC,b=ze(),O=e.isComposing()===!1&&b.getTextContent()==="";if(h ); } -`,rG={defaultPreset:"react",presets:[{name:"react",meta:"live react",label:"React",sandpackTemplate:"react",sandpackTheme:"light",snippetFileName:"/App.js",snippetLanguage:"jsx",initialSnippetContent:nG}]},YA=be(rG),iG=gt(n=>{n.link(n.pipe(iG,ct(YA),ui(([e,t])=>{const r=e?t.presets.find(i=>i.name===e):t.presets.find(i=>i.name==t.defaultPreset);if(!r)throw new Error(`No sandpack preset found with name ${e}`);return{code:r.initialSnippetContent??"",language:r.snippetLanguage??"jsx",meta:r.meta}})),Md)});function j(n){return new Yo(Pb.define(n))}function $i(n){return V(()=>import("./index-BzFGR1qi.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>e.sql({dialect:e[n]}))}const sG=[I.of({name:"C",extensions:["c","h","ino"],load(){return V(()=>import("./index-aa7UOF77.js"),__vite__mapDeps([7,1,2,3,4,5,6])).then(n=>n.cpp())}}),I.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return V(()=>import("./index-aa7UOF77.js"),__vite__mapDeps([7,1,2,3,4,5,6])).then(n=>n.cpp())}}),I.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return $i("Cassandra")}}),I.of({name:"CSS",extensions:["css"],load(){return V(()=>Promise.resolve().then(()=>CY),void 0).then(n=>n.css())}}),I.of({name:"Go",extensions:["go"],load(){return V(()=>import("./index-heZ9DadS.js"),__vite__mapDeps([8,1,2,3,4,5,6])).then(n=>n.go())}}),I.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return V(()=>Promise.resolve().then(()=>eG),void 0).then(n=>n.html())}}),I.of({name:"Java",extensions:["java"],load(){return V(()=>import("./index-DsQCzYbi.js"),__vite__mapDeps([9,1,2,3,4,5,6])).then(n=>n.java())}}),I.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript())}}),I.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return V(()=>import("./index-D1OvKKI2.js"),__vite__mapDeps([10,1,2,3,4,5,6])).then(n=>n.json())}}),I.of({name:"JSX",extensions:["jsx"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({jsx:!0}))}}),I.of({name:"LESS",extensions:["less"],load(){return V(()=>import("./index-kavLhC2I.js"),__vite__mapDeps([11,1,2,3,4,5,6])).then(n=>n.less())}}),I.of({name:"Liquid",extensions:["liquid"],load(){return V(()=>import("./index-CxE5KQvT.js"),__vite__mapDeps([12,1,2,3,4,5,6])).then(n=>n.liquid())}}),I.of({name:"MariaDB SQL",load(){return $i("MariaSQL")}}),I.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return V(()=>Promise.resolve().then(()=>mee),void 0).then(n=>n.markdown())}}),I.of({name:"MS SQL",load(){return $i("MSSQL")}}),I.of({name:"MySQL",load(){return $i("MySQL")}}),I.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return V(()=>import("./index-Be5skDjq.js"),__vite__mapDeps([13,1,2,3,4,5,6])).then(n=>n.php())}}),I.of({name:"PLSQL",extensions:["pls"],load(){return $i("PLSQL")}}),I.of({name:"PostgreSQL",load(){return $i("PostgreSQL")}}),I.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return V(()=>import("./index-B8vW3wT0.js"),__vite__mapDeps([14,1,2,3,4,5,6])).then(n=>n.python())}}),I.of({name:"Rust",extensions:["rs"],load(){return V(()=>import("./index-BP0nGub4.js"),__vite__mapDeps([15,1,2,3,4,5,6])).then(n=>n.rust())}}),I.of({name:"Sass",extensions:["sass"],load(){return V(()=>import("./index-PJUOLX06.js"),__vite__mapDeps([16,1,2,3,4,5,6])).then(n=>n.sass({indented:!0}))}}),I.of({name:"SCSS",extensions:["scss"],load(){return V(()=>import("./index-PJUOLX06.js"),__vite__mapDeps([16,1,2,3,4,5,6])).then(n=>n.sass())}}),I.of({name:"SQL",extensions:["sql"],load(){return $i("StandardSQL")}}),I.of({name:"SQLite",load(){return $i("SQLite")}}),I.of({name:"TSX",extensions:["tsx"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),I.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({typescript:!0}))}}),I.of({name:"WebAssembly",extensions:["wat","wast"],load(){return V(()=>import("./index-B5fhD1y5.js"),__vite__mapDeps([17,1,2,3,4,5,6])).then(n=>n.wast())}}),I.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return V(()=>import("./index-DLoYlX0n.js"),__vite__mapDeps([18,1,2,3,4,5,6])).then(n=>n.xml())}}),I.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return V(()=>import("./index-CqhMBQeO.js"),__vite__mapDeps([19,1,2,3,4,5,6])).then(n=>n.yaml())}}),I.of({name:"APL",extensions:["dyalog","apl"],load(){return V(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>j(n.apl))}}),I.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return V(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>j(n.asciiArmor))}}),I.of({name:"ASN.1",extensions:["asn","asn1"],load(){return V(()=>import("./asn1-CGOzndHr.js"),[]).then(n=>j(n.asn1({})))}}),I.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return V(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>j(n.asterisk))}}),I.of({name:"Brainfuck",extensions:["b","bf"],load(){return V(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>j(n.brainfuck))}}),I.of({name:"Cobol",extensions:["cob","cpy"],load(){return V(()=>import("./cobol-XrqhtCFE.js"),[]).then(n=>j(n.cobol))}}),I.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.csharp))}}),I.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"ClojureScript",extensions:["cljs"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return V(()=>import("./css-BnMrqG3P.js"),[]).then(n=>j(n.gss))}}),I.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return V(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>j(n.cmake))}}),I.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return V(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>j(n.coffeeScript))}}),I.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return V(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>j(n.commonLisp))}}),I.of({name:"Cypher",extensions:["cyp","cypher"],load(){return V(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>j(n.cypher))}}),I.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return V(()=>import("./python-BuPzkPfP.js"),[]).then(n=>j(n.cython))}}),I.of({name:"Crystal",extensions:["cr"],load(){return V(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>j(n.crystal))}}),I.of({name:"D",extensions:["d"],load(){return V(()=>import("./d-pRatUO7H.js"),[]).then(n=>j(n.d))}}),I.of({name:"Dart",extensions:["dart"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.dart))}}),I.of({name:"diff",extensions:["diff","patch"],load(){return V(()=>import("./diff-DbItnlRl.js"),[]).then(n=>j(n.diff))}}),I.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return V(()=>import("./dockerfile-BuNIbK2j.js"),__vite__mapDeps([20,21])).then(n=>j(n.dockerFile))}}),I.of({name:"DTD",extensions:["dtd"],load(){return V(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>j(n.dtd))}}),I.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return V(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>j(n.dylan))}}),I.of({name:"EBNF",load(){return V(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>j(n.ebnf))}}),I.of({name:"ECL",extensions:["ecl"],load(){return V(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>j(n.ecl))}}),I.of({name:"edn",extensions:["edn"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"Eiffel",extensions:["e"],load(){return V(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>j(n.eiffel))}}),I.of({name:"Elm",extensions:["elm"],load(){return V(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>j(n.elm))}}),I.of({name:"Erlang",extensions:["erl"],load(){return V(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>j(n.erlang))}}),I.of({name:"Esper",load(){return V(()=>import("./sql-C4g8LzGK.js"),[]).then(n=>j(n.esper))}}),I.of({name:"Factor",extensions:["factor"],load(){return V(()=>import("./factor-D8pE9siL.js"),__vite__mapDeps([22,21])).then(n=>j(n.factor))}}),I.of({name:"FCL",load(){return V(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>j(n.fcl))}}),I.of({name:"Forth",extensions:["forth","fth","4th"],load(){return V(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>j(n.forth))}}),I.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return V(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>j(n.fortran))}}),I.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.fSharp))}}),I.of({name:"Gas",extensions:["s"],load(){return V(()=>import("./gas-Bneqetm1.js"),[]).then(n=>j(n.gas))}}),I.of({name:"Gherkin",extensions:["feature"],load(){return V(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>j(n.gherkin))}}),I.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return V(()=>import("./groovy-DKLxxR9y.js"),[]).then(n=>j(n.groovy))}}),I.of({name:"Haskell",extensions:["hs"],load(){return V(()=>import("./haskell-BWDZoCOh.js"),[]).then(n=>j(n.haskell))}}),I.of({name:"Haxe",extensions:["hx"],load(){return V(()=>import("./haxe-pv4rovob.js"),[]).then(n=>j(n.haxe))}}),I.of({name:"HXML",extensions:["hxml"],load(){return V(()=>import("./haxe-pv4rovob.js"),[]).then(n=>j(n.hxml))}}),I.of({name:"HTTP",load(){return V(()=>import("./http-DBlCnlav.js"),[]).then(n=>j(n.http))}}),I.of({name:"IDL",extensions:["pro"],load(){return V(()=>import("./idl-BEugSyMb.js"),[]).then(n=>j(n.idl))}}),I.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return V(()=>import("./javascript-iSgyE4tI.js"),[]).then(n=>j(n.jsonld))}}),I.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return V(()=>import("./jinja2-C4DGRd-O.js"),[]).then(n=>j(n.jinja2))}}),I.of({name:"Julia",extensions:["jl"],load(){return V(()=>import("./julia-DuME0IfC.js"),[]).then(n=>j(n.julia))}}),I.of({name:"Kotlin",extensions:["kt","kts"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.kotlin))}}),I.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return V(()=>import("./livescript-k3uCVVjK.js"),[]).then(n=>j(n.liveScript))}}),I.of({name:"Lua",extensions:["lua"],load(){return V(()=>import("./lua-BgMRiT3U.js"),[]).then(n=>j(n.lua))}}),I.of({name:"mIRC",extensions:["mrc"],load(){return V(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>j(n.mirc))}}),I.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return V(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>j(n.mathematica))}}),I.of({name:"Modelica",extensions:["mo"],load(){return V(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>j(n.modelica))}}),I.of({name:"MUMPS",extensions:["mps"],load(){return V(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>j(n.mumps))}}),I.of({name:"Mbox",extensions:["mbox"],load(){return V(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>j(n.mbox))}}),I.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return V(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>j(n.nginx))}}),I.of({name:"NSIS",extensions:["nsh","nsi"],load(){return V(()=>import("./nsis-CEAdamBV.js"),__vite__mapDeps([23,21])).then(n=>j(n.nsis))}}),I.of({name:"NTriples",extensions:["nt","nq"],load(){return V(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>j(n.ntriples))}}),I.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.objectiveC))}}),I.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.objectiveCpp))}}),I.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.oCaml))}}),I.of({name:"Octave",extensions:["m"],load(){return V(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>j(n.octave))}}),I.of({name:"Oz",extensions:["oz"],load(){return V(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>j(n.oz))}}),I.of({name:"Pascal",extensions:["p","pas"],load(){return V(()=>import("./pascal-B1wCu0_E.js"),[]).then(n=>j(n.pascal))}}),I.of({name:"Perl",extensions:["pl","pm"],load(){return V(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>j(n.perl))}}),I.of({name:"Pig",extensions:["pig"],load(){return V(()=>import("./pig-CevX1Tat.js"),[]).then(n=>j(n.pig))}}),I.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return V(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>j(n.powerShell))}}),I.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return V(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>j(n.properties))}}),I.of({name:"ProtoBuf",extensions:["proto"],load(){return V(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>j(n.protobuf))}}),I.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return V(()=>import("./pug-BmUsPMDj.js"),__vite__mapDeps([24,25])).then(n=>j(n.pug))}}),I.of({name:"Puppet",extensions:["pp"],load(){return V(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>j(n.puppet))}}),I.of({name:"Q",extensions:["q"],load(){return V(()=>import("./q-ZnEupP5q.js"),[]).then(n=>j(n.q))}}),I.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return V(()=>import("./r-DUYO_cvP.js"),[]).then(n=>j(n.r))}}),I.of({name:"RPM Changes",load(){return V(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>j(n.rpmChanges))}}),I.of({name:"RPM Spec",extensions:["spec"],load(){return V(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>j(n.rpmSpec))}}),I.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return V(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>j(n.ruby))}}),I.of({name:"SAS",extensions:["sas"],load(){return V(()=>import("./sas-B4kiWyti.js"),[]).then(n=>j(n.sas))}}),I.of({name:"Scala",extensions:["scala"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.scala))}}),I.of({name:"Scheme",extensions:["scm","ss"],load(){return V(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>j(n.scheme))}}),I.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return V(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>j(n.shell))}}),I.of({name:"Sieve",extensions:["siv","sieve"],load(){return V(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>j(n.sieve))}}),I.of({name:"Smalltalk",extensions:["st"],load(){return V(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>j(n.smalltalk))}}),I.of({name:"Solr",load(){return V(()=>import("./solr-DehyRSwq.js"),[]).then(n=>j(n.solr))}}),I.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.sml))}}),I.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return V(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>j(n.sparql))}}),I.of({name:"Spreadsheet",alias:["excel","formula"],load(){return V(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>j(n.spreadsheet))}}),I.of({name:"Squirrel",extensions:["nut"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.squirrel))}}),I.of({name:"Stylus",extensions:["styl"],load(){return V(()=>import("./stylus-BdAi1jBa.js"),[]).then(n=>j(n.stylus))}}),I.of({name:"Swift",extensions:["swift"],load(){return V(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>j(n.swift))}}),I.of({name:"sTeX",load(){return V(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>j(n.stex))}}),I.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return V(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>j(n.stex))}}),I.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return V(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>j(n.verilog))}}),I.of({name:"Tcl",extensions:["tcl"],load(){return V(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>j(n.tcl))}}),I.of({name:"Textile",extensions:["textile"],load(){return V(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>j(n.textile))}}),I.of({name:"TiddlyWiki",load(){return V(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>j(n.tiddlyWiki))}}),I.of({name:"Tiki wiki",load(){return V(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>j(n.tiki))}}),I.of({name:"TOML",extensions:["toml"],load(){return V(()=>import("./toml-BXUEaScT.js"),[]).then(n=>j(n.toml))}}),I.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return V(()=>import("./troff-wAsdV37c.js"),[]).then(n=>j(n.troff))}}),I.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return V(()=>import("./ttcn-CiGrtVSZ.js"),[]).then(n=>j(n.ttcn))}}),I.of({name:"TTCN_CFG",extensions:["cfg"],load(){return V(()=>import("./ttcn-cfg-BIkV9KBc.js"),[]).then(n=>j(n.ttcnCfg))}}),I.of({name:"Turtle",extensions:["ttl"],load(){return V(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>j(n.turtle))}}),I.of({name:"Web IDL",extensions:["webidl"],load(){return V(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>j(n.webIDL))}}),I.of({name:"VB.NET",extensions:["vb"],load(){return V(()=>import("./vb-CmGdzxic.js"),[]).then(n=>j(n.vb))}}),I.of({name:"VBScript",extensions:["vbs"],load(){return V(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>j(n.vbScript))}}),I.of({name:"Velocity",extensions:["vtl"],load(){return V(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>j(n.velocity))}}),I.of({name:"Verilog",extensions:["v"],load(){return V(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>j(n.verilog))}}),I.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return V(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>j(n.vhdl))}}),I.of({name:"XQuery",extensions:["xy","xquery"],load(){return V(()=>import("./xquery-WRlm2TX8.js"),[]).then(n=>j(n.xQuery))}}),I.of({name:"Yacas",extensions:["ys"],load(){return V(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>j(n.yacas))}}),I.of({name:"Z80",extensions:["z80"],load(){return V(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>j(n.z80))}}),I.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.mscgen))}}),I.of({name:"Xù",extensions:["xu"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.xu))}}),I.of({name:"MsGenny",extensions:["msgenny"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.msgenny))}}),I.of({name:"Vue",extensions:["vue"],load(){return V(()=>import("./index-DGE4TJz4.js"),__vite__mapDeps([26,1,2,3,4,5,6])).then(n=>n.vue())}}),I.of({name:"Angular Template",load(){return V(()=>import("./index-Biv_8wwF.js"),__vite__mapDeps([27,1,2,3,4,5,6])).then(n=>n.angular())}})],uk="#2e3440",Yb="#3b4252",hk="#434c5e",Bu="#4c566a",fk="#e5e9f0",AO="#eceff4",gg="#8fbcbb",dk="#88c0d0",oG="#81a1c1",tr="#5e81ac",lG="#bf616a",lo="#d08770",mg="#ebcb8b",pk="#a3be8c",aG="#b48ead",gk="#d30102",Ub=AO,Og=Ub,cG="#ffffff",bg=Yb,uG=Ub,mk=Yb,hG=J.theme({"&":{color:uk,backgroundColor:cG},".cm-content":{caretColor:mk},".cm-cursor, .cm-dropCursor":{borderLeftColor:mk},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:uG},".cm-panels":{backgroundColor:Ub,color:Bu},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${Bu}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fk},".cm-activeLine":{backgroundColor:Og},".cm-selectionMatch":{backgroundColor:fk},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Bu}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:AO},".cm-gutters":{backgroundColor:AO,color:uk,border:"none"},".cm-activeLineGutter":{backgroundColor:Og},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:bg},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bg,borderBottomColor:bg},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Og,color:Bu}}},{dark:!1}),fG=Xc.define([{tag:E.keyword,color:tr},{tag:[E.name,E.deleted,E.character,E.propertyName,E.macroName],color:lo},{tag:[E.variableName],color:lo},{tag:[E.function(E.variableName)],color:tr},{tag:[E.labelName],color:oG},{tag:[E.color,E.constant(E.name),E.standard(E.name)],color:tr},{tag:[E.definition(E.name),E.separator],color:pk},{tag:[E.brace],color:gg},{tag:[E.annotation],color:gk},{tag:[E.number,E.changed,E.annotation,E.modifier,E.self,E.namespace],color:dk},{tag:[E.typeName,E.className],color:mg},{tag:[E.operator,E.operatorKeyword],color:pk},{tag:[E.tagName],color:aG},{tag:[E.squareBracket],color:lG},{tag:[E.angleBracket],color:lo},{tag:[E.attributeName],color:mg},{tag:[E.regexp],color:tr},{tag:[E.quote],color:Yb},{tag:[E.string],color:lo},{tag:E.link,color:gg,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[E.url,E.escape,E.special(E.string)],color:lo},{tag:[E.meta],color:dk},{tag:[E.comment],color:hk,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold",color:tr},{tag:E.emphasis,fontStyle:"italic",color:tr},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.heading,fontWeight:"bold",color:tr},{tag:E.special(E.heading1),fontWeight:"bold",color:tr},{tag:E.heading1,fontWeight:"bold",color:tr},{tag:[E.heading2,E.heading3,E.heading4],fontWeight:"bold",color:tr},{tag:[E.heading5,E.heading6],color:tr},{tag:[E.atom,E.bool,E.special(E.variableName)],color:lo},{tag:[E.processingInstruction,E.inserted],color:gg},{tag:[E.contentSeparator],color:mg},{tag:E.invalid,color:hk,borderBottom:`1px dotted ${gk}`}]),UA=[hG,a$(fG)];function Je(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;en.normalize("NFKD"):n=>n;class Jo{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?l=>s(Ok(l)):Ok,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return jt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ob(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=zn(e);let i=this.normalize(t);for(let s=0,o=r;;s++){let l=i.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(a)return this.value=a,this;break}o==r&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Af(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=t){let l=new Ro(t,e.sliceString(t,r));return xg.set(e,l),l}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Af(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ro.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(JA.prototype[Symbol.iterator]=e9.prototype[Symbol.iterator]=function(){return this});function dG(n){try{return new RegExp(n,Gb),!0}catch{return!1}}function Af(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function QO(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Je("input",{class:"cm-textfield",name:"line",value:e}),r=Je("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Qf.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},Je("label",n.state.phrase("Go to line"),": ",t)," ",Je("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,c,u,h]=s,f=u?+u.slice(1):0,d=c?+c:l.number;if(c&&h){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=F.cursor(p.from+Math.max(0,Math.min(f,p.length)));n.dispatch({effects:[Qf.of(!1),J.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:r}}const Qf=Se.define(),bk=vt.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Qf)&&(n=t.value);return n},provide:n=>Xa.from(n,e=>e?QO:null)}),pG=n=>{let e=ja(n,QO);if(!e){let t=[Qf.of(!0)];n.state.field(bk,!1)==null&&t.push(Se.appendConfig.of([bk,gG])),n.dispatch({effects:t}),e=ja(n,QO)}return e&&e.dom.querySelector("input").select(),!0},gG=J.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),mG={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},OG=fe.define({combine(n){return Jr(n,mG,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function bG(n){return[SG,wG]}const xG=Oe.mark({class:"cm-selectionMatch"}),yG=Oe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function xk(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=ut.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=ut.Word)}function vG(n,e,t,r){return n(e.sliceDoc(t,t+1))==ut.Word&&n(e.sliceDoc(r-1,r))==ut.Word}const wG=xt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(OG),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Oe.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Oe.none;let a=t.wordAt(i.head);if(!a)return Oe.none;o=t.charCategorizer(i.head),s=t.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a200)return Oe.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(xk(o,t,i.from,i.to)&&vG(o,t,i.from,i.to)))return Oe.none}else if(s=t.sliceDoc(i.from,i.to),!s)return Oe.none}let l=[];for(let a of n.visibleRanges){let c=new Jo(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||xk(o,t,u,h))&&(i.empty&&u<=i.from&&h>=i.to?l.push(yG.range(u,h)):(u>=i.to||h<=i.from)&&l.push(xG.range(u,h)),l.length>e.maxMatches))return Oe.none}}return Oe.set(l)}},{decorations:n=>n.decorations}),SG=J.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),kG=({state:n,dispatch:e})=>{let{selection:t}=n,r=F.create(t.ranges.map(i=>n.wordAt(i.head)||F.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function CG(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,l=new Jo(n.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Jo(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(a=>a.from==l.value.from))continue;if(s){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const _G=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return kG({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=CG(n,r);return i?(e(n.update({selection:n.selection.addRange(F.range(i.from,i.to),!1),effects:J.scrollIntoView(i.to)})),!0):!1},Sl=fe.define({combine(n){return Jr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new NG(e),scrollToMatch:e=>J.scrollIntoView(e)})}});class t9{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||dG(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?` +`,rG={defaultPreset:"react",presets:[{name:"react",meta:"live react",label:"React",sandpackTemplate:"react",sandpackTheme:"light",snippetFileName:"/App.js",snippetLanguage:"jsx",initialSnippetContent:nG}]},YA=be(rG),iG=gt(n=>{n.link(n.pipe(iG,ct(YA),ui(([e,t])=>{const r=e?t.presets.find(i=>i.name===e):t.presets.find(i=>i.name==t.defaultPreset);if(!r)throw new Error(`No sandpack preset found with name ${e}`);return{code:r.initialSnippetContent??"",language:r.snippetLanguage??"jsx",meta:r.meta}})),Md)});function j(n){return new Yo(Pb.define(n))}function $i(n){return V(()=>import("./index-DASPBQ9R.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>e.sql({dialect:e[n]}))}const sG=[I.of({name:"C",extensions:["c","h","ino"],load(){return V(()=>import("./index-B5Pv1XMp.js"),__vite__mapDeps([7,1,2,3,4,5,6])).then(n=>n.cpp())}}),I.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return V(()=>import("./index-B5Pv1XMp.js"),__vite__mapDeps([7,1,2,3,4,5,6])).then(n=>n.cpp())}}),I.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return $i("Cassandra")}}),I.of({name:"CSS",extensions:["css"],load(){return V(()=>Promise.resolve().then(()=>CY),void 0).then(n=>n.css())}}),I.of({name:"Go",extensions:["go"],load(){return V(()=>import("./index-BIHNXQx0.js"),__vite__mapDeps([8,1,2,3,4,5,6])).then(n=>n.go())}}),I.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return V(()=>Promise.resolve().then(()=>eG),void 0).then(n=>n.html())}}),I.of({name:"Java",extensions:["java"],load(){return V(()=>import("./index-C5noiB26.js"),__vite__mapDeps([9,1,2,3,4,5,6])).then(n=>n.java())}}),I.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript())}}),I.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return V(()=>import("./index-U6IpoprS.js"),__vite__mapDeps([10,1,2,3,4,5,6])).then(n=>n.json())}}),I.of({name:"JSX",extensions:["jsx"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({jsx:!0}))}}),I.of({name:"LESS",extensions:["less"],load(){return V(()=>import("./index-CM2WSMdR.js"),__vite__mapDeps([11,1,2,3,4,5,6])).then(n=>n.less())}}),I.of({name:"Liquid",extensions:["liquid"],load(){return V(()=>import("./index-C43Yg2RY.js"),__vite__mapDeps([12,1,2,3,4,5,6])).then(n=>n.liquid())}}),I.of({name:"MariaDB SQL",load(){return $i("MariaSQL")}}),I.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return V(()=>Promise.resolve().then(()=>mee),void 0).then(n=>n.markdown())}}),I.of({name:"MS SQL",load(){return $i("MSSQL")}}),I.of({name:"MySQL",load(){return $i("MySQL")}}),I.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return V(()=>import("./index-A8JLZe8e.js"),__vite__mapDeps([13,1,2,3,4,5,6])).then(n=>n.php())}}),I.of({name:"PLSQL",extensions:["pls"],load(){return $i("PLSQL")}}),I.of({name:"PostgreSQL",load(){return $i("PostgreSQL")}}),I.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return V(()=>import("./index-D58BRKR5.js"),__vite__mapDeps([14,1,2,3,4,5,6])).then(n=>n.python())}}),I.of({name:"Rust",extensions:["rs"],load(){return V(()=>import("./index-DHgdPR2R.js"),__vite__mapDeps([15,1,2,3,4,5,6])).then(n=>n.rust())}}),I.of({name:"Sass",extensions:["sass"],load(){return V(()=>import("./index-D93eCjLG.js"),__vite__mapDeps([16,1,2,3,4,5,6])).then(n=>n.sass({indented:!0}))}}),I.of({name:"SCSS",extensions:["scss"],load(){return V(()=>import("./index-D93eCjLG.js"),__vite__mapDeps([16,1,2,3,4,5,6])).then(n=>n.sass())}}),I.of({name:"SQL",extensions:["sql"],load(){return $i("StandardSQL")}}),I.of({name:"SQLite",load(){return $i("SQLite")}}),I.of({name:"TSX",extensions:["tsx"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),I.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return V(()=>Promise.resolve().then(()=>Zu),void 0).then(n=>n.javascript({typescript:!0}))}}),I.of({name:"WebAssembly",extensions:["wat","wast"],load(){return V(()=>import("./index-CG3ncPiq.js"),__vite__mapDeps([17,1,2,3,4,5,6])).then(n=>n.wast())}}),I.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return V(()=>import("./index-D0FpL0lt.js"),__vite__mapDeps([18,1,2,3,4,5,6])).then(n=>n.xml())}}),I.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return V(()=>import("./index-B7VpxOmb.js"),__vite__mapDeps([19,1,2,3,4,5,6])).then(n=>n.yaml())}}),I.of({name:"APL",extensions:["dyalog","apl"],load(){return V(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>j(n.apl))}}),I.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return V(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>j(n.asciiArmor))}}),I.of({name:"ASN.1",extensions:["asn","asn1"],load(){return V(()=>import("./asn1-CGOzndHr.js"),[]).then(n=>j(n.asn1({})))}}),I.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return V(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>j(n.asterisk))}}),I.of({name:"Brainfuck",extensions:["b","bf"],load(){return V(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>j(n.brainfuck))}}),I.of({name:"Cobol",extensions:["cob","cpy"],load(){return V(()=>import("./cobol-XrqhtCFE.js"),[]).then(n=>j(n.cobol))}}),I.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.csharp))}}),I.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"ClojureScript",extensions:["cljs"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return V(()=>import("./css-BnMrqG3P.js"),[]).then(n=>j(n.gss))}}),I.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return V(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>j(n.cmake))}}),I.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return V(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>j(n.coffeeScript))}}),I.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return V(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>j(n.commonLisp))}}),I.of({name:"Cypher",extensions:["cyp","cypher"],load(){return V(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>j(n.cypher))}}),I.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return V(()=>import("./python-BuPzkPfP.js"),[]).then(n=>j(n.cython))}}),I.of({name:"Crystal",extensions:["cr"],load(){return V(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>j(n.crystal))}}),I.of({name:"D",extensions:["d"],load(){return V(()=>import("./d-pRatUO7H.js"),[]).then(n=>j(n.d))}}),I.of({name:"Dart",extensions:["dart"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.dart))}}),I.of({name:"diff",extensions:["diff","patch"],load(){return V(()=>import("./diff-DbItnlRl.js"),[]).then(n=>j(n.diff))}}),I.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return V(()=>import("./dockerfile-BuNIbK2j.js"),__vite__mapDeps([20,21])).then(n=>j(n.dockerFile))}}),I.of({name:"DTD",extensions:["dtd"],load(){return V(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>j(n.dtd))}}),I.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return V(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>j(n.dylan))}}),I.of({name:"EBNF",load(){return V(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>j(n.ebnf))}}),I.of({name:"ECL",extensions:["ecl"],load(){return V(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>j(n.ecl))}}),I.of({name:"edn",extensions:["edn"],load(){return V(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>j(n.clojure))}}),I.of({name:"Eiffel",extensions:["e"],load(){return V(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>j(n.eiffel))}}),I.of({name:"Elm",extensions:["elm"],load(){return V(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>j(n.elm))}}),I.of({name:"Erlang",extensions:["erl"],load(){return V(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>j(n.erlang))}}),I.of({name:"Esper",load(){return V(()=>import("./sql-C4g8LzGK.js"),[]).then(n=>j(n.esper))}}),I.of({name:"Factor",extensions:["factor"],load(){return V(()=>import("./factor-D8pE9siL.js"),__vite__mapDeps([22,21])).then(n=>j(n.factor))}}),I.of({name:"FCL",load(){return V(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>j(n.fcl))}}),I.of({name:"Forth",extensions:["forth","fth","4th"],load(){return V(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>j(n.forth))}}),I.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return V(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>j(n.fortran))}}),I.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.fSharp))}}),I.of({name:"Gas",extensions:["s"],load(){return V(()=>import("./gas-Bneqetm1.js"),[]).then(n=>j(n.gas))}}),I.of({name:"Gherkin",extensions:["feature"],load(){return V(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>j(n.gherkin))}}),I.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return V(()=>import("./groovy-DKLxxR9y.js"),[]).then(n=>j(n.groovy))}}),I.of({name:"Haskell",extensions:["hs"],load(){return V(()=>import("./haskell-BWDZoCOh.js"),[]).then(n=>j(n.haskell))}}),I.of({name:"Haxe",extensions:["hx"],load(){return V(()=>import("./haxe-pv4rovob.js"),[]).then(n=>j(n.haxe))}}),I.of({name:"HXML",extensions:["hxml"],load(){return V(()=>import("./haxe-pv4rovob.js"),[]).then(n=>j(n.hxml))}}),I.of({name:"HTTP",load(){return V(()=>import("./http-DBlCnlav.js"),[]).then(n=>j(n.http))}}),I.of({name:"IDL",extensions:["pro"],load(){return V(()=>import("./idl-BEugSyMb.js"),[]).then(n=>j(n.idl))}}),I.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return V(()=>import("./javascript-iSgyE4tI.js"),[]).then(n=>j(n.jsonld))}}),I.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return V(()=>import("./jinja2-C4DGRd-O.js"),[]).then(n=>j(n.jinja2))}}),I.of({name:"Julia",extensions:["jl"],load(){return V(()=>import("./julia-DuME0IfC.js"),[]).then(n=>j(n.julia))}}),I.of({name:"Kotlin",extensions:["kt","kts"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.kotlin))}}),I.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return V(()=>import("./livescript-k3uCVVjK.js"),[]).then(n=>j(n.liveScript))}}),I.of({name:"Lua",extensions:["lua"],load(){return V(()=>import("./lua-BgMRiT3U.js"),[]).then(n=>j(n.lua))}}),I.of({name:"mIRC",extensions:["mrc"],load(){return V(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>j(n.mirc))}}),I.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return V(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>j(n.mathematica))}}),I.of({name:"Modelica",extensions:["mo"],load(){return V(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>j(n.modelica))}}),I.of({name:"MUMPS",extensions:["mps"],load(){return V(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>j(n.mumps))}}),I.of({name:"Mbox",extensions:["mbox"],load(){return V(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>j(n.mbox))}}),I.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return V(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>j(n.nginx))}}),I.of({name:"NSIS",extensions:["nsh","nsi"],load(){return V(()=>import("./nsis-CEAdamBV.js"),__vite__mapDeps([23,21])).then(n=>j(n.nsis))}}),I.of({name:"NTriples",extensions:["nt","nq"],load(){return V(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>j(n.ntriples))}}),I.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.objectiveC))}}),I.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.objectiveCpp))}}),I.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.oCaml))}}),I.of({name:"Octave",extensions:["m"],load(){return V(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>j(n.octave))}}),I.of({name:"Oz",extensions:["oz"],load(){return V(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>j(n.oz))}}),I.of({name:"Pascal",extensions:["p","pas"],load(){return V(()=>import("./pascal-B1wCu0_E.js"),[]).then(n=>j(n.pascal))}}),I.of({name:"Perl",extensions:["pl","pm"],load(){return V(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>j(n.perl))}}),I.of({name:"Pig",extensions:["pig"],load(){return V(()=>import("./pig-CevX1Tat.js"),[]).then(n=>j(n.pig))}}),I.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return V(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>j(n.powerShell))}}),I.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return V(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>j(n.properties))}}),I.of({name:"ProtoBuf",extensions:["proto"],load(){return V(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>j(n.protobuf))}}),I.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return V(()=>import("./pug-BmUsPMDj.js"),__vite__mapDeps([24,25])).then(n=>j(n.pug))}}),I.of({name:"Puppet",extensions:["pp"],load(){return V(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>j(n.puppet))}}),I.of({name:"Q",extensions:["q"],load(){return V(()=>import("./q-ZnEupP5q.js"),[]).then(n=>j(n.q))}}),I.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return V(()=>import("./r-DUYO_cvP.js"),[]).then(n=>j(n.r))}}),I.of({name:"RPM Changes",load(){return V(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>j(n.rpmChanges))}}),I.of({name:"RPM Spec",extensions:["spec"],load(){return V(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>j(n.rpmSpec))}}),I.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return V(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>j(n.ruby))}}),I.of({name:"SAS",extensions:["sas"],load(){return V(()=>import("./sas-B4kiWyti.js"),[]).then(n=>j(n.sas))}}),I.of({name:"Scala",extensions:["scala"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.scala))}}),I.of({name:"Scheme",extensions:["scm","ss"],load(){return V(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>j(n.scheme))}}),I.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return V(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>j(n.shell))}}),I.of({name:"Sieve",extensions:["siv","sieve"],load(){return V(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>j(n.sieve))}}),I.of({name:"Smalltalk",extensions:["st"],load(){return V(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>j(n.smalltalk))}}),I.of({name:"Solr",load(){return V(()=>import("./solr-DehyRSwq.js"),[]).then(n=>j(n.solr))}}),I.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return V(()=>import("./mllike-C_8OmSiT.js"),[]).then(n=>j(n.sml))}}),I.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return V(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>j(n.sparql))}}),I.of({name:"Spreadsheet",alias:["excel","formula"],load(){return V(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>j(n.spreadsheet))}}),I.of({name:"Squirrel",extensions:["nut"],load(){return V(()=>import("./clike-DWq2Y8ae.js"),[]).then(n=>j(n.squirrel))}}),I.of({name:"Stylus",extensions:["styl"],load(){return V(()=>import("./stylus-BdAi1jBa.js"),[]).then(n=>j(n.stylus))}}),I.of({name:"Swift",extensions:["swift"],load(){return V(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>j(n.swift))}}),I.of({name:"sTeX",load(){return V(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>j(n.stex))}}),I.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return V(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>j(n.stex))}}),I.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return V(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>j(n.verilog))}}),I.of({name:"Tcl",extensions:["tcl"],load(){return V(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>j(n.tcl))}}),I.of({name:"Textile",extensions:["textile"],load(){return V(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>j(n.textile))}}),I.of({name:"TiddlyWiki",load(){return V(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>j(n.tiddlyWiki))}}),I.of({name:"Tiki wiki",load(){return V(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>j(n.tiki))}}),I.of({name:"TOML",extensions:["toml"],load(){return V(()=>import("./toml-BXUEaScT.js"),[]).then(n=>j(n.toml))}}),I.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return V(()=>import("./troff-wAsdV37c.js"),[]).then(n=>j(n.troff))}}),I.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return V(()=>import("./ttcn-CiGrtVSZ.js"),[]).then(n=>j(n.ttcn))}}),I.of({name:"TTCN_CFG",extensions:["cfg"],load(){return V(()=>import("./ttcn-cfg-BIkV9KBc.js"),[]).then(n=>j(n.ttcnCfg))}}),I.of({name:"Turtle",extensions:["ttl"],load(){return V(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>j(n.turtle))}}),I.of({name:"Web IDL",extensions:["webidl"],load(){return V(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>j(n.webIDL))}}),I.of({name:"VB.NET",extensions:["vb"],load(){return V(()=>import("./vb-CmGdzxic.js"),[]).then(n=>j(n.vb))}}),I.of({name:"VBScript",extensions:["vbs"],load(){return V(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>j(n.vbScript))}}),I.of({name:"Velocity",extensions:["vtl"],load(){return V(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>j(n.velocity))}}),I.of({name:"Verilog",extensions:["v"],load(){return V(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>j(n.verilog))}}),I.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return V(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>j(n.vhdl))}}),I.of({name:"XQuery",extensions:["xy","xquery"],load(){return V(()=>import("./xquery-WRlm2TX8.js"),[]).then(n=>j(n.xQuery))}}),I.of({name:"Yacas",extensions:["ys"],load(){return V(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>j(n.yacas))}}),I.of({name:"Z80",extensions:["z80"],load(){return V(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>j(n.z80))}}),I.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.mscgen))}}),I.of({name:"Xù",extensions:["xu"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.xu))}}),I.of({name:"MsGenny",extensions:["msgenny"],load(){return V(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>j(n.msgenny))}}),I.of({name:"Vue",extensions:["vue"],load(){return V(()=>import("./index-DMnbdnsj.js"),__vite__mapDeps([26,1,2,3,4,5,6])).then(n=>n.vue())}}),I.of({name:"Angular Template",load(){return V(()=>import("./index-CE1nPMQM.js"),__vite__mapDeps([27,1,2,3,4,5,6])).then(n=>n.angular())}})],uk="#2e3440",Yb="#3b4252",hk="#434c5e",Bu="#4c566a",fk="#e5e9f0",AO="#eceff4",gg="#8fbcbb",dk="#88c0d0",oG="#81a1c1",tr="#5e81ac",lG="#bf616a",lo="#d08770",mg="#ebcb8b",pk="#a3be8c",aG="#b48ead",gk="#d30102",Ub=AO,Og=Ub,cG="#ffffff",bg=Yb,uG=Ub,mk=Yb,hG=J.theme({"&":{color:uk,backgroundColor:cG},".cm-content":{caretColor:mk},".cm-cursor, .cm-dropCursor":{borderLeftColor:mk},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:uG},".cm-panels":{backgroundColor:Ub,color:Bu},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${Bu}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fk},".cm-activeLine":{backgroundColor:Og},".cm-selectionMatch":{backgroundColor:fk},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Bu}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:AO},".cm-gutters":{backgroundColor:AO,color:uk,border:"none"},".cm-activeLineGutter":{backgroundColor:Og},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:bg},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bg,borderBottomColor:bg},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Og,color:Bu}}},{dark:!1}),fG=Xc.define([{tag:E.keyword,color:tr},{tag:[E.name,E.deleted,E.character,E.propertyName,E.macroName],color:lo},{tag:[E.variableName],color:lo},{tag:[E.function(E.variableName)],color:tr},{tag:[E.labelName],color:oG},{tag:[E.color,E.constant(E.name),E.standard(E.name)],color:tr},{tag:[E.definition(E.name),E.separator],color:pk},{tag:[E.brace],color:gg},{tag:[E.annotation],color:gk},{tag:[E.number,E.changed,E.annotation,E.modifier,E.self,E.namespace],color:dk},{tag:[E.typeName,E.className],color:mg},{tag:[E.operator,E.operatorKeyword],color:pk},{tag:[E.tagName],color:aG},{tag:[E.squareBracket],color:lG},{tag:[E.angleBracket],color:lo},{tag:[E.attributeName],color:mg},{tag:[E.regexp],color:tr},{tag:[E.quote],color:Yb},{tag:[E.string],color:lo},{tag:E.link,color:gg,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[E.url,E.escape,E.special(E.string)],color:lo},{tag:[E.meta],color:dk},{tag:[E.comment],color:hk,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold",color:tr},{tag:E.emphasis,fontStyle:"italic",color:tr},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.heading,fontWeight:"bold",color:tr},{tag:E.special(E.heading1),fontWeight:"bold",color:tr},{tag:E.heading1,fontWeight:"bold",color:tr},{tag:[E.heading2,E.heading3,E.heading4],fontWeight:"bold",color:tr},{tag:[E.heading5,E.heading6],color:tr},{tag:[E.atom,E.bool,E.special(E.variableName)],color:lo},{tag:[E.processingInstruction,E.inserted],color:gg},{tag:[E.contentSeparator],color:mg},{tag:E.invalid,color:hk,borderBottom:`1px dotted ${gk}`}]),UA=[hG,a$(fG)];function Je(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;en.normalize("NFKD"):n=>n;class Jo{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?l=>s(Ok(l)):Ok,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return jt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ob(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=zn(e);let i=this.normalize(t);for(let s=0,o=r;;s++){let l=i.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(a)return this.value=a,this;break}o==r&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Af(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=t){let l=new Ro(t,e.sliceString(t,r));return xg.set(e,l),l}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Af(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ro.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(JA.prototype[Symbol.iterator]=e9.prototype[Symbol.iterator]=function(){return this});function dG(n){try{return new RegExp(n,Gb),!0}catch{return!1}}function Af(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function QO(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Je("input",{class:"cm-textfield",name:"line",value:e}),r=Je("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Qf.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},Je("label",n.state.phrase("Go to line"),": ",t)," ",Je("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,c,u,h]=s,f=u?+u.slice(1):0,d=c?+c:l.number;if(c&&h){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=F.cursor(p.from+Math.max(0,Math.min(f,p.length)));n.dispatch({effects:[Qf.of(!1),J.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:r}}const Qf=Se.define(),bk=vt.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Qf)&&(n=t.value);return n},provide:n=>Xa.from(n,e=>e?QO:null)}),pG=n=>{let e=ja(n,QO);if(!e){let t=[Qf.of(!0)];n.state.field(bk,!1)==null&&t.push(Se.appendConfig.of([bk,gG])),n.dispatch({effects:t}),e=ja(n,QO)}return e&&e.dom.querySelector("input").select(),!0},gG=J.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),mG={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},OG=fe.define({combine(n){return Jr(n,mG,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function bG(n){return[SG,wG]}const xG=Oe.mark({class:"cm-selectionMatch"}),yG=Oe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function xk(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=ut.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=ut.Word)}function vG(n,e,t,r){return n(e.sliceDoc(t,t+1))==ut.Word&&n(e.sliceDoc(r-1,r))==ut.Word}const wG=xt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(OG),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Oe.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Oe.none;let a=t.wordAt(i.head);if(!a)return Oe.none;o=t.charCategorizer(i.head),s=t.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a200)return Oe.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(xk(o,t,i.from,i.to)&&vG(o,t,i.from,i.to)))return Oe.none}else if(s=t.sliceDoc(i.from,i.to),!s)return Oe.none}let l=[];for(let a of n.visibleRanges){let c=new Jo(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||xk(o,t,u,h))&&(i.empty&&u<=i.from&&h>=i.to?l.push(yG.range(u,h)):(u>=i.to||h<=i.from)&&l.push(xG.range(u,h)),l.length>e.maxMatches))return Oe.none}}return Oe.set(l)}},{decorations:n=>n.decorations}),SG=J.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),kG=({state:n,dispatch:e})=>{let{selection:t}=n,r=F.create(t.ranges.map(i=>n.wordAt(i.head)||F.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function CG(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,l=new Jo(n.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Jo(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(a=>a.from==l.value.from))continue;if(s){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const _G=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return kG({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=CG(n,r);return i?(e(n.update({selection:n.selection.addRange(F.range(i.from,i.to),!1),effects:J.scrollIntoView(i.to)})),!0):!1},Sl=fe.define({combine(n){return Jr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new NG(e),scrollToMatch:e=>J.scrollIntoView(e)})}});class t9{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||dG(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?` `:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new $G(this):new TG(this)}getCursor(e,t=0,r){let i=e.doc?e:Ae.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?po(this,i,t,r):fo(this,i,t,r)}}class n9{constructor(e){this.spec=e}}function fo(n,e,t,r){return new Jo(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?PG(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function PG(n,e){return(t,r,i,s)=>((s>t||s+i.length=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=fo(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function po(n,e,t,r){return new JA(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?EG(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function Rf(n,e){return n.slice(Yt(n,e,!1),e)}function Mf(n,e){return n.slice(e,Yt(n,e))}function EG(n){return(e,t,r)=>!r[0].length||(n(Rf(r.input,r.index))!=ut.Word||n(Mf(r.input,r.index))!=ut.Word)&&(n(Mf(r.input,r.index+r[0].length))!=ut.Word||n(Rf(r.input,r.index+r[0].length))!=ut.Word)}class $G extends n9{nextMatch(e,t,r){let i=po(this.spec,e,r,e.doc.length).next();return i.done&&(i=po(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=po(this.spec,e,s,r),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=po(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const nc=Se.define(),Kb=Se.define(),Ui=vt.define({create(n){return new yg(RO(n).create(),null)},update(n,e){for(let t of e.effects)t.is(nc)?n=new yg(t.value.create(),n.panel):t.is(Kb)&&(n=new yg(n.query,t.value?Jb:null));return n},provide:n=>Xa.from(n,e=>e.panel)});class yg{constructor(e,t){this.query=e,this.panel=t}}const AG=Oe.mark({class:"cm-searchMatch"}),QG=Oe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),RG=xt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Ui))}update(n){let e=n.state.field(Ui);(e!=n.startState.field(Ui)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Oe.none;let{view:t}=this,r=new Dn;for(let i=0,s=t.visibleRanges,o=s.length;is[i+1].from-2*250;)a=s[++i].to;n.highlight(t.state,l,a,(c,u)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==u);r.add(c,u,h?QG:AG)})}return r.finish()}},{decorations:n=>n.decorations});function Hc(n){return e=>{let t=e.state.field(Ui,!1);return t&&t.query.spec.valid?n(e,t):s9(e)}}const Lf=Hc((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=F.single(r.from,r.to),s=n.state.facet(Sl);return n.dispatch({selection:i,effects:[ex(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),i9(n),!0}),If=Hc((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=F.single(i.from,i.to),o=n.state.facet(Sl);return n.dispatch({selection:s,effects:[ex(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),i9(n),!0}),MG=Hc((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:F.create(t.map(r=>F.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),LG=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let l=new Jo(n.doc,n.sliceDoc(r,i));!l.next().done;){if(s.length>1e3)return!1;l.value.from==r&&(o=s.length),s.push(F.range(l.value.from,l.value.to))}return e(n.update({selection:F.create(s,o),userEvent:"select.search.matches"})),!0},yk=Hc((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=[],l,a,c=[];if(s.from==r&&s.to==i&&(a=t.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:a}),s=e.nextMatch(t,s.from,s.to),c.push(J.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),s){let u=o.length==0||o[0].from>=s.to?0:s.to-s.from-a.length;l=F.single(s.from-u,s.to-u),c.push(ex(n,s)),c.push(t.facet(Sl).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:c,userEvent:"input.replace"}),!0}),IG=Hc((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:J.announce.of(r),userEvent:"input.replace.all"}),!0});function Jb(n){return n.state.facet(Sl).createPanel(n)}function RO(n,e){var t,r,i,s,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=n.facet(Sl);return new t9({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function r9(n){let e=ja(n,Jb);return e&&e.dom.querySelector("[main-field]")}function i9(n){let e=r9(n);e&&e==n.root.activeElement&&e.select()}const s9=n=>{let e=n.state.field(Ui,!1);if(e&&e.panel){let t=r9(n);if(t&&t!=n.root.activeElement){let r=RO(n.state,e.query.spec);r.valid&&n.dispatch({effects:nc.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[Kb.of(!0),e?nc.of(RO(n.state,e.query.spec)):Se.appendConfig.of(ZG)]});return!0},o9=n=>{let e=n.state.field(Ui,!1);if(!e||!e.panel)return!1;let t=ja(n,Jb);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Kb.of(!1)}),!0},DG=[{key:"Mod-f",run:s9,scope:"editor search-panel"},{key:"F3",run:Lf,shift:If,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Lf,shift:If,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:o9,scope:"editor search-panel"},{key:"Mod-Shift-l",run:LG},{key:"Mod-Alt-g",run:pG},{key:"Mod-d",run:_G,preventDefault:!0}];class NG{constructor(e){this.view=e;let t=this.query=e.state.field(Ui).query.spec;this.commit=this.commit.bind(this),this.searchField=Je("input",{value:t.search,placeholder:Pn(e,"Find"),"aria-label":Pn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Je("input",{value:t.replace,placeholder:Pn(e,"Replace"),"aria-label":Pn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Je("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Je("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Je("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return Je("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=Je("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Lf(e),[Pn(e,"next")]),r("prev",()=>If(e),[Pn(e,"previous")]),r("select",()=>MG(e),[Pn(e,"all")]),Je("label",null,[this.caseField,Pn(e,"match case")]),Je("label",null,[this.reField,Pn(e,"regexp")]),Je("label",null,[this.wordField,Pn(e,"by word")]),...e.state.readOnly?[]:[Je("br"),this.replaceField,r("replace",()=>yk(e),[Pn(e,"replace")]),r("replaceAll",()=>IG(e),[Pn(e,"replace all")])],Je("button",{name:"close",onclick:()=>o9(e),"aria-label":Pn(e,"close"),type:"button"},["×"])])}commit(){let e=new t9({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:nc.of(e)}))}keydown(e){Pj(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?If:Lf)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),yk(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(nc)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Sl).top}}function Pn(n,e){return n.state.phrase(e)}const Fu=30,zu=/[\s\.,:;?!]/;function ex(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-Fu),o=Math.min(i,t+Fu),l=n.state.sliceDoc(s,o);if(s!=r.from){for(let a=0;al.length-Fu;a--)if(!zu.test(l[a-1])&&zu.test(l[a])){l=l.slice(0,a);break}}return J.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${r.number}.`)}const VG=J.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ZG=[Ui,wr.low(RG),VG];class BG{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class Cs{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=e,s=r.facet(rc).markerFilter;s&&(i=s(i,r));let o=Oe.set(i.map(l=>l.from==l.to||l.from==l.to-1&&r.doc.lineAt(l.from).to==l.from?Oe.widget({widget:new UG(l),diagnostic:l}).range(l.from):Oe.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new Cs(o,t,el(o))}}function el(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostic!=e))return r=new BG(i,s,o.diagnostic),!1}),r}function FG(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(rc).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(l9))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function zG(n,e){return n.field(Mn,!1)?e:e.concat(Se.appendConfig.of(JG))}const l9=Se.define(),tx=Se.define(),a9=Se.define(),Mn=vt.define({create(){return new Cs(Oe.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=el(t,n.selected.diagnostic,s)||el(t,null,s)}!t.size&&i&&e.state.facet(rc).autoPanel&&(i=null),n=new Cs(t,i,r)}for(let t of e.effects)if(t.is(l9)){let r=e.state.facet(rc).autoPanel?t.value.length?ic.open:null:n.panel;n=Cs.init(t.value,r,e.state)}else t.is(tx)?n=new Cs(n.diagnostics,t.value?ic.open:null,n.selected):t.is(a9)&&(n=new Cs(n.diagnostics,n.panel,t.value));return n},provide:n=>[Xa.from(n,e=>e.panel),J.decorations.from(n,e=>e.diagnostics)]}),jG=Oe.mark({class:"cm-lintRange cm-lintRange-active"});function XG(n,e,t){let{diagnostics:r}=n.state.field(Mn),i=[],s=2e8,o=0;r.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:u})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(eu9(n,t,!1)))}const WG=n=>{let e=n.state.field(Mn,!1);(!e||!e.panel)&&n.dispatch({effects:zG(n.state,[tx.of(!0)])});let t=ja(n,ic.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},vk=n=>{let e=n.state.field(Mn,!1);return!e||!e.panel?!1:(n.dispatch({effects:tx.of(!1)}),!0)},HG=n=>{let e=n.state.field(Mn,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},YG=[{key:"Mod-Shift-m",run:WG,preventDefault:!0},{key:"F8",run:HG}],rc=fe.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},Jr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function c9(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;rs.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function u9(n,e,t){var r;let i=t?c9(e.actions):[];return Je("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Je("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let l=!1,a=f=>{if(f.preventDefault(),l)return;l=!0;let d=el(n.state.field(Mn).diagnostics,e);d&&s.apply(n,d.from,d.to)},{name:c}=s,u=i[o]?c.indexOf(i[o]):-1,h=u<0?c:[c.slice(0,u),Je("u",c.slice(u,u+1)),c.slice(u+1)];return Je("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&Je("div",{class:"cm-diagnosticSource"},e.source))}class UG extends Sr{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Je("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class wk{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=u9(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ic{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)vk(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=c9(s.actions);for(let l=0;l{for(let s=0;svk(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Mn).selected;if(!e)return-1;for(let t=0;t{let c=-1,u;for(let h=r;hr&&(this.items.splice(r,c-r),i=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),s=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let a=l.height/this.list.offsetHeight;o.topl.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Mn),r=el(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:a9.of(r)})}static open(e){return new ic(e)}}function GG(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function ju(n){return GG(``,'width="6" height="3"')}const KG=J.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:ju("#d11")},".cm-lintRange-warning":{backgroundImage:ju("orange")},".cm-lintRange-info":{backgroundImage:ju("#999")},".cm-lintRange-hint":{backgroundImage:ju("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),JG=[Mn,J.decorations.compute([Mn],n=>{let{selected:e,panel:t}=n.field(Mn);return!e||!t||e.from==e.to?Oe.none:Oe.set([jG.range(e.from,e.to)])}),dX(XG,{hideOn:FG}),KG],h9=[yb(),CX(),jj(),FW(),mq(),Rj(),Nj(),Ae.allowMultipleSelections.of(!0),iq(),a$(yq,{fallback:!0}),Pq(),yW(),AW(),nX(),sX(),Uj(),bG(),Zc.of([...kW,...jH,...DG,...GW,...fq,...$$,...YG])];function Sk(n,[e,t]){return Math.min(t,Math.max(e,n))}function eK(n){const e=k.useRef({value:n,previous:n});return k.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var tK="VisuallyHidden",nx=k.forwardRef((n,e)=>R.jsx(Me.span,{...n,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...n.style}}));nx.displayName=tK;var nK=nx,rK=[" ","Enter","ArrowUp","ArrowDown"],iK=[" ","Enter"],Yc="Select",[Hd,Yd,sK]=P5(Yc),[kl,Ote]=Od(Yc,[sK,pl]),Ud=pl(),[oK,Os]=kl(Yc),[lK,aK]=kl(Yc),f9=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:l,onValueChange:a,dir:c,name:u,autoComplete:h,disabled:f,required:d,form:p}=n,g=Ud(e),[m,b]=k.useState(null),[O,x]=k.useState(null),[y,v]=k.useState(!1),C=_d(c),[S=!1,_]=yi({prop:r,defaultProp:i,onChange:s}),[P,T]=yi({prop:o,defaultProp:l,onChange:a}),M=k.useRef(null),Q=m?p||!!m.closest("form"):!0,[D,N]=k.useState(new Set),Z=Array.from(D).map(H=>H.props.value).join(";");return R.jsx(p0,{...g,children:R.jsxs(oK,{required:d,scope:e,trigger:m,onTriggerChange:b,valueNode:O,onValueNodeChange:x,valueNodeHasChildren:y,onValueNodeHasChildrenChange:v,contentId:di(),value:P,onValueChange:T,open:S,onOpenChange:_,dir:C,triggerPointerDownPosRef:M,disabled:f,children:[R.jsx(Hd.Provider,{scope:e,children:R.jsx(lK,{scope:n.__scopeSelect,onNativeOptionAdd:k.useCallback(H=>{N(X=>new Set(X).add(H))},[]),onNativeOptionRemove:k.useCallback(H=>{N(X=>{const Y=new Set(X);return Y.delete(H),Y})},[]),children:t})}),Q?R.jsxs(R9,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:h,value:P,onChange:H=>T(H.target.value),disabled:f,form:p,children:[P===void 0?R.jsx("option",{value:""}):null,Array.from(D)]},Z):null]})})};f9.displayName=Yc;var d9="SelectTrigger",p9=k.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...i}=n,s=Ud(t),o=Os(d9,t),l=o.disabled||r,a=tt(e,o.onTriggerChange),c=Yd(t),u=k.useRef("touch"),[h,f,d]=M9(g=>{const m=c().filter(x=>!x.disabled),b=m.find(x=>x.value===o.value),O=L9(m,g,b);O!==void 0&&o.onValueChange(O.value)}),p=g=>{l||(o.onOpenChange(!0),d()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return R.jsx(wd,{asChild:!0,...s,children:R.jsx(Me.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Q9(o.value)?"":void 0,...i,ref:a,onClick:Pe(i.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&p(g)}),onPointerDown:Pe(i.onPointerDown,g=>{u.current=g.pointerType;const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(p(g),g.preventDefault())}),onKeyDown:Pe(i.onKeyDown,g=>{const m=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(m&&g.key===" ")&&rK.includes(g.key)&&(p(),g.preventDefault())})})})});p9.displayName=d9;var g9="SelectValue",m9=k.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,children:s,placeholder:o="",...l}=n,a=Os(g9,t),{onValueNodeHasChildrenChange:c}=a,u=s!==void 0,h=tt(e,a.onValueNodeChange);return hn(()=>{c(u)},[c,u]),R.jsx(Me.span,{...l,ref:h,style:{pointerEvents:"none"},children:Q9(a.value)?R.jsx(R.Fragment,{children:o}):s})});m9.displayName=g9;var cK="SelectIcon",O9=k.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...i}=n;return R.jsx(Me.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});O9.displayName=cK;var uK="SelectPortal",b9=n=>R.jsx(kc,{asChild:!0,...n});b9.displayName=uK;var Hs="SelectContent",x9=k.forwardRef((n,e)=>{const t=Os(Hs,n.__scopeSelect),[r,i]=k.useState();if(hn(()=>{i(new DocumentFragment)},[]),!t.open){const s=r;return s?Lo.createPortal(R.jsx(y9,{scope:n.__scopeSelect,children:R.jsx(Hd.Slot,{scope:n.__scopeSelect,children:R.jsx("div",{children:n.children})})}),s):null}return R.jsx(v9,{...n,ref:e})});x9.displayName=Hs;var ir=10,[y9,bs]=kl(Hs),hK="SelectContentImpl",v9=k.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:l,sideOffset:a,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:p,hideWhenDetached:g,avoidCollisions:m,...b}=n,O=Os(Hs,t),[x,y]=k.useState(null),[v,C]=k.useState(null),S=tt(e,q=>y(q)),[_,P]=k.useState(null),[T,M]=k.useState(null),Q=Yd(t),[D,N]=k.useState(!1),Z=k.useRef(!1);k.useEffect(()=>{if(x)return O0(x)},[x]),s0();const H=k.useCallback(q=>{const[K,...he]=Q().map(Ce=>Ce.ref.current),[de]=he.slice(-1),ve=document.activeElement;for(const Ce of q)if(Ce===ve||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===K&&v&&(v.scrollTop=0),Ce===de&&v&&(v.scrollTop=v.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==ve))return},[Q,v]),X=k.useCallback(()=>H([_,x]),[H,_,x]);k.useEffect(()=>{D&&X()},[D,X]);const{onOpenChange:Y,triggerPointerDownPosRef:ne}=O;k.useEffect(()=>{if(x){let q={x:0,y:0};const K=de=>{var ve,Ce;q={x:Math.abs(Math.round(de.pageX)-(((ve=ne.current)==null?void 0:ve.x)??0)),y:Math.abs(Math.round(de.pageY)-(((Ce=ne.current)==null?void 0:Ce.y)??0))}},he=de=>{q.x<=10&&q.y<=10?de.preventDefault():x.contains(de.target)||Y(!1),document.removeEventListener("pointermove",K),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",K),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",he,{capture:!0})}}},[x,Y,ne]),k.useEffect(()=>{const q=()=>Y(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[Y]);const[pe,ye]=M9(q=>{const K=Q().filter(ve=>!ve.disabled),he=K.find(ve=>ve.ref.current===document.activeElement),de=L9(K,q,he);de&&setTimeout(()=>de.ref.current.focus())}),we=k.useCallback((q,K,he)=>{const de=!Z.current&&!he;(O.value!==void 0&&O.value===K||de)&&(P(q),de&&(Z.current=!0))},[O.value]),De=k.useCallback(()=>x==null?void 0:x.focus(),[x]),Ee=k.useCallback((q,K,he)=>{const de=!Z.current&&!he;(O.value!==void 0&&O.value===K||de)&&M(q)},[O.value]),Le=r==="popper"?MO:w9,Qe=Le===MO?{side:l,sideOffset:a,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:p,hideWhenDetached:g,avoidCollisions:m}:{};return R.jsx(y9,{scope:t,content:x,viewport:v,onViewportChange:C,itemRefCallback:we,selectedItem:_,onItemLeave:De,itemTextRefCallback:Ee,focusSelectedItem:X,selectedItemText:T,position:r,isPositioned:D,searchRef:pe,children:R.jsx(kd,{as:Ns,allowPinchZoom:!0,children:R.jsx(bd,{asChild:!0,trapped:O.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Pe(i,q=>{var K;(K=O.trigger)==null||K.focus({preventScroll:!0}),q.preventDefault()}),children:R.jsx(wc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:R.jsx(Le,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:q=>q.preventDefault(),...b,...Qe,onPlaced:()=>N(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Pe(b.onKeyDown,q=>{const K=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!K&&q.key.length===1&&ye(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let de=Q().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(q.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const ve=q.target,Ce=de.indexOf(ve);de=de.slice(Ce+1)}setTimeout(()=>H(de)),q.preventDefault()}})})})})})})});v9.displayName=hK;var fK="SelectItemAlignedPosition",w9=k.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...i}=n,s=Os(Hs,t),o=bs(Hs,t),[l,a]=k.useState(null),[c,u]=k.useState(null),h=tt(e,S=>u(S)),f=Yd(t),d=k.useRef(!1),p=k.useRef(!0),{viewport:g,selectedItem:m,selectedItemText:b,focusSelectedItem:O}=o,x=k.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&c&&g&&m&&b){const S=s.trigger.getBoundingClientRect(),_=c.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),T=b.getBoundingClientRect();if(s.dir!=="rtl"){const ve=T.left-_.left,Ce=P.left-ve,Ne=S.left-Ce,He=S.width+Ne,Rt=Math.max(He,_.width),Mt=window.innerWidth-ir,Vt=Sk(Ce,[ir,Math.max(ir,Mt-Rt)]);l.style.minWidth=He+"px",l.style.left=Vt+"px"}else{const ve=_.right-T.right,Ce=window.innerWidth-P.right-ve,Ne=window.innerWidth-S.right-Ce,He=S.width+Ne,Rt=Math.max(He,_.width),Mt=window.innerWidth-ir,Vt=Sk(Ce,[ir,Math.max(ir,Mt-Rt)]);l.style.minWidth=He+"px",l.style.right=Vt+"px"}const M=f(),Q=window.innerHeight-ir*2,D=g.scrollHeight,N=window.getComputedStyle(c),Z=parseInt(N.borderTopWidth,10),H=parseInt(N.paddingTop,10),X=parseInt(N.borderBottomWidth,10),Y=parseInt(N.paddingBottom,10),ne=Z+H+D+Y+X,pe=Math.min(m.offsetHeight*5,ne),ye=window.getComputedStyle(g),we=parseInt(ye.paddingTop,10),De=parseInt(ye.paddingBottom,10),Ee=S.top+S.height/2-ir,Le=Q-Ee,Qe=m.offsetHeight/2,q=m.offsetTop+Qe,K=Z+H+q,he=ne-K;if(K<=Ee){const ve=M.length>0&&m===M[M.length-1].ref.current;l.style.bottom="0px";const Ce=c.clientHeight-g.offsetTop-g.offsetHeight,Ne=Math.max(Le,Qe+(ve?De:0)+Ce+X),He=K+Ne;l.style.height=He+"px"}else{const ve=M.length>0&&m===M[0].ref.current;l.style.top="0px";const Ne=Math.max(Ee,Z+g.offsetTop+(ve?we:0)+Qe)+he;l.style.height=Ne+"px",g.scrollTop=K-Ee+g.offsetTop}l.style.margin=`${ir}px 0`,l.style.minHeight=pe+"px",l.style.maxHeight=Q+"px",r==null||r(),requestAnimationFrame(()=>d.current=!0)}},[f,s.trigger,s.valueNode,l,c,g,m,b,s.dir,r]);hn(()=>x(),[x]);const[y,v]=k.useState();hn(()=>{c&&v(window.getComputedStyle(c).zIndex)},[c]);const C=k.useCallback(S=>{S&&p.current===!0&&(x(),O==null||O(),p.current=!1)},[x,O]);return R.jsx(pK,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:d,onScrollButtonChange:C,children:R.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:R.jsx(Me.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});w9.displayName=fK;var dK="SelectPopperPosition",MO=k.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:i=ir,...s}=n,o=Ud(t);return R.jsx(g0,{...o,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});MO.displayName=dK;var[pK,rx]=kl(Hs,{}),LO="SelectViewport",S9=k.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:r,...i}=n,s=bs(LO,t),o=rx(LO,t),l=tt(e,s.onViewportChange),a=k.useRef(0);return R.jsxs(R.Fragment,{children:[R.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),R.jsx(Hd.Slot,{scope:t,children:R.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Pe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const d=Math.abs(a.current-u.scrollTop);if(d>0){const p=window.innerHeight-ir*2,g=parseFloat(h.style.minHeight),m=parseFloat(h.style.height),b=Math.max(g,m);if(b0?y:0,h.style.justifyContent="flex-end")}}}a.current=u.scrollTop})})})]})});S9.displayName=LO;var k9="SelectGroup",[gK,mK]=kl(k9),OK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=di();return R.jsx(gK,{scope:t,id:i,children:R.jsx(Me.div,{role:"group","aria-labelledby":i,...r,ref:e})})});OK.displayName=k9;var C9="SelectLabel",bK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=mK(C9,t);return R.jsx(Me.div,{id:i.id,...r,ref:e})});bK.displayName=C9;var Df="SelectItem",[xK,_9]=kl(Df),P9=k.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:i=!1,textValue:s,...o}=n,l=Os(Df,t),a=bs(Df,t),c=l.value===r,[u,h]=k.useState(s??""),[f,d]=k.useState(!1),p=tt(e,O=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,O,r,i)}),g=di(),m=k.useRef("touch"),b=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return R.jsx(xK,{scope:t,value:r,disabled:i,textId:g,isSelected:c,onItemTextChange:k.useCallback(O=>{h(x=>x||((O==null?void 0:O.textContent)??"").trim())},[]),children:R.jsx(Hd.ItemSlot,{scope:t,value:r,disabled:i,textValue:u,children:R.jsx(Me.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:p,onFocus:Pe(o.onFocus,()=>d(!0)),onBlur:Pe(o.onBlur,()=>d(!1)),onClick:Pe(o.onClick,()=>{m.current!=="mouse"&&b()}),onPointerUp:Pe(o.onPointerUp,()=>{m.current==="mouse"&&b()}),onPointerDown:Pe(o.onPointerDown,O=>{m.current=O.pointerType}),onPointerMove:Pe(o.onPointerMove,O=>{var x;m.current=O.pointerType,i?(x=a.onItemLeave)==null||x.call(a):m.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(o.onPointerLeave,O=>{var x;O.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:Pe(o.onKeyDown,O=>{var y;((y=a.searchRef)==null?void 0:y.current)!==""&&O.key===" "||(iK.includes(O.key)&&b(),O.key===" "&&O.preventDefault())})})})})});P9.displayName=Df;var Jl="SelectItemText",T9=k.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,...s}=n,o=Os(Jl,t),l=bs(Jl,t),a=_9(Jl,t),c=aK(Jl,t),[u,h]=k.useState(null),f=tt(e,b=>h(b),a.onItemTextChange,b=>{var O;return(O=l.itemTextRefCallback)==null?void 0:O.call(l,b,a.value,a.disabled)}),d=u==null?void 0:u.textContent,p=k.useMemo(()=>R.jsx("option",{value:a.value,disabled:a.disabled,children:d},a.value),[a.disabled,a.value,d]),{onNativeOptionAdd:g,onNativeOptionRemove:m}=c;return hn(()=>(g(p),()=>m(p)),[g,m,p]),R.jsxs(R.Fragment,{children:[R.jsx(Me.span,{id:a.textId,...s,ref:f}),a.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Lo.createPortal(s.children,o.valueNode):null]})});T9.displayName=Jl;var E9="SelectItemIndicator",yK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return _9(E9,t).isSelected?R.jsx(Me.span,{"aria-hidden":!0,...r,ref:e}):null});yK.displayName=E9;var IO="SelectScrollUpButton",vK=k.forwardRef((n,e)=>{const t=bs(IO,n.__scopeSelect),r=rx(IO,n.__scopeSelect),[i,s]=k.useState(!1),o=tt(e,r.onScrollButtonChange);return hn(()=>{if(t.viewport&&t.isPositioned){let l=function(){const c=a.scrollTop>0;s(c)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),i?R.jsx($9,{...n,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});vK.displayName=IO;var DO="SelectScrollDownButton",wK=k.forwardRef((n,e)=>{const t=bs(DO,n.__scopeSelect),r=rx(DO,n.__scopeSelect),[i,s]=k.useState(!1),o=tt(e,r.onScrollButtonChange);return hn(()=>{if(t.viewport&&t.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),i?R.jsx($9,{...n,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});wK.displayName=DO;var $9=k.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:r,...i}=n,s=bs("SelectScrollButton",t),o=k.useRef(null),l=Yd(t),a=k.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return k.useEffect(()=>()=>a(),[a]),hn(()=>{var u;const c=l().find(h=>h.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),R.jsx(Me.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Pe(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Pe(i.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Pe(i.onPointerLeave,()=>{a()})})}),SK="SelectSeparator",A9=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return R.jsx(Me.div,{"aria-hidden":!0,...r,ref:e})});A9.displayName=SK;var NO="SelectArrow",kK=k.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=Ud(t),s=Os(NO,t),o=bs(NO,t);return s.open&&o.position==="popper"?R.jsx(m0,{...i,...r,ref:e}):null});kK.displayName=NO;function Q9(n){return n===""||n===void 0}var R9=k.forwardRef((n,e)=>{const{value:t,...r}=n,i=k.useRef(null),s=tt(e,i),o=eK(t);return k.useEffect(()=>{const l=i.current,a=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(a,"value").set;if(o!==t&&u){const h=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(h)}},[o,t]),R.jsx(nx,{asChild:!0,children:R.jsx("select",{...r,ref:s,defaultValue:t})})});R9.displayName="BubbleSelect";function M9(n){const e=Hr(n),t=k.useRef(""),r=k.useRef(0),i=k.useCallback(o=>{const l=t.current+o;e(l),function a(c){t.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(l)},[e]),s=k.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,i,s]}function L9(n,e,t){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let o=CK(n,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==t));const a=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==t?a:void 0}function CK(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var _K=f9,PK=p9,TK=m9,EK=O9,$K=b9,AK=x9,QK=S9,RK=P9,MK=T9,LK=A9,[Gd,bte]=Od("Tooltip",[pl]),Kd=pl(),I9="TooltipProvider",IK=700,VO="tooltip.open",[DK,ix]=Gd(I9),D9=n=>{const{__scopeTooltip:e,delayDuration:t=IK,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=n,[o,l]=k.useState(!0),a=k.useRef(!1),c=k.useRef(0);return k.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),R.jsx(DK,{scope:e,isOpenDelayed:o,delayDuration:t,onOpen:k.useCallback(()=>{window.clearTimeout(c.current),l(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:k.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:s})};D9.displayName=I9;var Jd="Tooltip",[NK,Uc]=Gd(Jd),N9=n=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=n,a=ix(Jd,n.__scopeTooltip),c=Kd(e),[u,h]=k.useState(null),f=di(),d=k.useRef(0),p=o??a.disableHoverableContent,g=l??a.delayDuration,m=k.useRef(!1),[b=!1,O]=yi({prop:r,defaultProp:i,onChange:S=>{S?(a.onOpen(),document.dispatchEvent(new CustomEvent(VO))):a.onClose(),s==null||s(S)}}),x=k.useMemo(()=>b?m.current?"delayed-open":"instant-open":"closed",[b]),y=k.useCallback(()=>{window.clearTimeout(d.current),m.current=!1,O(!0)},[O]),v=k.useCallback(()=>{window.clearTimeout(d.current),O(!1)},[O]),C=k.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{m.current=!0,O(!0)},g)},[g,O]);return k.useEffect(()=>()=>window.clearTimeout(d.current),[]),R.jsx(p0,{...c,children:R.jsx(NK,{scope:e,contentId:f,open:b,stateAttribute:x,trigger:u,onTriggerChange:h,onTriggerEnter:k.useCallback(()=>{a.isOpenDelayed?C():y()},[a.isOpenDelayed,C,y]),onTriggerLeave:k.useCallback(()=>{p?v():window.clearTimeout(d.current)},[v,p]),onOpen:y,onClose:v,disableHoverableContent:p,children:t})})};N9.displayName=Jd;var ZO="TooltipTrigger",V9=k.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=Uc(ZO,t),s=ix(ZO,t),o=Kd(t),l=k.useRef(null),a=tt(e,l,i.onTriggerChange),c=k.useRef(!1),u=k.useRef(!1),h=k.useCallback(()=>c.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),R.jsx(wd,{asChild:!0,...o,children:R.jsx(Me.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:a,onPointerMove:Pe(n.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Pe(n.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Pe(n.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Pe(n.onFocus,()=>{c.current||i.onOpen()}),onBlur:Pe(n.onBlur,i.onClose),onClick:Pe(n.onClick,i.onClose)})})});V9.displayName=ZO;var sx="TooltipPortal",[VK,ZK]=Gd(sx,{forceMount:void 0}),Z9=n=>{const{__scopeTooltip:e,forceMount:t,children:r,container:i}=n,s=Uc(sx,e);return R.jsx(VK,{scope:e,forceMount:t,children:R.jsx(ps,{present:t||s.open,children:R.jsx(kc,{asChild:!0,container:i,children:r})})})};Z9.displayName=sx;var tl="TooltipContent",B9=k.forwardRef((n,e)=>{const t=ZK(tl,n.__scopeTooltip),{forceMount:r=t.forceMount,side:i="top",...s}=n,o=Uc(tl,n.__scopeTooltip);return R.jsx(ps,{present:r||o.open,children:o.disableHoverableContent?R.jsx(F9,{side:i,...s,ref:e}):R.jsx(BK,{side:i,...s,ref:e})})}),BK=k.forwardRef((n,e)=>{const t=Uc(tl,n.__scopeTooltip),r=ix(tl,n.__scopeTooltip),i=k.useRef(null),s=tt(e,i),[o,l]=k.useState(null),{trigger:a,onClose:c}=t,u=i.current,{onPointerInTransitChange:h}=r,f=k.useCallback(()=>{l(null),h(!1)},[h]),d=k.useCallback((p,g)=>{const m=p.currentTarget,b={x:p.clientX,y:p.clientY},O=jK(b,m.getBoundingClientRect()),x=XK(b,O),y=qK(g.getBoundingClientRect()),v=HK([...x,...y]);l(v),h(!0)},[h]);return k.useEffect(()=>()=>f(),[f]),k.useEffect(()=>{if(a&&u){const p=m=>d(m,u),g=m=>d(m,a);return a.addEventListener("pointerleave",p),u.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",g)}}},[a,u,d,f]),k.useEffect(()=>{if(o){const p=g=>{const m=g.target,b={x:g.clientX,y:g.clientY},O=(a==null?void 0:a.contains(m))||(u==null?void 0:u.contains(m)),x=!WK(b,o);O?f():x&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[a,u,o,c,f]),R.jsx(F9,{...n,ref:s})}),[FK,zK]=Gd(Jd,{isInside:!1}),F9=k.forwardRef((n,e)=>{const{__scopeTooltip:t,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...l}=n,a=Uc(tl,t),c=Kd(t),{onClose:u}=a;return k.useEffect(()=>(document.addEventListener(VO,u),()=>document.removeEventListener(VO,u)),[u]),k.useEffect(()=>{if(a.trigger){const h=f=>{const d=f.target;d!=null&&d.contains(a.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[a.trigger,u]),R.jsx(wc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:R.jsxs(g0,{"data-state":a.stateAttribute,...c,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[R.jsx(F_,{children:r}),R.jsx(FK,{scope:t,isInside:!0,children:R.jsx(nK,{id:a.contentId,role:"tooltip",children:i||r})})]})})});B9.displayName=tl;var z9="TooltipArrow",j9=k.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=Kd(t);return zK(z9,t).isInside?null:R.jsx(m0,{...i,...r,ref:e})});j9.displayName=z9;function jK(n,e){const t=Math.abs(e.top-n.y),r=Math.abs(e.bottom-n.y),i=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,r,i,s)){case s:return"left";case i:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function XK(n,e,t=5){const r=[];switch(e){case"top":r.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":r.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":r.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":r.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return r}function qK(n){const{top:e,right:t,bottom:r,left:i}=n;return[{x:i,y:e},{x:t,y:e},{x:t,y:r},{x:i,y:r}]}function WK(n,e){const{x:t,y:r}=n;let i=!1;for(let s=0,o=e.length-1;sr!=u>r&&t<(c-l)*(r-a)/(u-a)+l&&(i=!i)}return i}function HK(n){const e=n.slice();return e.sort((t,r)=>t.xr.x?1:t.yr.y?1:0),YK(e)}function YK(n){if(n.length<=1)return n.slice();const e=[];for(let r=0;r=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let r=n.length-1;r>=0;r--){const i=n[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var X9=D9,q9=N9,W9=V9,H9=Z9,Y9=B9,UK=j9;const Gc=w.forwardRef(({title:n,children:e},t)=>{const r=Nt(Gs);return w.createElement(X9,{delayDuration:100},w.createElement(q9,null,w.createElement(W9,{ref:t,asChild:!0},w.createElement("span",{className:W.tooltipTrigger},e)),w.createElement(H9,{container:r==null?void 0:r.current},w.createElement(Y9,{className:Fe(W.tooltipContent),sideOffset:10},n))))}),GK=w.forwardRef(({children:n,className:e,...t},r)=>w.createElement(RK,{...t,ref:r,className:Fe(e,W.selectItem)},w.createElement(MK,null,n))),KK=({title:n,placeholder:e,className:t})=>{const[r,i]=yt(In,Tt);return w.createElement(Gc,{title:n},w.createElement(PK,{"aria-label":e,className:Fe(W.selectTrigger,t),"data-toolbar-item":!0,disabled:r},w.createElement(TK,{placeholder:e}),w.createElement(EK,{className:W.selectDropdownArrow},i("arrow_drop_down"))))},JK=({children:n,className:e=W.selectContainer})=>{const t=Nt(Gs);return w.createElement($K,{container:t==null?void 0:t.current},w.createElement(AK,{className:Fe(e,"mdxeditor-select-content"),onCloseAutoFocus:r=>{r.preventDefault()},position:"popper"},w.createElement(QK,{"data-editor-dropdown":!0},n)))},U9=n=>w.createElement(_K,{value:n.value||void 0,onValueChange:n.onChange},w.createElement(KK,{title:n.triggerTitle,placeholder:n.placeholder}),w.createElement(JK,null,n.items.map((e,t)=>e==="separator"?w.createElement(LK,{key:t}):w.createElement(GK,{key:t,value:e.value},e.label)))),kk="__EMPTY_VALUE__",eJ=({language:n,nodeKey:e,code:t,focusEmitter:r})=>{const i=mt(),{parentEditor:s,lexicalNode:o}=Rm(),[l,a,c,u,h]=yt(In,FO,zO,Tt,BO),f=tG(e,"codeblock",n,r),{setCode:d}=Rm(),p=w.useRef(null),g=w.useRef(null),m=w.useRef(d);return m.current=d,f.current={getCodemirror:()=>p.current},w.useEffect(()=>((async()=>{const b=[...a,h9,UA,yb(),J.lineWrapping,J.updateListener.of(({state:O})=>{m.current(O.doc.toString())})];if(l&&b.push(Ae.readOnly.of(!0)),n!==""&&c){const O=sG.find(x=>x.name===n||x.alias.includes(n)||x.extensions.includes(n));if(O)try{const x=await O.load();b.push(x.extension)}catch{console.warn("failed to load language support for",n)}}g.current.innerHTML="",p.current=new J({parent:g.current,state:Ae.create({doc:t,extensions:b})})})(),()=>{var b;(b=p.current)==null||b.destroy(),p.current=null}),[l,n]),w.createElement("div",{className:W.codeMirrorWrapper,onKeyDown:b=>{b.stopPropagation()}},w.createElement("div",{className:W.codeMirrorToolbar},w.createElement(U9,{value:n,onChange:b=>{s.update(()=>{o.setLanguage(b===kk?"":b),setTimeout(()=>{s.update(()=>{o.getLatest().select()})})})},triggerTitle:i("codeBlock.selectLanguage","Select code block language"),placeholder:i("codeBlock.inlineLanguage","Language"),items:Object.entries(h).map(([b,O])=>({value:b||kk,label:O}))}),w.createElement("button",{className:W.iconButton,type:"button",title:i("codeblock.delete","Delete code block"),onClick:b=>{b.preventDefault(),s.update(()=>{o.remove()})}},u("delete_small"))),w.createElement("div",{ref:g}))},BO=be({js:"JavaScript",ts:"TypeScript",tsx:"TypeScript (React)",jsx:"JavaScript (React)",css:"CSS"}),tJ=gt(n=>{n.link(n.pipe(tJ,ui(({language:e,code:t})=>({code:t,language:e,meta:""}))),Md)}),FO=be([]),zO=be(!0),nJ=Nn({update(n,e){n.pubIn({[BO]:e==null?void 0:e.codeBlockLanguages,[FO]:(e==null?void 0:e.codeMirrorExtensions)??[],[zO]:(e==null?void 0:e.autoLoadLanguageSupport)??!0})},init(n,e){n.pubIn({[BO]:e==null?void 0:e.codeBlockLanguages,[FO]:(e==null?void 0:e.codeMirrorExtensions)??[],[QF]:rJ((e==null?void 0:e.codeBlockLanguages)??{}),[zO]:(e==null?void 0:e.autoLoadLanguageSupport)??!0})}});function rJ(n){return{match(e,t){return!!Object.hasOwn(n,e??"")&&!t},priority:1,Editor:eJ}}function iJ(n){try{const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?sy(t)?r:i:sy(e)?r:i}catch{return null}}function G9(n){const e=le(),t=window.getSelection(),r=document.activeElement,i=n.getRootElement();if(e!==null&&t!==null&&i!==null&&i.contains(t.anchorNode)&&n.isEditable()){const s=t.getRangeAt(0);let o;if(t.isCollapsed){let l=t.anchorNode;(l==null?void 0:l.nodeType)==3&&(l=l.parentNode),o=l.getBoundingClientRect(),o.width=0}else if(t.anchorNode===i){let l=i;for(;l.firstElementChild!=null;)l=l.firstElementChild;o=l.getBoundingClientRect()}else o=s.getBoundingClientRect();return{top:Math.round(o.top),left:Math.round(o.left),width:Math.round(o.width),height:Math.round(o.height)}}else if(!r||r.className!=="link-input")return null;return null}function sJ({url:n,title:e,onSubmit:t,onCancel:r,linkAutocompleteSuggestions:i}){const{register:s,handleSubmit:o,control:l,setValue:a,reset:c}=AP({values:{url:n,title:e}}),u=mt();return w.createElement("form",{onSubmit:h=>{o(t)(h),h.stopPropagation(),h.preventDefault()},onReset:h=>{h.stopPropagation(),r()},className:Fe(W.multiFieldForm,W.linkDialogEditForm)},w.createElement("div",{className:W.formField},w.createElement("label",{htmlFor:"link-url"},u("createLink.url","URL")),w.createElement(rT,{register:s,initialInputValue:n,inputName:"url",suggestions:i,setValue:a,control:l,placeholder:u("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),w.createElement("div",{className:W.formField},w.createElement("label",{htmlFor:"link-title"},u("createLink.title","Title")),w.createElement("input",{id:"link-title",className:W.textInput,size:40,...s("title")})),w.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},w.createElement("button",{type:"submit",title:u("createLink.saveTooltip","Set URL"),"aria-label":u("createLink.saveTooltip","Set URL"),className:Fe(W.primaryButton)},u("dialogControls.save","Save")),w.createElement("button",{type:"reset",title:u("createLink.cancelTooltip","Cancel change"),"aria-label":u("createLink.cancelTooltip","Cancel change"),className:Fe(W.secondaryButton)},u("dialogControls.cancel","Cancel"))))}const oJ=()=>{const[n,e,t,r,i,s]=yt(Gs,ft,Tt,mn,r3,i3),o=at(K9),l=at(J9),a=at(e3),c=at(t3),u=at(n3);w.useEffect(()=>{const m=()=>{e==null||e.getEditorState().read(()=>{o(!0)})};return window.addEventListener("resize",m),window.addEventListener("scroll",m),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m)}},[e,o]);const[h,f]=w.useState(!1),d=mt(),p=r.rectangle,g=r.type==="preview"&&r.url.startsWith("http");return w.createElement(v0,{open:r.type!=="inactive"},w.createElement(vV,{"data-visible":r.type==="edit",className:W.linkDialogAnchor,style:{top:`${(p==null?void 0:p.top)??0}px`,left:`${(p==null?void 0:p.left)??0}px`,width:`${(p==null?void 0:p.width)??0}px`,height:`${(p==null?void 0:p.height)??0}px`}}),w.createElement(w0,{container:n==null?void 0:n.current},w.createElement(wV,{className:Fe(W.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:m=>{m.preventDefault()},key:r.linkNodeKey},r.type==="edit"&&w.createElement(sJ,{url:r.url,title:r.title,onSubmit:l,onCancel:a.bind(null),linkAutocompleteSuggestions:i}),r.type==="preview"&&w.createElement(w.Fragment,null,w.createElement("a",{className:W.linkDialogPreviewAnchor,href:r.url,...g?{target:"_blank",rel:"noreferrer"}:{},onClick:m=>{s!==null&&(m.preventDefault(),s(r.url))},title:g?d("linkPreview.open","Open {{url}} in new window",{url:r.url}):r.url},w.createElement("span",null,r.url),g&&t("open_in_new")),w.createElement(vg,{onClick:()=>{c()},title:d("linkPreview.edit","Edit link URL"),"aria-label":d("linkPreview.edit","Edit link URL")},t("edit")),w.createElement(X9,null,w.createElement(q9,{open:h},w.createElement(W9,{asChild:!0},w.createElement(vg,{title:d("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":d("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{f(!0),setTimeout(()=>{f(!1)},1e3)})}},t(h?"check":"content_copy"))),w.createElement(H9,{container:n==null?void 0:n.current},w.createElement(Y9,{className:Fe(W.tooltipContent),sideOffset:5},d("linkPreview.copied","Copied!"),w.createElement(UK,null))))),w.createElement(vg,{title:d("linkPreview.remove","Remove link"),"aria-label":d("linkPreview.remove","Remove link"),onClick:()=>{u()}},t("link_off"))),w.createElement(S0,{className:W.popoverArrow}))))},vg=w.forwardRef(({className:n,...e},t)=>w.createElement("button",{className:Fe(W.actionButton,n),ref:t,...e}));function jO(n){if(!n)return null;const e=iJ(n);if(e===null)return null;const t=e.getParent();return Pm(t)?t:Pm(e)?e:null}const K9=gt(),mn=be({type:"inactive"},n=>{n.pub(zh,e=>e.registerCommand(uc,()=>n.getValue(mn).type==="preview"?(n.pub(mn,{type:"inactive"}),!0):!1,lt)),n.pub(zh,e=>e.registerCommand(SC,t=>{if(t.key==="k"&&(Zh?t.metaKey:t.ctrlKey)&&!n.getValue(In)){const r=le();return U(r)?(n.pub(ox),t.stopPropagation(),t.preventDefault(),!0):!1}return!1},Jg)),n.link(n.pipe(t3,ct(mn),ui(([,e])=>{if(e.type==="preview")return{type:"edit",initialUrl:e.url,url:e.url,title:e.title,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot switch to edit mode when not in preview mode")})),mn),n.sub(n.pipe(J9,ct(ft,mn,Vo)),([e,t,r,i])=>{var s,o;const l=((s=e.url)==null?void 0:s.trim())??"",a=((o=e.title)==null?void 0:o.trim())??"";if(l!==""){if(i!=null&&i.isCollapsed()){const c=a||l;t==null||t.update(()=>{const u=jO(i);if(u)u.setURL(l),u.setTitle(a);else{const h=La(l,{title:a});h.append(Ot(c)),ll([h]),h.select()}},{discrete:!0})}else t==null||t.dispatchCommand(Tm,{url:l,title:a});n.pub(mn,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:a,url:l})}else r.type==="edit"&&r.initialUrl!==""&&(t==null||t.dispatchCommand(Tm,null)),n.pub(mn,{type:"inactive"})}),n.link(n.pipe(e3,ct(mn,ft),ui(([,e,t])=>{if(e.type==="edit")return t==null||t.focus(),e.initialUrl===""?{type:"inactive"}:{type:"preview",url:e.initialUrl,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),mn),n.link(n.pipe(n.combine(Vo,K9),ct(ft,mn,In),ui(([[e],t,r,i])=>{if(U(e)&&t&&!i){const s=jO(e);return s?{type:"preview",url:s.getURL(),linkNodeKey:s.getKey(),title:s.getTitle(),rectangle:G9(t)}:{type:"inactive"}}else return{type:"inactive"}})),mn)}),J9=gt(),e3=os();os();const t3=os(),n3=os(n=>{n.sub(n.pipe(n3,ct(ft)),([,e])=>{e==null||e.dispatchCommand(Tm,null)})}),ox=os(n=>{n.sub(n.pipe(ox,ct(Vo,ft),ac(([,e])=>U(e))),([,e,t])=>{t==null||t.focus(()=>{t.getEditorState().read(()=>{const r=jO(e),i=G9(t);r?n.pub(mn,{type:"edit",initialUrl:r.getURL(),initialTitle:r.getTitle()??"",url:r.getURL(),title:r.getTitle()??"",linkNodeKey:r.getKey(),rectangle:i}):n.pub(mn,{type:"edit",initialUrl:"",initialTitle:"",title:"",url:"",linkNodeKey:"",rectangle:i})})})})}),r3=be([]),i3=be(null),lJ=Nn({init(n,e){n.pub(hl,(e==null?void 0:e.LinkDialog)??oJ),n.pub(i3,(e==null?void 0:e.onClickLinkCallback)??null)},update(n,e={}){n.pub(r3,e.linkAutocompleteSuggestions??[])}});function lx(n,e){return w.forwardRef((t,r)=>{const i=Fe(e.className,t.className);return w.createElement(n,{...e,...t,className:i,ref:r})})}function aJ(n){return({title:e,children:t,...r})=>w.createElement(n,{...r},w.createElement(Gc,{title:e},t))}const cJ=({readOnly:n,children:e,className:t})=>w.createElement(E0,{className:Fe("mdxeditor-toolbar",W.toolbarRoot,{[W.readOnlyToolbarRoot]:n},t),...n?{tabIndex:-1}:{}},e),uJ=lx(Hi,{className:W.toolbarButton,"data-toolbar-item":!0}),Kc=aJ(uJ),s3=lx(ch,{className:W.toolbarToggleItem,"data-toolbar-item":!0});lx(Ed,{type:"single",className:W.toolbarToggleSingleGroup});const o3=w.forwardRef(({on:n,title:e,children:t,disabled:r,...i},s)=>w.createElement(Ed,{type:"single",className:W.toolbarToggleSingleGroup,...i,value:n?"on":"off",ref:s},w.createElement(s3,{title:e,value:"on",disabled:r},w.createElement(Gc,{title:e},t)))),l3=({items:n})=>w.createElement("div",{className:W.toolbarGroupOfGroups},n.map((e,t)=>w.createElement(o3,{key:t,title:e.title,on:e.active,onValueChange:r=>{e.onChange(r==="on")},disabled:e.disabled},e.contents))),a3=({value:n,onChange:e,className:t,items:r})=>{const i=mt();return w.createElement("div",{className:W.toolbarGroupOfGroups},w.createElement(Ed,{"aria-label":i("toolbar.toggleGroup","toggle group"),type:"single",className:Fe(W.toolbarToggleSingleGroup,t),onValueChange:e,value:n||"",onFocus:s=>{s.preventDefault()}},r.map((s,o)=>w.createElement(s3,{key:o,"aria-label":s.title,value:s.value},w.createElement(Gc,{title:s.title},s.contents)))))};function Ck(n){return Object.hasOwn(n,"when")}const hJ=({options:n})=>{const e=Nt(dd),t=w.useMemo(()=>{const r=n.find(i=>{if(Ck(i)){if(i.when(e))return!0}else return!0});return r?Ck(r)?r.contents():r.fallback():null},[n,e]);return w.createElement("div",{style:{display:"flex"}},t)},fJ=G5,wg=be(()=>null),Sg=be(""),_k=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components }}` to the toolbarPlugin to customize it.",dJ=Nn({init(n,e){n.pubIn({[wg]:(e==null?void 0:e.toolbarContents)??_k,[Sg]:(e==null?void 0:e.toolbarClassName)??"",[f6]:()=>{const[t,r,i]=yt(wg,In,Sg);return w.createElement(cJ,{className:i,readOnly:r},t())}})},update(n,e){n.pub(wg,(e==null?void 0:e.toolbarContents)??_k),n.pub(Sg,(e==null?void 0:e.toolbarClassName)??"")}});class kt{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}offset(e,t=e){return new kt(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}}function Ys(n,e,t,r,i,s){if(n==r)return[];let o=ax(n,e,t,r,i,s),l=cx(n,e+o,t,r,i+o,s);e+=o,t-=l,i+=o,s-=l;let a=t-e,c=s-i;if(!a||!c)return[new kt(e,t,i,s)];if(a>c){let h=n.slice(e,t).indexOf(r.slice(i,s));if(h>-1)return[new kt(e,e+h,i,i),new kt(e+h+c,t,s,s)]}else if(c>a){let h=r.slice(i,s).indexOf(n.slice(e,t));if(h>-1)return[new kt(e,e,i,i+h),new kt(t,t,i+h+a,s)]}if(a==1||c==1)return[new kt(e,t,i,s)];let u=h3(n,e,t,r,i,s);if(u){let[h,f,d]=u;return Ys(n,e,h,r,i,f).concat(Ys(n,h+d,t,r,f+d,s))}return pJ(n,e,t,r,i,s)}let ea=1e9;function pJ(n,e,t,r,i,s){let o=t-e,l=s-i;if(ea<1e9&&Math.min(o,l)>ea*16)return Math.min(o,l)>ea*64?[new kt(e,t,i,s)]:Pk(n,e,t,r,i,s);let a=Math.ceil((o+l)/2);kg.reset(a),Cg.reset(a);let c=(d,p)=>n.charCodeAt(e+d)==r.charCodeAt(i+p),u=(d,p)=>n.charCodeAt(t-d-1)==r.charCodeAt(s-p-1),h=(o-l)%2!=0?Cg:null,f=h?null:kg;for(let d=0;dea)return Pk(n,e,t,r,i,s);let p=kg.advance(d,o,l,a,h,!1,c)||Cg.advance(d,o,l,a,f,!0,u);if(p)return gJ(n,e,t,e+p[0],r,i,s,i+p[1])}return[new kt(e,t,i,s)]}class c3{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let t=0;tt)this.end+=2;else if(h>r)this.start+=2;else if(s){let f=i+(t-r)-a;if(f>=0&&f=t-u)return[d,i+d-f]}else{let d=t-s.vec[f];if(u>=d)return[u,h]}}}return null}}const kg=new c3,Cg=new c3;function gJ(n,e,t,r,i,s,o,l){let a=!1;return!nl(n,r)&&++r==t&&(a=!0),!nl(i,l)&&++l==o&&(a=!0),a?[new kt(e,t,s,o)]:Ys(n,e,r,i,s,l).concat(Ys(n,r,t,i,l,o))}function u3(n,e){let t=1,r=Math.min(n,e);for(;tt||u>s||n.slice(l,c)!=r.slice(a,u)){if(o==1)return l-e-(nl(n,l)?0:1);o=o>>1}else{if(c==t||u==s)return c-e;l=c,a=u}}}function cx(n,e,t,r,i,s){if(e==t||i==s||n.charCodeAt(t-1)!=r.charCodeAt(s-1))return 0;let o=u3(t-e,s-i);for(let l=t,a=s;;){let c=l-o,u=a-o;if(c>1}else{if(c==e||u==i)return t-c;l=c,a=u}}}function XO(n,e,t,r,i,s,o,l){let a=r.slice(i,s),c=null;for(;;){if(c||o=t)break;let f=n.slice(u,h),d=-1;for(;(d=a.indexOf(f,d+1))!=-1;){let p=ax(n,h,t,r,i+d+f.length,s),g=cx(n,e,u,r,i,i+d),m=f.length+p+g;(!c||c[2]>1}}function h3(n,e,t,r,i,s){let o=t-e,l=s-i;if(oi.fromA-e&&r.toB>i.fromB-e&&(n[t-1]=new kt(r.fromA,i.toA,r.fromB,i.toB),n.splice(t--,1))}}function mJ(n,e,t){for(;;){f3(t,1);let r=!1;for(let i=0;i3||l>3){let a=i==n.length-1?e.length:n[i+1].fromA,c=s.fromA-r,u=a-s.toA,h=Ek(e,s.fromA,Math.min(c,5)),f=Tk(e,s.toA,Math.min(u,5)),d=s.fromA-h,p=f-s.toA;if(!o||!l){let g=Math.max(o,l),[m,b,O]=o?[e,s.fromA,s.toA]:[t,s.fromB,s.toB];d&&p&&(g>d&&e.slice(h,s.fromA)==m.slice(O-d,O)?(s=n[i]=new kt(h,h+o,s.fromB-d,s.toB-d),h=s.fromA,f=Tk(e,s.toA,Math.min(a-s.toA,5))):g>p&&e.slice(s.toA,f)==m.slice(b,b+p)&&(s=n[i]=new kt(f-o,f,s.fromB+p,s.toB+p),f=s.toA,h=Ek(e,s.fromA,Math.min(s.fromA-r,5))),d=s.fromA-h,p=f-s.toA)}if(d||p)s=n[i]=new kt(s.fromA-d,s.toA+p,s.fromB-d,s.toB+p);else if(o){if(!l){let g=Ak(e,s.fromA,s.toA),m,b=g<0?-1:$k(e,s.toA,s.fromA);g>-1&&(m=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+m)?s=n[i]=s.offset(m):b>-1&&(m=s.toA-b)>=c&&t.slice(s.fromA-m,s.fromA)==t.slice(b,s.toA)&&(s=n[i]=s.offset(-m))}}else{let g=Ak(t,s.fromB,s.toB),m,b=g<0?-1:$k(t,s.toB,s.fromB);g>-1&&(m=g-s.fromB)<=u&&t.slice(s.fromB,g)==t.slice(s.toB,s.toB+m)?s=n[i]=s.offset(m):b>-1&&(m=s.toB-b)>=c&&t.slice(s.fromB-m,s.fromB)==t.slice(b,s.toB)&&(s=n[i]=s.offset(-m))}r=s.toA}}return f3(n,3),n}let Rs;try{Rs=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function d3(n){return n>48&&n<58||n>64&&n<91||n>96&&n<123}function p3(n,e){if(e==n.length)return 0;let t=n.charCodeAt(e);return t<192?d3(t)?1:0:Rs?!m3(t)||e==n.length-1?Rs.test(String.fromCharCode(t))?1:0:Rs.test(n.slice(e,e+2))?2:0:0}function g3(n,e){if(!e)return 0;let t=n.charCodeAt(e-1);return t<192?d3(t)?1:0:Rs?!O3(t)||e==1?Rs.test(String.fromCharCode(t))?1:0:Rs.test(n.slice(e-2,e))?2:0:0}function Tk(n,e,t){if(e==n.length||!g3(n,e))return e;for(let r=e,i=e+t;;){let s=p3(n,r);if(!s)return r;if(r+=s,r>i)return e}}function Ek(n,e,t){if(!e||!p3(n,e))return e;for(let r=e,i=e-t;;){let s=g3(n,r);if(!s)return r;if(r-=s,rn>=55296&&n<=56319,O3=n=>n>=56320&&n<=57343;function nl(n,e){return!e||e==n.length||!m3(n.charCodeAt(e-1))||!O3(n.charCodeAt(e))}function bJ(n,e,t){var r;return ea=((r=t==null?void 0:t.scanLimit)!==null&&r!==void 0?r:1e9)>>1,mJ(n,e,Ys(n,0,n.length,e,0,e.length))}function b3(n,e,t){return OJ(bJ(n,e,t),n,e)}const Ir=fe.define({combine:n=>n[0]}),qO=Se.define(),rl=vt.define({create(n){return null},update(n,e){for(let t of e.effects)t.is(qO)&&(n=t.value);return n}});class Mo{constructor(e,t,r,i,s){this.changes=e,this.fromA=t,this.toA=r,this.fromB=i,this.toB=s}offset(e,t){return e||t?new Mo(this.changes,this.fromA+e,this.toA+e,this.fromB+t,this.toB+t):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,r){return x3(b3(e.toString(),t.toString(),r),e,t,0,0)}static updateA(e,t,r,i,s){return Ik(Lk(e,i,!0,r.length),e,t,r,s)}static updateB(e,t,r,i,s){return Ik(Lk(e,i,!1,t.length),e,t,r,s)}}function Qk(n,e,t,r){let i=t.lineAt(n),s=r.lineAt(e);return i.to==n&&s.to==e&&nu+1&&g>h+1)break;f.push(d.offset(-a+r,-c+i)),[u,h]=Rk(d.toA+r,d.toB+i,e,t),o++}s.push(new Mo(f,a,Math.max(a,u),c,Math.max(c,h)))}return s}const Xu=1e3;function Mk(n,e,t,r){let i=0,s=n.length;for(;;){if(i==s){let u=0,h=0;i&&({toA:u,toB:h}=n[i-1]);let f=e-(t?u:h);return[u+f,h+f]}let o=i+s>>1,l=n[o],[a,c]=t?[l.fromA,l.toA]:[l.fromB,l.toB];if(a>e)s=o;else if(c<=e)i=o+1;else return r?[l.fromA,l.fromB]:[l.toA,l.toB]}}function Lk(n,e,t,r){let i=[];return e.iterChangedRanges((s,o,l,a)=>{let c=0,u=t?e.length:r,h=0,f=t?r:e.length;s>Xu&&([c,h]=Mk(n,s-Xu,t,!0)),o=c?i[i.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:f,diffA:p.diffA+g,diffB:p.diffB+m}:i.push({fromA:c,toA:u,fromB:h,toB:f,diffA:g,diffB:m})}),i}function Ik(n,e,t,r,i){if(!n.length)return e;let s=[];for(let o=0,l=0,a=0,c=0;;o++){let u=o==n.length?null:n[o],h=u?u.fromA+l:t.length,f=u?u.fromB+a:r.length;for(;ch||m.toB+a>f)break;s.push(m.offset(l,a)),c++}if(!u)break;let d=u.toA+l+u.diffA,p=u.toB+a+u.diffB,g=b3(t.sliceString(h,d),r.sliceString(f,p),i);for(let m of x3(g,t,r,h,f))s.push(m);for(l+=u.diffA,a+=u.diffB;cd&&m.fromB+a>p)break;c++}}return s}const xJ={scanLimit:500},y3=xt.fromClass(class{constructor(n){({deco:this.deco,gutter:this.gutter}=Vk(n))}update(n){(n.docChanged||n.viewportChanged||yJ(n.startState,n.state)||vJ(n.startState,n.state))&&({deco:this.deco,gutter:this.gutter}=Vk(n.view))}},{decorations:n=>n.deco}),qu=wr.low(DE({class:"cm-changeGutter",markers:n=>{var e;return((e=n.plugin(y3))===null||e===void 0?void 0:e.gutter)||Ze.empty}}));function yJ(n,e){return n.field(rl,!1)!=e.field(rl,!1)}function vJ(n,e){return n.facet(Ir)!=e.facet(Ir)}const Dk=Oe.line({class:"cm-changedLine"}),wJ=Oe.mark({class:"cm-changedText"}),SJ=Oe.mark({tagName:"ins",class:"cm-insertedLine"}),kJ=Oe.mark({tagName:"del",class:"cm-deletedLine"}),Nk=new class extends Gr{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function CJ(n,e,t,r,i,s){let o=t?n.fromA:n.fromB,l=t?n.toA:n.toB,a=0;if(o!=l){i.add(o,o,Dk),i.add(o,l,t?kJ:SJ),s&&s.add(o,o,Nk);for(let c=e.iterRange(o,l-1),u=o;!c.next().done;){if(c.lineBreak){u++,i.add(u,u,Dk),s&&s.add(u,u,Nk);continue}let h=u+c.value.length;if(r)for(;a=c)break;(s?u.toA:u.toB)>a&&CJ(u,n.state.doc,s,r,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class Wu extends Sr{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const Nf=Se.define({map:(n,e)=>n.map(e)}),ta=vt.define({create:()=>Oe.none,update:(n,e)=>{for(let t of e.effects)if(t.is(Nf))return t.value;return n.map(e.changes)},provide:n=>J.decorations.from(n)}),Hu=.01;function Zk(n,e){if(n.size!=e.size)return!1;let t=n.iter(),r=e.iter();for(;t.value;){if(t.from!=r.from||Math.abs(t.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;t.next(),r.next()}return!0}function _J(n,e,t){let r=new Dn,i=new Dn,s=n.state.field(ta).iter(),o=e.state.field(ta).iter(),l=0,a=0,c=0,u=0,h=n.viewport,f=e.viewport;for(let m=0;;m++){let b=mHu&&(u+=C,i.add(a,a,Oe.widget({widget:new Wu(C),block:!0,side:-1})))}if(O>l+1e3&&lh.from&&af.from){let y=Math.min(h.from-l,f.from-a);l+=y,a+=y,m--}else if(b)l=b.toA,a=b.toB;else break;for(;s.value&&s.fromHu&&i.add(e.state.doc.length,e.state.doc.length,Oe.widget({widget:new Wu(d),block:!0,side:1}));let p=r.finish(),g=i.finish();Zk(p,n.state.field(ta))||n.dispatch({effects:Nf.of(p)}),Zk(g,e.state.field(ta))||e.dispatch({effects:Nf.of(g)})}const WO=Se.define({map:(n,e)=>e.mapPos(n)});class PJ extends Sr{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement("div");return t.className="cm-collapsedLines",t.textContent="⦚ "+e.state.phrase("$ unchanged lines",this.lines)+" ⦚",t.addEventListener("click",r=>{let i=e.posAtDOM(r.target);e.dispatch({effects:WO.of(i)});let{side:s,sibling:o}=e.state.facet(Ir);o&&o().dispatch({effects:WO.of(TJ(i,e.state.field(rl),s=="a"))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}}function TJ(n,e,t){let r=0,i=0;for(let s=0;;s++){let o=s=n)return i+(n-r);[r,i]=t?[o.toA,o.toB]:[o.toB,o.toA]}}const EJ=vt.define({create(n){return Oe.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)t.is(WO)&&(n=n.update({filter:r=>r!=t.value}));return n},provide:n=>J.decorations.from(n)});function Bk({margin:n=3,minSize:e=4}){return EJ.init(t=>$J(t,n,e))}function $J(n,e,t){let r=new Dn,i=n.facet(Ir).side=="a",s=n.field(rl),o=1;for(let l=0;;l++){let a=l=t&&r.add(n.doc.line(c).from,n.doc.line(u).to,Oe.replace({widget:new PJ(h),block:!0})),!a)break;o=n.doc.lineAt(Math.min(n.doc.length,i?a.toA:a.toB)).number}return r.finish()}const AJ=J.styleModule.of(new vi({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),QJ=J.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb2266, #22bb2266) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff8866, #88ff8866) bottom/100% 2px no-repeat"},".cm-insertedLine, .cm-deletedLine":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer"},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"}}),Fk=new Ol,Yu=new Ol;class RJ{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||xJ;let t=[wr.low(y3),QJ,AJ,ta,J.updateListener.of(h=>{this.measuring<0&&(h.heightChanged||h.viewportChanged)&&!h.transactions.some(f=>f.effects.some(d=>d.is(Nf)))&&this.measure()})],r=[Ir.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(qu);let i=Ae.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],J.editorAttributes.of({class:"cm-merge-a"}),Yu.of(r),t]}),s=[Ir.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(qu);let o=Ae.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],J.editorAttributes.of({class:"cm-merge-b"}),Yu.of(s),t]});this.chunks=Mo.build(i.doc,o.doc,this.diffConf);let l=[rl.init(()=>this.chunks),Fk.of(e.collapseUnchanged?Bk(e.collapseUnchanged):[])];i=i.update({effects:Se.appendConfig.of(l)}).state,o=o.update({effects:Se.appendConfig.of(l)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let a=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(a=="a-b"?c:u),this.editorDOM.appendChild(a=="a-b"?u:c),this.a=new J({state:i,parent:c,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.a)}),this.b=new J({state:o,parent:u,root:e.root,dispatchTransactions:h=>this.dispatch(h,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(r=>r.docChanged)){let r=e[e.length-1],i=e.reduce((o,l)=>o.compose(l.changes),St.empty(e[0].startState.doc.length));this.chunks=t==this.a?Mo.updateA(this.chunks,r.newDoc,this.b.state.doc,i,this.diffConf):Mo.updateB(this.chunks,this.a.state.doc,r.newDoc,i,this.diffConf),t.update([...e,r.state.update({effects:qO.of(this.chunks)})]);let s=t==this.a?this.b:this.a;s.update([s.state.update({effects:qO.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let o=this.a.dom.parentNode,l=this.b.dom.parentNode;o.remove(),l.remove(),this.editorDOM.insertBefore(s?o:l,this.editorDOM.firstChild),this.editorDOM.appendChild(s?l:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,o=this.revertToA,l=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,o=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(l=e.renderRevertControl),this.setupRevertControls(s,o,l)}let t="highlightChanges"in e,r="gutter"in e,i="collapseUnchanged"in e;if(t||r||i){let s=[],o=[];if(t||r){let l=this.a.state.facet(Ir),a=r?e.gutter!==!1:l.markGutter,c=t?e.highlightChanges!==!1:l.highlightChanges;s.push(Yu.reconfigure([Ir.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:a}),a?qu:[]])),o.push(Yu.reconfigure([Ir.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:a}),a?qu:[]]))}if(i){let l=Fk.reconfigure(e.collapseUnchanged?Bk(e.collapseUnchanged):[]);s.push(l),o.push(l)}this.a.dispatch({effects:s}),this.b.dispatch({effects:o})}this.scheduleMeasure()}setupRevertControls(e,t,r){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){_J(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,r=this.a.viewport,i=this.b.viewport;for(let s=0;sr.to||o.fromB>i.to)break;if(o.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function zk(n){let e=n.nextSibling;return n.remove(),e}class Vf{static create(e,t,r,i,s){let o=i+(i<<8)+e+(t<<4)|0;return new Vf(e,t,r,o,s,[],[])}constructor(e,t,r,i,s,o,l){this.type=e,this.value=t,this.from=r,this.hash=i,this.end=s,this.children=o,this.positions=l,this.hashProp=[[ke.contextHash,i]]}addChild(e,t){e.prop(ke.contextHash)!=this.hash&&(e=new Re(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new Re(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(i,s,o)=>new Re(Pt.none,i,s,o,this.hashProp)})}}var ee;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(ee||(ee={}));class MJ{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class LJ{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return ya(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,r=0){for(let i=t;i=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==ee.OrderedList?fx:hx)(t,e,!1);return r>0&&(n.type!=ee.BulletList||ux(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const v3={[ee.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(Ve(ee.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Kn(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[ee.ListItem](n,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[ee.OrderedList]:jk,[ee.BulletList]:jk,[ee.Document](){return!0}};function Kn(n){return n==32||n==9||n==10||n==13}function ya(n,e=0){for(;et&&Kn(n.charCodeAt(e-1));)e--;return e}function w3(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf($3.SetextHeading)>-1||r<3?-1:1}function k3(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function hx(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Kn(n.text.charCodeAt(n.pos+1)))&&(!t||k3(e,ee.BulletList)||n.skipSpace(n.pos+2)=48&&i<=57;){r++;if(r==n.text.length)return-1;i=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||i!=46&&i!=41||rn.pos+1||n.next!=49)?-1:r+1-n.pos}function C3(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e6?-1:t}function _3(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e/,T3=/\?>/,YO=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*"),ie=w(ee,"?>"),ye=w(te,"]]>"),ge=Y({Text:p.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,AttributeValue:p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta,Cdata:p.special(p.string)}),me=I.deserialize({version:14,states:",SOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DS'#DSOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C{'#C{O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C|'#C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y;'S;=`&_<%lO%yXE]T!PP{WOr%ysv%yw;'S%y;'S;=`&_<%lO%yZEuWaQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n_FhW[UVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZGXYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aGw!a;'S$n;'S;=`&e<%lO$nZHQW!OQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZHqYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_#P$n#P#QIa#Q;'S$n;'S;=`&e<%lO$nZIhYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aJW!a;'S$n;'S;=`&e<%lO$nZJaWwQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n",tokenizers:[oe,se,ie,ye,0,1,2,3],topRules:{Document:[0,6]},tokenPrec:0});function h(e,t){let O=t&&t.getChild("TagName");return O?e.sliceString(O.from,O.to):""}function V(e,t){let O=t&&t.firstChild;return!O||O.name!="OpenTag"?"":h(e,O)}function $e(e,t,O){let n=t&&t.getChildren("Attribute").find(l=>l.from<=O&&l.to>=O),a=n&&n.getChild("AttributeName");return a?e.sliceString(a.from,a.to):""}function P(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ce(e,t){var O;let n=Z(e).resolveInner(t,-1),a=null;for(let l=n;!a&&l.parent;l=l.parent)(l.name=="OpenTag"||l.name=="CloseTag"||l.name=="SelfClosingTag"||l.name=="MismatchedCloseTag")&&(a=l);if(a&&(a.to>t||a.lastChild.type.isError)){let l=a.parent;if(n.name=="TagName")return a.name=="CloseTag"||a.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:l}:{type:"openTag",from:n.from,context:P(l)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:a};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:a};let s=n==a||n.name=="Attribute"?n.childBefore(t):n;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:P(l)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:l}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:a}:s?{type:"attrName",from:t,context:a}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:t,context:n.parent};for(;n.parent&&n.to==t&&!(!((O=n.lastChild)===null||O===void 0)&&O.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:t,context:n.name=="Element"?n:P(n)}:null}class ue{constructor(t,O,n){this.attrs=O,this.attrValues=n,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(a=>({label:a,type:"text"})):[]}}const v=/^[:\-\.\w\u00b7-\uffff]*$/;function R(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function G(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function pe(e,t){let O=[],n=[],a=Object.create(null);for(let r of t){let m=R(r);O.push(m),r.global&&n.push(m),r.values&&(a[r.name]=r.values.map(G))}let l=[],s=[],S=Object.create(null);for(let r of e){let m=n,y=a;r.attributes&&(m=m.concat(r.attributes.map(o=>typeof o=="string"?O.find(f=>f.label==o)||{label:o,type:"property"}:(o.values&&(y==a&&(y=Object.create(y)),y[o.name]=o.values.map(G)),R(o)))));let u=new ue(r,m,y);S[u.name]=u,l.push(u),r.top&&s.push(u)}s.length||(s=l);for(let r=0;r{var m;let{doc:y}=r.state,u=ce(r.state,r.pos);if(!u||u.type=="tag"&&!r.explicit)return null;let{type:o,from:f,context:$}=u;if(o=="openTag"){let i=s,g=V(y,$);if(g){let c=S[g];i=(c==null?void 0:c.children)||l}return{from:f,options:i.map(c=>c.completion),validFor:v}}else if(o=="closeTag"){let i=V(y,$);return i?{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)==">"?1:0),options:[((m=S[i])===null||m===void 0?void 0:m.closeNameCompletion)||{label:i+">",type:"type"}],validFor:v}:null}else if(o=="attrName"){let i=S[h(y,$)];return{from:f,options:(i==null?void 0:i.attrs)||n,validFor:v}}else if(o=="attrValue"){let i=$e(y,$,f);if(!i)return null;let g=S[h(y,$)],c=((g==null?void 0:g.attrValues)||a)[i];return!c||!c.length?null:{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)=='"'?1:0),options:c,validFor:/^"[^"]*"?$/}}else if(o=="tag"){let i=V(y,$),g=S[i],c=[],d=$&&$.lastChild;i&&(!d||d.name!="CloseTag"||h(y,d)!=i)&&c.push(g?g.closeCompletion:{label:"",type:"type",boost:2});let C=c.concat(((g==null?void 0:g.children)||($?l:s)).map(T=>T.openCompletion));if($&&(g!=null&&g.text.length)){let T=$.firstChild;T.to>r.pos-20&&!/\S/.test(r.state.sliceDoc(T.to,r.pos))&&(C=C.concat(g.text))}return{from:f,options:C,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const W=j.define({name:"xml",parser:me.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),z.add({Element(e){let t=e.firstChild,O=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:O.name=="CloseTag"?O.from:e.to}}}),q.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function Ve(e={}){let t=[W.data.of({autocomplete:pe(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Se),new D(W,t)}function N(e,t,O=e.length){if(!t)return"";let n=t.firstChild,a=n&&n.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,O)):""}const Se=M.inputHandler.of((e,t,O,n,a)=>{if(e.composing||e.state.readOnly||t!=O||n!=">"&&n!="/"||!W.isActiveAt(e.state,t,-1))return!1;let l=a(),{state:s}=l,S=s.changeByRange(r=>{var m,y,u;let{head:o}=r,f=s.doc.sliceString(o-1,o)==n,$=Z(s).resolveInner(o,-1),i;if(f&&n==">"&&$.name=="EndTag"){let g=$.parent;if(((y=(m=g.parent)===null||m===void 0?void 0:m.lastChild)===null||y===void 0?void 0:y.name)!="CloseTag"&&(i=N(s.doc,g.parent,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=``;return{range:r,changes:{from:o,to:c,insert:d}}}}else if(f&&n=="/"&&$.name=="StartCloseTag"){let g=$.parent;if($.from==o-2&&((u=g.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(i=N(s.doc,g,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=`${i}>`;return{range:B.cursor(o+d.length,-1),changes:{from:o,to:c,insert:d}}}}return{range:r}});return S.changes.empty?!1:(e.dispatch([l,s.update(S,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{Se as autoCloseTags,pe as completeFromSchema,Ve as xml,W as xmlLanguage}; +import{C as A,E as k,s as Y,t as p,b as I,L as j,i as U,f as z,u as q,a as D,o as M,g as Z,p as B}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const _=1,F=2,J=3,H=4,L=5,K=35,ee=36,te=37,ne=11,Oe=13;function ae(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function re(e){return e==9||e==10||e==13||e==32}let X=null,Q=null,E=0;function b(e,t){let O=e.pos+t;if(Q==e&&E==O)return X;for(;re(e.peek(t));)t++;let n="";for(;;){let a=e.peek(t);if(!ae(a))break;n+=String.fromCharCode(a),t++}return Q=e,E=O,X=n||null}function x(e,t){this.name=e,this.parent=t,this.hash=t?t.hash:0;for(let O=0;O{if(e.next==60){if(e.advance(),e.next==47){e.advance();let O=b(e,0);if(!O)return e.acceptToken(L);if(t.context&&O==t.context.name)return e.acceptToken(F);for(let n=t.context;n;n=n.parent)if(n.name==O)return e.acceptToken(J,-2);e.acceptToken(H)}else if(e.next!=33&&e.next!=63)return e.acceptToken(_)}},{contextual:!0});function w(e,t){return new k(O=>{let n=0,a=t.charCodeAt(0);e:for(;!(O.next<0);O.advance(),n++)if(O.next==a){for(let l=1;l"),ie=w(ee,"?>"),ye=w(te,"]]>"),ge=Y({Text:p.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,AttributeValue:p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta,Cdata:p.special(p.string)}),me=I.deserialize({version:14,states:",SOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DS'#DSOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C{'#C{O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C|'#C|O$dOrO,59^OOOP,59^,59^OOOS'#C}'#C}O$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO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lO$nZGXYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aGw!a;'S$n;'S;=`&e<%lO$nZHQW!OQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$nZHqYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_#P$n#P#QIa#Q;'S$n;'S;=`&e<%lO$nZIhYVP{WOr$nrs%_sv$nw!^$n!^!_%y!_!`$n!`!aJW!a;'S$n;'S;=`&e<%lO$nZJaWwQVP{WOr$nrs%_sv$nw!^$n!^!_%y!_;'S$n;'S;=`&e<%lO$n",tokenizers:[oe,se,ie,ye,0,1,2,3],topRules:{Document:[0,6]},tokenPrec:0});function h(e,t){let O=t&&t.getChild("TagName");return O?e.sliceString(O.from,O.to):""}function V(e,t){let O=t&&t.firstChild;return!O||O.name!="OpenTag"?"":h(e,O)}function $e(e,t,O){let n=t&&t.getChildren("Attribute").find(l=>l.from<=O&&l.to>=O),a=n&&n.getChild("AttributeName");return a?e.sliceString(a.from,a.to):""}function P(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ce(e,t){var O;let n=Z(e).resolveInner(t,-1),a=null;for(let l=n;!a&&l.parent;l=l.parent)(l.name=="OpenTag"||l.name=="CloseTag"||l.name=="SelfClosingTag"||l.name=="MismatchedCloseTag")&&(a=l);if(a&&(a.to>t||a.lastChild.type.isError)){let l=a.parent;if(n.name=="TagName")return a.name=="CloseTag"||a.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:l}:{type:"openTag",from:n.from,context:P(l)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:a};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:a};let s=n==a||n.name=="Attribute"?n.childBefore(t):n;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:P(l)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:l}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:a}:s?{type:"attrName",from:t,context:a}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:t,context:n.parent};for(;n.parent&&n.to==t&&!(!((O=n.lastChild)===null||O===void 0)&&O.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:t,context:n.name=="Element"?n:P(n)}:null}class ue{constructor(t,O,n){this.attrs=O,this.attrValues=n,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(a=>({label:a,type:"text"})):[]}}const v=/^[:\-\.\w\u00b7-\uffff]*$/;function R(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function G(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function pe(e,t){let O=[],n=[],a=Object.create(null);for(let r of t){let m=R(r);O.push(m),r.global&&n.push(m),r.values&&(a[r.name]=r.values.map(G))}let l=[],s=[],S=Object.create(null);for(let r of e){let m=n,y=a;r.attributes&&(m=m.concat(r.attributes.map(o=>typeof o=="string"?O.find(f=>f.label==o)||{label:o,type:"property"}:(o.values&&(y==a&&(y=Object.create(y)),y[o.name]=o.values.map(G)),R(o)))));let u=new ue(r,m,y);S[u.name]=u,l.push(u),r.top&&s.push(u)}s.length||(s=l);for(let r=0;r{var m;let{doc:y}=r.state,u=ce(r.state,r.pos);if(!u||u.type=="tag"&&!r.explicit)return null;let{type:o,from:f,context:$}=u;if(o=="openTag"){let i=s,g=V(y,$);if(g){let c=S[g];i=(c==null?void 0:c.children)||l}return{from:f,options:i.map(c=>c.completion),validFor:v}}else if(o=="closeTag"){let i=V(y,$);return i?{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)==">"?1:0),options:[((m=S[i])===null||m===void 0?void 0:m.closeNameCompletion)||{label:i+">",type:"type"}],validFor:v}:null}else if(o=="attrName"){let i=S[h(y,$)];return{from:f,options:(i==null?void 0:i.attrs)||n,validFor:v}}else if(o=="attrValue"){let i=$e(y,$,f);if(!i)return null;let g=S[h(y,$)],c=((g==null?void 0:g.attrValues)||a)[i];return!c||!c.length?null:{from:f,to:r.pos+(y.sliceString(r.pos,r.pos+1)=='"'?1:0),options:c,validFor:/^"[^"]*"?$/}}else if(o=="tag"){let i=V(y,$),g=S[i],c=[],d=$&&$.lastChild;i&&(!d||d.name!="CloseTag"||h(y,d)!=i)&&c.push(g?g.closeCompletion:{label:"",type:"type",boost:2});let C=c.concat(((g==null?void 0:g.children)||($?l:s)).map(T=>T.openCompletion));if($&&(g!=null&&g.text.length)){let T=$.firstChild;T.to>r.pos-20&&!/\S/.test(r.state.sliceDoc(T.to,r.pos))&&(C=C.concat(g.text))}return{from:f,options:C,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const W=j.define({name:"xml",parser:me.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),z.add({Element(e){let t=e.firstChild,O=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:O.name=="CloseTag"?O.from:e.to}}}),q.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function Ve(e={}){let t=[W.data.of({autocomplete:pe(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Se),new D(W,t)}function N(e,t,O=e.length){if(!t)return"";let n=t.firstChild,a=n&&n.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,O)):""}const Se=M.inputHandler.of((e,t,O,n,a)=>{if(e.composing||e.state.readOnly||t!=O||n!=">"&&n!="/"||!W.isActiveAt(e.state,t,-1))return!1;let l=a(),{state:s}=l,S=s.changeByRange(r=>{var m,y,u;let{head:o}=r,f=s.doc.sliceString(o-1,o)==n,$=Z(s).resolveInner(o,-1),i;if(f&&n==">"&&$.name=="EndTag"){let g=$.parent;if(((y=(m=g.parent)===null||m===void 0?void 0:m.lastChild)===null||y===void 0?void 0:y.name)!="CloseTag"&&(i=N(s.doc,g.parent,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=``;return{range:r,changes:{from:o,to:c,insert:d}}}}else if(f&&n=="/"&&$.name=="StartCloseTag"){let g=$.parent;if($.from==o-2&&((u=g.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(i=N(s.doc,g,o))){let c=o+(s.doc.sliceString(o,o+1)===">"?1:0),d=`${i}>`;return{range:B.cursor(o+d.length,-1),changes:{from:o,to:c,insert:d}}}}return{range:r}});return S.changes.empty?!1:(e.dispatch([l,s.update(S,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{Se as autoCloseTags,pe as completeFromSchema,Ve as xml,W as xmlLanguage}; diff --git a/assets/index-B8vW3wT0.js b/assets/index-D58BRKR5.js similarity index 99% rename from assets/index-B8vW3wT0.js rename to assets/index-D58BRKR5.js index 70a7ab0..d7f5b26 100644 --- a/assets/index-B8vW3wT0.js +++ b/assets/index-D58BRKR5.js @@ -1,3 +1,3 @@ -import{E as h,C as N,s as D,t as n,b as L,g as H,d as B,L as K,i as M,j as X,f as OO,k as iO,a as eO,I as aO,e as nO,N as rO,m as d}from"./MarkdownEditor-BcjjWJJf.js";import"./index-CI8FOYx1.js";import"./index.lazy-B3BXRqZi.js";import"./isAddressEqual-Cr_byQ5I.js";import"./secp256k1-B_ijNduS.js";const QO=1,w=194,Z=195,tO=196,_=197,oO=198,dO=199,sO=200,lO=2,E=3,k=201,TO=24,SO=25,pO=49,qO=50,gO=55,mO=56,PO=57,$O=59,hO=60,cO=61,XO=62,fO=63,yO=65,WO=238,zO=71,RO=241,vO=242,_O=243,kO=244,xO=245,UO=246,uO=247,VO=248,j=72,bO=249,GO=250,wO=251,ZO=252,EO=253,jO=254,YO=255,FO=256,CO=73,JO=77,AO=263,IO=112,NO=130,DO=151,LO=152,HO=155,p=10,q=13,R=32,c=9,v=35,BO=40,KO=46,z=123,x=125,Y=39,F=34,MO=92,Oi=111,ii=120,ei=78,ai=117,ni=85,ri=new Set([SO,pO,qO,AO,yO,NO,mO,PO,WO,XO,fO,j,CO,JO,hO,cO,DO,LO,HO,IO]);function f(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qi=new h((O,i)=>{let e;if(O.next<0)O.acceptToken(dO);else if(i.context.flags&P)f(O.next)&&O.acceptToken(oO,1);else if(((e=O.peek(-1))<0||f(e))&&i.canShift(_)){let a=0;for(;O.next==R||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==v)&&O.acceptToken(_,-a)}else f(O.next)&&O.acceptToken(tO,1)},{contextual:!0}),ti=new h((O,i)=>{let e=i.context;if(e.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,t=0;for(;;){if(O.next==R)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),t++}r!=e.indent&&O.next!=p&&O.next!=q&&O.next!=v&&(r[O,i|C])),si=new N({start:oi,reduce(O,i,e,a){return O.flags&P&&ri.has(i)||(i==zO||i==j)&&O.flags&C?O.parent:O},shift(O,i,e,a){return i==w?new $(O,di(a.read(a.pos,e.pos)),0):i==Z?O.parent:i==TO||i==gO||i==$O||i==E?new $(O,0,P):U.has(i)?new $(O,0,U.get(i)|O.flags&P):O},hash(O){return O.hash}}),li=new h(O=>{for(let i=0;i<5;i++){if(O.next!="print".charCodeAt(i))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let i=0;;i++){let e=O.peek(i);if(!(e==R||e==c)){e!=BO&&e!=KO&&e!=p&&e!=q&&e!=v&&O.acceptToken(QO);return}}}),Ti=new h((O,i)=>{let{flags:e}=i.context,a=e&s?F:Y,r=(e&l)>0,t=!(e&T),Q=(e&S)>0,o=O.pos;for(;!(O.next<0);)if(Q&&O.next==z)if(O.peek(1)==z)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(t&&O.next==MO){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Si(O,g)),O.acceptToken(lO);return}break}else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(k,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(k);return}break}else O.advance();O.pos>o&&O.acceptToken(sO)});function Si(O,i){if(i==Oi)for(let e=0;e<2&&O.next>=48&&O.next<=55;e++)O.advance();else if(i==ii)for(let e=0;e<2&&y(O.next);e++)O.advance();else if(i==ai)for(let e=0;e<4&&y(O.next);e++)O.advance();else if(i==ni)for(let e=0;e<8&&y(O.next);e++)O.advance();else if(i==ei&&O.next==z){for(O.advance();O.next>=0&&O.next!=x&&O.next!=Y&&O.next!=F&&O.next!=p;)O.advance();O.next==x&&O.advance()}}const pi=D({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qi={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},gi=L.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,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!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[li,ti,Qi,Ti,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qi[O]||-1}],tokenPrec:7652}),u=new rO,J=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function m(O){return(i,e,a)=>{if(a)return!1;let r=i.node.getChild("VariableName");return r&&e(r,O),!0}}const mi={FunctionDefinition:m("function"),ClassDefinition:m("class"),ForStatement(O,i,e){if(e){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")i(a,"variable");else if(a.name=="in")break}},ImportStatement(O,i){var e,a;let{node:r}=O,t=((e=r.firstChild)===null||e===void 0?void 0:e.name)=="from";for(let Q=r.getChild("import");Q;Q=Q.nextSibling)Q.name=="VariableName"&&((a=Q.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&i(Q,t?"variable":"namespace")},AssignStatement(O,i){for(let e=O.node.firstChild;e;e=e.nextSibling)if(e.name=="VariableName")i(e,"variable");else if(e.name==":"||e.name=="AssignOp")break},ParamList(O,i){for(let e=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!e||!/\*|AssignOp/.test(e.name))&&i(a,"variable"),e=a},CapturePattern:m("variable"),AsPattern:m("variable"),__proto__:null};function A(O,i){let e=u.get(i);if(e)return e;let a=[],r=!0;function t(Q,o){let g=O.sliceString(Q.from,Q.to);a.push({label:g,type:o})}return i.cursor(aO.IncludeAnonymous).iterate(Q=>{if(Q.name){let o=mi[Q.name];if(o&&o(Q,t,r)||!r&&J.has(Q.name))return!1;r=!1}else if(Q.to-Q.from>8192){for(let o of A(O,Q.node))a.push(o);return!1}}),u.set(i,a),a}const V=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,I=["String","FormatString","Comment","PropertyName"];function Pi(O){let i=H(O.state).resolveInner(O.pos,-1);if(I.indexOf(i.name)>-1)return null;let e=i.name=="VariableName"||i.to-i.from<20&&V.test(O.state.sliceDoc(i.from,i.to));if(!e&&!O.explicit)return null;let a=[];for(let r=i;r;r=r.parent)J.has(r.name)&&(a=a.concat(A(O.state.doc,r)));return{options:a,from:e?i.from:O.pos,validFor:V}}const $i=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),hi=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: +import{E as h,C as N,s as D,t as n,b as L,g as H,d as B,L as K,i as M,j as X,f as OO,k as iO,a as eO,I as aO,e as nO,N as rO,m as d}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const QO=1,w=194,Z=195,tO=196,_=197,oO=198,dO=199,sO=200,lO=2,E=3,k=201,TO=24,SO=25,pO=49,qO=50,gO=55,mO=56,PO=57,$O=59,hO=60,cO=61,XO=62,fO=63,yO=65,WO=238,zO=71,RO=241,vO=242,_O=243,kO=244,xO=245,UO=246,uO=247,VO=248,j=72,bO=249,GO=250,wO=251,ZO=252,EO=253,jO=254,YO=255,FO=256,CO=73,JO=77,AO=263,IO=112,NO=130,DO=151,LO=152,HO=155,p=10,q=13,R=32,c=9,v=35,BO=40,KO=46,z=123,x=125,Y=39,F=34,MO=92,Oi=111,ii=120,ei=78,ai=117,ni=85,ri=new Set([SO,pO,qO,AO,yO,NO,mO,PO,WO,XO,fO,j,CO,JO,hO,cO,DO,LO,HO,IO]);function f(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qi=new h((O,i)=>{let e;if(O.next<0)O.acceptToken(dO);else if(i.context.flags&P)f(O.next)&&O.acceptToken(oO,1);else if(((e=O.peek(-1))<0||f(e))&&i.canShift(_)){let a=0;for(;O.next==R||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==v)&&O.acceptToken(_,-a)}else f(O.next)&&O.acceptToken(tO,1)},{contextual:!0}),ti=new h((O,i)=>{let e=i.context;if(e.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,t=0;for(;;){if(O.next==R)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),t++}r!=e.indent&&O.next!=p&&O.next!=q&&O.next!=v&&(r[O,i|C])),si=new N({start:oi,reduce(O,i,e,a){return O.flags&P&&ri.has(i)||(i==zO||i==j)&&O.flags&C?O.parent:O},shift(O,i,e,a){return i==w?new $(O,di(a.read(a.pos,e.pos)),0):i==Z?O.parent:i==TO||i==gO||i==$O||i==E?new $(O,0,P):U.has(i)?new $(O,0,U.get(i)|O.flags&P):O},hash(O){return O.hash}}),li=new h(O=>{for(let i=0;i<5;i++){if(O.next!="print".charCodeAt(i))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let i=0;;i++){let e=O.peek(i);if(!(e==R||e==c)){e!=BO&&e!=KO&&e!=p&&e!=q&&e!=v&&O.acceptToken(QO);return}}}),Ti=new h((O,i)=>{let{flags:e}=i.context,a=e&s?F:Y,r=(e&l)>0,t=!(e&T),Q=(e&S)>0,o=O.pos;for(;!(O.next<0);)if(Q&&O.next==z)if(O.peek(1)==z)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(t&&O.next==MO){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Si(O,g)),O.acceptToken(lO);return}break}else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(k,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(k);return}break}else O.advance();O.pos>o&&O.acceptToken(sO)});function Si(O,i){if(i==Oi)for(let e=0;e<2&&O.next>=48&&O.next<=55;e++)O.advance();else if(i==ii)for(let e=0;e<2&&y(O.next);e++)O.advance();else if(i==ai)for(let e=0;e<4&&y(O.next);e++)O.advance();else if(i==ni)for(let e=0;e<8&&y(O.next);e++)O.advance();else if(i==ei&&O.next==z){for(O.advance();O.next>=0&&O.next!=x&&O.next!=Y&&O.next!=F&&O.next!=p;)O.advance();O.next==x&&O.advance()}}const pi=D({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qi={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as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%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[li,ti,Qi,Ti,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qi[O]||-1}],tokenPrec:7652}),u=new rO,J=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function m(O){return(i,e,a)=>{if(a)return!1;let r=i.node.getChild("VariableName");return r&&e(r,O),!0}}const mi={FunctionDefinition:m("function"),ClassDefinition:m("class"),ForStatement(O,i,e){if(e){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")i(a,"variable");else if(a.name=="in")break}},ImportStatement(O,i){var e,a;let{node:r}=O,t=((e=r.firstChild)===null||e===void 0?void 0:e.name)=="from";for(let Q=r.getChild("import");Q;Q=Q.nextSibling)Q.name=="VariableName"&&((a=Q.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&i(Q,t?"variable":"namespace")},AssignStatement(O,i){for(let e=O.node.firstChild;e;e=e.nextSibling)if(e.name=="VariableName")i(e,"variable");else if(e.name==":"||e.name=="AssignOp")break},ParamList(O,i){for(let e=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!e||!/\*|AssignOp/.test(e.name))&&i(a,"variable"),e=a},CapturePattern:m("variable"),AsPattern:m("variable"),__proto__:null};function A(O,i){let e=u.get(i);if(e)return e;let a=[],r=!0;function t(Q,o){let g=O.sliceString(Q.from,Q.to);a.push({label:g,type:o})}return i.cursor(aO.IncludeAnonymous).iterate(Q=>{if(Q.name){let o=mi[Q.name];if(o&&o(Q,t,r)||!r&&J.has(Q.name))return!1;r=!1}else if(Q.to-Q.from>8192){for(let o of A(O,Q.node))a.push(o);return!1}}),u.set(i,a),a}const V=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,I=["String","FormatString","Comment","PropertyName"];function Pi(O){let i=H(O.state).resolveInner(O.pos,-1);if(I.indexOf(i.name)>-1)return null;let e=i.name=="VariableName"||i.to-i.from<20&&V.test(O.state.sliceDoc(i.from,i.to));if(!e&&!O.explicit)return null;let a=[];for(let r=i;r;r=r.parent)J.has(r.name)&&(a=a.concat(A(O.state.doc,r)));return{options:a,from:e?i.from:O.pos,validFor:V}}const $i=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),hi=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: `,{label:"if",detail:"block",type:"keyword"}),d("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),d("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),d("import ${module}",{label:"import",detail:"statement",type:"keyword"}),d("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ci=B(I,nO($i.concat(hi)));function b(O){let{node:i,pos:e}=O,a=O.lineIndent(e,-1),r=null;for(;;){let t=i.childBefore(e);if(t)if(t.name=="Comment")e=t.from;else if(t.name=="Body")O.baseIndentFor(t)+O.unit<=a&&(r=t),i=t;else if(t.type.is("Statement"))i=t;else break;else break}return r}function G(O,i){let e=O.baseIndentFor(i),a=O.lineAt(O.pos,-1),r=a.from+a.text.length;return/^\s*($|#)/.test(a.text)&&O.node.toe?null:e+O.unit}const W=K.define({name:"python",parser:gi.configure({props:[M.add({Body:O=>{var i;let e=b(O);return(i=G(O,e||O.node))!==null&&i!==void 0?i:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except |finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":X({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":X({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":X({closing:"]"}),"String FormatString":()=>null,Script:O=>{var i;let e=b(O);return(i=e&&G(O,e))!==null&&i!==void 0?i:O.continue()}}),OO.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":iO,Body:(O,i)=>({from:O.from+1,to:O.to-(O.to==i.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function Ri(){return new eO(W,[W.data.of({autocomplete:Pi}),W.data.of({autocomplete:ci})])}export{ci as globalCompletion,Pi as localCompletionSource,Ri as python,W as pythonLanguage}; diff --git a/assets/index-PJUOLX06.js b/assets/index-D93eCjLG.js similarity index 99% rename from assets/index-PJUOLX06.js rename to assets/index-D93eCjLG.js index 4f8e52a..954efee 100644 --- a/assets/index-PJUOLX06.js +++ b/assets/index-D93eCjLG.js @@ -1 +1 @@ -import{E as R,C as G,s as u,t as $,b as w,L as v,f as g,k as V,i as U,c as b,n as q,a as E}from"./MarkdownEditor-BcjjWJJf.js";import"./index-CI8FOYx1.js";import"./index.lazy-B3BXRqZi.js";import"./isAddressEqual-Cr_byQ5I.js";import"./secp256k1-B_ijNduS.js";const z=154,X=155,C=156,N=1,D=2,f=3,I=157,F=158,Z=4,K=5,L=159,p=160,W=161,s=162,T=6,h=7,A=8,B=9,c=0,i=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],M=58,J=40,P=95,H=91,l=45,OO=46,m=35,$O=37,j=123,eO=125,o=47,S=42,r=10,_=61,aO=43,QO=38;function d(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function x(O){return O>=48&&O<=57}function k(O){let e;return O.next==o&&((e=O.peek(1))==o||e==S)}const tO=new R((O,e)=>{if(e.dialectEnabled(c)){let a;if(O.next<0&&e.canShift(W))O.acceptToken(W);else if(((a=O.peek(-1))==r||a<0)&&e.canShift(p)){let Q=0;for(;O.next!=r&&i.includes(O.next);)O.advance(),Q++;O.next==r||k(O)?O.acceptToken(p,-Q):Q&&O.acceptToken(s)}else if(O.next==r)O.acceptToken(L,1);else if(i.includes(O.next)){for(O.advance();O.next!=r&&i.includes(O.next);)O.advance();O.acceptToken(s)}}else{let a=0;for(;i.includes(O.next);)O.advance(),a++;a&&O.acceptToken(s)}},{contextual:!0}),nO=new R((O,e)=>{if(k(O)){if(O.advance(),e.dialectEnabled(c)){let a=-1;for(let Q=1;;Q++){let t=O.peek(-Q-1);if(t==r||t<0){a=Q+1;break}else if(!i.includes(t))break}if(a>-1){let Q=O.next==S,t=0;for(O.advance();O.next>=0;)if(O.next==r){O.advance();let n=0;for(;O.next!=r&&i.includes(O.next);)n++,O.advance();if(n=0;)O.advance();O.acceptToken(T)}else{for(O.advance();O.next>=0;){let{next:a}=O;if(O.advance(),a==S&&O.next==o){O.advance();break}}O.acceptToken(h)}}}),rO=new R((O,e)=>{(O.next==aO||O.next==_)&&e.dialectEnabled(c)&&O.acceptToken(O.next==_?A:B,1)}),iO=new R((O,e)=>{if(!e.dialectEnabled(c))return;let a=e.context.depth;if(O.next<0&&a){O.acceptToken(X);return}if(O.peek(-1)==r){let t=0;for(;O.next!=r&&i.includes(O.next);)O.advance(),t++;t!=a&&O.next!=r&&!k(O)&&(t{for(let a=!1,Q=0,t=0;;t++){let{next:n}=O;if(d(n)||n==l||n==P||a&&x(n))!a&&(n!=l||t>0)&&(a=!0),Q===t&&n==l&&Q++,O.advance();else if(n==m&&O.peek(1)==j){O.acceptToken(K,2);break}else{a&&O.acceptToken(n==J?I:Q==2&&e.canShift(Z)?Z:F);break}}}),lO=new R(O=>{if(O.next==eO){for(O.advance();d(O.next)||O.next==l||O.next==P||x(O.next);)O.advance();O.next==m&&O.peek(1)==j?O.acceptToken(D,2):O.acceptToken(N)}}),oO=new R(O=>{if(i.includes(O.peek(-1))){let{next:e}=O;(d(e)||e==P||e==m||e==OO||e==H||e==M||e==l||e==QO)&&O.acceptToken(C)}}),dO=new R(O=>{if(!i.includes(O.peek(-1))){let{next:e}=O;if(e==$O&&(O.advance(),O.acceptToken(f)),d(e)){do O.advance();while(d(O.next));O.acceptToken(f)}}});function Y(O,e){this.parent=O,this.depth=e,this.hash=(O?O.hash+O.hash<<8:0)+e+(e<<4)}const SO=new Y(null,0),cO=new G({start:SO,shift(O,e,a,Q){return e==z?new Y(O,a.pos-Q.pos):e==X?O.parent:O},hash(O){return O.hash}}),sO=u({"AtKeyword import charset namespace keyframes media supports include mixin use forward extend at-root":$.definitionKeyword,"Keyword selector":$.keyword,ControlKeyword:$.controlKeyword,NamespaceName:$.namespace,KeyframeName:$.labelName,TagName:$.tagName,"ClassName Suffix":$.className,PseudoClassName:$.constant($.className),IdName:$.labelName,"FeatureName PropertyName":$.propertyName,AttributeName:$.attributeName,NumberLiteral:$.number,KeywordQuery:$.keyword,UnaryQueryOp:$.operatorKeyword,"CallTag ValueName":$.atom,VariableName:$.variableName,SassVariableName:$.special($.variableName),Callee:$.operatorKeyword,Unit:$.unit,"UniversalSelector NestingSelector IndentedMixin IndentedInclude":$.definitionOperator,MatchOp:$.compareOperator,"ChildOp SiblingOp, LogicOp":$.logicOperator,BinOp:$.arithmeticOperator,"Important Global Default":$.modifier,Comment:$.blockComment,LineComment:$.lineComment,ColorLiteral:$.color,"ParenthesizedContent StringLiteral":$.string,"InterpolationStart InterpolationContinue InterpolationEnd":$.meta,': "..."':$.punctuation,"PseudoOp #":$.derefOperator,"; ,":$.separator,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace}),XO={__proto__:null,not:62,only:62,using:179,as:189,with:193,without:193,hide:207,show:207,from:230,to:232,if:245,through:251,in:257},yO={__proto__:null,url:80,"url-prefix":80,domain:80,regexp:80,lang:94,"nth-child":94,"nth-last-child":94,"nth-of-type":94,"nth-last-of-type":94,dir:94,"host-context":94,selector:172},PO={__proto__:null,"@import":156,"@include":176,"@mixin":182,"@function":182,"@use":186,"@extend":196,"@at-root":200,"@forward":204,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@if":240,"@else":242,"@for":248,"@each":254,"@while":260,"@debug":264,"@warn":264,"@error":264,"@return":264},mO=w.deserialize({version:14,states:"L|Q`Q+tOOO#fQ+tOOP#mOpOOOOQ#U'#Ch'#ChO#rQ(pO'#CjOOQ#U'#Ci'#CiO%_Q)QO'#FxO%rQ.jO'#CnO&jQ#dO'#DWO'aQ(pO'#CgO'hQ)OO'#DYO'sQ#dO'#DaO'xQ#dO'#DeO'}Q#dO'#DnOOQ#U'#Fx'#FxO(SQ(pO'#FxO(ZQ(nO'#DrO%rQ.jO'#DzO%rQ.jO'#EVO%rQ.jO'#EYO%rQ.jO'#E[O(`Q)OO'#EaO)QQ)OO'#EcO%rQ.jO'#EeO)_Q)OO'#EhO%rQ.jO'#EjO)yQ)OO'#ElO*UQ#dO'#EoO*ZQ)OO'#EuO*oQ)OO'#FVOOQ&Z'#Fw'#FwOOQ&Y'#FY'#FYO*yQ(nO'#FYQ`Q+tOOO%rQ.jO'#EwO+UQ(nO'#E{O+ZQ)OO'#FOO%rQ.jO'#FRO%rQ.jO'#FTOOQ&Z'#Fa'#FaO+cQ+uO'#GRO+pQ(oO'#GRQOQ#SOOP,RO#SO'#FvPOOO)CAk)CAkOOQ#U'#Cm'#CmOOQ#U,59W,59WOOQ#i'#Cp'#CpO%rQ.jO'#CsO,aQ.wO'#CuO.|Q.^O,59YO%rQ.jO'#CzOOQ#S'#DO'#DOO/_Q(nO'#DTOOQ#i'#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S$R;'S;=`$d<%lO$RZN{UOy$Rz#f$R#f#gNe#g;'S$R;'S;=`$d<%lO$RZ! dS!eROy$Rz;'S$R;'S;=`$d<%lO$RZ! uS!mROy$Rz;'S$R;'S;=`$d<%lO$R]!!WU!aPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!!mP;=`<%l#r",tokenizers:[iO,oO,lO,dO,RO,tO,nO,rO,0,1,2,3],topRules:{StyleSheet:[0,10],Styles:[1,134]},dialects:{indented:0},specialized:[{term:158,get:O=>XO[O]||-1},{term:157,get:O=>yO[O]||-1},{term:77,get:O=>PO[O]||-1}],tokenPrec:3003}),y=v.define({name:"sass",parser:mO.configure({props:[g.add({Block:V,Comment(O,e){return{from:O.from+2,to:e.sliceDoc(O.to-2,O.to)=="*/"?O.to-2:O.to}}}),U.add({Declaration:b()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),kO=y.configure({dialect:"indented",props:[U.add({"Block RuleSet":O=>O.baseIndent+O.unit}),g.add({Block:O=>({from:O.from,to:O.to})})]}),fO=q(O=>O.name=="VariableName"||O.name=="SassVariableName");function _O(O){return new E(O!=null&&O.indented?kO:y,y.data.of({autocomplete:fO}))}export{_O as sass,fO as sassCompletionSource,y as sassLanguage}; +import{E as R,C as G,s as u,t as $,b as w,L as v,f as g,k as V,i as U,c as b,n as q,a as E}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const z=154,X=155,C=156,N=1,D=2,f=3,I=157,F=158,Z=4,K=5,L=159,p=160,W=161,s=162,T=6,h=7,A=8,B=9,c=0,i=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],M=58,J=40,P=95,H=91,l=45,OO=46,m=35,$O=37,j=123,eO=125,o=47,S=42,r=10,_=61,aO=43,QO=38;function d(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function x(O){return O>=48&&O<=57}function k(O){let e;return O.next==o&&((e=O.peek(1))==o||e==S)}const tO=new R((O,e)=>{if(e.dialectEnabled(c)){let a;if(O.next<0&&e.canShift(W))O.acceptToken(W);else if(((a=O.peek(-1))==r||a<0)&&e.canShift(p)){let Q=0;for(;O.next!=r&&i.includes(O.next);)O.advance(),Q++;O.next==r||k(O)?O.acceptToken(p,-Q):Q&&O.acceptToken(s)}else if(O.next==r)O.acceptToken(L,1);else if(i.includes(O.next)){for(O.advance();O.next!=r&&i.includes(O.next);)O.advance();O.acceptToken(s)}}else{let a=0;for(;i.includes(O.next);)O.advance(),a++;a&&O.acceptToken(s)}},{contextual:!0}),nO=new R((O,e)=>{if(k(O)){if(O.advance(),e.dialectEnabled(c)){let a=-1;for(let Q=1;;Q++){let t=O.peek(-Q-1);if(t==r||t<0){a=Q+1;break}else if(!i.includes(t))break}if(a>-1){let Q=O.next==S,t=0;for(O.advance();O.next>=0;)if(O.next==r){O.advance();let n=0;for(;O.next!=r&&i.includes(O.next);)n++,O.advance();if(n=0;)O.advance();O.acceptToken(T)}else{for(O.advance();O.next>=0;){let{next:a}=O;if(O.advance(),a==S&&O.next==o){O.advance();break}}O.acceptToken(h)}}}),rO=new R((O,e)=>{(O.next==aO||O.next==_)&&e.dialectEnabled(c)&&O.acceptToken(O.next==_?A:B,1)}),iO=new R((O,e)=>{if(!e.dialectEnabled(c))return;let a=e.context.depth;if(O.next<0&&a){O.acceptToken(X);return}if(O.peek(-1)==r){let t=0;for(;O.next!=r&&i.includes(O.next);)O.advance(),t++;t!=a&&O.next!=r&&!k(O)&&(t{for(let a=!1,Q=0,t=0;;t++){let{next:n}=O;if(d(n)||n==l||n==P||a&&x(n))!a&&(n!=l||t>0)&&(a=!0),Q===t&&n==l&&Q++,O.advance();else if(n==m&&O.peek(1)==j){O.acceptToken(K,2);break}else{a&&O.acceptToken(n==J?I:Q==2&&e.canShift(Z)?Z:F);break}}}),lO=new R(O=>{if(O.next==eO){for(O.advance();d(O.next)||O.next==l||O.next==P||x(O.next);)O.advance();O.next==m&&O.peek(1)==j?O.acceptToken(D,2):O.acceptToken(N)}}),oO=new R(O=>{if(i.includes(O.peek(-1))){let{next:e}=O;(d(e)||e==P||e==m||e==OO||e==H||e==M||e==l||e==QO)&&O.acceptToken(C)}}),dO=new R(O=>{if(!i.includes(O.peek(-1))){let{next:e}=O;if(e==$O&&(O.advance(),O.acceptToken(f)),d(e)){do O.advance();while(d(O.next));O.acceptToken(f)}}});function Y(O,e){this.parent=O,this.depth=e,this.hash=(O?O.hash+O.hash<<8:0)+e+(e<<4)}const SO=new Y(null,0),cO=new G({start:SO,shift(O,e,a,Q){return e==z?new Y(O,a.pos-Q.pos):e==X?O.parent:O},hash(O){return O.hash}}),sO=u({"AtKeyword import charset namespace keyframes media supports include mixin use forward extend at-root":$.definitionKeyword,"Keyword selector":$.keyword,ControlKeyword:$.controlKeyword,NamespaceName:$.namespace,KeyframeName:$.labelName,TagName:$.tagName,"ClassName Suffix":$.className,PseudoClassName:$.constant($.className),IdName:$.labelName,"FeatureName PropertyName":$.propertyName,AttributeName:$.attributeName,NumberLiteral:$.number,KeywordQuery:$.keyword,UnaryQueryOp:$.operatorKeyword,"CallTag ValueName":$.atom,VariableName:$.variableName,SassVariableName:$.special($.variableName),Callee:$.operatorKeyword,Unit:$.unit,"UniversalSelector NestingSelector IndentedMixin IndentedInclude":$.definitionOperator,MatchOp:$.compareOperator,"ChildOp SiblingOp, LogicOp":$.logicOperator,BinOp:$.arithmeticOperator,"Important Global Default":$.modifier,Comment:$.blockComment,LineComment:$.lineComment,ColorLiteral:$.color,"ParenthesizedContent StringLiteral":$.string,"InterpolationStart InterpolationContinue InterpolationEnd":$.meta,': "..."':$.punctuation,"PseudoOp #":$.derefOperator,"; ,":$.separator,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace}),XO={__proto__:null,not:62,only:62,using:179,as:189,with:193,without:193,hide:207,show:207,from:230,to:232,if:245,through:251,in:257},yO={__proto__:null,url:80,"url-prefix":80,domain:80,regexp:80,lang:94,"nth-child":94,"nth-last-child":94,"nth-of-type":94,"nth-last-of-type":94,dir:94,"host-context":94,selector:172},PO={__proto__:null,"@import":156,"@include":176,"@mixin":182,"@function":182,"@use":186,"@extend":196,"@at-root":200,"@forward":204,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@if":240,"@else":242,"@for":248,"@each":254,"@while":260,"@debug":264,"@warn":264,"@error":264,"@return":264},mO=w.deserialize({version:14,states:"L|Q`Q+tOOO#fQ+tOOP#mOpOOOOQ#U'#Ch'#ChO#rQ(pO'#CjOOQ#U'#Ci'#CiO%_Q)QO'#FxO%rQ.jO'#CnO&jQ#dO'#DWO'aQ(pO'#CgO'hQ)OO'#DYO'sQ#dO'#DaO'xQ#dO'#DeO'}Q#dO'#DnOOQ#U'#Fx'#FxO(SQ(pO'#FxO(ZQ(nO'#DrO%rQ.jO'#DzO%rQ.jO'#EVO%rQ.jO'#EYO%rQ.jO'#E[O(`Q)OO'#EaO)QQ)OO'#EcO%rQ.jO'#EeO)_Q)OO'#EhO%rQ.jO'#EjO)yQ)OO'#ElO*UQ#dO'#EoO*ZQ)OO'#EuO*oQ)OO'#FVOOQ&Z'#Fw'#FwOOQ&Y'#FY'#FYO*yQ(nO'#FYQ`Q+tOOO%rQ.jO'#EwO+UQ(nO'#E{O+ZQ)OO'#FOO%rQ.jO'#FRO%rQ.jO'#FTOOQ&Z'#Fa'#FaO+cQ+uO'#GRO+pQ(oO'#GRQOQ#SOOP,RO#SO'#FvPOOO)CAk)CAkOOQ#U'#Cm'#CmOOQ#U,59W,59WOOQ#i'#Cp'#CpO%rQ.jO'#CsO,aQ.wO'#CuO.|Q.^O,59YO%rQ.jO'#CzOOQ#S'#DO'#DOO/_Q(nO'#DTOOQ#i'#Fz'#FzO/dQ(nO'#C}OOQ#U'#DX'#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R#f#gNe#g;'S$R;'S;=`$d<%lO$RZ! dS!eROy$Rz;'S$R;'S;=`$d<%lO$RZ! uS!mROy$Rz;'S$R;'S;=`$d<%lO$R]!!WU!aPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!!mP;=`<%l#r",tokenizers:[iO,oO,lO,dO,RO,tO,nO,rO,0,1,2,3],topRules:{StyleSheet:[0,10],Styles:[1,134]},dialects:{indented:0},specialized:[{term:158,get:O=>XO[O]||-1},{term:157,get:O=>yO[O]||-1},{term:77,get:O=>PO[O]||-1}],tokenPrec:3003}),y=v.define({name:"sass",parser:mO.configure({props:[g.add({Block:V,Comment(O,e){return{from:O.from+2,to:e.sliceDoc(O.to-2,O.to)=="*/"?O.to-2:O.to}}}),U.add({Declaration:b()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),kO=y.configure({dialect:"indented",props:[U.add({"Block RuleSet":O=>O.baseIndent+O.unit}),g.add({Block:O=>({from:O.from,to:O.to})})]}),fO=q(O=>O.name=="VariableName"||O.name=="SassVariableName");function _O(O){return new E(O!=null&&O.indented?kO:y,y.data.of({autocomplete:fO}))}export{_O as sass,fO as sassCompletionSource,y as sassLanguage}; diff --git a/assets/index-BzFGR1qi.js b/assets/index-DASPBQ9R.js similarity index 99% rename from assets/index-BzFGR1qi.js rename to assets/index-DASPBQ9R.js index 48631d6..35580d2 100644 --- a/assets/index-BzFGR1qi.js +++ b/assets/index-DASPBQ9R.js @@ -1,2 +1,2 @@ -import{i as te,c as ae,f as re,s as ne,t as i,L as ie,a as se,E as oe,b as le,d as ce,e as de,g as me}from"./MarkdownEditor-BcjjWJJf.js";import"./index-CI8FOYx1.js";import"./index.lazy-B3BXRqZi.js";import"./isAddressEqual-Cr_byQ5I.js";import"./secp256k1-B_ijNduS.js";const ue=36,X=1,fe=2,b=3,C=4,pe=5,ge=6,he=7,_e=8,be=9,ve=10,ye=11,ke=12,xe=13,Oe=14,we=15,Qe=16,Ce=17,I=18,Se=19,A=20,E=21,R=22,Pe=23,qe=24;function P(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function Te(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function g(t,e,r){for(let a=!1;;){if(t.next<0)return;if(t.next==e&&!a){t.advance();return}a=r&&!a&&t.next==92,t.advance()}}function Ue(t,e){e:for(;;){if(t.next<0)return;if(t.next==36){t.advance();for(let r=0;r)".charCodeAt(r);for(;;){if(t.next<0)return;if(t.next==a&&t.peek(1)==39){t.advance(2);return}t.advance()}}function q(t,e){for(;!(t.next!=95&&!P(t.next));)e!=null&&(e+=String.fromCharCode(t.next)),t.advance();return e}function Le(t){if(t.next==39||t.next==34||t.next==96){let e=t.next;t.advance(),g(t,e,!1)}else q(t)}function j(t,e){for(;t.next==48||t.next==49;)t.advance();e&&t.next==e&&t.advance()}function D(t,e){for(;;){if(t.next==46){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(t.next==69||t.next==101)for(t.advance(),(t.next==43||t.next==45)&&t.advance();t.next>=48&&t.next<=57;)t.advance()}function Z(t){for(;!(t.next<0||t.next==10);)t.advance()}function p(t,e){for(let r=0;r=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function Te(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function g(t,e,r){for(let a=!1;;){if(t.next<0)return;if(t.next==e&&!a){t.advance();return}a=r&&!a&&t.next==92,t.advance()}}function Ue(t,e){e:for(;;){if(t.next<0)return;if(t.next==36){t.advance();for(let r=0;r)".charCodeAt(r);for(;;){if(t.next<0)return;if(t.next==a&&t.peek(1)==39){t.advance(2);return}t.advance()}}function q(t,e){for(;!(t.next!=95&&!P(t.next));)e!=null&&(e+=String.fromCharCode(t.next)),t.advance();return e}function Le(t){if(t.next==39||t.next==34||t.next==96){let e=t.next;t.advance(),g(t,e,!1)}else q(t)}function j(t,e){for(;t.next==48||t.next==49;)t.advance();e&&t.next==e&&t.advance()}function D(t,e){for(;;){if(t.next==46){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(t.next==69||t.next==101)for(t.advance(),(t.next==43||t.next==45)&&t.advance();t.next>=48&&t.next<=57;)t.advance()}function Z(t){for(;!(t.next<0||t.next==10);)t.advance()}function p(t,e){for(let r=0;r!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:W(_,h)};function Be(t,e,r,a){let n={};for(let s in T)n[s]=(t.hasOwnProperty(s)?t:T)[s];return e&&(n.words=W(e,r||"",a)),n}function K(t){return new oe(e=>{var r;let{next:a}=e;if(e.advance(),p(a,S)){for(;p(e.next,S);)e.advance();e.acceptToken(ue)}else if(a==36&&t.doubleDollarQuotedStrings){let n=q(e,"");e.next==36&&(e.advance(),Ue(e,n),e.acceptToken(b))}else if(a==39||a==34&&t.doubleQuotedStrings)g(e,a,t.backslashEscapes),e.acceptToken(b);else if(a==35&&t.hashComments||a==47&&e.next==47&&t.slashComments)Z(e),e.acceptToken(X);else if(a==45&&e.next==45&&(!t.spaceAfterDashes||e.peek(1)==32))Z(e),e.acceptToken(X);else if(a==47&&e.next==42){e.advance();for(let n=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(n--,e.advance(),!n)break}else s==47&&e.next==42&&(n++,e.advance())}e.acceptToken(fe)}else if((a==101||a==69)&&e.next==39)e.advance(),g(e,39,!0),e.acceptToken(b);else if((a==110||a==78)&&e.next==39&&t.charSetCasts)e.advance(),g(e,39,t.backslashEscapes),e.acceptToken(b);else if(a==95&&t.charSetCasts)for(let n=0;;n++){if(e.next==39&&n>1){e.advance(),g(e,39,t.backslashEscapes),e.acceptToken(b);break}if(!P(e.next))break;e.advance()}else if(t.plsqlQuotingMechanism&&(a==113||a==81)&&e.next==39&&e.peek(1)>0&&!p(e.peek(1),S)){let n=e.peek(1);e.advance(2),ze(e,n),e.acceptToken(b)}else if(a==40)e.acceptToken(he);else if(a==41)e.acceptToken(_e);else if(a==123)e.acceptToken(be);else if(a==125)e.acceptToken(ve);else if(a==91)e.acceptToken(ye);else if(a==93)e.acceptToken(ke);else if(a==59)e.acceptToken(xe);else if(t.unquotedBitLiterals&&a==48&&e.next==98)e.advance(),j(e),e.acceptToken(R);else if((a==98||a==66)&&(e.next==39||e.next==34)){const n=e.next;e.advance(),t.treatBitsAsBytes?(g(e,n,t.backslashEscapes),e.acceptToken(Pe)):(j(e,n),e.acceptToken(R))}else if(a==48&&(e.next==120||e.next==88)||(a==120||a==88)&&e.next==39){let n=e.next==39;for(e.advance();Te(e.next);)e.advance();n&&e.next==39&&e.advance(),e.acceptToken(C)}else if(a==46&&e.next>=48&&e.next<=57)D(e,!0),e.acceptToken(C);else if(a==46)e.acceptToken(Oe);else if(a>=48&&a<=57)D(e,!1),e.acceptToken(C);else if(p(a,t.operatorChars)){for(;p(e.next,t.operatorChars);)e.advance();e.acceptToken(we)}else if(p(a,t.specialVar))e.next==a&&e.advance(),Le(e),e.acceptToken(Ce);else if(p(a,t.identifierQuotes))g(e,a,!1),e.acceptToken(Se);else if(a==58||a==44)e.acceptToken(Qe);else if(P(a)){let n=q(e,String.fromCharCode(a));e.acceptToken(e.next==46||e.peek(-n.length-1)==46?I:(r=t.words[n.toLowerCase()])!==null&&r!==void 0?r:I)}})}const M=K(T),Xe=le.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,M],topRules:{Script:[0,25]},tokenPrec:0});function U(t){let e=t.cursor().moveTo(t.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function y(t,e){let r=t.sliceString(e.from,e.to),a=/^([`'"])(.*)\1$/.exec(r);return a?a[2]:r}function w(t){return t&&(t.name=="Identifier"||t.name=="QuotedIdentifier")}function Ie(t,e){if(e.name=="CompositeIdentifier"){let r=[];for(let a=e.firstChild;a;a=a.nextSibling)w(a)&&r.push(y(t,a));return r}return[y(t,e)]}function N(t,e){for(let r=[];;){if(!e||e.name!=".")return r;let a=U(e);if(!w(a))return r;r.unshift(y(t,a)),e=U(a)}}function Re(t,e){let r=me(t).resolveInner(e,-1),a=De(t.doc,r);return r.name=="Identifier"||r.name=="QuotedIdentifier"||r.name=="Keyword"?{from:r.from,quoted:r.name=="QuotedIdentifier"?t.doc.sliceString(r.from,r.from+1):null,parents:N(t.doc,U(r)),aliases:a}:r.name=="."?{from:e,quoted:null,parents:N(t.doc,r),aliases:a}:{from:e,quoted:null,parents:[],empty:!0,aliases:a}}const je=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function De(t,e){let r;for(let n=e;!r;n=n.parent){if(!n)return null;n.name=="Statement"&&(r=n)}let a=null;for(let n=r.firstChild,s=!1,c=null;n;n=n.nextSibling){let l=n.name=="Keyword"?t.sliceString(n.from,n.to).toLowerCase():null,o=null;if(!s)s=l=="from";else if(l=="as"&&c&&w(n.nextSibling))o=y(t,n.nextSibling);else{if(l&&je.has(l))break;c&&w(n)&&(o=y(t,n))}o&&(a||(a=Object.create(null)),a[o]=Ie(t,c)),c=/Identifier$/.test(n.name)?n:null}return a}function Ze(t,e){return t?e.map(r=>Object.assign(Object.assign({},r),{label:r.label[0]==t?r.label:t+r.label+t,apply:void 0})):e}const Ne=/^\w*$/,Ve=/^[`'"]?\w*[`'"]?$/;function V(t){return t.self&&typeof t.self.label=="string"}class z{constructor(e,r){this.idQuote=e,this.idCaseInsensitive=r,this.list=[],this.children=void 0}child(e){let r=this.children||(this.children=Object.create(null)),a=r[e];return a||(e&&!this.list.some(n=>n.label==e)&&this.list.push($(e,"type",this.idQuote,this.idCaseInsensitive)),r[e]=new z(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let r=this.list.findIndex(a=>a.label==e.label);r>-1?this.list[r]=e:this.list.push(e)}addCompletions(e){for(let r of e)this.addCompletion(typeof r=="string"?$(r,"property",this.idQuote,this.idCaseInsensitive):r)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):V(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let r of Object.keys(e)){let a=e[r],n=null,s=r.replace(/\\?\./g,l=>l=="."?"\0":l).split("\0"),c=this;V(a)&&(n=a.self,a=a.children);for(let l=0;l{let{parents:v,from:H,quoted:k,empty:J,aliases:x}=Re(f.state,f.pos);if(J&&!f.explicit)return null;x&&v.length==1&&(v=x[v[0]]||v);let d=o;for(let O of v){for(;!d.children||!d.children[O];)if(d==o&&u)d=u;else if(d==u&&a)d=d.child(a);else return null;let B=d.maybeChild(O);if(!B)return null;d=B}let ee=k&&f.state.sliceDoc(f.pos,f.pos+1)==k,Q=d.list;return d==o&&x&&(Q=Q.concat(Object.keys(x).map(O=>({label:O,type:"constant"})))),{from:H,to:ee?f.pos+1:void 0,options:Ze(k,Q),validFor:k?Ve:Ne}}}function Ae(t){return t==E?"type":t==A?"keyword":"variable"}function Ee(t,e,r){let a=Object.keys(t).map(n=>r(e?n.toUpperCase():n,Ae(t[n])));return ce(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],de(a))}let We=Xe.configure({props:[te.add({Statement:ae()}),re.add({Statement(t,e){return{from:Math.min(t.from+100,e.doc.lineAt(t.from).to),to:t.to}},BlockComment(t){return{from:t.from+2,to:t.to-2}}}),ne({Keyword:i.keyword,Type:i.typeName,Builtin:i.standard(i.name),Bits:i.number,Bytes:i.string,Bool:i.bool,Null:i.null,Number:i.number,String:i.string,Identifier:i.name,QuotedIdentifier:i.special(i.string),SpecialVar:i.special(i.name),LineComment:i.lineComment,BlockComment:i.blockComment,Operator:i.operator,"Semi Punctuation":i.punctuation,"( )":i.paren,"{ }":i.brace,"[ ]":i.squareBracket})]});class m{constructor(e,r,a){this.dialect=e,this.language=r,this.spec=a}get extension(){return this.language.extension}static define(e){let r=Be(e,e.keywords,e.types,e.builtin),a=ie.define({name:"sql",parser:We.configure({tokenizers:[{from:M,to:K(r)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new m(r,a,e)}}function Ke(t,e){return{label:t,type:e,boost:-1}}function Me(t,e=!1,r){return Ee(t.dialect.words,e,r||Ke)}function Fe(t){return t.schema?$e(t.schema,t.tables,t.schemas,t.defaultTable,t.defaultSchema,t.dialect||L):()=>null}function Ge(t){return t.schema?(t.dialect||L).language.data.of({autocomplete:Fe(t)}):[]}function at(t={}){let e=t.dialect||L;return new se(e.language,[Ge(t),e.language.data.of({autocomplete:Me(e,t.upperCaseKeywords,t.keywordCompletion)})])}const L=m.define({}),rt=m.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:_+"abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",types:h+"bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"}),F="accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill",G=h+"bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int1 int2 int3 int4 int8 float4 float8 varbinary varcharacter precision datetime unsigned signed",Y="charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee",nt=m.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:_+"group_concat "+F,types:G,builtin:Y}),it=m.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:_+"always generated groupby_concat hard persistent shutdown soft virtual "+F,types:G,builtin:Y}),st=m.define({keywords:_+"trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock pivot readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx unpivot updlock with",types:h+"bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",builtin:"binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id",operatorChars:"*+-%<>!=^&|/",specialVar:"@"}),ot=m.define({keywords:_+"abort analyze attach autoincrement conflict database detach exclusive fail glob ignore index indexed instead isnull notnull offset plan pragma query raise regexp reindex rename replace temp vacuum virtual",types:h+"bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int2 int8 unsigned signed real",builtin:"auth backup bail changes clone databases dbinfo dump echo eqp explain fullschema headers help import imposter indexes iotrace lint load log mode nullvalue once print prompt quit restore save scanstats separator shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),lt=m.define({keywords:"add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime infinity NaN",types:h+"ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",slashComments:!0}),ct=m.define({keywords:_+"abort accept access add all alter and any arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body by case cast char_base check close cluster clusters colauth column comment commit compress connected constant constraint crash create current currval cursor data_base database dba deallocate debugoff debugon declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry exception exception_init exchange exclusive exists external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base of off offline on online only option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw rebuild record ref references refresh rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",builtin:"appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define echo editfile embedded feedback flagger flush heading headsep instance linesize lno loboffset logsource longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar repfooter repheader serveroutput shiftinout show showmode spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout timing trimout trimspool ttitle underline verify version wrap",types:h+"ascii bfile bfilename bigserial bit blob dec long number nvarchar nvarchar2 serial smallint string text uid varchar2 xml",operatorChars:"*/+-%<>!=~",doubleQuotedStrings:!0,charSetCasts:!0,plsqlQuotingMechanism:!0});export{lt as Cassandra,st as MSSQL,it as MariaSQL,nt as MySQL,ct as PLSQL,rt as PostgreSQL,m as SQLDialect,ot as SQLite,L as StandardSQL,Me as keywordCompletionSource,Fe as schemaCompletionSource,at as sql}; diff --git a/assets/index-BP0nGub4.js b/assets/index-DHgdPR2R.js similarity index 99% rename from assets/index-BP0nGub4.js rename to assets/index-DHgdPR2R.js index 46e528f..9544cd2 100644 --- a/assets/index-BP0nGub4.js +++ b/assets/index-DHgdPR2R.js @@ -1 +1 @@ -import{E as a,s as o,t as Q,b as Z,L as _,i as q,c as r,f as l,k as w,a as V}from"./MarkdownEditor-BcjjWJJf.js";import"./index-CI8FOYx1.js";import"./index.lazy-B3BXRqZi.js";import"./isAddressEqual-Cr_byQ5I.js";import"./secp256k1-B_ijNduS.js";const R=1,g=2,b=3,y=4,T=5,s=98,c=101,p=102,t=114,v=69,X=48,W=46,d=43,f=45,Y=35,z=34,x=124,U=60,h=62;function n(O){return O>=48&&O<=57}function e(O){return n(O)||O==95}const G=new a((O,i)=>{if(n(O.next)){let P=!1;do O.advance();while(e(O.next));if(O.next==W){if(P=!0,O.advance(),n(O.next))do O.advance();while(e(O.next));else if(O.next==W||O.next>127||/\w/.test(String.fromCharCode(O.next)))return}if(O.next==c||O.next==v){if(P=!0,O.advance(),(O.next==d||O.next==f)&&O.advance(),!e(O.next))return;do O.advance();while(e(O.next))}if(O.next==p){let $=O.peek(1);if($==X+3&&O.peek(2)==X+2||$==X+6&&O.peek(2)==X+4)O.advance(3),P=!0;else return}P&&O.acceptToken(T)}else if(O.next==s||O.next==t){if(O.next==s&&O.advance(),O.next!=t)return;O.advance();let P=0;for(;O.next==Y;)P++,O.advance();if(O.next!=z)return;O.advance();O:for(;;){if(O.next<0)return;let $=O.next==z;if(O.advance(),$){for(let S=0;S{O.next==x&&O.acceptToken(R,1)}),u=new a(O=>{O.next==U?O.acceptToken(g,1):O.next==h&&O.acceptToken(b,1)}),k=o({"const macro_rules struct union enum type fn impl trait let static":Q.definitionKeyword,"mod use crate":Q.moduleKeyword,"pub unsafe async mut extern default move":Q.modifier,"for if else loop while match continue break return await":Q.controlKeyword,"as in ref":Q.operatorKeyword,"where _ crate super dyn":Q.keyword,self:Q.self,String:Q.string,Char:Q.character,RawString:Q.special(Q.string),Boolean:Q.bool,Identifier:Q.variableName,"CallExpression/Identifier":Q.function(Q.variableName),BoundIdentifier:Q.definition(Q.variableName),"FunctionItem/BoundIdentifier":Q.function(Q.definition(Q.variableName)),LoopLabel:Q.labelName,FieldIdentifier:Q.propertyName,"CallExpression/FieldExpression/FieldIdentifier":Q.function(Q.propertyName),Lifetime:Q.special(Q.variableName),ScopeIdentifier:Q.namespace,TypeIdentifier:Q.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":Q.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":Q.macroName,'"!"':Q.macroName,UpdateOp:Q.updateOperator,LineComment:Q.lineComment,BlockComment:Q.blockComment,Integer:Q.integer,Float:Q.float,ArithOp:Q.arithmeticOperator,LogicOp:Q.logicOperator,BitOp:Q.bitwiseOperator,CompareOp:Q.compareOperator,"=":Q.definitionOperator,".. ... => ->":Q.punctuation,"( )":Q.paren,"[ ]":Q.squareBracket,"{ }":Q.brace,". DerefOp":Q.derefOperator,"&":Q.operator,", ; ::":Q.separator,"Attribute/...":Q.meta}),j={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395,fn:396,trait:412,use:420,static:438,dyn:476},E=Z.deserialize({version:14,states:"$2xQ]Q_OOP$wOWOOO&sQWO'#CnO)WQWO'#I`OOQP'#I`'#I`OOQQ'#Ie'#IeO)hO`O'#C}OOQR'#Ih'#IhO)sQWO'#IuOOQO'#Hk'#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v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-t-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[k],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!b#6S!b!c#7U!c!}#8W!}#O#:T#O#P#;V#P#Q#Cb#Q#R#Dd#R#S#8W#S#T$n#T#U#8W#U#V#El#V#f#8W#f#g#Ic#g#o#8W#o#p$ S#p#q$!U#q#r$$f#r${$n${$|#8W$|4w$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q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n",tokenizers:[m,u,G,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:O=>j[O]||-1}],tokenPrec:15596}),I=_.define({name:"rust",parser:E.configure({props:[q.add({IfExpression:r({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:O=>O.continue(),"Statement MatchArm":r()}),l.add(O=>{if(/(Block|edTokens|List)$/.test(O.name))return w;if(O.name=="BlockComment")return i=>({from:i.from+2,to:i.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function F(){return new V(I)}export{F as rust,I as rustLanguage}; +import{E as a,s as o,t as Q,b as Z,L as _,i as q,c as r,f as l,k as w,a as V}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const R=1,g=2,b=3,y=4,T=5,s=98,c=101,p=102,t=114,v=69,X=48,W=46,d=43,f=45,Y=35,z=34,x=124,U=60,h=62;function n(O){return O>=48&&O<=57}function e(O){return n(O)||O==95}const G=new a((O,i)=>{if(n(O.next)){let P=!1;do O.advance();while(e(O.next));if(O.next==W){if(P=!0,O.advance(),n(O.next))do O.advance();while(e(O.next));else if(O.next==W||O.next>127||/\w/.test(String.fromCharCode(O.next)))return}if(O.next==c||O.next==v){if(P=!0,O.advance(),(O.next==d||O.next==f)&&O.advance(),!e(O.next))return;do O.advance();while(e(O.next))}if(O.next==p){let $=O.peek(1);if($==X+3&&O.peek(2)==X+2||$==X+6&&O.peek(2)==X+4)O.advance(3),P=!0;else return}P&&O.acceptToken(T)}else if(O.next==s||O.next==t){if(O.next==s&&O.advance(),O.next!=t)return;O.advance();let P=0;for(;O.next==Y;)P++,O.advance();if(O.next!=z)return;O.advance();O:for(;;){if(O.next<0)return;let $=O.next==z;if(O.advance(),$){for(let S=0;S{O.next==x&&O.acceptToken(R,1)}),u=new a(O=>{O.next==U?O.acceptToken(g,1):O.next==h&&O.acceptToken(b,1)}),k=o({"const macro_rules struct union enum type fn impl trait let static":Q.definitionKeyword,"mod use crate":Q.moduleKeyword,"pub unsafe async mut extern default move":Q.modifier,"for if else loop while match continue break return await":Q.controlKeyword,"as in ref":Q.operatorKeyword,"where _ crate super dyn":Q.keyword,self:Q.self,String:Q.string,Char:Q.character,RawString:Q.special(Q.string),Boolean:Q.bool,Identifier:Q.variableName,"CallExpression/Identifier":Q.function(Q.variableName),BoundIdentifier:Q.definition(Q.variableName),"FunctionItem/BoundIdentifier":Q.function(Q.definition(Q.variableName)),LoopLabel:Q.labelName,FieldIdentifier:Q.propertyName,"CallExpression/FieldExpression/FieldIdentifier":Q.function(Q.propertyName),Lifetime:Q.special(Q.variableName),ScopeIdentifier:Q.namespace,TypeIdentifier:Q.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":Q.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":Q.macroName,'"!"':Q.macroName,UpdateOp:Q.updateOperator,LineComment:Q.lineComment,BlockComment:Q.blockComment,Integer:Q.integer,Float:Q.float,ArithOp:Q.arithmeticOperator,LogicOp:Q.logicOperator,BitOp:Q.bitwiseOperator,CompareOp:Q.compareOperator,"=":Q.definitionOperator,".. ... => ->":Q.punctuation,"( )":Q.paren,"[ ]":Q.squareBracket,"{ }":Q.brace,". DerefOp":Q.derefOperator,"&":Q.operator,", ; ::":Q.separator,"Attribute/...":Q.meta}),j={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395,fn:396,trait:412,use:420,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v6R6Y6p6v6x7c7r8gR${xR0b+UR0W*xR0U*xR6{4PR/y*vR/x*vR0P*wR0O*wR0_+QR0^+Q%XyObxz!O!P!Q!T!n$O$u$y$|%_%b%f%n%o%p%q%y%{&P&o&p&r'](q)S)U)i)s)v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-t-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[k],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!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]'|X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$$o]vX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n",tokenizers:[m,u,G,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:O=>j[O]||-1}],tokenPrec:15596}),I=_.define({name:"rust",parser:E.configure({props:[q.add({IfExpression:r({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:O=>O.continue(),"Statement MatchArm":r()}),l.add(O=>{if(/(Block|edTokens|List)$/.test(O.name))return w;if(O.name=="BlockComment")return i=>({from:i.from+2,to:i.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function F(){return new V(I)}export{F as rust,I as rustLanguage}; diff --git a/assets/index-DGE4TJz4.js b/assets/index-DMnbdnsj.js similarity index 94% rename from assets/index-DGE4TJz4.js rename to assets/index-DMnbdnsj.js index 6c97a21..541ee1e 100644 --- a/assets/index-DGE4TJz4.js +++ b/assets/index-DMnbdnsj.js @@ -1 +1 @@ -import{s as p,t as e,L as u,a as l,b as m,l as r,q as b,r as n,v as S}from"./MarkdownEditor-BcjjWJJf.js";import"./index-CI8FOYx1.js";import"./index.lazy-B3BXRqZi.js";import"./isAddressEqual-Cr_byQ5I.js";import"./secp256k1-B_ijNduS.js";const c=m.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,nodeProps:[["isolate",-3,3,13,17,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new r("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new r("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new r("[~RPwxU~ZOp~~",11,15),new r("[~RPrsU~ZOn~~",11,14),new r("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new r("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),P=S.parser.configure({top:"SingleExpression"}),o=c.configure({props:[p({Text:e.content,Is:e.definitionOperator,AttributeName:e.attributeName,VueAttributeName:e.keyword,Identifier:e.variableName,"AttributeValue ScriptAttributeValue":e.attributeValue,Entity:e.character,"{{ }}":e.brace,"@ :":e.punctuation})]}),s={parser:P},Q=o.configure({wrap:n((O,t)=>O.name=="InterpolationContent"?s:null)}),g=o.configure({wrap:n((O,t)=>O.name=="AttributeScript"?s:null),top:"Attribute"}),y={parser:Q},R={parser:g},a=b();function i(O){return O.configure({dialect:"selfClosing",wrap:n(X)},"vue")}const T=i(a.language);function X(O,t){switch(O.name){case"Attribute":return/^(@|:|v-)/.test(t.read(O.from,O.from+2))?R:null;case"Text":return y}return null}function k(O={}){let t=a;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof u))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new l(t.language==a.language?T:i(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["{",'"']}})])}export{k as vue,T as vueLanguage}; +import{s as p,t as e,L as u,a as l,b as m,l as r,q as b,r as n,v as S}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const c=m.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,nodeProps:[["isolate",-3,3,13,17,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new r("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new r("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new r("[~RPwxU~ZOp~~",11,15),new r("[~RPrsU~ZOn~~",11,14),new r("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new r("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),P=S.parser.configure({top:"SingleExpression"}),o=c.configure({props:[p({Text:e.content,Is:e.definitionOperator,AttributeName:e.attributeName,VueAttributeName:e.keyword,Identifier:e.variableName,"AttributeValue ScriptAttributeValue":e.attributeValue,Entity:e.character,"{{ }}":e.brace,"@ :":e.punctuation})]}),s={parser:P},Q=o.configure({wrap:n((O,t)=>O.name=="InterpolationContent"?s:null)}),g=o.configure({wrap:n((O,t)=>O.name=="AttributeScript"?s:null),top:"Attribute"}),y={parser:Q},R={parser:g},a=b();function i(O){return O.configure({dialect:"selfClosing",wrap:n(X)},"vue")}const T=i(a.language);function X(O,t){switch(O.name){case"Attribute":return/^(@|:|v-)/.test(t.read(O.from,O.from+2))?R:null;case"Text":return y}return null}function k(O={}){let t=a;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof u))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new l(t.language==a.language?T:i(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["{",'"']}})])}export{k as vue,T as vueLanguage}; diff --git a/assets/index-CI8FOYx1.js b/assets/index-Dje23Sct.js similarity index 95% rename from assets/index-CI8FOYx1.js rename to assets/index-Dje23Sct.js index 4b94342..8199e7b 100644 --- a/assets/index-CI8FOYx1.js +++ b/assets/index-Dje23Sct.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-BrPrqTPA.js","assets/isAddressEqual-Cr_byQ5I.js","assets/index-C9IGeZlS.js","assets/hooks.module-Cgj3tfPN.js","assets/index-DJ_EjEfy.js","assets/index.lazy-DRoQcysg.js","assets/index-C0HCKJ4u.css","assets/index.lazy-B3BXRqZi.js","assets/secp256k1-B_ijNduS.js","assets/index-lHEOM186.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-DXiuzO4m.js","assets/isAddressEqual-CzhKTe3O.js","assets/index-BK4Ob9ME.js","assets/hooks.module-CVqc1jrB.js","assets/index-Bcq5aE4i.js","assets/index.lazy-Cf4BJ7np.js","assets/index-C0HCKJ4u.css","assets/index.lazy-D7Gh5HMF.js","assets/secp256k1-B-W0FJZ_.js","assets/index-lHEOM186.css"])))=>i.map(i=>d[i]); var BT=t=>{throw TypeError(t)};var ax=(t,e,r)=>e.has(t)||BT("Cannot "+r);var Oe=(t,e,r)=>(ax(t,e,"read from private field"),r?r.call(t):e.get(t)),Fr=(t,e,r)=>e.has(t)?BT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),pr=(t,e,r,n)=>(ax(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),zi=(t,e,r)=>(ax(t,e,"access private method"),r);var V3=(t,e,r,n)=>({set _(i){pr(t,e,i,r)},get _(){return Oe(t,e,n)}});function IQ(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ec(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Z$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Q$={exports:{}},g6={},Y$={exports:{}},Cr={};/** * @license React * react.production.min.js @@ -38,7 +38,7 @@ var BT=t=>{throw TypeError(t)};var ax=(t,e,r)=>e.has(t)||BT("Cannot "+r);var Oe= `+i[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{ux=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Tm(t):""}function tY(t){switch(t.tag){case 5:return Tm(t.type);case 16:return Tm("Lazy");case 13:return Tm("Suspense");case 19:return Tm("SuspenseList");case 0:case 2:case 15:return t=dx(t.type,!1),t;case 11:return t=dx(t.type.render,!1),t;case 1:return t=dx(t.type,!0),t;default:return""}}function g7(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Cp:return"Fragment";case xp:return"Portal";case f7:return"Profiler";case tA:return"StrictMode";case h7:return"Suspense";case p7:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case fO:return(t.displayName||"Context")+".Consumer";case dO:return(t._context.displayName||"Context")+".Provider";case rA:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case nA:return e=t.displayName||null,e!==null?e:g7(t.type)||"Memo";case wd:e=t._payload,t=t._init;try{return g7(t(e))}catch{}}return null}function rY(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return g7(e);case 8:return e===tA?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function tf(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function pO(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function nY(t){var e=pO(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Z3(t){t._valueTracker||(t._valueTracker=nY(t))}function gO(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=pO(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Ab(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function m7(t,e){var r=e.checked;return kn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function qT(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=tf(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function mO(t,e){e=e.checked,e!=null&&eA(t,"checked",e,!1)}function w7(t,e){mO(t,e);var r=tf(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?v7(t,e.type,r):e.hasOwnProperty("defaultValue")&&v7(t,e.type,tf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function VT(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function v7(t,e,r){(e!=="number"||Ab(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var km=Array.isArray;function Up(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Q3.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function fw(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Um={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iY=["Webkit","ms","Moz","O"];Object.keys(Um).forEach(function(t){iY.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Um[e]=Um[t]})});function bO(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Um.hasOwnProperty(t)&&Um[t]?(""+e).trim():e+"px"}function xO(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=bO(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var sY=kn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function x7(t,e){if(e){if(sY[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(We(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(We(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(We(61))}if(e.style!=null&&typeof e.style!="object")throw Error(We(62))}}function C7(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _7=null;function iA(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var A7=null,jp=null,Fp=null;function ZT(t){if(t=Jv(t)){if(typeof A7!="function")throw Error(We(280));var e=t.stateNode;e&&(e=b6(e),A7(t.stateNode,t.type,e))}}function CO(t){jp?Fp?Fp.push(t):Fp=[t]:jp=t}function _O(){if(jp){var t=jp,e=Fp;if(Fp=jp=null,ZT(t),e)for(t=0;t>>=0,t===0?32:31-(mY(t)/wY|0)|0}var Y3=64,J3=4194304;function Rm(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Tb(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Rm(a):(s&=o,s!==0&&(n=Rm(s)))}else o=r&~i,o!==0?n=Rm(o):s!==0&&(n=Rm(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function Qv(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-lc(e),t[e]=r}function xY(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Fm),ik=" ",sk=!1;function WO(t,e){switch(t){case"keyup":return ZY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HO(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _p=!1;function YY(t,e){switch(t){case"compositionend":return HO(e);case"keypress":return e.which!==32?null:(sk=!0,ik);case"textInput":return t=e.data,t===ik&&sk?null:t;default:return null}}function JY(t,e){if(_p)return t==="compositionend"||!fA&&WO(t,e)?(t=FO(),Ky=lA=Dd=null,_p=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lk(r)}}function GO(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?GO(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function ZO(){for(var t=window,e=Ab();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Ab(t.document)}return e}function hA(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function aJ(t){var e=ZO(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&GO(r.ownerDocument.documentElement,r)){if(n!==null&&hA(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=uk(r,s);var o=uk(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Ap=null,R7=null,Wm=null,P7=!1;function dk(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;P7||Ap==null||Ap!==Ab(n)||(n=Ap,"selectionStart"in n&&hA(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Wm&&vw(Wm,n)||(Wm=n,n=Pb(R7,"onSelect"),0Ip||(t.current=L7[Ip],L7[Ip]=null,Ip--)}function on(t,e){Ip++,L7[Ip]=t.current,t.current=e}var rf={},rs=Cf(rf),Ks=Cf(!1),Nh=rf;function d1(t,e){var r=t.type.contextTypes;if(!r)return rf;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Gs(t){return t=t.childContextTypes,t!=null}function Mb(){mn(Ks),mn(rs)}function vk(t,e,r){if(rs.current!==rf)throw Error(We(168));on(rs,e),on(Ks,r)}function iD(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(We(108,rY(t)||"Unknown",i));return kn({},r,n)}function $b(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rf,Nh=rs.current,on(rs,t),on(Ks,Ks.current),!0}function yk(t,e,r){var n=t.stateNode;if(!n)throw Error(We(169));r?(t=iD(t,e,Nh),n.__reactInternalMemoizedMergedChildContext=t,mn(Ks),mn(rs),on(rs,t)):mn(Ks),on(Ks,r)}var du=null,x6=!1,Ex=!1;function sD(t){du===null?du=[t]:du.push(t)}function yJ(t){x6=!0,sD(t)}function _f(){if(!Ex&&du!==null){Ex=!0;var t=0,e=Hr;try{var r=du;for(Hr=1;t>=o,i-=o,gu=1<<32-lc(e)+i|r<T?(B=I,I=null):B=I.sibling;var K=g(N,I,$[T],L);if(K===null){I===null&&(I=B);break}t&&I&&K.alternate===null&&e(N,I),E=s(K,E,T),H===null?j=K:H.sibling=K,H=K,I=B}if(T===$.length)return r(N,I),yn&&oh(N,T),j;if(I===null){for(;T<$.length;T++)I=f(N,$[T],L),I!==null&&(E=s(I,E,T),H===null?j=I:H.sibling=I,H=I);return yn&&oh(N,T),j}for(I=n(N,I);T<$.length;T++)B=v(I,N,T,$[T],L),B!==null&&(t&&B.alternate!==null&&I.delete(B.key===null?T:B.key),E=s(B,E,T),H===null?j=B:H.sibling=B,H=B);return t&&I.forEach(function(U){return e(N,U)}),yn&&oh(N,T),j}function P(N,E,$,L){var j=Xg($);if(typeof j!="function")throw Error(We(150));if($=j.call($),$==null)throw Error(We(151));for(var H=j=null,I=E,T=E=0,B=null,K=$.next();I!==null&&!K.done;T++,K=$.next()){I.index>T?(B=I,I=null):B=I.sibling;var U=g(N,I,K.value,L);if(U===null){I===null&&(I=B);break}t&&I&&U.alternate===null&&e(N,I),E=s(U,E,T),H===null?j=U:H.sibling=U,H=U,I=B}if(K.done)return r(N,I),yn&&oh(N,T),j;if(I===null){for(;!K.done;T++,K=$.next())K=f(N,K.value,L),K!==null&&(E=s(K,E,T),H===null?j=K:H.sibling=K,H=K);return yn&&oh(N,T),j}for(I=n(N,I);!K.done;T++,K=$.next())K=v(I,N,T,K.value,L),K!==null&&(t&&K.alternate!==null&&I.delete(K.key===null?T:K.key),E=s(K,E,T),H===null?j=K:H.sibling=K,H=K);return t&&I.forEach(function(C){return e(N,C)}),yn&&oh(N,T),j}function M(N,E,$,L){if(typeof $=="object"&&$!==null&&$.type===Cp&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case G3:e:{for(var j=$.key,H=E;H!==null;){if(H.key===j){if(j=$.type,j===Cp){if(H.tag===7){r(N,H.sibling),E=i(H,$.props.children),E.return=N,N=E;break e}}else if(H.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===wd&&Ck(j)===H.type){r(N,H.sibling),E=i(H,$.props),E.ref=im(N,H,$),E.return=N,N=E;break e}r(N,H);break}else e(N,H);H=H.sibling}$.type===Cp?(E=Sh($.props.children,N.mode,L,$.key),E.return=N,N=E):(L=tb($.type,$.key,$.props,null,N.mode,L),L.ref=im(N,E,$),L.return=N,N=L)}return o(N);case xp:e:{for(H=$.key;E!==null;){if(E.key===H)if(E.tag===4&&E.stateNode.containerInfo===$.containerInfo&&E.stateNode.implementation===$.implementation){r(N,E.sibling),E=i(E,$.children||[]),E.return=N,N=E;break e}else{r(N,E);break}else e(N,E);E=E.sibling}E=Mx($,N.mode,L),E.return=N,N=E}return o(N);case wd:return H=$._init,M(N,E,H($._payload),L)}if(km($))return x(N,E,$,L);if(Xg($))return P(N,E,$,L);sy(N,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,E!==null&&E.tag===6?(r(N,E.sibling),E=i(E,$),E.return=N,N=E):(r(N,E),E=Nx($,N.mode,L),E.return=N,N=E),o(N)):r(N,E)}return M}var h1=lD(!0),uD=lD(!1),Lb=Cf(null),Bb=null,Rp=null,wA=null;function vA(){wA=Rp=Bb=null}function yA(t){var e=Lb.current;mn(Lb),t._currentValue=e}function j7(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Wp(t,e){Bb=t,wA=Rp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(qs=!0),t.firstContext=null)}function ma(t){var e=t._currentValue;if(wA!==t)if(t={context:t,memoizedValue:e,next:null},Rp===null){if(Bb===null)throw Error(We(308));Rp=t,Bb.dependencies={lanes:0,firstContext:t}}else Rp=Rp.next=t;return e}var fh=null;function bA(t){fh===null?fh=[t]:fh.push(t)}function dD(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,bA(e)):(r.next=i.next,i.next=r),e.interleaved=r,Iu(t,n)}function Iu(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var vd=!1;function xA(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fD(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function xu(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function qd(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Nr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,Iu(t,r)}return i=n.interleaved,i===null?(e.next=e,bA(n)):(e.next=i.next,i.next=e),n.interleaved=e,Iu(t,r)}function Zy(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,oA(t,r)}}function _k(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Ub(t,e,r,n){var i=t.updateQueue;vd=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?s=l:o.next=l,o=c;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=c))}if(s!==null){var f=i.baseState;o=0,d=l=c=null,a=s;do{var g=a.lane,v=a.eventTime;if((n&g)===g){d!==null&&(d=d.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=t,P=a;switch(g=e,v=r,P.tag){case 1:if(x=P.payload,typeof x=="function"){f=x.call(v,f,g);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=P.payload,g=typeof x=="function"?x.call(v,f,g):x,g==null)break e;f=kn({},f,g);break e;case 2:vd=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,g=i.effects,g===null?i.effects=[a]:g.push(a))}else v={eventTime:v,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(l=d=v,c=f):d=d.next=v,o|=g;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;g=a,a=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Oh|=o,t.lanes=o,t.memoizedState=f}}function Ak(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=Ix.transition;Ix.transition={};try{t(!1),e()}finally{Hr=r,Ix.transition=n}}function kD(){return wa().memoizedState}function _J(t,e,r){var n=Kd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},RD(t))PD(e,r);else if(r=dD(t,e,r,n),r!==null){var i=ws();uc(r,t,n,i),ND(r,e,n)}}function AJ(t,e,r){var n=Kd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(RD(t))PD(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,pc(a,o)){var c=e.interleaved;c===null?(i.next=i,bA(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=dD(t,e,i,n),r!==null&&(i=ws(),uc(r,t,n,i),ND(r,e,n))}}function RD(t){var e=t.alternate;return t===In||e!==null&&e===In}function PD(t,e){Hm=Fb=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function ND(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,oA(t,r)}}var zb={readContext:ma,useCallback:Wi,useContext:Wi,useEffect:Wi,useImperativeHandle:Wi,useInsertionEffect:Wi,useLayoutEffect:Wi,useMemo:Wi,useReducer:Wi,useRef:Wi,useState:Wi,useDebugValue:Wi,useDeferredValue:Wi,useTransition:Wi,useMutableSource:Wi,useSyncExternalStore:Wi,useId:Wi,unstable_isNewReconciler:!1},EJ={readContext:ma,useCallback:function(t,e){return Vc().memoizedState=[t,e===void 0?null:e],t},useContext:ma,useEffect:Sk,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Yy(4194308,4,AD.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Yy(4194308,4,t,e)},useInsertionEffect:function(t,e){return Yy(4,2,t,e)},useMemo:function(t,e){var r=Vc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Vc();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=_J.bind(null,In,t),[n.memoizedState,t]},useRef:function(t){var e=Vc();return t={current:t},e.memoizedState=t},useState:Ek,useDebugValue:kA,useDeferredValue:function(t){return Vc().memoizedState=t},useTransition:function(){var t=Ek(!1),e=t[0];return t=CJ.bind(null,t[1]),Vc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=In,i=Vc();if(yn){if(r===void 0)throw Error(We(407));r=r()}else{if(r=e(),wi===null)throw Error(We(349));$h&30||mD(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,Sk(vD.bind(null,n,s,t),[t]),n.flags|=2048,Sw(9,wD.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Vc(),e=wi.identifierPrefix;if(yn){var r=mu,n=gu;r=(n&~(1<<32-lc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Aw++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[nl]=e,t[xw]=n,zD(t,e,!1,!1),e.stateNode=t;e:{switch(o=C7(r,n),r){case"dialog":fn("cancel",t),fn("close",t),i=n;break;case"iframe":case"object":case"embed":fn("load",t),i=n;break;case"video":case"audio":for(i=0;im1&&(e.flags|=128,n=!0,sm(s,!1),e.lanes=4194304)}else{if(!n)if(t=jb(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),sm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!yn)return Hi(e),null}else 2*Hn()-s.renderingStartTime>m1&&r!==1073741824&&(e.flags|=128,n=!0,sm(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Hn(),e.sibling=null,r=En.current,on(En,n?r&1|2:r&1),e):(Hi(e),null);case 22:case 23:return OA(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?go&1073741824&&(Hi(e),e.subtreeFlags&6&&(e.flags|=8192)):Hi(e),null;case 24:return null;case 25:return null}throw Error(We(156,e.tag))}function MJ(t,e){switch(gA(e),e.tag){case 1:return Gs(e.type)&&Mb(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return p1(),mn(Ks),mn(rs),AA(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return _A(e),null;case 13:if(mn(En),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(We(340));f1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return mn(En),null;case 4:return p1(),null;case 10:return yA(e.type._context),null;case 22:case 23:return OA(),null;case 24:return null;default:return null}}var ay=!1,Ji=!1,$J=typeof WeakSet=="function"?WeakSet:Set,_t=null;function Pp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){On(t,e,n)}else r.current=null}function Z7(t,e,r){try{r()}catch(n){On(t,e,n)}}var Lk=!1;function OJ(t,e){if(N7=kb,t=ZO(),hA(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,d=0,f=t,g=null;t:for(;;){for(var v;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(v=f.firstChild)!==null;)g=f,f=v;for(;;){if(f===t)break t;if(g===r&&++l===i&&(a=o),g===s&&++d===n&&(c=o),(v=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(M7={focusedElem:t,selectionRange:r},kb=!1,_t=e;_t!==null;)if(e=_t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,_t=t;else for(;_t!==null;){e=_t;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,M=x.memoizedState,N=e.stateNode,E=N.getSnapshotBeforeUpdate(e.elementType===e.type?P:Qa(e.type,P),M);N.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var $=e.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(We(163))}}catch(L){On(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,_t=t;break}_t=e.return}return x=Lk,Lk=!1,x}function qm(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Z7(e,r,s)}i=i.next}while(i!==n)}}function A6(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Q7(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function qD(t){var e=t.alternate;e!==null&&(t.alternate=null,qD(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[nl],delete e[xw],delete e[D7],delete e[wJ],delete e[vJ])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function VD(t){return t.tag===5||t.tag===3||t.tag===4}function Bk(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||VD(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Y7(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Nb));else if(n!==4&&(t=t.child,t!==null))for(Y7(t,e,r),t=t.sibling;t!==null;)Y7(t,e,r),t=t.sibling}function J7(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(J7(t,e,r),t=t.sibling;t!==null;)J7(t,e,r),t=t.sibling}var Ai=null,tc=!1;function ud(t,e,r){for(r=r.child;r!==null;)KD(t,e,r),r=r.sibling}function KD(t,e,r){if(sl&&typeof sl.onCommitFiberUnmount=="function")try{sl.onCommitFiberUnmount(m6,r)}catch{}switch(r.tag){case 5:Ji||Pp(r,e);case 6:var n=Ai,i=tc;Ai=null,ud(t,e,r),Ai=n,tc=i,Ai!==null&&(tc?(t=Ai,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ai.removeChild(r.stateNode));break;case 18:Ai!==null&&(tc?(t=Ai,r=r.stateNode,t.nodeType===8?Ax(t.parentNode,r):t.nodeType===1&&Ax(t,r),mw(t)):Ax(Ai,r.stateNode));break;case 4:n=Ai,i=tc,Ai=r.stateNode.containerInfo,tc=!0,ud(t,e,r),Ai=n,tc=i;break;case 0:case 11:case 14:case 15:if(!Ji&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Z7(r,e,o),i=i.next}while(i!==n)}ud(t,e,r);break;case 1:if(!Ji&&(Pp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){On(r,e,a)}ud(t,e,r);break;case 21:ud(t,e,r);break;case 22:r.mode&1?(Ji=(n=Ji)||r.memoizedState!==null,ud(t,e,r),Ji=n):ud(t,e,r);break;default:ud(t,e,r)}}function Uk(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new $J),e.forEach(function(n){var i=HJ.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ja(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Hn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*LJ(n/1960))-n,10t?16:t,Ld===null)var n=!1;else{if(t=Ld,Ld=null,qb=0,Nr&6)throw Error(We(331));var i=Nr;for(Nr|=4,_t=t.current;_t!==null;){var s=_t,o=s.child;if(_t.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cHn()-MA?Eh(t,0):NA|=r),Zs(t,e)}function tL(t,e){e===0&&(t.mode&1?(e=J3,J3<<=1,!(J3&130023424)&&(J3=4194304)):e=1);var r=ws();t=Iu(t,e),t!==null&&(Qv(t,e,r),Zs(t,r))}function WJ(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),tL(t,r)}function HJ(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(We(314))}n!==null&&n.delete(e),tL(t,r)}var rL;rL=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ks.current)qs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return qs=!1,PJ(t,e,r);qs=!!(t.flags&131072)}else qs=!1,yn&&e.flags&1048576&&oD(e,Db,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Jy(t,e),t=e.pendingProps;var i=d1(e,rs.current);Wp(e,r),i=SA(null,e,n,t,i,r);var s=IA();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Gs(n)?(s=!0,$b(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xA(e),i.updater=_6,e.stateNode=i,i._reactInternals=e,z7(e,n,t,r),e=q7(null,e,n,!0,s,r)):(e.tag=0,yn&&s&&pA(e),fs(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Jy(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=VJ(n),t=Qa(n,t),i){case 0:e=H7(null,e,n,t,r);break e;case 1:e=$k(null,e,n,t,r);break e;case 11:e=Nk(null,e,n,t,r);break e;case 14:e=Mk(null,e,n,Qa(n.type,t),r);break e}throw Error(We(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),H7(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),$k(t,e,n,i,r);case 3:e:{if(UD(e),t===null)throw Error(We(387));n=e.pendingProps,s=e.memoizedState,i=s.element,fD(t,e),Ub(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=g1(Error(We(423)),e),e=Ok(t,e,n,r,i);break e}else if(n!==i){i=g1(Error(We(424)),e),e=Ok(t,e,n,r,i);break e}else for(wo=Hd(e.stateNode.containerInfo.firstChild),bo=e,yn=!0,ic=null,r=uD(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(f1(),n===i){e=Tu(t,e,r);break e}fs(t,e,n,r)}e=e.child}return e;case 5:return hD(e),t===null&&U7(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,$7(n,i)?o=null:s!==null&&$7(n,s)&&(e.flags|=32),BD(t,e),fs(t,e,o,r),e.child;case 6:return t===null&&U7(e),null;case 13:return jD(t,e,r);case 4:return CA(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=h1(e,null,n,r):fs(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),Nk(t,e,n,i,r);case 7:return fs(t,e,e.pendingProps,r),e.child;case 8:return fs(t,e,e.pendingProps.children,r),e.child;case 12:return fs(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,on(Lb,n._currentValue),n._currentValue=o,s!==null)if(pc(s.value,o)){if(s.children===i.children&&!Ks.current){e=Tu(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=xu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var d=l.pending;d===null?c.next=c:(c.next=d.next,d.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),j7(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(We(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),j7(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}fs(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Wp(e,r),i=ma(i),n=n(i),e.flags|=1,fs(t,e,n,r),e.child;case 14:return n=e.type,i=Qa(n,e.pendingProps),i=Qa(n.type,i),Mk(t,e,n,i,r);case 15:return DD(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),Jy(t,e),e.tag=1,Gs(n)?(t=!0,$b(e)):t=!1,Wp(e,r),MD(e,n,i),z7(e,n,i,r),q7(null,e,n,!0,t,r);case 19:return FD(t,e,r);case 22:return LD(t,e,r)}throw Error(We(156,e.tag))};function nL(t,e){return RO(t,e)}function qJ(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pa(t,e,r,n){return new qJ(t,e,r,n)}function LA(t){return t=t.prototype,!(!t||!t.isReactComponent)}function VJ(t){if(typeof t=="function")return LA(t)?1:0;if(t!=null){if(t=t.$$typeof,t===rA)return 11;if(t===nA)return 14}return 2}function Gd(t,e){var r=t.alternate;return r===null?(r=pa(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function tb(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")LA(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Cp:return Sh(r.children,i,s,e);case tA:o=8,i|=8;break;case f7:return t=pa(12,r,e,i|2),t.elementType=f7,t.lanes=s,t;case h7:return t=pa(13,r,e,i),t.elementType=h7,t.lanes=s,t;case p7:return t=pa(19,r,e,i),t.elementType=p7,t.lanes=s,t;case hO:return S6(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case dO:o=10;break e;case fO:o=9;break e;case rA:o=11;break e;case nA:o=14;break e;case wd:o=16,n=null;break e}throw Error(We(130,t==null?t:typeof t,""))}return e=pa(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Sh(t,e,r,n){return t=pa(7,t,n,e),t.lanes=r,t}function S6(t,e,r,n){return t=pa(22,t,n,e),t.elementType=hO,t.lanes=r,t.stateNode={isHidden:!1},t}function Nx(t,e,r){return t=pa(6,t,null,e),t.lanes=r,t}function Mx(t,e,r){return e=pa(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function KJ(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hx(0),this.expirationTimes=hx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hx(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function BA(t,e,r,n,i,s,o,a,c){return t=new KJ(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=pa(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},xA(s),t}function GJ(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aL)}catch(t){console.error(t)}}aL(),aO.exports=ko;var zA=aO.exports;const nAe=Ec(zA);var cL,Kk=zA;cL=Kk.createRoot,Kk.hydrateRoot;const XJ="modulepreload",eX=function(t){return"/"+t},Gk={},Qs=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=eX(c),c in Gk)return;Gk[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":XJ,l||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),l)return new Promise((g,v)=>{f.addEventListener("load",g),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},tX=Symbol(),Zk=Object.getPrototypeOf,nC=new WeakMap,rX=t=>t&&(nC.has(t)?nC.get(t):Zk(t)===Object.prototype||Zk(t)===Array.prototype),nX=t=>rX(t)&&t[tX]||null,Qk=(t,e=!0)=>{nC.set(t,e)},Gb={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://dacademy-ucan-delegator.netlify.app/ucan"},$x=t=>typeof t=="object"&&t!==null,yd=new WeakMap,Nm=new WeakSet,iX=(t=Object.is,e=(l,d)=>new Proxy(l,d),r=l=>$x(l)&&!Nm.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},i=new WeakMap,s=(l,d,f=n)=>{const g=i.get(l);if((g==null?void 0:g[0])===d)return g[1];const v=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Qk(v,!0),i.set(l,[d,v]),Reflect.ownKeys(l).forEach(x=>{if(Object.getOwnPropertyDescriptor(v,x))return;const P=Reflect.get(l,x),M={value:P,enumerable:!0,configurable:!0};if(Nm.has(P))Qk(P,!1);else if(P instanceof Promise)delete M.value,M.get=()=>f(P);else if(yd.has(P)){const[N,E]=yd.get(P);M.value=s(N,E(),f)}Object.defineProperty(v,x,M)}),Object.preventExtensions(v)},o=new WeakMap,a=[1,1],c=l=>{if(!$x(l))throw new Error("object required");const d=o.get(l);if(d)return d;let f=a[0];const g=new Set,v=(B,K=++a[0])=>{f!==K&&(f=K,g.forEach(U=>U(B,K)))};let x=a[1];const P=(B=++a[1])=>(x!==B&&!g.size&&(x=B,N.forEach(([K])=>{const U=K[1](B);U>f&&(f=U)})),f),M=B=>(K,U)=>{const C=[...K];C[1]=[B,...C[1]],v(C,U)},N=new Map,E=(B,K)=>{if((Gb?"production":void 0)!=="production"&&N.has(B))throw new Error("prop listener already exists");if(g.size){const U=K[3](M(B));N.set(B,[K,U])}else N.set(B,[K])},$=B=>{var K;const U=N.get(B);U&&(N.delete(B),(K=U[1])==null||K.call(U))},L=B=>(g.add(B),g.size===1&&N.forEach(([U,C],p)=>{if((Gb?"production":void 0)!=="production"&&C)throw new Error("remove already exists");const m=U[3](M(p));N.set(p,[U,m])}),()=>{g.delete(B),g.size===0&&N.forEach(([U,C],p)=>{C&&(C(),N.set(p,[U]))})}),j=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),I=e(j,{deleteProperty(B,K){const U=Reflect.get(B,K);$(K);const C=Reflect.deleteProperty(B,K);return C&&v(["delete",[K],U]),C},set(B,K,U,C){const p=Reflect.has(B,K),m=Reflect.get(B,K,C);if(p&&(t(m,U)||o.has(U)&&t(m,o.get(U))))return!0;$(K),$x(U)&&(U=nX(U)||U);let w=U;if(U instanceof Promise)U.then(_=>{U.status="fulfilled",U.value=_,v(["resolve",[K],_])}).catch(_=>{U.status="rejected",U.reason=_,v(["reject",[K],_])});else{!yd.has(U)&&r(U)&&(w=c(U));const _=!Nm.has(w)&&yd.get(w);_&&E(K,_)}return Reflect.set(B,K,w,C),v(["set",[K],U,m]),!0}});o.set(l,I);const T=[j,P,s,L];return yd.set(I,T),Reflect.ownKeys(l).forEach(B=>{const K=Object.getOwnPropertyDescriptor(l,B);"value"in K&&(I[B]=l[B],delete K.value,delete K.writable),Object.defineProperty(j,B,K)}),I})=>[c,yd,Nm,t,e,r,n,i,s,o,a],[sX]=iX();function Rn(t={}){return sX(t)}function bs(t,e,r){const n=yd.get(t);(Gb?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const l=o(d=>{s.push(d),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}function iC(t,e){const r=yd.get(t);(Gb?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}function sc(t){return Nm.add(t),t}function Ts(t,e,r,n){let i=t[e];return bs(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)})}function oX(t){const e=Rn({data:Array.from([]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(s=>s[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(e,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(e),e}var lL={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Yi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",d="week",f="month",g="quarter",v="year",x="date",P="Invalid Date",M=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(m){var w=["th","st","nd","rd"],_=m%100;return"["+m+(w[(_-20)%10]||w[_]||w[0])+"]"}},$=function(m,w,_){var R=String(m);return!R||R.length>=w?m:""+Array(w+1-R.length).join(_)+m},L={s:$,z:function(m){var w=-m.utcOffset(),_=Math.abs(w),R=Math.floor(_/60),S=_%60;return(w<=0?"+":"-")+$(R,2,"0")+":"+$(S,2,"0")},m:function m(w,_){if(w.date()<_.date())return-m(_,w);var R=12*(_.year()-w.year())+(_.month()-w.month()),S=w.clone().add(R,f),k=_-S<0,y=w.clone().add(R+(k?-1:1),f);return+(-(R+(_-S)/(k?S-y:y-S))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:f,y:v,w:d,d:l,D:x,h:c,m:a,s:o,ms:s,Q:g}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},j="en",H={};H[j]=E;var I="$isDayjsObject",T=function(m){return m instanceof C||!(!m||!m[I])},B=function m(w,_,R){var S;if(!w)return j;if(typeof w=="string"){var k=w.toLowerCase();H[k]&&(S=k),_&&(H[k]=_,S=k);var y=w.split("-");if(!S&&y.length>1)return m(y[0])}else{var b=w.name;H[b]=w,S=b}return!R&&S&&(j=S),S||!R&&j},K=function(m,w){if(T(m))return m.clone();var _=typeof w=="object"?w:{};return _.date=m,_.args=arguments,new C(_)},U=L;U.l=B,U.i=T,U.w=function(m,w){return K(m,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var C=function(){function m(_){this.$L=B(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[I]=!0}var w=m.prototype;return w.parse=function(_){this.$d=function(R){var S=R.date,k=R.utc;if(S===null)return new Date(NaN);if(U.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var y=S.match(M);if(y){var b=y[2]-1||0,V=(y[7]||"0").substring(0,3);return k?new Date(Date.UTC(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)):new Date(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)}}return new Date(S)}(_),this.init()},w.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},w.$utils=function(){return U},w.isValid=function(){return this.$d.toString()!==P},w.isSame=function(_,R){var S=K(_);return this.startOf(R)<=S&&S<=this.endOf(R)},w.isAfter=function(_,R){return K(_)0,H<=j.r||!j.r){H<=1&&L>0&&(j=E[L-1]);var I=N[j.l];v&&(H=v(""+H)),P=typeof I=="string"?I.replace("%d",H):I(H,d,j.l,M);break}}if(d)return P;var T=M?N.future:N.past;return typeof T=="function"?T(P):T.replace("%s",P)},s.to=function(l,d){return a(l,d,this,!0)},s.from=function(l,d){return a(l,d,this)};var c=function(l){return l.$u?i.utc():i()};s.toNow=function(l){return this.to(c(this),l)},s.fromNow=function(l){return this.from(c(this),l)}}})})(dL);var uX=dL.exports;const dX=Ec(uX);var fL={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Yi,function(){return function(r,n,i){i.updateLocale=function(s,o){var a=i.Ls[s];if(a)return(o?Object.keys(o):[]).forEach(function(c){a[c]=o[c]}),a}}})})(fL);var fX=fL.exports;const hX=Ec(fX);qp.extend(dX);qp.extend(hX);const pX={...lX,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};qp.locale("en-web3-modal",pX);const WA={getYear(t=new Date().toISOString()){return qp(t).year()},getRelativeDateFromNow(t){return qp(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return qp(t).format(e)}},Ya={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t}};var gX=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ox=Math.ceil,ra=Math.floor,Us="[BigNumber Error] ",Yk=Us+"Number primitive has more than 15 significant digits: ",Fa=1e14,sr=14,Dx=9007199254740991,Lx=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],dd=1e7,li=1e9;function hL(t){var e,r,n,i=E.prototype={constructor:E,toString:null,valueOf:null},s=new E(1),o=20,a=4,c=-7,l=21,d=-1e7,f=1e7,g=!1,v=1,x=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function E(T,B){var K,U,C,p,m,w,_,R,S=this;if(!(S instanceof E))return new E(T,B);if(B==null){if(T&&T._isBigNumber===!0){S.s=T.s,!T.c||T.e>f?S.c=S.e=null:T.e=10;m/=10,p++);p>f?S.c=S.e=null:(S.e=p,S.c=[T]);return}R=String(T)}else{if(!gX.test(R=String(T)))return n(S,R,w);S.s=R.charCodeAt(0)==45?(R=R.slice(1),-1):1}(p=R.indexOf("."))>-1&&(R=R.replace(".","")),(m=R.search(/e/i))>0?(p<0&&(p=m),p+=+R.slice(m+1),R=R.substring(0,m)):p<0&&(p=R.length)}else{if(_n(B,2,M.length,"Base"),B==10&&N)return S=new E(T),H(S,o+S.e+1,a);if(R=String(T),w=typeof T=="number"){if(T*0!=0)return n(S,R,w,B);if(S.s=1/T<0?(R=R.slice(1),-1):1,E.DEBUG&&R.replace(/^0\.0*|\./,"").length>15)throw Error(Yk+T)}else S.s=R.charCodeAt(0)===45?(R=R.slice(1),-1):1;for(K=M.slice(0,B),p=m=0,_=R.length;m<_;m++)if(K.indexOf(U=R.charAt(m))<0){if(U=="."){if(m>p){p=_;continue}}else if(!C&&(R==R.toUpperCase()&&(R=R.toLowerCase())||R==R.toLowerCase()&&(R=R.toUpperCase()))){C=!0,m=-1,p=0;continue}return n(S,String(T),w,B)}w=!1,R=r(R,B,10,S.s),(p=R.indexOf("."))>-1?R=R.replace(".",""):p=R.length}for(m=0;R.charCodeAt(m)===48;m++);for(_=R.length;R.charCodeAt(--_)===48;);if(R=R.slice(m,++_)){if(_-=m,w&&E.DEBUG&&_>15&&(T>Dx||T!==ra(T)))throw Error(Yk+S.s*T);if((p=p-m-1)>f)S.c=S.e=null;else if(p=-li&&C<=li&&C===ra(C)){if(U[0]===0){if(C===0&&U.length===1)return!0;break e}if(B=(C+1)%sr,B<1&&(B+=sr),String(U[0]).length==B){for(B=0;B=Fa||K!==ra(K))break e;if(K!==0)return!0}}}else if(U===null&&C===null&&(p===null||p===1||p===-1))return!0;throw Error(Us+"Invalid BigNumber: "+T)},E.maximum=E.max=function(){return L(arguments,-1)},E.minimum=E.min=function(){return L(arguments,1)},E.random=function(){var T=9007199254740992,B=Math.random()*T&2097151?function(){return ra(Math.random()*T)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(K){var U,C,p,m,w,_=0,R=[],S=new E(s);if(K==null?K=o:_n(K,0,li),m=Ox(K/sr),g)if(crypto.getRandomValues){for(U=crypto.getRandomValues(new Uint32Array(m*=2));_>>11),w>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),U[_]=C[0],U[_+1]=C[1]):(R.push(w%1e14),_+=2);_=m/2}else if(crypto.randomBytes){for(U=crypto.randomBytes(m*=7);_=9e15?crypto.randomBytes(7).copy(U,_):(R.push(w%1e14),_+=7);_=m/7}else throw g=!1,Error(Us+"crypto unavailable");if(!g)for(;_=10;w/=10,_++);_C-1&&(w[m+1]==null&&(w[m+1]=0),w[m+1]+=w[m]/C|0,w[m]%=C)}return w.reverse()}return function(K,U,C,p,m){var w,_,R,S,k,y,b,V,ce=K.indexOf("."),fe=o,W=a;for(ce>=0&&(S=x,x=0,K=K.replace(".",""),V=new E(U),y=V.pow(K.length-ce),x=S,V.c=B(Jl(Go(y.c),y.e,"0"),10,C,T),V.e=V.c.length),b=B(K,U,C,m?(w=M,T):(w=T,M)),R=S=b.length;b[--S]==0;b.pop());if(!b[0])return w.charAt(0);if(ce<0?--R:(y.c=b,y.e=R,y.s=p,y=e(y,V,fe,W,C),b=y.c,k=y.r,R=y.e),_=R+fe+1,ce=b[_],S=C/2,k=k||_<0||b[_+1]!=null,k=W<4?(ce!=null||k)&&(W==0||W==(y.s<0?3:2)):ce>S||ce==S&&(W==4||k||W==6&&b[_-1]&1||W==(y.s<0?8:7)),_<1||!b[0])K=k?Jl(w.charAt(1),-fe,w.charAt(0)):w.charAt(0);else{if(b.length=_,k)for(--C;++b[--_]>C;)b[_]=0,_||(++R,b=[1].concat(b));for(S=b.length;!b[--S];);for(ce=0,K="";ce<=S;K+=w.charAt(b[ce++]));K=Jl(K,R,w.charAt(0))}return K}}(),e=function(){function T(U,C,p){var m,w,_,R,S=0,k=U.length,y=C%dd,b=C/dd|0;for(U=U.slice();k--;)_=U[k]%dd,R=U[k]/dd|0,m=b*_+R*y,w=y*_+m%dd*dd+S,S=(w/p|0)+(m/dd|0)+b*R,U[k]=w%p;return S&&(U=[S].concat(U)),U}function B(U,C,p,m){var w,_;if(p!=m)_=p>m?1:-1;else for(w=_=0;wC[w]?1:-1;break}return _}function K(U,C,p,m){for(var w=0;p--;)U[p]-=w,w=U[p]1;U.splice(0,1));}return function(U,C,p,m,w){var _,R,S,k,y,b,V,ce,fe,W,ue,J,ne,ie,D,te,me,Ce=U.s==C.s?1:-1,Ee=U.c,Re=C.c;if(!Ee||!Ee[0]||!Re||!Re[0])return new E(!U.s||!C.s||(Ee?Re&&Ee[0]==Re[0]:!Re)?NaN:Ee&&Ee[0]==0||!Re?Ce*0:Ce/0);for(ce=new E(Ce),fe=ce.c=[],R=U.e-C.e,Ce=p+R+1,w||(w=Fa,R=na(U.e/sr)-na(C.e/sr),Ce=Ce/sr|0),S=0;Re[S]==(Ee[S]||0);S++);if(Re[S]>(Ee[S]||0)&&R--,Ce<0)fe.push(1),k=!0;else{for(ie=Ee.length,te=Re.length,S=0,Ce+=2,y=ra(w/(Re[0]+1)),y>1&&(Re=T(Re,y,w),Ee=T(Ee,y,w),te=Re.length,ie=Ee.length),ne=te,W=Ee.slice(0,te),ue=W.length;ue=w/2&&D++;do{if(y=0,_=B(Re,W,te,ue),_<0){if(J=W[0],te!=ue&&(J=J*w+(W[1]||0)),y=ra(J/D),y>1)for(y>=w&&(y=w-1),b=T(Re,y,w),V=b.length,ue=W.length;B(b,W,V,ue)==1;)y--,K(b,te=10;Ce/=10,S++);H(ce,p+(ce.e=S+R*sr-1)+1,m,k)}else ce.e=R,ce.r=+k;return ce}}();function $(T,B,K,U){var C,p,m,w,_;if(K==null?K=a:_n(K,0,8),!T.c)return T.toString();if(C=T.c[0],m=T.e,B==null)_=Go(T.c),_=U==1||U==2&&(m<=c||m>=l)?dy(_,m):Jl(_,m,"0");else if(T=H(new E(T),B,K),p=T.e,_=Go(T.c),w=_.length,U==1||U==2&&(B<=p||p<=c)){for(;ww){if(--B>0)for(_+=".";B--;_+="0");}else if(B+=p-w,B>0)for(p+1==w&&(_+=".");B--;_+="0");return T.s<0&&C?"-"+_:_}function L(T,B){for(var K,U,C=1,p=new E(T[0]);C=10;C/=10,U++);return(K=U+K*sr-1)>f?T.c=T.e=null:K=10;w/=10,C++);if(p=B-C,p<0)p+=sr,m=B,_=k[R=0],S=ra(_/y[C-m-1]%10);else if(R=Ox((p+1)/sr),R>=k.length)if(U){for(;k.length<=R;k.push(0));_=S=0,C=1,p%=sr,m=p-sr+1}else break e;else{for(_=w=k[R],C=1;w>=10;w/=10,C++);p%=sr,m=p-sr+C,S=m<0?0:ra(_/y[C-m-1]%10)}if(U=U||B<0||k[R+1]!=null||(m<0?_:_%y[C-m-1]),U=K<4?(S||U)&&(K==0||K==(T.s<0?3:2)):S>5||S==5&&(K==4||U||K==6&&(p>0?m>0?_/y[C-m]:0:k[R-1])%10&1||K==(T.s<0?8:7)),B<1||!k[0])return k.length=0,U?(B-=T.e+1,k[0]=y[(sr-B%sr)%sr],T.e=-B||0):k[0]=T.e=0,T;if(p==0?(k.length=R,w=1,R--):(k.length=R+1,w=y[sr-p],k[R]=m>0?ra(_/y[C-m]%y[m])*w:0),U)for(;;)if(R==0){for(p=1,m=k[0];m>=10;m/=10,p++);for(m=k[0]+=w,w=1;m>=10;m/=10,w++);p!=w&&(T.e++,k[0]==Fa&&(k[0]=1));break}else{if(k[R]+=w,k[R]!=Fa)break;k[R--]=0,w=1}for(p=k.length;k[--p]===0;k.pop());}T.e>f?T.c=T.e=null:T.e=l?dy(B,K):Jl(B,K,"0"),T.s<0?"-"+B:B)}return i.absoluteValue=i.abs=function(){var T=new E(this);return T.s<0&&(T.s=1),T},i.comparedTo=function(T,B){return Xf(this,new E(T,B))},i.decimalPlaces=i.dp=function(T,B){var K,U,C,p=this;if(T!=null)return _n(T,0,li),B==null?B=a:_n(B,0,8),H(new E(p),T+p.e+1,B);if(!(K=p.c))return null;if(U=((C=K.length-1)-na(this.e/sr))*sr,C=K[C])for(;C%10==0;C/=10,U--);return U<0&&(U=0),U},i.dividedBy=i.div=function(T,B){return e(this,new E(T,B),o,a)},i.dividedToIntegerBy=i.idiv=function(T,B){return e(this,new E(T,B),0,1)},i.exponentiatedBy=i.pow=function(T,B){var K,U,C,p,m,w,_,R,S,k=this;if(T=new E(T),T.c&&!T.isInteger())throw Error(Us+"Exponent not an integer: "+I(T));if(B!=null&&(B=new E(B)),w=T.e>14,!k.c||!k.c[0]||k.c[0]==1&&!k.e&&k.c.length==1||!T.c||!T.c[0])return S=new E(Math.pow(+I(k),w?T.s*(2-uy(T)):+I(T))),B?S.mod(B):S;if(_=T.s<0,B){if(B.c?!B.c[0]:!B.s)return new E(NaN);U=!_&&k.isInteger()&&B.isInteger(),U&&(k=k.mod(B))}else{if(T.e>9&&(k.e>0||k.e<-1||(k.e==0?k.c[0]>1||w&&k.c[1]>=24e7:k.c[0]<8e13||w&&k.c[0]<=9999975e7)))return p=k.s<0&&uy(T)?-0:0,k.e>-1&&(p=1/p),new E(_?1/p:p);x&&(p=Ox(x/sr+2))}for(w?(K=new E(.5),_&&(T.s=1),R=uy(T)):(C=Math.abs(+I(T)),R=C%2),S=new E(s);;){if(R){if(S=S.times(k),!S.c)break;p?S.c.length>p&&(S.c.length=p):U&&(S=S.mod(B))}if(C){if(C=ra(C/2),C===0)break;R=C%2}else if(T=T.times(K),H(T,T.e+1,1),T.e>14)R=uy(T);else{if(C=+I(T),C===0)break;R=C%2}k=k.times(k),p?k.c&&k.c.length>p&&(k.c.length=p):U&&(k=k.mod(B))}return U?S:(_&&(S=s.div(S)),B?S.mod(B):p?H(S,x,a,m):S)},i.integerValue=function(T){var B=new E(this);return T==null?T=a:_n(T,0,8),H(B,B.e+1,T)},i.isEqualTo=i.eq=function(T,B){return Xf(this,new E(T,B))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(T,B){return Xf(this,new E(T,B))>0},i.isGreaterThanOrEqualTo=i.gte=function(T,B){return(B=Xf(this,new E(T,B)))===1||B===0},i.isInteger=function(){return!!this.c&&na(this.e/sr)>this.c.length-2},i.isLessThan=i.lt=function(T,B){return Xf(this,new E(T,B))<0},i.isLessThanOrEqualTo=i.lte=function(T,B){return(B=Xf(this,new E(T,B)))===-1||B===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(T,B){var K,U,C,p,m=this,w=m.s;if(T=new E(T,B),B=T.s,!w||!B)return new E(NaN);if(w!=B)return T.s=-B,m.plus(T);var _=m.e/sr,R=T.e/sr,S=m.c,k=T.c;if(!_||!R){if(!S||!k)return S?(T.s=-B,T):new E(k?m:NaN);if(!S[0]||!k[0])return k[0]?(T.s=-B,T):new E(S[0]?m:a==3?-0:0)}if(_=na(_),R=na(R),S=S.slice(),w=_-R){for((p=w<0)?(w=-w,C=S):(R=_,C=k),C.reverse(),B=w;B--;C.push(0));C.reverse()}else for(U=(p=(w=S.length)<(B=k.length))?w:B,w=B=0;B0)for(;B--;S[K++]=0);for(B=Fa-1;U>w;){if(S[--U]=0;){for(K=0,y=J[C]%fe,b=J[C]/fe|0,m=_,p=C+m;p>C;)R=ue[--m]%fe,S=ue[m]/fe|0,w=b*R+S*y,R=y*R+w%fe*fe+V[p]+K,K=(R/ce|0)+(w/fe|0)+b*S,V[p--]=R%ce;V[p]=K}return K?++U:V.splice(0,1),j(T,V,U)},i.negated=function(){var T=new E(this);return T.s=-T.s||null,T},i.plus=function(T,B){var K,U=this,C=U.s;if(T=new E(T,B),B=T.s,!C||!B)return new E(NaN);if(C!=B)return T.s=-B,U.minus(T);var p=U.e/sr,m=T.e/sr,w=U.c,_=T.c;if(!p||!m){if(!w||!_)return new E(C/0);if(!w[0]||!_[0])return _[0]?T:new E(w[0]?U:C*0)}if(p=na(p),m=na(m),w=w.slice(),C=p-m){for(C>0?(m=p,K=_):(C=-C,K=w),K.reverse();C--;K.push(0));K.reverse()}for(C=w.length,B=_.length,C-B<0&&(K=_,_=w,w=K,B=C),C=0;B;)C=(w[--B]=w[B]+_[B]+C)/Fa|0,w[B]=Fa===w[B]?0:w[B]%Fa;return C&&(w=[C].concat(w),++m),j(T,w,m)},i.precision=i.sd=function(T,B){var K,U,C,p=this;if(T!=null&&T!==!!T)return _n(T,1,li),B==null?B=a:_n(B,0,8),H(new E(p),T,B);if(!(K=p.c))return null;if(C=K.length-1,U=C*sr+1,C=K[C]){for(;C%10==0;C/=10,U--);for(C=K[0];C>=10;C/=10,U++);}return T&&p.e+1>U&&(U=p.e+1),U},i.shiftedBy=function(T){return _n(T,-Dx,Dx),this.times("1e"+T)},i.squareRoot=i.sqrt=function(){var T,B,K,U,C,p=this,m=p.c,w=p.s,_=p.e,R=o+4,S=new E("0.5");if(w!==1||!m||!m[0])return new E(!w||w<0&&(!m||m[0])?NaN:m?p:1/0);if(w=Math.sqrt(+I(p)),w==0||w==1/0?(B=Go(m),(B.length+_)%2==0&&(B+="0"),w=Math.sqrt(+B),_=na((_+1)/2)-(_<0||_%2),w==1/0?B="5e"+_:(B=w.toExponential(),B=B.slice(0,B.indexOf("e")+1)+_),K=new E(B)):K=new E(w+""),K.c[0]){for(_=K.e,w=_+R,w<3&&(w=0);;)if(C=K,K=S.times(C.plus(e(p,C,R,1))),Go(C.c).slice(0,w)===(B=Go(K.c)).slice(0,w))if(K.e<_&&--w,B=B.slice(w-3,w+1),B=="9999"||!U&&B=="4999"){if(!U&&(H(C,C.e+o+2,0),C.times(C).eq(p))){K=C;break}R+=4,w+=4,U=1}else{(!+B||!+B.slice(1)&&B.charAt(0)=="5")&&(H(K,K.e+o+2,1),T=!K.times(K).eq(p));break}}return H(K,K.e+o+1,a,T)},i.toExponential=function(T,B){return T!=null&&(_n(T,0,li),T++),$(this,T,B,1)},i.toFixed=function(T,B){return T!=null&&(_n(T,0,li),T=T+this.e+1),$(this,T,B)},i.toFormat=function(T,B,K){var U,C=this;if(K==null)T!=null&&B&&typeof B=="object"?(K=B,B=null):T&&typeof T=="object"?(K=T,T=B=null):K=P;else if(typeof K!="object")throw Error(Us+"Argument not an object: "+K);if(U=C.toFixed(T,B),C.c){var p,m=U.split("."),w=+K.groupSize,_=+K.secondaryGroupSize,R=K.groupSeparator||"",S=m[0],k=m[1],y=C.s<0,b=y?S.slice(1):S,V=b.length;if(_&&(p=w,w=_,_=p,V-=p),w>0&&V>0){for(p=V%w||w,S=b.substr(0,p);p0&&(S+=R+b.slice(p)),y&&(S="-"+S)}U=k?S+(K.decimalSeparator||"")+((_=+K.fractionGroupSize)?k.replace(new RegExp("\\d{"+_+"}\\B","g"),"$&"+(K.fractionGroupSeparator||"")):k):S}return(K.prefix||"")+U+(K.suffix||"")},i.toFraction=function(T){var B,K,U,C,p,m,w,_,R,S,k,y,b=this,V=b.c;if(T!=null&&(w=new E(T),!w.isInteger()&&(w.c||w.s!==1)||w.lt(s)))throw Error(Us+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+I(w));if(!V)return new E(b);for(B=new E(s),R=K=new E(s),U=_=new E(s),y=Go(V),p=B.e=y.length-b.e-1,B.c[0]=Lx[(m=p%sr)<0?sr+m:m],T=!T||w.comparedTo(B)>0?p>0?B:R:w,m=f,f=1/0,w=new E(y),_.c[0]=0;S=e(w,B,0,1),C=K.plus(S.times(U)),C.comparedTo(T)!=1;)K=U,U=C,R=_.plus(S.times(C=R)),_=C,B=w.minus(S.times(C=B)),w=C;return C=e(T.minus(K),U,0,1),_=_.plus(C.times(R)),K=K.plus(C.times(U)),_.s=R.s=b.s,p=p*2,k=e(R,U,p,a).minus(b).abs().comparedTo(e(_,K,p,a).minus(b).abs())<1?[R,U]:[_,K],f=m,k},i.toNumber=function(){return+I(this)},i.toPrecision=function(T,B){return T!=null&&_n(T,1,li),$(this,T,B,2)},i.toString=function(T){var B,K=this,U=K.s,C=K.e;return C===null?U?(B="Infinity",U<0&&(B="-"+B)):B="NaN":(T==null?B=C<=c||C>=l?dy(Go(K.c),C):Jl(Go(K.c),C,"0"):T===10&&N?(K=H(new E(K),o+C+1,a),B=Jl(Go(K.c),K.e,"0")):(_n(T,2,M.length,"Base"),B=r(Jl(Go(K.c),C,"0"),10,T,U,!0)),U<0&&K.c[0]&&(B="-"+B)),B},i.valueOf=i.toJSON=function(){return I(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,t!=null&&E.set(t),E}function na(t){var e=t|0;return t>0||t===e?e:e-1}function Go(t){for(var e,r,n=1,i=t.length,s=t[0]+"";nl^r?1:-1;for(a=(c=i.length)<(l=s.length)?c:l,o=0;os[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function _n(t,e,r,n){if(tr||t!==ra(t))throw Error(Us+(n||"Argument")+(typeof t=="number"?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function uy(t){var e=t.c.length-1;return na(t.e/sr)==e&&t.c[e]%2!=0}function dy(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Jl(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(n=t.length,++e>n){for(i=r,e-=n;--e;i+=r);t+=i}else e="0"&&s<="9";!i&&(a||c||l||d)&&t.preventDefault(),e==="0"&&!f&&!g&&s==="0"&&t.preventDefault(),e==="0"&&v&&(r(s),t.preventDefault()),(f||g)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!v&&!n.includes(s)&&!g&&!f&&t.preventDefault()}},wX=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],HA={URLS:{FAQ:"https://walletconnect.com/faq"}},xn={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot"},CHAIN_NAME_MAP:{eip155:"Ethereum",solana:"Solana",polkadot:"Polkadot"}},nn={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_CONNECTOR:"@appkit/connected_connector",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit/connected_social_username",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE"},sn={setItem(t,e){hy()&&localStorage.setItem(t,e)},getItem(t){if(hy())return localStorage.getItem(t)||void 0},removeItem(t){hy()&&localStorage.removeItem(t)},clear(){hy()&&localStorage.clear()}};function hy(){return typeof window<"u"&&typeof localStorage<"u"}function wu(t,e){return e==="light"?{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}function vX(t){return(t==null?void 0:t.endsWith(xn.WC_NAME_SUFFIX_LEGACY))||(t==null?void 0:t.endsWith(xn.WC_NAME_SUFFIX))}const yX="rpc.walletconnect.org",Tw={extendRpcUrlWithProjectId(t,e){if(t.includes(yX)){const n=new URL(t);return n.searchParams.has("projectId")||n.searchParams.set("projectId",e),n.toString()}return t},extendCaipNetwork(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return{...t,imageId:e[t.chainId],imageUrl:r==null?void 0:r[t.chainId],rpcUrl:Tw.extendRpcUrlWithProjectId(t.rpcUrl,n)}},extendCaipNetworks(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return t.map(i=>Tw.extendCaipNetwork(i,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}))}},Bx="https://secure.walletconnect.org",pL=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],bX="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",Tn={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:Bx,SECURE_SITE_DASHBOARD:`${Bx}/dashboard`,SECURE_SITE_FAVICON:`${Bx}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,DEFAULT_FEATURES:{swaps:!0,onramp:!0,email:!0,emailShowWallets:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],history:!0,analytics:!0,allWallets:!0}},Ue={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const t=window.navigator.userAgent.toLowerCase();return Ue.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return Ue.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Tn.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Tn.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Tn.FOUR_MINUTES_MS},getNetworkId(t){return t==null?void 0:t.split(":")[1]},getPlainAddress(t){return t==null?void 0:t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e){if(Ue.isHttpUrl(t))return this.formatUniversalUrl(t,e);let r=t;r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},formatUniversalUrl(t,e){if(!Ue.isHttpUrl(t))return this.formatNativeUrl(t,e);let r=t;r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},openHref(t,e,r){window.open(t,e,r||"noreferrer noopener")},returnOpenHref(t,e,r){return window.open(t,e,r||"noreferrer noopener")},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,Ue.wait(2e3)])},formatBalance(t,e){let r="0.000";if(typeof t=="string"){const n=Number(t);if(n){const i=Math.floor(n*1e3)/1e3;i&&(r=i.toString())}}return`${r}${e?` ${e}`:""}`},formatBalance2(t,e){var n;let r;if(t==="0")r="0";else if(typeof t=="string"){const i=Number(t);i&&(r=(n=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:n[0])}return{value:r??"0",rest:r==="0"?"000":"",symbol:e}},getApiUrl(){return xn.W3M_API_URL},getBlockchainApiUrl(){return xn.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return xn.PULSE_API_URL},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})},parseError(t){var e,r;return typeof t=="string"?t:typeof((r=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:r.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const r={};return e&&t&&(t.forEach((n,i)=>{r[n]=i}),e.sort((n,i)=>{const s=r[n.id],o=r[i.id];return s!==void 0&&o!==void 0?s-o:s!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const r of t)e+=r.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[r,n]=e.split(".");return{dollars:r,pennies:n}},isAddress(t,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);default:return!1}},uniqueBy(t,e){const r=new Set;return t.filter(n=>{const i=n[e];return r.has(i)?!1:(r.add(i),!0)})},generateSdkVersion(t,e,r){const i=t.length===0?"universal":t.map(s=>s.adapterType).join(",");return`${e}-${i}-${r}`}};async function am(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class P6{constructor({baseUrl:e,clientId:r}){this.baseUrl=e,this.clientId=r}async get({headers:e,signal:r,cache:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await am(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"POST",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async put({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"PUT",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async delete({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"DELETE",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}createUrl({path:e,params:r}){const n=new URL(e,this.baseUrl);return r&&Object.entries(r).forEach(([i,s])=>{s&&n.searchParams.append(i,s)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}}const dn=Rn({features:Tn.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),qe={state:dn,subscribeKey(t,e){return Ts(dn,t,e)},setOptions(t){Object.assign(dn,t)},setFeatures(t){t&&Object.entries(t).forEach(([e,r])=>{dn.features||(dn.features=Tn.DEFAULT_FEATURES),e in dn.features&&(dn.features[e]=r)})},setProjectId(t){dn.projectId=t},setAllWallets(t){dn.allWallets=t},setIncludeWalletIds(t){dn.includeWalletIds=t},setExcludeWalletIds(t){dn.excludeWalletIds=t},setFeaturedWalletIds(t){dn.featuredWalletIds=t},setTokens(t){dn.tokens=t},setTermsConditionsUrl(t){dn.termsConditionsUrl=t},setPrivacyPolicyUrl(t){dn.privacyPolicyUrl=t},setCustomWallets(t){dn.customWallets=t},setIsSiweEnabled(t){dn.isSiweEnabled=t},setIsUniversalProvider(t){dn.isUniversalProvider=t},setSdkVersion(t){dn.sdkVersion=t},setMetadata(t){dn.metadata=t},setDisableAppend(t){dn.disableAppend=t},setEIP6963Enabled(t){dn.enableEIP6963=t},setEnableWalletConnect(t){dn.enableWalletConnect=t},setEnableWallets(t){dn.enableWallets=t},setHasMultipleAddresses(t){dn.hasMultipleAddresses=t}},xX=Ue.getAnalyticsUrl(),CX=new P6({baseUrl:xX,clientId:null}),_X=["MODAL_CREATED"],ap=Rn({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),ot={state:ap,subscribe(t){return bs(ap,()=>t(ap))},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=qe.state;return{"x-project-id":t,"x-sdk-type":e,"x-sdk-version":r||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(t){try{if(_X.includes(t.data.event)||typeof window>"u")return;await CX.post({path:"/e",headers:ot._getApiHeaders(),body:{eventId:Ue.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){var e;ap.timestamp=Date.now(),ap.data=t,(e=qe.state.features)!=null&&e.analytics&&ot._sendAnalyticsEvent(ap)}},Jk=Rn({supportsAllNetworks:!0,smartAccountEnabledNetworks:[]}),Zt={state:Jk,replaceState(t){t&&Object.assign(Jk,sc(t))},subscribeKey(t,e){let r;return ge.subscribeChainProp("networkState",n=>{if(n){const i=n[t];r!==i&&(r=i,e(i))}})},_getClient(){return ge.getNetworkControllerClient()},setActiveCaipNetwork(t){if(!t)return;ge.setActiveCaipNetwork(t),this.checkIfSupportedNetwork()||this.showUnsupportedChainUI()},setCaipNetwork(t){if(t){if(!(t!=null&&t.chainNamespace))throw new Error("chain is required to set active network");ge.setCaipNetwork(t==null?void 0:t.chainNamespace,t)}},setRequestedCaipNetworks(t,e){ge.setChainNetworkData(e,{requestedCaipNetworks:t})},setAllowUnsupportedChain(t,e){ge.setChainNetworkData(e||ge.state.activeChain,{allowUnsupportedCaipNetwork:t})},setSmartAccountEnabledNetworks(t,e){ge.setChainNetworkData(e,{smartAccountEnabledNetworks:t})},getRequestedCaipNetworks(t){let e;if(!ge.state.activeChain)throw new Error("activeChain is required to get requested networks");if(t){const s=t;if(!s)throw new Error("chain is required to get requested networks");e=[s]}else e=[...ge.state.chains.keys()];const r=[],n=[];return e.forEach(s=>{var o,a,c,l,d,f,g,v;(a=(o=ge.state.chains.get(s))==null?void 0:o.networkState)!=null&&a.approvedCaipNetworkIds&&r.push(...((l=(c=ge.state.chains.get(s))==null?void 0:c.networkState)==null?void 0:l.approvedCaipNetworkIds)||[]),(f=(d=ge.state.chains.get(s))==null?void 0:d.networkState)!=null&&f.requestedCaipNetworks&&n.push(...((v=(g=ge.state.chains.get(s))==null?void 0:g.networkState)==null?void 0:v.requestedCaipNetworks)||[])}),Ue.sortRequestedNetworks(r,n)},async switchActiveNetwork(t){const e=ge.getNetworkControllerClient(t==null?void 0:t.chainNamespace);e&&await e.switchCaipNetwork(t),ge.setActiveCaipNetwork(t),t&&ot.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.id}})},getApprovedCaipNetworkIds(t){var r,n;if(t){const i=t;if(!i)throw new Error("chain is required to get approved network IDs");return(n=(r=ge.state.chains.get(i))==null?void 0:r.networkState)==null?void 0:n.approvedCaipNetworkIds}const e=[];return Object.values(ge.state.chains).forEach(i=>{var s;i.networkState.approvedCaipNetworkIds&&e.push(...((s=i.networkState)==null?void 0:s.approvedCaipNetworkIds)||[])}),e},async setApprovedCaipNetworksData(t){const e=ge.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());if(!t)throw new Error("chain is required to set approved network data");ge.setChainNetworkData(t,{approvedCaipNetworkIds:r==null?void 0:r.approvedCaipNetworkIds,supportsAllNetworks:r==null?void 0:r.supportsAllNetworks})},checkIfSupportedNetwork(){const t=ge.state.activeChain;if(!t)return!1;const e=ge.state.activeCaipNetwork,r=this.getRequestedCaipNetworks(t);return r.length?r==null?void 0:r.some(n=>n.id===(e==null?void 0:e.id)):!0},checkIfSmartAccountEnabled(){var n;const t=Ya.caipNetworkIdToNumber((n=ge.state.activeCaipNetwork)==null?void 0:n.id);if(!ge.state.activeChain)throw new Error("activeChain is required to check if smart account is enabled");if(!t)return!1;const r=ge.getNetworkProp("smartAccountEnabledNetworks");return!!(r!=null&&r.includes(Number(t)))},resetNetwork(){const t=ge.state.activeChain;if(!t)throw new Error("chain is required to reset network");ge.setChainNetworkData(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},getSupportsAllNetworks(){var e,r;const t=ge.state.activeChain;if(!t)throw new Error("chain is required to check if network supports all networks");return(r=(e=ge.state.chains.get(t))==null?void 0:e.networkState)==null?void 0:r.supportsAllNetworks},showUnsupportedChainUI(){setTimeout(()=>{jt.open({view:"UnsupportedChain"})},300)},getActiveNetworkTokenAddress(){var e,r;const t=Tn.NATIVE_TOKEN_ADDRESS[((e=ge.state.activeCaipNetwork)==null?void 0:e.chainNamespace)||"eip155"];return`${((r=ge.state.activeCaipNetwork)==null?void 0:r.id)||"eip155:1"}:${t}`}},AX={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},gL=Ue.getBlockchainApiUrl(),Zn=Rn({clientId:null,api:new P6({baseUrl:gL,clientId:null})}),bn={state:Zn,fetchIdentity({address:t}){return Zn.api.get({path:`/v1/identity/${t}`,params:{projectId:qe.state.projectId,sender:ge.state.activeCaipAddress?Ue.getPlainAddress(ge.state.activeCaipAddress):void 0}})},fetchTransactions({account:t,projectId:e,cursor:r,onramp:n,signal:i,cache:s,chainId:o}){return Zn.api.get({path:`/v1/account/${t}/history`,params:{projectId:e,cursor:r,onramp:n,chainId:o},signal:i,cache:s})},fetchSwapQuote({projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}){return Zn.api.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}})},fetchSwapTokens({projectId:t,chainId:e}){return Zn.api.get({path:"/v1/convert/tokens",params:{projectId:t,chainId:e}})},fetchTokenPrice({projectId:t,addresses:e}){return Zn.api.post({path:"/v1/fungible/price",body:{projectId:t,currency:"usd",addresses:e},headers:{"Content-Type":"application/json"}})},fetchSwapAllowance({projectId:t,tokenAddress:e,userAddress:r}){const{sdkType:n,sdkVersion:i}=qe.state;return Zn.api.get({path:"/v1/convert/allowance",params:{projectId:t,tokenAddress:e,userAddress:r},headers:{"Content-Type":"application/json","x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"}})},fetchGasPrice({projectId:t,chainId:e}){const{sdkType:r,sdkVersion:n}=qe.state;return Zn.api.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":r,"x-sdk-version":n||"html-wagmi-4.2.2"},params:{projectId:t,chainId:e}})},generateSwapCalldata({amount:t,from:e,projectId:r,to:n,userAddress:i}){return Zn.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Tn.CONVERT_SLIPPAGE_TOLERANCE},from:e,projectId:r,to:n,userAddress:i}})},generateApproveCalldata({from:t,projectId:e,to:r,userAddress:n}){const{sdkType:i,sdkVersion:s}=qe.state;return Zn.api.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":i,"x-sdk-version":s||"html-wagmi-4.2.2"},params:{projectId:e,userAddress:n,from:t,to:r}})},async getBalance(t,e,r){const{sdkType:n,sdkVersion:i}=qe.state;return Zn.api.get({path:`/v1/account/${t}/balance`,headers:{"x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"},params:{currency:"usd",projectId:qe.state.projectId,chainId:e,forceUpdate:r}})},async lookupEnsName(t){return Zn.api.get({path:`/v1/profile/account/${t}`,params:{projectId:qe.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:t}){return Zn.api.get({path:`/v1/profile/reverse/${t}`,params:{sender:Se.state.address,projectId:qe.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(t){return Zn.api.get({path:`/v1/profile/suggestions/${t}`,params:{projectId:qe.state.projectId}})},async registerEnsName({coinType:t,address:e,message:r,signature:n}){return Zn.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:n},headers:{"Content-Type":"application/json"}})},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:n,paymentAmount:i}){return(await Zn.api.post({path:"/v1/generators/onrampurl",params:{projectId:qe.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url},async getOnrampOptions(){try{return await Zn.api.get({path:"/v1/onramp/options",params:{projectId:qe.state.projectId}})}catch{return AX}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){try{return await Zn.api.post({path:"/v1/onramp/quote",params:{projectId:qe.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}})}catch{return{coinbaseFee:{amount:r,currency:e.id},networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},setClientId(t){Zn.clientId=t,Zn.api=new P6({baseUrl:gL,clientId:t})}},Zo=Rn({message:"",variant:"success",open:!1}),St={state:Zo,subscribeKey(t,e){return Ts(Zo,t,e)},showLoading(t){Zo.message=t,Zo.variant="loading",Zo.open=!0},showSuccess(t){Zo.message=t,Zo.variant="success",Zo.open=!0},showError(t){const e=Ue.parseError(t);Zo.message=e,Zo.variant="error",Zo.open=!0},hide(){Zo.open=!1}};var mL={},N6={};N6.byteLength=IX;N6.toByteArray=kX;N6.fromByteArray=NX;var il=[],oa=[],EX=typeof Uint8Array<"u"?Uint8Array:Array,Ux="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var cp=0,SX=Ux.length;cp0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function IX(t){var e=wL(t),r=e[0],n=e[1];return(r+n)*3/4-n}function TX(t,e,r){return(e+r)*3/4-r}function kX(t){var e,r=wL(t),n=r[0],i=r[1],s=new EX(TX(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=oa[t.charCodeAt(c)]<<2|oa[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=oa[t.charCodeAt(c)]<<10|oa[t.charCodeAt(c+1)]<<4|oa[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function RX(t){return il[t>>18&63]+il[t>>12&63]+il[t>>6&63]+il[t&63]}function PX(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(il[e>>2]+il[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(il[e>>10]+il[e>>4&63]+il[e<<2&63]+"=")),i.join("")}var qA={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */qA.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,d=-7,f=r?i-1:0,g=r?-1:1,v=t[e+f];for(f+=g,s=v&(1<<-d)-1,v>>=-d,d+=a;d>0;s=s*256+t[e+f],f+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+f],f+=g,d-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(v?-1:1)*o*Math.pow(2,s-n)};qA.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,d=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,x=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=g/c:e+=g*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*c-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+v]=a&255,v+=x,a/=256,i-=8);for(o=o<0;t[r+v]=o&255,v+=x,o/=256,l-=8);t[r+v-x]|=P*128};/*! +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Rx(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function W7(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var TJ=typeof WeakMap=="function"?WeakMap:Map;function $D(t,e,r){r=xu(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Hb||(Hb=!0,X7=n),W7(t,e)},r}function OD(t,e,r){r=xu(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){W7(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){W7(t,e),typeof n!="function"&&(Vd===null?Vd=new Set([this]):Vd.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function kk(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new TJ;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=zJ.bind(null,t,e,r),e.then(t,t))}function Rk(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Pk(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=xu(-1,1),e.tag=2,qd(r,e,1))),r.lanes|=1),t)}var kJ=Vu.ReactCurrentOwner,qs=!1;function fs(t,e,r,n){e.child=t===null?uD(e,null,r,n):h1(e,t.child,r,n)}function Nk(t,e,r,n,i){r=r.render;var s=e.ref;return Wp(e,i),n=SA(t,e,r,n,s,i),r=IA(),t!==null&&!qs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Tu(t,e,i)):(yn&&r&&pA(e),e.flags|=1,fs(t,e,n,i),e.child)}function Mk(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!LA(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,DD(t,e,s,n,i)):(t=tb(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:vw,r(o,n)&&t.ref===e.ref)return Tu(t,e,i)}return e.flags|=1,t=Gd(s,n),t.ref=e.ref,t.return=e,e.child=t}function DD(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(vw(s,n)&&t.ref===e.ref)if(qs=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(qs=!0);else return e.lanes=t.lanes,Tu(t,e,i)}return H7(t,e,r,n,i)}function LD(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},on(Np,go),go|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,on(Np,go),go|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,on(Np,go),go|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,on(Np,go),go|=n;return fs(t,e,i,r),e.child}function BD(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function H7(t,e,r,n,i){var s=Gs(r)?Nh:rs.current;return s=d1(e,s),Wp(e,i),r=SA(t,e,r,n,s,i),n=IA(),t!==null&&!qs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Tu(t,e,i)):(yn&&n&&pA(e),e.flags|=1,fs(t,e,r,i),e.child)}function $k(t,e,r,n,i){if(Gs(r)){var s=!0;$b(e)}else s=!1;if(Wp(e,i),e.stateNode===null)Jy(t,e),MD(e,r,n),z7(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,l=r.contextType;typeof l=="object"&&l!==null?l=ma(l):(l=Gs(r)?Nh:rs.current,l=d1(e,l));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||c!==l)&&Tk(e,o,n,l),vd=!1;var g=e.memoizedState;o.state=g,Ub(e,n,o,i),c=e.memoizedState,a!==n||g!==c||Ks.current||vd?(typeof d=="function"&&(F7(e,r,d,n),c=e.memoizedState),(a=vd||Ik(e,r,a,n,g,c,l))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),o.props=n,o.state=c,o.context=l,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,fD(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:Qa(e.type,a),o.props=l,f=e.pendingProps,g=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=ma(c):(c=Gs(r)?Nh:rs.current,c=d1(e,c));var v=r.getDerivedStateFromProps;(d=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||g!==c)&&Tk(e,o,n,c),vd=!1,g=e.memoizedState,o.state=g,Ub(e,n,o,i);var x=e.memoizedState;a!==f||g!==x||Ks.current||vd?(typeof v=="function"&&(F7(e,r,v,n),x=e.memoizedState),(l=vd||Ik(e,r,l,n,g,x,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,x,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,x,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=x),o.props=n,o.state=x,o.context=c,n=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),n=!1)}return q7(t,e,r,n,s,i)}function q7(t,e,r,n,i,s){BD(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&yk(e,r,!1),Tu(t,e,s);n=e.stateNode,kJ.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=h1(e,t.child,null,s),e.child=h1(e,null,a,s)):fs(t,e,a,s),e.memoizedState=n.state,i&&yk(e,r,!0),e.child}function UD(t){var e=t.stateNode;e.pendingContext?vk(t,e.pendingContext,e.pendingContext!==e.context):e.context&&vk(t,e.context,!1),CA(t,e.containerInfo)}function Ok(t,e,r,n,i){return f1(),mA(i),e.flags|=256,fs(t,e,r,n),e.child}var V7={dehydrated:null,treeContext:null,retryLane:0};function K7(t){return{baseLanes:t,cachePool:null,transitions:null}}function jD(t,e,r){var n=e.pendingProps,i=En.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),on(En,i&1),t===null)return U7(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=S6(o,n,0,null),t=Sh(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=K7(r),e.memoizedState=V7,t):RA(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return RJ(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=Gd(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Gd(a,s):(s=Sh(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?K7(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=V7,n}return s=t.child,t=s.sibling,n=Gd(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function RA(t,e){return e=S6({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function oy(t,e,r,n){return n!==null&&mA(n),h1(e,t.child,null,r),t=RA(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function RJ(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Rx(Error(We(422))),oy(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=S6({mode:"visible",children:n.children},i,0,null),s=Sh(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&h1(e,t.child,null,o),e.child.memoizedState=K7(o),e.memoizedState=V7,s);if(!(e.mode&1))return oy(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(We(419)),n=Rx(s,n,void 0),oy(t,e,o,n)}if(a=(o&t.childLanes)!==0,qs||a){if(n=wi,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Iu(t,i),uc(n,t,i,-1))}return DA(),n=Rx(Error(We(421))),oy(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=WJ.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,wo=Hd(i.nextSibling),bo=e,yn=!0,ic=null,t!==null&&(da[fa++]=gu,da[fa++]=mu,da[fa++]=Mh,gu=t.id,mu=t.overflow,Mh=e),e=RA(e,n.children),e.flags|=4096,e)}function Dk(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),j7(t.return,e,r)}function Px(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function FD(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(fs(t,e,n.children,r),n=En.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Dk(t,r,e);else if(t.tag===19)Dk(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(on(En,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&jb(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Px(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&jb(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Px(e,!0,r,null,s);break;case"together":Px(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Jy(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Tu(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Oh|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(We(153));if(e.child!==null){for(t=e.child,r=Gd(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Gd(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function PJ(t,e,r){switch(e.tag){case 3:UD(e),f1();break;case 5:hD(e);break;case 1:Gs(e.type)&&$b(e);break;case 4:CA(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;on(Lb,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(on(En,En.current&1),e.flags|=128,null):r&e.child.childLanes?jD(t,e,r):(on(En,En.current&1),t=Tu(t,e,r),t!==null?t.sibling:null);on(En,En.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return FD(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),on(En,En.current),n)break;return null;case 22:case 23:return e.lanes=0,LD(t,e,r)}return Tu(t,e,r)}var zD,G7,WD,HD;zD=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};G7=function(){};WD=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,hh(ol.current);var s=null;switch(r){case"input":i=m7(t,i),n=m7(t,n),s=[];break;case"select":i=kn({},i,{value:void 0}),n=kn({},n,{value:void 0}),s=[];break;case"textarea":i=y7(t,i),n=y7(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Nb)}x7(r,n);var o;r=null;for(l in i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(dw.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var c=n[l];if(a=i!=null?i[l]:void 0,n.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(s||(s=[]),s.push(l,r)),r=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(dw.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&fn("scroll",t),s||a===c||(s=[])):(s=s||[]).push(l,c))}r&&(s=s||[]).push("style",r);var l=s;(e.updateQueue=l)&&(e.flags|=4)}};HD=function(t,e,r,n){r!==n&&(e.flags|=4)};function sm(t,e){if(!yn)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Hi(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function NJ(t,e,r){var n=e.pendingProps;switch(gA(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hi(e),null;case 1:return Gs(e.type)&&Mb(),Hi(e),null;case 3:return n=e.stateNode,p1(),mn(Ks),mn(rs),AA(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(iy(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ic!==null&&(rC(ic),ic=null))),G7(t,e),Hi(e),null;case 5:_A(e);var i=hh(_w.current);if(r=e.type,t!==null&&e.stateNode!=null)WD(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(We(166));return Hi(e),null}if(t=hh(ol.current),iy(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[nl]=e,n[xw]=s,t=(e.mode&1)!==0,r){case"dialog":fn("cancel",n),fn("close",n);break;case"iframe":case"object":case"embed":fn("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[nl]=e,t[xw]=n,zD(t,e,!1,!1),e.stateNode=t;e:{switch(o=C7(r,n),r){case"dialog":fn("cancel",t),fn("close",t),i=n;break;case"iframe":case"object":case"embed":fn("load",t),i=n;break;case"video":case"audio":for(i=0;im1&&(e.flags|=128,n=!0,sm(s,!1),e.lanes=4194304)}else{if(!n)if(t=jb(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),sm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!yn)return Hi(e),null}else 2*Hn()-s.renderingStartTime>m1&&r!==1073741824&&(e.flags|=128,n=!0,sm(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Hn(),e.sibling=null,r=En.current,on(En,n?r&1|2:r&1),e):(Hi(e),null);case 22:case 23:return OA(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?go&1073741824&&(Hi(e),e.subtreeFlags&6&&(e.flags|=8192)):Hi(e),null;case 24:return null;case 25:return null}throw Error(We(156,e.tag))}function MJ(t,e){switch(gA(e),e.tag){case 1:return Gs(e.type)&&Mb(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return p1(),mn(Ks),mn(rs),AA(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return _A(e),null;case 13:if(mn(En),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(We(340));f1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return mn(En),null;case 4:return p1(),null;case 10:return yA(e.type._context),null;case 22:case 23:return OA(),null;case 24:return null;default:return null}}var ay=!1,Ji=!1,$J=typeof WeakSet=="function"?WeakSet:Set,_t=null;function Pp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){On(t,e,n)}else r.current=null}function Z7(t,e,r){try{r()}catch(n){On(t,e,n)}}var Lk=!1;function OJ(t,e){if(N7=kb,t=ZO(),hA(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,d=0,f=t,g=null;t:for(;;){for(var v;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(v=f.firstChild)!==null;)g=f,f=v;for(;;){if(f===t)break t;if(g===r&&++l===i&&(a=o),g===s&&++d===n&&(c=o),(v=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(M7={focusedElem:t,selectionRange:r},kb=!1,_t=e;_t!==null;)if(e=_t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,_t=t;else for(;_t!==null;){e=_t;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,M=x.memoizedState,N=e.stateNode,E=N.getSnapshotBeforeUpdate(e.elementType===e.type?P:Qa(e.type,P),M);N.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var $=e.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(We(163))}}catch(L){On(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,_t=t;break}_t=e.return}return x=Lk,Lk=!1,x}function qm(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Z7(e,r,s)}i=i.next}while(i!==n)}}function A6(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Q7(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function qD(t){var e=t.alternate;e!==null&&(t.alternate=null,qD(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[nl],delete e[xw],delete e[D7],delete e[wJ],delete e[vJ])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function VD(t){return t.tag===5||t.tag===3||t.tag===4}function Bk(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||VD(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Y7(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Nb));else if(n!==4&&(t=t.child,t!==null))for(Y7(t,e,r),t=t.sibling;t!==null;)Y7(t,e,r),t=t.sibling}function J7(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(J7(t,e,r),t=t.sibling;t!==null;)J7(t,e,r),t=t.sibling}var Ai=null,tc=!1;function ud(t,e,r){for(r=r.child;r!==null;)KD(t,e,r),r=r.sibling}function KD(t,e,r){if(sl&&typeof sl.onCommitFiberUnmount=="function")try{sl.onCommitFiberUnmount(m6,r)}catch{}switch(r.tag){case 5:Ji||Pp(r,e);case 6:var n=Ai,i=tc;Ai=null,ud(t,e,r),Ai=n,tc=i,Ai!==null&&(tc?(t=Ai,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ai.removeChild(r.stateNode));break;case 18:Ai!==null&&(tc?(t=Ai,r=r.stateNode,t.nodeType===8?Ax(t.parentNode,r):t.nodeType===1&&Ax(t,r),mw(t)):Ax(Ai,r.stateNode));break;case 4:n=Ai,i=tc,Ai=r.stateNode.containerInfo,tc=!0,ud(t,e,r),Ai=n,tc=i;break;case 0:case 11:case 14:case 15:if(!Ji&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Z7(r,e,o),i=i.next}while(i!==n)}ud(t,e,r);break;case 1:if(!Ji&&(Pp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){On(r,e,a)}ud(t,e,r);break;case 21:ud(t,e,r);break;case 22:r.mode&1?(Ji=(n=Ji)||r.memoizedState!==null,ud(t,e,r),Ji=n):ud(t,e,r);break;default:ud(t,e,r)}}function Uk(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new $J),e.forEach(function(n){var i=HJ.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ja(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Hn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*LJ(n/1960))-n,10t?16:t,Ld===null)var n=!1;else{if(t=Ld,Ld=null,qb=0,Nr&6)throw Error(We(331));var i=Nr;for(Nr|=4,_t=t.current;_t!==null;){var s=_t,o=s.child;if(_t.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cHn()-MA?Eh(t,0):NA|=r),Zs(t,e)}function tL(t,e){e===0&&(t.mode&1?(e=J3,J3<<=1,!(J3&130023424)&&(J3=4194304)):e=1);var r=ws();t=Iu(t,e),t!==null&&(Qv(t,e,r),Zs(t,r))}function WJ(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),tL(t,r)}function HJ(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(We(314))}n!==null&&n.delete(e),tL(t,r)}var rL;rL=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ks.current)qs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return qs=!1,PJ(t,e,r);qs=!!(t.flags&131072)}else qs=!1,yn&&e.flags&1048576&&oD(e,Db,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Jy(t,e),t=e.pendingProps;var i=d1(e,rs.current);Wp(e,r),i=SA(null,e,n,t,i,r);var s=IA();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Gs(n)?(s=!0,$b(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xA(e),i.updater=_6,e.stateNode=i,i._reactInternals=e,z7(e,n,t,r),e=q7(null,e,n,!0,s,r)):(e.tag=0,yn&&s&&pA(e),fs(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Jy(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=VJ(n),t=Qa(n,t),i){case 0:e=H7(null,e,n,t,r);break e;case 1:e=$k(null,e,n,t,r);break e;case 11:e=Nk(null,e,n,t,r);break e;case 14:e=Mk(null,e,n,Qa(n.type,t),r);break e}throw Error(We(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),H7(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),$k(t,e,n,i,r);case 3:e:{if(UD(e),t===null)throw Error(We(387));n=e.pendingProps,s=e.memoizedState,i=s.element,fD(t,e),Ub(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=g1(Error(We(423)),e),e=Ok(t,e,n,r,i);break e}else if(n!==i){i=g1(Error(We(424)),e),e=Ok(t,e,n,r,i);break e}else for(wo=Hd(e.stateNode.containerInfo.firstChild),bo=e,yn=!0,ic=null,r=uD(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(f1(),n===i){e=Tu(t,e,r);break e}fs(t,e,n,r)}e=e.child}return e;case 5:return hD(e),t===null&&U7(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,$7(n,i)?o=null:s!==null&&$7(n,s)&&(e.flags|=32),BD(t,e),fs(t,e,o,r),e.child;case 6:return t===null&&U7(e),null;case 13:return jD(t,e,r);case 4:return CA(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=h1(e,null,n,r):fs(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),Nk(t,e,n,i,r);case 7:return fs(t,e,e.pendingProps,r),e.child;case 8:return fs(t,e,e.pendingProps.children,r),e.child;case 12:return fs(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,on(Lb,n._currentValue),n._currentValue=o,s!==null)if(pc(s.value,o)){if(s.children===i.children&&!Ks.current){e=Tu(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=xu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var d=l.pending;d===null?c.next=c:(c.next=d.next,d.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),j7(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(We(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),j7(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}fs(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Wp(e,r),i=ma(i),n=n(i),e.flags|=1,fs(t,e,n,r),e.child;case 14:return n=e.type,i=Qa(n,e.pendingProps),i=Qa(n.type,i),Mk(t,e,n,i,r);case 15:return DD(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Qa(n,i),Jy(t,e),e.tag=1,Gs(n)?(t=!0,$b(e)):t=!1,Wp(e,r),MD(e,n,i),z7(e,n,i,r),q7(null,e,n,!0,t,r);case 19:return FD(t,e,r);case 22:return LD(t,e,r)}throw Error(We(156,e.tag))};function nL(t,e){return RO(t,e)}function qJ(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pa(t,e,r,n){return new qJ(t,e,r,n)}function LA(t){return t=t.prototype,!(!t||!t.isReactComponent)}function VJ(t){if(typeof t=="function")return LA(t)?1:0;if(t!=null){if(t=t.$$typeof,t===rA)return 11;if(t===nA)return 14}return 2}function Gd(t,e){var r=t.alternate;return r===null?(r=pa(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function tb(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")LA(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Cp:return Sh(r.children,i,s,e);case tA:o=8,i|=8;break;case f7:return t=pa(12,r,e,i|2),t.elementType=f7,t.lanes=s,t;case h7:return t=pa(13,r,e,i),t.elementType=h7,t.lanes=s,t;case p7:return t=pa(19,r,e,i),t.elementType=p7,t.lanes=s,t;case hO:return S6(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case dO:o=10;break e;case fO:o=9;break e;case rA:o=11;break e;case nA:o=14;break e;case wd:o=16,n=null;break e}throw Error(We(130,t==null?t:typeof t,""))}return e=pa(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Sh(t,e,r,n){return t=pa(7,t,n,e),t.lanes=r,t}function S6(t,e,r,n){return t=pa(22,t,n,e),t.elementType=hO,t.lanes=r,t.stateNode={isHidden:!1},t}function Nx(t,e,r){return t=pa(6,t,null,e),t.lanes=r,t}function Mx(t,e,r){return e=pa(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function KJ(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hx(0),this.expirationTimes=hx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hx(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function BA(t,e,r,n,i,s,o,a,c){return t=new KJ(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=pa(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},xA(s),t}function GJ(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aL)}catch(t){console.error(t)}}aL(),aO.exports=ko;var zA=aO.exports;const nAe=Ec(zA);var cL,Kk=zA;cL=Kk.createRoot,Kk.hydrateRoot;const XJ="modulepreload",eX=function(t){return"/"+t},Gk={},Qs=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=eX(c),c in Gk)return;Gk[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":XJ,l||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),l)return new Promise((g,v)=>{f.addEventListener("load",g),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},tX=Symbol(),Zk=Object.getPrototypeOf,nC=new WeakMap,rX=t=>t&&(nC.has(t)?nC.get(t):Zk(t)===Object.prototype||Zk(t)===Array.prototype),nX=t=>rX(t)&&t[tX]||null,Qk=(t,e=!0)=>{nC.set(t,e)},Gb={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://ucan.dacade.my/ucan"},$x=t=>typeof t=="object"&&t!==null,yd=new WeakMap,Nm=new WeakSet,iX=(t=Object.is,e=(l,d)=>new Proxy(l,d),r=l=>$x(l)&&!Nm.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},i=new WeakMap,s=(l,d,f=n)=>{const g=i.get(l);if((g==null?void 0:g[0])===d)return g[1];const v=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Qk(v,!0),i.set(l,[d,v]),Reflect.ownKeys(l).forEach(x=>{if(Object.getOwnPropertyDescriptor(v,x))return;const P=Reflect.get(l,x),M={value:P,enumerable:!0,configurable:!0};if(Nm.has(P))Qk(P,!1);else if(P instanceof Promise)delete M.value,M.get=()=>f(P);else if(yd.has(P)){const[N,E]=yd.get(P);M.value=s(N,E(),f)}Object.defineProperty(v,x,M)}),Object.preventExtensions(v)},o=new WeakMap,a=[1,1],c=l=>{if(!$x(l))throw new Error("object required");const d=o.get(l);if(d)return d;let f=a[0];const g=new Set,v=(B,K=++a[0])=>{f!==K&&(f=K,g.forEach(U=>U(B,K)))};let x=a[1];const P=(B=++a[1])=>(x!==B&&!g.size&&(x=B,N.forEach(([K])=>{const U=K[1](B);U>f&&(f=U)})),f),M=B=>(K,U)=>{const C=[...K];C[1]=[B,...C[1]],v(C,U)},N=new Map,E=(B,K)=>{if((Gb?"production":void 0)!=="production"&&N.has(B))throw new Error("prop listener already exists");if(g.size){const U=K[3](M(B));N.set(B,[K,U])}else N.set(B,[K])},$=B=>{var K;const U=N.get(B);U&&(N.delete(B),(K=U[1])==null||K.call(U))},L=B=>(g.add(B),g.size===1&&N.forEach(([U,C],p)=>{if((Gb?"production":void 0)!=="production"&&C)throw new Error("remove already exists");const m=U[3](M(p));N.set(p,[U,m])}),()=>{g.delete(B),g.size===0&&N.forEach(([U,C],p)=>{C&&(C(),N.set(p,[U]))})}),j=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),I=e(j,{deleteProperty(B,K){const U=Reflect.get(B,K);$(K);const C=Reflect.deleteProperty(B,K);return C&&v(["delete",[K],U]),C},set(B,K,U,C){const p=Reflect.has(B,K),m=Reflect.get(B,K,C);if(p&&(t(m,U)||o.has(U)&&t(m,o.get(U))))return!0;$(K),$x(U)&&(U=nX(U)||U);let w=U;if(U instanceof Promise)U.then(_=>{U.status="fulfilled",U.value=_,v(["resolve",[K],_])}).catch(_=>{U.status="rejected",U.reason=_,v(["reject",[K],_])});else{!yd.has(U)&&r(U)&&(w=c(U));const _=!Nm.has(w)&&yd.get(w);_&&E(K,_)}return Reflect.set(B,K,w,C),v(["set",[K],U,m]),!0}});o.set(l,I);const T=[j,P,s,L];return yd.set(I,T),Reflect.ownKeys(l).forEach(B=>{const K=Object.getOwnPropertyDescriptor(l,B);"value"in K&&(I[B]=l[B],delete K.value,delete K.writable),Object.defineProperty(j,B,K)}),I})=>[c,yd,Nm,t,e,r,n,i,s,o,a],[sX]=iX();function Rn(t={}){return sX(t)}function bs(t,e,r){const n=yd.get(t);(Gb?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const l=o(d=>{s.push(d),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}function iC(t,e){const r=yd.get(t);(Gb?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}function sc(t){return Nm.add(t),t}function Ts(t,e,r,n){let i=t[e];return bs(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)})}function oX(t){const e=Rn({data:Array.from([]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(s=>s[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(e,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(e),e}var lL={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Yi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",d="week",f="month",g="quarter",v="year",x="date",P="Invalid Date",M=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(m){var w=["th","st","nd","rd"],_=m%100;return"["+m+(w[(_-20)%10]||w[_]||w[0])+"]"}},$=function(m,w,_){var R=String(m);return!R||R.length>=w?m:""+Array(w+1-R.length).join(_)+m},L={s:$,z:function(m){var w=-m.utcOffset(),_=Math.abs(w),R=Math.floor(_/60),S=_%60;return(w<=0?"+":"-")+$(R,2,"0")+":"+$(S,2,"0")},m:function m(w,_){if(w.date()<_.date())return-m(_,w);var R=12*(_.year()-w.year())+(_.month()-w.month()),S=w.clone().add(R,f),k=_-S<0,y=w.clone().add(R+(k?-1:1),f);return+(-(R+(_-S)/(k?S-y:y-S))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:f,y:v,w:d,d:l,D:x,h:c,m:a,s:o,ms:s,Q:g}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},j="en",H={};H[j]=E;var I="$isDayjsObject",T=function(m){return m instanceof C||!(!m||!m[I])},B=function m(w,_,R){var S;if(!w)return j;if(typeof w=="string"){var k=w.toLowerCase();H[k]&&(S=k),_&&(H[k]=_,S=k);var y=w.split("-");if(!S&&y.length>1)return m(y[0])}else{var b=w.name;H[b]=w,S=b}return!R&&S&&(j=S),S||!R&&j},K=function(m,w){if(T(m))return m.clone();var _=typeof w=="object"?w:{};return _.date=m,_.args=arguments,new C(_)},U=L;U.l=B,U.i=T,U.w=function(m,w){return K(m,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var C=function(){function m(_){this.$L=B(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[I]=!0}var w=m.prototype;return w.parse=function(_){this.$d=function(R){var S=R.date,k=R.utc;if(S===null)return new Date(NaN);if(U.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var y=S.match(M);if(y){var b=y[2]-1||0,V=(y[7]||"0").substring(0,3);return k?new Date(Date.UTC(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)):new Date(y[1],b,y[3]||1,y[4]||0,y[5]||0,y[6]||0,V)}}return new Date(S)}(_),this.init()},w.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},w.$utils=function(){return U},w.isValid=function(){return this.$d.toString()!==P},w.isSame=function(_,R){var S=K(_);return this.startOf(R)<=S&&S<=this.endOf(R)},w.isAfter=function(_,R){return K(_)0,H<=j.r||!j.r){H<=1&&L>0&&(j=E[L-1]);var I=N[j.l];v&&(H=v(""+H)),P=typeof I=="string"?I.replace("%d",H):I(H,d,j.l,M);break}}if(d)return P;var T=M?N.future:N.past;return typeof T=="function"?T(P):T.replace("%s",P)},s.to=function(l,d){return a(l,d,this,!0)},s.from=function(l,d){return a(l,d,this)};var c=function(l){return l.$u?i.utc():i()};s.toNow=function(l){return this.to(c(this),l)},s.fromNow=function(l){return this.from(c(this),l)}}})})(dL);var uX=dL.exports;const dX=Ec(uX);var fL={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Yi,function(){return function(r,n,i){i.updateLocale=function(s,o){var a=i.Ls[s];if(a)return(o?Object.keys(o):[]).forEach(function(c){a[c]=o[c]}),a}}})})(fL);var fX=fL.exports;const hX=Ec(fX);qp.extend(dX);qp.extend(hX);const pX={...lX,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};qp.locale("en-web3-modal",pX);const WA={getYear(t=new Date().toISOString()){return qp(t).year()},getRelativeDateFromNow(t){return qp(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return qp(t).format(e)}},Ya={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t}};var gX=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ox=Math.ceil,ra=Math.floor,Us="[BigNumber Error] ",Yk=Us+"Number primitive has more than 15 significant digits: ",Fa=1e14,sr=14,Dx=9007199254740991,Lx=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],dd=1e7,li=1e9;function hL(t){var e,r,n,i=E.prototype={constructor:E,toString:null,valueOf:null},s=new E(1),o=20,a=4,c=-7,l=21,d=-1e7,f=1e7,g=!1,v=1,x=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function E(T,B){var K,U,C,p,m,w,_,R,S=this;if(!(S instanceof E))return new E(T,B);if(B==null){if(T&&T._isBigNumber===!0){S.s=T.s,!T.c||T.e>f?S.c=S.e=null:T.e=10;m/=10,p++);p>f?S.c=S.e=null:(S.e=p,S.c=[T]);return}R=String(T)}else{if(!gX.test(R=String(T)))return n(S,R,w);S.s=R.charCodeAt(0)==45?(R=R.slice(1),-1):1}(p=R.indexOf("."))>-1&&(R=R.replace(".","")),(m=R.search(/e/i))>0?(p<0&&(p=m),p+=+R.slice(m+1),R=R.substring(0,m)):p<0&&(p=R.length)}else{if(_n(B,2,M.length,"Base"),B==10&&N)return S=new E(T),H(S,o+S.e+1,a);if(R=String(T),w=typeof T=="number"){if(T*0!=0)return n(S,R,w,B);if(S.s=1/T<0?(R=R.slice(1),-1):1,E.DEBUG&&R.replace(/^0\.0*|\./,"").length>15)throw Error(Yk+T)}else S.s=R.charCodeAt(0)===45?(R=R.slice(1),-1):1;for(K=M.slice(0,B),p=m=0,_=R.length;m<_;m++)if(K.indexOf(U=R.charAt(m))<0){if(U=="."){if(m>p){p=_;continue}}else if(!C&&(R==R.toUpperCase()&&(R=R.toLowerCase())||R==R.toLowerCase()&&(R=R.toUpperCase()))){C=!0,m=-1,p=0;continue}return n(S,String(T),w,B)}w=!1,R=r(R,B,10,S.s),(p=R.indexOf("."))>-1?R=R.replace(".",""):p=R.length}for(m=0;R.charCodeAt(m)===48;m++);for(_=R.length;R.charCodeAt(--_)===48;);if(R=R.slice(m,++_)){if(_-=m,w&&E.DEBUG&&_>15&&(T>Dx||T!==ra(T)))throw Error(Yk+S.s*T);if((p=p-m-1)>f)S.c=S.e=null;else if(p=-li&&C<=li&&C===ra(C)){if(U[0]===0){if(C===0&&U.length===1)return!0;break e}if(B=(C+1)%sr,B<1&&(B+=sr),String(U[0]).length==B){for(B=0;B=Fa||K!==ra(K))break e;if(K!==0)return!0}}}else if(U===null&&C===null&&(p===null||p===1||p===-1))return!0;throw Error(Us+"Invalid BigNumber: "+T)},E.maximum=E.max=function(){return L(arguments,-1)},E.minimum=E.min=function(){return L(arguments,1)},E.random=function(){var T=9007199254740992,B=Math.random()*T&2097151?function(){return ra(Math.random()*T)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(K){var U,C,p,m,w,_=0,R=[],S=new E(s);if(K==null?K=o:_n(K,0,li),m=Ox(K/sr),g)if(crypto.getRandomValues){for(U=crypto.getRandomValues(new Uint32Array(m*=2));_>>11),w>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),U[_]=C[0],U[_+1]=C[1]):(R.push(w%1e14),_+=2);_=m/2}else if(crypto.randomBytes){for(U=crypto.randomBytes(m*=7);_=9e15?crypto.randomBytes(7).copy(U,_):(R.push(w%1e14),_+=7);_=m/7}else throw g=!1,Error(Us+"crypto unavailable");if(!g)for(;_=10;w/=10,_++);_C-1&&(w[m+1]==null&&(w[m+1]=0),w[m+1]+=w[m]/C|0,w[m]%=C)}return w.reverse()}return function(K,U,C,p,m){var w,_,R,S,k,y,b,V,ce=K.indexOf("."),fe=o,W=a;for(ce>=0&&(S=x,x=0,K=K.replace(".",""),V=new E(U),y=V.pow(K.length-ce),x=S,V.c=B(Jl(Go(y.c),y.e,"0"),10,C,T),V.e=V.c.length),b=B(K,U,C,m?(w=M,T):(w=T,M)),R=S=b.length;b[--S]==0;b.pop());if(!b[0])return w.charAt(0);if(ce<0?--R:(y.c=b,y.e=R,y.s=p,y=e(y,V,fe,W,C),b=y.c,k=y.r,R=y.e),_=R+fe+1,ce=b[_],S=C/2,k=k||_<0||b[_+1]!=null,k=W<4?(ce!=null||k)&&(W==0||W==(y.s<0?3:2)):ce>S||ce==S&&(W==4||k||W==6&&b[_-1]&1||W==(y.s<0?8:7)),_<1||!b[0])K=k?Jl(w.charAt(1),-fe,w.charAt(0)):w.charAt(0);else{if(b.length=_,k)for(--C;++b[--_]>C;)b[_]=0,_||(++R,b=[1].concat(b));for(S=b.length;!b[--S];);for(ce=0,K="";ce<=S;K+=w.charAt(b[ce++]));K=Jl(K,R,w.charAt(0))}return K}}(),e=function(){function T(U,C,p){var m,w,_,R,S=0,k=U.length,y=C%dd,b=C/dd|0;for(U=U.slice();k--;)_=U[k]%dd,R=U[k]/dd|0,m=b*_+R*y,w=y*_+m%dd*dd+S,S=(w/p|0)+(m/dd|0)+b*R,U[k]=w%p;return S&&(U=[S].concat(U)),U}function B(U,C,p,m){var w,_;if(p!=m)_=p>m?1:-1;else for(w=_=0;wC[w]?1:-1;break}return _}function K(U,C,p,m){for(var w=0;p--;)U[p]-=w,w=U[p]1;U.splice(0,1));}return function(U,C,p,m,w){var _,R,S,k,y,b,V,ce,fe,W,ue,J,ne,ie,D,te,me,Ce=U.s==C.s?1:-1,Ee=U.c,Re=C.c;if(!Ee||!Ee[0]||!Re||!Re[0])return new E(!U.s||!C.s||(Ee?Re&&Ee[0]==Re[0]:!Re)?NaN:Ee&&Ee[0]==0||!Re?Ce*0:Ce/0);for(ce=new E(Ce),fe=ce.c=[],R=U.e-C.e,Ce=p+R+1,w||(w=Fa,R=na(U.e/sr)-na(C.e/sr),Ce=Ce/sr|0),S=0;Re[S]==(Ee[S]||0);S++);if(Re[S]>(Ee[S]||0)&&R--,Ce<0)fe.push(1),k=!0;else{for(ie=Ee.length,te=Re.length,S=0,Ce+=2,y=ra(w/(Re[0]+1)),y>1&&(Re=T(Re,y,w),Ee=T(Ee,y,w),te=Re.length,ie=Ee.length),ne=te,W=Ee.slice(0,te),ue=W.length;ue=w/2&&D++;do{if(y=0,_=B(Re,W,te,ue),_<0){if(J=W[0],te!=ue&&(J=J*w+(W[1]||0)),y=ra(J/D),y>1)for(y>=w&&(y=w-1),b=T(Re,y,w),V=b.length,ue=W.length;B(b,W,V,ue)==1;)y--,K(b,te=10;Ce/=10,S++);H(ce,p+(ce.e=S+R*sr-1)+1,m,k)}else ce.e=R,ce.r=+k;return ce}}();function $(T,B,K,U){var C,p,m,w,_;if(K==null?K=a:_n(K,0,8),!T.c)return T.toString();if(C=T.c[0],m=T.e,B==null)_=Go(T.c),_=U==1||U==2&&(m<=c||m>=l)?dy(_,m):Jl(_,m,"0");else if(T=H(new E(T),B,K),p=T.e,_=Go(T.c),w=_.length,U==1||U==2&&(B<=p||p<=c)){for(;ww){if(--B>0)for(_+=".";B--;_+="0");}else if(B+=p-w,B>0)for(p+1==w&&(_+=".");B--;_+="0");return T.s<0&&C?"-"+_:_}function L(T,B){for(var K,U,C=1,p=new E(T[0]);C=10;C/=10,U++);return(K=U+K*sr-1)>f?T.c=T.e=null:K=10;w/=10,C++);if(p=B-C,p<0)p+=sr,m=B,_=k[R=0],S=ra(_/y[C-m-1]%10);else if(R=Ox((p+1)/sr),R>=k.length)if(U){for(;k.length<=R;k.push(0));_=S=0,C=1,p%=sr,m=p-sr+1}else break e;else{for(_=w=k[R],C=1;w>=10;w/=10,C++);p%=sr,m=p-sr+C,S=m<0?0:ra(_/y[C-m-1]%10)}if(U=U||B<0||k[R+1]!=null||(m<0?_:_%y[C-m-1]),U=K<4?(S||U)&&(K==0||K==(T.s<0?3:2)):S>5||S==5&&(K==4||U||K==6&&(p>0?m>0?_/y[C-m]:0:k[R-1])%10&1||K==(T.s<0?8:7)),B<1||!k[0])return k.length=0,U?(B-=T.e+1,k[0]=y[(sr-B%sr)%sr],T.e=-B||0):k[0]=T.e=0,T;if(p==0?(k.length=R,w=1,R--):(k.length=R+1,w=y[sr-p],k[R]=m>0?ra(_/y[C-m]%y[m])*w:0),U)for(;;)if(R==0){for(p=1,m=k[0];m>=10;m/=10,p++);for(m=k[0]+=w,w=1;m>=10;m/=10,w++);p!=w&&(T.e++,k[0]==Fa&&(k[0]=1));break}else{if(k[R]+=w,k[R]!=Fa)break;k[R--]=0,w=1}for(p=k.length;k[--p]===0;k.pop());}T.e>f?T.c=T.e=null:T.e=l?dy(B,K):Jl(B,K,"0"),T.s<0?"-"+B:B)}return i.absoluteValue=i.abs=function(){var T=new E(this);return T.s<0&&(T.s=1),T},i.comparedTo=function(T,B){return Xf(this,new E(T,B))},i.decimalPlaces=i.dp=function(T,B){var K,U,C,p=this;if(T!=null)return _n(T,0,li),B==null?B=a:_n(B,0,8),H(new E(p),T+p.e+1,B);if(!(K=p.c))return null;if(U=((C=K.length-1)-na(this.e/sr))*sr,C=K[C])for(;C%10==0;C/=10,U--);return U<0&&(U=0),U},i.dividedBy=i.div=function(T,B){return e(this,new E(T,B),o,a)},i.dividedToIntegerBy=i.idiv=function(T,B){return e(this,new E(T,B),0,1)},i.exponentiatedBy=i.pow=function(T,B){var K,U,C,p,m,w,_,R,S,k=this;if(T=new E(T),T.c&&!T.isInteger())throw Error(Us+"Exponent not an integer: "+I(T));if(B!=null&&(B=new E(B)),w=T.e>14,!k.c||!k.c[0]||k.c[0]==1&&!k.e&&k.c.length==1||!T.c||!T.c[0])return S=new E(Math.pow(+I(k),w?T.s*(2-uy(T)):+I(T))),B?S.mod(B):S;if(_=T.s<0,B){if(B.c?!B.c[0]:!B.s)return new E(NaN);U=!_&&k.isInteger()&&B.isInteger(),U&&(k=k.mod(B))}else{if(T.e>9&&(k.e>0||k.e<-1||(k.e==0?k.c[0]>1||w&&k.c[1]>=24e7:k.c[0]<8e13||w&&k.c[0]<=9999975e7)))return p=k.s<0&&uy(T)?-0:0,k.e>-1&&(p=1/p),new E(_?1/p:p);x&&(p=Ox(x/sr+2))}for(w?(K=new E(.5),_&&(T.s=1),R=uy(T)):(C=Math.abs(+I(T)),R=C%2),S=new E(s);;){if(R){if(S=S.times(k),!S.c)break;p?S.c.length>p&&(S.c.length=p):U&&(S=S.mod(B))}if(C){if(C=ra(C/2),C===0)break;R=C%2}else if(T=T.times(K),H(T,T.e+1,1),T.e>14)R=uy(T);else{if(C=+I(T),C===0)break;R=C%2}k=k.times(k),p?k.c&&k.c.length>p&&(k.c.length=p):U&&(k=k.mod(B))}return U?S:(_&&(S=s.div(S)),B?S.mod(B):p?H(S,x,a,m):S)},i.integerValue=function(T){var B=new E(this);return T==null?T=a:_n(T,0,8),H(B,B.e+1,T)},i.isEqualTo=i.eq=function(T,B){return Xf(this,new E(T,B))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(T,B){return Xf(this,new E(T,B))>0},i.isGreaterThanOrEqualTo=i.gte=function(T,B){return(B=Xf(this,new E(T,B)))===1||B===0},i.isInteger=function(){return!!this.c&&na(this.e/sr)>this.c.length-2},i.isLessThan=i.lt=function(T,B){return Xf(this,new E(T,B))<0},i.isLessThanOrEqualTo=i.lte=function(T,B){return(B=Xf(this,new E(T,B)))===-1||B===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(T,B){var K,U,C,p,m=this,w=m.s;if(T=new E(T,B),B=T.s,!w||!B)return new E(NaN);if(w!=B)return T.s=-B,m.plus(T);var _=m.e/sr,R=T.e/sr,S=m.c,k=T.c;if(!_||!R){if(!S||!k)return S?(T.s=-B,T):new E(k?m:NaN);if(!S[0]||!k[0])return k[0]?(T.s=-B,T):new E(S[0]?m:a==3?-0:0)}if(_=na(_),R=na(R),S=S.slice(),w=_-R){for((p=w<0)?(w=-w,C=S):(R=_,C=k),C.reverse(),B=w;B--;C.push(0));C.reverse()}else for(U=(p=(w=S.length)<(B=k.length))?w:B,w=B=0;B0)for(;B--;S[K++]=0);for(B=Fa-1;U>w;){if(S[--U]=0;){for(K=0,y=J[C]%fe,b=J[C]/fe|0,m=_,p=C+m;p>C;)R=ue[--m]%fe,S=ue[m]/fe|0,w=b*R+S*y,R=y*R+w%fe*fe+V[p]+K,K=(R/ce|0)+(w/fe|0)+b*S,V[p--]=R%ce;V[p]=K}return K?++U:V.splice(0,1),j(T,V,U)},i.negated=function(){var T=new E(this);return T.s=-T.s||null,T},i.plus=function(T,B){var K,U=this,C=U.s;if(T=new E(T,B),B=T.s,!C||!B)return new E(NaN);if(C!=B)return T.s=-B,U.minus(T);var p=U.e/sr,m=T.e/sr,w=U.c,_=T.c;if(!p||!m){if(!w||!_)return new E(C/0);if(!w[0]||!_[0])return _[0]?T:new E(w[0]?U:C*0)}if(p=na(p),m=na(m),w=w.slice(),C=p-m){for(C>0?(m=p,K=_):(C=-C,K=w),K.reverse();C--;K.push(0));K.reverse()}for(C=w.length,B=_.length,C-B<0&&(K=_,_=w,w=K,B=C),C=0;B;)C=(w[--B]=w[B]+_[B]+C)/Fa|0,w[B]=Fa===w[B]?0:w[B]%Fa;return C&&(w=[C].concat(w),++m),j(T,w,m)},i.precision=i.sd=function(T,B){var K,U,C,p=this;if(T!=null&&T!==!!T)return _n(T,1,li),B==null?B=a:_n(B,0,8),H(new E(p),T,B);if(!(K=p.c))return null;if(C=K.length-1,U=C*sr+1,C=K[C]){for(;C%10==0;C/=10,U--);for(C=K[0];C>=10;C/=10,U++);}return T&&p.e+1>U&&(U=p.e+1),U},i.shiftedBy=function(T){return _n(T,-Dx,Dx),this.times("1e"+T)},i.squareRoot=i.sqrt=function(){var T,B,K,U,C,p=this,m=p.c,w=p.s,_=p.e,R=o+4,S=new E("0.5");if(w!==1||!m||!m[0])return new E(!w||w<0&&(!m||m[0])?NaN:m?p:1/0);if(w=Math.sqrt(+I(p)),w==0||w==1/0?(B=Go(m),(B.length+_)%2==0&&(B+="0"),w=Math.sqrt(+B),_=na((_+1)/2)-(_<0||_%2),w==1/0?B="5e"+_:(B=w.toExponential(),B=B.slice(0,B.indexOf("e")+1)+_),K=new E(B)):K=new E(w+""),K.c[0]){for(_=K.e,w=_+R,w<3&&(w=0);;)if(C=K,K=S.times(C.plus(e(p,C,R,1))),Go(C.c).slice(0,w)===(B=Go(K.c)).slice(0,w))if(K.e<_&&--w,B=B.slice(w-3,w+1),B=="9999"||!U&&B=="4999"){if(!U&&(H(C,C.e+o+2,0),C.times(C).eq(p))){K=C;break}R+=4,w+=4,U=1}else{(!+B||!+B.slice(1)&&B.charAt(0)=="5")&&(H(K,K.e+o+2,1),T=!K.times(K).eq(p));break}}return H(K,K.e+o+1,a,T)},i.toExponential=function(T,B){return T!=null&&(_n(T,0,li),T++),$(this,T,B,1)},i.toFixed=function(T,B){return T!=null&&(_n(T,0,li),T=T+this.e+1),$(this,T,B)},i.toFormat=function(T,B,K){var U,C=this;if(K==null)T!=null&&B&&typeof B=="object"?(K=B,B=null):T&&typeof T=="object"?(K=T,T=B=null):K=P;else if(typeof K!="object")throw Error(Us+"Argument not an object: "+K);if(U=C.toFixed(T,B),C.c){var p,m=U.split("."),w=+K.groupSize,_=+K.secondaryGroupSize,R=K.groupSeparator||"",S=m[0],k=m[1],y=C.s<0,b=y?S.slice(1):S,V=b.length;if(_&&(p=w,w=_,_=p,V-=p),w>0&&V>0){for(p=V%w||w,S=b.substr(0,p);p0&&(S+=R+b.slice(p)),y&&(S="-"+S)}U=k?S+(K.decimalSeparator||"")+((_=+K.fractionGroupSize)?k.replace(new RegExp("\\d{"+_+"}\\B","g"),"$&"+(K.fractionGroupSeparator||"")):k):S}return(K.prefix||"")+U+(K.suffix||"")},i.toFraction=function(T){var B,K,U,C,p,m,w,_,R,S,k,y,b=this,V=b.c;if(T!=null&&(w=new E(T),!w.isInteger()&&(w.c||w.s!==1)||w.lt(s)))throw Error(Us+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+I(w));if(!V)return new E(b);for(B=new E(s),R=K=new E(s),U=_=new E(s),y=Go(V),p=B.e=y.length-b.e-1,B.c[0]=Lx[(m=p%sr)<0?sr+m:m],T=!T||w.comparedTo(B)>0?p>0?B:R:w,m=f,f=1/0,w=new E(y),_.c[0]=0;S=e(w,B,0,1),C=K.plus(S.times(U)),C.comparedTo(T)!=1;)K=U,U=C,R=_.plus(S.times(C=R)),_=C,B=w.minus(S.times(C=B)),w=C;return C=e(T.minus(K),U,0,1),_=_.plus(C.times(R)),K=K.plus(C.times(U)),_.s=R.s=b.s,p=p*2,k=e(R,U,p,a).minus(b).abs().comparedTo(e(_,K,p,a).minus(b).abs())<1?[R,U]:[_,K],f=m,k},i.toNumber=function(){return+I(this)},i.toPrecision=function(T,B){return T!=null&&_n(T,1,li),$(this,T,B,2)},i.toString=function(T){var B,K=this,U=K.s,C=K.e;return C===null?U?(B="Infinity",U<0&&(B="-"+B)):B="NaN":(T==null?B=C<=c||C>=l?dy(Go(K.c),C):Jl(Go(K.c),C,"0"):T===10&&N?(K=H(new E(K),o+C+1,a),B=Jl(Go(K.c),K.e,"0")):(_n(T,2,M.length,"Base"),B=r(Jl(Go(K.c),C,"0"),10,T,U,!0)),U<0&&K.c[0]&&(B="-"+B)),B},i.valueOf=i.toJSON=function(){return I(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,t!=null&&E.set(t),E}function na(t){var e=t|0;return t>0||t===e?e:e-1}function Go(t){for(var e,r,n=1,i=t.length,s=t[0]+"";nl^r?1:-1;for(a=(c=i.length)<(l=s.length)?c:l,o=0;os[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function _n(t,e,r,n){if(tr||t!==ra(t))throw Error(Us+(n||"Argument")+(typeof t=="number"?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function uy(t){var e=t.c.length-1;return na(t.e/sr)==e&&t.c[e]%2!=0}function dy(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Jl(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(n=t.length,++e>n){for(i=r,e-=n;--e;i+=r);t+=i}else e="0"&&s<="9";!i&&(a||c||l||d)&&t.preventDefault(),e==="0"&&!f&&!g&&s==="0"&&t.preventDefault(),e==="0"&&v&&(r(s),t.preventDefault()),(f||g)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!v&&!n.includes(s)&&!g&&!f&&t.preventDefault()}},wX=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],HA={URLS:{FAQ:"https://walletconnect.com/faq"}},xn={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot"},CHAIN_NAME_MAP:{eip155:"Ethereum",solana:"Solana",polkadot:"Polkadot"}},nn={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_CONNECTOR:"@appkit/connected_connector",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit/connected_social_username",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE"},sn={setItem(t,e){hy()&&localStorage.setItem(t,e)},getItem(t){if(hy())return localStorage.getItem(t)||void 0},removeItem(t){hy()&&localStorage.removeItem(t)},clear(){hy()&&localStorage.clear()}};function hy(){return typeof window<"u"&&typeof localStorage<"u"}function wu(t,e){return e==="light"?{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}function vX(t){return(t==null?void 0:t.endsWith(xn.WC_NAME_SUFFIX_LEGACY))||(t==null?void 0:t.endsWith(xn.WC_NAME_SUFFIX))}const yX="rpc.walletconnect.org",Tw={extendRpcUrlWithProjectId(t,e){if(t.includes(yX)){const n=new URL(t);return n.searchParams.has("projectId")||n.searchParams.set("projectId",e),n.toString()}return t},extendCaipNetwork(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return{...t,imageId:e[t.chainId],imageUrl:r==null?void 0:r[t.chainId],rpcUrl:Tw.extendRpcUrlWithProjectId(t.rpcUrl,n)}},extendCaipNetworks(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return t.map(i=>Tw.extendCaipNetwork(i,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}))}},Bx="https://secure.walletconnect.org",pL=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],bX="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",Tn={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:Bx,SECURE_SITE_DASHBOARD:`${Bx}/dashboard`,SECURE_SITE_FAVICON:`${Bx}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,DEFAULT_FEATURES:{swaps:!0,onramp:!0,email:!0,emailShowWallets:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],history:!0,analytics:!0,allWallets:!0}},Ue={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const t=window.navigator.userAgent.toLowerCase();return Ue.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return Ue.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Tn.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Tn.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Tn.FOUR_MINUTES_MS},getNetworkId(t){return t==null?void 0:t.split(":")[1]},getPlainAddress(t){return t==null?void 0:t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e){if(Ue.isHttpUrl(t))return this.formatUniversalUrl(t,e);let r=t;r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},formatUniversalUrl(t,e){if(!Ue.isHttpUrl(t))return this.formatNativeUrl(t,e);let r=t;r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},openHref(t,e,r){window.open(t,e,r||"noreferrer noopener")},returnOpenHref(t,e,r){return window.open(t,e,r||"noreferrer noopener")},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,Ue.wait(2e3)])},formatBalance(t,e){let r="0.000";if(typeof t=="string"){const n=Number(t);if(n){const i=Math.floor(n*1e3)/1e3;i&&(r=i.toString())}}return`${r}${e?` ${e}`:""}`},formatBalance2(t,e){var n;let r;if(t==="0")r="0";else if(typeof t=="string"){const i=Number(t);i&&(r=(n=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:n[0])}return{value:r??"0",rest:r==="0"?"000":"",symbol:e}},getApiUrl(){return xn.W3M_API_URL},getBlockchainApiUrl(){return xn.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return xn.PULSE_API_URL},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})},parseError(t){var e,r;return typeof t=="string"?t:typeof((r=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:r.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const r={};return e&&t&&(t.forEach((n,i)=>{r[n]=i}),e.sort((n,i)=>{const s=r[n.id],o=r[i.id];return s!==void 0&&o!==void 0?s-o:s!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const r of t)e+=r.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[r,n]=e.split(".");return{dollars:r,pennies:n}},isAddress(t,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);default:return!1}},uniqueBy(t,e){const r=new Set;return t.filter(n=>{const i=n[e];return r.has(i)?!1:(r.add(i),!0)})},generateSdkVersion(t,e,r){const i=t.length===0?"universal":t.map(s=>s.adapterType).join(",");return`${e}-${i}-${r}`}};async function am(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class P6{constructor({baseUrl:e,clientId:r}){this.baseUrl=e,this.clientId=r}async get({headers:e,signal:r,cache:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await am(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"POST",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async put({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"PUT",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async delete({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await am(s,{method:"DELETE",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}createUrl({path:e,params:r}){const n=new URL(e,this.baseUrl);return r&&Object.entries(r).forEach(([i,s])=>{s&&n.searchParams.append(i,s)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}}const dn=Rn({features:Tn.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),qe={state:dn,subscribeKey(t,e){return Ts(dn,t,e)},setOptions(t){Object.assign(dn,t)},setFeatures(t){t&&Object.entries(t).forEach(([e,r])=>{dn.features||(dn.features=Tn.DEFAULT_FEATURES),e in dn.features&&(dn.features[e]=r)})},setProjectId(t){dn.projectId=t},setAllWallets(t){dn.allWallets=t},setIncludeWalletIds(t){dn.includeWalletIds=t},setExcludeWalletIds(t){dn.excludeWalletIds=t},setFeaturedWalletIds(t){dn.featuredWalletIds=t},setTokens(t){dn.tokens=t},setTermsConditionsUrl(t){dn.termsConditionsUrl=t},setPrivacyPolicyUrl(t){dn.privacyPolicyUrl=t},setCustomWallets(t){dn.customWallets=t},setIsSiweEnabled(t){dn.isSiweEnabled=t},setIsUniversalProvider(t){dn.isUniversalProvider=t},setSdkVersion(t){dn.sdkVersion=t},setMetadata(t){dn.metadata=t},setDisableAppend(t){dn.disableAppend=t},setEIP6963Enabled(t){dn.enableEIP6963=t},setEnableWalletConnect(t){dn.enableWalletConnect=t},setEnableWallets(t){dn.enableWallets=t},setHasMultipleAddresses(t){dn.hasMultipleAddresses=t}},xX=Ue.getAnalyticsUrl(),CX=new P6({baseUrl:xX,clientId:null}),_X=["MODAL_CREATED"],ap=Rn({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),ot={state:ap,subscribe(t){return bs(ap,()=>t(ap))},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=qe.state;return{"x-project-id":t,"x-sdk-type":e,"x-sdk-version":r||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(t){try{if(_X.includes(t.data.event)||typeof window>"u")return;await CX.post({path:"/e",headers:ot._getApiHeaders(),body:{eventId:Ue.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){var e;ap.timestamp=Date.now(),ap.data=t,(e=qe.state.features)!=null&&e.analytics&&ot._sendAnalyticsEvent(ap)}},Jk=Rn({supportsAllNetworks:!0,smartAccountEnabledNetworks:[]}),Zt={state:Jk,replaceState(t){t&&Object.assign(Jk,sc(t))},subscribeKey(t,e){let r;return ge.subscribeChainProp("networkState",n=>{if(n){const i=n[t];r!==i&&(r=i,e(i))}})},_getClient(){return ge.getNetworkControllerClient()},setActiveCaipNetwork(t){if(!t)return;ge.setActiveCaipNetwork(t),this.checkIfSupportedNetwork()||this.showUnsupportedChainUI()},setCaipNetwork(t){if(t){if(!(t!=null&&t.chainNamespace))throw new Error("chain is required to set active network");ge.setCaipNetwork(t==null?void 0:t.chainNamespace,t)}},setRequestedCaipNetworks(t,e){ge.setChainNetworkData(e,{requestedCaipNetworks:t})},setAllowUnsupportedChain(t,e){ge.setChainNetworkData(e||ge.state.activeChain,{allowUnsupportedCaipNetwork:t})},setSmartAccountEnabledNetworks(t,e){ge.setChainNetworkData(e,{smartAccountEnabledNetworks:t})},getRequestedCaipNetworks(t){let e;if(!ge.state.activeChain)throw new Error("activeChain is required to get requested networks");if(t){const s=t;if(!s)throw new Error("chain is required to get requested networks");e=[s]}else e=[...ge.state.chains.keys()];const r=[],n=[];return e.forEach(s=>{var o,a,c,l,d,f,g,v;(a=(o=ge.state.chains.get(s))==null?void 0:o.networkState)!=null&&a.approvedCaipNetworkIds&&r.push(...((l=(c=ge.state.chains.get(s))==null?void 0:c.networkState)==null?void 0:l.approvedCaipNetworkIds)||[]),(f=(d=ge.state.chains.get(s))==null?void 0:d.networkState)!=null&&f.requestedCaipNetworks&&n.push(...((v=(g=ge.state.chains.get(s))==null?void 0:g.networkState)==null?void 0:v.requestedCaipNetworks)||[])}),Ue.sortRequestedNetworks(r,n)},async switchActiveNetwork(t){const e=ge.getNetworkControllerClient(t==null?void 0:t.chainNamespace);e&&await e.switchCaipNetwork(t),ge.setActiveCaipNetwork(t),t&&ot.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.id}})},getApprovedCaipNetworkIds(t){var r,n;if(t){const i=t;if(!i)throw new Error("chain is required to get approved network IDs");return(n=(r=ge.state.chains.get(i))==null?void 0:r.networkState)==null?void 0:n.approvedCaipNetworkIds}const e=[];return Object.values(ge.state.chains).forEach(i=>{var s;i.networkState.approvedCaipNetworkIds&&e.push(...((s=i.networkState)==null?void 0:s.approvedCaipNetworkIds)||[])}),e},async setApprovedCaipNetworksData(t){const e=ge.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());if(!t)throw new Error("chain is required to set approved network data");ge.setChainNetworkData(t,{approvedCaipNetworkIds:r==null?void 0:r.approvedCaipNetworkIds,supportsAllNetworks:r==null?void 0:r.supportsAllNetworks})},checkIfSupportedNetwork(){const t=ge.state.activeChain;if(!t)return!1;const e=ge.state.activeCaipNetwork,r=this.getRequestedCaipNetworks(t);return r.length?r==null?void 0:r.some(n=>n.id===(e==null?void 0:e.id)):!0},checkIfSmartAccountEnabled(){var n;const t=Ya.caipNetworkIdToNumber((n=ge.state.activeCaipNetwork)==null?void 0:n.id);if(!ge.state.activeChain)throw new Error("activeChain is required to check if smart account is enabled");if(!t)return!1;const r=ge.getNetworkProp("smartAccountEnabledNetworks");return!!(r!=null&&r.includes(Number(t)))},resetNetwork(){const t=ge.state.activeChain;if(!t)throw new Error("chain is required to reset network");ge.setChainNetworkData(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},getSupportsAllNetworks(){var e,r;const t=ge.state.activeChain;if(!t)throw new Error("chain is required to check if network supports all networks");return(r=(e=ge.state.chains.get(t))==null?void 0:e.networkState)==null?void 0:r.supportsAllNetworks},showUnsupportedChainUI(){setTimeout(()=>{jt.open({view:"UnsupportedChain"})},300)},getActiveNetworkTokenAddress(){var e,r;const t=Tn.NATIVE_TOKEN_ADDRESS[((e=ge.state.activeCaipNetwork)==null?void 0:e.chainNamespace)||"eip155"];return`${((r=ge.state.activeCaipNetwork)==null?void 0:r.id)||"eip155:1"}:${t}`}},AX={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},gL=Ue.getBlockchainApiUrl(),Zn=Rn({clientId:null,api:new P6({baseUrl:gL,clientId:null})}),bn={state:Zn,fetchIdentity({address:t}){return Zn.api.get({path:`/v1/identity/${t}`,params:{projectId:qe.state.projectId,sender:ge.state.activeCaipAddress?Ue.getPlainAddress(ge.state.activeCaipAddress):void 0}})},fetchTransactions({account:t,projectId:e,cursor:r,onramp:n,signal:i,cache:s,chainId:o}){return Zn.api.get({path:`/v1/account/${t}/history`,params:{projectId:e,cursor:r,onramp:n,chainId:o},signal:i,cache:s})},fetchSwapQuote({projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}){return Zn.api.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:s}})},fetchSwapTokens({projectId:t,chainId:e}){return Zn.api.get({path:"/v1/convert/tokens",params:{projectId:t,chainId:e}})},fetchTokenPrice({projectId:t,addresses:e}){return Zn.api.post({path:"/v1/fungible/price",body:{projectId:t,currency:"usd",addresses:e},headers:{"Content-Type":"application/json"}})},fetchSwapAllowance({projectId:t,tokenAddress:e,userAddress:r}){const{sdkType:n,sdkVersion:i}=qe.state;return Zn.api.get({path:"/v1/convert/allowance",params:{projectId:t,tokenAddress:e,userAddress:r},headers:{"Content-Type":"application/json","x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"}})},fetchGasPrice({projectId:t,chainId:e}){const{sdkType:r,sdkVersion:n}=qe.state;return Zn.api.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":r,"x-sdk-version":n||"html-wagmi-4.2.2"},params:{projectId:t,chainId:e}})},generateSwapCalldata({amount:t,from:e,projectId:r,to:n,userAddress:i}){return Zn.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Tn.CONVERT_SLIPPAGE_TOLERANCE},from:e,projectId:r,to:n,userAddress:i}})},generateApproveCalldata({from:t,projectId:e,to:r,userAddress:n}){const{sdkType:i,sdkVersion:s}=qe.state;return Zn.api.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":i,"x-sdk-version":s||"html-wagmi-4.2.2"},params:{projectId:e,userAddress:n,from:t,to:r}})},async getBalance(t,e,r){const{sdkType:n,sdkVersion:i}=qe.state;return Zn.api.get({path:`/v1/account/${t}/balance`,headers:{"x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"},params:{currency:"usd",projectId:qe.state.projectId,chainId:e,forceUpdate:r}})},async lookupEnsName(t){return Zn.api.get({path:`/v1/profile/account/${t}`,params:{projectId:qe.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:t}){return Zn.api.get({path:`/v1/profile/reverse/${t}`,params:{sender:Se.state.address,projectId:qe.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(t){return Zn.api.get({path:`/v1/profile/suggestions/${t}`,params:{projectId:qe.state.projectId}})},async registerEnsName({coinType:t,address:e,message:r,signature:n}){return Zn.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:n},headers:{"Content-Type":"application/json"}})},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:n,paymentAmount:i}){return(await Zn.api.post({path:"/v1/generators/onrampurl",params:{projectId:qe.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url},async getOnrampOptions(){try{return await Zn.api.get({path:"/v1/onramp/options",params:{projectId:qe.state.projectId}})}catch{return AX}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){try{return await Zn.api.post({path:"/v1/onramp/quote",params:{projectId:qe.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}})}catch{return{coinbaseFee:{amount:r,currency:e.id},networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},setClientId(t){Zn.clientId=t,Zn.api=new P6({baseUrl:gL,clientId:t})}},Zo=Rn({message:"",variant:"success",open:!1}),St={state:Zo,subscribeKey(t,e){return Ts(Zo,t,e)},showLoading(t){Zo.message=t,Zo.variant="loading",Zo.open=!0},showSuccess(t){Zo.message=t,Zo.variant="success",Zo.open=!0},showError(t){const e=Ue.parseError(t);Zo.message=e,Zo.variant="error",Zo.open=!0},hide(){Zo.open=!1}};var mL={},N6={};N6.byteLength=IX;N6.toByteArray=kX;N6.fromByteArray=NX;var il=[],oa=[],EX=typeof Uint8Array<"u"?Uint8Array:Array,Ux="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var cp=0,SX=Ux.length;cp0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function IX(t){var e=wL(t),r=e[0],n=e[1];return(r+n)*3/4-n}function TX(t,e,r){return(e+r)*3/4-r}function kX(t){var e,r=wL(t),n=r[0],i=r[1],s=new EX(TX(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=oa[t.charCodeAt(c)]<<2|oa[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=oa[t.charCodeAt(c)]<<10|oa[t.charCodeAt(c+1)]<<4|oa[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function RX(t){return il[t>>18&63]+il[t>>12&63]+il[t>>6&63]+il[t&63]}function PX(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(il[e>>2]+il[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(il[e>>10]+il[e>>4&63]+il[e<<2&63]+"=")),i.join("")}var qA={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */qA.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,d=-7,f=r?i-1:0,g=r?-1:1,v=t[e+f];for(f+=g,s=v&(1<<-d)-1,v>>=-d,d+=a;d>0;s=s*256+t[e+f],f+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+f],f+=g,d-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(v?-1:1)*o*Math.pow(2,s-n)};qA.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,d=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,x=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=g/c:e+=g*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*c-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+v]=a&255,v+=x,a/=256,i-=8);for(o=o<0;t[r+v]=o&255,v+=x,o/=256,l-=8);t[r+v-x]|=P*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh @@ -6000,7 +6000,7 @@ __p += '`),Rr&&(Le+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Le+`return __p -}`;var hr=OT(function(){return Lr(re,It+"return "+Le).apply(r,de)});if(hr.source=Le,Q8(hr))throw hr;return hr}function $Z(u){return jr(u).toLowerCase()}function OZ(u){return jr(u).toUpperCase()}function DZ(u,h,A){if(u=jr(u),u&&(A||h===r))return HS(u);if(!u||!(h=lo(h)))return u;var F=Da(u),Z=Da(h),re=qS(F,Z),de=VS(F,Z)+1;return cd(F,re,de).join("")}function LZ(u,h,A){if(u=jr(u),u&&(A||h===r))return u.slice(0,GS(u)+1);if(!u||!(h=lo(h)))return u;var F=Da(u),Z=VS(F,Da(h))+1;return cd(F,0,Z).join("")}function BZ(u,h,A){if(u=jr(u),u&&(A||h===r))return u.replace(Wt,"");if(!u||!(h=lo(h)))return u;var F=Da(u),Z=qS(F,Da(h));return cd(F,Z).join("")}function UZ(u,h){var A=K,F=U;if(Cn(h)){var Z="separator"in h?h.separator:Z;A="length"in h?fr(h.length):A,F="omission"in h?lo(h.omission):F}u=jr(u);var re=u.length;if(G0(u)){var de=Da(u);re=de.length}if(A>=re)return u;var pe=A-Z0(F);if(pe<1)return F;var xe=de?cd(de,0,pe).join(""):u.slice(0,pe);if(Z===r)return xe+F;if(de&&(pe+=xe.length-pe),Y8(Z)){if(u.slice(pe).search(Z)){var Me,$e=xe;for(Z.global||(Z=h8(Z.source,jr(ar.exec(Z))+"g")),Z.lastIndex=0;Me=Z.exec($e);)var Le=Me.index;xe=xe.slice(0,Le===r?pe:Le)}}else if(u.indexOf(lo(Z),pe)!=pe){var it=xe.lastIndexOf(Z);it>-1&&(xe=xe.slice(0,it))}return xe+F}function jZ(u){return u=jr(u),u&&ft.test(u)?u.replace(yr,gH):u}var FZ=rp(function(u,h,A){return u+(A?" ":"")+h.toUpperCase()}),ex=DI("toUpperCase");function $T(u,h,A){return u=jr(u),h=A?r:h,h===r?uH(u)?vH(u):tH(u):u.match(h)||[]}var OT=wr(function(u,h){try{return ai(u,r,h)}catch(A){return Q8(A)?A:new tr(A)}}),zZ=Kl(function(u,h){return Fo(h,function(A){A=Uc(A),ql(u,A,G8(u[A],u))}),u});function WZ(u){var h=u==null?0:u.length,A=Ht();return u=h?wn(u,function(F){if(typeof F[1]!="function")throw new zo(o);return[A(F[0]),F[1]]}):[],wr(function(F){for(var Z=-1;++ZS)return[];var A=b,F=ji(u,b);h=Ht(h),u-=b;for(var Z=u8(F,h);++A0||h<0)?new Ar(A):(u<0?A=A.takeRight(-u):u&&(A=A.drop(u)),h!==r&&(h=fr(h),A=h<0?A.dropRight(-h):A.take(h-u)),A)},Ar.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ar.prototype.toArray=function(){return this.take(b)},Lc(Ar.prototype,function(u,h){var A=/^(?:filter|find|map|reject)|While$/.test(h),F=/^(?:head|last)$/.test(h),Z=ee[F?"take"+(h=="last"?"Right":""):h],re=F||/^find/.test(h);Z&&(ee.prototype[h]=function(){var de=this.__wrapped__,pe=F?[1]:arguments,xe=de instanceof Ar,Me=pe[0],$e=xe||ir(de),Le=function(br){var Rr=Z.apply(ee,rd([br],pe));return F&&it?Rr[0]:Rr};$e&&A&&typeof Me=="function"&&Me.length!=1&&(xe=$e=!1);var it=this.__chain__,It=!!this.__actions__.length,Kt=re&&!it,hr=xe&&!It;if(!re&&$e){de=hr?de:new Ar(this);var Gt=u.apply(de,pe);return Gt.__actions__.push({func:B3,args:[Le],thisArg:r}),new Wo(Gt,it)}return Kt&&hr?u.apply(this,pe):(Gt=this.thru(Le),Kt?F?Gt.value()[0]:Gt.value():Gt)})}),Fo(["pop","push","shift","sort","splice","unshift"],function(u){var h=u3[u],A=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",F=/^(?:pop|shift)$/.test(u);ee.prototype[u]=function(){var Z=arguments;if(F&&!this.__chain__){var re=this.value();return h.apply(ir(re)?re:[],Z)}return this[A](function(de){return h.apply(ir(de)?de:[],Z)})}}),Lc(Ar.prototype,function(u,h){var A=ee[h];if(A){var F=A.name+"";Wr.call(X0,F)||(X0[F]=[]),X0[F].push({name:h,func:A})}}),X0[P3(r,N).name]=[{name:"wrapper",func:r}],Ar.prototype.clone=jH,Ar.prototype.reverse=FH,Ar.prototype.value=zH,ee.prototype.at=wK,ee.prototype.chain=vK,ee.prototype.commit=yK,ee.prototype.next=bK,ee.prototype.plant=CK,ee.prototype.reverse=_K,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=AK,ee.prototype.first=ee.prototype.head,Ug&&(ee.prototype[Ug]=xK),ee},Q0=yH();Bn?((Bn.exports=Q0)._=Q0,Qr._=Q0):kr._=Q0}).call(Am)})(KC,KC.exports);var n3e=Object.defineProperty,i3e=Object.defineProperties,s3e=Object.getOwnPropertyDescriptors,GN=Object.getOwnPropertySymbols,o3e=Object.prototype.hasOwnProperty,a3e=Object.prototype.propertyIsEnumerable,ZN=(t,e,r)=>e in t?n3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ty=(t,e)=>{for(var r in e||(e={}))o3e.call(e,r)&&ZN(t,r,e[r]);if(GN)for(var r of GN(e))a3e.call(e,r)&&ZN(t,r,e[r]);return t},c3e=(t,e)=>i3e(t,s3e(e));function yc(t,e,r){var n;const i=ew(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${r3e}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function L0(t){return t.includes(":")?t.split(":")[1]:t}function Qj(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function l3e(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function L9(t={},e={}){const r=QN(t),n=QN(e);return KC.exports.merge(r,n)}function QN(t){var e,r,n,i;const s={};if(!pv(t))return s;for(const[o,a]of Object.entries(t)){const c=FE(o)?[o]:a.chains,l=a.methods||[],d=a.events||[],f=a.rpcMap||{},g=Dm(o);s[g]=c3e(Ty(Ty({},s[g]),a),{chains:cb(c,(e=s[g])==null?void 0:e.chains),methods:cb(l,(r=s[g])==null?void 0:r.methods),events:cb(d,(n=s[g])==null?void 0:n.events),rpcMap:Ty(Ty({},f),(i=s[g])==null?void 0:i.rpcMap)})}return s}function u3e(t){return t.includes(":")?t.split(":")[2]:t}function YN(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=FE(r)?[r]:n.chains?n.chains:Qj(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function B9(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Yj={},zr=t=>Yj[t],U9=(t,e)=>{Yj[t]=e};class d3e{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}var f3e=Object.defineProperty,h3e=Object.defineProperties,p3e=Object.getOwnPropertyDescriptors,JN=Object.getOwnPropertySymbols,g3e=Object.prototype.hasOwnProperty,m3e=Object.prototype.propertyIsEnumerable,XN=(t,e,r)=>e in t?f3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eM=(t,e)=>{for(var r in e||(e={}))g3e.call(e,r)&&XN(t,r,e[r]);if(JN)for(var r of JN(e))m3e.call(e,r)&&XN(t,r,e[r]);return t},tM=(t,e)=>h3e(t,p3e(e));class w3e{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||yc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(L0(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:tM(eM({},o.sessionProperties||{}),{capabilities:tM(eM({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}}class v3e{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class y3e{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class b3e{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||yc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Tc(new Bl(n,zr("disableProviderPing")))}}class x3e{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=L0(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class C3e{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class _3e{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class A3e{constructor(e){this.name="near",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yc(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace);return typeof n>"u"?void 0:new Tc(new Bl(n,zr("disableProviderPing")))}}class E3e{constructor(e){this.name=wp,this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=ew(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}var S3e=Object.defineProperty,I3e=Object.defineProperties,T3e=Object.getOwnPropertyDescriptors,rM=Object.getOwnPropertySymbols,k3e=Object.prototype.hasOwnProperty,R3e=Object.prototype.propertyIsEnumerable,nM=(t,e,r)=>e in t?S3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ky=(t,e)=>{for(var r in e||(e={}))k3e.call(e,r)&&nM(t,r,e[r]);if(rM)for(var r of rM(e))R3e.call(e,r)&&nM(t,r,e[r]);return t},j9=(t,e)=>I3e(t,T3e(e));class KE{constructor(e){this.events=new yE,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:t2(n2({level:(e==null?void 0:e.logger)||VN})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new KE(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:ky({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,y4(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Vr("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=YN(this.session.namespaces);this.namespaces=L9(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=YN(s.namespaces);this.namespaces=L9(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Gj)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===wp?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(e0(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await H2e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||VN,relayUrl:this.providerOpts.relayUrl||X2e,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Dm(r)))];U9("client",this.client),U9("events",this.events),U9("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=l3e(r,this.session),i=Qj(n),s=L9(this.namespaces,this.optionalNamespaces),o=j9(ky({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new w3e({namespace:o});break;case"algorand":this.rpcProviders[r]=new b3e({namespace:o});break;case"solana":this.rpcProviders[r]=new v3e({namespace:o});break;case"cosmos":this.rpcProviders[r]=new y3e({namespace:o});break;case"polkadot":this.rpcProviders[r]=new d3e({namespace:o});break;case"cip34":this.rpcProviders[r]=new x3e({namespace:o});break;case"elrond":this.rpcProviders[r]=new C3e({namespace:o});break;case"multiversx":this.rpcProviders[r]=new _3e({namespace:o});break;case"near":this.rpcProviders[r]=new A3e({namespace:o});break;default:this.rpcProviders[wp]?this.rpcProviders[wp].updateNamespace(o):this.rpcProviders[wp]=new E3e({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&e0(i)&&this.events.emit("accountsChanged",i.map(u3e))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Dm(i),a=B9(i)!==B9(s)?`${o}:${B9(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=j9(ky({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",j9(ky({},Vr("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[wp]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>Dm(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Dm(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${KN}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${KN}/${e}`)}}const Jj={getMethodsByChainNamespace(t){switch(t){case"solana":return["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts"];case"eip155":return["personal_sign","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendRawTransaction","eth_sendTransaction","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus","wallet_getCallsStatus","wallet_switchEthereumChain"];default:return[]}},createNamespaces(t){return t.reduce((e,r)=>{const{chainId:n,chainNamespace:i,rpcUrl:s}=r,o=this.getMethodsByChainNamespace(i);e[i]||(e[i]={methods:o,events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}});const a=`${i}:${n}`,c=e[i];return c.chains.push(a),c!=null&&c.rpcMap&&(c.rpcMap[n]=s),e},{})}},ta=Rn({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),z1={state:ta,subscribeKey(t,e){return Ts(ta,t,e)},subscribeProviders(t){return bs(ta.providers,()=>t(ta.providers))},setProvider(t,e){e&&(ta.providers[t]=sc(e))},getProvider(t){return ta.providers[t]},setProviderId(t,e){e&&(ta.providerIds[t]=e)},getProviderId(t){return ta.providerIds[t]},reset(){ta.providers={eip155:void 0,solana:void 0,polkadot:void 0},ta.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(t){ta.providers[t]=void 0,ta.providerIds[t]=void 0}},P3e=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class N3e{constructor(e){this.appKit=void 0,this.isUniversalAdapterClient=!0,this.defaultNetwork=void 0,this.options=void 0,this.adapterType="universal";const{siweConfig:r,metadata:n}=e;this.caipNetworks=e.networks,this.chainNamespace="eip155",this.metadata=n,this.defaultNetwork=e.defaultNetwork||e.networks[0],this.networkControllerClient={switchCaipNetwork:i=>{if(i)try{this.switchNetwork(i)}catch{throw new Error("networkControllerClient:switchCaipNetwork - unable to switch chain")}},getApprovedCaipNetworksData:async()=>(await this.getWalletConnectProvider(),new Promise(i=>{var c,l;const s=(l=(c=this.walletConnectProvider)==null?void 0:c.session)==null?void 0:l.namespaces,o=[];s&&Object.keys(s).forEach(d=>{var g;const f=(g=s==null?void 0:s[d])==null?void 0:g.chains;f&&o.push(...f)}),i({supportsAllNetworks:!0,approvedCaipNetworkIds:o})}))},this.connectionControllerClient={connectWalletConnect:async i=>{var o,a,c,l,d,f,g,v,x,P,M;const s=await this.getWalletConnectProvider();if(!s)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(s.on("display_uri",N=>{i(N)}),ge.state.activeChain&&((c=(a=(o=ge.state)==null?void 0:o.chains)==null?void 0:a.get(ge.state.activeChain))==null?void 0:c.adapterType)==="wagmi"){const N=ge.state.chains.get(ge.state.activeChain);await((d=(l=N==null?void 0:N.connectionControllerClient)==null?void 0:l.connectWalletConnect)==null?void 0:d.call(l,i)),this.setWalletConnectProvider()}else{const N=await((f=r==null?void 0:r.getMessageParams)==null?void 0:f.call(r)),E=(g=r==null?void 0:r.options)==null?void 0:g.enabled,$=typeof(s==null?void 0:s.authenticate)=="function",L=N&&Object.keys(N||{}).length>0;if(r&&E&&N&&$&&L){const{SIWEController:j,getDidChainId:H,getDidAddress:I}=await Qs(async()=>{const{SIWEController:U,getDidChainId:C,getDidAddress:p}=await import("./index-hDIYmWL4.js");return{SIWEController:U,getDidChainId:C,getDidAddress:p}},[]),T=(v=this.caipNetworks)==null?void 0:v.filter(U=>U.chainNamespace==="eip155").map(U=>U.id);N.chains=(x=this.caipNetworks)==null?void 0:x.filter(U=>U.chainNamespace==="eip155").map(U=>U.chainId);const B=await s.authenticate({nonce:await((P=r==null?void 0:r.getNonce)==null?void 0:P.call(r)),methods:[...P3e],...N,chains:T}),K=(M=B==null?void 0:B.auths)==null?void 0:M[0];if(K){const{p:U,s:C}=K,p=H(U.iss),m=I(U.iss);m&&p&&j.setSession({address:m,chainId:parseInt(p,10)});try{const w=s.client.formatAuthMessage({request:U,iss:U.iss});await j.verifyMessage({message:w,signature:C.s,cacao:K})}catch(w){throw console.error("Error verifying message",w),await s.disconnect().catch(console.error),await j.signOut().catch(console.error),w}}}else{const j=Jj.createNamespaces(this.caipNetworks);await s.connect({optionalNamespaces:j})}this.setWalletConnectProvider()}},disconnect:async()=>{var i,s,o,a;if(sn.removeItem(nn.WALLET_ID),(i=r==null?void 0:r.options)!=null&&i.signOutOnDisconnect){const{SIWEController:c}=await Qs(async()=>{const{SIWEController:l}=await import("./index-hDIYmWL4.js");return{SIWEController:l}},[]);await c.signOut()}await((s=this.walletConnectProvider)==null?void 0:s.disconnect()),(o=this.appKit)==null||o.resetAccount("eip155"),(a=this.appKit)==null||a.resetAccount("solana")},signMessage:async i=>{const s=await this.getWalletConnectProvider(),o=ge.state.activeCaipAddress,a=Ue.getPlainAddress(o);if(!s)throw new Error("connectionControllerClient:signMessage - provider is undefined");return await s.request({method:"personal_sign",params:[i,a]})},estimateGas:async()=>await Promise.resolve(BigInt(0)),getEnsAvatar:async i=>await Promise.resolve(i),getEnsAddress:async i=>await Promise.resolve(i),writeContract:async()=>await Promise.resolve("0x"),sendTransaction:async()=>await Promise.resolve("0x"),parseUnits:()=>BigInt(0),formatUnits:()=>""}}construct(e,r){if(!r.projectId)throw new Error("Solana:construct - projectId is undefined");this.appKit=e,this.options=r,this.createProvider(),this.syncRequestedNetworks(this.caipNetworks),this.syncConnectors()}switchNetwork(e){e&&this.walletConnectProvider&&this.walletConnectProvider.setDefaultChain(e.id)}async disconnect(){var e,r;this.walletConnectProvider&&(await this.walletConnectProvider.disconnect(),(e=this.appKit)==null||e.resetAccount("eip155"),(r=this.appKit)==null||r.resetAccount("solana"))}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{await this.createProvider()}catch{throw new Error("EthereumAdapter:getWalletConnectProvider - Cannot create provider")}return this.walletConnectProvider}createProvider(){var e,r;return!this.walletConnectProviderInitPromise&&typeof window<"u"&&((e=this.options)!=null&&e.projectId)&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider((r=this.options)==null?void 0:r.projectId)),this.walletConnectProviderInitPromise}async initWalletConnectProvider(e){const r={projectId:e,metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]}};this.walletConnectProvider=await KE.init(r),await this.checkActiveWalletConnectProvider()}syncRequestedNetworks(e){[...new Set(e.map(n=>n.chainNamespace))].filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(s=>s.chainNamespace===n),n)})}async checkActiveWalletConnectProvider(){const e=await this.getWalletConnectProvider(),r=sn.getItem(nn.WALLET_ID);e&&r===cr.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var r,n,i;sn.setItem(nn.WALLET_ID,cr.WALLET_CONNECT_CONNECTOR_ID);const e=(n=(r=this.walletConnectProvider)==null?void 0:r.session)==null?void 0:n.namespaces;if(e){Object.keys(e).reverse().forEach(a=>{var l,d;const c=(l=e==null?void 0:e[a])==null?void 0:l.accounts[0];z1.setProvider(a,this.walletConnectProvider),z1.setProviderId(a,"walletConnect"),c&&((d=this.appKit)==null||d.setCaipAddress(c,a))});const s=vr.getStoredActiveCaipNetwork(),o=ge.state.activeCaipNetwork;try{s?Zt.setActiveCaipNetwork(s):o?(i=Zt.state.approvedCaipNetworkIds)!=null&&i.includes(o.id)||this.setDefaultNetwork(e):this.setDefaultNetwork(e)}catch(a){console.warn(">>> Error setting active caip network",a)}}this.syncAccount(),this.watchWalletConnect()}setDefaultNetwork(e){var n,i;const r=(n=this.caipNetworks[0])==null?void 0:n.chainNamespace;if(r){const s=e==null?void 0:e[r];if(s!=null&&s.chains){const o=s.chains[0];if(o){const a=(i=Zt.state)==null?void 0:i.requestedCaipNetworks;if(a){const c=a.find(l=>l.id===o);c&&Zt.setActiveCaipNetwork(c)}}}}}async watchWalletConnect(){var o;const e=await this.getWalletConnectProvider(),r=((o=e==null?void 0:e.session)==null?void 0:o.namespaces)||{};function n(){Object.keys(r).forEach(a=>{Se.resetAccount(a)}),Lt.resetWcConnection(),sn.removeItem(nn.WALLET_ID),e==null||e.removeListener("disconnect",n),e==null||e.removeListener("accountsChanged",i)}const i=a=>{a.length>0&&this.syncAccount()},s=a=>{var d,f,g;const c=this.caipNetworks.find(v=>v.chainId==a),l=(d=this.appKit)==null?void 0:d.getCaipNetwork();if(!c){Zt.setActiveCaipNetwork({chainId:Number(a),id:`eip155:${a}`,name:"Unknown Network",currency:"",explorerUrl:"",rpcUrl:"",chainNamespace:((f=this.appKit)==null?void 0:f.getActiveChainNamespace())||"eip155"});return}(!l||(l==null?void 0:l.id)!==(c==null?void 0:c.id))&&((g=this.appKit)==null||g.setCaipNetwork(c))};e&&(e.on("disconnect",n),e.on("accountsChanged",i),e.on("chainChanged",s))}getProviderData(){var i,s,o,a;const e=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{},r=((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1,n=((a=this.appKit)==null?void 0:a.getPreferredAccountType())||"";return{provider:this.walletConnectProvider,namespaces:e,namespaceKeys:e?Object.keys(e):[],isConnected:r,preferredAccountType:n}}syncAccount(){var s,o,a,c;const{namespaceKeys:e,namespaces:r}=this.getProviderData(),n=(s=this.appKit)==null?void 0:s.getPreferredAccountType();((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1?e.forEach(async l=>{var v,x,P,M,N;const d=l,f=(v=r==null?void 0:r[l])==null?void 0:v.accounts[0];((x=this.appKit)==null?void 0:x.getCaipAddress(d))||((P=this.appKit)==null||P.setPreferredAccountType(n,d),(M=this.appKit)==null||M.setCaipAddress(f,d),this.syncConnectedWalletInfo(),await Promise.all([(N=this.appKit)==null?void 0:N.setApprovedCaipNetworksData(d)])),this.syncAccounts()}):((a=this.appKit)==null||a.resetWcConnection(),(c=this.appKit)==null||c.resetNetwork(),this.syncAccounts(!0))}syncAccounts(e=!1){const{namespaces:r}=this.getProviderData();Object.keys(r).forEach(i=>{var o,a,c,l;const s=(a=(o=r==null?void 0:r[i])==null?void 0:o.accounts)==null?void 0:a.map(d=>{const[,,f]=d.split(":");return f}).filter((d,f,g)=>g.indexOf(d)===f);e&&((c=this.appKit)==null||c.setAllAccounts([],i)),s&&((l=this.appKit)==null||l.setAllAccounts(s.map(d=>({address:d,type:"eoa"})),i))})}syncConnectedWalletInfo(){var i,s;const e=sn.getItem(nn.WALLET_ID),r=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{};Object.keys(r).forEach(o=>{var a,c,l,d,f;(a=this.walletConnectProvider)!=null&&a.session?(l=this.appKit)==null||l.setConnectedWalletInfo({...this.walletConnectProvider.session.peer.metadata,name:this.walletConnectProvider.session.peer.metadata.name,icon:(c=this.walletConnectProvider.session.peer.metadata.icons)==null?void 0:c[0]},o):e&&((d=this.appKit)==null||d.setConnectedWalletInfo({name:e},"eip155"),(f=this.appKit)==null||f.setConnectedWalletInfo({name:e},"solana"))})}syncConnectors(){var r;const e=[];e.push({id:cr.WALLET_CONNECT_CONNECTOR_ID,explorerId:ha.ConnectorExplorerIds[cr.WALLET_CONNECT_CONNECTOR_ID],imageId:ha.ConnectorImageIds[cr.WALLET_CONNECT_CONNECTOR_ID],name:ha.ConnectorNamesMap[cr.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(r=this.appKit)==null||r.setConnectors(e)}}let iM=!1;class M3e{constructor(e){var r;this.initPromise=void 0,this.setStatus=(n,i)=>{Se.setStatus(n,i)},this.getIsConnectedState=()=>!!ge.state.activeCaipAddress,this.setAllAccounts=(n,i)=>{Se.setAllAccounts(n,i),qe.setHasMultipleAddresses((n==null?void 0:n.length)>1)},this.addAddressLabel=(n,i,s)=>{Se.addAddressLabel(n,i,s)},this.removeAddressLabel=(n,i)=>{Se.removeAddressLabel(n,i)},this.getCaipAddress=n=>ge.state.activeChain===n||!n?ge.state.activeCaipAddress:ge.getAccountProp("caipAddress",n),this.getAddress=n=>ge.state.activeChain===n||!n?Se.state.address:ge.getAccountProp("address",n),this.getProvider=()=>Se.state.provider,this.getPreferredAccountType=()=>Se.state.preferredAccountType,this.setCaipAddress=(n,i)=>{Se.setCaipAddress(n,i)},this.setProvider=(n,i)=>{Se.setProvider(n,i)},this.setBalance=(n,i,s)=>{Se.setBalance(n,i,s)},this.setProfileName=(n,i)=>{Se.setProfileName(n,i)},this.setProfileImage=(n,i)=>{Se.setProfileImage(n,i)},this.resetAccount=n=>{Se.resetAccount(n)},this.setCaipNetwork=n=>{ge.setActiveCaipNetwork(n)},this.getCaipNetwork=n=>{var i;return n?(i=Zt.getRequestedCaipNetworks().filter(s=>s.chainNamespace===n))==null?void 0:i[0]:ge.state.activeCaipNetwork},this.getCaipNetworks=()=>Zt.getRequestedCaipNetworks(),this.getActiveChainNamespace=()=>ge.state.activeChain,this.setRequestedCaipNetworks=(n,i)=>{Zt.setRequestedCaipNetworks(n,i)},this.getApprovedCaipNetworkIds=()=>Zt.getApprovedCaipNetworkIds(),this.setApprovedCaipNetworksData=n=>Zt.setApprovedCaipNetworksData(n),this.resetNetwork=()=>{Zt.resetNetwork()},this.setConnectors=n=>{const i=[...ut.getConnectors(),...n];ut.setConnectors(i)},this.addConnector=n=>{ut.addConnector(n)},this.getConnectors=()=>ut.getConnectors(),this.resetWcConnection=()=>{Lt.resetWcConnection()},this.fetchIdentity=n=>bn.fetchIdentity(n),this.setAddressExplorerUrl=(n,i)=>{Se.setAddressExplorerUrl(n,i)},this.setSmartAccountDeployed=(n,i)=>{Se.setSmartAccountDeployed(n,i)},this.setConnectedWalletInfo=(n,i)=>{Se.setConnectedWalletInfo(n,i)},this.setSmartAccountEnabledNetworks=(n,i)=>{Zt.setSmartAccountEnabledNetworks(n,i)},this.setPreferredAccountType=(n,i)=>{Se.setPreferredAccountType(n,i)},this.getReownName=n=>Kc.getNamesForAddress(n),this.resolveReownName=async n=>{var o;const i=await Kc.resolveName(n);return((o=(Object.values(i==null?void 0:i.addresses)||[])[0])==null?void 0:o.address)||!1},this.setEIP6963Enabled=n=>{qe.setEIP6963Enabled(n)},this.setClientId=n=>{bn.setClientId(n)},this.getConnectorImage=n=>Sr.getConnectorImage(n),this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.adapter=(r=e.adapters)==null?void 0:r[0],this.initControllers(e),this.initOrContinue()}static getInstance(){return this.instance}async open(e){await this.initOrContinue(),jt.open(e)}async close(){await this.initOrContinue(),jt.close()}setLoading(e){jt.setLoading(e)}getError(){return""}getChainId(){var e;return(e=ge.state.activeCaipNetwork)==null?void 0:e.chainId}switchNetwork(e){return Zt.switchActiveNetwork(e)}getWalletProvider(){return ge.state.activeChain?z1.state.providers[ge.state.activeChain]:null}getWalletProviderType(){return ge.state.activeChain?z1.state.providerIds[ge.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return vn.state.themeMode}getThemeVariables(){return vn.state.themeVariables}setThemeMode(e){vn.setThemeMode(e),BL(vn.state.themeMode)}setThemeVariables(e){vn.setThemeVariables(e),Qre(vn.state.themeVariables)}subscribeTheme(e){return vn.subscribe(e)}getWalletInfo(){return Se.state.connectedWalletInfo}subscribeWalletInfo(e){return Se.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){Se.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){Zt.subscribeKey("caipNetwork",e)}getState(){return vu.state}subscribeState(e){return vu.subscribe(e)}showErrorMessage(e){St.showError(e)}showSuccessMessage(e){St.showSuccess(e)}getEvent(){return{...ot.state}}subscribeEvents(e){return ot.subscribe(e)}replace(e){Ae.replace(e)}redirect(e){Ae.push(e)}popTransactionStack(e){Ae.popTransactionStack(e)}isOpen(){return jt.state.open}isTransactionStackEmpty(){return Ae.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=Ae.state.transactionStack[Ae.state.transactionStack.length-1])==null?void 0:e.replace}async initControllers(e){var n;if(qe.setProjectId(e.projectId),qe.setSdkVersion(e.sdkVersion),this.adapters=e.adapters,this.setMetadata(e),this.extendCaipNetworks(e),this.initializeUniversalAdapter(e),this.initializeAdapters(e),this.setDefaultNetwork(e),qe.setAllWallets(e.allWallets),qe.setIncludeWalletIds(e.includeWalletIds),qe.setExcludeWalletIds(e.excludeWalletIds),e.excludeWalletIds&&Tt.searchWalletByIds({ids:e.excludeWalletIds}),qe.setFeaturedWalletIds(e.featuredWalletIds),qe.setTokens(e.tokens),qe.setTermsConditionsUrl(e.termsConditionsUrl),qe.setPrivacyPolicyUrl(e.privacyPolicyUrl),qe.setCustomWallets(e.customWallets),qe.setFeatures(e.features),qe.setEnableWalletConnect(e.enableWalletConnect!==!1),qe.setEnableWallets(e.enableWallets!==!1),e.metadata&&qe.setMetadata(e.metadata),e.themeMode&&vn.setThemeMode(e.themeMode),e.themeVariables&&vn.setThemeVariables(e.themeVariables),e.disableAppend&&qe.setDisableAppend(!!e.disableAppend),((n=e.adapters)==null?void 0:n.find(i=>i.chainNamespace===xn.CHAIN.EVM))&&e.siweConfig){const{SIWEController:i}=await Qs(async()=>{const{SIWEController:s}=await import("./index-hDIYmWL4.js");return{SIWEController:s}},[]);i.setSIWEClient(e.siweConfig)}}setMetadata(e){var r,n,i;typeof window>"u"||typeof document>"u"||(e.metadata={name:((r=document.getElementsByTagName("title")[0])==null?void 0:r.textContent)||"",description:((n=document.querySelector('meta[property="og:description"]'))==null?void 0:n.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]})}extendCaipNetworks(e){e.networks=Tw.extendCaipNetworks(e.networks,{networkImageIds:ha.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}),e.defaultNetwork=e.networks.find(r=>{var n;return r.id===((n=e.defaultNetwork)==null?void 0:n.id)})}initializeUniversalAdapter(e){var r,n;this.universalAdapter=new N3e(e),ge.initializeUniversalAdapter(this.universalAdapter,e.adapters||[]),(n=(r=this.universalAdapter).construct)==null||n.call(r,this,e)}initializeAdapters(e){var r;ge.initialize(e.adapters||[]),(r=e.adapters)==null||r.forEach(n=>{var i;(i=n.construct)==null||i.call(n,this,e)})}setDefaultNetwork(e){const r=e.defaultNetwork?Tw.extendCaipNetwork(e.defaultNetwork,{networkImageIds:ha.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0,n=sn.getItem(nn.ACTIVE_CAIP_NETWORK_ID),s=(n?e.networks.find(o=>o.id===n):void 0)??r??e.networks[0];ge.setActiveCaipNetwork(s)}async initOrContinue(){return!this.initPromise&&!iM&&Ue.isClient()&&(iM=!0,this.initPromise=new Promise(async e=>{await Promise.all([Qs(()=>import("./index-C1_8NCHf.js"),[]),Qs(()=>import("./w3m-modal-fwmTGh44.js"),[])]);const r=document.createElement("w3m-modal");qe.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}}const $3e="@reown/appkit",O3e="1.0.4",D3e="module",L3e="./dist/esm/exports/index.js",B3e="./dist/types/exports/index.d.ts",U3e=["dist","!tsconfig.tsbuildinfo"],j3e={"build:clean":"rm -rf dist",build:"tsc --build tsconfig.build.json",watch:"tsc --watch",typecheck:"tsc --noEmit",lint:"eslint . --ext .js,.jsx,.ts,.tsx",test:"vitest run --coverage.enabled=true --coverage.reporter=json --coverage.reporter=json-summary --coverage.reportOnFailure=true"},F3e={".":{types:"./dist/types/exports/index.d.ts",import:"./dist/esm/exports/index.js",default:"./dist/esm/exports/index.js"},"./react":{types:"./dist/types/exports/react.d.ts",import:"./dist/esm/exports/react.js",default:"./dist/esm/exports/react.js"},"./vue":{types:"./dist/types/exports/vue.d.ts",import:"./dist/esm/exports/vue.js",default:"./dist/esm/exports/vue.js"},"./library/react":{types:"./dist/types/exports/library/react.d.ts",import:"./dist/esm/exports/library/react.js",default:"./dist/esm/exports/library/react.js"},"./library/vue":{types:"./dist/types/exports/library/vue.d.ts",import:"./dist/esm/exports/library/vue.js",default:"./dist/esm/exports/library/vue.js"},"./store":{types:"./dist/types/exports/store.d.ts",import:"./dist/esm/exports/store.js",default:"./dist/esm/exports/store.js"},"./utils":{types:"./dist/types/exports/utils.d.ts",import:"./dist/esm/exports/utils.js",default:"./dist/esm/exports/utils.js"},"./networks":{types:"./dist/types/exports/networks.d.ts",import:"./dist/esm/exports/networks.js",default:"./dist/esm/exports/networks.js"},"./auth-provider":{types:"./dist/types/exports/auth-provider.d.ts",import:"./dist/esm/exports/auth-provider.js",default:"./dist/esm/exports/auth-provider.js"}},z3e={"*":{react:["./dist/types/exports/react.d.ts"],vue:["./dist/types/exports/vue.d.ts"],"library/react":["./dist/types/exports/library/react.d.ts"],"library/vue":["./dist/types/exports/library/vue.d.ts"],store:["./dist/types/exports/store.d.ts"],networks:["./dist/types/exports/networks.d.ts"],"auth-provider":["./dist/types/exports/auth-provider.d.ts"]}},W3e={"@walletconnect/universal-provider":"2.16.1","@reown/appkit-common":"workspace:*","@reown/appkit-core":"workspace:*","@reown/appkit-polyfills":"workspace:*","@reown/appkit-scaffold-ui":"workspace:*","@reown/appkit-utils":"workspace:*","@reown/appkit-siwe":"workspace:*","@reown/appkit-ui":"workspace:*","@reown/appkit-wallet":"workspace:*","@walletconnect/types":"2.16.1","@walletconnect/utils":"2.16.1",valtio:"1.11.2"},H3e={borsh:"0.7.0",bs58:"5.0.0"},q3e={"@types/react":"18.2.0","@types/react-dom":"18.2.0","@vitest/coverage-v8":"2.0.5","@vue/runtime-core":"3.4.3","@wagmi/connectors":"5.1.9","@wagmi/core":"2.13.4","@wallet-standard/app":"1.0.1","@wallet-standard/base":"1.0.1","@wallet-standard/features":"1.0.3","@wallet-standard/wallet":"1.0.1","@walletconnect/types":"2.13.3","@walletconnect/universal-provider":"2.16.1",ethers:"6.13.2",ethers5:"npm:ethers@5.7.2",react:"18.2.0","react-dom":"18.2.0",viem:"2.21.4",vitest:"2.0.5",vue:"3.4.3",wagmi:"2.12.9"},V3e="Reown (https://reown.com)",K3e="Apache-2.0",G3e="https://github.com/WalletConnect/web3modal",Z3e={type:"git",url:"git+https://github.com/WalletConnect/web3modal.git"},Q3e={url:"https://github.com/WalletConnect/web3modal/issues"},Y3e={name:$3e,version:O3e,type:D3e,main:L3e,types:B3e,files:U3e,scripts:j3e,exports:F3e,typesVersions:z3e,dependencies:W3e,optionalDependencies:H3e,devDependencies:q3e,author:V3e,license:K3e,homepage:G3e,repository:Z3e,bugs:Q3e};var Oo=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ro=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=ge.state.activeCaipAddress,this.balanceVal=Se.state.balance,this.balanceSymbol=Se.state.balanceSymbol,this.profileName=Se.state.profileName,this.profileImage=Se.state.profileImage,this.network=ge.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(Sn.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),ge.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),Se.subscribeKey("balance",e=>this.balanceVal=e),Se.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Se.subscribeKey("profileName",e=>this.profileName=e),Se.subscribeKey("profileImage",e=>this.profileImage=e),ge.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Sr.getNetworkImage(e):void 0}),Zt.subscribeKey("isUnsupportedChain",e=>{this.isUnsupportedChain=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.balance==="show";return q` +}`;var hr=OT(function(){return Lr(re,It+"return "+Le).apply(r,de)});if(hr.source=Le,Q8(hr))throw hr;return hr}function $Z(u){return jr(u).toLowerCase()}function OZ(u){return jr(u).toUpperCase()}function DZ(u,h,A){if(u=jr(u),u&&(A||h===r))return HS(u);if(!u||!(h=lo(h)))return u;var F=Da(u),Z=Da(h),re=qS(F,Z),de=VS(F,Z)+1;return cd(F,re,de).join("")}function LZ(u,h,A){if(u=jr(u),u&&(A||h===r))return u.slice(0,GS(u)+1);if(!u||!(h=lo(h)))return u;var F=Da(u),Z=VS(F,Da(h))+1;return cd(F,0,Z).join("")}function BZ(u,h,A){if(u=jr(u),u&&(A||h===r))return u.replace(Wt,"");if(!u||!(h=lo(h)))return u;var F=Da(u),Z=qS(F,Da(h));return cd(F,Z).join("")}function UZ(u,h){var A=K,F=U;if(Cn(h)){var Z="separator"in h?h.separator:Z;A="length"in h?fr(h.length):A,F="omission"in h?lo(h.omission):F}u=jr(u);var re=u.length;if(G0(u)){var de=Da(u);re=de.length}if(A>=re)return u;var pe=A-Z0(F);if(pe<1)return F;var xe=de?cd(de,0,pe).join(""):u.slice(0,pe);if(Z===r)return xe+F;if(de&&(pe+=xe.length-pe),Y8(Z)){if(u.slice(pe).search(Z)){var Me,$e=xe;for(Z.global||(Z=h8(Z.source,jr(ar.exec(Z))+"g")),Z.lastIndex=0;Me=Z.exec($e);)var Le=Me.index;xe=xe.slice(0,Le===r?pe:Le)}}else if(u.indexOf(lo(Z),pe)!=pe){var it=xe.lastIndexOf(Z);it>-1&&(xe=xe.slice(0,it))}return xe+F}function jZ(u){return u=jr(u),u&&ft.test(u)?u.replace(yr,gH):u}var FZ=rp(function(u,h,A){return u+(A?" ":"")+h.toUpperCase()}),ex=DI("toUpperCase");function $T(u,h,A){return u=jr(u),h=A?r:h,h===r?uH(u)?vH(u):tH(u):u.match(h)||[]}var OT=wr(function(u,h){try{return ai(u,r,h)}catch(A){return Q8(A)?A:new tr(A)}}),zZ=Kl(function(u,h){return Fo(h,function(A){A=Uc(A),ql(u,A,G8(u[A],u))}),u});function WZ(u){var h=u==null?0:u.length,A=Ht();return u=h?wn(u,function(F){if(typeof F[1]!="function")throw new zo(o);return[A(F[0]),F[1]]}):[],wr(function(F){for(var Z=-1;++ZS)return[];var A=b,F=ji(u,b);h=Ht(h),u-=b;for(var Z=u8(F,h);++A0||h<0)?new Ar(A):(u<0?A=A.takeRight(-u):u&&(A=A.drop(u)),h!==r&&(h=fr(h),A=h<0?A.dropRight(-h):A.take(h-u)),A)},Ar.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ar.prototype.toArray=function(){return this.take(b)},Lc(Ar.prototype,function(u,h){var A=/^(?:filter|find|map|reject)|While$/.test(h),F=/^(?:head|last)$/.test(h),Z=ee[F?"take"+(h=="last"?"Right":""):h],re=F||/^find/.test(h);Z&&(ee.prototype[h]=function(){var de=this.__wrapped__,pe=F?[1]:arguments,xe=de instanceof Ar,Me=pe[0],$e=xe||ir(de),Le=function(br){var Rr=Z.apply(ee,rd([br],pe));return F&&it?Rr[0]:Rr};$e&&A&&typeof Me=="function"&&Me.length!=1&&(xe=$e=!1);var it=this.__chain__,It=!!this.__actions__.length,Kt=re&&!it,hr=xe&&!It;if(!re&&$e){de=hr?de:new Ar(this);var Gt=u.apply(de,pe);return Gt.__actions__.push({func:B3,args:[Le],thisArg:r}),new Wo(Gt,it)}return Kt&&hr?u.apply(this,pe):(Gt=this.thru(Le),Kt?F?Gt.value()[0]:Gt.value():Gt)})}),Fo(["pop","push","shift","sort","splice","unshift"],function(u){var h=u3[u],A=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",F=/^(?:pop|shift)$/.test(u);ee.prototype[u]=function(){var Z=arguments;if(F&&!this.__chain__){var re=this.value();return h.apply(ir(re)?re:[],Z)}return this[A](function(de){return h.apply(ir(de)?de:[],Z)})}}),Lc(Ar.prototype,function(u,h){var A=ee[h];if(A){var F=A.name+"";Wr.call(X0,F)||(X0[F]=[]),X0[F].push({name:h,func:A})}}),X0[P3(r,N).name]=[{name:"wrapper",func:r}],Ar.prototype.clone=jH,Ar.prototype.reverse=FH,Ar.prototype.value=zH,ee.prototype.at=wK,ee.prototype.chain=vK,ee.prototype.commit=yK,ee.prototype.next=bK,ee.prototype.plant=CK,ee.prototype.reverse=_K,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=AK,ee.prototype.first=ee.prototype.head,Ug&&(ee.prototype[Ug]=xK),ee},Q0=yH();Bn?((Bn.exports=Q0)._=Q0,Qr._=Q0):kr._=Q0}).call(Am)})(KC,KC.exports);var n3e=Object.defineProperty,i3e=Object.defineProperties,s3e=Object.getOwnPropertyDescriptors,GN=Object.getOwnPropertySymbols,o3e=Object.prototype.hasOwnProperty,a3e=Object.prototype.propertyIsEnumerable,ZN=(t,e,r)=>e in t?n3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ty=(t,e)=>{for(var r in e||(e={}))o3e.call(e,r)&&ZN(t,r,e[r]);if(GN)for(var r of GN(e))a3e.call(e,r)&&ZN(t,r,e[r]);return t},c3e=(t,e)=>i3e(t,s3e(e));function yc(t,e,r){var n;const i=ew(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${r3e}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function L0(t){return t.includes(":")?t.split(":")[1]:t}function Qj(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function l3e(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function L9(t={},e={}){const r=QN(t),n=QN(e);return KC.exports.merge(r,n)}function QN(t){var e,r,n,i;const s={};if(!pv(t))return s;for(const[o,a]of Object.entries(t)){const c=FE(o)?[o]:a.chains,l=a.methods||[],d=a.events||[],f=a.rpcMap||{},g=Dm(o);s[g]=c3e(Ty(Ty({},s[g]),a),{chains:cb(c,(e=s[g])==null?void 0:e.chains),methods:cb(l,(r=s[g])==null?void 0:r.methods),events:cb(d,(n=s[g])==null?void 0:n.events),rpcMap:Ty(Ty({},f),(i=s[g])==null?void 0:i.rpcMap)})}return s}function u3e(t){return t.includes(":")?t.split(":")[2]:t}function YN(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=FE(r)?[r]:n.chains?n.chains:Qj(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function B9(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Yj={},zr=t=>Yj[t],U9=(t,e)=>{Yj[t]=e};class d3e{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}var f3e=Object.defineProperty,h3e=Object.defineProperties,p3e=Object.getOwnPropertyDescriptors,JN=Object.getOwnPropertySymbols,g3e=Object.prototype.hasOwnProperty,m3e=Object.prototype.propertyIsEnumerable,XN=(t,e,r)=>e in t?f3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eM=(t,e)=>{for(var r in e||(e={}))g3e.call(e,r)&&XN(t,r,e[r]);if(JN)for(var r of JN(e))m3e.call(e,r)&&XN(t,r,e[r]);return t},tM=(t,e)=>h3e(t,p3e(e));class w3e{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||yc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(L0(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const c=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:tM(eM({},o.sessionProperties||{}),{capabilities:tM(eM({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}}class v3e{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class y3e{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class b3e{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||yc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Tc(new Bl(n,zr("disableProviderPing")))}}class x3e{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=L0(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class C3e{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class _3e{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=L0(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}class A3e{constructor(e){this.name="near",this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||yc(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace);return typeof n>"u"?void 0:new Tc(new Bl(n,zr("disableProviderPing")))}}class E3e{constructor(e){this.name=wp,this.namespace=e.namespace,this.events=zr("events"),this.client=zr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kc.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=ew(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||yc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tc(new Bl(n,zr("disableProviderPing")))}}var S3e=Object.defineProperty,I3e=Object.defineProperties,T3e=Object.getOwnPropertyDescriptors,rM=Object.getOwnPropertySymbols,k3e=Object.prototype.hasOwnProperty,R3e=Object.prototype.propertyIsEnumerable,nM=(t,e,r)=>e in t?S3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ky=(t,e)=>{for(var r in e||(e={}))k3e.call(e,r)&&nM(t,r,e[r]);if(rM)for(var r of rM(e))R3e.call(e,r)&&nM(t,r,e[r]);return t},j9=(t,e)=>I3e(t,T3e(e));class KE{constructor(e){this.events=new yE,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:t2(n2({level:(e==null?void 0:e.logger)||VN})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new KE(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:ky({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,y4(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Vr("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=YN(this.session.namespaces);this.namespaces=L9(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s;const o=YN(s.namespaces);this.namespaces=L9(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Gj)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===wp?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(e0(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await H2e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||VN,relayUrl:this.providerOpts.relayUrl||X2e,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Dm(r)))];U9("client",this.client),U9("events",this.events),U9("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=l3e(r,this.session),i=Qj(n),s=L9(this.namespaces,this.optionalNamespaces),o=j9(ky({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new w3e({namespace:o});break;case"algorand":this.rpcProviders[r]=new b3e({namespace:o});break;case"solana":this.rpcProviders[r]=new v3e({namespace:o});break;case"cosmos":this.rpcProviders[r]=new y3e({namespace:o});break;case"polkadot":this.rpcProviders[r]=new d3e({namespace:o});break;case"cip34":this.rpcProviders[r]=new x3e({namespace:o});break;case"elrond":this.rpcProviders[r]=new C3e({namespace:o});break;case"multiversx":this.rpcProviders[r]=new _3e({namespace:o});break;case"near":this.rpcProviders[r]=new A3e({namespace:o});break;default:this.rpcProviders[wp]?this.rpcProviders[wp].updateNamespace(o):this.rpcProviders[wp]=new E3e({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&e0(i)&&this.events.emit("accountsChanged",i.map(u3e))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Dm(i),a=B9(i)!==B9(s)?`${o}:${B9(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=j9(ky({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",j9(ky({},Vr("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[wp]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>Dm(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Dm(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${KN}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${KN}/${e}`)}}const Jj={getMethodsByChainNamespace(t){switch(t){case"solana":return["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts"];case"eip155":return["personal_sign","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendRawTransaction","eth_sendTransaction","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus","wallet_getCallsStatus","wallet_switchEthereumChain"];default:return[]}},createNamespaces(t){return t.reduce((e,r)=>{const{chainId:n,chainNamespace:i,rpcUrl:s}=r,o=this.getMethodsByChainNamespace(i);e[i]||(e[i]={methods:o,events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}});const a=`${i}:${n}`,c=e[i];return c.chains.push(a),c!=null&&c.rpcMap&&(c.rpcMap[n]=s),e},{})}},ta=Rn({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),z1={state:ta,subscribeKey(t,e){return Ts(ta,t,e)},subscribeProviders(t){return bs(ta.providers,()=>t(ta.providers))},setProvider(t,e){e&&(ta.providers[t]=sc(e))},getProvider(t){return ta.providers[t]},setProviderId(t,e){e&&(ta.providerIds[t]=e)},getProviderId(t){return ta.providerIds[t]},reset(){ta.providers={eip155:void 0,solana:void 0,polkadot:void 0},ta.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(t){ta.providers[t]=void 0,ta.providerIds[t]=void 0}},P3e=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class N3e{constructor(e){this.appKit=void 0,this.isUniversalAdapterClient=!0,this.defaultNetwork=void 0,this.options=void 0,this.adapterType="universal";const{siweConfig:r,metadata:n}=e;this.caipNetworks=e.networks,this.chainNamespace="eip155",this.metadata=n,this.defaultNetwork=e.defaultNetwork||e.networks[0],this.networkControllerClient={switchCaipNetwork:i=>{if(i)try{this.switchNetwork(i)}catch{throw new Error("networkControllerClient:switchCaipNetwork - unable to switch chain")}},getApprovedCaipNetworksData:async()=>(await this.getWalletConnectProvider(),new Promise(i=>{var c,l;const s=(l=(c=this.walletConnectProvider)==null?void 0:c.session)==null?void 0:l.namespaces,o=[];s&&Object.keys(s).forEach(d=>{var g;const f=(g=s==null?void 0:s[d])==null?void 0:g.chains;f&&o.push(...f)}),i({supportsAllNetworks:!0,approvedCaipNetworkIds:o})}))},this.connectionControllerClient={connectWalletConnect:async i=>{var o,a,c,l,d,f,g,v,x,P,M;const s=await this.getWalletConnectProvider();if(!s)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(s.on("display_uri",N=>{i(N)}),ge.state.activeChain&&((c=(a=(o=ge.state)==null?void 0:o.chains)==null?void 0:a.get(ge.state.activeChain))==null?void 0:c.adapterType)==="wagmi"){const N=ge.state.chains.get(ge.state.activeChain);await((d=(l=N==null?void 0:N.connectionControllerClient)==null?void 0:l.connectWalletConnect)==null?void 0:d.call(l,i)),this.setWalletConnectProvider()}else{const N=await((f=r==null?void 0:r.getMessageParams)==null?void 0:f.call(r)),E=(g=r==null?void 0:r.options)==null?void 0:g.enabled,$=typeof(s==null?void 0:s.authenticate)=="function",L=N&&Object.keys(N||{}).length>0;if(r&&E&&N&&$&&L){const{SIWEController:j,getDidChainId:H,getDidAddress:I}=await Qs(async()=>{const{SIWEController:U,getDidChainId:C,getDidAddress:p}=await import("./index-BpiWtdP0.js");return{SIWEController:U,getDidChainId:C,getDidAddress:p}},[]),T=(v=this.caipNetworks)==null?void 0:v.filter(U=>U.chainNamespace==="eip155").map(U=>U.id);N.chains=(x=this.caipNetworks)==null?void 0:x.filter(U=>U.chainNamespace==="eip155").map(U=>U.chainId);const B=await s.authenticate({nonce:await((P=r==null?void 0:r.getNonce)==null?void 0:P.call(r)),methods:[...P3e],...N,chains:T}),K=(M=B==null?void 0:B.auths)==null?void 0:M[0];if(K){const{p:U,s:C}=K,p=H(U.iss),m=I(U.iss);m&&p&&j.setSession({address:m,chainId:parseInt(p,10)});try{const w=s.client.formatAuthMessage({request:U,iss:U.iss});await j.verifyMessage({message:w,signature:C.s,cacao:K})}catch(w){throw console.error("Error verifying message",w),await s.disconnect().catch(console.error),await j.signOut().catch(console.error),w}}}else{const j=Jj.createNamespaces(this.caipNetworks);await s.connect({optionalNamespaces:j})}this.setWalletConnectProvider()}},disconnect:async()=>{var i,s,o,a;if(sn.removeItem(nn.WALLET_ID),(i=r==null?void 0:r.options)!=null&&i.signOutOnDisconnect){const{SIWEController:c}=await Qs(async()=>{const{SIWEController:l}=await import("./index-BpiWtdP0.js");return{SIWEController:l}},[]);await c.signOut()}await((s=this.walletConnectProvider)==null?void 0:s.disconnect()),(o=this.appKit)==null||o.resetAccount("eip155"),(a=this.appKit)==null||a.resetAccount("solana")},signMessage:async i=>{const s=await this.getWalletConnectProvider(),o=ge.state.activeCaipAddress,a=Ue.getPlainAddress(o);if(!s)throw new Error("connectionControllerClient:signMessage - provider is undefined");return await s.request({method:"personal_sign",params:[i,a]})},estimateGas:async()=>await Promise.resolve(BigInt(0)),getEnsAvatar:async i=>await Promise.resolve(i),getEnsAddress:async i=>await Promise.resolve(i),writeContract:async()=>await Promise.resolve("0x"),sendTransaction:async()=>await Promise.resolve("0x"),parseUnits:()=>BigInt(0),formatUnits:()=>""}}construct(e,r){if(!r.projectId)throw new Error("Solana:construct - projectId is undefined");this.appKit=e,this.options=r,this.createProvider(),this.syncRequestedNetworks(this.caipNetworks),this.syncConnectors()}switchNetwork(e){e&&this.walletConnectProvider&&this.walletConnectProvider.setDefaultChain(e.id)}async disconnect(){var e,r;this.walletConnectProvider&&(await this.walletConnectProvider.disconnect(),(e=this.appKit)==null||e.resetAccount("eip155"),(r=this.appKit)==null||r.resetAccount("solana"))}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{await this.createProvider()}catch{throw new Error("EthereumAdapter:getWalletConnectProvider - Cannot create provider")}return this.walletConnectProvider}createProvider(){var e,r;return!this.walletConnectProviderInitPromise&&typeof window<"u"&&((e=this.options)!=null&&e.projectId)&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider((r=this.options)==null?void 0:r.projectId)),this.walletConnectProviderInitPromise}async initWalletConnectProvider(e){const r={projectId:e,metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]}};this.walletConnectProvider=await KE.init(r),await this.checkActiveWalletConnectProvider()}syncRequestedNetworks(e){[...new Set(e.map(n=>n.chainNamespace))].filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(s=>s.chainNamespace===n),n)})}async checkActiveWalletConnectProvider(){const e=await this.getWalletConnectProvider(),r=sn.getItem(nn.WALLET_ID);e&&r===cr.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var r,n,i;sn.setItem(nn.WALLET_ID,cr.WALLET_CONNECT_CONNECTOR_ID);const e=(n=(r=this.walletConnectProvider)==null?void 0:r.session)==null?void 0:n.namespaces;if(e){Object.keys(e).reverse().forEach(a=>{var l,d;const c=(l=e==null?void 0:e[a])==null?void 0:l.accounts[0];z1.setProvider(a,this.walletConnectProvider),z1.setProviderId(a,"walletConnect"),c&&((d=this.appKit)==null||d.setCaipAddress(c,a))});const s=vr.getStoredActiveCaipNetwork(),o=ge.state.activeCaipNetwork;try{s?Zt.setActiveCaipNetwork(s):o?(i=Zt.state.approvedCaipNetworkIds)!=null&&i.includes(o.id)||this.setDefaultNetwork(e):this.setDefaultNetwork(e)}catch(a){console.warn(">>> Error setting active caip network",a)}}this.syncAccount(),this.watchWalletConnect()}setDefaultNetwork(e){var n,i;const r=(n=this.caipNetworks[0])==null?void 0:n.chainNamespace;if(r){const s=e==null?void 0:e[r];if(s!=null&&s.chains){const o=s.chains[0];if(o){const a=(i=Zt.state)==null?void 0:i.requestedCaipNetworks;if(a){const c=a.find(l=>l.id===o);c&&Zt.setActiveCaipNetwork(c)}}}}}async watchWalletConnect(){var o;const e=await this.getWalletConnectProvider(),r=((o=e==null?void 0:e.session)==null?void 0:o.namespaces)||{};function n(){Object.keys(r).forEach(a=>{Se.resetAccount(a)}),Lt.resetWcConnection(),sn.removeItem(nn.WALLET_ID),e==null||e.removeListener("disconnect",n),e==null||e.removeListener("accountsChanged",i)}const i=a=>{a.length>0&&this.syncAccount()},s=a=>{var d,f,g;const c=this.caipNetworks.find(v=>v.chainId==a),l=(d=this.appKit)==null?void 0:d.getCaipNetwork();if(!c){Zt.setActiveCaipNetwork({chainId:Number(a),id:`eip155:${a}`,name:"Unknown Network",currency:"",explorerUrl:"",rpcUrl:"",chainNamespace:((f=this.appKit)==null?void 0:f.getActiveChainNamespace())||"eip155"});return}(!l||(l==null?void 0:l.id)!==(c==null?void 0:c.id))&&((g=this.appKit)==null||g.setCaipNetwork(c))};e&&(e.on("disconnect",n),e.on("accountsChanged",i),e.on("chainChanged",s))}getProviderData(){var i,s,o,a;const e=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{},r=((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1,n=((a=this.appKit)==null?void 0:a.getPreferredAccountType())||"";return{provider:this.walletConnectProvider,namespaces:e,namespaceKeys:e?Object.keys(e):[],isConnected:r,preferredAccountType:n}}syncAccount(){var s,o,a,c;const{namespaceKeys:e,namespaces:r}=this.getProviderData(),n=(s=this.appKit)==null?void 0:s.getPreferredAccountType();((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1?e.forEach(async l=>{var v,x,P,M,N;const d=l,f=(v=r==null?void 0:r[l])==null?void 0:v.accounts[0];((x=this.appKit)==null?void 0:x.getCaipAddress(d))||((P=this.appKit)==null||P.setPreferredAccountType(n,d),(M=this.appKit)==null||M.setCaipAddress(f,d),this.syncConnectedWalletInfo(),await Promise.all([(N=this.appKit)==null?void 0:N.setApprovedCaipNetworksData(d)])),this.syncAccounts()}):((a=this.appKit)==null||a.resetWcConnection(),(c=this.appKit)==null||c.resetNetwork(),this.syncAccounts(!0))}syncAccounts(e=!1){const{namespaces:r}=this.getProviderData();Object.keys(r).forEach(i=>{var o,a,c,l;const s=(a=(o=r==null?void 0:r[i])==null?void 0:o.accounts)==null?void 0:a.map(d=>{const[,,f]=d.split(":");return f}).filter((d,f,g)=>g.indexOf(d)===f);e&&((c=this.appKit)==null||c.setAllAccounts([],i)),s&&((l=this.appKit)==null||l.setAllAccounts(s.map(d=>({address:d,type:"eoa"})),i))})}syncConnectedWalletInfo(){var i,s;const e=sn.getItem(nn.WALLET_ID),r=((s=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:s.namespaces)||{};Object.keys(r).forEach(o=>{var a,c,l,d,f;(a=this.walletConnectProvider)!=null&&a.session?(l=this.appKit)==null||l.setConnectedWalletInfo({...this.walletConnectProvider.session.peer.metadata,name:this.walletConnectProvider.session.peer.metadata.name,icon:(c=this.walletConnectProvider.session.peer.metadata.icons)==null?void 0:c[0]},o):e&&((d=this.appKit)==null||d.setConnectedWalletInfo({name:e},"eip155"),(f=this.appKit)==null||f.setConnectedWalletInfo({name:e},"solana"))})}syncConnectors(){var r;const e=[];e.push({id:cr.WALLET_CONNECT_CONNECTOR_ID,explorerId:ha.ConnectorExplorerIds[cr.WALLET_CONNECT_CONNECTOR_ID],imageId:ha.ConnectorImageIds[cr.WALLET_CONNECT_CONNECTOR_ID],name:ha.ConnectorNamesMap[cr.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(r=this.appKit)==null||r.setConnectors(e)}}let iM=!1;class M3e{constructor(e){var r;this.initPromise=void 0,this.setStatus=(n,i)=>{Se.setStatus(n,i)},this.getIsConnectedState=()=>!!ge.state.activeCaipAddress,this.setAllAccounts=(n,i)=>{Se.setAllAccounts(n,i),qe.setHasMultipleAddresses((n==null?void 0:n.length)>1)},this.addAddressLabel=(n,i,s)=>{Se.addAddressLabel(n,i,s)},this.removeAddressLabel=(n,i)=>{Se.removeAddressLabel(n,i)},this.getCaipAddress=n=>ge.state.activeChain===n||!n?ge.state.activeCaipAddress:ge.getAccountProp("caipAddress",n),this.getAddress=n=>ge.state.activeChain===n||!n?Se.state.address:ge.getAccountProp("address",n),this.getProvider=()=>Se.state.provider,this.getPreferredAccountType=()=>Se.state.preferredAccountType,this.setCaipAddress=(n,i)=>{Se.setCaipAddress(n,i)},this.setProvider=(n,i)=>{Se.setProvider(n,i)},this.setBalance=(n,i,s)=>{Se.setBalance(n,i,s)},this.setProfileName=(n,i)=>{Se.setProfileName(n,i)},this.setProfileImage=(n,i)=>{Se.setProfileImage(n,i)},this.resetAccount=n=>{Se.resetAccount(n)},this.setCaipNetwork=n=>{ge.setActiveCaipNetwork(n)},this.getCaipNetwork=n=>{var i;return n?(i=Zt.getRequestedCaipNetworks().filter(s=>s.chainNamespace===n))==null?void 0:i[0]:ge.state.activeCaipNetwork},this.getCaipNetworks=()=>Zt.getRequestedCaipNetworks(),this.getActiveChainNamespace=()=>ge.state.activeChain,this.setRequestedCaipNetworks=(n,i)=>{Zt.setRequestedCaipNetworks(n,i)},this.getApprovedCaipNetworkIds=()=>Zt.getApprovedCaipNetworkIds(),this.setApprovedCaipNetworksData=n=>Zt.setApprovedCaipNetworksData(n),this.resetNetwork=()=>{Zt.resetNetwork()},this.setConnectors=n=>{const i=[...ut.getConnectors(),...n];ut.setConnectors(i)},this.addConnector=n=>{ut.addConnector(n)},this.getConnectors=()=>ut.getConnectors(),this.resetWcConnection=()=>{Lt.resetWcConnection()},this.fetchIdentity=n=>bn.fetchIdentity(n),this.setAddressExplorerUrl=(n,i)=>{Se.setAddressExplorerUrl(n,i)},this.setSmartAccountDeployed=(n,i)=>{Se.setSmartAccountDeployed(n,i)},this.setConnectedWalletInfo=(n,i)=>{Se.setConnectedWalletInfo(n,i)},this.setSmartAccountEnabledNetworks=(n,i)=>{Zt.setSmartAccountEnabledNetworks(n,i)},this.setPreferredAccountType=(n,i)=>{Se.setPreferredAccountType(n,i)},this.getReownName=n=>Kc.getNamesForAddress(n),this.resolveReownName=async n=>{var o;const i=await Kc.resolveName(n);return((o=(Object.values(i==null?void 0:i.addresses)||[])[0])==null?void 0:o.address)||!1},this.setEIP6963Enabled=n=>{qe.setEIP6963Enabled(n)},this.setClientId=n=>{bn.setClientId(n)},this.getConnectorImage=n=>Sr.getConnectorImage(n),this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.adapter=(r=e.adapters)==null?void 0:r[0],this.initControllers(e),this.initOrContinue()}static getInstance(){return this.instance}async open(e){await this.initOrContinue(),jt.open(e)}async close(){await this.initOrContinue(),jt.close()}setLoading(e){jt.setLoading(e)}getError(){return""}getChainId(){var e;return(e=ge.state.activeCaipNetwork)==null?void 0:e.chainId}switchNetwork(e){return Zt.switchActiveNetwork(e)}getWalletProvider(){return ge.state.activeChain?z1.state.providers[ge.state.activeChain]:null}getWalletProviderType(){return ge.state.activeChain?z1.state.providerIds[ge.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return vn.state.themeMode}getThemeVariables(){return vn.state.themeVariables}setThemeMode(e){vn.setThemeMode(e),BL(vn.state.themeMode)}setThemeVariables(e){vn.setThemeVariables(e),Qre(vn.state.themeVariables)}subscribeTheme(e){return vn.subscribe(e)}getWalletInfo(){return Se.state.connectedWalletInfo}subscribeWalletInfo(e){return Se.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){Se.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){Zt.subscribeKey("caipNetwork",e)}getState(){return vu.state}subscribeState(e){return vu.subscribe(e)}showErrorMessage(e){St.showError(e)}showSuccessMessage(e){St.showSuccess(e)}getEvent(){return{...ot.state}}subscribeEvents(e){return ot.subscribe(e)}replace(e){Ae.replace(e)}redirect(e){Ae.push(e)}popTransactionStack(e){Ae.popTransactionStack(e)}isOpen(){return jt.state.open}isTransactionStackEmpty(){return Ae.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=Ae.state.transactionStack[Ae.state.transactionStack.length-1])==null?void 0:e.replace}async initControllers(e){var n;if(qe.setProjectId(e.projectId),qe.setSdkVersion(e.sdkVersion),this.adapters=e.adapters,this.setMetadata(e),this.extendCaipNetworks(e),this.initializeUniversalAdapter(e),this.initializeAdapters(e),this.setDefaultNetwork(e),qe.setAllWallets(e.allWallets),qe.setIncludeWalletIds(e.includeWalletIds),qe.setExcludeWalletIds(e.excludeWalletIds),e.excludeWalletIds&&Tt.searchWalletByIds({ids:e.excludeWalletIds}),qe.setFeaturedWalletIds(e.featuredWalletIds),qe.setTokens(e.tokens),qe.setTermsConditionsUrl(e.termsConditionsUrl),qe.setPrivacyPolicyUrl(e.privacyPolicyUrl),qe.setCustomWallets(e.customWallets),qe.setFeatures(e.features),qe.setEnableWalletConnect(e.enableWalletConnect!==!1),qe.setEnableWallets(e.enableWallets!==!1),e.metadata&&qe.setMetadata(e.metadata),e.themeMode&&vn.setThemeMode(e.themeMode),e.themeVariables&&vn.setThemeVariables(e.themeVariables),e.disableAppend&&qe.setDisableAppend(!!e.disableAppend),((n=e.adapters)==null?void 0:n.find(i=>i.chainNamespace===xn.CHAIN.EVM))&&e.siweConfig){const{SIWEController:i}=await Qs(async()=>{const{SIWEController:s}=await import("./index-BpiWtdP0.js");return{SIWEController:s}},[]);i.setSIWEClient(e.siweConfig)}}setMetadata(e){var r,n,i;typeof window>"u"||typeof document>"u"||(e.metadata={name:((r=document.getElementsByTagName("title")[0])==null?void 0:r.textContent)||"",description:((n=document.querySelector('meta[property="og:description"]'))==null?void 0:n.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]})}extendCaipNetworks(e){e.networks=Tw.extendCaipNetworks(e.networks,{networkImageIds:ha.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}),e.defaultNetwork=e.networks.find(r=>{var n;return r.id===((n=e.defaultNetwork)==null?void 0:n.id)})}initializeUniversalAdapter(e){var r,n;this.universalAdapter=new N3e(e),ge.initializeUniversalAdapter(this.universalAdapter,e.adapters||[]),(n=(r=this.universalAdapter).construct)==null||n.call(r,this,e)}initializeAdapters(e){var r;ge.initialize(e.adapters||[]),(r=e.adapters)==null||r.forEach(n=>{var i;(i=n.construct)==null||i.call(n,this,e)})}setDefaultNetwork(e){const r=e.defaultNetwork?Tw.extendCaipNetwork(e.defaultNetwork,{networkImageIds:ha.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0,n=sn.getItem(nn.ACTIVE_CAIP_NETWORK_ID),s=(n?e.networks.find(o=>o.id===n):void 0)??r??e.networks[0];ge.setActiveCaipNetwork(s)}async initOrContinue(){return!this.initPromise&&!iM&&Ue.isClient()&&(iM=!0,this.initPromise=new Promise(async e=>{await Promise.all([Qs(()=>import("./index-Bn7sbfQV.js"),[]),Qs(()=>import("./w3m-modal-DG2UkRHg.js"),[])]);const r=document.createElement("w3m-modal");qe.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}}const $3e="@reown/appkit",O3e="1.0.4",D3e="module",L3e="./dist/esm/exports/index.js",B3e="./dist/types/exports/index.d.ts",U3e=["dist","!tsconfig.tsbuildinfo"],j3e={"build:clean":"rm -rf dist",build:"tsc --build tsconfig.build.json",watch:"tsc --watch",typecheck:"tsc --noEmit",lint:"eslint . --ext .js,.jsx,.ts,.tsx",test:"vitest run --coverage.enabled=true --coverage.reporter=json --coverage.reporter=json-summary --coverage.reportOnFailure=true"},F3e={".":{types:"./dist/types/exports/index.d.ts",import:"./dist/esm/exports/index.js",default:"./dist/esm/exports/index.js"},"./react":{types:"./dist/types/exports/react.d.ts",import:"./dist/esm/exports/react.js",default:"./dist/esm/exports/react.js"},"./vue":{types:"./dist/types/exports/vue.d.ts",import:"./dist/esm/exports/vue.js",default:"./dist/esm/exports/vue.js"},"./library/react":{types:"./dist/types/exports/library/react.d.ts",import:"./dist/esm/exports/library/react.js",default:"./dist/esm/exports/library/react.js"},"./library/vue":{types:"./dist/types/exports/library/vue.d.ts",import:"./dist/esm/exports/library/vue.js",default:"./dist/esm/exports/library/vue.js"},"./store":{types:"./dist/types/exports/store.d.ts",import:"./dist/esm/exports/store.js",default:"./dist/esm/exports/store.js"},"./utils":{types:"./dist/types/exports/utils.d.ts",import:"./dist/esm/exports/utils.js",default:"./dist/esm/exports/utils.js"},"./networks":{types:"./dist/types/exports/networks.d.ts",import:"./dist/esm/exports/networks.js",default:"./dist/esm/exports/networks.js"},"./auth-provider":{types:"./dist/types/exports/auth-provider.d.ts",import:"./dist/esm/exports/auth-provider.js",default:"./dist/esm/exports/auth-provider.js"}},z3e={"*":{react:["./dist/types/exports/react.d.ts"],vue:["./dist/types/exports/vue.d.ts"],"library/react":["./dist/types/exports/library/react.d.ts"],"library/vue":["./dist/types/exports/library/vue.d.ts"],store:["./dist/types/exports/store.d.ts"],networks:["./dist/types/exports/networks.d.ts"],"auth-provider":["./dist/types/exports/auth-provider.d.ts"]}},W3e={"@walletconnect/universal-provider":"2.16.1","@reown/appkit-common":"workspace:*","@reown/appkit-core":"workspace:*","@reown/appkit-polyfills":"workspace:*","@reown/appkit-scaffold-ui":"workspace:*","@reown/appkit-utils":"workspace:*","@reown/appkit-siwe":"workspace:*","@reown/appkit-ui":"workspace:*","@reown/appkit-wallet":"workspace:*","@walletconnect/types":"2.16.1","@walletconnect/utils":"2.16.1",valtio:"1.11.2"},H3e={borsh:"0.7.0",bs58:"5.0.0"},q3e={"@types/react":"18.2.0","@types/react-dom":"18.2.0","@vitest/coverage-v8":"2.0.5","@vue/runtime-core":"3.4.3","@wagmi/connectors":"5.1.9","@wagmi/core":"2.13.4","@wallet-standard/app":"1.0.1","@wallet-standard/base":"1.0.1","@wallet-standard/features":"1.0.3","@wallet-standard/wallet":"1.0.1","@walletconnect/types":"2.13.3","@walletconnect/universal-provider":"2.16.1",ethers:"6.13.2",ethers5:"npm:ethers@5.7.2",react:"18.2.0","react-dom":"18.2.0",viem:"2.21.4",vitest:"2.0.5",vue:"3.4.3",wagmi:"2.12.9"},V3e="Reown (https://reown.com)",K3e="Apache-2.0",G3e="https://github.com/WalletConnect/web3modal",Z3e={type:"git",url:"git+https://github.com/WalletConnect/web3modal.git"},Q3e={url:"https://github.com/WalletConnect/web3modal/issues"},Y3e={name:$3e,version:O3e,type:D3e,main:L3e,types:B3e,files:U3e,scripts:j3e,exports:F3e,typesVersions:z3e,dependencies:W3e,optionalDependencies:H3e,devDependencies:q3e,author:V3e,license:K3e,homepage:G3e,repository:Z3e,bugs:Q3e};var Oo=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ro=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=ge.state.activeCaipAddress,this.balanceVal=Se.state.balance,this.balanceSymbol=Se.state.balanceSymbol,this.profileName=Se.state.profileName,this.profileImage=Se.state.profileImage,this.network=ge.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(Sn.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),ge.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),Se.subscribeKey("balance",e=>this.balanceVal=e),Se.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Se.subscribeKey("profileName",e=>this.profileName=e),Se.subscribeKey("profileImage",e=>this.profileImage=e),ge.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Sr.getNetworkImage(e):void 0}),Zt.subscribeKey("isUnsupportedChain",e=>{this.isUnsupportedChain=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.balance==="show";return q` ${this.dynamicButtonTemplate()} ${this.titleTemplate()} ${this.closeButtonTemplate()} - `}onWalletHelp(){ot.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),Ae.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Qs(async()=>{const{SIWEController:i}=await import("./index-hDIYmWL4.js");return{SIWEController:i}},[]),r=Ae.state.view==="ApproveTransaction";e.state.status!=="success"&&r?Ae.popTransactionStack(!0):jt.close()}else jt.close()}closeButtonTemplate(){const e=Ae.state.view==="ConnectingSiwe";return this.isSiweEnabled&&e?q`
`:q` + `}onWalletHelp(){ot.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),Ae.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Qs(async()=>{const{SIWEController:i}=await import("./index-BpiWtdP0.js");return{SIWEController:i}},[]),r=Ae.state.view==="ApproveTransaction";e.state.status!=="success"&&r?Ae.popTransactionStack(!0):jt.close()}else jt.close()}closeButtonTemplate(){const e=Ae.state.view==="ConnectingSiwe";return this.isSiweEnabled&&e?q`
`:q` e+r.replace("0x",""),"")}`}class Cv extends ze{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class nS extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}function J5(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function S5e(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function B4(t,...e){if(!S5e(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function wTe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");J5(t.outputLen),J5(t.blockLen)}function X5(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function RF(t,e){B4(t);const r=e.outputLen;if(t.length>NM&Ny)}:{h:Number(t>>NM&Ny)|0,l:Number(t&Ny)|0}}function T5e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,R5e=(t,e,r)=>e<>>32-r,P5e=(t,e,r)=>e<>>64-r,N5e=(t,e,r)=>t<>>64-r,W9=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const M5e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),H9=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Hc=(t,e)=>t<<32-e|t>>>e,MM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,$5e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function $M(t){for(let e=0;et().update(iS(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function yTe(t=32){if(W9&&typeof W9.getRandomValues=="function")return W9.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}const MF=[],$F=[],OF=[],D5e=BigInt(0),Em=BigInt(1),L5e=BigInt(2),B5e=BigInt(7),U5e=BigInt(256),j5e=BigInt(113);for(let t=0,e=Em,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],MF.push(2*(5*n+r)),$F.push((t+1)*(t+2)/2%64);let i=D5e;for(let s=0;s<7;s++)e=(e<>B5e)*j5e)%U5e,e&L5e&&(i^=Em<<(Em<r>32?P5e(t,e,r):k5e(t,e,r),DM=(t,e,r)=>r>32?N5e(t,e,r):R5e(t,e,r);function W5e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],d=r[c+1],f=OM(l,d,1)^r[a],g=DM(l,d,1)^r[a+1];for(let v=0;v<50;v+=10)t[o+v]^=f,t[o+v+1]^=g}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=$F[o],c=OM(i,s,a),l=DM(i,s,a),d=MF[o];i=t[d],s=t[d+1],t[d]=c,t[d+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=F5e[n],t[1]^=z5e[n]}r.fill(0)}class sS extends PF{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,J5(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=M5e(this.state)}keccak(){MM||$M(this.state32),W5e(this.state32,this.rounds),MM||$M(this.state32),this.posOut=0,this.pos=0}update(e){X5(this);const{blockLen:r,state:n}=this;e=iS(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return J5(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(RF(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new sS(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const H5e=(t,e,r)=>NF(()=>new sS(e,t,r)),q5e=H5e(1,136,256/8);function wf(t,e){const r=e||"hex",n=q5e(Hu(t,{strict:!1})?M4(t):t);return r==="bytes"?n:h0(n)}const q9=new nS(8192);function U4(t,e){if(q9.has(`${t}.${e}`))return q9.get(`${t}.${e}`);const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=wf(Ph(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return q9.set(`${t}.${e}`,s),s}function Vs(t,e){if(!vf(t,{strict:!1}))throw new Cv({address:t});return U4(t,e)}const V5e=/^0x[a-fA-F0-9]{40}$/,V9=new nS(8192);function vf(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(V9.has(n))return V9.get(n);const i=V5e.test(t)?t.toLowerCase()===t?!0:r?U4(t)===t:!0:!1;return V9.set(n,i),i}function e6(t,e,r,{strict:n}={}){return Hu(t,{strict:!1})?K5e(t,e,r,{strict:n}):BF(t,e,r,{strict:n})}function DF(t,e){if(typeof e=="number"&&e>0&&e>Ii(t)-1)throw new EF({offset:e,position:"start",size:Ii(t)})}function LF(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Ii(t)!==r-e)throw new EF({offset:r,position:"end",size:Ii(t)})}function BF(t,e,r,{strict:n}={}){DF(t,e);const i=t.slice(e,r);return n&&LF(i,e,r),i}function K5e(t,e,r,{strict:n}={}){DF(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&LF(i,e,r),i}function UF(t,e){if(t.length!==e.length)throw new v5e({expectedLength:t.length,givenLength:e.length});const r=G5e({params:t,values:e}),n=aS(r);return n.length===0?"0x":n}function G5e({params:t,values:e}){const r=[];for(let n=0;n0?g0([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:g0(s.map(({encoded:o})=>o))}}function Y5e(t,{param:e}){const[,r]=e.type.split("bytes"),n=Ii(t);if(!r){let i=t;return n%32!==0&&(i=Jd(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:g0([Jd(gr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new w5e({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:Jd(t,{dir:"right"})}}function J5e(t){if(typeof t!="boolean")throw new ze(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Jd(TF(t))}}function X5e(t,{signed:e}){return{dynamic:!1,encoded:gr(t,{size:32,signed:e})}}function e6e(t){const e=$4(t),r=Math.ceil(Ii(e)/32),n=[];for(let i=0;ii))}}function cS(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const K9="/docs/contract/encodeDeployData";function jF(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new p5e({docsPath:K9});if(!("inputs"in i))throw new PM({docsPath:K9});if(!i.inputs||i.inputs.length===0)throw new PM({docsPath:K9});const s=UF(i.inputs,r);return L4([n,s])}function $c(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class lS extends ze{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` -`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class G9 extends ze{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function r6e(t){const e=wf(`0x${t.substring(4)}`).substring(26);return U4(`0x${e}`)}async function n6e({hash:t,signature:e}){const r=Hu(t)?t:h0(t),{secp256k1:n}=await Qs(async()=>{const{secp256k1:o}=await import("./secp256k1-B_ijNduS.js").then(a=>a.a);return{secp256k1:o}},[]);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:d,v:f,yParity:g}=e,v=Number(g??f),x=LM(v);return new n.Signature(Q1(l),Q1(d)).addRecoveryBit(x)}const o=Hu(e)?e:h0(e),a=f0(`0x${o.slice(130)}`),c=LM(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function LM(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function i6e({hash:t,signature:e}){return r6e(await n6e({hash:t,signature:e}))}class BM extends ze{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class s6e extends ze{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class o6e extends ze{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const a6e={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new o6e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new s6e({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new BM({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new BM({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function uS(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(a6e);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function c6e(t,e="hex"){const r=FF(t),n=uS(new Uint8Array(r.length));return r.encode(n),e==="hex"?Ri(n.bytes):n.bytes}function FF(t){return Array.isArray(t)?l6e(t.map(e=>FF(e))):u6e(t)}function l6e(t){const e=t.reduce((i,s)=>i+s.length,0),r=zF(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:s}of t)s(i)}}}function u6e(t){const e=typeof t=="string"?Rl(t):t,r=zF(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function zF(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new ze("Length is too large.")}function d6e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,s=wf(L4(["0x05",c6e([gr(e),r,n?gr(n):"0x"])]));return i==="bytes"?Rl(s):s}async function WF(t){const{authorization:e,signature:r}=t;return i6e({hash:d6e(e),signature:r??e})}class g_ extends ze{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class f6e extends ze{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class h6e extends ze{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class G9 extends ze{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function r6e(t){const e=wf(`0x${t.substring(4)}`).substring(26);return U4(`0x${e}`)}async function n6e({hash:t,signature:e}){const r=Hu(t)?t:h0(t),{secp256k1:n}=await Qs(async()=>{const{secp256k1:o}=await import("./secp256k1-B-W0FJZ_.js").then(a=>a.a);return{secp256k1:o}},[]);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:d,v:f,yParity:g}=e,v=Number(g??f),x=LM(v);return new n.Signature(Q1(l),Q1(d)).addRecoveryBit(x)}const o=Hu(e)?e:h0(e),a=f0(`0x${o.slice(130)}`),c=LM(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function LM(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function i6e({hash:t,signature:e}){return r6e(await n6e({hash:t,signature:e}))}class BM extends ze{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class s6e extends ze{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class o6e extends ze{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const a6e={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new o6e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new s6e({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new BM({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new BM({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function uS(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(a6e);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function c6e(t,e="hex"){const r=FF(t),n=uS(new Uint8Array(r.length));return r.encode(n),e==="hex"?Ri(n.bytes):n.bytes}function FF(t){return Array.isArray(t)?l6e(t.map(e=>FF(e))):u6e(t)}function l6e(t){const e=t.reduce((i,s)=>i+s.length,0),r=zF(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:s}of t)s(i)}}}function u6e(t){const e=typeof t=="string"?Rl(t):t,r=zF(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function zF(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new ze("Length is too large.")}function d6e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,s=wf(L4(["0x05",c6e([gr(e),r,n?gr(n):"0x"])]));return i==="bytes"?Rl(s):s}async function WF(t){const{authorization:e,signature:r}=t;return i6e({hash:d6e(e),signature:r??e})}class g_ extends ze{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class f6e extends ze{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class h6e extends ze{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` `),{name:"ChainNotFoundError"})}}class HF extends ze{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}function p6e({chain:t,currentChainId:e}){if(!t)throw new h6e;if(e!==t.id)throw new f6e({chain:t,currentChainId:e})}const g6e={gwei:9,wei:18},m6e={ether:-9,wei:9},w6e={ether:-18,gwei:-9};function L2(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function Ys(t,e="wei"){return L2(t,m6e[e])}class Op extends ze{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(Op,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Op,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class t6 extends ze{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Ys(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(t6,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class m_ extends ze{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Ys(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(m_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class w_ extends ze{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(w_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class v_ extends ze{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` `),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(v_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class y_ extends ze{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(y_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class b_ extends ze{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` `),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(b_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class x_ extends ze{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(x_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class C_ extends ze{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(C_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class __ extends ze{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(__,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class r6 extends ze{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Ys(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Ys(n)} gwei`:""}).`].join(` @@ -11073,8 +11073,8 @@ ${this.value??""}{if(r.length!==66)throw new kM({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new kM({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function B6e(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,o={};if(s!==void 0&&(o.code=s),e!==void 0&&(o.balance=gr(e)),r!==void 0&&(o.nonce=gr(r)),n!==void 0&&(o.state=FM(n)),i!==void 0){if(o.state)throw new D6e;o.stateDiff=FM(i)}return o}function ez(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!vf(r,{strict:!1}))throw new Cv({address:r});if(e[r])throw new O6e({address:r});e[r]=B6e(n)}return e}async function tz(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?gr(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}async function wS(t,e){var i,s,o;const r=e.account??t.account,n=r?$c(r):void 0;try{let m=function(_){const{block:R,request:S,rpcStateOverride:k}=_;return t.request({method:"eth_estimateGas",params:k?[S,R??"latest",k]:R?[S,R]:[S]})};const{accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:d,blockNumber:f,blockTag:g,data:v,gas:x,gasPrice:P,maxFeePerBlobGas:M,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:$,value:L,stateOverride:j,...H}=await yS(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),T=(f?gr(f):void 0)||g,B=ez(j),K=await(async()=>{if(H.to)return H.to;if(c&&c.length>0)return await WF({authorization:c[0]}).catch(()=>{throw new ze("`to` is required. Could not infer from `authorizationList`")})})();F4(e);const U=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,p=(U||gS)({...pS(H,{format:U}),from:n==null?void 0:n.address,accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:d,data:v,gas:x,gasPrice:P,maxFeePerBlobGas:M,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:$,to:K,value:L});let w=BigInt(await m({block:T,request:p,rpcStateOverride:B}));if(c){const _=await tz(t,{address:p.from}),R=await Promise.all(c.map(async S=>{const{contractAddress:k}=S,y=await m({block:T,request:{authorizationList:void 0,data:v,from:n==null?void 0:n.address,to:k,value:gr(_)},rpcStateOverride:B}).catch(()=>100000n);return 2n*BigInt(y)}));w+=R.reduce((S,k)=>S+k,0n)}return w}catch(a){throw $6e(a,{...e,account:n,chain:t.chain})}}async function U6e(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?gr(n):r]},{dedupe:!!n});return f0(i)}function rz(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(s=>Rl(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>Ri(s))}function nz(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>Rl(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>Rl(o)):t.commitments,s=[];for(let o=0;oRi(o))}function j6e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}const F6e=(t,e,r)=>t&e^~t&r,z6e=(t,e,r)=>t&e^t&r^e&r;class W6e extends PF{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=H9(this.buffer)}update(e){X5(this);const{view:r,buffer:n,blockLen:i}=this;e=iS(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fd.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,P=Hc(v,17)^Hc(v,19)^v>>>10;gd[f]=P+gd[f-7]+x+gd[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:d}=this;for(let f=0;f<64;f++){const g=Hc(a,6)^Hc(a,11)^Hc(a,25),v=d+g+F6e(a,c,l)+H6e[f]+gd[f]|0,P=(Hc(n,2)^Hc(n,13)^Hc(n,22))+z6e(n,i,s)|0;d=l,l=c,c=a,a=o+v|0,o=s,s=i,i=n,n=v+P|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,d=d+this.H|0,this.set(n,i,s,o,a,c,l,d)}roundClean(){gd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const V6e=NF(()=>new q6e);function K6e(t,e){return V6e(Hu(t,{strict:!1})?M4(t):t)}function G6e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=K6e(e);return i.set([r],0),n==="bytes"?i:Ri(i)}function Z6e(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(G6e({commitment:s,to:n,version:r}));return i}const zM=6,iz=32,vS=4096,sz=iz*vS,WM=sz*zM-1-1*vS*zM;class Q6e extends ze{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class Y6e extends ze{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function J6e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Rl(t.data):t.data,n=Ii(r);if(!n)throw new Y6e;if(n>WM)throw new Q6e({maxSize:WM,size:n});const i=[];let s=!0,o=0;for(;s;){const a=uS(new Uint8Array(sz));let c=0;for(;ca.bytes):i.map(a=>Ri(a.bytes))}function X6e(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??J6e({data:e,to:n}),s=t.commitments??rz({blobs:i,kzg:r,to:n}),o=t.proofs??nz({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let c=0;c"u"&&f)if(c){const N=await M();g.nonce=await c.consume({address:f.address,chainId:N,client:t})}else g.nonce=await an(t,U6e,"getTransactionCount")({address:f.address,blockTag:"pending"});if((l.includes("fees")||l.includes("type"))&&typeof d>"u")try{g.type=e4e(g)}catch{const N=await x();g.type=typeof(N==null?void 0:N.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(l.includes("fees"))if(g.type!=="legacy"&&g.type!=="eip2930"){if(typeof g.maxFeePerGas>"u"||typeof g.maxPriorityFeePerGas>"u"){const N=await x(),{maxFeePerGas:E,maxPriorityFeePerGas:$}=await A_(t,{block:N,chain:i,request:g});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas<$)throw new R6e({maxPriorityFeePerGas:$});g.maxPriorityFeePerGas=$,g.maxFeePerGas=E}}else{if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")throw new mS;const N=await x(),{gasPrice:E}=await A_(t,{block:N,chain:i,request:g,type:"legacy"});g.gasPrice=E}return l.includes("gas")&&typeof s>"u"&&(g.gas=await an(t,wS,"estimateGas")({...g,account:f?{address:f.address,type:"json-rpc"}:void 0})),F4(g),delete g.parameters,g}async function t4e(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function az(t,e){var N,E,$,L;const{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:s,blobs:o,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:g,nonce:v,value:x,...P}=e;if(!r)throw new lS({docsPath:"/docs/actions/wallet/sendTransaction"});const M=$c(r);try{F4(e);const j=await(async()=>{if(e.to)return e.to;if(s&&s.length>0)return await WF({authorization:s[0]}).catch(()=>{throw new ze("`to` is required. Could not infer from `authorizationList`.")})})();if(M.type==="json-rpc"){let H;n!==null&&(H=await an(t,GF,"getChainId")({}),p6e({currentChainId:H,chain:n}));const I=($=(E=(N=t.chain)==null?void 0:N.formatters)==null?void 0:E.transactionRequest)==null?void 0:$.format,B=(I||gS)({...pS(P,{format:I}),accessList:i,authorizationList:s,blobs:o,chainId:H,data:a,from:M.address,gas:c,gasPrice:l,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:g,nonce:v,to:j,value:x});return await t.request({method:"eth_sendTransaction",params:[B]},{retryCount:0})}if(M.type==="local"){const H=await an(t,yS,"prepareTransactionRequest")({account:M,accessList:i,authorizationList:s,blobs:o,chain:n,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:g,nonce:v,nonceManager:M.nonceManager,parameters:[...oz,"sidecars"],value:x,...P,to:j}),I=(L=n==null?void 0:n.serializers)==null?void 0:L.transaction,T=await M.signTransaction(H,{serializer:I});return await an(t,t4e,"sendRawTransaction")({serializedTransaction:T})}throw M.type==="smart"?new G9({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new G9({docsPath:"/docs/actions/wallet/sendTransaction",type:M.type})}catch(j){throw j instanceof G9?j:E6e(j,{...e,account:M,chain:e.chain||void 0})}}const E_=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],cz=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],lz=[...cz,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],r4e=[...cz,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],HM=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],qM=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],CTe=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}];function n4e(t,e={}){typeof e.size<"u"&&Mc(t,{size:e.size});const r=Ri(t,e);return Q1(r,e)}function i4e(t,e={}){let r=t;if(typeof e.size<"u"&&(Mc(r,{size:e.size}),r=Pg(r)),r.length>1||r[0]>1)throw new s5e(r);return!!r[0]}function Au(t,e={}){typeof e.size<"u"&&Mc(t,{size:e.size});const r=Ri(t,e);return f0(r,e)}function s4e(t,e={}){let r=t;return typeof e.size<"u"&&(Mc(r,{size:e.size}),r=Pg(r,{dir:"right"})),new TextDecoder().decode(r)}function uz(t,e){const r=typeof e=="string"?Rl(e):e,n=uS(r);if(Ii(r)===0&&t.length>0)throw new D4;if(Ii(e)&&Ii(e)<32)throw new g5e({data:typeof e=="string"?e:Ri(e),params:t,size:Ii(e)});let i=0;const s=[];for(let o=0;o48?n4e(i,{signed:r}):Au(i,{signed:r}),32]}function d4e(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(Dv(e)){const o=Au(t.readBytes(S_)),a=r+o;for(let c=0;cwf(M4(t));function p4e(t){return h4e(t)}const g4e="1.0.5";let Ta=class I_ extends Error{constructor(e,r={}){var o;const n=r.cause instanceof I_?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,i=r.cause instanceof I_&&r.cause.docsPath||r.docsPath,s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${g4e}`].join(` `);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}};function Lf(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const dz=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,fz=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,hz=/^\(.+?\).*?$/,KM=/^tuple(?(\[(\d*)\])*)$/;function T_(t){let e=t.type;if(KM.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function w4e(t){return pz.test(t)}function v4e(t){return Lf(pz,t)}const gz=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function y4e(t){return gz.test(t)}function b4e(t){return Lf(gz,t)}const mz=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function x4e(t){return mz.test(t)}function C4e(t){return Lf(mz,t)}const wz=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function vz(t){return wz.test(t)}function _4e(t){return Lf(wz,t)}const yz=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function A4e(t){return yz.test(t)}function E4e(t){return Lf(yz,t)}const S4e=/^fallback\(\) external(?:\s(?payable{1}))?$/;function I4e(t){return S4e.test(t)}const T4e=/^receive\(\) external payable$/;function k4e(t){return T4e.test(t)}const R4e=new Set(["indexed"]),k_=new Set(["calldata","memory","storage"]);class P4e extends Ta{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class N4e extends Ta{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class M4e extends Ta{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class $4e extends Ta{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class O4e extends Ta{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class D4e extends Ta{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class L4e extends Ta{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Lm extends Ta{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class B4e extends Ta{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class U4e extends Ta{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class j4e extends Ta{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class F4e extends Ta{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function z4e(t,e){return e?`${e}:${t}`:t}const Z9=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function W4e(t,e={}){if(x4e(t)){const r=C4e(t);if(!r)throw new Lm({signature:t,type:"function"});const n=oc(r.parameters),i=[],s=n.length;for(let a=0;a[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,q4e=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,V4e=/^u?int$/;function uh(t,e){var f,g;const r=z4e(t,e==null?void 0:e.type);if(Z9.has(r))return Z9.get(r);const n=hz.test(t),i=Lf(n?q4e:H4e,t);if(!i)throw new M4e({param:t});if(i.name&&G4e(i.name))throw new $4e({param:t,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(e==null?void 0:e.structs)??{};let c,l={};if(n){c="tuple";const v=oc(i.type),x=[],P=v.length;for(let M=0;M[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function xz(t,e,r=new Set){const n=[],i=t.length;for(let s=0;s{const e=typeof t=="string"?t:m4e(t);return J4e(e)};function _z(t){return p4e(X4e(t))}const e8e=_z,bS=t=>e6(_z(t),0,4);function xS(t){const{abi:e,args:r=[],name:n}=t,i=Hu(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?bS(a)===n:a.type==="event"?e8e(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((l,d)=>{const f="inputs"in a&&a.inputs[d];return f?R_(l,f):!1})){if(o&&"inputs"in o&&o.inputs){const l=Az(a.inputs,o.inputs,r);if(l)throw new b5e({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||s[0]}function R_(t,e){const r=typeof t,n=e.type;switch(n){case"address":return vf(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>R_(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>R_(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Az(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return Az(i.components,s.components,r[n]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?vf(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?vf(r[n],{strict:!1}):!1)return o}}const Q9="/docs/contract/decodeFunctionResult";function Mg(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=xS({abi:e,args:r,name:n});if(!a)throw new Y5(n,{docsPath:Q9});s=a}if(s.type!=="function")throw new Y5(void 0,{docsPath:Q9});if(!s.outputs)throw new y5e(s.name,{docsPath:Q9});const o=uz(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const GM="/docs/contract/encodeFunctionData";function t8e(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=xS({abi:e,args:r,name:n});if(!s)throw new Y5(n,{docsPath:GM});i=s}if(i.type!=="function")throw new Y5(void 0,{docsPath:GM});return{abi:[i],functionName:bS(p0(i))}}function F0(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:t8e(t)})(),i=r[0],s=n,o="inputs"in i&&i.inputs?UF(i.inputs,e??[]):void 0;return L4([s,o??"0x"])}function U2({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new g_({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new g_({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}const Ez={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},r8e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},n8e={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function i8e(t){const{abi:e,data:r}=t,n=e6(r,0,4);if(n==="0x")throw new D4;const s=[...e||[],r8e,n8e].find(o=>o.type==="error"&&n===bS(p0(o)));if(!s)throw new kF(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?uz(s.inputs,e6(r,4)):void 0,errorName:s.name}}function Sz({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?hc(e[s]):e[s]}`).join(", ")})`}class s8e extends ze{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:d,to:f,value:g,stateOverride:v}){var M;const x=r?$c(r):void 0;let P=B2({from:x==null?void 0:x.address,to:f,value:typeof g<"u"&&`${dS(g)} ${((M=i==null?void 0:i.nativeCurrency)==null?void 0:M.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Ys(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Ys(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ys(l)} gwei`,nonce:d});v&&(P+=` ${L6e(v)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",P].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class CS extends ze{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=xS({abi:r,args:n,name:o}),l=c?Sz({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,d=c?p0(c,{includeName:!0}):void 0,f=B2({address:i&&C6e(i),function:d,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class P_ extends ze{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=i8e({abi:e,data:r});const{abiItem:d,errorName:f,args:g}=o;if(f==="Error")c=g[0];else if(f==="Panic"){const[v]=g;c=Ez[v]}else{const v=d?p0(d,{includeName:!0}):void 0,x=d&&g?Sz({abiItem:d,args:g,includeFunctionName:!1,includeName:!1}):void 0;a=[v?`Error: ${v}`:"",x&&x!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${x}`:""]}}catch(d){s=d}else i&&(c=i);let l;s instanceof kF&&(l=s.signature,a=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${n}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` -`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class o8e extends ze{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class a8e extends ze{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class _S extends ze{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function AS(t,e){var n,i,s,o,a,c;if(!(t instanceof ze))return!1;const r=t.walk(l=>l instanceof P_);return r instanceof P_?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=r.data)==null?void 0:s.errorName)==="ResolverNotContract"||((o=r.data)==null?void 0:o.errorName)==="ResolverError"||((a=r.data)==null?void 0:a.errorName)==="HttpError"||(c=r.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===Ez[50]):!1}function Iz(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Hu(e)?e:null}function gb(t){let e=new Uint8Array(32).fill(0);if(!t)return Ri(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=Iz(r[n]),s=i?M4(i):wf(Ph(r[n]),"bytes");e=wf(g0([e,s]),"bytes")}return Ri(e)}function c8e(t){return`[${t.slice(2)}]`}function l8e(t){const e=new Uint8Array(32).fill(0);return t?Iz(t)||wf(Ph(t)):Ri(e)}function ES(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Ph(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=Ph(c8e(l8e(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const u8e=3;function Lv(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:d}=t instanceof _S?t:t instanceof ze?t.walk(g=>"data"in g)||t.walk():{},f=t instanceof D4?new o8e({functionName:s}):[u8e,m0.code].includes(a)&&(c||l||d)?new P_({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:d??l}):t;return new CS(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const d8e="0x82ad56cb",f8e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",h8e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",_Te="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function p8e(t,{docsPath:e,...r}){const n=(()=>{const i=hS(t,r);return i instanceof j4?t:i})();return new s8e(n,{docsPath:e,...r})}const Y9=new Map;function Tz({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const d=c();o();const f=d.map(({args:g})=>g);f.length!==0&&t(f).then(g=>{var v;i&&Array.isArray(g)&&g.sort(i);for(let x=0;x{var v;for(let x=0;xY9.delete(e),a=()=>c().map(({args:d})=>d),c=()=>Y9.get(e)||[],l=d=>Y9.set(e,[...c(),d]);return{flush:o,async schedule(d){const f={},g=new Promise((P,M)=>{f.resolve=P,f.reject=M});return(r==null?void 0:r([...a(),d]))&&s(),c().length>0?(l({args:d,pendingPromise:f}),g):(l({args:d,pendingPromise:f}),setTimeout(s,n),g)}}}async function SS(t,e){var U,C,p,m;const{account:r=t.account,batch:n=!!((U=t.batch)!=null&&U.multicall),blockNumber:i,blockTag:s="latest",accessList:o,blobs:a,code:c,data:l,factory:d,factoryData:f,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:P,maxPriorityFeePerGas:M,nonce:N,to:E,value:$,stateOverride:L,...j}=e,H=r?$c(r):void 0;if(c&&(d||f))throw new ze("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&E)throw new ze("Cannot provide both `code` & `to` as parameters.");const I=c&&l,T=d&&f&&E&&l,B=I||T,K=I?w8e({code:c,data:l}):T?v8e({data:l,factory:d,factoryData:f,to:E}):l;try{F4(e);const _=(i?gr(i):void 0)||s,R=ez(L),S=(m=(p=(C=t.chain)==null?void 0:C.formatters)==null?void 0:p.transactionRequest)==null?void 0:m.format,y=(S||gS)({...pS(j,{format:S}),from:H==null?void 0:H.address,accessList:o,blobs:a,data:K,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:P,maxPriorityFeePerGas:M,nonce:N,to:B?void 0:E,value:$});if(n&&g8e({request:y})&&!R)try{return await m8e(t,{...y,blockNumber:i,blockTag:s})}catch(V){if(!(V instanceof HF)&&!(V instanceof g_))throw V}const b=await t.request({method:"eth_call",params:R?[y,_,R]:[y,_]});return b==="0x"?{data:void 0}:{data:b}}catch(w){const _=y8e(w),{offchainLookup:R,offchainLookupSignature:S}=await Qs(async()=>{const{offchainLookup:k,offchainLookupSignature:y}=await import("./ccip-BrPrqTPA.js");return{offchainLookup:k,offchainLookupSignature:y}},__vite__mapDeps([0,1]));if(t.ccipRead!==!1&&(_==null?void 0:_.slice(0,10))===S&&E)return{data:await R(t,{data:_,to:E})};throw B&&(_==null?void 0:_.slice(0,10))==="0x101bb98d"?new a8e({factory:d}):p8e(w,{...e,account:H,chain:t.chain})}}function g8e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(d8e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function m8e(t,e){var P;const{batchSize:r=1024,wait:n=0}=typeof((P=t.batch)==null?void 0:P.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new HF;l=U2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?gr(i):void 0)||s,{schedule:g}=Tz({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(M){return M.reduce((E,{data:$})=>E+($.length-2),0)>r*2},fn:async M=>{const N=M.map(L=>({allowFailure:!0,callData:L.data,target:L.to})),E=F0({abi:E_,args:[N],functionName:"aggregate3"}),$=await t.request({method:"eth_call",params:[{data:E,to:l},f]});return Mg({abi:E_,args:[N],functionName:"aggregate3",data:$||"0x"})}}),[{returnData:v,success:x}]=await g({data:o,to:c});if(!x)throw new _S({data:v});return v==="0x"?{data:void 0}:{data:v}}function w8e(t){const{code:e,data:r}=t;return jF({abi:Cz(["constructor(bytes, bytes)"]),bytecode:f8e,args:[e,r]})}function v8e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return jF({abi:Cz(["constructor(address, bytes, address, bytes)"]),bytecode:h8e,args:[i,e,r,n]})}function y8e(t){var r;if(!(t instanceof ze))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(r=e.data)==null?void 0:r.data:e.data}async function w0(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=F0({abi:r,args:i,functionName:s});try{const{data:c}=await an(t,SS,"call")({...o,data:a,to:n});return Mg({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw Lv(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function b8e(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=U2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=F0({abi:qM,functionName:"addr",...n!=null?{args:[gb(i),BigInt(n)]}:{args:[gb(i)]}}),d={address:c,abi:lz,functionName:"resolve",args:[h0(ES(i)),l],blockNumber:e,blockTag:r},f=an(t,w0,"readContract"),g=s?await f({...d,args:[...d.args,s]}):await f(d);if(g[0]==="0x")return null;const v=Mg({abi:qM,args:n!=null?[gb(i),BigInt(n)]:void 0,functionName:"addr",data:g[0]});return v==="0x"||Pg(v)==="0x00"?null:v}catch(l){if(o)throw l;if(AS(l,"resolve"))return null;throw l}}class x8e extends ze{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class Im extends ze{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class IS extends ze{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class C8e extends ze{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const _8e=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,A8e=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,E8e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,S8e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function I8e(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function ZM(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function kz({uri:t,gatewayUrls:e}){const r=E8e.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=ZM(e==null?void 0:e.ipfs,"https://ipfs.io"),i=ZM(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(_8e),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},d=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||A8e.test(t);if(t.startsWith("http")&&!d&&!f){let v=t;return e!=null&&e.arweave&&(v=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:v,isOnChain:!1,isEncoded:!1}}if((d||f)&&c)return{uri:`${n}/${d?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let g=t.replace(S8e,"");if(g.startsWith("i.json());return await TS({gatewayUrls:t,uri:Rz(r)})}catch{throw new IS({uri:e})}}async function TS({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=kz({uri:e,gatewayUrls:t});if(n||await I8e(r))return r;throw new IS({uri:e})}function k8e(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Im({reason:"Only EIP-155 supported"});if(!o)throw new Im({reason:"Chain ID not found"});if(!c)throw new Im({reason:"Contract address not found"});if(!i)throw new Im({reason:"Token ID not found"});if(!a)throw new Im({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function R8e(t,{nft:e}){if(e.namespace==="erc721")return w0(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return w0(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new C8e({namespace:e.namespace})}async function P8e(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?N8e(t,{gatewayUrls:e,record:r}):TS({uri:r,gatewayUrls:e})}async function N8e(t,{gatewayUrls:e,record:r}){const n=k8e(r),i=await R8e(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=kz({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,d=JSON.parse(l);return TS({uri:Rz(d),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),T8e({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function M8e(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=U2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:lz,functionName:"resolve",args:[h0(ES(n)),F0({abi:HM,functionName:"text",args:[gb(n),i]})],blockNumber:e,blockTag:r},d=an(t,w0,"readContract"),f=s?await d({...l,args:[...l.args,s]}):await d(l);if(f[0]==="0x")return null;const g=Mg({abi:HM,functionName:"text",data:f[0]});return g===""?null:g}catch(l){if(o)throw l;if(AS(l,"resolve"))return null;throw l}}async function $8e(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await an(t,M8e,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await P8e(t,{record:c,gatewayUrls:n})}catch{return null}}async function O8e(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:s,universalResolverAddress:o}){let a=o;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=U2({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:r4e,functionName:"reverse",args:[h0(ES(c))],blockNumber:r,blockTag:n},d=an(t,w0,"readContract"),[f,g]=i?await d({...l,args:[...l.args,i]}):await d(l);return e.toLowerCase()!==g.toLowerCase()?null:f}catch(l){if(s)throw l;if(AS(l,"reverse"))return null;throw l}}const D8e=new Map,L8e=new Map;function B8e(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,D8e),n=e(t,L8e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function U8e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=B8e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function F8e(t,{cacheTime:e=t.cacheTime}={}){const r=await U8e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:j8e(t.uid),cacheTime:e});return BigInt(r)}function z8e(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}async function Pz(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var d,f,g;const o=n||"latest",a=r!==void 0?gr(r):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,gr(s)]},{dedupe:!0}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,gr(s)]},{dedupe:!!a})),!c)throw new qF({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((g=(f=(d=t.chain)==null?void 0:d.formatters)==null?void 0:f.transaction)==null?void 0:g.format)||YF)(c)}const W8e={"0x0":"reverted","0x1":"success"};function H8e(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>z8e(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?f0(t.transactionIndex):null,status:t.status?W8e[t.status]:null,type:t.type?QF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}async function QM(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new VF({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||H8e)(r)}async function q8e(t,e){var M;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,multicallAddress:o,stateOverride:a}=e,c=e.contracts,l=n??(typeof((M=t.batch)==null?void 0:M.multicall)=="object"&&t.batch.multicall.batchSize||1024);let d=o;if(!d){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");d=U2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let g=0,v=0;for(let N=0;N0&&v>l&&f[g].length>0&&(g++,v=(H.length-2)/2,f[g]=[]),f[g]=[...f[g],{allowFailure:!0,callData:H,target:$}]}catch(H){const I=Lv(H,{abi:E,address:$,args:L,docsPath:"/docs/contract/multicall",functionName:j});if(!r)throw I;f[g]=[...f[g],{allowFailure:!0,callData:"0x",target:$}]}}const x=await Promise.allSettled(f.map(N=>an(t,w0,"readContract")({abi:E_,address:d,args:[N],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),P=[];for(let N=0;NJ9.get(t)||[],s=()=>{const d=i();J9.set(t,d.filter(f=>f.id!==n))},o=()=>{const d=YM.get(t);i().length===1&&d&&d(),s()},a=i();if(J9.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const d in e)c[d]=(...f)=>{var v,x;const g=i();if(g.length!==0)for(const P of g)(x=(v=P.fns)[d])==null||x.call(v,...f)};const l=r(c);return typeof l=="function"&&YM.set(t,l),o}async function n6(t){return new Promise(e=>setTimeout(e,t))}function K8e(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await n6(c);const l=async()=>{i&&(await t({unpoll:s}),await n6(n),l())};l()})(),s}function G8e(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:o=t.pollingInterval}){const a=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let c;return a?(()=>{const f=hc(["watchBlockNumber",t.uid,e,r,o]);return N_(f,{onBlockNumber:n,onError:i},g=>K8e(async()=>{var v;try{const x=await an(t,F8e,"getBlockNumber")({cacheTime:0});if(c){if(x===c)return;if(x-c>1&&r)for(let P=c+1n;Pc)&&(g.onBlockNumber(x,c),c=x)}catch(x){(v=g.onError)==null||v.call(g,x)}},{emitOnBegin:e,interval:o}))})():(()=>{const f=hc(["watchBlockNumber",t.uid,e,r]);return N_(f,{onBlockNumber:n,onError:i},g=>{let v=!0,x=()=>v=!1;return(async()=>{try{const P=(()=>{if(t.transport.type==="fallback"){const N=t.transport.transports.find(E=>E.config.type==="webSocket");return N?N.value:t.transport}return t.transport})(),{unsubscribe:M}=await P.subscribe({params:["newHeads"],onData(N){var $;if(!v)return;const E=Q1(($=N.result)==null?void 0:$.number);g.onBlockNumber(E,c),c=E},onError(N){var E;(E=g.onError)==null||E.call(g,N)}});x=M,v||x()}catch(P){i==null||i(P)}})(),()=>x()})})()}const My=new nS(8192);function Z8e(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(My.get(r))return My.get(r);const n=t().finally(()=>My.delete(r));return My.set(r,n),n}function i6(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const d=typeof e=="function"?e({count:a,error:l}):e;d&&await n6(d),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a{const{dedupe:i=!1,retryDelay:s=150,retryCount:o=3,uid:a}={...e,...n},c=i?wf($4(`${a}.${hc(r)}`)):void 0;return Z8e(()=>i6(async()=>{try{return await t(r)}catch(l){const d=l;switch(d.code){case _v.code:throw new _v(d);case Av.code:throw new Av(d);case Ev.code:throw new Ev(d,{method:r.method});case Sv.code:throw new Sv(d);case m0.code:throw new m0(d);case Iv.code:throw new Iv(d);case Tv.code:throw new Tv(d);case Xd.code:throw new Xd(d);case Y1.code:throw new Y1(d);case kv.code:throw new kv(d,{method:r.method});case J1.code:throw new J1(d);case Rv.code:throw new Rv(d);case pn.code:throw new pn(d);case Pv.code:throw new Pv(d);case Nv.code:throw new Nv(d);case Mv.code:throw new Mv(d);case $v.code:throw new $v(d);case no.code:throw new no(d);case 5e3:throw new pn(d);default:throw l instanceof ze?l:new A6e(d)}}},{delay:({count:l,error:d})=>{var f;if(d&&d instanceof ow){const g=(f=d==null?void 0:d.headers)==null?void 0:f.get("Retry-After");if(g!=null&&g.match(/\d/))return Number.parseInt(g)*1e3}return~~(1<Y8e(l)}),{enabled:i,id:c})}}function Y8e(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===J1.code||t.code===m0.code:t instanceof ow&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function J8e(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function Nz(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function X8e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const JM=X8e();function exe(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=r,a={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:c,method:l,signal:d}=a;try{const g=await Nz(async({signal:x})=>{const P={...a,body:Array.isArray(n)?hc(n.map(E=>({jsonrpc:"2.0",id:E.id??JM.take(),...E}))):hc({jsonrpc:"2.0",id:n.id??JM.take(),...n}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:d||(o>0?x:null)},M=new Request(t,P);return i&&await i(M),await fetch(t,P)},{errorInstance:new UM({body:n,url:t}),timeout:o,signal:!0});s&&await s(g);let v;if((f=g.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))v=await g.json();else{v=await g.text();try{v=JSON.parse(v||"{}")}catch(x){if(g.ok)throw x;v={error:v}}}if(!g.ok)throw new ow({body:n,details:hc(v.error)||g.statusText,headers:g.headers,status:g.status,url:t});return v}catch(g){throw g instanceof ow||g instanceof UM?g:new ow({body:n,cause:g,url:t})}}}}class txe extends ze{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function rxe(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new txe({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[s,o,a]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${o}.${a}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}async function nxe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<{a&&setTimeout(()=>x(new x6e({hash:r})),a);const P=N_(c,{onReplaced:n,resolve:v,reject:x},M=>{const N=an(t,G8e,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(E){const $=j=>{N(),j(),P()};let L=E;if(!g)try{if(f){if(e>1&&(!f.blockNumber||L-f.blockNumber+1nM.resolve(f));return}if(l||(g=!0,await i6(async()=>{l=await an(t,Pz,"getTransaction")({hash:r}),l.blockNumber&&(L=l.blockNumber)},{delay:o,retryCount:s}),g=!1),f=await an(t,QM,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||L-f.blockNumber+1nM.resolve(f))}catch(j){if(j instanceof qF||j instanceof VF){if(!l){g=!1;return}try{d=l,g=!0;const H=await i6(()=>an(t,Ov,"getBlock")({blockNumber:L,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:B})=>B instanceof ZF});g=!1;const I=H.transactions.find(({from:B,nonce:K})=>B===d.from&&K===d.nonce);if(!I||(f=await an(t,QM,"getTransactionReceipt")({hash:I.hash}),e>1&&(!f.blockNumber||L-f.blockNumber+1n{var B;(B=M.onReplaced)==null||B.call(M,{reason:T,replacedTransaction:d,transaction:I,transactionReceipt:f}),M.resolve(f)})}catch(H){$(()=>M.reject(H))}}else $(()=>M.reject(j))}}})})})}async function ixe(t,{account:e=t.account,message:r}){if(!e)throw new lS({docsPath:"/docs/actions/wallet/signMessage"});const n=$c(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?$4(r):r.raw instanceof Uint8Array?h0(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function sxe(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?$c(a.account):t.account,l=F0({abi:r,args:i,functionName:o});try{const{data:d}=await an(t,SS,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),f=Mg({abi:r,args:i,functionName:o,data:d||"0x"}),g=r.filter(v=>"name"in v&&v.name===e.functionName);return{result:f,request:{abi:g,address:n,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(d){throw Lv(d,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}async function oxe(t,e){const{abi:r,account:n=t.account,address:i,args:s,dataSuffix:o,functionName:a,...c}=e;if(!n)throw new lS({docsPath:"/docs/contract/writeContract"});const l=$c(n),d=F0({abi:r,args:s,functionName:a});try{return await an(t,az,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:i,account:l,...c})}catch(f){throw Lv(f,{abi:r,address:i,args:s,docsPath:"/docs/contract/writeContract",functionName:a,sender:l.address})}}const M_=256;let $y=M_,Oy;function Mz(t=11){if(!Oy||$y+t>M_*2){Oy="",$y=0;for(let e=0;e{const E=N(M);for(const L in x)delete E[L];const $={...M,...E};return Object.assign($,{extend:P($)})}}return Object.assign(x,{extend:P(x)})}function kS({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){const c=Mz();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:Q8e(r,{retryCount:n,retryDelay:i,uid:c}),value:a}}function axe(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>kS({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}function cxe(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:s,retryDelay:o}=e;return({chain:a,pollingInterval:c=4e3,timeout:l,...d})=>{let f=t,g=()=>{};const v=kS({key:r,name:n,async request({method:x,params:P}){const M=async(N=0)=>{const E=f[N]({...d,chain:a,retryCount:0,timeout:l});try{const $=await E.request({method:x,params:P});return g({method:x,params:P,response:$,transport:E,status:"success"}),$}catch($){if(g({error:$,method:x,params:P,transport:E,status:"error"}),lxe($)||N===f.length-1)throw $;return M(N+1)}};return M()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:x=>g=x,transports:f.map(x=>x({chain:a,retryCount:0}))});if(i){const x=typeof i=="object"?i:{};uxe({chain:a,interval:x.interval??c,onTransports:P=>f=P,sampleCount:x.sampleCount,timeout:x.timeout,transports:f,weights:x.weights})}return v}}function lxe(t){return"code"in t&&typeof t.code=="number"&&(t.code===Y1.code||t.code===pn.code||t.code===5e3)}function uxe({chain:t,interval:e=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:s,weights:o={}}){const{stability:a=.7,latency:c=.3}=o,l=[],d=async()=>{const f=await Promise.all(s.map(async x=>{const P=x({chain:t,retryCount:0,timeout:i}),M=Date.now();let N,E;try{await P.request({method:"net_listening"}),E=1}catch{E=0}finally{N=Date.now()}return{latency:N-M,success:E}}));l.push(f),l.length>n&&l.shift();const g=Math.max(...l.map(x=>Math.max(...x.map(({latency:P})=>P)))),v=s.map((x,P)=>{const M=l.map(j=>j[P].latency),E=1-M.reduce((j,H)=>j+H,0)/M.length/g,$=l.map(j=>j[P].success),L=$.reduce((j,H)=>j+H,0)/$.length;return L===0?[0,P]:[c*E+a*L,P]}).sort((x,P)=>P[0]-x[0]);r(v.map(([,x])=>s[x])),await n6(e),d()};d()}class dxe extends ze{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function X9(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:a,retryDelay:c}=e;return({chain:l,retryCount:d,timeout:f})=>{const{batchSize:g=1e3,wait:v=0}=typeof r=="object"?r:{},x=e.retryCount??d,P=f??e.timeout??1e4,M=t||(l==null?void 0:l.rpcUrls.default.http[0]);if(!M)throw new dxe;const N=exe(M,{fetchOptions:n,onRequest:o,onResponse:a,timeout:P});return kS({key:i,name:s,async request({method:E,params:$}){const L={method:E,params:$},{schedule:j}=Tz({id:M,wait:v,shouldSplitBatch(B){return B.length>g},fn:B=>N.request({body:B}),sort:(B,K)=>B.id-K.id}),H=async B=>r?j(B):[await N.request({body:B})],[{error:I,result:T}]=await H(L);if(I)throw new KF({body:L,error:I,url:M});return T},retryCount:x,retryDelay:c,timeout:P,type:"http"},{fetchOptions:n,url:M})}}let e7=!1;async function fxe(t,e={}){var l,d;if(e7)return[];e7=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const f of e.connectors){let g;typeof f=="function"?g=t._internal.connectors.setup(f):g=f,r.push(g)}else r.push(...t.connectors);let n;try{n=await((d=t.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((f,g)=>(i[f.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const f of s){const g=await f.getProvider().catch(()=>{});if(!g||c.some(P=>P===g)||!await f.isAuthorized())continue;const x=await f.connect({isReconnecting:!0}).catch(()=>null);x&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(P=>{const M=new Map(o?P.connections:new Map).set(f.uid,{accounts:x.accounts,chainId:x.chainId,connector:f});return{...P,current:o?P.current:f.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:f}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),e7=!1,a}function hxe(t){if(typeof window>"u")return;const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function pxe(){const t=new Set;let e=[];const r=()=>hxe(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n==null||n()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const gxe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://dacademy-ucan-delegator.netlify.app/ucan"},mxe=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const d=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=g=>{const v=o(g);if(!d(f,v)){const x=f;a(f=v,x)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},wxe=mxe;function vxe(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,void 0),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>r.removeItem(i)}}const Bv=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return Bv(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Bv(n)(r)}}}},yxe=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:M=>M,version:0,merge:(M,N)=>({...N,...M}),...e},o=!1;const a=new Set,c=new Set;let l;try{l=s.getStorage()}catch{}if(!l)return t((...M)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...M)},n,i);const d=Bv(s.serialize),f=()=>{const M=s.partialize({...n()});let N;const E=d({state:M,version:s.version}).then($=>l.setItem(s.name,$)).catch($=>{N=$});if(N)throw N;return E},g=i.setState;i.setState=(M,N)=>{g(M,N),f()};const v=t((...M)=>{r(...M),f()},n,i);let x;const P=()=>{var M;if(!l)return;o=!1,a.forEach(E=>E(n()));const N=((M=s.onRehydrateStorage)==null?void 0:M.call(s,n()))||void 0;return Bv(l.getItem.bind(l))(s.name).then(E=>{if(E)return s.deserialize(E)}).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==s.version){if(s.migrate)return s.migrate(E.state,E.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return E.state}).then(E=>{var $;return x=s.merge(E,($=n())!=null?$:v),r(x,!0),f()}).then(()=>{N==null||N(x,void 0),o=!0,c.forEach(E=>E(x))}).catch(E=>{N==null||N(void 0,E)})};return i.persist={setOptions:M=>{s={...s,...M},M.getStorage&&(l=M.getStorage())},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>P(),hasHydrated:()=>o,onHydrate:M=>(a.add(M),()=>{a.delete(M)}),onFinishHydration:M=>(c.add(M),()=>{c.delete(M)})},P(),x||v},bxe=(t,e)=>(r,n,i)=>{let s={storage:vxe(()=>localStorage),partialize:P=>P,version:0,merge:(P,M)=>({...M,...P}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...P)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...P)},n,i);const d=()=>{const P=s.partialize({...n()});return l.setItem(s.name,{state:P,version:s.version})},f=i.setState;i.setState=(P,M)=>{f(P,M),d()};const g=t((...P)=>{r(...P),d()},n,i);let v;const x=()=>{var P,M;if(!l)return;o=!1,a.forEach(E=>{var $;return E(($=n())!=null?$:g)});const N=((M=s.onRehydrateStorage)==null?void 0:M.call(s,(P=n())!=null?P:g))||void 0;return Bv(l.getItem.bind(l))(s.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==s.version){if(s.migrate)return s.migrate(E.state,E.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return E.state}).then(E=>{var $;return v=s.merge(E,($=n())!=null?$:g),r(v,!0),d()}).then(()=>{N==null||N(v,void 0),v=n(),o=!0,c.forEach(E=>E(v))}).catch(E=>{N==null||N(void 0,E)})};return i.persist={setOptions:P=>{s={...s,...P},P.storage&&(l=P.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:P=>(a.add(P),()=>{a.delete(P)}),onFinishHydration:P=>(c.add(P),()=>{c.delete(P)})},s.skipHydration||x(),v||g},xxe=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((gxe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),yxe(t,e)):bxe(t,e),Cxe=xxe,_xe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://dacademy-ucan-delegator.netlify.app/ucan"},XM=t=>{let e;const r=new Set,n=(c,l)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=l??typeof d!="object"?d:Object.assign({},e,d),r.forEach(g=>g(e,f))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{(_xe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},t7=t=>t?XM(t):XM;var Oz={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,d){this.fn=c,this.context=l,this.once=d||!1}function s(c,l,d,f,g){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new i(d,f||c,g),x=r?r+l:l;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],v]:c._events[x].push(v):(c._events[x]=v,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],d,f;if(this._eventsCount===0)return l;for(f in d=this._events)e.call(d,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},a.prototype.listeners=function(l){var d=r?r+l:l,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,v=f.length,x=new Array(v);gi.id===r.chainId)?r.chainId:t.chains[0].id,connections:n?r.connections:new Map,status:n?"reconnecting":"disconnected"}),{async onMount(){var i;if(t._internal.ssr){await t._internal.store.persist.rehydrate();const s=(i=t._internal.mipd)==null?void 0:i.getProviders().map(t._internal.connectors.providerDetailToConnector).map(t._internal.connectors.setup);t._internal.connectors.setState(o=>[...o,...s??[]])}n?fxe(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}function Ixe(t){const{children:e,config:r,initialState:n,reconnectOnMount:i=!0}=t,{onMount:s}=Sxe(r,{initialState:n,reconnectOnMount:i});r._internal.ssr||s();const o=Ye.useRef(!0);return Ye.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const Txe=Ye.createContext(void 0);function kxe(t){const{children:e,config:r}=t,n={value:r};return Ye.createElement(Ixe,t,Ye.createElement(Txe.Provider,n,e))}var z4=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},W4=typeof window>"u"||"Deno"in globalThis;function Xa(){}function Rxe(t,e){return typeof t=="function"?t(e):t}function Pxe(t){return typeof t=="number"&&t>=0&&t!==1/0}function Nxe(t,e){return Math.max(t+(e||0)-Date.now(),0)}function e$(t,e){return typeof t=="function"?t(e):t}function Mxe(t,e){return typeof t=="function"?t(e):t}function t$(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==RS(o,e.options))return!1}else if(!jv(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function r$(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Uv(e.options.mutationKey)!==Uv(s))return!1}else if(!jv(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function RS(t,e){return((e==null?void 0:e.queryKeyHashFn)||Uv)(t)}function Uv(t){return JSON.stringify(t,(e,r)=>$_(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function jv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!jv(t[r],e[r])):!1}function Dz(t,e){if(t===e)return t;const r=n$(t)&&n$(e);if(r||$_(t)&&$_(e)){const n=r?t:Object.keys(t),i=n.length,s=r?e:Object.keys(e),o=s.length,a=r?[]:{};let c=0;for(let l=0;l{setTimeout(e,t)})}function Oxe(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Dz(t,e):e}function Dxe(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function Lxe(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Lz=Symbol();function Bz(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Lz?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var xh,Pd,t1,F$,Bxe=(F$=class extends z4{constructor(){super();Fr(this,xh);Fr(this,Pd);Fr(this,t1);pr(this,t1,e=>{if(!W4&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Oe(this,Pd)||this.setEventListener(Oe(this,t1))}onUnsubscribe(){var e;this.hasListeners()||((e=Oe(this,Pd))==null||e.call(this),pr(this,Pd,void 0))}setEventListener(e){var r;pr(this,t1,e),(r=Oe(this,Pd))==null||r.call(this),pr(this,Pd,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){Oe(this,xh)!==e&&(pr(this,xh,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof Oe(this,xh)=="boolean"?Oe(this,xh):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},xh=new WeakMap,Pd=new WeakMap,t1=new WeakMap,F$),Uz=new Bxe,r1,Nd,n1,z$,Uxe=(z$=class extends z4{constructor(){super();Fr(this,r1,!0);Fr(this,Nd);Fr(this,n1);pr(this,n1,e=>{if(!W4&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){Oe(this,Nd)||this.setEventListener(Oe(this,n1))}onUnsubscribe(){var e;this.hasListeners()||((e=Oe(this,Nd))==null||e.call(this),pr(this,Nd,void 0))}setEventListener(e){var r;pr(this,n1,e),(r=Oe(this,Nd))==null||r.call(this),pr(this,Nd,e(this.setOnline.bind(this)))}setOnline(e){Oe(this,r1)!==e&&(pr(this,r1,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return Oe(this,r1)}},r1=new WeakMap,Nd=new WeakMap,n1=new WeakMap,z$),s6=new Uxe;function jxe(t){return Math.min(1e3*2**t,3e4)}function jz(t){return(t??"online")==="online"?s6.isOnline():!0}var Fz=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function r7(t){return t instanceof Fz}function zz(t){let e=!1,r=0,n=!1,i,s,o;const a=new Promise((N,E)=>{s=N,o=E}),c=N=>{var E;n||(x(new Fz(N)),(E=t.abort)==null||E.call(t))},l=()=>{e=!0},d=()=>{e=!1},f=()=>Uz.isFocused()&&(t.networkMode==="always"||s6.isOnline())&&t.canRun(),g=()=>jz(t.networkMode)&&t.canRun(),v=N=>{var E;n||(n=!0,(E=t.onSuccess)==null||E.call(t,N),i==null||i(),s(N))},x=N=>{var E;n||(n=!0,(E=t.onError)==null||E.call(t,N),i==null||i(),o(N))},P=()=>new Promise(N=>{var E;i=$=>{(n||f())&&N($)},(E=t.onPause)==null||E.call(t)}).then(()=>{var N;i=void 0,n||(N=t.onContinue)==null||N.call(t)}),M=()=>{if(n)return;let N;const E=r===0?t.initialPromise:void 0;try{N=E??t.fn()}catch($){N=Promise.reject($)}Promise.resolve(N).then(v).catch($=>{var T;if(n)return;const L=t.retry??(W4?0:3),j=t.retryDelay??jxe,H=typeof j=="function"?j(r,$):j,I=L===!0||typeof L=="number"&&rf()?void 0:P()).then(()=>{e?x($):M()})})};return{promise:a,cancel:c,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:d,canStart:g,start:()=>(g()?M():P().then(M),a)}}function Fxe(){let t=[],e=0,r=a=>{a()},n=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?t.push(a):i(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var gs=Fxe(),Ch,W$,Wz=(W$=class{constructor(){Fr(this,Ch)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pxe(this.gcTime)&&pr(this,Ch,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(W4?1/0:5*60*1e3))}clearGcTimeout(){Oe(this,Ch)&&(clearTimeout(Oe(this,Ch)),pr(this,Ch,void 0))}},Ch=new WeakMap,W$),i1,s1,ca,Zi,Kv,_h,ec,cu,H$,zxe=(H$=class extends Wz{constructor(e){super();Fr(this,ec);Fr(this,i1);Fr(this,s1);Fr(this,ca);Fr(this,Zi);Fr(this,Kv);Fr(this,_h);pr(this,_h,!1),pr(this,Kv,e.defaultOptions),this.setOptions(e.options),this.observers=[],pr(this,ca,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,pr(this,i1,Hxe(this.options)),this.state=e.state??Oe(this,i1),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Oe(this,Zi))==null?void 0:e.promise}setOptions(e){this.options={...Oe(this,Kv),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Oe(this,ca).remove(this)}setData(e,r){const n=Oxe(this.state.data,e,this.options);return zi(this,ec,cu).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){zi(this,ec,cu).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,i;const r=(n=Oe(this,Zi))==null?void 0:n.promise;return(i=Oe(this,Zi))==null||i.cancel(e),r?r.then(Xa).catch(Xa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Oe(this,i1))}isActive(){return this.observers.some(e=>Mxe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Nxe(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Zi))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Zi))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Oe(this,ca).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(Oe(this,Zi)&&(Oe(this,_h)?Oe(this,Zi).cancel({revert:!0}):Oe(this,Zi).cancelRetry()),this.scheduleGc()),Oe(this,ca).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||zi(this,ec,cu).call(this,{type:"invalidate"})}fetch(e,r){var c,l,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Oe(this,Zi))return Oe(this,Zi).continueRetry(),Oe(this,Zi).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(g=>g.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(pr(this,_h,!0),n.signal)})},s=()=>{const f=Bz(this.options,r),g={queryKey:this.queryKey,meta:this.meta};return i(g),pr(this,_h,!1),this.options.persister?this.options.persister(f,g,this):f(g)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),pr(this,s1,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=o.fetchOptions)==null?void 0:l.meta))&&zi(this,ec,cu).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=f=>{var g,v,x,P;r7(f)&&f.silent||zi(this,ec,cu).call(this,{type:"error",error:f}),r7(f)||((v=(g=Oe(this,ca).config).onError)==null||v.call(g,f,this),(P=(x=Oe(this,ca).config).onSettled)==null||P.call(x,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return pr(this,Zi,zz({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var g,v,x,P;if(f===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(M){a(M);return}(v=(g=Oe(this,ca).config).onSuccess)==null||v.call(g,f,this),(P=(x=Oe(this,ca).config).onSettled)==null||P.call(x,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(f,g)=>{zi(this,ec,cu).call(this,{type:"failed",failureCount:f,error:g})},onPause:()=>{zi(this,ec,cu).call(this,{type:"pause"})},onContinue:()=>{zi(this,ec,cu).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),Oe(this,Zi).start()}},i1=new WeakMap,s1=new WeakMap,ca=new WeakMap,Zi=new WeakMap,Kv=new WeakMap,_h=new WeakMap,ec=new WeakSet,cu=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Wxe(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return r7(i)&&i.revert&&Oe(this,s1)?{...Oe(this,s1),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),gs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Oe(this,ca).notify({query:this,type:"updated",action:e})})},H$);function Wxe(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jz(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Hxe(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Jc,q$,qxe=(q$=class extends z4{constructor(e={}){super();Fr(this,Jc);this.config=e,pr(this,Jc,new Map)}build(e,r,n){const i=r.queryKey,s=r.queryHash??RS(i,r);let o=this.get(s);return o||(o=new zxe({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){Oe(this,Jc).has(e.queryHash)||(Oe(this,Jc).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=Oe(this,Jc).get(e.queryHash);r&&(e.destroy(),r===e&&Oe(this,Jc).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){gs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Oe(this,Jc).get(e)}getAll(){return[...Oe(this,Jc).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>t$(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>t$(e,n)):r}notify(e){gs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){gs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){gs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jc=new WeakMap,q$),Xc,ds,Ah,el,md,V$,Vxe=(V$=class extends Wz{constructor(e){super();Fr(this,el);Fr(this,Xc);Fr(this,ds);Fr(this,Ah);this.mutationId=e.mutationId,pr(this,ds,e.mutationCache),pr(this,Xc,[]),this.state=e.state||Kxe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Oe(this,Xc).includes(e)||(Oe(this,Xc).push(e),this.clearGcTimeout(),Oe(this,ds).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){pr(this,Xc,Oe(this,Xc).filter(r=>r!==e)),this.scheduleGc(),Oe(this,ds).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Oe(this,Xc).length||(this.state.status==="pending"?this.scheduleGc():Oe(this,ds).remove(this))}continue(){var e;return((e=Oe(this,Ah))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,l,d,f,g,v,x,P,M,N,E,$,L,j,H,I;pr(this,Ah,zz({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(T,B)=>{zi(this,el,md).call(this,{type:"failed",failureCount:T,error:B})},onPause:()=>{zi(this,el,md).call(this,{type:"pause"})},onContinue:()=>{zi(this,el,md).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Oe(this,ds).canRun(this)}));const r=this.state.status==="pending",n=!Oe(this,Ah).canStart();try{if(!r){zi(this,el,md).call(this,{type:"pending",variables:e,isPaused:n}),await((s=(i=Oe(this,ds).config).onMutate)==null?void 0:s.call(i,e,this));const B=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));B!==this.state.context&&zi(this,el,md).call(this,{type:"pending",context:B,variables:e,isPaused:n})}const T=await Oe(this,Ah).start();return await((l=(c=Oe(this,ds).config).onSuccess)==null?void 0:l.call(c,T,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,T,e,this.state.context)),await((v=(g=Oe(this,ds).config).onSettled)==null?void 0:v.call(g,T,null,this.state.variables,this.state.context,this)),await((P=(x=this.options).onSettled)==null?void 0:P.call(x,T,null,e,this.state.context)),zi(this,el,md).call(this,{type:"success",data:T}),T}catch(T){try{throw await((N=(M=Oe(this,ds).config).onError)==null?void 0:N.call(M,T,e,this.state.context,this)),await(($=(E=this.options).onError)==null?void 0:$.call(E,T,e,this.state.context)),await((j=(L=Oe(this,ds).config).onSettled)==null?void 0:j.call(L,void 0,T,this.state.variables,this.state.context,this)),await((I=(H=this.options).onSettled)==null?void 0:I.call(H,void 0,T,e,this.state.context)),T}finally{zi(this,el,md).call(this,{type:"error",error:T})}}finally{Oe(this,ds).runNext(this)}}},Xc=new WeakMap,ds=new WeakMap,Ah=new WeakMap,el=new WeakSet,md=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),gs.batch(()=>{Oe(this,Xc).forEach(n=>{n.onMutationUpdate(e)}),Oe(this,ds).notify({mutation:this,type:"updated",action:e})})},V$);function Kxe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var po,Gv,K$,Gxe=(K$=class extends z4{constructor(e={}){super();Fr(this,po);Fr(this,Gv);this.config=e,pr(this,po,new Map),pr(this,Gv,Date.now())}build(e,r,n){const i=new Vxe({mutationCache:this,mutationId:++V3(this,Gv)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){const r=Dy(e),n=Oe(this,po).get(r)??[];n.push(e),Oe(this,po).set(r,n),this.notify({type:"added",mutation:e})}remove(e){var n;const r=Dy(e);if(Oe(this,po).has(r)){const i=(n=Oe(this,po).get(r))==null?void 0:n.filter(s=>s!==e);i&&(i.length===0?Oe(this,po).delete(r):Oe(this,po).set(r,i))}this.notify({type:"removed",mutation:e})}canRun(e){var n;const r=(n=Oe(this,po).get(Dy(e)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}runNext(e){var n;const r=(n=Oe(this,po).get(Dy(e)))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){gs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...Oe(this,po).values()].flat()}find(e){const r={exact:!0,...e};return this.getAll().find(n=>r$(r,n))}findAll(e={}){return this.getAll().filter(r=>r$(e,r))}notify(e){gs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return gs.batch(()=>Promise.all(e.map(r=>r.continue().catch(Xa))))}},po=new WeakMap,Gv=new WeakMap,K$);function Dy(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function s$(t){return{onFetch:(e,r)=>{var d,f,g,v,x;const n=e.options,i=(g=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,s=((v=e.state.data)==null?void 0:v.pages)||[],o=((x=e.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let P=!1;const M=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(e.signal.aborted?P=!0:e.signal.addEventListener("abort",()=>{P=!0}),e.signal)})},N=Bz(e.options,e.fetchOptions),E=async($,L,j)=>{if(P)return Promise.reject();if(L==null&&$.pages.length)return Promise.resolve($);const H={queryKey:e.queryKey,pageParam:L,direction:j?"backward":"forward",meta:e.options.meta};M(H);const I=await N(H),{maxPages:T}=e.options,B=j?Lxe:Dxe;return{pages:B($.pages,I,T),pageParams:B($.pageParams,L,T)}};if(i&&s.length){const $=i==="backward",L=$?Zxe:o$,j={pages:s,pageParams:o},H=L(n,j);a=await E(j,H,$)}else{const $=t??s.length;do{const L=c===0?o[0]??n.initialPageParam:o$(n,a);if(c>0&&L==null)break;a=await E(a,L),c++}while(c<$)}return a};e.options.persister?e.fetchFn=()=>{var P,M;return(M=(P=e.options).persister)==null?void 0:M.call(P,l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=l}}}function o$(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function Zxe(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var $n,Md,$d,o1,a1,Od,c1,l1,G$,Qxe=(G$=class{constructor(t={}){Fr(this,$n);Fr(this,Md);Fr(this,$d);Fr(this,o1);Fr(this,a1);Fr(this,Od);Fr(this,c1);Fr(this,l1);pr(this,$n,t.queryCache||new qxe),pr(this,Md,t.mutationCache||new Gxe),pr(this,$d,t.defaultOptions||{}),pr(this,o1,new Map),pr(this,a1,new Map),pr(this,Od,0)}mount(){V3(this,Od)._++,Oe(this,Od)===1&&(pr(this,c1,Uz.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,$n).onFocus())})),pr(this,l1,s6.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,$n).onOnline())})))}unmount(){var t,e;V3(this,Od)._--,Oe(this,Od)===0&&((t=Oe(this,c1))==null||t.call(this),pr(this,c1,void 0),(e=Oe(this,l1))==null||e.call(this),pr(this,l1,void 0))}isFetching(t){return Oe(this,$n).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Oe(this,Md).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Oe(this,$n).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const r=this.defaultQueryOptions(t),n=Oe(this,$n).build(this,r);return t.revalidateIfStale&&n.isStaleByTime(e$(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(e)}}getQueriesData(t){return Oe(this,$n).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),i=Oe(this,$n).get(n.queryHash),s=i==null?void 0:i.state.data,o=Rxe(e,s);if(o!==void 0)return Oe(this,$n).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return gs.batch(()=>Oe(this,$n).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Oe(this,$n).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=Oe(this,$n);gs.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=Oe(this,$n),n={type:"active",...t};return gs.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(n,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},n=gs.batch(()=>Oe(this,$n).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(Xa).catch(Xa)}invalidateQueries(t={},e={}){return gs.batch(()=>{if(Oe(this,$n).findAll(t).forEach(n=>{n.invalidate()}),t.refetchType==="none")return Promise.resolve();const r={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(r,e)})}refetchQueries(t={},e){const r={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},n=gs.batch(()=>Oe(this,$n).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Xa)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Xa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=Oe(this,$n).build(this,e);return r.isStaleByTime(e$(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Xa).catch(Xa)}fetchInfiniteQuery(t){return t.behavior=s$(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Xa).catch(Xa)}ensureInfiniteQueryData(t){return t.behavior=s$(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return s6.isOnline()?Oe(this,Md).resumePausedMutations():Promise.resolve()}getQueryCache(){return Oe(this,$n)}getMutationCache(){return Oe(this,Md)}getDefaultOptions(){return Oe(this,$d)}setDefaultOptions(t){pr(this,$d,t)}setQueryDefaults(t,e){Oe(this,o1).set(Uv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Oe(this,o1).values()];let r={};return e.forEach(n=>{jv(t,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(t,e){Oe(this,a1).set(Uv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Oe(this,a1).values()];let r={};return e.forEach(n=>{jv(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Oe(this,$d).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=RS(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===Lz&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Oe(this,$d).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Oe(this,$n).clear(),Oe(this,Md).clear()}},$n=new WeakMap,Md=new WeakMap,$d=new WeakMap,o1=new WeakMap,a1=new WeakMap,Od=new WeakMap,c1=new WeakMap,l1=new WeakMap,G$),Hz=Ye.createContext(void 0),ETe=t=>{const e=Ye.useContext(Hz);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Yxe=({client:t,children:e})=>(Ye.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Q.jsx(Hz.Provider,{value:t,children:e}));function qz(t,e){return`https://rpc.walletconnect.org/v1/?chainId=${e}:${t}`}const Vz={id:"eip155:1",chainId:1,name:"Ethereum",currency:"ETH",explorerUrl:"https://etherscan.io",rpcUrl:qz(1,"eip155"),chainNamespace:"eip155"},Kz={id:"eip155:10",chainId:10,name:"Optimism",currency:"ETH",explorerUrl:"https://optimistic.etherscan.io",rpcUrl:qz(10,"eip155"),chainNamespace:"eip155"};function ts(t,e,r){const n=t[e.name];if(typeof n=="function")return n;const i=t[r];return typeof i=="function"?i:s=>e(t,s)}const mb="2.13.7",Jxe=()=>`@wagmi/core@${mb}`;var Gz=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},o6,Zz;class Ac extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Jxe()}constructor(e,r={}){var s;super(),o6.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=r.cause instanceof Ac?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof Ac&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` -`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return Gz(this,o6,"m",Zz).call(this,this,e)}}o6=new WeakSet,Zz=function t(e,r){return r!=null&&r(e)?e:e.cause?Gz(this,o6,"m",t).call(this,e.cause,r):e};class v0 extends Ac{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Xxe extends Ac{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Qz extends Ac{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class e9e extends Ac{constructor({address:e,connector:r}){super(`Account "${e}" not found for connector "${r.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class t9e extends Ac{constructor({connectionChainId:e,connectorChainId:r}){super(`The current chain of the connector (id: ${r}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class r9e extends Ac{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function a$(t,e){var n;let r;if(typeof e.connector=="function"?r=t._internal.connectors.setup(e.connector):r=e.connector,r.uid===t.state.current)throw new Xxe;try{t.setState(o=>({...o,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const i=await r.connect({chainId:e.chainId}),s=i.accounts;return r.emitter.off("connect",t._internal.events.connect),r.emitter.on("change",t._internal.events.change),r.emitter.on("disconnect",t._internal.events.disconnect),await((n=t.storage)==null?void 0:n.setItem("recentConnectorId",r.id)),t.setState(o=>({...o,connections:new Map(o.connections).set(r.uid,{accounts:s,chainId:i.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:s,chainId:i.chainId}}catch(i){throw t.setState(s=>({...s,status:s.current?"connected":"disconnected"})),i}}async function j2(t,e={}){let r;if(e.connector){const{connector:l}=e;if(t.state.status==="reconnecting"&&!l.getAccounts&&!l.getChainId)throw new r9e({connector:l});const[d,f]=await Promise.all([l.getAccounts(),l.getChainId()]);r={accounts:d,chainId:f,connector:l}}else r=t.state.connections.get(t.state.current);if(!r)throw new Qz;const n=e.chainId??r.chainId,i=await r.connector.getChainId();if(i!==r.chainId)throw new t9e({connectionChainId:r.chainId,connectorChainId:i});const s=r.connector;if(s.getClient)return s.getClient({chainId:n});const o=$c(e.account??r.accounts[0]);if(o.address=Vs(o.address),e.account&&!r.accounts.some(l=>l.toLowerCase()===o.address.toLowerCase()))throw new e9e({address:o.address,connector:s});const a=t.chains.find(l=>l.id===n),c=await r.connector.getProvider({chainId:n});return $z({account:o,chain:a,name:"Connector Client",transport:l=>axe(c)({...l,retryCount:0})})}async function n9e(t,e={}){var i,s;let r;if(e.connector)r=e.connector;else{const{connections:o,current:a}=t.state,c=o.get(a);r=c==null?void 0:c.connector}const n=t.state.connections;r&&(await r.disconnect(),r.emitter.off("change",t._internal.events.change),r.emitter.off("disconnect",t._internal.events.disconnect),r.emitter.on("connect",t._internal.events.connect),n.delete(r.uid)),t.setState(o=>{if(n.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const a=n.values().next().value;return{...o,connections:new Map(n),current:a.connector.uid}});{const o=t.state.current;if(!o)return;const a=(i=t.state.connections.get(o))==null?void 0:i.connector;if(!a)return;await((s=t.storage)==null?void 0:s.setItem("recentConnectorId",a.id))}}async function i9e(t,e){const{chainId:r,connector:n,...i}=e;let s;e.account?s=e.account:s=(await j2(t,{account:e.account,chainId:r,connector:n})).account;const o=t.getClient({chainId:r});return ts(o,wS,"estimateGas")({...i,account:s})}function Yz(t){return typeof t=="number"?t:t==="wei"?0:Math.abs(w6e[t])}function F2(t){const e=t.state.current,r=t.state.connections.get(e),n=r==null?void 0:r.accounts,i=n==null?void 0:n[0],s=t.chains.find(a=>a.id===(r==null?void 0:r.chainId)),o=t.state.status;switch(o){case"connected":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}async function s9e(t,e){const{allowFailure:r=!0,chainId:n,contracts:i,...s}=e,o=t.getClient({chainId:n});return ts(o,q8e,"multicall")({allowFailure:r,contracts:i,...s})}function o9e(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,w0,"readContract")(n)}async function a9e(t,e){var a;const{allowFailure:r=!0,blockNumber:n,blockTag:i,...s}=e,o=e.contracts;try{const c={};for(const[g,v]of o.entries()){const x=v.chainId??t.state.chainId;c[x]||(c[x]=[]),(a=c[x])==null||a.push({contract:v,index:g})}const l=()=>Object.entries(c).map(([g,v])=>s9e(t,{...s,allowFailure:r,blockNumber:n,blockTag:i,chainId:Number.parseInt(g),contracts:v.map(({contract:x})=>x)})),d=(await Promise.all(l())).flat(),f=Object.values(c).flatMap(g=>g.map(({index:v})=>v));return d.reduce((g,v,x)=>(g&&(g[f[x]]=v),g),[])}catch(c){if(c instanceof CS)throw c;const l=()=>o.map(d=>o9e(t,{...d,blockNumber:n,blockTag:i}));return r?(await Promise.allSettled(l())).map(d=>d.status==="fulfilled"?{result:d.value,status:"success"}:{error:d.reason,result:void 0,status:"failure"}):await Promise.all(l())}}async function c9e(t,e){const{address:r,blockNumber:n,blockTag:i,chainId:s,token:o,unit:a="ether"}=e;if(o)try{return c$(t,{balanceAddress:r,chainId:s,symbolType:"string",tokenAddress:o})}catch(g){if(g instanceof CS){const v=await c$(t,{balanceAddress:r,chainId:s,symbolType:"bytes32",tokenAddress:o}),x=IF(Pg(v.symbol,{dir:"right"}));return{...v,symbol:x}}throw g}const c=t.getClient({chainId:s}),d=await ts(c,tz,"getBalance")(n?{address:r,blockNumber:n}:{address:r,blockTag:i}),f=t.chains.find(g=>g.id===s)??c.chain;return{decimals:f.nativeCurrency.decimals,formatted:L2(d,Yz(a)),symbol:f.nativeCurrency.symbol,value:d}}async function c$(t,e){const{balanceAddress:r,chainId:n,symbolType:i,tokenAddress:s,unit:o}=e,a={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:i}]}],address:s},[c,l,d]=await a9e(t,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[r],chainId:n},{...a,functionName:"decimals",chainId:n},{...a,functionName:"symbol",chainId:n}]}),f=L2(c??"0",Yz(o??l));return{decimals:l,formatted:f,symbol:d,value:c}}function Fv(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Fv(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!Fv(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let Ly=[];function l9e(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||Fv(Ly,e)?Ly:(Ly=e,e)}let n7=[];function u9e(t){const e=t.connectors;return Fv(n7,e)?n7:(n7=e,e)}function d9e(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,b8e,"getEnsAddress")(n)}function l$(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,$8e,"getEnsAvatar")(n)}function f9e(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,O8e,"getEnsName")(n)}async function h9e(t,e){const{account:r,chainId:n,...i}=e,s=r??F2(t).address,o=t.getClient({chainId:n});return ts(o,yS,"prepareTransactionRequest")({...i,...s?{account:s}:{}})}let i7=!1;async function u$(t,e={}){var l,d;if(i7)return[];i7=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const f of e.connectors){let g;typeof f=="function"?g=t._internal.connectors.setup(f):g=f,r.push(g)}else r.push(...t.connectors);let n;try{n=await((d=t.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((f,g)=>(i[f.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const f of s){const g=await f.getProvider().catch(()=>{});if(!g||c.some(P=>P===g)||!await f.isAuthorized())continue;const x=await f.connect({isReconnecting:!0}).catch(()=>null);x&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(P=>{const M=new Map(o?P.connections:new Map).set(f.uid,{accounts:x.accounts,chainId:x.chainId,connector:f});return{...P,current:o?P.current:f.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:f}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),i7=!1,a}async function p9e(t,e){const{account:r,chainId:n,connector:i,gas:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await j2(t,{account:r,chainId:n,connector:i});const{connector:c}=F2(t),l=await(async()=>{var g;if(!(!("data"in e)||!e.data)&&!((g=i??c)!=null&&g.supportsSimulation)&&s!==null)return s===void 0?ts(a,wS,"estimateGas")({...o,account:r,chain:n?{id:n}:null}):s})();return await ts(a,az,"sendTransaction")({...o,...r?{account:r}:{},gas:l,chain:n?{id:n}:null})}async function g9e(t,e){const{account:r,connector:n,...i}=e;let s;return typeof r=="object"&&r.type==="local"?s=t.getClient():s=await j2(t,{account:r,connector:n}),ts(s,ixe,"signMessage")({...i,...r?{account:r}:{}})}async function m9e(t,e){const{abi:r,chainId:n,connector:i,...s}=e;let o;e.account?o=e.account:o=(await j2(t,{chainId:n,connector:i})).account;const a=t.getClient({chainId:n}),c=ts(a,sxe,"simulateContract"),{result:l,request:d}=await c({...s,abi:r,account:o});return{chainId:a.chain.id,result:l,request:{__mode:"prepared",...d,chainId:n}}}async function w9e(t,e){var i;const{connector:r}=e,n=t.state.connections.get(r.uid);if(!n)throw new Qz;return await((i=t.storage)==null?void 0:i.setItem("recentConnectorId",r.id)),t.setState(s=>({...s,current:r.uid})),{accounts:n.accounts,chainId:n.chainId}}class _d extends Ac{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class v9e extends Ac{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function y9e(t,e){var o;const{addEthereumChainParameter:r,chainId:n}=e,i=t.state.connections.get(((o=e.connector)==null?void 0:o.uid)??t.state.current);if(i){const a=i.connector;if(!a.switchChain)throw new v9e({connector:a});return await a.switchChain({addEthereumChainParameter:r,chainId:n})}const s=t.chains.find(a=>a.id===n);if(!s)throw new v0;return t.setState(a=>({...a,chainId:n})),s}function b9e(t,e){const{onChange:r}=e;return t.subscribe(()=>F2(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return Fv(o,c)&&(s==null?void 0:s.id)===(a==null?void 0:a.id)&&(s==null?void 0:s.uid)===(a==null?void 0:a.uid)}})}function x9e(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}async function C9e(t,e){const{chainId:r,timeout:n=0,...i}=e,s=t.getClient({chainId:r}),a=await ts(s,nxe,"waitForTransactionReceipt")({...i,timeout:n});if(a.status==="reverted"){const l=await ts(s,Pz,"getTransaction")({hash:a.transactionHash}),f=await ts(s,SS,"call")({...l,gasPrice:l.type!=="eip1559"?l.gasPrice:void 0,maxFeePerGas:l.type==="eip1559"?l.maxFeePerGas:void 0,maxPriorityFeePerGas:l.type==="eip1559"?l.maxPriorityFeePerGas:void 0}),g=f!=null&&f.data?IF(`0x${f.data.substring(138)}`):"unknown reason";throw new Error(g)}return{...a,chainId:s.chain.id}}async function _9e(t,e){const{account:r,chainId:n,connector:i,__mode:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await j2(t,{account:r,chainId:n,connector:i});const{connector:c}=F2(t);let l;if(s==="prepared"||c!=null&&c.supportsSimulation)l=o;else{const{request:g}=await m9e(t,{...o,account:r,chainId:n});l=g}return await ts(a,oxe,"writeContract")({...l,...r?{account:r}:{},chain:n?{id:n}:null})}const A9e=/(rabby|trustwallet)/,E9e={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:wb(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return wb(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const r=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const n of r)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,r;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(r=t.phantom)==null?void 0:r.ethereum:wb(t,"isPhantom")}}};H4.type="injected";function H4(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:r}=t;function n(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...E9e[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l==null?void 0:l.ethereum}}}let i,s,o,a;return c=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},get supportsSimulation(){return A9e.test(this.id.toLowerCase())},type:H4.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&t.target&&(o||(o=this.onConnect.bind(this),l.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:d}={}){var v,x,P,M,N,E;const f=await this.getProvider();if(!f)throw new _d;let g=[];if(d)g=await this.getAccounts().catch(()=>[]);else if(e)try{g=(M=(P=(x=(v=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:v.caveats)==null?void 0:x[0])==null?void 0:P.value)==null?void 0:M.map(L=>Vs(L)),g.length>0&&(g=await this.getAccounts())}catch($){const L=$;if(L.code===pn.code)throw new pn(L);if(L.code===Xd.code)throw L}try{!(g!=null&&g.length)&&!d&&(g=(await f.request({method:"eth_requestAccounts"})).map(j=>Vs(j))),o&&(f.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),f.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a));let $=await this.getChainId();if(l&&$!==l){const L=await this.switchChain({chainId:l}).catch(j=>{if(j.code===pn.code)throw j;return{id:$}});$=(L==null?void 0:L.id)??$}return e&&await((N=c.storage)==null?void 0:N.removeItem(`${this.id}.disconnected`)),t.target||await((E=c.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:g,chainId:$}}catch($){const L=$;throw L.code===pn.code?new pn(L):L.code===Xd.code?new Xd(L):L}},async disconnect(){var d,f;const l=await this.getProvider();if(!l)throw new _d;s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o));try{await Nz(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((d=c.storage)==null?void 0:d.setItem(`${this.id}.disconnected`,!0)),t.target||await((f=c.storage)==null?void 0:f.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new _d;return(await l.request({method:"eth_accounts"})).map(f=>Vs(f))},async getChainId(){const l=await this.getProvider();if(!l)throw new _d;const d=await l.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let l;const d=n();return typeof d.provider=="function"?l=d.provider(window):typeof d.provider=="string"?l=wb(window,d.provider):l=d.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){var l,d;try{if(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!t.target&&!await((d=c.storage)==null?void 0:d.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(r!==void 0&&r!==!1){const x=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",x),!!await this.getProvider()),P=typeof r=="number"?r:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(N=>window.addEventListener("ethereum#initialized",()=>N(x()),{once:!0}))]:[],new Promise(N=>setTimeout(()=>N(x()),P))]))return!0}throw new _d}return!!(await i6(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){var v,x,P,M;const f=await this.getProvider();if(!f)throw new _d;const g=c.chains.find(N=>N.id===d);if(!g)throw new no(new v0);try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),new Promise(N=>c.emitter.once("change",({chainId:E})=>{E===d&&N()}))]),g}catch(N){const E=N;if(E.code===4902||((x=(v=E==null?void 0:E.data)==null?void 0:v.originalError)==null?void 0:x.code)===4902)try{const{default:$,...L}=g.blockExplorers??{};let j;l!=null&&l.blockExplorerUrls?j=l.blockExplorerUrls:$&&(j=[$.url,...Object.values(L).map(B=>B.url)]);let H;(P=l==null?void 0:l.rpcUrls)!=null&&P.length?H=l.rpcUrls:H=[((M=g.rpcUrls.default)==null?void 0:M.http[0])??""];const I={blockExplorerUrls:j,chainId:gr(d),chainName:(l==null?void 0:l.chainName)??g.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??g.nativeCurrency,rpcUrls:H};if(await f.request({method:"wallet_addEthereumChain",params:[I]}),await this.getChainId()!==d)throw new pn(new Error("User rejected switch after adding network."));return g}catch($){throw new pn($)}throw E.code===pn.code?new pn(E):new no(E)}},async onAccountsChanged(l){var d;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f}),e&&await((d=c.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(f=>Vs(f))})},onChainChanged(l){const d=Number(l);c.emitter.emit("change",{chainId:d})},async onConnect(l){const d=await this.getAccounts();if(d.length===0)return;const f=Number(l.chainId);c.emitter.emit("connect",{accounts:d,chainId:f});const g=await this.getProvider();g&&(o&&(g.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),g.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),g.on("disconnect",a)))},async onDisconnect(l){const d=await this.getProvider();l&&l.code===1013&&d&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),d&&(s&&(d.removeListener("chainChanged",s),s=void 0),a&&(d.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),d.on("connect",o))))}})}function wb(t,e){function r(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const n=t.ethereum;if(n!=null&&n.providers)return n.providers.find(i=>r(i));if(n&&r(n))return n}class S9e{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new Exe})}on(e,r){this._emitter.on(e,r)}once(e,r){this._emitter.once(e,r)}off(e,r){this._emitter.off(e,r)}emit(e,...r){const n=r[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function I9e(t){return new S9e(t)}function T9e(t,e){return JSON.parse(t,(r,n)=>{let i=n;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(r,i))??i})}function d$(t,e){return t.slice(0,e).join(".")||"."}function f$(t,e){const{length:r}=t;for(let n=0;n{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},n),r??void 0)}function P9e(t){const{deserialize:e=T9e,key:r="wagmi",serialize:n=R9e,storage:i=Jz}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:r,async getItem(o,a){const c=i.getItem(`${r}.${o}`),l=await s(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${r}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,n(a)))},async removeItem(o){await s(i.removeItem(`${r}.${o}`))}}}const Jz={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},O_=256;let By=O_,Uy;function N9e(t=11){if(!Uy||By+t>O_*2){Uy="",By=0;for(let e=0;es.chains),c=t7(()=>[...s.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(d))??[]].map(l));function l(j){var T;const H=I9e(N9e()),I={...j({emitter:H,chains:a.getState(),storage:r,transports:s.transports}),emitter:H,uid:H.uid};return H.on("connect",$),(T=I.setup)==null||T.call(I),I}function d(j){const{info:H}=j,I=j.provider;return H4({target:{...H,id:H.rdns,provider:I}})}const f=new Map;function g(j={}){const H=j.chainId??M.getState().chainId,I=a.getState().find(B=>B.id===H);if(j.chainId&&!I)throw new v0;{const B=f.get(M.getState().chainId);if(B&&!I)return B;if(!I)throw new v0}{const B=f.get(H);if(B)return B}let T;if(s.client)T=s.client({chain:I});else{const B=I.id,K=a.getState().map(p=>p.id),U={},C=Object.entries(s);for(const[p,m]of C)if(!(p==="chains"||p==="client"||p==="connectors"||p==="transports"))if(typeof m=="object")if(B in m)U[p]=m[B];else{if(K.some(_=>_ in m))continue;U[p]=m}else U[p]=m;T=$z({...U,chain:I,batch:U.batch??{multicall:!0},transport:p=>s.transports[B]({...p,connectors:c})})}return f.set(H,T),T}function v(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let x;const P="0.0.0-canary-";mb.startsWith(P)?x=Number.parseInt(mb.replace(P,"")):x=Number.parseInt(mb.split(".")[0]??"0");const M=t7(wxe(r?Cxe(v,{migrate(j,H){if(H===x)return j;const I=v(),T=N(j,I.chainId);return{...I,chainId:T}},name:"store",partialize(j){return{connections:{__type:"Map",value:Array.from(j.connections.entries()).map(([H,I])=>{const{id:T,name:B,type:K,uid:U}=I.connector;return[H,{...I,connector:{id:T,name:B,type:K,uid:U}}]})},chainId:j.chainId,current:j.current}},merge(j,H){typeof j=="object"&&j&&"status"in j&&delete j.status;const I=N(j,H.chainId);return{...H,...j,chainId:I}},skipHydration:i,storage:r,version:x}):v));function N(j,H){return j&&typeof j=="object"&&"chainId"in j&&typeof j.chainId=="number"&&a.getState().some(I=>I.id===j.chainId)?j.chainId:H}n&&M.subscribe(({connections:j,current:H})=>{var I;return H?(I=j.get(H))==null?void 0:I.chainId:void 0},j=>{if(a.getState().some(I=>I.id===j))return M.setState(I=>({...I,chainId:j??I.chainId}))}),o==null||o.subscribe(j=>{const H=new Map;for(const T of c.getState())H.set(T.id,!0);const I=[];for(const T of j){const B=l(d(T));H.has(B.id)||I.push(B)}r&&!M.persist.hasHydrated()||c.setState(T=>[...T,...I],!0)});function E(j){M.setState(H=>{const I=H.connections.get(j.uid);return I?{...H,connections:new Map(H.connections).set(j.uid,{accounts:j.accounts??I.accounts,chainId:j.chainId??I.chainId,connector:I.connector})}:H})}function $(j){M.getState().status==="connecting"||M.getState().status==="reconnecting"||M.setState(H=>{const I=c.getState().find(T=>T.uid===j.uid);return I?(I.emitter.listenerCount("connect")&&I.emitter.off("connect",E),I.emitter.listenerCount("change")||I.emitter.on("change",E),I.emitter.listenerCount("disconnect")||I.emitter.on("disconnect",L),{...H,connections:new Map(H.connections).set(j.uid,{accounts:j.accounts,chainId:j.chainId,connector:I}),current:j.uid,status:"connected"}):H})}function L(j){M.setState(H=>{const I=H.connections.get(j.uid);if(I){const B=I.connector;B.emitter.listenerCount("change")&&I.connector.emitter.off("change",E),B.emitter.listenerCount("disconnect")&&I.connector.emitter.off("disconnect",L),B.emitter.listenerCount("connect")||I.connector.emitter.on("connect",$)}if(H.connections.delete(j.uid),H.connections.size===0)return{...H,connections:new Map,current:null,status:"disconnected"};const T=H.connections.values().next().value;return{...H,connections:new Map(H.connections),current:T.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:r,getClient:g,get state(){return M.getState()},setState(j){let H;typeof j=="function"?H=j(M.getState()):H=j;const I=v();typeof H!="object"&&(H=I),Object.keys(I).some(B=>!(B in H))&&(H=I),M.setState(H,!0)},subscribe(j,H,I){return M.subscribe(j,H,I?{...I,fireImmediately:I.emitImmediately}:void 0)},_internal:{mipd:o,store:M,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(j){const H=typeof j=="function"?j(a.getState()):j;if(H.length!==0)return a.setState(H,!0)},subscribe(j){return a.subscribe(j)}},connectors:{providerDetailToConnector:d,setup:l,setState(j){return c.setState(typeof j=="function"?j(c.getState()):j,!0)},subscribe(j){return c.subscribe(j)}},events:{change:E,connect:$,disconnect:L}}}}const h$=J8e({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});async function $9e(t){var i;if(!t)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const e=await(t==null?void 0:t.getProvider()),r=(i=e==null?void 0:e.session)==null?void 0:i.namespaces,n=[];return r&&Object.keys(r).forEach(s=>{var a;const o=(a=r==null?void 0:r[s])==null?void 0:a.chains;o&&n.push(...o)}),{supportsAllNetworks:!0,approvedCaipNetworkIds:n}}function O9e(){return{supportsAllNetworks:!0,approvedCaipNetworkIds:ha.WalletConnectRpcChainIds.map(t=>`${cr.EIP155}:${t}`)}}function D9e({chain:t,projectId:e}){var i,s;const r=Ue.getBlockchainApiUrl(),n=(s=(i=t.rpcUrls[0])==null?void 0:i.http)==null?void 0:s[0];return ha.WalletConnectRpcChainIds.includes(t.id)?cxe([X9(`${r}/v1/?chainId=${cr.EIP155}:${t.id}&projectId=${e}`,{fetchOptions:{headers:{"Content-Type":"text/plain"}}}),X9(n)]):X9(n)}function p$(t){if(!t)throw new Error("No CAIP address provided");const e=t.split(":")[2];if(!e)throw new Error("Invalid CAIP address");return e}function Xz(t){return t.map(r=>({blockExplorers:{default:{apiUrl:"",name:"",url:r.explorerUrl||""}},fees:void 0,formatters:void 0,id:Number(r.chainId),name:r.name,nativeCurrency:{decimals:18,name:r.currency,symbol:r.currency},rpcUrls:{default:{http:[r.rpcUrl]}},serializers:void 0}))}var L9e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy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SlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const g$=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),m$=4;function B9e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let j=1;j>--c&1}const f=31,g=2**f,v=g>>>1,x=v>>1,P=g-1;let M=0;for(let j=0;j1;){let K=H+I>>>1;j>>1|d(),T=T<<1^v,B=(B^v)<<1|v|1;E=T,$=1+B-T}let L=n-4;return N.map(j=>{switch(j-L){case 3:return L+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return L+256+(t[a++]<<8|t[a++]);case 1:return L+t[a++];default:return j-1}})}function U9e(t){let e=0;return()=>t[e++]}function eW(t){return U9e(B9e(j9e(t)))}function j9e(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function F9e(t){return t&1?~t>>1:t>>1}function z9e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=zv(t);if(e.length)return e})}function rW(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(W9e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(H9e(r,t))}return e.flat()}function Wv(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function nW(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function W9e(t,e){let r=1+e(),n=e(),i=Wv(e);return nW(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((d,f)=>{let g=f*n;return[c+f*r,l.map(v=>v+g)]})})}function H9e(t,e){let r=1+e();return nW(r,1+t,e).map(i=>[i[0],i.slice(1)])}function q9e(t){let e=[],r=zv(t);return i(n([]),[]),e;function n(s){let o=t(),a=Wv(()=>{let c=zv(t).map(l=>r[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let d of l.Q)i(l,[...a,d],c)}}}function V9e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function iW(t){return`{${V9e(t)}}`}function K9e(t){let e=[];for(let r=0,n=t.length;r>24&255}function aW(t){return t&16777215}let D_,w$,L_,vb;function t7e(){let t=eW(Z9e);D_=new Map(tW(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),w$=new Set(zv(t)),L_=new Map,vb=new Map;for(let[e,r]of rW(t)){if(!w$.has(e)&&r.length==2){let[n,i]=r,s=vb.get(n);s||(s=new Map,vb.set(n,s)),s.set(i,e)}L_.set(e,r.reverse())}}function cW(t){return t>=Hv&&t=a6&&t=c6&&el6&&e0&&i(l6+l)}else{let o=L_.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Bm(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=r7e(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function uW(t){return lW(t).map(aW)}function i7e(t){return n7e(lW(t))}const v$=45,dW=".",fW=65039,hW=1,Dp=t=>Array.from(t);function qv(t,e){return t.P.has(e)||t.Q.has(e)}class s7e extends Array{get is_emoji(){return!0}}let B_,pW,yh,U_,gW,Xp,s7,vp,mW,y$,j_;function PS(){if(B_)return;let t=eW(L9e);const e=()=>zv(t),r=()=>new Set(e());B_=new Map(rW(t)),pW=r(),yh=e(),U_=new Set(e().map(d=>yh[d])),yh=new Set(yh),gW=r(),r();let n=tW(t),i=t();const s=()=>new Set(e().flatMap(d=>n[d]).concat(e()));Xp=Wv(d=>{let f=Wv(t).map(g=>g+96);if(f.length){let g=d>=i;f[0]-=32,f=X1(f),g&&(f=`Restricted[${f}]`);let v=s(),x=s(),P=!t();return{N:f,P:v,Q:x,M:P,R:g}}}),s7=r(),vp=new Map;let o=e().concat(Dp(s7)).sort((d,f)=>d-f);o.forEach((d,f)=>{let g=t(),v=o[f]=g?o[f-g]:{V:[],M:new Map};v.V.push(d),s7.has(d)||vp.set(d,v)});for(let{V:d,M:f}of new Set(vp.values())){let g=[];for(let x of d){let P=Xp.filter(N=>qv(N,x)),M=g.find(({G:N})=>P.some(E=>N.has(E)));M||(M={G:new Set,V:[]},g.push(M)),M.V.push(x),P.forEach(N=>M.G.add(N))}let v=g.flatMap(x=>Dp(x.G));for(let{G:x,V:P}of g){let M=new Set(v.filter(N=>!x.has(N)));for(let N of P)f.set(N,M)}}let a=new Set,c=new Set;const l=d=>a.has(d)?c.add(d):a.add(d);for(let d of Xp){for(let f of d.P)l(f);for(let f of d.Q)l(f)}for(let d of a)!vp.has(d)&&!c.has(d)&&vp.set(d,hW);mW=new Set(Dp(a).concat(Dp(uW(a)))),y$=q9e(t).map(d=>s7e.from(d)).sort(G9e),j_=new Map;for(let d of y$){let f=[j_];for(let g of d){let v=f.map(x=>{let P=x.get(g);return P||(P=new Map,x.set(g,P)),P});g===fW?f.push(...v):f=v}for(let g of f)g.V=d}}function NS(t){return(wW(t)?"":`${MS(q4([t]))} `)+iW(t)}function MS(t){return`"${t}"‎`}function o7e(t){if(t.length>=4&&t[2]==v$&&t[3]==v$)throw new Error(`invalid label extension: "${X1(t.slice(0,4))}"`)}function a7e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function c7e(t){let e=t[0],r=g$.get(e);if(r)throw aw(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=K9e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=m7e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let d=o.output=a.flat();if(a7e(d),!(o.emoji=c>1||a[0].is_emoji)&&d.every(g=>g<128))o7e(d),l="ASCII";else{let g=a.flatMap(v=>v.is_emoji?[]:v);if(!g.length)l="Emoji";else{if(yh.has(d[0]))throw aw("leading combining mark");for(let P=1;Po.has(a)):Dp(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>qv(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function h7e(t){let e=Xp;for(let r of t){let n=e.filter(i=>qv(i,r));if(!n.length)throw Xp.some(i=>qv(i,r))?yW(e[0],r):vW(r);if(e=n,n.length==1)break}return e}function p7e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${MS(q4(e))}: ${i}`)}return X1(n)}).join(dW)}function vW(t){return new Error(`disallowed character: ${NS(t)}`)}function yW(t,e){let r=NS(e),n=Xp.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function aw(t){return new Error(`illegal placement: ${t}`)}function g7e(t,e){for(let r of e)if(!qv(t,r))throw yW(t,r);if(t.M){let r=uW(e);for(let n=1,i=r.length;nm$)throw new Error(`excessive non-spacing marks: ${MS(q4(r.slice(n-1,s)))} (${s-n}/${m$})`);n=s}}}function m7e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=v7e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(mW.has(o))i.push(o);else{let a=B_.get(o);if(a)i.push(...a);else if(!pW.has(o))throw vW(o)}}}return i.length&&n.push(e(i)),n}function w7e(t){return t.filter(e=>e!=fW)}function v7e(t,e){let r=j_,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}function b$(t){return u7e(t)}$S.type="walletConnect";function $S(t,e){const r=t.isNewChainsStale??!0;let n,i,s,o,a,c,l,d;return f=>({id:"walletConnect",name:"WalletConnect",type:$S.type,async setup(){const g=await this.getProvider().catch(()=>null);g&&(a||(a=this.onConnect.bind(this),g.on("connect",a)),l||(l=this.onSessionDelete.bind(this),g.on("session_delete",l)))},async connect({...g}={}){try{const v=await this.getProvider();if(!v)throw new _d;c||(c=this.onDisplayUri,v.on("display_uri",c));const x=await this.isChainsStale();if(v.session&&x&&await v.disconnect(),!v.session||x){const N=Jj.createNamespaces(t.networks);await v.connect({optionalNamespaces:N,..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(t.networks.map(E=>Number(E.chainId)))}const P=(await v.enable()).map(N=>Vs(N)),M=await this.getChainId();return c&&(v.removeListener("display_uri",c),c=void 0),a&&(v.removeListener("connect",a),a=void 0),s||(s=this.onAccountsChanged.bind(this),v.on("accountsChanged",s)),o||(o=this.onChainChanged.bind(this),v.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),v.on("disconnect",d)),l||(l=this.onSessionDelete.bind(this),v.on("session_delete",l)),{accounts:P,chainId:M}}catch(v){throw/(user rejected|connection request reset)/i.test(v==null?void 0:v.message)?new pn(v):v}},async disconnect(){const g=await this.getProvider();try{await(g==null?void 0:g.disconnect())}catch(v){if(!/No matching key/i.test(v.message))throw v}finally{o&&(g==null||g.removeListener("chainChanged",o),o=void 0),d&&(g==null||g.removeListener("disconnect",d),d=void 0),a||(a=this.onConnect.bind(this),g==null||g.on("connect",a)),s&&(g==null||g.removeListener("accountsChanged",s),s=void 0),l&&(g==null||g.removeListener("session_delete",l),l=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var P,M,N;const g=await this.getProvider();if(!((P=g==null?void 0:g.session)!=null&&P.namespaces))return[];const v=(N=(M=g==null?void 0:g.session)==null?void 0:M.namespaces.eip155)==null?void 0:N.accounts;return(v==null?void 0:v.map(E=>E.split(":")[2]))??[]},async getProvider({chainId:g}={}){var P,M,N;async function v(){var L;if(!t.networks.map(j=>Number(j.chainId)).length)return;const $=(L=e.universalAdapter)==null?void 0:L.getWalletConnectProvider();if(!$)throw new Error("Provider not found");return $}n||(i||(i=v()),n=await i,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY));const x=(P=e.getCaipNetwork())==null?void 0:P.chainId;if(g&&x!==g){const E=vr.getStoredActiveCaipNetwork();E&&E.chainNamespace==="eip155"?await((M=this.switchChain)==null?void 0:M.call(this,{chainId:Number(E.chainId)})):await((N=this.switchChain)==null?void 0:N.call(this,{chainId:g}))}return n},async getChainId(){var M,N,E,$;const g=(M=e.getCaipNetwork())==null?void 0:M.chainId;if(g)return g;const x=($=(E=(N=(await this.getProvider()).session)==null?void 0:N.namespaces.eip155)==null?void 0:E.chains)==null?void 0:$[0],P=t.networks.find(L=>L.id===x);return P==null?void 0:P.chainId},async isAuthorized(){try{const[g,v]=await Promise.all([this.getAccounts(),this.getProvider()]);return g.length?await this.isChainsStale()&&v.session?(await v.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:g,chainId:v}){var N,E;const x=await this.getProvider();if(!x)throw new _d;const P=t.networks.find($=>$.chainId===v),[M]=P?Xz([P]):[];if(!M)throw new no(new v0);try{P!=null&&P.id&&x.setDefaultChain(P==null?void 0:P.id),await x.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(v)}]}),f.emitter.emit("change",{chainId:Number(v)});const $=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...$,v]),M}catch($){const L=$;if(/(?:user rejected)/iu.test(L.message))throw new pn(L);try{let j;g!=null&&g.blockExplorerUrls?j=g.blockExplorerUrls:j=(N=M.blockExplorers)!=null&&N.default.url?[(E=M.blockExplorers)==null?void 0:E.default.url]:[];const H={blockExplorerUrls:j,chainId:gr(v),chainName:M.name,iconUrls:g==null?void 0:g.iconUrls,nativeCurrency:M.nativeCurrency,rpcUrls:M.rpcUrls.default.http};await x.request({method:"wallet_addEthereumChain",params:[H]});const I=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...I,v]),M}catch(j){throw new pn(j)}}},onAccountsChanged(g){g.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:g.map(v=>Vs(v))})},onChainChanged(g){const v=Number(g);f.emitter.emit("change",{chainId:v})},async onConnect(g){const v=Number(g.chainId),x=await this.getAccounts();f.emitter.emit("connect",{accounts:x,chainId:v})},async onDisconnect(g){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const v=await this.getProvider();s&&(v.removeListener("accountsChanged",s),s=void 0),o&&(v.removeListener("chainChanged",o),o=void 0),d&&(v.removeListener("disconnect",d),d=void 0),l&&(v.removeListener("session_delete",l),l=void 0),a||(a=this.onConnect.bind(this),v.on("connect",a))},onDisplayUri(g){f.emitter.emit("message",{type:"display_uri",data:g})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var x,P,M;if(!((x=n==null?void 0:n.session)!=null&&x.namespaces))return[];const g=(M=(P=n==null?void 0:n.session)==null?void 0:P.namespaces.eip155)==null?void 0:M.accounts;return(g==null?void 0:g.map(N=>Number.parseInt(N.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var v;const g=await((v=f.storage)==null?void 0:v.getItem(this.requestedChainsStorageKey))??[];return[...new Set(g)]},async isChainsStale(){if(!r)return!1;const g=f.chains.map(P=>P.id),v=this.getNamespaceChainsIds();if(v.length&&!v.some(P=>g.includes(P)))return!1;const x=await this.getRequestedChainsIds();return!g.every(P=>x.includes(Number(P)))},async setRequestedChainsIds(g){var v;await((v=f.storage)==null?void 0:v.setItem(this.requestedChainsStorageKey,g))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}V4.type="coinbaseWallet";function V4(t={}){return t.version==="3"||t.headlessMode?b7e(t):y7e(t)}function y7e(t){let e,r,n,i,s;return o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:V4.type,async connect({chainId:a}={}){try{const c=await this.getProvider(),l=(await c.request({method:"eth_requestAccounts"})).map(f=>Vs(f));n||(n=this.onAccountsChanged.bind(this),c.on("accountsChanged",n)),i||(i=this.onChainChanged.bind(this),c.on("chainChanged",i)),s||(s=this.onDisconnect.bind(this),c.on("disconnect",s));let d=await this.getChainId();if(a&&d!==a){const f=await this.switchChain({chainId:a}).catch(g=>{if(g.code===pn.code)throw g;return{id:d}});d=(f==null?void 0:f.id)??d}return{accounts:l,chainId:d}}catch(c){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(c.message)?new pn(c):c}},async disconnect(){var c;const a=await this.getProvider();n&&(a.removeListener("accountsChanged",n),n=void 0),i&&(a.removeListener("chainChanged",i),i=void 0),s&&(a.removeListener("disconnect",s),s=void 0),a.disconnect(),(c=a.close)==null||c.call(a)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>Vs(c))},async getChainId(){const c=await(await this.getProvider()).request({method:"eth_chainId"});return Number(c)},async getProvider(){if(!r){const a=await(async()=>{const{default:c}=await Qs(async()=>{const{default:l}=await import("./index-C9IGeZlS.js").then(d=>d.i);return{default:l}},__vite__mapDeps([2,3]));return typeof c!="function"&&typeof c.default=="function"?c.default:c})();e=new a({...t,appChainIds:o.chains.map(c=>c.id)}),r=e.makeWeb3Provider({...t,options:t.preference??"all"})}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:c}){var f,g,v,x;const l=o.chains.find(P=>P.id===c);if(!l)throw new no(new v0);const d=await this.getProvider();try{return await d.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(l.id)}]}),l}catch(P){if(P.code===4902)try{let M;a!=null&&a.blockExplorerUrls?M=a.blockExplorerUrls:M=(f=l.blockExplorers)!=null&&f.default.url?[(g=l.blockExplorers)==null?void 0:g.default.url]:[];let N;(v=a==null?void 0:a.rpcUrls)!=null&&v.length?N=a.rpcUrls:N=[((x=l.rpcUrls.default)==null?void 0:x.http[0])??""];const E={blockExplorerUrls:M,chainId:gr(c),chainName:(a==null?void 0:a.chainName)??l.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??l.nativeCurrency,rpcUrls:N};return await d.request({method:"wallet_addEthereumChain",params:[E]}),l}catch(M){throw new pn(M)}throw new no(P)}},onAccountsChanged(a){a.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:a.map(c=>Vs(c))})},onChainChanged(a){const c=Number(a);o.emitter.emit("change",{chainId:c})},async onDisconnect(a){o.emitter.emit("disconnect");const c=await this.getProvider();n&&(c.removeListener("accountsChanged",n),n=void 0),i&&(c.removeListener("chainChanged",i),i=void 0),s&&(c.removeListener("disconnect",s),s=void 0)}})}function b7e(t){let r,n,i,s,o;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:V4.type,async connect({chainId:c}={}){try{const l=await this.getProvider(),d=(await l.request({method:"eth_requestAccounts"})).map(g=>Vs(g));i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),l.on("chainChanged",s)),o||(o=this.onDisconnect.bind(this),l.on("disconnect",o));let f=await this.getChainId();if(c&&f!==c){const g=await this.switchChain({chainId:c}).catch(v=>{if(v.code===pn.code)throw v;return{id:f}});f=(g==null?void 0:g.id)??f}return{accounts:d,chainId:f}}catch(l){throw/(user closed modal|accounts received is empty|user denied account)/i.test(l.message)?new pn(l):l}},async disconnect(){const c=await this.getProvider();i&&(c.removeListener("accountsChanged",i),i=void 0),s&&(c.removeListener("chainChanged",s),s=void 0),o&&(c.removeListener("disconnect",o),o=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>Vs(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){var c;if(!n){const l=await(async()=>{const{default:x}=await Qs(async()=>{const{default:P}=await import("./index-DJ_EjEfy.js").then(M=>M.i);return{default:P}},__vite__mapDeps([4,3]));return typeof x!="function"&&typeof x.default=="function"?x.default:x})();r=new l({...t,reloadOnDisconnect:!1});const d=(c=r.walletExtension)==null?void 0:c.getChainId(),f=a.chains.find(x=>t.chainId?x.id===t.chainId:x.id===d)||a.chains[0],g=t.chainId||(f==null?void 0:f.id),v=t.jsonRpcUrl||(f==null?void 0:f.rpcUrls.default.http[0]);n=r.makeWeb3Provider(v,g)}return n},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:l}){var g,v,x,P;const d=a.chains.find(M=>M.id===l);if(!d)throw new no(new v0);const f=await this.getProvider();try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(d.id)}]}),d}catch(M){if(M.code===4902)try{let N;c!=null&&c.blockExplorerUrls?N=c.blockExplorerUrls:N=(g=d.blockExplorers)!=null&&g.default.url?[(v=d.blockExplorers)==null?void 0:v.default.url]:[];let E;(x=c==null?void 0:c.rpcUrls)!=null&&x.length?E=c.rpcUrls:E=[((P=d.rpcUrls.default)==null?void 0:P.http[0])??""];const $={blockExplorerUrls:N,chainId:gr(l),chainName:(c==null?void 0:c.chainName)??d.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??d.nativeCurrency,rpcUrls:E};return await f.request({method:"wallet_addEthereumChain",params:[$]}),d}catch(N){throw new pn(N)}throw new no(M)}},onAccountsChanged(c){c.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:c.map(l=>Vs(l))})},onChainChanged(c){const l=Number(c);a.emitter.emit("change",{chainId:l})},async onDisconnect(c){a.emitter.emit("disconnect");const l=await this.getProvider();i&&(l.removeListener("accountsChanged",i),i=void 0),s&&(l.removeListener("chainChanged",s),s=void 0),o&&(l.removeListener("disconnect",o),o=void 0)}})}class cw{constructor(){}static getInstance(e,r){return cw.instance||(cw.instance=new Ere(e,r)),cw.instance}}function x7e(t){function e(r){return Ya.parseEvmChainId(r)||1}return r=>({id:cr.AUTH_CONNECTOR_ID,name:"AppKit Auth",type:"w3mAuth",chain:xn.CHAIN.EVM,async connect(n={}){const i=await this.getProvider();let s=n.chainId;if(n.isReconnecting&&(s=i.getLastUsedChainId(),!s))throw new Error("ChainId not found in provider");const{address:o,chainId:a}=await i.connect({chainId:s});await i.getSmartAccountEnabledNetworks();const c=e(a);return{accounts:[o],account:o,chainId:c,chain:{id:c,unsuported:!1}}},async disconnect(){await(await this.getProvider()).disconnect()},async getAccounts(){const n=await this.getProvider(),{address:i}=await n.connect();return r.emitter.emit("change",{accounts:[i]}),[i]},async getProvider(){return this.provider||(this.provider=cw.getInstance(t.options.projectId)),Promise.resolve(this.provider)},async getChainId(){const n=await this.getProvider(),{chainId:i}=await n.getChainId();return e(i)},async isAuthorized(){const n=await this.getProvider(),{isConnected:i}=await n.isConnected();return i},async switchChain({chainId:n}){try{const i=r.chains.find(a=>a.id===n);if(!i)throw new no(new Error("chain not found on connector."));const o=await(await this.getProvider()).connect({chainId:n});return r.emitter.emit("change",{chainId:Number(n),accounts:[o.address]}),i}catch(i){throw i instanceof Error?new no(i):i}},onAccountsChanged(n){n.length===0?this.onDisconnect():r.emitter.emit("change",{accounts:n.map(Vs)})},onChainChanged(n){const i=Number(n);r.emitter.emit("change",{chainId:i})},async onDisconnect(n){await(await this.getProvider()).disconnect()}})}const C7e=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class _7e{constructor(e){var s,o,a;this.appKit=void 0,this.options=void 0,this.chainNamespace=xn.CHAIN.EVM,this.defaultCaipNetwork=void 0,this.tokens=PR.getCaipTokens((s=this.options)==null?void 0:s.tokens),this.siweControllerClient=(o=this.options)==null?void 0:o.siweConfig,this.adapterType="wagmi",this.caipNetworks=e.networks.map(c=>({...c,rpcUrl:Tw.extendRpcUrlWithProjectId(c.rpcUrl,e.projectId)})),this.wagmiChains=Xz(this.caipNetworks.filter(c=>c.chainNamespace===xn.CHAIN.EVM));const r=this.wagmiChains.map(c=>[c.id,D9e({chain:c,projectId:e.projectId})]),n=Object.fromEntries(r),i=[...e.connectors??[]];this.wagmiConfig=M9e({...this.createConfigParams,chains:this.wagmiChains,transports:n,connectors:[...i,...((a=this.createConfigParams)==null?void 0:a.connectors)??[]]})}setCustomConnectors(e,r){var o,a,c,l,d,f,g;const n=[];e.enableWalletConnect!==!1&&n.push($S(e,r)),e.enableInjected!==!1&&n.push(H4({shimDisconnect:!0})),e.enableCoinbase!==!1&&n.push(V4({version:"4",appName:((o=e.metadata)==null?void 0:o.name)??"Unknown",appLogoUrl:((a=e.metadata)==null?void 0:a.icons[0])??"Unknown",preference:e.coinbasePreference??"all"}));const i=((c=e.features)==null?void 0:c.email)===void 0?Tn.DEFAULT_FEATURES.email:(l=e.features)==null?void 0:l.email,s=(d=e.features)!=null&&d.socials?((g=(f=e.features)==null?void 0:f.socials)==null?void 0:g.length)>0:Tn.DEFAULT_FEATURES.socials;(i||s)&&n.push(x7e({chains:this.wagmiChains,options:{projectId:e.projectId}})),n.forEach(v=>{const x=this.wagmiConfig._internal.connectors.setup(v);this.wagmiConfig._internal.connectors.setState(P=>[...P,x])})}construct(e,r){var n,i,s;if(!r.projectId)throw new Error("appkit:initialize - projectId is undefined");if(this.appKit=e,this.options=r,this.caipNetworks=r.networks,this.defaultCaipNetwork=r.defaultNetwork||r.networks[0],this.tokens=PR.getCaipTokens(r.tokens),this.setCustomConnectors(r,e),!this.wagmiConfig)throw new Error("appkit:wagmiConfig - is undefined");this.networkControllerClient={switchCaipNetwork:async o=>{const a=Number(Ya.caipNetworkIdToNumber(o==null?void 0:o.id));a&&this.wagmiConfig&&await y9e(this.wagmiConfig,{chainId:a})},getApprovedCaipNetworksData:async()=>{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");return new Promise(o=>{var l,d;const c=new Map(this.wagmiConfig.state.connections).get(this.wagmiConfig.state.current||"");if(((l=c==null?void 0:c.connector)==null?void 0:l.id)===cr.AUTH_CONNECTOR_ID)o(O9e());else if(((d=c==null?void 0:c.connector)==null?void 0:d.id)===cr.WALLET_CONNECT_CONNECTOR_ID){const f=this.wagmiConfig.connectors.find(g=>g.id===cr.WALLET_CONNECT_CONNECTOR_ID);o($9e(f))}o({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})}},this.connectionControllerClient={connectWalletConnect:async()=>{var x,P,M,N,E,$,L,j,H,I,T,B;if(!this.wagmiConfig)throw new Error("connectionControllerClient:getWalletConnectUri - wagmiConfig is undefined");const o=this.wagmiConfig.connectors.find(K=>K.id===cr.WALLET_CONNECT_CONNECTOR_ID);if(!o)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");const a=await o.getProvider(),c=await((M=(P=(x=this.options)==null?void 0:x.siweConfig)==null?void 0:P.getMessageParams)==null?void 0:M.call(P)),l=($=(E=(N=this.options)==null?void 0:N.siweConfig)==null?void 0:E.options)==null?void 0:$.enabled,d=typeof(a==null?void 0:a.authenticate)=="function",f=c&&Object.keys(c||{}).length>0,g=(L=this.options)==null?void 0:L.siweConfig;if(l&&d&&f&&g){await o.setRequestedChainsIds(c.chains);const{SIWEController:K,getDidChainId:U,getDidAddress:C}=await Qs(async()=>{const{SIWEController:_,getDidChainId:R,getDidAddress:S}=await import("./index-hDIYmWL4.js");return{SIWEController:_,getDidChainId:R,getDidAddress:S}},[]),p=(j=this.caipNetworks)==null?void 0:j.filter(_=>_.chainNamespace==="eip155").map(_=>_.id);c.chains=(H=this.caipNetworks)==null?void 0:H.filter(_=>_.chainNamespace==="eip155").map(_=>_.chainId);const m=await a.authenticate({nonce:await g.getNonce(),methods:[...C7e],...c,chains:p}),w=(I=m==null?void 0:m.auths)==null?void 0:I[0];if(w){const{p:_,s:R}=w,S=U(_.iss),k=C(_.iss);k&&S&&K.setSession({address:k,chainId:parseInt(S,10)});try{const y=a.client.formatAuthMessage({request:_,iss:_.iss});await K.verifyMessage({message:y,signature:R.s,cacao:w})}catch(y){throw console.error("Error verifying message",y),await a.disconnect().catch(console.error),await K.signOut().catch(console.error),y}}}const v=Number(Ya.caipNetworkIdToNumber((B=(T=this.appKit)==null?void 0:T.getCaipNetwork())==null?void 0:B.id));await a$(this.wagmiConfig,{connector:o,chainId:v})},connectExternal:async({id:o,provider:a,info:c})=>{var f,g,v,x;if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const l=this.wagmiConfig.connectors.find(P=>P.id===o);if(!l)throw new Error("connectionControllerClient:connectExternal - connector is undefined");(f=this.appKit)==null||f.setClientId(null),a&&c&&l.id===cr.EIP6963_CONNECTOR_ID&&((g=l.setEip6963Wallet)==null||g.call(l,{provider:a,info:c}));const d=Number(Ya.caipNetworkIdToNumber((x=(v=this.appKit)==null?void 0:v.getCaipNetwork())==null?void 0:x.id));await a$(this.wagmiConfig,{connector:l,chainId:d})},checkInstalled:o=>{var c;const a=(c=this.appKit)==null?void 0:c.getConnectors().find(l=>l.type==="INJECTED");return o?a&&window!=null&&window.ethereum?o.some(l=>{var d;return!!((d=window.ethereum)!=null&&d[String(l)])}):!1:!!window.ethereum},disconnect:async()=>{var o,a,c,l,d;if(await n9e(this.wagmiConfig),(c=(a=(o=this.options)==null?void 0:o.siweConfig)==null?void 0:a.options)!=null&&c.signOutOnDisconnect){const{SIWEController:f}=await Qs(async()=>{const{SIWEController:g}=await import("./index-hDIYmWL4.js");return{SIWEController:g}},[]);await f.signOut()}sn.removeItem(nn.WALLET_ID),sn.removeItem(nn.CONNECTED_CONNECTOR),sn.removeItem(nn.WALLET_NAME),(l=this.appKit)==null||l.setClientId(null),this.syncAccount({address:void 0,chainId:void 0,connector:void 0,addresses:void 0,status:"disconnected"}),(d=this.appKit)==null||d.resetAccount("solana")},signMessage:async o=>{var l;const a=((l=this.appKit)==null?void 0:l.getCaipAddress())||"",c=p$(a);return g9e(this.wagmiConfig,{message:o,account:c})},estimateGas:async o=>{if(o.chainNamespace&&o.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${o.chainNamespace}`);try{return await i9e(this.wagmiConfig,{account:o.address,to:o.to,data:o.data,type:"legacy"})}catch{return BigInt(0)}},sendTransaction:async o=>{if(o.chainNamespace&&o.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${o.chainNamespace}`);const{chainId:a}=F2(this.wagmiConfig),c={account:o.address,to:o.to,value:o.value,gas:o.gas,gasPrice:o.gasPrice,data:o.data,chainId:a,type:"legacy"};await h9e(this.wagmiConfig,c);const l=await p9e(this.wagmiConfig,c);return await C9e(this.wagmiConfig,{hash:l,timeout:25e3}),l},writeContract:async o=>{var f,g,v,x;const a=((f=this.appKit)==null?void 0:f.getCaipAddress())||"",c=p$(a),l=Number(Ya.caipNetworkIdToNumber((v=(g=this.appKit)==null?void 0:g.getCaipNetwork())==null?void 0:v.id));return await _9e(this.wagmiConfig,{chain:(x=this.wagmiChains)==null?void 0:x[l],chainId:l,address:o.tokenAddress,account:c,abi:o.abi,functionName:o.method,args:[o.receiverAddress,o.tokenAmount]})},getEnsAddress:async o=>{var a,c,l;try{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const d=Number(Ya.caipNetworkIdToNumber((c=(a=this.appKit)==null?void 0:a.getCaipNetwork())==null?void 0:c.id));let f=!1,g=!1;return vX(o)&&(g=await((l=this.appKit)==null?void 0:l.resolveReownName(o))||!1),d===1&&(f=await d9e(this.wagmiConfig,{name:b$(o),chainId:d})),f||g||!1}catch{return!1}},getEnsAvatar:async o=>{var l,d;const a=Number(Ya.caipNetworkIdToNumber((d=(l=this.appKit)==null?void 0:l.getCaipNetwork())==null?void 0:d.id));return a!==h$.id?!1:await l$(this.wagmiConfig,{name:b$(o),chainId:a})||!1},parseUnits:rxe,formatUnits:L2},ge.state.chains.set(this.chainNamespace,{chainNamespace:this.chainNamespace,connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient,adapterType:this.adapterType,caipNetworks:this.caipNetworks}),this.syncConnectors(this.wagmiConfig.connectors),this.syncAuthConnector((n=this.wagmiConfig)==null?void 0:n.connectors.find(o=>o.id===cr.AUTH_CONNECTOR_ID)),this.syncRequestedNetworks(this.caipNetworks),x9e(this.wagmiConfig,{onChange:o=>{this.syncConnectors(o),this.syncAuthConnector(o.find(a=>a.id===cr.AUTH_CONNECTOR_ID))}}),b9e(this.wagmiConfig,{onChange:o=>{this.syncAccount(o)}}),(i=this.appKit)==null||i.setEIP6963Enabled(r.enableEIP6963!==!1),(s=this.appKit)==null||s.subscribeShouldUpdateToAddress(o=>{var a;if(o){const l=(a=l9e(this.wagmiConfig)[0])==null?void 0:a.connector;l&&w9e(this.wagmiConfig,{connector:l}).then(d=>this.syncAccount({address:o,isConnected:!0,addresses:d.accounts,connector:l,chainId:d.chainId,status:"connected"}))}})}subscribeState(e){var r;return(r=this.appKit)==null?void 0:r.subscribeState(n=>e({...n,selectedNetworkId:Number(Ya.caipNetworkIdToNumber(n.selectedNetworkId))}))}syncRequestedNetworks(e){Array.from(new Set(e.map(n=>n.chainNamespace))).filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(s=>s.chainNamespace===n),n)})}async syncAccount({address:e,chainId:r,connector:n,addresses:i,status:s}){var a,c,l,d,f,g,v,x,P,M,N,E,$,L,j,H;const o=ge.state.activeCaipAddress;if(s==="disconnected"&&!o){(a=this.appKit)==null||a.resetAccount(this.chainNamespace),(c=this.appKit)==null||c.resetWcConnection(),(l=this.appKit)==null||l.resetNetwork(),(d=this.appKit)==null||d.setAllAccounts([],this.chainNamespace),sn.removeItem(nn.WALLET_ID);return}if(this.wagmiConfig&&n){if(n&&n.name==="WalletConnect"&&n.getProvider&&e){const I=r||Number(Ya.caipNetworkIdToNumber((g=(f=this.appKit)==null?void 0:f.getCaipNetwork())==null?void 0:g.id)),T=await n.getProvider(),B=((v=T==null?void 0:T.session)==null?void 0:v.namespaces)||{},K=B?Object.keys(B):[],U=(x=this.appKit)==null?void 0:x.getPreferredAccountType();K.forEach(C=>{var w,_,R;const p=C,m=(w=B==null?void 0:B[C])==null?void 0:w.accounts[0];z1.setProvider(p,T),z1.setProviderId(p,"walletConnect"),(_=this.appKit)==null||_.setPreferredAccountType(U,p),(R=this.appKit)==null||R.setCaipAddress(m,p)}),((M=(P=this.appKit)==null?void 0:P.getCaipNetwork())==null?void 0:M.chainNamespace)!=="solana"&&(this.syncNetwork(e,I,!0),await Promise.all([this.syncProfile(e,I),this.syncBalance(e,I),this.syncConnectedWalletInfo(n),(N=this.appKit)==null?void 0:N.setApprovedCaipNetworksData(this.chainNamespace)]))}else if(s==="connected"&&e&&r){const I=`eip155:${r}:${e}`;this.syncNetwork(e,r,!0),(E=this.appKit)==null||E.setCaipAddress(I,this.chainNamespace),await Promise.all([this.syncProfile(e,r),this.syncBalance(e,r),this.syncConnectedWalletInfo(n),($=this.appKit)==null?void 0:$.setApprovedCaipNetworksData(this.chainNamespace)]),n&&this.syncConnectedWalletInfo(n),!((n==null?void 0:n.id)===cr.AUTH_CONNECTOR_ID)&&(i!=null&&i.length)&&((L=this.appKit)==null||L.setAllAccounts(i.map(B=>({address:B,type:"eoa"})),this.chainNamespace))}else if(s==="reconnecting"){(j=this.appKit)==null||j.setLoading(!0);const T=u9e(this.wagmiConfig).find(B=>B.id===n.id);T&&(await u$(this.wagmiConfig,{connectors:[T]}),(H=this.appKit)==null||H.setLoading(!1))}}}async syncNetwork(e,r,n){var s,o,a,c,l,d;const i=this.caipNetworks.find(f=>f.chainId===r);if(i&&r&&((a=this.appKit)==null||a.setCaipNetwork({chainId:i.chainId,id:i.id,name:i.name||"",imageId:ha.NetworkImageIds[i.chainId],imageUrl:(o=(s=this.options)==null?void 0:s.chainImages)==null?void 0:o[i.chainId],chainNamespace:this.chainNamespace,currency:(i==null?void 0:i.currency)||"",explorerUrl:(i==null?void 0:i.explorerUrl)||"",rpcUrl:(i==null?void 0:i.rpcUrl)||""}),n&&e&&r)){const f=`eip155:${r}:${e}`;if((c=this.appKit)==null||c.setCaipAddress(f,this.chainNamespace),i!=null&&i.explorerUrl){const g=`${i.explorerUrl}/address/${e}`;(l=this.appKit)==null||l.setAddressExplorerUrl(g,this.chainNamespace)}else(d=this.appKit)==null||d.setAddressExplorerUrl(void 0,this.chainNamespace);await this.syncBalance(e,r)}}async syncReownName(e){var r,n,i;if(!this.appKit)throw new Error("syncReownName - appKit is undefined");try{const s=await this.appKit.getReownName(e);if(s[0]){const o=s[0];(r=this.appKit)==null||r.setProfileName(o.name,this.chainNamespace)}else(n=this.appKit)==null||n.setProfileName(null,this.chainNamespace)}catch{(i=this.appKit)==null||i.setProfileName(null,this.chainNamespace)}}async syncProfile(e,r){var n,i,s,o,a,c;if(!this.appKit)throw new Error("syncProfile - appKit is undefined");try{const{name:l,avatar:d}=await this.appKit.fetchIdentity({address:e});(n=this.appKit)==null||n.setProfileName(l,this.chainNamespace),(i=this.appKit)==null||i.setProfileImage(d,this.chainNamespace),l||await this.syncReownName(e)}catch{if(r===h$.id){const l=await f9e(this.wagmiConfig,{address:e,chainId:r});if(l){(s=this.appKit)==null||s.setProfileName(l,this.chainNamespace);const d=await l$(this.wagmiConfig,{name:l,chainId:r});d&&((o=this.appKit)==null||o.setProfileImage(d,this.chainNamespace))}else await this.syncReownName(e),(a=this.appKit)==null||a.setProfileImage(null,this.chainNamespace)}else await this.syncReownName(e),(c=this.appKit)==null||c.setProfileImage(null,this.chainNamespace)}}async syncBalance(e,r){var i,s,o,a,c;const n=this.caipNetworks.find(l=>l.chainId===r);if(n&&this.wagmiConfig){const l=await c9e(this.wagmiConfig,{address:e,chainId:r,token:(o=(s=(i=this.options)==null?void 0:i.tokens)==null?void 0:s[n.id])==null?void 0:o.address});(a=this.appKit)==null||a.setBalance(l.formatted,l.symbol,this.chainNamespace);return}(c=this.appKit)==null||c.setBalance(void 0,void 0,this.chainNamespace)}async syncConnectedWalletInfo(e){var r,n,i,s;if(!e)throw Error("syncConnectedWalletInfo - connector is undefined");if(e.id===cr.WALLET_CONNECT_CONNECTOR_ID&&e.getProvider){const o=await e.getProvider();o.session&&((n=this.appKit)==null||n.setConnectedWalletInfo({...o.session.peer.metadata,name:o.session.peer.metadata.name,icon:(r=o.session.peer.metadata.icons)==null?void 0:r[0]},this.chainNamespace))}else{const o=(i=this.appKit)==null?void 0:i.getConnectors().find(a=>a.id===e.id);(s=this.appKit)==null||s.setConnectedWalletInfo({name:e.name,icon:e.icon||this.appKit.getConnectorImage(o)},this.chainNamespace)}}syncConnectors(e){var o;const r=e.map(a=>({...a,chain:this.chainNamespace})),n=new Set,i=r.filter(a=>{const c=n.has(a.id);return n.add(a.id),!c}),s=[];i.forEach(({id:a,name:c,type:l,icon:d})=>{var g,v;cr.AUTH_CONNECTOR_ID===a||s.push({id:a,explorerId:ha.ConnectorExplorerIds[a],imageUrl:((v=(g=this.options)==null?void 0:g.connectorImages)==null?void 0:v[a])??d,name:ha.ConnectorNamesMap[a]??c,imageId:ha.ConnectorImageIds[a],type:ha.ConnectorTypesMap[l]??"EXTERNAL",info:{rdns:a},chain:this.chainNamespace})}),(o=this.appKit)==null||o.setConnectors(s)}async syncAuthConnector(e){var n;const r=e;if(r){const i=await r.getProvider();(n=this.appKit)==null||n.addConnector({id:cr.AUTH_CONNECTOR_ID,type:"AUTH",name:"w3mAuth",provider:i,chain:this.chainNamespace}),this.initAuthConnectorListeners(e)}}async initAuthConnectorListeners(e){e&&(await this.listenAuthConnector(e),await this.listenModal(e))}async listenAuthConnector(e,r=!1){var n,i;if(r||typeof window<"u"&&e){(n=this.appKit)==null||n.setLoading(!0);const s=await e.getProvider(),o=s.getLoginEmailUsed();(i=this.appKit)==null||i.setLoading(o),s.onRpcRequest(a=>{var c,l;Xi.checkIfRequestExists(a)?Xi.checkIfRequestIsSafe(a)||(c=this.appKit)==null||c.handleUnsafeRPCRequest():((l=this.appKit)==null||l.open(),console.error(lr.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:a.method}),setTimeout(()=>{var d;(d=this.appKit)==null||d.showErrorMessage(lr.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),s.rejectRpcRequests())}),s.onRpcError(()=>{var c,l,d,f;((c=this.appKit)==null?void 0:c.isOpen())&&((l=this.appKit)!=null&&l.isTransactionStackEmpty()?(d=this.appKit)==null||d.close():(f=this.appKit)==null||f.popTransactionStack(!0))}),s.onRpcSuccess((a,c)=>{var d,f,g;Xi.checkIfRequestIsSafe(c)||((d=this.appKit)!=null&&d.isTransactionStackEmpty()?(f=this.appKit)==null||f.close():(g=this.appKit)==null||g.popTransactionStack())}),s.onNotConnected(()=>{var d,f,g;const a=(d=this.appKit)==null?void 0:d.getIsConnectedState(),l=sn.getItem(nn.CONNECTED_CONNECTOR)==="AUTH";!a&&l&&((f=this.appKit)==null||f.setCaipAddress(void 0,this.chainNamespace),(g=this.appKit)==null||g.setLoading(!1))}),s.onIsConnected(()=>{s.connect()}),s.onConnect(a=>{var l,d,f,g,v;const c=`eip155:${a.chainId}:${a.address}`;(l=this.appKit)==null||l.setCaipAddress(c,this.chainNamespace),(d=this.appKit)==null||d.setSmartAccountDeployed(!!a.smartAccountDeployed,this.chainNamespace),(f=this.appKit)==null||f.setPreferredAccountType(a.preferredAccountType,this.chainNamespace),(g=this.appKit)==null||g.setAllAccounts(a.accounts||[{address:a.address,type:a.preferredAccountType||"eoa"}],this.chainNamespace),vr.setConnectedConnector("AUTH"),(v=this.appKit)==null||v.setLoading(!1)}),s.onGetSmartAccountEnabledNetworks(a=>{var c;(c=this.appKit)==null||c.setSmartAccountEnabledNetworks(a,this.chainNamespace)}),s.onSetPreferredAccount(({address:a,type:c})=>{var l;a&&((l=this.appKit)==null||l.setPreferredAccountType(c,this.chainNamespace),this.wagmiConfig&&u$(this.wagmiConfig,{connectors:[e]}))})}}async listenModal(e){const r=await e.getProvider();this.subscribeState(n=>{n.open||r.rejectRpcRequests()})}}const x$="pushstate",C$="popstate",bW="beforeunload",xW=t=>(t.preventDefault(),t.returnValue=""),A7e=()=>{removeEventListener(bW,xW,{capture:!0})};function CW(t){let e=t.getLocation();const r=new Set;let n=[];const i=()=>{e=t.getLocation(),r.forEach(o=>o())},s=async(o,a)=>{var c;if(!((a==null?void 0:a.ignoreBlocker)??!1)&&typeof document<"u"&&n.length){for(const d of n)if(!await d()){(c=t.onBlocked)==null||c.call(t,i);return}}o()};return{get location(){return e},get length(){return t.getLength()},subscribers:r,subscribe:o=>(r.add(o),()=>{r.delete(o)}),push:(o,a,c)=>{a=_$(a),s(()=>{t.pushState(o,a),i()},c)},replace:(o,a,c)=>{a=_$(a),s(()=>{t.replaceState(o,a),i()},c)},go:(o,a)=>{s(()=>{t.go(o),i()},a)},back:o=>{s(()=>{t.back(),i()},o)},forward:o=>{s(()=>{t.forward(),i()},o)},createHref:o=>t.createHref(o),block:o=>(n.push(o),n.length===1&&addEventListener(bW,xW,{capture:!0}),()=>{n=n.filter(a=>a!==o),n.length||A7e()}),flush:()=>{var o;return(o=t.flush)==null?void 0:o.call(t)},destroy:()=>{var o;return(o=t.destroy)==null?void 0:o.call(t)},notify:i}}function _$(t){return t||(t={}),{...t,key:I7e()}}function _W(t){const e=(t==null?void 0:t.window)??(typeof document<"u"?window:void 0),r=e.history.pushState,n=e.history.replaceState,i=(t==null?void 0:t.createHref)??(P=>P),s=(t==null?void 0:t.parseLocation)??(()=>Vv(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));let o=s(),a;const c=()=>o;let l,d;const f=()=>{l&&(x._ignoreSubscribers=!0,(l.isPush?e.history.pushState:e.history.replaceState)(l.state,"",l.href),x._ignoreSubscribers=!1,l=void 0,d=void 0,a=void 0)},g=(P,M,N)=>{const E=i(M);d||(a=o),o=Vv(M,N),l={href:E,state:N,isPush:(l==null?void 0:l.isPush)||P==="push"},d||(d=Promise.resolve().then(()=>f()))},v=()=>{o=s(),x.notify()},x=CW({getLocation:c,getLength:()=>e.history.length,pushState:(P,M)=>g("push",P,M),replaceState:(P,M)=>g("replace",P,M),back:()=>e.history.back(),forward:()=>e.history.forward(),go:P=>e.history.go(P),createHref:P=>i(P),flush:f,destroy:()=>{e.history.pushState=r,e.history.replaceState=n,e.removeEventListener(x$,v),e.removeEventListener(C$,v)},onBlocked:P=>{a&&o!==a&&(o=a,P())}});return e.addEventListener(x$,v),e.addEventListener(C$,v),e.history.pushState=function(...P){const M=r.apply(e.history,P);return x._ignoreSubscribers||v(),M},e.history.replaceState=function(...P){const M=n.apply(e.history,P);return x._ignoreSubscribers||v(),M},x}function E7e(t){const e=typeof document<"u"?window:void 0;return _W({window:e,parseLocation:()=>{const r=e.location.hash.split("#").slice(1).join("#")??"/";return Vv(r,e.history.state)},createHref:r=>`${e.location.pathname}${e.location.search}#${r}`})}function S7e(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1;const n=e.map(()=>({}));return CW({getLocation:()=>Vv(e[r],n[r]),getLength:()=>e.length,pushState:(s,o)=>{r{n[r]=o,e[r]=s},back:()=>{r=Math.max(r-1,0)},forward:()=>{r=Math.min(r+1,e.length-1)},go:s=>{r=Math.min(Math.max(r+s,0),e.length-1)},createHref:s=>s})}function Vv(t,e){const r=t.indexOf("#"),n=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:t.length),hash:r>-1?t.substring(r):"",search:n>-1?t.slice(n,r===-1?void 0:r):"",state:e||{}}}function I7e(){return(Math.random()+1).toString(36).substring(7)}var T7e="Invariant failed";function hs(t,e){if(!t)throw new Error(T7e)}const o7=Ye.createContext(null);function AW(){return typeof document>"u"?o7:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=o7,o7)}function Xu(t){const e=Ye.useContext(AW());return t==null||t.warn,e}var EW={exports:{}},SW={},IW={exports:{}},TW={};/** +`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class o8e extends ze{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class a8e extends ze{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class _S extends ze{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function AS(t,e){var n,i,s,o,a,c;if(!(t instanceof ze))return!1;const r=t.walk(l=>l instanceof P_);return r instanceof P_?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=r.data)==null?void 0:s.errorName)==="ResolverNotContract"||((o=r.data)==null?void 0:o.errorName)==="ResolverError"||((a=r.data)==null?void 0:a.errorName)==="HttpError"||(c=r.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===Ez[50]):!1}function Iz(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Hu(e)?e:null}function gb(t){let e=new Uint8Array(32).fill(0);if(!t)return Ri(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=Iz(r[n]),s=i?M4(i):wf(Ph(r[n]),"bytes");e=wf(g0([e,s]),"bytes")}return Ri(e)}function c8e(t){return`[${t.slice(2)}]`}function l8e(t){const e=new Uint8Array(32).fill(0);return t?Iz(t)||wf(Ph(t)):Ri(e)}function ES(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Ph(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=Ph(c8e(l8e(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const u8e=3;function Lv(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:d}=t instanceof _S?t:t instanceof ze?t.walk(g=>"data"in g)||t.walk():{},f=t instanceof D4?new o8e({functionName:s}):[u8e,m0.code].includes(a)&&(c||l||d)?new P_({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:d??l}):t;return new CS(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const d8e="0x82ad56cb",f8e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",h8e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",_Te="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function p8e(t,{docsPath:e,...r}){const n=(()=>{const i=hS(t,r);return i instanceof j4?t:i})();return new s8e(n,{docsPath:e,...r})}const Y9=new Map;function Tz({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const d=c();o();const f=d.map(({args:g})=>g);f.length!==0&&t(f).then(g=>{var v;i&&Array.isArray(g)&&g.sort(i);for(let x=0;x{var v;for(let x=0;xY9.delete(e),a=()=>c().map(({args:d})=>d),c=()=>Y9.get(e)||[],l=d=>Y9.set(e,[...c(),d]);return{flush:o,async schedule(d){const f={},g=new Promise((P,M)=>{f.resolve=P,f.reject=M});return(r==null?void 0:r([...a(),d]))&&s(),c().length>0?(l({args:d,pendingPromise:f}),g):(l({args:d,pendingPromise:f}),setTimeout(s,n),g)}}}async function SS(t,e){var U,C,p,m;const{account:r=t.account,batch:n=!!((U=t.batch)!=null&&U.multicall),blockNumber:i,blockTag:s="latest",accessList:o,blobs:a,code:c,data:l,factory:d,factoryData:f,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:P,maxPriorityFeePerGas:M,nonce:N,to:E,value:$,stateOverride:L,...j}=e,H=r?$c(r):void 0;if(c&&(d||f))throw new ze("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&E)throw new ze("Cannot provide both `code` & `to` as parameters.");const I=c&&l,T=d&&f&&E&&l,B=I||T,K=I?w8e({code:c,data:l}):T?v8e({data:l,factory:d,factoryData:f,to:E}):l;try{F4(e);const _=(i?gr(i):void 0)||s,R=ez(L),S=(m=(p=(C=t.chain)==null?void 0:C.formatters)==null?void 0:p.transactionRequest)==null?void 0:m.format,y=(S||gS)({...pS(j,{format:S}),from:H==null?void 0:H.address,accessList:o,blobs:a,data:K,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:P,maxPriorityFeePerGas:M,nonce:N,to:B?void 0:E,value:$});if(n&&g8e({request:y})&&!R)try{return await m8e(t,{...y,blockNumber:i,blockTag:s})}catch(V){if(!(V instanceof HF)&&!(V instanceof g_))throw V}const b=await t.request({method:"eth_call",params:R?[y,_,R]:[y,_]});return b==="0x"?{data:void 0}:{data:b}}catch(w){const _=y8e(w),{offchainLookup:R,offchainLookupSignature:S}=await Qs(async()=>{const{offchainLookup:k,offchainLookupSignature:y}=await import("./ccip-DXiuzO4m.js");return{offchainLookup:k,offchainLookupSignature:y}},__vite__mapDeps([0,1]));if(t.ccipRead!==!1&&(_==null?void 0:_.slice(0,10))===S&&E)return{data:await R(t,{data:_,to:E})};throw B&&(_==null?void 0:_.slice(0,10))==="0x101bb98d"?new a8e({factory:d}):p8e(w,{...e,account:H,chain:t.chain})}}function g8e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(d8e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function m8e(t,e){var P;const{batchSize:r=1024,wait:n=0}=typeof((P=t.batch)==null?void 0:P.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new HF;l=U2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?gr(i):void 0)||s,{schedule:g}=Tz({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(M){return M.reduce((E,{data:$})=>E+($.length-2),0)>r*2},fn:async M=>{const N=M.map(L=>({allowFailure:!0,callData:L.data,target:L.to})),E=F0({abi:E_,args:[N],functionName:"aggregate3"}),$=await t.request({method:"eth_call",params:[{data:E,to:l},f]});return Mg({abi:E_,args:[N],functionName:"aggregate3",data:$||"0x"})}}),[{returnData:v,success:x}]=await g({data:o,to:c});if(!x)throw new _S({data:v});return v==="0x"?{data:void 0}:{data:v}}function w8e(t){const{code:e,data:r}=t;return jF({abi:Cz(["constructor(bytes, bytes)"]),bytecode:f8e,args:[e,r]})}function v8e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return jF({abi:Cz(["constructor(address, bytes, address, bytes)"]),bytecode:h8e,args:[i,e,r,n]})}function y8e(t){var r;if(!(t instanceof ze))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(r=e.data)==null?void 0:r.data:e.data}async function w0(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=F0({abi:r,args:i,functionName:s});try{const{data:c}=await an(t,SS,"call")({...o,data:a,to:n});return Mg({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw Lv(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function b8e(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=U2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=F0({abi:qM,functionName:"addr",...n!=null?{args:[gb(i),BigInt(n)]}:{args:[gb(i)]}}),d={address:c,abi:lz,functionName:"resolve",args:[h0(ES(i)),l],blockNumber:e,blockTag:r},f=an(t,w0,"readContract"),g=s?await f({...d,args:[...d.args,s]}):await f(d);if(g[0]==="0x")return null;const v=Mg({abi:qM,args:n!=null?[gb(i),BigInt(n)]:void 0,functionName:"addr",data:g[0]});return v==="0x"||Pg(v)==="0x00"?null:v}catch(l){if(o)throw l;if(AS(l,"resolve"))return null;throw l}}class x8e extends ze{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class Im extends ze{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class IS extends ze{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class C8e extends ze{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const _8e=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,A8e=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,E8e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,S8e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function I8e(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function ZM(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function kz({uri:t,gatewayUrls:e}){const r=E8e.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=ZM(e==null?void 0:e.ipfs,"https://ipfs.io"),i=ZM(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(_8e),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},d=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||A8e.test(t);if(t.startsWith("http")&&!d&&!f){let v=t;return e!=null&&e.arweave&&(v=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:v,isOnChain:!1,isEncoded:!1}}if((d||f)&&c)return{uri:`${n}/${d?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let g=t.replace(S8e,"");if(g.startsWith("i.json());return await TS({gatewayUrls:t,uri:Rz(r)})}catch{throw new IS({uri:e})}}async function TS({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=kz({uri:e,gatewayUrls:t});if(n||await I8e(r))return r;throw new IS({uri:e})}function k8e(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Im({reason:"Only EIP-155 supported"});if(!o)throw new Im({reason:"Chain ID not found"});if(!c)throw new Im({reason:"Contract address not found"});if(!i)throw new Im({reason:"Token ID not found"});if(!a)throw new Im({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function R8e(t,{nft:e}){if(e.namespace==="erc721")return w0(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return w0(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new C8e({namespace:e.namespace})}async function P8e(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?N8e(t,{gatewayUrls:e,record:r}):TS({uri:r,gatewayUrls:e})}async function N8e(t,{gatewayUrls:e,record:r}){const n=k8e(r),i=await R8e(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=kz({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,d=JSON.parse(l);return TS({uri:Rz(d),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),T8e({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function M8e(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=U2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:lz,functionName:"resolve",args:[h0(ES(n)),F0({abi:HM,functionName:"text",args:[gb(n),i]})],blockNumber:e,blockTag:r},d=an(t,w0,"readContract"),f=s?await d({...l,args:[...l.args,s]}):await d(l);if(f[0]==="0x")return null;const g=Mg({abi:HM,functionName:"text",data:f[0]});return g===""?null:g}catch(l){if(o)throw l;if(AS(l,"resolve"))return null;throw l}}async function $8e(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await an(t,M8e,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await P8e(t,{record:c,gatewayUrls:n})}catch{return null}}async function O8e(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:s,universalResolverAddress:o}){let a=o;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=U2({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:r4e,functionName:"reverse",args:[h0(ES(c))],blockNumber:r,blockTag:n},d=an(t,w0,"readContract"),[f,g]=i?await d({...l,args:[...l.args,i]}):await d(l);return e.toLowerCase()!==g.toLowerCase()?null:f}catch(l){if(s)throw l;if(AS(l,"reverse"))return null;throw l}}const D8e=new Map,L8e=new Map;function B8e(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,D8e),n=e(t,L8e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function U8e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=B8e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function F8e(t,{cacheTime:e=t.cacheTime}={}){const r=await U8e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:j8e(t.uid),cacheTime:e});return BigInt(r)}function z8e(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}async function Pz(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var d,f,g;const o=n||"latest",a=r!==void 0?gr(r):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,gr(s)]},{dedupe:!0}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,gr(s)]},{dedupe:!!a})),!c)throw new qF({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((g=(f=(d=t.chain)==null?void 0:d.formatters)==null?void 0:f.transaction)==null?void 0:g.format)||YF)(c)}const W8e={"0x0":"reverted","0x1":"success"};function H8e(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>z8e(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?f0(t.transactionIndex):null,status:t.status?W8e[t.status]:null,type:t.type?QF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}async function QM(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new VF({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||H8e)(r)}async function q8e(t,e){var M;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,multicallAddress:o,stateOverride:a}=e,c=e.contracts,l=n??(typeof((M=t.batch)==null?void 0:M.multicall)=="object"&&t.batch.multicall.batchSize||1024);let d=o;if(!d){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");d=U2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let g=0,v=0;for(let N=0;N0&&v>l&&f[g].length>0&&(g++,v=(H.length-2)/2,f[g]=[]),f[g]=[...f[g],{allowFailure:!0,callData:H,target:$}]}catch(H){const I=Lv(H,{abi:E,address:$,args:L,docsPath:"/docs/contract/multicall",functionName:j});if(!r)throw I;f[g]=[...f[g],{allowFailure:!0,callData:"0x",target:$}]}}const x=await Promise.allSettled(f.map(N=>an(t,w0,"readContract")({abi:E_,address:d,args:[N],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),P=[];for(let N=0;NJ9.get(t)||[],s=()=>{const d=i();J9.set(t,d.filter(f=>f.id!==n))},o=()=>{const d=YM.get(t);i().length===1&&d&&d(),s()},a=i();if(J9.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const d in e)c[d]=(...f)=>{var v,x;const g=i();if(g.length!==0)for(const P of g)(x=(v=P.fns)[d])==null||x.call(v,...f)};const l=r(c);return typeof l=="function"&&YM.set(t,l),o}async function n6(t){return new Promise(e=>setTimeout(e,t))}function K8e(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await n6(c);const l=async()=>{i&&(await t({unpoll:s}),await n6(n),l())};l()})(),s}function G8e(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:o=t.pollingInterval}){const a=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let c;return a?(()=>{const f=hc(["watchBlockNumber",t.uid,e,r,o]);return N_(f,{onBlockNumber:n,onError:i},g=>K8e(async()=>{var v;try{const x=await an(t,F8e,"getBlockNumber")({cacheTime:0});if(c){if(x===c)return;if(x-c>1&&r)for(let P=c+1n;Pc)&&(g.onBlockNumber(x,c),c=x)}catch(x){(v=g.onError)==null||v.call(g,x)}},{emitOnBegin:e,interval:o}))})():(()=>{const f=hc(["watchBlockNumber",t.uid,e,r]);return N_(f,{onBlockNumber:n,onError:i},g=>{let v=!0,x=()=>v=!1;return(async()=>{try{const P=(()=>{if(t.transport.type==="fallback"){const N=t.transport.transports.find(E=>E.config.type==="webSocket");return N?N.value:t.transport}return t.transport})(),{unsubscribe:M}=await P.subscribe({params:["newHeads"],onData(N){var $;if(!v)return;const E=Q1(($=N.result)==null?void 0:$.number);g.onBlockNumber(E,c),c=E},onError(N){var E;(E=g.onError)==null||E.call(g,N)}});x=M,v||x()}catch(P){i==null||i(P)}})(),()=>x()})})()}const My=new nS(8192);function Z8e(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(My.get(r))return My.get(r);const n=t().finally(()=>My.delete(r));return My.set(r,n),n}function i6(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const d=typeof e=="function"?e({count:a,error:l}):e;d&&await n6(d),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a{const{dedupe:i=!1,retryDelay:s=150,retryCount:o=3,uid:a}={...e,...n},c=i?wf($4(`${a}.${hc(r)}`)):void 0;return Z8e(()=>i6(async()=>{try{return await t(r)}catch(l){const d=l;switch(d.code){case _v.code:throw new _v(d);case Av.code:throw new Av(d);case Ev.code:throw new Ev(d,{method:r.method});case Sv.code:throw new Sv(d);case m0.code:throw new m0(d);case Iv.code:throw new Iv(d);case Tv.code:throw new Tv(d);case Xd.code:throw new Xd(d);case Y1.code:throw new Y1(d);case kv.code:throw new kv(d,{method:r.method});case J1.code:throw new J1(d);case Rv.code:throw new Rv(d);case pn.code:throw new pn(d);case Pv.code:throw new Pv(d);case Nv.code:throw new Nv(d);case Mv.code:throw new Mv(d);case $v.code:throw new $v(d);case no.code:throw new no(d);case 5e3:throw new pn(d);default:throw l instanceof ze?l:new A6e(d)}}},{delay:({count:l,error:d})=>{var f;if(d&&d instanceof ow){const g=(f=d==null?void 0:d.headers)==null?void 0:f.get("Retry-After");if(g!=null&&g.match(/\d/))return Number.parseInt(g)*1e3}return~~(1<Y8e(l)}),{enabled:i,id:c})}}function Y8e(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===J1.code||t.code===m0.code:t instanceof ow&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function J8e(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function Nz(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function X8e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const JM=X8e();function exe(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=r,a={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:c,method:l,signal:d}=a;try{const g=await Nz(async({signal:x})=>{const P={...a,body:Array.isArray(n)?hc(n.map(E=>({jsonrpc:"2.0",id:E.id??JM.take(),...E}))):hc({jsonrpc:"2.0",id:n.id??JM.take(),...n}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:d||(o>0?x:null)},M=new Request(t,P);return i&&await i(M),await fetch(t,P)},{errorInstance:new UM({body:n,url:t}),timeout:o,signal:!0});s&&await s(g);let v;if((f=g.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))v=await g.json();else{v=await g.text();try{v=JSON.parse(v||"{}")}catch(x){if(g.ok)throw x;v={error:v}}}if(!g.ok)throw new ow({body:n,details:hc(v.error)||g.statusText,headers:g.headers,status:g.status,url:t});return v}catch(g){throw g instanceof ow||g instanceof UM?g:new ow({body:n,cause:g,url:t})}}}}class txe extends ze{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function rxe(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new txe({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[s,o,a]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${o}.${a}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}async function nxe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<{a&&setTimeout(()=>x(new x6e({hash:r})),a);const P=N_(c,{onReplaced:n,resolve:v,reject:x},M=>{const N=an(t,G8e,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(E){const $=j=>{N(),j(),P()};let L=E;if(!g)try{if(f){if(e>1&&(!f.blockNumber||L-f.blockNumber+1nM.resolve(f));return}if(l||(g=!0,await i6(async()=>{l=await an(t,Pz,"getTransaction")({hash:r}),l.blockNumber&&(L=l.blockNumber)},{delay:o,retryCount:s}),g=!1),f=await an(t,QM,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||L-f.blockNumber+1nM.resolve(f))}catch(j){if(j instanceof qF||j instanceof VF){if(!l){g=!1;return}try{d=l,g=!0;const H=await i6(()=>an(t,Ov,"getBlock")({blockNumber:L,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:B})=>B instanceof ZF});g=!1;const I=H.transactions.find(({from:B,nonce:K})=>B===d.from&&K===d.nonce);if(!I||(f=await an(t,QM,"getTransactionReceipt")({hash:I.hash}),e>1&&(!f.blockNumber||L-f.blockNumber+1n{var B;(B=M.onReplaced)==null||B.call(M,{reason:T,replacedTransaction:d,transaction:I,transactionReceipt:f}),M.resolve(f)})}catch(H){$(()=>M.reject(H))}}else $(()=>M.reject(j))}}})})})}async function ixe(t,{account:e=t.account,message:r}){if(!e)throw new lS({docsPath:"/docs/actions/wallet/signMessage"});const n=$c(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?$4(r):r.raw instanceof Uint8Array?h0(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function sxe(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?$c(a.account):t.account,l=F0({abi:r,args:i,functionName:o});try{const{data:d}=await an(t,SS,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),f=Mg({abi:r,args:i,functionName:o,data:d||"0x"}),g=r.filter(v=>"name"in v&&v.name===e.functionName);return{result:f,request:{abi:g,address:n,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(d){throw Lv(d,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}async function oxe(t,e){const{abi:r,account:n=t.account,address:i,args:s,dataSuffix:o,functionName:a,...c}=e;if(!n)throw new lS({docsPath:"/docs/contract/writeContract"});const l=$c(n),d=F0({abi:r,args:s,functionName:a});try{return await an(t,az,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:i,account:l,...c})}catch(f){throw Lv(f,{abi:r,address:i,args:s,docsPath:"/docs/contract/writeContract",functionName:a,sender:l.address})}}const M_=256;let $y=M_,Oy;function Mz(t=11){if(!Oy||$y+t>M_*2){Oy="",$y=0;for(let e=0;e{const E=N(M);for(const L in x)delete E[L];const $={...M,...E};return Object.assign($,{extend:P($)})}}return Object.assign(x,{extend:P(x)})}function kS({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){const c=Mz();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:Q8e(r,{retryCount:n,retryDelay:i,uid:c}),value:a}}function axe(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>kS({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}function cxe(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:s,retryDelay:o}=e;return({chain:a,pollingInterval:c=4e3,timeout:l,...d})=>{let f=t,g=()=>{};const v=kS({key:r,name:n,async request({method:x,params:P}){const M=async(N=0)=>{const E=f[N]({...d,chain:a,retryCount:0,timeout:l});try{const $=await E.request({method:x,params:P});return g({method:x,params:P,response:$,transport:E,status:"success"}),$}catch($){if(g({error:$,method:x,params:P,transport:E,status:"error"}),lxe($)||N===f.length-1)throw $;return M(N+1)}};return M()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:x=>g=x,transports:f.map(x=>x({chain:a,retryCount:0}))});if(i){const x=typeof i=="object"?i:{};uxe({chain:a,interval:x.interval??c,onTransports:P=>f=P,sampleCount:x.sampleCount,timeout:x.timeout,transports:f,weights:x.weights})}return v}}function lxe(t){return"code"in t&&typeof t.code=="number"&&(t.code===Y1.code||t.code===pn.code||t.code===5e3)}function uxe({chain:t,interval:e=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:s,weights:o={}}){const{stability:a=.7,latency:c=.3}=o,l=[],d=async()=>{const f=await Promise.all(s.map(async x=>{const P=x({chain:t,retryCount:0,timeout:i}),M=Date.now();let N,E;try{await P.request({method:"net_listening"}),E=1}catch{E=0}finally{N=Date.now()}return{latency:N-M,success:E}}));l.push(f),l.length>n&&l.shift();const g=Math.max(...l.map(x=>Math.max(...x.map(({latency:P})=>P)))),v=s.map((x,P)=>{const M=l.map(j=>j[P].latency),E=1-M.reduce((j,H)=>j+H,0)/M.length/g,$=l.map(j=>j[P].success),L=$.reduce((j,H)=>j+H,0)/$.length;return L===0?[0,P]:[c*E+a*L,P]}).sort((x,P)=>P[0]-x[0]);r(v.map(([,x])=>s[x])),await n6(e),d()};d()}class dxe extends ze{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function X9(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:a,retryDelay:c}=e;return({chain:l,retryCount:d,timeout:f})=>{const{batchSize:g=1e3,wait:v=0}=typeof r=="object"?r:{},x=e.retryCount??d,P=f??e.timeout??1e4,M=t||(l==null?void 0:l.rpcUrls.default.http[0]);if(!M)throw new dxe;const N=exe(M,{fetchOptions:n,onRequest:o,onResponse:a,timeout:P});return kS({key:i,name:s,async request({method:E,params:$}){const L={method:E,params:$},{schedule:j}=Tz({id:M,wait:v,shouldSplitBatch(B){return B.length>g},fn:B=>N.request({body:B}),sort:(B,K)=>B.id-K.id}),H=async B=>r?j(B):[await N.request({body:B})],[{error:I,result:T}]=await H(L);if(I)throw new KF({body:L,error:I,url:M});return T},retryCount:x,retryDelay:c,timeout:P,type:"http"},{fetchOptions:n,url:M})}}let e7=!1;async function fxe(t,e={}){var l,d;if(e7)return[];e7=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const f of e.connectors){let g;typeof f=="function"?g=t._internal.connectors.setup(f):g=f,r.push(g)}else r.push(...t.connectors);let n;try{n=await((d=t.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((f,g)=>(i[f.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const f of s){const g=await f.getProvider().catch(()=>{});if(!g||c.some(P=>P===g)||!await f.isAuthorized())continue;const x=await f.connect({isReconnecting:!0}).catch(()=>null);x&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(P=>{const M=new Map(o?P.connections:new Map).set(f.uid,{accounts:x.accounts,chainId:x.chainId,connector:f});return{...P,current:o?P.current:f.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:f}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),e7=!1,a}function hxe(t){if(typeof window>"u")return;const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function pxe(){const t=new Set;let e=[];const r=()=>hxe(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n==null||n()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const gxe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://ucan.dacade.my/ucan"},mxe=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const d=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=g=>{const v=o(g);if(!d(f,v)){const x=f;a(f=v,x)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},wxe=mxe;function vxe(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,void 0),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>r.removeItem(i)}}const Bv=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return Bv(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Bv(n)(r)}}}},yxe=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:M=>M,version:0,merge:(M,N)=>({...N,...M}),...e},o=!1;const a=new Set,c=new Set;let l;try{l=s.getStorage()}catch{}if(!l)return t((...M)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...M)},n,i);const d=Bv(s.serialize),f=()=>{const M=s.partialize({...n()});let N;const E=d({state:M,version:s.version}).then($=>l.setItem(s.name,$)).catch($=>{N=$});if(N)throw N;return E},g=i.setState;i.setState=(M,N)=>{g(M,N),f()};const v=t((...M)=>{r(...M),f()},n,i);let x;const P=()=>{var M;if(!l)return;o=!1,a.forEach(E=>E(n()));const N=((M=s.onRehydrateStorage)==null?void 0:M.call(s,n()))||void 0;return Bv(l.getItem.bind(l))(s.name).then(E=>{if(E)return s.deserialize(E)}).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==s.version){if(s.migrate)return s.migrate(E.state,E.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return E.state}).then(E=>{var $;return x=s.merge(E,($=n())!=null?$:v),r(x,!0),f()}).then(()=>{N==null||N(x,void 0),o=!0,c.forEach(E=>E(x))}).catch(E=>{N==null||N(void 0,E)})};return i.persist={setOptions:M=>{s={...s,...M},M.getStorage&&(l=M.getStorage())},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>P(),hasHydrated:()=>o,onHydrate:M=>(a.add(M),()=>{a.delete(M)}),onFinishHydration:M=>(c.add(M),()=>{c.delete(M)})},P(),x||v},bxe=(t,e)=>(r,n,i)=>{let s={storage:vxe(()=>localStorage),partialize:P=>P,version:0,merge:(P,M)=>({...M,...P}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...P)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...P)},n,i);const d=()=>{const P=s.partialize({...n()});return l.setItem(s.name,{state:P,version:s.version})},f=i.setState;i.setState=(P,M)=>{f(P,M),d()};const g=t((...P)=>{r(...P),d()},n,i);let v;const x=()=>{var P,M;if(!l)return;o=!1,a.forEach(E=>{var $;return E(($=n())!=null?$:g)});const N=((M=s.onRehydrateStorage)==null?void 0:M.call(s,(P=n())!=null?P:g))||void 0;return Bv(l.getItem.bind(l))(s.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==s.version){if(s.migrate)return s.migrate(E.state,E.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return E.state}).then(E=>{var $;return v=s.merge(E,($=n())!=null?$:g),r(v,!0),d()}).then(()=>{N==null||N(v,void 0),v=n(),o=!0,c.forEach(E=>E(v))}).catch(E=>{N==null||N(void 0,E)})};return i.persist={setOptions:P=>{s={...s,...P},P.storage&&(l=P.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:P=>(a.add(P),()=>{a.delete(P)}),onFinishHydration:P=>(c.add(P),()=>{c.delete(P)})},s.skipHydration||x(),v||g},xxe=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((gxe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),yxe(t,e)):bxe(t,e),Cxe=xxe,_xe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APPKIT_PROJECT_ID:"e68f5aaf8852a7276013760c5323852a",VITE_THE_GRAPH_QUEST_CHAINS_URL:"https://api.studio.thegraph.com/query/71457/quest-chains-optimism/version/latest",VITE_UCAN_DELEGATOR:"https://ucan.dacade.my/ucan"},XM=t=>{let e;const r=new Set,n=(c,l)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=l??typeof d!="object"?d:Object.assign({},e,d),r.forEach(g=>g(e,f))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{(_xe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},t7=t=>t?XM(t):XM;var Oz={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,d){this.fn=c,this.context=l,this.once=d||!1}function s(c,l,d,f,g){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new i(d,f||c,g),x=r?r+l:l;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],v]:c._events[x].push(v):(c._events[x]=v,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],d,f;if(this._eventsCount===0)return l;for(f in d=this._events)e.call(d,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},a.prototype.listeners=function(l){var d=r?r+l:l,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,v=f.length,x=new Array(v);gi.id===r.chainId)?r.chainId:t.chains[0].id,connections:n?r.connections:new Map,status:n?"reconnecting":"disconnected"}),{async onMount(){var i;if(t._internal.ssr){await t._internal.store.persist.rehydrate();const s=(i=t._internal.mipd)==null?void 0:i.getProviders().map(t._internal.connectors.providerDetailToConnector).map(t._internal.connectors.setup);t._internal.connectors.setState(o=>[...o,...s??[]])}n?fxe(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}function Ixe(t){const{children:e,config:r,initialState:n,reconnectOnMount:i=!0}=t,{onMount:s}=Sxe(r,{initialState:n,reconnectOnMount:i});r._internal.ssr||s();const o=Ye.useRef(!0);return Ye.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const Txe=Ye.createContext(void 0);function kxe(t){const{children:e,config:r}=t,n={value:r};return Ye.createElement(Ixe,t,Ye.createElement(Txe.Provider,n,e))}var z4=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},W4=typeof window>"u"||"Deno"in globalThis;function Xa(){}function Rxe(t,e){return typeof t=="function"?t(e):t}function Pxe(t){return typeof t=="number"&&t>=0&&t!==1/0}function Nxe(t,e){return Math.max(t+(e||0)-Date.now(),0)}function e$(t,e){return typeof t=="function"?t(e):t}function Mxe(t,e){return typeof t=="function"?t(e):t}function t$(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==RS(o,e.options))return!1}else if(!jv(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function r$(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Uv(e.options.mutationKey)!==Uv(s))return!1}else if(!jv(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function RS(t,e){return((e==null?void 0:e.queryKeyHashFn)||Uv)(t)}function Uv(t){return JSON.stringify(t,(e,r)=>$_(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function jv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!jv(t[r],e[r])):!1}function Dz(t,e){if(t===e)return t;const r=n$(t)&&n$(e);if(r||$_(t)&&$_(e)){const n=r?t:Object.keys(t),i=n.length,s=r?e:Object.keys(e),o=s.length,a=r?[]:{};let c=0;for(let l=0;l{setTimeout(e,t)})}function Oxe(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Dz(t,e):e}function Dxe(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function Lxe(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Lz=Symbol();function Bz(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Lz?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var xh,Pd,t1,F$,Bxe=(F$=class extends z4{constructor(){super();Fr(this,xh);Fr(this,Pd);Fr(this,t1);pr(this,t1,e=>{if(!W4&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Oe(this,Pd)||this.setEventListener(Oe(this,t1))}onUnsubscribe(){var e;this.hasListeners()||((e=Oe(this,Pd))==null||e.call(this),pr(this,Pd,void 0))}setEventListener(e){var r;pr(this,t1,e),(r=Oe(this,Pd))==null||r.call(this),pr(this,Pd,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){Oe(this,xh)!==e&&(pr(this,xh,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof Oe(this,xh)=="boolean"?Oe(this,xh):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},xh=new WeakMap,Pd=new WeakMap,t1=new WeakMap,F$),Uz=new Bxe,r1,Nd,n1,z$,Uxe=(z$=class extends z4{constructor(){super();Fr(this,r1,!0);Fr(this,Nd);Fr(this,n1);pr(this,n1,e=>{if(!W4&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){Oe(this,Nd)||this.setEventListener(Oe(this,n1))}onUnsubscribe(){var e;this.hasListeners()||((e=Oe(this,Nd))==null||e.call(this),pr(this,Nd,void 0))}setEventListener(e){var r;pr(this,n1,e),(r=Oe(this,Nd))==null||r.call(this),pr(this,Nd,e(this.setOnline.bind(this)))}setOnline(e){Oe(this,r1)!==e&&(pr(this,r1,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return Oe(this,r1)}},r1=new WeakMap,Nd=new WeakMap,n1=new WeakMap,z$),s6=new Uxe;function jxe(t){return Math.min(1e3*2**t,3e4)}function jz(t){return(t??"online")==="online"?s6.isOnline():!0}var Fz=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function r7(t){return t instanceof Fz}function zz(t){let e=!1,r=0,n=!1,i,s,o;const a=new Promise((N,E)=>{s=N,o=E}),c=N=>{var E;n||(x(new Fz(N)),(E=t.abort)==null||E.call(t))},l=()=>{e=!0},d=()=>{e=!1},f=()=>Uz.isFocused()&&(t.networkMode==="always"||s6.isOnline())&&t.canRun(),g=()=>jz(t.networkMode)&&t.canRun(),v=N=>{var E;n||(n=!0,(E=t.onSuccess)==null||E.call(t,N),i==null||i(),s(N))},x=N=>{var E;n||(n=!0,(E=t.onError)==null||E.call(t,N),i==null||i(),o(N))},P=()=>new Promise(N=>{var E;i=$=>{(n||f())&&N($)},(E=t.onPause)==null||E.call(t)}).then(()=>{var N;i=void 0,n||(N=t.onContinue)==null||N.call(t)}),M=()=>{if(n)return;let N;const E=r===0?t.initialPromise:void 0;try{N=E??t.fn()}catch($){N=Promise.reject($)}Promise.resolve(N).then(v).catch($=>{var T;if(n)return;const L=t.retry??(W4?0:3),j=t.retryDelay??jxe,H=typeof j=="function"?j(r,$):j,I=L===!0||typeof L=="number"&&rf()?void 0:P()).then(()=>{e?x($):M()})})};return{promise:a,cancel:c,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:d,canStart:g,start:()=>(g()?M():P().then(M),a)}}function Fxe(){let t=[],e=0,r=a=>{a()},n=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?t.push(a):i(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var gs=Fxe(),Ch,W$,Wz=(W$=class{constructor(){Fr(this,Ch)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pxe(this.gcTime)&&pr(this,Ch,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(W4?1/0:5*60*1e3))}clearGcTimeout(){Oe(this,Ch)&&(clearTimeout(Oe(this,Ch)),pr(this,Ch,void 0))}},Ch=new WeakMap,W$),i1,s1,ca,Zi,Kv,_h,ec,cu,H$,zxe=(H$=class extends Wz{constructor(e){super();Fr(this,ec);Fr(this,i1);Fr(this,s1);Fr(this,ca);Fr(this,Zi);Fr(this,Kv);Fr(this,_h);pr(this,_h,!1),pr(this,Kv,e.defaultOptions),this.setOptions(e.options),this.observers=[],pr(this,ca,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,pr(this,i1,Hxe(this.options)),this.state=e.state??Oe(this,i1),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Oe(this,Zi))==null?void 0:e.promise}setOptions(e){this.options={...Oe(this,Kv),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Oe(this,ca).remove(this)}setData(e,r){const n=Oxe(this.state.data,e,this.options);return zi(this,ec,cu).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){zi(this,ec,cu).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,i;const r=(n=Oe(this,Zi))==null?void 0:n.promise;return(i=Oe(this,Zi))==null||i.cancel(e),r?r.then(Xa).catch(Xa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Oe(this,i1))}isActive(){return this.observers.some(e=>Mxe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Nxe(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Zi))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Zi))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Oe(this,ca).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(Oe(this,Zi)&&(Oe(this,_h)?Oe(this,Zi).cancel({revert:!0}):Oe(this,Zi).cancelRetry()),this.scheduleGc()),Oe(this,ca).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||zi(this,ec,cu).call(this,{type:"invalidate"})}fetch(e,r){var c,l,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Oe(this,Zi))return Oe(this,Zi).continueRetry(),Oe(this,Zi).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(g=>g.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(pr(this,_h,!0),n.signal)})},s=()=>{const f=Bz(this.options,r),g={queryKey:this.queryKey,meta:this.meta};return i(g),pr(this,_h,!1),this.options.persister?this.options.persister(f,g,this):f(g)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),pr(this,s1,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=o.fetchOptions)==null?void 0:l.meta))&&zi(this,ec,cu).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=f=>{var g,v,x,P;r7(f)&&f.silent||zi(this,ec,cu).call(this,{type:"error",error:f}),r7(f)||((v=(g=Oe(this,ca).config).onError)==null||v.call(g,f,this),(P=(x=Oe(this,ca).config).onSettled)==null||P.call(x,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return pr(this,Zi,zz({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var g,v,x,P;if(f===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(M){a(M);return}(v=(g=Oe(this,ca).config).onSuccess)==null||v.call(g,f,this),(P=(x=Oe(this,ca).config).onSettled)==null||P.call(x,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(f,g)=>{zi(this,ec,cu).call(this,{type:"failed",failureCount:f,error:g})},onPause:()=>{zi(this,ec,cu).call(this,{type:"pause"})},onContinue:()=>{zi(this,ec,cu).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),Oe(this,Zi).start()}},i1=new WeakMap,s1=new WeakMap,ca=new WeakMap,Zi=new WeakMap,Kv=new WeakMap,_h=new WeakMap,ec=new WeakSet,cu=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Wxe(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return r7(i)&&i.revert&&Oe(this,s1)?{...Oe(this,s1),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),gs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Oe(this,ca).notify({query:this,type:"updated",action:e})})},H$);function Wxe(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jz(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Hxe(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Jc,q$,qxe=(q$=class extends z4{constructor(e={}){super();Fr(this,Jc);this.config=e,pr(this,Jc,new Map)}build(e,r,n){const i=r.queryKey,s=r.queryHash??RS(i,r);let o=this.get(s);return o||(o=new zxe({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){Oe(this,Jc).has(e.queryHash)||(Oe(this,Jc).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=Oe(this,Jc).get(e.queryHash);r&&(e.destroy(),r===e&&Oe(this,Jc).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){gs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Oe(this,Jc).get(e)}getAll(){return[...Oe(this,Jc).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>t$(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>t$(e,n)):r}notify(e){gs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){gs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){gs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jc=new WeakMap,q$),Xc,ds,Ah,el,md,V$,Vxe=(V$=class extends Wz{constructor(e){super();Fr(this,el);Fr(this,Xc);Fr(this,ds);Fr(this,Ah);this.mutationId=e.mutationId,pr(this,ds,e.mutationCache),pr(this,Xc,[]),this.state=e.state||Kxe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Oe(this,Xc).includes(e)||(Oe(this,Xc).push(e),this.clearGcTimeout(),Oe(this,ds).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){pr(this,Xc,Oe(this,Xc).filter(r=>r!==e)),this.scheduleGc(),Oe(this,ds).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Oe(this,Xc).length||(this.state.status==="pending"?this.scheduleGc():Oe(this,ds).remove(this))}continue(){var e;return((e=Oe(this,Ah))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,l,d,f,g,v,x,P,M,N,E,$,L,j,H,I;pr(this,Ah,zz({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(T,B)=>{zi(this,el,md).call(this,{type:"failed",failureCount:T,error:B})},onPause:()=>{zi(this,el,md).call(this,{type:"pause"})},onContinue:()=>{zi(this,el,md).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Oe(this,ds).canRun(this)}));const r=this.state.status==="pending",n=!Oe(this,Ah).canStart();try{if(!r){zi(this,el,md).call(this,{type:"pending",variables:e,isPaused:n}),await((s=(i=Oe(this,ds).config).onMutate)==null?void 0:s.call(i,e,this));const B=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));B!==this.state.context&&zi(this,el,md).call(this,{type:"pending",context:B,variables:e,isPaused:n})}const T=await Oe(this,Ah).start();return await((l=(c=Oe(this,ds).config).onSuccess)==null?void 0:l.call(c,T,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,T,e,this.state.context)),await((v=(g=Oe(this,ds).config).onSettled)==null?void 0:v.call(g,T,null,this.state.variables,this.state.context,this)),await((P=(x=this.options).onSettled)==null?void 0:P.call(x,T,null,e,this.state.context)),zi(this,el,md).call(this,{type:"success",data:T}),T}catch(T){try{throw await((N=(M=Oe(this,ds).config).onError)==null?void 0:N.call(M,T,e,this.state.context,this)),await(($=(E=this.options).onError)==null?void 0:$.call(E,T,e,this.state.context)),await((j=(L=Oe(this,ds).config).onSettled)==null?void 0:j.call(L,void 0,T,this.state.variables,this.state.context,this)),await((I=(H=this.options).onSettled)==null?void 0:I.call(H,void 0,T,e,this.state.context)),T}finally{zi(this,el,md).call(this,{type:"error",error:T})}}finally{Oe(this,ds).runNext(this)}}},Xc=new WeakMap,ds=new WeakMap,Ah=new WeakMap,el=new WeakSet,md=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),gs.batch(()=>{Oe(this,Xc).forEach(n=>{n.onMutationUpdate(e)}),Oe(this,ds).notify({mutation:this,type:"updated",action:e})})},V$);function Kxe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var po,Gv,K$,Gxe=(K$=class extends z4{constructor(e={}){super();Fr(this,po);Fr(this,Gv);this.config=e,pr(this,po,new Map),pr(this,Gv,Date.now())}build(e,r,n){const i=new Vxe({mutationCache:this,mutationId:++V3(this,Gv)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){const r=Dy(e),n=Oe(this,po).get(r)??[];n.push(e),Oe(this,po).set(r,n),this.notify({type:"added",mutation:e})}remove(e){var n;const r=Dy(e);if(Oe(this,po).has(r)){const i=(n=Oe(this,po).get(r))==null?void 0:n.filter(s=>s!==e);i&&(i.length===0?Oe(this,po).delete(r):Oe(this,po).set(r,i))}this.notify({type:"removed",mutation:e})}canRun(e){var n;const r=(n=Oe(this,po).get(Dy(e)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}runNext(e){var n;const r=(n=Oe(this,po).get(Dy(e)))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){gs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...Oe(this,po).values()].flat()}find(e){const r={exact:!0,...e};return this.getAll().find(n=>r$(r,n))}findAll(e={}){return this.getAll().filter(r=>r$(e,r))}notify(e){gs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return gs.batch(()=>Promise.all(e.map(r=>r.continue().catch(Xa))))}},po=new WeakMap,Gv=new WeakMap,K$);function Dy(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function s$(t){return{onFetch:(e,r)=>{var d,f,g,v,x;const n=e.options,i=(g=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,s=((v=e.state.data)==null?void 0:v.pages)||[],o=((x=e.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let P=!1;const M=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(e.signal.aborted?P=!0:e.signal.addEventListener("abort",()=>{P=!0}),e.signal)})},N=Bz(e.options,e.fetchOptions),E=async($,L,j)=>{if(P)return Promise.reject();if(L==null&&$.pages.length)return Promise.resolve($);const H={queryKey:e.queryKey,pageParam:L,direction:j?"backward":"forward",meta:e.options.meta};M(H);const I=await N(H),{maxPages:T}=e.options,B=j?Lxe:Dxe;return{pages:B($.pages,I,T),pageParams:B($.pageParams,L,T)}};if(i&&s.length){const $=i==="backward",L=$?Zxe:o$,j={pages:s,pageParams:o},H=L(n,j);a=await E(j,H,$)}else{const $=t??s.length;do{const L=c===0?o[0]??n.initialPageParam:o$(n,a);if(c>0&&L==null)break;a=await E(a,L),c++}while(c<$)}return a};e.options.persister?e.fetchFn=()=>{var P,M;return(M=(P=e.options).persister)==null?void 0:M.call(P,l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=l}}}function o$(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function Zxe(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var $n,Md,$d,o1,a1,Od,c1,l1,G$,Qxe=(G$=class{constructor(t={}){Fr(this,$n);Fr(this,Md);Fr(this,$d);Fr(this,o1);Fr(this,a1);Fr(this,Od);Fr(this,c1);Fr(this,l1);pr(this,$n,t.queryCache||new qxe),pr(this,Md,t.mutationCache||new Gxe),pr(this,$d,t.defaultOptions||{}),pr(this,o1,new Map),pr(this,a1,new Map),pr(this,Od,0)}mount(){V3(this,Od)._++,Oe(this,Od)===1&&(pr(this,c1,Uz.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,$n).onFocus())})),pr(this,l1,s6.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,$n).onOnline())})))}unmount(){var t,e;V3(this,Od)._--,Oe(this,Od)===0&&((t=Oe(this,c1))==null||t.call(this),pr(this,c1,void 0),(e=Oe(this,l1))==null||e.call(this),pr(this,l1,void 0))}isFetching(t){return Oe(this,$n).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Oe(this,Md).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Oe(this,$n).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const r=this.defaultQueryOptions(t),n=Oe(this,$n).build(this,r);return t.revalidateIfStale&&n.isStaleByTime(e$(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(e)}}getQueriesData(t){return Oe(this,$n).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),i=Oe(this,$n).get(n.queryHash),s=i==null?void 0:i.state.data,o=Rxe(e,s);if(o!==void 0)return Oe(this,$n).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return gs.batch(()=>Oe(this,$n).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Oe(this,$n).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=Oe(this,$n);gs.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=Oe(this,$n),n={type:"active",...t};return gs.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(n,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},n=gs.batch(()=>Oe(this,$n).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(Xa).catch(Xa)}invalidateQueries(t={},e={}){return gs.batch(()=>{if(Oe(this,$n).findAll(t).forEach(n=>{n.invalidate()}),t.refetchType==="none")return Promise.resolve();const r={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(r,e)})}refetchQueries(t={},e){const r={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},n=gs.batch(()=>Oe(this,$n).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Xa)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Xa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=Oe(this,$n).build(this,e);return r.isStaleByTime(e$(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Xa).catch(Xa)}fetchInfiniteQuery(t){return t.behavior=s$(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Xa).catch(Xa)}ensureInfiniteQueryData(t){return t.behavior=s$(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return s6.isOnline()?Oe(this,Md).resumePausedMutations():Promise.resolve()}getQueryCache(){return Oe(this,$n)}getMutationCache(){return Oe(this,Md)}getDefaultOptions(){return Oe(this,$d)}setDefaultOptions(t){pr(this,$d,t)}setQueryDefaults(t,e){Oe(this,o1).set(Uv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Oe(this,o1).values()];let r={};return e.forEach(n=>{jv(t,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(t,e){Oe(this,a1).set(Uv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Oe(this,a1).values()];let r={};return e.forEach(n=>{jv(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Oe(this,$d).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=RS(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===Lz&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Oe(this,$d).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Oe(this,$n).clear(),Oe(this,Md).clear()}},$n=new WeakMap,Md=new WeakMap,$d=new WeakMap,o1=new WeakMap,a1=new WeakMap,Od=new WeakMap,c1=new WeakMap,l1=new WeakMap,G$),Hz=Ye.createContext(void 0),ETe=t=>{const e=Ye.useContext(Hz);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Yxe=({client:t,children:e})=>(Ye.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Q.jsx(Hz.Provider,{value:t,children:e}));function qz(t,e){return`https://rpc.walletconnect.org/v1/?chainId=${e}:${t}`}const Vz={id:"eip155:1",chainId:1,name:"Ethereum",currency:"ETH",explorerUrl:"https://etherscan.io",rpcUrl:qz(1,"eip155"),chainNamespace:"eip155"},Kz={id:"eip155:10",chainId:10,name:"Optimism",currency:"ETH",explorerUrl:"https://optimistic.etherscan.io",rpcUrl:qz(10,"eip155"),chainNamespace:"eip155"};function ts(t,e,r){const n=t[e.name];if(typeof n=="function")return n;const i=t[r];return typeof i=="function"?i:s=>e(t,s)}const mb="2.13.7",Jxe=()=>`@wagmi/core@${mb}`;var Gz=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},o6,Zz;class Ac extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Jxe()}constructor(e,r={}){var s;super(),o6.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=r.cause instanceof Ac?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof Ac&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` +`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return Gz(this,o6,"m",Zz).call(this,this,e)}}o6=new WeakSet,Zz=function t(e,r){return r!=null&&r(e)?e:e.cause?Gz(this,o6,"m",t).call(this,e.cause,r):e};class v0 extends Ac{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Xxe extends Ac{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Qz extends Ac{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class e9e extends Ac{constructor({address:e,connector:r}){super(`Account "${e}" not found for connector "${r.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class t9e extends Ac{constructor({connectionChainId:e,connectorChainId:r}){super(`The current chain of the connector (id: ${r}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class r9e extends Ac{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function a$(t,e){var n;let r;if(typeof e.connector=="function"?r=t._internal.connectors.setup(e.connector):r=e.connector,r.uid===t.state.current)throw new Xxe;try{t.setState(o=>({...o,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const i=await r.connect({chainId:e.chainId}),s=i.accounts;return r.emitter.off("connect",t._internal.events.connect),r.emitter.on("change",t._internal.events.change),r.emitter.on("disconnect",t._internal.events.disconnect),await((n=t.storage)==null?void 0:n.setItem("recentConnectorId",r.id)),t.setState(o=>({...o,connections:new Map(o.connections).set(r.uid,{accounts:s,chainId:i.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:s,chainId:i.chainId}}catch(i){throw t.setState(s=>({...s,status:s.current?"connected":"disconnected"})),i}}async function j2(t,e={}){let r;if(e.connector){const{connector:l}=e;if(t.state.status==="reconnecting"&&!l.getAccounts&&!l.getChainId)throw new r9e({connector:l});const[d,f]=await Promise.all([l.getAccounts(),l.getChainId()]);r={accounts:d,chainId:f,connector:l}}else r=t.state.connections.get(t.state.current);if(!r)throw new Qz;const n=e.chainId??r.chainId,i=await r.connector.getChainId();if(i!==r.chainId)throw new t9e({connectionChainId:r.chainId,connectorChainId:i});const s=r.connector;if(s.getClient)return s.getClient({chainId:n});const o=$c(e.account??r.accounts[0]);if(o.address=Vs(o.address),e.account&&!r.accounts.some(l=>l.toLowerCase()===o.address.toLowerCase()))throw new e9e({address:o.address,connector:s});const a=t.chains.find(l=>l.id===n),c=await r.connector.getProvider({chainId:n});return $z({account:o,chain:a,name:"Connector Client",transport:l=>axe(c)({...l,retryCount:0})})}async function n9e(t,e={}){var i,s;let r;if(e.connector)r=e.connector;else{const{connections:o,current:a}=t.state,c=o.get(a);r=c==null?void 0:c.connector}const n=t.state.connections;r&&(await r.disconnect(),r.emitter.off("change",t._internal.events.change),r.emitter.off("disconnect",t._internal.events.disconnect),r.emitter.on("connect",t._internal.events.connect),n.delete(r.uid)),t.setState(o=>{if(n.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const a=n.values().next().value;return{...o,connections:new Map(n),current:a.connector.uid}});{const o=t.state.current;if(!o)return;const a=(i=t.state.connections.get(o))==null?void 0:i.connector;if(!a)return;await((s=t.storage)==null?void 0:s.setItem("recentConnectorId",a.id))}}async function i9e(t,e){const{chainId:r,connector:n,...i}=e;let s;e.account?s=e.account:s=(await j2(t,{account:e.account,chainId:r,connector:n})).account;const o=t.getClient({chainId:r});return ts(o,wS,"estimateGas")({...i,account:s})}function Yz(t){return typeof t=="number"?t:t==="wei"?0:Math.abs(w6e[t])}function F2(t){const e=t.state.current,r=t.state.connections.get(e),n=r==null?void 0:r.accounts,i=n==null?void 0:n[0],s=t.chains.find(a=>a.id===(r==null?void 0:r.chainId)),o=t.state.status;switch(o){case"connected":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}async function s9e(t,e){const{allowFailure:r=!0,chainId:n,contracts:i,...s}=e,o=t.getClient({chainId:n});return ts(o,q8e,"multicall")({allowFailure:r,contracts:i,...s})}function o9e(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,w0,"readContract")(n)}async function a9e(t,e){var a;const{allowFailure:r=!0,blockNumber:n,blockTag:i,...s}=e,o=e.contracts;try{const c={};for(const[g,v]of o.entries()){const x=v.chainId??t.state.chainId;c[x]||(c[x]=[]),(a=c[x])==null||a.push({contract:v,index:g})}const l=()=>Object.entries(c).map(([g,v])=>s9e(t,{...s,allowFailure:r,blockNumber:n,blockTag:i,chainId:Number.parseInt(g),contracts:v.map(({contract:x})=>x)})),d=(await Promise.all(l())).flat(),f=Object.values(c).flatMap(g=>g.map(({index:v})=>v));return d.reduce((g,v,x)=>(g&&(g[f[x]]=v),g),[])}catch(c){if(c instanceof CS)throw c;const l=()=>o.map(d=>o9e(t,{...d,blockNumber:n,blockTag:i}));return r?(await Promise.allSettled(l())).map(d=>d.status==="fulfilled"?{result:d.value,status:"success"}:{error:d.reason,result:void 0,status:"failure"}):await Promise.all(l())}}async function c9e(t,e){const{address:r,blockNumber:n,blockTag:i,chainId:s,token:o,unit:a="ether"}=e;if(o)try{return c$(t,{balanceAddress:r,chainId:s,symbolType:"string",tokenAddress:o})}catch(g){if(g instanceof CS){const v=await c$(t,{balanceAddress:r,chainId:s,symbolType:"bytes32",tokenAddress:o}),x=IF(Pg(v.symbol,{dir:"right"}));return{...v,symbol:x}}throw g}const c=t.getClient({chainId:s}),d=await ts(c,tz,"getBalance")(n?{address:r,blockNumber:n}:{address:r,blockTag:i}),f=t.chains.find(g=>g.id===s)??c.chain;return{decimals:f.nativeCurrency.decimals,formatted:L2(d,Yz(a)),symbol:f.nativeCurrency.symbol,value:d}}async function c$(t,e){const{balanceAddress:r,chainId:n,symbolType:i,tokenAddress:s,unit:o}=e,a={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:i}]}],address:s},[c,l,d]=await a9e(t,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[r],chainId:n},{...a,functionName:"decimals",chainId:n},{...a,functionName:"symbol",chainId:n}]}),f=L2(c??"0",Yz(o??l));return{decimals:l,formatted:f,symbol:d,value:c}}function Fv(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Fv(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!Fv(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let Ly=[];function l9e(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||Fv(Ly,e)?Ly:(Ly=e,e)}let n7=[];function u9e(t){const e=t.connectors;return Fv(n7,e)?n7:(n7=e,e)}function d9e(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,b8e,"getEnsAddress")(n)}function l$(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,$8e,"getEnsAvatar")(n)}function f9e(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return ts(i,O8e,"getEnsName")(n)}async function h9e(t,e){const{account:r,chainId:n,...i}=e,s=r??F2(t).address,o=t.getClient({chainId:n});return ts(o,yS,"prepareTransactionRequest")({...i,...s?{account:s}:{}})}let i7=!1;async function u$(t,e={}){var l,d;if(i7)return[];i7=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const f of e.connectors){let g;typeof f=="function"?g=t._internal.connectors.setup(f):g=f,r.push(g)}else r.push(...t.connectors);let n;try{n=await((d=t.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((f,g)=>(i[f.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const f of s){const g=await f.getProvider().catch(()=>{});if(!g||c.some(P=>P===g)||!await f.isAuthorized())continue;const x=await f.connect({isReconnecting:!0}).catch(()=>null);x&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(P=>{const M=new Map(o?P.connections:new Map).set(f.uid,{accounts:x.accounts,chainId:x.chainId,connector:f});return{...P,current:o?P.current:f.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:f}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),i7=!1,a}async function p9e(t,e){const{account:r,chainId:n,connector:i,gas:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await j2(t,{account:r,chainId:n,connector:i});const{connector:c}=F2(t),l=await(async()=>{var g;if(!(!("data"in e)||!e.data)&&!((g=i??c)!=null&&g.supportsSimulation)&&s!==null)return s===void 0?ts(a,wS,"estimateGas")({...o,account:r,chain:n?{id:n}:null}):s})();return await ts(a,az,"sendTransaction")({...o,...r?{account:r}:{},gas:l,chain:n?{id:n}:null})}async function g9e(t,e){const{account:r,connector:n,...i}=e;let s;return typeof r=="object"&&r.type==="local"?s=t.getClient():s=await j2(t,{account:r,connector:n}),ts(s,ixe,"signMessage")({...i,...r?{account:r}:{}})}async function m9e(t,e){const{abi:r,chainId:n,connector:i,...s}=e;let o;e.account?o=e.account:o=(await j2(t,{chainId:n,connector:i})).account;const a=t.getClient({chainId:n}),c=ts(a,sxe,"simulateContract"),{result:l,request:d}=await c({...s,abi:r,account:o});return{chainId:a.chain.id,result:l,request:{__mode:"prepared",...d,chainId:n}}}async function w9e(t,e){var i;const{connector:r}=e,n=t.state.connections.get(r.uid);if(!n)throw new Qz;return await((i=t.storage)==null?void 0:i.setItem("recentConnectorId",r.id)),t.setState(s=>({...s,current:r.uid})),{accounts:n.accounts,chainId:n.chainId}}class _d extends Ac{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class v9e extends Ac{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function y9e(t,e){var o;const{addEthereumChainParameter:r,chainId:n}=e,i=t.state.connections.get(((o=e.connector)==null?void 0:o.uid)??t.state.current);if(i){const a=i.connector;if(!a.switchChain)throw new v9e({connector:a});return await a.switchChain({addEthereumChainParameter:r,chainId:n})}const s=t.chains.find(a=>a.id===n);if(!s)throw new v0;return t.setState(a=>({...a,chainId:n})),s}function b9e(t,e){const{onChange:r}=e;return t.subscribe(()=>F2(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return Fv(o,c)&&(s==null?void 0:s.id)===(a==null?void 0:a.id)&&(s==null?void 0:s.uid)===(a==null?void 0:a.uid)}})}function x9e(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}async function C9e(t,e){const{chainId:r,timeout:n=0,...i}=e,s=t.getClient({chainId:r}),a=await ts(s,nxe,"waitForTransactionReceipt")({...i,timeout:n});if(a.status==="reverted"){const l=await ts(s,Pz,"getTransaction")({hash:a.transactionHash}),f=await ts(s,SS,"call")({...l,gasPrice:l.type!=="eip1559"?l.gasPrice:void 0,maxFeePerGas:l.type==="eip1559"?l.maxFeePerGas:void 0,maxPriorityFeePerGas:l.type==="eip1559"?l.maxPriorityFeePerGas:void 0}),g=f!=null&&f.data?IF(`0x${f.data.substring(138)}`):"unknown reason";throw new Error(g)}return{...a,chainId:s.chain.id}}async function _9e(t,e){const{account:r,chainId:n,connector:i,__mode:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await j2(t,{account:r,chainId:n,connector:i});const{connector:c}=F2(t);let l;if(s==="prepared"||c!=null&&c.supportsSimulation)l=o;else{const{request:g}=await m9e(t,{...o,account:r,chainId:n});l=g}return await ts(a,oxe,"writeContract")({...l,...r?{account:r}:{},chain:n?{id:n}:null})}const A9e=/(rabby|trustwallet)/,E9e={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:wb(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return wb(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const r=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const n of r)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,r;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(r=t.phantom)==null?void 0:r.ethereum:wb(t,"isPhantom")}}};H4.type="injected";function H4(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:r}=t;function n(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...E9e[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l==null?void 0:l.ethereum}}}let i,s,o,a;return c=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},get supportsSimulation(){return A9e.test(this.id.toLowerCase())},type:H4.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&t.target&&(o||(o=this.onConnect.bind(this),l.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:d}={}){var v,x,P,M,N,E;const f=await this.getProvider();if(!f)throw new _d;let g=[];if(d)g=await this.getAccounts().catch(()=>[]);else if(e)try{g=(M=(P=(x=(v=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:v.caveats)==null?void 0:x[0])==null?void 0:P.value)==null?void 0:M.map(L=>Vs(L)),g.length>0&&(g=await this.getAccounts())}catch($){const L=$;if(L.code===pn.code)throw new pn(L);if(L.code===Xd.code)throw L}try{!(g!=null&&g.length)&&!d&&(g=(await f.request({method:"eth_requestAccounts"})).map(j=>Vs(j))),o&&(f.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),f.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a));let $=await this.getChainId();if(l&&$!==l){const L=await this.switchChain({chainId:l}).catch(j=>{if(j.code===pn.code)throw j;return{id:$}});$=(L==null?void 0:L.id)??$}return e&&await((N=c.storage)==null?void 0:N.removeItem(`${this.id}.disconnected`)),t.target||await((E=c.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:g,chainId:$}}catch($){const L=$;throw L.code===pn.code?new pn(L):L.code===Xd.code?new Xd(L):L}},async disconnect(){var d,f;const l=await this.getProvider();if(!l)throw new _d;s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o));try{await Nz(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((d=c.storage)==null?void 0:d.setItem(`${this.id}.disconnected`,!0)),t.target||await((f=c.storage)==null?void 0:f.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new _d;return(await l.request({method:"eth_accounts"})).map(f=>Vs(f))},async getChainId(){const l=await this.getProvider();if(!l)throw new _d;const d=await l.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let l;const d=n();return typeof d.provider=="function"?l=d.provider(window):typeof d.provider=="string"?l=wb(window,d.provider):l=d.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){var l,d;try{if(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!t.target&&!await((d=c.storage)==null?void 0:d.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(r!==void 0&&r!==!1){const x=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",x),!!await this.getProvider()),P=typeof r=="number"?r:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(N=>window.addEventListener("ethereum#initialized",()=>N(x()),{once:!0}))]:[],new Promise(N=>setTimeout(()=>N(x()),P))]))return!0}throw new _d}return!!(await i6(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){var v,x,P,M;const f=await this.getProvider();if(!f)throw new _d;const g=c.chains.find(N=>N.id===d);if(!g)throw new no(new v0);try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),new Promise(N=>c.emitter.once("change",({chainId:E})=>{E===d&&N()}))]),g}catch(N){const E=N;if(E.code===4902||((x=(v=E==null?void 0:E.data)==null?void 0:v.originalError)==null?void 0:x.code)===4902)try{const{default:$,...L}=g.blockExplorers??{};let j;l!=null&&l.blockExplorerUrls?j=l.blockExplorerUrls:$&&(j=[$.url,...Object.values(L).map(B=>B.url)]);let H;(P=l==null?void 0:l.rpcUrls)!=null&&P.length?H=l.rpcUrls:H=[((M=g.rpcUrls.default)==null?void 0:M.http[0])??""];const I={blockExplorerUrls:j,chainId:gr(d),chainName:(l==null?void 0:l.chainName)??g.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??g.nativeCurrency,rpcUrls:H};if(await f.request({method:"wallet_addEthereumChain",params:[I]}),await this.getChainId()!==d)throw new pn(new Error("User rejected switch after adding network."));return g}catch($){throw new pn($)}throw E.code===pn.code?new pn(E):new no(E)}},async onAccountsChanged(l){var d;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f}),e&&await((d=c.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(f=>Vs(f))})},onChainChanged(l){const d=Number(l);c.emitter.emit("change",{chainId:d})},async onConnect(l){const d=await this.getAccounts();if(d.length===0)return;const f=Number(l.chainId);c.emitter.emit("connect",{accounts:d,chainId:f});const g=await this.getProvider();g&&(o&&(g.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),g.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),g.on("disconnect",a)))},async onDisconnect(l){const d=await this.getProvider();l&&l.code===1013&&d&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),d&&(s&&(d.removeListener("chainChanged",s),s=void 0),a&&(d.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),d.on("connect",o))))}})}function wb(t,e){function r(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const n=t.ethereum;if(n!=null&&n.providers)return n.providers.find(i=>r(i));if(n&&r(n))return n}class S9e{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new Exe})}on(e,r){this._emitter.on(e,r)}once(e,r){this._emitter.once(e,r)}off(e,r){this._emitter.off(e,r)}emit(e,...r){const n=r[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function I9e(t){return new S9e(t)}function T9e(t,e){return JSON.parse(t,(r,n)=>{let i=n;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(r,i))??i})}function d$(t,e){return t.slice(0,e).join(".")||"."}function f$(t,e){const{length:r}=t;for(let n=0;n{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},n),r??void 0)}function P9e(t){const{deserialize:e=T9e,key:r="wagmi",serialize:n=R9e,storage:i=Jz}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:r,async getItem(o,a){const c=i.getItem(`${r}.${o}`),l=await s(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${r}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,n(a)))},async removeItem(o){await s(i.removeItem(`${r}.${o}`))}}}const Jz={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},O_=256;let By=O_,Uy;function N9e(t=11){if(!Uy||By+t>O_*2){Uy="",By=0;for(let e=0;es.chains),c=t7(()=>[...s.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(d))??[]].map(l));function l(j){var T;const H=I9e(N9e()),I={...j({emitter:H,chains:a.getState(),storage:r,transports:s.transports}),emitter:H,uid:H.uid};return H.on("connect",$),(T=I.setup)==null||T.call(I),I}function d(j){const{info:H}=j,I=j.provider;return H4({target:{...H,id:H.rdns,provider:I}})}const f=new Map;function g(j={}){const H=j.chainId??M.getState().chainId,I=a.getState().find(B=>B.id===H);if(j.chainId&&!I)throw new v0;{const B=f.get(M.getState().chainId);if(B&&!I)return B;if(!I)throw new v0}{const B=f.get(H);if(B)return B}let T;if(s.client)T=s.client({chain:I});else{const B=I.id,K=a.getState().map(p=>p.id),U={},C=Object.entries(s);for(const[p,m]of C)if(!(p==="chains"||p==="client"||p==="connectors"||p==="transports"))if(typeof m=="object")if(B in m)U[p]=m[B];else{if(K.some(_=>_ in m))continue;U[p]=m}else U[p]=m;T=$z({...U,chain:I,batch:U.batch??{multicall:!0},transport:p=>s.transports[B]({...p,connectors:c})})}return f.set(H,T),T}function v(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let x;const P="0.0.0-canary-";mb.startsWith(P)?x=Number.parseInt(mb.replace(P,"")):x=Number.parseInt(mb.split(".")[0]??"0");const M=t7(wxe(r?Cxe(v,{migrate(j,H){if(H===x)return j;const I=v(),T=N(j,I.chainId);return{...I,chainId:T}},name:"store",partialize(j){return{connections:{__type:"Map",value:Array.from(j.connections.entries()).map(([H,I])=>{const{id:T,name:B,type:K,uid:U}=I.connector;return[H,{...I,connector:{id:T,name:B,type:K,uid:U}}]})},chainId:j.chainId,current:j.current}},merge(j,H){typeof j=="object"&&j&&"status"in j&&delete j.status;const I=N(j,H.chainId);return{...H,...j,chainId:I}},skipHydration:i,storage:r,version:x}):v));function N(j,H){return j&&typeof j=="object"&&"chainId"in j&&typeof j.chainId=="number"&&a.getState().some(I=>I.id===j.chainId)?j.chainId:H}n&&M.subscribe(({connections:j,current:H})=>{var I;return H?(I=j.get(H))==null?void 0:I.chainId:void 0},j=>{if(a.getState().some(I=>I.id===j))return M.setState(I=>({...I,chainId:j??I.chainId}))}),o==null||o.subscribe(j=>{const H=new Map;for(const T of c.getState())H.set(T.id,!0);const I=[];for(const T of j){const B=l(d(T));H.has(B.id)||I.push(B)}r&&!M.persist.hasHydrated()||c.setState(T=>[...T,...I],!0)});function E(j){M.setState(H=>{const I=H.connections.get(j.uid);return I?{...H,connections:new Map(H.connections).set(j.uid,{accounts:j.accounts??I.accounts,chainId:j.chainId??I.chainId,connector:I.connector})}:H})}function $(j){M.getState().status==="connecting"||M.getState().status==="reconnecting"||M.setState(H=>{const I=c.getState().find(T=>T.uid===j.uid);return I?(I.emitter.listenerCount("connect")&&I.emitter.off("connect",E),I.emitter.listenerCount("change")||I.emitter.on("change",E),I.emitter.listenerCount("disconnect")||I.emitter.on("disconnect",L),{...H,connections:new Map(H.connections).set(j.uid,{accounts:j.accounts,chainId:j.chainId,connector:I}),current:j.uid,status:"connected"}):H})}function L(j){M.setState(H=>{const I=H.connections.get(j.uid);if(I){const B=I.connector;B.emitter.listenerCount("change")&&I.connector.emitter.off("change",E),B.emitter.listenerCount("disconnect")&&I.connector.emitter.off("disconnect",L),B.emitter.listenerCount("connect")||I.connector.emitter.on("connect",$)}if(H.connections.delete(j.uid),H.connections.size===0)return{...H,connections:new Map,current:null,status:"disconnected"};const T=H.connections.values().next().value;return{...H,connections:new Map(H.connections),current:T.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:r,getClient:g,get state(){return M.getState()},setState(j){let H;typeof j=="function"?H=j(M.getState()):H=j;const I=v();typeof H!="object"&&(H=I),Object.keys(I).some(B=>!(B in H))&&(H=I),M.setState(H,!0)},subscribe(j,H,I){return M.subscribe(j,H,I?{...I,fireImmediately:I.emitImmediately}:void 0)},_internal:{mipd:o,store:M,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(j){const H=typeof j=="function"?j(a.getState()):j;if(H.length!==0)return a.setState(H,!0)},subscribe(j){return a.subscribe(j)}},connectors:{providerDetailToConnector:d,setup:l,setState(j){return c.setState(typeof j=="function"?j(c.getState()):j,!0)},subscribe(j){return c.subscribe(j)}},events:{change:E,connect:$,disconnect:L}}}}const h$=J8e({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});async function $9e(t){var i;if(!t)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const e=await(t==null?void 0:t.getProvider()),r=(i=e==null?void 0:e.session)==null?void 0:i.namespaces,n=[];return r&&Object.keys(r).forEach(s=>{var a;const o=(a=r==null?void 0:r[s])==null?void 0:a.chains;o&&n.push(...o)}),{supportsAllNetworks:!0,approvedCaipNetworkIds:n}}function O9e(){return{supportsAllNetworks:!0,approvedCaipNetworkIds:ha.WalletConnectRpcChainIds.map(t=>`${cr.EIP155}:${t}`)}}function D9e({chain:t,projectId:e}){var i,s;const r=Ue.getBlockchainApiUrl(),n=(s=(i=t.rpcUrls[0])==null?void 0:i.http)==null?void 0:s[0];return ha.WalletConnectRpcChainIds.includes(t.id)?cxe([X9(`${r}/v1/?chainId=${cr.EIP155}:${t.id}&projectId=${e}`,{fetchOptions:{headers:{"Content-Type":"text/plain"}}}),X9(n)]):X9(n)}function p$(t){if(!t)throw new Error("No CAIP address provided");const e=t.split(":")[2];if(!e)throw new Error("Invalid CAIP address");return e}function Xz(t){return t.map(r=>({blockExplorers:{default:{apiUrl:"",name:"",url:r.explorerUrl||""}},fees:void 0,formatters:void 0,id:Number(r.chainId),name:r.name,nativeCurrency:{decimals:18,name:r.currency,symbol:r.currency},rpcUrls:{default:{http:[r.rpcUrl]}},serializers:void 0}))}var L9e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxRE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6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const g$=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),m$=4;function B9e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let j=1;j>--c&1}const f=31,g=2**f,v=g>>>1,x=v>>1,P=g-1;let M=0;for(let j=0;j1;){let K=H+I>>>1;j>>1|d(),T=T<<1^v,B=(B^v)<<1|v|1;E=T,$=1+B-T}let L=n-4;return N.map(j=>{switch(j-L){case 3:return L+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return L+256+(t[a++]<<8|t[a++]);case 1:return L+t[a++];default:return j-1}})}function U9e(t){let e=0;return()=>t[e++]}function eW(t){return U9e(B9e(j9e(t)))}function j9e(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i=8&&(n[s++]=a>>(o-=8));return n}function F9e(t){return t&1?~t>>1:t>>1}function z9e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=zv(t);if(e.length)return e})}function rW(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(W9e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(H9e(r,t))}return e.flat()}function Wv(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function nW(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function W9e(t,e){let r=1+e(),n=e(),i=Wv(e);return nW(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((d,f)=>{let g=f*n;return[c+f*r,l.map(v=>v+g)]})})}function H9e(t,e){let r=1+e();return nW(r,1+t,e).map(i=>[i[0],i.slice(1)])}function q9e(t){let e=[],r=zv(t);return i(n([]),[]),e;function n(s){let o=t(),a=Wv(()=>{let c=zv(t).map(l=>r[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let d of l.Q)i(l,[...a,d],c)}}}function V9e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function iW(t){return`{${V9e(t)}}`}function K9e(t){let e=[];for(let r=0,n=t.length;r>24&255}function aW(t){return t&16777215}let D_,w$,L_,vb;function t7e(){let t=eW(Z9e);D_=new Map(tW(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),w$=new Set(zv(t)),L_=new Map,vb=new Map;for(let[e,r]of rW(t)){if(!w$.has(e)&&r.length==2){let[n,i]=r,s=vb.get(n);s||(s=new Map,vb.set(n,s)),s.set(i,e)}L_.set(e,r.reverse())}}function cW(t){return t>=Hv&&t=a6&&t=c6&&el6&&e0&&i(l6+l)}else{let o=L_.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Bm(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=r7e(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function uW(t){return lW(t).map(aW)}function i7e(t){return n7e(lW(t))}const v$=45,dW=".",fW=65039,hW=1,Dp=t=>Array.from(t);function qv(t,e){return t.P.has(e)||t.Q.has(e)}class s7e extends Array{get is_emoji(){return!0}}let B_,pW,yh,U_,gW,Xp,s7,vp,mW,y$,j_;function PS(){if(B_)return;let t=eW(L9e);const e=()=>zv(t),r=()=>new Set(e());B_=new Map(rW(t)),pW=r(),yh=e(),U_=new Set(e().map(d=>yh[d])),yh=new Set(yh),gW=r(),r();let n=tW(t),i=t();const s=()=>new Set(e().flatMap(d=>n[d]).concat(e()));Xp=Wv(d=>{let f=Wv(t).map(g=>g+96);if(f.length){let g=d>=i;f[0]-=32,f=X1(f),g&&(f=`Restricted[${f}]`);let v=s(),x=s(),P=!t();return{N:f,P:v,Q:x,M:P,R:g}}}),s7=r(),vp=new Map;let o=e().concat(Dp(s7)).sort((d,f)=>d-f);o.forEach((d,f)=>{let g=t(),v=o[f]=g?o[f-g]:{V:[],M:new Map};v.V.push(d),s7.has(d)||vp.set(d,v)});for(let{V:d,M:f}of new Set(vp.values())){let g=[];for(let x of d){let P=Xp.filter(N=>qv(N,x)),M=g.find(({G:N})=>P.some(E=>N.has(E)));M||(M={G:new Set,V:[]},g.push(M)),M.V.push(x),P.forEach(N=>M.G.add(N))}let v=g.flatMap(x=>Dp(x.G));for(let{G:x,V:P}of g){let M=new Set(v.filter(N=>!x.has(N)));for(let N of P)f.set(N,M)}}let a=new Set,c=new Set;const l=d=>a.has(d)?c.add(d):a.add(d);for(let d of Xp){for(let f of d.P)l(f);for(let f of d.Q)l(f)}for(let d of a)!vp.has(d)&&!c.has(d)&&vp.set(d,hW);mW=new Set(Dp(a).concat(Dp(uW(a)))),y$=q9e(t).map(d=>s7e.from(d)).sort(G9e),j_=new Map;for(let d of y$){let f=[j_];for(let g of d){let v=f.map(x=>{let P=x.get(g);return P||(P=new Map,x.set(g,P)),P});g===fW?f.push(...v):f=v}for(let g of f)g.V=d}}function NS(t){return(wW(t)?"":`${MS(q4([t]))} `)+iW(t)}function MS(t){return`"${t}"‎`}function o7e(t){if(t.length>=4&&t[2]==v$&&t[3]==v$)throw new Error(`invalid label extension: "${X1(t.slice(0,4))}"`)}function a7e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function c7e(t){let e=t[0],r=g$.get(e);if(r)throw aw(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=K9e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=m7e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let d=o.output=a.flat();if(a7e(d),!(o.emoji=c>1||a[0].is_emoji)&&d.every(g=>g<128))o7e(d),l="ASCII";else{let g=a.flatMap(v=>v.is_emoji?[]:v);if(!g.length)l="Emoji";else{if(yh.has(d[0]))throw aw("leading combining mark");for(let P=1;Po.has(a)):Dp(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>qv(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function h7e(t){let e=Xp;for(let r of t){let n=e.filter(i=>qv(i,r));if(!n.length)throw Xp.some(i=>qv(i,r))?yW(e[0],r):vW(r);if(e=n,n.length==1)break}return e}function p7e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${MS(q4(e))}: ${i}`)}return X1(n)}).join(dW)}function vW(t){return new Error(`disallowed character: ${NS(t)}`)}function yW(t,e){let r=NS(e),n=Xp.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function aw(t){return new Error(`illegal placement: ${t}`)}function g7e(t,e){for(let r of e)if(!qv(t,r))throw yW(t,r);if(t.M){let r=uW(e);for(let n=1,i=r.length;nm$)throw new Error(`excessive non-spacing marks: ${MS(q4(r.slice(n-1,s)))} (${s-n}/${m$})`);n=s}}}function m7e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=v7e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(mW.has(o))i.push(o);else{let a=B_.get(o);if(a)i.push(...a);else if(!pW.has(o))throw vW(o)}}}return i.length&&n.push(e(i)),n}function w7e(t){return t.filter(e=>e!=fW)}function v7e(t,e){let r=j_,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}function b$(t){return u7e(t)}$S.type="walletConnect";function $S(t,e){const r=t.isNewChainsStale??!0;let n,i,s,o,a,c,l,d;return f=>({id:"walletConnect",name:"WalletConnect",type:$S.type,async setup(){const g=await this.getProvider().catch(()=>null);g&&(a||(a=this.onConnect.bind(this),g.on("connect",a)),l||(l=this.onSessionDelete.bind(this),g.on("session_delete",l)))},async connect({...g}={}){try{const v=await this.getProvider();if(!v)throw new _d;c||(c=this.onDisplayUri,v.on("display_uri",c));const x=await this.isChainsStale();if(v.session&&x&&await v.disconnect(),!v.session||x){const N=Jj.createNamespaces(t.networks);await v.connect({optionalNamespaces:N,..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(t.networks.map(E=>Number(E.chainId)))}const P=(await v.enable()).map(N=>Vs(N)),M=await this.getChainId();return c&&(v.removeListener("display_uri",c),c=void 0),a&&(v.removeListener("connect",a),a=void 0),s||(s=this.onAccountsChanged.bind(this),v.on("accountsChanged",s)),o||(o=this.onChainChanged.bind(this),v.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),v.on("disconnect",d)),l||(l=this.onSessionDelete.bind(this),v.on("session_delete",l)),{accounts:P,chainId:M}}catch(v){throw/(user rejected|connection request reset)/i.test(v==null?void 0:v.message)?new pn(v):v}},async disconnect(){const g=await this.getProvider();try{await(g==null?void 0:g.disconnect())}catch(v){if(!/No matching key/i.test(v.message))throw v}finally{o&&(g==null||g.removeListener("chainChanged",o),o=void 0),d&&(g==null||g.removeListener("disconnect",d),d=void 0),a||(a=this.onConnect.bind(this),g==null||g.on("connect",a)),s&&(g==null||g.removeListener("accountsChanged",s),s=void 0),l&&(g==null||g.removeListener("session_delete",l),l=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var P,M,N;const g=await this.getProvider();if(!((P=g==null?void 0:g.session)!=null&&P.namespaces))return[];const v=(N=(M=g==null?void 0:g.session)==null?void 0:M.namespaces.eip155)==null?void 0:N.accounts;return(v==null?void 0:v.map(E=>E.split(":")[2]))??[]},async getProvider({chainId:g}={}){var P,M,N;async function v(){var L;if(!t.networks.map(j=>Number(j.chainId)).length)return;const $=(L=e.universalAdapter)==null?void 0:L.getWalletConnectProvider();if(!$)throw new Error("Provider not found");return $}n||(i||(i=v()),n=await i,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY));const x=(P=e.getCaipNetwork())==null?void 0:P.chainId;if(g&&x!==g){const E=vr.getStoredActiveCaipNetwork();E&&E.chainNamespace==="eip155"?await((M=this.switchChain)==null?void 0:M.call(this,{chainId:Number(E.chainId)})):await((N=this.switchChain)==null?void 0:N.call(this,{chainId:g}))}return n},async getChainId(){var M,N,E,$;const g=(M=e.getCaipNetwork())==null?void 0:M.chainId;if(g)return g;const x=($=(E=(N=(await this.getProvider()).session)==null?void 0:N.namespaces.eip155)==null?void 0:E.chains)==null?void 0:$[0],P=t.networks.find(L=>L.id===x);return P==null?void 0:P.chainId},async isAuthorized(){try{const[g,v]=await Promise.all([this.getAccounts(),this.getProvider()]);return g.length?await this.isChainsStale()&&v.session?(await v.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:g,chainId:v}){var N,E;const x=await this.getProvider();if(!x)throw new _d;const P=t.networks.find($=>$.chainId===v),[M]=P?Xz([P]):[];if(!M)throw new no(new v0);try{P!=null&&P.id&&x.setDefaultChain(P==null?void 0:P.id),await x.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(v)}]}),f.emitter.emit("change",{chainId:Number(v)});const $=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...$,v]),M}catch($){const L=$;if(/(?:user rejected)/iu.test(L.message))throw new pn(L);try{let j;g!=null&&g.blockExplorerUrls?j=g.blockExplorerUrls:j=(N=M.blockExplorers)!=null&&N.default.url?[(E=M.blockExplorers)==null?void 0:E.default.url]:[];const H={blockExplorerUrls:j,chainId:gr(v),chainName:M.name,iconUrls:g==null?void 0:g.iconUrls,nativeCurrency:M.nativeCurrency,rpcUrls:M.rpcUrls.default.http};await x.request({method:"wallet_addEthereumChain",params:[H]});const I=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...I,v]),M}catch(j){throw new pn(j)}}},onAccountsChanged(g){g.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:g.map(v=>Vs(v))})},onChainChanged(g){const v=Number(g);f.emitter.emit("change",{chainId:v})},async onConnect(g){const v=Number(g.chainId),x=await this.getAccounts();f.emitter.emit("connect",{accounts:x,chainId:v})},async onDisconnect(g){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const v=await this.getProvider();s&&(v.removeListener("accountsChanged",s),s=void 0),o&&(v.removeListener("chainChanged",o),o=void 0),d&&(v.removeListener("disconnect",d),d=void 0),l&&(v.removeListener("session_delete",l),l=void 0),a||(a=this.onConnect.bind(this),v.on("connect",a))},onDisplayUri(g){f.emitter.emit("message",{type:"display_uri",data:g})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var x,P,M;if(!((x=n==null?void 0:n.session)!=null&&x.namespaces))return[];const g=(M=(P=n==null?void 0:n.session)==null?void 0:P.namespaces.eip155)==null?void 0:M.accounts;return(g==null?void 0:g.map(N=>Number.parseInt(N.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var v;const g=await((v=f.storage)==null?void 0:v.getItem(this.requestedChainsStorageKey))??[];return[...new Set(g)]},async isChainsStale(){if(!r)return!1;const g=f.chains.map(P=>P.id),v=this.getNamespaceChainsIds();if(v.length&&!v.some(P=>g.includes(P)))return!1;const x=await this.getRequestedChainsIds();return!g.every(P=>x.includes(Number(P)))},async setRequestedChainsIds(g){var v;await((v=f.storage)==null?void 0:v.setItem(this.requestedChainsStorageKey,g))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}V4.type="coinbaseWallet";function V4(t={}){return t.version==="3"||t.headlessMode?b7e(t):y7e(t)}function y7e(t){let e,r,n,i,s;return o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:V4.type,async connect({chainId:a}={}){try{const c=await this.getProvider(),l=(await c.request({method:"eth_requestAccounts"})).map(f=>Vs(f));n||(n=this.onAccountsChanged.bind(this),c.on("accountsChanged",n)),i||(i=this.onChainChanged.bind(this),c.on("chainChanged",i)),s||(s=this.onDisconnect.bind(this),c.on("disconnect",s));let d=await this.getChainId();if(a&&d!==a){const f=await this.switchChain({chainId:a}).catch(g=>{if(g.code===pn.code)throw g;return{id:d}});d=(f==null?void 0:f.id)??d}return{accounts:l,chainId:d}}catch(c){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(c.message)?new pn(c):c}},async disconnect(){var c;const a=await this.getProvider();n&&(a.removeListener("accountsChanged",n),n=void 0),i&&(a.removeListener("chainChanged",i),i=void 0),s&&(a.removeListener("disconnect",s),s=void 0),a.disconnect(),(c=a.close)==null||c.call(a)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>Vs(c))},async getChainId(){const c=await(await this.getProvider()).request({method:"eth_chainId"});return Number(c)},async getProvider(){if(!r){const a=await(async()=>{const{default:c}=await Qs(async()=>{const{default:l}=await import("./index-BK4Ob9ME.js").then(d=>d.i);return{default:l}},__vite__mapDeps([2,3]));return typeof c!="function"&&typeof c.default=="function"?c.default:c})();e=new a({...t,appChainIds:o.chains.map(c=>c.id)}),r=e.makeWeb3Provider({...t,options:t.preference??"all"})}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:c}){var f,g,v,x;const l=o.chains.find(P=>P.id===c);if(!l)throw new no(new v0);const d=await this.getProvider();try{return await d.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(l.id)}]}),l}catch(P){if(P.code===4902)try{let M;a!=null&&a.blockExplorerUrls?M=a.blockExplorerUrls:M=(f=l.blockExplorers)!=null&&f.default.url?[(g=l.blockExplorers)==null?void 0:g.default.url]:[];let N;(v=a==null?void 0:a.rpcUrls)!=null&&v.length?N=a.rpcUrls:N=[((x=l.rpcUrls.default)==null?void 0:x.http[0])??""];const E={blockExplorerUrls:M,chainId:gr(c),chainName:(a==null?void 0:a.chainName)??l.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??l.nativeCurrency,rpcUrls:N};return await d.request({method:"wallet_addEthereumChain",params:[E]}),l}catch(M){throw new pn(M)}throw new no(P)}},onAccountsChanged(a){a.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:a.map(c=>Vs(c))})},onChainChanged(a){const c=Number(a);o.emitter.emit("change",{chainId:c})},async onDisconnect(a){o.emitter.emit("disconnect");const c=await this.getProvider();n&&(c.removeListener("accountsChanged",n),n=void 0),i&&(c.removeListener("chainChanged",i),i=void 0),s&&(c.removeListener("disconnect",s),s=void 0)}})}function b7e(t){let r,n,i,s,o;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:V4.type,async connect({chainId:c}={}){try{const l=await this.getProvider(),d=(await l.request({method:"eth_requestAccounts"})).map(g=>Vs(g));i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),l.on("chainChanged",s)),o||(o=this.onDisconnect.bind(this),l.on("disconnect",o));let f=await this.getChainId();if(c&&f!==c){const g=await this.switchChain({chainId:c}).catch(v=>{if(v.code===pn.code)throw v;return{id:f}});f=(g==null?void 0:g.id)??f}return{accounts:d,chainId:f}}catch(l){throw/(user closed modal|accounts received is empty|user denied account)/i.test(l.message)?new pn(l):l}},async disconnect(){const c=await this.getProvider();i&&(c.removeListener("accountsChanged",i),i=void 0),s&&(c.removeListener("chainChanged",s),s=void 0),o&&(c.removeListener("disconnect",o),o=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>Vs(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){var c;if(!n){const l=await(async()=>{const{default:x}=await Qs(async()=>{const{default:P}=await import("./index-Bcq5aE4i.js").then(M=>M.i);return{default:P}},__vite__mapDeps([4,3]));return typeof x!="function"&&typeof x.default=="function"?x.default:x})();r=new l({...t,reloadOnDisconnect:!1});const d=(c=r.walletExtension)==null?void 0:c.getChainId(),f=a.chains.find(x=>t.chainId?x.id===t.chainId:x.id===d)||a.chains[0],g=t.chainId||(f==null?void 0:f.id),v=t.jsonRpcUrl||(f==null?void 0:f.rpcUrls.default.http[0]);n=r.makeWeb3Provider(v,g)}return n},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:l}){var g,v,x,P;const d=a.chains.find(M=>M.id===l);if(!d)throw new no(new v0);const f=await this.getProvider();try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(d.id)}]}),d}catch(M){if(M.code===4902)try{let N;c!=null&&c.blockExplorerUrls?N=c.blockExplorerUrls:N=(g=d.blockExplorers)!=null&&g.default.url?[(v=d.blockExplorers)==null?void 0:v.default.url]:[];let E;(x=c==null?void 0:c.rpcUrls)!=null&&x.length?E=c.rpcUrls:E=[((P=d.rpcUrls.default)==null?void 0:P.http[0])??""];const $={blockExplorerUrls:N,chainId:gr(l),chainName:(c==null?void 0:c.chainName)??d.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??d.nativeCurrency,rpcUrls:E};return await f.request({method:"wallet_addEthereumChain",params:[$]}),d}catch(N){throw new pn(N)}throw new no(M)}},onAccountsChanged(c){c.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:c.map(l=>Vs(l))})},onChainChanged(c){const l=Number(c);a.emitter.emit("change",{chainId:l})},async onDisconnect(c){a.emitter.emit("disconnect");const l=await this.getProvider();i&&(l.removeListener("accountsChanged",i),i=void 0),s&&(l.removeListener("chainChanged",s),s=void 0),o&&(l.removeListener("disconnect",o),o=void 0)}})}class cw{constructor(){}static getInstance(e,r){return cw.instance||(cw.instance=new Ere(e,r)),cw.instance}}function x7e(t){function e(r){return Ya.parseEvmChainId(r)||1}return r=>({id:cr.AUTH_CONNECTOR_ID,name:"AppKit Auth",type:"w3mAuth",chain:xn.CHAIN.EVM,async connect(n={}){const i=await this.getProvider();let s=n.chainId;if(n.isReconnecting&&(s=i.getLastUsedChainId(),!s))throw new Error("ChainId not found in provider");const{address:o,chainId:a}=await i.connect({chainId:s});await i.getSmartAccountEnabledNetworks();const c=e(a);return{accounts:[o],account:o,chainId:c,chain:{id:c,unsuported:!1}}},async disconnect(){await(await this.getProvider()).disconnect()},async getAccounts(){const n=await this.getProvider(),{address:i}=await n.connect();return r.emitter.emit("change",{accounts:[i]}),[i]},async getProvider(){return this.provider||(this.provider=cw.getInstance(t.options.projectId)),Promise.resolve(this.provider)},async getChainId(){const n=await this.getProvider(),{chainId:i}=await n.getChainId();return e(i)},async isAuthorized(){const n=await this.getProvider(),{isConnected:i}=await n.isConnected();return i},async switchChain({chainId:n}){try{const i=r.chains.find(a=>a.id===n);if(!i)throw new no(new Error("chain not found on connector."));const o=await(await this.getProvider()).connect({chainId:n});return r.emitter.emit("change",{chainId:Number(n),accounts:[o.address]}),i}catch(i){throw i instanceof Error?new no(i):i}},onAccountsChanged(n){n.length===0?this.onDisconnect():r.emitter.emit("change",{accounts:n.map(Vs)})},onChainChanged(n){const i=Number(n);r.emitter.emit("change",{chainId:i})},async onDisconnect(n){await(await this.getProvider()).disconnect()}})}const C7e=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class _7e{constructor(e){var s,o,a;this.appKit=void 0,this.options=void 0,this.chainNamespace=xn.CHAIN.EVM,this.defaultCaipNetwork=void 0,this.tokens=PR.getCaipTokens((s=this.options)==null?void 0:s.tokens),this.siweControllerClient=(o=this.options)==null?void 0:o.siweConfig,this.adapterType="wagmi",this.caipNetworks=e.networks.map(c=>({...c,rpcUrl:Tw.extendRpcUrlWithProjectId(c.rpcUrl,e.projectId)})),this.wagmiChains=Xz(this.caipNetworks.filter(c=>c.chainNamespace===xn.CHAIN.EVM));const r=this.wagmiChains.map(c=>[c.id,D9e({chain:c,projectId:e.projectId})]),n=Object.fromEntries(r),i=[...e.connectors??[]];this.wagmiConfig=M9e({...this.createConfigParams,chains:this.wagmiChains,transports:n,connectors:[...i,...((a=this.createConfigParams)==null?void 0:a.connectors)??[]]})}setCustomConnectors(e,r){var o,a,c,l,d,f,g;const n=[];e.enableWalletConnect!==!1&&n.push($S(e,r)),e.enableInjected!==!1&&n.push(H4({shimDisconnect:!0})),e.enableCoinbase!==!1&&n.push(V4({version:"4",appName:((o=e.metadata)==null?void 0:o.name)??"Unknown",appLogoUrl:((a=e.metadata)==null?void 0:a.icons[0])??"Unknown",preference:e.coinbasePreference??"all"}));const i=((c=e.features)==null?void 0:c.email)===void 0?Tn.DEFAULT_FEATURES.email:(l=e.features)==null?void 0:l.email,s=(d=e.features)!=null&&d.socials?((g=(f=e.features)==null?void 0:f.socials)==null?void 0:g.length)>0:Tn.DEFAULT_FEATURES.socials;(i||s)&&n.push(x7e({chains:this.wagmiChains,options:{projectId:e.projectId}})),n.forEach(v=>{const x=this.wagmiConfig._internal.connectors.setup(v);this.wagmiConfig._internal.connectors.setState(P=>[...P,x])})}construct(e,r){var n,i,s;if(!r.projectId)throw new Error("appkit:initialize - projectId is undefined");if(this.appKit=e,this.options=r,this.caipNetworks=r.networks,this.defaultCaipNetwork=r.defaultNetwork||r.networks[0],this.tokens=PR.getCaipTokens(r.tokens),this.setCustomConnectors(r,e),!this.wagmiConfig)throw new Error("appkit:wagmiConfig - is undefined");this.networkControllerClient={switchCaipNetwork:async o=>{const a=Number(Ya.caipNetworkIdToNumber(o==null?void 0:o.id));a&&this.wagmiConfig&&await y9e(this.wagmiConfig,{chainId:a})},getApprovedCaipNetworksData:async()=>{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");return new Promise(o=>{var l,d;const c=new Map(this.wagmiConfig.state.connections).get(this.wagmiConfig.state.current||"");if(((l=c==null?void 0:c.connector)==null?void 0:l.id)===cr.AUTH_CONNECTOR_ID)o(O9e());else if(((d=c==null?void 0:c.connector)==null?void 0:d.id)===cr.WALLET_CONNECT_CONNECTOR_ID){const f=this.wagmiConfig.connectors.find(g=>g.id===cr.WALLET_CONNECT_CONNECTOR_ID);o($9e(f))}o({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})}},this.connectionControllerClient={connectWalletConnect:async()=>{var x,P,M,N,E,$,L,j,H,I,T,B;if(!this.wagmiConfig)throw new Error("connectionControllerClient:getWalletConnectUri - wagmiConfig is undefined");const o=this.wagmiConfig.connectors.find(K=>K.id===cr.WALLET_CONNECT_CONNECTOR_ID);if(!o)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");const a=await o.getProvider(),c=await((M=(P=(x=this.options)==null?void 0:x.siweConfig)==null?void 0:P.getMessageParams)==null?void 0:M.call(P)),l=($=(E=(N=this.options)==null?void 0:N.siweConfig)==null?void 0:E.options)==null?void 0:$.enabled,d=typeof(a==null?void 0:a.authenticate)=="function",f=c&&Object.keys(c||{}).length>0,g=(L=this.options)==null?void 0:L.siweConfig;if(l&&d&&f&&g){await o.setRequestedChainsIds(c.chains);const{SIWEController:K,getDidChainId:U,getDidAddress:C}=await Qs(async()=>{const{SIWEController:_,getDidChainId:R,getDidAddress:S}=await import("./index-BpiWtdP0.js");return{SIWEController:_,getDidChainId:R,getDidAddress:S}},[]),p=(j=this.caipNetworks)==null?void 0:j.filter(_=>_.chainNamespace==="eip155").map(_=>_.id);c.chains=(H=this.caipNetworks)==null?void 0:H.filter(_=>_.chainNamespace==="eip155").map(_=>_.chainId);const m=await a.authenticate({nonce:await g.getNonce(),methods:[...C7e],...c,chains:p}),w=(I=m==null?void 0:m.auths)==null?void 0:I[0];if(w){const{p:_,s:R}=w,S=U(_.iss),k=C(_.iss);k&&S&&K.setSession({address:k,chainId:parseInt(S,10)});try{const y=a.client.formatAuthMessage({request:_,iss:_.iss});await K.verifyMessage({message:y,signature:R.s,cacao:w})}catch(y){throw console.error("Error verifying message",y),await a.disconnect().catch(console.error),await K.signOut().catch(console.error),y}}}const v=Number(Ya.caipNetworkIdToNumber((B=(T=this.appKit)==null?void 0:T.getCaipNetwork())==null?void 0:B.id));await a$(this.wagmiConfig,{connector:o,chainId:v})},connectExternal:async({id:o,provider:a,info:c})=>{var f,g,v,x;if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const l=this.wagmiConfig.connectors.find(P=>P.id===o);if(!l)throw new Error("connectionControllerClient:connectExternal - connector is undefined");(f=this.appKit)==null||f.setClientId(null),a&&c&&l.id===cr.EIP6963_CONNECTOR_ID&&((g=l.setEip6963Wallet)==null||g.call(l,{provider:a,info:c}));const d=Number(Ya.caipNetworkIdToNumber((x=(v=this.appKit)==null?void 0:v.getCaipNetwork())==null?void 0:x.id));await a$(this.wagmiConfig,{connector:l,chainId:d})},checkInstalled:o=>{var c;const a=(c=this.appKit)==null?void 0:c.getConnectors().find(l=>l.type==="INJECTED");return o?a&&window!=null&&window.ethereum?o.some(l=>{var d;return!!((d=window.ethereum)!=null&&d[String(l)])}):!1:!!window.ethereum},disconnect:async()=>{var o,a,c,l,d;if(await n9e(this.wagmiConfig),(c=(a=(o=this.options)==null?void 0:o.siweConfig)==null?void 0:a.options)!=null&&c.signOutOnDisconnect){const{SIWEController:f}=await Qs(async()=>{const{SIWEController:g}=await import("./index-BpiWtdP0.js");return{SIWEController:g}},[]);await f.signOut()}sn.removeItem(nn.WALLET_ID),sn.removeItem(nn.CONNECTED_CONNECTOR),sn.removeItem(nn.WALLET_NAME),(l=this.appKit)==null||l.setClientId(null),this.syncAccount({address:void 0,chainId:void 0,connector:void 0,addresses:void 0,status:"disconnected"}),(d=this.appKit)==null||d.resetAccount("solana")},signMessage:async o=>{var l;const a=((l=this.appKit)==null?void 0:l.getCaipAddress())||"",c=p$(a);return g9e(this.wagmiConfig,{message:o,account:c})},estimateGas:async o=>{if(o.chainNamespace&&o.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${o.chainNamespace}`);try{return await i9e(this.wagmiConfig,{account:o.address,to:o.to,data:o.data,type:"legacy"})}catch{return BigInt(0)}},sendTransaction:async o=>{if(o.chainNamespace&&o.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${o.chainNamespace}`);const{chainId:a}=F2(this.wagmiConfig),c={account:o.address,to:o.to,value:o.value,gas:o.gas,gasPrice:o.gasPrice,data:o.data,chainId:a,type:"legacy"};await h9e(this.wagmiConfig,c);const l=await p9e(this.wagmiConfig,c);return await C9e(this.wagmiConfig,{hash:l,timeout:25e3}),l},writeContract:async o=>{var f,g,v,x;const a=((f=this.appKit)==null?void 0:f.getCaipAddress())||"",c=p$(a),l=Number(Ya.caipNetworkIdToNumber((v=(g=this.appKit)==null?void 0:g.getCaipNetwork())==null?void 0:v.id));return await _9e(this.wagmiConfig,{chain:(x=this.wagmiChains)==null?void 0:x[l],chainId:l,address:o.tokenAddress,account:c,abi:o.abi,functionName:o.method,args:[o.receiverAddress,o.tokenAmount]})},getEnsAddress:async o=>{var a,c,l;try{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const d=Number(Ya.caipNetworkIdToNumber((c=(a=this.appKit)==null?void 0:a.getCaipNetwork())==null?void 0:c.id));let f=!1,g=!1;return vX(o)&&(g=await((l=this.appKit)==null?void 0:l.resolveReownName(o))||!1),d===1&&(f=await d9e(this.wagmiConfig,{name:b$(o),chainId:d})),f||g||!1}catch{return!1}},getEnsAvatar:async o=>{var l,d;const a=Number(Ya.caipNetworkIdToNumber((d=(l=this.appKit)==null?void 0:l.getCaipNetwork())==null?void 0:d.id));return a!==h$.id?!1:await l$(this.wagmiConfig,{name:b$(o),chainId:a})||!1},parseUnits:rxe,formatUnits:L2},ge.state.chains.set(this.chainNamespace,{chainNamespace:this.chainNamespace,connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient,adapterType:this.adapterType,caipNetworks:this.caipNetworks}),this.syncConnectors(this.wagmiConfig.connectors),this.syncAuthConnector((n=this.wagmiConfig)==null?void 0:n.connectors.find(o=>o.id===cr.AUTH_CONNECTOR_ID)),this.syncRequestedNetworks(this.caipNetworks),x9e(this.wagmiConfig,{onChange:o=>{this.syncConnectors(o),this.syncAuthConnector(o.find(a=>a.id===cr.AUTH_CONNECTOR_ID))}}),b9e(this.wagmiConfig,{onChange:o=>{this.syncAccount(o)}}),(i=this.appKit)==null||i.setEIP6963Enabled(r.enableEIP6963!==!1),(s=this.appKit)==null||s.subscribeShouldUpdateToAddress(o=>{var a;if(o){const l=(a=l9e(this.wagmiConfig)[0])==null?void 0:a.connector;l&&w9e(this.wagmiConfig,{connector:l}).then(d=>this.syncAccount({address:o,isConnected:!0,addresses:d.accounts,connector:l,chainId:d.chainId,status:"connected"}))}})}subscribeState(e){var r;return(r=this.appKit)==null?void 0:r.subscribeState(n=>e({...n,selectedNetworkId:Number(Ya.caipNetworkIdToNumber(n.selectedNetworkId))}))}syncRequestedNetworks(e){Array.from(new Set(e.map(n=>n.chainNamespace))).filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(s=>s.chainNamespace===n),n)})}async syncAccount({address:e,chainId:r,connector:n,addresses:i,status:s}){var a,c,l,d,f,g,v,x,P,M,N,E,$,L,j,H;const o=ge.state.activeCaipAddress;if(s==="disconnected"&&!o){(a=this.appKit)==null||a.resetAccount(this.chainNamespace),(c=this.appKit)==null||c.resetWcConnection(),(l=this.appKit)==null||l.resetNetwork(),(d=this.appKit)==null||d.setAllAccounts([],this.chainNamespace),sn.removeItem(nn.WALLET_ID);return}if(this.wagmiConfig&&n){if(n&&n.name==="WalletConnect"&&n.getProvider&&e){const I=r||Number(Ya.caipNetworkIdToNumber((g=(f=this.appKit)==null?void 0:f.getCaipNetwork())==null?void 0:g.id)),T=await n.getProvider(),B=((v=T==null?void 0:T.session)==null?void 0:v.namespaces)||{},K=B?Object.keys(B):[],U=(x=this.appKit)==null?void 0:x.getPreferredAccountType();K.forEach(C=>{var w,_,R;const p=C,m=(w=B==null?void 0:B[C])==null?void 0:w.accounts[0];z1.setProvider(p,T),z1.setProviderId(p,"walletConnect"),(_=this.appKit)==null||_.setPreferredAccountType(U,p),(R=this.appKit)==null||R.setCaipAddress(m,p)}),((M=(P=this.appKit)==null?void 0:P.getCaipNetwork())==null?void 0:M.chainNamespace)!=="solana"&&(this.syncNetwork(e,I,!0),await Promise.all([this.syncProfile(e,I),this.syncBalance(e,I),this.syncConnectedWalletInfo(n),(N=this.appKit)==null?void 0:N.setApprovedCaipNetworksData(this.chainNamespace)]))}else if(s==="connected"&&e&&r){const I=`eip155:${r}:${e}`;this.syncNetwork(e,r,!0),(E=this.appKit)==null||E.setCaipAddress(I,this.chainNamespace),await Promise.all([this.syncProfile(e,r),this.syncBalance(e,r),this.syncConnectedWalletInfo(n),($=this.appKit)==null?void 0:$.setApprovedCaipNetworksData(this.chainNamespace)]),n&&this.syncConnectedWalletInfo(n),!((n==null?void 0:n.id)===cr.AUTH_CONNECTOR_ID)&&(i!=null&&i.length)&&((L=this.appKit)==null||L.setAllAccounts(i.map(B=>({address:B,type:"eoa"})),this.chainNamespace))}else if(s==="reconnecting"){(j=this.appKit)==null||j.setLoading(!0);const T=u9e(this.wagmiConfig).find(B=>B.id===n.id);T&&(await u$(this.wagmiConfig,{connectors:[T]}),(H=this.appKit)==null||H.setLoading(!1))}}}async syncNetwork(e,r,n){var s,o,a,c,l,d;const i=this.caipNetworks.find(f=>f.chainId===r);if(i&&r&&((a=this.appKit)==null||a.setCaipNetwork({chainId:i.chainId,id:i.id,name:i.name||"",imageId:ha.NetworkImageIds[i.chainId],imageUrl:(o=(s=this.options)==null?void 0:s.chainImages)==null?void 0:o[i.chainId],chainNamespace:this.chainNamespace,currency:(i==null?void 0:i.currency)||"",explorerUrl:(i==null?void 0:i.explorerUrl)||"",rpcUrl:(i==null?void 0:i.rpcUrl)||""}),n&&e&&r)){const f=`eip155:${r}:${e}`;if((c=this.appKit)==null||c.setCaipAddress(f,this.chainNamespace),i!=null&&i.explorerUrl){const g=`${i.explorerUrl}/address/${e}`;(l=this.appKit)==null||l.setAddressExplorerUrl(g,this.chainNamespace)}else(d=this.appKit)==null||d.setAddressExplorerUrl(void 0,this.chainNamespace);await this.syncBalance(e,r)}}async syncReownName(e){var r,n,i;if(!this.appKit)throw new Error("syncReownName - appKit is undefined");try{const s=await this.appKit.getReownName(e);if(s[0]){const o=s[0];(r=this.appKit)==null||r.setProfileName(o.name,this.chainNamespace)}else(n=this.appKit)==null||n.setProfileName(null,this.chainNamespace)}catch{(i=this.appKit)==null||i.setProfileName(null,this.chainNamespace)}}async syncProfile(e,r){var n,i,s,o,a,c;if(!this.appKit)throw new Error("syncProfile - appKit is undefined");try{const{name:l,avatar:d}=await this.appKit.fetchIdentity({address:e});(n=this.appKit)==null||n.setProfileName(l,this.chainNamespace),(i=this.appKit)==null||i.setProfileImage(d,this.chainNamespace),l||await this.syncReownName(e)}catch{if(r===h$.id){const l=await f9e(this.wagmiConfig,{address:e,chainId:r});if(l){(s=this.appKit)==null||s.setProfileName(l,this.chainNamespace);const d=await l$(this.wagmiConfig,{name:l,chainId:r});d&&((o=this.appKit)==null||o.setProfileImage(d,this.chainNamespace))}else await this.syncReownName(e),(a=this.appKit)==null||a.setProfileImage(null,this.chainNamespace)}else await this.syncReownName(e),(c=this.appKit)==null||c.setProfileImage(null,this.chainNamespace)}}async syncBalance(e,r){var i,s,o,a,c;const n=this.caipNetworks.find(l=>l.chainId===r);if(n&&this.wagmiConfig){const l=await c9e(this.wagmiConfig,{address:e,chainId:r,token:(o=(s=(i=this.options)==null?void 0:i.tokens)==null?void 0:s[n.id])==null?void 0:o.address});(a=this.appKit)==null||a.setBalance(l.formatted,l.symbol,this.chainNamespace);return}(c=this.appKit)==null||c.setBalance(void 0,void 0,this.chainNamespace)}async syncConnectedWalletInfo(e){var r,n,i,s;if(!e)throw Error("syncConnectedWalletInfo - connector is undefined");if(e.id===cr.WALLET_CONNECT_CONNECTOR_ID&&e.getProvider){const o=await e.getProvider();o.session&&((n=this.appKit)==null||n.setConnectedWalletInfo({...o.session.peer.metadata,name:o.session.peer.metadata.name,icon:(r=o.session.peer.metadata.icons)==null?void 0:r[0]},this.chainNamespace))}else{const o=(i=this.appKit)==null?void 0:i.getConnectors().find(a=>a.id===e.id);(s=this.appKit)==null||s.setConnectedWalletInfo({name:e.name,icon:e.icon||this.appKit.getConnectorImage(o)},this.chainNamespace)}}syncConnectors(e){var o;const r=e.map(a=>({...a,chain:this.chainNamespace})),n=new Set,i=r.filter(a=>{const c=n.has(a.id);return n.add(a.id),!c}),s=[];i.forEach(({id:a,name:c,type:l,icon:d})=>{var g,v;cr.AUTH_CONNECTOR_ID===a||s.push({id:a,explorerId:ha.ConnectorExplorerIds[a],imageUrl:((v=(g=this.options)==null?void 0:g.connectorImages)==null?void 0:v[a])??d,name:ha.ConnectorNamesMap[a]??c,imageId:ha.ConnectorImageIds[a],type:ha.ConnectorTypesMap[l]??"EXTERNAL",info:{rdns:a},chain:this.chainNamespace})}),(o=this.appKit)==null||o.setConnectors(s)}async syncAuthConnector(e){var n;const r=e;if(r){const i=await r.getProvider();(n=this.appKit)==null||n.addConnector({id:cr.AUTH_CONNECTOR_ID,type:"AUTH",name:"w3mAuth",provider:i,chain:this.chainNamespace}),this.initAuthConnectorListeners(e)}}async initAuthConnectorListeners(e){e&&(await this.listenAuthConnector(e),await this.listenModal(e))}async listenAuthConnector(e,r=!1){var n,i;if(r||typeof window<"u"&&e){(n=this.appKit)==null||n.setLoading(!0);const s=await e.getProvider(),o=s.getLoginEmailUsed();(i=this.appKit)==null||i.setLoading(o),s.onRpcRequest(a=>{var c,l;Xi.checkIfRequestExists(a)?Xi.checkIfRequestIsSafe(a)||(c=this.appKit)==null||c.handleUnsafeRPCRequest():((l=this.appKit)==null||l.open(),console.error(lr.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:a.method}),setTimeout(()=>{var d;(d=this.appKit)==null||d.showErrorMessage(lr.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),s.rejectRpcRequests())}),s.onRpcError(()=>{var c,l,d,f;((c=this.appKit)==null?void 0:c.isOpen())&&((l=this.appKit)!=null&&l.isTransactionStackEmpty()?(d=this.appKit)==null||d.close():(f=this.appKit)==null||f.popTransactionStack(!0))}),s.onRpcSuccess((a,c)=>{var d,f,g;Xi.checkIfRequestIsSafe(c)||((d=this.appKit)!=null&&d.isTransactionStackEmpty()?(f=this.appKit)==null||f.close():(g=this.appKit)==null||g.popTransactionStack())}),s.onNotConnected(()=>{var d,f,g;const a=(d=this.appKit)==null?void 0:d.getIsConnectedState(),l=sn.getItem(nn.CONNECTED_CONNECTOR)==="AUTH";!a&&l&&((f=this.appKit)==null||f.setCaipAddress(void 0,this.chainNamespace),(g=this.appKit)==null||g.setLoading(!1))}),s.onIsConnected(()=>{s.connect()}),s.onConnect(a=>{var l,d,f,g,v;const c=`eip155:${a.chainId}:${a.address}`;(l=this.appKit)==null||l.setCaipAddress(c,this.chainNamespace),(d=this.appKit)==null||d.setSmartAccountDeployed(!!a.smartAccountDeployed,this.chainNamespace),(f=this.appKit)==null||f.setPreferredAccountType(a.preferredAccountType,this.chainNamespace),(g=this.appKit)==null||g.setAllAccounts(a.accounts||[{address:a.address,type:a.preferredAccountType||"eoa"}],this.chainNamespace),vr.setConnectedConnector("AUTH"),(v=this.appKit)==null||v.setLoading(!1)}),s.onGetSmartAccountEnabledNetworks(a=>{var c;(c=this.appKit)==null||c.setSmartAccountEnabledNetworks(a,this.chainNamespace)}),s.onSetPreferredAccount(({address:a,type:c})=>{var l;a&&((l=this.appKit)==null||l.setPreferredAccountType(c,this.chainNamespace),this.wagmiConfig&&u$(this.wagmiConfig,{connectors:[e]}))})}}async listenModal(e){const r=await e.getProvider();this.subscribeState(n=>{n.open||r.rejectRpcRequests()})}}const x$="pushstate",C$="popstate",bW="beforeunload",xW=t=>(t.preventDefault(),t.returnValue=""),A7e=()=>{removeEventListener(bW,xW,{capture:!0})};function CW(t){let e=t.getLocation();const r=new Set;let n=[];const i=()=>{e=t.getLocation(),r.forEach(o=>o())},s=async(o,a)=>{var c;if(!((a==null?void 0:a.ignoreBlocker)??!1)&&typeof document<"u"&&n.length){for(const d of n)if(!await d()){(c=t.onBlocked)==null||c.call(t,i);return}}o()};return{get location(){return e},get length(){return t.getLength()},subscribers:r,subscribe:o=>(r.add(o),()=>{r.delete(o)}),push:(o,a,c)=>{a=_$(a),s(()=>{t.pushState(o,a),i()},c)},replace:(o,a,c)=>{a=_$(a),s(()=>{t.replaceState(o,a),i()},c)},go:(o,a)=>{s(()=>{t.go(o),i()},a)},back:o=>{s(()=>{t.back(),i()},o)},forward:o=>{s(()=>{t.forward(),i()},o)},createHref:o=>t.createHref(o),block:o=>(n.push(o),n.length===1&&addEventListener(bW,xW,{capture:!0}),()=>{n=n.filter(a=>a!==o),n.length||A7e()}),flush:()=>{var o;return(o=t.flush)==null?void 0:o.call(t)},destroy:()=>{var o;return(o=t.destroy)==null?void 0:o.call(t)},notify:i}}function _$(t){return t||(t={}),{...t,key:I7e()}}function _W(t){const e=(t==null?void 0:t.window)??(typeof document<"u"?window:void 0),r=e.history.pushState,n=e.history.replaceState,i=(t==null?void 0:t.createHref)??(P=>P),s=(t==null?void 0:t.parseLocation)??(()=>Vv(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));let o=s(),a;const c=()=>o;let l,d;const f=()=>{l&&(x._ignoreSubscribers=!0,(l.isPush?e.history.pushState:e.history.replaceState)(l.state,"",l.href),x._ignoreSubscribers=!1,l=void 0,d=void 0,a=void 0)},g=(P,M,N)=>{const E=i(M);d||(a=o),o=Vv(M,N),l={href:E,state:N,isPush:(l==null?void 0:l.isPush)||P==="push"},d||(d=Promise.resolve().then(()=>f()))},v=()=>{o=s(),x.notify()},x=CW({getLocation:c,getLength:()=>e.history.length,pushState:(P,M)=>g("push",P,M),replaceState:(P,M)=>g("replace",P,M),back:()=>e.history.back(),forward:()=>e.history.forward(),go:P=>e.history.go(P),createHref:P=>i(P),flush:f,destroy:()=>{e.history.pushState=r,e.history.replaceState=n,e.removeEventListener(x$,v),e.removeEventListener(C$,v)},onBlocked:P=>{a&&o!==a&&(o=a,P())}});return e.addEventListener(x$,v),e.addEventListener(C$,v),e.history.pushState=function(...P){const M=r.apply(e.history,P);return x._ignoreSubscribers||v(),M},e.history.replaceState=function(...P){const M=n.apply(e.history,P);return x._ignoreSubscribers||v(),M},x}function E7e(t){const e=typeof document<"u"?window:void 0;return _W({window:e,parseLocation:()=>{const r=e.location.hash.split("#").slice(1).join("#")??"/";return Vv(r,e.history.state)},createHref:r=>`${e.location.pathname}${e.location.search}#${r}`})}function S7e(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1;const n=e.map(()=>({}));return CW({getLocation:()=>Vv(e[r],n[r]),getLength:()=>e.length,pushState:(s,o)=>{r{n[r]=o,e[r]=s},back:()=>{r=Math.max(r-1,0)},forward:()=>{r=Math.min(r+1,e.length-1)},go:s=>{r=Math.min(Math.max(r+s,0),e.length-1)},createHref:s=>s})}function Vv(t,e){const r=t.indexOf("#"),n=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:t.length),hash:r>-1?t.substring(r):"",search:n>-1?t.slice(n,r===-1?void 0:r):"",state:e||{}}}function I7e(){return(Math.random()+1).toString(36).substring(7)}var T7e="Invariant failed";function hs(t,e){if(!t)throw new Error(T7e)}const o7=Ye.createContext(null);function AW(){return typeof document>"u"?o7:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=o7,o7)}function Xu(t){const e=Ye.useContext(AW());return t==null||t.warn,e}var EW={exports:{}},SW={},IW={exports:{}},TW={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -11720,4 +11720,4 @@ to { color: ${e.gray[400]}; width: ${n[2]}; height: ${n[2]}; - `}};let Wy=null;function W2(){const t=gn.useContext(Y4);return Wy||(Wy=j_e(t),Wy)}const L$=[{title:"Meta/GameB",description:"Bigger picture, the grander game.",books:[{title:"WTF is Game B?",image:"/assets/gameb.webp"},{title:"WTF is Metacrisis?",image:"/assets/metacrisis.webp"},{title:"Meditations on Moloch",image:"/assets/moloch.webp"},{title:"Political Metamodernism: Bridging Divides",image:"/assets/metamodernist.webp"},{title:"Choose Good Quests",image:"/assets/goodquests.webp"},{title:"Meme Driven Organizations",image:"/assets/memedriven.webp"}]},{title:"Web3 General",description:"Web3 basics: how & why.",books:[{title:"WTF is Ethereum?",image:"/assets/ethereum.webp"},{title:"WTF are DAOs?",image:"/assets/daos.webp"},{title:"WTF is DeFi?",image:"/assets/defi.webp"},{title:"WTF are NFTs?",image:"/assets/nfts.webp"},{title:"WTF are dApps?",image:"/assets/dapps.webp"},{title:"Become a Web3 Developer",image:"/assets/web3builder.webp"}]},{title:"DAO Playbooks",description:"DAO Tooling/Coordination Methods",books:[{title:"Become the Best Contributor in Any DAO",image:"/assets/best-dao-contributor.webp"},{title:"Starting DAOs 101",image:"/assets/daosummoner.webp"},{title:"How to Build a Network for Impact",image:"/assets/impact-networks.webp",displayTitle:!1},{title:"Using Coordinape to Reward Contributors",image:"/assets/coordinape.webp"},{title:"Effective Meetings with Holacracy",image:"/assets/holacracy.webp"},{title:"Entering a DAO as a Writer",image:"/assets/daowriter.webp"},{title:"Building Successful Teams",image:"/assets/successful-teams.webp"}]},{title:"Self-Actualization",description:"Level-up, self-improve.",books:[{title:"How to Play the Creator Game",image:"/assets/creatorgame.webp"},{title:"Embrace the Ticking Clock",image:"/assets/time.webp"},{title:"Know Your Biases",image:"/assets/biases.webp"},{title:"Understanding Imposter Syndrome",image:"/assets/imposter.webp"},{title:"Journaling Like Dickie Bush",image:"/assets/journaling.webp"}]}],K_=t=>t.toLowerCase().replace(/\s+/g,"-").replace(/[\?,:]/g,""),kTe=({image:t,title:e,alt:r,displayTitle:n=!0})=>Q.jsx(bb,{to:`/book/${K_(e)}`,children:Q.jsxs("div",{className:"basis-1/4 md:basis-1/2 xl:basis-1/3 2xl:basis-1/4 flex-1 flex place-items-center image-full z-0 card p-0 bg-base-100 mr-4 rounded-l-none rounded-rt-lg rounded-br-lg pb-4 hover:scale-95 transition duration-600",children:[Q.jsx("figure",{className:"border-white border",children:Q.jsx("img",{src:t,alt:r??e})}),n&&Q.jsx("div",{className:"card-body bg-black bg-opacity-20 p-0 mx-auto px-1",children:Q.jsx("h2",{className:"card-title text-white z-10 font-extrabold",children:e})})]})}),F_e=()=>(Ye.useEffect(()=>{const t=e=>{let{target:r}=e;for(;r&&r.tagName!=="DETAILS";)r=r.parentNode;r||document.querySelectorAll("details").forEach(n=>n.removeAttribute("open"))};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)}),Q.jsxs("nav",{className:"sticky top-0 navbar bg-base-100 min-h-0 flex-shrink-0 justify-between z-[1001] shadow-md shadow-secondary px-0 sm:px-2 mb-4",children:[Q.jsx("div",{className:"justify-start",children:Q.jsxs("div",{className:"dropdown",children:[Q.jsx("div",{tabIndex:0,role:"button",className:"btn btn-ghost lg:hidden",children:Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Q.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h8m-8 6h16"})})}),Q.jsxs("ul",{tabIndex:0,className:"menu menu-sm dropdown-content bg-base-100 rounded-box z-[1] mt-3 w-52 p-2 shadow",children:[Q.jsx("li",{children:Q.jsx("a",{children:"Support"})}),Q.jsxs("li",{children:[Q.jsx("a",{children:"Categories"}),Q.jsx("ul",{className:"p-2",children:L$.map((t,e)=>Q.jsx("li",{children:Q.jsx(bb,{to:`/#${K_(t.title)}`,children:t.title})},e))})]}),Q.jsx("li",{children:Q.jsx("a",{children:"Submit"})})]})]})}),Q.jsxs("ul",{className:"grow flex flex-col md:flex-row justify-center",children:[Q.jsx("li",{children:Q.jsx(bb,{to:"/",className:"btn btn-ghost text-xl",children:"dAcademy"})}),Q.jsx("li",{className:"hidden lg:flex",children:Q.jsxs("ul",{className:"menu menu-horizontal px-1",children:[Q.jsx("li",{children:Q.jsx("a",{children:"Support"})}),Q.jsx("li",{children:Q.jsxs("details",{children:[Q.jsx("summary",{children:"Categories"}),Q.jsx("ul",{className:"p-2 z-10",children:L$.map((t,e)=>Q.jsx("li",{children:Q.jsx(bb,{to:`/#${K_(t.title)}`,children:t.title})},e))})]})}),Q.jsx("li",{children:Q.jsx("a",{children:"Submit"})})]})}),Q.jsx("li",{children:Q.jsx("div",{className:"navbar-end px-4",children:Q.jsx("w3m-button",{balance:"hide"})})})]})]})),BS=CCe({component:()=>Q.jsxs(Q.Fragment,{children:[Q.jsx(F_e,{}),Q.jsx(UW,{}),Q.jsx(B_e,{})]})}),z_e=DW("/")(),W_e=DW("/book/$slug/")(),H_e=z_e.update({path:"/",getParentRoute:()=>BS}).lazy(()=>Qs(()=>import("./index.lazy-DRoQcysg.js"),__vite__mapDeps([5,6])).then(t=>t.Route)),q_e=W_e.update({path:"/book/$slug/",getParentRoute:()=>BS}).lazy(()=>Qs(()=>import("./index.lazy-B3BXRqZi.js").then(t=>t.n),__vite__mapDeps([7,1,8,9])).then(t=>t.Route)),V_e={IndexLazyRoute:H_e,BookSlugIndexLazyRoute:q_e},K_e=BS._addFileChildren(V_e)._addFileTypes(),G_e=new URLSearchParams(window.location.search);G_e.get("debug");const Z_e=E7e(),Q_e=pCe({routeTree:K_e,history:Z_e}),Y_e=new Qxe,GW="e68f5aaf8852a7276013760c5323852a",J_e={name:"dAcademy",description:"dAcademy",url:"https://dacade.my",icons:["https://dacade.my/octopus%20icon.svg"]},X_e=[Vz,Kz],ZW=new _7e({networks:X_e,projectId:GW});n5e({adapters:[ZW],networks:[Vz,Kz],metadata:J_e,projectId:GW,showWallets:!0,features:{analytics:!0,email:!1,socials:["x","farcaster","discord"]}});const eAe=({children:t})=>Q.jsx(kxe,{config:ZW.wagmiConfig,children:Q.jsx(Yxe,{client:Y_e,children:t})}),B$=document.getElementById("root");B$.innerHTML||cL(B$).render(Q.jsxs(Ye.StrictMode,{children:[Q.jsx(E_e,{position:"bottom-center"}),Q.jsx(eAe,{children:Q.jsx(OCe,{router:Q_e})})]}));export{g5e as $,Se as A,ze as B,ge as C,e8e as D,ot as E,wf as F,dj as G,M4 as H,UF as I,fj as J,gr as K,bb as L,jt as M,F0 as N,qe as O,wS as P,$c as Q,Ae as R,St as S,Lv as T,f0 as U,dTe as V,lr as W,fTe as X,N5 as Y,mTe as Z,uz as _,bs as a,gs as a$,s6e as a0,gTe as a1,Ii as a2,z8e as a3,F8e as a4,Pz as a5,hc as a6,N_ as a7,K8e as a8,Ov as a9,xTe as aA,JF as aB,bTe as aC,U6e as aD,QM as aE,q8e as aF,yS as aG,t4e as aH,sxe as aI,nxe as aJ,G8e as aK,$z as aL,axe as aM,IF as aN,oxe as aO,Txe as aP,z4 as aQ,Mxe as aR,ATe as aS,e$ as aT,Xa as aU,W4 as aV,Pxe as aW,Nxe as aX,Uz as aY,Wxe as aZ,Oxe as a_,N6e as aa,Iv as ab,g0 as ac,vf as ad,Cv as ae,pTe as af,$4 as ag,Ri as ah,K5e as ai,L4 as aj,Rl as ak,Hu as al,Q1 as am,SS as an,jF as ao,CTe as ap,_Te as aq,Vs as ar,i6e as as,s8e as at,tz as au,GF as av,b8e as aw,$8e as ax,O8e as ay,M8e as az,le as b,yl as b$,Uv as b0,Kxe as b1,ETe as b2,Ei as b3,Zce as b4,V6e as b5,gn as b6,TTe as b7,Qs as b8,h$ as b9,hC as bA,d5 as bB,Zw as bC,_1 as bD,Vh as bE,mc as bF,Kh as bG,h5 as bH,Qw as bI,wc as bJ,Yw as bK,ba as bL,_o as bM,gC as bN,Ao as bO,Xw as bP,p5 as bQ,A1 as bR,Nu as bS,E1 as bT,wl as bU,bC as bV,lf as bW,vl as bX,tv as bY,Jw as bZ,R1 as b_,X9 as ba,Fe as bb,vy as bc,yAe as bd,BL as be,Qre as bf,Rt as bg,gh as bh,dC as bi,b1 as bj,x1 as bk,fC as bl,Vw as bm,c5 as bn,Wh as bo,Hh as bp,Kw as bq,va as br,l5 as bs,qh as bt,ya as bu,u5 as bv,Mu as bw,$u as bx,Gw as by,C1 as bz,ye as c,Ou as c0,P1 as c1,Pu as c2,N1 as c3,rv as c4,M1 as c5,uf as c6,df as c7,w5 as c8,nv as c9,mL as cA,c4 as cB,fS as cC,i8e as cD,ow as cE,PF as cF,wTe as cG,iS as cH,X5 as cI,B4 as cJ,vTe as cK,yTe as cL,zA as cM,rAe as cN,nAe as cO,ff as ca,Du as cb,Lu as cc,iv as cd,sv as ce,$1 as cf,Bu as cg,bl as ch,O1 as ci,Gh as cj,Zh as ck,ov as cl,av as cm,Qh as cn,v5 as co,Cs as cp,Js as cq,y5 as cr,Tt as cs,Ue as ct,xn as cu,vn as cv,Z$ as cw,xE as cx,Ea as cy,Exe as cz,Lt as d,Ye as e,Yi as f,Ec as g,_e as h,Te as i,Q as j,q as k,ITe as l,L$ as m,kTe as n,U2 as o,Rn as p,an as q,sc as r,Ts as s,K_ as t,h0 as u,ES as v,w0 as w,xS as x,hTe as y,p0 as z}; + `}};let Wy=null;function W2(){const t=gn.useContext(Y4);return Wy||(Wy=j_e(t),Wy)}const L$=[{title:"Meta/GameB",description:"Bigger picture, the grander game.",books:[{title:"WTF is Game B?",image:"/assets/gameb.webp"},{title:"WTF is Metacrisis?",image:"/assets/metacrisis.webp"},{title:"Meditations on Moloch",image:"/assets/moloch.webp"},{title:"Political Metamodernism: Bridging Divides",image:"/assets/metamodernist.webp"},{title:"Choose Good Quests",image:"/assets/goodquests.webp"},{title:"Meme Driven Organizations",image:"/assets/memedriven.webp"}]},{title:"Web3 General",description:"Web3 basics: how & why.",books:[{title:"WTF is Ethereum?",image:"/assets/ethereum.webp"},{title:"WTF are DAOs?",image:"/assets/daos.webp"},{title:"WTF is DeFi?",image:"/assets/defi.webp"},{title:"WTF are NFTs?",image:"/assets/nfts.webp"},{title:"WTF are dApps?",image:"/assets/dapps.webp"},{title:"Become a Web3 Developer",image:"/assets/web3builder.webp"}]},{title:"DAO Playbooks",description:"DAO Tooling/Coordination Methods",books:[{title:"Become the Best Contributor in Any DAO",image:"/assets/best-dao-contributor.webp"},{title:"Starting DAOs 101",image:"/assets/daosummoner.webp"},{title:"How to Build a Network for Impact",image:"/assets/impact-networks.webp",displayTitle:!1},{title:"Using Coordinape to Reward Contributors",image:"/assets/coordinape.webp"},{title:"Effective Meetings with Holacracy",image:"/assets/holacracy.webp"},{title:"Entering a DAO as a Writer",image:"/assets/daowriter.webp"},{title:"Building Successful Teams",image:"/assets/successful-teams.webp"}]},{title:"Self-Actualization",description:"Level-up, self-improve.",books:[{title:"How to Play the Creator Game",image:"/assets/creatorgame.webp"},{title:"Embrace the Ticking Clock",image:"/assets/time.webp"},{title:"Know Your Biases",image:"/assets/biases.webp"},{title:"Understanding Imposter Syndrome",image:"/assets/imposter.webp"},{title:"Journaling Like Dickie Bush",image:"/assets/journaling.webp"}]}],K_=t=>t.toLowerCase().replace(/\s+/g,"-").replace(/[\?,:]/g,""),kTe=({image:t,title:e,alt:r,displayTitle:n=!0})=>Q.jsx(bb,{to:`/book/${K_(e)}`,children:Q.jsxs("div",{className:"basis-1/4 md:basis-1/2 xl:basis-1/3 2xl:basis-1/4 flex-1 flex place-items-center image-full z-0 card p-0 bg-base-100 mr-4 rounded-l-none rounded-rt-lg rounded-br-lg pb-4 hover:scale-95 transition duration-600",children:[Q.jsx("figure",{className:"border-white border",children:Q.jsx("img",{src:t,alt:r??e})}),n&&Q.jsx("div",{className:"card-body bg-black bg-opacity-20 p-0 mx-auto px-1",children:Q.jsx("h2",{className:"card-title text-white z-10 font-extrabold",children:e})})]})}),F_e=()=>(Ye.useEffect(()=>{const t=e=>{let{target:r}=e;for(;r&&r.tagName!=="DETAILS";)r=r.parentNode;r||document.querySelectorAll("details").forEach(n=>n.removeAttribute("open"))};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)}),Q.jsxs("nav",{className:"sticky top-0 navbar bg-base-100 min-h-0 flex-shrink-0 justify-between z-[1001] shadow-md shadow-secondary px-0 sm:px-2 mb-4",children:[Q.jsx("div",{className:"justify-start",children:Q.jsxs("div",{className:"dropdown",children:[Q.jsx("div",{tabIndex:0,role:"button",className:"btn btn-ghost lg:hidden",children:Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Q.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h8m-8 6h16"})})}),Q.jsxs("ul",{tabIndex:0,className:"menu menu-sm dropdown-content bg-base-100 rounded-box z-[1] mt-3 w-52 p-2 shadow",children:[Q.jsx("li",{children:Q.jsx("a",{children:"Support"})}),Q.jsxs("li",{children:[Q.jsx("a",{children:"Categories"}),Q.jsx("ul",{className:"p-2",children:L$.map((t,e)=>Q.jsx("li",{children:Q.jsx(bb,{to:`/#${K_(t.title)}`,children:t.title})},e))})]}),Q.jsx("li",{children:Q.jsx("a",{children:"Submit"})})]})]})}),Q.jsxs("ul",{className:"grow flex flex-col md:flex-row justify-center",children:[Q.jsx("li",{children:Q.jsx(bb,{to:"/",className:"btn btn-ghost text-xl",children:"dAcademy"})}),Q.jsx("li",{className:"hidden lg:flex",children:Q.jsxs("ul",{className:"menu menu-horizontal px-1",children:[Q.jsx("li",{children:Q.jsx("a",{children:"Support"})}),Q.jsx("li",{children:Q.jsxs("details",{children:[Q.jsx("summary",{children:"Categories"}),Q.jsx("ul",{className:"p-2 z-10",children:L$.map((t,e)=>Q.jsx("li",{children:Q.jsx(bb,{to:`/#${K_(t.title)}`,children:t.title})},e))})]})}),Q.jsx("li",{children:Q.jsx("a",{children:"Submit"})})]})}),Q.jsx("li",{children:Q.jsx("div",{className:"navbar-end px-4",children:Q.jsx("w3m-button",{balance:"hide"})})})]})]})),BS=CCe({component:()=>Q.jsxs(Q.Fragment,{children:[Q.jsx(F_e,{}),Q.jsx(UW,{}),Q.jsx(B_e,{})]})}),z_e=DW("/")(),W_e=DW("/book/$slug/")(),H_e=z_e.update({path:"/",getParentRoute:()=>BS}).lazy(()=>Qs(()=>import("./index.lazy-Cf4BJ7np.js"),__vite__mapDeps([5,6])).then(t=>t.Route)),q_e=W_e.update({path:"/book/$slug/",getParentRoute:()=>BS}).lazy(()=>Qs(()=>import("./index.lazy-D7Gh5HMF.js").then(t=>t.n),__vite__mapDeps([7,1,8,9])).then(t=>t.Route)),V_e={IndexLazyRoute:H_e,BookSlugIndexLazyRoute:q_e},K_e=BS._addFileChildren(V_e)._addFileTypes(),G_e=new URLSearchParams(window.location.search);G_e.get("debug");const Z_e=E7e(),Q_e=pCe({routeTree:K_e,history:Z_e}),Y_e=new Qxe,GW="e68f5aaf8852a7276013760c5323852a",J_e={name:"dAcademy",description:"dAcademy",url:"https://dacade.my",icons:["https://dacade.my/octopus%20icon.svg"]},X_e=[Vz,Kz],ZW=new _7e({networks:X_e,projectId:GW});n5e({adapters:[ZW],networks:[Vz,Kz],metadata:J_e,projectId:GW,showWallets:!0,features:{analytics:!0,email:!1,socials:["x","farcaster","discord"]}});const eAe=({children:t})=>Q.jsx(kxe,{config:ZW.wagmiConfig,children:Q.jsx(Yxe,{client:Y_e,children:t})}),B$=document.getElementById("root");B$.innerHTML||cL(B$).render(Q.jsxs(Ye.StrictMode,{children:[Q.jsx(E_e,{position:"bottom-center"}),Q.jsx(eAe,{children:Q.jsx(OCe,{router:Q_e})})]}));export{g5e as $,Se as A,ze as B,ge as C,e8e as D,ot as E,wf as F,dj as G,M4 as H,UF as I,fj as J,gr as K,bb as L,jt as M,F0 as N,qe as O,wS as P,$c as Q,Ae as R,St as S,Lv as T,f0 as U,dTe as V,lr as W,fTe as X,N5 as Y,mTe as Z,uz as _,bs as a,gs as a$,s6e as a0,gTe as a1,Ii as a2,z8e as a3,F8e as a4,Pz as a5,hc as a6,N_ as a7,K8e as a8,Ov as a9,xTe as aA,JF as aB,bTe as aC,U6e as aD,QM as aE,q8e as aF,yS as aG,t4e as aH,sxe as aI,nxe as aJ,G8e as aK,$z as aL,axe as aM,IF as aN,oxe as aO,Txe as aP,z4 as aQ,Mxe as aR,ATe as aS,e$ as aT,Xa as aU,W4 as aV,Pxe as aW,Nxe as aX,Uz as aY,Wxe as aZ,Oxe as a_,N6e as aa,Iv as ab,g0 as ac,vf as ad,Cv as ae,pTe as af,$4 as ag,Ri as ah,K5e as ai,L4 as aj,Rl as ak,Hu as al,Q1 as am,SS as an,jF as ao,CTe as ap,_Te as aq,Vs as ar,i6e as as,s8e as at,tz as au,GF as av,b8e as aw,$8e as ax,O8e as ay,M8e as az,le as b,yl as b$,Uv as b0,Kxe as b1,ETe as b2,Ei as b3,Zce as b4,V6e as b5,gn as b6,TTe as b7,Qs as b8,h$ as b9,hC as bA,d5 as bB,Zw as bC,_1 as bD,Vh as bE,mc as bF,Kh as bG,h5 as bH,Qw as bI,wc as bJ,Yw as bK,ba as bL,_o as bM,gC as bN,Ao as bO,Xw as bP,p5 as bQ,A1 as bR,Nu as bS,E1 as bT,wl as bU,bC as bV,lf as bW,vl as bX,tv as bY,Jw as bZ,R1 as b_,X9 as ba,Fe as bb,vy as bc,yAe as bd,BL as be,Qre as bf,Rt as bg,gh as bh,dC as bi,b1 as bj,x1 as bk,fC as bl,Vw as bm,c5 as bn,Wh as bo,Hh as bp,Kw as bq,va as br,l5 as bs,qh as bt,ya as bu,u5 as bv,Mu as bw,$u as bx,Gw as by,C1 as bz,ye as c,Ou as c0,P1 as c1,Pu as c2,N1 as c3,rv as c4,M1 as c5,uf as c6,df as c7,w5 as c8,nv as c9,mL as cA,c4 as cB,fS as cC,i8e as cD,ow as cE,PF as cF,wTe as cG,iS as cH,X5 as cI,B4 as cJ,vTe as cK,yTe as cL,zA as cM,rAe as cN,nAe as cO,ff as ca,Du as cb,Lu as cc,iv as cd,sv as ce,$1 as cf,Bu as cg,bl as ch,O1 as ci,Gh as cj,Zh as ck,ov as cl,av as cm,Qh as cn,v5 as co,Cs as cp,Js as cq,y5 as cr,Tt as cs,Ue as ct,xn as cu,vn as cv,Z$ as cw,xE as cx,Ea as cy,Exe as cz,Lt as d,Ye as e,Yi as f,Ec as g,_e as h,Te as i,Q as j,q as k,ITe as l,L$ as m,kTe as n,U2 as o,Rn as p,an as q,sc as r,Ts as s,K_ as t,h0 as u,ES as v,w0 as w,xS as x,hTe as y,p0 as z}; diff --git a/assets/index-D1OvKKI2.js b/assets/index-U6IpoprS.js similarity index 92% rename from assets/index-D1OvKKI2.js rename to assets/index-U6IpoprS.js index 8c58ae4..8922ada 100644 --- a/assets/index-D1OvKKI2.js +++ b/assets/index-U6IpoprS.js @@ -1 +1 @@ -import{s,t as r,b as o,L as n,i as P,c as a,f as i,k as Q,a as c}from"./MarkdownEditor-BcjjWJJf.js";import"./index-CI8FOYx1.js";import"./index.lazy-B3BXRqZi.js";import"./isAddressEqual-Cr_byQ5I.js";import"./secp256k1-B_ijNduS.js";const p=s({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,",":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),g=o.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[p],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),f=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=u(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function u(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const m=n.define({name:"json",parser:g.configure({props:[P.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":Q})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function b(){return new c(m)}export{b as json,m as jsonLanguage,f as jsonParseLinter}; +import{s,t as r,b as o,L as n,i as P,c as a,f as i,k as Q,a as c}from"./MarkdownEditor-Bk-WrKMy.js";import"./index-Dje23Sct.js";import"./index.lazy-D7Gh5HMF.js";import"./isAddressEqual-CzhKTe3O.js";import"./secp256k1-B-W0FJZ_.js";const p=s({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,",":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),g=o.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[p],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),f=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=u(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function u(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const m=n.define({name:"json",parser:g.configure({props:[P.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":Q})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function b(){return new c(m)}export{b as json,m as jsonLanguage,f as jsonParseLinter}; diff --git a/assets/index.lazy-DRoQcysg.js b/assets/index.lazy-Cf4BJ7np.js similarity index 99% rename from assets/index.lazy-DRoQcysg.js rename to assets/index.lazy-Cf4BJ7np.js index a13b3e0..4275175 100644 --- a/assets/index.lazy-DRoQcysg.js +++ b/assets/index.lazy-Cf4BJ7np.js @@ -1 +1 @@ -import{e as L,f as N,g as ct,j as y,l as pt,m as ft,t as rt,L as mt,n as vt}from"./index-CI8FOYx1.js";var z={},K={},m={},B={};(function(o){function i(a,s,l){var u=s.slidesToShow,h=s.currentSlide;return l.length>2*u?a+2*u:h>=l.length?l.length+a:a}function t(a,s){if(s.length>2*a){for(var l={},u=s.length-2*a,h=s.length-u,c=u,d=0;d2*a?s.slice(s.length-2*a,s.length).concat(s,s.slice(0,2*a)):s.concat(s,s)}function n(a,s){return s.length>2*a?2*a:s.length}function r(a,s,l){var u,h=a.currentSlide,c=a.slidesToShow,d=a.itemWidth,p=a.totalItems,f=0,v=0,b=h===0,C=s.length-(s.length-2*c);return s.length2*c?((u=h>=C+s.length)&&(v=-d*(f=h-s.length)),b&&(v=-d*(f=C+(s.length-2*c)))):((u=h>=2*s.length)&&(v=-d*(f=h-s.length)),b&&(v=l.showDots?-d*(f=s.length):-d*(f=p/3))),{isReachingTheEnd:u,isReachingTheStart:b,nextSlide:f,nextPosition:v}}Object.defineProperty(o,"__esModule",{value:!0}),o.getOriginalCounterPart=i,o.getOriginalIndexLookupTableByClones=t,o.getClones=e,o.getInitialSlideInInfiniteMode=n,o.checkClonesPosition=r})(B);var O={};Object.defineProperty(O,"__esModule",{value:!0});function gt(o,i,t,e){var n=0,r=e||t;return i&&r&&(n=o[r].partialVisibilityGutter||o[r].paritialVisibilityGutter),n}function St(o,i){var t;return i[o]&&(t=(100/i[o].items).toFixed(1)),t}function yt(o,i,t){return Math.round(t/(i+(o.centerMode?1:0)))}O.getPartialVisibilityGutter=gt,O.getWidthFromDeviceType=St,O.getItemClientSideWidth=yt;var T={};Object.defineProperty(T,"__esModule",{value:!0});var Y=O;function q(o){var i=o.slidesToShow;return o.totalItems=v&&window.innerWidth<=f&&(l=p)}),l}T.notEnoughChildren=q,T.getInitialState=Tt,T.getIfSlideIsVisbile=wt,T.getTransformForCenterMode=st,T.isInLeftEnd=bt,T.isInRightEnd=at,T.getTransformForPartialVsibile=lt,T.parsePosition=ut,T.getTransform=Ct,T.getSlidesToSlide=It;var J={};Object.defineProperty(J,"__esModule",{value:!0});var Mt=function(o,i,t){var e;return function(){var n=arguments;e||(o.apply(this,n),e=!0,typeof t=="function"&&t(!0),setTimeout(function(){e=!1,typeof t=="function"&&t(!1)},i))}};J.default=Mt;var ht={};(function(o){function i(t,e){var n=e.partialVisbile,r=e.partialVisible,a=e.centerMode,s=e.ssr,l=e.responsive;if((n||r)&&a)throw new Error("center mode can not be used at the same time with partialVisible");if(!l)throw s?new Error("ssr mode need to be used in conjunction with responsive prop"):new Error("Responsive prop is needed for deciding the amount of items to show on the screen");if(l&&typeof l!="object")throw new Error("responsive prop must be an object")}Object.defineProperty(o,"__esModule",{value:!0}),o.default=i})(ht);var Q={};Object.defineProperty(Q,"__esModule",{value:!0});var xt=T;function Pt(o,i,t){t===void 0&&(t=0);var e,n,r=o.slidesToShow,a=o.currentSlide,s=o.itemWidth,l=o.totalItems,u=xt.getSlidesToSlide(o,i),h=a+1+t+r+(0Math.abs(s)))return;var l=S.populateSlidesOnMouseTouchMove(this.state,this.props,this.initialX,this.lastX,n,this.transformPlaceHolder),u=l.direction,h=l.nextPosition,c=l.canContinue;u&&(this.direction=u,c&&h!==void 0&&this.setTransformDirectly(h)),this.lastX=n}}},i.prototype.handleOut=function(t){this.props.autoPlay&&!this.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed));var e=t.type==="touchend"&&!this.props.swipeable,n=(t.type==="mouseleave"||t.type==="mouseup")&&!this.props.draggable;if(!e&&!n&&this.onMove){if(this.setAnimationDirectly(!0),this.direction==="right")if(this.initialX-this.lastX>=this.props.minimumTouchDrag){var r=Math.round((this.initialX-this.lastX)/this.state.itemWidth);this.next(r)}else this.correctItemsPosition(this.state.itemWidth,!0,!0);this.direction==="left"&&(this.lastX-this.initialX>this.props.minimumTouchDrag?(r=Math.round((this.lastX-this.initialX)/this.state.itemWidth),this.previous(r)):this.correctItemsPosition(this.state.itemWidth,!0,!0)),this.resetMoveStatus()}},i.prototype.isInViewport=function(t){var e=t.getBoundingClientRect(),n=e.top,r=n===void 0?0:n,a=e.left,s=a===void 0?0:a,l=e.bottom,u=l===void 0?0:l,h=e.right,c=h===void 0?0:h;return 0<=r&&0<=s&&u<=(window.innerHeight||document.documentElement.clientHeight)&&c<=(window.innerWidth||document.documentElement.clientWidth)},i.prototype.isChildOfCarousel=function(t){return!!(t instanceof Element&&this.listRef&&this.listRef.current)&&this.listRef.current.contains(t)},i.prototype.onKeyUp=function(t){var e=t.target;switch(t.keyCode){case 37:if(this.isChildOfCarousel(e))return this.previous();break;case 39:if(this.isChildOfCarousel(e))return this.next();break;case 9:if(this.isChildOfCarousel(e)&&e instanceof HTMLInputElement&&this.isInViewport(e))return this.next()}},i.prototype.handleEnter=function(t){E.isMouseMoveEvent(t)&&this.autoPlay&&this.props.autoPlay&&this.props.pauseOnHover&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},i.prototype.goToSlide=function(t,e,n){var r=this;if(n===void 0&&(n=!0),!this.isInThrottle){var a=this.state.itemWidth,s=this.props,l=s.afterChange,u=s.beforeChange,h=this.state.currentSlide;typeof u!="function"||e&&(typeof e!="object"||e.skipBeforeChange)||u(t,this.getState()),this.isAnimationAllowed=n,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({currentSlide:t,transform:-a*t},function(){r.props.infinite&&r.correctClonesPosition({domLoaded:!0}),typeof l!="function"||e&&(typeof e!="object"||e.skipAfterChange)||(i.afterChangeTimeout3=setTimeout(function(){l(h,r.getState())},r.props.transitionDuration||P))})}},i.prototype.getState=function(){return this.state},i.prototype.renderLeftArrow=function(t){var e=this,n=this.props,r=n.customLeftArrow,a=n.rtl;return w.createElement(ot.LeftArrow,{customLeftArrow:r,getState:function(){return e.getState()},previous:this.previous,disabled:t,rtl:a})},i.prototype.renderRightArrow=function(t){var e=this,n=this.props,r=n.customRightArrow,a=n.rtl;return w.createElement(ot.RightArrow,{customRightArrow:r,getState:function(){return e.getState()},next:this.next,disabled:t,rtl:a})},i.prototype.renderButtonGroups=function(){var t=this,e=this.props.customButtonGroup;return e?w.cloneElement(e,{previous:function(){return t.previous()},next:function(){return t.next()},goToSlide:function(n,r){return t.goToSlide(n,r)},carouselState:this.getState()}):null},i.prototype.renderDotsList=function(){var t=this;return w.createElement(Qt.default,{state:this.state,props:this.props,goToSlide:this.goToSlide,getState:function(){return t.getState()}})},i.prototype.renderCarouselItems=function(){var t=[];if(this.props.infinite){var e=w.Children.toArray(this.props.children);t=S.getClones(this.state.slidesToShow,e)}return w.createElement(Zt.default,{clones:t,goToSlide:this.goToSlide,state:this.state,notEnoughChildren:S.notEnoughChildren(this.state),props:this.props})},i.prototype.render=function(){var t=this.props,e=t.deviceType,n=t.arrows,r=t.renderArrowsWhenDisabled,a=t.removeArrowOnDeviceType,s=t.infinite,l=t.containerClass,u=t.sliderClass,h=t.customTransition,c=t.additionalTransfrom,d=t.renderDotsOutside,p=t.renderButtonGroupOutside,f=t.className,v=t.rtl,b=S.getInitialState(this.state,this.props),C=b.shouldRenderOnSSR,I=b.shouldRenderAtAll,g=S.isInLeftEnd(this.state),x=S.isInRightEnd(this.state),M=n&&!(a&&(e&&-1y.jsxs("header",{className:"justify-start mb-4",children:[y.jsx("h1",{className:"text-2xl font-medium text-primary justify-left text-left text-shadow-md",children:o}),y.jsx("h2",{className:"text-xl font-medium text-accent justify-left text-left text-shadow-md",children:i})]}),le=pt("/")({component:se}),ne={superLargeDesktop:{breakpoint:{max:4e3,min:3e3},items:5},desktop:{breakpoint:{max:3e3,min:1024},items:4},tablet:{breakpoint:{max:1024,min:464},items:2},mobile:{breakpoint:{max:464,min:0},items:1}},re=({id:o,title:i,description:t,items:e})=>y.jsxs("div",{id:o,className:"container py-4 mt-30 gap-4 scroll-mt-20",children:[y.jsx(oe,{title:i,description:t}),y.jsx(ie,{responsive:ne,className:"gap-4 md:gap-6 lg:gap-8 w-full",children:e.map((n,r)=>y.jsx("div",{id:`${o}-${rt(n.title)}`,children:y.jsx(vt,{...n})},r))})]});function se(){return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:"top",className:"scroll-mt-32",children:y.jsx("h2",{className:"text-accent font-light text-3xl mb-2 pt-6",children:"A de-store of knowledge. Onboard forward."})}),y.jsx("div",{className:"container p-4 mt-30 gap-4",children:ft.map((o,i)=>y.jsx(re,{id:rt(o.title),title:o.title,description:o.description,items:o.books},i))}),y.jsx("div",{className:"fixed bottom-0 right-0 p-4",children:y.jsx(mt,{to:"/#top",className:"btn btn-ghost text-xl",children:y.jsxs("div",{className:"flex flex-col justify-center items-center",children:[y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 10l7-7 7 7"})}),y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 10l7-7 7 7"})})]})})})]})}export{se as App,le as Route,se as default}; +import{e as L,f as N,g as ct,j as y,l as pt,m as ft,t as rt,L as mt,n as vt}from"./index-Dje23Sct.js";var z={},K={},m={},B={};(function(o){function i(a,s,l){var u=s.slidesToShow,h=s.currentSlide;return l.length>2*u?a+2*u:h>=l.length?l.length+a:a}function t(a,s){if(s.length>2*a){for(var l={},u=s.length-2*a,h=s.length-u,c=u,d=0;d2*a?s.slice(s.length-2*a,s.length).concat(s,s.slice(0,2*a)):s.concat(s,s)}function n(a,s){return s.length>2*a?2*a:s.length}function r(a,s,l){var u,h=a.currentSlide,c=a.slidesToShow,d=a.itemWidth,p=a.totalItems,f=0,v=0,b=h===0,C=s.length-(s.length-2*c);return s.length2*c?((u=h>=C+s.length)&&(v=-d*(f=h-s.length)),b&&(v=-d*(f=C+(s.length-2*c)))):((u=h>=2*s.length)&&(v=-d*(f=h-s.length)),b&&(v=l.showDots?-d*(f=s.length):-d*(f=p/3))),{isReachingTheEnd:u,isReachingTheStart:b,nextSlide:f,nextPosition:v}}Object.defineProperty(o,"__esModule",{value:!0}),o.getOriginalCounterPart=i,o.getOriginalIndexLookupTableByClones=t,o.getClones=e,o.getInitialSlideInInfiniteMode=n,o.checkClonesPosition=r})(B);var O={};Object.defineProperty(O,"__esModule",{value:!0});function gt(o,i,t,e){var n=0,r=e||t;return i&&r&&(n=o[r].partialVisibilityGutter||o[r].paritialVisibilityGutter),n}function St(o,i){var t;return i[o]&&(t=(100/i[o].items).toFixed(1)),t}function yt(o,i,t){return Math.round(t/(i+(o.centerMode?1:0)))}O.getPartialVisibilityGutter=gt,O.getWidthFromDeviceType=St,O.getItemClientSideWidth=yt;var T={};Object.defineProperty(T,"__esModule",{value:!0});var Y=O;function q(o){var i=o.slidesToShow;return o.totalItems=v&&window.innerWidth<=f&&(l=p)}),l}T.notEnoughChildren=q,T.getInitialState=Tt,T.getIfSlideIsVisbile=wt,T.getTransformForCenterMode=st,T.isInLeftEnd=bt,T.isInRightEnd=at,T.getTransformForPartialVsibile=lt,T.parsePosition=ut,T.getTransform=Ct,T.getSlidesToSlide=It;var J={};Object.defineProperty(J,"__esModule",{value:!0});var Mt=function(o,i,t){var e;return function(){var n=arguments;e||(o.apply(this,n),e=!0,typeof t=="function"&&t(!0),setTimeout(function(){e=!1,typeof t=="function"&&t(!1)},i))}};J.default=Mt;var ht={};(function(o){function i(t,e){var n=e.partialVisbile,r=e.partialVisible,a=e.centerMode,s=e.ssr,l=e.responsive;if((n||r)&&a)throw new Error("center mode can not be used at the same time with partialVisible");if(!l)throw s?new Error("ssr mode need to be used in conjunction with responsive prop"):new Error("Responsive prop is needed for deciding the amount of items to show on the screen");if(l&&typeof l!="object")throw new Error("responsive prop must be an object")}Object.defineProperty(o,"__esModule",{value:!0}),o.default=i})(ht);var Q={};Object.defineProperty(Q,"__esModule",{value:!0});var xt=T;function Pt(o,i,t){t===void 0&&(t=0);var e,n,r=o.slidesToShow,a=o.currentSlide,s=o.itemWidth,l=o.totalItems,u=xt.getSlidesToSlide(o,i),h=a+1+t+r+(0Math.abs(s)))return;var l=S.populateSlidesOnMouseTouchMove(this.state,this.props,this.initialX,this.lastX,n,this.transformPlaceHolder),u=l.direction,h=l.nextPosition,c=l.canContinue;u&&(this.direction=u,c&&h!==void 0&&this.setTransformDirectly(h)),this.lastX=n}}},i.prototype.handleOut=function(t){this.props.autoPlay&&!this.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed));var e=t.type==="touchend"&&!this.props.swipeable,n=(t.type==="mouseleave"||t.type==="mouseup")&&!this.props.draggable;if(!e&&!n&&this.onMove){if(this.setAnimationDirectly(!0),this.direction==="right")if(this.initialX-this.lastX>=this.props.minimumTouchDrag){var r=Math.round((this.initialX-this.lastX)/this.state.itemWidth);this.next(r)}else this.correctItemsPosition(this.state.itemWidth,!0,!0);this.direction==="left"&&(this.lastX-this.initialX>this.props.minimumTouchDrag?(r=Math.round((this.lastX-this.initialX)/this.state.itemWidth),this.previous(r)):this.correctItemsPosition(this.state.itemWidth,!0,!0)),this.resetMoveStatus()}},i.prototype.isInViewport=function(t){var e=t.getBoundingClientRect(),n=e.top,r=n===void 0?0:n,a=e.left,s=a===void 0?0:a,l=e.bottom,u=l===void 0?0:l,h=e.right,c=h===void 0?0:h;return 0<=r&&0<=s&&u<=(window.innerHeight||document.documentElement.clientHeight)&&c<=(window.innerWidth||document.documentElement.clientWidth)},i.prototype.isChildOfCarousel=function(t){return!!(t instanceof Element&&this.listRef&&this.listRef.current)&&this.listRef.current.contains(t)},i.prototype.onKeyUp=function(t){var e=t.target;switch(t.keyCode){case 37:if(this.isChildOfCarousel(e))return this.previous();break;case 39:if(this.isChildOfCarousel(e))return this.next();break;case 9:if(this.isChildOfCarousel(e)&&e instanceof HTMLInputElement&&this.isInViewport(e))return this.next()}},i.prototype.handleEnter=function(t){E.isMouseMoveEvent(t)&&this.autoPlay&&this.props.autoPlay&&this.props.pauseOnHover&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},i.prototype.goToSlide=function(t,e,n){var r=this;if(n===void 0&&(n=!0),!this.isInThrottle){var a=this.state.itemWidth,s=this.props,l=s.afterChange,u=s.beforeChange,h=this.state.currentSlide;typeof u!="function"||e&&(typeof e!="object"||e.skipBeforeChange)||u(t,this.getState()),this.isAnimationAllowed=n,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({currentSlide:t,transform:-a*t},function(){r.props.infinite&&r.correctClonesPosition({domLoaded:!0}),typeof l!="function"||e&&(typeof e!="object"||e.skipAfterChange)||(i.afterChangeTimeout3=setTimeout(function(){l(h,r.getState())},r.props.transitionDuration||P))})}},i.prototype.getState=function(){return this.state},i.prototype.renderLeftArrow=function(t){var e=this,n=this.props,r=n.customLeftArrow,a=n.rtl;return w.createElement(ot.LeftArrow,{customLeftArrow:r,getState:function(){return e.getState()},previous:this.previous,disabled:t,rtl:a})},i.prototype.renderRightArrow=function(t){var e=this,n=this.props,r=n.customRightArrow,a=n.rtl;return w.createElement(ot.RightArrow,{customRightArrow:r,getState:function(){return e.getState()},next:this.next,disabled:t,rtl:a})},i.prototype.renderButtonGroups=function(){var t=this,e=this.props.customButtonGroup;return e?w.cloneElement(e,{previous:function(){return t.previous()},next:function(){return t.next()},goToSlide:function(n,r){return t.goToSlide(n,r)},carouselState:this.getState()}):null},i.prototype.renderDotsList=function(){var t=this;return w.createElement(Qt.default,{state:this.state,props:this.props,goToSlide:this.goToSlide,getState:function(){return t.getState()}})},i.prototype.renderCarouselItems=function(){var t=[];if(this.props.infinite){var e=w.Children.toArray(this.props.children);t=S.getClones(this.state.slidesToShow,e)}return w.createElement(Zt.default,{clones:t,goToSlide:this.goToSlide,state:this.state,notEnoughChildren:S.notEnoughChildren(this.state),props:this.props})},i.prototype.render=function(){var t=this.props,e=t.deviceType,n=t.arrows,r=t.renderArrowsWhenDisabled,a=t.removeArrowOnDeviceType,s=t.infinite,l=t.containerClass,u=t.sliderClass,h=t.customTransition,c=t.additionalTransfrom,d=t.renderDotsOutside,p=t.renderButtonGroupOutside,f=t.className,v=t.rtl,b=S.getInitialState(this.state,this.props),C=b.shouldRenderOnSSR,I=b.shouldRenderAtAll,g=S.isInLeftEnd(this.state),x=S.isInRightEnd(this.state),M=n&&!(a&&(e&&-1y.jsxs("header",{className:"justify-start mb-4",children:[y.jsx("h1",{className:"text-2xl font-medium text-primary justify-left text-left text-shadow-md",children:o}),y.jsx("h2",{className:"text-xl font-medium text-accent justify-left text-left text-shadow-md",children:i})]}),le=pt("/")({component:se}),ne={superLargeDesktop:{breakpoint:{max:4e3,min:3e3},items:5},desktop:{breakpoint:{max:3e3,min:1024},items:4},tablet:{breakpoint:{max:1024,min:464},items:2},mobile:{breakpoint:{max:464,min:0},items:1}},re=({id:o,title:i,description:t,items:e})=>y.jsxs("div",{id:o,className:"container py-4 mt-30 gap-4 scroll-mt-20",children:[y.jsx(oe,{title:i,description:t}),y.jsx(ie,{responsive:ne,className:"gap-4 md:gap-6 lg:gap-8 w-full",children:e.map((n,r)=>y.jsx("div",{id:`${o}-${rt(n.title)}`,children:y.jsx(vt,{...n})},r))})]});function se(){return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:"top",className:"scroll-mt-32",children:y.jsx("h2",{className:"text-accent font-light text-3xl mb-2 pt-6",children:"A de-store of knowledge. Onboard forward."})}),y.jsx("div",{className:"container p-4 mt-30 gap-4",children:ft.map((o,i)=>y.jsx(re,{id:rt(o.title),title:o.title,description:o.description,items:o.books},i))}),y.jsx("div",{className:"fixed bottom-0 right-0 p-4",children:y.jsx(mt,{to:"/#top",className:"btn btn-ghost text-xl",children:y.jsxs("div",{className:"flex flex-col justify-center items-center",children:[y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 10l7-7 7 7"})}),y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 10l7-7 7 7"})})]})})})]})}export{se as App,le as Route,se as default}; diff --git a/assets/index.lazy-B3BXRqZi.js b/assets/index.lazy-D7Gh5HMF.js similarity index 97% rename from assets/index.lazy-B3BXRqZi.js rename to assets/index.lazy-D7Gh5HMF.js index 107b5d3..22eca13 100644 --- a/assets/index.lazy-B3BXRqZi.js +++ b/assets/index.lazy-D7Gh5HMF.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownEditor-BcjjWJJf.js","assets/index-CI8FOYx1.js","assets/index-DQLbHeQa.css"])))=>i.map(i=>d[i]); -var dn=Object.defineProperty;var qt=o=>{throw TypeError(o)};var hn=(o,i,s)=>i in o?dn(o,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[i]=s;var U=(o,i,s)=>hn(o,typeof i!="symbol"?i+"":i,s),At=(o,i,s)=>i.has(o)||qt("Cannot "+s);var F=(o,i,s)=>(At(o,i,"read from private field"),s?s.call(o):i.get(o)),Y=(o,i,s)=>i.has(o)?qt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(o):i.set(o,s),Q=(o,i,s,a)=>(At(o,i,"write to private field"),a?a.call(o,s):i.set(o,s),s),te=(o,i,s)=>(At(o,i,"access private method"),s);import{e as reactExports,o as getChainContractAddress,q as getAction$1,u as toHex,v as packetToBytes,w as readContract,B as BaseError$2,x as getAbiItem,y as AbiEventNotFoundError,z as formatAbiItem,D as toEventSelector,F as keccak256,H as toBytes$4,I as encodeAbiParameters,K as numberToHex,N as encodeFunctionData,P as estimateGas,Q as parseAccount,T as getContractError,U as hexToNumber,V as AbiEventSignatureEmptyTopicsError,X as AbiEventSignatureNotFoundError,Z as DecodeLogTopicsMismatch,_ as decodeAbiParameters,$ as AbiDecodingDataSizeTooSmallError,a0 as PositionOutOfBoundsError,a1 as DecodeLogDataMismatch,a2 as size$4,a3 as formatLog,a4 as getBlockNumber,a5 as getTransaction,a6 as stringify$2,a7 as observe,a8 as poll$1,a9 as getBlock,aa as formatBlock,ab as InvalidInputRpcError,ac as concat$2,ad as isAddress,ae as InvalidAddressError,af as BytesSizeMismatchError,ag as stringToHex,ah as bytesToHex$1,ai as sliceHex,aj as concatHex,ak as hexToBytes$1,al as isHex,am as hexToBigInt,an as call,ao as encodeDeployData,ap as universalSignatureValidatorAbi,aq as universalSignatureValidatorByteCode,ar as getAddress,as as recoverAddress,at as CallExecutionError,au as getBalance,av as getChainId$1,aw as getEnsAddress,ax as getEnsAvatar,ay as getEnsName,az as getEnsText,aA as estimateFeesPerGas,aB as getGasPrice,aC as estimateMaxPriorityFeePerGas,aD as getTransactionCount,aE as getTransactionReceipt,aF as multicall,aG as prepareTransactionRequest,aH as sendRawTransaction,aI as simulateContract$1,aJ as waitForTransactionReceipt$1,aK as watchBlockNumber,aL as createClient,aM as custom,aN as hexToString,aO as writeContract$1,aP as WagmiContext,aQ as Subscribable,aR as resolveEnabled,aS as shallowEqualObjects,aT as resolveStaleTime,aU as noop$3,aV as isServer,aW as isValidTimeout,aX as timeUntilStale,aY as focusManager,aZ as fetchState,a_ as replaceData,a$ as notifyManager,b0 as hashKey,b1 as getDefaultState,b2 as useQueryClient,m as playbooks,t as toSlug,j as jsxRuntimeExports,b3 as clsx,f as commonjsGlobal,g as getDefaultExportFromCjs,b4 as nodeCrypto,b5 as sha256$7,b6 as React__default,b7 as _t,b8 as __vitePreload,b9 as mainnet,ba as http,l as createLazyFileRoute}from"./index-CI8FOYx1.js";import{i as isAddressEqual}from"./isAddressEqual-Cr_byQ5I.js";import{e as equalBytes$1,s as secp256k1}from"./secp256k1-B_ijNduS.js";var encode_1$f=encode$S,MSB$h=128,REST$h=127,MSBALL$g=~REST$h,INT$g=Math.pow(2,31);function encode$S(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$g;)i[s++]=o&255|MSB$h,o/=128;for(;o&MSBALL$g;)i[s++]=o&255|MSB$h,o>>>=7;return i[s]=o|0,encode$S.bytes=s-a+1,i}var decode$1h=read$i,MSB$1$f=128,REST$1$f=127;function read$i(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$i.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$f)<=MSB$1$f);return read$i.bytes=d-a,s}var N1$f=Math.pow(2,7),N2$f=Math.pow(2,14),N3$f=Math.pow(2,21),N4$f=Math.pow(2,28),N5$f=Math.pow(2,35),N6$f=Math.pow(2,42),N7$f=Math.pow(2,49),N8$f=Math.pow(2,56),N9$f=Math.pow(2,63),length$f=function(o){return o(_brrp_varint$e.encode(o,i,s),i),encodingLength$e=o=>_brrp_varint$e.encodingLength(o),create$w=(o,i)=>{const s=i.byteLength,a=encodingLength$e(o),c=a+encodingLength$e(s),d=new Uint8Array(c+s);return encodeTo$e(o,d,0),encodeTo$e(s,d,a),d.set(i,c),new Digest$e(o,s,i,d)};let Digest$e=class{constructor(i,s,a,c){this.code=i,this.size=s,this.digest=a,this.bytes=c}};const from$u=({name:o,code:i,encode:s})=>new Hasher$7(o,i,s);let Hasher$7=class{constructor(i,s,a){this.name=i,this.code=s,this.encode=a}digest(i){if(i instanceof Uint8Array){const s=this.encode(i);return s instanceof Uint8Array?create$w(this.code,s):s.then(a=>create$w(this.code,a))}else throw Error("Unknown type, must be binary type")}};const sha$5=o=>async i=>new Uint8Array(await crypto.subtle.digest(o,i)),sha256$6=from$u({name:"sha2-256",code:18,encode:sha$5("SHA-256")});var shim={exports:{}},useSyncExternalStoreShim_production_min={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownEditor-Bk-WrKMy.js","assets/index-Dje23Sct.js","assets/index-DQLbHeQa.css"])))=>i.map(i=>d[i]); +var dn=Object.defineProperty;var qt=o=>{throw TypeError(o)};var hn=(o,i,s)=>i in o?dn(o,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[i]=s;var U=(o,i,s)=>hn(o,typeof i!="symbol"?i+"":i,s),At=(o,i,s)=>i.has(o)||qt("Cannot "+s);var F=(o,i,s)=>(At(o,i,"read from private field"),s?s.call(o):i.get(o)),Y=(o,i,s)=>i.has(o)?qt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(o):i.set(o,s),Q=(o,i,s,a)=>(At(o,i,"write to private field"),a?a.call(o,s):i.set(o,s),s),te=(o,i,s)=>(At(o,i,"access private method"),s);import{e as reactExports,o as getChainContractAddress,q as getAction$1,u as toHex,v as packetToBytes,w as readContract,B as BaseError$2,x as getAbiItem,y as AbiEventNotFoundError,z as formatAbiItem,D as toEventSelector,F as keccak256,H as toBytes$4,I as encodeAbiParameters,K as numberToHex,N as encodeFunctionData,P as estimateGas,Q as parseAccount,T as getContractError,U as hexToNumber,V as AbiEventSignatureEmptyTopicsError,X as AbiEventSignatureNotFoundError,Z as DecodeLogTopicsMismatch,_ as decodeAbiParameters,$ as AbiDecodingDataSizeTooSmallError,a0 as PositionOutOfBoundsError,a1 as DecodeLogDataMismatch,a2 as size$4,a3 as formatLog,a4 as getBlockNumber,a5 as getTransaction,a6 as stringify$2,a7 as observe,a8 as poll$1,a9 as getBlock,aa as formatBlock,ab as InvalidInputRpcError,ac as concat$2,ad as isAddress,ae as InvalidAddressError,af as BytesSizeMismatchError,ag as stringToHex,ah as bytesToHex$1,ai as sliceHex,aj as concatHex,ak as hexToBytes$1,al as isHex,am as hexToBigInt,an as call,ao as encodeDeployData,ap as universalSignatureValidatorAbi,aq as universalSignatureValidatorByteCode,ar as getAddress,as as recoverAddress,at as CallExecutionError,au as getBalance,av as getChainId$1,aw as getEnsAddress,ax as getEnsAvatar,ay as getEnsName,az as getEnsText,aA as estimateFeesPerGas,aB as getGasPrice,aC as estimateMaxPriorityFeePerGas,aD as getTransactionCount,aE as getTransactionReceipt,aF as multicall,aG as prepareTransactionRequest,aH as sendRawTransaction,aI as simulateContract$1,aJ as waitForTransactionReceipt$1,aK as watchBlockNumber,aL as createClient,aM as custom,aN as hexToString,aO as writeContract$1,aP as WagmiContext,aQ as Subscribable,aR as resolveEnabled,aS as shallowEqualObjects,aT as resolveStaleTime,aU as noop$3,aV as isServer,aW as isValidTimeout,aX as timeUntilStale,aY as focusManager,aZ as fetchState,a_ as replaceData,a$ as notifyManager,b0 as hashKey,b1 as getDefaultState,b2 as useQueryClient,m as playbooks,t as toSlug,j as jsxRuntimeExports,b3 as clsx,f as commonjsGlobal,g as getDefaultExportFromCjs,b4 as nodeCrypto,b5 as sha256$7,b6 as React__default,b7 as _t,b8 as __vitePreload,b9 as mainnet,ba as http,l as createLazyFileRoute}from"./index-Dje23Sct.js";import{i as isAddressEqual}from"./isAddressEqual-CzhKTe3O.js";import{e as equalBytes$1,s as secp256k1}from"./secp256k1-B-W0FJZ_.js";var encode_1$f=encode$S,MSB$h=128,REST$h=127,MSBALL$g=~REST$h,INT$g=Math.pow(2,31);function encode$S(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$g;)i[s++]=o&255|MSB$h,o/=128;for(;o&MSBALL$g;)i[s++]=o&255|MSB$h,o>>>=7;return i[s]=o|0,encode$S.bytes=s-a+1,i}var decode$1h=read$i,MSB$1$f=128,REST$1$f=127;function read$i(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$i.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$f)<=MSB$1$f);return read$i.bytes=d-a,s}var N1$f=Math.pow(2,7),N2$f=Math.pow(2,14),N3$f=Math.pow(2,21),N4$f=Math.pow(2,28),N5$f=Math.pow(2,35),N6$f=Math.pow(2,42),N7$f=Math.pow(2,49),N8$f=Math.pow(2,56),N9$f=Math.pow(2,63),length$f=function(o){return o(_brrp_varint$e.encode(o,i,s),i),encodingLength$e=o=>_brrp_varint$e.encodingLength(o),create$w=(o,i)=>{const s=i.byteLength,a=encodingLength$e(o),c=a+encodingLength$e(s),d=new Uint8Array(c+s);return encodeTo$e(o,d,0),encodeTo$e(s,d,a),d.set(i,c),new Digest$e(o,s,i,d)};let Digest$e=class{constructor(i,s,a,c){this.code=i,this.size=s,this.digest=a,this.bytes=c}};const from$u=({name:o,code:i,encode:s})=>new Hasher$7(o,i,s);let Hasher$7=class{constructor(i,s,a){this.name=i,this.code=s,this.encode=a}digest(i){if(i instanceof Uint8Array){const s=this.encode(i);return s instanceof Uint8Array?create$w(this.code,s):s.then(a=>create$w(this.code,a))}else throw Error("Unknown type, must be binary type")}};const sha$5=o=>async i=>new Uint8Array(await crypto.subtle.digest(o,i)),sha256$6=from$u({name:"sha2-256",code:18,encode:sha$5("SHA-256")});var shim={exports:{}},useSyncExternalStoreShim_production_min={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -2194,4 +2194,4 @@ zebra zero zone zoo`.split(` -`),Provider$1=match$1({method:"web"}),add$8=capability({can:"provider/add",with:AccountDID$1,nb:struct({provider:Provider$1,consumer:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.provider,i.nb.provider,"provider"))||and$2(equal(o.nb.consumer,i.nb.consumer,"consumer"))||ok({})}),Provider$2=Object.freeze(Object.defineProperty({__proto__:null,AccountDID:AccountDID$1,Provider:Provider$1,add:add$8},Symbol.toStringTag,{value:"Module"})),{Provider:ProviderDID$3,AccountDID}=Provider$2,add$7=async(o,{account:i,consumer:s,provider:a=o.connection.id.did(),proofs:c})=>{if(!ProviderDID$3.is(a))throw new Error(`Unable to determine provider from agent.connection.id did ${a}. expected a did:web:`);const{out:d}=await o.invokeAndExecute(add$8,{with:i,nb:{provider:a,consumer:s},proofs:c});return d},generate$1=async({name:o,agent:i})=>{const{signer:s}=await generate$2();return new OwnedSpace({signer:s,name:o,agent:i})},fromMnemonic=async(o,{name:i,agent:s})=>{const a=mnemonicToEntropy(o,wordlist),c=await derive(a);return new OwnedSpace({signer:c,name:i,agent:s})},toMnemonic=({signer:o})=>{const i=o.secret;return entropyToMnemonic(i,wordlist)},createRecovery=(o,i)=>createAuthorization(o,{agent:o.signer.withDID(i),access:accountAccess$1,expiration:1/0}),SESSION_LIFETIME=60*60*24*365,createAuthorization=async({signer:o,name:i},{agent:s,access:a=spaceAccess$1,expiration:c=now()+SESSION_LIFETIME})=>await delegate$3({issuer:o,audience:s,capabilities:toCapabilities({[o.did()]:a}),...c?{expiration:c}:{},facts:[{space:{name:i}}]}),toCapabilities=o=>{const i=[];for(const[s,a]of Object.entries(o)){const c=Object.entries(a);for(const[d,f]of c)f&&i.push({can:d,with:s})}return i};class OwnedSpace{constructor(i){this.model=i}get signer(){return this.model.signer}get name(){return this.model.name}did(){return this.signer.did()}withName(i){return new OwnedSpace({signer:this.signer,name:i})}async save({agent:i=this.model.agent}={}){if(!i)return fail("Please provide an agent to save the space into");const s=await createAuthorization(this,{agent:i});return await i.importSpaceFromDelegation(s),await i.setCurrentSpace(this.did()),{ok:{}}}provision({proofs:i},{agent:s=this.model.agent}={}){return s?provision(this,{proofs:i,agent:s}):fail("Please provide an agent to save the space into")}async createRecovery(i){return createRecovery(this,i)}createAuthorization(i,s){return createAuthorization(this,{...s,agent:i})}toMnemonic(){return toMnemonic(this)}}const SpaceDID=match$1({method:"key"}),fromDelegation=o=>{var a;const i=SpaceDID.read(o.capabilities[0].with);if(i.error)throw Object.assign(new Error(`Invalid delegation, expected capabilities[0].with to be DID, ${i.error}`),{cause:i.error});const s=((a=o.facts[0])==null?void 0:a.space)??{};return new SharedSpace({id:i.ok,delegation:o,meta:s})},provision=async(o,{proofs:i,agent:s})=>{const[a]=i[0].capabilities,{ok:c,error:d}=AccountDID.read(a.with);return d?error$1(d):await add$7(s,{consumer:o.did(),account:c,proofs:i})};class SharedSpace{constructor(i){this.model=i}get delegation(){return this.model.delegation}get meta(){return this.model.meta}get name(){return this.meta.name??""}did(){return this.model.id}withName(i){return new SharedSpace({...this.model,meta:{...this.meta,name:i}})}}function isExpired(o){return o.expiration===void 0||o.expiration<=Math.floor(Date.now()/1e3)}function isTooEarly(o){return o.notBefore?o.notBefore>Math.floor(Date.now()/1e3):!1}function canDelegateCapability(o,i){const s=allows(o);for(const[a,c]of Object.entries(s))if(matchResource(a,i.with)){const d=Object.keys(c);for(const f of d)if(canDelegateAbility(f,i.can))return!0}return!1}const matchResource=(o,i)=>i==="ucan:*"?!0:typeof i=="string"?o===i:i.test(o),_globalReference=globalThis||window||self,webcrypto=_globalReference.crypto,tagWith=(o,i)=>{const s=encodingLength$7(o),a=new Uint8Array(i.byteLength+s);return encodeTo$7(o,a,0),a.set(i,s),a},untagWith=(o,i,s=0)=>{const a=s!==0?i.subarray(s):i,[c,d]=decode$C(a);if(c!==o)throw new Error(`Expected multiformat with 0x${o.toString(16)} tag instead got 0x${c.toString(16)}`);return new Uint8Array(a.buffer,a.byteOffset+d)},TAG_SIZE$1=1,INT_TAG=2,BITSTRING_TAG=3,OCTET_STRING_TAG=4,SEQUENCE_TAG=48,UNUSED_BIT_PAD=0,encodeDERLength=o=>{if(o<=127)return new Uint8Array([o]);const i=[];for(;o!==0;)i.push(o&255),o=o>>>8;return i.reverse(),new Uint8Array([128|i.length&255,...i])},readDERLength=(o,i=0)=>{if(!(o[i]&128))return{number:o[i],consumed:1};const s=o[i]&127;if(o.length{const a=into(o,i,s);return a.position+a.length},into=(o,i,s)=>{const a=o[s];if(a!==i)throw new Error(`ASN parsing error: Expected tag 0x${i.toString(16)} at position ${s}, but got 0x${a.toString(16)}.`);const c=readDERLength(o,s+TAG_SIZE$1);return{position:s+TAG_SIZE$1+c.consumed,length:c.number}},encodeBitString=o=>{const i=encodeDERLength(o.byteLength+1),s=new Uint8Array(TAG_SIZE$1+i.byteLength+1+o.byteLength);let a=0;return s[a]=BITSTRING_TAG,a+=TAG_SIZE$1,s.set(i,a),a+=i.byteLength,s[a]=UNUSED_BIT_PAD,a+=1,s.set(o,a),s},encodeOctetString=o=>{const i=encodeDERLength(o.byteLength),s=new Uint8Array(TAG_SIZE$1+i.byteLength+o.byteLength);let a=0;return s[a]=OCTET_STRING_TAG,a+=TAG_SIZE$1,s.set(i,a),a+=i.byteLength,s.set(o,a),s},encodeSequence=o=>{let i=0;for(const d of o)i+=d.byteLength;const s=encodeDERLength(i),a=new Uint8Array(TAG_SIZE$1+s.byteLength+i);let c=0;a[c]=SEQUENCE_TAG,c+=TAG_SIZE$1,a.set(s,c),c+=s.byteLength;for(const d of o)a.set(d,c),c+=d.byteLength;return a},readSequence=(o,i=0)=>{const{position:s,length:a}=into(o,SEQUENCE_TAG,i);return new Uint8Array(o.buffer,o.byteOffset+s,a)},encodeInt=o=>{const i=o.byteLength===0||o[0]&128?1:0,s=encodeDERLength(o.byteLength+i),a=new Uint8Array(TAG_SIZE$1+s.byteLength+o.byteLength+i);let c=0;return a[c]=INT_TAG,c+=TAG_SIZE$1,a.set(s,c),c+=s.byteLength,i>0&&(a[c]=UNUSED_BIT_PAD,c+=i),a.set(o,c),a},enterSequence=(o,i=0)=>into(o,SEQUENCE_TAG,i).position,skipSequence=(o,i=0)=>skip(o,SEQUENCE_TAG,i),skipInt=(o,i=0)=>skip(o,INT_TAG,i),readBitString=(o,i=0)=>{const{position:s,length:a}=into(o,BITSTRING_TAG,i),c=o[s];if(c!==UNUSED_BIT_PAD)throw new Error(`Can not read bitstring, expected length to be multiple of 8, but got ${c} unused bits in last byte.`);return new Uint8Array(o.buffer,o.byteOffset+s+1,a-1)},readInt$1=(o,i=0)=>{const{position:s,length:a}=into(o,INT_TAG,i);let c=0;for(;o[s+c]===0;)c++;return new Uint8Array(o.buffer,o.byteOffset+s+c,a-c)},readOctetString=(o,i=0)=>{const{position:s,length:a}=into(o,OCTET_STRING_TAG,i);return new Uint8Array(o.buffer,o.byteOffset+s,a)},readSequenceWith=(o,i,s=0)=>{const a=[],c=readSequence(i,s);let d=0;for(const f of o){const g=f(c,d);a.push(g),d=g.byteOffset+g.byteLength-c.byteOffset}return a},SPKI_PARAMS_ENCODED=new Uint8Array([48,13,6,9,42,134,72,134,247,13,1,1,1,5,0]),encode$n=o=>encodeSequence([SPKI_PARAMS_ENCODED,encodeBitString(o)]),decode$y=o=>{const i=enterSequence(o,0),s=skipSequence(o,i);return readBitString(o,s)},PKSC8_HEADER=new Uint8Array([2,1,0,48,13,6,9,42,134,72,134,247,13,1,1,1,5,0]),decode$x=o=>{let i=0;return i=enterSequence(o,i),i=skipInt(o,i),i=skipSequence(o,i),readOctetString(o,i)},encode$m=o=>encodeSequence([PKSC8_HEADER,encodeOctetString(o)]),encode$l=({n:o,e:i})=>encodeSequence([encodeInt(o),encodeInt(i)]),decode$w=(o,i=0)=>{const[s,a,c,d,f,g,y,b,$]=readSequenceWith([readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1],o,i);return{v:s,n:a,e:c,d,p:f,q:g,dp:y,dq:b,qi:$}},name$7="RSA",code$8=4869,verifierCode=4613,signatureCode=RS256,signatureAlgorithm="RS256",ALG="RSASSA-PKCS1-v1_5",HASH_ALG="SHA-256",KEY_SIZE=2048,SALT_LENGTH=128,IMPORT_PARAMS={name:ALG,hash:{name:HASH_ALG}},generate=async({size:o=KEY_SIZE,extractable:i=!1}={})=>{const{publicKey:s,privateKey:a}=await webcrypto.subtle.generateKey({name:ALG,modulusLength:o,publicExponent:new Uint8Array([1,0,1]),hash:{name:HASH_ALG}},i,["sign","verify"]),c=await webcrypto.subtle.exportKey("spki",s),d=tagWith(verifierCode,decode$y(new Uint8Array(c))),f=new RSAVerifier({bytes:d,publicKey:s});if(i){const g=await webcrypto.subtle.exportKey("pkcs8",a),y=tagWith(code$8,decode$x(new Uint8Array(g)));return new ExtractableRSASigner({privateKey:a,bytes:y,verifier:f})}else return new UnextractableRSASigner({privateKey:a,verifier:f})},from$g=({id:o,keys:i})=>{if(o.startsWith("did:key:")){const s=o,a=i[s];return a instanceof Uint8Array?decode$v(a):new UnextractableRSASigner({privateKey:a,verifier:RSAVerifier.parse(s)})}else throw new TypeError(`RSA can not import from ${o} archive, try generic Signer instead`)},or$9=o=>or$b({from:from$g},o),decode$v=o=>{const i=decode$w(untagWith(code$8,o)),s=tagWith(verifierCode,encode$l(i));return new ExtractableRSASigner({bytes:o,privateKey:webcrypto.subtle.importKey("pkcs8",encode$m(untagWith(code$8,o)),IMPORT_PARAMS,!0,["sign"]),verifier:RSAVerifier.decode(s)})};class RSAVerifier{constructor({publicKey:i,bytes:s}){this.publicKey=i,this.bytes=s}withDID(i){return withDID$1(this,i)}toDIDKey(){return this.did()}static decode(i){return new this({bytes:i,publicKey:webcrypto.subtle.importKey("spki",encode$n(untagWith(verifierCode,i)),IMPORT_PARAMS,!0,["verify"])})}static parse(i){return RSAVerifier.decode(parse$2(i))}static or(i){return or$c(this,i)}get code(){return verifierCode}get signatureCode(){return signatureCode}get signatureAlgorithm(){return signatureAlgorithm}did(){return`did:key:${base58btc$5.encode(this.bytes)}`}async verify(i,s){return s.code!==signatureCode?!1:webcrypto.subtle.verify({name:ALG,hash:{name:HASH_ALG}},await this.publicKey,s.raw,i)}}class RSASigner{constructor({privateKey:i,verifier:s}){this.verifier=s,this.privateKey=i}get signer(){return this}get code(){return code$8}get signatureCode(){return signatureCode}get signatureAlgorithm(){return signatureAlgorithm}did(){return this.verifier.did()}toDIDKey(){return this.verifier.toDIDKey()}verify(i,s){return this.verifier.verify(i,s)}async sign(i){const s=await webcrypto.subtle.sign({name:ALG,saltLength:SALT_LENGTH},await this.privateKey,i);return create$r(signatureCode,new Uint8Array(s))}}class ExtractableRSASigner extends RSASigner{constructor(i){super(i),this.bytes=i.bytes}withDID(i){return withDID(this,i)}toArchive(){const i=this.did();return{id:i,keys:{[i]:this.bytes}}}}class UnextractableRSASigner extends RSASigner{constructor(i){super(i),this.privateKey=i.privateKey}withDID(i){return withDID(this,i)}toArchive(){const i=this.did();return{id:i,keys:{[i]:this.privateKey}}}}const RSA=Object.freeze(Object.defineProperty({__proto__:null,Verifier:RSAVerifier,code:code$8,decode:decode$v,from:from$g,generate,name:name$7,or:or$9,signatureAlgorithm,signatureCode},Symbol.toStringTag,{value:"Module"})),Signer=or$a(RSA),ProviderDID$2=match$1({method:"web"}),has$1=capability({can:"consumer/has",with:ProviderDID$2,nb:struct({consumer:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.consumer,i.nb.consumer,"consumer"))||ok({})}),get$f=capability({can:"consumer/get",with:ProviderDID$2,nb:struct({consumer:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.consumer,i.nb.consumer,"consumer"))||ok({})}),ProviderDID$1=match$1({method:"web"}),get$e=capability({can:"customer/get",with:ProviderDID$1,nb:struct({customer:AccountDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.customer,i.nb.customer,"customer"))||ok({})});capability({can:"console/*",with:match$1(),derives:equalWith});capability({can:"console/log",with:match$1(),nb:struct({value:unknown()}),derives:equalWith});capability({can:"console/error",with:match$1(),nb:struct({error:unknown()}),derives:equalWith});const Provider=DID,add$6=capability({can:"rate-limit/add",with:Provider,nb:struct({subject:string(),rate:number()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.subject,i.nb.subject,"subject"))||and$2(equal(o.nb.rate,i.nb.rate,"rate"))||ok({})}),remove$6=capability({can:"rate-limit/remove",with:Provider,nb:struct({id:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.id,i.nb.id,"id"))||ok({})}),list$7=capability({can:"rate-limit/list",with:Provider,nb:struct({subject:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.subject,i.nb.subject,"subject"))||ok({})}),admin=capability({can:"admin/*",with:ProviderDID$4,derives:equalWith}),upload$1={inspect:capability({can:"admin/upload/inspect",with:ProviderDID$4,nb:struct({root:Link}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.root,i.nb.root,"root"))||ok({})})},store={inspect:capability({can:"admin/store/inspect",with:ProviderDID$4,nb:struct({link:Link}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.link,i.nb.link,"link"))||ok({})})},ProviderDID=match$1({method:"web"}),get$d=capability({can:"subscription/get",with:ProviderDID,nb:struct({subscription:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.subscription,i.nb.subscription,"consumer"))||ok({})}),list$6=capability({can:"subscription/list",with:AccountDID$1,derives:equalWith}),FR32_SHA2_256_TRUNC254_PADDED_BINARY_TREE=4113,RAW_CODE=85,PieceLink=match$2({code:RAW_CODE,version:1,multihash:{code:FR32_SHA2_256_TRUNC254_PADDED_BINARY_TREE}}),filecoinOffer$1=capability({can:"filecoin/offer",with:match$1(),nb:struct({content:match$2(),piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.content,i.nb.content,"nb.content"))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),filecoinSubmit=capability({can:"filecoin/submit",with:match$1(),nb:struct({content:match$2(),piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.content,i.nb.content,"nb.content"))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),filecoinAccept=capability({can:"filecoin/accept",with:match$1(),nb:struct({content:match$2(),piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.content,i.nb.content,"nb.content"))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),filecoinInfo$1=capability({can:"filecoin/info",with:match$1(),nb:struct({piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),pieceOffer=capability({can:"piece/offer",with:match$1(),nb:struct({piece:PieceLink,group:match()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||and$2(equal(o.nb.group,i.nb.group,"nb.group"))||ok({})}),pieceAccept=capability({can:"piece/accept",with:match$1(),nb:struct({piece:PieceLink,group:match()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||and$2(equal(o.nb.group,i.nb.group,"nb.group"))||ok({})}),aggregateOffer=capability({can:"aggregate/offer",with:match$1(),nb:struct({aggregate:PieceLink,pieces:match$2({version:1})}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.aggregate,i.nb.aggregate,"nb.aggregate"))||and$2(checkLink(o.nb.pieces,i.nb.pieces,"nb.pieces"))||ok({})}),aggregateAccept=capability({can:"aggregate/accept",with:match$1(),nb:struct({aggregate:PieceLink,pieces:match$2()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.aggregate,i.nb.aggregate,"nb.aggregate"))||and$2(checkLink(o.nb.pieces,i.nb.pieces,"nb.pieces"))||ok({})}),dealInfo=capability({can:"deal/info",with:match$1(),nb:struct({piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),index=capability({can:"space/index/*",with:SpaceDID$1,derives:equalWith}),add$5=capability({can:"space/index/add",with:SpaceDID$1,nb:struct({index:match$2({code:code$c,version:1})}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.index,i.nb.index,"index"))||ok({})}),get$c=capability({can:"plan/get",with:AccountDID$1,derives:(o,i)=>and$2(equalWith(o,i))||ok({})}),set$5=capability({can:"plan/set",with:AccountDID$1,nb:struct({product:DID}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.product,i.nb.product,"product"))||ok({})}),createAdminSession$1=capability({can:"plan/create-admin-session",with:AccountDID$1,nb:struct({returnURL:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.returnURL,i.nb.returnURL,"returnURL"))||ok({})}),usage=capability({can:"usage/*",with:SpaceDID$1,derives:equalWith}),report$1=capability({can:"usage/report",with:SpaceDID$1,nb:struct({period:struct({from:integer().greaterThan(-1),to:integer().greaterThan(-1)})}),derives:(o,i)=>{var s,a,c,d;return and$2(equalWith(o,i))||and$2(equal((s=o.nb.period)==null?void 0:s.from,(a=i.nb.period)==null?void 0:a.from,"period.from"))||and$2(equal((c=o.nb.period)==null?void 0:c.to,(d=i.nb.period)==null?void 0:d.to,"period.to"))||ok({})}}),blob$1=capability({can:"space/blob/*",with:SpaceDID$1,derives:equalWith}),content=struct({digest:bytes$1(),size:integer()}),add$4=capability({can:"space/blob/add",with:SpaceDID$1,nb:struct({blob:content}),derives:equalBlob}),remove$5=capability({can:"space/blob/remove",with:SpaceDID$1,nb:struct({digest:bytes$1()}),derives:(o,i)=>o.with!==i.with?fail(`Expected 'with: "${i.with}"' instead got '${o.with}'`):i.nb.digest&&!equals$d(i.nb.digest,o.nb.digest)?fail(`Link ${o.nb.digest?`${o.nb.digest}`:""} violates imposed ${i.nb.digest} constraint.`):ok({})}),list$5=capability({can:"space/blob/list",with:SpaceDID$1,nb:struct({cursor:string().optional(),size:integer().optional()}),derives:(o,i)=>o.with!==i.with?fail(`Expected 'with: "${i.with}"' instead got '${o.with}'`):ok({})}),get$b=capability({can:"space/blob/get/0/1",with:SpaceDID$1,nb:struct({digest:bytes$1()}),derives:(o,i)=>o.with!==i.with?fail(`Expected 'with: "${i.with}"' instead got '${o.with}'`):i.nb.digest&&!equals$d(i.nb.digest,o.nb.digest)?fail(`Link ${o.nb.digest?`${o.nb.digest}`:""} violates imposed ${i.nb.digest} constraint.`):ok({})}),blob=capability({can:"web3.storage/blob/*",with:SpaceDID$1,derives:equalWith}),allocate=capability({can:"web3.storage/blob/allocate",with:match$1(),nb:struct({blob:content,cause:Link,space:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equalBlob(o,i))||and$2(checkLink(o.nb.cause,i.nb.cause,"cause"))||and$2(equal(o.nb.space,i.nb.space,"space"))||ok({})}),accept=capability({can:"web3.storage/blob/accept",with:match$1(),nb:struct({blob:content,ttl:integer().optional(),space:SpaceDID$1,_put:Await}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equalBlob(o,i))||and$2(equal(o.nb.ttl,i.nb.ttl,"ttl"))||and$2(equal(o.nb.space,i.nb.space,"space"))||ok({})}),put=capability({can:"http/put",with:SpaceDID$1,nb:struct({body:content,url:string().or(Await),headers:dictionary({value:string()}).or(Await)}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equalBody(o,i))||and$2(equal(o.nb.url,i.nb,"url"))||and$2(equal(o.nb.headers,i.nb,"headers"))||ok({})}),abilitiesAsStrings=[top.can,add$8.can,space.can,info.can,upload$2.can,add$9.can,get$g.can,remove$7.can,list$8.can,store$1.can,add$a.can,get$h.can,remove$8.can,list$9.can,access$1.can,authorize.can,attest.can,conclude$1.can,get$e.can,has$1.can,get$f.can,get$d.can,list$6.can,add$6.can,remove$6.can,list$7.can,filecoinOffer$1.can,filecoinSubmit.can,filecoinAccept.can,filecoinInfo$1.can,pieceOffer.can,pieceAccept.can,aggregateOffer.can,aggregateAccept.can,dealInfo.can,admin.can,upload$1.inspect.can,store.inspect.can,get$c.can,set$5.can,createAdminSession$1.can,usage.can,report$1.can,blob$1.can,add$4.can,remove$5.can,list$5.can,blob.can,allocate.can,accept.can,put.can,index.can,add$5.can];function uint8ArrayToArrayBuffer(o){return o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o.buffer.slice(o.byteOffset,o.byteLength+o.byteOffset)}var Fe;const St=class St{constructor(i,s={}){Y(this,Fe);this.meta=i.meta,this.principal=i.principal,this.spaces=i.spaces,this.delegations=i.delegations,this.currentSpace=i.currentSpace,Q(this,Fe,a=>s.store?s.store.save(a):void 0)}static async create(i={},s={}){const a=new St({meta:{name:"agent",type:"device",...i.meta},principal:i.principal??await generate$2(),spaces:i.spaces??new Map,delegations:i.delegations??new Map,currentSpace:i.currentSpace},s);return s.store&&await s.store.save(a.export()),a}static fromExport(i,s){const a=new Map;for(const[c,d]of i.delegations)a.set(c,{delegation:importDAG(d.delegation.map(f=>({cid:CID$5.parse(f.cid).toV1(),bytes:f.bytes instanceof Uint8Array?f.bytes:new Uint8Array(f.bytes)}))),meta:d.meta});return new St({meta:i.meta,principal:Signer.from(i.principal),currentSpace:i.currentSpace,spaces:i.spaces,delegations:a},s)}export(){const i={meta:this.meta,principal:this.principal.toArchive(),currentSpace:this.currentSpace,spaces:this.spaces,delegations:new Map};for(const[s,a]of this.delegations)i.delegations.set(s,{meta:a.meta,delegation:[...a.delegation.export()].map(c=>({cid:c.cid.toString(),bytes:uint8ArrayToArrayBuffer(c.bytes)}))});return i}async addSpace(i,s,a){this.spaces.set(i,s),await(a?this.addDelegation(a):F(this,Fe).call(this,this.export()))}async setCurrentSpace(i){this.currentSpace=i,await F(this,Fe).call(this,this.export())}async addDelegation(i,s){this.delegations.set(i.cid.toString(),{delegation:i,meta:s??{}}),await F(this,Fe).call(this,this.export())}async removeDelegation(i){this.delegations.delete(i.toString()),await F(this,Fe).call(this,this.export())}};Fe=new WeakMap;let AgentData=St;const isSessionCapability=o=>o.can===attest.can,isSessionProof=o=>o.capabilities.some(i=>isSessionCapability(i));function getSessionProofs(o){const i={};for(const{delegation:s}of o.delegations.values())if(isSessionProof(s)){const a=s.capabilities[0];if(a&&!isExpired(s)){const c=a.nb.proof;if(c){const d=c.toString(),f=s.issuer.did();i[d]=i[d]??{},i[d][f]=i[d][f]??[],i[d][f].push(s)}}}return i}match$1({method:"web"});const HOST="https://up.web3.storage",PRINCIPAL=parse$2("did:web:web3.storage"),agentToData=new WeakMap;function connection$2(o={}){return connect({id:o.principal??PRINCIPAL,codec:outbound,channel:o.channel??open$2({url:o.url??new URL(HOST),method:"POST",fetch:o.fetch??globalThis.fetch.bind(globalThis)})})}var se,gt,Mt;const Tt=class Tt{constructor(i,s={}){Y(this,gt);Y(this,se);var c;const a=(c=s.connection)==null?void 0:c.channel;this.url=s.url??(a==null?void 0:a.url)??new URL(HOST),this.connection=s.connection??connection$2({principal:s.servicePrincipal,url:this.url}),Q(this,se,i),agentToData.set(this,F(this,se))}static async create(i,s={}){const a=await AgentData.create(i,s);return new Tt(a,s)}static from(i,s={}){const a=AgentData.fromExport(i,s);return new Tt(a,s)}get issuer(){return F(this,se).principal}get meta(){return F(this,se).meta}get spaces(){return F(this,se).spaces}did(){return F(this,se).principal.did()}async addProof(i){return await this.addProofs([i])}async addProofs(i){for(const s of i)await F(this,se).addDelegation(s,{audience:this.meta});return await this.removeExpiredDelegations(),{}}async removeExpiredDelegations(){for(const[,i]of F(this,se).delegations)isExpired(i.delegation)&&await F(this,se).removeDelegation(i.delegation.cid)}async revoke(i,s={}){const a=s.proofs??[],c=[...this.delegations(),...a].find(f=>f.cid.equals(i));return c?(await this.invokeAndExecute(revoke,{with:this.issuer.did(),nb:{ucan:c.cid},proofs:[c,...a]})).out:{error:new Error(`could not find delegation ${i.toString()} - please include the delegation in options.proofs`)}}proofs(i,s){const a=[];for(const{delegation:d}of te(this,gt,Mt).call(this,i))d.audience.did()===this.issuer.did()&&a.push(d);const c=getSessionProofs(F(this,se));for(const d of a){const f=c[d.asCID.toString()]??{},g=s!=null&&s.sessionProofIssuer?f[s.sessionProofIssuer]??[]:Object.values(f).flat();g.length&&a.push(...g)}return a}delegations(i){const s=[];for(const{delegation:a}of this.delegationsWithMeta(i))s.push(a);return s}delegationsWithMeta(i){const s=[];for(const a of te(this,gt,Mt).call(this,i)){const{delegation:c}=a;!c.capabilities.some(f=>f.can===attest.can)&&c.audience.did()!==this.issuer.did()&&s.push(a)}return s}async createSpace(i){return await generate$1({name:i,agent:this})}async recoverSpace(i,{name:s}){return await fromMnemonic(i,{name:s,agent:this})}async importSpaceFromDelegation(i,{name:s=""}={}){const a=s===""?fromDelegation(i):fromDelegation(i).withName(s);return F(this,se).spaces.set(a.did(),{...a.meta,name:a.name}),await this.addProof(a.delegation),this.currentSpace()||await this.setCurrentSpace(a.did()),a}async setCurrentSpace(i){if(!F(this,se).spaces.has(i))throw new Error(`Agent has no proofs for ${i}.`);return await F(this,se).setCurrentSpace(i),i}currentSpace(){return F(this,se).currentSpace}currentSpaceWithMeta(){if(!F(this,se).currentSpace)return;const i=this.proofs([{can:"space/info",with:F(this,se).currentSpace}]),s=new Set;for(const a of i)for(const c of a.capabilities)s.add(c.can);return{did:F(this,se).currentSpace,proofs:i,capabilities:[...s],meta:F(this,se).spaces.get(F(this,se).currentSpace)}}async delegate(i){const s=this.currentSpaceWithMeta();if(!s)throw new Error("no space selected.");const a=i.abilities.map(d=>({with:s.did,can:d}));for(const d of a)if(!this.proofs([d]).length)throw new Error(`cannot delegate capability ${d.can} with ${d.with}`);const c=await delegate$3({issuer:this.issuer,capabilities:a,proofs:this.proofs(a),facts:[{space:s.meta??{}}],...i});return await F(this,se).addDelegation(c,{audience:i.audienceMeta}),await this.removeExpiredDelegations(),c}async invokeAndExecute(i,s){return(await this.invoke(i,s)).execute(this.connection)}execute(...i){return this.connection.execute(...i)}async invoke(i,s){const a=s.audience||this.connection.id,c=s.with||this.currentSpace();if(!c)throw new Error("No space or resource selected, you need pass a resource.");const d=[...s.proofs||[],...this.proofs([{with:c,can:i.can}],{sessionProofIssuer:a.did()})];if(d.length===0&&s.with!==this.did())throw new Error(`no proofs available for resource ${c} and ability ${i.can}`);return invoke({...s,audience:a,capability:i.create({with:c,nb:s.nb}),issuer:this.issuer,proofs:[...d],nonce:s.nonce})}async getSpaceInfo(i,s){const a=i||this.currentSpace();if(!a)throw new Error("No space selected, you need pass a resource.");const c=await this.invokeAndExecute(info,{...s,with:a});if(c.out.error)throw c.out.error;return c.out.ok}};se=new WeakMap,gt=new WeakSet,Mt=function(i){const s=new Set(i),a=[];for(const[,c]of F(this,se).delegations)if(!isExpired(c.delegation)&&!isTooEarly(c.delegation))if(Array.isArray(i)&&i.length>0)for(const d of s)canDelegateCapability(c.delegation,d)&&a.push(c);else a.push(c);return a};let Agent=Tt;async function addSpacesFromDelegations(o,i){const s=agentToData.get(o);if(!s)throw Object.assign(new Error("cannot determine AgentData for Agent"),{agent:o});const a=new Map,c=i.filter(f=>f.audience.did()===o.did()),d=c.filter(f=>f.capabilities[0].can==="*"&&f.capabilities[0].with==="ucan:*");for(const f of d)for(const g of f.proofs){if(!isDelegation(g)||!g.capabilities[0].with.startsWith("did:key"))continue;const y=fromDelegation(g);a.set(y.did(),y.meta)}for(const f of c){const g=allows(f);for(const[y,b]of Object.entries(g))y.startsWith("did:key")&&Object.keys(b).length>0&&(a.has(y)||a.set(y,{}))}for(const[f,g]of a)await s.addSpace(f,g)}const importAuthorization=async(o,{proofs:i})=>{try{return await o.addProofs(i),await addSpacesFromDelegations(o,i),{ok:{}}}catch(s){return{error:s}}};function pDefer(){const o={};return o.promise=new Promise((i,s)=>{o.resolve=i,o.reject=s}),o}const STORE_NAME="AccessStore",DATA_ID=1;var yt,mt,je,Be,bt,rt,kt;class IndexedDBDriver{constructor(i,s={}){Y(this,rt);Y(this,yt);Y(this,mt);Y(this,je);Y(this,Be);Y(this,bt);Q(this,yt,i),Q(this,mt,s.dbVersion),Q(this,je,s.dbStoreName??STORE_NAME),Q(this,bt,s.autoOpen??!0)}async open(){if(F(this,Be))return;const{resolve:s,reject:a,promise:c}=pDefer(),d=indexedDB.open(F(this,yt),F(this,mt));return d.addEventListener("upgradeneeded",()=>{d.result.createObjectStore(F(this,je),{keyPath:"id"})}),d.addEventListener("success",()=>{Q(this,Be,d.result),s()}),d.addEventListener("error",()=>a(d.error)),c}async close(){const i=F(this,Be);if(!i)throw new Error("Store is not open");i.close(),Q(this,Be,void 0)}async save(i){const s=await te(this,rt,kt).call(this);return await withObjectStore(s,"readwrite",F(this,je),async c=>{const{resolve:d,reject:f,promise:g}=pDefer(),y=c.put({id:DATA_ID,...i});return y.addEventListener("success",()=>d()),y.addEventListener("error",()=>f(new Error("failed to query DB",{cause:y.error}))),g})()}async load(){const i=await te(this,rt,kt).call(this);return await withObjectStore(i,"readonly",F(this,je),async a=>{const{resolve:c,reject:d,promise:f}=pDefer(),g=a.get(DATA_ID);return g.addEventListener("success",()=>c(g.result)),g.addEventListener("error",()=>d(new Error("failed to query DB",{cause:g.error}))),f})()}async reset(){const i=await te(this,rt,kt).call(this);await withObjectStore(i,"readwrite",F(this,je),a=>{const{resolve:c,reject:d,promise:f}=pDefer(),g=a.clear();return g.addEventListener("success",()=>{c()}),g.addEventListener("error",()=>d(new Error("failed to query DB",{cause:g.error}))),f})()}}yt=new WeakMap,mt=new WeakMap,je=new WeakMap,Be=new WeakMap,bt=new WeakMap,rt=new WeakSet,kt=async function(){if(!F(this,Be)){if(!F(this,bt))throw new Error("Store is not open");await this.open()}return F(this,Be)};function withObjectStore(o,i,s,a){return async()=>{const c=o.transaction(s,i),{resolve:d,reject:f,promise:g}=pDefer();let y;c.addEventListener("complete",()=>d(y)),c.addEventListener("abort",()=>f(c.error||new Error("transaction aborted"))),c.addEventListener("error",()=>f(new Error("transaction error",{cause:c.error})));try{y=await a(c.objectStore(s)),c.commit()}catch(b){f(b),c.abort()}return g}}class StoreIndexedDB extends IndexedDBDriver{}const BITS_PER_BYTE=8,FRS_PER_QUAD=4;BigInt(FRS_PER_QUAD);const IN_BITS_FR=254,OUT_BITS_FR=256,IN_BYTES_PER_QUAD=FRS_PER_QUAD*IN_BITS_FR/BITS_PER_BYTE,OUT_BYTES_PER_QUAD=FRS_PER_QUAD*OUT_BITS_FR/BITS_PER_BYTE,PADDED_BYTES_PER_QUAD=BigInt(IN_BYTES_PER_QUAD);BigInt(OUT_BYTES_PER_QUAD);const FR_RATIO=IN_BITS_FR/OUT_BITS_FR,NODE_SIZE=OUT_BYTES_PER_QUAD/FRS_PER_QUAD,EXPANDED_BYTES_PER_NODE=BigInt(NODE_SIZE),MIN_PAYLOAD_SIZE=2*NODE_SIZE+1,from$f=o=>{if(o instanceof Uint8Array){if(o.length>NODE_SIZE)return o.subarray(0,NODE_SIZE);if(o.length==NODE_SIZE)return o}const i=new Uint8Array(NODE_SIZE);return i.set([...o]),i},empty$4=()=>EMPTY$4,EMPTY$4=from$f(new Uint8Array(NODE_SIZE).fill(0));Object.freeze(EMPTY$4.buffer);function coerce$6(o){if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")}const name$6="sha2-256",code$7=18,size$2=32,prefix=new Uint8Array([18,32]);let Digest$7=class{constructor(i){this.code=code$7,this.name=name$6,this.bytes=i,this.size=size$2,this.digest=i.subarray(2)}};const digest$2=o=>{const i=new Uint8Array(prefix.length+size$2);return i.set(prefix,0),i.set(sha256$7(o),prefix.length),new Digest$7(i)},code$6=code$7,SHA256=Object.freeze(Object.defineProperty({__proto__:null,code:code$6,digest:digest$2,name:name$6,size:size$2},Symbol.toStringTag,{value:"Module"}));function base$6(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$6=base$6,_brrp__multiformats_scope_baseX$6=src$6;let Encoder$6=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$6=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$8(this,i)}},ComposedDecoder$6=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$8(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$8(o,i){return new ComposedDecoder$6({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$6=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$6(i,s,a),this.decoder=new Decoder$6(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$e({name:o,prefix:i,encode:s,decode:a}){return new Codec$6(o,i,s,a)}function baseX$6({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$6(s,o);return from$e({prefix:i,name:o,encode:a,decode:d=>coerce$6(c(d))})}function decode$u(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$k(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<=INT$7;)i[s++]=o&255|MSB$7,o/=128;for(;o&MSBALL$7;)i[s++]=o&255|MSB$7,o>>>=7;return i[s]=o|0,encode$j.bytes=s-a+1,i}var decode$t=read$7,MSB$1$7=128,REST$1$7=127;function read$7(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$7.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$7)<=MSB$1$7);return read$7.bytes=d-a,s}var N1$6=Math.pow(2,7),N2$6=Math.pow(2,14),N3$6=Math.pow(2,21),N4$6=Math.pow(2,28),N5$6=Math.pow(2,35),N6$6=Math.pow(2,42),N7$6=Math.pow(2,49),N8$6=Math.pow(2,56),N9$6=Math.pow(2,63),length$6=function(o){return o{const a=new Uint8Array(o.length+i.length);return a.set(o,0),a.set(i,o.length),truncatedHash(a,s)};function truncate(o){return o[NODE_SIZE-1]&=63,o}const MAX_LEVEL=64;class ZeroComm{constructor(){this.bytes=new Uint8Array(MAX_LEVEL*NODE_SIZE),this.bytes.set(empty$4(),0),this.node=empty$4(),this.length=NODE_SIZE}slice(i,s){for(;this.length{if(o<0||o>=MAX_LEVEL)throw new Error(`Only levels between 0 and ${MAX_LEVEL-1} inclusive are available`);return ZERO_COMM.slice(NODE_SIZE*o,NODE_SIZE*(o+1))},split$1=o=>{const i=o.length/NODE_SIZE,s=new Array(i);for(let a=0;atoZeroPaddedSize(o)/FR_RATIO,pad=(o,i=new Uint8Array(toPieceSize(o.length)))=>{const a=toZeroPaddedSize(o.byteLength)/IN_BYTES_PER_QUAD;for(let c=0;c>6;i[f+63]&=63;for(let g=64;g<96;g++)i[f+g]=o[d+g]<<4|o[d+g-1]>>4;i[f+95]&=63;for(let g=96;g<127;g++)i[f+g]=o[d+g]<<6|o[d+g-1]>>2;i[f+127]=o[d+126]>>2}return i},log2Floor=o=>{let i=0n;for(;o>>=1n;)i++;return Number(i)},log2Ceil=o=>o<=1n?0:log2Floor(BigInt(o)-1n)+1,toPadding=o=>toPadded(o)-o,toPadded=o=>toQauds(o)*PADDED_BYTES_PER_QUAD,toQauds=o=>{const i=(o+PADDED_BYTES_PER_QUAD-1n)/PADDED_BYTES_PER_QUAD;return 2n**BigInt(log2Ceil(i))},fromHeight=o=>fromWidth(2n**BigInt(o)),fromWidth=o=>o*EXPANDED_BYTES_PER_NODE,name$5="fr32-sha2-256-trunc254-padded-binary-tree",code$5=4113,MAX_PADDING_SIZE=9,HEIGHT_SIZE=1,ROOT_SIZE=size$2,MAX_DIGEST_SIZE=MAX_PADDING_SIZE+HEIGHT_SIZE+size$2,TAG_SIZE=encodingLength$6(code$5),MAX_SIZE=TAG_SIZE+encodingLength$6(MAX_DIGEST_SIZE)+MAX_DIGEST_SIZE,MAX_HEIGHT$1=255,MAX_PAYLOAD_SIZE$1=fromHeight(MAX_HEIGHT$1)*BigInt(IN_BITS_FR)/BigInt(OUT_BITS_FR),fromPiece=({padding:o,height:i,root:s})=>{const a=encodingLength$6(Number(o)),c=a+HEIGHT_SIZE+ROOT_SIZE,d=encodingLength$6(c),f=TAG_SIZE+d+c;let g=0;const y=new Uint8Array(f);return encodeTo$6(code$5,y,g),g+=TAG_SIZE,encodeTo$6(c,y,g),g+=d,encodeTo$6(Number(o),y,g),g+=a,y[g]=i,g+=HEIGHT_SIZE,y.set(s,g),new Digest$6(y)},fromBytes$3=o=>new Digest$6(o),toBytes$2=({digest:o})=>{const s=encodingLength$6(o.length)+TAG_SIZE;if(o.byteOffset>=s){const c=new Uint8Array(o.buffer,o.byteOffset-s,o.byteOffset+o.length),[d,f]=decode$s(c);if(d===code$5&&decode$s(c,f)[0]===o.length)return c}const a=new Uint8Array(o.length+s);return encodeTo$6(code$5,a),encodeTo$6(o.length,a,TAG_SIZE),a.set(o,s),a},height=({digest:o})=>{const[,i]=decode$s(o);return o[i]},padding=({digest:o})=>{const[i]=decode$s(o);return BigInt(i)},root=({digest:o})=>{const[,i]=decode$s(o);return o.subarray(i+HEIGHT_SIZE,i+HEIGHT_SIZE+size$2)};let Digest$6=class{constructor(i){this.bytes=i;const[s]=decode$s(i);if(s!==code$5)throw new RangeError(`Expected multihash with code ${code$5}`);let a=TAG_SIZE;const[c,d]=decode$s(i,a);a+=d;const f=i.subarray(a);if(f.length!==c)throw new RangeError(`Invalid multihash size expected ${a+c} bytes, got ${i.length} bytes`);this.digest=f}get name(){return name$5}get code(){return code$5}get size(){return this.digest.length}get padding(){return padding(this)}get height(){return height(this)}get root(){return root(this)}};const digest$1=Object.freeze(Object.defineProperty({__proto__:null,HEIGHT_SIZE,MAX_DIGEST_SIZE,MAX_HEIGHT:MAX_HEIGHT$1,MAX_PAYLOAD_SIZE:MAX_PAYLOAD_SIZE$1,MAX_SIZE,ROOT_SIZE,TAG_SIZE,code:code$5,fromBytes:fromBytes$3,fromPiece,height,name:name$5,padding,root,toBytes:toBytes$2},Symbol.toStringTag,{value:"Module"})),name$4="fr32-sha2-256-trunc254-padded-binary-tree",code$4=4113,MAX_HEIGHT=255,MAX_PAYLOAD_SIZE=fromHeight(MAX_HEIGHT)*BigInt(IN_BITS_FR)/BigInt(OUT_BITS_FR),digest=o=>{const i=new Hasher$4;return i.write(o),i.digest()},create$i=()=>new Hasher$4;let Hasher$4=class{constructor(){this.bytesWritten=0n,this.buffer=new Uint8Array(IN_BYTES_PER_QUAD),this.offset=0,this.layers=[[]]}count(){return this.bytesWritten}digest(){const i=new Uint8Array(MAX_SIZE),s=this.digestInto(i,0,!0);return fromBytes$3(i.subarray(0,s))}digestInto(i,s=0,a=!0){const{buffer:c,layers:d,offset:f,bytesWritten:g}=this;let[y,...b]=d;(f>0||g===0n)&&(y=[...y,...split$1(pad(c.fill(0,f)))]);const $=build([y,...b]),x=$.length-1,[T]=$[x],A=Number(toPadding(this.bytesWritten)),E=encodingLength$6(A);let S=s;if(a){encodeTo$6(code$4,i,S),S+=TAG_SIZE;const _=E+HEIGHT_SIZE+ROOT_SIZE,C=encodingLength$6(_);encodeTo$6(_,i,S),S+=C}return encodeTo$6(A,i,S),S+=E,i[S]=x,S+=1,i.set(T,S),S+=T.length,S-s}write(i){const{buffer:s,offset:a,layers:c}=this,d=c[0],{length:f}=i;if(f===0)return this;if(this.bytesWritten+BigInt(f)>MAX_PAYLOAD_SIZE)throw new RangeError(`Writing ${f} bytes exceeds max payload size of ${MAX_PAYLOAD_SIZE}`);if(a+fflush$1(o,!1),build=o=>flush$1([...o],!0),flush$1=(o,i)=>{let s=0;for(;s0&&a&&c.push(fromLevel(s)),s+=1,a=a?i?[...a]:a:[];let d=0;for(;d+1{const s=[];for(const c of o.receipts.values()){const d=c.out;d.ok?s.push(d.ok):s.push({...d.error,error:!0})}const a=encode$A(s);return{headers:HEADERS,body:a}},response=Object.freeze(Object.defineProperty({__proto__:null,contentType:contentType$2,encode:encode$i},Symbol.toStringTag,{value:"Module"})),contentType$1="application/car",decode$r=async({body:o})=>{const{roots:i,blocks:s}=decode$M(o),a=[];for(const{cid:d}of i){const f=view$2({root:d,blocks:s});a.push(f)}return await build$1({invocations:a})},request$1=Object.freeze(Object.defineProperty({__proto__:null,contentType:contentType$1,decode:decode$r},Symbol.toStringTag,{value:"Module"})),{contentType}=request$1;inbound({decoders:{[contentType]:request$1,[contentType$3]:request$3},encoders:{"*/*;q=0.1":response,[contentType$3]:response$1}});const services={STOREFRONT:{url:new URL("https://up.web3.storage"),principal:parse$2("did:web:web3.storage")},AGGREGATOR:{url:new URL("https://aggregator.web3.storage"),principal:parse$2("did:web:web3.storage")},DEALER:{url:new URL("https://dealer.web3.storage"),principal:parse$2("did:web:web3.storage")},DEAL_TRACKER:{url:new URL("https://tracker.web3.storage"),principal:parse$2("did:web:web3.storage")}},connection$1=connect({id:services.STOREFRONT.principal,codec:outbound,channel:open$2({url:services.STOREFRONT.url,method:"POST"})});async function filecoinOffer({issuer:o,with:i,proofs:s,audience:a},c,d,f={}){const g=f.connection??connection$1;return await filecoinOffer$1.invoke({issuer:o,audience:a??services.STOREFRONT.principal,with:i,nb:{content:c,piece:d},proofs:s,expiration:1/0}).execute(g)}async function filecoinInfo({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection$1;return await filecoinInfo$1.invoke({issuer:o,audience:a??services.STOREFRONT.principal,with:i,nb:{piece:c},proofs:s}).execute(f)}connect({id:services.AGGREGATOR.principal,codec:outbound,channel:open$2({url:services.AGGREGATOR.url,method:"POST"})});connect({id:services.DEALER.principal,codec:outbound,channel:open$2({url:services.DEALER.url,method:"POST"})});connect({id:services.DEAL_TRACKER.principal,codec:outbound,channel:open$2({url:services.DEAL_TRACKER.url,method:"POST"})});function base$5(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$5=base$5,_brrp__multiformats_scope_baseX$5=src$5;const equals$a=(o,i)=>{if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s{if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")};let Encoder$5=class{constructor(i,s,a){this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$5=class{constructor(i,s,a){if(this.name=i,this.prefix=s,s.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s.codePointAt(0),this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$7(this,i)}},ComposedDecoder$5=class{constructor(i){this.decoders=i}or(i){return or$7(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const or$7=(o,i)=>new ComposedDecoder$5({...o.decoders||{[o.prefix]:o},...i.decoders||{[i.prefix]:i}});let Codec$5=class{constructor(i,s,a,c){this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$5(i,s,a),this.decoder=new Decoder$5(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};const from$d=({name:o,prefix:i,encode:s,decode:a})=>new Codec$5(o,i,s,a),baseX$5=({prefix:o,name:i,alphabet:s})=>{const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$5(s,i);return from$d({prefix:o,name:i,encode:a,decode:d=>coerce$5(c(d))})},decode$q=(o,i,s,a)=>{const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f},encode$h=(o,i,s)=>{const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f&&(d+=i[c&g<from$d({prefix:i,name:o,encode(c){return encode$h(c,a,s)},decode(c){return decode$q(c,a,s,o)}}),base32$4=rfc4648$5({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$5({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$5({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$5({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$5({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$5({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$5({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$5({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$5({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const base58btc$4=baseX$5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var encode_1$5=encode$g,MSB$6=128,REST$6=127,MSBALL$6=~REST$6,INT$6=Math.pow(2,31);function encode$g(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$6;)i[s++]=o&255|MSB$6,o/=128;for(;o&MSBALL$6;)i[s++]=o&255|MSB$6,o>>>=7;return i[s]=o|0,encode$g.bytes=s-a+1,i}var decode$p=read$6,MSB$1$6=128,REST$1$6=127;function read$6(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$6.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$6)<=MSB$1$6);return read$6.bytes=d-a,s}var N1$5=Math.pow(2,7),N2$5=Math.pow(2,14),N3$5=Math.pow(2,21),N4$5=Math.pow(2,28),N5$5=Math.pow(2,35),N6$5=Math.pow(2,42),N7$5=Math.pow(2,49),N8$5=Math.pow(2,56),N9$5=Math.pow(2,63),length$5=function(o){return o[_brrp_varint$5.decode(o,i),_brrp_varint$5.decode.bytes],encodeTo$5=(o,i,s=0)=>(_brrp_varint$5.encode(o,i,s),i),encodingLength$5=o=>_brrp_varint$5.encodingLength(o),create$h=(o,i)=>{const s=i.byteLength,a=encodingLength$5(o),c=a+encodingLength$5(s),d=new Uint8Array(c+s);return encodeTo$5(o,d,0),encodeTo$5(s,d,a),d.set(i,c),new Digest$5(o,s,i,d)},decode$n=o=>{const i=coerce$5(o),[s,a]=decode$o(i),[c,d]=decode$o(i.subarray(a)),f=i.subarray(a+d);if(f.byteLength!==c)throw new Error("Incorrect length");return new Digest$5(s,c,f,i)},equals$9=(o,i)=>{if(o===i)return!0;{const s=i;return o.code===s.code&&o.size===s.size&&s.bytes instanceof Uint8Array&&equals$a(o.bytes,s.bytes)}};let Digest$5=class{constructor(i,s,a,c){this.code=i,this.size=s,this.digest=a,this.bytes=c}};const format$4=(o,i)=>{const{bytes:s,version:a}=o;switch(a){case 0:return toStringV0$4(s,baseCache$4(o),i||base58btc$4.encoder);default:return toStringV1$4(s,baseCache$4(o),i||base32$4.encoder)}},cache$5=new WeakMap,baseCache$4=o=>{const i=cache$5.get(o);if(i==null){const s=new Map;return cache$5.set(o,s),s}return i};let CID$4=class ye{constructor(i,s,a,c){this.code=s,this.version=i,this.multihash=a,this.bytes=c,this["/"]=c}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:i,multihash:s}=this;if(i!==DAG_PB_CODE$5)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(s.code!==SHA_256_CODE$4)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return ye.createV0(s)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:i,digest:s}=this.multihash,a=create$h(i,s);return ye.createV1(this.code,a)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(i){return ye.equals(this,i)}static equals(i,s){const a=s;return a&&i.code===a.code&&i.version===a.version&&equals$9(i.multihash,a.multihash)}toString(i){return format$4(this,i)}toJSON(){return{"/":format$4(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(i){if(i==null)return null;const s=i;if(s instanceof ye)return s;if(s["/"]!=null&&s["/"]===s.bytes||s.asCID===s){const{version:a,code:c,multihash:d,bytes:f}=s;return new ye(a,c,d,f||encodeCID$4(a,c,d.bytes))}else if(s[cidSymbol$4]===!0){const{version:a,multihash:c,code:d}=s,f=decode$n(c);return ye.create(a,d,f)}else return null}static create(i,s,a){if(typeof s!="number")throw new Error("String codecs are no longer supported");if(!(a.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(i){case 0:{if(s!==DAG_PB_CODE$5)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$5}) block encoding`);return new ye(i,s,a,a.bytes)}case 1:{const c=encodeCID$4(i,s,a.bytes);return new ye(i,s,a,c)}default:throw new Error("Invalid version")}}static createV0(i){return ye.create(0,DAG_PB_CODE$5,i)}static createV1(i,s){return ye.create(1,i,s)}static decode(i){const[s,a]=ye.decodeFirst(i);if(a.length)throw new Error("Incorrect length");return s}static decodeFirst(i){const s=ye.inspectBytes(i),a=s.size-s.multihashSize,c=coerce$5(i.subarray(a,a+s.multihashSize));if(c.byteLength!==s.multihashSize)throw new Error("Incorrect length");const d=c.subarray(s.multihashSize-s.digestSize),f=new Digest$5(s.multihashCode,s.digestSize,d,c);return[s.version===0?ye.createV0(f):ye.createV1(s.codec,f),i.subarray(s.size)]}static inspectBytes(i){let s=0;const a=()=>{const[x,T]=decode$o(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$5;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$4(i,s),d=ye.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$4(d).set(a,i),d}};const parseCIDtoBytes$4=(o,i)=>{switch(o[0]){case"Q":{const s=i||base58btc$4;return[base58btc$4.prefix,s.decode(`${base58btc$4.prefix}${o}`)]}case base58btc$4.prefix:{const s=i||base58btc$4;return[base58btc$4.prefix,s.decode(o)]}case base32$4.prefix:{const s=i||base32$4;return[base32$4.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}},toStringV0$4=(o,i,s)=>{const{prefix:a}=s;if(a!==base58btc$4.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c},toStringV1$4=(o,i,s)=>{const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c},DAG_PB_CODE$5=112,SHA_256_CODE$4=18,encodeCID$4=(o,i,s)=>{const a=encodingLength$5(o),c=a+encodingLength$5(i),d=new Uint8Array(c+s.byteLength);return encodeTo$5(o,d,0),encodeTo$5(i,d,a),d.set(s,c),d},cidSymbol$4=Symbol.for("@ipld/js-cid/CID"),create$g=(o,i)=>CID$4.create(1,o,i),name$3="raw",code$3=85,encode$f=o=>coerce$5(o),decode$m=o=>coerce$5(o),raw=Object.freeze(Object.defineProperty({__proto__:null,code:code$3,decode:decode$m,encode:encode$f,name:name$3},Symbol.toStringTag,{value:"Module"})),from$c=({name:o,code:i,encode:s})=>new Hasher$3(o,i,s);let Hasher$3=class{constructor(i,s,a){this.name=i,this.code=s,this.encode=a}digest(i){if(i instanceof Uint8Array){const s=this.encode(i);return s instanceof Uint8Array?create$h(this.code,s):s.then(a=>create$h(this.code,a))}else throw Error("Unknown type, must be binary type")}};const sha$2=o=>async i=>new Uint8Array(await crypto.subtle.digest(o,i)),sha256$2=from$c({name:"sha2-256",code:18,encode:sha$2("SHA-256")});var retry$2={};function RetryOperation(o,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(o)),this._timeouts=o,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(o){if(this._timeout&&clearTimeout(this._timeout),!o)return!1;var i=new Date().getTime();if(o&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(o),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(o);var s=this._timeouts.shift();if(s===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),s=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},s),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(o,i){this._fn=o,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var s=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){s._operationTimeoutCb()},s._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(o){console.log("Using RetryOperation.try() is deprecated"),this.attempt(o)};RetryOperation.prototype.start=function(o){console.log("Using RetryOperation.start() is deprecated"),this.attempt(o)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var o={},i=null,s=0,a=0;a=s&&(i=c,s=f)}return i};(function(o){var i=retry_operation;o.operation=function(s){var a=o.timeouts(s);return new i(a,{forever:s&&(s.forever||s.retries===1/0),unref:s&&s.unref,maxRetryTime:s&&s.maxRetryTime})},o.timeouts=function(s){if(s instanceof Array)return[].concat(s);var a={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var c in s)a[c]=s[c];if(a.minTimeout>a.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var d=[],f=0;f{const a=s.retries-(i-1);return o.attemptNumber=i,o.retriesLeft=a,o},isNetworkError=o=>networkErrorMsgs.has(o),getDOMException=o=>globalThis.DOMException===void 0?new Error(o):new DOMException(o);async function pRetry(o,i){return new Promise((s,a)=>{i={onFailedAttempt(){},retries:10,...i};const c=retry$1.operation(i);c.attempt(async d=>{try{s(await o(d))}catch(f){if(!(f instanceof Error)){a(new TypeError(`Non-error was thrown: "${f}". You should only throw errors.`));return}if(f instanceof AbortError)c.stop(),a(f.originalError);else if(f instanceof TypeError&&!isNetworkError(f.message))c.stop(),a(f);else{decorateErrorWithCounts(f,d,i);try{await i.onFailedAttempt(f)}catch(g){a(g);return}c.retry(f)||a(c.mainError())}}}),i.signal&&!i.signal.aborted&&i.signal.addEventListener("abort",()=>{c.stop();const d=i.signal.reason===void 0?getDOMException("The operation was aborted."):i.signal.reason;a(d instanceof Error?d:getDOMException(d))},{once:!0})})}const serviceURL=new URL("https://up.web3.storage"),servicePrincipal=parse$2("did:web:web3.storage"),receiptsEndpoint="https://up.web3.storage/receipt/",connection=connect({id:servicePrincipal,codec:outbound,channel:open$2({url:serviceURL,method:"POST"})}),REQUEST_RETRIES=3;function createUploadProgressHandler$1(o,i){function s({total:a,loaded:c,lengthComputable:d}){return i({total:a,loaded:c,lengthComputable:d,url:o})}return s}async function add$3({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=c instanceof Uint8Array?c:new Uint8Array(await c.arrayBuffer()),g=await link$2(f),y=d.connection??connection,b=await pRetry(async()=>await add$a.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:{link:g,size:f.length},proofs:s,nonce:d.nonce}).execute(y),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!b.out.ok)throw new Error(`failed ${add$a.can} invocation`,{cause:b.out.error});if(b.out.ok.status==="done")return g;const $=b.out.ok,x=d.fetchWithUploadProgress||d.fetch||globalThis.fetch.bind(globalThis);let T=!1;const A=await pRetry(async()=>{var E;try{const S=await x($.url,{method:"PUT",body:c,headers:$.headers,signal:d.signal,onUploadProgress:_=>{T=!0,d.onUploadProgress&&createUploadProgressHandler$1($.url,d.onUploadProgress)(_)},duplex:"half"});if(S.status>=400&&S.status<500)throw new AbortError(`upload failed: ${S.status}`);return S}catch(S){throw((E=d.signal)==null?void 0:E.aborted)===!0?new AbortError("upload aborted"):S}},{retries:d.retries??REQUEST_RETRIES});if(!T&&d.onUploadProgress){const E=new Blob([c]);d.onUploadProgress({total:E.size,loaded:E.size,lengthComputable:!1})}if(!A.ok)throw new Error(`upload failed: ${A.status}`);return g}async function get$a({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await pRetry(async()=>await get$h.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:{link:c},proofs:s,nonce:d.nonce}).execute(f),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!g.out.ok)throw new Error(`failed ${get$h.can} invocation`,{cause:g.out.error});return g.out.ok}async function list$4({issuer:o,with:i,proofs:s,audience:a},c={}){const d=c.connection??connection,f=await list$9.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),proofs:s,nb:{cursor:c.cursor,size:c.size,pre:c.pre},nonce:c.nonce}).execute(d);if(!f.out.ok)throw new Error(`failed ${list$9.can} invocation`,{cause:f.out.error});return f.out.ok}async function remove$4({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await remove$8.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:{link:c},proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${remove$8.can} invocation`,{cause:g.out.error});return g.out}class ReceiptNotFound extends Error{constructor(i){super(),this.taskCid=i}get reason(){return`receipt not found for task ${this.taskCid} in the indexed workflow`}get name(){return"ReceiptNotFound"}}class ReceiptMissing extends Error{constructor(i){super(),this.taskCid=i}get reason(){return`receipt missing for task ${this.taskCid}`}get name(){return"ReceiptMissing"}}async function poll(o,i={}){return await pRetry(async()=>{const s=await get$9(o,i);if(s.error)throw s.error.name==="ReceiptNotFound"?s.error:new AbortError(new Error("failed to fetch blob/accept receipt",{cause:s.error}));return s.ok},{onFailedAttempt:console.warn,retries:i.retries??REQUEST_RETRIES})}async function get$9(o,i={}){const s=new URL(o.toString(),i.receiptsEndpoint??receiptsEndpoint),c=await(i.fetch??globalThis.fetch.bind(globalThis))(s);if(c.status===404)return{error:new ReceiptNotFound(o)};const d=new Uint8Array(await c.arrayBuffer()),g=(await decode$K({body:d,headers:{}})).receipts.get(o.toString());return g?{ok:g}:{error:new ReceiptMissing(o)}}function createUploadProgressHandler(o,i){return({total:a,loaded:c,lengthComputable:d})=>i({total:a,loaded:c,lengthComputable:d,url:o})}function getConcludeReceipt(o){const i=new Map;for(const s of o.iterateIPLDBlocks())i.set(`${s.cid}`,s);return view$1({root:o.capabilities[0].nb.receipt,blocks:i})}function parseBlobAddReceiptNext(o){const i=o.fx.fork,s=i.find($=>$.capabilities[0].can===allocate.can),a=i.filter($=>$.capabilities[0].can===conclude$1.can),c=i.find($=>$.capabilities[0].can===put.can),d=i.find($=>$.capabilities[0].can===accept.can);if(!s||!a.length||!c||!d)throw new Error("mandatory effects not received");const f=a.map($=>getConcludeReceipt($)),g=f.find($=>$.ran.link().equals(s.cid)),y=f.find($=>$.ran.link().equals(c.cid)),b=f.find($=>$.ran.link().equals(d.cid));if(!g)throw new Error("mandatory effects not received");return{allocate:{task:s,receipt:g},put:{task:c,receipt:y},accept:{task:d,receipt:b}}}function createConcludeInvocation(o,i,s){const a=[],c=[];for(const f of s.iterateIPLDBlocks())a.push(f),c.push(f.cid);const d=conclude$1.invoke({issuer:o,audience:i,with:o.toDIDKey(),nb:{receipt:s.link()},expiration:1/0,facts:[{...c}]});for(const f of a)d.attach(f);return d}async function add$2({issuer:o,with:i,proofs:s,audience:a},c,d,f={}){var B;const g=d instanceof Uint8Array?d:new Uint8Array(await d.arrayBuffer()),y=g.length,b=f.connection??connection,$=await pRetry(async()=>await add$4.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$8(c,y),proofs:s,nonce:f.nonce}).execute(b),{onFailedAttempt:console.warn,retries:f.retries??REQUEST_RETRIES});if(!$.out.ok)throw new Error(`failed ${add$4.can} invocation`,{cause:$.out.error});const x=parseBlobAddReceiptNext($),{receipt:T}=x.allocate;if(!T.out.ok)throw new Error(`failed ${add$4.can} invocation`,{cause:T.out.error});const{address:A}=T.out.ok;if(A){const D=f.fetchWithUploadProgress||f.fetch||globalThis.fetch.bind(globalThis);let I=!1;const{status:L}=await pRetry(async()=>{var N;try{const O=await D(A.url,{method:"PUT",mode:"cors",body:g,headers:A.headers,signal:f.signal,onUploadProgress:R=>{I=!0,f.onUploadProgress&&createUploadProgressHandler(A.url,f.onUploadProgress)(R)},duplex:"half"});if(O.status>=400&&O.status<500)throw new AbortError(`upload failed: ${O.status}`);return O}catch(O){throw((N=f.signal)==null?void 0:N.aborted)===!0?new AbortError("upload aborted"):O}},{retries:f.retries??REQUEST_RETRIES});if(L!==200)throw new Error(`upload failed: ${L}`);if(!I&&f.onUploadProgress){const N=new Blob([g]);f.onUploadProgress({total:N.size,loaded:N.size,lengthComputable:!1})}}let{receipt:E}=x.put;if(!(E!=null&&E.out.ok)){const D=from$h(x.put.task.facts[0].keys);if(E=await issue$1({issuer:D,ran:x.put.task.cid,result:{ok:{}}}),!(await createConcludeInvocation(o,a??servicePrincipal,E).execute(b)).out.ok)throw new Error(`failed ${add$4.can} invocation`,{cause:$.out.error})}let{receipt:S}=x.accept;S!=null&&S.out.ok||(S=await poll(x.accept.task.link(),f));const _=new Map([...S.iterateIPLDBlocks()].map(D=>[`${D.cid}`,D]));return{site:view$3({root:(B=S.out.ok)==null?void 0:B.site,blocks:_})}}const ability$2=add$4.can,input$8=(o,i)=>({blob:{digest:o.bytes,size:i}});async function get$8({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await get$b.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$7(c),proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${get$b.can} invocation`,{cause:g.out.error});return g.out}get$b.can;const input$7=o=>({digest:o.bytes});async function list$3({issuer:o,with:i,proofs:s,audience:a},c={}){const d=c.connection??connection,f=await list$5.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),proofs:s,nb:input$6(c.cursor,c.size),nonce:c.nonce}).execute(d);if(!f.out.ok)throw new Error(`failed ${list$5.can} invocation`,{cause:f.out.error});return f.out.ok}list$5.can;const input$6=(o,i)=>({cursor:o,size:i});async function remove$3({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await remove$5.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$5(c),proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${remove$5.can} invocation`,{cause:g.out.error});return g.out}remove$5.can;const input$5=o=>({digest:o.bytes});async function add$1({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await pRetry(async()=>await add$5.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$4(c),proofs:s}).execute(f),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!g.out.ok)throw new Error(`failed ${add$5.can} invocation`,{cause:g.out.error});return g.out.ok}const ability$1=add$5.can,input$4=o=>({index:o});async function add({issuer:o,with:i,proofs:s,audience:a},c,d,f={}){const g=f.connection??connection,y=await pRetry(async()=>await add$9.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$3(c,d),proofs:s,nonce:f.nonce}).execute(g),{onFailedAttempt:console.warn,retries:f.retries??REQUEST_RETRIES});if(!y.out.ok)throw new Error(`failed ${add$9.can} invocation`,{cause:y.out.error});return y.out.ok}const ability=add$9.can,input$3=(o,i)=>({root:o,shards:i});async function get$7({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await pRetry(async()=>await get$g.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$2(c),proofs:s,nonce:d.nonce}).execute(f),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!g.out.ok)throw new Error(`failed ${get$g.can} invocation`,{cause:g.out.error});return g.out.ok}get$g.can;const input$2=o=>({root:o});async function list$2({issuer:o,with:i,proofs:s,audience:a},c={}){const d=c.connection??connection,f=await list$8.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),proofs:s,nb:input$1(c.cursor,c.size,c.pre),nonce:c.nonce}).execute(d);if(!f.out.ok)throw new Error(`failed ${list$8.can} invocation`,{cause:f.out.error});return f.out.ok}list$8.can;const input$1=(o,i,s)=>({cursor:o,size:i,pre:s});async function remove$2({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await remove$7.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input(c),proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${remove$7.can} invocation`,{cause:g.out.error});return g.out.ok}remove$7.can;const input=o=>({root:o});function equals$8(o,i){if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$4=base$4,_brrp__multiformats_scope_baseX$4=src$4;let Encoder$4=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$4=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$6(this,i)}},ComposedDecoder$4=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$6(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$6(o,i){return new ComposedDecoder$4({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$4=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$4(i,s,a),this.decoder=new Decoder$4(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$b({name:o,prefix:i,encode:s,decode:a}){return new Codec$4(o,i,s,a)}function baseX$4({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$4(s,o);return from$b({prefix:i,name:o,encode:a,decode:d=>coerce$4(c(d))})}function decode$l(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$e(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<=INT$5;)i[s++]=o&255|MSB$5,o/=128;for(;o&MSBALL$5;)i[s++]=o&255|MSB$5,o>>>=7;return i[s]=o|0,encode$d.bytes=s-a+1,i}var decode$k=read$5,MSB$1$5=128,REST$1$5=127;function read$5(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$5.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$5)<=MSB$1$5);return read$5.bytes=d-a,s}var N1$4=Math.pow(2,7),N2$4=Math.pow(2,14),N3$4=Math.pow(2,21),N4$4=Math.pow(2,28),N5$4=Math.pow(2,35),N6$4=Math.pow(2,42),N7$4=Math.pow(2,49),N8$4=Math.pow(2,56),N9$4=Math.pow(2,63),length$4=function(o){return o{const[x,T]=decode$j(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$4;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$3(i,s),d=me.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$3(d).set(a,i),d}};function parseCIDtoBytes$3(o,i){switch(o[0]){case"Q":{const s=i??base58btc$3;return[base58btc$3.prefix,s.decode(`${base58btc$3.prefix}${o}`)]}case base58btc$3.prefix:{const s=i??base58btc$3;return[base58btc$3.prefix,s.decode(o)]}case base32$3.prefix:{const s=i??base32$3;return[base32$3.prefix,s.decode(o)]}case base36$2.prefix:{const s=i??base36$2;return[base36$2.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}}function toStringV0$3(o,i,s){const{prefix:a}=s;if(a!==base58btc$3.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c}function toStringV1$3(o,i,s){const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c}const DAG_PB_CODE$4=112,SHA_256_CODE$3=18;function encodeCID$3(o,i,s){const a=encodingLength$4(o),c=a+encodingLength$4(i),d=new Uint8Array(c+s.byteLength);return encodeTo$4(o,d,0),encodeTo$4(i,d,a),d.set(s,c),d}const cidSymbol$3=Symbol.for("@ipld/js-cid/CID"),textDecoder=new TextDecoder;function decodeVarint(o,i){let s=0;for(let a=0;;a+=7){if(a>=64)throw new Error("protobuf: varint overflow");if(i>=o.length)throw new Error("protobuf: unexpected end of data");const c=o[i++];if(s+=a<28?(c&127)<o.length)throw new Error("protobuf: unexpected end of data");return[o.subarray(i,a),a]}function decodeKey(o,i){let s;return[s,i]=decodeVarint(o,i),[s&7,s>>3,i]}function decodeLink(o){const i={},s=o.length;let a=0;for(;as)throw new Error("protobuf: (PBLink) unexpected end of data");return i}function decodeNode(o){const i=o.length;let s=0,a,c=!1,d;for(;si)throw new Error("protobuf: (PBNode) unexpected end of data");const f={};return d&&(f.Data=d),f.Links=a||[],f}const textEncoder$1=new TextEncoder,maxInt32=2**32,maxUInt32=2**31;function encodeLink$1(o,i){let s=i.length;if(typeof o.Tsize=="number"){if(o.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(o.Tsize))throw new Error("Tsize too large for encoding");s=encodeVarint(i,s,o.Tsize)-1,i[s]=24}if(typeof o.Name=="string"){const a=textEncoder$1.encode(o.Name);s-=a.length,i.set(a,s),s=encodeVarint(i,s,a.length)-1,i[s]=18}return o.Hash&&(s-=o.Hash.length,i.set(o.Hash,s),s=encodeVarint(i,s,o.Hash.length)-1,i[s]=10),i.length-s}function encodeNode(o){const i=sizeNode(o),s=new Uint8Array(i);let a=i;if(o.Data&&(a-=o.Data.length,s.set(o.Data,a),a=encodeVarint(s,a,o.Data.length)-1,s[a]=10),o.Links)for(let c=o.Links.length-1;c>=0;c--){const d=encodeLink$1(o.Links[c],s.subarray(0,a));a-=d,a=encodeVarint(s,a,d)-1,s[a]=18}return s}function sizeLink(o){let i=0;if(o.Hash){const s=o.Hash.length;i+=1+s+sov(s)}if(typeof o.Name=="string"){const s=textEncoder$1.encode(o.Name).length;i+=1+s+sov(s)}return typeof o.Tsize=="number"&&(i+=1+sov(o.Tsize)),i}function sizeNode(o){let i=0;if(o.Data){const s=o.Data.length;i+=1+s+sov(s)}if(o.Links)for(const s of o.Links){const a=sizeLink(s);i+=1+a+sov(a)}return i}function encodeVarint(o,i,s){i-=sov(s);const a=i;for(;s>=maxUInt32;)o[i++]=s&127|128,s/=128;for(;s>=128;)o[i++]=s&127|128,s>>>=7;return o[i]=s,a}function sov(o){return o%2===0&&o++,Math.floor((len64(o)+6)/7)}function len64(o){let i=0;return o>=maxInt32&&(o=Math.floor(o/maxInt32),i=32),o>=65536&&(o>>>=16,i+=16),o>=256&&(o>>>=8,i+=8),i+len8tab[o]}const len8tab=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8],pbNodeProperties=["Data","Links"],pbLinkProperties=["Hash","Name","Tsize"],textEncoder=new TextEncoder;function linkComparator(o,i){if(o===i)return 0;const s=o.Name?textEncoder.encode(o.Name):[],a=i.Name?textEncoder.encode(i.Name):[];let c=s.length,d=a.length;for(let f=0,g=Math.min(c,d);f!i.includes(s))}function asLink(o){if(typeof o.asCID=="object"){const s=CID$3.asCID(o);if(!s)throw new TypeError("Invalid DAG-PB form");return{Hash:s}}if(typeof o!="object"||Array.isArray(o))throw new TypeError("Invalid DAG-PB form");const i={};if(o.Hash){let s=CID$3.asCID(o.Hash);try{s||(typeof o.Hash=="string"?s=CID$3.parse(o.Hash):o.Hash instanceof Uint8Array&&(s=CID$3.decode(o.Hash)))}catch(a){throw new TypeError(`Invalid DAG-PB form: ${a.message}`)}s&&(i.Hash=s)}if(!i.Hash)throw new TypeError("Invalid DAG-PB form");return typeof o.Name=="string"&&(i.Name=o.Name),typeof o.Tsize=="number"&&(i.Tsize=o.Tsize),i}function prepare(o){if((o instanceof Uint8Array||typeof o=="string")&&(o={Data:o}),typeof o!="object"||Array.isArray(o))throw new TypeError("Invalid DAG-PB form");const i={};if(o.Data!==void 0)if(typeof o.Data=="string")i.Data=textEncoder.encode(o.Data);else if(o.Data instanceof Uint8Array)i.Data=o.Data;else throw new TypeError("Invalid DAG-PB form");if(o.Links!==void 0)if(Array.isArray(o.Links))i.Links=o.Links.map(asLink),i.Links.sort(linkComparator);else throw new TypeError("Invalid DAG-PB form");else i.Links=[];return i}function validate(o){if(!o||typeof o!="object"||Array.isArray(o)||o instanceof Uint8Array||o["/"]&&o["/"]===o.bytes)throw new TypeError("Invalid DAG-PB form");if(!hasOnlyProperties(o,pbNodeProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(o.Data!==void 0&&!(o.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray(o.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let i=0;i0&&linkComparator(s,o.Links[i-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function toByteView(o){return o instanceof ArrayBuffer?new Uint8Array(o,0,o.byteLength):o}const code$2=112;function encode$c(o){validate(o);const i={};return o.Links&&(i.Links=o.Links.map(s=>{const a={};return s.Hash&&(a.Hash=s.Hash.bytes),s.Name!==void 0&&(a.Name=s.Name),s.Tsize!==void 0&&(a.Tsize=s.Tsize),a})),o.Data&&(i.Data=o.Data),encodeNode(i)}function decode$h(o){const i=toByteView(o),s=decodeNode(i),a={};return s.Data&&(a.Data=s.Data),s.Links&&(a.Links=s.Links.map(c=>{const d={};try{d.Hash=CID$3.decode(c.Hash)}catch{}if(!d.Hash)throw new Error("Invalid Hash field found in link, expected CID");return c.Name!==void 0&&(d.Name=c.Name),c.Tsize!==void 0&&(d.Tsize=c.Tsize),d})),a}var indexMinimal={},minimal$1={},aspromise=asPromise;function asPromise(o,i){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c1&&g.charAt(y)==="=";)++b;return Math.ceil(g.length*3)/4-b};for(var s=new Array(64),a=new Array(123),c=0;c<64;)a[s[c]=c<26?c+65:c<52?c+71:c<62?c-4:c-59|43]=c++;i.encode=function(g,y,b){for(var $=null,x=[],T=0,A=0,E;y>2],E=(S&3)<<4,A=1;break;case 1:x[T++]=s[E|S>>4],E=(S&15)<<2,A=2;break;case 2:x[T++]=s[E|S>>6],x[T++]=s[S&63],A=0;break}T>8191&&(($||($=[])).push(String.fromCharCode.apply(String,x)),T=0)}return A&&(x[T++]=s[E],x[T++]=61,A===1&&(x[T++]=61)),$?(T&&$.push(String.fromCharCode.apply(String,x.slice(0,T))),$.join("")):String.fromCharCode.apply(String,x.slice(0,T))};var d="invalid encoding";i.decode=function(g,y,b){for(var $=b,x=0,T,A=0;A1)break;if((E=a[E])===void 0)throw Error(d);switch(x){case 0:T=E,x=1;break;case 1:y[b++]=T<<2|(E&48)>>4,T=E,x=2;break;case 2:y[b++]=(T&15)<<4|(E&60)>>2,T=E,x=3;break;case 3:y[b++]=(T&3)<<6|E,x=0;break}}if(x===1)throw Error(d);return b-$},i.test=function(g){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(g)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(i,s,a){return(this._listeners[i]||(this._listeners[i]=[])).push({fn:s,ctx:a||this}),this};EventEmitter.prototype.off=function(i,s){if(i===void 0)this._listeners={};else if(s===void 0)this._listeners[i]=[];else for(var a=this._listeners[i],c=0;c0?0:2147483648,d,f);else if(isNaN(c))a(2143289344,d,f);else if(c>34028234663852886e22)a((g<<31|2139095040)>>>0,d,f);else if(c<11754943508222875e-54)a((g<<31|Math.round(c/1401298464324817e-60))>>>0,d,f);else{var y=Math.floor(Math.log(c)/Math.LN2),b=Math.round(c*Math.pow(2,-y)*8388608)&8388607;a((g<<31|y+127<<23|b)>>>0,d,f)}}o.writeFloatLE=i.bind(null,writeUintLE),o.writeFloatBE=i.bind(null,writeUintBE);function s(a,c,d){var f=a(c,d),g=(f>>31)*2+1,y=f>>>23&255,b=f&8388607;return y===255?b?NaN:g*(1/0):y===0?g*1401298464324817e-60*b:g*Math.pow(2,y-150)*(b+8388608)}o.readFloatLE=s.bind(null,readUintLE),o.readFloatBE=s.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),s=new Uint8Array(i.buffer),a=s[7]===128;function c(y,b,$){i[0]=y,b[$]=s[0],b[$+1]=s[1],b[$+2]=s[2],b[$+3]=s[3],b[$+4]=s[4],b[$+5]=s[5],b[$+6]=s[6],b[$+7]=s[7]}function d(y,b,$){i[0]=y,b[$]=s[7],b[$+1]=s[6],b[$+2]=s[5],b[$+3]=s[4],b[$+4]=s[3],b[$+5]=s[2],b[$+6]=s[1],b[$+7]=s[0]}o.writeDoubleLE=a?c:d,o.writeDoubleBE=a?d:c;function f(y,b){return s[0]=y[b],s[1]=y[b+1],s[2]=y[b+2],s[3]=y[b+3],s[4]=y[b+4],s[5]=y[b+5],s[6]=y[b+6],s[7]=y[b+7],i[0]}function g(y,b){return s[7]=y[b],s[6]=y[b+1],s[5]=y[b+2],s[4]=y[b+3],s[3]=y[b+4],s[2]=y[b+5],s[1]=y[b+6],s[0]=y[b+7],i[0]}o.readDoubleLE=a?f:g,o.readDoubleBE=a?g:f}():function(){function i(a,c,d,f,g,y){var b=f<0?1:0;if(b&&(f=-f),f===0)a(0,g,y+c),a(1/f>0?0:2147483648,g,y+d);else if(isNaN(f))a(0,g,y+c),a(2146959360,g,y+d);else if(f>17976931348623157e292)a(0,g,y+c),a((b<<31|2146435072)>>>0,g,y+d);else{var $;if(f<22250738585072014e-324)$=f/5e-324,a($>>>0,g,y+c),a((b<<31|$/4294967296)>>>0,g,y+d);else{var x=Math.floor(Math.log(f)/Math.LN2);x===1024&&(x=1023),$=f*Math.pow(2,-x),a($*4503599627370496>>>0,g,y+c),a((b<<31|x+1023<<20|$*1048576&1048575)>>>0,g,y+d)}}}o.writeDoubleLE=i.bind(null,writeUintLE,0,4),o.writeDoubleBE=i.bind(null,writeUintBE,4,0);function s(a,c,d,f,g){var y=a(f,g+c),b=a(f,g+d),$=(b>>31)*2+1,x=b>>>20&2047,T=4294967296*(b&1048575)+y;return x===2047?T?NaN:$*(1/0):x===0?$*5e-324*T:$*Math.pow(2,x-1075)*(T+4503599627370496)}o.readDoubleLE=s.bind(null,readUintLE,0,4),o.readDoubleBE=s.bind(null,readUintBE,4,0)}(),o}function writeUintLE(o,i,s){i[s]=o&255,i[s+1]=o>>>8&255,i[s+2]=o>>>16&255,i[s+3]=o>>>24}function writeUintBE(o,i,s){i[s]=o>>>24,i[s+1]=o>>>16&255,i[s+2]=o>>>8&255,i[s+3]=o&255}function readUintLE(o,i){return(o[i]|o[i+1]<<8|o[i+2]<<16|o[i+3]<<24)>>>0}function readUintBE(o,i){return(o[i]<<24|o[i+1]<<16|o[i+2]<<8|o[i+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(o){}return null}var utf8$5={};(function(o){var i=o;i.length=function(a){for(var c=0,d=0,f=0;f191&&$<224?y[b++]=($&31)<<6|a[c++]&63:$>239&&$<365?($=(($&7)<<18|(a[c++]&63)<<12|(a[c++]&63)<<6|a[c++]&63)-65536,y[b++]=55296+($>>10),y[b++]=56320+($&1023)):y[b++]=($&15)<<12|(a[c++]&63)<<6|a[c++]&63,b>8191&&((g||(g=[])).push(String.fromCharCode.apply(String,y)),b=0);return g?(b&&g.push(String.fromCharCode.apply(String,y.slice(0,b))),g.join("")):String.fromCharCode.apply(String,y.slice(0,b))},i.write=function(a,c,d){for(var f=d,g,y,b=0;b>6|192,c[d++]=g&63|128):(g&64512)===55296&&((y=a.charCodeAt(b+1))&64512)===56320?(g=65536+((g&1023)<<10)+(y&1023),++b,c[d++]=g>>18|240,c[d++]=g>>12&63|128,c[d++]=g>>6&63|128,c[d++]=g&63|128):(c[d++]=g>>12|224,c[d++]=g>>6&63|128,c[d++]=g&63|128);return d-f}})(utf8$5);var pool_1=pool;function pool(o,i,s){var a=s||8192,c=a>>>1,d=null,f=a;return function(y){if(y<1||y>c)return o(y);f+y>a&&(d=o(a),f=0);var b=i.call(d,f,f+=y);return f&7&&(f=(f|7)+1),b}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=i;var o=requireMinimal();function i(d,f){this.lo=d>>>0,this.hi=f>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(f){if(f===0)return s;var g=f<0;g&&(f=-f);var y=f>>>0,b=(f-y)/4294967296>>>0;return g&&(b=~b>>>0,y=~y>>>0,++y>4294967295&&(y=0,++b>4294967295&&(b=0))),new i(y,b)},i.from=function(f){if(typeof f=="number")return i.fromNumber(f);if(o.isString(f))if(o.Long)f=o.Long.fromString(f);else return i.fromNumber(parseInt(f,10));return f.low||f.high?new i(f.low>>>0,f.high>>>0):s},i.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var g=~this.lo+1>>>0,y=~this.hi>>>0;return g||(y=y+1>>>0),-(g+y*4294967296)}return this.lo+this.hi*4294967296},i.prototype.toLong=function(f){return o.Long?new o.Long(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;return i.fromHash=function(f){return f===a?s:new i((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},i.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},i.prototype.length=function(){var f=this.lo,g=(this.lo>>>28|this.hi<<4)>>>0,y=this.hi>>>24;return y===0?g===0?f<16384?f<128?1:2:f<2097152?3:4:g<16384?g<128?5:6:g<2097152?7:8:y<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(o){var i=o;i.asPromise=aspromise,i.base64=base64$1,i.EventEmitter=eventemitter,i.float=float,i.inquire=inquire_1,i.utf8=utf8$5,i.pool=pool_1,i.LongBits=requireLongbits(),i.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),i.global=i.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d},i.isString=function(d){return typeof d=="string"||d instanceof String},i.isObject=function(d){return d&&typeof d=="object"},i.isset=i.isSet=function(d,f){var g=d[f];return g!=null&&d.hasOwnProperty(f)?typeof g!="object"||(Array.isArray(g)?g.length:Object.keys(g).length)>0:!1},i.Buffer=function(){try{var c=i.inquire("buffer").Buffer;return c.prototype.utf8Write?c:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(d){return typeof d=="number"?i.Buffer?i._Buffer_allocUnsafe(d):new i.Array(d):i.Buffer?i._Buffer_from(d):typeof Uint8Array>"u"?d:new Uint8Array(d)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(d){return d?i.LongBits.from(d).toHash():i.LongBits.zeroHash},i.longFromHash=function(d,f){var g=i.LongBits.fromHash(d);return i.Long?i.Long.fromBits(g.lo,g.hi,f):g.toNumber(!!f)};function s(c,d,f){for(var g=Object.keys(d),y=0;y-1;--b)if(f[y[b]]===1&&this[y[b]]!==void 0&&this[y[b]]!==null)return y[b]}},i.oneOfSetter=function(d){return function(f){for(var g=0;g127;)i[s++]=o&127|128,o>>>=7;i[s]=o}function VarintOp(o,i){this.len=o,this.next=void 0,this.val=i}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function o(i){return this.len+=(this.tail=this.tail.next=new VarintOp((i=i>>>0)<128?1:i<16384?2:i<2097152?3:i<268435456?4:5,i)).len,this};Writer$1.prototype.int32=function o(i){return i<0?this._push(writeVarint64,10,LongBits$1.fromNumber(i)):this.uint32(i)};Writer$1.prototype.sint32=function o(i){return this.uint32((i<<1^i>>31)>>>0)};function writeVarint64(o,i,s){for(;o.hi;)i[s++]=o.lo&127|128,o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)i[s++]=o.lo&127|128,o.lo=o.lo>>>7;i[s++]=o.lo}Writer$1.prototype.uint64=function o(i){var s=LongBits$1.from(i);return this._push(writeVarint64,s.length(),s)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function o(i){var s=LongBits$1.from(i).zzEncode();return this._push(writeVarint64,s.length(),s)};Writer$1.prototype.bool=function o(i){return this._push(writeByte,1,i?1:0)};function writeFixed32(o,i,s){i[s]=o&255,i[s+1]=o>>>8&255,i[s+2]=o>>>16&255,i[s+3]=o>>>24}Writer$1.prototype.fixed32=function o(i){return this._push(writeFixed32,4,i>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function o(i){var s=LongBits$1.from(i);return this._push(writeFixed32,4,s.lo)._push(writeFixed32,4,s.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function o(i){return this._push(util$4.float.writeFloatLE,4,i)};Writer$1.prototype.double=function o(i){return this._push(util$4.float.writeDoubleLE,8,i)};var writeBytes=util$4.Array.prototype.set?function o(i,s,a){s.set(i,a)}:function o(i,s,a){for(var c=0;c>>0;if(!s)return this._push(writeByte,1,0);if(util$4.isString(i)){var a=Writer$1.alloc(s=base64.length(i));base64.decode(i,a,0),i=a}return this.uint32(s)._push(writeBytes,s,i)};Writer$1.prototype.string=function o(i){var s=utf8$4.length(i);return s?this.uint32(s)._push(utf8$4.write,s,i):this._push(writeByte,1,0)};Writer$1.prototype.fork=function o(){return this.states=new State$1(this),this.head=this.tail=new Op(noop$1,0,0),this.len=0,this};Writer$1.prototype.reset=function o(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop$1,0,0),this.len=0),this};Writer$1.prototype.ldelim=function o(){var i=this.head,s=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=i.next,this.tail=s,this.len+=a),this};Writer$1.prototype.finish=function o(){for(var i=this.head.next,s=this.constructor.alloc(this.len),a=0;i;)i.fn(i.val,s,a),a+=i.len,i=i.next;return s};Writer$1._configure=function(o){BufferWriter$1=o,Writer$1.create=create$e(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(i,s,a){s.set(i,a)}:function(i,s,a){if(i.copy)i.copy(s,a,0,i.length);else for(var c=0;c>>0;return this.uint32(s),s&&this._push(BufferWriter.writeBytesBuffer,s,i),this};function writeStringBuffer(o,i,s){o.length<40?util$3.utf8.write(o,i,s):i.utf8Write?i.utf8Write(o,s):i.write(o,s)}BufferWriter.prototype.string=function o(i){var s=util$3.Buffer.byteLength(i);return this.uint32(s),s&&this._push(writeStringBuffer,s,i),this};BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8$3=util$2.utf8;function indexOutOfRange(o,i){return RangeError("index out of range: "+o.pos+" + "+(i||1)+" > "+o.len)}function Reader$1(o){this.buf=o,this.pos=0,this.len=o.length}var create_array=typeof Uint8Array<"u"?function o(i){if(i instanceof Uint8Array||Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")}:function o(i){if(Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")},create$d=function o(){return util$2.Buffer?function(s){return(Reader$1.create=function(c){return util$2.Buffer.isBuffer(c)?new BufferReader$1(c):create_array(c)})(s)}:create_array};Reader$1.create=create$d();Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice;Reader$1.prototype.uint32=function o(){var i=4294967295;return function(){if(i=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(i=(i|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return i;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return i}}();Reader$1.prototype.int32=function o(){return this.uint32()|0};Reader$1.prototype.sint32=function o(){var i=this.uint32();return i>>>1^-(i&1)|0};function readLongVarint(){var o=new LongBits(0,0),i=0;if(this.len-this.pos>4){for(;i<4;++i)if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o;if(o.lo=(o.lo|(this.buf[this.pos]&127)<<28)>>>0,o.hi=(o.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return o;i=0}else{for(;i<3;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}return o.lo=(o.lo|(this.buf[this.pos++]&127)<>>0,o}if(this.len-this.pos>4){for(;i<5;++i)if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}else for(;i<5;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function o(){return this.uint32()!==0};function readFixed32_end(o,i){return(o[i-4]|o[i-3]<<8|o[i-2]<<16|o[i-1]<<24)>>>0}Reader$1.prototype.fixed32=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var i=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,i};Reader$1.prototype.double=function o(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var i=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,i};Reader$1.prototype.bytes=function o(){var i=this.uint32(),s=this.pos,a=this.pos+i;if(a>this.len)throw indexOutOfRange(this,i);if(this.pos+=i,Array.isArray(this.buf))return this.buf.slice(s,a);if(s===a){var c=util$2.Buffer;return c?c.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,s,a)};Reader$1.prototype.string=function o(){var i=this.bytes();return utf8$3.read(i,0,i.length)};Reader$1.prototype.skip=function o(i){if(typeof i=="number"){if(this.pos+i>this.len)throw indexOutOfRange(this,i);this.pos+=i}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(o){switch(o){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(o=this.uint32()&7)!==4;)this.skipType(o);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+o+" at offset "+this.pos)}return this};Reader$1._configure=function(o){BufferReader$1=o,Reader$1.create=create$d(),BufferReader$1._configure();var i=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[i](!1)},uint64:function(){return readLongVarint.call(this)[i](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[i](!1)},fixed64:function(){return readFixed64.call(this)[i](!0)},sfixed64:function(){return readFixed64.call(this)[i](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(o){Reader.call(this,o)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)};BufferReader.prototype.string=function o(){var i=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+i,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+i,this.len))};BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(o,i,s){if(typeof o!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=!!i,this.responseDelimited=!!s}Service.prototype.rpcCall=function o(i,s,a,c,d){if(!c)throw TypeError("request must be specified");var f=this;if(!d)return util.asPromise(o,f,i,s,a,c);if(!f.rpcImpl){setTimeout(function(){d(Error("already ended"))},0);return}try{return f.rpcImpl(i,s[f.requestDelimited?"encodeDelimited":"encode"](c).finish(),function(y,b){if(y)return f.emit("error",y,i),d(y);if(b===null){f.end(!0);return}if(!(b instanceof a))try{b=a[f.responseDelimited?"decodeDelimited":"decode"](b)}catch($){return f.emit("error",$,i),d($)}return f.emit("data",b,i),d(null,b)})}catch(g){f.emit("error",g,i),setTimeout(function(){d(g)},0);return}};Service.prototype.end=function o(i){return this.rpcImpl&&(i||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(o){var i=o;i.Service=service})(rpc);var roots={};(function(o){var i=o;i.build="minimal",i.Writer=writer,i.BufferWriter=writer_buffer,i.Reader=reader,i.BufferReader=reader_buffer,i.util=requireMinimal(),i.rpc=rpc,i.roots=roots,i.configure=s;function s(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}s()})(indexMinimal);var minimal=indexMinimal;const $protobuf=getDefaultExportFromCjs(minimal),$Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util,$root=$protobuf.roots.unixfs||($protobuf.roots.unixfs={}),Data=$root.Data=(()=>{function o(i){if(this.blocksizes=[],i)for(var s=Object.keys(i),a=0;a>>3){case 1:d.Type=s.int32();break;case 2:d.Data=s.bytes();break;case 3:d.filesize=s.uint64();break;case 4:if(d.blocksizes&&d.blocksizes.length||(d.blocksizes=[]),(f&7)===2)for(var g=s.uint32()+s.pos;s.pos>>0,s.filesize.high>>>0).toNumber(!0))),s.blocksizes){if(!Array.isArray(s.blocksizes))throw TypeError(".Data.blocksizes: array expected");a.blocksizes=[];for(var c=0;c>>0,s.blocksizes[c].high>>>0).toNumber(!0))}if(s.hashType!=null&&($util.Long?(a.hashType=$util.Long.fromValue(s.hashType)).unsigned=!0:typeof s.hashType=="string"?a.hashType=parseInt(s.hashType,10):typeof s.hashType=="number"?a.hashType=s.hashType:typeof s.hashType=="object"&&(a.hashType=new $util.LongBits(s.hashType.low>>>0,s.hashType.high>>>0).toNumber(!0))),s.fanout!=null&&($util.Long?(a.fanout=$util.Long.fromValue(s.fanout)).unsigned=!0:typeof s.fanout=="string"?a.fanout=parseInt(s.fanout,10):typeof s.fanout=="number"?a.fanout=s.fanout:typeof s.fanout=="object"&&(a.fanout=new $util.LongBits(s.fanout.low>>>0,s.fanout.high>>>0).toNumber(!0))),s.mode!=null&&(a.mode=s.mode>>>0),s.mtime!=null){if(typeof s.mtime!="object")throw TypeError(".Data.mtime: object expected");a.mtime=$root.UnixTime.fromObject(s.mtime)}return a},o.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.blocksizes=[]),a.defaults){if(c.Type=a.enums===String?"Raw":0,a.bytes===String?c.Data="":(c.Data=[],a.bytes!==Array&&(c.Data=$util.newBuffer(c.Data))),$util.Long){var d=new $util.Long(0,0,!0);c.filesize=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.filesize=a.longs===String?"0":0;if($util.Long){var d=new $util.Long(0,0,!0);c.hashType=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.hashType=a.longs===String?"0":0;if($util.Long){var d=new $util.Long(0,0,!0);c.fanout=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.fanout=a.longs===String?"0":0;c.mode=0,c.mtime=null}if(s.Type!=null&&s.hasOwnProperty("Type")&&(c.Type=a.enums===String?$root.Data.DataType[s.Type]:s.Type),s.Data!=null&&s.hasOwnProperty("Data")&&(c.Data=a.bytes===String?$util.base64.encode(s.Data,0,s.Data.length):a.bytes===Array?Array.prototype.slice.call(s.Data):s.Data),s.filesize!=null&&s.hasOwnProperty("filesize")&&(typeof s.filesize=="number"?c.filesize=a.longs===String?String(s.filesize):s.filesize:c.filesize=a.longs===String?$util.Long.prototype.toString.call(s.filesize):a.longs===Number?new $util.LongBits(s.filesize.low>>>0,s.filesize.high>>>0).toNumber(!0):s.filesize),s.blocksizes&&s.blocksizes.length){c.blocksizes=[];for(var f=0;f>>0,s.blocksizes[f].high>>>0).toNumber(!0):s.blocksizes[f]}return s.hashType!=null&&s.hasOwnProperty("hashType")&&(typeof s.hashType=="number"?c.hashType=a.longs===String?String(s.hashType):s.hashType:c.hashType=a.longs===String?$util.Long.prototype.toString.call(s.hashType):a.longs===Number?new $util.LongBits(s.hashType.low>>>0,s.hashType.high>>>0).toNumber(!0):s.hashType),s.fanout!=null&&s.hasOwnProperty("fanout")&&(typeof s.fanout=="number"?c.fanout=a.longs===String?String(s.fanout):s.fanout:c.fanout=a.longs===String?$util.Long.prototype.toString.call(s.fanout):a.longs===Number?new $util.LongBits(s.fanout.low>>>0,s.fanout.high>>>0).toNumber(!0):s.fanout),s.mode!=null&&s.hasOwnProperty("mode")&&(c.mode=s.mode),s.mtime!=null&&s.hasOwnProperty("mtime")&&(c.mtime=$root.UnixTime.toObject(s.mtime,a)),c},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o.DataType=function(){const i={},s=Object.create(i);return s[i[0]="Raw"]=0,s[i[1]="Directory"]=1,s[i[2]="File"]=2,s[i[3]="Metadata"]=3,s[i[4]="Symlink"]=4,s[i[5]="HAMTShard"]=5,s}(),o})();$root.UnixTime=(()=>{function o(i){if(i)for(var s=Object.keys(i),a=0;a>>3){case 1:d.Seconds=s.int64();break;case 2:d.FractionalNanoseconds=s.fixed32();break;default:s.skipType(f&7);break}}if(!d.hasOwnProperty("Seconds"))throw $util.ProtocolError("missing required 'Seconds'",{instance:d});return d},o.fromObject=function(s){if(s instanceof $root.UnixTime)return s;var a=new $root.UnixTime;return s.Seconds!=null&&($util.Long?(a.Seconds=$util.Long.fromValue(s.Seconds)).unsigned=!1:typeof s.Seconds=="string"?a.Seconds=parseInt(s.Seconds,10):typeof s.Seconds=="number"?a.Seconds=s.Seconds:typeof s.Seconds=="object"&&(a.Seconds=new $util.LongBits(s.Seconds.low>>>0,s.Seconds.high>>>0).toNumber())),s.FractionalNanoseconds!=null&&(a.FractionalNanoseconds=s.FractionalNanoseconds>>>0),a},o.toObject=function(s,a){a||(a={});var c={};if(a.defaults){if($util.Long){var d=new $util.Long(0,0,!1);c.Seconds=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.Seconds=a.longs===String?"0":0;c.FractionalNanoseconds=0}return s.Seconds!=null&&s.hasOwnProperty("Seconds")&&(typeof s.Seconds=="number"?c.Seconds=a.longs===String?String(s.Seconds):s.Seconds:c.Seconds=a.longs===String?$util.Long.prototype.toString.call(s.Seconds):a.longs===Number?new $util.LongBits(s.Seconds.low>>>0,s.Seconds.high>>>0).toNumber():s.Seconds),s.FractionalNanoseconds!=null&&s.hasOwnProperty("FractionalNanoseconds")&&(c.FractionalNanoseconds=s.FractionalNanoseconds),c},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o})();$root.Metadata=(()=>{function o(i){if(i)for(var s=Object.keys(i),a=0;a>>3){case 1:d.MimeType=s.string();break;default:s.skipType(f&7);break}}return d},o.fromObject=function(s){if(s instanceof $root.Metadata)return s;var a=new $root.Metadata;return s.MimeType!=null&&(a.MimeType=String(s.MimeType)),a},o.toObject=function(s,a){a||(a={});var c={};return a.defaults&&(c.MimeType=""),s.MimeType!=null&&s.hasOwnProperty("MimeType")&&(c.MimeType=s.MimeType),c},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o})();const NodeType=Data.DataType,EMPTY$3=Object.freeze([]),EMPTY_BUFFER$1=new Uint8Array(0),BLANK$2=Object.freeze({}),DEFAULT_FILE_MODE=parseInt("0644",8),DEFAULT_DIRECTORY_MODE=parseInt("0755",8),code$1=code$2,name$2="UnixFS",encodePB=(o,i)=>(Object(globalThis).debug&&console.log({data:o,links:i}),encode$c(prepare({Data:Data.encode(o).finish(),Links:i}))),createRaw=o=>({type:NodeType.Raw,content:o}),createEmptyFile=o=>createSimpleFile(EMPTY_BUFFER$1,o),createSimpleFile=(o,i)=>({type:NodeType.File,layout:"simple",content:o,metadata:decodeMetadata(i)}),createFileChunk=o=>({type:NodeType.File,layout:"simple",content:o}),createAdvancedFile=(o,i)=>({type:NodeType.File,layout:"advanced",parts:o,metadata:decodeMetadata(i)}),createFileShard=o=>({type:NodeType.File,layout:"advanced",parts:o}),createComplexFile=(o,i,s)=>({type:NodeType.File,layout:"complex",content:o,parts:i,metadata:decodeMetadata(s)}),createFlatDirectory=(o,i)=>({type:NodeType.Directory,metadata:decodeMetadata(i),entries:o}),createShardedDirectory=(o,i,s,a,c=BLANK$2)=>({type:NodeType.HAMTShard,bitfield:i,fanout:readFanout(s),hashType:readInt(a),entries:o,metadata:decodeMetadata(c)}),createDirectoryShard=(o,i,s,a)=>({type:NodeType.HAMTShard,bitfield:i,fanout:readFanout(s),hashType:readInt(a),entries:o}),encodeRaw=o=>encodePB({Type:NodeType.Raw,Data:o.byteLength>0?o:void 0,filesize:o.byteLength,blocksizes:EMPTY$3},[]),encodeFile=(o,i=!1)=>{const s=i?BLANK$2:Object(o).metadata;switch(o.layout){case"simple":return encodeSimpleFile(o.content,s);case"advanced":return encodeAdvancedFile(o.parts,s);case"complex":return encodeComplexFile(o.content,o.parts,s);default:throw new TypeError(`File with unknown layout "${Object(o).layout}" was passed`)}},encodeFileChunk=o=>encodeSimpleFile(o,BLANK$2),encodeFileShard=o=>encodePB({Type:NodeType.File,blocksizes:o.map(contentByteLength),filesize:cumulativeContentByteLength(o)},o.map(encodeLink)),encodeAdvancedFile=(o,i=BLANK$2)=>encodePB({Type:NodeType.File,blocksizes:o.map(contentByteLength),filesize:cumulativeContentByteLength(o),...encodeMetadata(i)},o.map(encodeLink)),encodeLink=o=>({Name:"",Tsize:o.dagByteLength,Hash:o.cid}),encodeSimpleFile=(o,i=BLANK$2)=>encodePB({Type:NodeType.File,Data:o.byteLength>0?o:void 0,filesize:o.byteLength,blocksizes:[],...encodeMetadata(i)},[]),encodeComplexFile=(o,i,s=BLANK$2)=>encodePB({Type:NodeType.File,Data:o,filesize:o.byteLength+cumulativeContentByteLength(i),blocksizes:i.map(contentByteLength)},i.map(encodeLink)),encodeDirectory=o=>encodePB({Type:o.type,...encodeDirectoryMetadata(o.metadata||BLANK$2)},o.entries.map(encodeNamedLink)),encodeHAMTShard=({bitfield:o,fanout:i,hashType:s,entries:a,metadata:c=BLANK$2})=>encodePB({Type:NodeType.HAMTShard,Data:o.byteLength>0?o:void 0,fanout:readFanout(i),hashType:readInt(s),...encodeDirectoryMetadata(c)},a.map(encodeNamedLink)),readFanout=o=>{if(Math.log2(o)%1===0)return o;throw new TypeError(`Expected hamt size to be a power of two instead got ${o}`)},readInt=o=>{if(Number.isInteger(o))return o;throw new TypeError(`Expected an integer value instead got ${o}`)},createSymlink=(o,i=BLANK$2)=>({type:NodeType.Symlink,content:o,metadata:decodeMetadata(i)}),encodeSymlink=(o,i=!1)=>{const s=i?BLANK$2:Object(o).metadata;return encodePB({Type:NodeType.Symlink,Data:o.content,...encodeMetadata(s||BLANK$2)},[])},encode$b=(o,i=!0)=>{switch(o.type){case NodeType.Raw:return encodeRaw(o.content);case NodeType.File:return encodeFile(o);case NodeType.Directory:return encodeDirectory(o);case NodeType.HAMTShard:return encodeHAMTShard(o);case NodeType.Symlink:return encodeSymlink(o);default:throw new Error(`Unknown node type ${Object(o).type}`)}},decode$g=o=>{const i=decode$h(o),s=Data.decode(i.Data),{Type:a,Data:c,mtime:d,mode:f,blocksizes:g,...y}=Data.toObject(s,{defaults:!1,arrays:!0,longs:Number,objects:!1}),b={...f&&{mode:f},...decodeMtime(d)},$=i.Links;switch(s.Type){case NodeType.Raw:return createRaw(c);case NodeType.File:return $.length===0?new SimpleFileView(c,b):c.byteLength===0?new AdvancedFileView(decodeFileLinks(y.blocksizes,$),b):new ComplexFileView(c,decodeFileLinks(y.blocksizes,$),b);case NodeType.Directory:return createFlatDirectory(decodeDirectoryLinks($),b);case NodeType.HAMTShard:return createShardedDirectory(decodeDirectoryLinks($),c||EMPTY_BUFFER$1,y.fanout,y.hashType,b);case NodeType.Symlink:return createSymlink(c,b);default:throw new TypeError(`Unsupported node type ${s.Type}`)}},decodeMtime=o=>o==null?void 0:{mtime:{secs:o.Seconds,nsecs:o.FractionalNanoseconds||0}},decodeFileLinks=(o,i)=>{const s=[],a=o.length;let c=0;for(;co.map(i=>({cid:i.Hash,name:i.Name||"",dagByteLength:i.Tsize||0})),cumulativeContentByteLength=o=>o.reduce((i,s)=>i+s.contentByteLength,0),cumulativeDagByteLength=(o,i)=>i.reduce((s,a)=>s+a.dagByteLength,o.byteLength),contentByteLength=o=>o.contentByteLength,encodeNamedLink=({name:o,dagByteLength:i,cid:s})=>({Name:o,Tsize:i,Hash:s}),encodeDirectoryMetadata=o=>encodeMetadata(o,DEFAULT_DIRECTORY_MODE),encodeMetadata=({mode:o,mtime:i},s=DEFAULT_FILE_MODE)=>({mode:o!=null?encodeMode(o,s):void 0,mtime:i!=null?encodeMTime(i):void 0}),decodeMetadata=o=>o==null?BLANK$2:{...o.mode==null?void 0:{mode:decodeMode(o.mode)},...o.mtime==null?void 0:{mtime:o.mtime}},encodeMTime=o=>o==null?void 0:o.nsecs!==0?{Seconds:o.secs,FractionalNanoseconds:o.nsecs}:{Seconds:o.secs},encodeMode=(o,i)=>{const s=o==null?void 0:decodeMode(o);return s===i||s==null?void 0:s},decodeMode=o=>o&4095|o&4294963200,matchFile=({content:o=EMPTY_BUFFER$1,parts:i=EMPTY$3,metadata:s=BLANK$2,...a})=>i.length===0?new SimpleFileView(o,s):o.byteLength===0?new AdvancedFileView(i,s):new ComplexFileView(o,i,s);class SimpleFileView{constructor(i,s){this.content=i,this.metadata=s,this.layout="simple",this.type=NodeType.File}get filesize(){return this.content.byteLength}encode(){return encodeSimpleFile(this.content,this.metadata)}}class AdvancedFileView{constructor(i,s){this.parts=i,this.metadata=s}get layout(){return"advanced"}get type(){return NodeType.File}get fileSize(){return cumulativeContentByteLength(this.parts)}get blockSizes(){return this.parts.map(contentByteLength)}encode(){return encodeAdvancedFile(this.parts,this.metadata)}}class ComplexFileView{constructor(i,s,a){this.content=i,this.parts=s,this.metadata=a}get layout(){return"complex"}get type(){return NodeType.File}get fileSize(){return this.content.byteLength+cumulativeContentByteLength(this.parts)}get blockSizes(){return this.parts.map(contentByteLength)}encode(){return encodeComplexFile(this.content,this.parts,this.metadata)}}const filesize=o=>{switch(o.type){case NodeType.Raw:case NodeType.Symlink:return o.content.byteLength;case NodeType.File:switch(o.layout){case"simple":return o.content.byteLength;case"advanced":return cumulativeContentByteLength(o.parts);case"complex":return o.content.byteLength+cumulativeContentByteLength(o.parts)}default:return 0}},UnixFS=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_DIRECTORY_MODE,DEFAULT_FILE_MODE,NodeType,code:code$1,createAdvancedFile,createComplexFile,createDirectoryShard,createEmptyFile,createFileChunk,createFileShard,createFlatDirectory,createRaw,createShardedDirectory,createSimpleFile,createSymlink,cumulativeContentByteLength,cumulativeDagByteLength,decode:decode$g,decodeMetadata,encode:encode$b,encodeAdvancedFile,encodeComplexFile,encodeDirectory,encodeDirectoryMetadata,encodeFile,encodeFileChunk,encodeFileShard,encodeHAMTShard,encodeLink,encodeMetadata,encodeMode,encodeRaw,encodeSimpleFile,encodeSymlink,filesize,matchFile,name:name$2},Symbol.toStringTag,{value:"Module"})),effect=function*(o){const i=yield*o;yield*send(i)};function*current(){return yield CURRENT}const suspend=function*(){yield SUSPEND},wait=function*(o){const i=yield*current();if(isAsync(o)){let s=!1,a;if(o.then(c=>{s=!1,a=c,enqueue(i)},c=>{s=!0,a=c,enqueue(i)}),yield*suspend(),s)throw a;return a}else return main(wake(i)),yield*suspend(),o};function*wake(o){enqueue(o)}const isAsync=o=>o!=null&&typeof o.then=="function",send=function*(o){yield o},listen=function*(o){const i=[];for(const s of Object.entries(o)){const[a,c]=s;c!==NONE&&i.push(yield*fork$3(tag(c,a)))}yield*group(i)},effects=o=>o.length>0?batch(o.map(effect)):NONE;function*batch(o){const i=[];for(const s of o)i.push(yield*fork$3(s));yield*group(i)}const tag=(o,i)=>o===NONE?NONE:o instanceof Tagger?new Tagger([...o.tags,i],o.source):new Tagger([i],o);class Tagger{constructor(i,s){this.tags=i,this.source=s,this.controller}[Symbol.iterator](){return this.controller||(this.controller=this.source[Symbol.iterator]()),this}box(i){if(i.done)return i;switch(i.value){case SUSPEND:case CURRENT:return i;default:{const s=i;let{value:a}=s;for(const c of this.tags)a=withTag(c,a);return s.value=a,s}}}next(i){return this.box(this.controller.next(i))}throw(i){return this.box(this.controller.throw(i))}return(i){return this.box(this.controller.return(i))}get[Symbol.toStringTag](){return"TaggedEffect"}}const none=()=>NONE,withTag=(o,i)=>({type:o,[o]:i}),CURRENT=Symbol("current"),SUSPEND=Symbol("suspend");class Group{static of(i){return i.group||MAIN}static enqueue(i,s){i.group=s,s.stack.active.push(i)}constructor(i,s=[],a=new Set,c=new Stack(s,a)){this.driver=i,this.parent=Group.of(i),this.stack=c,this.id=++ID}}class Main{constructor(){this.status=IDLE,this.stack=new Stack,this.id=0}}class Stack{constructor(i=[],s=new Set){this.active=i,this.idle=s}static size({active:i,idle:s}){return i.length+s.size}}const main=o=>enqueue(o[Symbol.iterator]()),enqueue=o=>{let i=Group.of(o);for(i.stack.active.push(o),i.stack.idle.delete(o);i.parent;){const{idle:s,active:a}=i.parent.stack;if(s.has(i.driver))s.delete(i.driver),a.push(i.driver);else break;i=i.parent}if(MAIN.status===IDLE)for(MAIN.status=ACTIVE;;)try{for(const s of step(MAIN));MAIN.status=IDLE;break}catch{MAIN.stack.active.shift()}},resume=o=>enqueue(o),step=function*(o){const{active:i}=o.stack;let s=i[0];for(o.stack.idle.delete(s);s;){let a=INIT;e:for(;!a.done&&s===i[0];){const c=a.value;switch(c){case SUSPEND:o.stack.idle.add(s);break e;case CURRENT:a=s.next(s);break;default:a=s.next(yield c);break}}i.shift(),s=i[0],o.stack.idle.delete(s)}},fork$3=(o,i)=>new Fork(o,i),exit=(o,i)=>conclude(o,{ok:!0,value:i}),abort=(o,i)=>conclude(o,{ok:!1,error:i});function*conclude(o,i){try{const s=o,a=i.ok?s.return(i.value):s.throw(i.error);if(!a.done)if(a.value===SUSPEND){const{idle:c}=Group.of(s).stack;c.add(s)}else enqueue(s)}catch{}}function*group(o){if(o.length===0)return;const i=yield*current(),s=new Group(i);let a=null;for(const c of o){const{result:d}=c;if(d){!d.ok&&!a&&(a=d);continue}move(c,s)}try{if(a)throw a.error;for(;yield*step(s),Stack.size(s.stack)>0;)yield*suspend()}catch(c){for(const d of s.stack.active)yield*abort(d,c);for(const d of s.stack.idle)yield*abort(d,c),enqueue(d);throw c}}const move=(o,i)=>{const s=Group.of(o);if(s!==i){const{active:a,idle:c}=s.stack,d=i.stack;if(o.group=i,c.has(o))c.delete(o),d.idle.add(o);else{const f=a.indexOf(o);f>=0&&(a.splice(f,1),d.active.push(o))}}};function*join(o){o.status===IDLE&&(yield*o),o.result||(yield*group([o]));const i=o.result;if(i.ok)return i.value;throw i.error}class Future{constructor(i){this.handler=i,this.result}get promise(){const{result:i}=this,s=i==null?new Promise((a,c)=>{this.handler.onsuccess=a,this.handler.onfailure=c}):i.ok?Promise.resolve(i.value):Promise.reject(i.error);return Object.defineProperty(this,"promise",{value:s}),s}then(i,s){return this.activate().promise.then(i,s)}catch(i){return this.activate().promise.catch(i)}finally(i){return this.activate().promise.finally(i)}activate(){return this}}class Fork extends Future{constructor(i,s=BLANK$1,a={},c=INIT){super(a),this.id=++ID,this.name=s.name||"",this.task=i,this.state=c,this.status=IDLE,this.result,this.handler=a,this.controller}*resume(){resume(this)}join(){return join(this)}abort(i){return abort(this,i)}exit(i){return exit(this,i)}get[Symbol.toStringTag](){return"Fork"}*[Symbol.iterator](){return this.activate()}activate(){return this.controller=this.task[Symbol.iterator](),this.status=ACTIVE,enqueue(this),this}panic(i){this.result={ok:!1,error:i},this.status=FINISHED;const{handler:s}=this;throw s.onfailure&&s.onfailure(i),i}step(i){if(this.state=i,i.done){this.result={ok:!0,value:i.value},this.status=FINISHED;const{handler:s}=this;s.onsuccess&&s.onsuccess(i.value)}return i}next(i){try{return this.step(this.controller.next(i))}catch(s){return this.panic(s)}}return(i){try{return this.step(this.controller.return(i))}catch(s){return this.panic(s)}}throw(i){try{return this.step(this.controller.throw(i))}catch(s){return this.panic(s)}}}const loop=function*(o,i){const s=yield*current(),a=new Group(s);for(Group.enqueue(o[Symbol.iterator](),a);;){for(const c of step(a))Group.enqueue(i(c)[Symbol.iterator](),a);if(Stack.size(a.stack)>0)yield*suspend();else break}};let ID=0;const IDLE="idle",ACTIVE="active",FINISHED="finished",INIT={done:!1,value:CURRENT},BLANK$1={},NONE=function*o(){}(),MAIN=new Main;function Indexed(){}Object.defineProperties(Indexed,{prototype:{value:new Proxy(Object.prototype,{get(o,i,s){return typeof i=="symbol"?Reflect.get(o,i,s):s.get(i)}})}});const empty$3=()=>new BufferView,slice=(o,i=0,s=o.byteLength)=>{const a=[],c=i<0?o.byteLength-i:i,d=s<0?o.byteLength-s:s;if(c===0&&d>=o.byteLength)return o;if(c>d||c>o.byteLength||d<=0)return empty$3();let f=0,g=0;for(const y of o.segments){const b=g+y.byteLength;if(f===0){if(d<=b){const $=y.subarray(c-g,d-g);a.push($),f=$.byteLength;break}else if(ci.byteLength>0?(o.segments.push(i),new BufferView(o.segments,o.byteOffset,o.byteLength+i.byteLength)):o,get$6=(o,i)=>{if(i{let a=s;for(const c of o.segments)i.set(c,a),a+=c.byteLength;return i};function*iterate$1(o){for(const i of o.segments)yield*i}class BufferView extends Indexed{constructor(i=[],s=0,a=0){super(),this.segments=i,this.byteLength=a,this.length=a,this.byteOffset=s}[Symbol.iterator](){return iterate$1(this)}slice(i,s){return slice(this,i,s)}subarray(i,s){return slice(this,i,s)}push(i){return push(this,i)}get(i){return get$6(this,i)}copyTo(i,s){return copyTo(this,i,s)}}const panic=o=>{throw new Error(o)},unreachable=(o,i,...s)=>panic(String.raw(o,JSON.stringify(i),...s)),EMPTY_BUFFER=new Uint8Array(0),EMPTY$2=[],open$1=o=>({config:o,buffer:empty$3()}),write$3=(o,i)=>i.byteLength>0?split(o.config,o.buffer.push(i),!1):{...o,chunks:EMPTY$2},close$6=o=>split(o.config,o.buffer,!0),split=(o,i,s)=>{const a=o.chunker,c=[];let d=0;for(const f of a.cut(a.context,i,s))if(f>0){const g=i.subarray(d,d+f);c.push(g),d+=f}return{config:o,chunks:c,buffer:i.subarray(d)}},mutable=()=>({mutable:!0,needs:{},nodes:{},links:{},linked:EMPTY$1}),addNodes=(o,i)=>{let s=patch(i,{});for(const a of o){const{ready:c,has:d,wants:f}=collect(a.children,s.links);f.length===0?s=patch(s,{links:assign(void 0,d),linked:[{id:a.id,links:c}]}):s=patch(s,{needs:assign(a.id,f),nodes:{[a.id]:{children:a.children,count:f.length}}})}return s},addLink=(o,i,s)=>{const a=s.needs[o],c=s.nodes[a];if(c!=null)if(c.count===1){const{ready:d,has:f}=collect(c.children,{...s.links,[o]:i});return patch(s,{needs:{[o]:void 0},links:assign(void 0,f),nodes:{[a]:void 0},linked:[{id:a,links:d}]})}else return patch(s,{needs:{[o]:void 0},links:{[o]:i},nodes:{[a]:{...c,count:c.count-1}}});else return patch(s,{links:{[o]:i}})},patch=(o,{needs:i,nodes:s,links:a,linked:c})=>{const d=o.mutable?o:{...o},f=o.mutable?BLANK:void 0;return i&&(d.needs=patchDict(o.needs,i,f)),s&&(d.nodes=patchDict(o.nodes,s,f)),a&&(d.links=patchDict(o.links,a,f)),d.linked=c?append(o.linked||EMPTY$1,c,EMPTY$1):o.linked||[],d},assign=(o,i)=>{const s={};for(const a of i)s[a]=o;return s},patchDict=(o,i,s=o)=>{const a=o===s?{...o}:o;for(const c of Object.entries(i)){const[d,f]=c;f==null?delete a[d]:a[d]=f}return a},append=(o,i,s=o)=>{if(o===s)return[...o,...i];for(const a of i)o.push(a);return o},collect=(o,i)=>{const s=[],a=[],c=[];for(const d of o){const f=i[d];f?(s.push(d),c.push(f)):a.push(d)}return{has:s,wants:a,ready:c}},EMPTY$1=Object.freeze([]),BLANK=Object.freeze({}),update=(o,i)=>{switch(o.type){case"write":return write$2(i,o.bytes);case"link":return link(i,o.link);case"block":return{state:i,effect:none()};case"close":return close$5(i);case"end":return{state:i,effect:none()};default:return unreachable`File Writer got unknown message ${o}`}},init=(o,i,s)=>({status:"open",metadata:i,config:s,writer:o,chunker:open$1({chunker:s.chunker}),layout:s.fileLayout.open(),nodeQueue:mutable()}),write$2=(o,i)=>{if(o.status==="open"){const{chunks:s,...a}=write$3(o.chunker,i),{nodes:c,leaves:d,layout:f}=o.config.fileLayout.write(o.layout,s),{linked:g,...y}=addNodes(c,o.nodeQueue),b=[...encodeLeaves(d,o.config),...encodeBranches(g,o.config)];return{state:{...o,chunker:a,layout:f,nodeQueue:y},effect:listen({link:effects(b)})}}else return panic("Unable to perform write on closed file")},link=(o,{id:i,link:s,block:a})=>{let{linked:c,...d}=addLink(i,s,o.nodeQueue);const f=encodeBranches(c,o.config),g=o.status==="closed"&&i===o.rootID?{...o,status:"linked",link:s,nodeQueue:d}:{...o,nodeQueue:d},y=o.status==="closed"&&i===o.rootID&&o.end?o.end.resume():none();return{state:g,effect:listen({link:effects(f),block:writeBlock(o.writer,a),end:y})}},close$5=o=>{if(o.status==="open"){const{chunks:i}=close$6(o.chunker),{layout:s,...a}=o.config.fileLayout.write(o.layout,i),{root:c,...d}=o.config.fileLayout.close(s,o.metadata),[f,g]=isLeafNode(c)?[[...a.nodes,...d.nodes],[...a.leaves,...d.leaves,c]]:[[...a.nodes,...d.nodes,c],[...a.leaves,...d.leaves]],{linked:y,...b}=addNodes(f,o.nodeQueue),$=[...encodeLeaves(g,o.config),...encodeBranches(y,o.config)],x=fork$3(suspend());return{state:{...o,chunker:null,layout:null,rootID:c.id,status:"closed",end:x,nodeQueue:b},effect:listen({link:effects($),end:join(x)})}}else return{state:o,effect:none()}},encodeLeaves=(o,i)=>o.map(s=>encodeLeaf(i,s,i.fileChunkEncoder)),encodeLeaf=function*({hasher:o,linker:i},{id:s,content:a},c){const d=c.encode(a?asUint8Array$1(a):EMPTY_BUFFER),f=yield*wait(o.digest(d)),g=i.createLink(c.code,f),y={cid:g,bytes:d},b={cid:g,contentByteLength:a?a.byteLength:0,dagByteLength:d.byteLength};return{id:s,block:y,link:b}},encodeBranches=(o,i)=>o.map(s=>encodeBranch(i,s)),encodeBranch=function*(o,{id:i,links:s},a){const c=o.fileEncoder.encode({type:NodeType.File,layout:"advanced",parts:s,metadata:a}),d=yield*wait(Promise.resolve(o.hasher.digest(c))),f=o.linker.createLink(o.fileEncoder.code,d),g={bytes:c,cid:f},y={cid:f,contentByteLength:cumulativeContentByteLength(s),dagByteLength:cumulativeDagByteLength(c,s)};return{id:i,block:g,link:y}},writeBlock=function*(o,i){(o.desiredSize||0)<=0&&(yield*wait(o.ready)),o.write(i)},asUint8Array$1=o=>o instanceof Uint8Array?o:o.copyTo(new Uint8Array(o.byteLength),0),isLeafNode=o=>o.children==null,name$1="fixed",context={maxChunkSize:262144},type="Stateless",withMaxChunkSize=o=>({type:"Stateless",context:{maxChunkSize:o},name:name$1,cut}),cut=({maxChunkSize:o},{byteLength:i},s)=>{const a=i/o|0,c=new Array(a).fill(o),d=s?i-a*o:0;return d>0&&c.push(d),c},FixedSize=Object.freeze(Object.defineProperty({__proto__:null,context,cut,name:name$1,type,withMaxChunkSize},Symbol.toStringTag,{value:"Module"})),equals$6=(o,i)=>{if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s{if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")};var encode_1$3=encode$a,MSB$4=128,REST$4=127,MSBALL$4=~REST$4,INT$4=Math.pow(2,31);function encode$a(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$4;)i[s++]=o&255|MSB$4,o/=128;for(;o&MSBALL$4;)i[s++]=o&255|MSB$4,o>>>=7;return i[s]=o|0,encode$a.bytes=s-a+1,i}var decode$f=read$4,MSB$1$4=128,REST$1$4=127;function read$4(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$4.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$4)<=MSB$1$4);return read$4.bytes=d-a,s}var N1$3=Math.pow(2,7),N2$3=Math.pow(2,14),N3$3=Math.pow(2,21),N4$3=Math.pow(2,28),N5$3=Math.pow(2,35),N6$3=Math.pow(2,42),N7$3=Math.pow(2,49),N8$3=Math.pow(2,56),N9$3=Math.pow(2,63),length$3=function(o){return o[_brrp_varint$3.decode(o,i),_brrp_varint$3.decode.bytes],encodeTo$3=(o,i,s=0)=>(_brrp_varint$3.encode(o,i,s),i),encodingLength$3=o=>_brrp_varint$3.encodingLength(o),create$c=(o,i)=>{const s=i.byteLength,a=encodingLength$3(o),c=a+encodingLength$3(s),d=new Uint8Array(c+s);return encodeTo$3(o,d,0),encodeTo$3(s,d,a),d.set(i,c),new Digest$3(o,s,i,d)},decode$d=o=>{const i=coerce$3(o),[s,a]=decode$e(i),[c,d]=decode$e(i.subarray(a)),f=i.subarray(a+d);if(f.byteLength!==c)throw new Error("Incorrect length");return new Digest$3(s,c,f,i)},equals$5=(o,i)=>{if(o===i)return!0;{const s=i;return o.code===s.code&&o.size===s.size&&s.bytes instanceof Uint8Array&&equals$6(o.bytes,s.bytes)}};let Digest$3=class{constructor(i,s,a,c){this.code=i,this.size=s,this.digest=a,this.bytes=c}};const from$a=({name:o,code:i,encode:s})=>new Hasher$2(o,i,s);let Hasher$2=class{constructor(i,s,a){this.name=i,this.code=s,this.encode=a}digest(i){if(i instanceof Uint8Array){const s=this.encode(i);return s instanceof Uint8Array?create$c(this.code,s):s.then(a=>create$c(this.code,a))}else throw Error("Unknown type, must be binary type")}};const sha$1=o=>async i=>new Uint8Array(await crypto.subtle.digest(o,i)),sha256$1=from$a({name:"sha2-256",code:18,encode:sha$1("SHA-256")});function base$3(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$3=base$3,_brrp__multiformats_scope_baseX$3=src$3;let Encoder$3=class{constructor(i,s,a){this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$3=class{constructor(i,s,a){if(this.name=i,this.prefix=s,s.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s.codePointAt(0),this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$5(this,i)}},ComposedDecoder$3=class{constructor(i){this.decoders=i}or(i){return or$5(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const or$5=(o,i)=>new ComposedDecoder$3({...o.decoders||{[o.prefix]:o},...i.decoders||{[i.prefix]:i}});let Codec$3=class{constructor(i,s,a,c){this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$3(i,s,a),this.decoder=new Decoder$3(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};const from$9=({name:o,prefix:i,encode:s,decode:a})=>new Codec$3(o,i,s,a),baseX$3=({prefix:o,name:i,alphabet:s})=>{const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$3(s,i);return from$9({prefix:o,name:i,encode:a,decode:d=>coerce$3(c(d))})},decode$c=(o,i,s,a)=>{const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f},encode$9=(o,i,s)=>{const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f&&(d+=i[c&g<from$9({prefix:i,name:o,encode(c){return encode$9(c,a,s)},decode(c){return decode$c(c,a,s,o)}}),base58btc$2=baseX$3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});const base32$2=rfc4648$3({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$3({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$3({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$3({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$3({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$3({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$3({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$3({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$3({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const format$2=(o,i)=>{const{bytes:s,version:a}=o;switch(a){case 0:return toStringV0$2(s,baseCache$2(o),i||base58btc$2.encoder);default:return toStringV1$2(s,baseCache$2(o),i||base32$2.encoder)}},cache$3=new WeakMap,baseCache$2=o=>{const i=cache$3.get(o);if(i==null){const s=new Map;return cache$3.set(o,s),s}return i};let CID$2=class be{constructor(i,s,a,c){this.code=s,this.version=i,this.multihash=a,this.bytes=c,this["/"]=c}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:i,multihash:s}=this;if(i!==DAG_PB_CODE$3)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(s.code!==SHA_256_CODE$2)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return be.createV0(s)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:i,digest:s}=this.multihash,a=create$c(i,s);return be.createV1(this.code,a)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(i){return be.equals(this,i)}static equals(i,s){const a=s;return a&&i.code===a.code&&i.version===a.version&&equals$5(i.multihash,a.multihash)}toString(i){return format$2(this,i)}toJSON(){return{"/":format$2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(i){if(i==null)return null;const s=i;if(s instanceof be)return s;if(s["/"]!=null&&s["/"]===s.bytes||s.asCID===s){const{version:a,code:c,multihash:d,bytes:f}=s;return new be(a,c,d,f||encodeCID$2(a,c,d.bytes))}else if(s[cidSymbol$2]===!0){const{version:a,multihash:c,code:d}=s,f=decode$d(c);return be.create(a,d,f)}else return null}static create(i,s,a){if(typeof s!="number")throw new Error("String codecs are no longer supported");if(!(a.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(i){case 0:{if(s!==DAG_PB_CODE$3)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$3}) block encoding`);return new be(i,s,a,a.bytes)}case 1:{const c=encodeCID$2(i,s,a.bytes);return new be(i,s,a,c)}default:throw new Error("Invalid version")}}static createV0(i){return be.create(0,DAG_PB_CODE$3,i)}static createV1(i,s){return be.create(1,i,s)}static decode(i){const[s,a]=be.decodeFirst(i);if(a.length)throw new Error("Incorrect length");return s}static decodeFirst(i){const s=be.inspectBytes(i),a=s.size-s.multihashSize,c=coerce$3(i.subarray(a,a+s.multihashSize));if(c.byteLength!==s.multihashSize)throw new Error("Incorrect length");const d=c.subarray(s.multihashSize-s.digestSize),f=new Digest$3(s.multihashCode,s.digestSize,d,c);return[s.version===0?be.createV0(f):be.createV1(s.codec,f),i.subarray(s.size)]}static inspectBytes(i){let s=0;const a=()=>{const[x,T]=decode$e(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$3;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$2(i,s),d=be.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$2(d).set(a,i),d}};const parseCIDtoBytes$2=(o,i)=>{switch(o[0]){case"Q":{const s=i||base58btc$2;return[base58btc$2.prefix,s.decode(`${base58btc$2.prefix}${o}`)]}case base58btc$2.prefix:{const s=i||base58btc$2;return[base58btc$2.prefix,s.decode(o)]}case base32$2.prefix:{const s=i||base32$2;return[base32$2.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}},toStringV0$2=(o,i,s)=>{const{prefix:a}=s;if(a!==base58btc$2.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c},toStringV1$2=(o,i,s)=>{const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c},DAG_PB_CODE$3=112,SHA_256_CODE$2=18,encodeCID$2=(o,i,s)=>{const a=encodingLength$3(o),c=a+encodingLength$3(i),d=new Uint8Array(c+s.byteLength);return encodeTo$3(o,d,0),encodeTo$3(i,d,a),d.set(s,c),d},cidSymbol$2=Symbol.for("@ipld/js-cid/CID");class Node{constructor(i,s,a){this.id=i,this.children=s,this.metadata=a}}const withWidth=o=>({open:()=>open({width:o}),write:write$1,close:close$4}),defaults$3={width:174},open=({width:o}=defaults$3)=>({width:o,head:null,leafIndex:[],nodeIndex:[],lastID:0}),write$1=(o,i)=>{if(i.length===0)return{layout:o,nodes:EMPTY,leaves:EMPTY};{let{lastID:s}=o;const[a,c]=o.head?[null,(i.unshift(o.head),i)]:i.length===1&&o.leafIndex.length===0?[i[0],EMPTY]:[null,i];if(c.length===0)return{layout:{...o,head:a},nodes:EMPTY,leaves:EMPTY};{const d=[...o.leafIndex],f=[];for(const g of c){const y={id:++s,content:g};f.push(y),d.push(y.id)}return d.length>o.width?flush({...o,leafIndex:d,head:a,lastID:s},f):{layout:{...o,head:a,leafIndex:d,lastID:s},leaves:f,nodes:EMPTY}}}},flush=(o,i=EMPTY,s=[],a=!1)=>{let{lastID:c}=o;const d=o.nodeIndex.map(b=>[...b]),f=[...o.leafIndex],{width:g}=o;for(;f.length>g||f.length>0&&a;){grow(d,1);const b=new Node(++c,f.splice(0,g));d[0].push(b.id),s.push(b)}let y=0;for(;yg||b.length>0&&a&&y{const s=o;if(o.head)return{root:{id:1,content:o.head,metadata:i},leaves:EMPTY,nodes:EMPTY};if(o.leafIndex.length===0)return{root:{id:1,metadata:i},leaves:EMPTY,nodes:EMPTY};{const{nodes:a,layout:c}=flush(s,EMPTY,[],!0),{nodeIndex:d}=c,f=d.length-1,g=d[f];if(g.length===1){const y=a[a.length-1];return a.length=a.length-1,{root:y,nodes:a,leaves:EMPTY}}else return{root:new Node(c.lastID+1,g,i),nodes:a,leaves:EMPTY}}},grow=(o,i)=>{for(;o.length({chunker:FixedSize,fileChunkEncoder:UnixFSLeaf,smallFileEncoder:UnixFSLeaf,fileEncoder:UnixFS,fileLayout:withWidth(174),hasher:sha256$1,linker:{createLink:CID$2.createV1}}),configure$4=o=>({...defaults$2(),...o}),UnixFSLeaf={code:code$1,name:name$2,encode:encodeFileChunk},create$b=({writer:o,metadata:i={},settings:s=defaults$2()})=>new FileWriterView(init(o,i,configure$4(s))),write=async(o,i)=>(await perform(o,send({type:"write",bytes:i})),o),close$3=async(o,{releaseLock:i=!1,closeWriter:s=!1}={})=>{await perform(o,send({type:"close"}));const{state:a}=o;if(a.status==="linked")return s?await o.state.writer.close():i&&o.state.writer.releaseLock(),a.link;panic(`Expected writer to be in 'linked' state after close, but it is in "${a.status}" instead`)},perform=(o,i)=>fork$3(loop(i,s=>{const{state:a,effect:c}=update(s,o.state);return o.state=a,c}));class FileWriterView{constructor(i){this.state=i}get writer(){return this.state.writer}get settings(){return this.state.config}write(i){return write(this,i)}close(i){return close$3(this,i)}}const defaults$1=defaults$2,create$a=({writer:o,settings:i=defaults$1(),metadata:s={}})=>new DirectoryWriter({writer:o,metadata:s,settings:i,entries:new Map,closed:!1}),set$4=(o,i,s,{overwrite:a=!1}={})=>{const c=asWritable$1(o.state);if(i.includes("/"))throw new Error(`Directory entry name "${i}" contains forbidden "/" character`);if(!a&&c.entries.has(i))throw new Error(`Directory already contains entry with name "${i}"`);return c.entries.set(i,s),o},remove$1=(o,i)=>(asWritable$1(o.state).entries.delete(i),o),asWritable$1=o=>{if(o.closed)throw new Error("Can not change written directory, but you can .fork() and make changes to it");return o},close$2=async(o,{closeWriter:i=!1,releaseLock:s=!1}={})=>{const{writer:a,settings:c,metadata:d}=asWritable$1(o.state);o.state.closed=!0;const f=[...links$1(o)],g=createFlatDirectory(f,d),y=encodeDirectory(g),b=await c.hasher.digest(y),$=c.linker.createLink(code$1,b);return(a.desiredSize||0)<=0&&await a.ready,a.write({cid:$,bytes:y}),i?await a.close():s&&a.releaseLock(),{cid:$,dagByteLength:cumulativeDagByteLength(y,f)}},links$1=function*({state:o}){for(const[i,{dagByteLength:s,cid:a}]of o.entries)yield{name:i,dagByteLength:s,cid:a}},fork$2=({state:o},{writer:i=o.writer,metadata:s=o.metadata,settings:a=o.settings}={})=>new DirectoryWriter({writer:i,metadata:s,settings:a,entries:new Map(o.entries.entries()),closed:!1});class DirectoryWriter{constructor(i){this.state=i}get writer(){return this.state.writer}get settings(){return this.state.settings}links(){return links$1(this)}set(i,s,a){return set$4(this,i,s,a)}remove(i){return remove$1(this,i)}fork(i){return fork$2(this,i)}close(i){return close$2(this,i)}entries(){return this.state.entries.entries()}has(i){return this.state.entries.has(i)}get size(){return this.state.entries.size}}const api=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),empty$2=(o=32)=>{if(o!==32)throw new Error(`Uint32 BitField does not support size: ${o}`);return 0},from$8=(o,i)=>{let s=empty$2(i);for(const a of o)s=set$3(s,a);return s},size$1=o=>32,mask=(o,i)=>o>>>i&31,offset=(o,i)=>1<bitCount(o&offset(i,0)-1),set$3=(o,i)=>o|1<o&(255^1<(o>>i&1)!==0,bitCount=o=>{const i=o-(o>>1&1431655765),s=(i&858993459)+(i>>2&858993459);return(s+(s>>4)&252645135)*16843009>>24},and$1=(o,i)=>o&i,or$4=(o,i)=>o|i,toBytes$1=o=>Uint8Array.of(o>>24&255,o>>16&255,o>>8&255,o&255),fromBytes$2=o=>{if(o.length!==4)throw new Error(`Expected 4 bytes instead got ${o.length}`);return(o[0]<<24)+(o[1]<<16)+(o[2]<<8)+o[3]},Uint32BitField=Object.freeze(Object.defineProperty({__proto__:null,API:api,and:and$1,bitCount,empty:empty$2,from:from$8,fromBytes:fromBytes$2,get:get$5,or:or$4,popcount:popcount$1,set:set$3,size:size$1,toBytes:toBytes$1,unset:unset$1},Symbol.toStringTag,{value:"Module"}));var murmurHash3js={exports:{}};(function(o,i){(function(s,a){var c={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function d(S){if(!Array.isArray(S)&&!ArrayBuffer.isView(S))return!1;for(var _=0;_255)return!1;return!0}function f(S,_){return(S&65535)*_+(((S>>>16)*_&65535)<<16)}function g(S,_){return S<<_|S>>>32-_}function y(S){return S^=S>>>16,S=f(S,2246822507),S^=S>>>13,S=f(S,3266489909),S^=S>>>16,S}function b(S,_){S=[S[0]>>>16,S[0]&65535,S[1]>>>16,S[1]&65535],_=[_[0]>>>16,_[0]&65535,_[1]>>>16,_[1]&65535];var C=[0,0,0,0];return C[3]+=S[3]+_[3],C[2]+=C[3]>>>16,C[3]&=65535,C[2]+=S[2]+_[2],C[1]+=C[2]>>>16,C[2]&=65535,C[1]+=S[1]+_[1],C[0]+=C[1]>>>16,C[1]&=65535,C[0]+=S[0]+_[0],C[0]&=65535,[C[0]<<16|C[1],C[2]<<16|C[3]]}function $(S,_){S=[S[0]>>>16,S[0]&65535,S[1]>>>16,S[1]&65535],_=[_[0]>>>16,_[0]&65535,_[1]>>>16,_[1]&65535];var C=[0,0,0,0];return C[3]+=S[3]*_[3],C[2]+=C[3]>>>16,C[3]&=65535,C[2]+=S[2]*_[3],C[1]+=C[2]>>>16,C[2]&=65535,C[2]+=S[3]*_[2],C[1]+=C[2]>>>16,C[2]&=65535,C[1]+=S[1]*_[3],C[0]+=C[1]>>>16,C[1]&=65535,C[1]+=S[2]*_[2],C[0]+=C[1]>>>16,C[1]&=65535,C[1]+=S[3]*_[1],C[0]+=C[1]>>>16,C[1]&=65535,C[0]+=S[0]*_[3]+S[1]*_[2]+S[2]*_[1]+S[3]*_[0],C[0]&=65535,[C[0]<<16|C[1],C[2]<<16|C[3]]}function x(S,_){return _%=64,_===32?[S[1],S[0]]:_<32?[S[0]<<_|S[1]>>>32-_,S[1]<<_|S[0]>>>32-_]:(_-=32,[S[1]<<_|S[0]>>>32-_,S[0]<<_|S[1]>>>32-_])}function T(S,_){return _%=64,_===0?S:_<32?[S[0]<<_|S[1]>>>32-_,S[1]<<_]:[S[1]<<_-32,0]}function A(S,_){return[S[0]^_[0],S[1]^_[1]]}function E(S){return S=A(S,[0,S[0]>>>1]),S=$(S,[4283543511,3981806797]),S=A(S,[0,S[0]>>>1]),S=$(S,[3301882366,444984403]),S=A(S,[0,S[0]>>>1]),S}c.x86.hash32=function(S,_){if(c.inputValidation&&!d(S))return a;_=_||0;for(var C=S.length%4,B=S.length-C,D=_,I=0,L=3432918353,N=461845907,O=0;O>>0},c.x86.hash128=function(S,_){if(c.inputValidation&&!d(S))return a;_=_||0;for(var C=S.length%16,B=S.length-C,D=_,I=_,L=_,N=_,O=0,R=0,z=0,K=0,G=597399067,W=2869860233,J=951274213,ie=2716044179,H=0;H>>0).toString(16)).slice(-8)+("00000000"+(I>>>0).toString(16)).slice(-8)+("00000000"+(L>>>0).toString(16)).slice(-8)+("00000000"+(N>>>0).toString(16)).slice(-8)},c.x64.hash128=function(S,_){if(c.inputValidation&&!d(S))return a;_=_||0;for(var C=S.length%16,B=S.length-C,D=[0,_],I=[0,_],L=[0,0],N=[0,0],O=[2277735313,289559509],R=[1291169091,658871167],z=0;z>>0).toString(16)).slice(-8)+("00000000"+(D[1]>>>0).toString(16)).slice(-8)+("00000000"+(I[0]>>>0).toString(16)).slice(-8)+("00000000"+(I[1]>>>0).toString(16)).slice(-8)},o.exports&&(i=o.exports=c),i.murmurHash3=c})()})(murmurHash3js,murmurHash3js.exports);var murmurHash3jsExports=murmurHash3js.exports,murmurhash3jsRevisited=murmurHash3jsExports;const mur=getDefaultExportFromCjs(murmurhash3jsRevisited),utf8$2=new TextEncoder,hash32=mur.x64.hash126,configure$3=({bitWidth:o=5,hash:i=hash32})=>{if(o>4*8)throw new RangeError(`Can not use bitWidth ${o} which exceeds the hashSize 4`);const a=4294967295>>>32-o;return{at:(f,g)=>f>>>g*o&a,from:f=>i(utf8$2.encode(f)),size:Math.ceil(4*8/o)}};class BitmapIndexedNode{constructor(i,s,a,c,d){this.edit=i,this.config=d,this.datamap=s,this.nodemap=a,this.children=c}get nodeArity(){return this.config.BitField.popcount(this.nodemap)}get dataArity(){return this.config.BitField.popcount(this.datamap)}empty(){return create$9(this.config)}lookup(i,s,a,c){return lookup(this,i,s,a,c)}associate(i,s,a,c,d,f){return associate(this,i,s,a,c,d,f)}dissociate(i,s,a,c,d){return dissociate(this,i,s,a,c,d)}fork(i=null){return fork$1(this,i)}entries(){return entries(this)}keys(){return keys(this)}values(){return values(this)}}class HashCollisionNode{constructor(i,s,a,c){this.edit=i,this.count=s,this.children=a,this.config=c}get nodeArity(){return 0}get dataArity(){return this.count}lookup(i,s,a,c){return lookupCollision(this,a,c)}associate(i,s,a,c,d,f){return associateCollision(this,i,a,c,d,f)}dissociate(i,s,a,c,d){return dissociateCollision(this,i,a,c,d)}fork(i=null){return forkCollision(this,i)}entries(){return entries(this)}keys(){return keys(this)}values(){return values(this)}}const lookupCollision=(o,i,s)=>{const{children:a,count:c}=o,d=findHashCollisionNodeIndex(a,c,i);return a[d]===i?a[d+1]:s},associateCollision=(o,i,s,a,c,d)=>{const{children:f,count:g}=o,y=findHashCollisionNodeIndex(f,g,a);if(f[y]!==a){const b=o.fork(i);return d.value=!0,b.count+=1,b.children.splice(y,s,c),b}else if(f[y+1]!==c){const b=o.fork(i);return b.children[y+1]=c,b}else return o},dissociateCollision=(o,i,s,a,c)=>{const{children:d,count:f,config:g}=o,y=findHashCollisionNodeIndex(d,f,a);if(d[y]!==a)return o;if(c.value=!0,f===2){const b=y===0?2:0;return associate(create$9(g),i,0,s,d[b],d[b+1],c)}else{const b=o.fork(i);return b.children.splice(y,2),b.count-=1,b}},forkCollision=(o,i=null)=>canEdit(o.edit,i)?o:new HashCollisionNode(i,o.count,o.children.slice(),o.config),findHashCollisionNodeIndex=(o,i,s)=>{let a=0;for(;as;)a+=2;return a},create$9=(o,i=null)=>new BitmapIndexedNode(i,o.BitField.empty(Math.pow(2,o.bitWidth)),o.BitField.empty(Math.pow(2,o.bitWidth)),[],o),get$4=(o,i,s)=>lookup(o,0,o.config.Path.from(i),i,s),lookup=(o,i,s,a,c)=>{const{datamap:d,nodemap:f,config:g}=o,{Path:y,BitField:b}=g,$=y.at(s,i);if(b.get(d,$)){const x=b.popcount(d,$);return keyAt(o,x)===a?valueAt(o,x):c}else return b.get(f,$)?resolveNode(o,$).lookup(i+1,s,a,c):c},set$2=(o,i,s,a,c)=>associate(o,i,0,o.config.Path.from(s),s,a,c),associate=(o,i,s,a,c,d,f)=>{const{datamap:g,nodemap:y,config:b}=o,{Path:$,BitField:x}=b,T=$.at(a,s);if(x.get(g,T)){const A=x.popcount(g,T),E=keyAt(o,A);if(c===E)return valueAt(o,A)===d?o:forkAndSet(o,i,A,d);{const S=mergeTwoLeaves(b,i,s+1,$.from(E),E,valueAt(o,A),a,c,d);return f.value=!0,migrateLeafToBranch(o,i,T,S)}}else if(x.get(y,T)){const A=resolveNode(o,T),E=A.associate(i,s+1,a,c,d,f);return A===E?o:copyAndSetChild(o,i,T,E)}else{const A=x.popcount(g,T);f.value=!0;const E=o.fork(i);return E.datamap=x.set(g,T),E.children.splice(keyPosition(A),0,c,d),E}},remove=(o,i,s,a)=>dissociate(o,i,0,o.config.Path.from(s),s,a),dissociate=(o,i,s,a,c,d)=>{const{datamap:f,nodemap:g,config:y}=o,{BitField:b,Path:$}=y,x=$.at(a,s);if(b.get(f,x)){const T=b.popcount(f,x);if(c===keyAt(o,T)){d.value=!0;const A=fork$1(o,i);return A.datamap=b.unset(o.datamap,x),A.children.splice(keyPosition(T),2),A}else return o}else if(b.get(g,x)){const T=resolveNode(o,x),A=T.dissociate(i,s+1,a,c,d);return hasSingleLeaf(A)?hasSingleNode(o)?A:inlineChild(o,i,x,A):T===A?o:copyAndSetChild(o,i,x,A)}else return o},entries=function*({children:o}){let i=0;const s=o.length;for(;icanEdit(o.edit,i)?o:new BitmapIndexedNode(i,o.datamap,o.nodemap,o.children.slice(),o.config),keys=function*({children:o}){let i=0;const s=o.length;for(;i{const c=o.fork(i);return c.children[valuePosition(s)]=a,c},inlineChild=(o,i,s,a)=>{const{datamap:c,nodemap:d,config:f}=o,{BitField:g}=f,y=fork$1(o,i);return y.children.splice(nodePosition(o,s),1),y.children.splice(keyPosition(g.popcount(c,s)),0,a.children[0],a.children[1]),y.datamap=g.set(c,s),y.nodemap=g.unset(d,s),y},copyAndSetChild=(o,i,s,a)=>{const c=fork$1(o,i);return c.children[nodePosition(o,s)]=a,c},migrateLeafToBranch=(o,i,s,a)=>{const{nodemap:c,datamap:d,config:f}=o,{BitField:g}=f,y=g.popcount(d,s),b=keyPosition(y),$=nodePosition(o,s),x=fork$1(o,i);return x.datamap=g.unset(d,s),x.children.splice(b,2),x.nodemap=g.set(c,s),x.children.splice($-1,0,a),x},mergeTwoLeaves=(o,i,s,a,c,d,f,g,y)=>{const{BitField:b,Path:$}=o;if($.sizeo[keyPosition(i)],keyPosition=o=>o*2,valueAt=({children:o},i)=>o[valuePosition(i)],valuePosition=o=>o*2+1,resolveNode=(o,i)=>o.children[nodePosition(o,i)],nodePosition=({children:o,nodemap:i,config:s},a)=>o.length-1-s.BitField.popcount(i,a),canEdit=(o,i)=>o!=null&&o===i,hasSingleLeaf=o=>o.nodeArity===0&&o.dataArity===1,hasSingleNode=({config:{BitField:o},datamap:i,nodemap:s})=>o.popcount(i)===0&&o.popcount(s)===1,empty$1=new Uint8Array(0);function fromHex(o){const i=o.match(/../g);return i!=null?new Uint8Array(i.map(s=>parseInt(s,16))):empty$1}function coerce$2(o){if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")}function base$2(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$2=base$2,_brrp__multiformats_scope_baseX$2=src$2;let Encoder$2=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$2=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$3(this,i)}},ComposedDecoder$2=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$3(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$3(o,i){return new ComposedDecoder$2({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$2=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$2(i,s,a),this.decoder=new Decoder$2(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$7({name:o,prefix:i,encode:s,decode:a}){return new Codec$2(o,i,s,a)}function baseX$2({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$2(s,o);return from$7({prefix:i,name:o,encode:a,decode:d=>coerce$2(c(d))})}function decode$b(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$8(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<=INT$3;)i[s++]=o&255|MSB$3,o/=128;for(;o&MSBALL$3;)i[s++]=o&255|MSB$3,o>>>=7;return i[s]=o|0,encode$7.bytes=s-a+1,i}var decode$a=read$3,MSB$1$3=128,REST$1$3=127;function read$3(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$3.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$3)<=MSB$1$3);return read$3.bytes=d-a,s}var N1$2=Math.pow(2,7),N2$2=Math.pow(2,14),N3$2=Math.pow(2,21),N4$2=Math.pow(2,28),N5$2=Math.pow(2,35),N6$2=Math.pow(2,42),N7$2=Math.pow(2,49),N8$2=Math.pow(2,56),N9$2=Math.pow(2,63),length$2=function(o){return ocreate$8(this.code,a))}else throw Error("Unknown type, must be binary type")}};const murmur364=from$6({name:"murmur3-x64-64",code:34,encode:o=>fromHex(mur.x64.hash128(o)).subarray(0,8)}),utf8$1=new TextEncoder,hash64$1=o=>murmur364.encode(o),configure$2=({bitWidth:o=8,hash:i=hash64$1}={})=>{const s=i(new Uint8Array).byteLength;return{from:d=>i(utf8$1.encode(d)),at:(d,f)=>{const g=f*o;if(g>s)throw new RangeError("Out of bounds");return toInt(d,g,o)},size:Math.ceil(s*8/o)}},toInt=(o,i,s)=>{let a=i/8|0,c=i%8,d=s,f=0;for(;d>0&&a>c&g)>>$;f=(f<{if(o%8!==0)throw new Error("Must be multiple of 8");return new Uint8Array(o/8)},from$5=(o,i)=>{let s=empty(i);for(const a of o){const{byte:c,byteOffset:d,bitOffset:f}=at(s,a);s[d]=c|1<o.byteLength*8,at=(o,i)=>{const s=o.byteLength-1-(i/8|0),a=i%8;return{byte:o[s],byteOffset:s,bitOffset:a}},setByte=(o,i,s)=>{if(o[i]!==s){const a=o.slice(0);return a[i]=s,a}return o},set$1=(o,i)=>{const{byte:s,byteOffset:a,bitOffset:c}=at(o,i);return setByte(o,a,s|1<{const{byte:s,byteOffset:a,bitOffset:c}=at(o,i);return setByte(o,a,s&(255^1<{var{byte:s,bitOffset:a}=at(o,i);return(s>>a&1)!==0},toBytes=o=>o,fromBytes$1=o=>o,popcount=(o,i=o.byteLength*8)=>{const{byteOffset:s,bitOffset:a,byte:c}=at(o,i);let d=popcount$1(c,a),f=o.byteLength-1;for(;f>s;){const g=o[f];d+=bitCount(g),f--}return d},or$2=(o,i)=>{const s=o.slice();let a=0;for(;a{const s=o.slice();let a=0;for(;a({bitWidth:o,BitField:i,Path:s}),from$4=(o,i)=>{const s=builder$1(i);for(const[a,c]of o)s.set(a,c);return s.build()},has=(o,i)=>get$4(o.root,i,NOT_FOUND)!==NOT_FOUND,get$2=(o,i,s=void 0)=>get$4(o.root,i,s),builder$1=o=>{const i={},s=configure$1(o);return new HashMapBuilder(i,0,create$9(s,i),s)};class PersistentHashMap{constructor(i=0,s,a){this.count=i,this.root=s,this.config=a}get size(){return this.count}clone(){return new PersistentHashMap(this.count,this.root,this.config)}empty(){return new PersistentHashMap(0,create$9(this.config,null),this.config)}has(i){return has(this,i)}get(i){return get$4(this.root,i,void 0)}set(i,s){const a={value:!1},c=set$2(this.root,null,i,s,a);return c===this.root?this:new PersistentHashMap(a.value?this.count+1:this.count,c,this.config)}delete(i){const s=remove(this.root,null,i,{value:!1});return s===this.root?this:new PersistentHashMap(this.count-1,s,this.config)}get bitField(){return this.config.BitField.or(this.root.datamap,this.root.nodemap)}[Symbol.iterator](){return this.entries()}entries(){return this.root.entries()}keys(){return this.root.keys()}values(){return this.root.values()}createBuilder(){return new HashMapBuilder({},this.count,this.root,this.config)}}class HashMapBuilder{constructor(i,s,a,c){this.edit=i,this.count=s,this.root=a,this.config=c}get size(){if(this.edit)return this.count;throw new Error(".size was accessed on the finalized builder")}set(i,s){if(this.edit){const a={value:!1},c=set$2(this.root,this.edit,i,s,a);return this.root!==c&&(this.root=c),a.value&&(this.count+=1),this}else throw new Error(".set was called on the finalized builder")}delete(i){if(this.edit){if(this.count===0)return this;const s={value:!1},a=remove(this.root,this.edit,i,s);return a!==this.root&&(this.root=a),s.value&&(this.count-=1),this}else throw new Error(".delete was called on the finalized builder")}build(){if(this.edit)return this.edit=null,new PersistentHashMap(this.count,this.root,this.config);throw new Error(".build was called on the finalized builder")}}const utf8=new TextEncoder,hash64=o=>murmur364.encode(o),configure=({bitWidth:o=8,hash:i=hash64})=>{const s=i(new Uint8Array).byteLength,a={bitWidth:o,hash:i,hashSize:s};return{at:(f,g)=>read$2(f,g,a),from:f=>utf8.encode(f),size:1/0}},read$2=(o,i=0,{bitWidth:s=8,hash:a,hashSize:c})=>{const d=c*8;let f=0,g=s,y=s*i;for(;g>0;){const b=y/d>>0,$=a(b===0?o:appendByte(o,b)),x=d<=y?y%d:y,T=d-x,A=T{const s=new Uint8Array(o.byteLength+1).fill(i,o.byteLength);return s.set(o),s},bitWidth=8,config={bitWidth,Path:configure({bitWidth})},tableSize=o=>Math.pow(2,o.config.bitWidth),builder=(o=config)=>builder$1(o),from$3=(o,i=config)=>from$4(o,i),bitField=({datamap:o,nodemap:i,config:{BitField:s}})=>withoutLeadingZeros(s.toBytes(s.or(o,i))),withoutLeadingZeros=o=>{let i=0;for(;i`[${JSON.stringify(f)}]`).join("")}`);const d=CID$2.asCID(s);if(d)return{value:d,remaining:i.slice(a+1).join("/")}}return{value:s}}class Block{constructor({cid:i,bytes:s,value:a}){if(!i||!s||typeof a>"u")throw new Error("Missing required argument");this.cid=i,this.bytes=s,this.value=a,this.asBlock=this,Object.defineProperties(this,{cid:readonly(),bytes:readonly(),value:readonly(),asBlock:readonly()})}links(){return links(this.value,[])}tree(){return tree(this.value,[])}get(i="/"){return get$1(this.value,i.split("/").filter(Boolean))}}const defaults=defaults$2,create$7=({writer:o,settings:i=defaults(),metadata:s={}})=>new HAMTDirectoryWriter({writer:o,metadata:s,settings:i,entries:new HashMap,closed:!1}),asWritable=o=>{if(o.closed)throw new Error("Can not change written HAMT directory, but you can .fork() and make changes to it");return o},close$1=async(o,{closeWriter:i=!1,releaseLock:s=!1}={})=>{const{writer:a,settings:c,metadata:d}=asWritable(o.state);o.state.closed=!0;const{entries:f}=o.state;if(!(f instanceof HashMap))throw new Error(`not a HAMT: ${f}`);const g=f.builder.build(),y=iterateBlocks(g,g.root,c);let b=null;for await(const $ of y)b=$,(a.desiredSize||0)<=0&&await a.ready,a.write($);if(b==null)throw new Error("no root block yielded");return i?await a.close():s&&a.releaseLock(),{cid:b.cid,dagByteLength:cumulativeDagByteLength(b.bytes,b.value.entries)}},iterateBlocks=async function*(o,i,s){const a=[];for(const d of iterate(i))if("key"in d)a.push({name:`${d.prefix??""}${d.key??""}`,dagByteLength:d.value.dagByteLength,cid:d.value.cid});else{let f=null;for await(const g of iterateBlocks(o,d.node,s))yield g,f=g;if(f==null)throw new Error("no root block yielded");a.push({name:d.prefix,dagByteLength:cumulativeDagByteLength(f.bytes,f.value.entries),cid:f.cid})}const c=createDirectoryShard(a,bitField(i),tableSize(o),murmur364.code);yield await encodeHAMTShardBlock(c,s)};async function encodeHAMTShardBlock(o,i){const s=encodeHAMTShard(o),a=await i.hasher.digest(s),c=i.linker.createLink(code$2,a);return new Block({cid:c,bytes:s,value:o})}const fork=({state:o},{writer:i=o.writer,metadata:s=o.metadata,settings:a=o.settings}={})=>new HAMTDirectoryWriter({writer:i,metadata:s,settings:a,entries:new HashMap(from$3(o.entries.entries()).createBuilder()),closed:!1});class HAMTDirectoryWriter{constructor(i){this.state=i}get writer(){return this.state.writer}get settings(){return this.state.settings}set(i,s,a){return set$4(this,i,s,a)}remove(i){return remove$1(this,i)}fork(i){return fork(this,i)}close(i){return close$1(this,i)}entries(){return this.state.entries.entries()}has(i){return this.state.entries.has(i)}get size(){return this.state.entries.size}}class HashMap extends Map{constructor(i=builder()){super(),this.builder=i}clear(){this.builder=builder()}delete(i){const{root:s}=this.builder;return this.builder.delete(i),this.builder.root!==s}forEach(i,s=this){for(const[a,c]of this.builder.root.entries())i.call(s,c,a,this)}get(i){return get$2(this.builder,i)}has(i){return has(this.builder,i)}set(i,s){return this.builder.set(i,s),this}get size(){return this.builder.size}[Symbol.iterator](){return this.builder.root.entries()}entries(){return this.builder.root.entries()}keys(){return this.builder.root.keys()}values(){return this.builder.root.values()}}const createWriter=({writable:o,settings:i=defaults$2()})=>new FileSystemWriter({writer:o.getWriter(),settings:i}),close=async(o,{releaseLock:i=!0,closeWriter:s=!0}={})=>(s?await o.writer.close():i&&o.writer.releaseLock(),o);class FileSystemWriter{constructor({writer:i,settings:s}){this.writer=i,this.settings=configure$4(s)}createFileWriter({settings:i=this.settings,metadata:s}={}){return create$b({writer:this.writer,settings:i,metadata:s})}createDirectoryWriter({settings:i=this.settings,metadata:s}={}){return create$a({writer:this.writer,settings:i,metadata:s})}close(i){return close(this,i)}}const BLOCK_SIZE_LIMIT=1048576,defaultCapacity=BLOCK_SIZE_LIMIT*100,withCapacity=(o=defaultCapacity)=>({highWaterMark:o,size:i=>i.bytes.length}),SHARD_THRESHOLD=1e3,queuingStrategy=withCapacity(),defaultSettings=configure$4({fileChunkEncoder:raw,smallFileEncoder:raw,chunker:withMaxChunkSize(1024*1024),fileLayout:withWidth(1024)});function createFileEncoderStream(o,i){const{readable:s,writable:a}=new TransformStream({},queuingStrategy),c=(i==null?void 0:i.settings)??defaultSettings,d=createWriter({writable:a,settings:c}),f=new UnixFSFileBuilder("",o);return(async()=>(await f.finalize(d),await d.close()))(),s}var wt;class UnixFSFileBuilder{constructor(i,s){Y(this,wt);this.name=i,Q(this,wt,s)}async finalize(i){const s=create$b(i);return await F(this,wt).stream().pipeTo(new WritableStream({async write(a){await s.write(a)}})),await s.close()}}wt=new WeakMap;var ot;class UnixFSDirectoryBuilder{constructor(i,s){Y(this,ot);U(this,"entries",new Map);this.name=i,Q(this,ot,s)}async finalize(i){var a;const s=this.entries.size<=SHARD_THRESHOLD?create$a(i):create$7(i);for(const[c,d]of this.entries){const f=await d.finalize(i);(a=F(this,ot))!=null&&a.onDirectoryEntryLink&&F(this,ot).onDirectoryEntryLink({name:d.name,...f}),s.set(c,f)}return await s.close()}}ot=new WeakMap;function createDirectoryEncoderStream(o,i){const s=new UnixFSDirectoryBuilder("",i);for(const g of o){const y=g.name.split("/");(y[0]===""||y[0]===".")&&y.shift();let b=s;for(const[$,x]of y.entries()){if($===y.length-1){b.entries.set(x,new UnixFSFileBuilder(y.join("/"),g));break}let T=b.entries.get(x);if(T==null){const A=b===s?x:`${b.name}/${x}`;T=new UnixFSDirectoryBuilder(A,i),b.entries.set(x,T)}if(!(T instanceof UnixFSDirectoryBuilder))throw new Error(`"${g.name}" cannot be a file and a directory`);b=T}}const{readable:a,writable:c}=new TransformStream({},queuingStrategy),d=(i==null?void 0:i.settings)??defaultSettings,f=createWriter({writable:c,settings:d});return(async()=>{const g=await s.finalize(f);i!=null&&i.onDirectoryEntryLink&&i.onDirectoryEntryLink({name:"",...g}),await f.close()})(),a}async function readHeader(o,i){const s=decodeVarint$1(await o.upTo(8),o);if(s===0)throw new Error("Invalid CAR header (zero length)");const a=await o.exactly(s,!0),c=decode$1a(a);if(CarV1HeaderOrV2Pragma.toTyped(c)===void 0)throw new Error("Invalid CAR header format");if(c.version!==1&&c.version!==2||i!==void 0&&c.version!==i)throw new Error(`Invalid CAR version: ${c.version}${i!==void 0?` (expected ${i})`:""}`);if(c.version===1){if(!Array.isArray(c.roots))throw new Error("Invalid CAR header format");return c}if(c.roots!==void 0)throw new Error("Invalid CAR header format");const d=decodeV2Header(await o.exactly(V2_HEADER_LENGTH,!0));o.seek(d.dataOffset-o.pos);const f=await readHeader(o,1);return Object.assign(f,d)}async function readCid(o){const i=await o.exactly(2,!1);if(i[0]===CIDV0_BYTES$1.SHA2_256&&i[1]===CIDV0_BYTES$1.LENGTH){const f=await o.exactly(34,!0),g=decode$O(f);return CID$6.create(0,CIDV0_BYTES$1.DAG_PB,g)}const s=decodeVarint$1(await o.upTo(8),o);if(s!==1)throw new Error(`Unexpected CID version (${s})`);const a=decodeVarint$1(await o.upTo(8),o),c=await o.exactly(getMultihashLength$1(await o.upTo(8)),!0),d=decode$O(c);return CID$6.create(s,a,d)}async function readBlockHead(o){const i=o.pos;let s=decodeVarint$1(await o.upTo(8),o);if(s===0)throw new Error("Invalid CAR section (zero length)");s+=o.pos-i;const a=await readCid(o),c=s-Number(o.pos-i);return{cid:a,length:s,blockLength:c}}async function readBlock(o){const{cid:i,blockLength:s}=await readBlockHead(o);return{bytes:await o.exactly(s,!0),cid:i}}async function readBlockIndex(o){const i=o.pos,{cid:s,length:a,blockLength:c}=await readBlockHead(o),d={cid:s,length:a,blockLength:c,offset:i,blockOffset:o.pos};return o.seek(d.blockLength),d}function createDecoder(o){const i=(async()=>{const s=await readHeader(o);if(s.version===2){const a=o.pos-s.dataOffset;o=limitReader(o,s.dataSize-a)}return s})();return{header:()=>i,async*blocks(){for(await i;(await o.upTo(8)).length>0;)yield await readBlock(o)},async*blocksIndex(){for(await i;(await o.upTo(8)).length>0;)yield await readBlockIndex(o)}}}function bytesReader(o){let i=0;return{async upTo(s){return o.subarray(i,i+Math.min(s,o.length-i))},async exactly(s,a=!1){if(s>o.length-i)throw new Error("Unexpected end of data");const c=o.subarray(i,i+s);return a&&(i+=s),c},seek(s){i+=s},get pos(){return i}}}function chunkReader(o){let i=0,s=0,a=0,c=new Uint8Array(0);const d=async f=>{s=c.length-a;const g=[c.subarray(a)];for(;ss&&g.push(b.subarray(-s)):g.push(b),s+=b.length}c=new Uint8Array(g.reduce((b,$)=>b+$.length,0));let y=0;for(const b of g)c.set(b,y),y+=b.length;a=0};return{async upTo(f){return c.length-ai&&(c=c.subarray(0,i-s)),c},async exactly(a,c=!1){const d=await o.exactly(a,c);if(d.length+s>i)throw new Error("Unexpected end of data");return c&&(s+=a),d},seek(a){s+=a,o.seek(a)},get pos(){return o.pos}}}class CarIteratorBase{constructor(i,s,a){this._version=i,this._roots=s,this._iterable=a,this._decoded=!1}get version(){return this._version}async getRoots(){return this._roots}}class CarBlockIterator extends CarIteratorBase{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");return this._decoded=!0,this._iterable[Symbol.asyncIterator]()}static async fromBytes(i){const{version:s,roots:a,iterator:c}=await fromBytes(i);return new CarBlockIterator(s,a,c)}static async fromIterable(i){const{version:s,roots:a,iterator:c}=await fromIterable(i);return new CarBlockIterator(s,a,c)}}async function fromBytes(o){if(!(o instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return decodeIterator(bytesReader(o))}async function fromIterable(o){if(!o||typeof o[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return decodeIterator(asyncIterableReader(o))}async function decodeIterator(o){const i=createDecoder(o),{version:s,roots:a}=await i.header();return{version:s,roots:a,iterator:i.blocks()}}const CAR_V1_VERSION=1;function createHeader(o){const i=encode$O({version:CAR_V1_VERSION,roots:o}),s=varint$a.encode(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a}function createEncoder(o){return{async setRoots(i){const s=createHeader(i);await o.write(s)},async writeBlock(i){const{cid:s,bytes:a}=i;await o.write(new Uint8Array(varint$a.encode(s.bytes.length+a.length))),await o.write(s.bytes),a.length&&await o.write(a)},async close(){await o.end()},version(){return CAR_V1_VERSION}}}function noop(){}function create$6(){const o=[];let i=null,s=noop,a=!1,c=null,d=noop;const f=()=>(i||(i=new Promise(b=>{s=()=>{i=null,s=noop,b()}})),i),g={write(b){o.push(b);const $=f();return d(),$},async end(){a=!0;const b=f();d(),await b}},y={async next(){const b=o.shift();return b?(o.length===0&&s(),{done:!1,value:b}):a?(s(),{done:!0,value:void 0}):(c||(c=new Promise($=>{d=()=>(c=null,d=noop,$(y.next()))})),c)}};return{writer:g,iterator:y}}class CarWriter{constructor(i,s){this._encoder=s,this._mutex=s.setRoots(i),this._ended=!1}async put(i){if(!(i.bytes instanceof Uint8Array)||!i.cid)throw new TypeError("Can only write {cid, bytes} objects");if(this._ended)throw new Error("Already closed");const s=CID$6.asCID(i.cid);if(!s)throw new TypeError("Can only write {cid, bytes} objects");return this._mutex=this._mutex.then(()=>this._encoder.writeBlock({cid:s,bytes:i.bytes})),this._mutex}async close(){if(this._ended)throw new Error("Already closed");return await this._mutex,this._ended=!0,this._encoder.close()}version(){return this._encoder.version()}static create(i){i=toRoots(i);const{encoder:s,iterator:a}=encodeWriter(),c=new CarWriter(i,s),d=new CarWriterOut(a);return{writer:c,out:d}}static createAppender(){const{encoder:i,iterator:s}=encodeWriter();i.setRoots=()=>Promise.resolve();const a=new CarWriter([],i),c=new CarWriterOut(s);return{writer:a,out:c}}static async updateRootsInBytes(i,s){const a=bytesReader(i);await readHeader(a);const c=createHeader(s);if(Number(a.pos)!==c.length)throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${a.pos} bytes, new header is ${c.length} bytes)`);return i.set(c,0),i}}class CarWriterOut{constructor(i){this._iterator=i}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}}function encodeWriter(){const o=create$6(),{writer:i,iterator:s}=o;return{encoder:createEncoder(i),iterator:s}}function toRoots(o){if(o===void 0)return[];if(!Array.isArray(o)){const s=CID$6.asCID(o);if(!s)throw new TypeError("roots must be a single CID or an array of CIDs");return[s]}const i=[];for(const s of o){const a=CID$6.asCID(s);if(!a)throw new TypeError("roots must be a single CID or an array of CIDs");i.push(a)}return i}const code=514,NO_ROOTS_HEADER_LENGTH=18;function headerEncodingLength(o){if(!o)return NO_ROOTS_HEADER_LENGTH;const i=encode$O({version:1,roots:[o]}).length;return varint$a.encodingLength(i)+i}function blockHeaderEncodingLength(o){const i=o.cid.bytes.length+o.bytes.length;return varint$a.encodingLength(i)+o.cid.bytes.length}function blockEncodingLength(o){return blockHeaderEncodingLength(o)+o.bytes.length}async function encode$6(o,i){const{writer:s,out:a}=CarWriter.create(i);let c;(async()=>{try{for await(const g of o)await s.put(g)}catch(g){c=g}finally{await s.close()}})();const d=[];for await(const g of a)d.push(g);if(c!=null)throw c;const f=i!=null?[i]:[];return Object.assign(new Blob(d),{version:1,roots:f})}class BlockStream extends ReadableStream{constructor(i){let s=null;const a=()=>s||(s=CarBlockIterator.fromIterable(toIterable(i.stream())),s);let c=null;super({async start(){c=(await a())[Symbol.asyncIterator]()},async pull(d){if(!c)throw new Error("missing blocks iterator");const{value:f,done:g}=await c.next();if(g)return d.close();d.enqueue(f)}}),this.getRoots=async()=>await(await a()).getRoots()}}function toIterable(o){return Symbol.asyncIterator in o?o:async function*(){const i=o.getReader();try{for(;;){const{done:s,value:a}=await i.read();if(s)return;yield a}}finally{i.releaseLock()}}()}function compare(o,i){for(let s=0;si[s])return 1}return o.byteLength>i.byteLength?1:o.byteLength=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$1=base$1,_brrp__multiformats_scope_baseX$1=src$1;let Encoder$1=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$1=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$1(this,i)}},ComposedDecoder$1=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$1(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$1(o,i){return new ComposedDecoder$1({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$1=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$1(i,s,a),this.decoder=new Decoder$1(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$2({name:o,prefix:i,encode:s,decode:a}){return new Codec$1(o,i,s,a)}function baseX$1({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$1(s,o);return from$2({prefix:i,name:o,encode:a,decode:d=>coerce$1(c(d))})}function decode$9(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$5(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<(o[s]=i,o),[]),alphabetCharsToBytes=alphabet.reduce((o,i,s)=>{const a=i.codePointAt(0);if(a==null)throw new Error(`Invalid character: ${i}`);return o[a]=s,o},[]);function encode$4(o){return o.reduce((i,s)=>(i+=alphabetBytesToChars[s],i),"")}function decode$8(o){const i=[];for(const s of o){const a=s.codePointAt(0);if(a==null)throw new Error(`Invalid character: ${s}`);const c=alphabetCharsToBytes[a];if(c==null)throw new Error(`Non-base256emoji character: ${s}`);i.push(c)}return new Uint8Array(i)}from$2({prefix:"🚀",name:"base256emoji",encode:encode$4,decode:decode$8});const base32$1=rfc4648$1({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$1({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$1({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$1({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$1({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$1({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$1({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$1({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$1({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const base36$1=baseX$1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"});baseX$1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});const base58btc$1=baseX$1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});rfc4648$1({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});rfc4648$1({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6});rfc4648$1({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6});rfc4648$1({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});rfc4648$1({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});from$2({prefix:"\0",name:"identity",encode:o=>toString(o),decode:o=>fromString(o)});new TextEncoder;new TextDecoder;var encode_1$1=encode$3,MSB$2=128,REST$2=127,MSBALL$2=~REST$2,INT$2=Math.pow(2,31);function encode$3(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$2;)i[s++]=o&255|MSB$2,o/=128;for(;o&MSBALL$2;)i[s++]=o&255|MSB$2,o>>>=7;return i[s]=o|0,encode$3.bytes=s-a+1,i}var decode$7=read$1,MSB$1$2=128,REST$1$2=127;function read$1(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$1.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$2)<=MSB$1$2);return read$1.bytes=d-a,s}var N1$1=Math.pow(2,7),N2$1=Math.pow(2,14),N3$1=Math.pow(2,21),N4$1=Math.pow(2,28),N5$1=Math.pow(2,35),N6$1=Math.pow(2,42),N7$1=Math.pow(2,49),N8$1=Math.pow(2,56),N9$1=Math.pow(2,63),length$1=function(o){return ocreate$5(this.code,a))}else throw Error("Unknown type, must be binary type")}}function sha(o){return async i=>new Uint8Array(await crypto.subtle.digest(o,i))}const sha256=from$1({name:"sha2-256",code:18,encode:sha("SHA-256")});function format$1(o,i){const{bytes:s,version:a}=o;switch(a){case 0:return toStringV0$1(s,baseCache$1(o),i??base58btc$1.encoder);default:return toStringV1$1(s,baseCache$1(o),i??base32$1.encoder)}}const cache$2=new WeakMap;function baseCache$1(o){const i=cache$2.get(o);if(i==null){const s=new Map;return cache$2.set(o,s),s}return i}var Yt;let CID$1=class we{constructor(i,s,a,c){U(this,"code");U(this,"version");U(this,"multihash");U(this,"bytes");U(this,"/");U(this,Yt,"CID");this.code=s,this.version=i,this.multihash=a,this.bytes=c,this["/"]=c}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:i,multihash:s}=this;if(i!==DAG_PB_CODE$2)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(s.code!==SHA_256_CODE$1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return we.createV0(s)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:i,digest:s}=this.multihash,a=create$5(i,s);return we.createV1(this.code,a)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(i){return we.equals(this,i)}static equals(i,s){const a=s;return a!=null&&i.code===a.code&&i.version===a.version&&equals$3(i.multihash,a.multihash)}toString(i){return format$1(this,i)}toJSON(){return{"/":format$1(this)}}link(){return this}[(Yt=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(i){if(i==null)return null;const s=i;if(s instanceof we)return s;if(s["/"]!=null&&s["/"]===s.bytes||s.asCID===s){const{version:a,code:c,multihash:d,bytes:f}=s;return new we(a,c,d,f??encodeCID$1(a,c,d.bytes))}else if(s[cidSymbol$1]===!0){const{version:a,multihash:c,code:d}=s,f=decode$5(c);return we.create(a,d,f)}else return null}static create(i,s,a){if(typeof s!="number")throw new Error("String codecs are no longer supported");if(!(a.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(i){case 0:{if(s!==DAG_PB_CODE$2)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$2}) block encoding`);return new we(i,s,a,a.bytes)}case 1:{const c=encodeCID$1(i,s,a.bytes);return new we(i,s,a,c)}default:throw new Error("Invalid version")}}static createV0(i){return we.create(0,DAG_PB_CODE$2,i)}static createV1(i,s){return we.create(1,i,s)}static decode(i){const[s,a]=we.decodeFirst(i);if(a.length!==0)throw new Error("Incorrect length");return s}static decodeFirst(i){const s=we.inspectBytes(i),a=s.size-s.multihashSize,c=coerce$1(i.subarray(a,a+s.multihashSize));if(c.byteLength!==s.multihashSize)throw new Error("Incorrect length");const d=c.subarray(s.multihashSize-s.digestSize),f=new Digest$1(s.multihashCode,s.digestSize,d,c);return[s.version===0?we.createV0(f):we.createV1(s.codec,f),i.subarray(s.size)]}static inspectBytes(i){let s=0;const a=()=>{const[x,T]=decode$6(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$2;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$1(i,s),d=we.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$1(d).set(a,i),d}};function parseCIDtoBytes$1(o,i){switch(o[0]){case"Q":{const s=i??base58btc$1;return[base58btc$1.prefix,s.decode(`${base58btc$1.prefix}${o}`)]}case base58btc$1.prefix:{const s=i??base58btc$1;return[base58btc$1.prefix,s.decode(o)]}case base32$1.prefix:{const s=i??base32$1;return[base32$1.prefix,s.decode(o)]}case base36$1.prefix:{const s=i??base36$1;return[base36$1.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}}function toStringV0$1(o,i,s){const{prefix:a}=s;if(a!==base58btc$1.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c}function toStringV1$1(o,i,s){const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c}const DAG_PB_CODE$2=112,SHA_256_CODE$1=18;function encodeCID$1(o,i,s){const a=encodingLength$1(o),c=a+encodingLength$1(i),d=new Uint8Array(c+s.byteLength);return encodeTo$1(o,d,0),encodeTo$1(i,d,a),d.set(s,c),d}const cidSymbol$1=Symbol.for("@ipld/js-cid/CID");function create$4(o,i){return CID$1.create(1,o,i)}const cache$1=new WeakMap,toBase58String=o=>{let i=cache$1.get(o.bytes);return i||(i=base58btc$1.encode(o.bytes),cache$1.set(o.bytes,i)),i};var ve;class DigestMap{constructor(i){Y(this,ve);Q(this,ve,new Map);for(const[s,a]of i??[])this.set(s,a)}get[Symbol.toStringTag](){return"DigestMap"}clear(){F(this,ve).clear()}delete(i){const s=toBase58String(i);return F(this,ve).delete(s)}forEach(i,s){for(const[a,c]of F(this,ve).values())i.call(s,c,a,this)}get(i){const s=F(this,ve).get(toBase58String(i));if(s)return s[1]}has(i){return F(this,ve).has(toBase58String(i))}set(i,s){return F(this,ve).set(toBase58String(i),[i,s]),this}get size(){return F(this,ve).size}[Symbol.iterator](){return this.entries()}*entries(){yield*F(this,ve).values()}*keys(){for(const[i]of F(this,ve).values())yield i}*values(){for(const[,i]of F(this,ve).values())yield i}}ve=new WeakMap;const version="index/sharded/dag@0.1";variant({[version]:struct({content:match$2(),shards:array(match$2())})});var $t,Ke;class ShardedDAGIndex{constructor(i){Y(this,$t);Y(this,Ke);Q(this,$t,i),Q(this,Ke,new DigestMap)}get content(){return F(this,$t)}get shards(){return F(this,Ke)}setSlice(i,s,a){let c=F(this,Ke).get(i);c||(c=new DigestMap,F(this,Ke).set(i,c)),c.set(s,a)}archive(){return archive$1(this)}}$t=new WeakMap,Ke=new WeakMap;const create$3=o=>new ShardedDAGIndex(o),archive$1=async o=>{const i=new Map,s=[...o.shards.entries()].sort((g,y)=>compare(g[0].digest,y[0].digest)),a={content:o.content,shards:[]};for(const g of s){const y=[...g[1].entries()].sort((T,A)=>compare(T[0].digest,A[0].digest)).map(T=>[T[0].bytes,T[1]]),b=encode$O([g[0].bytes,y]),$=await sha256.digest(b),x=create$4(code$h,$);i.set(x.toString(),{cid:x,bytes:b}),a.shards.push(x)}const c=encode$O({[version]:a}),d=await sha256.digest(c),f=create$4(code$h,d);return ok(encode$v({roots:[{cid:f,bytes:c}],blocks:i}))};function alloc(o=0){return new Uint8Array(o)}function allocUnsafe(o=0){return new Uint8Array(o)}function asUint8Array(o){return o}function concat(o,i){i==null&&(i=o.reduce((c,d)=>c+d.length,0));const s=allocUnsafe(i);let a=0;for(const c of o)s.set(c,a),a+=c.length;return s}function equals$2(o,i){if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s0&&this.appendAll(i)}*[(Jt=symbol,Symbol.iterator)](){yield*this.bufs}get byteLength(){return this.length}append(...i){this.appendAll(i)}appendAll(i){let s=0;for(const a of i)if(a instanceof Uint8Array)s+=a.byteLength,this.bufs.push(a);else if(isUint8ArrayList(a))s+=a.byteLength,this.bufs.push(...a.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=s}prepend(...i){this.prependAll(i)}prependAll(i){let s=0;for(const a of i.reverse())if(a instanceof Uint8Array)s+=a.byteLength,this.bufs.unshift(a);else if(isUint8ArrayList(a))s+=a.byteLength,this.bufs.unshift(...a.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=s}get(i){const s=findBufAndOffset(this.bufs,i);return s.buf[s.index]}set(i,s){const a=findBufAndOffset(this.bufs,i);a.buf[a.index]=s}write(i,s=0){if(i instanceof Uint8Array)for(let a=0;a0;)if(i>=this.bufs[0].byteLength)i-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(i),this.length-=i;break}}}slice(i,s){const{bufs:a,length:c}=this._subList(i,s);return concat(a,c)}subarray(i,s){const{bufs:a,length:c}=this._subList(i,s);return a.length===1?a[0]:concat(a,c)}sublist(i,s){const{bufs:a,length:c}=this._subList(i,s),d=new Uint8ArrayList;return d.length=c,d.bufs=[...a],d}_subList(i,s){if(i=i??0,s=s??this.length,i<0&&(i=this.length+i),s<0&&(s=this.length+s),i<0||s>this.length)throw new RangeError("index is out of bounds");if(i===s)return{bufs:[],length:0};if(i===0&&s===this.length)return{bufs:this.bufs,length:this.length};const a=[];let c=0;for(let d=0;d=y)continue;const b=i>=g&&ig&&s<=y;if(b&&$){if(i===g&&s===y){a.push(f);break}const x=i-g;a.push(f.subarray(x,x+(s-i)));break}if(b){if(i===0){a.push(f);continue}a.push(f.subarray(i-g));continue}if($){if(s===y){a.push(f);break}a.push(f.subarray(0,s-g));break}a.push(f)}return{bufs:a,length:s-i}}indexOf(i,s=0){if(!isUint8ArrayList(i)&&!(i instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const a=i instanceof Uint8Array?i:i.subarray();if(s=Number(s??0),isNaN(s)&&(s=0),s<0&&(s=this.length+s),s<0&&(s=0),i.length===0)return s>this.length?this.length:s;const c=a.byteLength;if(c===0)throw new TypeError("search must be at least 1 byte long");const d=256,f=new Int32Array(d);for(let x=0;x=0;T--){const A=this.get(x+T);if(a[T]!==A){$=Math.max(1,T-g[A]);break}}if($===0)return x}return-1}getInt8(i){const s=this.subarray(i,i+1);return new DataView(s.buffer,s.byteOffset,s.byteLength).getInt8(0)}setInt8(i,s){const a=allocUnsafe(1);new DataView(a.buffer,a.byteOffset,a.byteLength).setInt8(0,s),this.write(a,i)}getInt16(i,s){const a=this.subarray(i,i+2);return new DataView(a.buffer,a.byteOffset,a.byteLength).getInt16(0,s)}setInt16(i,s,a){const c=alloc(2);new DataView(c.buffer,c.byteOffset,c.byteLength).setInt16(0,s,a),this.write(c,i)}getInt32(i,s){const a=this.subarray(i,i+4);return new DataView(a.buffer,a.byteOffset,a.byteLength).getInt32(0,s)}setInt32(i,s,a){const c=alloc(4);new DataView(c.buffer,c.byteOffset,c.byteLength).setInt32(0,s,a),this.write(c,i)}getBigInt64(i,s){const a=this.subarray(i,i+8);return new DataView(a.buffer,a.byteOffset,a.byteLength).getBigInt64(0,s)}setBigInt64(i,s,a){const c=alloc(8);new DataView(c.buffer,c.byteOffset,c.byteLength).setBigInt64(0,s,a),this.write(c,i)}getUint8(i){const s=this.subarray(i,i+1);return new DataView(s.buffer,s.byteOffset,s.byteLength).getUint8(0)}setUint8(i,s){const a=allocUnsafe(1);new DataView(a.buffer,a.byteOffset,a.byteLength).setUint8(0,s),this.write(a,i)}getUint16(i,s){const a=this.subarray(i,i+2);return new DataView(a.buffer,a.byteOffset,a.byteLength).getUint16(0,s)}setUint16(i,s,a){const c=alloc(2);new DataView(c.buffer,c.byteOffset,c.byteLength).setUint16(0,s,a),this.write(c,i)}getUint32(i,s){const a=this.subarray(i,i+4);return new DataView(a.buffer,a.byteOffset,a.byteLength).getUint32(0,s)}setUint32(i,s,a){const c=alloc(4);new DataView(c.buffer,c.byteOffset,c.byteLength).setUint32(0,s,a),this.write(c,i)}getBigUint64(i,s){const a=this.subarray(i,i+8);return new DataView(a.buffer,a.byteOffset,a.byteLength).getBigUint64(0,s)}setBigUint64(i,s,a){const c=alloc(8);new DataView(c.buffer,c.byteOffset,c.byteLength).setBigUint64(0,s,a),this.write(c,i)}getFloat32(i,s){const a=this.subarray(i,i+4);return new DataView(a.buffer,a.byteOffset,a.byteLength).getFloat32(0,s)}setFloat32(i,s,a){const c=alloc(4);new DataView(c.buffer,c.byteOffset,c.byteLength).setFloat32(0,s,a),this.write(c,i)}getFloat64(i,s){const a=this.subarray(i,i+8);return new DataView(a.buffer,a.byteOffset,a.byteLength).getFloat64(0,s)}setFloat64(i,s,a){const c=alloc(8);new DataView(c.buffer,c.byteOffset,c.byteLength).setFloat64(0,s,a),this.write(c,i)}equals(i){if(i==null||!(i instanceof Uint8ArrayList)||i.bufs.length!==this.bufs.length)return!1;for(let s=0;sc+d.byteLength,0)),a.length=s,a}}function equals$1(o,i){if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s=INT$1;)i[s++]=o&255|MSB$1,o/=128;for(;o&MSBALL$1;)i[s++]=o&255|MSB$1,o>>>=7;return i[s]=o|0,encode$2.bytes=s-a+1,i}var decode$4=read,MSB$1$1=128,REST$1$1=127;function read(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$1)<=MSB$1$1);return read.bytes=d-a,s}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function(o){return o=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src=base,_brrp__multiformats_scope_baseX=src;class Encoder{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or(this,i)}}class ComposedDecoder{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}function or(o,i){return new ComposedDecoder({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}class Codec{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder(i,s,a),this.decoder=new Decoder(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}}function from({name:o,prefix:i,encode:s,decode:a}){return new Codec(o,i,s,a)}function baseX({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX(s,o);return from({prefix:i,name:o,encode:a,decode:d=>coerce(c(d))})}function decode$1(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$1(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<{const[x,T]=decode$3(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$1;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes(i,s),d=CID.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(d).set(a,i),d}}function parseCIDtoBytes(o,i){switch(o[0]){case"Q":{const s=i??base58btc;return[base58btc.prefix,s.decode(`${base58btc.prefix}${o}`)]}case base58btc.prefix:{const s=i??base58btc;return[base58btc.prefix,s.decode(o)]}case base32.prefix:{const s=i??base32;return[base32.prefix,s.decode(o)]}case base36.prefix:{const s=i??base36;return[base36.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}}function toStringV0(o,i,s){const{prefix:a}=s;if(a!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c}function toStringV1(o,i,s){const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c}const DAG_PB_CODE$1=112,SHA_256_CODE=18;function encodeCID(o,i,s){const a=encodingLength(o),c=a+encodingLength(i),d=new Uint8Array(c+s.byteLength);return encodeTo(o,d,0),encodeTo(i,d,a),d.set(s,c),d}const cidSymbol=Symbol.for("@ipld/js-cid/CID"),DAG_PB_CODE=112;function createLegacy(o){return CID.create(0,DAG_PB_CODE,o)}function create$1(o,i){return CID.create(1,o,i)}const MSB=128,REST=127,MSBALL=~REST,INT=Math.pow(2,31),encode=o=>{const i=[];let s=0;for(;o>=INT;)i[s++]=o&255|MSB,o/=128;for(;o&MSBALL;)i[s++]=o&255|MSB,o>>>=7;return i[s]=o|0,i},decode=(o,i)=>{let s=0;i=i||0;let a=0,c=i,d;const f=o.length;do{if(c>=f||a>49)throw new RangeError("Could not decode varint");d=o.get(c++),s+=a<28?(d&REST)<=MSB);return[s,c-i]},State={ReadHeaderLength:0,ReadHeader:1,ReadBlockLength:2,ReadBlock:3},CIDV0_BYTES={SHA2_256:18,LENGTH:32,DAG_PB:112};var xt;class CARReaderStream extends TransformStream{constructor(s,a){const c=new Uint8ArrayList;let d=0,f=d,g=8,y=State.ReadHeaderLength,b;const $=new Promise(x=>{b=x});super({transform(x,T){for(c.append(x);!(c.length{const[,i]=decode(o),[s,a]=decode(o,i);return i+a+s},encodeHeader=o=>{const i=encode$O({version:1,roots:o}),s=encode(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a},encodeBlock=o=>{const i=encode(o.cid.bytes.length+o.bytes.length),s=new Uint8Array(i.length+o.cid.bytes.length+o.bytes.length);return s.set(i),s.set(o.cid.bytes,i.length),s.set(o.bytes,i.length+o.cid.bytes.length),s};class CARWriterStream extends TransformStream{constructor(i=[],s,a){super({start:c=>c.enqueue(encodeHeader(i)),transform:(c,d)=>d.enqueue(encodeBlock(c))},s,a)}}async function indexShardedDAG(o,i,s){const a=create$3(o);for(const[c,d]of i.entries()){const f=s[c];a.shards.set(d.multihash,f)}return await a.archive()}const SHARD_SIZE=133169152;class ShardingStream extends TransformStream{constructor(i={}){const s=i.shardSize??SHARD_SIZE,a=s-headerEncodingLength();let c=[],d=null,f=new DigestMap,g=null,y=0;super({async transform(b,$){d!=null&&g!=null&&($.enqueue(await encodeCAR(d,g)),d=null,g=null);const x=blockHeaderEncodingLength(b),T=x+b.bytes.length;if(T>a)throw new Error(`block will cause CAR to exceed shard size: ${b.cid}`);c.length&&y+T>a&&(d=c,g=f,c=[],f=new DigestMap,y=0),c.push(b),f.set(b.cid.multihash,[headerEncodingLength()+y+x,b.bytes.length]),y+=T},async flush(b){d!=null&&g!=null&&b.enqueue(await encodeCAR(d,g));const $=c.at(-1);if($==null)return;const x=i.rootCID??$.cid,T=headerEncodingLength(x);if(T+y>s){const A=T+y-s,E=[];let S=0;for(;Sa.name)=>ascending(o,i,s);function ascending(o,i,s){const a=s(o),c=s(i);return a===c?0:aObject.assign(await encode$6(o,s),{slices:i});async function uploadFile(o,i,s={}){return await uploadBlockStream(o,createFileEncoderStream(i,s),s)}async function uploadDirectory(o,i,s={}){const{customOrder:a=!1}=s,c=a?i:[...i].sort(defaultFileComparator);return await uploadBlockStream(o,createDirectoryEncoderStream(c,s),s)}async function uploadCAR(o,i,s={}){const a=new BlockStream(i);return s.rootCID=s.rootCID??(await a.getRoots())[0],await uploadBlockStream(o,a,s)}async function uploadBlockStream(o,i,{pieceHasher:s=PieceHasher,...a}={}){const c=typeof o=="function"?o:()=>o,d=[],f=[];let g=null;if(await i.pipeThrough(new ShardingStream(a)).pipeThrough(new TransformStream({async transform(E,S){const _=new Uint8Array(await E.arrayBuffer()),C=await sha256$2.digest(_),B=await c([{can:ability$2,nb:input$8(C,_.length)}]);await add$2(B,C,_,a);const D=create$g(code,C);let I;if(s){const z=await s.digest(_);I=create$g(code$3,z);const K=create$g(code$3,C),G=await filecoinOffer({issuer:B.issuer,audience:B.audience,with:B.issuer.did(),proofs:B.proofs},K,I,a);if(G.out.error)throw new Error("failed to offer piece for aggregation into filecoin deal",{cause:G.out.error})}const{version:L,roots:N,size:O,slices:R}=E;S.enqueue({version:L,roots:N,size:O,cid:D,piece:I,slices:R})}})).pipeTo(new WritableStream({write(E){g=g||E.roots[0],f.push(E.cid),E.slices.set(E.cid.multihash,[0,E.size]),d.push(E.slices),a.onShardStored&&a.onShardStored(E)}})),!g)throw new Error("missing root CID");const y=await indexShardedDAG(g,f,d);if(!y.ok)throw new Error("failed to archive DAG index",{cause:y.error});const b=await sha256$2.digest(y.ok),$=create$g(code,b),[x,T,A]=await Promise.all([c([{can:ability$2,nb:input$8(b,y.ok.length)}]),c([{can:ability$1,nb:input$4($)}]),c([{can:ability,nb:input$3(g,f)}])]);return await add$2(x,b,y.ok,a),await add$1(T,$,a),await add(A,g,f,a),g}const accessServiceURL=new URL("https://up.web3.storage"),accessServicePrincipal=parse$2("did:web:web3.storage"),accessServiceConnection=connect({id:accessServicePrincipal,codec:outbound,channel:open$2({url:accessServiceURL,method:"POST"})}),uploadServiceURL=new URL("https://up.web3.storage"),uploadServicePrincipal=parse$2("did:web:web3.storage"),uploadServiceConnection=connect({id:uploadServicePrincipal,codec:outbound,channel:open$2({url:uploadServiceURL,method:"POST"})}),filecoinServiceURL=new URL("https://up.web3.storage"),filecoinServicePrincipal=parse$2("did:web:web3.storage"),filecoinServiceConnection=connect({id:filecoinServicePrincipal,codec:outbound,channel:open$2({url:filecoinServiceURL,method:"POST"})}),serviceConf={access:accessServiceConnection,upload:uploadServiceConnection,filecoin:filecoinServiceConnection};class Base{constructor(i,s={}){U(this,"_agent");U(this,"_serviceConf");this._serviceConf=s.serviceConf??serviceConf,this._agent=new Agent(i,{servicePrincipal:this._serviceConf.access.id,url:this._serviceConf.access.channel.url,connection:this._serviceConf.access}),this._receiptsEndpoint=s.receiptsEndpoint??receiptsEndpoint}get agent(){return this._agent}async _invocationConfig(i){const s=this._agent.currentSpace();if(!s)throw new Error("missing current space: use createSpace() or setCurrentSpace()");const a=this._agent.issuer,c=await this._agent.proofs(i.map(f=>({can:f,with:s}))),d=this._serviceConf.upload.id;return{issuer:a,with:s,proofs:c,audience:d}}}const unwrap=({ok:o,error:i})=>{if(i)throw i;return o};class AccessClient extends Base{async authorize(i,s){const a=fromEmail(i),c=unwrap(await request(this,{account:a})),d=unwrap(await c.claim(s));return await unwrap(await d.save()),d.proofs}async claim(i){const s=unwrap(await claim(this,i));return await unwrap(await s.save()),s.proofs}async request(i){return await request(this,i)}async delegate(i){return await delegate(this,i)}}const claim=async({agent:o},i)=>claim$1(o,i),request=async({agent:o},i)=>request$2(o,i),delegate=async({agent:o},i)=>delegate$1(o,i),{spaceAccess,accountAccess}=access;class PlanClient extends Base{async get(i,s){const a=await get({agent:this.agent},{...s,account:i});if(!a.ok)throw new Error(`failed ${get$c.can} invocation`,{cause:a.error});return a.ok}async set(i,s,a){const c=await set({agent:this.agent},{...a,account:i,product:s});if(!c.ok)throw new Error(`failed ${set$5.can} invocation`,{cause:c.error});return c.ok}async createAdminSession(i,s,a){const c=await createAdminSession({agent:this.agent},{...a,account:i,returnURL:s});if(!c.ok)throw new Error(`failed ${createAdminSession$1.can} invocation`,{cause:c.error});return c.ok}}const get=async({agent:o},{account:i,nonce:s,proofs:a=[]})=>(await o.invokeAndExecute(get$c,{with:i,proofs:a,nonce:s})).out,set=async({agent:o},{account:i,product:s,nonce:a,proofs:c=[]})=>(await o.invokeAndExecute(set$5,{with:i,nb:{product:s},nonce:a,proofs:c})).out,createAdminSession=async({agent:o},{account:i,returnURL:s,nonce:a,proofs:c=[]})=>(await o.invokeAndExecute(createAdminSession$1,{with:i,proofs:c,nonce:a,nb:{returnURL:s}})).out;class SubscriptionClient extends Base{async list(i,s){const a=await list$1({agent:this.agent},{...s,account:i});if(!a.ok)throw new Error(`failed ${list$6.can} invocation`,{cause:a.error});return a.ok}}const list$1=async({agent:o},{account:i,nonce:s,proofs:a=[]})=>(await o.invokeAndExecute(list$6,{with:i,proofs:a,nb:{},nonce:s})).out,list=({agent:o},{account:i}={})=>{const s={with:i??/did:mailto:.*/,can:"*"},a=o.proofs([s]),c={},d={};for(const f of a){const g=allows(f);for(const[y,b]of Object.entries(g)){if(AccountDID.is(y)&&b["*"]){const $=y;(c[$]||(c[$]=new Account({id:$,agent:o,proofs:[]}))).addProof(f)}for(const $ of b["ucan/attest"]||[]){const x=$.proof;x&&(d[`${x}`]=f)}}}for(const f of Object.values(c))for(const g of f.proofs){const y=d[`${g.cid}`];y&&f.addProof(y)}return c},login=async({agent:o},i,s={})=>{const a=fromEmail(i),c=list({agent:o},{account:a})[a];if(c)return{ok:c};const d=await request({agent:o},{account:a,access:accountAccess}),{ok:f,error:g}=d;if(g)return{error:g};{const{ok:y,error:b}=await f.claim({signal:s.signal});return b?{error:b}:{ok:new Account({id:a,proofs:y.proofs,agent:o})}}};class Account{constructor(i){this.model=i,this.plan=new AccountPlan(i)}get agent(){return this.model.agent}get proofs(){return this.model.proofs}did(){return this.model.id}toEmail(){return toEmail(this.did())}addProof(i){this.proofs.push(i)}toJSON(){return{id:this.did(),proofs:this.proofs.sort((i,s)=>i.cid.toString().localeCompare(s.cid.toString())).map(i=>i.toJSON())}}provision(i,s={}){return add$7(this.agent,{...s,account:this.did(),consumer:i,proofs:this.proofs})}async save({agent:i=this.agent}={}){return await importAuthorization(i,this)}}class AccountPlan{constructor(i){this.model=i}async get(i){return await get(this.model,{...i,account:this.model.id,proofs:this.model.proofs})}async set(i,s){return await set(this.model,{...s,account:this.model.id,product:i,proofs:this.model.proofs})}async wait(i){var d;const s=Date.now(),a=(i==null?void 0:i.interval)||1e3,c=(i==null?void 0:i.timeout)||60*15*1e3;for(;;){const f=await this.get();if(f.ok)return f.ok;if(f.error)throw new Error(`Error retrieving payment plan: ${f.error}`);if(Date.now()-s>c)throw new Error("Timeout: Payment plan selection took too long.");if((d=i==null?void 0:i.signal)!=null&&d.aborted)throw new Error("Aborted: Payment plan selection was aborted.");console.log("Waiting for payment plan to be selected..."),await new Promise(g=>setTimeout(g,a))}}async createAdminSession(i,s,a){return await createAdminSession(this.model,{...a,account:i,returnURL:s})}async subscriptions(i){return await list$1(this.model,{...i,account:this.model.id,proofs:this.model.proofs})}}class UsageClient extends Base{async report(i,s,a){const c=await report({agent:this.agent},{...a,space:i,period:s});if(!c.ok)throw new Error(`failed ${report$1.can} invocation`,{cause:c.error});return c.ok}}const report=async({agent:o},{space:i,period:s,nonce:a,proofs:c=[]})=>(await o.invokeAndExecute(report$1,{with:i,proofs:c,nonce:a,nb:{period:{from:Math.floor(s.from.getTime()/1e3),to:Math.ceil(s.to.getTime()/1e3)}}})).out;var Qe;class Space{constructor(i){Y(this,Qe);Q(this,Qe,i),this.usage=new StorageUsage(i)}get name(){var i;return String(((i=F(this,Qe).meta)==null?void 0:i.name)??"")}did(){return F(this,Qe).id}meta(){return F(this,Qe).meta}}Qe=new WeakMap;var st;class StorageUsage{constructor(i){Y(this,st);Q(this,st,i)}async get(){const{agent:i}=F(this,st),s=F(this,st).id,a=new Date,c={from:startOfLastMonth(a),to:a},d=await report({agent:i},{space:s,period:c});if(d.error)return d;const f=i.connection.id.did(),g=d.ok[f];return{ok:(g==null?void 0:g.size.final)==null?void 0:BigInt(g.size.final)}}}st=new WeakMap;const startOfMonth=o=>{const i=new Date(o);return i.setUTCDate(1),i.setUTCHours(0),i.setUTCMinutes(0),i.setUTCSeconds(0),i.setUTCMilliseconds(0),i},startOfLastMonth=o=>{const i=startOfMonth(o);return i.setUTCMonth(i.getUTCMonth()-1),i};class BlobClient extends Base{async add(i,s={}){const a=await this._invocationConfig([add$4.can]);s.connection=this._serviceConf.upload;const c=new Uint8Array(await i.arrayBuffer()),d=await sha256$6.digest(c);return{digest:d,...await add$2(a,d,c,s)}}async list(i={}){const s=await this._invocationConfig([list$5.can]);return i.connection=this._serviceConf.upload,list$3(s,i)}async remove(i,s={}){const a=await this._invocationConfig([remove$5.can]);return s.connection=this._serviceConf.upload,remove$3(a,i,s)}async get(i,s={}){const a=await this._invocationConfig([get$b.can]);return s.connection=this._serviceConf.upload,get$8(a,i,s)}}class IndexClient extends Base{async add(i,s={}){const a=await this._invocationConfig([add$5.can]);return s.connection=this._serviceConf.upload,add$1(a,i,s)}}class StoreClient extends Base{async add(i,s={}){const a=await this._invocationConfig([add$a.can]);return s.connection=this._serviceConf.upload,add$3(a,i,s)}async get(i,s={}){const a=await this._invocationConfig([get$h.can]);return s.connection=this._serviceConf.upload,get$a(a,i,s)}async list(i={}){const s=await this._invocationConfig([list$9.can]);return i.connection=this._serviceConf.upload,list$4(s,i)}async remove(i,s={}){const a=await this._invocationConfig([remove$8.can]);return s.connection=this._serviceConf.upload,remove$4(a,i,s)}}class UploadClient extends Base{async add(i,s,a={}){const c=await this._invocationConfig([add$9.can]);return a.connection=this._serviceConf.upload,add(c,i,s,a)}async get(i,s={}){const a=await this._invocationConfig([get$g.can]);return s.connection=this._serviceConf.upload,get$7(a,i,s)}async list(i={}){const s=await this._invocationConfig([list$8.can]);return i.connection=this._serviceConf.upload,list$2(s,i)}async remove(i,s={}){const a=await this._invocationConfig([remove$7.can]);return s.connection=this._serviceConf.upload,remove$2(a,i,s)}}class SpaceClient extends Base{async info(i,s){return await this._agent.getSpaceInfo(i,s)}}class FilecoinClient extends Base{async offer(i,s,a){const c=await this._invocationConfig([filecoinOffer$1.can]);return filecoinOffer(c,i,s,{...a,connection:this._serviceConf.filecoin})}async info(i,s){const a=await this._invocationConfig([filecoinInfo$1.can]);return filecoinInfo(a,i,{...s,connection:this._serviceConf.filecoin})}}class CouponAPI extends Base{async redeem(i,s={}){const{agent:a}=this,c=unwrap(await extract(i));return unwrap(await redeem(c,{...s,agent:a}))}async issue({proofs:i=[],...s}){const{agent:a}=this;return await issue({...s,issuer:a.issuer,proofs:[...i,...a.proofs(s.capabilities)]})}}const extract=async o=>{const{ok:i,error:s}=await extract$1(o);return i?ok(new Coupon({proofs:[i]})):error$1(s)},archive=async o=>{const[i]=o.proofs;return await archive$2(i)},issue=async({password:o="",...i})=>{const s=await deriveSigner(o),a=await delegate$3({...i,audience:s});return new Coupon({proofs:[a]})},redeem=async(o,{agent:i,password:s=""})=>{const a=await deriveSigner(s),[c]=o.proofs;if(c.audience.did()!==a.did())return error$1(new RangeError(s===""?"Extracting account requires a password":"Provided password is invalid"));{const d=await delegate$3({issuer:a,audience:i,capabilities:c.capabilities,expiration:c.expiration,notBefore:c.notBefore,proofs:[c]});return ok(new GrantedAccess({agent:i,proofs:[d]}))}},deriveSigner=async o=>{const{digest:i}=await sha256$4.digest(new TextEncoder().encode(o));return await derive(i)};class Coupon{constructor(i){this.model=i}get proofs(){return this.model.proofs}redeem(i,s={}){return redeem(this,{...s,agent:i})}archive(){return archive(this)}}class Client extends Base{constructor(i,s){super(i,s),this.capability={access:new AccessClient(i,s),filecoin:new FilecoinClient(i,s),index:new IndexClient(i,s),plan:new PlanClient(i,s),space:new SpaceClient(i,s),blob:new BlobClient(i,s),store:new StoreClient(i,s),subscription:new SubscriptionClient(i,s),upload:new UploadClient(i,s),usage:new UsageClient(i,s)},this.coupon=new CouponAPI(i,s)}did(){return this._agent.did()}async authorize(i,s){await this.capability.access.authorize(i,s)}async login(i,s={}){const a=unwrap(await login(this,i,s));return unwrap(await a.save()),a}accounts(){return list(this)}async uploadFile(i,s={}){const a=await this._invocationConfig([add$4.can,add$5.can,filecoinOffer$1.can,add$9.can]);return s.connection=this._serviceConf.upload,uploadFile(a,i,s)}async uploadDirectory(i,s={}){const a=await this._invocationConfig([add$4.can,add$5.can,filecoinOffer$1.can,add$9.can]);return s.connection=this._serviceConf.upload,uploadDirectory(a,i,s)}async uploadCAR(i,s={}){const a=await this._invocationConfig([add$4.can,add$5.can,filecoinOffer$1.can,add$9.can]);return s.connection=this._serviceConf.upload,uploadCAR(a,i,s)}async getReceipt(i){const s=new URL(this._receiptsEndpoint).toString();return poll(i,{receiptsEndpoint:s})}defaultProvider(){return this._agent.connection.id.did()}currentSpace(){const i=this._agent,s=i.currentSpace();if(!s)return;const a=i.spaces.get(s);return new Space({id:s,meta:a,agent:i})}async setCurrentSpace(i){await this._agent.setCurrentSpace(i)}spaces(){return[...this._agent.spaces].map(([i,s])=>new Space({id:i,meta:s,agent:this._agent}))}async createSpace(i,s={}){const a=await this._agent.createSpace(i),c=s.account;if(c){const d=await c.provision(a.did());if(d.error)throw new Error(`failed to provision account: ${d.error.message}`,{cause:d.error});await a.save();const f=await a.createRecovery(c.did()),g=await this.capability.access.delegate({space:a.did(),delegations:[f]});if(g.error)throw new Error(`failed to authorize recovery account: ${g.error.message}`,{cause:g.error})}return a}async shareSpace(i,s,a={abilities:["space/*","store/*","upload/*","access/*","usage/*","filecoin/offer","filecoin/info","filecoin/accept","filecoin/submit"],expiration:1/0}){const{abilities:c,...d}=a,f=this.agent.currentSpace();try{await this.agent.setCurrentSpace(s);const{root:g,blocks:y}=await this.agent.delegate({...d,abilities:c,audience:{did:()=>fromEmail(email(i))},audienceMeta:a.audienceMeta??{}}),b=new AgentDelegation(g,y,{audience:i}),$=await this.capability.access.delegate({space:s,delegations:[b]});if($.error)throw new Error(`failed to share space with ${i}: ${$.error.message}`,{cause:$.error});return b}finally{f&&f!==s&&await this.agent.setCurrentSpace(f)}}async addSpace(i){return await this._agent.importSpaceFromDelegation(i)}proofs(i){return this._agent.proofs(i)}async addProof(i){await this._agent.addProof(i)}delegations(i){const s=[];for(const{delegation:a,meta:c}of this._agent.delegationsWithMeta(i))s.push(new AgentDelegation(a.root,a.blocks,c));return s}async createDelegation(i,s,a={}){const c=a.audienceMeta??{name:"agent",type:"device"},{root:d,blocks:f}=await this._agent.delegate({...a,abilities:s,audience:i,audienceMeta:c});return new AgentDelegation(d,f,{audience:c})}async revokeDelegation(i,s={}){return this._agent.revoke(i,{proofs:s.proofs})}async remove(i,s={}){var c;if(!s.shards){await this.capability.upload.remove(i);return}const a=await this.capability.upload.get(i);(c=a.shards)!=null&&c.length&&await Promise.allSettled(a.shards.map(async d=>{var f;try{const g=await this.capability.blob.remove(d.multihash);g.ok&&g.ok.size===0&&await this.capability.store.remove(d)}catch(g){if(((f=g==null?void 0:g.cause)==null?void 0:f.name)!=="StoreItemNotFound")throw new Error(`failed to remove shard: ${d}`,{cause:g})}})),await this.capability.upload.remove(i)}}new Set(abilitiesAsStrings);async function create(o={}){const i=o.store??new StoreIndexedDB("w3up-client"),s=await i.load();if(s){const d=AgentData.fromExport(s,{store:i});if(o.principal&&d.principal.did()!==o.principal.did())throw new Error(`store cannot be used with ${o.principal.did()}, stored principal and passed principal must match`);return new Client(d,o)}const a=o.principal??await generate(),c=await AgentData.create({principal:a},{store:i});return new Client(c,o)}const toHTTP=o=>o.replace(/^ipfs:\/\//,"https://w3s.link/ipfs/"),upload=async o=>{const i=await create();console.debug({"W3Up Client":i,accounts:i.accounts(),did:i.did()});const s=await fetch("https://dacademy-ucan-delegator.netlify.app/ucan",{method:"POST",body:JSON.stringify({did:i.did()})}),{delegation:a}=await s.json(),{ok:c,error:d}=await extract$1(new Uint8Array(a));if(!c)throw new Error("Failed to extract delegation.",{cause:d});const f=await i.addSpace(c);return i.setCurrentSpace(f.did()),(await i.uploadDirectory(o)).toString()},abi=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"editor",type:"address"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{components:[{internalType:"bool",name:"paused",type:"bool"},{internalType:"bool",name:"optional",type:"bool"},{internalType:"bool",name:"skipReview",type:"bool"}],indexed:!1,internalType:"struct IQuestChain.QuestDetails[]",name:"questDetails",type:"tuple[]"}],name:"ConfiguredQuests",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"editor",type:"address"},{indexed:!1,internalType:"string",name:"details",type:"string"}],name:"QuestChainEdited",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"details",type:"string"},{indexed:!1,internalType:"string[]",name:"quests",type:"string[]"},{indexed:!1,internalType:"bool",name:"paused",type:"bool"}],name:"QuestChainInit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"tokenURI",type:"string"}],name:"QuestChainTokenURIUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"reviewer",type:"address"},{indexed:!1,internalType:"address[]",name:"questerList",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{indexed:!1,internalType:"bool[]",name:"successList",type:"bool[]"},{indexed:!1,internalType:"string[]",name:"detailsList",type:"string[]"}],name:"QuestProofsReviewed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"quester",type:"address"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"proofList",type:"string[]"}],name:"QuestProofsSubmitted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"string[]",name:"detailsList",type:"string[]"}],name:"QuestsCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"editor",type:"address"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"detailsList",type:"string[]"}],name:"QuestsEdited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"limiterContract",type:"address"}],name:"SetLimiter",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"EDITOR_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"REVIEWER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"burnToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{components:[{internalType:"bool",name:"paused",type:"bool"},{internalType:"bool",name:"optional",type:"bool"},{internalType:"bool",name:"skipReview",type:"bool"}],internalType:"struct IQuestChain.QuestDetails[]",name:"_questDetails",type:"tuple[]"}],name:"configureQuests",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string[]",name:"_detailsList",type:"string[]"}],name:"createQuests",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_details",type:"string"}],name:"edit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{internalType:"string[]",name:"_detailsList",type:"string[]"}],name:"editQuests",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTokenURI",outputs:[{internalType:"string",name:"uri",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_role",type:"bytes32"},{internalType:"address",name:"_account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"address[]",name:"admins",type:"address[]"},{internalType:"address[]",name:"editors",type:"address[]"},{internalType:"address[]",name:"reviewers",type:"address[]"},{internalType:"string[]",name:"quests",type:"string[]"},{internalType:"bool",name:"paused",type:"bool"},{internalType:"string",name:"details",type:"string"},{internalType:"string",name:"tokenURI",type:"string"}],internalType:"struct QuestChainCommons.QuestChainInfo",name:"_info",type:"tuple"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"limiterContract",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"mintToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"premium",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"questChainFactory",outputs:[{internalType:"contract IQuestChainFactory",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"questChainId",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"questChainToken",outputs:[{internalType:"contract IQuestChainToken",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"questCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"questDetails",outputs:[{internalType:"bool",name:"paused",type:"bool"},{internalType:"bool",name:"optional",type:"bool"},{internalType:"bool",name:"skipReview",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_quester",type:"address"},{internalType:"uint256",name:"_questId",type:"uint256"}],name:"questStatus",outputs:[{internalType:"enum IQuestChain.Status",name:"status",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"_questerList",type:"address[]"},{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{internalType:"bool[]",name:"_successList",type:"bool[]"},{internalType:"string[]",name:"_detailsList",type:"string[]"}],name:"reviewProofs",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"_role",type:"bytes32"},{internalType:"address",name:"_account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_limiterContract",type:"address"}],name:"setLimiter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_tokenURI",type:"string"}],name:"setTokenURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{internalType:"string[]",name:"_proofList",type:"string[]"}],name:"submitProofs",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"}],CHAIN=10,Alert=({children:o})=>jsxRuntimeExports.jsxs("div",{role:"alert",className:"alert alert-warning flex items-center mt-10",children:[jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 shrink-0 stroke-current",fill:"none",viewBox:"0 0 24 24",children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),o]}),Submission=()=>{const o=useLoadedBook(),i=useChainId(),s=React__default.useRef(null),[a,c]=reactExports.useState(!1),[d,f]=reactExports.useState({}),g=({type:I,error:L})=>{f(N=>({...N,[I]:L}))},{data:y,writeContract:b,isPending:$}=useWriteContract(),x=useConfig(),T={chain:{type:"chain",error:jsxRuntimeExports.jsx("h3",{className:"flex text-center items-center justify-center",children:"Please switch to the Optimism network to continue."})},account:{type:"account",error:jsxRuntimeExports.jsxs("h3",{className:"flex text-center items-center justify-center",children:["Please",jsxRuntimeExports.jsx("div",{className:"mx-2",children:jsxRuntimeExports.jsx("w3m-button",{size:"sm"})}),"to submit a proof."]})}};reactExports.useEffect(()=>{if(x)return watchChainId(x,{onChange(I){I!==CHAIN&&!d.chain&&g(T.chain)}})},[x]);const{contract:A=null}=o&&"contract"in o?o:{};reactExports.useEffect(()=>{y&&_t.success(jsxRuntimeExports.jsxs("p",{children:["Successfully submitted transaction",jsxRuntimeExports.jsxs("a",{href:`https://optimistic.etherscan.io/tx/${y}`,className:"mx-1 whitespace-nowrap text-primary hover:text-secondary",target:"_blank",children:[y.substring(0,8),"…",y.slice(-6)]}),"to the Quest Chain contract at",jsxRuntimeExports.jsxs("a",{href:`https://optimistic.etherscan.io/address/${A}`,className:"ml-1 whitespace-nowrap text-primary hover:text-secondary",target:"_blank",children:[A==null?void 0:A.substring(0,6),"…",A==null?void 0:A.slice(-4)]}),"."]}),{duration:12e3,style:{width:"45ch"}})},[y]);const{isLoading:E,isSuccess:S}=useWaitForTransactionReceipt({hash:y});o.reader==null&&!d.account?g(T.account):o.reader!=null&&d.account&&g({type:"account",error:null}),i!==CHAIN&&!d.chain?g(T.chain):i===CHAIN&&d.chain&&g({type:"chain",error:null});const _=Object.values(d).filter(Boolean);if(_.length>0)return _.map((I,L)=>jsxRuntimeExports.jsx(Alert,{children:I},L));const C=React__default.lazy(()=>__vitePreload(()=>import("./MarkdownEditor-BcjjWJJf.js").then(I=>I.M),__vite__mapDeps([0,1,2]))),B="Submit Proof",D=E?"Confirming…":$?"Transaction Pending…":a?"Saving to IPFS…":S?"¡Done: Submitted!":B;return jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("h3",{children:"Loading Submission Editor…"}),children:[jsxRuntimeExports.jsx(C,{editorRef:s,markdown:"",className:"dark-theme dark-editor content mt-10"}),jsxRuntimeExports.jsxs("button",{onClick:async()=>{var L;const I=(L=s.current)==null?void 0:L.getMarkdown();if(!I)throw new Error(`Invalid \`markdown\`: "${I}".`);c(!0);try{const N=new Blob([JSON.stringify({name,description:I})],{type:"application/json"}),O=await upload([new File([N],"submission.json")]);if(_t.success(jsxRuntimeExports.jsxs("p",{children:["Successfully uploaded your response submission to",jsxRuntimeExports.jsx("a",{href:"https://web3.storage",target:"_blank",className:"mx-1 whitespace-nowrap text-primary hover:text-secondary",children:"Web3.Storage"}),"at",jsxRuntimeExports.jsxs("a",{href:`https://w3s.link/ipfs/${O}`,target:"_blank",className:"ml-1 whitespace-nowrap text-primary hover:text-secondary",children:["ipfs://",O.substring(0,6),"…",O.slice(-4)]}),"."]}),{duration:15e3,position:"bottom-center",style:{width:"45ch"}}),o.on==null)throw new Error("No current chapter.");b({address:A,abi,functionName:"submitProofs",args:[[o.on-1],[O]]},{onError:R=>{console.error({error:R}),_t.error(R.shortMessage??R.message,{duration:12e3})}})}catch(N){console.error({error:N}),_t.error(N.message)}finally{c(!1)}},disabled:D!==B,className:"btn btn-wide text-primary my-6",children:[jsxRuntimeExports.jsx("span",{className:clsx(D.endsWith("…")&&"loading loading-dots loading-md")}),D]})]})};function Content(){const o=useLoadedBook();return jsxRuntimeExports.jsxs("section",{id:"content",className:"flex-grow",children:[jsxRuntimeExports.jsx("div",{className:"card bg-transparent max-w-prose mt-4 mx-auto",children:jsxRuntimeExports.jsx("div",{className:"content",children:jsxRuntimeExports.jsx(Markdown,{children:o.chapters.active.content})})}),o.on===0?jsxRuntimeExports.jsx("button",{onClick:()=>o.setOn(o.on+1),className:"shadow-md rounded-md bg-base-300 p-4 hover:bg-yellow-300/60 text-white text-center",children:"Continue"}):["pass"].includes(o.chapters.active.status)?jsxRuntimeExports.jsxs("div",{role:"alert",className:"alert alert-success flex items-center mt-10",children:[jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 shrink-0 stroke-current",fill:"none",viewBox:"0 0 24 24",children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),jsxRuntimeExports.jsx("h2",{className:"grow",children:"You have already successfully completed this submission."}),o.ono.setOn(o.on+1),className:"btn btn-primary text-fg font-bold self-end",children:["Next ",jsxRuntimeExports.jsx("span",{className:"size-2xl",children:"→"})]})]}):jsxRuntimeExports.jsx(Submission,{})]})}const Reward=()=>{var b;const o=useLoadedBook(),{data:i,writeContract:s}=useWriteContract(),{isLoading:a,isSuccess:c}=useWaitForTransactionReceipt({hash:i});if(!o)throw new Error("No book found.");const d=()=>{if(!o)throw new Error("No book found.");s({address:o.contract,abi,functionName:"mintToken",args:[]},{onError:$=>{console.error({error:$}),_t.error($.shortMessage??$.message,{duration:12e3})},onSuccess:$=>_t.success(jsxRuntimeExports.jsxs("p",{children:["Minted in transaction",jsxRuntimeExports.jsxs("a",{href:`https://optimistic.etherscan.io/tx/${$}`,className:"mx-1 whitespace-nowrap text-primary hover:text-secondary",target:"_blank",children:[$.substring(0,8),"…",$.slice(-6)]}),"."]}),{duration:12e3})})};let f=((b=o.chapters)==null?void 0:b.every($=>$.status==="pass"||$.optional))&&!o.nft.minted;const g="Mint NFT",y=a?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"loading loading-spinner loading-md"}),"Confirming…"]}):c?"¡Done: Minted!":g;return jsxRuntimeExports.jsx("div",{id:"reward",className:"flex flex-col ml-4 mt-8 md:mt-1",children:jsxRuntimeExports.jsxs("div",{className:"card rounded-sm bg-secondary/25 h-auto max-w-md mr-4 mx-auto",children:[jsxRuntimeExports.jsx("h1",{className:"text-3xl font-bold text-center my-4 mx-2",children:"Completion NFT"}),jsxRuntimeExports.jsx("img",{src:toHTTP(o.nft.image),alt:"Soulbound NFT",className:"w-full h-full object-contain pb-4 px-4"}),f&&jsxRuntimeExports.jsx("button",{disabled:y!==g,onClick:d,className:"btn btn-primary",children:y}),o.nft.minted&&jsxRuntimeExports.jsx("h2",{className:"bg-info rounded-md p-4",children:"You've already collected this NFT."})]})})},BookHeader=()=>{var a;const o=useBook(),[i,s]=reactExports.useState("Unknown");if(reactExports.useEffect(()=>{o&&"creator"in o&&(s(`${o.creator.substring(0,5)}⋯${o.creator.slice(-3)}`),createPublicClient({chain:mainnet,transport:http()}).getEnsName({address:o.creator}).then(d=>{d&&s(d)}))}),o&&o.error)throw o.error;return jsxRuntimeExports.jsxs("header",{children:[jsxRuntimeExports.jsxs("h2",{className:"text-sm text-secondary mt-5 text-left pl-1",children:["Creator: ",i]}),jsxRuntimeExports.jsx("h1",{className:"text-4xl md:text-6xl font-bold text-left mt-2",children:o==null?void 0:o.title}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-white text-left pl-1 mt-6 mb-4",children:["Last Updated:"," ",((a=o==null?void 0:o.updatedAt)==null?void 0:a.toLocaleString(void 0,{day:"numeric",month:"long",year:"numeric"}))??"Unknown"]})]})},Route=createLazyFileRoute("/book/$slug/")({component:Book});function Book(){try{const{slug:o}=Route.useParams();return jsxRuntimeExports.jsx(BookProvider,{slug:o,children:jsxRuntimeExports.jsxs("article",{id:"top",className:"container mx-auto py-20 px-5 overflow-auto relative",children:[jsxRuntimeExports.jsx(BookHeader,{}),jsxRuntimeExports.jsx("main",{className:"md:flex justify-start overflow-hidden relative",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("h1",{children:"Loading…"}),children:[jsxRuntimeExports.jsx(Chapters,{}),jsxRuntimeExports.jsx(Content,{}),jsxRuntimeExports.jsx(Reward,{})]})})]})})}catch(o){return jsxRuntimeExports.jsxs("h1",{children:["Error: ",o.message]})}}const index_lazy=Object.freeze(Object.defineProperty({__proto__:null,Book,Route},Symbol.toStringTag,{value:"Module"}));export{EXIT as E,VFileMessage as V,stringifyPosition as a,markdownSpace as b,classifyCharacter as c,decodeNamedCharacterReference as d,markdownLineEndingOrSpace as e,factorySpace as f,start as g,cont as h,convert as i,decodeString as j,fromMarkdown as k,upload as l,markdownLineEnding as m,index_lazy as n,ok$2 as o,resolveAll as r,splice as s,toString$5 as t,unicodeWhitespace as u,visit as v}; +`),Provider$1=match$1({method:"web"}),add$8=capability({can:"provider/add",with:AccountDID$1,nb:struct({provider:Provider$1,consumer:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.provider,i.nb.provider,"provider"))||and$2(equal(o.nb.consumer,i.nb.consumer,"consumer"))||ok({})}),Provider$2=Object.freeze(Object.defineProperty({__proto__:null,AccountDID:AccountDID$1,Provider:Provider$1,add:add$8},Symbol.toStringTag,{value:"Module"})),{Provider:ProviderDID$3,AccountDID}=Provider$2,add$7=async(o,{account:i,consumer:s,provider:a=o.connection.id.did(),proofs:c})=>{if(!ProviderDID$3.is(a))throw new Error(`Unable to determine provider from agent.connection.id did ${a}. expected a did:web:`);const{out:d}=await o.invokeAndExecute(add$8,{with:i,nb:{provider:a,consumer:s},proofs:c});return d},generate$1=async({name:o,agent:i})=>{const{signer:s}=await generate$2();return new OwnedSpace({signer:s,name:o,agent:i})},fromMnemonic=async(o,{name:i,agent:s})=>{const a=mnemonicToEntropy(o,wordlist),c=await derive(a);return new OwnedSpace({signer:c,name:i,agent:s})},toMnemonic=({signer:o})=>{const i=o.secret;return entropyToMnemonic(i,wordlist)},createRecovery=(o,i)=>createAuthorization(o,{agent:o.signer.withDID(i),access:accountAccess$1,expiration:1/0}),SESSION_LIFETIME=60*60*24*365,createAuthorization=async({signer:o,name:i},{agent:s,access:a=spaceAccess$1,expiration:c=now()+SESSION_LIFETIME})=>await delegate$3({issuer:o,audience:s,capabilities:toCapabilities({[o.did()]:a}),...c?{expiration:c}:{},facts:[{space:{name:i}}]}),toCapabilities=o=>{const i=[];for(const[s,a]of Object.entries(o)){const c=Object.entries(a);for(const[d,f]of c)f&&i.push({can:d,with:s})}return i};class OwnedSpace{constructor(i){this.model=i}get signer(){return this.model.signer}get name(){return this.model.name}did(){return this.signer.did()}withName(i){return new OwnedSpace({signer:this.signer,name:i})}async save({agent:i=this.model.agent}={}){if(!i)return fail("Please provide an agent to save the space into");const s=await createAuthorization(this,{agent:i});return await i.importSpaceFromDelegation(s),await i.setCurrentSpace(this.did()),{ok:{}}}provision({proofs:i},{agent:s=this.model.agent}={}){return s?provision(this,{proofs:i,agent:s}):fail("Please provide an agent to save the space into")}async createRecovery(i){return createRecovery(this,i)}createAuthorization(i,s){return createAuthorization(this,{...s,agent:i})}toMnemonic(){return toMnemonic(this)}}const SpaceDID=match$1({method:"key"}),fromDelegation=o=>{var a;const i=SpaceDID.read(o.capabilities[0].with);if(i.error)throw Object.assign(new Error(`Invalid delegation, expected capabilities[0].with to be DID, ${i.error}`),{cause:i.error});const s=((a=o.facts[0])==null?void 0:a.space)??{};return new SharedSpace({id:i.ok,delegation:o,meta:s})},provision=async(o,{proofs:i,agent:s})=>{const[a]=i[0].capabilities,{ok:c,error:d}=AccountDID.read(a.with);return d?error$1(d):await add$7(s,{consumer:o.did(),account:c,proofs:i})};class SharedSpace{constructor(i){this.model=i}get delegation(){return this.model.delegation}get meta(){return this.model.meta}get name(){return this.meta.name??""}did(){return this.model.id}withName(i){return new SharedSpace({...this.model,meta:{...this.meta,name:i}})}}function isExpired(o){return o.expiration===void 0||o.expiration<=Math.floor(Date.now()/1e3)}function isTooEarly(o){return o.notBefore?o.notBefore>Math.floor(Date.now()/1e3):!1}function canDelegateCapability(o,i){const s=allows(o);for(const[a,c]of Object.entries(s))if(matchResource(a,i.with)){const d=Object.keys(c);for(const f of d)if(canDelegateAbility(f,i.can))return!0}return!1}const matchResource=(o,i)=>i==="ucan:*"?!0:typeof i=="string"?o===i:i.test(o),_globalReference=globalThis||window||self,webcrypto=_globalReference.crypto,tagWith=(o,i)=>{const s=encodingLength$7(o),a=new Uint8Array(i.byteLength+s);return encodeTo$7(o,a,0),a.set(i,s),a},untagWith=(o,i,s=0)=>{const a=s!==0?i.subarray(s):i,[c,d]=decode$C(a);if(c!==o)throw new Error(`Expected multiformat with 0x${o.toString(16)} tag instead got 0x${c.toString(16)}`);return new Uint8Array(a.buffer,a.byteOffset+d)},TAG_SIZE$1=1,INT_TAG=2,BITSTRING_TAG=3,OCTET_STRING_TAG=4,SEQUENCE_TAG=48,UNUSED_BIT_PAD=0,encodeDERLength=o=>{if(o<=127)return new Uint8Array([o]);const i=[];for(;o!==0;)i.push(o&255),o=o>>>8;return i.reverse(),new Uint8Array([128|i.length&255,...i])},readDERLength=(o,i=0)=>{if(!(o[i]&128))return{number:o[i],consumed:1};const s=o[i]&127;if(o.length{const a=into(o,i,s);return a.position+a.length},into=(o,i,s)=>{const a=o[s];if(a!==i)throw new Error(`ASN parsing error: Expected tag 0x${i.toString(16)} at position ${s}, but got 0x${a.toString(16)}.`);const c=readDERLength(o,s+TAG_SIZE$1);return{position:s+TAG_SIZE$1+c.consumed,length:c.number}},encodeBitString=o=>{const i=encodeDERLength(o.byteLength+1),s=new Uint8Array(TAG_SIZE$1+i.byteLength+1+o.byteLength);let a=0;return s[a]=BITSTRING_TAG,a+=TAG_SIZE$1,s.set(i,a),a+=i.byteLength,s[a]=UNUSED_BIT_PAD,a+=1,s.set(o,a),s},encodeOctetString=o=>{const i=encodeDERLength(o.byteLength),s=new Uint8Array(TAG_SIZE$1+i.byteLength+o.byteLength);let a=0;return s[a]=OCTET_STRING_TAG,a+=TAG_SIZE$1,s.set(i,a),a+=i.byteLength,s.set(o,a),s},encodeSequence=o=>{let i=0;for(const d of o)i+=d.byteLength;const s=encodeDERLength(i),a=new Uint8Array(TAG_SIZE$1+s.byteLength+i);let c=0;a[c]=SEQUENCE_TAG,c+=TAG_SIZE$1,a.set(s,c),c+=s.byteLength;for(const d of o)a.set(d,c),c+=d.byteLength;return a},readSequence=(o,i=0)=>{const{position:s,length:a}=into(o,SEQUENCE_TAG,i);return new Uint8Array(o.buffer,o.byteOffset+s,a)},encodeInt=o=>{const i=o.byteLength===0||o[0]&128?1:0,s=encodeDERLength(o.byteLength+i),a=new Uint8Array(TAG_SIZE$1+s.byteLength+o.byteLength+i);let c=0;return a[c]=INT_TAG,c+=TAG_SIZE$1,a.set(s,c),c+=s.byteLength,i>0&&(a[c]=UNUSED_BIT_PAD,c+=i),a.set(o,c),a},enterSequence=(o,i=0)=>into(o,SEQUENCE_TAG,i).position,skipSequence=(o,i=0)=>skip(o,SEQUENCE_TAG,i),skipInt=(o,i=0)=>skip(o,INT_TAG,i),readBitString=(o,i=0)=>{const{position:s,length:a}=into(o,BITSTRING_TAG,i),c=o[s];if(c!==UNUSED_BIT_PAD)throw new Error(`Can not read bitstring, expected length to be multiple of 8, but got ${c} unused bits in last byte.`);return new Uint8Array(o.buffer,o.byteOffset+s+1,a-1)},readInt$1=(o,i=0)=>{const{position:s,length:a}=into(o,INT_TAG,i);let c=0;for(;o[s+c]===0;)c++;return new Uint8Array(o.buffer,o.byteOffset+s+c,a-c)},readOctetString=(o,i=0)=>{const{position:s,length:a}=into(o,OCTET_STRING_TAG,i);return new Uint8Array(o.buffer,o.byteOffset+s,a)},readSequenceWith=(o,i,s=0)=>{const a=[],c=readSequence(i,s);let d=0;for(const f of o){const g=f(c,d);a.push(g),d=g.byteOffset+g.byteLength-c.byteOffset}return a},SPKI_PARAMS_ENCODED=new Uint8Array([48,13,6,9,42,134,72,134,247,13,1,1,1,5,0]),encode$n=o=>encodeSequence([SPKI_PARAMS_ENCODED,encodeBitString(o)]),decode$y=o=>{const i=enterSequence(o,0),s=skipSequence(o,i);return readBitString(o,s)},PKSC8_HEADER=new Uint8Array([2,1,0,48,13,6,9,42,134,72,134,247,13,1,1,1,5,0]),decode$x=o=>{let i=0;return i=enterSequence(o,i),i=skipInt(o,i),i=skipSequence(o,i),readOctetString(o,i)},encode$m=o=>encodeSequence([PKSC8_HEADER,encodeOctetString(o)]),encode$l=({n:o,e:i})=>encodeSequence([encodeInt(o),encodeInt(i)]),decode$w=(o,i=0)=>{const[s,a,c,d,f,g,y,b,$]=readSequenceWith([readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1,readInt$1],o,i);return{v:s,n:a,e:c,d,p:f,q:g,dp:y,dq:b,qi:$}},name$7="RSA",code$8=4869,verifierCode=4613,signatureCode=RS256,signatureAlgorithm="RS256",ALG="RSASSA-PKCS1-v1_5",HASH_ALG="SHA-256",KEY_SIZE=2048,SALT_LENGTH=128,IMPORT_PARAMS={name:ALG,hash:{name:HASH_ALG}},generate=async({size:o=KEY_SIZE,extractable:i=!1}={})=>{const{publicKey:s,privateKey:a}=await webcrypto.subtle.generateKey({name:ALG,modulusLength:o,publicExponent:new Uint8Array([1,0,1]),hash:{name:HASH_ALG}},i,["sign","verify"]),c=await webcrypto.subtle.exportKey("spki",s),d=tagWith(verifierCode,decode$y(new Uint8Array(c))),f=new RSAVerifier({bytes:d,publicKey:s});if(i){const g=await webcrypto.subtle.exportKey("pkcs8",a),y=tagWith(code$8,decode$x(new Uint8Array(g)));return new ExtractableRSASigner({privateKey:a,bytes:y,verifier:f})}else return new UnextractableRSASigner({privateKey:a,verifier:f})},from$g=({id:o,keys:i})=>{if(o.startsWith("did:key:")){const s=o,a=i[s];return a instanceof Uint8Array?decode$v(a):new UnextractableRSASigner({privateKey:a,verifier:RSAVerifier.parse(s)})}else throw new TypeError(`RSA can not import from ${o} archive, try generic Signer instead`)},or$9=o=>or$b({from:from$g},o),decode$v=o=>{const i=decode$w(untagWith(code$8,o)),s=tagWith(verifierCode,encode$l(i));return new ExtractableRSASigner({bytes:o,privateKey:webcrypto.subtle.importKey("pkcs8",encode$m(untagWith(code$8,o)),IMPORT_PARAMS,!0,["sign"]),verifier:RSAVerifier.decode(s)})};class RSAVerifier{constructor({publicKey:i,bytes:s}){this.publicKey=i,this.bytes=s}withDID(i){return withDID$1(this,i)}toDIDKey(){return this.did()}static decode(i){return new this({bytes:i,publicKey:webcrypto.subtle.importKey("spki",encode$n(untagWith(verifierCode,i)),IMPORT_PARAMS,!0,["verify"])})}static parse(i){return RSAVerifier.decode(parse$2(i))}static or(i){return or$c(this,i)}get code(){return verifierCode}get signatureCode(){return signatureCode}get signatureAlgorithm(){return signatureAlgorithm}did(){return`did:key:${base58btc$5.encode(this.bytes)}`}async verify(i,s){return s.code!==signatureCode?!1:webcrypto.subtle.verify({name:ALG,hash:{name:HASH_ALG}},await this.publicKey,s.raw,i)}}class RSASigner{constructor({privateKey:i,verifier:s}){this.verifier=s,this.privateKey=i}get signer(){return this}get code(){return code$8}get signatureCode(){return signatureCode}get signatureAlgorithm(){return signatureAlgorithm}did(){return this.verifier.did()}toDIDKey(){return this.verifier.toDIDKey()}verify(i,s){return this.verifier.verify(i,s)}async sign(i){const s=await webcrypto.subtle.sign({name:ALG,saltLength:SALT_LENGTH},await this.privateKey,i);return create$r(signatureCode,new Uint8Array(s))}}class ExtractableRSASigner extends RSASigner{constructor(i){super(i),this.bytes=i.bytes}withDID(i){return withDID(this,i)}toArchive(){const i=this.did();return{id:i,keys:{[i]:this.bytes}}}}class UnextractableRSASigner extends RSASigner{constructor(i){super(i),this.privateKey=i.privateKey}withDID(i){return withDID(this,i)}toArchive(){const i=this.did();return{id:i,keys:{[i]:this.privateKey}}}}const RSA=Object.freeze(Object.defineProperty({__proto__:null,Verifier:RSAVerifier,code:code$8,decode:decode$v,from:from$g,generate,name:name$7,or:or$9,signatureAlgorithm,signatureCode},Symbol.toStringTag,{value:"Module"})),Signer=or$a(RSA),ProviderDID$2=match$1({method:"web"}),has$1=capability({can:"consumer/has",with:ProviderDID$2,nb:struct({consumer:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.consumer,i.nb.consumer,"consumer"))||ok({})}),get$f=capability({can:"consumer/get",with:ProviderDID$2,nb:struct({consumer:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.consumer,i.nb.consumer,"consumer"))||ok({})}),ProviderDID$1=match$1({method:"web"}),get$e=capability({can:"customer/get",with:ProviderDID$1,nb:struct({customer:AccountDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.customer,i.nb.customer,"customer"))||ok({})});capability({can:"console/*",with:match$1(),derives:equalWith});capability({can:"console/log",with:match$1(),nb:struct({value:unknown()}),derives:equalWith});capability({can:"console/error",with:match$1(),nb:struct({error:unknown()}),derives:equalWith});const Provider=DID,add$6=capability({can:"rate-limit/add",with:Provider,nb:struct({subject:string(),rate:number()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.subject,i.nb.subject,"subject"))||and$2(equal(o.nb.rate,i.nb.rate,"rate"))||ok({})}),remove$6=capability({can:"rate-limit/remove",with:Provider,nb:struct({id:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.id,i.nb.id,"id"))||ok({})}),list$7=capability({can:"rate-limit/list",with:Provider,nb:struct({subject:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.subject,i.nb.subject,"subject"))||ok({})}),admin=capability({can:"admin/*",with:ProviderDID$4,derives:equalWith}),upload$1={inspect:capability({can:"admin/upload/inspect",with:ProviderDID$4,nb:struct({root:Link}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.root,i.nb.root,"root"))||ok({})})},store={inspect:capability({can:"admin/store/inspect",with:ProviderDID$4,nb:struct({link:Link}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.link,i.nb.link,"link"))||ok({})})},ProviderDID=match$1({method:"web"}),get$d=capability({can:"subscription/get",with:ProviderDID,nb:struct({subscription:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.subscription,i.nb.subscription,"consumer"))||ok({})}),list$6=capability({can:"subscription/list",with:AccountDID$1,derives:equalWith}),FR32_SHA2_256_TRUNC254_PADDED_BINARY_TREE=4113,RAW_CODE=85,PieceLink=match$2({code:RAW_CODE,version:1,multihash:{code:FR32_SHA2_256_TRUNC254_PADDED_BINARY_TREE}}),filecoinOffer$1=capability({can:"filecoin/offer",with:match$1(),nb:struct({content:match$2(),piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.content,i.nb.content,"nb.content"))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),filecoinSubmit=capability({can:"filecoin/submit",with:match$1(),nb:struct({content:match$2(),piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.content,i.nb.content,"nb.content"))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),filecoinAccept=capability({can:"filecoin/accept",with:match$1(),nb:struct({content:match$2(),piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.content,i.nb.content,"nb.content"))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),filecoinInfo$1=capability({can:"filecoin/info",with:match$1(),nb:struct({piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),pieceOffer=capability({can:"piece/offer",with:match$1(),nb:struct({piece:PieceLink,group:match()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||and$2(equal(o.nb.group,i.nb.group,"nb.group"))||ok({})}),pieceAccept=capability({can:"piece/accept",with:match$1(),nb:struct({piece:PieceLink,group:match()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||and$2(equal(o.nb.group,i.nb.group,"nb.group"))||ok({})}),aggregateOffer=capability({can:"aggregate/offer",with:match$1(),nb:struct({aggregate:PieceLink,pieces:match$2({version:1})}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.aggregate,i.nb.aggregate,"nb.aggregate"))||and$2(checkLink(o.nb.pieces,i.nb.pieces,"nb.pieces"))||ok({})}),aggregateAccept=capability({can:"aggregate/accept",with:match$1(),nb:struct({aggregate:PieceLink,pieces:match$2()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.aggregate,i.nb.aggregate,"nb.aggregate"))||and$2(checkLink(o.nb.pieces,i.nb.pieces,"nb.pieces"))||ok({})}),dealInfo=capability({can:"deal/info",with:match$1(),nb:struct({piece:PieceLink}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(checkLink(o.nb.piece,i.nb.piece,"nb.piece"))||ok({})}),index=capability({can:"space/index/*",with:SpaceDID$1,derives:equalWith}),add$5=capability({can:"space/index/add",with:SpaceDID$1,nb:struct({index:match$2({code:code$c,version:1})}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.index,i.nb.index,"index"))||ok({})}),get$c=capability({can:"plan/get",with:AccountDID$1,derives:(o,i)=>and$2(equalWith(o,i))||ok({})}),set$5=capability({can:"plan/set",with:AccountDID$1,nb:struct({product:DID}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.product,i.nb.product,"product"))||ok({})}),createAdminSession$1=capability({can:"plan/create-admin-session",with:AccountDID$1,nb:struct({returnURL:string()}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equal(o.nb.returnURL,i.nb.returnURL,"returnURL"))||ok({})}),usage=capability({can:"usage/*",with:SpaceDID$1,derives:equalWith}),report$1=capability({can:"usage/report",with:SpaceDID$1,nb:struct({period:struct({from:integer().greaterThan(-1),to:integer().greaterThan(-1)})}),derives:(o,i)=>{var s,a,c,d;return and$2(equalWith(o,i))||and$2(equal((s=o.nb.period)==null?void 0:s.from,(a=i.nb.period)==null?void 0:a.from,"period.from"))||and$2(equal((c=o.nb.period)==null?void 0:c.to,(d=i.nb.period)==null?void 0:d.to,"period.to"))||ok({})}}),blob$1=capability({can:"space/blob/*",with:SpaceDID$1,derives:equalWith}),content=struct({digest:bytes$1(),size:integer()}),add$4=capability({can:"space/blob/add",with:SpaceDID$1,nb:struct({blob:content}),derives:equalBlob}),remove$5=capability({can:"space/blob/remove",with:SpaceDID$1,nb:struct({digest:bytes$1()}),derives:(o,i)=>o.with!==i.with?fail(`Expected 'with: "${i.with}"' instead got '${o.with}'`):i.nb.digest&&!equals$d(i.nb.digest,o.nb.digest)?fail(`Link ${o.nb.digest?`${o.nb.digest}`:""} violates imposed ${i.nb.digest} constraint.`):ok({})}),list$5=capability({can:"space/blob/list",with:SpaceDID$1,nb:struct({cursor:string().optional(),size:integer().optional()}),derives:(o,i)=>o.with!==i.with?fail(`Expected 'with: "${i.with}"' instead got '${o.with}'`):ok({})}),get$b=capability({can:"space/blob/get/0/1",with:SpaceDID$1,nb:struct({digest:bytes$1()}),derives:(o,i)=>o.with!==i.with?fail(`Expected 'with: "${i.with}"' instead got '${o.with}'`):i.nb.digest&&!equals$d(i.nb.digest,o.nb.digest)?fail(`Link ${o.nb.digest?`${o.nb.digest}`:""} violates imposed ${i.nb.digest} constraint.`):ok({})}),blob=capability({can:"web3.storage/blob/*",with:SpaceDID$1,derives:equalWith}),allocate=capability({can:"web3.storage/blob/allocate",with:match$1(),nb:struct({blob:content,cause:Link,space:SpaceDID$1}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equalBlob(o,i))||and$2(checkLink(o.nb.cause,i.nb.cause,"cause"))||and$2(equal(o.nb.space,i.nb.space,"space"))||ok({})}),accept=capability({can:"web3.storage/blob/accept",with:match$1(),nb:struct({blob:content,ttl:integer().optional(),space:SpaceDID$1,_put:Await}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equalBlob(o,i))||and$2(equal(o.nb.ttl,i.nb.ttl,"ttl"))||and$2(equal(o.nb.space,i.nb.space,"space"))||ok({})}),put=capability({can:"http/put",with:SpaceDID$1,nb:struct({body:content,url:string().or(Await),headers:dictionary({value:string()}).or(Await)}),derives:(o,i)=>and$2(equalWith(o,i))||and$2(equalBody(o,i))||and$2(equal(o.nb.url,i.nb,"url"))||and$2(equal(o.nb.headers,i.nb,"headers"))||ok({})}),abilitiesAsStrings=[top.can,add$8.can,space.can,info.can,upload$2.can,add$9.can,get$g.can,remove$7.can,list$8.can,store$1.can,add$a.can,get$h.can,remove$8.can,list$9.can,access$1.can,authorize.can,attest.can,conclude$1.can,get$e.can,has$1.can,get$f.can,get$d.can,list$6.can,add$6.can,remove$6.can,list$7.can,filecoinOffer$1.can,filecoinSubmit.can,filecoinAccept.can,filecoinInfo$1.can,pieceOffer.can,pieceAccept.can,aggregateOffer.can,aggregateAccept.can,dealInfo.can,admin.can,upload$1.inspect.can,store.inspect.can,get$c.can,set$5.can,createAdminSession$1.can,usage.can,report$1.can,blob$1.can,add$4.can,remove$5.can,list$5.can,blob.can,allocate.can,accept.can,put.can,index.can,add$5.can];function uint8ArrayToArrayBuffer(o){return o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o.buffer.slice(o.byteOffset,o.byteLength+o.byteOffset)}var Fe;const St=class St{constructor(i,s={}){Y(this,Fe);this.meta=i.meta,this.principal=i.principal,this.spaces=i.spaces,this.delegations=i.delegations,this.currentSpace=i.currentSpace,Q(this,Fe,a=>s.store?s.store.save(a):void 0)}static async create(i={},s={}){const a=new St({meta:{name:"agent",type:"device",...i.meta},principal:i.principal??await generate$2(),spaces:i.spaces??new Map,delegations:i.delegations??new Map,currentSpace:i.currentSpace},s);return s.store&&await s.store.save(a.export()),a}static fromExport(i,s){const a=new Map;for(const[c,d]of i.delegations)a.set(c,{delegation:importDAG(d.delegation.map(f=>({cid:CID$5.parse(f.cid).toV1(),bytes:f.bytes instanceof Uint8Array?f.bytes:new Uint8Array(f.bytes)}))),meta:d.meta});return new St({meta:i.meta,principal:Signer.from(i.principal),currentSpace:i.currentSpace,spaces:i.spaces,delegations:a},s)}export(){const i={meta:this.meta,principal:this.principal.toArchive(),currentSpace:this.currentSpace,spaces:this.spaces,delegations:new Map};for(const[s,a]of this.delegations)i.delegations.set(s,{meta:a.meta,delegation:[...a.delegation.export()].map(c=>({cid:c.cid.toString(),bytes:uint8ArrayToArrayBuffer(c.bytes)}))});return i}async addSpace(i,s,a){this.spaces.set(i,s),await(a?this.addDelegation(a):F(this,Fe).call(this,this.export()))}async setCurrentSpace(i){this.currentSpace=i,await F(this,Fe).call(this,this.export())}async addDelegation(i,s){this.delegations.set(i.cid.toString(),{delegation:i,meta:s??{}}),await F(this,Fe).call(this,this.export())}async removeDelegation(i){this.delegations.delete(i.toString()),await F(this,Fe).call(this,this.export())}};Fe=new WeakMap;let AgentData=St;const isSessionCapability=o=>o.can===attest.can,isSessionProof=o=>o.capabilities.some(i=>isSessionCapability(i));function getSessionProofs(o){const i={};for(const{delegation:s}of o.delegations.values())if(isSessionProof(s)){const a=s.capabilities[0];if(a&&!isExpired(s)){const c=a.nb.proof;if(c){const d=c.toString(),f=s.issuer.did();i[d]=i[d]??{},i[d][f]=i[d][f]??[],i[d][f].push(s)}}}return i}match$1({method:"web"});const HOST="https://up.web3.storage",PRINCIPAL=parse$2("did:web:web3.storage"),agentToData=new WeakMap;function connection$2(o={}){return connect({id:o.principal??PRINCIPAL,codec:outbound,channel:o.channel??open$2({url:o.url??new URL(HOST),method:"POST",fetch:o.fetch??globalThis.fetch.bind(globalThis)})})}var se,gt,Mt;const Tt=class Tt{constructor(i,s={}){Y(this,gt);Y(this,se);var c;const a=(c=s.connection)==null?void 0:c.channel;this.url=s.url??(a==null?void 0:a.url)??new URL(HOST),this.connection=s.connection??connection$2({principal:s.servicePrincipal,url:this.url}),Q(this,se,i),agentToData.set(this,F(this,se))}static async create(i,s={}){const a=await AgentData.create(i,s);return new Tt(a,s)}static from(i,s={}){const a=AgentData.fromExport(i,s);return new Tt(a,s)}get issuer(){return F(this,se).principal}get meta(){return F(this,se).meta}get spaces(){return F(this,se).spaces}did(){return F(this,se).principal.did()}async addProof(i){return await this.addProofs([i])}async addProofs(i){for(const s of i)await F(this,se).addDelegation(s,{audience:this.meta});return await this.removeExpiredDelegations(),{}}async removeExpiredDelegations(){for(const[,i]of F(this,se).delegations)isExpired(i.delegation)&&await F(this,se).removeDelegation(i.delegation.cid)}async revoke(i,s={}){const a=s.proofs??[],c=[...this.delegations(),...a].find(f=>f.cid.equals(i));return c?(await this.invokeAndExecute(revoke,{with:this.issuer.did(),nb:{ucan:c.cid},proofs:[c,...a]})).out:{error:new Error(`could not find delegation ${i.toString()} - please include the delegation in options.proofs`)}}proofs(i,s){const a=[];for(const{delegation:d}of te(this,gt,Mt).call(this,i))d.audience.did()===this.issuer.did()&&a.push(d);const c=getSessionProofs(F(this,se));for(const d of a){const f=c[d.asCID.toString()]??{},g=s!=null&&s.sessionProofIssuer?f[s.sessionProofIssuer]??[]:Object.values(f).flat();g.length&&a.push(...g)}return a}delegations(i){const s=[];for(const{delegation:a}of this.delegationsWithMeta(i))s.push(a);return s}delegationsWithMeta(i){const s=[];for(const a of te(this,gt,Mt).call(this,i)){const{delegation:c}=a;!c.capabilities.some(f=>f.can===attest.can)&&c.audience.did()!==this.issuer.did()&&s.push(a)}return s}async createSpace(i){return await generate$1({name:i,agent:this})}async recoverSpace(i,{name:s}){return await fromMnemonic(i,{name:s,agent:this})}async importSpaceFromDelegation(i,{name:s=""}={}){const a=s===""?fromDelegation(i):fromDelegation(i).withName(s);return F(this,se).spaces.set(a.did(),{...a.meta,name:a.name}),await this.addProof(a.delegation),this.currentSpace()||await this.setCurrentSpace(a.did()),a}async setCurrentSpace(i){if(!F(this,se).spaces.has(i))throw new Error(`Agent has no proofs for ${i}.`);return await F(this,se).setCurrentSpace(i),i}currentSpace(){return F(this,se).currentSpace}currentSpaceWithMeta(){if(!F(this,se).currentSpace)return;const i=this.proofs([{can:"space/info",with:F(this,se).currentSpace}]),s=new Set;for(const a of i)for(const c of a.capabilities)s.add(c.can);return{did:F(this,se).currentSpace,proofs:i,capabilities:[...s],meta:F(this,se).spaces.get(F(this,se).currentSpace)}}async delegate(i){const s=this.currentSpaceWithMeta();if(!s)throw new Error("no space selected.");const a=i.abilities.map(d=>({with:s.did,can:d}));for(const d of a)if(!this.proofs([d]).length)throw new Error(`cannot delegate capability ${d.can} with ${d.with}`);const c=await delegate$3({issuer:this.issuer,capabilities:a,proofs:this.proofs(a),facts:[{space:s.meta??{}}],...i});return await F(this,se).addDelegation(c,{audience:i.audienceMeta}),await this.removeExpiredDelegations(),c}async invokeAndExecute(i,s){return(await this.invoke(i,s)).execute(this.connection)}execute(...i){return this.connection.execute(...i)}async invoke(i,s){const a=s.audience||this.connection.id,c=s.with||this.currentSpace();if(!c)throw new Error("No space or resource selected, you need pass a resource.");const d=[...s.proofs||[],...this.proofs([{with:c,can:i.can}],{sessionProofIssuer:a.did()})];if(d.length===0&&s.with!==this.did())throw new Error(`no proofs available for resource ${c} and ability ${i.can}`);return invoke({...s,audience:a,capability:i.create({with:c,nb:s.nb}),issuer:this.issuer,proofs:[...d],nonce:s.nonce})}async getSpaceInfo(i,s){const a=i||this.currentSpace();if(!a)throw new Error("No space selected, you need pass a resource.");const c=await this.invokeAndExecute(info,{...s,with:a});if(c.out.error)throw c.out.error;return c.out.ok}};se=new WeakMap,gt=new WeakSet,Mt=function(i){const s=new Set(i),a=[];for(const[,c]of F(this,se).delegations)if(!isExpired(c.delegation)&&!isTooEarly(c.delegation))if(Array.isArray(i)&&i.length>0)for(const d of s)canDelegateCapability(c.delegation,d)&&a.push(c);else a.push(c);return a};let Agent=Tt;async function addSpacesFromDelegations(o,i){const s=agentToData.get(o);if(!s)throw Object.assign(new Error("cannot determine AgentData for Agent"),{agent:o});const a=new Map,c=i.filter(f=>f.audience.did()===o.did()),d=c.filter(f=>f.capabilities[0].can==="*"&&f.capabilities[0].with==="ucan:*");for(const f of d)for(const g of f.proofs){if(!isDelegation(g)||!g.capabilities[0].with.startsWith("did:key"))continue;const y=fromDelegation(g);a.set(y.did(),y.meta)}for(const f of c){const g=allows(f);for(const[y,b]of Object.entries(g))y.startsWith("did:key")&&Object.keys(b).length>0&&(a.has(y)||a.set(y,{}))}for(const[f,g]of a)await s.addSpace(f,g)}const importAuthorization=async(o,{proofs:i})=>{try{return await o.addProofs(i),await addSpacesFromDelegations(o,i),{ok:{}}}catch(s){return{error:s}}};function pDefer(){const o={};return o.promise=new Promise((i,s)=>{o.resolve=i,o.reject=s}),o}const STORE_NAME="AccessStore",DATA_ID=1;var yt,mt,je,Be,bt,rt,kt;class IndexedDBDriver{constructor(i,s={}){Y(this,rt);Y(this,yt);Y(this,mt);Y(this,je);Y(this,Be);Y(this,bt);Q(this,yt,i),Q(this,mt,s.dbVersion),Q(this,je,s.dbStoreName??STORE_NAME),Q(this,bt,s.autoOpen??!0)}async open(){if(F(this,Be))return;const{resolve:s,reject:a,promise:c}=pDefer(),d=indexedDB.open(F(this,yt),F(this,mt));return d.addEventListener("upgradeneeded",()=>{d.result.createObjectStore(F(this,je),{keyPath:"id"})}),d.addEventListener("success",()=>{Q(this,Be,d.result),s()}),d.addEventListener("error",()=>a(d.error)),c}async close(){const i=F(this,Be);if(!i)throw new Error("Store is not open");i.close(),Q(this,Be,void 0)}async save(i){const s=await te(this,rt,kt).call(this);return await withObjectStore(s,"readwrite",F(this,je),async c=>{const{resolve:d,reject:f,promise:g}=pDefer(),y=c.put({id:DATA_ID,...i});return y.addEventListener("success",()=>d()),y.addEventListener("error",()=>f(new Error("failed to query DB",{cause:y.error}))),g})()}async load(){const i=await te(this,rt,kt).call(this);return await withObjectStore(i,"readonly",F(this,je),async a=>{const{resolve:c,reject:d,promise:f}=pDefer(),g=a.get(DATA_ID);return g.addEventListener("success",()=>c(g.result)),g.addEventListener("error",()=>d(new Error("failed to query DB",{cause:g.error}))),f})()}async reset(){const i=await te(this,rt,kt).call(this);await withObjectStore(i,"readwrite",F(this,je),a=>{const{resolve:c,reject:d,promise:f}=pDefer(),g=a.clear();return g.addEventListener("success",()=>{c()}),g.addEventListener("error",()=>d(new Error("failed to query DB",{cause:g.error}))),f})()}}yt=new WeakMap,mt=new WeakMap,je=new WeakMap,Be=new WeakMap,bt=new WeakMap,rt=new WeakSet,kt=async function(){if(!F(this,Be)){if(!F(this,bt))throw new Error("Store is not open");await this.open()}return F(this,Be)};function withObjectStore(o,i,s,a){return async()=>{const c=o.transaction(s,i),{resolve:d,reject:f,promise:g}=pDefer();let y;c.addEventListener("complete",()=>d(y)),c.addEventListener("abort",()=>f(c.error||new Error("transaction aborted"))),c.addEventListener("error",()=>f(new Error("transaction error",{cause:c.error})));try{y=await a(c.objectStore(s)),c.commit()}catch(b){f(b),c.abort()}return g}}class StoreIndexedDB extends IndexedDBDriver{}const BITS_PER_BYTE=8,FRS_PER_QUAD=4;BigInt(FRS_PER_QUAD);const IN_BITS_FR=254,OUT_BITS_FR=256,IN_BYTES_PER_QUAD=FRS_PER_QUAD*IN_BITS_FR/BITS_PER_BYTE,OUT_BYTES_PER_QUAD=FRS_PER_QUAD*OUT_BITS_FR/BITS_PER_BYTE,PADDED_BYTES_PER_QUAD=BigInt(IN_BYTES_PER_QUAD);BigInt(OUT_BYTES_PER_QUAD);const FR_RATIO=IN_BITS_FR/OUT_BITS_FR,NODE_SIZE=OUT_BYTES_PER_QUAD/FRS_PER_QUAD,EXPANDED_BYTES_PER_NODE=BigInt(NODE_SIZE),MIN_PAYLOAD_SIZE=2*NODE_SIZE+1,from$f=o=>{if(o instanceof Uint8Array){if(o.length>NODE_SIZE)return o.subarray(0,NODE_SIZE);if(o.length==NODE_SIZE)return o}const i=new Uint8Array(NODE_SIZE);return i.set([...o]),i},empty$4=()=>EMPTY$4,EMPTY$4=from$f(new Uint8Array(NODE_SIZE).fill(0));Object.freeze(EMPTY$4.buffer);function coerce$6(o){if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")}const name$6="sha2-256",code$7=18,size$2=32,prefix=new Uint8Array([18,32]);let Digest$7=class{constructor(i){this.code=code$7,this.name=name$6,this.bytes=i,this.size=size$2,this.digest=i.subarray(2)}};const digest$2=o=>{const i=new Uint8Array(prefix.length+size$2);return i.set(prefix,0),i.set(sha256$7(o),prefix.length),new Digest$7(i)},code$6=code$7,SHA256=Object.freeze(Object.defineProperty({__proto__:null,code:code$6,digest:digest$2,name:name$6,size:size$2},Symbol.toStringTag,{value:"Module"}));function base$6(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$6=base$6,_brrp__multiformats_scope_baseX$6=src$6;let Encoder$6=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$6=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$8(this,i)}},ComposedDecoder$6=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$8(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$8(o,i){return new ComposedDecoder$6({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$6=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$6(i,s,a),this.decoder=new Decoder$6(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$e({name:o,prefix:i,encode:s,decode:a}){return new Codec$6(o,i,s,a)}function baseX$6({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$6(s,o);return from$e({prefix:i,name:o,encode:a,decode:d=>coerce$6(c(d))})}function decode$u(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$k(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<=INT$7;)i[s++]=o&255|MSB$7,o/=128;for(;o&MSBALL$7;)i[s++]=o&255|MSB$7,o>>>=7;return i[s]=o|0,encode$j.bytes=s-a+1,i}var decode$t=read$7,MSB$1$7=128,REST$1$7=127;function read$7(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$7.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$7)<=MSB$1$7);return read$7.bytes=d-a,s}var N1$6=Math.pow(2,7),N2$6=Math.pow(2,14),N3$6=Math.pow(2,21),N4$6=Math.pow(2,28),N5$6=Math.pow(2,35),N6$6=Math.pow(2,42),N7$6=Math.pow(2,49),N8$6=Math.pow(2,56),N9$6=Math.pow(2,63),length$6=function(o){return o{const a=new Uint8Array(o.length+i.length);return a.set(o,0),a.set(i,o.length),truncatedHash(a,s)};function truncate(o){return o[NODE_SIZE-1]&=63,o}const MAX_LEVEL=64;class ZeroComm{constructor(){this.bytes=new Uint8Array(MAX_LEVEL*NODE_SIZE),this.bytes.set(empty$4(),0),this.node=empty$4(),this.length=NODE_SIZE}slice(i,s){for(;this.length{if(o<0||o>=MAX_LEVEL)throw new Error(`Only levels between 0 and ${MAX_LEVEL-1} inclusive are available`);return ZERO_COMM.slice(NODE_SIZE*o,NODE_SIZE*(o+1))},split$1=o=>{const i=o.length/NODE_SIZE,s=new Array(i);for(let a=0;atoZeroPaddedSize(o)/FR_RATIO,pad=(o,i=new Uint8Array(toPieceSize(o.length)))=>{const a=toZeroPaddedSize(o.byteLength)/IN_BYTES_PER_QUAD;for(let c=0;c>6;i[f+63]&=63;for(let g=64;g<96;g++)i[f+g]=o[d+g]<<4|o[d+g-1]>>4;i[f+95]&=63;for(let g=96;g<127;g++)i[f+g]=o[d+g]<<6|o[d+g-1]>>2;i[f+127]=o[d+126]>>2}return i},log2Floor=o=>{let i=0n;for(;o>>=1n;)i++;return Number(i)},log2Ceil=o=>o<=1n?0:log2Floor(BigInt(o)-1n)+1,toPadding=o=>toPadded(o)-o,toPadded=o=>toQauds(o)*PADDED_BYTES_PER_QUAD,toQauds=o=>{const i=(o+PADDED_BYTES_PER_QUAD-1n)/PADDED_BYTES_PER_QUAD;return 2n**BigInt(log2Ceil(i))},fromHeight=o=>fromWidth(2n**BigInt(o)),fromWidth=o=>o*EXPANDED_BYTES_PER_NODE,name$5="fr32-sha2-256-trunc254-padded-binary-tree",code$5=4113,MAX_PADDING_SIZE=9,HEIGHT_SIZE=1,ROOT_SIZE=size$2,MAX_DIGEST_SIZE=MAX_PADDING_SIZE+HEIGHT_SIZE+size$2,TAG_SIZE=encodingLength$6(code$5),MAX_SIZE=TAG_SIZE+encodingLength$6(MAX_DIGEST_SIZE)+MAX_DIGEST_SIZE,MAX_HEIGHT$1=255,MAX_PAYLOAD_SIZE$1=fromHeight(MAX_HEIGHT$1)*BigInt(IN_BITS_FR)/BigInt(OUT_BITS_FR),fromPiece=({padding:o,height:i,root:s})=>{const a=encodingLength$6(Number(o)),c=a+HEIGHT_SIZE+ROOT_SIZE,d=encodingLength$6(c),f=TAG_SIZE+d+c;let g=0;const y=new Uint8Array(f);return encodeTo$6(code$5,y,g),g+=TAG_SIZE,encodeTo$6(c,y,g),g+=d,encodeTo$6(Number(o),y,g),g+=a,y[g]=i,g+=HEIGHT_SIZE,y.set(s,g),new Digest$6(y)},fromBytes$3=o=>new Digest$6(o),toBytes$2=({digest:o})=>{const s=encodingLength$6(o.length)+TAG_SIZE;if(o.byteOffset>=s){const c=new Uint8Array(o.buffer,o.byteOffset-s,o.byteOffset+o.length),[d,f]=decode$s(c);if(d===code$5&&decode$s(c,f)[0]===o.length)return c}const a=new Uint8Array(o.length+s);return encodeTo$6(code$5,a),encodeTo$6(o.length,a,TAG_SIZE),a.set(o,s),a},height=({digest:o})=>{const[,i]=decode$s(o);return o[i]},padding=({digest:o})=>{const[i]=decode$s(o);return BigInt(i)},root=({digest:o})=>{const[,i]=decode$s(o);return o.subarray(i+HEIGHT_SIZE,i+HEIGHT_SIZE+size$2)};let Digest$6=class{constructor(i){this.bytes=i;const[s]=decode$s(i);if(s!==code$5)throw new RangeError(`Expected multihash with code ${code$5}`);let a=TAG_SIZE;const[c,d]=decode$s(i,a);a+=d;const f=i.subarray(a);if(f.length!==c)throw new RangeError(`Invalid multihash size expected ${a+c} bytes, got ${i.length} bytes`);this.digest=f}get name(){return name$5}get code(){return code$5}get size(){return this.digest.length}get padding(){return padding(this)}get height(){return height(this)}get root(){return root(this)}};const digest$1=Object.freeze(Object.defineProperty({__proto__:null,HEIGHT_SIZE,MAX_DIGEST_SIZE,MAX_HEIGHT:MAX_HEIGHT$1,MAX_PAYLOAD_SIZE:MAX_PAYLOAD_SIZE$1,MAX_SIZE,ROOT_SIZE,TAG_SIZE,code:code$5,fromBytes:fromBytes$3,fromPiece,height,name:name$5,padding,root,toBytes:toBytes$2},Symbol.toStringTag,{value:"Module"})),name$4="fr32-sha2-256-trunc254-padded-binary-tree",code$4=4113,MAX_HEIGHT=255,MAX_PAYLOAD_SIZE=fromHeight(MAX_HEIGHT)*BigInt(IN_BITS_FR)/BigInt(OUT_BITS_FR),digest=o=>{const i=new Hasher$4;return i.write(o),i.digest()},create$i=()=>new Hasher$4;let Hasher$4=class{constructor(){this.bytesWritten=0n,this.buffer=new Uint8Array(IN_BYTES_PER_QUAD),this.offset=0,this.layers=[[]]}count(){return this.bytesWritten}digest(){const i=new Uint8Array(MAX_SIZE),s=this.digestInto(i,0,!0);return fromBytes$3(i.subarray(0,s))}digestInto(i,s=0,a=!0){const{buffer:c,layers:d,offset:f,bytesWritten:g}=this;let[y,...b]=d;(f>0||g===0n)&&(y=[...y,...split$1(pad(c.fill(0,f)))]);const $=build([y,...b]),x=$.length-1,[T]=$[x],A=Number(toPadding(this.bytesWritten)),E=encodingLength$6(A);let S=s;if(a){encodeTo$6(code$4,i,S),S+=TAG_SIZE;const _=E+HEIGHT_SIZE+ROOT_SIZE,C=encodingLength$6(_);encodeTo$6(_,i,S),S+=C}return encodeTo$6(A,i,S),S+=E,i[S]=x,S+=1,i.set(T,S),S+=T.length,S-s}write(i){const{buffer:s,offset:a,layers:c}=this,d=c[0],{length:f}=i;if(f===0)return this;if(this.bytesWritten+BigInt(f)>MAX_PAYLOAD_SIZE)throw new RangeError(`Writing ${f} bytes exceeds max payload size of ${MAX_PAYLOAD_SIZE}`);if(a+fflush$1(o,!1),build=o=>flush$1([...o],!0),flush$1=(o,i)=>{let s=0;for(;s0&&a&&c.push(fromLevel(s)),s+=1,a=a?i?[...a]:a:[];let d=0;for(;d+1{const s=[];for(const c of o.receipts.values()){const d=c.out;d.ok?s.push(d.ok):s.push({...d.error,error:!0})}const a=encode$A(s);return{headers:HEADERS,body:a}},response=Object.freeze(Object.defineProperty({__proto__:null,contentType:contentType$2,encode:encode$i},Symbol.toStringTag,{value:"Module"})),contentType$1="application/car",decode$r=async({body:o})=>{const{roots:i,blocks:s}=decode$M(o),a=[];for(const{cid:d}of i){const f=view$2({root:d,blocks:s});a.push(f)}return await build$1({invocations:a})},request$1=Object.freeze(Object.defineProperty({__proto__:null,contentType:contentType$1,decode:decode$r},Symbol.toStringTag,{value:"Module"})),{contentType}=request$1;inbound({decoders:{[contentType]:request$1,[contentType$3]:request$3},encoders:{"*/*;q=0.1":response,[contentType$3]:response$1}});const services={STOREFRONT:{url:new URL("https://up.web3.storage"),principal:parse$2("did:web:web3.storage")},AGGREGATOR:{url:new URL("https://aggregator.web3.storage"),principal:parse$2("did:web:web3.storage")},DEALER:{url:new URL("https://dealer.web3.storage"),principal:parse$2("did:web:web3.storage")},DEAL_TRACKER:{url:new URL("https://tracker.web3.storage"),principal:parse$2("did:web:web3.storage")}},connection$1=connect({id:services.STOREFRONT.principal,codec:outbound,channel:open$2({url:services.STOREFRONT.url,method:"POST"})});async function filecoinOffer({issuer:o,with:i,proofs:s,audience:a},c,d,f={}){const g=f.connection??connection$1;return await filecoinOffer$1.invoke({issuer:o,audience:a??services.STOREFRONT.principal,with:i,nb:{content:c,piece:d},proofs:s,expiration:1/0}).execute(g)}async function filecoinInfo({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection$1;return await filecoinInfo$1.invoke({issuer:o,audience:a??services.STOREFRONT.principal,with:i,nb:{piece:c},proofs:s}).execute(f)}connect({id:services.AGGREGATOR.principal,codec:outbound,channel:open$2({url:services.AGGREGATOR.url,method:"POST"})});connect({id:services.DEALER.principal,codec:outbound,channel:open$2({url:services.DEALER.url,method:"POST"})});connect({id:services.DEAL_TRACKER.principal,codec:outbound,channel:open$2({url:services.DEAL_TRACKER.url,method:"POST"})});function base$5(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$5=base$5,_brrp__multiformats_scope_baseX$5=src$5;const equals$a=(o,i)=>{if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s{if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")};let Encoder$5=class{constructor(i,s,a){this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$5=class{constructor(i,s,a){if(this.name=i,this.prefix=s,s.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s.codePointAt(0),this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$7(this,i)}},ComposedDecoder$5=class{constructor(i){this.decoders=i}or(i){return or$7(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const or$7=(o,i)=>new ComposedDecoder$5({...o.decoders||{[o.prefix]:o},...i.decoders||{[i.prefix]:i}});let Codec$5=class{constructor(i,s,a,c){this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$5(i,s,a),this.decoder=new Decoder$5(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};const from$d=({name:o,prefix:i,encode:s,decode:a})=>new Codec$5(o,i,s,a),baseX$5=({prefix:o,name:i,alphabet:s})=>{const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$5(s,i);return from$d({prefix:o,name:i,encode:a,decode:d=>coerce$5(c(d))})},decode$q=(o,i,s,a)=>{const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f},encode$h=(o,i,s)=>{const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f&&(d+=i[c&g<from$d({prefix:i,name:o,encode(c){return encode$h(c,a,s)},decode(c){return decode$q(c,a,s,o)}}),base32$4=rfc4648$5({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$5({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$5({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$5({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$5({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$5({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$5({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$5({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$5({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const base58btc$4=baseX$5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var encode_1$5=encode$g,MSB$6=128,REST$6=127,MSBALL$6=~REST$6,INT$6=Math.pow(2,31);function encode$g(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$6;)i[s++]=o&255|MSB$6,o/=128;for(;o&MSBALL$6;)i[s++]=o&255|MSB$6,o>>>=7;return i[s]=o|0,encode$g.bytes=s-a+1,i}var decode$p=read$6,MSB$1$6=128,REST$1$6=127;function read$6(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$6.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$6)<=MSB$1$6);return read$6.bytes=d-a,s}var N1$5=Math.pow(2,7),N2$5=Math.pow(2,14),N3$5=Math.pow(2,21),N4$5=Math.pow(2,28),N5$5=Math.pow(2,35),N6$5=Math.pow(2,42),N7$5=Math.pow(2,49),N8$5=Math.pow(2,56),N9$5=Math.pow(2,63),length$5=function(o){return o[_brrp_varint$5.decode(o,i),_brrp_varint$5.decode.bytes],encodeTo$5=(o,i,s=0)=>(_brrp_varint$5.encode(o,i,s),i),encodingLength$5=o=>_brrp_varint$5.encodingLength(o),create$h=(o,i)=>{const s=i.byteLength,a=encodingLength$5(o),c=a+encodingLength$5(s),d=new Uint8Array(c+s);return encodeTo$5(o,d,0),encodeTo$5(s,d,a),d.set(i,c),new Digest$5(o,s,i,d)},decode$n=o=>{const i=coerce$5(o),[s,a]=decode$o(i),[c,d]=decode$o(i.subarray(a)),f=i.subarray(a+d);if(f.byteLength!==c)throw new Error("Incorrect length");return new Digest$5(s,c,f,i)},equals$9=(o,i)=>{if(o===i)return!0;{const s=i;return o.code===s.code&&o.size===s.size&&s.bytes instanceof Uint8Array&&equals$a(o.bytes,s.bytes)}};let Digest$5=class{constructor(i,s,a,c){this.code=i,this.size=s,this.digest=a,this.bytes=c}};const format$4=(o,i)=>{const{bytes:s,version:a}=o;switch(a){case 0:return toStringV0$4(s,baseCache$4(o),i||base58btc$4.encoder);default:return toStringV1$4(s,baseCache$4(o),i||base32$4.encoder)}},cache$5=new WeakMap,baseCache$4=o=>{const i=cache$5.get(o);if(i==null){const s=new Map;return cache$5.set(o,s),s}return i};let CID$4=class ye{constructor(i,s,a,c){this.code=s,this.version=i,this.multihash=a,this.bytes=c,this["/"]=c}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:i,multihash:s}=this;if(i!==DAG_PB_CODE$5)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(s.code!==SHA_256_CODE$4)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return ye.createV0(s)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:i,digest:s}=this.multihash,a=create$h(i,s);return ye.createV1(this.code,a)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(i){return ye.equals(this,i)}static equals(i,s){const a=s;return a&&i.code===a.code&&i.version===a.version&&equals$9(i.multihash,a.multihash)}toString(i){return format$4(this,i)}toJSON(){return{"/":format$4(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(i){if(i==null)return null;const s=i;if(s instanceof ye)return s;if(s["/"]!=null&&s["/"]===s.bytes||s.asCID===s){const{version:a,code:c,multihash:d,bytes:f}=s;return new ye(a,c,d,f||encodeCID$4(a,c,d.bytes))}else if(s[cidSymbol$4]===!0){const{version:a,multihash:c,code:d}=s,f=decode$n(c);return ye.create(a,d,f)}else return null}static create(i,s,a){if(typeof s!="number")throw new Error("String codecs are no longer supported");if(!(a.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(i){case 0:{if(s!==DAG_PB_CODE$5)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$5}) block encoding`);return new ye(i,s,a,a.bytes)}case 1:{const c=encodeCID$4(i,s,a.bytes);return new ye(i,s,a,c)}default:throw new Error("Invalid version")}}static createV0(i){return ye.create(0,DAG_PB_CODE$5,i)}static createV1(i,s){return ye.create(1,i,s)}static decode(i){const[s,a]=ye.decodeFirst(i);if(a.length)throw new Error("Incorrect length");return s}static decodeFirst(i){const s=ye.inspectBytes(i),a=s.size-s.multihashSize,c=coerce$5(i.subarray(a,a+s.multihashSize));if(c.byteLength!==s.multihashSize)throw new Error("Incorrect length");const d=c.subarray(s.multihashSize-s.digestSize),f=new Digest$5(s.multihashCode,s.digestSize,d,c);return[s.version===0?ye.createV0(f):ye.createV1(s.codec,f),i.subarray(s.size)]}static inspectBytes(i){let s=0;const a=()=>{const[x,T]=decode$o(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$5;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$4(i,s),d=ye.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$4(d).set(a,i),d}};const parseCIDtoBytes$4=(o,i)=>{switch(o[0]){case"Q":{const s=i||base58btc$4;return[base58btc$4.prefix,s.decode(`${base58btc$4.prefix}${o}`)]}case base58btc$4.prefix:{const s=i||base58btc$4;return[base58btc$4.prefix,s.decode(o)]}case base32$4.prefix:{const s=i||base32$4;return[base32$4.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}},toStringV0$4=(o,i,s)=>{const{prefix:a}=s;if(a!==base58btc$4.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c},toStringV1$4=(o,i,s)=>{const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c},DAG_PB_CODE$5=112,SHA_256_CODE$4=18,encodeCID$4=(o,i,s)=>{const a=encodingLength$5(o),c=a+encodingLength$5(i),d=new Uint8Array(c+s.byteLength);return encodeTo$5(o,d,0),encodeTo$5(i,d,a),d.set(s,c),d},cidSymbol$4=Symbol.for("@ipld/js-cid/CID"),create$g=(o,i)=>CID$4.create(1,o,i),name$3="raw",code$3=85,encode$f=o=>coerce$5(o),decode$m=o=>coerce$5(o),raw=Object.freeze(Object.defineProperty({__proto__:null,code:code$3,decode:decode$m,encode:encode$f,name:name$3},Symbol.toStringTag,{value:"Module"})),from$c=({name:o,code:i,encode:s})=>new Hasher$3(o,i,s);let Hasher$3=class{constructor(i,s,a){this.name=i,this.code=s,this.encode=a}digest(i){if(i instanceof Uint8Array){const s=this.encode(i);return s instanceof Uint8Array?create$h(this.code,s):s.then(a=>create$h(this.code,a))}else throw Error("Unknown type, must be binary type")}};const sha$2=o=>async i=>new Uint8Array(await crypto.subtle.digest(o,i)),sha256$2=from$c({name:"sha2-256",code:18,encode:sha$2("SHA-256")});var retry$2={};function RetryOperation(o,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(o)),this._timeouts=o,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(o){if(this._timeout&&clearTimeout(this._timeout),!o)return!1;var i=new Date().getTime();if(o&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(o),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(o);var s=this._timeouts.shift();if(s===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),s=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},s),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(o,i){this._fn=o,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var s=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){s._operationTimeoutCb()},s._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(o){console.log("Using RetryOperation.try() is deprecated"),this.attempt(o)};RetryOperation.prototype.start=function(o){console.log("Using RetryOperation.start() is deprecated"),this.attempt(o)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var o={},i=null,s=0,a=0;a=s&&(i=c,s=f)}return i};(function(o){var i=retry_operation;o.operation=function(s){var a=o.timeouts(s);return new i(a,{forever:s&&(s.forever||s.retries===1/0),unref:s&&s.unref,maxRetryTime:s&&s.maxRetryTime})},o.timeouts=function(s){if(s instanceof Array)return[].concat(s);var a={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var c in s)a[c]=s[c];if(a.minTimeout>a.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var d=[],f=0;f{const a=s.retries-(i-1);return o.attemptNumber=i,o.retriesLeft=a,o},isNetworkError=o=>networkErrorMsgs.has(o),getDOMException=o=>globalThis.DOMException===void 0?new Error(o):new DOMException(o);async function pRetry(o,i){return new Promise((s,a)=>{i={onFailedAttempt(){},retries:10,...i};const c=retry$1.operation(i);c.attempt(async d=>{try{s(await o(d))}catch(f){if(!(f instanceof Error)){a(new TypeError(`Non-error was thrown: "${f}". You should only throw errors.`));return}if(f instanceof AbortError)c.stop(),a(f.originalError);else if(f instanceof TypeError&&!isNetworkError(f.message))c.stop(),a(f);else{decorateErrorWithCounts(f,d,i);try{await i.onFailedAttempt(f)}catch(g){a(g);return}c.retry(f)||a(c.mainError())}}}),i.signal&&!i.signal.aborted&&i.signal.addEventListener("abort",()=>{c.stop();const d=i.signal.reason===void 0?getDOMException("The operation was aborted."):i.signal.reason;a(d instanceof Error?d:getDOMException(d))},{once:!0})})}const serviceURL=new URL("https://up.web3.storage"),servicePrincipal=parse$2("did:web:web3.storage"),receiptsEndpoint="https://up.web3.storage/receipt/",connection=connect({id:servicePrincipal,codec:outbound,channel:open$2({url:serviceURL,method:"POST"})}),REQUEST_RETRIES=3;function createUploadProgressHandler$1(o,i){function s({total:a,loaded:c,lengthComputable:d}){return i({total:a,loaded:c,lengthComputable:d,url:o})}return s}async function add$3({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=c instanceof Uint8Array?c:new Uint8Array(await c.arrayBuffer()),g=await link$2(f),y=d.connection??connection,b=await pRetry(async()=>await add$a.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:{link:g,size:f.length},proofs:s,nonce:d.nonce}).execute(y),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!b.out.ok)throw new Error(`failed ${add$a.can} invocation`,{cause:b.out.error});if(b.out.ok.status==="done")return g;const $=b.out.ok,x=d.fetchWithUploadProgress||d.fetch||globalThis.fetch.bind(globalThis);let T=!1;const A=await pRetry(async()=>{var E;try{const S=await x($.url,{method:"PUT",body:c,headers:$.headers,signal:d.signal,onUploadProgress:_=>{T=!0,d.onUploadProgress&&createUploadProgressHandler$1($.url,d.onUploadProgress)(_)},duplex:"half"});if(S.status>=400&&S.status<500)throw new AbortError(`upload failed: ${S.status}`);return S}catch(S){throw((E=d.signal)==null?void 0:E.aborted)===!0?new AbortError("upload aborted"):S}},{retries:d.retries??REQUEST_RETRIES});if(!T&&d.onUploadProgress){const E=new Blob([c]);d.onUploadProgress({total:E.size,loaded:E.size,lengthComputable:!1})}if(!A.ok)throw new Error(`upload failed: ${A.status}`);return g}async function get$a({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await pRetry(async()=>await get$h.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:{link:c},proofs:s,nonce:d.nonce}).execute(f),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!g.out.ok)throw new Error(`failed ${get$h.can} invocation`,{cause:g.out.error});return g.out.ok}async function list$4({issuer:o,with:i,proofs:s,audience:a},c={}){const d=c.connection??connection,f=await list$9.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),proofs:s,nb:{cursor:c.cursor,size:c.size,pre:c.pre},nonce:c.nonce}).execute(d);if(!f.out.ok)throw new Error(`failed ${list$9.can} invocation`,{cause:f.out.error});return f.out.ok}async function remove$4({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await remove$8.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:{link:c},proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${remove$8.can} invocation`,{cause:g.out.error});return g.out}class ReceiptNotFound extends Error{constructor(i){super(),this.taskCid=i}get reason(){return`receipt not found for task ${this.taskCid} in the indexed workflow`}get name(){return"ReceiptNotFound"}}class ReceiptMissing extends Error{constructor(i){super(),this.taskCid=i}get reason(){return`receipt missing for task ${this.taskCid}`}get name(){return"ReceiptMissing"}}async function poll(o,i={}){return await pRetry(async()=>{const s=await get$9(o,i);if(s.error)throw s.error.name==="ReceiptNotFound"?s.error:new AbortError(new Error("failed to fetch blob/accept receipt",{cause:s.error}));return s.ok},{onFailedAttempt:console.warn,retries:i.retries??REQUEST_RETRIES})}async function get$9(o,i={}){const s=new URL(o.toString(),i.receiptsEndpoint??receiptsEndpoint),c=await(i.fetch??globalThis.fetch.bind(globalThis))(s);if(c.status===404)return{error:new ReceiptNotFound(o)};const d=new Uint8Array(await c.arrayBuffer()),g=(await decode$K({body:d,headers:{}})).receipts.get(o.toString());return g?{ok:g}:{error:new ReceiptMissing(o)}}function createUploadProgressHandler(o,i){return({total:a,loaded:c,lengthComputable:d})=>i({total:a,loaded:c,lengthComputable:d,url:o})}function getConcludeReceipt(o){const i=new Map;for(const s of o.iterateIPLDBlocks())i.set(`${s.cid}`,s);return view$1({root:o.capabilities[0].nb.receipt,blocks:i})}function parseBlobAddReceiptNext(o){const i=o.fx.fork,s=i.find($=>$.capabilities[0].can===allocate.can),a=i.filter($=>$.capabilities[0].can===conclude$1.can),c=i.find($=>$.capabilities[0].can===put.can),d=i.find($=>$.capabilities[0].can===accept.can);if(!s||!a.length||!c||!d)throw new Error("mandatory effects not received");const f=a.map($=>getConcludeReceipt($)),g=f.find($=>$.ran.link().equals(s.cid)),y=f.find($=>$.ran.link().equals(c.cid)),b=f.find($=>$.ran.link().equals(d.cid));if(!g)throw new Error("mandatory effects not received");return{allocate:{task:s,receipt:g},put:{task:c,receipt:y},accept:{task:d,receipt:b}}}function createConcludeInvocation(o,i,s){const a=[],c=[];for(const f of s.iterateIPLDBlocks())a.push(f),c.push(f.cid);const d=conclude$1.invoke({issuer:o,audience:i,with:o.toDIDKey(),nb:{receipt:s.link()},expiration:1/0,facts:[{...c}]});for(const f of a)d.attach(f);return d}async function add$2({issuer:o,with:i,proofs:s,audience:a},c,d,f={}){var B;const g=d instanceof Uint8Array?d:new Uint8Array(await d.arrayBuffer()),y=g.length,b=f.connection??connection,$=await pRetry(async()=>await add$4.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$8(c,y),proofs:s,nonce:f.nonce}).execute(b),{onFailedAttempt:console.warn,retries:f.retries??REQUEST_RETRIES});if(!$.out.ok)throw new Error(`failed ${add$4.can} invocation`,{cause:$.out.error});const x=parseBlobAddReceiptNext($),{receipt:T}=x.allocate;if(!T.out.ok)throw new Error(`failed ${add$4.can} invocation`,{cause:T.out.error});const{address:A}=T.out.ok;if(A){const D=f.fetchWithUploadProgress||f.fetch||globalThis.fetch.bind(globalThis);let I=!1;const{status:L}=await pRetry(async()=>{var N;try{const O=await D(A.url,{method:"PUT",mode:"cors",body:g,headers:A.headers,signal:f.signal,onUploadProgress:R=>{I=!0,f.onUploadProgress&&createUploadProgressHandler(A.url,f.onUploadProgress)(R)},duplex:"half"});if(O.status>=400&&O.status<500)throw new AbortError(`upload failed: ${O.status}`);return O}catch(O){throw((N=f.signal)==null?void 0:N.aborted)===!0?new AbortError("upload aborted"):O}},{retries:f.retries??REQUEST_RETRIES});if(L!==200)throw new Error(`upload failed: ${L}`);if(!I&&f.onUploadProgress){const N=new Blob([g]);f.onUploadProgress({total:N.size,loaded:N.size,lengthComputable:!1})}}let{receipt:E}=x.put;if(!(E!=null&&E.out.ok)){const D=from$h(x.put.task.facts[0].keys);if(E=await issue$1({issuer:D,ran:x.put.task.cid,result:{ok:{}}}),!(await createConcludeInvocation(o,a??servicePrincipal,E).execute(b)).out.ok)throw new Error(`failed ${add$4.can} invocation`,{cause:$.out.error})}let{receipt:S}=x.accept;S!=null&&S.out.ok||(S=await poll(x.accept.task.link(),f));const _=new Map([...S.iterateIPLDBlocks()].map(D=>[`${D.cid}`,D]));return{site:view$3({root:(B=S.out.ok)==null?void 0:B.site,blocks:_})}}const ability$2=add$4.can,input$8=(o,i)=>({blob:{digest:o.bytes,size:i}});async function get$8({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await get$b.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$7(c),proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${get$b.can} invocation`,{cause:g.out.error});return g.out}get$b.can;const input$7=o=>({digest:o.bytes});async function list$3({issuer:o,with:i,proofs:s,audience:a},c={}){const d=c.connection??connection,f=await list$5.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),proofs:s,nb:input$6(c.cursor,c.size),nonce:c.nonce}).execute(d);if(!f.out.ok)throw new Error(`failed ${list$5.can} invocation`,{cause:f.out.error});return f.out.ok}list$5.can;const input$6=(o,i)=>({cursor:o,size:i});async function remove$3({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await remove$5.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$5(c),proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${remove$5.can} invocation`,{cause:g.out.error});return g.out}remove$5.can;const input$5=o=>({digest:o.bytes});async function add$1({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await pRetry(async()=>await add$5.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$4(c),proofs:s}).execute(f),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!g.out.ok)throw new Error(`failed ${add$5.can} invocation`,{cause:g.out.error});return g.out.ok}const ability$1=add$5.can,input$4=o=>({index:o});async function add({issuer:o,with:i,proofs:s,audience:a},c,d,f={}){const g=f.connection??connection,y=await pRetry(async()=>await add$9.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$3(c,d),proofs:s,nonce:f.nonce}).execute(g),{onFailedAttempt:console.warn,retries:f.retries??REQUEST_RETRIES});if(!y.out.ok)throw new Error(`failed ${add$9.can} invocation`,{cause:y.out.error});return y.out.ok}const ability=add$9.can,input$3=(o,i)=>({root:o,shards:i});async function get$7({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await pRetry(async()=>await get$g.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input$2(c),proofs:s,nonce:d.nonce}).execute(f),{onFailedAttempt:console.warn,retries:d.retries??REQUEST_RETRIES});if(!g.out.ok)throw new Error(`failed ${get$g.can} invocation`,{cause:g.out.error});return g.out.ok}get$g.can;const input$2=o=>({root:o});async function list$2({issuer:o,with:i,proofs:s,audience:a},c={}){const d=c.connection??connection,f=await list$8.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),proofs:s,nb:input$1(c.cursor,c.size,c.pre),nonce:c.nonce}).execute(d);if(!f.out.ok)throw new Error(`failed ${list$8.can} invocation`,{cause:f.out.error});return f.out.ok}list$8.can;const input$1=(o,i,s)=>({cursor:o,size:i,pre:s});async function remove$2({issuer:o,with:i,proofs:s,audience:a},c,d={}){const f=d.connection??connection,g=await remove$7.invoke({issuer:o,audience:a??servicePrincipal,with:SpaceDID$1.from(i),nb:input(c),proofs:s,nonce:d.nonce}).execute(f);if(!g.out.ok)throw new Error(`failed ${remove$7.can} invocation`,{cause:g.out.error});return g.out.ok}remove$7.can;const input=o=>({root:o});function equals$8(o,i){if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$4=base$4,_brrp__multiformats_scope_baseX$4=src$4;let Encoder$4=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$4=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$6(this,i)}},ComposedDecoder$4=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$6(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$6(o,i){return new ComposedDecoder$4({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$4=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$4(i,s,a),this.decoder=new Decoder$4(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$b({name:o,prefix:i,encode:s,decode:a}){return new Codec$4(o,i,s,a)}function baseX$4({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$4(s,o);return from$b({prefix:i,name:o,encode:a,decode:d=>coerce$4(c(d))})}function decode$l(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$e(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<=INT$5;)i[s++]=o&255|MSB$5,o/=128;for(;o&MSBALL$5;)i[s++]=o&255|MSB$5,o>>>=7;return i[s]=o|0,encode$d.bytes=s-a+1,i}var decode$k=read$5,MSB$1$5=128,REST$1$5=127;function read$5(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$5.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$5)<=MSB$1$5);return read$5.bytes=d-a,s}var N1$4=Math.pow(2,7),N2$4=Math.pow(2,14),N3$4=Math.pow(2,21),N4$4=Math.pow(2,28),N5$4=Math.pow(2,35),N6$4=Math.pow(2,42),N7$4=Math.pow(2,49),N8$4=Math.pow(2,56),N9$4=Math.pow(2,63),length$4=function(o){return o{const[x,T]=decode$j(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$4;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$3(i,s),d=me.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$3(d).set(a,i),d}};function parseCIDtoBytes$3(o,i){switch(o[0]){case"Q":{const s=i??base58btc$3;return[base58btc$3.prefix,s.decode(`${base58btc$3.prefix}${o}`)]}case base58btc$3.prefix:{const s=i??base58btc$3;return[base58btc$3.prefix,s.decode(o)]}case base32$3.prefix:{const s=i??base32$3;return[base32$3.prefix,s.decode(o)]}case base36$2.prefix:{const s=i??base36$2;return[base36$2.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}}function toStringV0$3(o,i,s){const{prefix:a}=s;if(a!==base58btc$3.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c}function toStringV1$3(o,i,s){const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c}const DAG_PB_CODE$4=112,SHA_256_CODE$3=18;function encodeCID$3(o,i,s){const a=encodingLength$4(o),c=a+encodingLength$4(i),d=new Uint8Array(c+s.byteLength);return encodeTo$4(o,d,0),encodeTo$4(i,d,a),d.set(s,c),d}const cidSymbol$3=Symbol.for("@ipld/js-cid/CID"),textDecoder=new TextDecoder;function decodeVarint(o,i){let s=0;for(let a=0;;a+=7){if(a>=64)throw new Error("protobuf: varint overflow");if(i>=o.length)throw new Error("protobuf: unexpected end of data");const c=o[i++];if(s+=a<28?(c&127)<o.length)throw new Error("protobuf: unexpected end of data");return[o.subarray(i,a),a]}function decodeKey(o,i){let s;return[s,i]=decodeVarint(o,i),[s&7,s>>3,i]}function decodeLink(o){const i={},s=o.length;let a=0;for(;as)throw new Error("protobuf: (PBLink) unexpected end of data");return i}function decodeNode(o){const i=o.length;let s=0,a,c=!1,d;for(;si)throw new Error("protobuf: (PBNode) unexpected end of data");const f={};return d&&(f.Data=d),f.Links=a||[],f}const textEncoder$1=new TextEncoder,maxInt32=2**32,maxUInt32=2**31;function encodeLink$1(o,i){let s=i.length;if(typeof o.Tsize=="number"){if(o.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(o.Tsize))throw new Error("Tsize too large for encoding");s=encodeVarint(i,s,o.Tsize)-1,i[s]=24}if(typeof o.Name=="string"){const a=textEncoder$1.encode(o.Name);s-=a.length,i.set(a,s),s=encodeVarint(i,s,a.length)-1,i[s]=18}return o.Hash&&(s-=o.Hash.length,i.set(o.Hash,s),s=encodeVarint(i,s,o.Hash.length)-1,i[s]=10),i.length-s}function encodeNode(o){const i=sizeNode(o),s=new Uint8Array(i);let a=i;if(o.Data&&(a-=o.Data.length,s.set(o.Data,a),a=encodeVarint(s,a,o.Data.length)-1,s[a]=10),o.Links)for(let c=o.Links.length-1;c>=0;c--){const d=encodeLink$1(o.Links[c],s.subarray(0,a));a-=d,a=encodeVarint(s,a,d)-1,s[a]=18}return s}function sizeLink(o){let i=0;if(o.Hash){const s=o.Hash.length;i+=1+s+sov(s)}if(typeof o.Name=="string"){const s=textEncoder$1.encode(o.Name).length;i+=1+s+sov(s)}return typeof o.Tsize=="number"&&(i+=1+sov(o.Tsize)),i}function sizeNode(o){let i=0;if(o.Data){const s=o.Data.length;i+=1+s+sov(s)}if(o.Links)for(const s of o.Links){const a=sizeLink(s);i+=1+a+sov(a)}return i}function encodeVarint(o,i,s){i-=sov(s);const a=i;for(;s>=maxUInt32;)o[i++]=s&127|128,s/=128;for(;s>=128;)o[i++]=s&127|128,s>>>=7;return o[i]=s,a}function sov(o){return o%2===0&&o++,Math.floor((len64(o)+6)/7)}function len64(o){let i=0;return o>=maxInt32&&(o=Math.floor(o/maxInt32),i=32),o>=65536&&(o>>>=16,i+=16),o>=256&&(o>>>=8,i+=8),i+len8tab[o]}const len8tab=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8],pbNodeProperties=["Data","Links"],pbLinkProperties=["Hash","Name","Tsize"],textEncoder=new TextEncoder;function linkComparator(o,i){if(o===i)return 0;const s=o.Name?textEncoder.encode(o.Name):[],a=i.Name?textEncoder.encode(i.Name):[];let c=s.length,d=a.length;for(let f=0,g=Math.min(c,d);f!i.includes(s))}function asLink(o){if(typeof o.asCID=="object"){const s=CID$3.asCID(o);if(!s)throw new TypeError("Invalid DAG-PB form");return{Hash:s}}if(typeof o!="object"||Array.isArray(o))throw new TypeError("Invalid DAG-PB form");const i={};if(o.Hash){let s=CID$3.asCID(o.Hash);try{s||(typeof o.Hash=="string"?s=CID$3.parse(o.Hash):o.Hash instanceof Uint8Array&&(s=CID$3.decode(o.Hash)))}catch(a){throw new TypeError(`Invalid DAG-PB form: ${a.message}`)}s&&(i.Hash=s)}if(!i.Hash)throw new TypeError("Invalid DAG-PB form");return typeof o.Name=="string"&&(i.Name=o.Name),typeof o.Tsize=="number"&&(i.Tsize=o.Tsize),i}function prepare(o){if((o instanceof Uint8Array||typeof o=="string")&&(o={Data:o}),typeof o!="object"||Array.isArray(o))throw new TypeError("Invalid DAG-PB form");const i={};if(o.Data!==void 0)if(typeof o.Data=="string")i.Data=textEncoder.encode(o.Data);else if(o.Data instanceof Uint8Array)i.Data=o.Data;else throw new TypeError("Invalid DAG-PB form");if(o.Links!==void 0)if(Array.isArray(o.Links))i.Links=o.Links.map(asLink),i.Links.sort(linkComparator);else throw new TypeError("Invalid DAG-PB form");else i.Links=[];return i}function validate(o){if(!o||typeof o!="object"||Array.isArray(o)||o instanceof Uint8Array||o["/"]&&o["/"]===o.bytes)throw new TypeError("Invalid DAG-PB form");if(!hasOnlyProperties(o,pbNodeProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(o.Data!==void 0&&!(o.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray(o.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let i=0;i0&&linkComparator(s,o.Links[i-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function toByteView(o){return o instanceof ArrayBuffer?new Uint8Array(o,0,o.byteLength):o}const code$2=112;function encode$c(o){validate(o);const i={};return o.Links&&(i.Links=o.Links.map(s=>{const a={};return s.Hash&&(a.Hash=s.Hash.bytes),s.Name!==void 0&&(a.Name=s.Name),s.Tsize!==void 0&&(a.Tsize=s.Tsize),a})),o.Data&&(i.Data=o.Data),encodeNode(i)}function decode$h(o){const i=toByteView(o),s=decodeNode(i),a={};return s.Data&&(a.Data=s.Data),s.Links&&(a.Links=s.Links.map(c=>{const d={};try{d.Hash=CID$3.decode(c.Hash)}catch{}if(!d.Hash)throw new Error("Invalid Hash field found in link, expected CID");return c.Name!==void 0&&(d.Name=c.Name),c.Tsize!==void 0&&(d.Tsize=c.Tsize),d})),a}var indexMinimal={},minimal$1={},aspromise=asPromise;function asPromise(o,i){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c1&&g.charAt(y)==="=";)++b;return Math.ceil(g.length*3)/4-b};for(var s=new Array(64),a=new Array(123),c=0;c<64;)a[s[c]=c<26?c+65:c<52?c+71:c<62?c-4:c-59|43]=c++;i.encode=function(g,y,b){for(var $=null,x=[],T=0,A=0,E;y>2],E=(S&3)<<4,A=1;break;case 1:x[T++]=s[E|S>>4],E=(S&15)<<2,A=2;break;case 2:x[T++]=s[E|S>>6],x[T++]=s[S&63],A=0;break}T>8191&&(($||($=[])).push(String.fromCharCode.apply(String,x)),T=0)}return A&&(x[T++]=s[E],x[T++]=61,A===1&&(x[T++]=61)),$?(T&&$.push(String.fromCharCode.apply(String,x.slice(0,T))),$.join("")):String.fromCharCode.apply(String,x.slice(0,T))};var d="invalid encoding";i.decode=function(g,y,b){for(var $=b,x=0,T,A=0;A1)break;if((E=a[E])===void 0)throw Error(d);switch(x){case 0:T=E,x=1;break;case 1:y[b++]=T<<2|(E&48)>>4,T=E,x=2;break;case 2:y[b++]=(T&15)<<4|(E&60)>>2,T=E,x=3;break;case 3:y[b++]=(T&3)<<6|E,x=0;break}}if(x===1)throw Error(d);return b-$},i.test=function(g){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(g)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(i,s,a){return(this._listeners[i]||(this._listeners[i]=[])).push({fn:s,ctx:a||this}),this};EventEmitter.prototype.off=function(i,s){if(i===void 0)this._listeners={};else if(s===void 0)this._listeners[i]=[];else for(var a=this._listeners[i],c=0;c0?0:2147483648,d,f);else if(isNaN(c))a(2143289344,d,f);else if(c>34028234663852886e22)a((g<<31|2139095040)>>>0,d,f);else if(c<11754943508222875e-54)a((g<<31|Math.round(c/1401298464324817e-60))>>>0,d,f);else{var y=Math.floor(Math.log(c)/Math.LN2),b=Math.round(c*Math.pow(2,-y)*8388608)&8388607;a((g<<31|y+127<<23|b)>>>0,d,f)}}o.writeFloatLE=i.bind(null,writeUintLE),o.writeFloatBE=i.bind(null,writeUintBE);function s(a,c,d){var f=a(c,d),g=(f>>31)*2+1,y=f>>>23&255,b=f&8388607;return y===255?b?NaN:g*(1/0):y===0?g*1401298464324817e-60*b:g*Math.pow(2,y-150)*(b+8388608)}o.readFloatLE=s.bind(null,readUintLE),o.readFloatBE=s.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),s=new Uint8Array(i.buffer),a=s[7]===128;function c(y,b,$){i[0]=y,b[$]=s[0],b[$+1]=s[1],b[$+2]=s[2],b[$+3]=s[3],b[$+4]=s[4],b[$+5]=s[5],b[$+6]=s[6],b[$+7]=s[7]}function d(y,b,$){i[0]=y,b[$]=s[7],b[$+1]=s[6],b[$+2]=s[5],b[$+3]=s[4],b[$+4]=s[3],b[$+5]=s[2],b[$+6]=s[1],b[$+7]=s[0]}o.writeDoubleLE=a?c:d,o.writeDoubleBE=a?d:c;function f(y,b){return s[0]=y[b],s[1]=y[b+1],s[2]=y[b+2],s[3]=y[b+3],s[4]=y[b+4],s[5]=y[b+5],s[6]=y[b+6],s[7]=y[b+7],i[0]}function g(y,b){return s[7]=y[b],s[6]=y[b+1],s[5]=y[b+2],s[4]=y[b+3],s[3]=y[b+4],s[2]=y[b+5],s[1]=y[b+6],s[0]=y[b+7],i[0]}o.readDoubleLE=a?f:g,o.readDoubleBE=a?g:f}():function(){function i(a,c,d,f,g,y){var b=f<0?1:0;if(b&&(f=-f),f===0)a(0,g,y+c),a(1/f>0?0:2147483648,g,y+d);else if(isNaN(f))a(0,g,y+c),a(2146959360,g,y+d);else if(f>17976931348623157e292)a(0,g,y+c),a((b<<31|2146435072)>>>0,g,y+d);else{var $;if(f<22250738585072014e-324)$=f/5e-324,a($>>>0,g,y+c),a((b<<31|$/4294967296)>>>0,g,y+d);else{var x=Math.floor(Math.log(f)/Math.LN2);x===1024&&(x=1023),$=f*Math.pow(2,-x),a($*4503599627370496>>>0,g,y+c),a((b<<31|x+1023<<20|$*1048576&1048575)>>>0,g,y+d)}}}o.writeDoubleLE=i.bind(null,writeUintLE,0,4),o.writeDoubleBE=i.bind(null,writeUintBE,4,0);function s(a,c,d,f,g){var y=a(f,g+c),b=a(f,g+d),$=(b>>31)*2+1,x=b>>>20&2047,T=4294967296*(b&1048575)+y;return x===2047?T?NaN:$*(1/0):x===0?$*5e-324*T:$*Math.pow(2,x-1075)*(T+4503599627370496)}o.readDoubleLE=s.bind(null,readUintLE,0,4),o.readDoubleBE=s.bind(null,readUintBE,4,0)}(),o}function writeUintLE(o,i,s){i[s]=o&255,i[s+1]=o>>>8&255,i[s+2]=o>>>16&255,i[s+3]=o>>>24}function writeUintBE(o,i,s){i[s]=o>>>24,i[s+1]=o>>>16&255,i[s+2]=o>>>8&255,i[s+3]=o&255}function readUintLE(o,i){return(o[i]|o[i+1]<<8|o[i+2]<<16|o[i+3]<<24)>>>0}function readUintBE(o,i){return(o[i]<<24|o[i+1]<<16|o[i+2]<<8|o[i+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(o){}return null}var utf8$5={};(function(o){var i=o;i.length=function(a){for(var c=0,d=0,f=0;f191&&$<224?y[b++]=($&31)<<6|a[c++]&63:$>239&&$<365?($=(($&7)<<18|(a[c++]&63)<<12|(a[c++]&63)<<6|a[c++]&63)-65536,y[b++]=55296+($>>10),y[b++]=56320+($&1023)):y[b++]=($&15)<<12|(a[c++]&63)<<6|a[c++]&63,b>8191&&((g||(g=[])).push(String.fromCharCode.apply(String,y)),b=0);return g?(b&&g.push(String.fromCharCode.apply(String,y.slice(0,b))),g.join("")):String.fromCharCode.apply(String,y.slice(0,b))},i.write=function(a,c,d){for(var f=d,g,y,b=0;b>6|192,c[d++]=g&63|128):(g&64512)===55296&&((y=a.charCodeAt(b+1))&64512)===56320?(g=65536+((g&1023)<<10)+(y&1023),++b,c[d++]=g>>18|240,c[d++]=g>>12&63|128,c[d++]=g>>6&63|128,c[d++]=g&63|128):(c[d++]=g>>12|224,c[d++]=g>>6&63|128,c[d++]=g&63|128);return d-f}})(utf8$5);var pool_1=pool;function pool(o,i,s){var a=s||8192,c=a>>>1,d=null,f=a;return function(y){if(y<1||y>c)return o(y);f+y>a&&(d=o(a),f=0);var b=i.call(d,f,f+=y);return f&7&&(f=(f|7)+1),b}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=i;var o=requireMinimal();function i(d,f){this.lo=d>>>0,this.hi=f>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(f){if(f===0)return s;var g=f<0;g&&(f=-f);var y=f>>>0,b=(f-y)/4294967296>>>0;return g&&(b=~b>>>0,y=~y>>>0,++y>4294967295&&(y=0,++b>4294967295&&(b=0))),new i(y,b)},i.from=function(f){if(typeof f=="number")return i.fromNumber(f);if(o.isString(f))if(o.Long)f=o.Long.fromString(f);else return i.fromNumber(parseInt(f,10));return f.low||f.high?new i(f.low>>>0,f.high>>>0):s},i.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var g=~this.lo+1>>>0,y=~this.hi>>>0;return g||(y=y+1>>>0),-(g+y*4294967296)}return this.lo+this.hi*4294967296},i.prototype.toLong=function(f){return o.Long?new o.Long(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;return i.fromHash=function(f){return f===a?s:new i((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},i.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},i.prototype.length=function(){var f=this.lo,g=(this.lo>>>28|this.hi<<4)>>>0,y=this.hi>>>24;return y===0?g===0?f<16384?f<128?1:2:f<2097152?3:4:g<16384?g<128?5:6:g<2097152?7:8:y<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(o){var i=o;i.asPromise=aspromise,i.base64=base64$1,i.EventEmitter=eventemitter,i.float=float,i.inquire=inquire_1,i.utf8=utf8$5,i.pool=pool_1,i.LongBits=requireLongbits(),i.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),i.global=i.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d},i.isString=function(d){return typeof d=="string"||d instanceof String},i.isObject=function(d){return d&&typeof d=="object"},i.isset=i.isSet=function(d,f){var g=d[f];return g!=null&&d.hasOwnProperty(f)?typeof g!="object"||(Array.isArray(g)?g.length:Object.keys(g).length)>0:!1},i.Buffer=function(){try{var c=i.inquire("buffer").Buffer;return c.prototype.utf8Write?c:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(d){return typeof d=="number"?i.Buffer?i._Buffer_allocUnsafe(d):new i.Array(d):i.Buffer?i._Buffer_from(d):typeof Uint8Array>"u"?d:new Uint8Array(d)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(d){return d?i.LongBits.from(d).toHash():i.LongBits.zeroHash},i.longFromHash=function(d,f){var g=i.LongBits.fromHash(d);return i.Long?i.Long.fromBits(g.lo,g.hi,f):g.toNumber(!!f)};function s(c,d,f){for(var g=Object.keys(d),y=0;y-1;--b)if(f[y[b]]===1&&this[y[b]]!==void 0&&this[y[b]]!==null)return y[b]}},i.oneOfSetter=function(d){return function(f){for(var g=0;g127;)i[s++]=o&127|128,o>>>=7;i[s]=o}function VarintOp(o,i){this.len=o,this.next=void 0,this.val=i}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function o(i){return this.len+=(this.tail=this.tail.next=new VarintOp((i=i>>>0)<128?1:i<16384?2:i<2097152?3:i<268435456?4:5,i)).len,this};Writer$1.prototype.int32=function o(i){return i<0?this._push(writeVarint64,10,LongBits$1.fromNumber(i)):this.uint32(i)};Writer$1.prototype.sint32=function o(i){return this.uint32((i<<1^i>>31)>>>0)};function writeVarint64(o,i,s){for(;o.hi;)i[s++]=o.lo&127|128,o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)i[s++]=o.lo&127|128,o.lo=o.lo>>>7;i[s++]=o.lo}Writer$1.prototype.uint64=function o(i){var s=LongBits$1.from(i);return this._push(writeVarint64,s.length(),s)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function o(i){var s=LongBits$1.from(i).zzEncode();return this._push(writeVarint64,s.length(),s)};Writer$1.prototype.bool=function o(i){return this._push(writeByte,1,i?1:0)};function writeFixed32(o,i,s){i[s]=o&255,i[s+1]=o>>>8&255,i[s+2]=o>>>16&255,i[s+3]=o>>>24}Writer$1.prototype.fixed32=function o(i){return this._push(writeFixed32,4,i>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function o(i){var s=LongBits$1.from(i);return this._push(writeFixed32,4,s.lo)._push(writeFixed32,4,s.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function o(i){return this._push(util$4.float.writeFloatLE,4,i)};Writer$1.prototype.double=function o(i){return this._push(util$4.float.writeDoubleLE,8,i)};var writeBytes=util$4.Array.prototype.set?function o(i,s,a){s.set(i,a)}:function o(i,s,a){for(var c=0;c>>0;if(!s)return this._push(writeByte,1,0);if(util$4.isString(i)){var a=Writer$1.alloc(s=base64.length(i));base64.decode(i,a,0),i=a}return this.uint32(s)._push(writeBytes,s,i)};Writer$1.prototype.string=function o(i){var s=utf8$4.length(i);return s?this.uint32(s)._push(utf8$4.write,s,i):this._push(writeByte,1,0)};Writer$1.prototype.fork=function o(){return this.states=new State$1(this),this.head=this.tail=new Op(noop$1,0,0),this.len=0,this};Writer$1.prototype.reset=function o(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop$1,0,0),this.len=0),this};Writer$1.prototype.ldelim=function o(){var i=this.head,s=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=i.next,this.tail=s,this.len+=a),this};Writer$1.prototype.finish=function o(){for(var i=this.head.next,s=this.constructor.alloc(this.len),a=0;i;)i.fn(i.val,s,a),a+=i.len,i=i.next;return s};Writer$1._configure=function(o){BufferWriter$1=o,Writer$1.create=create$e(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(i,s,a){s.set(i,a)}:function(i,s,a){if(i.copy)i.copy(s,a,0,i.length);else for(var c=0;c>>0;return this.uint32(s),s&&this._push(BufferWriter.writeBytesBuffer,s,i),this};function writeStringBuffer(o,i,s){o.length<40?util$3.utf8.write(o,i,s):i.utf8Write?i.utf8Write(o,s):i.write(o,s)}BufferWriter.prototype.string=function o(i){var s=util$3.Buffer.byteLength(i);return this.uint32(s),s&&this._push(writeStringBuffer,s,i),this};BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8$3=util$2.utf8;function indexOutOfRange(o,i){return RangeError("index out of range: "+o.pos+" + "+(i||1)+" > "+o.len)}function Reader$1(o){this.buf=o,this.pos=0,this.len=o.length}var create_array=typeof Uint8Array<"u"?function o(i){if(i instanceof Uint8Array||Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")}:function o(i){if(Array.isArray(i))return new Reader$1(i);throw Error("illegal buffer")},create$d=function o(){return util$2.Buffer?function(s){return(Reader$1.create=function(c){return util$2.Buffer.isBuffer(c)?new BufferReader$1(c):create_array(c)})(s)}:create_array};Reader$1.create=create$d();Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice;Reader$1.prototype.uint32=function o(){var i=4294967295;return function(){if(i=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(i=(i|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(i=(i|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return i;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return i}}();Reader$1.prototype.int32=function o(){return this.uint32()|0};Reader$1.prototype.sint32=function o(){var i=this.uint32();return i>>>1^-(i&1)|0};function readLongVarint(){var o=new LongBits(0,0),i=0;if(this.len-this.pos>4){for(;i<4;++i)if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o;if(o.lo=(o.lo|(this.buf[this.pos]&127)<<28)>>>0,o.hi=(o.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return o;i=0}else{for(;i<3;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}return o.lo=(o.lo|(this.buf[this.pos++]&127)<>>0,o}if(this.len-this.pos>4){for(;i<5;++i)if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}else for(;i<5;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function o(){return this.uint32()!==0};function readFixed32_end(o,i){return(o[i-4]|o[i-3]<<8|o[i-2]<<16|o[i-1]<<24)>>>0}Reader$1.prototype.fixed32=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var i=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,i};Reader$1.prototype.double=function o(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var i=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,i};Reader$1.prototype.bytes=function o(){var i=this.uint32(),s=this.pos,a=this.pos+i;if(a>this.len)throw indexOutOfRange(this,i);if(this.pos+=i,Array.isArray(this.buf))return this.buf.slice(s,a);if(s===a){var c=util$2.Buffer;return c?c.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,s,a)};Reader$1.prototype.string=function o(){var i=this.bytes();return utf8$3.read(i,0,i.length)};Reader$1.prototype.skip=function o(i){if(typeof i=="number"){if(this.pos+i>this.len)throw indexOutOfRange(this,i);this.pos+=i}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(o){switch(o){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(o=this.uint32()&7)!==4;)this.skipType(o);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+o+" at offset "+this.pos)}return this};Reader$1._configure=function(o){BufferReader$1=o,Reader$1.create=create$d(),BufferReader$1._configure();var i=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[i](!1)},uint64:function(){return readLongVarint.call(this)[i](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[i](!1)},fixed64:function(){return readFixed64.call(this)[i](!0)},sfixed64:function(){return readFixed64.call(this)[i](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(o){Reader.call(this,o)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)};BufferReader.prototype.string=function o(){var i=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+i,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+i,this.len))};BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(o,i,s){if(typeof o!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=!!i,this.responseDelimited=!!s}Service.prototype.rpcCall=function o(i,s,a,c,d){if(!c)throw TypeError("request must be specified");var f=this;if(!d)return util.asPromise(o,f,i,s,a,c);if(!f.rpcImpl){setTimeout(function(){d(Error("already ended"))},0);return}try{return f.rpcImpl(i,s[f.requestDelimited?"encodeDelimited":"encode"](c).finish(),function(y,b){if(y)return f.emit("error",y,i),d(y);if(b===null){f.end(!0);return}if(!(b instanceof a))try{b=a[f.responseDelimited?"decodeDelimited":"decode"](b)}catch($){return f.emit("error",$,i),d($)}return f.emit("data",b,i),d(null,b)})}catch(g){f.emit("error",g,i),setTimeout(function(){d(g)},0);return}};Service.prototype.end=function o(i){return this.rpcImpl&&(i||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(o){var i=o;i.Service=service})(rpc);var roots={};(function(o){var i=o;i.build="minimal",i.Writer=writer,i.BufferWriter=writer_buffer,i.Reader=reader,i.BufferReader=reader_buffer,i.util=requireMinimal(),i.rpc=rpc,i.roots=roots,i.configure=s;function s(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}s()})(indexMinimal);var minimal=indexMinimal;const $protobuf=getDefaultExportFromCjs(minimal),$Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util,$root=$protobuf.roots.unixfs||($protobuf.roots.unixfs={}),Data=$root.Data=(()=>{function o(i){if(this.blocksizes=[],i)for(var s=Object.keys(i),a=0;a>>3){case 1:d.Type=s.int32();break;case 2:d.Data=s.bytes();break;case 3:d.filesize=s.uint64();break;case 4:if(d.blocksizes&&d.blocksizes.length||(d.blocksizes=[]),(f&7)===2)for(var g=s.uint32()+s.pos;s.pos>>0,s.filesize.high>>>0).toNumber(!0))),s.blocksizes){if(!Array.isArray(s.blocksizes))throw TypeError(".Data.blocksizes: array expected");a.blocksizes=[];for(var c=0;c>>0,s.blocksizes[c].high>>>0).toNumber(!0))}if(s.hashType!=null&&($util.Long?(a.hashType=$util.Long.fromValue(s.hashType)).unsigned=!0:typeof s.hashType=="string"?a.hashType=parseInt(s.hashType,10):typeof s.hashType=="number"?a.hashType=s.hashType:typeof s.hashType=="object"&&(a.hashType=new $util.LongBits(s.hashType.low>>>0,s.hashType.high>>>0).toNumber(!0))),s.fanout!=null&&($util.Long?(a.fanout=$util.Long.fromValue(s.fanout)).unsigned=!0:typeof s.fanout=="string"?a.fanout=parseInt(s.fanout,10):typeof s.fanout=="number"?a.fanout=s.fanout:typeof s.fanout=="object"&&(a.fanout=new $util.LongBits(s.fanout.low>>>0,s.fanout.high>>>0).toNumber(!0))),s.mode!=null&&(a.mode=s.mode>>>0),s.mtime!=null){if(typeof s.mtime!="object")throw TypeError(".Data.mtime: object expected");a.mtime=$root.UnixTime.fromObject(s.mtime)}return a},o.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.blocksizes=[]),a.defaults){if(c.Type=a.enums===String?"Raw":0,a.bytes===String?c.Data="":(c.Data=[],a.bytes!==Array&&(c.Data=$util.newBuffer(c.Data))),$util.Long){var d=new $util.Long(0,0,!0);c.filesize=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.filesize=a.longs===String?"0":0;if($util.Long){var d=new $util.Long(0,0,!0);c.hashType=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.hashType=a.longs===String?"0":0;if($util.Long){var d=new $util.Long(0,0,!0);c.fanout=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.fanout=a.longs===String?"0":0;c.mode=0,c.mtime=null}if(s.Type!=null&&s.hasOwnProperty("Type")&&(c.Type=a.enums===String?$root.Data.DataType[s.Type]:s.Type),s.Data!=null&&s.hasOwnProperty("Data")&&(c.Data=a.bytes===String?$util.base64.encode(s.Data,0,s.Data.length):a.bytes===Array?Array.prototype.slice.call(s.Data):s.Data),s.filesize!=null&&s.hasOwnProperty("filesize")&&(typeof s.filesize=="number"?c.filesize=a.longs===String?String(s.filesize):s.filesize:c.filesize=a.longs===String?$util.Long.prototype.toString.call(s.filesize):a.longs===Number?new $util.LongBits(s.filesize.low>>>0,s.filesize.high>>>0).toNumber(!0):s.filesize),s.blocksizes&&s.blocksizes.length){c.blocksizes=[];for(var f=0;f>>0,s.blocksizes[f].high>>>0).toNumber(!0):s.blocksizes[f]}return s.hashType!=null&&s.hasOwnProperty("hashType")&&(typeof s.hashType=="number"?c.hashType=a.longs===String?String(s.hashType):s.hashType:c.hashType=a.longs===String?$util.Long.prototype.toString.call(s.hashType):a.longs===Number?new $util.LongBits(s.hashType.low>>>0,s.hashType.high>>>0).toNumber(!0):s.hashType),s.fanout!=null&&s.hasOwnProperty("fanout")&&(typeof s.fanout=="number"?c.fanout=a.longs===String?String(s.fanout):s.fanout:c.fanout=a.longs===String?$util.Long.prototype.toString.call(s.fanout):a.longs===Number?new $util.LongBits(s.fanout.low>>>0,s.fanout.high>>>0).toNumber(!0):s.fanout),s.mode!=null&&s.hasOwnProperty("mode")&&(c.mode=s.mode),s.mtime!=null&&s.hasOwnProperty("mtime")&&(c.mtime=$root.UnixTime.toObject(s.mtime,a)),c},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o.DataType=function(){const i={},s=Object.create(i);return s[i[0]="Raw"]=0,s[i[1]="Directory"]=1,s[i[2]="File"]=2,s[i[3]="Metadata"]=3,s[i[4]="Symlink"]=4,s[i[5]="HAMTShard"]=5,s}(),o})();$root.UnixTime=(()=>{function o(i){if(i)for(var s=Object.keys(i),a=0;a>>3){case 1:d.Seconds=s.int64();break;case 2:d.FractionalNanoseconds=s.fixed32();break;default:s.skipType(f&7);break}}if(!d.hasOwnProperty("Seconds"))throw $util.ProtocolError("missing required 'Seconds'",{instance:d});return d},o.fromObject=function(s){if(s instanceof $root.UnixTime)return s;var a=new $root.UnixTime;return s.Seconds!=null&&($util.Long?(a.Seconds=$util.Long.fromValue(s.Seconds)).unsigned=!1:typeof s.Seconds=="string"?a.Seconds=parseInt(s.Seconds,10):typeof s.Seconds=="number"?a.Seconds=s.Seconds:typeof s.Seconds=="object"&&(a.Seconds=new $util.LongBits(s.Seconds.low>>>0,s.Seconds.high>>>0).toNumber())),s.FractionalNanoseconds!=null&&(a.FractionalNanoseconds=s.FractionalNanoseconds>>>0),a},o.toObject=function(s,a){a||(a={});var c={};if(a.defaults){if($util.Long){var d=new $util.Long(0,0,!1);c.Seconds=a.longs===String?d.toString():a.longs===Number?d.toNumber():d}else c.Seconds=a.longs===String?"0":0;c.FractionalNanoseconds=0}return s.Seconds!=null&&s.hasOwnProperty("Seconds")&&(typeof s.Seconds=="number"?c.Seconds=a.longs===String?String(s.Seconds):s.Seconds:c.Seconds=a.longs===String?$util.Long.prototype.toString.call(s.Seconds):a.longs===Number?new $util.LongBits(s.Seconds.low>>>0,s.Seconds.high>>>0).toNumber():s.Seconds),s.FractionalNanoseconds!=null&&s.hasOwnProperty("FractionalNanoseconds")&&(c.FractionalNanoseconds=s.FractionalNanoseconds),c},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o})();$root.Metadata=(()=>{function o(i){if(i)for(var s=Object.keys(i),a=0;a>>3){case 1:d.MimeType=s.string();break;default:s.skipType(f&7);break}}return d},o.fromObject=function(s){if(s instanceof $root.Metadata)return s;var a=new $root.Metadata;return s.MimeType!=null&&(a.MimeType=String(s.MimeType)),a},o.toObject=function(s,a){a||(a={});var c={};return a.defaults&&(c.MimeType=""),s.MimeType!=null&&s.hasOwnProperty("MimeType")&&(c.MimeType=s.MimeType),c},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o})();const NodeType=Data.DataType,EMPTY$3=Object.freeze([]),EMPTY_BUFFER$1=new Uint8Array(0),BLANK$2=Object.freeze({}),DEFAULT_FILE_MODE=parseInt("0644",8),DEFAULT_DIRECTORY_MODE=parseInt("0755",8),code$1=code$2,name$2="UnixFS",encodePB=(o,i)=>(Object(globalThis).debug&&console.log({data:o,links:i}),encode$c(prepare({Data:Data.encode(o).finish(),Links:i}))),createRaw=o=>({type:NodeType.Raw,content:o}),createEmptyFile=o=>createSimpleFile(EMPTY_BUFFER$1,o),createSimpleFile=(o,i)=>({type:NodeType.File,layout:"simple",content:o,metadata:decodeMetadata(i)}),createFileChunk=o=>({type:NodeType.File,layout:"simple",content:o}),createAdvancedFile=(o,i)=>({type:NodeType.File,layout:"advanced",parts:o,metadata:decodeMetadata(i)}),createFileShard=o=>({type:NodeType.File,layout:"advanced",parts:o}),createComplexFile=(o,i,s)=>({type:NodeType.File,layout:"complex",content:o,parts:i,metadata:decodeMetadata(s)}),createFlatDirectory=(o,i)=>({type:NodeType.Directory,metadata:decodeMetadata(i),entries:o}),createShardedDirectory=(o,i,s,a,c=BLANK$2)=>({type:NodeType.HAMTShard,bitfield:i,fanout:readFanout(s),hashType:readInt(a),entries:o,metadata:decodeMetadata(c)}),createDirectoryShard=(o,i,s,a)=>({type:NodeType.HAMTShard,bitfield:i,fanout:readFanout(s),hashType:readInt(a),entries:o}),encodeRaw=o=>encodePB({Type:NodeType.Raw,Data:o.byteLength>0?o:void 0,filesize:o.byteLength,blocksizes:EMPTY$3},[]),encodeFile=(o,i=!1)=>{const s=i?BLANK$2:Object(o).metadata;switch(o.layout){case"simple":return encodeSimpleFile(o.content,s);case"advanced":return encodeAdvancedFile(o.parts,s);case"complex":return encodeComplexFile(o.content,o.parts,s);default:throw new TypeError(`File with unknown layout "${Object(o).layout}" was passed`)}},encodeFileChunk=o=>encodeSimpleFile(o,BLANK$2),encodeFileShard=o=>encodePB({Type:NodeType.File,blocksizes:o.map(contentByteLength),filesize:cumulativeContentByteLength(o)},o.map(encodeLink)),encodeAdvancedFile=(o,i=BLANK$2)=>encodePB({Type:NodeType.File,blocksizes:o.map(contentByteLength),filesize:cumulativeContentByteLength(o),...encodeMetadata(i)},o.map(encodeLink)),encodeLink=o=>({Name:"",Tsize:o.dagByteLength,Hash:o.cid}),encodeSimpleFile=(o,i=BLANK$2)=>encodePB({Type:NodeType.File,Data:o.byteLength>0?o:void 0,filesize:o.byteLength,blocksizes:[],...encodeMetadata(i)},[]),encodeComplexFile=(o,i,s=BLANK$2)=>encodePB({Type:NodeType.File,Data:o,filesize:o.byteLength+cumulativeContentByteLength(i),blocksizes:i.map(contentByteLength)},i.map(encodeLink)),encodeDirectory=o=>encodePB({Type:o.type,...encodeDirectoryMetadata(o.metadata||BLANK$2)},o.entries.map(encodeNamedLink)),encodeHAMTShard=({bitfield:o,fanout:i,hashType:s,entries:a,metadata:c=BLANK$2})=>encodePB({Type:NodeType.HAMTShard,Data:o.byteLength>0?o:void 0,fanout:readFanout(i),hashType:readInt(s),...encodeDirectoryMetadata(c)},a.map(encodeNamedLink)),readFanout=o=>{if(Math.log2(o)%1===0)return o;throw new TypeError(`Expected hamt size to be a power of two instead got ${o}`)},readInt=o=>{if(Number.isInteger(o))return o;throw new TypeError(`Expected an integer value instead got ${o}`)},createSymlink=(o,i=BLANK$2)=>({type:NodeType.Symlink,content:o,metadata:decodeMetadata(i)}),encodeSymlink=(o,i=!1)=>{const s=i?BLANK$2:Object(o).metadata;return encodePB({Type:NodeType.Symlink,Data:o.content,...encodeMetadata(s||BLANK$2)},[])},encode$b=(o,i=!0)=>{switch(o.type){case NodeType.Raw:return encodeRaw(o.content);case NodeType.File:return encodeFile(o);case NodeType.Directory:return encodeDirectory(o);case NodeType.HAMTShard:return encodeHAMTShard(o);case NodeType.Symlink:return encodeSymlink(o);default:throw new Error(`Unknown node type ${Object(o).type}`)}},decode$g=o=>{const i=decode$h(o),s=Data.decode(i.Data),{Type:a,Data:c,mtime:d,mode:f,blocksizes:g,...y}=Data.toObject(s,{defaults:!1,arrays:!0,longs:Number,objects:!1}),b={...f&&{mode:f},...decodeMtime(d)},$=i.Links;switch(s.Type){case NodeType.Raw:return createRaw(c);case NodeType.File:return $.length===0?new SimpleFileView(c,b):c.byteLength===0?new AdvancedFileView(decodeFileLinks(y.blocksizes,$),b):new ComplexFileView(c,decodeFileLinks(y.blocksizes,$),b);case NodeType.Directory:return createFlatDirectory(decodeDirectoryLinks($),b);case NodeType.HAMTShard:return createShardedDirectory(decodeDirectoryLinks($),c||EMPTY_BUFFER$1,y.fanout,y.hashType,b);case NodeType.Symlink:return createSymlink(c,b);default:throw new TypeError(`Unsupported node type ${s.Type}`)}},decodeMtime=o=>o==null?void 0:{mtime:{secs:o.Seconds,nsecs:o.FractionalNanoseconds||0}},decodeFileLinks=(o,i)=>{const s=[],a=o.length;let c=0;for(;co.map(i=>({cid:i.Hash,name:i.Name||"",dagByteLength:i.Tsize||0})),cumulativeContentByteLength=o=>o.reduce((i,s)=>i+s.contentByteLength,0),cumulativeDagByteLength=(o,i)=>i.reduce((s,a)=>s+a.dagByteLength,o.byteLength),contentByteLength=o=>o.contentByteLength,encodeNamedLink=({name:o,dagByteLength:i,cid:s})=>({Name:o,Tsize:i,Hash:s}),encodeDirectoryMetadata=o=>encodeMetadata(o,DEFAULT_DIRECTORY_MODE),encodeMetadata=({mode:o,mtime:i},s=DEFAULT_FILE_MODE)=>({mode:o!=null?encodeMode(o,s):void 0,mtime:i!=null?encodeMTime(i):void 0}),decodeMetadata=o=>o==null?BLANK$2:{...o.mode==null?void 0:{mode:decodeMode(o.mode)},...o.mtime==null?void 0:{mtime:o.mtime}},encodeMTime=o=>o==null?void 0:o.nsecs!==0?{Seconds:o.secs,FractionalNanoseconds:o.nsecs}:{Seconds:o.secs},encodeMode=(o,i)=>{const s=o==null?void 0:decodeMode(o);return s===i||s==null?void 0:s},decodeMode=o=>o&4095|o&4294963200,matchFile=({content:o=EMPTY_BUFFER$1,parts:i=EMPTY$3,metadata:s=BLANK$2,...a})=>i.length===0?new SimpleFileView(o,s):o.byteLength===0?new AdvancedFileView(i,s):new ComplexFileView(o,i,s);class SimpleFileView{constructor(i,s){this.content=i,this.metadata=s,this.layout="simple",this.type=NodeType.File}get filesize(){return this.content.byteLength}encode(){return encodeSimpleFile(this.content,this.metadata)}}class AdvancedFileView{constructor(i,s){this.parts=i,this.metadata=s}get layout(){return"advanced"}get type(){return NodeType.File}get fileSize(){return cumulativeContentByteLength(this.parts)}get blockSizes(){return this.parts.map(contentByteLength)}encode(){return encodeAdvancedFile(this.parts,this.metadata)}}class ComplexFileView{constructor(i,s,a){this.content=i,this.parts=s,this.metadata=a}get layout(){return"complex"}get type(){return NodeType.File}get fileSize(){return this.content.byteLength+cumulativeContentByteLength(this.parts)}get blockSizes(){return this.parts.map(contentByteLength)}encode(){return encodeComplexFile(this.content,this.parts,this.metadata)}}const filesize=o=>{switch(o.type){case NodeType.Raw:case NodeType.Symlink:return o.content.byteLength;case NodeType.File:switch(o.layout){case"simple":return o.content.byteLength;case"advanced":return cumulativeContentByteLength(o.parts);case"complex":return o.content.byteLength+cumulativeContentByteLength(o.parts)}default:return 0}},UnixFS=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_DIRECTORY_MODE,DEFAULT_FILE_MODE,NodeType,code:code$1,createAdvancedFile,createComplexFile,createDirectoryShard,createEmptyFile,createFileChunk,createFileShard,createFlatDirectory,createRaw,createShardedDirectory,createSimpleFile,createSymlink,cumulativeContentByteLength,cumulativeDagByteLength,decode:decode$g,decodeMetadata,encode:encode$b,encodeAdvancedFile,encodeComplexFile,encodeDirectory,encodeDirectoryMetadata,encodeFile,encodeFileChunk,encodeFileShard,encodeHAMTShard,encodeLink,encodeMetadata,encodeMode,encodeRaw,encodeSimpleFile,encodeSymlink,filesize,matchFile,name:name$2},Symbol.toStringTag,{value:"Module"})),effect=function*(o){const i=yield*o;yield*send(i)};function*current(){return yield CURRENT}const suspend=function*(){yield SUSPEND},wait=function*(o){const i=yield*current();if(isAsync(o)){let s=!1,a;if(o.then(c=>{s=!1,a=c,enqueue(i)},c=>{s=!0,a=c,enqueue(i)}),yield*suspend(),s)throw a;return a}else return main(wake(i)),yield*suspend(),o};function*wake(o){enqueue(o)}const isAsync=o=>o!=null&&typeof o.then=="function",send=function*(o){yield o},listen=function*(o){const i=[];for(const s of Object.entries(o)){const[a,c]=s;c!==NONE&&i.push(yield*fork$3(tag(c,a)))}yield*group(i)},effects=o=>o.length>0?batch(o.map(effect)):NONE;function*batch(o){const i=[];for(const s of o)i.push(yield*fork$3(s));yield*group(i)}const tag=(o,i)=>o===NONE?NONE:o instanceof Tagger?new Tagger([...o.tags,i],o.source):new Tagger([i],o);class Tagger{constructor(i,s){this.tags=i,this.source=s,this.controller}[Symbol.iterator](){return this.controller||(this.controller=this.source[Symbol.iterator]()),this}box(i){if(i.done)return i;switch(i.value){case SUSPEND:case CURRENT:return i;default:{const s=i;let{value:a}=s;for(const c of this.tags)a=withTag(c,a);return s.value=a,s}}}next(i){return this.box(this.controller.next(i))}throw(i){return this.box(this.controller.throw(i))}return(i){return this.box(this.controller.return(i))}get[Symbol.toStringTag](){return"TaggedEffect"}}const none=()=>NONE,withTag=(o,i)=>({type:o,[o]:i}),CURRENT=Symbol("current"),SUSPEND=Symbol("suspend");class Group{static of(i){return i.group||MAIN}static enqueue(i,s){i.group=s,s.stack.active.push(i)}constructor(i,s=[],a=new Set,c=new Stack(s,a)){this.driver=i,this.parent=Group.of(i),this.stack=c,this.id=++ID}}class Main{constructor(){this.status=IDLE,this.stack=new Stack,this.id=0}}class Stack{constructor(i=[],s=new Set){this.active=i,this.idle=s}static size({active:i,idle:s}){return i.length+s.size}}const main=o=>enqueue(o[Symbol.iterator]()),enqueue=o=>{let i=Group.of(o);for(i.stack.active.push(o),i.stack.idle.delete(o);i.parent;){const{idle:s,active:a}=i.parent.stack;if(s.has(i.driver))s.delete(i.driver),a.push(i.driver);else break;i=i.parent}if(MAIN.status===IDLE)for(MAIN.status=ACTIVE;;)try{for(const s of step(MAIN));MAIN.status=IDLE;break}catch{MAIN.stack.active.shift()}},resume=o=>enqueue(o),step=function*(o){const{active:i}=o.stack;let s=i[0];for(o.stack.idle.delete(s);s;){let a=INIT;e:for(;!a.done&&s===i[0];){const c=a.value;switch(c){case SUSPEND:o.stack.idle.add(s);break e;case CURRENT:a=s.next(s);break;default:a=s.next(yield c);break}}i.shift(),s=i[0],o.stack.idle.delete(s)}},fork$3=(o,i)=>new Fork(o,i),exit=(o,i)=>conclude(o,{ok:!0,value:i}),abort=(o,i)=>conclude(o,{ok:!1,error:i});function*conclude(o,i){try{const s=o,a=i.ok?s.return(i.value):s.throw(i.error);if(!a.done)if(a.value===SUSPEND){const{idle:c}=Group.of(s).stack;c.add(s)}else enqueue(s)}catch{}}function*group(o){if(o.length===0)return;const i=yield*current(),s=new Group(i);let a=null;for(const c of o){const{result:d}=c;if(d){!d.ok&&!a&&(a=d);continue}move(c,s)}try{if(a)throw a.error;for(;yield*step(s),Stack.size(s.stack)>0;)yield*suspend()}catch(c){for(const d of s.stack.active)yield*abort(d,c);for(const d of s.stack.idle)yield*abort(d,c),enqueue(d);throw c}}const move=(o,i)=>{const s=Group.of(o);if(s!==i){const{active:a,idle:c}=s.stack,d=i.stack;if(o.group=i,c.has(o))c.delete(o),d.idle.add(o);else{const f=a.indexOf(o);f>=0&&(a.splice(f,1),d.active.push(o))}}};function*join(o){o.status===IDLE&&(yield*o),o.result||(yield*group([o]));const i=o.result;if(i.ok)return i.value;throw i.error}class Future{constructor(i){this.handler=i,this.result}get promise(){const{result:i}=this,s=i==null?new Promise((a,c)=>{this.handler.onsuccess=a,this.handler.onfailure=c}):i.ok?Promise.resolve(i.value):Promise.reject(i.error);return Object.defineProperty(this,"promise",{value:s}),s}then(i,s){return this.activate().promise.then(i,s)}catch(i){return this.activate().promise.catch(i)}finally(i){return this.activate().promise.finally(i)}activate(){return this}}class Fork extends Future{constructor(i,s=BLANK$1,a={},c=INIT){super(a),this.id=++ID,this.name=s.name||"",this.task=i,this.state=c,this.status=IDLE,this.result,this.handler=a,this.controller}*resume(){resume(this)}join(){return join(this)}abort(i){return abort(this,i)}exit(i){return exit(this,i)}get[Symbol.toStringTag](){return"Fork"}*[Symbol.iterator](){return this.activate()}activate(){return this.controller=this.task[Symbol.iterator](),this.status=ACTIVE,enqueue(this),this}panic(i){this.result={ok:!1,error:i},this.status=FINISHED;const{handler:s}=this;throw s.onfailure&&s.onfailure(i),i}step(i){if(this.state=i,i.done){this.result={ok:!0,value:i.value},this.status=FINISHED;const{handler:s}=this;s.onsuccess&&s.onsuccess(i.value)}return i}next(i){try{return this.step(this.controller.next(i))}catch(s){return this.panic(s)}}return(i){try{return this.step(this.controller.return(i))}catch(s){return this.panic(s)}}throw(i){try{return this.step(this.controller.throw(i))}catch(s){return this.panic(s)}}}const loop=function*(o,i){const s=yield*current(),a=new Group(s);for(Group.enqueue(o[Symbol.iterator](),a);;){for(const c of step(a))Group.enqueue(i(c)[Symbol.iterator](),a);if(Stack.size(a.stack)>0)yield*suspend();else break}};let ID=0;const IDLE="idle",ACTIVE="active",FINISHED="finished",INIT={done:!1,value:CURRENT},BLANK$1={},NONE=function*o(){}(),MAIN=new Main;function Indexed(){}Object.defineProperties(Indexed,{prototype:{value:new Proxy(Object.prototype,{get(o,i,s){return typeof i=="symbol"?Reflect.get(o,i,s):s.get(i)}})}});const empty$3=()=>new BufferView,slice=(o,i=0,s=o.byteLength)=>{const a=[],c=i<0?o.byteLength-i:i,d=s<0?o.byteLength-s:s;if(c===0&&d>=o.byteLength)return o;if(c>d||c>o.byteLength||d<=0)return empty$3();let f=0,g=0;for(const y of o.segments){const b=g+y.byteLength;if(f===0){if(d<=b){const $=y.subarray(c-g,d-g);a.push($),f=$.byteLength;break}else if(ci.byteLength>0?(o.segments.push(i),new BufferView(o.segments,o.byteOffset,o.byteLength+i.byteLength)):o,get$6=(o,i)=>{if(i{let a=s;for(const c of o.segments)i.set(c,a),a+=c.byteLength;return i};function*iterate$1(o){for(const i of o.segments)yield*i}class BufferView extends Indexed{constructor(i=[],s=0,a=0){super(),this.segments=i,this.byteLength=a,this.length=a,this.byteOffset=s}[Symbol.iterator](){return iterate$1(this)}slice(i,s){return slice(this,i,s)}subarray(i,s){return slice(this,i,s)}push(i){return push(this,i)}get(i){return get$6(this,i)}copyTo(i,s){return copyTo(this,i,s)}}const panic=o=>{throw new Error(o)},unreachable=(o,i,...s)=>panic(String.raw(o,JSON.stringify(i),...s)),EMPTY_BUFFER=new Uint8Array(0),EMPTY$2=[],open$1=o=>({config:o,buffer:empty$3()}),write$3=(o,i)=>i.byteLength>0?split(o.config,o.buffer.push(i),!1):{...o,chunks:EMPTY$2},close$6=o=>split(o.config,o.buffer,!0),split=(o,i,s)=>{const a=o.chunker,c=[];let d=0;for(const f of a.cut(a.context,i,s))if(f>0){const g=i.subarray(d,d+f);c.push(g),d+=f}return{config:o,chunks:c,buffer:i.subarray(d)}},mutable=()=>({mutable:!0,needs:{},nodes:{},links:{},linked:EMPTY$1}),addNodes=(o,i)=>{let s=patch(i,{});for(const a of o){const{ready:c,has:d,wants:f}=collect(a.children,s.links);f.length===0?s=patch(s,{links:assign(void 0,d),linked:[{id:a.id,links:c}]}):s=patch(s,{needs:assign(a.id,f),nodes:{[a.id]:{children:a.children,count:f.length}}})}return s},addLink=(o,i,s)=>{const a=s.needs[o],c=s.nodes[a];if(c!=null)if(c.count===1){const{ready:d,has:f}=collect(c.children,{...s.links,[o]:i});return patch(s,{needs:{[o]:void 0},links:assign(void 0,f),nodes:{[a]:void 0},linked:[{id:a,links:d}]})}else return patch(s,{needs:{[o]:void 0},links:{[o]:i},nodes:{[a]:{...c,count:c.count-1}}});else return patch(s,{links:{[o]:i}})},patch=(o,{needs:i,nodes:s,links:a,linked:c})=>{const d=o.mutable?o:{...o},f=o.mutable?BLANK:void 0;return i&&(d.needs=patchDict(o.needs,i,f)),s&&(d.nodes=patchDict(o.nodes,s,f)),a&&(d.links=patchDict(o.links,a,f)),d.linked=c?append(o.linked||EMPTY$1,c,EMPTY$1):o.linked||[],d},assign=(o,i)=>{const s={};for(const a of i)s[a]=o;return s},patchDict=(o,i,s=o)=>{const a=o===s?{...o}:o;for(const c of Object.entries(i)){const[d,f]=c;f==null?delete a[d]:a[d]=f}return a},append=(o,i,s=o)=>{if(o===s)return[...o,...i];for(const a of i)o.push(a);return o},collect=(o,i)=>{const s=[],a=[],c=[];for(const d of o){const f=i[d];f?(s.push(d),c.push(f)):a.push(d)}return{has:s,wants:a,ready:c}},EMPTY$1=Object.freeze([]),BLANK=Object.freeze({}),update=(o,i)=>{switch(o.type){case"write":return write$2(i,o.bytes);case"link":return link(i,o.link);case"block":return{state:i,effect:none()};case"close":return close$5(i);case"end":return{state:i,effect:none()};default:return unreachable`File Writer got unknown message ${o}`}},init=(o,i,s)=>({status:"open",metadata:i,config:s,writer:o,chunker:open$1({chunker:s.chunker}),layout:s.fileLayout.open(),nodeQueue:mutable()}),write$2=(o,i)=>{if(o.status==="open"){const{chunks:s,...a}=write$3(o.chunker,i),{nodes:c,leaves:d,layout:f}=o.config.fileLayout.write(o.layout,s),{linked:g,...y}=addNodes(c,o.nodeQueue),b=[...encodeLeaves(d,o.config),...encodeBranches(g,o.config)];return{state:{...o,chunker:a,layout:f,nodeQueue:y},effect:listen({link:effects(b)})}}else return panic("Unable to perform write on closed file")},link=(o,{id:i,link:s,block:a})=>{let{linked:c,...d}=addLink(i,s,o.nodeQueue);const f=encodeBranches(c,o.config),g=o.status==="closed"&&i===o.rootID?{...o,status:"linked",link:s,nodeQueue:d}:{...o,nodeQueue:d},y=o.status==="closed"&&i===o.rootID&&o.end?o.end.resume():none();return{state:g,effect:listen({link:effects(f),block:writeBlock(o.writer,a),end:y})}},close$5=o=>{if(o.status==="open"){const{chunks:i}=close$6(o.chunker),{layout:s,...a}=o.config.fileLayout.write(o.layout,i),{root:c,...d}=o.config.fileLayout.close(s,o.metadata),[f,g]=isLeafNode(c)?[[...a.nodes,...d.nodes],[...a.leaves,...d.leaves,c]]:[[...a.nodes,...d.nodes,c],[...a.leaves,...d.leaves]],{linked:y,...b}=addNodes(f,o.nodeQueue),$=[...encodeLeaves(g,o.config),...encodeBranches(y,o.config)],x=fork$3(suspend());return{state:{...o,chunker:null,layout:null,rootID:c.id,status:"closed",end:x,nodeQueue:b},effect:listen({link:effects($),end:join(x)})}}else return{state:o,effect:none()}},encodeLeaves=(o,i)=>o.map(s=>encodeLeaf(i,s,i.fileChunkEncoder)),encodeLeaf=function*({hasher:o,linker:i},{id:s,content:a},c){const d=c.encode(a?asUint8Array$1(a):EMPTY_BUFFER),f=yield*wait(o.digest(d)),g=i.createLink(c.code,f),y={cid:g,bytes:d},b={cid:g,contentByteLength:a?a.byteLength:0,dagByteLength:d.byteLength};return{id:s,block:y,link:b}},encodeBranches=(o,i)=>o.map(s=>encodeBranch(i,s)),encodeBranch=function*(o,{id:i,links:s},a){const c=o.fileEncoder.encode({type:NodeType.File,layout:"advanced",parts:s,metadata:a}),d=yield*wait(Promise.resolve(o.hasher.digest(c))),f=o.linker.createLink(o.fileEncoder.code,d),g={bytes:c,cid:f},y={cid:f,contentByteLength:cumulativeContentByteLength(s),dagByteLength:cumulativeDagByteLength(c,s)};return{id:i,block:g,link:y}},writeBlock=function*(o,i){(o.desiredSize||0)<=0&&(yield*wait(o.ready)),o.write(i)},asUint8Array$1=o=>o instanceof Uint8Array?o:o.copyTo(new Uint8Array(o.byteLength),0),isLeafNode=o=>o.children==null,name$1="fixed",context={maxChunkSize:262144},type="Stateless",withMaxChunkSize=o=>({type:"Stateless",context:{maxChunkSize:o},name:name$1,cut}),cut=({maxChunkSize:o},{byteLength:i},s)=>{const a=i/o|0,c=new Array(a).fill(o),d=s?i-a*o:0;return d>0&&c.push(d),c},FixedSize=Object.freeze(Object.defineProperty({__proto__:null,context,cut,name:name$1,type,withMaxChunkSize},Symbol.toStringTag,{value:"Module"})),equals$6=(o,i)=>{if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s{if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")};var encode_1$3=encode$a,MSB$4=128,REST$4=127,MSBALL$4=~REST$4,INT$4=Math.pow(2,31);function encode$a(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$4;)i[s++]=o&255|MSB$4,o/=128;for(;o&MSBALL$4;)i[s++]=o&255|MSB$4,o>>>=7;return i[s]=o|0,encode$a.bytes=s-a+1,i}var decode$f=read$4,MSB$1$4=128,REST$1$4=127;function read$4(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$4.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$4)<=MSB$1$4);return read$4.bytes=d-a,s}var N1$3=Math.pow(2,7),N2$3=Math.pow(2,14),N3$3=Math.pow(2,21),N4$3=Math.pow(2,28),N5$3=Math.pow(2,35),N6$3=Math.pow(2,42),N7$3=Math.pow(2,49),N8$3=Math.pow(2,56),N9$3=Math.pow(2,63),length$3=function(o){return o[_brrp_varint$3.decode(o,i),_brrp_varint$3.decode.bytes],encodeTo$3=(o,i,s=0)=>(_brrp_varint$3.encode(o,i,s),i),encodingLength$3=o=>_brrp_varint$3.encodingLength(o),create$c=(o,i)=>{const s=i.byteLength,a=encodingLength$3(o),c=a+encodingLength$3(s),d=new Uint8Array(c+s);return encodeTo$3(o,d,0),encodeTo$3(s,d,a),d.set(i,c),new Digest$3(o,s,i,d)},decode$d=o=>{const i=coerce$3(o),[s,a]=decode$e(i),[c,d]=decode$e(i.subarray(a)),f=i.subarray(a+d);if(f.byteLength!==c)throw new Error("Incorrect length");return new Digest$3(s,c,f,i)},equals$5=(o,i)=>{if(o===i)return!0;{const s=i;return o.code===s.code&&o.size===s.size&&s.bytes instanceof Uint8Array&&equals$6(o.bytes,s.bytes)}};let Digest$3=class{constructor(i,s,a,c){this.code=i,this.size=s,this.digest=a,this.bytes=c}};const from$a=({name:o,code:i,encode:s})=>new Hasher$2(o,i,s);let Hasher$2=class{constructor(i,s,a){this.name=i,this.code=s,this.encode=a}digest(i){if(i instanceof Uint8Array){const s=this.encode(i);return s instanceof Uint8Array?create$c(this.code,s):s.then(a=>create$c(this.code,a))}else throw Error("Unknown type, must be binary type")}};const sha$1=o=>async i=>new Uint8Array(await crypto.subtle.digest(o,i)),sha256$1=from$a({name:"sha2-256",code:18,encode:sha$1("SHA-256")});function base$3(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$3=base$3,_brrp__multiformats_scope_baseX$3=src$3;let Encoder$3=class{constructor(i,s,a){this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$3=class{constructor(i,s,a){if(this.name=i,this.prefix=s,s.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s.codePointAt(0),this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$5(this,i)}},ComposedDecoder$3=class{constructor(i){this.decoders=i}or(i){return or$5(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const or$5=(o,i)=>new ComposedDecoder$3({...o.decoders||{[o.prefix]:o},...i.decoders||{[i.prefix]:i}});let Codec$3=class{constructor(i,s,a,c){this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$3(i,s,a),this.decoder=new Decoder$3(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};const from$9=({name:o,prefix:i,encode:s,decode:a})=>new Codec$3(o,i,s,a),baseX$3=({prefix:o,name:i,alphabet:s})=>{const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$3(s,i);return from$9({prefix:o,name:i,encode:a,decode:d=>coerce$3(c(d))})},decode$c=(o,i,s,a)=>{const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f},encode$9=(o,i,s)=>{const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f&&(d+=i[c&g<from$9({prefix:i,name:o,encode(c){return encode$9(c,a,s)},decode(c){return decode$c(c,a,s,o)}}),base58btc$2=baseX$3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});const base32$2=rfc4648$3({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$3({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$3({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$3({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$3({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$3({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$3({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$3({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$3({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const format$2=(o,i)=>{const{bytes:s,version:a}=o;switch(a){case 0:return toStringV0$2(s,baseCache$2(o),i||base58btc$2.encoder);default:return toStringV1$2(s,baseCache$2(o),i||base32$2.encoder)}},cache$3=new WeakMap,baseCache$2=o=>{const i=cache$3.get(o);if(i==null){const s=new Map;return cache$3.set(o,s),s}return i};let CID$2=class be{constructor(i,s,a,c){this.code=s,this.version=i,this.multihash=a,this.bytes=c,this["/"]=c}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:i,multihash:s}=this;if(i!==DAG_PB_CODE$3)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(s.code!==SHA_256_CODE$2)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return be.createV0(s)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:i,digest:s}=this.multihash,a=create$c(i,s);return be.createV1(this.code,a)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(i){return be.equals(this,i)}static equals(i,s){const a=s;return a&&i.code===a.code&&i.version===a.version&&equals$5(i.multihash,a.multihash)}toString(i){return format$2(this,i)}toJSON(){return{"/":format$2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(i){if(i==null)return null;const s=i;if(s instanceof be)return s;if(s["/"]!=null&&s["/"]===s.bytes||s.asCID===s){const{version:a,code:c,multihash:d,bytes:f}=s;return new be(a,c,d,f||encodeCID$2(a,c,d.bytes))}else if(s[cidSymbol$2]===!0){const{version:a,multihash:c,code:d}=s,f=decode$d(c);return be.create(a,d,f)}else return null}static create(i,s,a){if(typeof s!="number")throw new Error("String codecs are no longer supported");if(!(a.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(i){case 0:{if(s!==DAG_PB_CODE$3)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$3}) block encoding`);return new be(i,s,a,a.bytes)}case 1:{const c=encodeCID$2(i,s,a.bytes);return new be(i,s,a,c)}default:throw new Error("Invalid version")}}static createV0(i){return be.create(0,DAG_PB_CODE$3,i)}static createV1(i,s){return be.create(1,i,s)}static decode(i){const[s,a]=be.decodeFirst(i);if(a.length)throw new Error("Incorrect length");return s}static decodeFirst(i){const s=be.inspectBytes(i),a=s.size-s.multihashSize,c=coerce$3(i.subarray(a,a+s.multihashSize));if(c.byteLength!==s.multihashSize)throw new Error("Incorrect length");const d=c.subarray(s.multihashSize-s.digestSize),f=new Digest$3(s.multihashCode,s.digestSize,d,c);return[s.version===0?be.createV0(f):be.createV1(s.codec,f),i.subarray(s.size)]}static inspectBytes(i){let s=0;const a=()=>{const[x,T]=decode$e(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$3;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$2(i,s),d=be.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$2(d).set(a,i),d}};const parseCIDtoBytes$2=(o,i)=>{switch(o[0]){case"Q":{const s=i||base58btc$2;return[base58btc$2.prefix,s.decode(`${base58btc$2.prefix}${o}`)]}case base58btc$2.prefix:{const s=i||base58btc$2;return[base58btc$2.prefix,s.decode(o)]}case base32$2.prefix:{const s=i||base32$2;return[base32$2.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}},toStringV0$2=(o,i,s)=>{const{prefix:a}=s;if(a!==base58btc$2.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c},toStringV1$2=(o,i,s)=>{const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c},DAG_PB_CODE$3=112,SHA_256_CODE$2=18,encodeCID$2=(o,i,s)=>{const a=encodingLength$3(o),c=a+encodingLength$3(i),d=new Uint8Array(c+s.byteLength);return encodeTo$3(o,d,0),encodeTo$3(i,d,a),d.set(s,c),d},cidSymbol$2=Symbol.for("@ipld/js-cid/CID");class Node{constructor(i,s,a){this.id=i,this.children=s,this.metadata=a}}const withWidth=o=>({open:()=>open({width:o}),write:write$1,close:close$4}),defaults$3={width:174},open=({width:o}=defaults$3)=>({width:o,head:null,leafIndex:[],nodeIndex:[],lastID:0}),write$1=(o,i)=>{if(i.length===0)return{layout:o,nodes:EMPTY,leaves:EMPTY};{let{lastID:s}=o;const[a,c]=o.head?[null,(i.unshift(o.head),i)]:i.length===1&&o.leafIndex.length===0?[i[0],EMPTY]:[null,i];if(c.length===0)return{layout:{...o,head:a},nodes:EMPTY,leaves:EMPTY};{const d=[...o.leafIndex],f=[];for(const g of c){const y={id:++s,content:g};f.push(y),d.push(y.id)}return d.length>o.width?flush({...o,leafIndex:d,head:a,lastID:s},f):{layout:{...o,head:a,leafIndex:d,lastID:s},leaves:f,nodes:EMPTY}}}},flush=(o,i=EMPTY,s=[],a=!1)=>{let{lastID:c}=o;const d=o.nodeIndex.map(b=>[...b]),f=[...o.leafIndex],{width:g}=o;for(;f.length>g||f.length>0&&a;){grow(d,1);const b=new Node(++c,f.splice(0,g));d[0].push(b.id),s.push(b)}let y=0;for(;yg||b.length>0&&a&&y{const s=o;if(o.head)return{root:{id:1,content:o.head,metadata:i},leaves:EMPTY,nodes:EMPTY};if(o.leafIndex.length===0)return{root:{id:1,metadata:i},leaves:EMPTY,nodes:EMPTY};{const{nodes:a,layout:c}=flush(s,EMPTY,[],!0),{nodeIndex:d}=c,f=d.length-1,g=d[f];if(g.length===1){const y=a[a.length-1];return a.length=a.length-1,{root:y,nodes:a,leaves:EMPTY}}else return{root:new Node(c.lastID+1,g,i),nodes:a,leaves:EMPTY}}},grow=(o,i)=>{for(;o.length({chunker:FixedSize,fileChunkEncoder:UnixFSLeaf,smallFileEncoder:UnixFSLeaf,fileEncoder:UnixFS,fileLayout:withWidth(174),hasher:sha256$1,linker:{createLink:CID$2.createV1}}),configure$4=o=>({...defaults$2(),...o}),UnixFSLeaf={code:code$1,name:name$2,encode:encodeFileChunk},create$b=({writer:o,metadata:i={},settings:s=defaults$2()})=>new FileWriterView(init(o,i,configure$4(s))),write=async(o,i)=>(await perform(o,send({type:"write",bytes:i})),o),close$3=async(o,{releaseLock:i=!1,closeWriter:s=!1}={})=>{await perform(o,send({type:"close"}));const{state:a}=o;if(a.status==="linked")return s?await o.state.writer.close():i&&o.state.writer.releaseLock(),a.link;panic(`Expected writer to be in 'linked' state after close, but it is in "${a.status}" instead`)},perform=(o,i)=>fork$3(loop(i,s=>{const{state:a,effect:c}=update(s,o.state);return o.state=a,c}));class FileWriterView{constructor(i){this.state=i}get writer(){return this.state.writer}get settings(){return this.state.config}write(i){return write(this,i)}close(i){return close$3(this,i)}}const defaults$1=defaults$2,create$a=({writer:o,settings:i=defaults$1(),metadata:s={}})=>new DirectoryWriter({writer:o,metadata:s,settings:i,entries:new Map,closed:!1}),set$4=(o,i,s,{overwrite:a=!1}={})=>{const c=asWritable$1(o.state);if(i.includes("/"))throw new Error(`Directory entry name "${i}" contains forbidden "/" character`);if(!a&&c.entries.has(i))throw new Error(`Directory already contains entry with name "${i}"`);return c.entries.set(i,s),o},remove$1=(o,i)=>(asWritable$1(o.state).entries.delete(i),o),asWritable$1=o=>{if(o.closed)throw new Error("Can not change written directory, but you can .fork() and make changes to it");return o},close$2=async(o,{closeWriter:i=!1,releaseLock:s=!1}={})=>{const{writer:a,settings:c,metadata:d}=asWritable$1(o.state);o.state.closed=!0;const f=[...links$1(o)],g=createFlatDirectory(f,d),y=encodeDirectory(g),b=await c.hasher.digest(y),$=c.linker.createLink(code$1,b);return(a.desiredSize||0)<=0&&await a.ready,a.write({cid:$,bytes:y}),i?await a.close():s&&a.releaseLock(),{cid:$,dagByteLength:cumulativeDagByteLength(y,f)}},links$1=function*({state:o}){for(const[i,{dagByteLength:s,cid:a}]of o.entries)yield{name:i,dagByteLength:s,cid:a}},fork$2=({state:o},{writer:i=o.writer,metadata:s=o.metadata,settings:a=o.settings}={})=>new DirectoryWriter({writer:i,metadata:s,settings:a,entries:new Map(o.entries.entries()),closed:!1});class DirectoryWriter{constructor(i){this.state=i}get writer(){return this.state.writer}get settings(){return this.state.settings}links(){return links$1(this)}set(i,s,a){return set$4(this,i,s,a)}remove(i){return remove$1(this,i)}fork(i){return fork$2(this,i)}close(i){return close$2(this,i)}entries(){return this.state.entries.entries()}has(i){return this.state.entries.has(i)}get size(){return this.state.entries.size}}const api=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),empty$2=(o=32)=>{if(o!==32)throw new Error(`Uint32 BitField does not support size: ${o}`);return 0},from$8=(o,i)=>{let s=empty$2(i);for(const a of o)s=set$3(s,a);return s},size$1=o=>32,mask=(o,i)=>o>>>i&31,offset=(o,i)=>1<bitCount(o&offset(i,0)-1),set$3=(o,i)=>o|1<o&(255^1<(o>>i&1)!==0,bitCount=o=>{const i=o-(o>>1&1431655765),s=(i&858993459)+(i>>2&858993459);return(s+(s>>4)&252645135)*16843009>>24},and$1=(o,i)=>o&i,or$4=(o,i)=>o|i,toBytes$1=o=>Uint8Array.of(o>>24&255,o>>16&255,o>>8&255,o&255),fromBytes$2=o=>{if(o.length!==4)throw new Error(`Expected 4 bytes instead got ${o.length}`);return(o[0]<<24)+(o[1]<<16)+(o[2]<<8)+o[3]},Uint32BitField=Object.freeze(Object.defineProperty({__proto__:null,API:api,and:and$1,bitCount,empty:empty$2,from:from$8,fromBytes:fromBytes$2,get:get$5,or:or$4,popcount:popcount$1,set:set$3,size:size$1,toBytes:toBytes$1,unset:unset$1},Symbol.toStringTag,{value:"Module"}));var murmurHash3js={exports:{}};(function(o,i){(function(s,a){var c={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function d(S){if(!Array.isArray(S)&&!ArrayBuffer.isView(S))return!1;for(var _=0;_255)return!1;return!0}function f(S,_){return(S&65535)*_+(((S>>>16)*_&65535)<<16)}function g(S,_){return S<<_|S>>>32-_}function y(S){return S^=S>>>16,S=f(S,2246822507),S^=S>>>13,S=f(S,3266489909),S^=S>>>16,S}function b(S,_){S=[S[0]>>>16,S[0]&65535,S[1]>>>16,S[1]&65535],_=[_[0]>>>16,_[0]&65535,_[1]>>>16,_[1]&65535];var C=[0,0,0,0];return C[3]+=S[3]+_[3],C[2]+=C[3]>>>16,C[3]&=65535,C[2]+=S[2]+_[2],C[1]+=C[2]>>>16,C[2]&=65535,C[1]+=S[1]+_[1],C[0]+=C[1]>>>16,C[1]&=65535,C[0]+=S[0]+_[0],C[0]&=65535,[C[0]<<16|C[1],C[2]<<16|C[3]]}function $(S,_){S=[S[0]>>>16,S[0]&65535,S[1]>>>16,S[1]&65535],_=[_[0]>>>16,_[0]&65535,_[1]>>>16,_[1]&65535];var C=[0,0,0,0];return C[3]+=S[3]*_[3],C[2]+=C[3]>>>16,C[3]&=65535,C[2]+=S[2]*_[3],C[1]+=C[2]>>>16,C[2]&=65535,C[2]+=S[3]*_[2],C[1]+=C[2]>>>16,C[2]&=65535,C[1]+=S[1]*_[3],C[0]+=C[1]>>>16,C[1]&=65535,C[1]+=S[2]*_[2],C[0]+=C[1]>>>16,C[1]&=65535,C[1]+=S[3]*_[1],C[0]+=C[1]>>>16,C[1]&=65535,C[0]+=S[0]*_[3]+S[1]*_[2]+S[2]*_[1]+S[3]*_[0],C[0]&=65535,[C[0]<<16|C[1],C[2]<<16|C[3]]}function x(S,_){return _%=64,_===32?[S[1],S[0]]:_<32?[S[0]<<_|S[1]>>>32-_,S[1]<<_|S[0]>>>32-_]:(_-=32,[S[1]<<_|S[0]>>>32-_,S[0]<<_|S[1]>>>32-_])}function T(S,_){return _%=64,_===0?S:_<32?[S[0]<<_|S[1]>>>32-_,S[1]<<_]:[S[1]<<_-32,0]}function A(S,_){return[S[0]^_[0],S[1]^_[1]]}function E(S){return S=A(S,[0,S[0]>>>1]),S=$(S,[4283543511,3981806797]),S=A(S,[0,S[0]>>>1]),S=$(S,[3301882366,444984403]),S=A(S,[0,S[0]>>>1]),S}c.x86.hash32=function(S,_){if(c.inputValidation&&!d(S))return a;_=_||0;for(var C=S.length%4,B=S.length-C,D=_,I=0,L=3432918353,N=461845907,O=0;O>>0},c.x86.hash128=function(S,_){if(c.inputValidation&&!d(S))return a;_=_||0;for(var C=S.length%16,B=S.length-C,D=_,I=_,L=_,N=_,O=0,R=0,z=0,K=0,G=597399067,W=2869860233,J=951274213,ie=2716044179,H=0;H>>0).toString(16)).slice(-8)+("00000000"+(I>>>0).toString(16)).slice(-8)+("00000000"+(L>>>0).toString(16)).slice(-8)+("00000000"+(N>>>0).toString(16)).slice(-8)},c.x64.hash128=function(S,_){if(c.inputValidation&&!d(S))return a;_=_||0;for(var C=S.length%16,B=S.length-C,D=[0,_],I=[0,_],L=[0,0],N=[0,0],O=[2277735313,289559509],R=[1291169091,658871167],z=0;z>>0).toString(16)).slice(-8)+("00000000"+(D[1]>>>0).toString(16)).slice(-8)+("00000000"+(I[0]>>>0).toString(16)).slice(-8)+("00000000"+(I[1]>>>0).toString(16)).slice(-8)},o.exports&&(i=o.exports=c),i.murmurHash3=c})()})(murmurHash3js,murmurHash3js.exports);var murmurHash3jsExports=murmurHash3js.exports,murmurhash3jsRevisited=murmurHash3jsExports;const mur=getDefaultExportFromCjs(murmurhash3jsRevisited),utf8$2=new TextEncoder,hash32=mur.x64.hash126,configure$3=({bitWidth:o=5,hash:i=hash32})=>{if(o>4*8)throw new RangeError(`Can not use bitWidth ${o} which exceeds the hashSize 4`);const a=4294967295>>>32-o;return{at:(f,g)=>f>>>g*o&a,from:f=>i(utf8$2.encode(f)),size:Math.ceil(4*8/o)}};class BitmapIndexedNode{constructor(i,s,a,c,d){this.edit=i,this.config=d,this.datamap=s,this.nodemap=a,this.children=c}get nodeArity(){return this.config.BitField.popcount(this.nodemap)}get dataArity(){return this.config.BitField.popcount(this.datamap)}empty(){return create$9(this.config)}lookup(i,s,a,c){return lookup(this,i,s,a,c)}associate(i,s,a,c,d,f){return associate(this,i,s,a,c,d,f)}dissociate(i,s,a,c,d){return dissociate(this,i,s,a,c,d)}fork(i=null){return fork$1(this,i)}entries(){return entries(this)}keys(){return keys(this)}values(){return values(this)}}class HashCollisionNode{constructor(i,s,a,c){this.edit=i,this.count=s,this.children=a,this.config=c}get nodeArity(){return 0}get dataArity(){return this.count}lookup(i,s,a,c){return lookupCollision(this,a,c)}associate(i,s,a,c,d,f){return associateCollision(this,i,a,c,d,f)}dissociate(i,s,a,c,d){return dissociateCollision(this,i,a,c,d)}fork(i=null){return forkCollision(this,i)}entries(){return entries(this)}keys(){return keys(this)}values(){return values(this)}}const lookupCollision=(o,i,s)=>{const{children:a,count:c}=o,d=findHashCollisionNodeIndex(a,c,i);return a[d]===i?a[d+1]:s},associateCollision=(o,i,s,a,c,d)=>{const{children:f,count:g}=o,y=findHashCollisionNodeIndex(f,g,a);if(f[y]!==a){const b=o.fork(i);return d.value=!0,b.count+=1,b.children.splice(y,s,c),b}else if(f[y+1]!==c){const b=o.fork(i);return b.children[y+1]=c,b}else return o},dissociateCollision=(o,i,s,a,c)=>{const{children:d,count:f,config:g}=o,y=findHashCollisionNodeIndex(d,f,a);if(d[y]!==a)return o;if(c.value=!0,f===2){const b=y===0?2:0;return associate(create$9(g),i,0,s,d[b],d[b+1],c)}else{const b=o.fork(i);return b.children.splice(y,2),b.count-=1,b}},forkCollision=(o,i=null)=>canEdit(o.edit,i)?o:new HashCollisionNode(i,o.count,o.children.slice(),o.config),findHashCollisionNodeIndex=(o,i,s)=>{let a=0;for(;as;)a+=2;return a},create$9=(o,i=null)=>new BitmapIndexedNode(i,o.BitField.empty(Math.pow(2,o.bitWidth)),o.BitField.empty(Math.pow(2,o.bitWidth)),[],o),get$4=(o,i,s)=>lookup(o,0,o.config.Path.from(i),i,s),lookup=(o,i,s,a,c)=>{const{datamap:d,nodemap:f,config:g}=o,{Path:y,BitField:b}=g,$=y.at(s,i);if(b.get(d,$)){const x=b.popcount(d,$);return keyAt(o,x)===a?valueAt(o,x):c}else return b.get(f,$)?resolveNode(o,$).lookup(i+1,s,a,c):c},set$2=(o,i,s,a,c)=>associate(o,i,0,o.config.Path.from(s),s,a,c),associate=(o,i,s,a,c,d,f)=>{const{datamap:g,nodemap:y,config:b}=o,{Path:$,BitField:x}=b,T=$.at(a,s);if(x.get(g,T)){const A=x.popcount(g,T),E=keyAt(o,A);if(c===E)return valueAt(o,A)===d?o:forkAndSet(o,i,A,d);{const S=mergeTwoLeaves(b,i,s+1,$.from(E),E,valueAt(o,A),a,c,d);return f.value=!0,migrateLeafToBranch(o,i,T,S)}}else if(x.get(y,T)){const A=resolveNode(o,T),E=A.associate(i,s+1,a,c,d,f);return A===E?o:copyAndSetChild(o,i,T,E)}else{const A=x.popcount(g,T);f.value=!0;const E=o.fork(i);return E.datamap=x.set(g,T),E.children.splice(keyPosition(A),0,c,d),E}},remove=(o,i,s,a)=>dissociate(o,i,0,o.config.Path.from(s),s,a),dissociate=(o,i,s,a,c,d)=>{const{datamap:f,nodemap:g,config:y}=o,{BitField:b,Path:$}=y,x=$.at(a,s);if(b.get(f,x)){const T=b.popcount(f,x);if(c===keyAt(o,T)){d.value=!0;const A=fork$1(o,i);return A.datamap=b.unset(o.datamap,x),A.children.splice(keyPosition(T),2),A}else return o}else if(b.get(g,x)){const T=resolveNode(o,x),A=T.dissociate(i,s+1,a,c,d);return hasSingleLeaf(A)?hasSingleNode(o)?A:inlineChild(o,i,x,A):T===A?o:copyAndSetChild(o,i,x,A)}else return o},entries=function*({children:o}){let i=0;const s=o.length;for(;icanEdit(o.edit,i)?o:new BitmapIndexedNode(i,o.datamap,o.nodemap,o.children.slice(),o.config),keys=function*({children:o}){let i=0;const s=o.length;for(;i{const c=o.fork(i);return c.children[valuePosition(s)]=a,c},inlineChild=(o,i,s,a)=>{const{datamap:c,nodemap:d,config:f}=o,{BitField:g}=f,y=fork$1(o,i);return y.children.splice(nodePosition(o,s),1),y.children.splice(keyPosition(g.popcount(c,s)),0,a.children[0],a.children[1]),y.datamap=g.set(c,s),y.nodemap=g.unset(d,s),y},copyAndSetChild=(o,i,s,a)=>{const c=fork$1(o,i);return c.children[nodePosition(o,s)]=a,c},migrateLeafToBranch=(o,i,s,a)=>{const{nodemap:c,datamap:d,config:f}=o,{BitField:g}=f,y=g.popcount(d,s),b=keyPosition(y),$=nodePosition(o,s),x=fork$1(o,i);return x.datamap=g.unset(d,s),x.children.splice(b,2),x.nodemap=g.set(c,s),x.children.splice($-1,0,a),x},mergeTwoLeaves=(o,i,s,a,c,d,f,g,y)=>{const{BitField:b,Path:$}=o;if($.sizeo[keyPosition(i)],keyPosition=o=>o*2,valueAt=({children:o},i)=>o[valuePosition(i)],valuePosition=o=>o*2+1,resolveNode=(o,i)=>o.children[nodePosition(o,i)],nodePosition=({children:o,nodemap:i,config:s},a)=>o.length-1-s.BitField.popcount(i,a),canEdit=(o,i)=>o!=null&&o===i,hasSingleLeaf=o=>o.nodeArity===0&&o.dataArity===1,hasSingleNode=({config:{BitField:o},datamap:i,nodemap:s})=>o.popcount(i)===0&&o.popcount(s)===1,empty$1=new Uint8Array(0);function fromHex(o){const i=o.match(/../g);return i!=null?new Uint8Array(i.map(s=>parseInt(s,16))):empty$1}function coerce$2(o){if(o instanceof Uint8Array&&o.constructor.name==="Uint8Array")return o;if(o instanceof ArrayBuffer)return new Uint8Array(o);if(ArrayBuffer.isView(o))return new Uint8Array(o.buffer,o.byteOffset,o.byteLength);throw new Error("Unknown type, must be binary type")}function base$2(o,i){if(o.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$2=base$2,_brrp__multiformats_scope_baseX$2=src$2;let Encoder$2=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$2=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$3(this,i)}},ComposedDecoder$2=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$3(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$3(o,i){return new ComposedDecoder$2({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$2=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$2(i,s,a),this.decoder=new Decoder$2(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$7({name:o,prefix:i,encode:s,decode:a}){return new Codec$2(o,i,s,a)}function baseX$2({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$2(s,o);return from$7({prefix:i,name:o,encode:a,decode:d=>coerce$2(c(d))})}function decode$b(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$8(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<=INT$3;)i[s++]=o&255|MSB$3,o/=128;for(;o&MSBALL$3;)i[s++]=o&255|MSB$3,o>>>=7;return i[s]=o|0,encode$7.bytes=s-a+1,i}var decode$a=read$3,MSB$1$3=128,REST$1$3=127;function read$3(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$3.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$3)<=MSB$1$3);return read$3.bytes=d-a,s}var N1$2=Math.pow(2,7),N2$2=Math.pow(2,14),N3$2=Math.pow(2,21),N4$2=Math.pow(2,28),N5$2=Math.pow(2,35),N6$2=Math.pow(2,42),N7$2=Math.pow(2,49),N8$2=Math.pow(2,56),N9$2=Math.pow(2,63),length$2=function(o){return ocreate$8(this.code,a))}else throw Error("Unknown type, must be binary type")}};const murmur364=from$6({name:"murmur3-x64-64",code:34,encode:o=>fromHex(mur.x64.hash128(o)).subarray(0,8)}),utf8$1=new TextEncoder,hash64$1=o=>murmur364.encode(o),configure$2=({bitWidth:o=8,hash:i=hash64$1}={})=>{const s=i(new Uint8Array).byteLength;return{from:d=>i(utf8$1.encode(d)),at:(d,f)=>{const g=f*o;if(g>s)throw new RangeError("Out of bounds");return toInt(d,g,o)},size:Math.ceil(s*8/o)}},toInt=(o,i,s)=>{let a=i/8|0,c=i%8,d=s,f=0;for(;d>0&&a>c&g)>>$;f=(f<{if(o%8!==0)throw new Error("Must be multiple of 8");return new Uint8Array(o/8)},from$5=(o,i)=>{let s=empty(i);for(const a of o){const{byte:c,byteOffset:d,bitOffset:f}=at(s,a);s[d]=c|1<o.byteLength*8,at=(o,i)=>{const s=o.byteLength-1-(i/8|0),a=i%8;return{byte:o[s],byteOffset:s,bitOffset:a}},setByte=(o,i,s)=>{if(o[i]!==s){const a=o.slice(0);return a[i]=s,a}return o},set$1=(o,i)=>{const{byte:s,byteOffset:a,bitOffset:c}=at(o,i);return setByte(o,a,s|1<{const{byte:s,byteOffset:a,bitOffset:c}=at(o,i);return setByte(o,a,s&(255^1<{var{byte:s,bitOffset:a}=at(o,i);return(s>>a&1)!==0},toBytes=o=>o,fromBytes$1=o=>o,popcount=(o,i=o.byteLength*8)=>{const{byteOffset:s,bitOffset:a,byte:c}=at(o,i);let d=popcount$1(c,a),f=o.byteLength-1;for(;f>s;){const g=o[f];d+=bitCount(g),f--}return d},or$2=(o,i)=>{const s=o.slice();let a=0;for(;a{const s=o.slice();let a=0;for(;a({bitWidth:o,BitField:i,Path:s}),from$4=(o,i)=>{const s=builder$1(i);for(const[a,c]of o)s.set(a,c);return s.build()},has=(o,i)=>get$4(o.root,i,NOT_FOUND)!==NOT_FOUND,get$2=(o,i,s=void 0)=>get$4(o.root,i,s),builder$1=o=>{const i={},s=configure$1(o);return new HashMapBuilder(i,0,create$9(s,i),s)};class PersistentHashMap{constructor(i=0,s,a){this.count=i,this.root=s,this.config=a}get size(){return this.count}clone(){return new PersistentHashMap(this.count,this.root,this.config)}empty(){return new PersistentHashMap(0,create$9(this.config,null),this.config)}has(i){return has(this,i)}get(i){return get$4(this.root,i,void 0)}set(i,s){const a={value:!1},c=set$2(this.root,null,i,s,a);return c===this.root?this:new PersistentHashMap(a.value?this.count+1:this.count,c,this.config)}delete(i){const s=remove(this.root,null,i,{value:!1});return s===this.root?this:new PersistentHashMap(this.count-1,s,this.config)}get bitField(){return this.config.BitField.or(this.root.datamap,this.root.nodemap)}[Symbol.iterator](){return this.entries()}entries(){return this.root.entries()}keys(){return this.root.keys()}values(){return this.root.values()}createBuilder(){return new HashMapBuilder({},this.count,this.root,this.config)}}class HashMapBuilder{constructor(i,s,a,c){this.edit=i,this.count=s,this.root=a,this.config=c}get size(){if(this.edit)return this.count;throw new Error(".size was accessed on the finalized builder")}set(i,s){if(this.edit){const a={value:!1},c=set$2(this.root,this.edit,i,s,a);return this.root!==c&&(this.root=c),a.value&&(this.count+=1),this}else throw new Error(".set was called on the finalized builder")}delete(i){if(this.edit){if(this.count===0)return this;const s={value:!1},a=remove(this.root,this.edit,i,s);return a!==this.root&&(this.root=a),s.value&&(this.count-=1),this}else throw new Error(".delete was called on the finalized builder")}build(){if(this.edit)return this.edit=null,new PersistentHashMap(this.count,this.root,this.config);throw new Error(".build was called on the finalized builder")}}const utf8=new TextEncoder,hash64=o=>murmur364.encode(o),configure=({bitWidth:o=8,hash:i=hash64})=>{const s=i(new Uint8Array).byteLength,a={bitWidth:o,hash:i,hashSize:s};return{at:(f,g)=>read$2(f,g,a),from:f=>utf8.encode(f),size:1/0}},read$2=(o,i=0,{bitWidth:s=8,hash:a,hashSize:c})=>{const d=c*8;let f=0,g=s,y=s*i;for(;g>0;){const b=y/d>>0,$=a(b===0?o:appendByte(o,b)),x=d<=y?y%d:y,T=d-x,A=T{const s=new Uint8Array(o.byteLength+1).fill(i,o.byteLength);return s.set(o),s},bitWidth=8,config={bitWidth,Path:configure({bitWidth})},tableSize=o=>Math.pow(2,o.config.bitWidth),builder=(o=config)=>builder$1(o),from$3=(o,i=config)=>from$4(o,i),bitField=({datamap:o,nodemap:i,config:{BitField:s}})=>withoutLeadingZeros(s.toBytes(s.or(o,i))),withoutLeadingZeros=o=>{let i=0;for(;i`[${JSON.stringify(f)}]`).join("")}`);const d=CID$2.asCID(s);if(d)return{value:d,remaining:i.slice(a+1).join("/")}}return{value:s}}class Block{constructor({cid:i,bytes:s,value:a}){if(!i||!s||typeof a>"u")throw new Error("Missing required argument");this.cid=i,this.bytes=s,this.value=a,this.asBlock=this,Object.defineProperties(this,{cid:readonly(),bytes:readonly(),value:readonly(),asBlock:readonly()})}links(){return links(this.value,[])}tree(){return tree(this.value,[])}get(i="/"){return get$1(this.value,i.split("/").filter(Boolean))}}const defaults=defaults$2,create$7=({writer:o,settings:i=defaults(),metadata:s={}})=>new HAMTDirectoryWriter({writer:o,metadata:s,settings:i,entries:new HashMap,closed:!1}),asWritable=o=>{if(o.closed)throw new Error("Can not change written HAMT directory, but you can .fork() and make changes to it");return o},close$1=async(o,{closeWriter:i=!1,releaseLock:s=!1}={})=>{const{writer:a,settings:c,metadata:d}=asWritable(o.state);o.state.closed=!0;const{entries:f}=o.state;if(!(f instanceof HashMap))throw new Error(`not a HAMT: ${f}`);const g=f.builder.build(),y=iterateBlocks(g,g.root,c);let b=null;for await(const $ of y)b=$,(a.desiredSize||0)<=0&&await a.ready,a.write($);if(b==null)throw new Error("no root block yielded");return i?await a.close():s&&a.releaseLock(),{cid:b.cid,dagByteLength:cumulativeDagByteLength(b.bytes,b.value.entries)}},iterateBlocks=async function*(o,i,s){const a=[];for(const d of iterate(i))if("key"in d)a.push({name:`${d.prefix??""}${d.key??""}`,dagByteLength:d.value.dagByteLength,cid:d.value.cid});else{let f=null;for await(const g of iterateBlocks(o,d.node,s))yield g,f=g;if(f==null)throw new Error("no root block yielded");a.push({name:d.prefix,dagByteLength:cumulativeDagByteLength(f.bytes,f.value.entries),cid:f.cid})}const c=createDirectoryShard(a,bitField(i),tableSize(o),murmur364.code);yield await encodeHAMTShardBlock(c,s)};async function encodeHAMTShardBlock(o,i){const s=encodeHAMTShard(o),a=await i.hasher.digest(s),c=i.linker.createLink(code$2,a);return new Block({cid:c,bytes:s,value:o})}const fork=({state:o},{writer:i=o.writer,metadata:s=o.metadata,settings:a=o.settings}={})=>new HAMTDirectoryWriter({writer:i,metadata:s,settings:a,entries:new HashMap(from$3(o.entries.entries()).createBuilder()),closed:!1});class HAMTDirectoryWriter{constructor(i){this.state=i}get writer(){return this.state.writer}get settings(){return this.state.settings}set(i,s,a){return set$4(this,i,s,a)}remove(i){return remove$1(this,i)}fork(i){return fork(this,i)}close(i){return close$1(this,i)}entries(){return this.state.entries.entries()}has(i){return this.state.entries.has(i)}get size(){return this.state.entries.size}}class HashMap extends Map{constructor(i=builder()){super(),this.builder=i}clear(){this.builder=builder()}delete(i){const{root:s}=this.builder;return this.builder.delete(i),this.builder.root!==s}forEach(i,s=this){for(const[a,c]of this.builder.root.entries())i.call(s,c,a,this)}get(i){return get$2(this.builder,i)}has(i){return has(this.builder,i)}set(i,s){return this.builder.set(i,s),this}get size(){return this.builder.size}[Symbol.iterator](){return this.builder.root.entries()}entries(){return this.builder.root.entries()}keys(){return this.builder.root.keys()}values(){return this.builder.root.values()}}const createWriter=({writable:o,settings:i=defaults$2()})=>new FileSystemWriter({writer:o.getWriter(),settings:i}),close=async(o,{releaseLock:i=!0,closeWriter:s=!0}={})=>(s?await o.writer.close():i&&o.writer.releaseLock(),o);class FileSystemWriter{constructor({writer:i,settings:s}){this.writer=i,this.settings=configure$4(s)}createFileWriter({settings:i=this.settings,metadata:s}={}){return create$b({writer:this.writer,settings:i,metadata:s})}createDirectoryWriter({settings:i=this.settings,metadata:s}={}){return create$a({writer:this.writer,settings:i,metadata:s})}close(i){return close(this,i)}}const BLOCK_SIZE_LIMIT=1048576,defaultCapacity=BLOCK_SIZE_LIMIT*100,withCapacity=(o=defaultCapacity)=>({highWaterMark:o,size:i=>i.bytes.length}),SHARD_THRESHOLD=1e3,queuingStrategy=withCapacity(),defaultSettings=configure$4({fileChunkEncoder:raw,smallFileEncoder:raw,chunker:withMaxChunkSize(1024*1024),fileLayout:withWidth(1024)});function createFileEncoderStream(o,i){const{readable:s,writable:a}=new TransformStream({},queuingStrategy),c=(i==null?void 0:i.settings)??defaultSettings,d=createWriter({writable:a,settings:c}),f=new UnixFSFileBuilder("",o);return(async()=>(await f.finalize(d),await d.close()))(),s}var wt;class UnixFSFileBuilder{constructor(i,s){Y(this,wt);this.name=i,Q(this,wt,s)}async finalize(i){const s=create$b(i);return await F(this,wt).stream().pipeTo(new WritableStream({async write(a){await s.write(a)}})),await s.close()}}wt=new WeakMap;var ot;class UnixFSDirectoryBuilder{constructor(i,s){Y(this,ot);U(this,"entries",new Map);this.name=i,Q(this,ot,s)}async finalize(i){var a;const s=this.entries.size<=SHARD_THRESHOLD?create$a(i):create$7(i);for(const[c,d]of this.entries){const f=await d.finalize(i);(a=F(this,ot))!=null&&a.onDirectoryEntryLink&&F(this,ot).onDirectoryEntryLink({name:d.name,...f}),s.set(c,f)}return await s.close()}}ot=new WeakMap;function createDirectoryEncoderStream(o,i){const s=new UnixFSDirectoryBuilder("",i);for(const g of o){const y=g.name.split("/");(y[0]===""||y[0]===".")&&y.shift();let b=s;for(const[$,x]of y.entries()){if($===y.length-1){b.entries.set(x,new UnixFSFileBuilder(y.join("/"),g));break}let T=b.entries.get(x);if(T==null){const A=b===s?x:`${b.name}/${x}`;T=new UnixFSDirectoryBuilder(A,i),b.entries.set(x,T)}if(!(T instanceof UnixFSDirectoryBuilder))throw new Error(`"${g.name}" cannot be a file and a directory`);b=T}}const{readable:a,writable:c}=new TransformStream({},queuingStrategy),d=(i==null?void 0:i.settings)??defaultSettings,f=createWriter({writable:c,settings:d});return(async()=>{const g=await s.finalize(f);i!=null&&i.onDirectoryEntryLink&&i.onDirectoryEntryLink({name:"",...g}),await f.close()})(),a}async function readHeader(o,i){const s=decodeVarint$1(await o.upTo(8),o);if(s===0)throw new Error("Invalid CAR header (zero length)");const a=await o.exactly(s,!0),c=decode$1a(a);if(CarV1HeaderOrV2Pragma.toTyped(c)===void 0)throw new Error("Invalid CAR header format");if(c.version!==1&&c.version!==2||i!==void 0&&c.version!==i)throw new Error(`Invalid CAR version: ${c.version}${i!==void 0?` (expected ${i})`:""}`);if(c.version===1){if(!Array.isArray(c.roots))throw new Error("Invalid CAR header format");return c}if(c.roots!==void 0)throw new Error("Invalid CAR header format");const d=decodeV2Header(await o.exactly(V2_HEADER_LENGTH,!0));o.seek(d.dataOffset-o.pos);const f=await readHeader(o,1);return Object.assign(f,d)}async function readCid(o){const i=await o.exactly(2,!1);if(i[0]===CIDV0_BYTES$1.SHA2_256&&i[1]===CIDV0_BYTES$1.LENGTH){const f=await o.exactly(34,!0),g=decode$O(f);return CID$6.create(0,CIDV0_BYTES$1.DAG_PB,g)}const s=decodeVarint$1(await o.upTo(8),o);if(s!==1)throw new Error(`Unexpected CID version (${s})`);const a=decodeVarint$1(await o.upTo(8),o),c=await o.exactly(getMultihashLength$1(await o.upTo(8)),!0),d=decode$O(c);return CID$6.create(s,a,d)}async function readBlockHead(o){const i=o.pos;let s=decodeVarint$1(await o.upTo(8),o);if(s===0)throw new Error("Invalid CAR section (zero length)");s+=o.pos-i;const a=await readCid(o),c=s-Number(o.pos-i);return{cid:a,length:s,blockLength:c}}async function readBlock(o){const{cid:i,blockLength:s}=await readBlockHead(o);return{bytes:await o.exactly(s,!0),cid:i}}async function readBlockIndex(o){const i=o.pos,{cid:s,length:a,blockLength:c}=await readBlockHead(o),d={cid:s,length:a,blockLength:c,offset:i,blockOffset:o.pos};return o.seek(d.blockLength),d}function createDecoder(o){const i=(async()=>{const s=await readHeader(o);if(s.version===2){const a=o.pos-s.dataOffset;o=limitReader(o,s.dataSize-a)}return s})();return{header:()=>i,async*blocks(){for(await i;(await o.upTo(8)).length>0;)yield await readBlock(o)},async*blocksIndex(){for(await i;(await o.upTo(8)).length>0;)yield await readBlockIndex(o)}}}function bytesReader(o){let i=0;return{async upTo(s){return o.subarray(i,i+Math.min(s,o.length-i))},async exactly(s,a=!1){if(s>o.length-i)throw new Error("Unexpected end of data");const c=o.subarray(i,i+s);return a&&(i+=s),c},seek(s){i+=s},get pos(){return i}}}function chunkReader(o){let i=0,s=0,a=0,c=new Uint8Array(0);const d=async f=>{s=c.length-a;const g=[c.subarray(a)];for(;ss&&g.push(b.subarray(-s)):g.push(b),s+=b.length}c=new Uint8Array(g.reduce((b,$)=>b+$.length,0));let y=0;for(const b of g)c.set(b,y),y+=b.length;a=0};return{async upTo(f){return c.length-ai&&(c=c.subarray(0,i-s)),c},async exactly(a,c=!1){const d=await o.exactly(a,c);if(d.length+s>i)throw new Error("Unexpected end of data");return c&&(s+=a),d},seek(a){s+=a,o.seek(a)},get pos(){return o.pos}}}class CarIteratorBase{constructor(i,s,a){this._version=i,this._roots=s,this._iterable=a,this._decoded=!1}get version(){return this._version}async getRoots(){return this._roots}}class CarBlockIterator extends CarIteratorBase{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");return this._decoded=!0,this._iterable[Symbol.asyncIterator]()}static async fromBytes(i){const{version:s,roots:a,iterator:c}=await fromBytes(i);return new CarBlockIterator(s,a,c)}static async fromIterable(i){const{version:s,roots:a,iterator:c}=await fromIterable(i);return new CarBlockIterator(s,a,c)}}async function fromBytes(o){if(!(o instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return decodeIterator(bytesReader(o))}async function fromIterable(o){if(!o||typeof o[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return decodeIterator(asyncIterableReader(o))}async function decodeIterator(o){const i=createDecoder(o),{version:s,roots:a}=await i.header();return{version:s,roots:a,iterator:i.blocks()}}const CAR_V1_VERSION=1;function createHeader(o){const i=encode$O({version:CAR_V1_VERSION,roots:o}),s=varint$a.encode(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a}function createEncoder(o){return{async setRoots(i){const s=createHeader(i);await o.write(s)},async writeBlock(i){const{cid:s,bytes:a}=i;await o.write(new Uint8Array(varint$a.encode(s.bytes.length+a.length))),await o.write(s.bytes),a.length&&await o.write(a)},async close(){await o.end()},version(){return CAR_V1_VERSION}}}function noop(){}function create$6(){const o=[];let i=null,s=noop,a=!1,c=null,d=noop;const f=()=>(i||(i=new Promise(b=>{s=()=>{i=null,s=noop,b()}})),i),g={write(b){o.push(b);const $=f();return d(),$},async end(){a=!0;const b=f();d(),await b}},y={async next(){const b=o.shift();return b?(o.length===0&&s(),{done:!1,value:b}):a?(s(),{done:!0,value:void 0}):(c||(c=new Promise($=>{d=()=>(c=null,d=noop,$(y.next()))})),c)}};return{writer:g,iterator:y}}class CarWriter{constructor(i,s){this._encoder=s,this._mutex=s.setRoots(i),this._ended=!1}async put(i){if(!(i.bytes instanceof Uint8Array)||!i.cid)throw new TypeError("Can only write {cid, bytes} objects");if(this._ended)throw new Error("Already closed");const s=CID$6.asCID(i.cid);if(!s)throw new TypeError("Can only write {cid, bytes} objects");return this._mutex=this._mutex.then(()=>this._encoder.writeBlock({cid:s,bytes:i.bytes})),this._mutex}async close(){if(this._ended)throw new Error("Already closed");return await this._mutex,this._ended=!0,this._encoder.close()}version(){return this._encoder.version()}static create(i){i=toRoots(i);const{encoder:s,iterator:a}=encodeWriter(),c=new CarWriter(i,s),d=new CarWriterOut(a);return{writer:c,out:d}}static createAppender(){const{encoder:i,iterator:s}=encodeWriter();i.setRoots=()=>Promise.resolve();const a=new CarWriter([],i),c=new CarWriterOut(s);return{writer:a,out:c}}static async updateRootsInBytes(i,s){const a=bytesReader(i);await readHeader(a);const c=createHeader(s);if(Number(a.pos)!==c.length)throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${a.pos} bytes, new header is ${c.length} bytes)`);return i.set(c,0),i}}class CarWriterOut{constructor(i){this._iterator=i}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}}function encodeWriter(){const o=create$6(),{writer:i,iterator:s}=o;return{encoder:createEncoder(i),iterator:s}}function toRoots(o){if(o===void 0)return[];if(!Array.isArray(o)){const s=CID$6.asCID(o);if(!s)throw new TypeError("roots must be a single CID or an array of CIDs");return[s]}const i=[];for(const s of o){const a=CID$6.asCID(s);if(!a)throw new TypeError("roots must be a single CID or an array of CIDs");i.push(a)}return i}const code=514,NO_ROOTS_HEADER_LENGTH=18;function headerEncodingLength(o){if(!o)return NO_ROOTS_HEADER_LENGTH;const i=encode$O({version:1,roots:[o]}).length;return varint$a.encodingLength(i)+i}function blockHeaderEncodingLength(o){const i=o.cid.bytes.length+o.bytes.length;return varint$a.encodingLength(i)+o.cid.bytes.length}function blockEncodingLength(o){return blockHeaderEncodingLength(o)+o.bytes.length}async function encode$6(o,i){const{writer:s,out:a}=CarWriter.create(i);let c;(async()=>{try{for await(const g of o)await s.put(g)}catch(g){c=g}finally{await s.close()}})();const d=[];for await(const g of a)d.push(g);if(c!=null)throw c;const f=i!=null?[i]:[];return Object.assign(new Blob(d),{version:1,roots:f})}class BlockStream extends ReadableStream{constructor(i){let s=null;const a=()=>s||(s=CarBlockIterator.fromIterable(toIterable(i.stream())),s);let c=null;super({async start(){c=(await a())[Symbol.asyncIterator]()},async pull(d){if(!c)throw new Error("missing blocks iterator");const{value:f,done:g}=await c.next();if(g)return d.close();d.enqueue(f)}}),this.getRoots=async()=>await(await a()).getRoots()}}function toIterable(o){return Symbol.asyncIterator in o?o:async function*(){const i=o.getReader();try{for(;;){const{done:s,value:a}=await i.read();if(s)return;yield a}}finally{i.releaseLock()}}()}function compare(o,i){for(let s=0;si[s])return 1}return o.byteLength>i.byteLength?1:o.byteLength=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src$1=base$1,_brrp__multiformats_scope_baseX$1=src$1;let Encoder$1=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}},Decoder$1=class{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or$1(this,i)}},ComposedDecoder$1=class{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or$1(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$1(o,i){return new ComposedDecoder$1({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}let Codec$1=class{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder$1(i,s,a),this.decoder=new Decoder$1(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}};function from$2({name:o,prefix:i,encode:s,decode:a}){return new Codec$1(o,i,s,a)}function baseX$1({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX$1(s,o);return from$2({prefix:i,name:o,encode:a,decode:d=>coerce$1(c(d))})}function decode$9(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$5(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<(o[s]=i,o),[]),alphabetCharsToBytes=alphabet.reduce((o,i,s)=>{const a=i.codePointAt(0);if(a==null)throw new Error(`Invalid character: ${i}`);return o[a]=s,o},[]);function encode$4(o){return o.reduce((i,s)=>(i+=alphabetBytesToChars[s],i),"")}function decode$8(o){const i=[];for(const s of o){const a=s.codePointAt(0);if(a==null)throw new Error(`Invalid character: ${s}`);const c=alphabetCharsToBytes[a];if(c==null)throw new Error(`Non-base256emoji character: ${s}`);i.push(c)}return new Uint8Array(i)}from$2({prefix:"🚀",name:"base256emoji",encode:encode$4,decode:decode$8});const base32$1=rfc4648$1({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$1({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$1({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$1({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$1({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$1({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$1({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$1({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$1({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const base36$1=baseX$1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"});baseX$1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});const base58btc$1=baseX$1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});rfc4648$1({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});rfc4648$1({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6});rfc4648$1({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6});rfc4648$1({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});rfc4648$1({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});from$2({prefix:"\0",name:"identity",encode:o=>toString(o),decode:o=>fromString(o)});new TextEncoder;new TextDecoder;var encode_1$1=encode$3,MSB$2=128,REST$2=127,MSBALL$2=~REST$2,INT$2=Math.pow(2,31);function encode$3(o,i,s){i=i||[],s=s||0;for(var a=s;o>=INT$2;)i[s++]=o&255|MSB$2,o/=128;for(;o&MSBALL$2;)i[s++]=o&255|MSB$2,o>>>=7;return i[s]=o|0,encode$3.bytes=s-a+1,i}var decode$7=read$1,MSB$1$2=128,REST$1$2=127;function read$1(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read$1.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$2)<=MSB$1$2);return read$1.bytes=d-a,s}var N1$1=Math.pow(2,7),N2$1=Math.pow(2,14),N3$1=Math.pow(2,21),N4$1=Math.pow(2,28),N5$1=Math.pow(2,35),N6$1=Math.pow(2,42),N7$1=Math.pow(2,49),N8$1=Math.pow(2,56),N9$1=Math.pow(2,63),length$1=function(o){return ocreate$5(this.code,a))}else throw Error("Unknown type, must be binary type")}}function sha(o){return async i=>new Uint8Array(await crypto.subtle.digest(o,i))}const sha256=from$1({name:"sha2-256",code:18,encode:sha("SHA-256")});function format$1(o,i){const{bytes:s,version:a}=o;switch(a){case 0:return toStringV0$1(s,baseCache$1(o),i??base58btc$1.encoder);default:return toStringV1$1(s,baseCache$1(o),i??base32$1.encoder)}}const cache$2=new WeakMap;function baseCache$1(o){const i=cache$2.get(o);if(i==null){const s=new Map;return cache$2.set(o,s),s}return i}var Yt;let CID$1=class we{constructor(i,s,a,c){U(this,"code");U(this,"version");U(this,"multihash");U(this,"bytes");U(this,"/");U(this,Yt,"CID");this.code=s,this.version=i,this.multihash=a,this.bytes=c,this["/"]=c}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:i,multihash:s}=this;if(i!==DAG_PB_CODE$2)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(s.code!==SHA_256_CODE$1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return we.createV0(s)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:i,digest:s}=this.multihash,a=create$5(i,s);return we.createV1(this.code,a)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(i){return we.equals(this,i)}static equals(i,s){const a=s;return a!=null&&i.code===a.code&&i.version===a.version&&equals$3(i.multihash,a.multihash)}toString(i){return format$1(this,i)}toJSON(){return{"/":format$1(this)}}link(){return this}[(Yt=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(i){if(i==null)return null;const s=i;if(s instanceof we)return s;if(s["/"]!=null&&s["/"]===s.bytes||s.asCID===s){const{version:a,code:c,multihash:d,bytes:f}=s;return new we(a,c,d,f??encodeCID$1(a,c,d.bytes))}else if(s[cidSymbol$1]===!0){const{version:a,multihash:c,code:d}=s,f=decode$5(c);return we.create(a,d,f)}else return null}static create(i,s,a){if(typeof s!="number")throw new Error("String codecs are no longer supported");if(!(a.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(i){case 0:{if(s!==DAG_PB_CODE$2)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$2}) block encoding`);return new we(i,s,a,a.bytes)}case 1:{const c=encodeCID$1(i,s,a.bytes);return new we(i,s,a,c)}default:throw new Error("Invalid version")}}static createV0(i){return we.create(0,DAG_PB_CODE$2,i)}static createV1(i,s){return we.create(1,i,s)}static decode(i){const[s,a]=we.decodeFirst(i);if(a.length!==0)throw new Error("Incorrect length");return s}static decodeFirst(i){const s=we.inspectBytes(i),a=s.size-s.multihashSize,c=coerce$1(i.subarray(a,a+s.multihashSize));if(c.byteLength!==s.multihashSize)throw new Error("Incorrect length");const d=c.subarray(s.multihashSize-s.digestSize),f=new Digest$1(s.multihashCode,s.digestSize,d,c);return[s.version===0?we.createV0(f):we.createV1(s.codec,f),i.subarray(s.size)]}static inspectBytes(i){let s=0;const a=()=>{const[x,T]=decode$6(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$2;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes$1(i,s),d=we.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$1(d).set(a,i),d}};function parseCIDtoBytes$1(o,i){switch(o[0]){case"Q":{const s=i??base58btc$1;return[base58btc$1.prefix,s.decode(`${base58btc$1.prefix}${o}`)]}case base58btc$1.prefix:{const s=i??base58btc$1;return[base58btc$1.prefix,s.decode(o)]}case base32$1.prefix:{const s=i??base32$1;return[base32$1.prefix,s.decode(o)]}case base36$1.prefix:{const s=i??base36$1;return[base36$1.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}}function toStringV0$1(o,i,s){const{prefix:a}=s;if(a!==base58btc$1.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c}function toStringV1$1(o,i,s){const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c}const DAG_PB_CODE$2=112,SHA_256_CODE$1=18;function encodeCID$1(o,i,s){const a=encodingLength$1(o),c=a+encodingLength$1(i),d=new Uint8Array(c+s.byteLength);return encodeTo$1(o,d,0),encodeTo$1(i,d,a),d.set(s,c),d}const cidSymbol$1=Symbol.for("@ipld/js-cid/CID");function create$4(o,i){return CID$1.create(1,o,i)}const cache$1=new WeakMap,toBase58String=o=>{let i=cache$1.get(o.bytes);return i||(i=base58btc$1.encode(o.bytes),cache$1.set(o.bytes,i)),i};var ve;class DigestMap{constructor(i){Y(this,ve);Q(this,ve,new Map);for(const[s,a]of i??[])this.set(s,a)}get[Symbol.toStringTag](){return"DigestMap"}clear(){F(this,ve).clear()}delete(i){const s=toBase58String(i);return F(this,ve).delete(s)}forEach(i,s){for(const[a,c]of F(this,ve).values())i.call(s,c,a,this)}get(i){const s=F(this,ve).get(toBase58String(i));if(s)return s[1]}has(i){return F(this,ve).has(toBase58String(i))}set(i,s){return F(this,ve).set(toBase58String(i),[i,s]),this}get size(){return F(this,ve).size}[Symbol.iterator](){return this.entries()}*entries(){yield*F(this,ve).values()}*keys(){for(const[i]of F(this,ve).values())yield i}*values(){for(const[,i]of F(this,ve).values())yield i}}ve=new WeakMap;const version="index/sharded/dag@0.1";variant({[version]:struct({content:match$2(),shards:array(match$2())})});var $t,Ke;class ShardedDAGIndex{constructor(i){Y(this,$t);Y(this,Ke);Q(this,$t,i),Q(this,Ke,new DigestMap)}get content(){return F(this,$t)}get shards(){return F(this,Ke)}setSlice(i,s,a){let c=F(this,Ke).get(i);c||(c=new DigestMap,F(this,Ke).set(i,c)),c.set(s,a)}archive(){return archive$1(this)}}$t=new WeakMap,Ke=new WeakMap;const create$3=o=>new ShardedDAGIndex(o),archive$1=async o=>{const i=new Map,s=[...o.shards.entries()].sort((g,y)=>compare(g[0].digest,y[0].digest)),a={content:o.content,shards:[]};for(const g of s){const y=[...g[1].entries()].sort((T,A)=>compare(T[0].digest,A[0].digest)).map(T=>[T[0].bytes,T[1]]),b=encode$O([g[0].bytes,y]),$=await sha256.digest(b),x=create$4(code$h,$);i.set(x.toString(),{cid:x,bytes:b}),a.shards.push(x)}const c=encode$O({[version]:a}),d=await sha256.digest(c),f=create$4(code$h,d);return ok(encode$v({roots:[{cid:f,bytes:c}],blocks:i}))};function alloc(o=0){return new Uint8Array(o)}function allocUnsafe(o=0){return new Uint8Array(o)}function asUint8Array(o){return o}function concat(o,i){i==null&&(i=o.reduce((c,d)=>c+d.length,0));const s=allocUnsafe(i);let a=0;for(const c of o)s.set(c,a),a+=c.length;return s}function equals$2(o,i){if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s0&&this.appendAll(i)}*[(Jt=symbol,Symbol.iterator)](){yield*this.bufs}get byteLength(){return this.length}append(...i){this.appendAll(i)}appendAll(i){let s=0;for(const a of i)if(a instanceof Uint8Array)s+=a.byteLength,this.bufs.push(a);else if(isUint8ArrayList(a))s+=a.byteLength,this.bufs.push(...a.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=s}prepend(...i){this.prependAll(i)}prependAll(i){let s=0;for(const a of i.reverse())if(a instanceof Uint8Array)s+=a.byteLength,this.bufs.unshift(a);else if(isUint8ArrayList(a))s+=a.byteLength,this.bufs.unshift(...a.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=s}get(i){const s=findBufAndOffset(this.bufs,i);return s.buf[s.index]}set(i,s){const a=findBufAndOffset(this.bufs,i);a.buf[a.index]=s}write(i,s=0){if(i instanceof Uint8Array)for(let a=0;a0;)if(i>=this.bufs[0].byteLength)i-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(i),this.length-=i;break}}}slice(i,s){const{bufs:a,length:c}=this._subList(i,s);return concat(a,c)}subarray(i,s){const{bufs:a,length:c}=this._subList(i,s);return a.length===1?a[0]:concat(a,c)}sublist(i,s){const{bufs:a,length:c}=this._subList(i,s),d=new Uint8ArrayList;return d.length=c,d.bufs=[...a],d}_subList(i,s){if(i=i??0,s=s??this.length,i<0&&(i=this.length+i),s<0&&(s=this.length+s),i<0||s>this.length)throw new RangeError("index is out of bounds");if(i===s)return{bufs:[],length:0};if(i===0&&s===this.length)return{bufs:this.bufs,length:this.length};const a=[];let c=0;for(let d=0;d=y)continue;const b=i>=g&&ig&&s<=y;if(b&&$){if(i===g&&s===y){a.push(f);break}const x=i-g;a.push(f.subarray(x,x+(s-i)));break}if(b){if(i===0){a.push(f);continue}a.push(f.subarray(i-g));continue}if($){if(s===y){a.push(f);break}a.push(f.subarray(0,s-g));break}a.push(f)}return{bufs:a,length:s-i}}indexOf(i,s=0){if(!isUint8ArrayList(i)&&!(i instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const a=i instanceof Uint8Array?i:i.subarray();if(s=Number(s??0),isNaN(s)&&(s=0),s<0&&(s=this.length+s),s<0&&(s=0),i.length===0)return s>this.length?this.length:s;const c=a.byteLength;if(c===0)throw new TypeError("search must be at least 1 byte long");const d=256,f=new Int32Array(d);for(let x=0;x=0;T--){const A=this.get(x+T);if(a[T]!==A){$=Math.max(1,T-g[A]);break}}if($===0)return x}return-1}getInt8(i){const s=this.subarray(i,i+1);return new DataView(s.buffer,s.byteOffset,s.byteLength).getInt8(0)}setInt8(i,s){const a=allocUnsafe(1);new DataView(a.buffer,a.byteOffset,a.byteLength).setInt8(0,s),this.write(a,i)}getInt16(i,s){const a=this.subarray(i,i+2);return new DataView(a.buffer,a.byteOffset,a.byteLength).getInt16(0,s)}setInt16(i,s,a){const c=alloc(2);new DataView(c.buffer,c.byteOffset,c.byteLength).setInt16(0,s,a),this.write(c,i)}getInt32(i,s){const a=this.subarray(i,i+4);return new DataView(a.buffer,a.byteOffset,a.byteLength).getInt32(0,s)}setInt32(i,s,a){const c=alloc(4);new DataView(c.buffer,c.byteOffset,c.byteLength).setInt32(0,s,a),this.write(c,i)}getBigInt64(i,s){const a=this.subarray(i,i+8);return new DataView(a.buffer,a.byteOffset,a.byteLength).getBigInt64(0,s)}setBigInt64(i,s,a){const c=alloc(8);new DataView(c.buffer,c.byteOffset,c.byteLength).setBigInt64(0,s,a),this.write(c,i)}getUint8(i){const s=this.subarray(i,i+1);return new DataView(s.buffer,s.byteOffset,s.byteLength).getUint8(0)}setUint8(i,s){const a=allocUnsafe(1);new DataView(a.buffer,a.byteOffset,a.byteLength).setUint8(0,s),this.write(a,i)}getUint16(i,s){const a=this.subarray(i,i+2);return new DataView(a.buffer,a.byteOffset,a.byteLength).getUint16(0,s)}setUint16(i,s,a){const c=alloc(2);new DataView(c.buffer,c.byteOffset,c.byteLength).setUint16(0,s,a),this.write(c,i)}getUint32(i,s){const a=this.subarray(i,i+4);return new DataView(a.buffer,a.byteOffset,a.byteLength).getUint32(0,s)}setUint32(i,s,a){const c=alloc(4);new DataView(c.buffer,c.byteOffset,c.byteLength).setUint32(0,s,a),this.write(c,i)}getBigUint64(i,s){const a=this.subarray(i,i+8);return new DataView(a.buffer,a.byteOffset,a.byteLength).getBigUint64(0,s)}setBigUint64(i,s,a){const c=alloc(8);new DataView(c.buffer,c.byteOffset,c.byteLength).setBigUint64(0,s,a),this.write(c,i)}getFloat32(i,s){const a=this.subarray(i,i+4);return new DataView(a.buffer,a.byteOffset,a.byteLength).getFloat32(0,s)}setFloat32(i,s,a){const c=alloc(4);new DataView(c.buffer,c.byteOffset,c.byteLength).setFloat32(0,s,a),this.write(c,i)}getFloat64(i,s){const a=this.subarray(i,i+8);return new DataView(a.buffer,a.byteOffset,a.byteLength).getFloat64(0,s)}setFloat64(i,s,a){const c=alloc(8);new DataView(c.buffer,c.byteOffset,c.byteLength).setFloat64(0,s,a),this.write(c,i)}equals(i){if(i==null||!(i instanceof Uint8ArrayList)||i.bufs.length!==this.bufs.length)return!1;for(let s=0;sc+d.byteLength,0)),a.length=s,a}}function equals$1(o,i){if(o===i)return!0;if(o.byteLength!==i.byteLength)return!1;for(let s=0;s=INT$1;)i[s++]=o&255|MSB$1,o/=128;for(;o&MSBALL$1;)i[s++]=o&255|MSB$1,o>>>=7;return i[s]=o|0,encode$2.bytes=s-a+1,i}var decode$4=read,MSB$1$1=128,REST$1$1=127;function read(o,a){var s=0,a=a||0,c=0,d=a,f,g=o.length;do{if(d>=g)throw read.bytes=0,new RangeError("Could not decode varint");f=o[d++],s+=c<28?(f&REST$1$1)<=MSB$1$1);return read.bytes=d-a,s}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function(o){return o=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),a=0;a>>0,I=new Uint8Array(D);C!==B;){for(var L=E[C],N=0,O=D-1;(L!==0||N<_)&&O!==-1;O--,N++)L+=256*I[O]>>>0,I[O]=L%g>>>0,L=L/g>>>0;if(L!==0)throw new Error("Non-zero carry");_=N,C++}for(var R=D-_;R!==D&&I[R]===0;)R++;for(var z=y.repeat(S);R>>0,D=new Uint8Array(B);E[S];){var I=s[E.charCodeAt(S)];if(I===255)return;for(var L=0,N=B-1;(I!==0||L>>0,D[N]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");C=L,S++}if(E[S]!==" "){for(var O=B-C;O!==B&&D[O]===0;)O++;for(var R=new Uint8Array(_+(B-O)),z=_;O!==B;)R[z++]=D[O++];return R}}}function A(E){var S=T(E);if(S)return S;throw new Error(`Non-${i} character`)}return{encode:x,decodeUnsafe:T,decode:A}}var src=base,_brrp__multiformats_scope_baseX=src;class Encoder{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseEncode");this.name=i,this.prefix=s,this.baseEncode=a}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(i,s,a){U(this,"name");U(this,"prefix");U(this,"baseDecode");U(this,"prefixCodePoint");this.name=i,this.prefix=s;const c=s.codePointAt(0);if(c===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=c,this.baseDecode=a}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return or(this,i)}}class ComposedDecoder{constructor(i){U(this,"decoders");this.decoders=i}or(i){return or(this,i)}decode(i){const s=i[0],a=this.decoders[s];if(a!=null)return a.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}function or(o,i){return new ComposedDecoder({...o.decoders??{[o.prefix]:o},...i.decoders??{[i.prefix]:i}})}class Codec{constructor(i,s,a,c){U(this,"name");U(this,"prefix");U(this,"baseEncode");U(this,"baseDecode");U(this,"encoder");U(this,"decoder");this.name=i,this.prefix=s,this.baseEncode=a,this.baseDecode=c,this.encoder=new Encoder(i,s,a),this.decoder=new Decoder(i,s,c)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}}function from({name:o,prefix:i,encode:s,decode:a}){return new Codec(o,i,s,a)}function baseX({name:o,prefix:i,alphabet:s}){const{encode:a,decode:c}=_brrp__multiformats_scope_baseX(s,o);return from({prefix:i,name:o,encode:a,decode:d=>coerce(c(d))})}function decode$1(o,i,s,a){const c={};for(let $=0;$=8&&(g-=8,f[b++]=255&y>>g)}if(g>=s||255&y<<8-g)throw new SyntaxError("Unexpected end of data");return f}function encode$1(o,i,s){const a=i[i.length-1]==="=",c=(1<s;)f-=s,d+=i[c&g>>f];if(f!==0&&(d+=i[c&g<{const[x,T]=decode$3(i.subarray(s));return s+=T,x};let c=a(),d=DAG_PB_CODE$1;if(c===18?(c=0,s=0):d=a(),c!==0&&c!==1)throw new RangeError(`Invalid CID version ${c}`);const f=s,g=a(),y=a(),b=s+y,$=b-f;return{version:c,codec:d,multihashCode:g,digestSize:y,multihashSize:$,size:b}}static parse(i,s){const[a,c]=parseCIDtoBytes(i,s),d=CID.decode(c);if(d.version===0&&i[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(d).set(a,i),d}}function parseCIDtoBytes(o,i){switch(o[0]){case"Q":{const s=i??base58btc;return[base58btc.prefix,s.decode(`${base58btc.prefix}${o}`)]}case base58btc.prefix:{const s=i??base58btc;return[base58btc.prefix,s.decode(o)]}case base32.prefix:{const s=i??base32;return[base32.prefix,s.decode(o)]}case base36.prefix:{const s=i??base36;return[base36.prefix,s.decode(o)]}default:{if(i==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],i.decode(o)]}}}function toStringV0(o,i,s){const{prefix:a}=s;if(a!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${s.name} encoding`);const c=i.get(a);if(c==null){const d=s.encode(o).slice(1);return i.set(a,d),d}else return c}function toStringV1(o,i,s){const{prefix:a}=s,c=i.get(a);if(c==null){const d=s.encode(o);return i.set(a,d),d}else return c}const DAG_PB_CODE$1=112,SHA_256_CODE=18;function encodeCID(o,i,s){const a=encodingLength(o),c=a+encodingLength(i),d=new Uint8Array(c+s.byteLength);return encodeTo(o,d,0),encodeTo(i,d,a),d.set(s,c),d}const cidSymbol=Symbol.for("@ipld/js-cid/CID"),DAG_PB_CODE=112;function createLegacy(o){return CID.create(0,DAG_PB_CODE,o)}function create$1(o,i){return CID.create(1,o,i)}const MSB=128,REST=127,MSBALL=~REST,INT=Math.pow(2,31),encode=o=>{const i=[];let s=0;for(;o>=INT;)i[s++]=o&255|MSB,o/=128;for(;o&MSBALL;)i[s++]=o&255|MSB,o>>>=7;return i[s]=o|0,i},decode=(o,i)=>{let s=0;i=i||0;let a=0,c=i,d;const f=o.length;do{if(c>=f||a>49)throw new RangeError("Could not decode varint");d=o.get(c++),s+=a<28?(d&REST)<=MSB);return[s,c-i]},State={ReadHeaderLength:0,ReadHeader:1,ReadBlockLength:2,ReadBlock:3},CIDV0_BYTES={SHA2_256:18,LENGTH:32,DAG_PB:112};var xt;class CARReaderStream extends TransformStream{constructor(s,a){const c=new Uint8ArrayList;let d=0,f=d,g=8,y=State.ReadHeaderLength,b;const $=new Promise(x=>{b=x});super({transform(x,T){for(c.append(x);!(c.length{const[,i]=decode(o),[s,a]=decode(o,i);return i+a+s},encodeHeader=o=>{const i=encode$O({version:1,roots:o}),s=encode(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a},encodeBlock=o=>{const i=encode(o.cid.bytes.length+o.bytes.length),s=new Uint8Array(i.length+o.cid.bytes.length+o.bytes.length);return s.set(i),s.set(o.cid.bytes,i.length),s.set(o.bytes,i.length+o.cid.bytes.length),s};class CARWriterStream extends TransformStream{constructor(i=[],s,a){super({start:c=>c.enqueue(encodeHeader(i)),transform:(c,d)=>d.enqueue(encodeBlock(c))},s,a)}}async function indexShardedDAG(o,i,s){const a=create$3(o);for(const[c,d]of i.entries()){const f=s[c];a.shards.set(d.multihash,f)}return await a.archive()}const SHARD_SIZE=133169152;class ShardingStream extends TransformStream{constructor(i={}){const s=i.shardSize??SHARD_SIZE,a=s-headerEncodingLength();let c=[],d=null,f=new DigestMap,g=null,y=0;super({async transform(b,$){d!=null&&g!=null&&($.enqueue(await encodeCAR(d,g)),d=null,g=null);const x=blockHeaderEncodingLength(b),T=x+b.bytes.length;if(T>a)throw new Error(`block will cause CAR to exceed shard size: ${b.cid}`);c.length&&y+T>a&&(d=c,g=f,c=[],f=new DigestMap,y=0),c.push(b),f.set(b.cid.multihash,[headerEncodingLength()+y+x,b.bytes.length]),y+=T},async flush(b){d!=null&&g!=null&&b.enqueue(await encodeCAR(d,g));const $=c.at(-1);if($==null)return;const x=i.rootCID??$.cid,T=headerEncodingLength(x);if(T+y>s){const A=T+y-s,E=[];let S=0;for(;Sa.name)=>ascending(o,i,s);function ascending(o,i,s){const a=s(o),c=s(i);return a===c?0:aObject.assign(await encode$6(o,s),{slices:i});async function uploadFile(o,i,s={}){return await uploadBlockStream(o,createFileEncoderStream(i,s),s)}async function uploadDirectory(o,i,s={}){const{customOrder:a=!1}=s,c=a?i:[...i].sort(defaultFileComparator);return await uploadBlockStream(o,createDirectoryEncoderStream(c,s),s)}async function uploadCAR(o,i,s={}){const a=new BlockStream(i);return s.rootCID=s.rootCID??(await a.getRoots())[0],await uploadBlockStream(o,a,s)}async function uploadBlockStream(o,i,{pieceHasher:s=PieceHasher,...a}={}){const c=typeof o=="function"?o:()=>o,d=[],f=[];let g=null;if(await i.pipeThrough(new ShardingStream(a)).pipeThrough(new TransformStream({async transform(E,S){const _=new Uint8Array(await E.arrayBuffer()),C=await sha256$2.digest(_),B=await c([{can:ability$2,nb:input$8(C,_.length)}]);await add$2(B,C,_,a);const D=create$g(code,C);let I;if(s){const z=await s.digest(_);I=create$g(code$3,z);const K=create$g(code$3,C),G=await filecoinOffer({issuer:B.issuer,audience:B.audience,with:B.issuer.did(),proofs:B.proofs},K,I,a);if(G.out.error)throw new Error("failed to offer piece for aggregation into filecoin deal",{cause:G.out.error})}const{version:L,roots:N,size:O,slices:R}=E;S.enqueue({version:L,roots:N,size:O,cid:D,piece:I,slices:R})}})).pipeTo(new WritableStream({write(E){g=g||E.roots[0],f.push(E.cid),E.slices.set(E.cid.multihash,[0,E.size]),d.push(E.slices),a.onShardStored&&a.onShardStored(E)}})),!g)throw new Error("missing root CID");const y=await indexShardedDAG(g,f,d);if(!y.ok)throw new Error("failed to archive DAG index",{cause:y.error});const b=await sha256$2.digest(y.ok),$=create$g(code,b),[x,T,A]=await Promise.all([c([{can:ability$2,nb:input$8(b,y.ok.length)}]),c([{can:ability$1,nb:input$4($)}]),c([{can:ability,nb:input$3(g,f)}])]);return await add$2(x,b,y.ok,a),await add$1(T,$,a),await add(A,g,f,a),g}const accessServiceURL=new URL("https://up.web3.storage"),accessServicePrincipal=parse$2("did:web:web3.storage"),accessServiceConnection=connect({id:accessServicePrincipal,codec:outbound,channel:open$2({url:accessServiceURL,method:"POST"})}),uploadServiceURL=new URL("https://up.web3.storage"),uploadServicePrincipal=parse$2("did:web:web3.storage"),uploadServiceConnection=connect({id:uploadServicePrincipal,codec:outbound,channel:open$2({url:uploadServiceURL,method:"POST"})}),filecoinServiceURL=new URL("https://up.web3.storage"),filecoinServicePrincipal=parse$2("did:web:web3.storage"),filecoinServiceConnection=connect({id:filecoinServicePrincipal,codec:outbound,channel:open$2({url:filecoinServiceURL,method:"POST"})}),serviceConf={access:accessServiceConnection,upload:uploadServiceConnection,filecoin:filecoinServiceConnection};class Base{constructor(i,s={}){U(this,"_agent");U(this,"_serviceConf");this._serviceConf=s.serviceConf??serviceConf,this._agent=new Agent(i,{servicePrincipal:this._serviceConf.access.id,url:this._serviceConf.access.channel.url,connection:this._serviceConf.access}),this._receiptsEndpoint=s.receiptsEndpoint??receiptsEndpoint}get agent(){return this._agent}async _invocationConfig(i){const s=this._agent.currentSpace();if(!s)throw new Error("missing current space: use createSpace() or setCurrentSpace()");const a=this._agent.issuer,c=await this._agent.proofs(i.map(f=>({can:f,with:s}))),d=this._serviceConf.upload.id;return{issuer:a,with:s,proofs:c,audience:d}}}const unwrap=({ok:o,error:i})=>{if(i)throw i;return o};class AccessClient extends Base{async authorize(i,s){const a=fromEmail(i),c=unwrap(await request(this,{account:a})),d=unwrap(await c.claim(s));return await unwrap(await d.save()),d.proofs}async claim(i){const s=unwrap(await claim(this,i));return await unwrap(await s.save()),s.proofs}async request(i){return await request(this,i)}async delegate(i){return await delegate(this,i)}}const claim=async({agent:o},i)=>claim$1(o,i),request=async({agent:o},i)=>request$2(o,i),delegate=async({agent:o},i)=>delegate$1(o,i),{spaceAccess,accountAccess}=access;class PlanClient extends Base{async get(i,s){const a=await get({agent:this.agent},{...s,account:i});if(!a.ok)throw new Error(`failed ${get$c.can} invocation`,{cause:a.error});return a.ok}async set(i,s,a){const c=await set({agent:this.agent},{...a,account:i,product:s});if(!c.ok)throw new Error(`failed ${set$5.can} invocation`,{cause:c.error});return c.ok}async createAdminSession(i,s,a){const c=await createAdminSession({agent:this.agent},{...a,account:i,returnURL:s});if(!c.ok)throw new Error(`failed ${createAdminSession$1.can} invocation`,{cause:c.error});return c.ok}}const get=async({agent:o},{account:i,nonce:s,proofs:a=[]})=>(await o.invokeAndExecute(get$c,{with:i,proofs:a,nonce:s})).out,set=async({agent:o},{account:i,product:s,nonce:a,proofs:c=[]})=>(await o.invokeAndExecute(set$5,{with:i,nb:{product:s},nonce:a,proofs:c})).out,createAdminSession=async({agent:o},{account:i,returnURL:s,nonce:a,proofs:c=[]})=>(await o.invokeAndExecute(createAdminSession$1,{with:i,proofs:c,nonce:a,nb:{returnURL:s}})).out;class SubscriptionClient extends Base{async list(i,s){const a=await list$1({agent:this.agent},{...s,account:i});if(!a.ok)throw new Error(`failed ${list$6.can} invocation`,{cause:a.error});return a.ok}}const list$1=async({agent:o},{account:i,nonce:s,proofs:a=[]})=>(await o.invokeAndExecute(list$6,{with:i,proofs:a,nb:{},nonce:s})).out,list=({agent:o},{account:i}={})=>{const s={with:i??/did:mailto:.*/,can:"*"},a=o.proofs([s]),c={},d={};for(const f of a){const g=allows(f);for(const[y,b]of Object.entries(g)){if(AccountDID.is(y)&&b["*"]){const $=y;(c[$]||(c[$]=new Account({id:$,agent:o,proofs:[]}))).addProof(f)}for(const $ of b["ucan/attest"]||[]){const x=$.proof;x&&(d[`${x}`]=f)}}}for(const f of Object.values(c))for(const g of f.proofs){const y=d[`${g.cid}`];y&&f.addProof(y)}return c},login=async({agent:o},i,s={})=>{const a=fromEmail(i),c=list({agent:o},{account:a})[a];if(c)return{ok:c};const d=await request({agent:o},{account:a,access:accountAccess}),{ok:f,error:g}=d;if(g)return{error:g};{const{ok:y,error:b}=await f.claim({signal:s.signal});return b?{error:b}:{ok:new Account({id:a,proofs:y.proofs,agent:o})}}};class Account{constructor(i){this.model=i,this.plan=new AccountPlan(i)}get agent(){return this.model.agent}get proofs(){return this.model.proofs}did(){return this.model.id}toEmail(){return toEmail(this.did())}addProof(i){this.proofs.push(i)}toJSON(){return{id:this.did(),proofs:this.proofs.sort((i,s)=>i.cid.toString().localeCompare(s.cid.toString())).map(i=>i.toJSON())}}provision(i,s={}){return add$7(this.agent,{...s,account:this.did(),consumer:i,proofs:this.proofs})}async save({agent:i=this.agent}={}){return await importAuthorization(i,this)}}class AccountPlan{constructor(i){this.model=i}async get(i){return await get(this.model,{...i,account:this.model.id,proofs:this.model.proofs})}async set(i,s){return await set(this.model,{...s,account:this.model.id,product:i,proofs:this.model.proofs})}async wait(i){var d;const s=Date.now(),a=(i==null?void 0:i.interval)||1e3,c=(i==null?void 0:i.timeout)||60*15*1e3;for(;;){const f=await this.get();if(f.ok)return f.ok;if(f.error)throw new Error(`Error retrieving payment plan: ${f.error}`);if(Date.now()-s>c)throw new Error("Timeout: Payment plan selection took too long.");if((d=i==null?void 0:i.signal)!=null&&d.aborted)throw new Error("Aborted: Payment plan selection was aborted.");console.log("Waiting for payment plan to be selected..."),await new Promise(g=>setTimeout(g,a))}}async createAdminSession(i,s,a){return await createAdminSession(this.model,{...a,account:i,returnURL:s})}async subscriptions(i){return await list$1(this.model,{...i,account:this.model.id,proofs:this.model.proofs})}}class UsageClient extends Base{async report(i,s,a){const c=await report({agent:this.agent},{...a,space:i,period:s});if(!c.ok)throw new Error(`failed ${report$1.can} invocation`,{cause:c.error});return c.ok}}const report=async({agent:o},{space:i,period:s,nonce:a,proofs:c=[]})=>(await o.invokeAndExecute(report$1,{with:i,proofs:c,nonce:a,nb:{period:{from:Math.floor(s.from.getTime()/1e3),to:Math.ceil(s.to.getTime()/1e3)}}})).out;var Qe;class Space{constructor(i){Y(this,Qe);Q(this,Qe,i),this.usage=new StorageUsage(i)}get name(){var i;return String(((i=F(this,Qe).meta)==null?void 0:i.name)??"")}did(){return F(this,Qe).id}meta(){return F(this,Qe).meta}}Qe=new WeakMap;var st;class StorageUsage{constructor(i){Y(this,st);Q(this,st,i)}async get(){const{agent:i}=F(this,st),s=F(this,st).id,a=new Date,c={from:startOfLastMonth(a),to:a},d=await report({agent:i},{space:s,period:c});if(d.error)return d;const f=i.connection.id.did(),g=d.ok[f];return{ok:(g==null?void 0:g.size.final)==null?void 0:BigInt(g.size.final)}}}st=new WeakMap;const startOfMonth=o=>{const i=new Date(o);return i.setUTCDate(1),i.setUTCHours(0),i.setUTCMinutes(0),i.setUTCSeconds(0),i.setUTCMilliseconds(0),i},startOfLastMonth=o=>{const i=startOfMonth(o);return i.setUTCMonth(i.getUTCMonth()-1),i};class BlobClient extends Base{async add(i,s={}){const a=await this._invocationConfig([add$4.can]);s.connection=this._serviceConf.upload;const c=new Uint8Array(await i.arrayBuffer()),d=await sha256$6.digest(c);return{digest:d,...await add$2(a,d,c,s)}}async list(i={}){const s=await this._invocationConfig([list$5.can]);return i.connection=this._serviceConf.upload,list$3(s,i)}async remove(i,s={}){const a=await this._invocationConfig([remove$5.can]);return s.connection=this._serviceConf.upload,remove$3(a,i,s)}async get(i,s={}){const a=await this._invocationConfig([get$b.can]);return s.connection=this._serviceConf.upload,get$8(a,i,s)}}class IndexClient extends Base{async add(i,s={}){const a=await this._invocationConfig([add$5.can]);return s.connection=this._serviceConf.upload,add$1(a,i,s)}}class StoreClient extends Base{async add(i,s={}){const a=await this._invocationConfig([add$a.can]);return s.connection=this._serviceConf.upload,add$3(a,i,s)}async get(i,s={}){const a=await this._invocationConfig([get$h.can]);return s.connection=this._serviceConf.upload,get$a(a,i,s)}async list(i={}){const s=await this._invocationConfig([list$9.can]);return i.connection=this._serviceConf.upload,list$4(s,i)}async remove(i,s={}){const a=await this._invocationConfig([remove$8.can]);return s.connection=this._serviceConf.upload,remove$4(a,i,s)}}class UploadClient extends Base{async add(i,s,a={}){const c=await this._invocationConfig([add$9.can]);return a.connection=this._serviceConf.upload,add(c,i,s,a)}async get(i,s={}){const a=await this._invocationConfig([get$g.can]);return s.connection=this._serviceConf.upload,get$7(a,i,s)}async list(i={}){const s=await this._invocationConfig([list$8.can]);return i.connection=this._serviceConf.upload,list$2(s,i)}async remove(i,s={}){const a=await this._invocationConfig([remove$7.can]);return s.connection=this._serviceConf.upload,remove$2(a,i,s)}}class SpaceClient extends Base{async info(i,s){return await this._agent.getSpaceInfo(i,s)}}class FilecoinClient extends Base{async offer(i,s,a){const c=await this._invocationConfig([filecoinOffer$1.can]);return filecoinOffer(c,i,s,{...a,connection:this._serviceConf.filecoin})}async info(i,s){const a=await this._invocationConfig([filecoinInfo$1.can]);return filecoinInfo(a,i,{...s,connection:this._serviceConf.filecoin})}}class CouponAPI extends Base{async redeem(i,s={}){const{agent:a}=this,c=unwrap(await extract(i));return unwrap(await redeem(c,{...s,agent:a}))}async issue({proofs:i=[],...s}){const{agent:a}=this;return await issue({...s,issuer:a.issuer,proofs:[...i,...a.proofs(s.capabilities)]})}}const extract=async o=>{const{ok:i,error:s}=await extract$1(o);return i?ok(new Coupon({proofs:[i]})):error$1(s)},archive=async o=>{const[i]=o.proofs;return await archive$2(i)},issue=async({password:o="",...i})=>{const s=await deriveSigner(o),a=await delegate$3({...i,audience:s});return new Coupon({proofs:[a]})},redeem=async(o,{agent:i,password:s=""})=>{const a=await deriveSigner(s),[c]=o.proofs;if(c.audience.did()!==a.did())return error$1(new RangeError(s===""?"Extracting account requires a password":"Provided password is invalid"));{const d=await delegate$3({issuer:a,audience:i,capabilities:c.capabilities,expiration:c.expiration,notBefore:c.notBefore,proofs:[c]});return ok(new GrantedAccess({agent:i,proofs:[d]}))}},deriveSigner=async o=>{const{digest:i}=await sha256$4.digest(new TextEncoder().encode(o));return await derive(i)};class Coupon{constructor(i){this.model=i}get proofs(){return this.model.proofs}redeem(i,s={}){return redeem(this,{...s,agent:i})}archive(){return archive(this)}}class Client extends Base{constructor(i,s){super(i,s),this.capability={access:new AccessClient(i,s),filecoin:new FilecoinClient(i,s),index:new IndexClient(i,s),plan:new PlanClient(i,s),space:new SpaceClient(i,s),blob:new BlobClient(i,s),store:new StoreClient(i,s),subscription:new SubscriptionClient(i,s),upload:new UploadClient(i,s),usage:new UsageClient(i,s)},this.coupon=new CouponAPI(i,s)}did(){return this._agent.did()}async authorize(i,s){await this.capability.access.authorize(i,s)}async login(i,s={}){const a=unwrap(await login(this,i,s));return unwrap(await a.save()),a}accounts(){return list(this)}async uploadFile(i,s={}){const a=await this._invocationConfig([add$4.can,add$5.can,filecoinOffer$1.can,add$9.can]);return s.connection=this._serviceConf.upload,uploadFile(a,i,s)}async uploadDirectory(i,s={}){const a=await this._invocationConfig([add$4.can,add$5.can,filecoinOffer$1.can,add$9.can]);return s.connection=this._serviceConf.upload,uploadDirectory(a,i,s)}async uploadCAR(i,s={}){const a=await this._invocationConfig([add$4.can,add$5.can,filecoinOffer$1.can,add$9.can]);return s.connection=this._serviceConf.upload,uploadCAR(a,i,s)}async getReceipt(i){const s=new URL(this._receiptsEndpoint).toString();return poll(i,{receiptsEndpoint:s})}defaultProvider(){return this._agent.connection.id.did()}currentSpace(){const i=this._agent,s=i.currentSpace();if(!s)return;const a=i.spaces.get(s);return new Space({id:s,meta:a,agent:i})}async setCurrentSpace(i){await this._agent.setCurrentSpace(i)}spaces(){return[...this._agent.spaces].map(([i,s])=>new Space({id:i,meta:s,agent:this._agent}))}async createSpace(i,s={}){const a=await this._agent.createSpace(i),c=s.account;if(c){const d=await c.provision(a.did());if(d.error)throw new Error(`failed to provision account: ${d.error.message}`,{cause:d.error});await a.save();const f=await a.createRecovery(c.did()),g=await this.capability.access.delegate({space:a.did(),delegations:[f]});if(g.error)throw new Error(`failed to authorize recovery account: ${g.error.message}`,{cause:g.error})}return a}async shareSpace(i,s,a={abilities:["space/*","store/*","upload/*","access/*","usage/*","filecoin/offer","filecoin/info","filecoin/accept","filecoin/submit"],expiration:1/0}){const{abilities:c,...d}=a,f=this.agent.currentSpace();try{await this.agent.setCurrentSpace(s);const{root:g,blocks:y}=await this.agent.delegate({...d,abilities:c,audience:{did:()=>fromEmail(email(i))},audienceMeta:a.audienceMeta??{}}),b=new AgentDelegation(g,y,{audience:i}),$=await this.capability.access.delegate({space:s,delegations:[b]});if($.error)throw new Error(`failed to share space with ${i}: ${$.error.message}`,{cause:$.error});return b}finally{f&&f!==s&&await this.agent.setCurrentSpace(f)}}async addSpace(i){return await this._agent.importSpaceFromDelegation(i)}proofs(i){return this._agent.proofs(i)}async addProof(i){await this._agent.addProof(i)}delegations(i){const s=[];for(const{delegation:a,meta:c}of this._agent.delegationsWithMeta(i))s.push(new AgentDelegation(a.root,a.blocks,c));return s}async createDelegation(i,s,a={}){const c=a.audienceMeta??{name:"agent",type:"device"},{root:d,blocks:f}=await this._agent.delegate({...a,abilities:s,audience:i,audienceMeta:c});return new AgentDelegation(d,f,{audience:c})}async revokeDelegation(i,s={}){return this._agent.revoke(i,{proofs:s.proofs})}async remove(i,s={}){var c;if(!s.shards){await this.capability.upload.remove(i);return}const a=await this.capability.upload.get(i);(c=a.shards)!=null&&c.length&&await Promise.allSettled(a.shards.map(async d=>{var f;try{const g=await this.capability.blob.remove(d.multihash);g.ok&&g.ok.size===0&&await this.capability.store.remove(d)}catch(g){if(((f=g==null?void 0:g.cause)==null?void 0:f.name)!=="StoreItemNotFound")throw new Error(`failed to remove shard: ${d}`,{cause:g})}})),await this.capability.upload.remove(i)}}new Set(abilitiesAsStrings);async function create(o={}){const i=o.store??new StoreIndexedDB("w3up-client"),s=await i.load();if(s){const d=AgentData.fromExport(s,{store:i});if(o.principal&&d.principal.did()!==o.principal.did())throw new Error(`store cannot be used with ${o.principal.did()}, stored principal and passed principal must match`);return new Client(d,o)}const a=o.principal??await generate(),c=await AgentData.create({principal:a},{store:i});return new Client(c,o)}const toHTTP=o=>o.replace(/^ipfs:\/\//,"https://w3s.link/ipfs/"),upload=async o=>{const i=await create();console.debug({"W3Up Client":i,accounts:i.accounts(),did:i.did()});const s=await fetch("https://ucan.dacade.my/ucan",{method:"POST",body:JSON.stringify({did:i.did()})}),{delegation:a}=await s.json(),{ok:c,error:d}=await extract$1(new Uint8Array(a));if(!c)throw new Error("Failed to extract delegation.",{cause:d});const f=await i.addSpace(c);return i.setCurrentSpace(f.did()),(await i.uploadDirectory(o)).toString()},abi=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"editor",type:"address"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{components:[{internalType:"bool",name:"paused",type:"bool"},{internalType:"bool",name:"optional",type:"bool"},{internalType:"bool",name:"skipReview",type:"bool"}],indexed:!1,internalType:"struct IQuestChain.QuestDetails[]",name:"questDetails",type:"tuple[]"}],name:"ConfiguredQuests",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"editor",type:"address"},{indexed:!1,internalType:"string",name:"details",type:"string"}],name:"QuestChainEdited",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"details",type:"string"},{indexed:!1,internalType:"string[]",name:"quests",type:"string[]"},{indexed:!1,internalType:"bool",name:"paused",type:"bool"}],name:"QuestChainInit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"tokenURI",type:"string"}],name:"QuestChainTokenURIUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"reviewer",type:"address"},{indexed:!1,internalType:"address[]",name:"questerList",type:"address[]"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{indexed:!1,internalType:"bool[]",name:"successList",type:"bool[]"},{indexed:!1,internalType:"string[]",name:"detailsList",type:"string[]"}],name:"QuestProofsReviewed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"quester",type:"address"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"proofList",type:"string[]"}],name:"QuestProofsSubmitted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"string[]",name:"detailsList",type:"string[]"}],name:"QuestsCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"editor",type:"address"},{indexed:!1,internalType:"uint256[]",name:"questIdList",type:"uint256[]"},{indexed:!1,internalType:"string[]",name:"detailsList",type:"string[]"}],name:"QuestsEdited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"limiterContract",type:"address"}],name:"SetLimiter",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"EDITOR_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"REVIEWER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"burnToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{components:[{internalType:"bool",name:"paused",type:"bool"},{internalType:"bool",name:"optional",type:"bool"},{internalType:"bool",name:"skipReview",type:"bool"}],internalType:"struct IQuestChain.QuestDetails[]",name:"_questDetails",type:"tuple[]"}],name:"configureQuests",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string[]",name:"_detailsList",type:"string[]"}],name:"createQuests",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_details",type:"string"}],name:"edit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{internalType:"string[]",name:"_detailsList",type:"string[]"}],name:"editQuests",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTokenURI",outputs:[{internalType:"string",name:"uri",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_role",type:"bytes32"},{internalType:"address",name:"_account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"address[]",name:"admins",type:"address[]"},{internalType:"address[]",name:"editors",type:"address[]"},{internalType:"address[]",name:"reviewers",type:"address[]"},{internalType:"string[]",name:"quests",type:"string[]"},{internalType:"bool",name:"paused",type:"bool"},{internalType:"string",name:"details",type:"string"},{internalType:"string",name:"tokenURI",type:"string"}],internalType:"struct QuestChainCommons.QuestChainInfo",name:"_info",type:"tuple"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"limiterContract",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"mintToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"premium",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"questChainFactory",outputs:[{internalType:"contract IQuestChainFactory",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"questChainId",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"questChainToken",outputs:[{internalType:"contract IQuestChainToken",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"questCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"questDetails",outputs:[{internalType:"bool",name:"paused",type:"bool"},{internalType:"bool",name:"optional",type:"bool"},{internalType:"bool",name:"skipReview",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_quester",type:"address"},{internalType:"uint256",name:"_questId",type:"uint256"}],name:"questStatus",outputs:[{internalType:"enum IQuestChain.Status",name:"status",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"_questerList",type:"address[]"},{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{internalType:"bool[]",name:"_successList",type:"bool[]"},{internalType:"string[]",name:"_detailsList",type:"string[]"}],name:"reviewProofs",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"_role",type:"bytes32"},{internalType:"address",name:"_account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_limiterContract",type:"address"}],name:"setLimiter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_tokenURI",type:"string"}],name:"setTokenURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"_questIdList",type:"uint256[]"},{internalType:"string[]",name:"_proofList",type:"string[]"}],name:"submitProofs",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"upgrade",outputs:[],stateMutability:"nonpayable",type:"function"}],CHAIN=10,Alert=({children:o})=>jsxRuntimeExports.jsxs("div",{role:"alert",className:"alert alert-warning flex items-center mt-10",children:[jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 shrink-0 stroke-current",fill:"none",viewBox:"0 0 24 24",children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),o]}),Submission=()=>{const o=useLoadedBook(),i=useChainId(),s=React__default.useRef(null),[a,c]=reactExports.useState(!1),[d,f]=reactExports.useState({}),g=({type:I,error:L})=>{f(N=>({...N,[I]:L}))},{data:y,writeContract:b,isPending:$}=useWriteContract(),x=useConfig(),T={chain:{type:"chain",error:jsxRuntimeExports.jsx("h3",{className:"flex text-center items-center justify-center",children:"Please switch to the Optimism network to continue."})},account:{type:"account",error:jsxRuntimeExports.jsxs("h3",{className:"flex text-center items-center justify-center",children:["Please",jsxRuntimeExports.jsx("div",{className:"mx-2",children:jsxRuntimeExports.jsx("w3m-button",{size:"sm"})}),"to submit a proof."]})}};reactExports.useEffect(()=>{if(x)return watchChainId(x,{onChange(I){I!==CHAIN&&!d.chain&&g(T.chain)}})},[x]);const{contract:A=null}=o&&"contract"in o?o:{};reactExports.useEffect(()=>{y&&_t.success(jsxRuntimeExports.jsxs("p",{children:["Successfully submitted transaction",jsxRuntimeExports.jsxs("a",{href:`https://optimistic.etherscan.io/tx/${y}`,className:"mx-1 whitespace-nowrap text-primary hover:text-secondary",target:"_blank",children:[y.substring(0,8),"…",y.slice(-6)]}),"to the Quest Chain contract at",jsxRuntimeExports.jsxs("a",{href:`https://optimistic.etherscan.io/address/${A}`,className:"ml-1 whitespace-nowrap text-primary hover:text-secondary",target:"_blank",children:[A==null?void 0:A.substring(0,6),"…",A==null?void 0:A.slice(-4)]}),"."]}),{duration:12e3,style:{width:"45ch"}})},[y]);const{isLoading:E,isSuccess:S}=useWaitForTransactionReceipt({hash:y});o.reader==null&&!d.account?g(T.account):o.reader!=null&&d.account&&g({type:"account",error:null}),i!==CHAIN&&!d.chain?g(T.chain):i===CHAIN&&d.chain&&g({type:"chain",error:null});const _=Object.values(d).filter(Boolean);if(_.length>0)return _.map((I,L)=>jsxRuntimeExports.jsx(Alert,{children:I},L));const C=React__default.lazy(()=>__vitePreload(()=>import("./MarkdownEditor-Bk-WrKMy.js").then(I=>I.M),__vite__mapDeps([0,1,2]))),B="Submit Proof",D=E?"Confirming…":$?"Transaction Pending…":a?"Saving to IPFS…":S?"¡Done: Submitted!":B;return jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("h3",{children:"Loading Submission Editor…"}),children:[jsxRuntimeExports.jsx(C,{editorRef:s,markdown:"",className:"dark-theme dark-editor content mt-10"}),jsxRuntimeExports.jsxs("button",{onClick:async()=>{var L;const I=(L=s.current)==null?void 0:L.getMarkdown();if(!I)throw new Error(`Invalid \`markdown\`: "${I}".`);c(!0);try{const N=new Blob([JSON.stringify({name,description:I})],{type:"application/json"}),O=await upload([new File([N],"submission.json")]);if(_t.success(jsxRuntimeExports.jsxs("p",{children:["Successfully uploaded your response submission to",jsxRuntimeExports.jsx("a",{href:"https://web3.storage",target:"_blank",className:"mx-1 whitespace-nowrap text-primary hover:text-secondary",children:"Web3.Storage"}),"at",jsxRuntimeExports.jsxs("a",{href:`https://w3s.link/ipfs/${O}`,target:"_blank",className:"ml-1 whitespace-nowrap text-primary hover:text-secondary",children:["ipfs://",O.substring(0,6),"…",O.slice(-4)]}),"."]}),{duration:15e3,position:"bottom-center",style:{width:"45ch"}}),o.on==null)throw new Error("No current chapter.");b({address:A,abi,functionName:"submitProofs",args:[[o.on-1],[O]]},{onError:R=>{console.error({error:R}),_t.error(R.shortMessage??R.message,{duration:12e3})}})}catch(N){console.error({error:N}),_t.error(N.message)}finally{c(!1)}},disabled:D!==B,className:"btn btn-wide text-primary my-6",children:[jsxRuntimeExports.jsx("span",{className:clsx(D.endsWith("…")&&"loading loading-dots loading-md")}),D]})]})};function Content(){const o=useLoadedBook();return jsxRuntimeExports.jsxs("section",{id:"content",className:"flex-grow",children:[jsxRuntimeExports.jsx("div",{className:"card bg-transparent max-w-prose mt-4 mx-auto",children:jsxRuntimeExports.jsx("div",{className:"content",children:jsxRuntimeExports.jsx(Markdown,{children:o.chapters.active.content})})}),o.on===0?jsxRuntimeExports.jsx("button",{onClick:()=>o.setOn(o.on+1),className:"shadow-md rounded-md bg-base-300 p-4 hover:bg-yellow-300/60 text-white text-center",children:"Continue"}):["pass"].includes(o.chapters.active.status)?jsxRuntimeExports.jsxs("div",{role:"alert",className:"alert alert-success flex items-center mt-10",children:[jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 shrink-0 stroke-current",fill:"none",viewBox:"0 0 24 24",children:jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),jsxRuntimeExports.jsx("h2",{className:"grow",children:"You have already successfully completed this submission."}),o.ono.setOn(o.on+1),className:"btn btn-primary text-fg font-bold self-end",children:["Next ",jsxRuntimeExports.jsx("span",{className:"size-2xl",children:"→"})]})]}):jsxRuntimeExports.jsx(Submission,{})]})}const Reward=()=>{var b;const o=useLoadedBook(),{data:i,writeContract:s}=useWriteContract(),{isLoading:a,isSuccess:c}=useWaitForTransactionReceipt({hash:i});if(!o)throw new Error("No book found.");const d=()=>{if(!o)throw new Error("No book found.");s({address:o.contract,abi,functionName:"mintToken",args:[]},{onError:$=>{console.error({error:$}),_t.error($.shortMessage??$.message,{duration:12e3})},onSuccess:$=>_t.success(jsxRuntimeExports.jsxs("p",{children:["Minted in transaction",jsxRuntimeExports.jsxs("a",{href:`https://optimistic.etherscan.io/tx/${$}`,className:"mx-1 whitespace-nowrap text-primary hover:text-secondary",target:"_blank",children:[$.substring(0,8),"…",$.slice(-6)]}),"."]}),{duration:12e3})})};let f=((b=o.chapters)==null?void 0:b.every($=>$.status==="pass"||$.optional))&&!o.nft.minted;const g="Mint NFT",y=a?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"loading loading-spinner loading-md"}),"Confirming…"]}):c?"¡Done: Minted!":g;return jsxRuntimeExports.jsx("div",{id:"reward",className:"flex flex-col ml-4 mt-8 md:mt-1",children:jsxRuntimeExports.jsxs("div",{className:"card rounded-sm bg-secondary/25 h-auto max-w-md mr-4 mx-auto",children:[jsxRuntimeExports.jsx("h1",{className:"text-3xl font-bold text-center my-4 mx-2",children:"Completion NFT"}),jsxRuntimeExports.jsx("img",{src:toHTTP(o.nft.image),alt:"Soulbound NFT",className:"w-full h-full object-contain pb-4 px-4"}),f&&jsxRuntimeExports.jsx("button",{disabled:y!==g,onClick:d,className:"btn btn-primary",children:y}),o.nft.minted&&jsxRuntimeExports.jsx("h2",{className:"bg-info rounded-md p-4",children:"You've already collected this NFT."})]})})},BookHeader=()=>{var a;const o=useBook(),[i,s]=reactExports.useState("Unknown");if(reactExports.useEffect(()=>{o&&"creator"in o&&(s(`${o.creator.substring(0,5)}⋯${o.creator.slice(-3)}`),createPublicClient({chain:mainnet,transport:http()}).getEnsName({address:o.creator}).then(d=>{d&&s(d)}))}),o&&o.error)throw o.error;return jsxRuntimeExports.jsxs("header",{children:[jsxRuntimeExports.jsxs("h2",{className:"text-sm text-secondary mt-5 text-left pl-1",children:["Creator: ",i]}),jsxRuntimeExports.jsx("h1",{className:"text-4xl md:text-6xl font-bold text-left mt-2",children:o==null?void 0:o.title}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-white text-left pl-1 mt-6 mb-4",children:["Last Updated:"," ",((a=o==null?void 0:o.updatedAt)==null?void 0:a.toLocaleString(void 0,{day:"numeric",month:"long",year:"numeric"}))??"Unknown"]})]})},Route=createLazyFileRoute("/book/$slug/")({component:Book});function Book(){try{const{slug:o}=Route.useParams();return jsxRuntimeExports.jsx(BookProvider,{slug:o,children:jsxRuntimeExports.jsxs("article",{id:"top",className:"container mx-auto py-20 px-5 overflow-auto relative",children:[jsxRuntimeExports.jsx(BookHeader,{}),jsxRuntimeExports.jsx("main",{className:"md:flex justify-start overflow-hidden relative",children:jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("h1",{children:"Loading…"}),children:[jsxRuntimeExports.jsx(Chapters,{}),jsxRuntimeExports.jsx(Content,{}),jsxRuntimeExports.jsx(Reward,{})]})})]})})}catch(o){return jsxRuntimeExports.jsxs("h1",{children:["Error: ",o.message]})}}const index_lazy=Object.freeze(Object.defineProperty({__proto__:null,Book,Route},Symbol.toStringTag,{value:"Module"}));export{EXIT as E,VFileMessage as V,stringifyPosition as a,markdownSpace as b,classifyCharacter as c,decodeNamedCharacterReference as d,markdownLineEndingOrSpace as e,factorySpace as f,start as g,cont as h,convert as i,decodeString as j,fromMarkdown as k,upload as l,markdownLineEnding as m,index_lazy as n,ok$2 as o,resolveAll as r,splice as s,toString$5 as t,unicodeWhitespace as u,visit as v}; diff --git a/assets/isAddressEqual-Cr_byQ5I.js b/assets/isAddressEqual-CzhKTe3O.js similarity index 70% rename from assets/isAddressEqual-Cr_byQ5I.js rename to assets/isAddressEqual-CzhKTe3O.js index fbadbb1..ad1526f 100644 --- a/assets/isAddressEqual-Cr_byQ5I.js +++ b/assets/isAddressEqual-CzhKTe3O.js @@ -1 +1 @@ -import{ad as e,ae as d}from"./index-CI8FOYx1.js";function a(s,r){if(!e(s,{strict:!1}))throw new d({address:s});if(!e(r,{strict:!1}))throw new d({address:r});return s.toLowerCase()===r.toLowerCase()}export{a as i}; +import{ad as e,ae as d}from"./index-Dje23Sct.js";function a(s,r){if(!e(s,{strict:!1}))throw new d({address:s});if(!e(r,{strict:!1}))throw new d({address:r});return s.toLowerCase()===r.toLowerCase()}export{a as i}; diff --git a/assets/secp256k1-B_ijNduS.js b/assets/secp256k1-B-W0FJZ_.js similarity index 99% rename from assets/secp256k1-B_ijNduS.js rename to assets/secp256k1-B-W0FJZ_.js index 41fdf3c..8294545 100644 --- a/assets/secp256k1-B_ijNduS.js +++ b/assets/secp256k1-B-W0FJZ_.js @@ -1 +1 @@ -import{cF as Ft,cG as Gt,cH as Wt,cI as qt,cJ as Xt,cK as Dt,cL as Qt,b5 as Jt}from"./index-CI8FOYx1.js";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ut=BigInt(0),ht=BigInt(1),te=BigInt(2);function nt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function lt(e){if(!nt(e))throw new Error("Uint8Array expected")}const ee=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function st(e){lt(e);let n="";for(let t=0;t=P._0&&e<=P._9)return e-P._0;if(e>=P._A&&e<=P._F)return e-(P._A-10);if(e>=P._a&&e<=P._f)return e-(P._a-10)}function ct(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const n=e.length,t=n/2;if(n%2)throw new Error("padded hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(t);for(let s=0,i=0;sUt;e>>=ht,n+=1);return n}function se(e,n){return e>>BigInt(n)&ht}function ce(e,n,t){return e|(t?ht:Ut)<(te<new Uint8Array(e),_t=e=>Uint8Array.from(e);function zt(e,n,t){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=wt(e),s=wt(e),i=0;const l=()=>{r.fill(1),s.fill(0),i=0},c=(...w)=>t(s,r,...w),o=(w=wt())=>{s=c(_t([0]),w),r=c(),w.length!==0&&(s=c(_t([1]),w),r=c())},a=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const O=[];for(;w{l(),o(w);let T;for(;!(T=O(a()));)o();return l(),T}}const fe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||nt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,n)=>n.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function dt(e,n,t={}){const r=(s,i,l)=>{const c=fe[i];if(typeof c!="function")throw new Error(`Invalid validator "${i}", expected function`);const o=e[s];if(!(l&&o===void 0)&&!c(o,e))throw new Error(`Invalid param ${String(s)}=${o} (${typeof o}), expected ${i}`)};for(const[s,i]of Object.entries(n))r(s,i,!1);for(const[s,i]of Object.entries(t))r(s,i,!0);return e}const ae=Object.freeze(Object.defineProperty({__proto__:null,abytes:lt,bitGet:se,bitLen:ie,bitMask:St,bitSet:ce,bytesToHex:st,bytesToNumberBE:et,bytesToNumberLE:xt,concatBytes:ut,createHmacDrbg:zt,ensureBytes:M,equalBytes:re,hexToBytes:ct,hexToNumber:Bt,isBytes:nt,numberToBytesBE:ft,numberToBytesLE:vt,numberToHexUnpadded:Rt,numberToVarBytesBE:ne,utf8ToBytes:oe,validateObject:dt},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const L=BigInt(0),$=BigInt(1),J=BigInt(2),ue=BigInt(3),yt=BigInt(4),Tt=BigInt(5),$t=BigInt(8);BigInt(9);BigInt(16);function R(e,n){const t=e%n;return t>=L?t:n+t}function le(e,n,t){if(t<=L||n 0");if(t===$)return L;let r=$;for(;n>L;)n&$&&(r=r*e%t),e=e*e%t,n>>=$;return r}function V(e,n,t){let r=e;for(;n-- >L;)r*=r,r%=t;return r}function mt(e,n){if(e===L||n<=L)throw new Error(`invert: expected positive integers, got n=${e} mod=${n}`);let t=R(e,n),r=n,s=L,i=$;for(;t!==L;){const c=r/t,o=r%t,a=s-i*c;r=t,t=o,s=i,i=a}if(r!==$)throw new Error("invert: does not exist");return R(s,n)}function de(e){const n=(e-$)/J;let t,r,s;for(t=e-$,r=0;t%J===L;t/=J,r++);for(s=J;s(r[s]="function",r),n);return dt(e,t)}function pe(e,n,t){if(t 0");if(t===L)return e.ONE;if(t===$)return n;let r=e.ONE,s=n;for(;t>L;)t&$&&(r=e.mul(r,s)),s=e.sqr(s),t>>=$;return r}function ye(e,n){const t=new Array(n.length),r=n.reduce((i,l,c)=>e.is0(l)?i:(t[c]=i,e.mul(i,l)),e.ONE),s=e.inv(r);return n.reduceRight((i,l,c)=>e.is0(l)?i:(t[c]=e.mul(i,t[c]),e.mul(i,l)),s),t}function Ct(e,n){const t=n!==void 0?n:e.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function me(e,n,t=!1,r={}){if(e<=L)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=Ct(e,n);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=he(e),c=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:St(s),ZERO:L,ONE:$,create:o=>R(o,e),isValid:o=>{if(typeof o!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof o}`);return L<=o&&oo===L,isOdd:o=>(o&$)===$,neg:o=>R(-o,e),eql:(o,a)=>o===a,sqr:o=>R(o*o,e),add:(o,a)=>R(o+a,e),sub:(o,a)=>R(o-a,e),mul:(o,a)=>R(o*a,e),pow:(o,a)=>pe(c,o,a),div:(o,a)=>R(o*mt(a,e),e),sqrN:o=>o*o,addN:(o,a)=>o+a,subN:(o,a)=>o-a,mulN:(o,a)=>o*a,inv:o=>mt(o,e),sqrt:r.sqrt||(o=>l(c,o)),invertBatch:o=>ye(c,o),cmov:(o,a,y)=>y?a:o,toBytes:o=>t?vt(o,i):ft(o,i),fromBytes:o=>{if(o.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${o.length}`);return t?xt(o):et(o)}});return Object.freeze(c)}function kt(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const n=e.toString(2).length;return Math.ceil(n/8)}function Vt(e){const n=kt(e);return n+Math.ceil(n/2)}function be(e,n,t=!1){const r=e.length,s=kt(n),i=Vt(n);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const l=t?et(e):xt(e),c=R(l,n-$)+$;return t?vt(c,s):ft(c,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ee=BigInt(0),pt=BigInt(1);function Be(e,n){const t=(s,i)=>{const l=i.negate();return s?l:i},r=s=>{const i=Math.ceil(n/s)+1,l=2**(s-1);return{windows:i,windowSize:l}};return{constTimeNegate:t,unsafeLadder(s,i){let l=e.ZERO,c=s;for(;i>Ee;)i&pt&&(l=l.add(c)),c=c.double(),i>>=pt;return l},precomputeWindow(s,i){const{windows:l,windowSize:c}=r(i),o=[];let a=s,y=a;for(let w=0;w>=T,d>o&&(d-=O,l+=pt);const h=f,b=f+Math.abs(d)-1,B=m%2!==0,I=d<0;d===0?y=y.add(t(B,i[h])):a=a.add(t(I,i[b]))}return{p:a,f:y}},wNAFCached(s,i,l,c){const o=s._WINDOW_SIZE||1;let a=i.get(s);return a||(a=this.precomputeWindow(s,o),o!==1&&i.set(s,c(a))),this.wNAF(o,a,l)}}}function jt(e){return we(e.Fp),dt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ct(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xe(e){const n=jt(e);dt(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:s}=n;if(t){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:ve,hexToBytes:Se}=ae,tt={Err:class extends Error{constructor(n=""){super(n)}},_parseInt(e){const{Err:n}=tt;if(e.length<2||e[0]!==2)throw new n("Invalid signature integer tag");const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new n("Invalid signature integer: wrong length");if(r[0]&128)throw new n("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new n("Invalid signature integer: unnecessary leading zero");return{d:ve(r),l:e.subarray(t+2)}},toSig(e){const{Err:n}=tt,t=typeof e=="string"?Se(e):e;lt(t);let r=t.length;if(r<2||t[0]!=48)throw new n("Invalid signature tag");if(t[1]!==r-2)throw new n("Invalid signature: incorrect length");const{d:s,l:i}=tt._parseInt(t.subarray(2)),{d:l,l:c}=tt._parseInt(i);if(c.length)throw new n("Invalid signature: left bytes after parsing");return{r:s,s:l}},hexFromSig(e){const n=a=>Number.parseInt(a[0],16)&8?"00"+a:a,t=a=>{const y=a.toString(16);return y.length&1?`0${y}`:y},r=n(t(e.s)),s=n(t(e.r)),i=r.length/2,l=s.length/2,c=t(i),o=t(l);return`30${t(l+i+4)}02${o}${s}02${c}${r}`}},F=BigInt(0),j=BigInt(1);BigInt(2);const Ht=BigInt(3);BigInt(4);function Ie(e){const n=xe(e),{Fp:t}=n,r=n.toBytes||((m,f,d)=>{const h=f.toAffine();return ut(Uint8Array.from([4]),t.toBytes(h.x),t.toBytes(h.y))}),s=n.fromBytes||(m=>{const f=m.subarray(1),d=t.fromBytes(f.subarray(0,t.BYTES)),h=t.fromBytes(f.subarray(t.BYTES,2*t.BYTES));return{x:d,y:h}});function i(m){const{a:f,b:d}=n,h=t.sqr(m),b=t.mul(h,m);return t.add(t.add(b,t.mul(m,f)),d)}if(!t.eql(t.sqr(n.Gy),i(n.Gx)))throw new Error("bad generator point: equation left != right");function l(m){return typeof m=="bigint"&&Ft.eql(B,t.ZERO);return b(d)&&b(h)?w.ZERO:new w(d,h,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(f){const d=t.invertBatch(f.map(h=>h.pz));return f.map((h,b)=>h.toAffine(d[b])).map(w.fromAffine)}static fromHex(f){const d=w.fromAffine(s(M("pointHex",f)));return d.assertValidity(),d}static fromPrivateKey(f){return w.BASE.multiply(o(f))}_setWindowSize(f){this._WINDOW_SIZE=f,a.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:f,y:d}=this.toAffine();if(!t.isValid(f)||!t.isValid(d))throw new Error("bad point: x or y not FE");const h=t.sqr(d),b=i(f);if(!t.eql(h,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:f}=this.toAffine();if(t.isOdd)return!t.isOdd(f);throw new Error("Field doesn't support isOdd")}equals(f){y(f);const{px:d,py:h,pz:b}=this,{px:B,py:I,pz:S}=f,p=t.eql(t.mul(d,S),t.mul(B,b)),E=t.eql(t.mul(h,S),t.mul(I,b));return p&&E}negate(){return new w(this.px,t.neg(this.py),this.pz)}double(){const{a:f,b:d}=n,h=t.mul(d,Ht),{px:b,py:B,pz:I}=this;let S=t.ZERO,p=t.ZERO,E=t.ZERO,v=t.mul(b,b),k=t.mul(B,B),_=t.mul(I,I),A=t.mul(b,B);return A=t.add(A,A),E=t.mul(b,I),E=t.add(E,E),S=t.mul(f,E),p=t.mul(h,_),p=t.add(S,p),S=t.sub(k,p),p=t.add(k,p),p=t.mul(S,p),S=t.mul(A,S),E=t.mul(h,E),_=t.mul(f,_),A=t.sub(v,_),A=t.mul(f,A),A=t.add(A,E),E=t.add(v,v),v=t.add(E,v),v=t.add(v,_),v=t.mul(v,A),p=t.add(p,v),_=t.mul(B,I),_=t.add(_,_),v=t.mul(_,A),S=t.sub(S,v),E=t.mul(_,k),E=t.add(E,E),E=t.add(E,E),new w(S,p,E)}add(f){y(f);const{px:d,py:h,pz:b}=this,{px:B,py:I,pz:S}=f;let p=t.ZERO,E=t.ZERO,v=t.ZERO;const k=n.a,_=t.mul(n.b,Ht);let A=t.mul(d,B),z=t.mul(h,I),C=t.mul(b,S),G=t.add(d,h),u=t.add(B,I);G=t.mul(G,u),u=t.add(A,z),G=t.sub(G,u),u=t.add(d,b);let g=t.add(B,S);return u=t.mul(u,g),g=t.add(A,C),u=t.sub(u,g),g=t.add(h,b),p=t.add(I,S),g=t.mul(g,p),p=t.add(z,C),g=t.sub(g,p),v=t.mul(k,u),p=t.mul(_,C),v=t.add(p,v),p=t.sub(z,v),v=t.add(z,v),E=t.mul(p,v),z=t.add(A,A),z=t.add(z,A),C=t.mul(k,C),u=t.mul(_,u),z=t.add(z,C),C=t.sub(A,C),C=t.mul(k,C),u=t.add(u,C),A=t.mul(z,u),E=t.add(E,A),A=t.mul(g,u),p=t.mul(G,p),p=t.sub(p,A),A=t.mul(G,z),v=t.mul(g,v),v=t.add(v,A),new w(p,E,v)}subtract(f){return this.add(f.negate())}is0(){return this.equals(w.ZERO)}wNAF(f){return T.wNAFCached(this,a,f,d=>{const h=t.invertBatch(d.map(b=>b.pz));return d.map((b,B)=>b.toAffine(h[B])).map(w.fromAffine)})}multiplyUnsafe(f){const d=w.ZERO;if(f===F)return d;if(c(f),f===j)return this;const{endo:h}=n;if(!h)return T.unsafeLadder(this,f);let{k1neg:b,k1:B,k2neg:I,k2:S}=h.splitScalar(f),p=d,E=d,v=this;for(;B>F||S>F;)B&j&&(p=p.add(v)),S&j&&(E=E.add(v)),v=v.double(),B>>=j,S>>=j;return b&&(p=p.negate()),I&&(E=E.negate()),E=new w(t.mul(E.px,h.beta),E.py,E.pz),p.add(E)}multiply(f){c(f);let d=f,h,b;const{endo:B}=n;if(B){const{k1neg:I,k1:S,k2neg:p,k2:E}=B.splitScalar(d);let{p:v,f:k}=this.wNAF(S),{p:_,f:A}=this.wNAF(E);v=T.constTimeNegate(I,v),_=T.constTimeNegate(p,_),_=new w(t.mul(_.px,B.beta),_.py,_.pz),h=v.add(_),b=k.add(A)}else{const{p:I,f:S}=this.wNAF(d);h=I,b=S}return w.normalizeZ([h,b])[0]}multiplyAndAddUnsafe(f,d,h){const b=w.BASE,B=(S,p)=>p===F||p===j||!S.equals(b)?S.multiplyUnsafe(p):S.multiply(p),I=B(this,d).add(B(f,h));return I.is0()?void 0:I}toAffine(f){const{px:d,py:h,pz:b}=this,B=this.is0();f==null&&(f=B?t.ONE:t.inv(b));const I=t.mul(d,f),S=t.mul(h,f),p=t.mul(b,f);if(B)return{x:t.ZERO,y:t.ZERO};if(!t.eql(p,t.ONE))throw new Error("invZ was invalid");return{x:I,y:S}}isTorsionFree(){const{h:f,isTorsionFree:d}=n;if(f===j)return!0;if(d)return d(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:f,clearCofactor:d}=n;return f===j?this:d?d(w,this):this.multiplyUnsafe(n.h)}toRawBytes(f=!0){return this.assertValidity(),r(w,this,f)}toHex(f=!0){return st(this.toRawBytes(f))}}w.BASE=new w(n.Gx,n.Gy,t.ONE),w.ZERO=new w(t.ZERO,t.ONE,t.ZERO);const O=n.nBitLength,T=Be(w,n.endo?Math.ceil(O/2):O);return{CURVE:n,ProjectivePoint:w,normPrivateKeyToScalar:o,weierstrassEquation:i,isWithinCurveOrder:l}}function Ae(e){const n=jt(e);return dt(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function Oe(e){const n=Ae(e),{Fp:t,n:r}=n,s=t.BYTES+1,i=2*t.BYTES+1;function l(u){return Fst(ft(u,n.nByteLength));function m(u){const g=r>>j;return u>g}function f(u){return m(u)?c(-u):u}const d=(u,g,x)=>et(u.slice(g,x));class h{constructor(g,x,N){this.r=g,this.s=x,this.recovery=N,this.assertValidity()}static fromCompact(g){const x=n.nByteLength;return g=M("compactSignature",g,x*2),new h(d(g,0,x),d(g,x,2*x))}static fromDER(g){const{r:x,s:N}=tt.toSig(M("DER",g));return new h(x,N)}assertValidity(){if(!O(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!O(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(g){return new h(this.r,this.s,g)}recoverPublicKey(g){const{r:x,s:N,recovery:q}=this,H=E(M("msgHash",g));if(q==null||![0,1,2,3].includes(q))throw new Error("recovery id invalid");const Z=q===2||q===3?x+n.n:x;if(Z>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const U=q&1?"03":"02",W=a.fromHex(U+T(Z)),Y=o(Z),X=c(-H*Y),at=c(N*Y),D=a.BASE.multiplyAndAddUnsafe(W,X,at);if(!D)throw new Error("point at infinify");return D.assertValidity(),D}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return ct(this.toDERHex())}toDERHex(){return tt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ct(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}const b={isValidPrivateKey(u){try{return y(u),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const u=Vt(n.n);return be(n.randomBytes(u),n.n)},precompute(u=8,g=a.BASE){return g._setWindowSize(u),g.multiply(BigInt(3)),g}};function B(u,g=!0){return a.fromPrivateKey(u).toRawBytes(g)}function I(u){const g=nt(u),x=typeof u=="string",N=(g||x)&&u.length;return g?N===s||N===i:x?N===2*s||N===2*i:u instanceof a}function S(u,g,x=!0){if(I(u))throw new Error("first arg must be private key");if(!I(g))throw new Error("second arg must be public key");return a.fromHex(g).multiply(y(u)).toRawBytes(x)}const p=n.bits2int||function(u){const g=et(u),x=u.length*8-n.nBitLength;return x>0?g>>BigInt(x):g},E=n.bits2int_modN||function(u){return c(p(u))},v=St(n.nBitLength);function k(u){if(typeof u!="bigint")throw new Error("bigint expected");if(!(F<=u&&uQ in x))throw new Error("sign() legacy options not supported");const{hash:N,randomBytes:q}=n;let{lowS:H,prehash:Z,extraEntropy:U}=x;H==null&&(H=!0),u=M("msgHash",u),Z&&(u=M("prehashed msgHash",N(u)));const W=E(u),Y=y(g),X=[k(Y),k(W)];if(U!=null&&U!==!1){const Q=U===!0?q(t.BYTES):U;X.push(M("extraEntropy",Q))}const at=ut(...X),D=W;function gt(Q){const rt=p(Q);if(!O(rt))return;const It=o(rt),ot=a.BASE.multiply(rt).toAffine(),K=c(ot.x);if(K===F)return;const it=c(It*c(D+K*Y));if(it===F)return;let At=(ot.x===K?0:2)|Number(ot.y&j),Ot=it;return H&&m(it)&&(Ot=f(it),At^=1),new h(K,Ot,At)}return{seed:at,k2sig:gt}}const A={lowS:n.lowS,prehash:!1},z={lowS:n.lowS,prehash:!1};function C(u,g,x=A){const{seed:N,k2sig:q}=_(u,g,x),H=n;return zt(H.hash.outputLen,H.nByteLength,H.hmac)(N,q)}a.BASE._setWindowSize(8);function G(u,g,x,N=z){var ot;const q=u;if(g=M("msgHash",g),x=M("publicKey",x),"strict"in N)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:Z}=N;let U,W;try{if(typeof q=="string"||nt(q))try{U=h.fromDER(q)}catch(K){if(!(K instanceof tt.Err))throw K;U=h.fromCompact(q)}else if(typeof q=="object"&&typeof q.r=="bigint"&&typeof q.s=="bigint"){const{r:K,s:it}=q;U=new h(K,it)}else throw new Error("PARSE");W=a.fromHex(x)}catch(K){if(K.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&U.hasHighS())return!1;Z&&(g=n.hash(g));const{r:Y,s:X}=U,at=E(g),D=o(X),gt=c(at*D),Q=c(Y*D),rt=(ot=a.BASE.multiplyAndAddUnsafe(W,gt,Q))==null?void 0:ot.toAffine();return rt?c(rt.x)===Y:!1}return{CURVE:n,getPublicKey:B,getSharedSecret:S,sign:C,verify:G,ProjectivePoint:a,Signature:h,utils:b}}class Yt extends Ft{constructor(n,t){super(),this.finished=!1,this.destroyed=!1,Gt(n);const r=Wt(t);if(this.iHash=n.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?n.create().update(r).digest():r);for(let l=0;lnew Yt(e,n).update(t).digest();Kt.create=(e,n)=>new Yt(e,n);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qe(e){return{hash:e,hmac:(n,...t)=>Kt(e,n,Dt(...t)),randomBytes:Qt}}function Ne(e,n){const t=r=>Oe({...e,...qe(r)});return Object.freeze({...t(n),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Mt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Lt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_e=BigInt(1),bt=BigInt(2),Zt=(e,n)=>(e+n/bt)/n;function Te(e){const n=Mt,t=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),l=BigInt(23),c=BigInt(44),o=BigInt(88),a=e*e*e%n,y=a*a*e%n,w=V(y,t,n)*y%n,O=V(w,t,n)*y%n,T=V(O,bt,n)*a%n,m=V(T,s,n)*T%n,f=V(m,i,n)*m%n,d=V(f,c,n)*f%n,h=V(d,o,n)*d%n,b=V(h,c,n)*f%n,B=V(b,t,n)*y%n,I=V(B,l,n)*m%n,S=V(I,r,n)*a%n,p=V(S,bt,n);if(!Et.eql(Et.sqr(p),e))throw new Error("Cannot find square root");return p}const Et=me(Mt,void 0,void 0,{sqrt:Te}),Pt=Ne({a:BigInt(0),b:BigInt(7),Fp:Et,n:Lt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const n=Lt,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-_e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,l=BigInt("0x100000000000000000000000000000000"),c=Zt(i*e,n),o=Zt(-r*e,n);let a=R(e-c*t-o*s,n),y=R(-c*r-o*i,n);const w=a>l,O=y>l;if(w&&(a=n-a),O&&(y=n-y),a>l||y>l)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:w,k1:a,k2neg:O,k2:y}}}},Jt);BigInt(0);Pt.ProjectivePoint;const Le=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Pt},Symbol.toStringTag,{value:"Module"}));export{Le as a,re as e,Pt as s}; +import{cF as Ft,cG as Gt,cH as Wt,cI as qt,cJ as Xt,cK as Dt,cL as Qt,b5 as Jt}from"./index-Dje23Sct.js";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ut=BigInt(0),ht=BigInt(1),te=BigInt(2);function nt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function lt(e){if(!nt(e))throw new Error("Uint8Array expected")}const ee=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function st(e){lt(e);let n="";for(let t=0;t=P._0&&e<=P._9)return e-P._0;if(e>=P._A&&e<=P._F)return e-(P._A-10);if(e>=P._a&&e<=P._f)return e-(P._a-10)}function ct(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const n=e.length,t=n/2;if(n%2)throw new Error("padded hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(t);for(let s=0,i=0;sUt;e>>=ht,n+=1);return n}function se(e,n){return e>>BigInt(n)&ht}function ce(e,n,t){return e|(t?ht:Ut)<(te<new Uint8Array(e),_t=e=>Uint8Array.from(e);function zt(e,n,t){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=wt(e),s=wt(e),i=0;const l=()=>{r.fill(1),s.fill(0),i=0},c=(...w)=>t(s,r,...w),o=(w=wt())=>{s=c(_t([0]),w),r=c(),w.length!==0&&(s=c(_t([1]),w),r=c())},a=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const O=[];for(;w{l(),o(w);let T;for(;!(T=O(a()));)o();return l(),T}}const fe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||nt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,n)=>n.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function dt(e,n,t={}){const r=(s,i,l)=>{const c=fe[i];if(typeof c!="function")throw new Error(`Invalid validator "${i}", expected function`);const o=e[s];if(!(l&&o===void 0)&&!c(o,e))throw new Error(`Invalid param ${String(s)}=${o} (${typeof o}), expected ${i}`)};for(const[s,i]of Object.entries(n))r(s,i,!1);for(const[s,i]of Object.entries(t))r(s,i,!0);return e}const ae=Object.freeze(Object.defineProperty({__proto__:null,abytes:lt,bitGet:se,bitLen:ie,bitMask:St,bitSet:ce,bytesToHex:st,bytesToNumberBE:et,bytesToNumberLE:xt,concatBytes:ut,createHmacDrbg:zt,ensureBytes:M,equalBytes:re,hexToBytes:ct,hexToNumber:Bt,isBytes:nt,numberToBytesBE:ft,numberToBytesLE:vt,numberToHexUnpadded:Rt,numberToVarBytesBE:ne,utf8ToBytes:oe,validateObject:dt},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const L=BigInt(0),$=BigInt(1),J=BigInt(2),ue=BigInt(3),yt=BigInt(4),Tt=BigInt(5),$t=BigInt(8);BigInt(9);BigInt(16);function R(e,n){const t=e%n;return t>=L?t:n+t}function le(e,n,t){if(t<=L||n 0");if(t===$)return L;let r=$;for(;n>L;)n&$&&(r=r*e%t),e=e*e%t,n>>=$;return r}function V(e,n,t){let r=e;for(;n-- >L;)r*=r,r%=t;return r}function mt(e,n){if(e===L||n<=L)throw new Error(`invert: expected positive integers, got n=${e} mod=${n}`);let t=R(e,n),r=n,s=L,i=$;for(;t!==L;){const c=r/t,o=r%t,a=s-i*c;r=t,t=o,s=i,i=a}if(r!==$)throw new Error("invert: does not exist");return R(s,n)}function de(e){const n=(e-$)/J;let t,r,s;for(t=e-$,r=0;t%J===L;t/=J,r++);for(s=J;s(r[s]="function",r),n);return dt(e,t)}function pe(e,n,t){if(t 0");if(t===L)return e.ONE;if(t===$)return n;let r=e.ONE,s=n;for(;t>L;)t&$&&(r=e.mul(r,s)),s=e.sqr(s),t>>=$;return r}function ye(e,n){const t=new Array(n.length),r=n.reduce((i,l,c)=>e.is0(l)?i:(t[c]=i,e.mul(i,l)),e.ONE),s=e.inv(r);return n.reduceRight((i,l,c)=>e.is0(l)?i:(t[c]=e.mul(i,t[c]),e.mul(i,l)),s),t}function Ct(e,n){const t=n!==void 0?n:e.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function me(e,n,t=!1,r={}){if(e<=L)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=Ct(e,n);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=he(e),c=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:St(s),ZERO:L,ONE:$,create:o=>R(o,e),isValid:o=>{if(typeof o!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof o}`);return L<=o&&oo===L,isOdd:o=>(o&$)===$,neg:o=>R(-o,e),eql:(o,a)=>o===a,sqr:o=>R(o*o,e),add:(o,a)=>R(o+a,e),sub:(o,a)=>R(o-a,e),mul:(o,a)=>R(o*a,e),pow:(o,a)=>pe(c,o,a),div:(o,a)=>R(o*mt(a,e),e),sqrN:o=>o*o,addN:(o,a)=>o+a,subN:(o,a)=>o-a,mulN:(o,a)=>o*a,inv:o=>mt(o,e),sqrt:r.sqrt||(o=>l(c,o)),invertBatch:o=>ye(c,o),cmov:(o,a,y)=>y?a:o,toBytes:o=>t?vt(o,i):ft(o,i),fromBytes:o=>{if(o.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${o.length}`);return t?xt(o):et(o)}});return Object.freeze(c)}function kt(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const n=e.toString(2).length;return Math.ceil(n/8)}function Vt(e){const n=kt(e);return n+Math.ceil(n/2)}function be(e,n,t=!1){const r=e.length,s=kt(n),i=Vt(n);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const l=t?et(e):xt(e),c=R(l,n-$)+$;return t?vt(c,s):ft(c,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ee=BigInt(0),pt=BigInt(1);function Be(e,n){const t=(s,i)=>{const l=i.negate();return s?l:i},r=s=>{const i=Math.ceil(n/s)+1,l=2**(s-1);return{windows:i,windowSize:l}};return{constTimeNegate:t,unsafeLadder(s,i){let l=e.ZERO,c=s;for(;i>Ee;)i&pt&&(l=l.add(c)),c=c.double(),i>>=pt;return l},precomputeWindow(s,i){const{windows:l,windowSize:c}=r(i),o=[];let a=s,y=a;for(let w=0;w>=T,d>o&&(d-=O,l+=pt);const h=f,b=f+Math.abs(d)-1,B=m%2!==0,I=d<0;d===0?y=y.add(t(B,i[h])):a=a.add(t(I,i[b]))}return{p:a,f:y}},wNAFCached(s,i,l,c){const o=s._WINDOW_SIZE||1;let a=i.get(s);return a||(a=this.precomputeWindow(s,o),o!==1&&i.set(s,c(a))),this.wNAF(o,a,l)}}}function jt(e){return we(e.Fp),dt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ct(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xe(e){const n=jt(e);dt(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:s}=n;if(t){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:ve,hexToBytes:Se}=ae,tt={Err:class extends Error{constructor(n=""){super(n)}},_parseInt(e){const{Err:n}=tt;if(e.length<2||e[0]!==2)throw new n("Invalid signature integer tag");const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new n("Invalid signature integer: wrong length");if(r[0]&128)throw new n("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new n("Invalid signature integer: unnecessary leading zero");return{d:ve(r),l:e.subarray(t+2)}},toSig(e){const{Err:n}=tt,t=typeof e=="string"?Se(e):e;lt(t);let r=t.length;if(r<2||t[0]!=48)throw new n("Invalid signature tag");if(t[1]!==r-2)throw new n("Invalid signature: incorrect length");const{d:s,l:i}=tt._parseInt(t.subarray(2)),{d:l,l:c}=tt._parseInt(i);if(c.length)throw new n("Invalid signature: left bytes after parsing");return{r:s,s:l}},hexFromSig(e){const n=a=>Number.parseInt(a[0],16)&8?"00"+a:a,t=a=>{const y=a.toString(16);return y.length&1?`0${y}`:y},r=n(t(e.s)),s=n(t(e.r)),i=r.length/2,l=s.length/2,c=t(i),o=t(l);return`30${t(l+i+4)}02${o}${s}02${c}${r}`}},F=BigInt(0),j=BigInt(1);BigInt(2);const Ht=BigInt(3);BigInt(4);function Ie(e){const n=xe(e),{Fp:t}=n,r=n.toBytes||((m,f,d)=>{const h=f.toAffine();return ut(Uint8Array.from([4]),t.toBytes(h.x),t.toBytes(h.y))}),s=n.fromBytes||(m=>{const f=m.subarray(1),d=t.fromBytes(f.subarray(0,t.BYTES)),h=t.fromBytes(f.subarray(t.BYTES,2*t.BYTES));return{x:d,y:h}});function i(m){const{a:f,b:d}=n,h=t.sqr(m),b=t.mul(h,m);return t.add(t.add(b,t.mul(m,f)),d)}if(!t.eql(t.sqr(n.Gy),i(n.Gx)))throw new Error("bad generator point: equation left != right");function l(m){return typeof m=="bigint"&&Ft.eql(B,t.ZERO);return b(d)&&b(h)?w.ZERO:new w(d,h,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(f){const d=t.invertBatch(f.map(h=>h.pz));return f.map((h,b)=>h.toAffine(d[b])).map(w.fromAffine)}static fromHex(f){const d=w.fromAffine(s(M("pointHex",f)));return d.assertValidity(),d}static fromPrivateKey(f){return w.BASE.multiply(o(f))}_setWindowSize(f){this._WINDOW_SIZE=f,a.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:f,y:d}=this.toAffine();if(!t.isValid(f)||!t.isValid(d))throw new Error("bad point: x or y not FE");const h=t.sqr(d),b=i(f);if(!t.eql(h,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:f}=this.toAffine();if(t.isOdd)return!t.isOdd(f);throw new Error("Field doesn't support isOdd")}equals(f){y(f);const{px:d,py:h,pz:b}=this,{px:B,py:I,pz:S}=f,p=t.eql(t.mul(d,S),t.mul(B,b)),E=t.eql(t.mul(h,S),t.mul(I,b));return p&&E}negate(){return new w(this.px,t.neg(this.py),this.pz)}double(){const{a:f,b:d}=n,h=t.mul(d,Ht),{px:b,py:B,pz:I}=this;let S=t.ZERO,p=t.ZERO,E=t.ZERO,v=t.mul(b,b),k=t.mul(B,B),_=t.mul(I,I),A=t.mul(b,B);return A=t.add(A,A),E=t.mul(b,I),E=t.add(E,E),S=t.mul(f,E),p=t.mul(h,_),p=t.add(S,p),S=t.sub(k,p),p=t.add(k,p),p=t.mul(S,p),S=t.mul(A,S),E=t.mul(h,E),_=t.mul(f,_),A=t.sub(v,_),A=t.mul(f,A),A=t.add(A,E),E=t.add(v,v),v=t.add(E,v),v=t.add(v,_),v=t.mul(v,A),p=t.add(p,v),_=t.mul(B,I),_=t.add(_,_),v=t.mul(_,A),S=t.sub(S,v),E=t.mul(_,k),E=t.add(E,E),E=t.add(E,E),new w(S,p,E)}add(f){y(f);const{px:d,py:h,pz:b}=this,{px:B,py:I,pz:S}=f;let p=t.ZERO,E=t.ZERO,v=t.ZERO;const k=n.a,_=t.mul(n.b,Ht);let A=t.mul(d,B),z=t.mul(h,I),C=t.mul(b,S),G=t.add(d,h),u=t.add(B,I);G=t.mul(G,u),u=t.add(A,z),G=t.sub(G,u),u=t.add(d,b);let g=t.add(B,S);return u=t.mul(u,g),g=t.add(A,C),u=t.sub(u,g),g=t.add(h,b),p=t.add(I,S),g=t.mul(g,p),p=t.add(z,C),g=t.sub(g,p),v=t.mul(k,u),p=t.mul(_,C),v=t.add(p,v),p=t.sub(z,v),v=t.add(z,v),E=t.mul(p,v),z=t.add(A,A),z=t.add(z,A),C=t.mul(k,C),u=t.mul(_,u),z=t.add(z,C),C=t.sub(A,C),C=t.mul(k,C),u=t.add(u,C),A=t.mul(z,u),E=t.add(E,A),A=t.mul(g,u),p=t.mul(G,p),p=t.sub(p,A),A=t.mul(G,z),v=t.mul(g,v),v=t.add(v,A),new w(p,E,v)}subtract(f){return this.add(f.negate())}is0(){return this.equals(w.ZERO)}wNAF(f){return T.wNAFCached(this,a,f,d=>{const h=t.invertBatch(d.map(b=>b.pz));return d.map((b,B)=>b.toAffine(h[B])).map(w.fromAffine)})}multiplyUnsafe(f){const d=w.ZERO;if(f===F)return d;if(c(f),f===j)return this;const{endo:h}=n;if(!h)return T.unsafeLadder(this,f);let{k1neg:b,k1:B,k2neg:I,k2:S}=h.splitScalar(f),p=d,E=d,v=this;for(;B>F||S>F;)B&j&&(p=p.add(v)),S&j&&(E=E.add(v)),v=v.double(),B>>=j,S>>=j;return b&&(p=p.negate()),I&&(E=E.negate()),E=new w(t.mul(E.px,h.beta),E.py,E.pz),p.add(E)}multiply(f){c(f);let d=f,h,b;const{endo:B}=n;if(B){const{k1neg:I,k1:S,k2neg:p,k2:E}=B.splitScalar(d);let{p:v,f:k}=this.wNAF(S),{p:_,f:A}=this.wNAF(E);v=T.constTimeNegate(I,v),_=T.constTimeNegate(p,_),_=new w(t.mul(_.px,B.beta),_.py,_.pz),h=v.add(_),b=k.add(A)}else{const{p:I,f:S}=this.wNAF(d);h=I,b=S}return w.normalizeZ([h,b])[0]}multiplyAndAddUnsafe(f,d,h){const b=w.BASE,B=(S,p)=>p===F||p===j||!S.equals(b)?S.multiplyUnsafe(p):S.multiply(p),I=B(this,d).add(B(f,h));return I.is0()?void 0:I}toAffine(f){const{px:d,py:h,pz:b}=this,B=this.is0();f==null&&(f=B?t.ONE:t.inv(b));const I=t.mul(d,f),S=t.mul(h,f),p=t.mul(b,f);if(B)return{x:t.ZERO,y:t.ZERO};if(!t.eql(p,t.ONE))throw new Error("invZ was invalid");return{x:I,y:S}}isTorsionFree(){const{h:f,isTorsionFree:d}=n;if(f===j)return!0;if(d)return d(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:f,clearCofactor:d}=n;return f===j?this:d?d(w,this):this.multiplyUnsafe(n.h)}toRawBytes(f=!0){return this.assertValidity(),r(w,this,f)}toHex(f=!0){return st(this.toRawBytes(f))}}w.BASE=new w(n.Gx,n.Gy,t.ONE),w.ZERO=new w(t.ZERO,t.ONE,t.ZERO);const O=n.nBitLength,T=Be(w,n.endo?Math.ceil(O/2):O);return{CURVE:n,ProjectivePoint:w,normPrivateKeyToScalar:o,weierstrassEquation:i,isWithinCurveOrder:l}}function Ae(e){const n=jt(e);return dt(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function Oe(e){const n=Ae(e),{Fp:t,n:r}=n,s=t.BYTES+1,i=2*t.BYTES+1;function l(u){return Fst(ft(u,n.nByteLength));function m(u){const g=r>>j;return u>g}function f(u){return m(u)?c(-u):u}const d=(u,g,x)=>et(u.slice(g,x));class h{constructor(g,x,N){this.r=g,this.s=x,this.recovery=N,this.assertValidity()}static fromCompact(g){const x=n.nByteLength;return g=M("compactSignature",g,x*2),new h(d(g,0,x),d(g,x,2*x))}static fromDER(g){const{r:x,s:N}=tt.toSig(M("DER",g));return new h(x,N)}assertValidity(){if(!O(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!O(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(g){return new h(this.r,this.s,g)}recoverPublicKey(g){const{r:x,s:N,recovery:q}=this,H=E(M("msgHash",g));if(q==null||![0,1,2,3].includes(q))throw new Error("recovery id invalid");const Z=q===2||q===3?x+n.n:x;if(Z>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const U=q&1?"03":"02",W=a.fromHex(U+T(Z)),Y=o(Z),X=c(-H*Y),at=c(N*Y),D=a.BASE.multiplyAndAddUnsafe(W,X,at);if(!D)throw new Error("point at infinify");return D.assertValidity(),D}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return ct(this.toDERHex())}toDERHex(){return tt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ct(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}const b={isValidPrivateKey(u){try{return y(u),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const u=Vt(n.n);return be(n.randomBytes(u),n.n)},precompute(u=8,g=a.BASE){return g._setWindowSize(u),g.multiply(BigInt(3)),g}};function B(u,g=!0){return a.fromPrivateKey(u).toRawBytes(g)}function I(u){const g=nt(u),x=typeof u=="string",N=(g||x)&&u.length;return g?N===s||N===i:x?N===2*s||N===2*i:u instanceof a}function S(u,g,x=!0){if(I(u))throw new Error("first arg must be private key");if(!I(g))throw new Error("second arg must be public key");return a.fromHex(g).multiply(y(u)).toRawBytes(x)}const p=n.bits2int||function(u){const g=et(u),x=u.length*8-n.nBitLength;return x>0?g>>BigInt(x):g},E=n.bits2int_modN||function(u){return c(p(u))},v=St(n.nBitLength);function k(u){if(typeof u!="bigint")throw new Error("bigint expected");if(!(F<=u&&uQ in x))throw new Error("sign() legacy options not supported");const{hash:N,randomBytes:q}=n;let{lowS:H,prehash:Z,extraEntropy:U}=x;H==null&&(H=!0),u=M("msgHash",u),Z&&(u=M("prehashed msgHash",N(u)));const W=E(u),Y=y(g),X=[k(Y),k(W)];if(U!=null&&U!==!1){const Q=U===!0?q(t.BYTES):U;X.push(M("extraEntropy",Q))}const at=ut(...X),D=W;function gt(Q){const rt=p(Q);if(!O(rt))return;const It=o(rt),ot=a.BASE.multiply(rt).toAffine(),K=c(ot.x);if(K===F)return;const it=c(It*c(D+K*Y));if(it===F)return;let At=(ot.x===K?0:2)|Number(ot.y&j),Ot=it;return H&&m(it)&&(Ot=f(it),At^=1),new h(K,Ot,At)}return{seed:at,k2sig:gt}}const A={lowS:n.lowS,prehash:!1},z={lowS:n.lowS,prehash:!1};function C(u,g,x=A){const{seed:N,k2sig:q}=_(u,g,x),H=n;return zt(H.hash.outputLen,H.nByteLength,H.hmac)(N,q)}a.BASE._setWindowSize(8);function G(u,g,x,N=z){var ot;const q=u;if(g=M("msgHash",g),x=M("publicKey",x),"strict"in N)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:Z}=N;let U,W;try{if(typeof q=="string"||nt(q))try{U=h.fromDER(q)}catch(K){if(!(K instanceof tt.Err))throw K;U=h.fromCompact(q)}else if(typeof q=="object"&&typeof q.r=="bigint"&&typeof q.s=="bigint"){const{r:K,s:it}=q;U=new h(K,it)}else throw new Error("PARSE");W=a.fromHex(x)}catch(K){if(K.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&U.hasHighS())return!1;Z&&(g=n.hash(g));const{r:Y,s:X}=U,at=E(g),D=o(X),gt=c(at*D),Q=c(Y*D),rt=(ot=a.BASE.multiplyAndAddUnsafe(W,gt,Q))==null?void 0:ot.toAffine();return rt?c(rt.x)===Y:!1}return{CURVE:n,getPublicKey:B,getSharedSecret:S,sign:C,verify:G,ProjectivePoint:a,Signature:h,utils:b}}class Yt extends Ft{constructor(n,t){super(),this.finished=!1,this.destroyed=!1,Gt(n);const r=Wt(t);if(this.iHash=n.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?n.create().update(r).digest():r);for(let l=0;lnew Yt(e,n).update(t).digest();Kt.create=(e,n)=>new Yt(e,n);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qe(e){return{hash:e,hmac:(n,...t)=>Kt(e,n,Dt(...t)),randomBytes:Qt}}function Ne(e,n){const t=r=>Oe({...e,...qe(r)});return Object.freeze({...t(n),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Mt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Lt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_e=BigInt(1),bt=BigInt(2),Zt=(e,n)=>(e+n/bt)/n;function Te(e){const n=Mt,t=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),l=BigInt(23),c=BigInt(44),o=BigInt(88),a=e*e*e%n,y=a*a*e%n,w=V(y,t,n)*y%n,O=V(w,t,n)*y%n,T=V(O,bt,n)*a%n,m=V(T,s,n)*T%n,f=V(m,i,n)*m%n,d=V(f,c,n)*f%n,h=V(d,o,n)*d%n,b=V(h,c,n)*f%n,B=V(b,t,n)*y%n,I=V(B,l,n)*m%n,S=V(I,r,n)*a%n,p=V(S,bt,n);if(!Et.eql(Et.sqr(p),e))throw new Error("Cannot find square root");return p}const Et=me(Mt,void 0,void 0,{sqrt:Te}),Pt=Ne({a:BigInt(0),b:BigInt(7),Fp:Et,n:Lt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const n=Lt,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-_e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,l=BigInt("0x100000000000000000000000000000000"),c=Zt(i*e,n),o=Zt(-r*e,n);let a=R(e-c*t-o*s,n),y=R(-c*r-o*i,n);const w=a>l,O=y>l;if(w&&(a=n-a),O&&(y=n-y),a>l||y>l)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:w,k1:a,k2neg:O,k2:y}}}},Jt);BigInt(0);Pt.ProjectivePoint;const Le=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Pt},Symbol.toStringTag,{value:"Module"}));export{Le as a,re as e,Pt as s}; diff --git a/assets/w3m-modal-fwmTGh44.js b/assets/w3m-modal-DG2UkRHg.js similarity index 95% rename from assets/w3m-modal-fwmTGh44.js rename to assets/w3m-modal-DG2UkRHg.js index c291d15..3363cfb 100644 --- a/assets/w3m-modal-fwmTGh44.js +++ b/assets/w3m-modal-DG2UkRHg.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-hDIYmWL4.js","assets/index-CI8FOYx1.js","assets/index-DQLbHeQa.css"])))=>i.map(i=>d[i]); -import{i as C,h as S,M as n,C as h,O as b,cs as k,A as p,E,k as A,R as c,b8 as f,bg as _,bd as x,S as O,ct as v,cu as L,b as w,c as N,cv as I}from"./index-CI8FOYx1.js";const T=C` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BpiWtdP0.js","assets/index-Dje23Sct.js","assets/index-DQLbHeQa.css"])))=>i.map(i=>d[i]); +import{i as C,h as S,M as n,C as h,O as b,cs as k,A as p,E,k as A,R as c,b8 as f,bg as _,bd as x,S as O,ct as v,cu as L,b as w,c as N,cv as I}from"./index-Dje23Sct.js";const T=C` :host { z-index: var(--w3m-z-index); display: block; @@ -138,7 +138,7 @@ import{i as C,h as S,M as n,C as h,O as b,cs as k,A as p,E,k as A,R as c,b8 as f - `:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){const e=c.state.view==="ConnectingSiwe",i=c.state.view==="ApproveTransaction";if(this.isSiweEnabled){const{SIWEController:t}=await f(async()=>{const{SIWEController:o}=await import("./index-hDIYmWL4.js");return{SIWEController:o}},__vite__mapDeps([0,1,2]));t.state.status!=="success"&&(e||i)?n.shake():n.close()}else n.close()}initializeTheming(){const{themeVariables:e,themeMode:i}=I.state,t=_.getColorTheme(i);x(e,t)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),O.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=g,e.textContent=` + `:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){const e=c.state.view==="ConnectingSiwe",i=c.state.view==="ApproveTransaction";if(this.isSiweEnabled){const{SIWEController:t}=await f(async()=>{const{SIWEController:o}=await import("./index-BpiWtdP0.js");return{SIWEController:o}},__vite__mapDeps([0,1,2]));t.state.status!=="success"&&(e||i)?n.shake():n.close()}else n.close()}initializeTheming(){const{themeVariables:e,themeMode:i}=I.state,t=_.getColorTheme(i);x(e,t)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),O.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=g,e.textContent=` body { touch-action: none; overflow: hidden; @@ -147,4 +147,4 @@ import{i as C,h as S,M as n,C as h,O as b,cs as k,A as p,E,k as A,R as c,b8 as f w3m-modal { pointer-events: auto; } - `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${g}"]`);e&&e.remove()}onAddKeyboardListener(){var i;this.abortController=new AbortController;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",t=>{if(t.key==="Escape")this.handleClose();else if(t.key==="Tab"){const{tagName:s}=t.target;s&&!s.includes("W3M-")&&!s.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}onSiweStatusChange(e){e==="success"&&n.close()}async onNewAddress(e){var o;const i=this.caipAddress?v.getPlainAddress(this.caipAddress):void 0,t=e?v.getPlainAddress(e):void 0;if(t&&!(i===t)&&this.isSiweEnabled){const{SIWEController:a}=await f(async()=>{const{SIWEController:m}=await import("./index-hDIYmWL4.js");return{SIWEController:m}},__vite__mapDeps([0,1,2])),r=p.state.siweStatus==="success";!i&&t?this.onSiweNavigation():r&&i&&t&&i!==t&&(o=a.state._client)!=null&&o.options.signOutOnAccountChange&&(await a.signOut(),this.onSiweNavigation())}t||n.close(),this.caipAddress=e}async onNewNetwork(e){var s,o,a,r;if(!this.caipAddress){this.caipNetwork=e;return}const i=(o=(s=this.caipNetwork)==null?void 0:s.id)==null?void 0:o.toString(),t=(a=e==null?void 0:e.id)==null?void 0:a.toString();if(i&&t&&i!==t)if(this.isSiweEnabled){const{SIWEController:m}=await f(async()=>{const{SIWEController:y}=await import("./index-hDIYmWL4.js");return{SIWEController:y}},__vite__mapDeps([0,1,2]));(r=m.state._client)!=null&&r.options.signOutOnNetworkChange?(await m.signOut(),this.onSiweNavigation()):c.goBack()}else c.goBack();this.caipNetwork=e}onSiweNavigation(){const e=h.state.activeChain===L.CHAIN.EVM;!(p.state.siweStatus==="success")&&e?this.open?c.replace("ConnectingSiwe"):n.open({view:"ConnectingSiwe"}):c.goBack()}};l.styles=T;d([w()],l.prototype,"open",void 0);d([w()],l.prototype,"caipAddress",void 0);d([w()],l.prototype,"caipNetwork",void 0);d([w()],l.prototype,"isSiweEnabled",void 0);d([w()],l.prototype,"shake",void 0);l=d([N("w3m-modal")],l);export{l as W3mModal}; + `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${g}"]`);e&&e.remove()}onAddKeyboardListener(){var i;this.abortController=new AbortController;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",t=>{if(t.key==="Escape")this.handleClose();else if(t.key==="Tab"){const{tagName:s}=t.target;s&&!s.includes("W3M-")&&!s.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}onSiweStatusChange(e){e==="success"&&n.close()}async onNewAddress(e){var o;const i=this.caipAddress?v.getPlainAddress(this.caipAddress):void 0,t=e?v.getPlainAddress(e):void 0;if(t&&!(i===t)&&this.isSiweEnabled){const{SIWEController:a}=await f(async()=>{const{SIWEController:m}=await import("./index-BpiWtdP0.js");return{SIWEController:m}},__vite__mapDeps([0,1,2])),r=p.state.siweStatus==="success";!i&&t?this.onSiweNavigation():r&&i&&t&&i!==t&&(o=a.state._client)!=null&&o.options.signOutOnAccountChange&&(await a.signOut(),this.onSiweNavigation())}t||n.close(),this.caipAddress=e}async onNewNetwork(e){var s,o,a,r;if(!this.caipAddress){this.caipNetwork=e;return}const i=(o=(s=this.caipNetwork)==null?void 0:s.id)==null?void 0:o.toString(),t=(a=e==null?void 0:e.id)==null?void 0:a.toString();if(i&&t&&i!==t)if(this.isSiweEnabled){const{SIWEController:m}=await f(async()=>{const{SIWEController:y}=await import("./index-BpiWtdP0.js");return{SIWEController:y}},__vite__mapDeps([0,1,2]));(r=m.state._client)!=null&&r.options.signOutOnNetworkChange?(await m.signOut(),this.onSiweNavigation()):c.goBack()}else c.goBack();this.caipNetwork=e}onSiweNavigation(){const e=h.state.activeChain===L.CHAIN.EVM;!(p.state.siweStatus==="success")&&e?this.open?c.replace("ConnectingSiwe"):n.open({view:"ConnectingSiwe"}):c.goBack()}};l.styles=T;d([w()],l.prototype,"open",void 0);d([w()],l.prototype,"caipAddress",void 0);d([w()],l.prototype,"caipNetwork",void 0);d([w()],l.prototype,"isSiweEnabled",void 0);d([w()],l.prototype,"shake",void 0);l=d([N("w3m-modal")],l);export{l as W3mModal}; diff --git a/index.html b/index.html index a98b284..40e2318 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ dAcademy - +