diff --git a/assets/MarkdownEditor-YN_nb091.js b/assets/MarkdownEditor-CZAn4RGy.js similarity index 99% rename from assets/MarkdownEditor-YN_nb091.js rename to assets/MarkdownEditor-CZAn4RGy.js index b592ecf..51444fc 100644 --- a/assets/MarkdownEditor-YN_nb091.js +++ b/assets/MarkdownEditor-CZAn4RGy.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BUCY1QbU.js","assets/index-B3nH8WrL.js","assets/index-BaCtwzPf.css","assets/markdown-editor-Bo-wCvDQ.js","assets/markdown-editor-DU6WCIos.css","assets/utils-DE92Morm.js","assets/isAddressEqual-CYfaHVHF.js","assets/secp256k1-Jr9fFTYw.js","assets/index-CaUmW_YA.js","assets/index-BiBTTaGH.js","assets/index-DRu_Ak_x.js","assets/index-CJ6QPiQg.js","assets/index-B1D2qaau.js","assets/index-LXQNhuCA.js","assets/index-BSrO6--0.js","assets/index-Bw6axJqo.js","assets/index-BrrwHM8t.js","assets/index-ByRSwZC2.js","assets/index-DPtw8zI_.js","assets/index-Ceqbi7UH.js","assets/index-35omGXah.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-CmhnNuSZ.js","assets/index-CADnrDq9.js"])))=>i.map(i=>d[i]); -import{g as w,f as k,j as R,cN as Lo,v as dC,cO as v7,cP as w7,Z as V,q as vx}from"./index-B3nH8WrL.js";import{s as ip,r as S7,c as wx,d as Sx,V as sn,o as sr,b as eu,m as on,e as Ar,g as li,h as $r,i as Pi,j as Jn,k as _l,v as k7,E as C7,t as pC,l as _7,p as P7,f as T7}from"./markdown-editor-Bo-wCvDQ.js";import{u as E7}from"./utils-DE92Morm.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{g as w,f as k,j as R,cN as Lo,v as dC,cO as v7,cP as w7,Z as V,q as vx}from"./index-CRY2WMkq.js";import{s as ip,r as S7,c as wx,d as Sx,V as sn,o as sr,b as eu,m as on,e as Ar,g as li,h as $r,i as Pi,j as Jn,k as _l,v as k7,E as C7,t as pC,l as _7,p as P7,f as T7}from"./markdown-editor-Bo-wCvDQ.js";import{u as E7}from"./utils-DRp9lgY5.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-BUCY1QbU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>e.sql({dialect:e[n]}))}const sG=[I.of({name:"C",extensions:["c","h","ino"],load(){return V(()=>import("./index-CaUmW_YA.js"),__vite__mapDeps([8,1,2,3,4,5,6,7])).then(n=>n.cpp())}}),I.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return V(()=>import("./index-CaUmW_YA.js"),__vite__mapDeps([8,1,2,3,4,5,6,7])).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-BiBTTaGH.js"),__vite__mapDeps([9,1,2,3,4,5,6,7])).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-DRu_Ak_x.js"),__vite__mapDeps([10,1,2,3,4,5,6,7])).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-CJ6QPiQg.js"),__vite__mapDeps([11,1,2,3,4,5,6,7])).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-B1D2qaau.js"),__vite__mapDeps([12,1,2,3,4,5,6,7])).then(n=>n.less())}}),I.of({name:"Liquid",extensions:["liquid"],load(){return V(()=>import("./index-LXQNhuCA.js"),__vite__mapDeps([13,1,2,3,4,5,6,7])).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-BSrO6--0.js"),__vite__mapDeps([14,1,2,3,4,5,6,7])).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-Bw6axJqo.js"),__vite__mapDeps([15,1,2,3,4,5,6,7])).then(n=>n.python())}}),I.of({name:"Rust",extensions:["rs"],load(){return V(()=>import("./index-BrrwHM8t.js"),__vite__mapDeps([16,1,2,3,4,5,6,7])).then(n=>n.rust())}}),I.of({name:"Sass",extensions:["sass"],load(){return V(()=>import("./index-ByRSwZC2.js"),__vite__mapDeps([17,1,2,3,4,5,6,7])).then(n=>n.sass({indented:!0}))}}),I.of({name:"SCSS",extensions:["scss"],load(){return V(()=>import("./index-ByRSwZC2.js"),__vite__mapDeps([17,1,2,3,4,5,6,7])).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-DPtw8zI_.js"),__vite__mapDeps([18,1,2,3,4,5,6,7])).then(n=>n.wast())}}),I.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return V(()=>import("./index-Ceqbi7UH.js"),__vite__mapDeps([19,1,2,3,4,5,6,7])).then(n=>n.xml())}}),I.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return V(()=>import("./index-35omGXah.js"),__vite__mapDeps([20,1,2,3,4,5,6,7])).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([21,22])).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([23,22])).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([24,22])).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([25,26])).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-CmhnNuSZ.js"),__vite__mapDeps([27,1,2,3,4,5,6,7])).then(n=>n.vue())}}),I.of({name:"Angular Template",load(){return V(()=>import("./index-CADnrDq9.js"),__vite__mapDeps([28,1,2,3,4,5,6,7])).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-BnXJvqJ9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>e.sql({dialect:e[n]}))}const sG=[I.of({name:"C",extensions:["c","h","ino"],load(){return V(()=>import("./index-BO26DNLR.js"),__vite__mapDeps([8,1,2,3,4,5,6,7])).then(n=>n.cpp())}}),I.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return V(()=>import("./index-BO26DNLR.js"),__vite__mapDeps([8,1,2,3,4,5,6,7])).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-CbZrDRPf.js"),__vite__mapDeps([9,1,2,3,4,5,6,7])).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-DpwEr9Iy.js"),__vite__mapDeps([10,1,2,3,4,5,6,7])).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-DSJRAYcL.js"),__vite__mapDeps([11,1,2,3,4,5,6,7])).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-CTW2H17E.js"),__vite__mapDeps([12,1,2,3,4,5,6,7])).then(n=>n.less())}}),I.of({name:"Liquid",extensions:["liquid"],load(){return V(()=>import("./index-CLgfgwob.js"),__vite__mapDeps([13,1,2,3,4,5,6,7])).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-CdwG7HTr.js"),__vite__mapDeps([14,1,2,3,4,5,6,7])).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-uRPInG8W.js"),__vite__mapDeps([15,1,2,3,4,5,6,7])).then(n=>n.python())}}),I.of({name:"Rust",extensions:["rs"],load(){return V(()=>import("./index-D4l1T0JE.js"),__vite__mapDeps([16,1,2,3,4,5,6,7])).then(n=>n.rust())}}),I.of({name:"Sass",extensions:["sass"],load(){return V(()=>import("./index-BQLI2pJw.js"),__vite__mapDeps([17,1,2,3,4,5,6,7])).then(n=>n.sass({indented:!0}))}}),I.of({name:"SCSS",extensions:["scss"],load(){return V(()=>import("./index-BQLI2pJw.js"),__vite__mapDeps([17,1,2,3,4,5,6,7])).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-BWEoL4Yf.js"),__vite__mapDeps([18,1,2,3,4,5,6,7])).then(n=>n.wast())}}),I.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return V(()=>import("./index-ByKQyYul.js"),__vite__mapDeps([19,1,2,3,4,5,6,7])).then(n=>n.xml())}}),I.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return V(()=>import("./index-NWKG_mJ6.js"),__vite__mapDeps([20,1,2,3,4,5,6,7])).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([21,22])).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([23,22])).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([24,22])).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([25,26])).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-CWD_4GZu.js"),__vite__mapDeps([27,1,2,3,4,5,6,7])).then(n=>n.vue())}}),I.of({name:"Angular Template",load(){return V(()=>import("./index-Byh6IrSk.js"),__vite__mapDeps([28,1,2,3,4,5,6,7])).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,bte]=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,xte]=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|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'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6y-E6yOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6z-E6zOOOP1G.x1G.xOOOS-E6{-E6{OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'jO!bO,59eOOOO-E6w-E6wO'xOpO1G.uO'xOpO1G.uOOOP1G.u1G.uO(QOpO7+$fOOOP7+$f7+$fO(YO!bO<d!d;'S%y;'S;=`&_<%lO%yX>iV{WOr%ysv%yw!}%y!}#O?O#O;'S%y;'S;=`&_<%lO%yX?VT{WxPOr%ysv%yw;'S%y;'S;=`&_<%lO%yX?kV{WOr%ysv%yw#W%y#W#X@Q#X;'S%y;'S;=`&_<%lO%yX@VV{WOr%ysv%yw#T%y#T#U@l#U;'S%y;'S;=`&_<%lO%yX@qV{WOr%ysv%yw#h%y#h#iAW#i;'S%y;'S;=`&_<%lO%yXA]V{WOr%ysv%yw#T%y#T#U>d#U;'S%y;'S;=`&_<%lO%yXAwV{WOr%ysv%yw#c%y#c#dB^#d;'S%y;'S;=`&_<%lO%yXBcV{WOr%ysv%yw#V%y#V#WBx#W;'S%y;'S;=`&_<%lO%yXB}V{WOr%ysv%yw#h%y#h#iCd#i;'S%y;'S;=`&_<%lO%yXCiV{WOr%ysv%yw#m%y#m#nDO#n;'S%y;'S;=`&_<%lO%yXDTV{WOr%ysv%yw#d%y#d#eDj#e;'S%y;'S;=`&_<%lO%yXDoV{WOr%ysv%yw#X%y#X#Y9i#Y;'S%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 Pe(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,Pe 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-CZAn4RGy.js";import"./index-CRY2WMkq.js";import"./markdown-editor-Bo-wCvDQ.js";import"./utils-DRp9lgY5.js";import"./isAddressEqual-C-mVTeCa.js";import"./secp256k1-B8dOsQyz.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'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6y-E6yOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6z-E6zOOOP1G.x1G.xOOOS-E6{-E6{OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'jO!bO,59eOOOO-E6w-E6wO'xOpO1G.uO'xOpO1G.uOOOP1G.u1G.uO(QOpO7+$fOOOP7+$f7+$fO(YO!bO<d!d;'S%y;'S;=`&_<%lO%yX>iV{WOr%ysv%yw!}%y!}#O?O#O;'S%y;'S;=`&_<%lO%yX?VT{WxPOr%ysv%yw;'S%y;'S;=`&_<%lO%yX?kV{WOr%ysv%yw#W%y#W#X@Q#X;'S%y;'S;=`&_<%lO%yX@VV{WOr%ysv%yw#T%y#T#U@l#U;'S%y;'S;=`&_<%lO%yX@qV{WOr%ysv%yw#h%y#h#iAW#i;'S%y;'S;=`&_<%lO%yXA]V{WOr%ysv%yw#T%y#T#U>d#U;'S%y;'S;=`&_<%lO%yXAwV{WOr%ysv%yw#c%y#c#dB^#d;'S%y;'S;=`&_<%lO%yXBcV{WOr%ysv%yw#V%y#V#WBx#W;'S%y;'S;=`&_<%lO%yXB}V{WOr%ysv%yw#h%y#h#iCd#i;'S%y;'S;=`&_<%lO%yXCiV{WOr%ysv%yw#m%y#m#nDO#n;'S%y;'S;=`&_<%lO%yXDTV{WOr%ysv%yw#d%y#d#eDj#e;'S%y;'S;=`&_<%lO%yXDoV{WOr%ysv%yw#X%y#X#Y9i#Y;'S%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 Pe(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,Pe as xml,W as xmlLanguage}; diff --git a/assets/index-CADnrDq9.js b/assets/index-Byh6IrSk.js similarity index 94% rename from assets/index-CADnrDq9.js rename to assets/index-Byh6IrSk.js index 3e6bda6..271d48a 100644 --- a/assets/index-CADnrDq9.js +++ b/assets/index-Byh6IrSk.js @@ -1 +1 @@ -import{s as q,t as r,v as i,L as P,a as g,b as c,q as R,r as l,E as p}from"./MarkdownEditor-YN_nb091.js";import"./index-B3nH8WrL.js";import"./markdown-editor-Bo-wCvDQ.js";import"./utils-DE92Morm.js";import"./isAddressEqual-CYfaHVHF.js";import"./secp256k1-Jr9fFTYw.js";const b=1,$=33,m=34,v=35,x=36,W=new p(O=>{let t=O.pos;for(;;){if(O.next==10){O.advance();break}else if(O.next==123&&O.peek(1)==123||O.next<0)break;O.advance()}O.pos>t&&O.acceptToken(b)});function n(O,t,a){return new p(e=>{let u=e.pos;for(;e.next!=O&&e.next>=0&&(a||e.next!=38&&(e.next!=123||e.peek(1)!=123));)e.advance();e.pos>u&&e.acceptToken(t)})}const d=n(39,$,!1),C=n(34,m,!1),T=n(39,v,!0),f=n(34,x,!0),A=c.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<O.name=="InterpolationContent"?o:null)}),y=Q.configure({wrap:l((O,t)=>{var a;return O.name=="InterpolationContent"?o:O.name!="AttributeInterpolation"?null:((a=O.node.parent)===null||a===void 0?void 0:a.name)=="StatementAttributeValue"?w:o}),top:"Attribute"}),E={parser:U},N={parser:y},s=R();function S(O){return O.configure({wrap:l(z)},"angular")}const k=S(s.language);function z(O,t){switch(O.name){case"Attribute":return/^[*#(\[]|\{\{/.test(t.read(O.from,O.to))?N:null;case"Text":return E}return null}function j(O={}){let t=s;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof P))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new g(t.language==s.language?k:S(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/})])}export{j as angular,k as angularLanguage}; +import{s as q,t as r,v as i,L as P,a as g,b as c,q as R,r as l,E as p}from"./MarkdownEditor-CZAn4RGy.js";import"./index-CRY2WMkq.js";import"./markdown-editor-Bo-wCvDQ.js";import"./utils-DRp9lgY5.js";import"./isAddressEqual-C-mVTeCa.js";import"./secp256k1-B8dOsQyz.js";const b=1,$=33,m=34,v=35,x=36,W=new p(O=>{let t=O.pos;for(;;){if(O.next==10){O.advance();break}else if(O.next==123&&O.peek(1)==123||O.next<0)break;O.advance()}O.pos>t&&O.acceptToken(b)});function n(O,t,a){return new p(e=>{let u=e.pos;for(;e.next!=O&&e.next>=0&&(a||e.next!=38&&(e.next!=123||e.peek(1)!=123));)e.advance();e.pos>u&&e.acceptToken(t)})}const d=n(39,$,!1),C=n(34,m,!1),T=n(39,v,!0),f=n(34,x,!0),A=c.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<O.name=="InterpolationContent"?o:null)}),y=Q.configure({wrap:l((O,t)=>{var a;return O.name=="InterpolationContent"?o:O.name!="AttributeInterpolation"?null:((a=O.node.parent)===null||a===void 0?void 0:a.name)=="StatementAttributeValue"?w:o}),top:"Attribute"}),E={parser:U},N={parser:y},s=R();function S(O){return O.configure({wrap:l(z)},"angular")}const k=S(s.language);function z(O,t){switch(O.name){case"Attribute":return/^[*#(\[]|\{\{/.test(t.read(O.from,O.to))?N:null;case"Text":return E}return null}function j(O={}){let t=s;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof P))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new g(t.language==s.language?k:S(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/})])}export{j as angular,k as angularLanguage}; diff --git a/assets/index-TYE6PGSe.js b/assets/index-CD5LSkva.js similarity index 99% rename from assets/index-TYE6PGSe.js rename to assets/index-CD5LSkva.js index d310b18..f6cd37f 100644 --- a/assets/index-TYE6PGSe.js +++ b/assets/index-CD5LSkva.js @@ -1 +1 @@ -import{q as M,cx as sn,v as an}from"./index-B3nH8WrL.js";import{j as on,s as cn,r as _t,a as dn,b as ln}from"./hooks.module-CUxDSjbn.js";var Et={},te={},me={};Object.defineProperty(me,"__esModule",{value:!0});me.walletLogo=void 0;const un=(n,e)=>{let t;switch(n){case"standard":return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return t=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};me.walletLogo=un;var be={},j={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.errorValues=U.standardErrorCodes=void 0;U.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};U.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var ye={},$e={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.serialize=n.getErrorCode=n.isValidCode=n.getMessageFromCode=n.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=U,t="Unspecified error message.";n.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function r(d,p=t){if(d&&Number.isInteger(d)){const m=d.toString();if(h(e.errorValues,m))return e.errorValues[m].message;if(c(d))return n.JSON_RPC_SERVER_ERROR_MESSAGE}return p}n.getMessageFromCode=r;function s(d){if(!Number.isInteger(d))return!1;const p=d.toString();return!!(e.errorValues[p]||c(d))}n.isValidCode=s;function i(d){var p;if(typeof d=="number")return d;if(a(d))return(p=d.code)!==null&&p!==void 0?p:d.errorCode}n.getErrorCode=i;function a(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}function o(d,{shouldIncludeStack:p=!1}={}){const m={};if(d&&typeof d=="object"&&!Array.isArray(d)&&h(d,"code")&&s(d.code)){const B=d;m.code=B.code,B.message&&typeof B.message=="string"?(m.message=B.message,h(B,"data")&&(m.data=B.data)):(m.message=r(m.code),m.data={originalError:l(d)})}else m.code=e.standardErrorCodes.rpc.internal,m.message=f(d,"message")?d.message:t,m.data={originalError:l(d)};return p&&(m.stack=f(d,"stack")?d.stack:void 0),m}n.serialize=o;function c(d){return d>=-32099&&d<=-32e3}function l(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function h(d,p){return Object.prototype.hasOwnProperty.call(d,p)}function f(d,p){return typeof d=="object"&&d!==null&&p in d&&typeof d[p]=="string"}})($e);Object.defineProperty(ye,"__esModule",{value:!0});ye.standardErrors=void 0;const v=U,St=$e;ye.standardErrors={rpc:{parse:n=>C(v.standardErrorCodes.rpc.parse,n),invalidRequest:n=>C(v.standardErrorCodes.rpc.invalidRequest,n),invalidParams:n=>C(v.standardErrorCodes.rpc.invalidParams,n),methodNotFound:n=>C(v.standardErrorCodes.rpc.methodNotFound,n),internal:n=>C(v.standardErrorCodes.rpc.internal,n),server:n=>{if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=n;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return C(e,n)},invalidInput:n=>C(v.standardErrorCodes.rpc.invalidInput,n),resourceNotFound:n=>C(v.standardErrorCodes.rpc.resourceNotFound,n),resourceUnavailable:n=>C(v.standardErrorCodes.rpc.resourceUnavailable,n),transactionRejected:n=>C(v.standardErrorCodes.rpc.transactionRejected,n),methodNotSupported:n=>C(v.standardErrorCodes.rpc.methodNotSupported,n),limitExceeded:n=>C(v.standardErrorCodes.rpc.limitExceeded,n)},provider:{userRejectedRequest:n=>$(v.standardErrorCodes.provider.userRejectedRequest,n),unauthorized:n=>$(v.standardErrorCodes.provider.unauthorized,n),unsupportedMethod:n=>$(v.standardErrorCodes.provider.unsupportedMethod,n),disconnected:n=>$(v.standardErrorCodes.provider.disconnected,n),chainDisconnected:n=>$(v.standardErrorCodes.provider.chainDisconnected,n),unsupportedChain:n=>$(v.standardErrorCodes.provider.unsupportedChain,n),custom:n=>{if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:t,data:r}=n;if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string');return new It(e,t,r)}}};function C(n,e){const[t,r]=Ct(e);return new kt(n,t||(0,St.getMessageFromCode)(n),r)}function $(n,e){const[t,r]=Ct(e);return new It(n,t||(0,St.getMessageFromCode)(n),r)}function Ct(n){if(n){if(typeof n=="string")return[n];if(typeof n=="object"&&!Array.isArray(n)){const{message:e,data:t}=n;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,t]}}return[]}class kt extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string.');super(t),this.code=e,r!==void 0&&(this.data=r)}}class It extends kt{constructor(e,t,r){if(!hn(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function hn(n){return Number.isInteger(n)&&n>=1e3&&n<=4999}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.standardErrors=n.standardErrorCodes=void 0;var e=U;Object.defineProperty(n,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var t=ye;Object.defineProperty(n,"standardErrors",{enumerable:!0,get:function(){return t.standardErrors}})})(j);var we={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.isErrorResponse=void 0;function gn(n){return n.errorMessage!==void 0}Q.isErrorResponse=gn;var K={};Object.defineProperty(K,"__esModule",{value:!0});K.LIB_VERSION=void 0;K.LIB_VERSION="4.0.4";Object.defineProperty(we,"__esModule",{value:!0});we.serializeError=void 0;const pn=Q,fn=K,mn=U,bn=$e;function yn(n,e){const t=(0,bn.serialize)(wn(n),{shouldIncludeStack:!0}),r=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");r.searchParams.set("version",fn.LIB_VERSION),r.searchParams.set("code",t.code.toString());const s=vn(t.data,e);return s&&r.searchParams.set("method",s),r.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:r.href})}we.serializeError=yn;function wn(n){return typeof n=="string"?{message:n,code:mn.standardErrorCodes.rpc.internal}:(0,pn.isErrorResponse)(n)?Object.assign(Object.assign({},n),{message:n.errorMessage,code:n.errorCode,data:{method:n.method}}):n}function vn(n,e){const t=n==null?void 0:n.method;if(t)return t;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var _={};Object.defineProperty(_,"__esModule",{value:!0});_.RegExpString=_.IntNumber=_.BigIntString=_.AddressString=_.HexString=_.OpaqueType=void 0;function ne(){return n=>n}_.OpaqueType=ne;_.HexString=ne();_.AddressString=ne();_.BigIntString=ne();function _n(n){return Math.floor(n)}_.IntNumber=_n;_.RegExpString=ne();var u={};Object.defineProperty(u,"__esModule",{value:!0});u.areAddressArraysEqual=u.getFavicon=u.range=u.isBigNumber=u.ensureParsedJSONObject=u.ensureBigInt=u.ensureRegExpString=u.ensureIntNumber=u.ensureBuffer=u.ensureAddressString=u.ensureEvenLengthHexString=u.ensureHexString=u.isHexString=u.prepend0x=u.strip0x=u.has0xPrefix=u.hexStringFromIntNumber=u.intNumberFromHexString=u.bigIntStringFromBigInt=u.hexStringFromBuffer=u.hexStringToUint8Array=u.uint8ArrayToHex=u.randomBytesHex=void 0;const q=j,I=_,Mt=/^[0-9]*$/,Lt=/^[a-f0-9]*$/;function En(n){return At(crypto.getRandomValues(new Uint8Array(n)))}u.randomBytesHex=En;function At(n){return[...n].map(e=>e.toString(16).padStart(2,"0")).join("")}u.uint8ArrayToHex=At;function Sn(n){return new Uint8Array(n.match(/.{1,2}/g).map(e=>parseInt(e,16)))}u.hexStringToUint8Array=Sn;function Cn(n,e=!1){const t=n.toString("hex");return(0,I.HexString)(e?`0x${t}`:t)}u.hexStringFromBuffer=Cn;function kn(n){return(0,I.BigIntString)(n.toString(10))}u.bigIntStringFromBigInt=kn;function In(n){return(0,I.IntNumber)(Number(BigInt(se(n,!0))))}u.intNumberFromHexString=In;function Mn(n){return(0,I.HexString)(`0x${BigInt(n).toString(16)}`)}u.hexStringFromIntNumber=Mn;function Fe(n){return n.startsWith("0x")||n.startsWith("0X")}u.has0xPrefix=Fe;function ve(n){return Fe(n)?n.slice(2):n}u.strip0x=ve;function Rt(n){return Fe(n)?`0x${n.slice(2)}`:`0x${n}`}u.prepend0x=Rt;function re(n){if(typeof n!="string")return!1;const e=ve(n).toLowerCase();return Lt.test(e)}u.isHexString=re;function xt(n,e=!1){if(typeof n=="string"){const t=ve(n).toLowerCase();if(Lt.test(t))return(0,I.HexString)(e?`0x${t}`:t)}throw q.standardErrors.rpc.invalidParams(`"${String(n)}" is not a hexadecimal string`)}u.ensureHexString=xt;function se(n,e=!1){let t=xt(n,!1);return t.length%2===1&&(t=(0,I.HexString)(`0${t}`)),e?(0,I.HexString)(`0x${t}`):t}u.ensureEvenLengthHexString=se;function Ln(n){if(typeof n=="string"){const e=ve(n).toLowerCase();if(re(e)&&e.length===40)return(0,I.AddressString)(Rt(e))}throw q.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(n)}`)}u.ensureAddressString=Ln;function An(n){if(Buffer.isBuffer(n))return n;if(typeof n=="string"){if(re(n)){const e=se(n,!1);return Buffer.from(e,"hex")}return Buffer.from(n,"utf8")}throw q.standardErrors.rpc.invalidParams(`Not binary data: ${String(n)}`)}u.ensureBuffer=An;function Pt(n){if(typeof n=="number"&&Number.isInteger(n))return(0,I.IntNumber)(n);if(typeof n=="string"){if(Mt.test(n))return(0,I.IntNumber)(Number(n));if(re(n))return(0,I.IntNumber)(Number(BigInt(se(n,!0))))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(n)}`)}u.ensureIntNumber=Pt;function Rn(n){if(n instanceof RegExp)return(0,I.RegExpString)(n.toString());throw q.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(n)}`)}u.ensureRegExpString=Rn;function xn(n){if(n!==null&&(typeof n=="bigint"||Nt(n)))return BigInt(n.toString(10));if(typeof n=="number")return BigInt(Pt(n));if(typeof n=="string"){if(Mt.test(n))return BigInt(n);if(re(n))return BigInt(se(n,!0))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(n)}`)}u.ensureBigInt=xn;function Pn(n){if(typeof n=="string")return JSON.parse(n);if(typeof n=="object")return n;throw q.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(n)}`)}u.ensureParsedJSONObject=Pn;function Nt(n){if(n==null||typeof n.constructor!="function")return!1;const{constructor:e}=n;return typeof e.config=="function"&&typeof e.EUCLID=="number"}u.isBigNumber=Nt;function Nn(n,e){return Array.from({length:e-n},(t,r)=>n+r)}u.range=Nn;function Tn(){const n=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:t}=document.location,r=n?n.getAttribute("href"):null;return!r||r.startsWith("javascript:")||r.startsWith("vbscript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${t}${r}`}u.getFavicon=Tn;function jn(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}u.areAddressArraysEqual=jn;var P={},_e={},Ee={},y={};Object.defineProperty(y,"__esModule",{value:!0});y.decryptContent=y.encryptContent=y.importKeyFromHexString=y.exportKeyToHexString=y.decrypt=y.encrypt=y.deriveSharedSecret=y.generateKeyPair=void 0;const Tt=u;async function On(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}y.generateKeyPair=On;async function Dn(n,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}y.deriveSharedSecret=Dn;async function jt(n,e){const t=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},n,new TextEncoder().encode(e));return{iv:t,cipherText:r}}y.encrypt=jt;async function Ot(n,{iv:e,cipherText:t}){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},n,t);return new TextDecoder().decode(r)}y.decrypt=Ot;function Dt(n){switch(n){case"public":return"spki";case"private":return"pkcs8"}}async function Wn(n,e){const t=Dt(n),r=await crypto.subtle.exportKey(t,e);return(0,Tt.uint8ArrayToHex)(new Uint8Array(r))}y.exportKeyToHexString=Wn;async function Un(n,e){const t=Dt(n),r=(0,Tt.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(t,r,{name:"ECDH",namedCurve:"P-256"},!0,n==="private"?["deriveKey"]:[])}y.importKeyFromHexString=Un;async function Bn(n,e){const t=JSON.stringify(n,(r,s)=>{if(!(s instanceof Error))return s;const i=s;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return jt(e,t)}y.encryptContent=Bn;async function Hn(n,e){return JSON.parse(await Ot(e,n))}y.decryptContent=Hn;var O={};Object.defineProperty(O,"__esModule",{value:!0});O.ScopedLocalStorage=void 0;class fe{constructor(e,t){this.scope=e,this.module=t}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let r=0;rlocalStorage.removeItem(r))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new fe("CBWSDK").clear(),new fe("walletlink").clear()}}O.ScopedLocalStorage=fe;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.SCWKeyManager=void 0;const oe=y,Kn=O,De={storageKey:"ownPrivateKey",keyType:"private"},We={storageKey:"ownPublicKey",keyType:"public"},Ue={storageKey:"peerPublicKey",keyType:"public"};class qn{constructor(){this.storage=new Kn.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(Ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(We.storageKey),this.storage.removeItem(De.storageKey),this.storage.removeItem(Ue.storageKey)}async generateKeyPair(){const e=await(0,oe.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(De,e.privateKey),await this.storeKey(We,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(De)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(We)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(Ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,oe.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?(0,oe.importKeyFromHexString)(e.keyType,t):null}async storeKey(e,t){const r=await(0,oe.exportKeyToHexString)(e.keyType,t);this.storage.setItem(e.storageKey,r)}}Ee.SCWKeyManager=qn;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.SCWStateManager=void 0;const $n=O,Qe="accounts",Xe="activeChain",et="availableChains",tt="walletCapabilities";class Fn{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var t,r;this.storage=new $n.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(et),this._walletCapabilities=this.loadItemFromStorage(tt);const s=this.loadItemFromStorage(Qe),i=this.loadItemFromStorage(Xe);s&&this.updateListener.onAccountsUpdate({accounts:s,source:"storage"}),i&&this.updateListener.onChainUpdate({chain:i,source:"storage"}),this._accounts=s||[],this._activeChain=i||{id:(r=(t=e.appChainIds)===null||t===void 0?void 0:t[0])!==null&&r!==void 0?r:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(Qe,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var t;const r=(t=this.availableChains)===null||t===void 0?void 0:t.find(s=>s.id===e);return r?(r===this._activeChain||(this._activeChain=r,this.storeItemToStorage(Xe,r),this.updateListener.onChainUpdate({chain:r,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const t=Object.entries(e).map(([r,s])=>({id:Number(r),rpcUrl:s}));this.availableChains=t,this.storeItemToStorage(et,t),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(tt,e)}storeItemToStorage(e,t){this.storage.setItem(e,JSON.stringify(t))}loadItemFromStorage(e){const t=this.storage.getItem(e);return t?JSON.parse(t):void 0}clear(){this.storage.clear()}}Se.SCWStateManager=Fn;Object.defineProperty(_e,"__esModule",{value:!0});_e.SCWSigner=void 0;const zn=Ee,Vn=Se,ce=j,nt=u,de=y;class Zn{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new zn.SCWKeyManager,this.stateManager=new Vn.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),t=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in t.content)throw t.content.failure;const r=await(0,de.importKeyFromHexString)("public",t.sender);await this.keyManager.setPeerPublicKey(r);const s=await this.decryptResponseMessage(t);this.updateInternalState({method:"eth_requestAccounts"},s);const i=s.result;if("error"in i)throw i.error;return this.stateManager.accounts}async request(e){const t=this.tryLocalHandling(e);if(t!==void 0){if(t instanceof Error)throw t;return t}await this.communicator.waitForPopupLoaded();const r=await this.sendEncryptedRequest(e),s=await this.decryptResponseMessage(r);this.updateInternalState(e,s);const i=s.result;if("error"in i)throw i.error;return i.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var t;switch(e.method){case"wallet_switchEthereumChain":{const r=e.params;if(!r||!(!((t=r[0])===null||t===void 0)&&t.chainId))throw ce.standardErrors.rpc.invalidParams();const s=(0,nt.ensureIntNumber)(r[0].chainId);return this.stateManager.switchChain(s)?null:void 0}case"wallet_getCapabilities":{const r=this.stateManager.walletCapabilities;if(!r)throw ce.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return r}default:return}}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw ce.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const r=await(0,de.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},t),s=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(s)}async createRequestMessage(e){const t=await(0,de.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){const t=e.content;if("failure"in t)throw t.failure;const r=await this.keyManager.getSharedSecret();if(!r)throw ce.standardErrors.provider.unauthorized("Invalid session");return(0,de.decryptContent)(t.encrypted,r)}updateInternalState(e,t){var r,s;const i=(r=t.data)===null||r===void 0?void 0:r.chains;i&&this.stateManager.updateAvailableChains(i);const a=(s=t.data)===null||s===void 0?void 0:s.capabilities;a&&this.stateManager.updateWalletCapabilities(a);const o=t.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const c=o.value;this.stateManager.updateAccounts(c);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const c=e.params,l=(0,nt.ensureIntNumber)(c[0].chainId);this.stateManager.switchChain(l);break}}}}_e.SCWSigner=Zn;var Ce={};const Gn=on;function Wt(n){return Buffer.allocUnsafe(n).fill(0)}function Yn(n){return n.toString(2).length}function Ut(n,e){let t=n.toString(16);t.length%2!==0&&(t="0"+t);const r=t.match(/.{1,2}/g).map(s=>parseInt(s,16));for(;r.length"u")throw new Error("Not an array?");if(t=Ft(n),t!=="dynamic"&&t!==0&&e.length>t)throw new Error("Elements exceed array size: "+t);s=[],n=n.slice(0,n.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(i in e)s.push(R(n,e[i]));if(t==="dynamic"){var a=R("uint256",e.length);s.unshift(a)}return Buffer.concat(s)}else{if(n==="bytes")return e=new Buffer(e),s=Buffer.concat([R("uint256",e.length),e]),e.length%32!==0&&(s=Buffer.concat([s,E.zeros(32-e.length%32)])),s;if(n.startsWith("bytes")){if(t=G(n),t<1||t>32)throw new Error("Invalid bytes width: "+t);return E.setLengthRight(e,32)}else if(n.startsWith("uint")){if(t=G(n),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);r=H(e);const o=E.bitLengthFromBigInt(r);if(o>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+o);if(r<0)throw new Error("Supplied uint is negative");return E.bufferBEFromBigInt(r,32)}else if(n.startsWith("int")){if(t=G(n),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);r=H(e);const o=E.bitLengthFromBigInt(r);if(o>t)throw new Error("Supplied int exceeds width: "+t+" vs "+o);const c=E.twosFromBigInt(r,256);return E.bufferBEFromBigInt(c,32)}else if(n.startsWith("ufixed")){if(t=rt(n),r=H(e),r<0)throw new Error("Supplied ufixed is negative");return R("uint256",r*BigInt(2)**BigInt(t[1]))}else if(n.startsWith("fixed"))return t=rt(n),R("int256",H(e)*BigInt(2)**BigInt(t[1]))}throw new Error("Unsupported or invalid type: "+n)}function nr(n){return n==="string"||n==="bytes"||Ft(n)==="dynamic"}function rr(n){return n.lastIndexOf("]")===n.length-1}function sr(n,e){var t=[],r=[],s=32*n.length;for(var i in n){var a=$t(n[i]),o=e[i],c=R(a,o);nr(a)?(t.push(R("uint256",s)),r.push(c),s+=c.length):t.push(c)}return Buffer.concat(t.concat(r))}function zt(n,e){if(n.length!==e.length)throw new Error("Number of types are not matching the values");for(var t,r,s=[],i=0;i32)throw new Error("Invalid bytes width: "+t);s.push(E.setLengthRight(o,t))}else if(a.startsWith("uint")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);r=H(o);const c=E.bitLengthFromBigInt(r);if(c>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+c);s.push(E.bufferBEFromBigInt(r,t/8))}else if(a.startsWith("int")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);r=H(o);const c=E.bitLengthFromBigInt(r);if(c>t)throw new Error("Supplied int exceeds width: "+t+" vs "+c);const l=E.twosFromBigInt(r,t);s.push(E.bufferBEFromBigInt(l,t/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(s)}function ir(n,e){return E.keccak(zt(n,e))}var ar={rawEncode:sr,solidityPack:zt,soliditySHA3:ir};const A=qt,ee=ar,Vt={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Be={encodeData(n,e,t,r=!0){const s=["bytes32"],i=[this.hashType(n,t)];if(r){const a=(o,c,l)=>{if(t[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":A.keccak(this.encodeData(c,l,t,r))];if(l===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",A.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",A.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),f=l.map(d=>a(o,h,d));return["bytes32",A.keccak(ee.rawEncode(f.map(([d])=>d),f.map(([,d])=>d)))]}return[c,l]};for(const o of t[n]){const[c,l]=a(o.name,o.type,e[o.name]);s.push(c),i.push(l)}}else for(const a of t[n]){let o=e[a.name];if(o!==void 0)if(a.type==="bytes")s.push("bytes32"),o=A.keccak(o),i.push(o);else if(a.type==="string")s.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=A.keccak(o),i.push(o);else if(t[a.type]!==void 0)s.push("bytes32"),o=A.keccak(this.encodeData(a.type,o,t,r)),i.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(o)}}return ee.rawEncode(s,i)},encodeType(n,e){let t="",r=this.findTypeDependencies(n,e).filter(s=>s!==n);r=[n].concat(r.sort());for(const s of r){if(!e[s])throw new Error("No type definition specified: "+s);t+=s+"("+e[s].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return t},findTypeDependencies(n,e,t=[]){if(n=n.match(/^\w*/)[0],t.includes(n)||e[n]===void 0)return t;t.push(n);for(const r of e[n])for(const s of this.findTypeDependencies(r.type,e,t))!t.includes(s)&&t.push(s);return t},hashStruct(n,e,t,r=!0){return A.keccak(this.encodeData(n,e,t,r))},hashType(n,e){return A.keccak(this.encodeType(n,e))},sanitizeData(n){const e={};for(const t in Vt.properties)n[t]&&(e[t]=n[t]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(n,e=!0){const t=this.sanitizeData(n),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",t.domain,t.types,e)),t.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(t.primaryType,t.message,t.types,e)),A.keccak(Buffer.concat(r))}};var or={TYPED_MESSAGE_SCHEMA:Vt,TypedDataUtils:Be,hashForSignTypedDataLegacy:function(n){return cr(n.data)},hashForSignTypedData_v3:function(n){return Be.hash(n.data,!1)},hashForSignTypedData_v4:function(n){return Be.hash(n.data)}};function cr(n){const e=new Error("Expect argument to be non-empty array");if(typeof n!="object"||!n.length)throw e;const t=n.map(function(i){return i.type==="bytes"?A.toBuffer(i.value):i.value}),r=n.map(function(i){return i.type}),s=n.map(function(i){if(!i.name)throw e;return i.type+" "+i.name});return ee.soliditySHA3(["bytes32","bytes32"],[ee.soliditySHA3(new Array(n.length).fill("string"),s),ee.soliditySHA3(r,t)])}var N={};Object.defineProperty(N,"__esModule",{value:!0});N.APP_VERSION_KEY=N.LOCAL_STORAGE_ADDRESSES_KEY=N.WALLET_USER_NAME_KEY=void 0;N.WALLET_USER_NAME_KEY="walletUsername";N.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";N.APP_VERSION_KEY="AppVersion";var ie={};Object.defineProperty(ie,"__esModule",{value:!0});ie.RelayEventManager=void 0;const dr=u;class lr{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,dr.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}ie.RelayEventManager=lr;var Ie={},Me={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.WalletLinkCipher=void 0;const le=u;class ur{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},s,i.encode(e)),o=16,c=a.slice(a.byteLength-o),l=a.slice(0,a.byteLength-o),h=new Uint8Array(c),f=new Uint8Array(l),d=new Uint8Array([...r,...h,...f]);return(0,le.uint8ArrayToHex)(d)}async decrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");return new Promise((r,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,le.hexStringToUint8Array)(e),o=a.slice(0,12),c=a.slice(12,28),l=a.slice(28),h=new Uint8Array([...l,...c]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const d=await window.crypto.subtle.decrypt(f,i,h),p=new TextDecoder;r(p.decode(d))}catch(d){s(d)}})()})}}Le.WalletLinkCipher=ur;var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.WalletLinkHTTP=void 0;class hr{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;const s=`${t}:${r}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:r,error:s}=await t.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(e=r==null?void 0:r.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${t.status}`)}}Ae.WalletLinkHTTP=hr;var Y={};Object.defineProperty(Y,"__esModule",{value:!0});Y.WalletLinkWebSocket=Y.ConnectionState=void 0;var Z;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED"})(Z||(Y.ConnectionState=Z={}));class gr{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,t)=>{var r;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){t(i);return}(r=this.connectionStateListener)===null||r===void 0||r.call(this,Z.CONNECTING),s.onclose=i=>{var a;this.clearWebSocket(),t(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.DISCONNECTED)},s.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Z.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch{}}}sendData(e){const{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}Y.WalletLinkWebSocket=gr;Object.defineProperty(Me,"__esModule",{value:!0});Me.WalletLinkConnection=void 0;const st=N,pr=Le,fr=Ae,ue=Y,F=_,it=1e4,mr=6e4;class br{constructor({session:e,linkAPIUrl:t,listener:r,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,F.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",c=>a.JsonRpcUrl&&this.handleChainUpdated(c,a.JsonRpcUrl)]]).forEach((c,l)=>{const h=a[l];h!==void 0&&c(h)})},this.handleDestroyed=a=>{var o;a==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async a=>{var o;{const c=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.accountUpdated(c)}},this.handleMetadataUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.metadataUpdated(a,l)}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(st.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(st.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(a),h=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.chainUpdated(l,h)}},this.session=e,this.cipher=new pr.WalletLinkCipher(e.secret),this.listener=r;const i=new ue.WalletLinkWebSocket(`${t}/rpc`,s);i.setConnectionStateListener(async a=>{let o=!1;switch(a){case ue.ConnectionState.DISCONNECTED:if(!this.destroyed){const c=async()=>{await new Promise(l=>setTimeout(l,5e3)),this.destroyed||i.connect().catch(()=>{c()})};c()}break;case ue.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},it),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case ue.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),i.setIncomingDataListener(a=>{var o;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const c=a.type==="IsLinkedOK"?a.linked:void 0;this.linked=c||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((o=this.requestResolutions.get(a.id))===null||o===void 0||o(a))}),this.ws=i,this.http=new fr.WalletLinkHTTP(t,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t;this._connected=e,e&&((t=this.onceConnected)===null||t===void 0||t.call(this))}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&((t=this.onceLinked)===null||t===void 0||t.call(this)),(r=this.listener)===null||r===void 0||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if(!(e.type!=="Event"||e.event!=="Web3Response")){const r=await this.cipher.decrypt(e.data),s=JSON.parse(r);if(s.type!=="WEB3_RESPONSE")return;(t=this.listener)===null||t===void 0||t.handleWeb3ResponseMessage(s)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(t=>this.handleIncomingEvent(t))}async setSessionMetadata(e,t){const r={type:"SetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(r);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(e,t,r=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:s,callWebhook:r};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>it*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,t=mr){const r=e.id;this.sendData(e);let s;return Promise.race([new Promise((i,a)=>{s=window.setTimeout(()=>{a(new Error(`request ${r} timed out`))},t)}),new Promise(i=>{this.requestResolutions.set(r,a=>{clearTimeout(s),i(a),this.requestResolutions.delete(r)})})])}async authenticate(){const e={type:"HostSession",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if(t.type==="Fail")throw new Error(t.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Me.WalletLinkConnection=br;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.WalletLinkSession=void 0;const yr=cn,at=u,ot="session:id",ct="session:secret",dt="session:linked";class ze{constructor(e,t,r,s){this._storage=e,this._id=t||(0,at.randomBytesHex)(16),this._secret=r||(0,at.randomBytesHex)(32),this._key=new yr.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(e){const t=e.getItem(ot),r=e.getItem(dt),s=e.getItem(ct);return t&&s?new ze(e,t,s,r==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(ot,this._id),this._storage.setItem(ct,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(dt,this._linked?"1":"0")}}Re.WalletLinkSession=ze;var S={};Object.defineProperty(S,"__esModule",{value:!0});S.isDarkMode=S.isMobileWeb=S.getLocation=S.createQrUrl=void 0;function wr(n,e,t,r,s,i){const a=r?"parent-id":"id",o=new URLSearchParams({[a]:n,secret:e,server:t,v:s,chainId:i.toString()}).toString();return`${t}/#/link?${o}`}S.createQrUrl=wr;function vr(){try{return window.frameElement!==null}catch{return!1}}function _r(){try{return vr()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=_r;function Er(){var n;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((n=window==null?void 0:window.navigator)===null||n===void 0?void 0:n.userAgent)}S.isMobileWeb=Er;function Sr(){var n,e;return(e=(n=window==null?void 0:window.matchMedia)===null||n===void 0?void 0:n.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}S.isDarkMode=Sr;var xe={},ae={},Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Cr=M&&M.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ae,"__esModule",{value:!0});ae.injectCssReset=void 0;const kr=Cr(Ve);function Ir(){const n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(kr.default)),document.documentElement.appendChild(n)}ae.injectCssReset=Ir;var Ze={};function Zt(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;e{this.items.delete(m),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(n.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([p,m])=>(0,r.h)(n.SnackbarInstance,Object.assign({},m,{key:p}))))),this.root)}}n.Snackbar=l;const h=d=>(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,a.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},d.children));n.SnackbarContainer=h;const f=({autoExpand:d,message:p,menuItems:m})=>{const[B,tn]=(0,s.useState)(!0),[Oe,Je]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const L=[window.setTimeout(()=>{tn(!1)},1),window.setTimeout(()=>{Je(!0)},1e4)];return()=>{L.forEach(window.clearTimeout)}});const nn=()=>{Je(!Oe)};return(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance",B&&"-cbwsdk-snackbar-instance-hidden",Oe&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:nn},(0,r.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},p),(0,r.h)("div",{class:"-gear-container"},!Oe&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),m&&m.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},m.map((L,rn)=>(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:L.onClick,key:rn},(0,r.h)("svg",{width:L.svgWidth,height:L.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":L.defaultFillRule,"clip-rule":L.defaultClipRule,d:L.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item-info",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},L.info)))))};n.SnackbarInstance=f})(Ze);Object.defineProperty(xe,"__esModule",{value:!0});xe.WalletLinkRelayUI=void 0;const Lr=ae,Ar=Ze;class Rr{constructor(){this.attached=!1,this.snackbar=new Ar.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,(0,Lr.injectCssReset)()}showConnecting(e){let t;return e.isUnlinkedErrorState?t={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:t={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}xe.WalletLinkRelayUI=Rr;var Pe={},Ne={},Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Yt=M&&M.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.RedirectDialog=void 0;const xr=Yt(Gt),x=_t,Pr=ae,Nr=Ze,Tr=S,jr=Yt(Ye);class Or{constructor(){this.root=null,this.darkMode=(0,Tr.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,Pr.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,x.render)(null,this.root),e&&(0,x.render)((0,x.h)(Dr,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}Ne.RedirectDialog=Or;const Dr=({title:n,buttonText:e,darkMode:t,onButtonClick:r,onDismiss:s})=>{const i=t?"dark":"light";return(0,x.h)(Nr.SnackbarContainer,{darkMode:t},(0,x.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,x.h)("style",null,jr.default),(0,x.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,x.h)("div",{class:(0,xr.default)("-cbwsdk-redirect-dialog-box",i)},(0,x.h)("p",null,n),(0,x.h)("button",{onClick:r},e))))};var T={};Object.defineProperty(T,"__esModule",{value:!0});T.CBW_MOBILE_DEEPLINK_URL=T.WALLETLINK_URL=T.CB_KEYS_URL=void 0;T.CB_KEYS_URL="https://keys.coinbase.com/connect";T.WALLETLINK_URL="https://www.walletlink.org";T.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.WLMobileRelayUI=void 0;const Wr=Ne,Ur=S,Br=T;class Hr{constructor(){this.attached=!1,this.redirectDialog=new Wr.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL(Br.CBW_MOBILE_DEEPLINK_URL);t.searchParams.append("redirect_url",(0,Ur.getLocation)().href),e&&t.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}Pe.WLMobileRelayUI=Hr;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.WalletLinkRelay=void 0;const Kr=Me,qr=N,$r=ie,He=Re,z=Q,Fr=S,zr=xe,ut=Pe,Vr=j,b=u,Zr=O;class W{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,Fr.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(qr.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(i,a))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),W.accountRequestCallbackIds.size>0&&(Array.from(W.accountRequestCallbackIds.values()).forEach(a=>{const o={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[i]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:a}))}),W.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:t,ui:r,connection:s}=this.subscribe();this._session=t,this.connection=s,this.relayEventManager=new $r.RelayEventManager,this.ui=r}subscribe(){const e=He.WalletLinkSession.load(this.storage)||new He.WalletLinkSession(this.storage).save(),{linkAPIUrl:t}=this,r=new Kr.WalletLinkConnection({session:e,linkAPIUrl:t,listener:this}),s=this.isMobileWeb?new ut.WLMobileRelayUI:new zr.WalletLinkRelayUI;return r.connect(),{session:e,ui:s,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=He.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&Zr.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,r,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(e,t,r){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),signature:(0,b.hexStringFromBuffer)(t,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,b.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const r=(0,b.randomBytesHex)(8),s=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,i),t==null||t()};return new Promise((i,a)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,o=>{if(t==null||t(),(0,z.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(r,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,t){const r={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",r,!0).then(s=>{}).catch(s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r.id,response:{method:t.method,errorMessage:s.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof ut.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e){const{response:t}=e;if(t.method==="requestEthereumAccounts"){W.accountRequestCallbackIds.forEach(r=>this.invokeCallback(Object.assign(Object.assign({},e),{id:r}))),W.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,r){var s;const i=(s=r==null?void 0:r.message)!==null&&s!==void 0?s:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:i}})}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,b.randomBytesHex)(8);return new Promise((r,s)=>{this.relayEventManager.callbacks.set(t,i=>{if((0,z.isErrorResponse)(i))return s(new Error(i.errorMessage));r(i)}),W.accountRequestCallbackIds.add(t),this.publishWeb3RequestEvent(t,e)})}watchAsset(e,t,r,s,i,a){const o={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:s,image:i},chainId:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,z.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}addEthereumChain(e,t,r,s,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:i,iconUrls:r,nativeCurrency:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,z.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}switchEthereumChain(e,t){const r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},s=(0,b.randomBytesHex)(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(s,o=>{if((0,z.isErrorResponse)(o)&&o.errorCode)return a(Vr.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,z.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,r)})}}Ie.WalletLinkRelay=W;W.accountRequestCallbackIds=new Set;var Gr=M&&M.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.WalletLinkSigner=void 0;const Ke=Gr(or),ht=N,Yr=ie,D=Q,Jr=Ie,gt=T,w=j,g=u,Qr=O,qe="DefaultChainId",pt="DefaultJsonRpcUrl";class Xr{constructor(e){var t,r;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:s,appLogoUrl:i}=e.metadata;this._appName=s,this._appLogoUrl=i,this._storage=new Qr.ScopedLocalStorage("walletlink",gt.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new Yr.RelayEventManager,this._jsonRpcUrlFromOpts="";const a=this._storage.getItem(ht.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(l=>(0,g.ensureAddressString)(l)),(t=this.updateListener)===null||t===void 0||t.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(qe)&&((r=this.updateListener)===null||r===void 0||r.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:r}=e.getWalletLinkSession();return{id:t,secret:r}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(pt))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(pt,e)}updateProviderInfo(e,t){var r;this.jsonRpcUrl=e;const s=this.getChainId();this._storage.setItem(qe,t.toString(10)),((0,g.ensureIntNumber)(t)!==s||!this.hasMadeFirstChainChangedEmission)&&((r=this.updateListener)===null||r===void 0||r.onChainUpdate({chain:{id:t,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,s,i,a){const c=await this.initializeRelay().watchAsset(e,t,r,s,i,a==null?void 0:a.toString());return(0,D.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(e,t,r,s,i,a){var o,c;if((0,g.ensureIntNumber)(e)===this.getChainId())return!1;const l=this.initializeRelay();this._isAuthorized()||await l.requestEthereumAccounts();const h=await l.addEthereumChain(e.toString(),t,i,r,s,a);return(0,D.isErrorResponse)(h)?!1:(((o=h.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(e){const r=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,D.isErrorResponse)(r)){if(!r.errorCode)return;throw r.errorCode===w.standardErrorCodes.provider.unsupportedChain?w.standardErrors.provider.unsupportedChain():w.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode})}const s=r.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(t=>{throw t})}catch(t){return Promise.reject(t)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw w.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:r}=e;if(typeof t!="string"||t.length===0)throw w.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw w.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const s=r===void 0?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:s,jsonrpc:"2.0",id:i})).result}_setAddresses(e,t){var r;if(!Array.isArray(e))throw new Error("addresses is not an array");const s=e.map(i=>(0,g.ensureAddressString)(i));JSON.stringify(s)!==JSON.stringify(this._addresses)&&(this._addresses=s,(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:s,source:"wallet"}),this._storage.setItem(ht.LOCAL_STORAGE_ADDRESSES_KEY,s.join(" ")))}_sendRequestAsync(e){return new Promise((t,r)=>{try{const s=this._handleSynchronousMethods(e);if(s!==void 0)return t({jsonrpc:"2.0",id:e.id,result:s})}catch(s){return r(s)}this._handleAsynchronousMethods(e).then(s=>s&&t(Object.assign(Object.assign({},s),{id:e.id}))).catch(s=>r(s))})}_handleSynchronousMethods(e){const{method:t}=e;switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,r=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(r);case"eth_ecRecover":return this._eth_ecRecover(r);case"personal_sign":return this._personal_sign(r);case"personal_ecRecover":return this._personal_ecRecover(r);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(r);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(r);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(r);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(r);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(r);case"wallet_watchAsset":return this._wallet_watchAsset(r);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const t=(0,g.ensureAddressString)(e);return this._addresses.map(s=>(0,g.ensureAddressString)(s)).includes(t)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,g.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);const r=e.to?(0,g.ensureAddressString)(e.to):null,s=e.value!=null?(0,g.ensureBigInt)(e.value):BigInt(0),i=e.data?(0,g.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,g.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,g.ensureBigInt)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,g.ensureBigInt)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,g.ensureBigInt)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,g.ensureBigInt)(e.gas):null,f=e.chainId?(0,g.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:t,toAddress:r,weiValue:s,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw w.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw w.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,s){this._ensureKnownAddress(t);try{const a=await this.initializeRelay().signEthereumMessage(e,t,r,s);if((0,D.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(e,t,r){const i=await this.initializeRelay().ethereumAddressFromSignedMessage(e,t,r);if((0,D.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,g.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(qe);if(!e)return(0,g.ensureIntNumber)(1);const t=parseInt(e,10);return(0,g.ensureIntNumber)(t)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,D.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(t){throw typeof t.message=="string"&&t.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied account authorization"):t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),r=(0,g.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),r=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,g.ensureBuffer)(e[0]),r=(0,g.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),r=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_sendRawTransaction(e){const t=(0,g.ensureBuffer)(e[0]),s=await this.initializeRelay().submitEthereumTransaction(t,this.getChainId());if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signAndSubmitEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,g.ensureParsedJSONObject)(e[0]),r=(0,g.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const s=Ke.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(s,r,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),r=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),r=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,i)}async _wallet_addEthereumChain(e){var t,r,s,i;const a=e[0];if(((t=a.rpcUrls)===null||t===void 0?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw w.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw w.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(r=a.rpcUrls)!==null&&r!==void 0?r:[],(s=a.blockExplorerUrls)!==null&&s!==void 0?s:[],a.chainName,(i=a.iconUrls)!==null&&i!==void 0?i:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw w.standardErrors.rpc.invalidParams("Type is required");if((t==null?void 0:t.type)!=="ERC20")throw w.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(t!=null&&t.options))throw w.standardErrors.rpc.invalidParams("Options are required");if(!(t!=null&&t.options.address))throw w.standardErrors.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:s,symbol:i,image:a,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,s,i,o,a,r)}}initializeRelay(){if(!this._relay){const e=new Jr.WalletLinkRelay({linkAPIUrl:gt.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((t,r)=>this._setAddresses(t,r)),e.setChainCallback((t,r)=>{this.updateProviderInfo(r,parseInt(t,10))}),this._relay=e}return this._relay}}Ce.WalletLinkSigner=Xr;var k={};Object.defineProperty(k,"__esModule",{value:!0});k.checkErrorForInvalidRequestArgs=k.getCoinbaseInjectedProvider=k.getCoinbaseInjectedSigner=k.fetchRPCRequest=void 0;const es=K,pe=j;async function ts(n,e){if(!e.rpcUrl)throw pe.standardErrors.rpc.internal("No RPC URL set for chain");const t=Object.assign(Object.assign({},n),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":es.LIB_VERSION}})).json()).result}k.fetchRPCRequest=ts;function Jt(){return globalThis.coinbaseWalletSigner}k.getCoinbaseInjectedSigner=Jt;function ns(){return globalThis.coinbaseWalletExtension}function rs(){var n,e;try{const t=globalThis;return(n=t.ethereum)!==null&&n!==void 0?n:(e=t.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function ss({metadata:n,preference:e}){var t;if(e.options!=="smartWalletOnly"){if(Jt())return;const i=ns();if(i){const{appName:a,appLogoUrl:o,appChainIds:c}=n;return(t=i.setAppInfo)===null||t===void 0||t.call(i,a,o,c),i}}const r=rs();if(r!=null&&r.isCoinbaseBrowser)return r}k.getCoinbaseInjectedProvider=ss;function is(n){if(!n||typeof n!="object"||Array.isArray(n))return pe.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:n});const{method:e,params:t}=n;if(typeof e!="string"||e.length===0)return pe.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:n});if(t!==void 0&&!Array.isArray(t)&&(typeof t!="object"||t===null))return pe.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:n})}k.checkErrorForInvalidRequestArgs=is;Object.defineProperty(P,"__esModule",{value:!0});P.createSigner=P.fetchSignerType=P.storeSignerType=P.loadSignerType=void 0;const as=_e,Qt=Ce,os=j,cs=k,ds=O,Xt="SignerType",en=new ds.ScopedLocalStorage("CBWSDK","SignerConfigurator");function ls(){return en.getItem(Xt)}P.loadSignerType=ls;function us(n){en.setItem(Xt,n)}P.storeSignerType=us;async function hs(n){const{communicator:e,metadata:t}=n;ps(e,t).catch(()=>{});const r={id:crypto.randomUUID(),event:"selectSignerType",data:n.preference},{data:s}=await e.postRequestAndWaitForResponse(r);return s}P.fetchSignerType=hs;function gs(n){const{signerType:e,metadata:t,communicator:r,updateListener:s}=n;switch(e){case"scw":return new as.SCWSigner({metadata:t,updateListener:s,communicator:r});case"walletlink":return new Qt.WalletLinkSigner({metadata:t,updateListener:s});case"extension":{const i=(0,cs.getCoinbaseInjectedSigner)();if(!i)throw os.standardErrors.rpc.internal("injected signer not found");return i}}}P.createSigner=gs;async function ps(n,e){await n.onMessage(({event:r})=>r==="WalletLinkSessionRequest");const t=new Qt.WalletLinkSigner({metadata:e});n.postMessage({event:"WalletLinkUpdate",data:{session:t.getSession()}}),await t.handshake(),n.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var Te={},J={};Object.defineProperty(J,"__esModule",{value:!0});J.closePopup=J.openPopup=void 0;const fs=j,ft=420,mt=540;function ms(n){const e=(window.innerWidth-ft)/2+window.screenX,t=(window.innerHeight-mt)/2+window.screenY,r=window.open(n,"Smart Wallet",`width=${ft}, height=${mt}, left=${e}, top=${t}`);if(r==null||r.focus(),!r)throw fs.standardErrors.rpc.internal("Pop up window failed to open");return r}J.openPopup=ms;function bs(n){n&&!n.closed&&n.close()}J.closePopup=bs;Object.defineProperty(Te,"__esModule",{value:!0});Te.Communicator=void 0;const ys=K,bt=J,ws=T,yt=j;class vs{constructor(e=ws.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async t=>{(await this.waitForPopupLoaded()).postMessage(t,this.url.origin)},this.postRequestAndWaitForResponse=async t=>{const r=this.onMessage(({requestId:s})=>s===t.id);return this.postMessage(t),await r},this.onMessage=async t=>new Promise((r,s)=>{const i=a=>{if(a.origin!==this.url.origin)return;const o=a.data;t(o)&&(r(o),window.removeEventListener("message",i),this.listeners.delete(i))};window.addEventListener("message",i),this.listeners.set(i,{reject:s})}),this.disconnect=()=>{(0,bt.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:t},r)=>{t(yt.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",r)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=(0,bt.openPopup)(this.url),this.onMessage(({event:t})=>t==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:t})=>t==="PopupLoaded").then(t=>{this.postMessage({requestId:t.id,data:{version:ys.LIB_VERSION}})}).then(()=>{if(!this.popup)throw yt.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}Te.Communicator=vs;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.determineMethodCategory=void 0;const wt={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function _s(n){for(const e in wt){const t=e;if(wt[t].includes(n))return t}}je.determineMethodCategory=_s;var Es=M&&M.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s{try{if(this.connected)return this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),this.accounts;const h=await this.requestSignerSelection(),f=this.initSigner(h),d=await f.handshake();return this.signer=f,(0,ge.storeSignerType)(h),this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),d}catch(h){throw this.handleUnauthorizedError(h),h}},sign:async l=>{if(!this.connected||!this.signer)throw V.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(l)}catch(h){throw this.handleUnauthorizedError(h),h}},fetch:l=>(0,vt.fetchRPCRequest)(l,this.chain),state:l=>{const h=()=>{if(this.connected)return this.accounts;throw V.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(l.method){case"eth_chainId":return(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return h();case"eth_coinbase":return h()[0];default:return this.handlers.unsupported(l)}},deprecated:({method:l})=>{throw V.standardErrors.rpc.methodNotSupported(`Method ${l} is deprecated.`)},unsupported:({method:l})=>{throw V.standardErrors.rpc.methodNotSupported(`Method ${l} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:l,source:h})=>{(0,X.areAddressArraysEqual)(this.accounts,l)||(this.accounts=l,h!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:l,source:h})=>{l.id===this.chain.id&&l.rpcUrl===this.chain.rpcUrl||(this.chain=l,h!=="storage"&&this.emit("chainChanged",(0,X.hexStringFromIntNumber)((0,he.IntNumber)(l.id))))}},this.metadata=s,this.preference=o,this.communicator=new Is.Communicator(a),this.chain={id:(r=(t=s.appChainIds)===null||t===void 0?void 0:t[0])!==null&&r!==void 0?r:1};const c=(0,ge.loadSignerType)();this.signer=c?this.initSigner(c):null}get connected(){return this.accounts.length>0}async request(e){var t;try{const r=(0,vt.checkErrorForInvalidRequestArgs)(e);if(r)throw r;const s=(t=(0,Ms.determineMethodCategory)(e.method))!==null&&t!==void 0?t:"fetch";return this.handlers[s](e)}catch(r){return Promise.reject((0,ks.serializeError)(r,e.method))}}handleUnauthorizedError(e){e.code===V.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},Ls.ScopedLocalStorage.clearAll(),this.emit("disconnect",V.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,ge.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,ge.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}be.CoinbaseWalletProvider=As;Object.defineProperty(te,"__esModule",{value:!0});te.CoinbaseWalletSDK=void 0;const Rs=me,xs=be,Ps=O,Ns=K,Ts=u,js=k;class Os{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,Ts.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var t;const r={metadata:this.metadata,preference:e};return(t=(0,js.getCoinbaseInjectedProvider)(r))!==null&&t!==void 0?t:new xs.CoinbaseWalletProvider(r)}getCoinbaseWalletLogo(e,t=240){return(0,Rs.walletLogo)(e,t)}storeLatestVersion(){new Ps.ScopedLocalStorage("CBWSDK").setItem("VERSION",Ns.LIB_VERSION)}}te.CoinbaseWalletSDK=Os;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CoinbaseWalletSDK=void 0;const e=te;n.default=e.CoinbaseWalletSDK;var t=te;Object.defineProperty(n,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}})})(Et);const Ds=an(Et),Bs=Object.freeze(Object.defineProperty({__proto__:null,default:Ds},Symbol.toStringTag,{value:"Module"}));export{Bs as i}; +import{q as M,cx as sn,v as an}from"./index-CRY2WMkq.js";import{j as on,s as cn,r as _t,a as dn,b as ln}from"./hooks.module-S7jQP2mz.js";var Et={},te={},me={};Object.defineProperty(me,"__esModule",{value:!0});me.walletLogo=void 0;const un=(n,e)=>{let t;switch(n){case"standard":return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return t=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};me.walletLogo=un;var be={},j={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.errorValues=U.standardErrorCodes=void 0;U.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};U.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var ye={},$e={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.serialize=n.getErrorCode=n.isValidCode=n.getMessageFromCode=n.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=U,t="Unspecified error message.";n.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function r(d,p=t){if(d&&Number.isInteger(d)){const m=d.toString();if(h(e.errorValues,m))return e.errorValues[m].message;if(c(d))return n.JSON_RPC_SERVER_ERROR_MESSAGE}return p}n.getMessageFromCode=r;function s(d){if(!Number.isInteger(d))return!1;const p=d.toString();return!!(e.errorValues[p]||c(d))}n.isValidCode=s;function i(d){var p;if(typeof d=="number")return d;if(a(d))return(p=d.code)!==null&&p!==void 0?p:d.errorCode}n.getErrorCode=i;function a(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}function o(d,{shouldIncludeStack:p=!1}={}){const m={};if(d&&typeof d=="object"&&!Array.isArray(d)&&h(d,"code")&&s(d.code)){const B=d;m.code=B.code,B.message&&typeof B.message=="string"?(m.message=B.message,h(B,"data")&&(m.data=B.data)):(m.message=r(m.code),m.data={originalError:l(d)})}else m.code=e.standardErrorCodes.rpc.internal,m.message=f(d,"message")?d.message:t,m.data={originalError:l(d)};return p&&(m.stack=f(d,"stack")?d.stack:void 0),m}n.serialize=o;function c(d){return d>=-32099&&d<=-32e3}function l(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function h(d,p){return Object.prototype.hasOwnProperty.call(d,p)}function f(d,p){return typeof d=="object"&&d!==null&&p in d&&typeof d[p]=="string"}})($e);Object.defineProperty(ye,"__esModule",{value:!0});ye.standardErrors=void 0;const v=U,St=$e;ye.standardErrors={rpc:{parse:n=>C(v.standardErrorCodes.rpc.parse,n),invalidRequest:n=>C(v.standardErrorCodes.rpc.invalidRequest,n),invalidParams:n=>C(v.standardErrorCodes.rpc.invalidParams,n),methodNotFound:n=>C(v.standardErrorCodes.rpc.methodNotFound,n),internal:n=>C(v.standardErrorCodes.rpc.internal,n),server:n=>{if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=n;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return C(e,n)},invalidInput:n=>C(v.standardErrorCodes.rpc.invalidInput,n),resourceNotFound:n=>C(v.standardErrorCodes.rpc.resourceNotFound,n),resourceUnavailable:n=>C(v.standardErrorCodes.rpc.resourceUnavailable,n),transactionRejected:n=>C(v.standardErrorCodes.rpc.transactionRejected,n),methodNotSupported:n=>C(v.standardErrorCodes.rpc.methodNotSupported,n),limitExceeded:n=>C(v.standardErrorCodes.rpc.limitExceeded,n)},provider:{userRejectedRequest:n=>$(v.standardErrorCodes.provider.userRejectedRequest,n),unauthorized:n=>$(v.standardErrorCodes.provider.unauthorized,n),unsupportedMethod:n=>$(v.standardErrorCodes.provider.unsupportedMethod,n),disconnected:n=>$(v.standardErrorCodes.provider.disconnected,n),chainDisconnected:n=>$(v.standardErrorCodes.provider.chainDisconnected,n),unsupportedChain:n=>$(v.standardErrorCodes.provider.unsupportedChain,n),custom:n=>{if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:t,data:r}=n;if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string');return new It(e,t,r)}}};function C(n,e){const[t,r]=Ct(e);return new kt(n,t||(0,St.getMessageFromCode)(n),r)}function $(n,e){const[t,r]=Ct(e);return new It(n,t||(0,St.getMessageFromCode)(n),r)}function Ct(n){if(n){if(typeof n=="string")return[n];if(typeof n=="object"&&!Array.isArray(n)){const{message:e,data:t}=n;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,t]}}return[]}class kt extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string.');super(t),this.code=e,r!==void 0&&(this.data=r)}}class It extends kt{constructor(e,t,r){if(!hn(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function hn(n){return Number.isInteger(n)&&n>=1e3&&n<=4999}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.standardErrors=n.standardErrorCodes=void 0;var e=U;Object.defineProperty(n,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var t=ye;Object.defineProperty(n,"standardErrors",{enumerable:!0,get:function(){return t.standardErrors}})})(j);var we={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.isErrorResponse=void 0;function gn(n){return n.errorMessage!==void 0}Q.isErrorResponse=gn;var K={};Object.defineProperty(K,"__esModule",{value:!0});K.LIB_VERSION=void 0;K.LIB_VERSION="4.0.4";Object.defineProperty(we,"__esModule",{value:!0});we.serializeError=void 0;const pn=Q,fn=K,mn=U,bn=$e;function yn(n,e){const t=(0,bn.serialize)(wn(n),{shouldIncludeStack:!0}),r=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");r.searchParams.set("version",fn.LIB_VERSION),r.searchParams.set("code",t.code.toString());const s=vn(t.data,e);return s&&r.searchParams.set("method",s),r.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:r.href})}we.serializeError=yn;function wn(n){return typeof n=="string"?{message:n,code:mn.standardErrorCodes.rpc.internal}:(0,pn.isErrorResponse)(n)?Object.assign(Object.assign({},n),{message:n.errorMessage,code:n.errorCode,data:{method:n.method}}):n}function vn(n,e){const t=n==null?void 0:n.method;if(t)return t;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var _={};Object.defineProperty(_,"__esModule",{value:!0});_.RegExpString=_.IntNumber=_.BigIntString=_.AddressString=_.HexString=_.OpaqueType=void 0;function ne(){return n=>n}_.OpaqueType=ne;_.HexString=ne();_.AddressString=ne();_.BigIntString=ne();function _n(n){return Math.floor(n)}_.IntNumber=_n;_.RegExpString=ne();var u={};Object.defineProperty(u,"__esModule",{value:!0});u.areAddressArraysEqual=u.getFavicon=u.range=u.isBigNumber=u.ensureParsedJSONObject=u.ensureBigInt=u.ensureRegExpString=u.ensureIntNumber=u.ensureBuffer=u.ensureAddressString=u.ensureEvenLengthHexString=u.ensureHexString=u.isHexString=u.prepend0x=u.strip0x=u.has0xPrefix=u.hexStringFromIntNumber=u.intNumberFromHexString=u.bigIntStringFromBigInt=u.hexStringFromBuffer=u.hexStringToUint8Array=u.uint8ArrayToHex=u.randomBytesHex=void 0;const q=j,I=_,Mt=/^[0-9]*$/,Lt=/^[a-f0-9]*$/;function En(n){return At(crypto.getRandomValues(new Uint8Array(n)))}u.randomBytesHex=En;function At(n){return[...n].map(e=>e.toString(16).padStart(2,"0")).join("")}u.uint8ArrayToHex=At;function Sn(n){return new Uint8Array(n.match(/.{1,2}/g).map(e=>parseInt(e,16)))}u.hexStringToUint8Array=Sn;function Cn(n,e=!1){const t=n.toString("hex");return(0,I.HexString)(e?`0x${t}`:t)}u.hexStringFromBuffer=Cn;function kn(n){return(0,I.BigIntString)(n.toString(10))}u.bigIntStringFromBigInt=kn;function In(n){return(0,I.IntNumber)(Number(BigInt(se(n,!0))))}u.intNumberFromHexString=In;function Mn(n){return(0,I.HexString)(`0x${BigInt(n).toString(16)}`)}u.hexStringFromIntNumber=Mn;function Fe(n){return n.startsWith("0x")||n.startsWith("0X")}u.has0xPrefix=Fe;function ve(n){return Fe(n)?n.slice(2):n}u.strip0x=ve;function Rt(n){return Fe(n)?`0x${n.slice(2)}`:`0x${n}`}u.prepend0x=Rt;function re(n){if(typeof n!="string")return!1;const e=ve(n).toLowerCase();return Lt.test(e)}u.isHexString=re;function xt(n,e=!1){if(typeof n=="string"){const t=ve(n).toLowerCase();if(Lt.test(t))return(0,I.HexString)(e?`0x${t}`:t)}throw q.standardErrors.rpc.invalidParams(`"${String(n)}" is not a hexadecimal string`)}u.ensureHexString=xt;function se(n,e=!1){let t=xt(n,!1);return t.length%2===1&&(t=(0,I.HexString)(`0${t}`)),e?(0,I.HexString)(`0x${t}`):t}u.ensureEvenLengthHexString=se;function Ln(n){if(typeof n=="string"){const e=ve(n).toLowerCase();if(re(e)&&e.length===40)return(0,I.AddressString)(Rt(e))}throw q.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(n)}`)}u.ensureAddressString=Ln;function An(n){if(Buffer.isBuffer(n))return n;if(typeof n=="string"){if(re(n)){const e=se(n,!1);return Buffer.from(e,"hex")}return Buffer.from(n,"utf8")}throw q.standardErrors.rpc.invalidParams(`Not binary data: ${String(n)}`)}u.ensureBuffer=An;function Pt(n){if(typeof n=="number"&&Number.isInteger(n))return(0,I.IntNumber)(n);if(typeof n=="string"){if(Mt.test(n))return(0,I.IntNumber)(Number(n));if(re(n))return(0,I.IntNumber)(Number(BigInt(se(n,!0))))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(n)}`)}u.ensureIntNumber=Pt;function Rn(n){if(n instanceof RegExp)return(0,I.RegExpString)(n.toString());throw q.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(n)}`)}u.ensureRegExpString=Rn;function xn(n){if(n!==null&&(typeof n=="bigint"||Nt(n)))return BigInt(n.toString(10));if(typeof n=="number")return BigInt(Pt(n));if(typeof n=="string"){if(Mt.test(n))return BigInt(n);if(re(n))return BigInt(se(n,!0))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(n)}`)}u.ensureBigInt=xn;function Pn(n){if(typeof n=="string")return JSON.parse(n);if(typeof n=="object")return n;throw q.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(n)}`)}u.ensureParsedJSONObject=Pn;function Nt(n){if(n==null||typeof n.constructor!="function")return!1;const{constructor:e}=n;return typeof e.config=="function"&&typeof e.EUCLID=="number"}u.isBigNumber=Nt;function Nn(n,e){return Array.from({length:e-n},(t,r)=>n+r)}u.range=Nn;function Tn(){const n=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:t}=document.location,r=n?n.getAttribute("href"):null;return!r||r.startsWith("javascript:")||r.startsWith("vbscript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${t}${r}`}u.getFavicon=Tn;function jn(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}u.areAddressArraysEqual=jn;var P={},_e={},Ee={},y={};Object.defineProperty(y,"__esModule",{value:!0});y.decryptContent=y.encryptContent=y.importKeyFromHexString=y.exportKeyToHexString=y.decrypt=y.encrypt=y.deriveSharedSecret=y.generateKeyPair=void 0;const Tt=u;async function On(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}y.generateKeyPair=On;async function Dn(n,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}y.deriveSharedSecret=Dn;async function jt(n,e){const t=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},n,new TextEncoder().encode(e));return{iv:t,cipherText:r}}y.encrypt=jt;async function Ot(n,{iv:e,cipherText:t}){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},n,t);return new TextDecoder().decode(r)}y.decrypt=Ot;function Dt(n){switch(n){case"public":return"spki";case"private":return"pkcs8"}}async function Wn(n,e){const t=Dt(n),r=await crypto.subtle.exportKey(t,e);return(0,Tt.uint8ArrayToHex)(new Uint8Array(r))}y.exportKeyToHexString=Wn;async function Un(n,e){const t=Dt(n),r=(0,Tt.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(t,r,{name:"ECDH",namedCurve:"P-256"},!0,n==="private"?["deriveKey"]:[])}y.importKeyFromHexString=Un;async function Bn(n,e){const t=JSON.stringify(n,(r,s)=>{if(!(s instanceof Error))return s;const i=s;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return jt(e,t)}y.encryptContent=Bn;async function Hn(n,e){return JSON.parse(await Ot(e,n))}y.decryptContent=Hn;var O={};Object.defineProperty(O,"__esModule",{value:!0});O.ScopedLocalStorage=void 0;class fe{constructor(e,t){this.scope=e,this.module=t}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let r=0;rlocalStorage.removeItem(r))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new fe("CBWSDK").clear(),new fe("walletlink").clear()}}O.ScopedLocalStorage=fe;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.SCWKeyManager=void 0;const oe=y,Kn=O,De={storageKey:"ownPrivateKey",keyType:"private"},We={storageKey:"ownPublicKey",keyType:"public"},Ue={storageKey:"peerPublicKey",keyType:"public"};class qn{constructor(){this.storage=new Kn.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(Ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(We.storageKey),this.storage.removeItem(De.storageKey),this.storage.removeItem(Ue.storageKey)}async generateKeyPair(){const e=await(0,oe.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(De,e.privateKey),await this.storeKey(We,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(De)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(We)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(Ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,oe.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?(0,oe.importKeyFromHexString)(e.keyType,t):null}async storeKey(e,t){const r=await(0,oe.exportKeyToHexString)(e.keyType,t);this.storage.setItem(e.storageKey,r)}}Ee.SCWKeyManager=qn;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.SCWStateManager=void 0;const $n=O,Qe="accounts",Xe="activeChain",et="availableChains",tt="walletCapabilities";class Fn{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var t,r;this.storage=new $n.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(et),this._walletCapabilities=this.loadItemFromStorage(tt);const s=this.loadItemFromStorage(Qe),i=this.loadItemFromStorage(Xe);s&&this.updateListener.onAccountsUpdate({accounts:s,source:"storage"}),i&&this.updateListener.onChainUpdate({chain:i,source:"storage"}),this._accounts=s||[],this._activeChain=i||{id:(r=(t=e.appChainIds)===null||t===void 0?void 0:t[0])!==null&&r!==void 0?r:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(Qe,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var t;const r=(t=this.availableChains)===null||t===void 0?void 0:t.find(s=>s.id===e);return r?(r===this._activeChain||(this._activeChain=r,this.storeItemToStorage(Xe,r),this.updateListener.onChainUpdate({chain:r,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const t=Object.entries(e).map(([r,s])=>({id:Number(r),rpcUrl:s}));this.availableChains=t,this.storeItemToStorage(et,t),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(tt,e)}storeItemToStorage(e,t){this.storage.setItem(e,JSON.stringify(t))}loadItemFromStorage(e){const t=this.storage.getItem(e);return t?JSON.parse(t):void 0}clear(){this.storage.clear()}}Se.SCWStateManager=Fn;Object.defineProperty(_e,"__esModule",{value:!0});_e.SCWSigner=void 0;const zn=Ee,Vn=Se,ce=j,nt=u,de=y;class Zn{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new zn.SCWKeyManager,this.stateManager=new Vn.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),t=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in t.content)throw t.content.failure;const r=await(0,de.importKeyFromHexString)("public",t.sender);await this.keyManager.setPeerPublicKey(r);const s=await this.decryptResponseMessage(t);this.updateInternalState({method:"eth_requestAccounts"},s);const i=s.result;if("error"in i)throw i.error;return this.stateManager.accounts}async request(e){const t=this.tryLocalHandling(e);if(t!==void 0){if(t instanceof Error)throw t;return t}await this.communicator.waitForPopupLoaded();const r=await this.sendEncryptedRequest(e),s=await this.decryptResponseMessage(r);this.updateInternalState(e,s);const i=s.result;if("error"in i)throw i.error;return i.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var t;switch(e.method){case"wallet_switchEthereumChain":{const r=e.params;if(!r||!(!((t=r[0])===null||t===void 0)&&t.chainId))throw ce.standardErrors.rpc.invalidParams();const s=(0,nt.ensureIntNumber)(r[0].chainId);return this.stateManager.switchChain(s)?null:void 0}case"wallet_getCapabilities":{const r=this.stateManager.walletCapabilities;if(!r)throw ce.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return r}default:return}}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw ce.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const r=await(0,de.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},t),s=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(s)}async createRequestMessage(e){const t=await(0,de.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){const t=e.content;if("failure"in t)throw t.failure;const r=await this.keyManager.getSharedSecret();if(!r)throw ce.standardErrors.provider.unauthorized("Invalid session");return(0,de.decryptContent)(t.encrypted,r)}updateInternalState(e,t){var r,s;const i=(r=t.data)===null||r===void 0?void 0:r.chains;i&&this.stateManager.updateAvailableChains(i);const a=(s=t.data)===null||s===void 0?void 0:s.capabilities;a&&this.stateManager.updateWalletCapabilities(a);const o=t.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const c=o.value;this.stateManager.updateAccounts(c);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const c=e.params,l=(0,nt.ensureIntNumber)(c[0].chainId);this.stateManager.switchChain(l);break}}}}_e.SCWSigner=Zn;var Ce={};const Gn=on;function Wt(n){return Buffer.allocUnsafe(n).fill(0)}function Yn(n){return n.toString(2).length}function Ut(n,e){let t=n.toString(16);t.length%2!==0&&(t="0"+t);const r=t.match(/.{1,2}/g).map(s=>parseInt(s,16));for(;r.length"u")throw new Error("Not an array?");if(t=Ft(n),t!=="dynamic"&&t!==0&&e.length>t)throw new Error("Elements exceed array size: "+t);s=[],n=n.slice(0,n.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(i in e)s.push(R(n,e[i]));if(t==="dynamic"){var a=R("uint256",e.length);s.unshift(a)}return Buffer.concat(s)}else{if(n==="bytes")return e=new Buffer(e),s=Buffer.concat([R("uint256",e.length),e]),e.length%32!==0&&(s=Buffer.concat([s,E.zeros(32-e.length%32)])),s;if(n.startsWith("bytes")){if(t=G(n),t<1||t>32)throw new Error("Invalid bytes width: "+t);return E.setLengthRight(e,32)}else if(n.startsWith("uint")){if(t=G(n),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);r=H(e);const o=E.bitLengthFromBigInt(r);if(o>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+o);if(r<0)throw new Error("Supplied uint is negative");return E.bufferBEFromBigInt(r,32)}else if(n.startsWith("int")){if(t=G(n),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);r=H(e);const o=E.bitLengthFromBigInt(r);if(o>t)throw new Error("Supplied int exceeds width: "+t+" vs "+o);const c=E.twosFromBigInt(r,256);return E.bufferBEFromBigInt(c,32)}else if(n.startsWith("ufixed")){if(t=rt(n),r=H(e),r<0)throw new Error("Supplied ufixed is negative");return R("uint256",r*BigInt(2)**BigInt(t[1]))}else if(n.startsWith("fixed"))return t=rt(n),R("int256",H(e)*BigInt(2)**BigInt(t[1]))}throw new Error("Unsupported or invalid type: "+n)}function nr(n){return n==="string"||n==="bytes"||Ft(n)==="dynamic"}function rr(n){return n.lastIndexOf("]")===n.length-1}function sr(n,e){var t=[],r=[],s=32*n.length;for(var i in n){var a=$t(n[i]),o=e[i],c=R(a,o);nr(a)?(t.push(R("uint256",s)),r.push(c),s+=c.length):t.push(c)}return Buffer.concat(t.concat(r))}function zt(n,e){if(n.length!==e.length)throw new Error("Number of types are not matching the values");for(var t,r,s=[],i=0;i32)throw new Error("Invalid bytes width: "+t);s.push(E.setLengthRight(o,t))}else if(a.startsWith("uint")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);r=H(o);const c=E.bitLengthFromBigInt(r);if(c>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+c);s.push(E.bufferBEFromBigInt(r,t/8))}else if(a.startsWith("int")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);r=H(o);const c=E.bitLengthFromBigInt(r);if(c>t)throw new Error("Supplied int exceeds width: "+t+" vs "+c);const l=E.twosFromBigInt(r,t);s.push(E.bufferBEFromBigInt(l,t/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(s)}function ir(n,e){return E.keccak(zt(n,e))}var ar={rawEncode:sr,solidityPack:zt,soliditySHA3:ir};const A=qt,ee=ar,Vt={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Be={encodeData(n,e,t,r=!0){const s=["bytes32"],i=[this.hashType(n,t)];if(r){const a=(o,c,l)=>{if(t[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":A.keccak(this.encodeData(c,l,t,r))];if(l===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",A.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",A.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),f=l.map(d=>a(o,h,d));return["bytes32",A.keccak(ee.rawEncode(f.map(([d])=>d),f.map(([,d])=>d)))]}return[c,l]};for(const o of t[n]){const[c,l]=a(o.name,o.type,e[o.name]);s.push(c),i.push(l)}}else for(const a of t[n]){let o=e[a.name];if(o!==void 0)if(a.type==="bytes")s.push("bytes32"),o=A.keccak(o),i.push(o);else if(a.type==="string")s.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=A.keccak(o),i.push(o);else if(t[a.type]!==void 0)s.push("bytes32"),o=A.keccak(this.encodeData(a.type,o,t,r)),i.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(o)}}return ee.rawEncode(s,i)},encodeType(n,e){let t="",r=this.findTypeDependencies(n,e).filter(s=>s!==n);r=[n].concat(r.sort());for(const s of r){if(!e[s])throw new Error("No type definition specified: "+s);t+=s+"("+e[s].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return t},findTypeDependencies(n,e,t=[]){if(n=n.match(/^\w*/)[0],t.includes(n)||e[n]===void 0)return t;t.push(n);for(const r of e[n])for(const s of this.findTypeDependencies(r.type,e,t))!t.includes(s)&&t.push(s);return t},hashStruct(n,e,t,r=!0){return A.keccak(this.encodeData(n,e,t,r))},hashType(n,e){return A.keccak(this.encodeType(n,e))},sanitizeData(n){const e={};for(const t in Vt.properties)n[t]&&(e[t]=n[t]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(n,e=!0){const t=this.sanitizeData(n),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",t.domain,t.types,e)),t.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(t.primaryType,t.message,t.types,e)),A.keccak(Buffer.concat(r))}};var or={TYPED_MESSAGE_SCHEMA:Vt,TypedDataUtils:Be,hashForSignTypedDataLegacy:function(n){return cr(n.data)},hashForSignTypedData_v3:function(n){return Be.hash(n.data,!1)},hashForSignTypedData_v4:function(n){return Be.hash(n.data)}};function cr(n){const e=new Error("Expect argument to be non-empty array");if(typeof n!="object"||!n.length)throw e;const t=n.map(function(i){return i.type==="bytes"?A.toBuffer(i.value):i.value}),r=n.map(function(i){return i.type}),s=n.map(function(i){if(!i.name)throw e;return i.type+" "+i.name});return ee.soliditySHA3(["bytes32","bytes32"],[ee.soliditySHA3(new Array(n.length).fill("string"),s),ee.soliditySHA3(r,t)])}var N={};Object.defineProperty(N,"__esModule",{value:!0});N.APP_VERSION_KEY=N.LOCAL_STORAGE_ADDRESSES_KEY=N.WALLET_USER_NAME_KEY=void 0;N.WALLET_USER_NAME_KEY="walletUsername";N.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";N.APP_VERSION_KEY="AppVersion";var ie={};Object.defineProperty(ie,"__esModule",{value:!0});ie.RelayEventManager=void 0;const dr=u;class lr{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,dr.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}ie.RelayEventManager=lr;var Ie={},Me={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.WalletLinkCipher=void 0;const le=u;class ur{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},s,i.encode(e)),o=16,c=a.slice(a.byteLength-o),l=a.slice(0,a.byteLength-o),h=new Uint8Array(c),f=new Uint8Array(l),d=new Uint8Array([...r,...h,...f]);return(0,le.uint8ArrayToHex)(d)}async decrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");return new Promise((r,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,le.hexStringToUint8Array)(e),o=a.slice(0,12),c=a.slice(12,28),l=a.slice(28),h=new Uint8Array([...l,...c]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const d=await window.crypto.subtle.decrypt(f,i,h),p=new TextDecoder;r(p.decode(d))}catch(d){s(d)}})()})}}Le.WalletLinkCipher=ur;var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.WalletLinkHTTP=void 0;class hr{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;const s=`${t}:${r}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:r,error:s}=await t.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(e=r==null?void 0:r.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${t.status}`)}}Ae.WalletLinkHTTP=hr;var Y={};Object.defineProperty(Y,"__esModule",{value:!0});Y.WalletLinkWebSocket=Y.ConnectionState=void 0;var Z;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED"})(Z||(Y.ConnectionState=Z={}));class gr{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,t)=>{var r;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){t(i);return}(r=this.connectionStateListener)===null||r===void 0||r.call(this,Z.CONNECTING),s.onclose=i=>{var a;this.clearWebSocket(),t(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.DISCONNECTED)},s.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Z.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch{}}}sendData(e){const{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}Y.WalletLinkWebSocket=gr;Object.defineProperty(Me,"__esModule",{value:!0});Me.WalletLinkConnection=void 0;const st=N,pr=Le,fr=Ae,ue=Y,F=_,it=1e4,mr=6e4;class br{constructor({session:e,linkAPIUrl:t,listener:r,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,F.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",c=>a.JsonRpcUrl&&this.handleChainUpdated(c,a.JsonRpcUrl)]]).forEach((c,l)=>{const h=a[l];h!==void 0&&c(h)})},this.handleDestroyed=a=>{var o;a==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async a=>{var o;{const c=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.accountUpdated(c)}},this.handleMetadataUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.metadataUpdated(a,l)}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(st.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(st.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(a),h=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.chainUpdated(l,h)}},this.session=e,this.cipher=new pr.WalletLinkCipher(e.secret),this.listener=r;const i=new ue.WalletLinkWebSocket(`${t}/rpc`,s);i.setConnectionStateListener(async a=>{let o=!1;switch(a){case ue.ConnectionState.DISCONNECTED:if(!this.destroyed){const c=async()=>{await new Promise(l=>setTimeout(l,5e3)),this.destroyed||i.connect().catch(()=>{c()})};c()}break;case ue.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},it),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case ue.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),i.setIncomingDataListener(a=>{var o;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const c=a.type==="IsLinkedOK"?a.linked:void 0;this.linked=c||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((o=this.requestResolutions.get(a.id))===null||o===void 0||o(a))}),this.ws=i,this.http=new fr.WalletLinkHTTP(t,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t;this._connected=e,e&&((t=this.onceConnected)===null||t===void 0||t.call(this))}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&((t=this.onceLinked)===null||t===void 0||t.call(this)),(r=this.listener)===null||r===void 0||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if(!(e.type!=="Event"||e.event!=="Web3Response")){const r=await this.cipher.decrypt(e.data),s=JSON.parse(r);if(s.type!=="WEB3_RESPONSE")return;(t=this.listener)===null||t===void 0||t.handleWeb3ResponseMessage(s)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(t=>this.handleIncomingEvent(t))}async setSessionMetadata(e,t){const r={type:"SetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(r);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(e,t,r=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:s,callWebhook:r};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>it*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,t=mr){const r=e.id;this.sendData(e);let s;return Promise.race([new Promise((i,a)=>{s=window.setTimeout(()=>{a(new Error(`request ${r} timed out`))},t)}),new Promise(i=>{this.requestResolutions.set(r,a=>{clearTimeout(s),i(a),this.requestResolutions.delete(r)})})])}async authenticate(){const e={type:"HostSession",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if(t.type==="Fail")throw new Error(t.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Me.WalletLinkConnection=br;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.WalletLinkSession=void 0;const yr=cn,at=u,ot="session:id",ct="session:secret",dt="session:linked";class ze{constructor(e,t,r,s){this._storage=e,this._id=t||(0,at.randomBytesHex)(16),this._secret=r||(0,at.randomBytesHex)(32),this._key=new yr.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(e){const t=e.getItem(ot),r=e.getItem(dt),s=e.getItem(ct);return t&&s?new ze(e,t,s,r==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(ot,this._id),this._storage.setItem(ct,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(dt,this._linked?"1":"0")}}Re.WalletLinkSession=ze;var S={};Object.defineProperty(S,"__esModule",{value:!0});S.isDarkMode=S.isMobileWeb=S.getLocation=S.createQrUrl=void 0;function wr(n,e,t,r,s,i){const a=r?"parent-id":"id",o=new URLSearchParams({[a]:n,secret:e,server:t,v:s,chainId:i.toString()}).toString();return`${t}/#/link?${o}`}S.createQrUrl=wr;function vr(){try{return window.frameElement!==null}catch{return!1}}function _r(){try{return vr()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=_r;function Er(){var n;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((n=window==null?void 0:window.navigator)===null||n===void 0?void 0:n.userAgent)}S.isMobileWeb=Er;function Sr(){var n,e;return(e=(n=window==null?void 0:window.matchMedia)===null||n===void 0?void 0:n.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}S.isDarkMode=Sr;var xe={},ae={},Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Cr=M&&M.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ae,"__esModule",{value:!0});ae.injectCssReset=void 0;const kr=Cr(Ve);function Ir(){const n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(kr.default)),document.documentElement.appendChild(n)}ae.injectCssReset=Ir;var Ze={};function Zt(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;e{this.items.delete(m),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(n.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([p,m])=>(0,r.h)(n.SnackbarInstance,Object.assign({},m,{key:p}))))),this.root)}}n.Snackbar=l;const h=d=>(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,a.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},d.children));n.SnackbarContainer=h;const f=({autoExpand:d,message:p,menuItems:m})=>{const[B,tn]=(0,s.useState)(!0),[Oe,Je]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const L=[window.setTimeout(()=>{tn(!1)},1),window.setTimeout(()=>{Je(!0)},1e4)];return()=>{L.forEach(window.clearTimeout)}});const nn=()=>{Je(!Oe)};return(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance",B&&"-cbwsdk-snackbar-instance-hidden",Oe&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:nn},(0,r.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},p),(0,r.h)("div",{class:"-gear-container"},!Oe&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),m&&m.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},m.map((L,rn)=>(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:L.onClick,key:rn},(0,r.h)("svg",{width:L.svgWidth,height:L.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":L.defaultFillRule,"clip-rule":L.defaultClipRule,d:L.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item-info",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},L.info)))))};n.SnackbarInstance=f})(Ze);Object.defineProperty(xe,"__esModule",{value:!0});xe.WalletLinkRelayUI=void 0;const Lr=ae,Ar=Ze;class Rr{constructor(){this.attached=!1,this.snackbar=new Ar.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,(0,Lr.injectCssReset)()}showConnecting(e){let t;return e.isUnlinkedErrorState?t={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:t={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}xe.WalletLinkRelayUI=Rr;var Pe={},Ne={},Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Yt=M&&M.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.RedirectDialog=void 0;const xr=Yt(Gt),x=_t,Pr=ae,Nr=Ze,Tr=S,jr=Yt(Ye);class Or{constructor(){this.root=null,this.darkMode=(0,Tr.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,Pr.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,x.render)(null,this.root),e&&(0,x.render)((0,x.h)(Dr,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}Ne.RedirectDialog=Or;const Dr=({title:n,buttonText:e,darkMode:t,onButtonClick:r,onDismiss:s})=>{const i=t?"dark":"light";return(0,x.h)(Nr.SnackbarContainer,{darkMode:t},(0,x.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,x.h)("style",null,jr.default),(0,x.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,x.h)("div",{class:(0,xr.default)("-cbwsdk-redirect-dialog-box",i)},(0,x.h)("p",null,n),(0,x.h)("button",{onClick:r},e))))};var T={};Object.defineProperty(T,"__esModule",{value:!0});T.CBW_MOBILE_DEEPLINK_URL=T.WALLETLINK_URL=T.CB_KEYS_URL=void 0;T.CB_KEYS_URL="https://keys.coinbase.com/connect";T.WALLETLINK_URL="https://www.walletlink.org";T.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.WLMobileRelayUI=void 0;const Wr=Ne,Ur=S,Br=T;class Hr{constructor(){this.attached=!1,this.redirectDialog=new Wr.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL(Br.CBW_MOBILE_DEEPLINK_URL);t.searchParams.append("redirect_url",(0,Ur.getLocation)().href),e&&t.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}Pe.WLMobileRelayUI=Hr;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.WalletLinkRelay=void 0;const Kr=Me,qr=N,$r=ie,He=Re,z=Q,Fr=S,zr=xe,ut=Pe,Vr=j,b=u,Zr=O;class W{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,Fr.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(qr.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(i,a))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),W.accountRequestCallbackIds.size>0&&(Array.from(W.accountRequestCallbackIds.values()).forEach(a=>{const o={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[i]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:a}))}),W.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:t,ui:r,connection:s}=this.subscribe();this._session=t,this.connection=s,this.relayEventManager=new $r.RelayEventManager,this.ui=r}subscribe(){const e=He.WalletLinkSession.load(this.storage)||new He.WalletLinkSession(this.storage).save(),{linkAPIUrl:t}=this,r=new Kr.WalletLinkConnection({session:e,linkAPIUrl:t,listener:this}),s=this.isMobileWeb?new ut.WLMobileRelayUI:new zr.WalletLinkRelayUI;return r.connect(),{session:e,ui:s,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=He.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&Zr.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,r,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(e,t,r){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),signature:(0,b.hexStringFromBuffer)(t,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,b.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const r=(0,b.randomBytesHex)(8),s=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,i),t==null||t()};return new Promise((i,a)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,o=>{if(t==null||t(),(0,z.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(r,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,t){const r={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",r,!0).then(s=>{}).catch(s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r.id,response:{method:t.method,errorMessage:s.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof ut.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e){const{response:t}=e;if(t.method==="requestEthereumAccounts"){W.accountRequestCallbackIds.forEach(r=>this.invokeCallback(Object.assign(Object.assign({},e),{id:r}))),W.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,r){var s;const i=(s=r==null?void 0:r.message)!==null&&s!==void 0?s:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:i}})}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,b.randomBytesHex)(8);return new Promise((r,s)=>{this.relayEventManager.callbacks.set(t,i=>{if((0,z.isErrorResponse)(i))return s(new Error(i.errorMessage));r(i)}),W.accountRequestCallbackIds.add(t),this.publishWeb3RequestEvent(t,e)})}watchAsset(e,t,r,s,i,a){const o={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:s,image:i},chainId:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,z.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}addEthereumChain(e,t,r,s,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:i,iconUrls:r,nativeCurrency:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,z.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}switchEthereumChain(e,t){const r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},s=(0,b.randomBytesHex)(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(s,o=>{if((0,z.isErrorResponse)(o)&&o.errorCode)return a(Vr.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,z.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,r)})}}Ie.WalletLinkRelay=W;W.accountRequestCallbackIds=new Set;var Gr=M&&M.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.WalletLinkSigner=void 0;const Ke=Gr(or),ht=N,Yr=ie,D=Q,Jr=Ie,gt=T,w=j,g=u,Qr=O,qe="DefaultChainId",pt="DefaultJsonRpcUrl";class Xr{constructor(e){var t,r;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:s,appLogoUrl:i}=e.metadata;this._appName=s,this._appLogoUrl=i,this._storage=new Qr.ScopedLocalStorage("walletlink",gt.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new Yr.RelayEventManager,this._jsonRpcUrlFromOpts="";const a=this._storage.getItem(ht.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(l=>(0,g.ensureAddressString)(l)),(t=this.updateListener)===null||t===void 0||t.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(qe)&&((r=this.updateListener)===null||r===void 0||r.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:r}=e.getWalletLinkSession();return{id:t,secret:r}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(pt))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(pt,e)}updateProviderInfo(e,t){var r;this.jsonRpcUrl=e;const s=this.getChainId();this._storage.setItem(qe,t.toString(10)),((0,g.ensureIntNumber)(t)!==s||!this.hasMadeFirstChainChangedEmission)&&((r=this.updateListener)===null||r===void 0||r.onChainUpdate({chain:{id:t,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,s,i,a){const c=await this.initializeRelay().watchAsset(e,t,r,s,i,a==null?void 0:a.toString());return(0,D.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(e,t,r,s,i,a){var o,c;if((0,g.ensureIntNumber)(e)===this.getChainId())return!1;const l=this.initializeRelay();this._isAuthorized()||await l.requestEthereumAccounts();const h=await l.addEthereumChain(e.toString(),t,i,r,s,a);return(0,D.isErrorResponse)(h)?!1:(((o=h.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(e){const r=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,D.isErrorResponse)(r)){if(!r.errorCode)return;throw r.errorCode===w.standardErrorCodes.provider.unsupportedChain?w.standardErrors.provider.unsupportedChain():w.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode})}const s=r.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(t=>{throw t})}catch(t){return Promise.reject(t)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw w.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:r}=e;if(typeof t!="string"||t.length===0)throw w.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw w.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const s=r===void 0?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:s,jsonrpc:"2.0",id:i})).result}_setAddresses(e,t){var r;if(!Array.isArray(e))throw new Error("addresses is not an array");const s=e.map(i=>(0,g.ensureAddressString)(i));JSON.stringify(s)!==JSON.stringify(this._addresses)&&(this._addresses=s,(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:s,source:"wallet"}),this._storage.setItem(ht.LOCAL_STORAGE_ADDRESSES_KEY,s.join(" ")))}_sendRequestAsync(e){return new Promise((t,r)=>{try{const s=this._handleSynchronousMethods(e);if(s!==void 0)return t({jsonrpc:"2.0",id:e.id,result:s})}catch(s){return r(s)}this._handleAsynchronousMethods(e).then(s=>s&&t(Object.assign(Object.assign({},s),{id:e.id}))).catch(s=>r(s))})}_handleSynchronousMethods(e){const{method:t}=e;switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,r=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(r);case"eth_ecRecover":return this._eth_ecRecover(r);case"personal_sign":return this._personal_sign(r);case"personal_ecRecover":return this._personal_ecRecover(r);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(r);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(r);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(r);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(r);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(r);case"wallet_watchAsset":return this._wallet_watchAsset(r);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const t=(0,g.ensureAddressString)(e);return this._addresses.map(s=>(0,g.ensureAddressString)(s)).includes(t)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,g.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);const r=e.to?(0,g.ensureAddressString)(e.to):null,s=e.value!=null?(0,g.ensureBigInt)(e.value):BigInt(0),i=e.data?(0,g.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,g.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,g.ensureBigInt)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,g.ensureBigInt)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,g.ensureBigInt)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,g.ensureBigInt)(e.gas):null,f=e.chainId?(0,g.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:t,toAddress:r,weiValue:s,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw w.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw w.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,s){this._ensureKnownAddress(t);try{const a=await this.initializeRelay().signEthereumMessage(e,t,r,s);if((0,D.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(e,t,r){const i=await this.initializeRelay().ethereumAddressFromSignedMessage(e,t,r);if((0,D.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,g.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(qe);if(!e)return(0,g.ensureIntNumber)(1);const t=parseInt(e,10);return(0,g.ensureIntNumber)(t)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,D.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(t){throw typeof t.message=="string"&&t.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied account authorization"):t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),r=(0,g.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),r=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,g.ensureBuffer)(e[0]),r=(0,g.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),r=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_sendRawTransaction(e){const t=(0,g.ensureBuffer)(e[0]),s=await this.initializeRelay().submitEthereumTransaction(t,this.getChainId());if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signAndSubmitEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,g.ensureParsedJSONObject)(e[0]),r=(0,g.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const s=Ke.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(s,r,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),r=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),r=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,i)}async _wallet_addEthereumChain(e){var t,r,s,i;const a=e[0];if(((t=a.rpcUrls)===null||t===void 0?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw w.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw w.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(r=a.rpcUrls)!==null&&r!==void 0?r:[],(s=a.blockExplorerUrls)!==null&&s!==void 0?s:[],a.chainName,(i=a.iconUrls)!==null&&i!==void 0?i:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw w.standardErrors.rpc.invalidParams("Type is required");if((t==null?void 0:t.type)!=="ERC20")throw w.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(t!=null&&t.options))throw w.standardErrors.rpc.invalidParams("Options are required");if(!(t!=null&&t.options.address))throw w.standardErrors.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:s,symbol:i,image:a,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,s,i,o,a,r)}}initializeRelay(){if(!this._relay){const e=new Jr.WalletLinkRelay({linkAPIUrl:gt.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((t,r)=>this._setAddresses(t,r)),e.setChainCallback((t,r)=>{this.updateProviderInfo(r,parseInt(t,10))}),this._relay=e}return this._relay}}Ce.WalletLinkSigner=Xr;var k={};Object.defineProperty(k,"__esModule",{value:!0});k.checkErrorForInvalidRequestArgs=k.getCoinbaseInjectedProvider=k.getCoinbaseInjectedSigner=k.fetchRPCRequest=void 0;const es=K,pe=j;async function ts(n,e){if(!e.rpcUrl)throw pe.standardErrors.rpc.internal("No RPC URL set for chain");const t=Object.assign(Object.assign({},n),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":es.LIB_VERSION}})).json()).result}k.fetchRPCRequest=ts;function Jt(){return globalThis.coinbaseWalletSigner}k.getCoinbaseInjectedSigner=Jt;function ns(){return globalThis.coinbaseWalletExtension}function rs(){var n,e;try{const t=globalThis;return(n=t.ethereum)!==null&&n!==void 0?n:(e=t.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function ss({metadata:n,preference:e}){var t;if(e.options!=="smartWalletOnly"){if(Jt())return;const i=ns();if(i){const{appName:a,appLogoUrl:o,appChainIds:c}=n;return(t=i.setAppInfo)===null||t===void 0||t.call(i,a,o,c),i}}const r=rs();if(r!=null&&r.isCoinbaseBrowser)return r}k.getCoinbaseInjectedProvider=ss;function is(n){if(!n||typeof n!="object"||Array.isArray(n))return pe.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:n});const{method:e,params:t}=n;if(typeof e!="string"||e.length===0)return pe.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:n});if(t!==void 0&&!Array.isArray(t)&&(typeof t!="object"||t===null))return pe.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:n})}k.checkErrorForInvalidRequestArgs=is;Object.defineProperty(P,"__esModule",{value:!0});P.createSigner=P.fetchSignerType=P.storeSignerType=P.loadSignerType=void 0;const as=_e,Qt=Ce,os=j,cs=k,ds=O,Xt="SignerType",en=new ds.ScopedLocalStorage("CBWSDK","SignerConfigurator");function ls(){return en.getItem(Xt)}P.loadSignerType=ls;function us(n){en.setItem(Xt,n)}P.storeSignerType=us;async function hs(n){const{communicator:e,metadata:t}=n;ps(e,t).catch(()=>{});const r={id:crypto.randomUUID(),event:"selectSignerType",data:n.preference},{data:s}=await e.postRequestAndWaitForResponse(r);return s}P.fetchSignerType=hs;function gs(n){const{signerType:e,metadata:t,communicator:r,updateListener:s}=n;switch(e){case"scw":return new as.SCWSigner({metadata:t,updateListener:s,communicator:r});case"walletlink":return new Qt.WalletLinkSigner({metadata:t,updateListener:s});case"extension":{const i=(0,cs.getCoinbaseInjectedSigner)();if(!i)throw os.standardErrors.rpc.internal("injected signer not found");return i}}}P.createSigner=gs;async function ps(n,e){await n.onMessage(({event:r})=>r==="WalletLinkSessionRequest");const t=new Qt.WalletLinkSigner({metadata:e});n.postMessage({event:"WalletLinkUpdate",data:{session:t.getSession()}}),await t.handshake(),n.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var Te={},J={};Object.defineProperty(J,"__esModule",{value:!0});J.closePopup=J.openPopup=void 0;const fs=j,ft=420,mt=540;function ms(n){const e=(window.innerWidth-ft)/2+window.screenX,t=(window.innerHeight-mt)/2+window.screenY,r=window.open(n,"Smart Wallet",`width=${ft}, height=${mt}, left=${e}, top=${t}`);if(r==null||r.focus(),!r)throw fs.standardErrors.rpc.internal("Pop up window failed to open");return r}J.openPopup=ms;function bs(n){n&&!n.closed&&n.close()}J.closePopup=bs;Object.defineProperty(Te,"__esModule",{value:!0});Te.Communicator=void 0;const ys=K,bt=J,ws=T,yt=j;class vs{constructor(e=ws.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async t=>{(await this.waitForPopupLoaded()).postMessage(t,this.url.origin)},this.postRequestAndWaitForResponse=async t=>{const r=this.onMessage(({requestId:s})=>s===t.id);return this.postMessage(t),await r},this.onMessage=async t=>new Promise((r,s)=>{const i=a=>{if(a.origin!==this.url.origin)return;const o=a.data;t(o)&&(r(o),window.removeEventListener("message",i),this.listeners.delete(i))};window.addEventListener("message",i),this.listeners.set(i,{reject:s})}),this.disconnect=()=>{(0,bt.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:t},r)=>{t(yt.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",r)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=(0,bt.openPopup)(this.url),this.onMessage(({event:t})=>t==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:t})=>t==="PopupLoaded").then(t=>{this.postMessage({requestId:t.id,data:{version:ys.LIB_VERSION}})}).then(()=>{if(!this.popup)throw yt.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}Te.Communicator=vs;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.determineMethodCategory=void 0;const wt={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function _s(n){for(const e in wt){const t=e;if(wt[t].includes(n))return t}}je.determineMethodCategory=_s;var Es=M&&M.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s{try{if(this.connected)return this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),this.accounts;const h=await this.requestSignerSelection(),f=this.initSigner(h),d=await f.handshake();return this.signer=f,(0,ge.storeSignerType)(h),this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),d}catch(h){throw this.handleUnauthorizedError(h),h}},sign:async l=>{if(!this.connected||!this.signer)throw V.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(l)}catch(h){throw this.handleUnauthorizedError(h),h}},fetch:l=>(0,vt.fetchRPCRequest)(l,this.chain),state:l=>{const h=()=>{if(this.connected)return this.accounts;throw V.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(l.method){case"eth_chainId":return(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return h();case"eth_coinbase":return h()[0];default:return this.handlers.unsupported(l)}},deprecated:({method:l})=>{throw V.standardErrors.rpc.methodNotSupported(`Method ${l} is deprecated.`)},unsupported:({method:l})=>{throw V.standardErrors.rpc.methodNotSupported(`Method ${l} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:l,source:h})=>{(0,X.areAddressArraysEqual)(this.accounts,l)||(this.accounts=l,h!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:l,source:h})=>{l.id===this.chain.id&&l.rpcUrl===this.chain.rpcUrl||(this.chain=l,h!=="storage"&&this.emit("chainChanged",(0,X.hexStringFromIntNumber)((0,he.IntNumber)(l.id))))}},this.metadata=s,this.preference=o,this.communicator=new Is.Communicator(a),this.chain={id:(r=(t=s.appChainIds)===null||t===void 0?void 0:t[0])!==null&&r!==void 0?r:1};const c=(0,ge.loadSignerType)();this.signer=c?this.initSigner(c):null}get connected(){return this.accounts.length>0}async request(e){var t;try{const r=(0,vt.checkErrorForInvalidRequestArgs)(e);if(r)throw r;const s=(t=(0,Ms.determineMethodCategory)(e.method))!==null&&t!==void 0?t:"fetch";return this.handlers[s](e)}catch(r){return Promise.reject((0,ks.serializeError)(r,e.method))}}handleUnauthorizedError(e){e.code===V.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},Ls.ScopedLocalStorage.clearAll(),this.emit("disconnect",V.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,ge.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,ge.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}be.CoinbaseWalletProvider=As;Object.defineProperty(te,"__esModule",{value:!0});te.CoinbaseWalletSDK=void 0;const Rs=me,xs=be,Ps=O,Ns=K,Ts=u,js=k;class Os{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,Ts.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var t;const r={metadata:this.metadata,preference:e};return(t=(0,js.getCoinbaseInjectedProvider)(r))!==null&&t!==void 0?t:new xs.CoinbaseWalletProvider(r)}getCoinbaseWalletLogo(e,t=240){return(0,Rs.walletLogo)(e,t)}storeLatestVersion(){new Ps.ScopedLocalStorage("CBWSDK").setItem("VERSION",Ns.LIB_VERSION)}}te.CoinbaseWalletSDK=Os;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CoinbaseWalletSDK=void 0;const e=te;n.default=e.CoinbaseWalletSDK;var t=te;Object.defineProperty(n,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}})})(Et);const Ds=an(Et),Bs=Object.freeze(Object.defineProperty({__proto__:null,default:Ds},Symbol.toStringTag,{value:"Module"}));export{Bs as i}; diff --git a/assets/index-LXQNhuCA.js b/assets/index-CLgfgwob.js similarity index 98% rename from assets/index-LXQNhuCA.js rename to assets/index-CLgfgwob.js index 4d58137..04fff19 100644 --- a/assets/index-LXQNhuCA.js +++ b/assets/index-CLgfgwob.js @@ -1 +1 @@ -import{o as W,p as u,L as T,s as b,t,i as y,j as v,f as k,a as _,b as R,g as Y,q as w,r as U,E as d}from"./MarkdownEditor-YN_nb091.js";import"./index-B3nH8WrL.js";import"./markdown-editor-Bo-wCvDQ.js";import"./utils-DE92Morm.js";import"./isAddressEqual-CYfaHVHF.js";import"./secp256k1-Jr9fFTYw.js";const G=1,X=2,S=3,z=180,j=4,h=181,Z=5,E=182;function x(O){return O>=65&&O<=90||O>=97&&O<=122}const V=new d(O=>{let a=O.pos;for(;;){let{next:e}=O;if(e<0)break;if(e==123){let r=O.peek(1);if(r==123){if(O.pos>a)break;O.acceptToken(G,2);return}else if(r==37){if(O.pos>a)break;let $=2,i=2;for(;;){let n=O.peek($);if(n==32||n==10)++$;else if(n==35)for(++$;;){let Q=O.peek($);if(Q<0||Q==10)break;$++}else if(n==45&&i==2)i=++$;else{let Q=n==101&&O.peek($+1)==110&&O.peek($+2)==100;O.acceptToken(Q?S:X,i);return}}}}if(O.advance(),e==10)break}O.pos>a&&O.acceptToken(z)});function f(O,a,e){return new d(r=>{let $=r.pos;for(;;){let{next:i}=r;if(i==123&&r.peek(1)==37){let n=2;for(;;n++){let l=r.peek(n);if(l!=32&&l!=10)break}let Q="";for(;;n++){let l=r.peek(n);if(!x(l))break;Q+=String.fromCharCode(l)}if(Q==O){if(r.pos>$)break;r.acceptToken(e,2);break}}else if(i<0)break;if(r.advance(),i==10)break}r.pos>$&&r.acceptToken(a)})}const F=f("endcomment",E,Z),D=f("endraw",h,j),N={__proto__:null,contains:32,or:36,and:36,true:50,false:50,empty:52,forloop:54,tablerowloop:56,continue:58,in:128,with:194,for:196,as:198,if:234,endif:238,unless:244,endunless:248,elsif:252,else:256,case:262,endcase:266,when:270,endfor:278,tablerow:284,endtablerow:288,break:292,cycle:298,echo:302,render:306,include:312,assign:316,capture:322,endcapture:326,increment:330,decrement:334},C={__proto__:null,if:82,endif:86,elsif:90,else:94,unless:100,endunless:104,case:110,endcase:114,when:118,for:126,endfor:136,tablerow:142,endtablerow:146,break:150,continue:154,cycle:158,comment:164,endcomment:170,raw:176,endraw:182,echo:186,render:190,include:202,assign:206,capture:212,endcapture:216,increment:220,decrement:224,liquid:228},I=R.deserialize({version:14,states:"GYQYOPOOOOOP'#F{'#F{OeOXO'#CdOsQWO'#CfO!bQ`O'#DQO#{OPO'#DTO$ZOPO'#D^O$iOPO'#DcO$wOPO'#DkO%VOPO'#DsO%eOSO'#EOO%jOQO'#EUO%oOPO'#EhOOOP'#G`'#G`OOOP'#G]'#G]OOOP'#Fz'#FzQYOPOOOOOP-E9y-E9yOOQO'#Cg'#CgO&`QpO,59QO&gQpO'#G^OsQWO'#CsOOQO'#G^'#G^OOOP,59l,59lO)PQWO,59lOsQWO,59pOsQWO,59tO)WQWO,59vOsQWO,59yOsQWO,5:OOsQWO,5:SO!]QWO,5:WO!]QWO,5:`O)]QWO,5:dO)bQWO,5:fO)gQWO,5:hO)lQWO,5:kO)qQWO,5:qOsQWO,5:vOsQWO,5:xOsQWO,5;OOsQWO,5;QOsQWO,5;TOsQWO,5;XOsQWO,5;ZO+QQWO,5;]O+XOPO'#CdOOOP,59o,59oO#{OPO,59oO+gQ`O'#DWOOOP,59x,59xO$ZOPO,59xO+lQ`O'#DaOOOP,59},59}O$iOPO,59}O+qQ`O'#DfOOOP,5:V,5:VO$wOPO,5:VO+vQ`O'#DqOOOP,5:_,5:_O%VOPO,5:_O+{Q`O'#DvOOOS'#GQ'#GQO,QOSO'#ERO,YOSO,5:jOOOQ'#GR'#GRO,_OQO'#EXO,gOQO,5:pOOOP,5;S,5;SO%oOPO,5;SO,lQ`O'#EkOOOP-E9x-E9xO,qQ!bO,59SOsQWO,59VOsQWO,59VO,vQWO'#C|OOQO'#F|'#F|O,{QWO1G.lOOOP1G.l1G.lOsQWO,59VOsQWO,59ZO-TQpO,59_O-fQpO1G/WOOOP1G/W1G/WO-wQpO1G/[O.YQpO1G/`OOOP1G/b1G/bO.kQpO1G/eO.|QpO1G/jO/pQpO1G/nO/wQWO1G/rO/|QWO1G/zOOOP1G0O1G0OOOOP1G0Q1G0QO0RQWO1G0SOOOS1G0V1G0VOOOQ1G0]1G0]O0^QpO1G0bO0eQpO1G0dO1PQpO1G0jO1bQpO1G0lO1sQpO1G0oO2UQpO1G0sO2gQpO1G0uO2xQWO'#EsO3PQWO'#ExO3WQWO'#FRO3_QWO'#FYO3fQWO'#F^O3mQWO'#FqOOQO'#Ga'#GaOOQO'#GT'#GTO3tQWO1G0wOsQWO'#EtOsQWO'#EyOsQWO'#E}OOQO'#FP'#FPOsQWO'#FSOsQWO'#FWO!]QWO'#FZO!]QWO'#F_OOQO'#Fc'#FcOOQO'#Fe'#FeO3{QWO'#FfOsQWO'#FhOsQWO'#FjOsQWO'#FmOsQWO'#FoOsQWO'#FrOsQWO'#FvOsQWO'#FxOOOP1G0w1G0wOOOP1G/Z1G/ZO4QQWO,59rOOOP1G/d1G/dO4VQWO,59{OOOP1G/i1G/iO4[QWO,5:QOOOP1G/q1G/qO4aQWO,5:]OOOP1G/y1G/yO4fQWO,5:bOOOS-E:O-E:OOOOP1G0U1G0UO4kQ`O'#ESOOOQ-E:P-E:POOOP1G0[1G0[O4pQ`O'#EYOOOP1G0n1G0nO4uQWO,5;VOOQO1G.n1G.nOOQO1G.q1G.qO7ZQpO1G.qOOQO'#DO'#DOO7eQWO,59hOOQO-E9z-E9zOOOP7+$W7+$WO9_QpO1G.qO9iQpO1G.uOsQWO1G.yOOOP7+$r7+$rOOOP7+$v7+$vOOOP7+$z7+$zOOOP7+%P7+%POOOP7+%U7+%UOsQWO'#F}OkQpO,5;eO@UQpO,5;iOBRQpO,5;nOClQpO,5;rOE_QWO,5;uOEdQWO,5;yOEiQWO,5dOOOPAN>dAN>dO!5aQWOAN>lOOOPAN>lAN>lO!5iQWOAN>tOOOPAN>tAN>tOsQWO1G0fO!]QWO1G0fO!5qQpO7+&{O!7QQpO7+'PO!8aQWO7+'WO!:TQWO,5N[O]||-1},{term:37,get:O=>C[O]||-1}],tokenPrec:0});function o(O,a){return O.split(" ").map(e=>({label:e,type:a}))}const m=o("abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where","function"),P=o("cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include","keyword"),q=o("empty forloop tablerowloop in with as contains","keyword"),L=o("first index index0 last length rindex","property"),A=o("col col0 col_first col_last first index index0 last length rindex rindex0 row","property");function B(O){var a;let{state:e,pos:r}=O,$=Y(e).resolveInner(r,-1).enterUnfinishedNodesBefore(r),i=((a=$.childBefore(r))===null||a===void 0?void 0:a.name)||$.name;if($.name=="FilterName")return{type:"filter",node:$};if(O.explicit&&i=="|")return{type:"filter"};if($.name=="TagName")return{type:"tag",node:$};if(O.explicit&&i=="{%")return{type:"tag"};if($.name=="PropertyName"&&$.parent.name=="MemberExpression")return{type:"property",node:$,target:$.parent};if($.name=="."&&$.parent.name=="MemberExpression")return{type:"property",target:$.parent};if($.name=="MemberExpression"&&i==".")return{type:"property",target:$};if($.name=="VariableName")return{type:"expression",from:$.from};let n=O.matchBefore(/[\w\u00c0-\uffff]+$/);return n?{type:"expression",from:n.from}:O.explicit&&$.name!="CommentText"&&$.name!="StringLiteral"&&$.name!="NumberLiteral"&&$.name!="InlineComment"?{type:"expression"}:null}function M(O,a,e,r){let $=[];for(;;){let i=a.getChild("Expression");if(!i)return[];if(i.name=="forloop")return $.length?[]:L;if(i.name=="tablerowloop")return $.length?[]:A;if(i.name=="VariableName"){$.unshift(O.sliceDoc(i.from,i.to));break}else if(i.name=="MemberExpression"){let n=i.getChild("PropertyName");n&&$.unshift(O.sliceDoc(n.from,n.to)),a=i}else return[]}return r?r($,O,e):[]}function H(O={}){let a=O.filters?O.filters.concat(m):m,e=O.tags?O.tags.concat(P):P,r=O.variables?O.variables.concat(q):q,{properties:$}=O;return i=>{var n;let Q=B(i);if(!Q)return null;let l=(n=Q.from)!==null&&n!==void 0?n:Q.node?Q.node.from:i.pos,s;return Q.type=="filter"?s=a:Q.type=="tag"?s=e:Q.type=="expression"?s=r:s=M(i.state,Q.target,i,$),s.length?{options:s,from:l,validFor:/^[\w\u00c0-\uffff]*$/}:null}}const K=W.inputHandler.of((O,a,e,r)=>r!="%"||a!=e||O.state.doc.sliceString(a-1,e+1)!="{}"?!1:(O.dispatch(O.state.changeByRange($=>({changes:{from:$.from,to:$.to,insert:"%%"},range:u.cursor($.from+1)})),{scrollIntoView:!0,userEvent:"input.type"}),!0));function c(O){return a=>{let e=O.test(a.textAfter);return a.lineIndent(a.node.from)+(e?0:a.unit)}}const J=T.define({name:"liquid",parser:I.configure({props:[b({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":t.keyword,"empty forloop tablerowloop":t.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":t.controlKeyword,"assign capture endcapture":t.definitionKeyword,contains:t.operatorKeyword,"render include":t.moduleKeyword,VariableName:t.variableName,TagName:t.tagName,FilterName:t.function(t.variableName),PropertyName:t.propertyName,CompareOp:t.compareOperator,AssignOp:t.definitionOperator,LogicOp:t.logicOperator,NumberLiteral:t.number,StringLiteral:t.string,BooleanLiteral:t.bool,InlineComment:t.lineComment,CommentText:t.blockComment,"{% %} {{ }}":t.brace,"( )":t.paren,".":t.derefOperator,", .. : |":t.punctuation}),y.add({Tag:v({closing:"%}"}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":c(/^\s*(\{%-?\s*)?end\w/),IfDirective:c(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:c(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),k.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(O){let a=O.firstChild,e=O.lastChild;return!a||a.name!="Tag"?null:{from:a.to,to:e.name=="EndTag"?e.from:O.to}}})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),p=w();function g(O){return J.configure({wrap:U(a=>a.type.isTop?{parser:O.parser,overlay:e=>e.name=="Text"||e.name=="RawText"}:null)},"liquid")}const OO=g(p.language);function nO(O={}){let a=O.base||p,e=a.language==p.language?OO:g(a.language);return new _(e,[a.support,e.data.of({autocomplete:H(O)}),a.language.data.of({closeBrackets:{brackets:["{"]}}),K])}export{K as closePercentBrace,nO as liquid,H as liquidCompletionSource,OO as liquidLanguage}; +import{o as W,p as u,L as T,s as b,t,i as y,j as v,f as k,a as _,b as R,g as Y,q as w,r as U,E as d}from"./MarkdownEditor-CZAn4RGy.js";import"./index-CRY2WMkq.js";import"./markdown-editor-Bo-wCvDQ.js";import"./utils-DRp9lgY5.js";import"./isAddressEqual-C-mVTeCa.js";import"./secp256k1-B8dOsQyz.js";const G=1,X=2,S=3,z=180,j=4,h=181,Z=5,E=182;function x(O){return O>=65&&O<=90||O>=97&&O<=122}const V=new d(O=>{let a=O.pos;for(;;){let{next:e}=O;if(e<0)break;if(e==123){let r=O.peek(1);if(r==123){if(O.pos>a)break;O.acceptToken(G,2);return}else if(r==37){if(O.pos>a)break;let $=2,i=2;for(;;){let n=O.peek($);if(n==32||n==10)++$;else if(n==35)for(++$;;){let Q=O.peek($);if(Q<0||Q==10)break;$++}else if(n==45&&i==2)i=++$;else{let Q=n==101&&O.peek($+1)==110&&O.peek($+2)==100;O.acceptToken(Q?S:X,i);return}}}}if(O.advance(),e==10)break}O.pos>a&&O.acceptToken(z)});function f(O,a,e){return new d(r=>{let $=r.pos;for(;;){let{next:i}=r;if(i==123&&r.peek(1)==37){let n=2;for(;;n++){let l=r.peek(n);if(l!=32&&l!=10)break}let Q="";for(;;n++){let l=r.peek(n);if(!x(l))break;Q+=String.fromCharCode(l)}if(Q==O){if(r.pos>$)break;r.acceptToken(e,2);break}}else if(i<0)break;if(r.advance(),i==10)break}r.pos>$&&r.acceptToken(a)})}const F=f("endcomment",E,Z),D=f("endraw",h,j),N={__proto__:null,contains:32,or:36,and:36,true:50,false:50,empty:52,forloop:54,tablerowloop:56,continue:58,in:128,with:194,for:196,as:198,if:234,endif:238,unless:244,endunless:248,elsif:252,else:256,case:262,endcase:266,when:270,endfor:278,tablerow:284,endtablerow:288,break:292,cycle:298,echo:302,render:306,include:312,assign:316,capture:322,endcapture:326,increment:330,decrement:334},C={__proto__:null,if:82,endif:86,elsif:90,else:94,unless:100,endunless:104,case:110,endcase:114,when:118,for:126,endfor:136,tablerow:142,endtablerow:146,break:150,continue:154,cycle:158,comment:164,endcomment:170,raw:176,endraw:182,echo:186,render:190,include:202,assign:206,capture:212,endcapture:216,increment:220,decrement:224,liquid:228},I=R.deserialize({version:14,states:"GYQYOPOOOOOP'#F{'#F{OeOXO'#CdOsQWO'#CfO!bQ`O'#DQO#{OPO'#DTO$ZOPO'#D^O$iOPO'#DcO$wOPO'#DkO%VOPO'#DsO%eOSO'#EOO%jOQO'#EUO%oOPO'#EhOOOP'#G`'#G`OOOP'#G]'#G]OOOP'#Fz'#FzQYOPOOOOOP-E9y-E9yOOQO'#Cg'#CgO&`QpO,59QO&gQpO'#G^OsQWO'#CsOOQO'#G^'#G^OOOP,59l,59lO)PQWO,59lOsQWO,59pOsQWO,59tO)WQWO,59vOsQWO,59yOsQWO,5:OOsQWO,5:SO!]QWO,5:WO!]QWO,5:`O)]QWO,5:dO)bQWO,5:fO)gQWO,5:hO)lQWO,5:kO)qQWO,5:qOsQWO,5:vOsQWO,5:xOsQWO,5;OOsQWO,5;QOsQWO,5;TOsQWO,5;XOsQWO,5;ZO+QQWO,5;]O+XOPO'#CdOOOP,59o,59oO#{OPO,59oO+gQ`O'#DWOOOP,59x,59xO$ZOPO,59xO+lQ`O'#DaOOOP,59},59}O$iOPO,59}O+qQ`O'#DfOOOP,5:V,5:VO$wOPO,5:VO+vQ`O'#DqOOOP,5:_,5:_O%VOPO,5:_O+{Q`O'#DvOOOS'#GQ'#GQO,QOSO'#ERO,YOSO,5:jOOOQ'#GR'#GRO,_OQO'#EXO,gOQO,5:pOOOP,5;S,5;SO%oOPO,5;SO,lQ`O'#EkOOOP-E9x-E9xO,qQ!bO,59SOsQWO,59VOsQWO,59VO,vQWO'#C|OOQO'#F|'#F|O,{QWO1G.lOOOP1G.l1G.lOsQWO,59VOsQWO,59ZO-TQpO,59_O-fQpO1G/WOOOP1G/W1G/WO-wQpO1G/[O.YQpO1G/`OOOP1G/b1G/bO.kQpO1G/eO.|QpO1G/jO/pQpO1G/nO/wQWO1G/rO/|QWO1G/zOOOP1G0O1G0OOOOP1G0Q1G0QO0RQWO1G0SOOOS1G0V1G0VOOOQ1G0]1G0]O0^QpO1G0bO0eQpO1G0dO1PQpO1G0jO1bQpO1G0lO1sQpO1G0oO2UQpO1G0sO2gQpO1G0uO2xQWO'#EsO3PQWO'#ExO3WQWO'#FRO3_QWO'#FYO3fQWO'#F^O3mQWO'#FqOOQO'#Ga'#GaOOQO'#GT'#GTO3tQWO1G0wOsQWO'#EtOsQWO'#EyOsQWO'#E}OOQO'#FP'#FPOsQWO'#FSOsQWO'#FWO!]QWO'#FZO!]QWO'#F_OOQO'#Fc'#FcOOQO'#Fe'#FeO3{QWO'#FfOsQWO'#FhOsQWO'#FjOsQWO'#FmOsQWO'#FoOsQWO'#FrOsQWO'#FvOsQWO'#FxOOOP1G0w1G0wOOOP1G/Z1G/ZO4QQWO,59rOOOP1G/d1G/dO4VQWO,59{OOOP1G/i1G/iO4[QWO,5:QOOOP1G/q1G/qO4aQWO,5:]OOOP1G/y1G/yO4fQWO,5:bOOOS-E:O-E:OOOOP1G0U1G0UO4kQ`O'#ESOOOQ-E:P-E:POOOP1G0[1G0[O4pQ`O'#EYOOOP1G0n1G0nO4uQWO,5;VOOQO1G.n1G.nOOQO1G.q1G.qO7ZQpO1G.qOOQO'#DO'#DOO7eQWO,59hOOQO-E9z-E9zOOOP7+$W7+$WO9_QpO1G.qO9iQpO1G.uOsQWO1G.yOOOP7+$r7+$rOOOP7+$v7+$vOOOP7+$z7+$zOOOP7+%P7+%POOOP7+%U7+%UOsQWO'#F}OkQpO,5;eO@UQpO,5;iOBRQpO,5;nOClQpO,5;rOE_QWO,5;uOEdQWO,5;yOEiQWO,5dOOOPAN>dAN>dO!5aQWOAN>lOOOPAN>lAN>lO!5iQWOAN>tOOOPAN>tAN>tOsQWO1G0fO!]QWO1G0fO!5qQpO7+&{O!7QQpO7+'PO!8aQWO7+'WO!:TQWO,5N[O]||-1},{term:37,get:O=>C[O]||-1}],tokenPrec:0});function o(O,a){return O.split(" ").map(e=>({label:e,type:a}))}const m=o("abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where","function"),P=o("cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include","keyword"),q=o("empty forloop tablerowloop in with as contains","keyword"),L=o("first index index0 last length rindex","property"),A=o("col col0 col_first col_last first index index0 last length rindex rindex0 row","property");function B(O){var a;let{state:e,pos:r}=O,$=Y(e).resolveInner(r,-1).enterUnfinishedNodesBefore(r),i=((a=$.childBefore(r))===null||a===void 0?void 0:a.name)||$.name;if($.name=="FilterName")return{type:"filter",node:$};if(O.explicit&&i=="|")return{type:"filter"};if($.name=="TagName")return{type:"tag",node:$};if(O.explicit&&i=="{%")return{type:"tag"};if($.name=="PropertyName"&&$.parent.name=="MemberExpression")return{type:"property",node:$,target:$.parent};if($.name=="."&&$.parent.name=="MemberExpression")return{type:"property",target:$.parent};if($.name=="MemberExpression"&&i==".")return{type:"property",target:$};if($.name=="VariableName")return{type:"expression",from:$.from};let n=O.matchBefore(/[\w\u00c0-\uffff]+$/);return n?{type:"expression",from:n.from}:O.explicit&&$.name!="CommentText"&&$.name!="StringLiteral"&&$.name!="NumberLiteral"&&$.name!="InlineComment"?{type:"expression"}:null}function M(O,a,e,r){let $=[];for(;;){let i=a.getChild("Expression");if(!i)return[];if(i.name=="forloop")return $.length?[]:L;if(i.name=="tablerowloop")return $.length?[]:A;if(i.name=="VariableName"){$.unshift(O.sliceDoc(i.from,i.to));break}else if(i.name=="MemberExpression"){let n=i.getChild("PropertyName");n&&$.unshift(O.sliceDoc(n.from,n.to)),a=i}else return[]}return r?r($,O,e):[]}function H(O={}){let a=O.filters?O.filters.concat(m):m,e=O.tags?O.tags.concat(P):P,r=O.variables?O.variables.concat(q):q,{properties:$}=O;return i=>{var n;let Q=B(i);if(!Q)return null;let l=(n=Q.from)!==null&&n!==void 0?n:Q.node?Q.node.from:i.pos,s;return Q.type=="filter"?s=a:Q.type=="tag"?s=e:Q.type=="expression"?s=r:s=M(i.state,Q.target,i,$),s.length?{options:s,from:l,validFor:/^[\w\u00c0-\uffff]*$/}:null}}const K=W.inputHandler.of((O,a,e,r)=>r!="%"||a!=e||O.state.doc.sliceString(a-1,e+1)!="{}"?!1:(O.dispatch(O.state.changeByRange($=>({changes:{from:$.from,to:$.to,insert:"%%"},range:u.cursor($.from+1)})),{scrollIntoView:!0,userEvent:"input.type"}),!0));function c(O){return a=>{let e=O.test(a.textAfter);return a.lineIndent(a.node.from)+(e?0:a.unit)}}const J=T.define({name:"liquid",parser:I.configure({props:[b({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":t.keyword,"empty forloop tablerowloop":t.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":t.controlKeyword,"assign capture endcapture":t.definitionKeyword,contains:t.operatorKeyword,"render include":t.moduleKeyword,VariableName:t.variableName,TagName:t.tagName,FilterName:t.function(t.variableName),PropertyName:t.propertyName,CompareOp:t.compareOperator,AssignOp:t.definitionOperator,LogicOp:t.logicOperator,NumberLiteral:t.number,StringLiteral:t.string,BooleanLiteral:t.bool,InlineComment:t.lineComment,CommentText:t.blockComment,"{% %} {{ }}":t.brace,"( )":t.paren,".":t.derefOperator,", .. : |":t.punctuation}),y.add({Tag:v({closing:"%}"}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":c(/^\s*(\{%-?\s*)?end\w/),IfDirective:c(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:c(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),k.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(O){let a=O.firstChild,e=O.lastChild;return!a||a.name!="Tag"?null:{from:a.to,to:e.name=="EndTag"?e.from:O.to}}})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),p=w();function g(O){return J.configure({wrap:U(a=>a.type.isTop?{parser:O.parser,overlay:e=>e.name=="Text"||e.name=="RawText"}:null)},"liquid")}const OO=g(p.language);function nO(O={}){let a=O.base||p,e=a.language==p.language?OO:g(a.language);return new _(e,[a.support,e.data.of({autocomplete:H(O)}),a.language.data.of({closeBrackets:{brackets:["{"]}}),K])}export{K as closePercentBrace,nO as liquid,H as liquidCompletionSource,OO as liquidLanguage}; diff --git a/assets/index-B3nH8WrL.js b/assets/index-CRY2WMkq.js similarity index 99% rename from assets/index-B3nH8WrL.js rename to assets/index-CRY2WMkq.js index ca9f2f1..c2e7435 100644 --- a/assets/index-B3nH8WrL.js +++ b/assets/index-CRY2WMkq.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-DJPJ_8CX.js","assets/isAddressEqual-CYfaHVHF.js","assets/index-TYE6PGSe.js","assets/hooks.module-CUxDSjbn.js","assets/index-DuaFf-vM.js","assets/index.lazy-C5pV79nK.js","assets/useAccount-D6bVeZSl.js","assets/index.lazy-h9TCrYvb.js","assets/index.lazy-DUpbKanP.js","assets/_user.lazy-Da_OvuGY.js","assets/index-vUgOGBE5.js","assets/index-C0HCKJ4u.css","assets/clsx-CICJCmT4.js","assets/utils-DE92Morm.js","assets/secp256k1-Jr9fFTYw.js","assets/Top-DyE3cSIx.js","assets/useUsername-hbu8_si_.js","assets/_user.lazy-Bqkk2MmQ.js","assets/MarkdownEditor-YN_nb091.js","assets/markdown-editor-Bo-wCvDQ.js","assets/markdown-editor-DU6WCIos.css","assets/_user.lazy-nay9z0sR.js","assets/index.lazy-CdfBSncd.js","assets/index.lazy-Wu1uRAhn.js","assets/index-DvsPcOYb.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-DJxiIDgE.js","assets/isAddressEqual-C-mVTeCa.js","assets/index-CD5LSkva.js","assets/hooks.module-S7jQP2mz.js","assets/index-F-gjaB_2.js","assets/index.lazy-GWe3Q1Ws.js","assets/useAccount-CorcDqln.js","assets/index.lazy-BmB491lo.js","assets/index.lazy-DJEnv9aP.js","assets/_user.lazy-CIe7MB4z.js","assets/index-DZJZDHxv.js","assets/index-C0HCKJ4u.css","assets/clsx-NxneMfFk.js","assets/utils-DRp9lgY5.js","assets/secp256k1-B8dOsQyz.js","assets/Top-B7CAGs01.js","assets/useUsername-DJz3tOke.js","assets/_user.lazy-LyJ9PWgc.js","assets/MarkdownEditor-CZAn4RGy.js","assets/markdown-editor-Bo-wCvDQ.js","assets/markdown-editor-DU6WCIos.css","assets/_user.lazy-BaNZvqyA.js","assets/index.lazy-CNEPLjvW.js","assets/index.lazy-DRLfXEAq.js","assets/index-DvsPcOYb.css"])))=>i.map(i=>d[i]); var ET=t=>{throw TypeError(t)};var ex=(t,e,r)=>e.has(t)||ET("Cannot "+r);var Oe=(t,e,r)=>(ex(t,e,"read from private field"),r?r.call(t):e.get(t)),Fr=(t,e,r)=>e.has(t)?ET("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),pr=(t,e,r,n)=>(ex(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),ji=(t,e,r)=>(ex(t,e,"access private method"),r);var W3=(t,e,r,n)=>({set _(i){pr(t,e,i,r)},get _(){return Oe(t,e,n)}});function sQ(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 Gi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _c(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function MO(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 OO={exports:{}},c6={},$O={exports:{}},_r={};/** * @license React * react.production.min.js @@ -7,7 +7,7 @@ var ET=t=>{throw TypeError(t)};var ex=(t,e,r)=>e.has(t)||ET("Cannot "+r);var Oe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Kv=Symbol.for("react.element"),oQ=Symbol.for("react.portal"),aQ=Symbol.for("react.fragment"),cQ=Symbol.for("react.strict_mode"),lQ=Symbol.for("react.profiler"),uQ=Symbol.for("react.provider"),dQ=Symbol.for("react.context"),fQ=Symbol.for("react.forward_ref"),hQ=Symbol.for("react.suspense"),pQ=Symbol.for("react.memo"),gQ=Symbol.for("react.lazy"),ST=Symbol.iterator;function mQ(t){return t===null||typeof t!="object"?null:(t=ST&&t[ST]||t["@@iterator"],typeof t=="function"?t:null)}var DO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LO=Object.assign,BO={};function rg(t,e,r){this.props=t,this.context=e,this.refs=BO,this.updater=r||DO}rg.prototype.isReactComponent={};rg.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};rg.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function UO(){}UO.prototype=rg.prototype;function LC(t,e,r){this.props=t,this.context=e,this.refs=BO,this.updater=r||DO}var BC=LC.prototype=new UO;BC.constructor=LC;LO(BC,rg.prototype);BC.isPureReactComponent=!0;var IT=Array.isArray,jO=Object.prototype.hasOwnProperty,UC={current:null},FO={key:!0,ref:!0,__self:!0,__source:!0};function zO(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)jO.call(e,n)&&!FO.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1{throw TypeError(t)};var ex=(t,e,r)=>e.has(t)||ET("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{nx=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Sm(t):""}function OQ(t){switch(t.tag){case 5:return Sm(t.type);case 16:return Sm("Lazy");case 13:return Sm("Suspense");case 19:return Sm("SuspenseList");case 0:case 2:case 15:return t=ix(t.type,!1),t;case 11:return t=ix(t.type.render,!1),t;case 1:return t=ix(t.type,!0),t;default:return""}}function a7(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 xp:return"Fragment";case bp:return"Portal";case i7:return"Profiler";case HC:return"StrictMode";case s7:return"Suspense";case o7:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case QO:return(t.displayName||"Context")+".Consumer";case ZO:return(t._context.displayName||"Context")+".Provider";case qC:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case VC:return e=t.displayName||null,e!==null?e:a7(t.type)||"Memo";case gd:e=t._payload,t=t._init;try{return a7(t(e))}catch{}}return null}function $Q(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 a7(e);case 8:return e===HC?"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 Xd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function JO(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function DQ(t){var e=JO(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 V3(t){t._valueTracker||(t._valueTracker=DQ(t))}function XO(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=JO(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function vb(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 c7(t,e){var r=e.checked;return In({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function NT(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Xd(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 e$(t,e){e=e.checked,e!=null&&WC(t,"checked",e,!1)}function l7(t,e){e$(t,e);var r=Xd(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")?u7(t,e.type,r):e.hasOwnProperty("defaultValue")&&u7(t,e.type,Xd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function MT(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 u7(t,e,r){(e!=="number"||vb(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Im=Array.isArray;function Lp(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=K3.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function uw(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Lm={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},LQ=["Webkit","ms","Moz","O"];Object.keys(Lm).forEach(function(t){LQ.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Lm[e]=Lm[t]})});function i$(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Lm.hasOwnProperty(t)&&Lm[t]?(""+e).trim():e+"px"}function s$(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=i$(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var BQ=In({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 h7(t,e){if(e){if(BQ[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 p7(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 g7=null;function KC(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var m7=null,Bp=null,Up=null;function DT(t){if(t=Qv(t)){if(typeof m7!="function")throw Error(We(280));var e=t.stateNode;e&&(e=h6(e),m7(t.stateNode,t.type,e))}}function o$(t){Bp?Up?Up.push(t):Up=[t]:Bp=t}function a$(){if(Bp){var t=Bp,e=Up;if(Up=Bp=null,DT(t),e)for(t=0;t>>=0,t===0?32:31-(ZQ(t)/QQ|0)|0}var G3=64,Z3=4194304;function Tm(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 _b(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=Tm(a):(s&=o,s!==0&&(n=Tm(s)))}else o=r&~i,o!==0?n=Tm(o):s!==0&&(n=Tm(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 Gv(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-oc(e),t[e]=r}function eY(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=Um),qT=" ",VT=!1;function I$(t,e){switch(t){case"keyup":return TY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T$(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _p=!1;function PY(t,e){switch(t){case"compositionend":return T$(e);case"keypress":return e.which!==32?null:(VT=!0,qT);case"textInput":return t=e.data,t===qT&&VT?null:t;default:return null}}function RY(t,e){if(_p)return t==="compositionend"||!tA&&I$(t,e)?(t=E$(),zy=JC=Od=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=QT(r)}}function N$(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?N$(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function M$(){for(var t=window,e=vb();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=vb(t.document)}return e}function rA(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 jY(t){var e=M$(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&N$(r.ownerDocument.documentElement,r)){if(n!==null&&rA(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=YT(r,s);var o=YT(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,Cp=null,_7=null,Fm=null,C7=!1;function JT(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;C7||Cp==null||Cp!==vb(n)||(n=Cp,"selectionStart"in n&&rA(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}),Fm&&mw(Fm,n)||(Fm=n,n=Eb(_7,"onSelect"),0Sp||(t.current=k7[Sp],k7[Sp]=null,Sp--)}function sn(t,e){Sp++,k7[Sp]=t.current,t.current=e}var ef={},Xi=yf(ef),Ws=yf(!1),Ph=ef;function l1(t,e){var r=t.type.contextTypes;if(!r)return ef;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 Hs(t){return t=t.childContextTypes,t!=null}function Ib(){pn(Ws),pn(Xi)}function sk(t,e,r){if(Xi.current!==ef)throw Error(We(168));sn(Xi,e),sn(Ws,r)}function z$(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,$Q(t)||"Unknown",i));return In({},r,n)}function Tb(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ef,Ph=Xi.current,sn(Xi,t),sn(Ws,Ws.current),!0}function ok(t,e,r){var n=t.stateNode;if(!n)throw Error(We(169));r?(t=z$(t,e,Ph),n.__reactInternalMemoizedMergedChildContext=t,pn(Ws),pn(Xi),sn(Xi,t)):pn(Ws),sn(Ws,r)}var uu=null,p6=!1,vx=!1;function W$(t){uu===null?uu=[t]:uu.push(t)}function JY(t){p6=!0,W$(t)}function bf(){if(!vx&&uu!==null){vx=!0;var t=0,e=Hr;try{var r=uu;for(Hr=1;t>=o,i-=o,pu=1<<32-oc(e)+i|r<T?(F=I,I=null):F=I.sibling;var K=g(N,I,O[T],L);if(K===null){I===null&&(I=F);break}t&&I&&K.alternate===null&&e(N,I),E=s(K,E,T),H===null?U=K:H.sibling=K,H=K,I=F}if(T===O.length)return r(N,I),wn&&ih(N,T),U;if(I===null){for(;TT?(F=I,I=null):F=I.sibling;var B=g(N,I,K.value,L);if(B===null){I===null&&(I=F);break}t&&I&&B.alternate===null&&e(N,I),E=s(B,E,T),H===null?U=B:H.sibling=B,H=B,I=F}if(K.done)return r(N,I),wn&&ih(N,T),U;if(I===null){for(;!K.done;T++,K=O.next())K=h(N,K.value,L),K!==null&&(E=s(K,E,T),H===null?U=K:H.sibling=K,H=K);return wn&&ih(N,T),U}for(I=n(N,I);!K.done;T++,K=O.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?U=K:H.sibling=K,H=K);return t&&I.forEach(function(_){return e(N,_)}),wn&&ih(N,T),U}function M(N,E,O,L){if(typeof O=="object"&&O!==null&&O.type===xp&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case q3:e:{for(var U=O.key,H=E;H!==null;){if(H.key===U){if(U=O.type,U===xp){if(H.tag===7){r(N,H.sibling),E=i(H,O.props.children),E.return=N,N=E;break e}}else if(H.elementType===U||typeof U=="object"&&U!==null&&U.$$typeof===gd&&lk(U)===H.type){r(N,H.sibling),E=i(H,O.props),E.ref=rm(N,H,O),E.return=N,N=E;break e}r(N,H);break}else e(N,H);H=H.sibling}O.type===xp?(E=Ah(O.props.children,N.mode,L,O.key),E.return=N,N=E):(L=Qy(O.type,O.key,O.props,null,N.mode,L),L.ref=rm(N,E,O),L.return=N,N=L)}return o(N);case bp:e:{for(H=O.key;E!==null;){if(E.key===H)if(E.tag===4&&E.stateNode.containerInfo===O.containerInfo&&E.stateNode.implementation===O.implementation){r(N,E.sibling),E=i(E,O.children||[]),E.return=N,N=E;break e}else{r(N,E);break}else e(N,E);E=E.sibling}E=Sx(O,N.mode,L),E.return=N,N=E}return o(N);case gd:return H=O._init,M(N,E,H(O._payload),L)}if(Im(O))return x(N,E,O,L);if(Yg(O))return R(N,E,O,L);ry(N,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,E!==null&&E.tag===6?(r(N,E.sibling),E=i(E,O),E.return=N,N=E):(r(N,E),E=Ex(O,N.mode,L),E.return=N,N=E),o(N)):r(N,E)}return M}var d1=K$(!0),G$=K$(!1),Rb=yf(null),Nb=null,kp=null,oA=null;function aA(){oA=kp=Nb=null}function cA(t){var e=Rb.current;pn(Rb),t._currentValue=e}function N7(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 Fp(t,e){Nb=t,oA=kp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Fs=!0),t.firstContext=null)}function ha(t){var e=t._currentValue;if(oA!==t)if(t={context:t,memoizedValue:e,next:null},kp===null){if(Nb===null)throw Error(We(308));kp=t,Nb.dependencies={lanes:0,firstContext:t}}else kp=kp.next=t;return e}var uh=null;function lA(t){uh===null?uh=[t]:uh.push(t)}function Z$(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,lA(e)):(r.next=i.next,i.next=r),e.interleaved=r,Su(t,n)}function Su(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 md=!1;function uA(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Q$(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 bu(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Wd(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,Su(t,r)}return i=n.interleaved,i===null?(e.next=e,lA(n)):(e.next=i.next,i.next=e),n.interleaved=e,Su(t,r)}function Hy(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,ZC(t,r)}}function uk(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 Mb(t,e,r,n){var i=t.updateQueue;md=!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 h=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,R=a;switch(g=e,v=r,R.tag){case 1:if(x=R.payload,typeof x=="function"){h=x.call(v,h,g);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=R.payload,g=typeof x=="function"?x.call(v,h,g):x,g==null)break e;h=In({},h,g);break e;case 2:md=!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=h):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=h),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);Mh|=o,t.lanes=o,t.memoizedState=h}}function dk(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=bx.transition;bx.transition={};try{t(!1),e()}finally{Hr=r,bx.transition=n}}function hD(){return pa().memoizedState}function rJ(t,e,r){var n=qd(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},pD(t))gD(e,r);else if(r=Z$(t,e,r,n),r!==null){var i=hs();ac(r,t,n,i),mD(r,e,n)}}function nJ(t,e,r){var n=qd(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(pD(t))gD(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,dc(a,o)){var c=e.interleaved;c===null?(i.next=i,lA(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=Z$(t,e,i,n),r!==null&&(i=hs(),ac(r,t,n,i),mD(r,e,n))}}function pD(t){var e=t.alternate;return t===En||e!==null&&e===En}function gD(t,e){zm=$b=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function mD(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,ZC(t,r)}}var Db={readContext:ha,useCallback:Fi,useContext:Fi,useEffect:Fi,useImperativeHandle:Fi,useInsertionEffect:Fi,useLayoutEffect:Fi,useMemo:Fi,useReducer:Fi,useRef:Fi,useState:Fi,useDebugValue:Fi,useDeferredValue:Fi,useTransition:Fi,useMutableSource:Fi,useSyncExternalStore:Fi,useId:Fi,unstable_isNewReconciler:!1},iJ={readContext:ha,useCallback:function(t,e){return Hc().memoizedState=[t,e===void 0?null:e],t},useContext:ha,useEffect:hk,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Vy(4194308,4,cD.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Vy(4194308,4,t,e)},useInsertionEffect:function(t,e){return Vy(4,2,t,e)},useMemo:function(t,e){var r=Hc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Hc();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=rJ.bind(null,En,t),[n.memoizedState,t]},useRef:function(t){var e=Hc();return t={current:t},e.memoizedState=t},useState:fk,useDebugValue:vA,useDeferredValue:function(t){return Hc().memoizedState=t},useTransition:function(){var t=fk(!1),e=t[0];return t=tJ.bind(null,t[1]),Hc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=En,i=Hc();if(wn){if(r===void 0)throw Error(We(407));r=r()}else{if(r=e(),mi===null)throw Error(We(349));Nh&30||eD(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,hk(rD.bind(null,n,s,t),[t]),n.flags|=2048,Aw(9,tD.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Hc(),e=mi.identifierPrefix;if(wn){var r=gu,n=pu;r=(n&~(1<<32-oc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=_w++,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[tl]=e,t[yw]=n,SD(t,e,!1,!1),e.stateNode=t;e:{switch(o=p7(r,n),r){case"dialog":dn("cancel",t),dn("close",t),i=n;break;case"iframe":case"object":case"embed":dn("load",t),i=n;break;case"video":case"audio":for(i=0;ip1&&(e.flags|=128,n=!0,nm(s,!1),e.lanes=4194304)}else{if(!n)if(t=Ob(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),nm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!wn)return zi(e),null}else 2*Wn()-s.renderingStartTime>p1&&r!==1073741824&&(e.flags|=128,n=!0,nm(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=Wn(),e.sibling=null,r=Cn.current,sn(Cn,n?r&1|2:r&1),e):(zi(e),null);case 22:case 23:return AA(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?lo&1073741824&&(zi(e),e.subtreeFlags&6&&(e.flags|=8192)):zi(e),null;case 24:return null;case 25:return null}throw Error(We(156,e.tag))}function fJ(t,e){switch(iA(e),e.tag){case 1:return Hs(e.type)&&Ib(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return f1(),pn(Ws),pn(Xi),hA(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return fA(e),null;case 13:if(pn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(We(340));u1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return pn(Cn),null;case 4:return f1(),null;case 10:return cA(e.type._context),null;case 22:case 23:return AA(),null;case 24:return null;default:return null}}var iy=!1,Zi=!1,hJ=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Pp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Mn(t,e,n)}else r.current=null}function F7(t,e,r){try{r()}catch(n){Mn(t,e,n)}}var Ak=!1;function pJ(t,e){if(A7=Cb,t=M$(),rA(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,h=t,g=null;t:for(;;){for(var v;h!==r||i!==0&&h.nodeType!==3||(a=o+i),h!==s||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(v=h.firstChild)!==null;)g=h,h=v;for(;;){if(h===t)break t;if(g===r&&++l===i&&(a=o),g===s&&++d===n&&(c=o),(v=h.nextSibling)!==null)break;h=g,g=h.parentNode}h=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(E7={focusedElem:t,selectionRange:r},Cb=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){e=Ct;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 R=x.memoizedProps,M=x.memoizedState,N=e.stateNode,E=N.getSnapshotBeforeUpdate(e.elementType===e.type?R:Ka(e.type,R),M);N.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var O=e.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(We(163))}}catch(L){Mn(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,Ct=t;break}Ct=e.return}return x=Ak,Ak=!1,x}function Wm(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&&F7(e,r,s)}i=i.next}while(i!==n)}}function w6(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 z7(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 kD(t){var e=t.alternate;e!==null&&(t.alternate=null,kD(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[tl],delete e[yw],delete e[T7],delete e[QY],delete e[YY])),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 PD(t){return t.tag===5||t.tag===3||t.tag===4}function Ek(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||PD(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 W7(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=Sb));else if(n!==4&&(t=t.child,t!==null))for(W7(t,e,r),t=t.sibling;t!==null;)W7(t,e,r),t=t.sibling}function H7(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(H7(t,e,r),t=t.sibling;t!==null;)H7(t,e,r),t=t.sibling}var Ci=null,Ja=!1;function cd(t,e,r){for(r=r.child;r!==null;)RD(t,e,r),r=r.sibling}function RD(t,e,r){if(nl&&typeof nl.onCommitFiberUnmount=="function")try{nl.onCommitFiberUnmount(l6,r)}catch{}switch(r.tag){case 5:Zi||Pp(r,e);case 6:var n=Ci,i=Ja;Ci=null,cd(t,e,r),Ci=n,Ja=i,Ci!==null&&(Ja?(t=Ci,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ci.removeChild(r.stateNode));break;case 18:Ci!==null&&(Ja?(t=Ci,r=r.stateNode,t.nodeType===8?wx(t.parentNode,r):t.nodeType===1&&wx(t,r),pw(t)):wx(Ci,r.stateNode));break;case 4:n=Ci,i=Ja,Ci=r.stateNode.containerInfo,Ja=!0,cd(t,e,r),Ci=n,Ja=i;break;case 0:case 11:case 14:case 15:if(!Zi&&(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)&&F7(r,e,o),i=i.next}while(i!==n)}cd(t,e,r);break;case 1:if(!Zi&&(Pp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Mn(r,e,a)}cd(t,e,r);break;case 21:cd(t,e,r);break;case 22:r.mode&1?(Zi=(n=Zi)||r.memoizedState!==null,cd(t,e,r),Zi=n):cd(t,e,r);break;default:cd(t,e,r)}}function Sk(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new hJ),e.forEach(function(n){var i=CJ.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function La(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Wn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*mJ(n/1960))-n,10t?16:t,$d===null)var n=!1;else{if(t=$d,$d=null,Ub=0,Nr&6)throw Error(We(331));var i=Nr;for(Nr|=4,Ct=t.current;Ct!==null;){var s=Ct,o=s.child;if(Ct.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cWn()-_A?Ch(t,0):xA|=r),qs(t,e)}function UD(t,e){e===0&&(t.mode&1?(e=Z3,Z3<<=1,!(Z3&130023424)&&(Z3=4194304)):e=1);var r=hs();t=Su(t,e),t!==null&&(Gv(t,e,r),qs(t,r))}function _J(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),UD(t,r)}function CJ(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),UD(t,r)}var jD;jD=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ws.current)Fs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Fs=!1,uJ(t,e,r);Fs=!!(t.flags&131072)}else Fs=!1,wn&&e.flags&1048576&&H$(e,Pb,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Ky(t,e),t=e.pendingProps;var i=l1(e,Xi.current);Fp(e,r),i=gA(null,e,n,t,i,r);var s=mA();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,Hs(n)?(s=!0,Tb(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,uA(e),i.updater=m6,e.stateNode=i,i._reactInternals=e,O7(e,n,t,r),e=L7(null,e,n,!0,s,r)):(e.tag=0,wn&&s&&nA(e),ls(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Ky(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=EJ(n),t=Ka(n,t),i){case 0:e=D7(null,e,n,t,r);break e;case 1:e=xk(null,e,n,t,r);break e;case 11:e=yk(null,e,n,t,r);break e;case 14:e=bk(null,e,n,Ka(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:Ka(n,i),D7(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),xk(t,e,n,i,r);case 3:e:{if(CD(e),t===null)throw Error(We(387));n=e.pendingProps,s=e.memoizedState,i=s.element,Q$(t,e),Mb(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=h1(Error(We(423)),e),e=_k(t,e,n,r,i);break e}else if(n!==i){i=h1(Error(We(424)),e),e=_k(t,e,n,r,i);break e}else for(ho=zd(e.stateNode.containerInfo.firstChild),mo=e,wn=!0,tc=null,r=G$(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(u1(),n===i){e=Iu(t,e,r);break e}ls(t,e,n,r)}e=e.child}return e;case 5:return Y$(e),t===null&&R7(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,S7(n,i)?o=null:s!==null&&S7(n,s)&&(e.flags|=32),_D(t,e),ls(t,e,o,r),e.child;case 6:return t===null&&R7(e),null;case 13:return AD(t,e,r);case 4:return dA(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=d1(e,null,n,r):ls(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),yk(t,e,n,i,r);case 7:return ls(t,e,e.pendingProps,r),e.child;case 8:return ls(t,e,e.pendingProps.children,r),e.child;case 12:return ls(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,sn(Rb,n._currentValue),n._currentValue=o,s!==null)if(dc(s.value,o)){if(s.children===i.children&&!Ws.current){e=Iu(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=bu(-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),N7(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),N7(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}ls(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Fp(e,r),i=ha(i),n=n(i),e.flags|=1,ls(t,e,n,r),e.child;case 14:return n=e.type,i=Ka(n,e.pendingProps),i=Ka(n.type,i),bk(t,e,n,i,r);case 15:return bD(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),Ky(t,e),e.tag=1,Hs(n)?(t=!0,Tb(e)):t=!1,Fp(e,r),wD(e,n,i),O7(e,n,i,r),L7(null,e,n,!0,t,r);case 19:return ED(t,e,r);case 22:return xD(t,e,r)}throw Error(We(156,e.tag))};function FD(t,e){return p$(t,e)}function AJ(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 da(t,e,r,n){return new AJ(t,e,r,n)}function SA(t){return t=t.prototype,!(!t||!t.isReactComponent)}function EJ(t){if(typeof t=="function")return SA(t)?1:0;if(t!=null){if(t=t.$$typeof,t===qC)return 11;if(t===VC)return 14}return 2}function Vd(t,e){var r=t.alternate;return r===null?(r=da(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 Qy(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")SA(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case xp:return Ah(r.children,i,s,e);case HC:o=8,i|=8;break;case i7:return t=da(12,r,e,i|2),t.elementType=i7,t.lanes=s,t;case s7:return t=da(13,r,e,i),t.elementType=s7,t.lanes=s,t;case o7:return t=da(19,r,e,i),t.elementType=o7,t.lanes=s,t;case YO:return y6(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ZO:o=10;break e;case QO:o=9;break e;case qC:o=11;break e;case VC:o=14;break e;case gd:o=16,n=null;break e}throw Error(We(130,t==null?t:typeof t,""))}return e=da(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Ah(t,e,r,n){return t=da(7,t,n,e),t.lanes=r,t}function y6(t,e,r,n){return t=da(22,t,n,e),t.elementType=YO,t.lanes=r,t.stateNode={isHidden:!1},t}function Ex(t,e,r){return t=da(6,t,null,e),t.lanes=r,t}function Sx(t,e,r){return e=da(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function SJ(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=ox(0),this.expirationTimes=ox(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ox(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IA(t,e,r,n,i,s,o,a,c){return t=new SJ(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=da(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},uA(s),t}function IJ(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qD)}catch(t){console.error(t)}}qD(),qO.exports=So;var RA=qO.exports;const BCe=_c(RA);var VD,Ok=RA;VD=Ok.createRoot,Ok.hydrateRoot;const NJ="modulepreload",MJ=function(t){return"/"+t},$k={},Dn=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=MJ(c),c in $k)return;$k[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":NJ,l||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),l)return new Promise((g,v)=>{h.addEventListener("load",g),h.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)})},OJ=Symbol(),Dk=Object.getPrototypeOf,Z7=new WeakMap,$J=t=>t&&(Z7.has(t)?Z7.get(t):Dk(t)===Object.prototype||Dk(t)===Array.prototype),DJ=t=>$J(t)&&t[OJ]||null,Lk=(t,e=!0)=>{Z7.set(t,e)},zb={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"},Ix=t=>typeof t=="object"&&t!==null,wd=new WeakMap,Pm=new WeakSet,LJ=(t=Object.is,e=(l,d)=>new Proxy(l,d),r=l=>Ix(l)&&!Pm.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,h=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 Lk(v,!0),i.set(l,[d,v]),Reflect.ownKeys(l).forEach(x=>{if(Object.getOwnPropertyDescriptor(v,x))return;const R=Reflect.get(l,x),M={value:R,enumerable:!0,configurable:!0};if(Pm.has(R))Lk(R,!1);else if(R instanceof Promise)delete M.value,M.get=()=>h(R);else if(wd.has(R)){const[N,E]=wd.get(R);M.value=s(N,E(),h)}Object.defineProperty(v,x,M)}),Object.preventExtensions(v)},o=new WeakMap,a=[1,1],c=l=>{if(!Ix(l))throw new Error("object required");const d=o.get(l);if(d)return d;let h=a[0];const g=new Set,v=(F,K=++a[0])=>{h!==K&&(h=K,g.forEach(B=>B(F,K)))};let x=a[1];const R=(F=++a[1])=>(x!==F&&!g.size&&(x=F,N.forEach(([K])=>{const B=K[1](F);B>h&&(h=B)})),h),M=F=>(K,B)=>{const _=[...K];_[1]=[F,..._[1]],v(_,B)},N=new Map,E=(F,K)=>{if((zb?"production":void 0)!=="production"&&N.has(F))throw new Error("prop listener already exists");if(g.size){const B=K[3](M(F));N.set(F,[K,B])}else N.set(F,[K])},O=F=>{var K;const B=N.get(F);B&&(N.delete(F),(K=B[1])==null||K.call(B))},L=F=>(g.add(F),g.size===1&&N.forEach(([B,_],p)=>{if((zb?"production":void 0)!=="production"&&_)throw new Error("remove already exists");const m=B[3](M(p));N.set(p,[B,m])}),()=>{g.delete(F),g.size===0&&N.forEach(([B,_],p)=>{_&&(_(),N.set(p,[B]))})}),U=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),I=e(U,{deleteProperty(F,K){const B=Reflect.get(F,K);O(K);const _=Reflect.deleteProperty(F,K);return _&&v(["delete",[K],B]),_},set(F,K,B,_){const p=Reflect.has(F,K),m=Reflect.get(F,K,_);if(p&&(t(m,B)||o.has(B)&&t(m,o.get(B))))return!0;O(K),Ix(B)&&(B=DJ(B)||B);let w=B;if(B instanceof Promise)B.then(A=>{B.status="fulfilled",B.value=A,v(["resolve",[K],A])}).catch(A=>{B.status="rejected",B.reason=A,v(["reject",[K],A])});else{!wd.has(B)&&r(B)&&(w=c(B));const A=!Pm.has(w)&&wd.get(w);A&&E(K,A)}return Reflect.set(F,K,w,_),v(["set",[K],B,m]),!0}});o.set(l,I);const T=[U,R,s,L];return wd.set(I,T),Reflect.ownKeys(l).forEach(F=>{const K=Object.getOwnPropertyDescriptor(l,F);"value"in K&&(I[F]=l[F],delete K.value,delete K.writable),Object.defineProperty(U,F,K)}),I})=>[c,wd,Pm,t,e,r,n,i,s,o,a],[BJ]=LJ();function Tn(t={}){return BJ(t)}function gs(t,e,r){const n=wd.get(t);(zb?"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 Q7(t,e){const r=wd.get(t);(zb?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}function rc(t){return Pm.add(t),t}function Cs(t,e,r,n){let i=t[e];return gs(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)})}function UJ(t){const e=Tn({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 KD={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Gi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",d="week",h="month",g="quarter",v="year",x="date",R="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"],A=m%100;return"["+m+(w[(A-20)%10]||w[A]||w[0])+"]"}},O=function(m,w,A){var P=String(m);return!P||P.length>=w?m:""+Array(w+1-P.length).join(A)+m},L={s:O,z:function(m){var w=-m.utcOffset(),A=Math.abs(w),P=Math.floor(A/60),S=A%60;return(w<=0?"+":"-")+O(P,2,"0")+":"+O(S,2,"0")},m:function m(w,A){if(w.date()1)return m(y[0])}else{var b=w.name;H[b]=w,S=b}return!P&&S&&(U=S),S||!P&&U},K=function(m,w){if(T(m))return m.clone();var A=typeof w=="object"?w:{};return A.date=m,A.args=arguments,new _(A)},B=L;B.l=F,B.i=T,B.w=function(m,w){return K(m,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var _=function(){function m(A){this.$L=F(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[I]=!0}var w=m.prototype;return w.parse=function(A){this.$d=function(P){var S=P.date,k=P.utc;if(S===null)return new Date(NaN);if(B.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)}(A),this.init()},w.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},w.$utils=function(){return B},w.isValid=function(){return this.$d.toString()!==R},w.isSame=function(A,P){var S=K(A);return this.startOf(P)<=S&&S<=this.endOf(P)},w.isAfter=function(A,P){return K(A)0,H<=U.r||!U.r){H<=1&&L>0&&(U=E[L-1]);var I=N[U.l];v&&(H=v(""+H)),R=typeof I=="string"?I.replace("%d",H):I(H,d,U.l,M);break}}if(d)return R;var T=M?N.future:N.past;return typeof T=="function"?T(R):T.replace("%s",R)},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)}}})})(ZD);var WJ=ZD.exports;const HJ=_c(WJ);var QD={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Gi,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}}})})(QD);var qJ=QD.exports;const VJ=_c(qJ);Wp.extend(HJ);Wp.extend(VJ);const KJ={...zJ,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"}};Wp.locale("en-web3-modal",KJ);const NA={getYear(t=new Date().toISOString()){return Wp(t).year()},getRelativeDateFromNow(t){return Wp(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return Wp(t).format(e)}},Ga={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t}};var GJ=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Tx=Math.ceil,Xo=Math.floor,Os="[BigNumber Error] ",Bk=Os+"Number primitive has more than 15 significant digits: ",Ba=1e14,sr=14,kx=9007199254740991,Px=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ld=1e7,ci=1e9;function YD(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,h=1e7,g=!1,v=1,x=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function E(T,F){var K,B,_,p,m,w,A,P,S=this;if(!(S instanceof E))return new E(T,F);if(F==null){if(T&&T._isBigNumber===!0){S.s=T.s,!T.c||T.e>h?S.c=S.e=null:T.e=10;m/=10,p++);p>h?S.c=S.e=null:(S.e=p,S.c=[T]);return}P=String(T)}else{if(!GJ.test(P=String(T)))return n(S,P,w);S.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(p=P.indexOf("."))>-1&&(P=P.replace(".","")),(m=P.search(/e/i))>0?(p<0&&(p=m),p+=+P.slice(m+1),P=P.substring(0,m)):p<0&&(p=P.length)}else{if(xn(F,2,M.length,"Base"),F==10&&N)return S=new E(T),H(S,o+S.e+1,a);if(P=String(T),w=typeof T=="number"){if(T*0!=0)return n(S,P,w,F);if(S.s=1/T<0?(P=P.slice(1),-1):1,E.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Bk+T)}else S.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(K=M.slice(0,F),p=m=0,A=P.length;mp){p=A;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,m=-1,p=0;continue}return n(S,String(T),w,F)}w=!1,P=r(P,F,10,S.s),(p=P.indexOf("."))>-1?P=P.replace(".",""):p=P.length}for(m=0;P.charCodeAt(m)===48;m++);for(A=P.length;P.charCodeAt(--A)===48;);if(P=P.slice(m,++A)){if(A-=m,w&&E.DEBUG&&A>15&&(T>kx||T!==Xo(T)))throw Error(Bk+S.s*T);if((p=p-m-1)>h)S.c=S.e=null;else if(p=-ci&&_<=ci&&_===Xo(_)){if(B[0]===0){if(_===0&&B.length===1)return!0;break e}if(F=(_+1)%sr,F<1&&(F+=sr),String(B[0]).length==F){for(F=0;F=Ba||K!==Xo(K))break e;if(K!==0)return!0}}}else if(B===null&&_===null&&(p===null||p===1||p===-1))return!0;throw Error(Os+"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,F=Math.random()*T&2097151?function(){return Xo(Math.random()*T)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(K){var B,_,p,m,w,A=0,P=[],S=new E(s);if(K==null?K=o:xn(K,0,ci),m=Tx(K/sr),g)if(crypto.getRandomValues){for(B=crypto.getRandomValues(new Uint32Array(m*=2));A>>11),w>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),B[A]=_[0],B[A+1]=_[1]):(P.push(w%1e14),A+=2);A=m/2}else if(crypto.randomBytes){for(B=crypto.randomBytes(m*=7);A=9e15?crypto.randomBytes(7).copy(B,A):(P.push(w%1e14),A+=7);A=m/7}else throw g=!1,Error(Os+"crypto unavailable");if(!g)for(;A=10;w/=10,A++);A_-1&&(w[m+1]==null&&(w[m+1]=0),w[m+1]+=w[m]/_|0,w[m]%=_)}return w.reverse()}return function(K,B,_,p,m){var w,A,P,S,k,y,b,V,ce=K.indexOf("."),de=o,W=a;for(ce>=0&&(S=x,x=0,K=K.replace(".",""),V=new E(B),y=V.pow(K.length-ce),x=S,V.c=F(Yl(qo(y.c),y.e,"0"),10,_,T),V.e=V.c.length),b=F(K,B,_,m?(w=M,T):(w=T,M)),P=S=b.length;b[--S]==0;b.pop());if(!b[0])return w.charAt(0);if(ce<0?--P:(y.c=b,y.e=P,y.s=p,y=e(y,V,de,W,_),b=y.c,k=y.r,P=y.e),A=P+de+1,ce=b[A],S=_/2,k=k||A<0||b[A+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[A-1]&1||W==(y.s<0?8:7)),A<1||!b[0])K=k?Yl(w.charAt(1),-de,w.charAt(0)):w.charAt(0);else{if(b.length=A,k)for(--_;++b[--A]>_;)b[A]=0,A||(++P,b=[1].concat(b));for(S=b.length;!b[--S];);for(ce=0,K="";ce<=S;K+=w.charAt(b[ce++]));K=Yl(K,P,w.charAt(0))}return K}}(),e=function(){function T(B,_,p){var m,w,A,P,S=0,k=B.length,y=_%ld,b=_/ld|0;for(B=B.slice();k--;)A=B[k]%ld,P=B[k]/ld|0,m=b*A+P*y,w=y*A+m%ld*ld+S,S=(w/p|0)+(m/ld|0)+b*P,B[k]=w%p;return S&&(B=[S].concat(B)),B}function F(B,_,p,m){var w,A;if(p!=m)A=p>m?1:-1;else for(w=A=0;w_[w]?1:-1;break}return A}function K(B,_,p,m){for(var w=0;p--;)B[p]-=w,w=B[p]<_[p]?1:0,B[p]=w*m+B[p]-_[p];for(;!B[0]&&B.length>1;B.splice(0,1));}return function(B,_,p,m,w){var A,P,S,k,y,b,V,ce,de,W,le,Y,re,ne,D,ee,ge,xe=B.s==_.s?1:-1,Ae=B.c,ke=_.c;if(!Ae||!Ae[0]||!ke||!ke[0])return new E(!B.s||!_.s||(Ae?ke&&Ae[0]==ke[0]:!ke)?NaN:Ae&&Ae[0]==0||!ke?xe*0:xe/0);for(ce=new E(xe),de=ce.c=[],P=B.e-_.e,xe=p+P+1,w||(w=Ba,P=ea(B.e/sr)-ea(_.e/sr),xe=xe/sr|0),S=0;ke[S]==(Ae[S]||0);S++);if(ke[S]>(Ae[S]||0)&&P--,xe<0)de.push(1),k=!0;else{for(ne=Ae.length,ee=ke.length,S=0,xe+=2,y=Xo(w/(ke[0]+1)),y>1&&(ke=T(ke,y,w),Ae=T(Ae,y,w),ee=ke.length,ne=Ae.length),re=ee,W=Ae.slice(0,ee),le=W.length;le=w/2&&D++;do{if(y=0,A=F(ke,W,ee,le),A<0){if(Y=W[0],ee!=le&&(Y=Y*w+(W[1]||0)),y=Xo(Y/D),y>1)for(y>=w&&(y=w-1),b=T(ke,y,w),V=b.length,le=W.length;F(b,W,V,le)==1;)y--,K(b,ee=10;xe/=10,S++);H(ce,p+(ce.e=S+P*sr-1)+1,m,k)}else ce.e=P,ce.r=+k;return ce}}();function O(T,F,K,B){var _,p,m,w,A;if(K==null?K=a:xn(K,0,8),!T.c)return T.toString();if(_=T.c[0],m=T.e,F==null)A=qo(T.c),A=B==1||B==2&&(m<=c||m>=l)?cy(A,m):Yl(A,m,"0");else if(T=H(new E(T),F,K),p=T.e,A=qo(T.c),w=A.length,B==1||B==2&&(F<=p||p<=c)){for(;ww){if(--F>0)for(A+=".";F--;A+="0");}else if(F+=p-w,F>0)for(p+1==w&&(A+=".");F--;A+="0");return T.s<0&&_?"-"+A:A}function L(T,F){for(var K,B,_=1,p=new E(T[0]);_=10;_/=10,B++);return(K=B+K*sr-1)>h?T.c=T.e=null:K=10;w/=10,_++);if(p=F-_,p<0)p+=sr,m=F,A=k[P=0],S=Xo(A/y[_-m-1]%10);else if(P=Tx((p+1)/sr),P>=k.length)if(B){for(;k.length<=P;k.push(0));A=S=0,_=1,p%=sr,m=p-sr+1}else break e;else{for(A=w=k[P],_=1;w>=10;w/=10,_++);p%=sr,m=p-sr+_,S=m<0?0:Xo(A/y[_-m-1]%10)}if(B=B||F<0||k[P+1]!=null||(m<0?A:A%y[_-m-1]),B=K<4?(S||B)&&(K==0||K==(T.s<0?3:2)):S>5||S==5&&(K==4||B||K==6&&(p>0?m>0?A/y[_-m]:0:k[P-1])%10&1||K==(T.s<0?8:7)),F<1||!k[0])return k.length=0,B?(F-=T.e+1,k[0]=y[(sr-F%sr)%sr],T.e=-F||0):k[0]=T.e=0,T;if(p==0?(k.length=P,w=1,P--):(k.length=P+1,w=y[sr-p],k[P]=m>0?Xo(A/y[_-m]%y[m])*w:0),B)for(;;)if(P==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]==Ba&&(k[0]=1));break}else{if(k[P]+=w,k[P]!=Ba)break;k[P--]=0,w=1}for(p=k.length;k[--p]===0;k.pop());}T.e>h?T.c=T.e=null:T.e=l?cy(F,K):Yl(F,K,"0"),T.s<0?"-"+F:F)}return i.absoluteValue=i.abs=function(){var T=new E(this);return T.s<0&&(T.s=1),T},i.comparedTo=function(T,F){return Yf(this,new E(T,F))},i.decimalPlaces=i.dp=function(T,F){var K,B,_,p=this;if(T!=null)return xn(T,0,ci),F==null?F=a:xn(F,0,8),H(new E(p),T+p.e+1,F);if(!(K=p.c))return null;if(B=((_=K.length-1)-ea(this.e/sr))*sr,_=K[_])for(;_%10==0;_/=10,B--);return B<0&&(B=0),B},i.dividedBy=i.div=function(T,F){return e(this,new E(T,F),o,a)},i.dividedToIntegerBy=i.idiv=function(T,F){return e(this,new E(T,F),0,1)},i.exponentiatedBy=i.pow=function(T,F){var K,B,_,p,m,w,A,P,S,k=this;if(T=new E(T),T.c&&!T.isInteger())throw Error(Os+"Exponent not an integer: "+I(T));if(F!=null&&(F=new E(F)),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-ay(T)):+I(T))),F?S.mod(F):S;if(A=T.s<0,F){if(F.c?!F.c[0]:!F.s)return new E(NaN);B=!A&&k.isInteger()&&F.isInteger(),B&&(k=k.mod(F))}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&&ay(T)?-0:0,k.e>-1&&(p=1/p),new E(A?1/p:p);x&&(p=Tx(x/sr+2))}for(w?(K=new E(.5),A&&(T.s=1),P=ay(T)):(_=Math.abs(+I(T)),P=_%2),S=new E(s);;){if(P){if(S=S.times(k),!S.c)break;p?S.c.length>p&&(S.c.length=p):B&&(S=S.mod(F))}if(_){if(_=Xo(_/2),_===0)break;P=_%2}else if(T=T.times(K),H(T,T.e+1,1),T.e>14)P=ay(T);else{if(_=+I(T),_===0)break;P=_%2}k=k.times(k),p?k.c&&k.c.length>p&&(k.c.length=p):B&&(k=k.mod(F))}return B?S:(A&&(S=s.div(S)),F?S.mod(F):p?H(S,x,a,m):S)},i.integerValue=function(T){var F=new E(this);return T==null?T=a:xn(T,0,8),H(F,F.e+1,T)},i.isEqualTo=i.eq=function(T,F){return Yf(this,new E(T,F))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(T,F){return Yf(this,new E(T,F))>0},i.isGreaterThanOrEqualTo=i.gte=function(T,F){return(F=Yf(this,new E(T,F)))===1||F===0},i.isInteger=function(){return!!this.c&&ea(this.e/sr)>this.c.length-2},i.isLessThan=i.lt=function(T,F){return Yf(this,new E(T,F))<0},i.isLessThanOrEqualTo=i.lte=function(T,F){return(F=Yf(this,new E(T,F)))===-1||F===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,F){var K,B,_,p,m=this,w=m.s;if(T=new E(T,F),F=T.s,!w||!F)return new E(NaN);if(w!=F)return T.s=-F,m.plus(T);var A=m.e/sr,P=T.e/sr,S=m.c,k=T.c;if(!A||!P){if(!S||!k)return S?(T.s=-F,T):new E(k?m:NaN);if(!S[0]||!k[0])return k[0]?(T.s=-F,T):new E(S[0]?m:a==3?-0:0)}if(A=ea(A),P=ea(P),S=S.slice(),w=A-P){for((p=w<0)?(w=-w,_=S):(P=A,_=k),_.reverse(),F=w;F--;_.push(0));_.reverse()}else for(B=(p=(w=S.length)<(F=k.length))?w:F,w=F=0;F0)for(;F--;S[K++]=0);for(F=Ba-1;B>w;){if(S[--B]=0;){for(K=0,y=Y[_]%de,b=Y[_]/de|0,m=A,p=_+m;p>_;)P=le[--m]%de,S=le[m]/de|0,w=b*P+S*y,P=y*P+w%de*de+V[p]+K,K=(P/ce|0)+(w/de|0)+b*S,V[p--]=P%ce;V[p]=K}return K?++B:V.splice(0,1),U(T,V,B)},i.negated=function(){var T=new E(this);return T.s=-T.s||null,T},i.plus=function(T,F){var K,B=this,_=B.s;if(T=new E(T,F),F=T.s,!_||!F)return new E(NaN);if(_!=F)return T.s=-F,B.minus(T);var p=B.e/sr,m=T.e/sr,w=B.c,A=T.c;if(!p||!m){if(!w||!A)return new E(_/0);if(!w[0]||!A[0])return A[0]?T:new E(w[0]?B:_*0)}if(p=ea(p),m=ea(m),w=w.slice(),_=p-m){for(_>0?(m=p,K=A):(_=-_,K=w),K.reverse();_--;K.push(0));K.reverse()}for(_=w.length,F=A.length,_-F<0&&(K=A,A=w,w=K,F=_),_=0;F;)_=(w[--F]=w[F]+A[F]+_)/Ba|0,w[F]=Ba===w[F]?0:w[F]%Ba;return _&&(w=[_].concat(w),++m),U(T,w,m)},i.precision=i.sd=function(T,F){var K,B,_,p=this;if(T!=null&&T!==!!T)return xn(T,1,ci),F==null?F=a:xn(F,0,8),H(new E(p),T,F);if(!(K=p.c))return null;if(_=K.length-1,B=_*sr+1,_=K[_]){for(;_%10==0;_/=10,B--);for(_=K[0];_>=10;_/=10,B++);}return T&&p.e+1>B&&(B=p.e+1),B},i.shiftedBy=function(T){return xn(T,-kx,kx),this.times("1e"+T)},i.squareRoot=i.sqrt=function(){var T,F,K,B,_,p=this,m=p.c,w=p.s,A=p.e,P=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?(F=qo(m),(F.length+A)%2==0&&(F+="0"),w=Math.sqrt(+F),A=ea((A+1)/2)-(A<0||A%2),w==1/0?F="5e"+A:(F=w.toExponential(),F=F.slice(0,F.indexOf("e")+1)+A),K=new E(F)):K=new E(w+""),K.c[0]){for(A=K.e,w=A+P,w<3&&(w=0);;)if(_=K,K=S.times(_.plus(e(p,_,P,1))),qo(_.c).slice(0,w)===(F=qo(K.c)).slice(0,w))if(K.e0&&V>0){for(p=V%w||w,S=b.substr(0,p);p0&&(S+=P+b.slice(p)),y&&(S="-"+S)}B=k?S+(K.decimalSeparator||"")+((A=+K.fractionGroupSize)?k.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(K.fractionGroupSeparator||"")):k):S}return(K.prefix||"")+B+(K.suffix||"")},i.toFraction=function(T){var F,K,B,_,p,m,w,A,P,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(Os+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+I(w));if(!V)return new E(b);for(F=new E(s),P=K=new E(s),B=A=new E(s),y=qo(V),p=F.e=y.length-b.e-1,F.c[0]=Px[(m=p%sr)<0?sr+m:m],T=!T||w.comparedTo(F)>0?p>0?F:P:w,m=h,h=1/0,w=new E(y),A.c[0]=0;S=e(w,F,0,1),_=K.plus(S.times(B)),_.comparedTo(T)!=1;)K=B,B=_,P=A.plus(S.times(_=P)),A=_,F=w.minus(S.times(_=F)),w=_;return _=e(T.minus(K),B,0,1),A=A.plus(_.times(P)),K=K.plus(_.times(B)),A.s=P.s=b.s,p=p*2,k=e(P,B,p,a).minus(b).abs().comparedTo(e(A,K,p,a).minus(b).abs())<1?[P,B]:[A,K],h=m,k},i.toNumber=function(){return+I(this)},i.toPrecision=function(T,F){return T!=null&&xn(T,1,ci),O(this,T,F,2)},i.toString=function(T){var F,K=this,B=K.s,_=K.e;return _===null?B?(F="Infinity",B<0&&(F="-"+F)):F="NaN":(T==null?F=_<=c||_>=l?cy(qo(K.c),_):Yl(qo(K.c),_,"0"):T===10&&N?(K=H(new E(K),o+_+1,a),F=Yl(qo(K.c),K.e,"0")):(xn(T,2,M.length,"Base"),F=r(Yl(qo(K.c),_,"0"),10,T,B,!0)),B<0&&K.c[0]&&(F="-"+F)),F},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 ea(t){var e=t|0;return t>0||t===e?e:e-1}function qo(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 xn(t,e,r,n){if(tr||t!==Xo(t))throw Error(Os+(n||"Argument")+(typeof t=="number"?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function ay(t){var e=t.c.length-1;return ea(t.e/sr)==e&&t.c[e]%2!=0}function cy(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Yl(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"&&!h&&!g&&s==="0"&&t.preventDefault(),e==="0"&&v&&(r(s),t.preventDefault()),(h||g)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!v&&!n.includes(s)&&!g&&!h&&t.preventDefault()}},QJ=[{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"}],MA={URLS:{FAQ:"https://walletconnect.com/faq"}},yn={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"}},rn={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"},nn={setItem(t,e){uy()&&localStorage.setItem(t,e)},getItem(t){if(uy())return localStorage.getItem(t)||void 0},removeItem(t){uy()&&localStorage.removeItem(t)},clear(){uy()&&localStorage.clear()}};function uy(){return typeof window<"u"&&typeof localStorage<"u"}function mu(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 YJ(t){return(t==null?void 0:t.endsWith(yn.WC_NAME_SUFFIX_LEGACY))||(t==null?void 0:t.endsWith(yn.WC_NAME_SUFFIX))}const JJ="rpc.walletconnect.org",Sw={extendRpcUrlWithProjectId(t,e){if(t.includes(JJ)){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:Sw.extendRpcUrlWithProjectId(t.rpcUrl,n)}},extendCaipNetworks(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return t.map(i=>Sw.extendCaipNetwork(i,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}))}},Rx="https://secure.walletconnect.org",JD=[{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"]}],XJ="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",Sn={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:Rx,SECURE_SITE_DASHBOARD:`${Rx}/dashboard`,SECURE_SITE_FAVICON:`${Rx}/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}},Be={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 Be.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return Be.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Sn.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Sn.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Sn.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(Be.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(!Be.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,Be.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 yn.W3M_API_URL},getBlockchainApiUrl(){return yn.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return yn.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 sm(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class A6{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 sm(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await sm(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await sm(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 sm(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 sm(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 un=Tn({features:Sn.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),qe={state:un,subscribeKey(t,e){return Cs(un,t,e)},setOptions(t){Object.assign(un,t)},setFeatures(t){t&&Object.entries(t).forEach(([e,r])=>{un.features||(un.features=Sn.DEFAULT_FEATURES),e in un.features&&(un.features[e]=r)})},setProjectId(t){un.projectId=t},setAllWallets(t){un.allWallets=t},setIncludeWalletIds(t){un.includeWalletIds=t},setExcludeWalletIds(t){un.excludeWalletIds=t},setFeaturedWalletIds(t){un.featuredWalletIds=t},setTokens(t){un.tokens=t},setTermsConditionsUrl(t){un.termsConditionsUrl=t},setPrivacyPolicyUrl(t){un.privacyPolicyUrl=t},setCustomWallets(t){un.customWallets=t},setIsSiweEnabled(t){un.isSiweEnabled=t},setIsUniversalProvider(t){un.isUniversalProvider=t},setSdkVersion(t){un.sdkVersion=t},setMetadata(t){un.metadata=t},setDisableAppend(t){un.disableAppend=t},setEIP6963Enabled(t){un.enableEIP6963=t},setEnableWalletConnect(t){un.enableWalletConnect=t},setEnableWallets(t){un.enableWallets=t},setHasMultipleAddresses(t){un.hasMultipleAddresses=t}},eX=Be.getAnalyticsUrl(),tX=new A6({baseUrl:eX,clientId:null}),rX=["MODAL_CREATED"],sp=Tn({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),ot={state:sp,subscribe(t){return gs(sp,()=>t(sp))},_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(rX.includes(t.data.event)||typeof window>"u")return;await tX.post({path:"/e",headers:ot._getApiHeaders(),body:{eventId:Be.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){var e;sp.timestamp=Date.now(),sp.data=t,(e=qe.state.features)!=null&&e.analytics&&ot._sendAnalyticsEvent(sp)}},Uk=Tn({supportsAllNetworks:!0,smartAccountEnabledNetworks:[]}),Zt={state:Uk,replaceState(t){t&&Object.assign(Uk,rc(t))},subscribeKey(t,e){let r;return pe.subscribeChainProp("networkState",n=>{if(n){const i=n[t];r!==i&&(r=i,e(i))}})},_getClient(){return pe.getNetworkControllerClient()},setActiveCaipNetwork(t){if(!t)return;pe.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");pe.setCaipNetwork(t==null?void 0:t.chainNamespace,t)}},setRequestedCaipNetworks(t,e){pe.setChainNetworkData(e,{requestedCaipNetworks:t})},setAllowUnsupportedChain(t,e){pe.setChainNetworkData(e||pe.state.activeChain,{allowUnsupportedCaipNetwork:t})},setSmartAccountEnabledNetworks(t,e){pe.setChainNetworkData(e,{smartAccountEnabledNetworks:t})},getRequestedCaipNetworks(t){let e;if(!pe.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=[...pe.state.chains.keys()];const r=[],n=[];return e.forEach(s=>{var o,a,c,l,d,h,g,v;(a=(o=pe.state.chains.get(s))==null?void 0:o.networkState)!=null&&a.approvedCaipNetworkIds&&r.push(...((l=(c=pe.state.chains.get(s))==null?void 0:c.networkState)==null?void 0:l.approvedCaipNetworkIds)||[]),(h=(d=pe.state.chains.get(s))==null?void 0:d.networkState)!=null&&h.requestedCaipNetworks&&n.push(...((v=(g=pe.state.chains.get(s))==null?void 0:g.networkState)==null?void 0:v.requestedCaipNetworks)||[])}),Be.sortRequestedNetworks(r,n)},async switchActiveNetwork(t){const e=pe.getNetworkControllerClient(t==null?void 0:t.chainNamespace);e&&await e.switchCaipNetwork(t),pe.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=pe.state.chains.get(i))==null?void 0:r.networkState)==null?void 0:n.approvedCaipNetworkIds}const e=[];return Object.values(pe.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=pe.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());if(!t)throw new Error("chain is required to set approved network data");pe.setChainNetworkData(t,{approvedCaipNetworkIds:r==null?void 0:r.approvedCaipNetworkIds,supportsAllNetworks:r==null?void 0:r.supportsAllNetworks})},checkIfSupportedNetwork(){const t=pe.state.activeChain;if(!t)return!1;const e=pe.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=Ga.caipNetworkIdToNumber((n=pe.state.activeCaipNetwork)==null?void 0:n.id);if(!pe.state.activeChain)throw new Error("activeChain is required to check if smart account is enabled");if(!t)return!1;const r=pe.getNetworkProp("smartAccountEnabledNetworks");return!!(r!=null&&r.includes(Number(t)))},resetNetwork(){const t=pe.state.activeChain;if(!t)throw new Error("chain is required to reset network");pe.setChainNetworkData(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},getSupportsAllNetworks(){var e,r;const t=pe.state.activeChain;if(!t)throw new Error("chain is required to check if network supports all networks");return(r=(e=pe.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=Sn.NATIVE_TOKEN_ADDRESS[((e=pe.state.activeCaipNetwork)==null?void 0:e.chainNamespace)||"eip155"];return`${((r=pe.state.activeCaipNetwork)==null?void 0:r.id)||"eip155:1"}:${t}`}},nX={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"}]}]},XD=Be.getBlockchainApiUrl(),Gn=Tn({clientId:null,api:new A6({baseUrl:XD,clientId:null})}),vn={state:Gn,fetchIdentity({address:t}){return Gn.api.get({path:`/v1/identity/${t}`,params:{projectId:qe.state.projectId,sender:pe.state.activeCaipAddress?Be.getPlainAddress(pe.state.activeCaipAddress):void 0}})},fetchTransactions({account:t,projectId:e,cursor:r,onramp:n,signal:i,cache:s,chainId:o}){return Gn.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 Gn.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 Gn.api.get({path:"/v1/convert/tokens",params:{projectId:t,chainId:e}})},fetchTokenPrice({projectId:t,addresses:e}){return Gn.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 Gn.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 Gn.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 Gn.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Sn.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 Gn.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 Gn.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 Gn.api.get({path:`/v1/profile/account/${t}`,params:{projectId:qe.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:t}){return Gn.api.get({path:`/v1/profile/reverse/${t}`,params:{sender:Ee.state.address,projectId:qe.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(t){return Gn.api.get({path:`/v1/profile/suggestions/${t}`,params:{projectId:qe.state.projectId}})},async registerEnsName({coinType:t,address:e,message:r,signature:n}){return Gn.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 Gn.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 Gn.api.get({path:"/v1/onramp/options",params:{projectId:qe.state.projectId}})}catch{return nX}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){try{return await Gn.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){Gn.clientId=t,Gn.api=new A6({baseUrl:XD,clientId:t})}},Vo=Tn({message:"",variant:"success",open:!1}),St={state:Vo,subscribeKey(t,e){return Cs(Vo,t,e)},showLoading(t){Vo.message=t,Vo.variant="loading",Vo.open=!0},showSuccess(t){Vo.message=t,Vo.variant="success",Vo.open=!0},showError(t){const e=Be.parseError(t);Vo.message=e,Vo.variant="error",Vo.open=!0},hide(){Vo.open=!1}};var eL={},E6={};E6.byteLength=oX;E6.toByteArray=cX;E6.fromByteArray=dX;var rl=[],na=[],iX=typeof Uint8Array<"u"?Uint8Array:Array,Nx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var op=0,sX=Nx.length;op0)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 oX(t){var e=tL(t),r=e[0],n=e[1];return(r+n)*3/4-n}function aX(t,e,r){return(e+r)*3/4-r}function cX(t){var e,r=tL(t),n=r[0],i=r[1],s=new iX(aX(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=na[t.charCodeAt(c)]<<2|na[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=na[t.charCodeAt(c)]<<10|na[t.charCodeAt(c+1)]<<4|na[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function lX(t){return rl[t>>18&63]+rl[t>>12&63]+rl[t>>6&63]+rl[t&63]}function uX(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(rl[e>>2]+rl[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(rl[e>>10]+rl[e>>4&63]+rl[e<<2&63]+"=")),i.join("")}var OA={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */OA.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,d=-7,h=r?i-1:0,g=r?-1:1,v=t[e+h];for(h+=g,s=v&(1<<-d)-1,v>>=-d,d+=a;d>0;s=s*256+t[e+h],h+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+h],h+=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)};OA.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,R=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+h>=1?e+=g/c:e+=g*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=d?(a=0,o=d):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o=o+h):(a=e*Math.pow(2,h-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]|=R*128};/*! +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Cx(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function $7(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var aJ=typeof WeakMap=="function"?WeakMap:Map;function vD(t,e,r){r=bu(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Bb||(Bb=!0,q7=n),$7(t,e)},r}function yD(t,e,r){r=bu(-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(){$7(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){$7(t,e),typeof n!="function"&&(Hd===null?Hd=new Set([this]):Hd.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function mk(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new aJ;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=xJ.bind(null,t,e,r),e.then(t,t))}function wk(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 vk(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=bu(-1,1),e.tag=2,Wd(r,e,1))),r.lanes|=1),t)}var cJ=qu.ReactCurrentOwner,Fs=!1;function ls(t,e,r,n){e.child=t===null?G$(e,null,r,n):d1(e,t.child,r,n)}function yk(t,e,r,n,i){r=r.render;var s=e.ref;return Fp(e,i),n=gA(t,e,r,n,s,i),r=mA(),t!==null&&!Fs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Iu(t,e,i)):(wn&&r&&nA(e),e.flags|=1,ls(t,e,n,i),e.child)}function bk(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!SA(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,bD(t,e,s,n,i)):(t=Qy(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:mw,r(o,n)&&t.ref===e.ref)return Iu(t,e,i)}return e.flags|=1,t=Vd(s,n),t.ref=e.ref,t.return=e,e.child=t}function bD(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(mw(s,n)&&t.ref===e.ref)if(Fs=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(Fs=!0);else return e.lanes=t.lanes,Iu(t,e,i)}return D7(t,e,r,n,i)}function xD(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},sn(Rp,lo),lo|=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,sn(Rp,lo),lo|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,sn(Rp,lo),lo|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,sn(Rp,lo),lo|=n;return ls(t,e,i,r),e.child}function _D(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function D7(t,e,r,n,i){var s=Hs(r)?Ph:Xi.current;return s=l1(e,s),Fp(e,i),r=gA(t,e,r,n,s,i),n=mA(),t!==null&&!Fs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Iu(t,e,i)):(wn&&n&&nA(e),e.flags|=1,ls(t,e,r,i),e.child)}function xk(t,e,r,n,i){if(Hs(r)){var s=!0;Tb(e)}else s=!1;if(Fp(e,i),e.stateNode===null)Ky(t,e),wD(e,r,n),O7(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=ha(l):(l=Hs(r)?Ph:Xi.current,l=l1(e,l));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||c!==l)&&gk(e,o,n,l),md=!1;var g=e.memoizedState;o.state=g,Mb(e,n,o,i),c=e.memoizedState,a!==n||g!==c||Ws.current||md?(typeof d=="function"&&(M7(e,r,d,n),c=e.memoizedState),(a=md||pk(e,r,a,n,g,c,l))?(h||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,Q$(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:Ka(e.type,a),o.props=l,h=e.pendingProps,g=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=ha(c):(c=Hs(r)?Ph:Xi.current,c=l1(e,c));var v=r.getDerivedStateFromProps;(d=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||g!==c)&&gk(e,o,n,c),md=!1,g=e.memoizedState,o.state=g,Mb(e,n,o,i);var x=e.memoizedState;a!==h||g!==x||Ws.current||md?(typeof v=="function"&&(M7(e,r,v,n),x=e.memoizedState),(l=md||pk(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 L7(t,e,r,n,s,i)}function L7(t,e,r,n,i,s){_D(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&ok(e,r,!1),Iu(t,e,s);n=e.stateNode,cJ.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=d1(e,t.child,null,s),e.child=d1(e,null,a,s)):ls(t,e,a,s),e.memoizedState=n.state,i&&ok(e,r,!0),e.child}function CD(t){var e=t.stateNode;e.pendingContext?sk(t,e.pendingContext,e.pendingContext!==e.context):e.context&&sk(t,e.context,!1),dA(t,e.containerInfo)}function _k(t,e,r,n,i){return u1(),sA(i),e.flags|=256,ls(t,e,r,n),e.child}var B7={dehydrated:null,treeContext:null,retryLane:0};function U7(t){return{baseLanes:t,cachePool:null,transitions:null}}function AD(t,e,r){var n=e.pendingProps,i=Cn.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),sn(Cn,i&1),t===null)return R7(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=y6(o,n,0,null),t=Ah(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=U7(r),e.memoizedState=B7,t):yA(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return lJ(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=Vd(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Vd(a,s):(s=Ah(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?U7(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=B7,n}return s=t.child,t=s.sibling,n=Vd(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 yA(t,e){return e=y6({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function ny(t,e,r,n){return n!==null&&sA(n),d1(e,t.child,null,r),t=yA(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function lJ(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Cx(Error(We(422))),ny(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=y6({mode:"visible",children:n.children},i,0,null),s=Ah(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&d1(e,t.child,null,o),e.child.memoizedState=U7(o),e.memoizedState=B7,s);if(!(e.mode&1))return ny(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=Cx(s,n,void 0),ny(t,e,o,n)}if(a=(o&t.childLanes)!==0,Fs||a){if(n=mi,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,Su(t,i),ac(n,t,i,-1))}return EA(),n=Cx(Error(We(421))),ny(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=_J.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,ho=zd(i.nextSibling),mo=e,wn=!0,tc=null,t!==null&&(ca[la++]=pu,ca[la++]=gu,ca[la++]=Rh,pu=t.id,gu=t.overflow,Rh=e),e=yA(e,n.children),e.flags|=4096,e)}function Ck(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),N7(t.return,e,r)}function Ax(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 ED(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(ls(t,e,n.children,r),n=Cn.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&&Ck(t,r,e);else if(t.tag===19)Ck(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(sn(Cn,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&&Ob(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Ax(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&&Ob(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Ax(e,!0,r,null,s);break;case"together":Ax(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Ky(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Iu(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Mh|=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=Vd(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Vd(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function uJ(t,e,r){switch(e.tag){case 3:CD(e),u1();break;case 5:Y$(e);break;case 1:Hs(e.type)&&Tb(e);break;case 4:dA(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;sn(Rb,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(sn(Cn,Cn.current&1),e.flags|=128,null):r&e.child.childLanes?AD(t,e,r):(sn(Cn,Cn.current&1),t=Iu(t,e,r),t!==null?t.sibling:null);sn(Cn,Cn.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return ED(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),sn(Cn,Cn.current),n)break;return null;case 22:case 23:return e.lanes=0,xD(t,e,r)}return Iu(t,e,r)}var SD,j7,ID,TD;SD=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}};j7=function(){};ID=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,dh(il.current);var s=null;switch(r){case"input":i=c7(t,i),n=c7(t,n),s=[];break;case"select":i=In({},i,{value:void 0}),n=In({},n,{value:void 0}),s=[];break;case"textarea":i=d7(t,i),n=d7(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Sb)}h7(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"&&(lw.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"&&(lw.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&dn("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)}};TD=function(t,e,r,n){r!==n&&(e.flags|=4)};function nm(t,e){if(!wn)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 zi(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 dJ(t,e,r){var n=e.pendingProps;switch(iA(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zi(e),null;case 1:return Hs(e.type)&&Ib(),zi(e),null;case 3:return n=e.stateNode,f1(),pn(Ws),pn(Xi),hA(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ty(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,tc!==null&&(G7(tc),tc=null))),j7(t,e),zi(e),null;case 5:fA(e);var i=dh(xw.current);if(r=e.type,t!==null&&e.stateNode!=null)ID(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 zi(e),null}if(t=dh(il.current),ty(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[tl]=e,n[yw]=s,t=(e.mode&1)!==0,r){case"dialog":dn("cancel",n),dn("close",n);break;case"iframe":case"object":case"embed":dn("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[tl]=e,t[yw]=n,SD(t,e,!1,!1),e.stateNode=t;e:{switch(o=p7(r,n),r){case"dialog":dn("cancel",t),dn("close",t),i=n;break;case"iframe":case"object":case"embed":dn("load",t),i=n;break;case"video":case"audio":for(i=0;ip1&&(e.flags|=128,n=!0,nm(s,!1),e.lanes=4194304)}else{if(!n)if(t=Ob(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),nm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!wn)return zi(e),null}else 2*Wn()-s.renderingStartTime>p1&&r!==1073741824&&(e.flags|=128,n=!0,nm(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=Wn(),e.sibling=null,r=Cn.current,sn(Cn,n?r&1|2:r&1),e):(zi(e),null);case 22:case 23:return AA(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?lo&1073741824&&(zi(e),e.subtreeFlags&6&&(e.flags|=8192)):zi(e),null;case 24:return null;case 25:return null}throw Error(We(156,e.tag))}function fJ(t,e){switch(iA(e),e.tag){case 1:return Hs(e.type)&&Ib(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return f1(),pn(Ws),pn(Xi),hA(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return fA(e),null;case 13:if(pn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(We(340));u1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return pn(Cn),null;case 4:return f1(),null;case 10:return cA(e.type._context),null;case 22:case 23:return AA(),null;case 24:return null;default:return null}}var iy=!1,Zi=!1,hJ=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Pp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Mn(t,e,n)}else r.current=null}function F7(t,e,r){try{r()}catch(n){Mn(t,e,n)}}var Ak=!1;function pJ(t,e){if(A7=Cb,t=M$(),rA(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,h=t,g=null;t:for(;;){for(var v;h!==r||i!==0&&h.nodeType!==3||(a=o+i),h!==s||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(v=h.firstChild)!==null;)g=h,h=v;for(;;){if(h===t)break t;if(g===r&&++l===i&&(a=o),g===s&&++d===n&&(c=o),(v=h.nextSibling)!==null)break;h=g,g=h.parentNode}h=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(E7={focusedElem:t,selectionRange:r},Cb=!1,Ct=e;Ct!==null;)if(e=Ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ct=t;else for(;Ct!==null;){e=Ct;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 R=x.memoizedProps,M=x.memoizedState,N=e.stateNode,E=N.getSnapshotBeforeUpdate(e.elementType===e.type?R:Ka(e.type,R),M);N.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var O=e.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(We(163))}}catch(L){Mn(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,Ct=t;break}Ct=e.return}return x=Ak,Ak=!1,x}function Wm(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&&F7(e,r,s)}i=i.next}while(i!==n)}}function w6(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 z7(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 kD(t){var e=t.alternate;e!==null&&(t.alternate=null,kD(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[tl],delete e[yw],delete e[T7],delete e[QY],delete e[YY])),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 PD(t){return t.tag===5||t.tag===3||t.tag===4}function Ek(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||PD(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 W7(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=Sb));else if(n!==4&&(t=t.child,t!==null))for(W7(t,e,r),t=t.sibling;t!==null;)W7(t,e,r),t=t.sibling}function H7(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(H7(t,e,r),t=t.sibling;t!==null;)H7(t,e,r),t=t.sibling}var Ci=null,Ja=!1;function cd(t,e,r){for(r=r.child;r!==null;)RD(t,e,r),r=r.sibling}function RD(t,e,r){if(nl&&typeof nl.onCommitFiberUnmount=="function")try{nl.onCommitFiberUnmount(l6,r)}catch{}switch(r.tag){case 5:Zi||Pp(r,e);case 6:var n=Ci,i=Ja;Ci=null,cd(t,e,r),Ci=n,Ja=i,Ci!==null&&(Ja?(t=Ci,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ci.removeChild(r.stateNode));break;case 18:Ci!==null&&(Ja?(t=Ci,r=r.stateNode,t.nodeType===8?wx(t.parentNode,r):t.nodeType===1&&wx(t,r),pw(t)):wx(Ci,r.stateNode));break;case 4:n=Ci,i=Ja,Ci=r.stateNode.containerInfo,Ja=!0,cd(t,e,r),Ci=n,Ja=i;break;case 0:case 11:case 14:case 15:if(!Zi&&(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)&&F7(r,e,o),i=i.next}while(i!==n)}cd(t,e,r);break;case 1:if(!Zi&&(Pp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Mn(r,e,a)}cd(t,e,r);break;case 21:cd(t,e,r);break;case 22:r.mode&1?(Zi=(n=Zi)||r.memoizedState!==null,cd(t,e,r),Zi=n):cd(t,e,r);break;default:cd(t,e,r)}}function Sk(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new hJ),e.forEach(function(n){var i=CJ.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function La(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Wn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*mJ(n/1960))-n,10t?16:t,$d===null)var n=!1;else{if(t=$d,$d=null,Ub=0,Nr&6)throw Error(We(331));var i=Nr;for(Nr|=4,Ct=t.current;Ct!==null;){var s=Ct,o=s.child;if(Ct.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cWn()-_A?Ch(t,0):xA|=r),qs(t,e)}function UD(t,e){e===0&&(t.mode&1?(e=Z3,Z3<<=1,!(Z3&130023424)&&(Z3=4194304)):e=1);var r=hs();t=Su(t,e),t!==null&&(Gv(t,e,r),qs(t,r))}function _J(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),UD(t,r)}function CJ(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),UD(t,r)}var jD;jD=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ws.current)Fs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Fs=!1,uJ(t,e,r);Fs=!!(t.flags&131072)}else Fs=!1,wn&&e.flags&1048576&&H$(e,Pb,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Ky(t,e),t=e.pendingProps;var i=l1(e,Xi.current);Fp(e,r),i=gA(null,e,n,t,i,r);var s=mA();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,Hs(n)?(s=!0,Tb(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,uA(e),i.updater=m6,e.stateNode=i,i._reactInternals=e,O7(e,n,t,r),e=L7(null,e,n,!0,s,r)):(e.tag=0,wn&&s&&nA(e),ls(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Ky(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=EJ(n),t=Ka(n,t),i){case 0:e=D7(null,e,n,t,r);break e;case 1:e=xk(null,e,n,t,r);break e;case 11:e=yk(null,e,n,t,r);break e;case 14:e=bk(null,e,n,Ka(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:Ka(n,i),D7(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),xk(t,e,n,i,r);case 3:e:{if(CD(e),t===null)throw Error(We(387));n=e.pendingProps,s=e.memoizedState,i=s.element,Q$(t,e),Mb(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=h1(Error(We(423)),e),e=_k(t,e,n,r,i);break e}else if(n!==i){i=h1(Error(We(424)),e),e=_k(t,e,n,r,i);break e}else for(ho=zd(e.stateNode.containerInfo.firstChild),mo=e,wn=!0,tc=null,r=G$(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(u1(),n===i){e=Iu(t,e,r);break e}ls(t,e,n,r)}e=e.child}return e;case 5:return Y$(e),t===null&&R7(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,S7(n,i)?o=null:s!==null&&S7(n,s)&&(e.flags|=32),_D(t,e),ls(t,e,o,r),e.child;case 6:return t===null&&R7(e),null;case 13:return AD(t,e,r);case 4:return dA(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=d1(e,null,n,r):ls(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),yk(t,e,n,i,r);case 7:return ls(t,e,e.pendingProps,r),e.child;case 8:return ls(t,e,e.pendingProps.children,r),e.child;case 12:return ls(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,sn(Rb,n._currentValue),n._currentValue=o,s!==null)if(dc(s.value,o)){if(s.children===i.children&&!Ws.current){e=Iu(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=bu(-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),N7(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),N7(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}ls(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Fp(e,r),i=ha(i),n=n(i),e.flags|=1,ls(t,e,n,r),e.child;case 14:return n=e.type,i=Ka(n,e.pendingProps),i=Ka(n.type,i),bk(t,e,n,i,r);case 15:return bD(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ka(n,i),Ky(t,e),e.tag=1,Hs(n)?(t=!0,Tb(e)):t=!1,Fp(e,r),wD(e,n,i),O7(e,n,i,r),L7(null,e,n,!0,t,r);case 19:return ED(t,e,r);case 22:return xD(t,e,r)}throw Error(We(156,e.tag))};function FD(t,e){return p$(t,e)}function AJ(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 da(t,e,r,n){return new AJ(t,e,r,n)}function SA(t){return t=t.prototype,!(!t||!t.isReactComponent)}function EJ(t){if(typeof t=="function")return SA(t)?1:0;if(t!=null){if(t=t.$$typeof,t===qC)return 11;if(t===VC)return 14}return 2}function Vd(t,e){var r=t.alternate;return r===null?(r=da(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 Qy(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")SA(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case xp:return Ah(r.children,i,s,e);case HC:o=8,i|=8;break;case i7:return t=da(12,r,e,i|2),t.elementType=i7,t.lanes=s,t;case s7:return t=da(13,r,e,i),t.elementType=s7,t.lanes=s,t;case o7:return t=da(19,r,e,i),t.elementType=o7,t.lanes=s,t;case YO:return y6(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ZO:o=10;break e;case QO:o=9;break e;case qC:o=11;break e;case VC:o=14;break e;case gd:o=16,n=null;break e}throw Error(We(130,t==null?t:typeof t,""))}return e=da(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Ah(t,e,r,n){return t=da(7,t,n,e),t.lanes=r,t}function y6(t,e,r,n){return t=da(22,t,n,e),t.elementType=YO,t.lanes=r,t.stateNode={isHidden:!1},t}function Ex(t,e,r){return t=da(6,t,null,e),t.lanes=r,t}function Sx(t,e,r){return e=da(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function SJ(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=ox(0),this.expirationTimes=ox(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ox(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IA(t,e,r,n,i,s,o,a,c){return t=new SJ(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=da(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},uA(s),t}function IJ(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qD)}catch(t){console.error(t)}}qD(),qO.exports=So;var RA=qO.exports;const UCe=_c(RA);var VD,Ok=RA;VD=Ok.createRoot,Ok.hydrateRoot;const NJ="modulepreload",MJ=function(t){return"/"+t},$k={},Dn=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=MJ(c),c in $k)return;$k[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":NJ,l||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),l)return new Promise((g,v)=>{h.addEventListener("load",g),h.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)})},OJ=Symbol(),Dk=Object.getPrototypeOf,Z7=new WeakMap,$J=t=>t&&(Z7.has(t)?Z7.get(t):Dk(t)===Object.prototype||Dk(t)===Array.prototype),DJ=t=>$J(t)&&t[OJ]||null,Lk=(t,e=!0)=>{Z7.set(t,e)},zb={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"},Ix=t=>typeof t=="object"&&t!==null,wd=new WeakMap,Pm=new WeakSet,LJ=(t=Object.is,e=(l,d)=>new Proxy(l,d),r=l=>Ix(l)&&!Pm.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,h=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 Lk(v,!0),i.set(l,[d,v]),Reflect.ownKeys(l).forEach(x=>{if(Object.getOwnPropertyDescriptor(v,x))return;const R=Reflect.get(l,x),M={value:R,enumerable:!0,configurable:!0};if(Pm.has(R))Lk(R,!1);else if(R instanceof Promise)delete M.value,M.get=()=>h(R);else if(wd.has(R)){const[N,E]=wd.get(R);M.value=s(N,E(),h)}Object.defineProperty(v,x,M)}),Object.preventExtensions(v)},o=new WeakMap,a=[1,1],c=l=>{if(!Ix(l))throw new Error("object required");const d=o.get(l);if(d)return d;let h=a[0];const g=new Set,v=(F,K=++a[0])=>{h!==K&&(h=K,g.forEach(B=>B(F,K)))};let x=a[1];const R=(F=++a[1])=>(x!==F&&!g.size&&(x=F,N.forEach(([K])=>{const B=K[1](F);B>h&&(h=B)})),h),M=F=>(K,B)=>{const _=[...K];_[1]=[F,..._[1]],v(_,B)},N=new Map,E=(F,K)=>{if((zb?"production":void 0)!=="production"&&N.has(F))throw new Error("prop listener already exists");if(g.size){const B=K[3](M(F));N.set(F,[K,B])}else N.set(F,[K])},O=F=>{var K;const B=N.get(F);B&&(N.delete(F),(K=B[1])==null||K.call(B))},L=F=>(g.add(F),g.size===1&&N.forEach(([B,_],p)=>{if((zb?"production":void 0)!=="production"&&_)throw new Error("remove already exists");const m=B[3](M(p));N.set(p,[B,m])}),()=>{g.delete(F),g.size===0&&N.forEach(([B,_],p)=>{_&&(_(),N.set(p,[B]))})}),U=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),I=e(U,{deleteProperty(F,K){const B=Reflect.get(F,K);O(K);const _=Reflect.deleteProperty(F,K);return _&&v(["delete",[K],B]),_},set(F,K,B,_){const p=Reflect.has(F,K),m=Reflect.get(F,K,_);if(p&&(t(m,B)||o.has(B)&&t(m,o.get(B))))return!0;O(K),Ix(B)&&(B=DJ(B)||B);let w=B;if(B instanceof Promise)B.then(A=>{B.status="fulfilled",B.value=A,v(["resolve",[K],A])}).catch(A=>{B.status="rejected",B.reason=A,v(["reject",[K],A])});else{!wd.has(B)&&r(B)&&(w=c(B));const A=!Pm.has(w)&&wd.get(w);A&&E(K,A)}return Reflect.set(F,K,w,_),v(["set",[K],B,m]),!0}});o.set(l,I);const T=[U,R,s,L];return wd.set(I,T),Reflect.ownKeys(l).forEach(F=>{const K=Object.getOwnPropertyDescriptor(l,F);"value"in K&&(I[F]=l[F],delete K.value,delete K.writable),Object.defineProperty(U,F,K)}),I})=>[c,wd,Pm,t,e,r,n,i,s,o,a],[BJ]=LJ();function Tn(t={}){return BJ(t)}function gs(t,e,r){const n=wd.get(t);(zb?"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 Q7(t,e){const r=wd.get(t);(zb?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}function rc(t){return Pm.add(t),t}function Cs(t,e,r,n){let i=t[e];return gs(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)})}function UJ(t){const e=Tn({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 KD={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Gi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",d="week",h="month",g="quarter",v="year",x="date",R="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"],A=m%100;return"["+m+(w[(A-20)%10]||w[A]||w[0])+"]"}},O=function(m,w,A){var P=String(m);return!P||P.length>=w?m:""+Array(w+1-P.length).join(A)+m},L={s:O,z:function(m){var w=-m.utcOffset(),A=Math.abs(w),P=Math.floor(A/60),S=A%60;return(w<=0?"+":"-")+O(P,2,"0")+":"+O(S,2,"0")},m:function m(w,A){if(w.date()1)return m(y[0])}else{var b=w.name;H[b]=w,S=b}return!P&&S&&(U=S),S||!P&&U},K=function(m,w){if(T(m))return m.clone();var A=typeof w=="object"?w:{};return A.date=m,A.args=arguments,new _(A)},B=L;B.l=F,B.i=T,B.w=function(m,w){return K(m,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var _=function(){function m(A){this.$L=F(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[I]=!0}var w=m.prototype;return w.parse=function(A){this.$d=function(P){var S=P.date,k=P.utc;if(S===null)return new Date(NaN);if(B.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)}(A),this.init()},w.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},w.$utils=function(){return B},w.isValid=function(){return this.$d.toString()!==R},w.isSame=function(A,P){var S=K(A);return this.startOf(P)<=S&&S<=this.endOf(P)},w.isAfter=function(A,P){return K(A)0,H<=U.r||!U.r){H<=1&&L>0&&(U=E[L-1]);var I=N[U.l];v&&(H=v(""+H)),R=typeof I=="string"?I.replace("%d",H):I(H,d,U.l,M);break}}if(d)return R;var T=M?N.future:N.past;return typeof T=="function"?T(R):T.replace("%s",R)},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)}}})})(ZD);var WJ=ZD.exports;const HJ=_c(WJ);var QD={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Gi,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}}})})(QD);var qJ=QD.exports;const VJ=_c(qJ);Wp.extend(HJ);Wp.extend(VJ);const KJ={...zJ,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"}};Wp.locale("en-web3-modal",KJ);const NA={getYear(t=new Date().toISOString()){return Wp(t).year()},getRelativeDateFromNow(t){return Wp(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return Wp(t).format(e)}},Ga={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t}};var GJ=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Tx=Math.ceil,Xo=Math.floor,Os="[BigNumber Error] ",Bk=Os+"Number primitive has more than 15 significant digits: ",Ba=1e14,sr=14,kx=9007199254740991,Px=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ld=1e7,ci=1e9;function YD(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,h=1e7,g=!1,v=1,x=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},M="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function E(T,F){var K,B,_,p,m,w,A,P,S=this;if(!(S instanceof E))return new E(T,F);if(F==null){if(T&&T._isBigNumber===!0){S.s=T.s,!T.c||T.e>h?S.c=S.e=null:T.e=10;m/=10,p++);p>h?S.c=S.e=null:(S.e=p,S.c=[T]);return}P=String(T)}else{if(!GJ.test(P=String(T)))return n(S,P,w);S.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(p=P.indexOf("."))>-1&&(P=P.replace(".","")),(m=P.search(/e/i))>0?(p<0&&(p=m),p+=+P.slice(m+1),P=P.substring(0,m)):p<0&&(p=P.length)}else{if(xn(F,2,M.length,"Base"),F==10&&N)return S=new E(T),H(S,o+S.e+1,a);if(P=String(T),w=typeof T=="number"){if(T*0!=0)return n(S,P,w,F);if(S.s=1/T<0?(P=P.slice(1),-1):1,E.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Bk+T)}else S.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(K=M.slice(0,F),p=m=0,A=P.length;mp){p=A;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,m=-1,p=0;continue}return n(S,String(T),w,F)}w=!1,P=r(P,F,10,S.s),(p=P.indexOf("."))>-1?P=P.replace(".",""):p=P.length}for(m=0;P.charCodeAt(m)===48;m++);for(A=P.length;P.charCodeAt(--A)===48;);if(P=P.slice(m,++A)){if(A-=m,w&&E.DEBUG&&A>15&&(T>kx||T!==Xo(T)))throw Error(Bk+S.s*T);if((p=p-m-1)>h)S.c=S.e=null;else if(p=-ci&&_<=ci&&_===Xo(_)){if(B[0]===0){if(_===0&&B.length===1)return!0;break e}if(F=(_+1)%sr,F<1&&(F+=sr),String(B[0]).length==F){for(F=0;F=Ba||K!==Xo(K))break e;if(K!==0)return!0}}}else if(B===null&&_===null&&(p===null||p===1||p===-1))return!0;throw Error(Os+"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,F=Math.random()*T&2097151?function(){return Xo(Math.random()*T)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(K){var B,_,p,m,w,A=0,P=[],S=new E(s);if(K==null?K=o:xn(K,0,ci),m=Tx(K/sr),g)if(crypto.getRandomValues){for(B=crypto.getRandomValues(new Uint32Array(m*=2));A>>11),w>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),B[A]=_[0],B[A+1]=_[1]):(P.push(w%1e14),A+=2);A=m/2}else if(crypto.randomBytes){for(B=crypto.randomBytes(m*=7);A=9e15?crypto.randomBytes(7).copy(B,A):(P.push(w%1e14),A+=7);A=m/7}else throw g=!1,Error(Os+"crypto unavailable");if(!g)for(;A=10;w/=10,A++);A_-1&&(w[m+1]==null&&(w[m+1]=0),w[m+1]+=w[m]/_|0,w[m]%=_)}return w.reverse()}return function(K,B,_,p,m){var w,A,P,S,k,y,b,V,ce=K.indexOf("."),de=o,W=a;for(ce>=0&&(S=x,x=0,K=K.replace(".",""),V=new E(B),y=V.pow(K.length-ce),x=S,V.c=F(Yl(qo(y.c),y.e,"0"),10,_,T),V.e=V.c.length),b=F(K,B,_,m?(w=M,T):(w=T,M)),P=S=b.length;b[--S]==0;b.pop());if(!b[0])return w.charAt(0);if(ce<0?--P:(y.c=b,y.e=P,y.s=p,y=e(y,V,de,W,_),b=y.c,k=y.r,P=y.e),A=P+de+1,ce=b[A],S=_/2,k=k||A<0||b[A+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[A-1]&1||W==(y.s<0?8:7)),A<1||!b[0])K=k?Yl(w.charAt(1),-de,w.charAt(0)):w.charAt(0);else{if(b.length=A,k)for(--_;++b[--A]>_;)b[A]=0,A||(++P,b=[1].concat(b));for(S=b.length;!b[--S];);for(ce=0,K="";ce<=S;K+=w.charAt(b[ce++]));K=Yl(K,P,w.charAt(0))}return K}}(),e=function(){function T(B,_,p){var m,w,A,P,S=0,k=B.length,y=_%ld,b=_/ld|0;for(B=B.slice();k--;)A=B[k]%ld,P=B[k]/ld|0,m=b*A+P*y,w=y*A+m%ld*ld+S,S=(w/p|0)+(m/ld|0)+b*P,B[k]=w%p;return S&&(B=[S].concat(B)),B}function F(B,_,p,m){var w,A;if(p!=m)A=p>m?1:-1;else for(w=A=0;w_[w]?1:-1;break}return A}function K(B,_,p,m){for(var w=0;p--;)B[p]-=w,w=B[p]<_[p]?1:0,B[p]=w*m+B[p]-_[p];for(;!B[0]&&B.length>1;B.splice(0,1));}return function(B,_,p,m,w){var A,P,S,k,y,b,V,ce,de,W,le,Y,re,ne,D,ee,ge,xe=B.s==_.s?1:-1,Ae=B.c,ke=_.c;if(!Ae||!Ae[0]||!ke||!ke[0])return new E(!B.s||!_.s||(Ae?ke&&Ae[0]==ke[0]:!ke)?NaN:Ae&&Ae[0]==0||!ke?xe*0:xe/0);for(ce=new E(xe),de=ce.c=[],P=B.e-_.e,xe=p+P+1,w||(w=Ba,P=ea(B.e/sr)-ea(_.e/sr),xe=xe/sr|0),S=0;ke[S]==(Ae[S]||0);S++);if(ke[S]>(Ae[S]||0)&&P--,xe<0)de.push(1),k=!0;else{for(ne=Ae.length,ee=ke.length,S=0,xe+=2,y=Xo(w/(ke[0]+1)),y>1&&(ke=T(ke,y,w),Ae=T(Ae,y,w),ee=ke.length,ne=Ae.length),re=ee,W=Ae.slice(0,ee),le=W.length;le=w/2&&D++;do{if(y=0,A=F(ke,W,ee,le),A<0){if(Y=W[0],ee!=le&&(Y=Y*w+(W[1]||0)),y=Xo(Y/D),y>1)for(y>=w&&(y=w-1),b=T(ke,y,w),V=b.length,le=W.length;F(b,W,V,le)==1;)y--,K(b,ee=10;xe/=10,S++);H(ce,p+(ce.e=S+P*sr-1)+1,m,k)}else ce.e=P,ce.r=+k;return ce}}();function O(T,F,K,B){var _,p,m,w,A;if(K==null?K=a:xn(K,0,8),!T.c)return T.toString();if(_=T.c[0],m=T.e,F==null)A=qo(T.c),A=B==1||B==2&&(m<=c||m>=l)?cy(A,m):Yl(A,m,"0");else if(T=H(new E(T),F,K),p=T.e,A=qo(T.c),w=A.length,B==1||B==2&&(F<=p||p<=c)){for(;ww){if(--F>0)for(A+=".";F--;A+="0");}else if(F+=p-w,F>0)for(p+1==w&&(A+=".");F--;A+="0");return T.s<0&&_?"-"+A:A}function L(T,F){for(var K,B,_=1,p=new E(T[0]);_=10;_/=10,B++);return(K=B+K*sr-1)>h?T.c=T.e=null:K=10;w/=10,_++);if(p=F-_,p<0)p+=sr,m=F,A=k[P=0],S=Xo(A/y[_-m-1]%10);else if(P=Tx((p+1)/sr),P>=k.length)if(B){for(;k.length<=P;k.push(0));A=S=0,_=1,p%=sr,m=p-sr+1}else break e;else{for(A=w=k[P],_=1;w>=10;w/=10,_++);p%=sr,m=p-sr+_,S=m<0?0:Xo(A/y[_-m-1]%10)}if(B=B||F<0||k[P+1]!=null||(m<0?A:A%y[_-m-1]),B=K<4?(S||B)&&(K==0||K==(T.s<0?3:2)):S>5||S==5&&(K==4||B||K==6&&(p>0?m>0?A/y[_-m]:0:k[P-1])%10&1||K==(T.s<0?8:7)),F<1||!k[0])return k.length=0,B?(F-=T.e+1,k[0]=y[(sr-F%sr)%sr],T.e=-F||0):k[0]=T.e=0,T;if(p==0?(k.length=P,w=1,P--):(k.length=P+1,w=y[sr-p],k[P]=m>0?Xo(A/y[_-m]%y[m])*w:0),B)for(;;)if(P==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]==Ba&&(k[0]=1));break}else{if(k[P]+=w,k[P]!=Ba)break;k[P--]=0,w=1}for(p=k.length;k[--p]===0;k.pop());}T.e>h?T.c=T.e=null:T.e=l?cy(F,K):Yl(F,K,"0"),T.s<0?"-"+F:F)}return i.absoluteValue=i.abs=function(){var T=new E(this);return T.s<0&&(T.s=1),T},i.comparedTo=function(T,F){return Yf(this,new E(T,F))},i.decimalPlaces=i.dp=function(T,F){var K,B,_,p=this;if(T!=null)return xn(T,0,ci),F==null?F=a:xn(F,0,8),H(new E(p),T+p.e+1,F);if(!(K=p.c))return null;if(B=((_=K.length-1)-ea(this.e/sr))*sr,_=K[_])for(;_%10==0;_/=10,B--);return B<0&&(B=0),B},i.dividedBy=i.div=function(T,F){return e(this,new E(T,F),o,a)},i.dividedToIntegerBy=i.idiv=function(T,F){return e(this,new E(T,F),0,1)},i.exponentiatedBy=i.pow=function(T,F){var K,B,_,p,m,w,A,P,S,k=this;if(T=new E(T),T.c&&!T.isInteger())throw Error(Os+"Exponent not an integer: "+I(T));if(F!=null&&(F=new E(F)),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-ay(T)):+I(T))),F?S.mod(F):S;if(A=T.s<0,F){if(F.c?!F.c[0]:!F.s)return new E(NaN);B=!A&&k.isInteger()&&F.isInteger(),B&&(k=k.mod(F))}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&&ay(T)?-0:0,k.e>-1&&(p=1/p),new E(A?1/p:p);x&&(p=Tx(x/sr+2))}for(w?(K=new E(.5),A&&(T.s=1),P=ay(T)):(_=Math.abs(+I(T)),P=_%2),S=new E(s);;){if(P){if(S=S.times(k),!S.c)break;p?S.c.length>p&&(S.c.length=p):B&&(S=S.mod(F))}if(_){if(_=Xo(_/2),_===0)break;P=_%2}else if(T=T.times(K),H(T,T.e+1,1),T.e>14)P=ay(T);else{if(_=+I(T),_===0)break;P=_%2}k=k.times(k),p?k.c&&k.c.length>p&&(k.c.length=p):B&&(k=k.mod(F))}return B?S:(A&&(S=s.div(S)),F?S.mod(F):p?H(S,x,a,m):S)},i.integerValue=function(T){var F=new E(this);return T==null?T=a:xn(T,0,8),H(F,F.e+1,T)},i.isEqualTo=i.eq=function(T,F){return Yf(this,new E(T,F))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(T,F){return Yf(this,new E(T,F))>0},i.isGreaterThanOrEqualTo=i.gte=function(T,F){return(F=Yf(this,new E(T,F)))===1||F===0},i.isInteger=function(){return!!this.c&&ea(this.e/sr)>this.c.length-2},i.isLessThan=i.lt=function(T,F){return Yf(this,new E(T,F))<0},i.isLessThanOrEqualTo=i.lte=function(T,F){return(F=Yf(this,new E(T,F)))===-1||F===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,F){var K,B,_,p,m=this,w=m.s;if(T=new E(T,F),F=T.s,!w||!F)return new E(NaN);if(w!=F)return T.s=-F,m.plus(T);var A=m.e/sr,P=T.e/sr,S=m.c,k=T.c;if(!A||!P){if(!S||!k)return S?(T.s=-F,T):new E(k?m:NaN);if(!S[0]||!k[0])return k[0]?(T.s=-F,T):new E(S[0]?m:a==3?-0:0)}if(A=ea(A),P=ea(P),S=S.slice(),w=A-P){for((p=w<0)?(w=-w,_=S):(P=A,_=k),_.reverse(),F=w;F--;_.push(0));_.reverse()}else for(B=(p=(w=S.length)<(F=k.length))?w:F,w=F=0;F0)for(;F--;S[K++]=0);for(F=Ba-1;B>w;){if(S[--B]=0;){for(K=0,y=Y[_]%de,b=Y[_]/de|0,m=A,p=_+m;p>_;)P=le[--m]%de,S=le[m]/de|0,w=b*P+S*y,P=y*P+w%de*de+V[p]+K,K=(P/ce|0)+(w/de|0)+b*S,V[p--]=P%ce;V[p]=K}return K?++B:V.splice(0,1),U(T,V,B)},i.negated=function(){var T=new E(this);return T.s=-T.s||null,T},i.plus=function(T,F){var K,B=this,_=B.s;if(T=new E(T,F),F=T.s,!_||!F)return new E(NaN);if(_!=F)return T.s=-F,B.minus(T);var p=B.e/sr,m=T.e/sr,w=B.c,A=T.c;if(!p||!m){if(!w||!A)return new E(_/0);if(!w[0]||!A[0])return A[0]?T:new E(w[0]?B:_*0)}if(p=ea(p),m=ea(m),w=w.slice(),_=p-m){for(_>0?(m=p,K=A):(_=-_,K=w),K.reverse();_--;K.push(0));K.reverse()}for(_=w.length,F=A.length,_-F<0&&(K=A,A=w,w=K,F=_),_=0;F;)_=(w[--F]=w[F]+A[F]+_)/Ba|0,w[F]=Ba===w[F]?0:w[F]%Ba;return _&&(w=[_].concat(w),++m),U(T,w,m)},i.precision=i.sd=function(T,F){var K,B,_,p=this;if(T!=null&&T!==!!T)return xn(T,1,ci),F==null?F=a:xn(F,0,8),H(new E(p),T,F);if(!(K=p.c))return null;if(_=K.length-1,B=_*sr+1,_=K[_]){for(;_%10==0;_/=10,B--);for(_=K[0];_>=10;_/=10,B++);}return T&&p.e+1>B&&(B=p.e+1),B},i.shiftedBy=function(T){return xn(T,-kx,kx),this.times("1e"+T)},i.squareRoot=i.sqrt=function(){var T,F,K,B,_,p=this,m=p.c,w=p.s,A=p.e,P=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?(F=qo(m),(F.length+A)%2==0&&(F+="0"),w=Math.sqrt(+F),A=ea((A+1)/2)-(A<0||A%2),w==1/0?F="5e"+A:(F=w.toExponential(),F=F.slice(0,F.indexOf("e")+1)+A),K=new E(F)):K=new E(w+""),K.c[0]){for(A=K.e,w=A+P,w<3&&(w=0);;)if(_=K,K=S.times(_.plus(e(p,_,P,1))),qo(_.c).slice(0,w)===(F=qo(K.c)).slice(0,w))if(K.e0&&V>0){for(p=V%w||w,S=b.substr(0,p);p0&&(S+=P+b.slice(p)),y&&(S="-"+S)}B=k?S+(K.decimalSeparator||"")+((A=+K.fractionGroupSize)?k.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(K.fractionGroupSeparator||"")):k):S}return(K.prefix||"")+B+(K.suffix||"")},i.toFraction=function(T){var F,K,B,_,p,m,w,A,P,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(Os+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+I(w));if(!V)return new E(b);for(F=new E(s),P=K=new E(s),B=A=new E(s),y=qo(V),p=F.e=y.length-b.e-1,F.c[0]=Px[(m=p%sr)<0?sr+m:m],T=!T||w.comparedTo(F)>0?p>0?F:P:w,m=h,h=1/0,w=new E(y),A.c[0]=0;S=e(w,F,0,1),_=K.plus(S.times(B)),_.comparedTo(T)!=1;)K=B,B=_,P=A.plus(S.times(_=P)),A=_,F=w.minus(S.times(_=F)),w=_;return _=e(T.minus(K),B,0,1),A=A.plus(_.times(P)),K=K.plus(_.times(B)),A.s=P.s=b.s,p=p*2,k=e(P,B,p,a).minus(b).abs().comparedTo(e(A,K,p,a).minus(b).abs())<1?[P,B]:[A,K],h=m,k},i.toNumber=function(){return+I(this)},i.toPrecision=function(T,F){return T!=null&&xn(T,1,ci),O(this,T,F,2)},i.toString=function(T){var F,K=this,B=K.s,_=K.e;return _===null?B?(F="Infinity",B<0&&(F="-"+F)):F="NaN":(T==null?F=_<=c||_>=l?cy(qo(K.c),_):Yl(qo(K.c),_,"0"):T===10&&N?(K=H(new E(K),o+_+1,a),F=Yl(qo(K.c),K.e,"0")):(xn(T,2,M.length,"Base"),F=r(Yl(qo(K.c),_,"0"),10,T,B,!0)),B<0&&K.c[0]&&(F="-"+F)),F},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 ea(t){var e=t|0;return t>0||t===e?e:e-1}function qo(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 xn(t,e,r,n){if(tr||t!==Xo(t))throw Error(Os+(n||"Argument")+(typeof t=="number"?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function ay(t){var e=t.c.length-1;return ea(t.e/sr)==e&&t.c[e]%2!=0}function cy(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Yl(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"&&!h&&!g&&s==="0"&&t.preventDefault(),e==="0"&&v&&(r(s),t.preventDefault()),(h||g)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!v&&!n.includes(s)&&!g&&!h&&t.preventDefault()}},QJ=[{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"}],MA={URLS:{FAQ:"https://walletconnect.com/faq"}},yn={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"}},rn={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"},nn={setItem(t,e){uy()&&localStorage.setItem(t,e)},getItem(t){if(uy())return localStorage.getItem(t)||void 0},removeItem(t){uy()&&localStorage.removeItem(t)},clear(){uy()&&localStorage.clear()}};function uy(){return typeof window<"u"&&typeof localStorage<"u"}function mu(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 YJ(t){return(t==null?void 0:t.endsWith(yn.WC_NAME_SUFFIX_LEGACY))||(t==null?void 0:t.endsWith(yn.WC_NAME_SUFFIX))}const JJ="rpc.walletconnect.org",Sw={extendRpcUrlWithProjectId(t,e){if(t.includes(JJ)){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:Sw.extendRpcUrlWithProjectId(t.rpcUrl,n)}},extendCaipNetworks(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return t.map(i=>Sw.extendCaipNetwork(i,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}))}},Rx="https://secure.walletconnect.org",JD=[{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"]}],XJ="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",Sn={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:Rx,SECURE_SITE_DASHBOARD:`${Rx}/dashboard`,SECURE_SITE_FAVICON:`${Rx}/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}},Be={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 Be.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return Be.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Sn.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Sn.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Sn.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(Be.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(!Be.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,Be.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 yn.W3M_API_URL},getBlockchainApiUrl(){return yn.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return yn.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 sm(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class A6{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 sm(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await sm(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await sm(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 sm(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 sm(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 un=Tn({features:Sn.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),qe={state:un,subscribeKey(t,e){return Cs(un,t,e)},setOptions(t){Object.assign(un,t)},setFeatures(t){t&&Object.entries(t).forEach(([e,r])=>{un.features||(un.features=Sn.DEFAULT_FEATURES),e in un.features&&(un.features[e]=r)})},setProjectId(t){un.projectId=t},setAllWallets(t){un.allWallets=t},setIncludeWalletIds(t){un.includeWalletIds=t},setExcludeWalletIds(t){un.excludeWalletIds=t},setFeaturedWalletIds(t){un.featuredWalletIds=t},setTokens(t){un.tokens=t},setTermsConditionsUrl(t){un.termsConditionsUrl=t},setPrivacyPolicyUrl(t){un.privacyPolicyUrl=t},setCustomWallets(t){un.customWallets=t},setIsSiweEnabled(t){un.isSiweEnabled=t},setIsUniversalProvider(t){un.isUniversalProvider=t},setSdkVersion(t){un.sdkVersion=t},setMetadata(t){un.metadata=t},setDisableAppend(t){un.disableAppend=t},setEIP6963Enabled(t){un.enableEIP6963=t},setEnableWalletConnect(t){un.enableWalletConnect=t},setEnableWallets(t){un.enableWallets=t},setHasMultipleAddresses(t){un.hasMultipleAddresses=t}},eX=Be.getAnalyticsUrl(),tX=new A6({baseUrl:eX,clientId:null}),rX=["MODAL_CREATED"],sp=Tn({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),ot={state:sp,subscribe(t){return gs(sp,()=>t(sp))},_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(rX.includes(t.data.event)||typeof window>"u")return;await tX.post({path:"/e",headers:ot._getApiHeaders(),body:{eventId:Be.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){var e;sp.timestamp=Date.now(),sp.data=t,(e=qe.state.features)!=null&&e.analytics&&ot._sendAnalyticsEvent(sp)}},Uk=Tn({supportsAllNetworks:!0,smartAccountEnabledNetworks:[]}),Zt={state:Uk,replaceState(t){t&&Object.assign(Uk,rc(t))},subscribeKey(t,e){let r;return pe.subscribeChainProp("networkState",n=>{if(n){const i=n[t];r!==i&&(r=i,e(i))}})},_getClient(){return pe.getNetworkControllerClient()},setActiveCaipNetwork(t){if(!t)return;pe.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");pe.setCaipNetwork(t==null?void 0:t.chainNamespace,t)}},setRequestedCaipNetworks(t,e){pe.setChainNetworkData(e,{requestedCaipNetworks:t})},setAllowUnsupportedChain(t,e){pe.setChainNetworkData(e||pe.state.activeChain,{allowUnsupportedCaipNetwork:t})},setSmartAccountEnabledNetworks(t,e){pe.setChainNetworkData(e,{smartAccountEnabledNetworks:t})},getRequestedCaipNetworks(t){let e;if(!pe.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=[...pe.state.chains.keys()];const r=[],n=[];return e.forEach(s=>{var o,a,c,l,d,h,g,v;(a=(o=pe.state.chains.get(s))==null?void 0:o.networkState)!=null&&a.approvedCaipNetworkIds&&r.push(...((l=(c=pe.state.chains.get(s))==null?void 0:c.networkState)==null?void 0:l.approvedCaipNetworkIds)||[]),(h=(d=pe.state.chains.get(s))==null?void 0:d.networkState)!=null&&h.requestedCaipNetworks&&n.push(...((v=(g=pe.state.chains.get(s))==null?void 0:g.networkState)==null?void 0:v.requestedCaipNetworks)||[])}),Be.sortRequestedNetworks(r,n)},async switchActiveNetwork(t){const e=pe.getNetworkControllerClient(t==null?void 0:t.chainNamespace);e&&await e.switchCaipNetwork(t),pe.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=pe.state.chains.get(i))==null?void 0:r.networkState)==null?void 0:n.approvedCaipNetworkIds}const e=[];return Object.values(pe.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=pe.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());if(!t)throw new Error("chain is required to set approved network data");pe.setChainNetworkData(t,{approvedCaipNetworkIds:r==null?void 0:r.approvedCaipNetworkIds,supportsAllNetworks:r==null?void 0:r.supportsAllNetworks})},checkIfSupportedNetwork(){const t=pe.state.activeChain;if(!t)return!1;const e=pe.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=Ga.caipNetworkIdToNumber((n=pe.state.activeCaipNetwork)==null?void 0:n.id);if(!pe.state.activeChain)throw new Error("activeChain is required to check if smart account is enabled");if(!t)return!1;const r=pe.getNetworkProp("smartAccountEnabledNetworks");return!!(r!=null&&r.includes(Number(t)))},resetNetwork(){const t=pe.state.activeChain;if(!t)throw new Error("chain is required to reset network");pe.setChainNetworkData(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},getSupportsAllNetworks(){var e,r;const t=pe.state.activeChain;if(!t)throw new Error("chain is required to check if network supports all networks");return(r=(e=pe.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=Sn.NATIVE_TOKEN_ADDRESS[((e=pe.state.activeCaipNetwork)==null?void 0:e.chainNamespace)||"eip155"];return`${((r=pe.state.activeCaipNetwork)==null?void 0:r.id)||"eip155:1"}:${t}`}},nX={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"}]}]},XD=Be.getBlockchainApiUrl(),Gn=Tn({clientId:null,api:new A6({baseUrl:XD,clientId:null})}),vn={state:Gn,fetchIdentity({address:t}){return Gn.api.get({path:`/v1/identity/${t}`,params:{projectId:qe.state.projectId,sender:pe.state.activeCaipAddress?Be.getPlainAddress(pe.state.activeCaipAddress):void 0}})},fetchTransactions({account:t,projectId:e,cursor:r,onramp:n,signal:i,cache:s,chainId:o}){return Gn.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 Gn.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 Gn.api.get({path:"/v1/convert/tokens",params:{projectId:t,chainId:e}})},fetchTokenPrice({projectId:t,addresses:e}){return Gn.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 Gn.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 Gn.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 Gn.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Sn.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 Gn.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 Gn.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 Gn.api.get({path:`/v1/profile/account/${t}`,params:{projectId:qe.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:t}){return Gn.api.get({path:`/v1/profile/reverse/${t}`,params:{sender:Ee.state.address,projectId:qe.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(t){return Gn.api.get({path:`/v1/profile/suggestions/${t}`,params:{projectId:qe.state.projectId}})},async registerEnsName({coinType:t,address:e,message:r,signature:n}){return Gn.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 Gn.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 Gn.api.get({path:"/v1/onramp/options",params:{projectId:qe.state.projectId}})}catch{return nX}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){try{return await Gn.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){Gn.clientId=t,Gn.api=new A6({baseUrl:XD,clientId:t})}},Vo=Tn({message:"",variant:"success",open:!1}),St={state:Vo,subscribeKey(t,e){return Cs(Vo,t,e)},showLoading(t){Vo.message=t,Vo.variant="loading",Vo.open=!0},showSuccess(t){Vo.message=t,Vo.variant="success",Vo.open=!0},showError(t){const e=Be.parseError(t);Vo.message=e,Vo.variant="error",Vo.open=!0},hide(){Vo.open=!1}};var eL={},E6={};E6.byteLength=oX;E6.toByteArray=cX;E6.fromByteArray=dX;var rl=[],na=[],iX=typeof Uint8Array<"u"?Uint8Array:Array,Nx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var op=0,sX=Nx.length;op0)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 oX(t){var e=tL(t),r=e[0],n=e[1];return(r+n)*3/4-n}function aX(t,e,r){return(e+r)*3/4-r}function cX(t){var e,r=tL(t),n=r[0],i=r[1],s=new iX(aX(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=na[t.charCodeAt(c)]<<2|na[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=na[t.charCodeAt(c)]<<10|na[t.charCodeAt(c+1)]<<4|na[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function lX(t){return rl[t>>18&63]+rl[t>>12&63]+rl[t>>6&63]+rl[t&63]}function uX(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(rl[e>>2]+rl[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(rl[e>>10]+rl[e>>4&63]+rl[e<<2&63]+"=")),i.join("")}var OA={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */OA.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,d=-7,h=r?i-1:0,g=r?-1:1,v=t[e+h];for(h+=g,s=v&(1<<-d)-1,v>>=-d,d+=a;d>0;s=s*256+t[e+h],h+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+h],h+=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)};OA.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,R=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+h>=1?e+=g/c:e+=g*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=d?(a=0,o=d):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o=o+h):(a=e*Math.pow(2,h-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]|=R*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh @@ -61,7 +61,7 @@ Error generating stack: `+s.message+` * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let _e=class extends hp{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=Tre(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return jh}};var AO;_e._$litElement$=!0,_e.finalized=!0,(AO=globalThis.litElementHydrateSupport)==null||AO.call(globalThis,{LitElement:_e});const Bx=globalThis.litElementPolyfillSupport;Bx==null||Bx({LitElement:_e});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");let Zm,Gd,Zd;function eAe(t,e){Zm=document.createElement("style"),Gd=document.createElement("style"),Zd=document.createElement("style"),Zm.textContent=qp(t).core.cssText,Gd.textContent=qp(t).dark.cssText,Zd.textContent=qp(t).light.cssText,document.head.appendChild(Zm),document.head.appendChild(Gd),document.head.appendChild(Zd),_L(e)}function _L(t){Gd&&Zd&&(t==="light"?(Gd.removeAttribute("media"),Zd.media="enabled"):(Zd.removeAttribute("media"),Gd.media="enabled"))}function kre(t){Zm&&Gd&&Zd&&(Zm.textContent=qp(t).core.cssText,Gd.textContent=qp(t).dark.cssText,Zd.textContent=qp(t).light.cssText)}function qp(t){return{core:Ie` + */let _e=class extends hp{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=Tre(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return jh}};var AO;_e._$litElement$=!0,_e.finalized=!0,(AO=globalThis.litElementHydrateSupport)==null||AO.call(globalThis,{LitElement:_e});const Bx=globalThis.litElementPolyfillSupport;Bx==null||Bx({LitElement:_e});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");let Zm,Gd,Zd;function tAe(t,e){Zm=document.createElement("style"),Gd=document.createElement("style"),Zd=document.createElement("style"),Zm.textContent=qp(t).core.cssText,Gd.textContent=qp(t).dark.cssText,Zd.textContent=qp(t).light.cssText,document.head.appendChild(Zm),document.head.appendChild(Gd),document.head.appendChild(Zd),_L(e)}function _L(t){Gd&&Zd&&(t==="light"?(Gd.removeAttribute("media"),Zd.media="enabled"):(Zd.removeAttribute("media"),Gd.media="enabled"))}function kre(t){Zm&&Gd&&Zd&&(Zm.textContent=qp(t).core.cssText,Gd.textContent=qp(t).dark.cssText,Zd.textContent=qp(t).light.cssText)}function qp(t){return{core:Ie` @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); @keyframes w3m-shake { 0% { @@ -6000,7 +6000,7 @@ __p += '`),Pr&&(De+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+De+`return __p -}`;var hr=_T(function(){return Lr(te,It+"return "+De).apply(r,ue)});if(hr.source=De,W8(hr))throw hr;return hr}function fZ(u){return jr(u).toLowerCase()}function hZ(u){return jr(u).toUpperCase()}function pZ(u,f,C){if(u=jr(u),u&&(C||f===r))return RS(u);if(!u||!(f=io(f)))return u;var j=Ma(u),Z=Ma(f),te=NS(j,Z),ue=MS(j,Z)+1;return od(j,te,ue).join("")}function gZ(u,f,C){if(u=jr(u),u&&(C||f===r))return u.slice(0,$S(u)+1);if(!u||!(f=io(f)))return u;var j=Ma(u),Z=MS(j,Ma(f))+1;return od(j,0,Z).join("")}function mZ(u,f,C){if(u=jr(u),u&&(C||f===r))return u.replace(Wt,"");if(!u||!(f=io(f)))return u;var j=Ma(u),Z=NS(j,Ma(f));return od(j,Z).join("")}function wZ(u,f){var C=K,j=B;if(bn(f)){var Z="separator"in f?f.separator:Z;C="length"in f?fr(f.length):C,j="omission"in f?io(f.omission):j}u=jr(u);var te=u.length;if(V0(u)){var ue=Ma(u);te=ue.length}if(C>=te)return u;var he=C-K0(j);if(he<1)return j;var be=ue?od(ue,0,he).join(""):u.slice(0,he);if(Z===r)return be+j;if(ue&&(he+=be.length-he),H8(Z)){if(u.slice(he).search(Z)){var Ne,Me=be;for(Z.global||(Z=o8(Z.source,jr(ar.exec(Z))+"g")),Z.lastIndex=0;Ne=Z.exec(Me);)var De=Ne.index;be=be.slice(0,De===r?he:De)}}else if(u.indexOf(io(Z),he)!=he){var nt=be.lastIndexOf(Z);nt>-1&&(be=be.slice(0,nt))}return be+j}function vZ(u){return u=jr(u),u&&ft.test(u)?u.replace(yr,KW):u}var yZ=ep(function(u,f,C){return u+(C?" ":"")+f.toUpperCase()}),K8=CI("toUpperCase");function xT(u,f,C){return u=jr(u),f=C?r:f,f===r?zW(u)?QW(u):MW(u):u.match(f)||[]}var _T=wr(function(u,f){try{return oi(u,r,f)}catch(C){return W8(C)?C:new tr(C)}}),bZ=Vl(function(u,f){return Bo(f,function(C){C=Lc(C),Hl(u,C,F8(u[C],u))}),u});function xZ(u){var f=u==null?0:u.length,C=Ht();return u=f?gn(u,function(j){if(typeof j[1]!="function")throw new Uo(o);return[C(j[0]),j[1]]}):[],wr(function(j){for(var Z=-1;++ZS)return[];var C=b,j=Bi(u,b);f=Ht(f),u-=b;for(var Z=n8(j,f);++C0||f<0)?new Ar(C):(u<0?C=C.takeRight(-u):u&&(C=C.drop(u)),f!==r&&(f=fr(f),C=f<0?C.dropRight(-f):C.take(f-u)),C)},Ar.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ar.prototype.toArray=function(){return this.take(b)},$c(Ar.prototype,function(u,f){var C=/^(?:filter|find|map|reject)|While$/.test(f),j=/^(?:head|last)$/.test(f),Z=X[j?"take"+(f=="last"?"Right":""):f],te=j||/^find/.test(f);Z&&(X.prototype[f]=function(){var ue=this.__wrapped__,he=j?[1]:arguments,be=ue instanceof Ar,Ne=he[0],Me=be||ir(ue),De=function(br){var Pr=Z.apply(X,ed([br],he));return j&&nt?Pr[0]:Pr};Me&&C&&typeof Ne=="function"&&Ne.length!=1&&(be=Me=!1);var nt=this.__chain__,It=!!this.__actions__.length,Kt=te&&!nt,hr=be&&!It;if(!te&&Me){ue=hr?ue:new Ar(this);var Gt=u.apply(ue,he);return Gt.__actions__.push({func:$3,args:[De],thisArg:r}),new jo(Gt,nt)}return Kt&&hr?u.apply(this,he):(Gt=this.thru(De),Kt?j?Gt.value()[0]:Gt.value():Gt)})}),Bo(["pop","push","shift","sort","splice","unshift"],function(u){var f=a3[u],C=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",j=/^(?:pop|shift)$/.test(u);X.prototype[u]=function(){var Z=arguments;if(j&&!this.__chain__){var te=this.value();return f.apply(ir(te)?te:[],Z)}return this[C](function(ue){return f.apply(ir(ue)?ue:[],Z)})}}),$c(Ar.prototype,function(u,f){var C=X[f];if(C){var j=C.name+"";Wr.call(Y0,j)||(Y0[j]=[]),Y0[j].push({name:f,func:C})}}),Y0[T3(r,N).name]=[{name:"wrapper",func:r}],Ar.prototype.clone=vH,Ar.prototype.reverse=yH,Ar.prototype.value=bH,X.prototype.at=ZV,X.prototype.chain=QV,X.prototype.commit=YV,X.prototype.next=JV,X.prototype.plant=eK,X.prototype.reverse=tK,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=rK,X.prototype.first=X.prototype.head,Lg&&(X.prototype[Lg]=XV),X},G0=YW();Ln?((Ln.exports=G0)._=G0,Qr._=G0):kr._=G0}).call(_m)})(U_,U_.exports);var D2e=Object.defineProperty,L2e=Object.defineProperties,B2e=Object.getOwnPropertyDescriptors,$N=Object.getOwnPropertySymbols,U2e=Object.prototype.hasOwnProperty,j2e=Object.prototype.propertyIsEnumerable,DN=(t,e,r)=>e in t?D2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ey=(t,e)=>{for(var r in e||(e={}))U2e.call(e,r)&&DN(t,r,e[r]);if($N)for(var r of $N(e))j2e.call(e,r)&&DN(t,r,e[r]);return t},F2e=(t,e)=>L2e(t,B2e(e));function mc(t,e,r){var n;const i=Jm(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${$2e}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function $0(t){return t.includes(":")?t.split(":")[1]:t}function Oj(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function z2e(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 P9(t={},e={}){const r=LN(t),n=LN(e);return U_.exports.merge(r,n)}function LN(t){var e,r,n,i;const s={};if(!fv(t))return s;for(const[o,a]of Object.entries(t)){const c=PE(o)?[o]:a.chains,l=a.methods||[],d=a.events||[],h=a.rpcMap||{},g=Om(o);s[g]=F2e(Ey(Ey({},s[g]),a),{chains:nb(c,(e=s[g])==null?void 0:e.chains),methods:nb(l,(r=s[g])==null?void 0:r.methods),events:nb(d,(n=s[g])==null?void 0:n.events),rpcMap:Ey(Ey({},h),(i=s[g])==null?void 0:i.rpcMap)})}return s}function W2e(t){return t.includes(":")?t.split(":")[2]:t}function BN(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=PE(r)?[r]:n.chains?n.chains:Oj(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function R9(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 $j={},zr=t=>$j[t],N9=(t,e)=>{$j[t]=e};class H2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}var q2e=Object.defineProperty,V2e=Object.defineProperties,K2e=Object.getOwnPropertyDescriptors,UN=Object.getOwnPropertySymbols,G2e=Object.prototype.hasOwnProperty,Z2e=Object.prototype.propertyIsEnumerable,jN=(t,e,r)=>e in t?q2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,FN=(t,e)=>{for(var r in e||(e={}))G2e.call(e,r)&&jN(t,r,e[r]);if(UN)for(var r of UN(e))Z2e.call(e,r)&&jN(t,r,e[r]);return t},zN=(t,e)=>V2e(t,K2e(e));class Q2e{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(Sc.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||mc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(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($0(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:zN(FN({},o.sessionProperties||{}),{capabilities:zN(FN({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}}class Y2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class J2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class X2e{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||mc(`${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(Sc.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||mc(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ec(new Dl(n,zr("disableProviderPing")))}}class e3e{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(Sc.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=$0(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 Ec(new Dl(n,zr("disableProviderPing")))}}class t3e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class r3e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class n3e{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||mc(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Sc.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||mc(e,this.namespace);return typeof n>"u"?void 0:new Ec(new Dl(n,zr("disableProviderPing")))}}class i3e{constructor(e){this.name=gp,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(Sc.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=Jm(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}var s3e=Object.defineProperty,o3e=Object.defineProperties,a3e=Object.getOwnPropertyDescriptors,WN=Object.getOwnPropertySymbols,c3e=Object.prototype.hasOwnProperty,l3e=Object.prototype.propertyIsEnumerable,HN=(t,e,r)=>e in t?s3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sy=(t,e)=>{for(var r in e||(e={}))c3e.call(e,r)&&HN(t,r,e[r]);if(WN)for(var r of WN(e))l3e.call(e,r)&&HN(t,r,e[r]);return t},M9=(t,e)=>o3e(t,a3e(e));class DE{constructor(e){this.events=new cE,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:Xv(t2({level:(e==null?void 0:e.logger)||MN})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new DE(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:Sy({},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,f4(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=BN(this.session.namespaces);this.namespaces=P9(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=BN(s.namespaces);this.namespaces=P9(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Nj)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===gp?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(Jh(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 C2e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||MN,relayUrl:this.providerOpts.relayUrl||N2e,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=>Om(r)))];N9("client",this.client),N9("events",this.events),N9("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=z2e(r,this.session),i=Oj(n),s=P9(this.namespaces,this.optionalNamespaces),o=M9(Sy({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new Q2e({namespace:o});break;case"algorand":this.rpcProviders[r]=new X2e({namespace:o});break;case"solana":this.rpcProviders[r]=new Y2e({namespace:o});break;case"cosmos":this.rpcProviders[r]=new J2e({namespace:o});break;case"polkadot":this.rpcProviders[r]=new H2e({namespace:o});break;case"cip34":this.rpcProviders[r]=new e3e({namespace:o});break;case"elrond":this.rpcProviders[r]=new t3e({namespace:o});break;case"multiversx":this.rpcProviders[r]=new r3e({namespace:o});break;case"near":this.rpcProviders[r]=new n3e({namespace:o});break;default:this.rpcProviders[gp]?this.rpcProviders[gp].updateNamespace(o):this.rpcProviders[gp]=new i3e({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&&Jh(i)&&this.events.emit("accountsChanged",i.map(W2e))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Om(i),a=R9(i)!==R9(s)?`${o}:${R9(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=M9(Sy({},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",M9(Sy({},Vr("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Sc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[gp]}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=>Om(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=Om(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(`${ON}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${ON}/${e}`)}}const Dj={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},{})}},Jo=Tn({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),j1={state:Jo,subscribeKey(t,e){return Cs(Jo,t,e)},subscribeProviders(t){return gs(Jo.providers,()=>t(Jo.providers))},setProvider(t,e){e&&(Jo.providers[t]=rc(e))},getProvider(t){return Jo.providers[t]},setProviderId(t,e){e&&(Jo.providerIds[t]=e)},getProviderId(t){return Jo.providerIds[t]},reset(){Jo.providers={eip155:void 0,solana:void 0,polkadot:void 0},Jo.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(t){Jo.providers[t]=void 0,Jo.providerIds[t]=void 0}},u3e=["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 d3e{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 h=(g=s==null?void 0:s[d])==null?void 0:g.chains;h&&o.push(...h)}),i({supportsAllNetworks:!0,approvedCaipNetworkIds:o})}))},this.connectionControllerClient={connectWalletConnect:async i=>{var o,a,c,l,d,h,g,v,x,R,M;const s=await this.getWalletConnectProvider();if(!s)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(s.on("display_uri",N=>{i(N)}),pe.state.activeChain&&((c=(a=(o=pe.state)==null?void 0:o.chains)==null?void 0:a.get(pe.state.activeChain))==null?void 0:c.adapterType)==="wagmi"){const N=pe.state.chains.get(pe.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((h=r==null?void 0:r.getMessageParams)==null?void 0:h.call(r)),E=(g=r==null?void 0:r.options)==null?void 0:g.enabled,O=typeof(s==null?void 0:s.authenticate)=="function",L=N&&Object.keys(N||{}).length>0;if(r&&E&&N&&O&&L){const{SIWEController:U,getDidChainId:H,getDidAddress:I}=await Dn(async()=>{const{SIWEController:B,getDidChainId:_,getDidAddress:p}=await import("./index-C90-4id0.js");return{SIWEController:B,getDidChainId:_,getDidAddress:p}},[]),T=(v=this.caipNetworks)==null?void 0:v.filter(B=>B.chainNamespace==="eip155").map(B=>B.id);N.chains=(x=this.caipNetworks)==null?void 0:x.filter(B=>B.chainNamespace==="eip155").map(B=>B.chainId);const F=await s.authenticate({nonce:await((R=r==null?void 0:r.getNonce)==null?void 0:R.call(r)),methods:[...u3e],...N,chains:T}),K=(M=F==null?void 0:F.auths)==null?void 0:M[0];if(K){const{p:B,s:_}=K,p=H(B.iss),m=I(B.iss);m&&p&&U.setSession({address:m,chainId:parseInt(p,10)});try{const w=s.client.formatAuthMessage({request:B,iss:B.iss});await U.verifyMessage({message:w,signature:_.s,cacao:K})}catch(w){throw console.error("Error verifying message",w),await s.disconnect().catch(console.error),await U.signOut().catch(console.error),w}}}else{const U=Dj.createNamespaces(this.caipNetworks);await s.connect({optionalNamespaces:U})}this.setWalletConnectProvider()}},disconnect:async()=>{var i,s,o,a;if(nn.removeItem(rn.WALLET_ID),(i=r==null?void 0:r.options)!=null&&i.signOutOnDisconnect){const{SIWEController:c}=await Dn(async()=>{const{SIWEController:l}=await import("./index-C90-4id0.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=pe.state.activeCaipAddress,a=Be.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 DE.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=nn.getItem(rn.WALLET_ID);e&&r===cr.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var r,n,i;nn.setItem(rn.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];j1.setProvider(a,this.walletConnectProvider),j1.setProviderId(a,"walletConnect"),c&&((d=this.appKit)==null||d.setCaipAddress(c,a))});const s=vr.getStoredActiveCaipNetwork(),o=pe.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=>{Ee.resetAccount(a)}),Lt.resetWcConnection(),nn.removeItem(rn.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,h,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:((h=this.appKit)==null?void 0:h.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,R,M,N;const d=l,h=(v=r==null?void 0:r[l])==null?void 0:v.accounts[0];((x=this.appKit)==null?void 0:x.getCaipAddress(d))||((R=this.appKit)==null||R.setPreferredAccountType(n,d),(M=this.appKit)==null||M.setCaipAddress(h,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[,,h]=d.split(":");return h}).filter((d,h,g)=>g.indexOf(d)===h);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=nn.getItem(rn.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,h;(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"),(h=this.appKit)==null||h.setConnectedWalletInfo({name:e},"solana"))})}syncConnectors(){var r;const e=[];e.push({id:cr.WALLET_CONNECT_CONNECTOR_ID,explorerId:ua.ConnectorExplorerIds[cr.WALLET_CONNECT_CONNECTOR_ID],imageId:ua.ConnectorImageIds[cr.WALLET_CONNECT_CONNECTOR_ID],name:ua.ConnectorNamesMap[cr.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(r=this.appKit)==null||r.setConnectors(e)}}let qN=!1;class f3e{constructor(e){var r;this.initPromise=void 0,this.setStatus=(n,i)=>{Ee.setStatus(n,i)},this.getIsConnectedState=()=>!!pe.state.activeCaipAddress,this.setAllAccounts=(n,i)=>{Ee.setAllAccounts(n,i),qe.setHasMultipleAddresses((n==null?void 0:n.length)>1)},this.addAddressLabel=(n,i,s)=>{Ee.addAddressLabel(n,i,s)},this.removeAddressLabel=(n,i)=>{Ee.removeAddressLabel(n,i)},this.getCaipAddress=n=>pe.state.activeChain===n||!n?pe.state.activeCaipAddress:pe.getAccountProp("caipAddress",n),this.getAddress=n=>pe.state.activeChain===n||!n?Ee.state.address:pe.getAccountProp("address",n),this.getProvider=()=>Ee.state.provider,this.getPreferredAccountType=()=>Ee.state.preferredAccountType,this.setCaipAddress=(n,i)=>{Ee.setCaipAddress(n,i)},this.setProvider=(n,i)=>{Ee.setProvider(n,i)},this.setBalance=(n,i,s)=>{Ee.setBalance(n,i,s)},this.setProfileName=(n,i)=>{Ee.setProfileName(n,i)},this.setProfileImage=(n,i)=>{Ee.setProfileImage(n,i)},this.resetAccount=n=>{Ee.resetAccount(n)},this.setCaipNetwork=n=>{pe.setActiveCaipNetwork(n)},this.getCaipNetwork=n=>{var i;return n?(i=Zt.getRequestedCaipNetworks().filter(s=>s.chainNamespace===n))==null?void 0:i[0]:pe.state.activeCaipNetwork},this.getCaipNetworks=()=>Zt.getRequestedCaipNetworks(),this.getActiveChainNamespace=()=>pe.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=>vn.fetchIdentity(n),this.setAddressExplorerUrl=(n,i)=>{Ee.setAddressExplorerUrl(n,i)},this.setSmartAccountDeployed=(n,i)=>{Ee.setSmartAccountDeployed(n,i)},this.setConnectedWalletInfo=(n,i)=>{Ee.setConnectedWalletInfo(n,i)},this.setSmartAccountEnabledNetworks=(n,i)=>{Zt.setSmartAccountEnabledNetworks(n,i)},this.setPreferredAccountType=(n,i)=>{Ee.setPreferredAccountType(n,i)},this.getReownName=n=>qc.getNamesForAddress(n),this.resolveReownName=async n=>{var o;const i=await qc.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=>{vn.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=pe.state.activeCaipNetwork)==null?void 0:e.chainId}switchNetwork(e){return Zt.switchActiveNetwork(e)}getWalletProvider(){return pe.state.activeChain?j1.state.providers[pe.state.activeChain]:null}getWalletProviderType(){return pe.state.activeChain?j1.state.providerIds[pe.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return mn.state.themeMode}getThemeVariables(){return mn.state.themeVariables}setThemeMode(e){mn.setThemeMode(e),_L(mn.state.themeMode)}setThemeVariables(e){mn.setThemeVariables(e),kre(mn.state.themeVariables)}subscribeTheme(e){return mn.subscribe(e)}getWalletInfo(){return Ee.state.connectedWalletInfo}subscribeWalletInfo(e){return Ee.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){Ee.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){Zt.subscribeKey("caipNetwork",e)}getState(){return wu.state}subscribeState(e){return wu.subscribe(e)}showErrorMessage(e){St.showError(e)}showSuccessMessage(e){St.showSuccess(e)}getEvent(){return{...ot.state}}subscribeEvents(e){return ot.subscribe(e)}replace(e){Ce.replace(e)}redirect(e){Ce.push(e)}popTransactionStack(e){Ce.popTransactionStack(e)}isOpen(){return jt.state.open}isTransactionStackEmpty(){return Ce.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=Ce.state.transactionStack[Ce.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&&mn.setThemeMode(e.themeMode),e.themeVariables&&mn.setThemeVariables(e.themeVariables),e.disableAppend&&qe.setDisableAppend(!!e.disableAppend),((n=e.adapters)==null?void 0:n.find(i=>i.chainNamespace===yn.CHAIN.EVM))&&e.siweConfig){const{SIWEController:i}=await Dn(async()=>{const{SIWEController:s}=await import("./index-C90-4id0.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=Sw.extendCaipNetworks(e.networks,{networkImageIds:ua.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 d3e(e),pe.initializeUniversalAdapter(this.universalAdapter,e.adapters||[]),(n=(r=this.universalAdapter).construct)==null||n.call(r,this,e)}initializeAdapters(e){var r;pe.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?Sw.extendCaipNetwork(e.defaultNetwork,{networkImageIds:ua.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0,n=nn.getItem(rn.ACTIVE_CAIP_NETWORK_ID),s=(n?e.networks.find(o=>o.id===n):void 0)??r??e.networks[0];pe.setActiveCaipNetwork(s)}async initOrContinue(){return!this.initPromise&&!qN&&Be.isClient()&&(qN=!0,this.initPromise=new Promise(async e=>{await Promise.all([Dn(()=>import("./index-B0KDiB1T.js"),[]),Dn(()=>import("./w3m-modal-B8ngV96a.js"),[])]);const r=document.createElement("w3m-modal");qe.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}}const h3e="@reown/appkit",p3e="1.0.4",g3e="module",m3e="./dist/esm/exports/index.js",w3e="./dist/types/exports/index.d.ts",v3e=["dist","!tsconfig.tsbuildinfo"],y3e={"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"},b3e={".":{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"}},x3e={"*":{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"]}},_3e={"@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"},C3e={borsh:"0.7.0",bs58:"5.0.0"},A3e={"@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"},E3e="Reown (https://reown.com)",S3e="Apache-2.0",I3e="https://github.com/WalletConnect/web3modal",T3e={type:"git",url:"git+https://github.com/WalletConnect/web3modal.git"},k3e={url:"https://github.com/WalletConnect/web3modal/issues"},P3e={name:h3e,version:p3e,type:g3e,main:m3e,types:w3e,files:v3e,scripts:y3e,exports:b3e,typesVersions:x3e,dependencies:_3e,optionalDependencies:C3e,devDependencies:A3e,author:E3e,license:S3e,homepage:I3e,repository:T3e,bugs:k3e};var No=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 Ys=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=pe.state.activeCaipAddress,this.balanceVal=Ee.state.balance,this.balanceSymbol=Ee.state.balanceSymbol,this.profileName=Ee.state.profileName,this.profileImage=Ee.state.profileImage,this.network=pe.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(An.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),Ee.subscribeKey("balance",e=>this.balanceVal=e),Ee.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Ee.subscribeKey("profileName",e=>this.profileName=e),Ee.subscribeKey("profileImage",e=>this.profileImage=e),pe.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=_T(function(){return Lr(te,It+"return "+De).apply(r,ue)});if(hr.source=De,W8(hr))throw hr;return hr}function fZ(u){return jr(u).toLowerCase()}function hZ(u){return jr(u).toUpperCase()}function pZ(u,f,C){if(u=jr(u),u&&(C||f===r))return RS(u);if(!u||!(f=io(f)))return u;var j=Ma(u),Z=Ma(f),te=NS(j,Z),ue=MS(j,Z)+1;return od(j,te,ue).join("")}function gZ(u,f,C){if(u=jr(u),u&&(C||f===r))return u.slice(0,$S(u)+1);if(!u||!(f=io(f)))return u;var j=Ma(u),Z=MS(j,Ma(f))+1;return od(j,0,Z).join("")}function mZ(u,f,C){if(u=jr(u),u&&(C||f===r))return u.replace(Wt,"");if(!u||!(f=io(f)))return u;var j=Ma(u),Z=NS(j,Ma(f));return od(j,Z).join("")}function wZ(u,f){var C=K,j=B;if(bn(f)){var Z="separator"in f?f.separator:Z;C="length"in f?fr(f.length):C,j="omission"in f?io(f.omission):j}u=jr(u);var te=u.length;if(V0(u)){var ue=Ma(u);te=ue.length}if(C>=te)return u;var he=C-K0(j);if(he<1)return j;var be=ue?od(ue,0,he).join(""):u.slice(0,he);if(Z===r)return be+j;if(ue&&(he+=be.length-he),H8(Z)){if(u.slice(he).search(Z)){var Ne,Me=be;for(Z.global||(Z=o8(Z.source,jr(ar.exec(Z))+"g")),Z.lastIndex=0;Ne=Z.exec(Me);)var De=Ne.index;be=be.slice(0,De===r?he:De)}}else if(u.indexOf(io(Z),he)!=he){var nt=be.lastIndexOf(Z);nt>-1&&(be=be.slice(0,nt))}return be+j}function vZ(u){return u=jr(u),u&&ft.test(u)?u.replace(yr,KW):u}var yZ=ep(function(u,f,C){return u+(C?" ":"")+f.toUpperCase()}),K8=CI("toUpperCase");function xT(u,f,C){return u=jr(u),f=C?r:f,f===r?zW(u)?QW(u):MW(u):u.match(f)||[]}var _T=wr(function(u,f){try{return oi(u,r,f)}catch(C){return W8(C)?C:new tr(C)}}),bZ=Vl(function(u,f){return Bo(f,function(C){C=Lc(C),Hl(u,C,F8(u[C],u))}),u});function xZ(u){var f=u==null?0:u.length,C=Ht();return u=f?gn(u,function(j){if(typeof j[1]!="function")throw new Uo(o);return[C(j[0]),j[1]]}):[],wr(function(j){for(var Z=-1;++ZS)return[];var C=b,j=Bi(u,b);f=Ht(f),u-=b;for(var Z=n8(j,f);++C0||f<0)?new Ar(C):(u<0?C=C.takeRight(-u):u&&(C=C.drop(u)),f!==r&&(f=fr(f),C=f<0?C.dropRight(-f):C.take(f-u)),C)},Ar.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ar.prototype.toArray=function(){return this.take(b)},$c(Ar.prototype,function(u,f){var C=/^(?:filter|find|map|reject)|While$/.test(f),j=/^(?:head|last)$/.test(f),Z=X[j?"take"+(f=="last"?"Right":""):f],te=j||/^find/.test(f);Z&&(X.prototype[f]=function(){var ue=this.__wrapped__,he=j?[1]:arguments,be=ue instanceof Ar,Ne=he[0],Me=be||ir(ue),De=function(br){var Pr=Z.apply(X,ed([br],he));return j&&nt?Pr[0]:Pr};Me&&C&&typeof Ne=="function"&&Ne.length!=1&&(be=Me=!1);var nt=this.__chain__,It=!!this.__actions__.length,Kt=te&&!nt,hr=be&&!It;if(!te&&Me){ue=hr?ue:new Ar(this);var Gt=u.apply(ue,he);return Gt.__actions__.push({func:$3,args:[De],thisArg:r}),new jo(Gt,nt)}return Kt&&hr?u.apply(this,he):(Gt=this.thru(De),Kt?j?Gt.value()[0]:Gt.value():Gt)})}),Bo(["pop","push","shift","sort","splice","unshift"],function(u){var f=a3[u],C=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",j=/^(?:pop|shift)$/.test(u);X.prototype[u]=function(){var Z=arguments;if(j&&!this.__chain__){var te=this.value();return f.apply(ir(te)?te:[],Z)}return this[C](function(ue){return f.apply(ir(ue)?ue:[],Z)})}}),$c(Ar.prototype,function(u,f){var C=X[f];if(C){var j=C.name+"";Wr.call(Y0,j)||(Y0[j]=[]),Y0[j].push({name:f,func:C})}}),Y0[T3(r,N).name]=[{name:"wrapper",func:r}],Ar.prototype.clone=vH,Ar.prototype.reverse=yH,Ar.prototype.value=bH,X.prototype.at=ZV,X.prototype.chain=QV,X.prototype.commit=YV,X.prototype.next=JV,X.prototype.plant=eK,X.prototype.reverse=tK,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=rK,X.prototype.first=X.prototype.head,Lg&&(X.prototype[Lg]=XV),X},G0=YW();Ln?((Ln.exports=G0)._=G0,Qr._=G0):kr._=G0}).call(_m)})(U_,U_.exports);var D2e=Object.defineProperty,L2e=Object.defineProperties,B2e=Object.getOwnPropertyDescriptors,$N=Object.getOwnPropertySymbols,U2e=Object.prototype.hasOwnProperty,j2e=Object.prototype.propertyIsEnumerable,DN=(t,e,r)=>e in t?D2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ey=(t,e)=>{for(var r in e||(e={}))U2e.call(e,r)&&DN(t,r,e[r]);if($N)for(var r of $N(e))j2e.call(e,r)&&DN(t,r,e[r]);return t},F2e=(t,e)=>L2e(t,B2e(e));function mc(t,e,r){var n;const i=Jm(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${$2e}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function $0(t){return t.includes(":")?t.split(":")[1]:t}function Oj(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function z2e(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 P9(t={},e={}){const r=LN(t),n=LN(e);return U_.exports.merge(r,n)}function LN(t){var e,r,n,i;const s={};if(!fv(t))return s;for(const[o,a]of Object.entries(t)){const c=PE(o)?[o]:a.chains,l=a.methods||[],d=a.events||[],h=a.rpcMap||{},g=Om(o);s[g]=F2e(Ey(Ey({},s[g]),a),{chains:nb(c,(e=s[g])==null?void 0:e.chains),methods:nb(l,(r=s[g])==null?void 0:r.methods),events:nb(d,(n=s[g])==null?void 0:n.events),rpcMap:Ey(Ey({},h),(i=s[g])==null?void 0:i.rpcMap)})}return s}function W2e(t){return t.includes(":")?t.split(":")[2]:t}function BN(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=PE(r)?[r]:n.chains?n.chains:Oj(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function R9(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 $j={},zr=t=>$j[t],N9=(t,e)=>{$j[t]=e};class H2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}var q2e=Object.defineProperty,V2e=Object.defineProperties,K2e=Object.getOwnPropertyDescriptors,UN=Object.getOwnPropertySymbols,G2e=Object.prototype.hasOwnProperty,Z2e=Object.prototype.propertyIsEnumerable,jN=(t,e,r)=>e in t?q2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,FN=(t,e)=>{for(var r in e||(e={}))G2e.call(e,r)&&jN(t,r,e[r]);if(UN)for(var r of UN(e))Z2e.call(e,r)&&jN(t,r,e[r]);return t},zN=(t,e)=>V2e(t,K2e(e));class Q2e{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(Sc.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||mc(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(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($0(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:zN(FN({},o.sessionProperties||{}),{capabilities:zN(FN({},a||{}),{[s]:c})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return c}}class Y2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class J2e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class X2e{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||mc(`${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(Sc.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||mc(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ec(new Dl(n,zr("disableProviderPing")))}}class e3e{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(Sc.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=$0(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 Ec(new Dl(n,zr("disableProviderPing")))}}class t3e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class r3e{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(Sc.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=$0(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}class n3e{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||mc(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Sc.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||mc(e,this.namespace);return typeof n>"u"?void 0:new Ec(new Dl(n,zr("disableProviderPing")))}}class i3e{constructor(e){this.name=gp,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(Sc.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=Jm(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||mc(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Ec(new Dl(n,zr("disableProviderPing")))}}var s3e=Object.defineProperty,o3e=Object.defineProperties,a3e=Object.getOwnPropertyDescriptors,WN=Object.getOwnPropertySymbols,c3e=Object.prototype.hasOwnProperty,l3e=Object.prototype.propertyIsEnumerable,HN=(t,e,r)=>e in t?s3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sy=(t,e)=>{for(var r in e||(e={}))c3e.call(e,r)&&HN(t,r,e[r]);if(WN)for(var r of WN(e))l3e.call(e,r)&&HN(t,r,e[r]);return t},M9=(t,e)=>o3e(t,a3e(e));class DE{constructor(e){this.events=new cE,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:Xv(t2({level:(e==null?void 0:e.logger)||MN})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new DE(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:Sy({},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,f4(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=BN(this.session.namespaces);this.namespaces=P9(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=BN(s.namespaces);this.namespaces=P9(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Nj)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===gp?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(Jh(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 C2e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||MN,relayUrl:this.providerOpts.relayUrl||N2e,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=>Om(r)))];N9("client",this.client),N9("events",this.events),N9("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=z2e(r,this.session),i=Oj(n),s=P9(this.namespaces,this.optionalNamespaces),o=M9(Sy({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new Q2e({namespace:o});break;case"algorand":this.rpcProviders[r]=new X2e({namespace:o});break;case"solana":this.rpcProviders[r]=new Y2e({namespace:o});break;case"cosmos":this.rpcProviders[r]=new J2e({namespace:o});break;case"polkadot":this.rpcProviders[r]=new H2e({namespace:o});break;case"cip34":this.rpcProviders[r]=new e3e({namespace:o});break;case"elrond":this.rpcProviders[r]=new t3e({namespace:o});break;case"multiversx":this.rpcProviders[r]=new r3e({namespace:o});break;case"near":this.rpcProviders[r]=new n3e({namespace:o});break;default:this.rpcProviders[gp]?this.rpcProviders[gp].updateNamespace(o):this.rpcProviders[gp]=new i3e({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&&Jh(i)&&this.events.emit("accountsChanged",i.map(W2e))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Om(i),a=R9(i)!==R9(s)?`${o}:${R9(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=M9(Sy({},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",M9(Sy({},Vr("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Sc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[gp]}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=>Om(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=Om(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(`${ON}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${ON}/${e}`)}}const Dj={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},{})}},Jo=Tn({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),j1={state:Jo,subscribeKey(t,e){return Cs(Jo,t,e)},subscribeProviders(t){return gs(Jo.providers,()=>t(Jo.providers))},setProvider(t,e){e&&(Jo.providers[t]=rc(e))},getProvider(t){return Jo.providers[t]},setProviderId(t,e){e&&(Jo.providerIds[t]=e)},getProviderId(t){return Jo.providerIds[t]},reset(){Jo.providers={eip155:void 0,solana:void 0,polkadot:void 0},Jo.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(t){Jo.providers[t]=void 0,Jo.providerIds[t]=void 0}},u3e=["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 d3e{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 h=(g=s==null?void 0:s[d])==null?void 0:g.chains;h&&o.push(...h)}),i({supportsAllNetworks:!0,approvedCaipNetworkIds:o})}))},this.connectionControllerClient={connectWalletConnect:async i=>{var o,a,c,l,d,h,g,v,x,R,M;const s=await this.getWalletConnectProvider();if(!s)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(s.on("display_uri",N=>{i(N)}),pe.state.activeChain&&((c=(a=(o=pe.state)==null?void 0:o.chains)==null?void 0:a.get(pe.state.activeChain))==null?void 0:c.adapterType)==="wagmi"){const N=pe.state.chains.get(pe.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((h=r==null?void 0:r.getMessageParams)==null?void 0:h.call(r)),E=(g=r==null?void 0:r.options)==null?void 0:g.enabled,O=typeof(s==null?void 0:s.authenticate)=="function",L=N&&Object.keys(N||{}).length>0;if(r&&E&&N&&O&&L){const{SIWEController:U,getDidChainId:H,getDidAddress:I}=await Dn(async()=>{const{SIWEController:B,getDidChainId:_,getDidAddress:p}=await import("./index-DzmO8s0j.js");return{SIWEController:B,getDidChainId:_,getDidAddress:p}},[]),T=(v=this.caipNetworks)==null?void 0:v.filter(B=>B.chainNamespace==="eip155").map(B=>B.id);N.chains=(x=this.caipNetworks)==null?void 0:x.filter(B=>B.chainNamespace==="eip155").map(B=>B.chainId);const F=await s.authenticate({nonce:await((R=r==null?void 0:r.getNonce)==null?void 0:R.call(r)),methods:[...u3e],...N,chains:T}),K=(M=F==null?void 0:F.auths)==null?void 0:M[0];if(K){const{p:B,s:_}=K,p=H(B.iss),m=I(B.iss);m&&p&&U.setSession({address:m,chainId:parseInt(p,10)});try{const w=s.client.formatAuthMessage({request:B,iss:B.iss});await U.verifyMessage({message:w,signature:_.s,cacao:K})}catch(w){throw console.error("Error verifying message",w),await s.disconnect().catch(console.error),await U.signOut().catch(console.error),w}}}else{const U=Dj.createNamespaces(this.caipNetworks);await s.connect({optionalNamespaces:U})}this.setWalletConnectProvider()}},disconnect:async()=>{var i,s,o,a;if(nn.removeItem(rn.WALLET_ID),(i=r==null?void 0:r.options)!=null&&i.signOutOnDisconnect){const{SIWEController:c}=await Dn(async()=>{const{SIWEController:l}=await import("./index-DzmO8s0j.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=pe.state.activeCaipAddress,a=Be.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 DE.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=nn.getItem(rn.WALLET_ID);e&&r===cr.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var r,n,i;nn.setItem(rn.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];j1.setProvider(a,this.walletConnectProvider),j1.setProviderId(a,"walletConnect"),c&&((d=this.appKit)==null||d.setCaipAddress(c,a))});const s=vr.getStoredActiveCaipNetwork(),o=pe.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=>{Ee.resetAccount(a)}),Lt.resetWcConnection(),nn.removeItem(rn.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,h,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:((h=this.appKit)==null?void 0:h.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,R,M,N;const d=l,h=(v=r==null?void 0:r[l])==null?void 0:v.accounts[0];((x=this.appKit)==null?void 0:x.getCaipAddress(d))||((R=this.appKit)==null||R.setPreferredAccountType(n,d),(M=this.appKit)==null||M.setCaipAddress(h,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[,,h]=d.split(":");return h}).filter((d,h,g)=>g.indexOf(d)===h);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=nn.getItem(rn.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,h;(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"),(h=this.appKit)==null||h.setConnectedWalletInfo({name:e},"solana"))})}syncConnectors(){var r;const e=[];e.push({id:cr.WALLET_CONNECT_CONNECTOR_ID,explorerId:ua.ConnectorExplorerIds[cr.WALLET_CONNECT_CONNECTOR_ID],imageId:ua.ConnectorImageIds[cr.WALLET_CONNECT_CONNECTOR_ID],name:ua.ConnectorNamesMap[cr.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(r=this.appKit)==null||r.setConnectors(e)}}let qN=!1;class f3e{constructor(e){var r;this.initPromise=void 0,this.setStatus=(n,i)=>{Ee.setStatus(n,i)},this.getIsConnectedState=()=>!!pe.state.activeCaipAddress,this.setAllAccounts=(n,i)=>{Ee.setAllAccounts(n,i),qe.setHasMultipleAddresses((n==null?void 0:n.length)>1)},this.addAddressLabel=(n,i,s)=>{Ee.addAddressLabel(n,i,s)},this.removeAddressLabel=(n,i)=>{Ee.removeAddressLabel(n,i)},this.getCaipAddress=n=>pe.state.activeChain===n||!n?pe.state.activeCaipAddress:pe.getAccountProp("caipAddress",n),this.getAddress=n=>pe.state.activeChain===n||!n?Ee.state.address:pe.getAccountProp("address",n),this.getProvider=()=>Ee.state.provider,this.getPreferredAccountType=()=>Ee.state.preferredAccountType,this.setCaipAddress=(n,i)=>{Ee.setCaipAddress(n,i)},this.setProvider=(n,i)=>{Ee.setProvider(n,i)},this.setBalance=(n,i,s)=>{Ee.setBalance(n,i,s)},this.setProfileName=(n,i)=>{Ee.setProfileName(n,i)},this.setProfileImage=(n,i)=>{Ee.setProfileImage(n,i)},this.resetAccount=n=>{Ee.resetAccount(n)},this.setCaipNetwork=n=>{pe.setActiveCaipNetwork(n)},this.getCaipNetwork=n=>{var i;return n?(i=Zt.getRequestedCaipNetworks().filter(s=>s.chainNamespace===n))==null?void 0:i[0]:pe.state.activeCaipNetwork},this.getCaipNetworks=()=>Zt.getRequestedCaipNetworks(),this.getActiveChainNamespace=()=>pe.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=>vn.fetchIdentity(n),this.setAddressExplorerUrl=(n,i)=>{Ee.setAddressExplorerUrl(n,i)},this.setSmartAccountDeployed=(n,i)=>{Ee.setSmartAccountDeployed(n,i)},this.setConnectedWalletInfo=(n,i)=>{Ee.setConnectedWalletInfo(n,i)},this.setSmartAccountEnabledNetworks=(n,i)=>{Zt.setSmartAccountEnabledNetworks(n,i)},this.setPreferredAccountType=(n,i)=>{Ee.setPreferredAccountType(n,i)},this.getReownName=n=>qc.getNamesForAddress(n),this.resolveReownName=async n=>{var o;const i=await qc.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=>{vn.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=pe.state.activeCaipNetwork)==null?void 0:e.chainId}switchNetwork(e){return Zt.switchActiveNetwork(e)}getWalletProvider(){return pe.state.activeChain?j1.state.providers[pe.state.activeChain]:null}getWalletProviderType(){return pe.state.activeChain?j1.state.providerIds[pe.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return mn.state.themeMode}getThemeVariables(){return mn.state.themeVariables}setThemeMode(e){mn.setThemeMode(e),_L(mn.state.themeMode)}setThemeVariables(e){mn.setThemeVariables(e),kre(mn.state.themeVariables)}subscribeTheme(e){return mn.subscribe(e)}getWalletInfo(){return Ee.state.connectedWalletInfo}subscribeWalletInfo(e){return Ee.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){Ee.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){Zt.subscribeKey("caipNetwork",e)}getState(){return wu.state}subscribeState(e){return wu.subscribe(e)}showErrorMessage(e){St.showError(e)}showSuccessMessage(e){St.showSuccess(e)}getEvent(){return{...ot.state}}subscribeEvents(e){return ot.subscribe(e)}replace(e){Ce.replace(e)}redirect(e){Ce.push(e)}popTransactionStack(e){Ce.popTransactionStack(e)}isOpen(){return jt.state.open}isTransactionStackEmpty(){return Ce.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=Ce.state.transactionStack[Ce.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&&mn.setThemeMode(e.themeMode),e.themeVariables&&mn.setThemeVariables(e.themeVariables),e.disableAppend&&qe.setDisableAppend(!!e.disableAppend),((n=e.adapters)==null?void 0:n.find(i=>i.chainNamespace===yn.CHAIN.EVM))&&e.siweConfig){const{SIWEController:i}=await Dn(async()=>{const{SIWEController:s}=await import("./index-DzmO8s0j.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=Sw.extendCaipNetworks(e.networks,{networkImageIds:ua.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 d3e(e),pe.initializeUniversalAdapter(this.universalAdapter,e.adapters||[]),(n=(r=this.universalAdapter).construct)==null||n.call(r,this,e)}initializeAdapters(e){var r;pe.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?Sw.extendCaipNetwork(e.defaultNetwork,{networkImageIds:ua.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0,n=nn.getItem(rn.ACTIVE_CAIP_NETWORK_ID),s=(n?e.networks.find(o=>o.id===n):void 0)??r??e.networks[0];pe.setActiveCaipNetwork(s)}async initOrContinue(){return!this.initPromise&&!qN&&Be.isClient()&&(qN=!0,this.initPromise=new Promise(async e=>{await Promise.all([Dn(()=>import("./index-BxqjrocD.js"),[]),Dn(()=>import("./w3m-modal-bl8_8Yo-.js"),[])]);const r=document.createElement("w3m-modal");qe.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}}const h3e="@reown/appkit",p3e="1.0.4",g3e="module",m3e="./dist/esm/exports/index.js",w3e="./dist/types/exports/index.d.ts",v3e=["dist","!tsconfig.tsbuildinfo"],y3e={"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"},b3e={".":{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"}},x3e={"*":{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"]}},_3e={"@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"},C3e={borsh:"0.7.0",bs58:"5.0.0"},A3e={"@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"},E3e="Reown (https://reown.com)",S3e="Apache-2.0",I3e="https://github.com/WalletConnect/web3modal",T3e={type:"git",url:"git+https://github.com/WalletConnect/web3modal.git"},k3e={url:"https://github.com/WalletConnect/web3modal/issues"},P3e={name:h3e,version:p3e,type:g3e,main:m3e,types:w3e,files:v3e,scripts:y3e,exports:b3e,typesVersions:x3e,dependencies:_3e,optionalDependencies:C3e,devDependencies:A3e,author:E3e,license:S3e,homepage:I3e,repository:T3e,bugs:k3e};var No=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 Ys=class extends _e{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=pe.state.activeCaipAddress,this.balanceVal=Ee.state.balance,this.balanceSymbol=Ee.state.balanceSymbol,this.profileName=Ee.state.profileName,this.profileImage=Ee.state.profileImage,this.network=pe.state.activeCaipNetwork,this.networkImage=this.network?Sr.getNetworkImage(this.network):void 0,this.isUnsupportedChain=Zt.state.isUnsupportedChain,this.unsubscribe.push(An.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Sr.getNetworkImage(this.network):void 0}),pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),Ee.subscribeKey("balance",e=>this.balanceVal=e),Ee.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Ee.subscribeKey("profileName",e=>this.profileName=e),Ee.subscribeKey("profileImage",e=>this.profileImage=e),pe.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"}),Ce.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Dn(async()=>{const{SIWEController:i}=await import("./index-C90-4id0.js");return{SIWEController:i}},[]),r=Ce.state.view==="ApproveTransaction";e.state.status!=="success"&&r?Ce.popTransactionStack(!0):jt.close()}else jt.close()}closeButtonTemplate(){const e=Ce.state.view==="ConnectingSiwe";return this.isSiweEnabled&&e?q`
`:q` + `}onWalletHelp(){ot.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),Ce.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Dn(async()=>{const{SIWEController:i}=await import("./index-DzmO8s0j.js");return{SIWEController:i}},[]),r=Ce.state.view==="ApproveTransaction";e.state.status!=="success"&&r?Ce.popTransactionStack(!0):jt.close()}else jt.close()}closeButtonTemplate(){const e=Ce.state.view==="ConnectingSiwe";return this.isSiweEnabled&&e?q`
`:q` e+r.replace("0x",""),"")}`}class bv extends Fe{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 VE 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 V5(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 R4(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 JIe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");V5(t.outputLen),V5(t.blockLen)}function K5(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 pF(t,e){R4(t);const r=e.outputLen;if(t.length>yM&ky)}:{h:Number(t>>yM&ky)|0,l:Number(t&ky)|0}}function a5e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,l5e=(t,e,r)=>e<>>32-r,u5e=(t,e,r)=>e<>>64-r,d5e=(t,e,r)=>t<>>64-r,D9=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const f5e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),L9=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),zc=(t,e)=>t<<32-e|t>>>e,bM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,h5e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function xM(t){for(let e=0;et().update(KE(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function eTe(t=32){if(D9&&typeof D9.getRandomValues=="function")return D9.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}const wF=[],vF=[],yF=[],g5e=BigInt(0),Cm=BigInt(1),m5e=BigInt(2),w5e=BigInt(7),v5e=BigInt(256),y5e=BigInt(113);for(let t=0,e=Cm,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],wF.push(2*(5*n+r)),vF.push((t+1)*(t+2)/2%64);let i=g5e;for(let s=0;s<7;s++)e=(e<>w5e)*y5e)%v5e,e&m5e&&(i^=Cm<<(Cm<r>32?u5e(t,e,r):c5e(t,e,r),CM=(t,e,r)=>r>32?d5e(t,e,r):l5e(t,e,r);function _5e(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],h=_M(l,d,1)^r[a],g=CM(l,d,1)^r[a+1];for(let v=0;v<50;v+=10)t[o+v]^=h,t[o+v+1]^=g}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=vF[o],c=_M(i,s,a),l=CM(i,s,a),d=wF[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]^=b5e[n],t[1]^=x5e[n]}r.fill(0)}class GE extends gF{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,V5(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=f5e(this.state)}keccak(){bM||xM(this.state32),_5e(this.state32,this.rounds),bM||xM(this.state32),this.posOut=0,this.pos=0}update(e){K5(this);const{blockLen:r,state:n}=this;e=KE(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 V5(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(pF(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 GE(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 C5e=(t,e,r)=>mF(()=>new GE(e,t,r)),A5e=C5e(1,136,256/8);function gf(t,e){const r=e||"hex",n=A5e(Wu(t,{strict:!1})?S4(t):t);return r==="bytes"?n:d0(n)}const B9=new VE(8192);function N4(t,e){if(B9.has(`${t}.${e}`))return B9.get(`${t}.${e}`);const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=gf(kh(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 B9.set(`${t}.${e}`,s),s}function zs(t,e){if(!mf(t,{strict:!1}))throw new bv({address:t});return N4(t,e)}const E5e=/^0x[a-fA-F0-9]{40}$/,U9=new VE(8192);function mf(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(U9.has(n))return U9.get(n);const i=E5e.test(t)?t.toLowerCase()===t?!0:r?N4(t)===t:!0:!1;return U9.set(n,i),i}function G5(t,e,r,{strict:n}={}){return Wu(t,{strict:!1})?S5e(t,e,r,{strict:n}):_F(t,e,r,{strict:n})}function bF(t,e){if(typeof e=="number"&&e>0&&e>Ei(t)-1)throw new lF({offset:e,position:"start",size:Ei(t)})}function xF(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Ei(t)!==r-e)throw new lF({offset:r,position:"end",size:Ei(t)})}function _F(t,e,r,{strict:n}={}){bF(t,e);const i=t.slice(e,r);return n&&xF(i,e,r),i}function S5e(t,e,r,{strict:n}={}){bF(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&xF(i,e,r),i}function CF(t,e){if(t.length!==e.length)throw new Ybe({expectedLength:t.length,givenLength:e.length});const r=I5e({params:t,values:e}),n=QE(r);return n.length===0?"0x":n}function I5e({params:t,values:e}){const r=[];for(let n=0;n0?h0([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:h0(s.map(({encoded:o})=>o))}}function P5e(t,{param:e}){const[,r]=e.type.split("bytes"),n=Ei(t);if(!r){let i=t;return n%32!==0&&(i=Qd(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:h0([Qd(gr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new Qbe({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:Qd(t,{dir:"right"})}}function R5e(t){if(typeof t!="boolean")throw new Fe(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Qd(fF(t))}}function N5e(t,{signed:e}){return{dynamic:!1,encoded:gr(t,{size:32,signed:e})}}function M5e(t){const e=I4(t),r=Math.ceil(Ei(e)/32),n=[];for(let i=0;ii))}}function YE(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const j9="/docs/contract/encodeDeployData";function AF(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 Kbe({docsPath:j9});if(!("inputs"in i))throw new vM({docsPath:j9});if(!i.inputs||i.inputs.length===0)throw new vM({docsPath:j9});const s=CF(i.inputs,r);return P4([n,s])}function Rc(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class JE extends Fe{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 F9 extends Fe{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function $5e(t){const e=gf(`0x${t.substring(4)}`).substring(26);return N4(`0x${e}`)}async function D5e({hash:t,signature:e}){const r=Wu(t)?t:d0(t),{secp256k1:n}=await Dn(async()=>{const{secp256k1:o}=await import("./secp256k1-Jr9fFTYw.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:h,yParity:g}=e,v=Number(g??h),x=AM(v);return new n.Signature(G1(l),G1(d)).addRecoveryBit(x)}const o=Wu(e)?e:d0(e),a=u0(`0x${o.slice(130)}`),c=AM(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function AM(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 L5e({hash:t,signature:e}){return $5e(await D5e({hash:t,signature:e}))}class EM extends Fe{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class B5e extends Fe{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class U5e extends Fe{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const j5e={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 U5e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new B5e({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new EM({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 EM({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 XE(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(j5e);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function F5e(t,e="hex"){const r=EF(t),n=XE(new Uint8Array(r.length));return r.encode(n),e==="hex"?Ti(n.bytes):n.bytes}function EF(t){return Array.isArray(t)?z5e(t.map(e=>EF(e))):W5e(t)}function z5e(t){const e=t.reduce((i,s)=>i+s.length,0),r=SF(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 W5e(t){const e=typeof t=="string"?Tl(t):t,r=SF(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 SF(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 Fe("Length is too large.")}function H5e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,s=gf(P4(["0x05",F5e([gr(e),r,n?gr(n):"0x"])]));return i==="bytes"?Tl(s):s}async function IF(t){const{authorization:e,signature:r}=t;return L5e({hash:H5e(e),signature:r??e})}class aC extends Fe{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 q5e extends Fe{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 V5e extends Fe{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:"InvalidDefinitionTypeError"})}}function h0(t){return typeof t[0]=="string"?P4(t):i5e(t)}function i5e(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function P4(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}class bv extends Fe{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 VE 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 V5(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 R4(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 XIe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");V5(t.outputLen),V5(t.blockLen)}function K5(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 pF(t,e){R4(t);const r=e.outputLen;if(t.length>yM&ky)}:{h:Number(t>>yM&ky)|0,l:Number(t&ky)|0}}function a5e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,l5e=(t,e,r)=>e<>>32-r,u5e=(t,e,r)=>e<>>64-r,d5e=(t,e,r)=>t<>>64-r,D9=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const f5e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),L9=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),zc=(t,e)=>t<<32-e|t>>>e,bM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,h5e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function xM(t){for(let e=0;et().update(KE(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function tTe(t=32){if(D9&&typeof D9.getRandomValues=="function")return D9.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}const wF=[],vF=[],yF=[],g5e=BigInt(0),Cm=BigInt(1),m5e=BigInt(2),w5e=BigInt(7),v5e=BigInt(256),y5e=BigInt(113);for(let t=0,e=Cm,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],wF.push(2*(5*n+r)),vF.push((t+1)*(t+2)/2%64);let i=g5e;for(let s=0;s<7;s++)e=(e<>w5e)*y5e)%v5e,e&m5e&&(i^=Cm<<(Cm<r>32?u5e(t,e,r):c5e(t,e,r),CM=(t,e,r)=>r>32?d5e(t,e,r):l5e(t,e,r);function _5e(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],h=_M(l,d,1)^r[a],g=CM(l,d,1)^r[a+1];for(let v=0;v<50;v+=10)t[o+v]^=h,t[o+v+1]^=g}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=vF[o],c=_M(i,s,a),l=CM(i,s,a),d=wF[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]^=b5e[n],t[1]^=x5e[n]}r.fill(0)}class GE extends gF{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,V5(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=f5e(this.state)}keccak(){bM||xM(this.state32),_5e(this.state32,this.rounds),bM||xM(this.state32),this.posOut=0,this.pos=0}update(e){K5(this);const{blockLen:r,state:n}=this;e=KE(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 V5(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(pF(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 GE(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 C5e=(t,e,r)=>mF(()=>new GE(e,t,r)),A5e=C5e(1,136,256/8);function gf(t,e){const r=e||"hex",n=A5e(Wu(t,{strict:!1})?S4(t):t);return r==="bytes"?n:d0(n)}const B9=new VE(8192);function N4(t,e){if(B9.has(`${t}.${e}`))return B9.get(`${t}.${e}`);const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=gf(kh(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 B9.set(`${t}.${e}`,s),s}function zs(t,e){if(!mf(t,{strict:!1}))throw new bv({address:t});return N4(t,e)}const E5e=/^0x[a-fA-F0-9]{40}$/,U9=new VE(8192);function mf(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(U9.has(n))return U9.get(n);const i=E5e.test(t)?t.toLowerCase()===t?!0:r?N4(t)===t:!0:!1;return U9.set(n,i),i}function G5(t,e,r,{strict:n}={}){return Wu(t,{strict:!1})?S5e(t,e,r,{strict:n}):_F(t,e,r,{strict:n})}function bF(t,e){if(typeof e=="number"&&e>0&&e>Ei(t)-1)throw new lF({offset:e,position:"start",size:Ei(t)})}function xF(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Ei(t)!==r-e)throw new lF({offset:r,position:"end",size:Ei(t)})}function _F(t,e,r,{strict:n}={}){bF(t,e);const i=t.slice(e,r);return n&&xF(i,e,r),i}function S5e(t,e,r,{strict:n}={}){bF(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&xF(i,e,r),i}function CF(t,e){if(t.length!==e.length)throw new Ybe({expectedLength:t.length,givenLength:e.length});const r=I5e({params:t,values:e}),n=QE(r);return n.length===0?"0x":n}function I5e({params:t,values:e}){const r=[];for(let n=0;n0?h0([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:h0(s.map(({encoded:o})=>o))}}function P5e(t,{param:e}){const[,r]=e.type.split("bytes"),n=Ei(t);if(!r){let i=t;return n%32!==0&&(i=Qd(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:h0([Qd(gr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new Qbe({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:Qd(t,{dir:"right"})}}function R5e(t){if(typeof t!="boolean")throw new Fe(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Qd(fF(t))}}function N5e(t,{signed:e}){return{dynamic:!1,encoded:gr(t,{size:32,signed:e})}}function M5e(t){const e=I4(t),r=Math.ceil(Ei(e)/32),n=[];for(let i=0;ii))}}function YE(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const j9="/docs/contract/encodeDeployData";function AF(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 Kbe({docsPath:j9});if(!("inputs"in i))throw new vM({docsPath:j9});if(!i.inputs||i.inputs.length===0)throw new vM({docsPath:j9});const s=CF(i.inputs,r);return P4([n,s])}function Rc(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class JE extends Fe{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 F9 extends Fe{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function $5e(t){const e=gf(`0x${t.substring(4)}`).substring(26);return N4(`0x${e}`)}async function D5e({hash:t,signature:e}){const r=Wu(t)?t:d0(t),{secp256k1:n}=await Dn(async()=>{const{secp256k1:o}=await import("./secp256k1-B8dOsQyz.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:h,yParity:g}=e,v=Number(g??h),x=AM(v);return new n.Signature(G1(l),G1(d)).addRecoveryBit(x)}const o=Wu(e)?e:d0(e),a=u0(`0x${o.slice(130)}`),c=AM(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function AM(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 L5e({hash:t,signature:e}){return $5e(await D5e({hash:t,signature:e}))}class EM extends Fe{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class B5e extends Fe{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class U5e extends Fe{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const j5e={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 U5e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new B5e({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new EM({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 EM({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 XE(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(j5e);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function F5e(t,e="hex"){const r=EF(t),n=XE(new Uint8Array(r.length));return r.encode(n),e==="hex"?Ti(n.bytes):n.bytes}function EF(t){return Array.isArray(t)?z5e(t.map(e=>EF(e))):W5e(t)}function z5e(t){const e=t.reduce((i,s)=>i+s.length,0),r=SF(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 W5e(t){const e=typeof t=="string"?Tl(t):t,r=SF(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 SF(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 Fe("Length is too large.")}function H5e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,s=gf(P4(["0x05",F5e([gr(e),r,n?gr(n):"0x"])]));return i==="bytes"?Tl(s):s}async function IF(t){const{authorization:e,signature:r}=t;return L5e({hash:H5e(e),signature:r??e})}class aC extends Fe{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 q5e extends Fe{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 V5e extends Fe{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 TF extends Fe{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}function K5e({chain:t,currentChainId:e}){if(!t)throw new V5e;if(e!==t.id)throw new q5e({chain:t,currentChainId:e})}const G5e={gwei:9,wei:18},Z5e={ether:-9,wei:9},Q5e={ether:-18,gwei:-9};function $2(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 Vs(t,e="wei"){return $2(t,Z5e[e])}class Op extends Fe{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 Z5 extends Fe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Vs(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Z5,"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 cC extends Fe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Vs(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(cC,"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 lC extends Fe{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(lC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class uC extends Fe{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(uC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class dC extends Fe{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(dC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class fC extends Fe{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(fC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class hC extends Fe{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(hC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class pC extends Fe{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(pC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class gC extends Fe{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(gC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Q5 extends Fe{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Vs(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Vs(n)} gwei`:""}).`].join(` @@ -11062,7 +11062,7 @@ ${this.value??""}JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r),t6e=t=>t,tS=t=>t;class iw extends Fe{constructor({body:e,cause:r,details:n,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${tS(o)}`,e&&`Request body: ${uc(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class RF extends Fe{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${tS(n)}`,`Request body: ${uc(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class SM extends Fe{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${tS(r)}`,`Request body: ${uc(e)}`],name:"TimeoutError"})}}const r6e=-1;class to extends Fe{constructor(e,{code:r,docsPath:n,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof RF?e.code:r??r6e}}class Pg extends to{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class xv extends to{constructor(e){super(e,{code:xv.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(xv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class _v extends to{constructor(e){super(e,{code:_v.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(_v,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Cv extends to{constructor(e,{method:r}={}){super(e,{code:Cv.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(Cv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Av extends to{constructor(e){super(e,{code:Av.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` `)})}}Object.defineProperty(Av,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class p0 extends to{constructor(e){super(e,{code:p0.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(p0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Ev extends to{constructor(e){super(e,{code:Ev.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(Ev,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Sv extends to{constructor(e){super(e,{code:Sv.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Sv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Yd extends to{constructor(e){super(e,{code:Yd.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Yd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Z1 extends to{constructor(e){super(e,{code:Z1.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Z1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Iv extends to{constructor(e,{method:r}={}){super(e,{code:Iv.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(Iv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Q1 extends to{constructor(e){super(e,{code:Q1.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Q1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Tv extends to{constructor(e){super(e,{code:Tv.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Tv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class hn extends Pg{constructor(e){super(e,{code:hn.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(hn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class kv extends Pg{constructor(e){super(e,{code:kv.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(kv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Pv extends Pg{constructor(e,{method:r}={}){super(e,{code:Pv.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(Pv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Rv extends Pg{constructor(e){super(e,{code:Rv.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Rv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Nv extends Pg{constructor(e){super(e,{code:Nv.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Nv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Js extends Pg{constructor(e){super(e,{code:Js.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Js,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class n6e extends to{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function rS(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Fe?t.walk(i=>(i==null?void 0:i.code)===Op.code):t;return n instanceof Fe?new Op({cause:t,message:n.details}):Op.nodeMessage.test(r)?new Op({cause:t,message:t.details}):Z5.nodeMessage.test(r)?new Z5({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):cC.nodeMessage.test(r)?new cC({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):lC.nodeMessage.test(r)?new lC({cause:t,nonce:e==null?void 0:e.nonce}):uC.nodeMessage.test(r)?new uC({cause:t,nonce:e==null?void 0:e.nonce}):dC.nodeMessage.test(r)?new dC({cause:t,nonce:e==null?void 0:e.nonce}):fC.nodeMessage.test(r)?new fC({cause:t}):hC.nodeMessage.test(r)?new hC({cause:t,gas:e==null?void 0:e.gas}):pC.nodeMessage.test(r)?new pC({cause:t,gas:e==null?void 0:e.gas}):gC.nodeMessage.test(r)?new gC({cause:t}):Q5.nodeMessage.test(r)?new Q5({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new M4({cause:t})}function i6e(t,{docsPath:e,...r}){const n=(()=>{const i=rS(t,r);return i instanceof M4?t:i})();return new X5e(n,{docsPath:e,...r})}function nS(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}const s6e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function iS(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=o6e(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(r=>Ti(r)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=gr(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=gr(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=gr(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=gr(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=gr(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=gr(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=s6e[t.type]),typeof t.value<"u"&&(e.value=gr(t.value)),e}function o6e(t){return t.map(e=>({address:e.contractAddress,r:e.r,s:e.s,chainId:gr(e.chainId),nonce:gr(e.nonce),...typeof e.yParity<"u"?{yParity:gr(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:gr(e.v)}:{}}))}function on(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 a6e=2n**256n-1n;function O4(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?Rc(e):void 0;if(o&&!mf(o.address))throw new bv({address:o.address});if(s&&!mf(s))throw new bv({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new Y5e;if(n&&n>a6e)throw new Z5({maxFeePerGas:n});if(i&&n&&i>n)throw new Q5({maxFeePerGas:n,maxPriorityFeePerGas:i})}async function NF(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return u0(e)}class c6e extends Fe{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class sS extends Fe{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class l6e extends Fe{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Vs(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class MF extends Fe{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const OF={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function $F(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?u0(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?u0(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?OF[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(e.authorizationList=u6e(t.authorizationList)),e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}function u6e(t){return t.map(e=>({contractAddress:e.address,r:e.r,s:e.s,chainId:Number(e.chainId),nonce:Number(e.nonce),...typeof e.yParity<"u"?{yParity:Number(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:Number(e.v)}:{}}))}function d6e(t){var r;const e=(r=t.transactions)==null?void 0:r.map(n=>typeof n=="string"?n:$F(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}async function Mv(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var d,h,g;const s=n??"latest",o=i??!1,a=r!==void 0?gr(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]},{dedupe:!0}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]},{dedupe:!!a}),!c)throw new MF({blockHash:e,blockNumber:r});return(((g=(h=(d=t.chain)==null?void 0:d.formatters)==null?void 0:h.block)==null?void 0:g.format)||d6e)(c)}async function DF(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function tTe(t,e){return LF(t,e)}async function LF(t,e){var s,o;const{block:r,chain:n=t.chain,request:i}=e||{};try{const a=((s=n==null?void 0:n.fees)==null?void 0:s.maxPriorityFeePerGas)??((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee);if(typeof a=="function"){const l=r||await on(t,Mv,"getBlock")({}),d=await a({block:l,client:t,request:i});if(d===null)throw new Error;return d}if(typeof a<"u")return a;const c=await t.request({method:"eth_maxPriorityFeePerGas"});return G1(c)}catch{const[a,c]=await Promise.all([r?Promise.resolve(r):on(t,Mv,"getBlock")({}),on(t,DF,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new sS;const l=c-a.baseFeePerGas;return l<0n?0n:l}}async function rTe(t,e){return mC(t,e)}async function mC(t,e){var g,v;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var x,R;return typeof((x=n==null?void 0:n.fees)==null?void 0:x.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((R=n==null?void 0:n.fees)==null?void 0:R.baseFeeMultiplier)??1.2})();if(o<1)throw new c6e;const c=10**(((g=o.toString().split(".")[1])==null?void 0:g.length)??0),l=x=>x*BigInt(Math.ceil(o*c))/BigInt(c),d=r||await on(t,Mv,"getBlock")({});if(typeof((v=n==null?void 0:n.fees)==null?void 0:v.estimateFeesPerGas)=="function"){const x=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(x!==null)return x}if(s==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new sS;const x=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await LF(t,{block:d,chain:n,request:i}),R=l(d.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??R+x,maxPriorityFeePerGas:x}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await on(t,DF,"getGasPrice")({}))}}class f6e extends Fe{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:d,to:h,value:g}){var x;const v=D2({from:r==null?void 0:r.address,to:h,value:typeof g<"u"&&`${eS(g)} ${((x=i==null?void 0:i.nativeCurrency)==null?void 0:x.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Vs(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Vs(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Vs(l)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",v].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}function h6e(t,{docsPath:e,...r}){const n=(()=>{const i=rS(t,r);return i instanceof M4?t:i})();return new f6e(n,{docsPath:e,...r})}class p6e extends Fe{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class g6e extends Fe{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function IM(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} +`)})}}Object.defineProperty(Ev,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Sv extends to{constructor(e){super(e,{code:Sv.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Sv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Yd extends to{constructor(e){super(e,{code:Yd.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Yd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Z1 extends to{constructor(e){super(e,{code:Z1.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Z1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Iv extends to{constructor(e,{method:r}={}){super(e,{code:Iv.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(Iv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Q1 extends to{constructor(e){super(e,{code:Q1.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Q1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Tv extends to{constructor(e){super(e,{code:Tv.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Tv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class hn extends Pg{constructor(e){super(e,{code:hn.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(hn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class kv extends Pg{constructor(e){super(e,{code:kv.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(kv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Pv extends Pg{constructor(e,{method:r}={}){super(e,{code:Pv.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(Pv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Rv extends Pg{constructor(e){super(e,{code:Rv.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Rv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Nv extends Pg{constructor(e){super(e,{code:Nv.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Nv,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Js extends Pg{constructor(e){super(e,{code:Js.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Js,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class n6e extends to{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function rS(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Fe?t.walk(i=>(i==null?void 0:i.code)===Op.code):t;return n instanceof Fe?new Op({cause:t,message:n.details}):Op.nodeMessage.test(r)?new Op({cause:t,message:t.details}):Z5.nodeMessage.test(r)?new Z5({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):cC.nodeMessage.test(r)?new cC({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):lC.nodeMessage.test(r)?new lC({cause:t,nonce:e==null?void 0:e.nonce}):uC.nodeMessage.test(r)?new uC({cause:t,nonce:e==null?void 0:e.nonce}):dC.nodeMessage.test(r)?new dC({cause:t,nonce:e==null?void 0:e.nonce}):fC.nodeMessage.test(r)?new fC({cause:t}):hC.nodeMessage.test(r)?new hC({cause:t,gas:e==null?void 0:e.gas}):pC.nodeMessage.test(r)?new pC({cause:t,gas:e==null?void 0:e.gas}):gC.nodeMessage.test(r)?new gC({cause:t}):Q5.nodeMessage.test(r)?new Q5({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new M4({cause:t})}function i6e(t,{docsPath:e,...r}){const n=(()=>{const i=rS(t,r);return i instanceof M4?t:i})();return new X5e(n,{docsPath:e,...r})}function nS(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}const s6e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function iS(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=o6e(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(r=>Ti(r)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=gr(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=gr(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=gr(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=gr(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=gr(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=gr(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=s6e[t.type]),typeof t.value<"u"&&(e.value=gr(t.value)),e}function o6e(t){return t.map(e=>({address:e.contractAddress,r:e.r,s:e.s,chainId:gr(e.chainId),nonce:gr(e.nonce),...typeof e.yParity<"u"?{yParity:gr(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:gr(e.v)}:{}}))}function on(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 a6e=2n**256n-1n;function O4(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?Rc(e):void 0;if(o&&!mf(o.address))throw new bv({address:o.address});if(s&&!mf(s))throw new bv({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new Y5e;if(n&&n>a6e)throw new Z5({maxFeePerGas:n});if(i&&n&&i>n)throw new Q5({maxFeePerGas:n,maxPriorityFeePerGas:i})}async function NF(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return u0(e)}class c6e extends Fe{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class sS extends Fe{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class l6e extends Fe{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Vs(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class MF extends Fe{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const OF={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function $F(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?u0(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?u0(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?OF[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(e.authorizationList=u6e(t.authorizationList)),e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}function u6e(t){return t.map(e=>({contractAddress:e.address,r:e.r,s:e.s,chainId:Number(e.chainId),nonce:Number(e.nonce),...typeof e.yParity<"u"?{yParity:Number(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:Number(e.v)}:{}}))}function d6e(t){var r;const e=(r=t.transactions)==null?void 0:r.map(n=>typeof n=="string"?n:$F(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}async function Mv(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var d,h,g;const s=n??"latest",o=i??!1,a=r!==void 0?gr(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]},{dedupe:!0}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]},{dedupe:!!a}),!c)throw new MF({blockHash:e,blockNumber:r});return(((g=(h=(d=t.chain)==null?void 0:d.formatters)==null?void 0:h.block)==null?void 0:g.format)||d6e)(c)}async function DF(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function rTe(t,e){return LF(t,e)}async function LF(t,e){var s,o;const{block:r,chain:n=t.chain,request:i}=e||{};try{const a=((s=n==null?void 0:n.fees)==null?void 0:s.maxPriorityFeePerGas)??((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee);if(typeof a=="function"){const l=r||await on(t,Mv,"getBlock")({}),d=await a({block:l,client:t,request:i});if(d===null)throw new Error;return d}if(typeof a<"u")return a;const c=await t.request({method:"eth_maxPriorityFeePerGas"});return G1(c)}catch{const[a,c]=await Promise.all([r?Promise.resolve(r):on(t,Mv,"getBlock")({}),on(t,DF,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new sS;const l=c-a.baseFeePerGas;return l<0n?0n:l}}async function nTe(t,e){return mC(t,e)}async function mC(t,e){var g,v;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var x,R;return typeof((x=n==null?void 0:n.fees)==null?void 0:x.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((R=n==null?void 0:n.fees)==null?void 0:R.baseFeeMultiplier)??1.2})();if(o<1)throw new c6e;const c=10**(((g=o.toString().split(".")[1])==null?void 0:g.length)??0),l=x=>x*BigInt(Math.ceil(o*c))/BigInt(c),d=r||await on(t,Mv,"getBlock")({});if(typeof((v=n==null?void 0:n.fees)==null?void 0:v.estimateFeesPerGas)=="function"){const x=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(x!==null)return x}if(s==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new sS;const x=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await LF(t,{block:d,chain:n,request:i}),R=l(d.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??R+x,maxPriorityFeePerGas:x}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await on(t,DF,"getGasPrice")({}))}}class f6e extends Fe{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:d,to:h,value:g}){var x;const v=D2({from:r==null?void 0:r.address,to:h,value:typeof g<"u"&&`${eS(g)} ${((x=i==null?void 0:i.nativeCurrency)==null?void 0:x.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Vs(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Vs(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Vs(l)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",v].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}function h6e(t,{docsPath:e,...r}){const n=(()=>{const i=rS(t,r);return i instanceof M4?t:i})();return new f6e(n,{docsPath:e,...r})}class p6e extends Fe{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class g6e extends Fe{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function IM(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} `,"")}function m6e(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: `;return n.nonce&&(i+=` nonce: ${n.nonce} `),n.balance&&(i+=` balance: ${n.balance} @@ -11070,11 +11070,11 @@ ${this.value??""}{if(r.length!==66)throw new mM({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new mM({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function w6e(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=TM(n)),i!==void 0){if(o.state)throw new g6e;o.stateDiff=TM(i)}return o}function BF(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!mf(r,{strict:!1}))throw new bv({address:r});if(e[r])throw new p6e({address:r});e[r]=w6e(n)}return e}async function UF(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 oS(t,e){var i,s,o;const r=e.account??t.account,n=r?Rc(r):void 0;try{let m=function(A){const{block:P,request:S,rpcStateOverride:k}=A;return t.request({method:"eth_estimateGas",params:k?[S,P??"latest",k]:P?[S,P]:[S]})};const{accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:d,blockNumber:h,blockTag:g,data:v,gas:x,gasPrice:R,maxFeePerBlobGas:M,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:O,value:L,stateOverride:U,...H}=await cS(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),T=(h?gr(h):void 0)||g,F=BF(U),K=await(async()=>{if(H.to)return H.to;if(c&&c.length>0)return await IF({authorization:c[0]}).catch(()=>{throw new Fe("`to` is required. Could not infer from `authorizationList`")})})();O4(e);const B=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,p=(B||iS)({...nS(H,{format:B}),from:n==null?void 0:n.address,accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:d,data:v,gas:x,gasPrice:R,maxFeePerBlobGas:M,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:O,to:K,value:L});let w=BigInt(await m({block:T,request:p,rpcStateOverride:F}));if(c){const A=await UF(t,{address:p.from}),P=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(A)},rpcStateOverride:F}).catch(()=>100000n);return 2n*BigInt(y)}));w+=P.reduce((S,k)=>S+k,0n)}return w}catch(a){throw h6e(a,{...e,account:n,chain:t.chain})}}async function v6e(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 u0(i)}function jF(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=>Tl(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>Ti(s))}function FF(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=>Tl(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>Tl(o)):t.commitments,s=[];for(let o=0;oTi(o))}function y6e(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 b6e=(t,e,r)=>t&e^~t&r,x6e=(t,e,r)=>t&e^t&r^e&r;class _6e extends gF{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=L9(this.buffer)}update(e){K5(this);const{view:r,buffer:n,blockLen:i}=this;e=KE(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hd.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>>3,R=zc(v,17)^zc(v,19)^v>>>10;hd[h]=R+hd[h-7]+x+hd[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:d}=this;for(let h=0;h<64;h++){const g=zc(a,6)^zc(a,11)^zc(a,25),v=d+g+b6e(a,c,l)+C6e[h]+hd[h]|0,R=(zc(n,2)^zc(n,13)^zc(n,22))+x6e(n,i,s)|0;d=l,l=c,c=a,a=o+v|0,o=s,s=i,i=n,n=v+R|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(){hd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const E6e=mF(()=>new A6e);function S6e(t,e){return E6e(Wu(t,{strict:!1})?S4(t):t)}function I6e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=S6e(e);return i.set([r],0),n==="bytes"?i:Ti(i)}function T6e(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(I6e({commitment:s,to:n,version:r}));return i}const kM=6,zF=32,aS=4096,WF=zF*aS,PM=WF*kM-1-1*aS*kM;class k6e extends Fe{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class P6e extends Fe{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function R6e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Tl(t.data):t.data,n=Ei(r);if(!n)throw new P6e;if(n>PM)throw new k6e({maxSize:PM,size:n});const i=[];let s=!0,o=0;for(;s;){const a=XE(new Uint8Array(WF));let c=0;for(;ca.bytes):i.map(a=>Ti(a.bytes))}function N6e(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??R6e({data:e,to:n}),s=t.commitments??jF({blobs:i,kzg:r,to:n}),o=t.proofs??FF({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let c=0;c"u"&&h)if(c){const N=await M();g.nonce=await c.consume({address:h.address,chainId:N,client:t})}else g.nonce=await on(t,v6e,"getTransactionCount")({address:h.address,blockTag:"pending"});if((l.includes("fees")||l.includes("type"))&&typeof d>"u")try{g.type=M6e(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:O}=await mC(t,{block:N,chain:i,request:g});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(g.gas=await on(t,oS,"estimateGas")({...g,account:h?{address:h.address,type:"json-rpc"}:void 0})),O4(g),delete g.parameters,g}async function O6e(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function qF(t,e){var N,E,O,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:h,maxPriorityFeePerGas:g,nonce:v,value:x,...R}=e;if(!r)throw new JE({docsPath:"/docs/actions/wallet/sendTransaction"});const M=Rc(r);try{O4(e);const U=await(async()=>{if(e.to)return e.to;if(s&&s.length>0)return await IF({authorization:s[0]}).catch(()=>{throw new Fe("`to` is required. Could not infer from `authorizationList`.")})})();if(M.type==="json-rpc"){let H;n!==null&&(H=await on(t,NF,"getChainId")({}),K5e({currentChainId:H,chain:n}));const I=(O=(E=(N=t.chain)==null?void 0:N.formatters)==null?void 0:E.transactionRequest)==null?void 0:O.format,F=(I||iS)({...nS(R,{format:I}),accessList:i,authorizationList:s,blobs:o,chainId:H,data:a,from:M.address,gas:c,gasPrice:l,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:v,to:U,value:x});return await t.request({method:"eth_sendTransaction",params:[F]},{retryCount:0})}if(M.type==="local"){const H=await on(t,cS,"prepareTransactionRequest")({account:M,accessList:i,authorizationList:s,blobs:o,chain:n,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:v,nonceManager:M.nonceManager,parameters:[...HF,"sidecars"],value:x,...R,to:U}),I=(L=n==null?void 0:n.serializers)==null?void 0:L.transaction,T=await M.signTransaction(H,{serializer:I});return await on(t,O6e,"sendRawTransaction")({serializedTransaction:T})}throw M.type==="smart"?new F9({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new F9({docsPath:"/docs/actions/wallet/sendTransaction",type:M.type})}catch(U){throw U instanceof F9?U:i6e(U,{...e,account:M,chain:e.chain||void 0})}}const wC=[{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"}],VF=[{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"}],KF=[...VF,{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"}]}],$6e=[...VF,{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"}]}],RM=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],NM=[{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"}]}],nTe=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}];function D6e(t,e={}){typeof e.size<"u"&&Pc(t,{size:e.size});const r=Ti(t,e);return G1(r,e)}function L6e(t,e={}){let r=t;if(typeof e.size<"u"&&(Pc(r,{size:e.size}),r=kg(r)),r.length>1||r[0]>1)throw new Bbe(r);return!!r[0]}function Cu(t,e={}){typeof e.size<"u"&&Pc(t,{size:e.size});const r=Ti(t,e);return u0(r,e)}function B6e(t,e={}){let r=t;return typeof e.size<"u"&&(Pc(r,{size:e.size}),r=kg(r,{dir:"right"})),new TextDecoder().decode(r)}function GF(t,e){const r=typeof e=="string"?Tl(e):e,n=XE(r);if(Ei(r)===0&&t.length>0)throw new k4;if(Ei(e)&&Ei(e)<32)throw new Gbe({data:typeof e=="string"?e:Ti(e),params:t,size:Ei(e)});let i=0;const s=[];for(let o=0;o48?D6e(i,{signed:r}):Cu(i,{signed:r}),32]}function H6e(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(Ov(e)){const o=Cu(t.readBytes(vC)),a=r+o;for(let c=0;cgf(S4(t));function K6e(t){return V6e(t)}const G6e="1.0.5";let Ea=class yC extends Error{constructor(e,r={}){var o;const n=r.cause instanceof yC?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,i=r.cause instanceof yC&&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@${G6e}`].join(` +`).slice(0,-1)}function TM(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new mM({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new mM({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function w6e(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=TM(n)),i!==void 0){if(o.state)throw new g6e;o.stateDiff=TM(i)}return o}function BF(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!mf(r,{strict:!1}))throw new bv({address:r});if(e[r])throw new p6e({address:r});e[r]=w6e(n)}return e}async function UF(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 oS(t,e){var i,s,o;const r=e.account??t.account,n=r?Rc(r):void 0;try{let m=function(A){const{block:P,request:S,rpcStateOverride:k}=A;return t.request({method:"eth_estimateGas",params:k?[S,P??"latest",k]:P?[S,P]:[S]})};const{accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:d,blockNumber:h,blockTag:g,data:v,gas:x,gasPrice:R,maxFeePerBlobGas:M,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:O,value:L,stateOverride:U,...H}=await cS(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),T=(h?gr(h):void 0)||g,F=BF(U),K=await(async()=>{if(H.to)return H.to;if(c&&c.length>0)return await IF({authorization:c[0]}).catch(()=>{throw new Fe("`to` is required. Could not infer from `authorizationList`")})})();O4(e);const B=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,p=(B||iS)({...nS(H,{format:B}),from:n==null?void 0:n.address,accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:d,data:v,gas:x,gasPrice:R,maxFeePerBlobGas:M,maxFeePerGas:N,maxPriorityFeePerGas:E,nonce:O,to:K,value:L});let w=BigInt(await m({block:T,request:p,rpcStateOverride:F}));if(c){const A=await UF(t,{address:p.from}),P=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(A)},rpcStateOverride:F}).catch(()=>100000n);return 2n*BigInt(y)}));w+=P.reduce((S,k)=>S+k,0n)}return w}catch(a){throw h6e(a,{...e,account:n,chain:t.chain})}}async function v6e(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 u0(i)}function jF(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=>Tl(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>Ti(s))}function FF(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=>Tl(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>Tl(o)):t.commitments,s=[];for(let o=0;oTi(o))}function y6e(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 b6e=(t,e,r)=>t&e^~t&r,x6e=(t,e,r)=>t&e^t&r^e&r;class _6e extends gF{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=L9(this.buffer)}update(e){K5(this);const{view:r,buffer:n,blockLen:i}=this;e=KE(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let h=o;hd.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>>3,R=zc(v,17)^zc(v,19)^v>>>10;hd[h]=R+hd[h-7]+x+hd[h-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:d}=this;for(let h=0;h<64;h++){const g=zc(a,6)^zc(a,11)^zc(a,25),v=d+g+b6e(a,c,l)+C6e[h]+hd[h]|0,R=(zc(n,2)^zc(n,13)^zc(n,22))+x6e(n,i,s)|0;d=l,l=c,c=a,a=o+v|0,o=s,s=i,i=n,n=v+R|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(){hd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const E6e=mF(()=>new A6e);function S6e(t,e){return E6e(Wu(t,{strict:!1})?S4(t):t)}function I6e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=S6e(e);return i.set([r],0),n==="bytes"?i:Ti(i)}function T6e(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(I6e({commitment:s,to:n,version:r}));return i}const kM=6,zF=32,aS=4096,WF=zF*aS,PM=WF*kM-1-1*aS*kM;class k6e extends Fe{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class P6e extends Fe{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function R6e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Tl(t.data):t.data,n=Ei(r);if(!n)throw new P6e;if(n>PM)throw new k6e({maxSize:PM,size:n});const i=[];let s=!0,o=0;for(;s;){const a=XE(new Uint8Array(WF));let c=0;for(;ca.bytes):i.map(a=>Ti(a.bytes))}function N6e(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??R6e({data:e,to:n}),s=t.commitments??jF({blobs:i,kzg:r,to:n}),o=t.proofs??FF({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let c=0;c"u"&&h)if(c){const N=await M();g.nonce=await c.consume({address:h.address,chainId:N,client:t})}else g.nonce=await on(t,v6e,"getTransactionCount")({address:h.address,blockTag:"pending"});if((l.includes("fees")||l.includes("type"))&&typeof d>"u")try{g.type=M6e(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:O}=await mC(t,{block:N,chain:i,request:g});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(g.gas=await on(t,oS,"estimateGas")({...g,account:h?{address:h.address,type:"json-rpc"}:void 0})),O4(g),delete g.parameters,g}async function O6e(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function qF(t,e){var N,E,O,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:h,maxPriorityFeePerGas:g,nonce:v,value:x,...R}=e;if(!r)throw new JE({docsPath:"/docs/actions/wallet/sendTransaction"});const M=Rc(r);try{O4(e);const U=await(async()=>{if(e.to)return e.to;if(s&&s.length>0)return await IF({authorization:s[0]}).catch(()=>{throw new Fe("`to` is required. Could not infer from `authorizationList`.")})})();if(M.type==="json-rpc"){let H;n!==null&&(H=await on(t,NF,"getChainId")({}),K5e({currentChainId:H,chain:n}));const I=(O=(E=(N=t.chain)==null?void 0:N.formatters)==null?void 0:E.transactionRequest)==null?void 0:O.format,F=(I||iS)({...nS(R,{format:I}),accessList:i,authorizationList:s,blobs:o,chainId:H,data:a,from:M.address,gas:c,gasPrice:l,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:v,to:U,value:x});return await t.request({method:"eth_sendTransaction",params:[F]},{retryCount:0})}if(M.type==="local"){const H=await on(t,cS,"prepareTransactionRequest")({account:M,accessList:i,authorizationList:s,blobs:o,chain:n,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:v,nonceManager:M.nonceManager,parameters:[...HF,"sidecars"],value:x,...R,to:U}),I=(L=n==null?void 0:n.serializers)==null?void 0:L.transaction,T=await M.signTransaction(H,{serializer:I});return await on(t,O6e,"sendRawTransaction")({serializedTransaction:T})}throw M.type==="smart"?new F9({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new F9({docsPath:"/docs/actions/wallet/sendTransaction",type:M.type})}catch(U){throw U instanceof F9?U:i6e(U,{...e,account:M,chain:e.chain||void 0})}}const wC=[{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"}],VF=[{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"}],KF=[...VF,{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"}]}],$6e=[...VF,{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"}]}],RM=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],NM=[{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"}]}],iTe=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}];function D6e(t,e={}){typeof e.size<"u"&&Pc(t,{size:e.size});const r=Ti(t,e);return G1(r,e)}function L6e(t,e={}){let r=t;if(typeof e.size<"u"&&(Pc(r,{size:e.size}),r=kg(r)),r.length>1||r[0]>1)throw new Bbe(r);return!!r[0]}function Cu(t,e={}){typeof e.size<"u"&&Pc(t,{size:e.size});const r=Ti(t,e);return u0(r,e)}function B6e(t,e={}){let r=t;return typeof e.size<"u"&&(Pc(r,{size:e.size}),r=kg(r,{dir:"right"})),new TextDecoder().decode(r)}function GF(t,e){const r=typeof e=="string"?Tl(e):e,n=XE(r);if(Ei(r)===0&&t.length>0)throw new k4;if(Ei(e)&&Ei(e)<32)throw new Gbe({data:typeof e=="string"?e:Ti(e),params:t,size:Ei(e)});let i=0;const s=[];for(let o=0;o48?D6e(i,{signed:r}):Cu(i,{signed:r}),32]}function H6e(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(Ov(e)){const o=Cu(t.readBytes(vC)),a=r+o;for(let c=0;cgf(S4(t));function K6e(t){return V6e(t)}const G6e="1.0.5";let Ea=class yC extends Error{constructor(e,r={}){var o;const n=r.cause instanceof yC?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,i=r.cause instanceof yC&&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@${G6e}`].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 Of(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const ZF=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,QF=/^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)?$/,YF=/^\(.+?\).*?$/,OM=/^tuple(?(\[(\d*)\])*)$/;function bC(t){let e=t.type;if(OM.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 Q6e(t){return JF.test(t)}function Y6e(t){return Of(JF,t)}const XF=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function J6e(t){return XF.test(t)}function X6e(t){return Of(XF,t)}const ez=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function e4e(t){return ez.test(t)}function t4e(t){return Of(ez,t)}const tz=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function rz(t){return tz.test(t)}function r4e(t){return Of(tz,t)}const nz=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function n4e(t){return nz.test(t)}function i4e(t){return Of(nz,t)}const s4e=/^fallback\(\) external(?:\s(?payable{1}))?$/;function o4e(t){return s4e.test(t)}const a4e=/^receive\(\) external payable$/;function c4e(t){return a4e.test(t)}const l4e=new Set(["indexed"]),xC=new Set(["calldata","memory","storage"]);class u4e extends Ea{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 d4e extends Ea{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 f4e extends Ea{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class h4e extends Ea{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 p4e extends Ea{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 g4e extends Ea{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 m4e extends Ea{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 $m extends Ea{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class w4e extends Ea{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class v4e extends Ea{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 y4e extends Ea{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 b4e extends Ea{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 x4e(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 _4e(t,e={}){if(e4e(t)){const r=t4e(t);if(!r)throw new $m({signature:t,type:"function"});const n=nc(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$_]*))?$/,A4e=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,E4e=/^u?int$/;function ch(t,e){var h,g;const r=x4e(t,e==null?void 0:e.type);if(z9.has(r))return z9.get(r);const n=YF.test(t),i=Of(n?A4e:C4e,t);if(!i)throw new f4e({param:t});if(i.name&&I4e(i.name))throw new h4e({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=nc(i.type),x=[],R=v.length;for(let M=0;M[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function sz(t,e,r=new Set){const n=[],i=t.length;for(let s=0;s{const e=typeof t=="string"?t:Z6e(t);return R4e(e)};function az(t){return K6e(N4e(t))}const M4e=az,lS=t=>G5(az(t),0,4);function uS(t){const{abi:e,args:r=[],name:n}=t,i=Wu(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?lS(a)===n:a.type==="event"?M4e(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 h="inputs"in a&&a.inputs[d];return h?_C(l,h):!1})){if(o&&"inputs"in o&&o.inputs){const l=cz(a.inputs,o.inputs,r);if(l)throw new Xbe({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||s[0]}function _C(t,e){const r=typeof t,n=e.type;switch(n){case"address":return mf(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)=>_C(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=>_C(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function cz(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 cz(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")?mf(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?mf(r[n],{strict:!1}):!1)return o}}const W9="/docs/contract/decodeFunctionResult";function Rg(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=uS({abi:e,args:r,name:n});if(!a)throw new q5(n,{docsPath:W9});s=a}if(s.type!=="function")throw new q5(void 0,{docsPath:W9});if(!s.outputs)throw new Jbe(s.name,{docsPath:W9});const o=GF(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const $M="/docs/contract/encodeFunctionData";function O4e(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=uS({abi:e,args:r,name:n});if(!s)throw new q5(n,{docsPath:$M});i=s}if(i.type!=="function")throw new q5(void 0,{docsPath:$M});return{abi:[i],functionName:lS(f0(i))}}function U0(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:O4e(t)})(),i=r[0],s=n,o="inputs"in i&&i.inputs?CF(i.inputs,e??[]):void 0;return P4([s,o??"0x"])}function L2({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 aC({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new aC({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}const lz={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."},$4e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},D4e={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function L4e(t){const{abi:e,data:r}=t,n=G5(r,0,4);if(n==="0x")throw new k4;const s=[...e||[],$4e,D4e].find(o=>o.type==="error"&&n===lS(f0(o)));if(!s)throw new hF(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?GF(s.inputs,G5(r,4)):void 0,errorName:s.name}}function uz({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"?uc(e[s]):e[s]}`).join(", ")})`}class B4e extends Fe{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:d,to:h,value:g,stateOverride:v}){var M;const x=r?Rc(r):void 0;let R=D2({from:x==null?void 0:x.address,to:h,value:typeof g<"u"&&`${eS(g)} ${((M=i==null?void 0:i.nativeCurrency)==null?void 0:M.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Vs(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Vs(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Vs(l)} gwei`,nonce:d});v&&(R+=` ${m6e(v)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",R].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class dS extends Fe{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=uS({abi:r,args:n,name:o}),l=c?uz({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,d=c?f0(c,{includeName:!0}):void 0,h=D2({address:i&&t6e(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," "]:[],h&&"Contract Call:",h].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 CC extends Fe{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=L4e({abi:e,data:r});const{abiItem:d,errorName:h,args:g}=o;if(h==="Error")c=g[0];else if(h==="Panic"){const[v]=g;c=lz[v]}else{const v=d?f0(d,{includeName:!0}):void 0,x=d&&g?uz({abiItem:d,args:g,includeFunctionName:!1,includeName:!1}):void 0;a=[v?`Error: ${v}`:"",x&&x!=="()"?` ${[...Array((h==null?void 0:h.length)??0).keys()].map(()=>" ").join("")}${x}`:""]}}catch(d){s=d}else i&&(c=i);let l;s instanceof hF&&(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 U4e extends Fe{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 j4e extends Fe{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 fS extends Fe{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 hS(t,e){var n,i,s,o,a,c;if(!(t instanceof Fe))return!1;const r=t.walk(l=>l instanceof CC);return r instanceof CC?!!(((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===lz[50]):!1}function dz(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Wu(e)?e:null}function ub(t){let e=new Uint8Array(32).fill(0);if(!t)return Ti(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=dz(r[n]),s=i?S4(i):gf(kh(r[n]),"bytes");e=gf(h0([e,s]),"bytes")}return Ti(e)}function F4e(t){return`[${t.slice(2)}]`}function z4e(t){const e=new Uint8Array(32).fill(0);return t?dz(t)||gf(kh(t)):Ti(e)}function pS(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(kh(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=kh(F4e(z4e(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 W4e=3;function $v(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:d}=t instanceof fS?t:t instanceof Fe?t.walk(g=>"data"in g)||t.walk():{},h=t instanceof k4?new U4e({functionName:s}):[W4e,p0.code].includes(a)&&(c||l||d)?new CC({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:d??l}):t;return new dS(h,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const H4e="0x82ad56cb",q4e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",V4e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",iTe="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function K4e(t,{docsPath:e,...r}){const n=(()=>{const i=rS(t,r);return i instanceof M4?t:i})();return new B4e(n,{docsPath:e,...r})}const H9=new Map;function fz({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const d=c();o();const h=d.map(({args:g})=>g);h.length!==0&&t(h).then(g=>{var v;i&&Array.isArray(g)&&g.sort(i);for(let x=0;x{var v;for(let x=0;xH9.delete(e),a=()=>c().map(({args:d})=>d),c=()=>H9.get(e)||[],l=d=>H9.set(e,[...c(),d]);return{flush:o,async schedule(d){const h={},g=new Promise((R,M)=>{h.resolve=R,h.reject=M});return(r==null?void 0:r([...a(),d]))&&s(),c().length>0?(l({args:d,pendingPromise:h}),g):(l({args:d,pendingPromise:h}),setTimeout(s,n),g)}}}async function gS(t,e){var B,_,p,m;const{account:r=t.account,batch:n=!!((B=t.batch)!=null&&B.multicall),blockNumber:i,blockTag:s="latest",accessList:o,blobs:a,code:c,data:l,factory:d,factoryData:h,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:R,maxPriorityFeePerGas:M,nonce:N,to:E,value:O,stateOverride:L,...U}=e,H=r?Rc(r):void 0;if(c&&(d||h))throw new Fe("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&E)throw new Fe("Cannot provide both `code` & `to` as parameters.");const I=c&&l,T=d&&h&&E&&l,F=I||T,K=I?Q4e({code:c,data:l}):T?Y4e({data:l,factory:d,factoryData:h,to:E}):l;try{O4(e);const A=(i?gr(i):void 0)||s,P=BF(L),S=(m=(p=(_=t.chain)==null?void 0:_.formatters)==null?void 0:p.transactionRequest)==null?void 0:m.format,y=(S||iS)({...nS(U,{format:S}),from:H==null?void 0:H.address,accessList:o,blobs:a,data:K,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:R,maxPriorityFeePerGas:M,nonce:N,to:F?void 0:E,value:O});if(n&&G4e({request:y})&&!P)try{return await Z4e(t,{...y,blockNumber:i,blockTag:s})}catch(V){if(!(V instanceof TF)&&!(V instanceof aC))throw V}const b=await t.request({method:"eth_call",params:P?[y,A,P]:[y,A]});return b==="0x"?{data:void 0}:{data:b}}catch(w){const A=J4e(w),{offchainLookup:P,offchainLookupSignature:S}=await Dn(async()=>{const{offchainLookup:k,offchainLookupSignature:y}=await import("./ccip-DJPJ_8CX.js");return{offchainLookup:k,offchainLookupSignature:y}},__vite__mapDeps([0,1]));if(t.ccipRead!==!1&&(A==null?void 0:A.slice(0,10))===S&&E)return{data:await P(t,{data:A,to:E})};throw F&&(A==null?void 0:A.slice(0,10))==="0x101bb98d"?new j4e({factory:d}):K4e(w,{...e,account:H,chain:t.chain})}}function G4e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(H4e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Z4e(t,e){var R;const{batchSize:r=1024,wait:n=0}=typeof((R=t.batch)==null?void 0:R.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 TF;l=L2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const h=(i?gr(i):void 0)||s,{schedule:g}=fz({id:`${t.uid}.${h}`,wait:n,shouldSplitBatch(M){return M.reduce((E,{data:O})=>E+(O.length-2),0)>r*2},fn:async M=>{const N=M.map(L=>({allowFailure:!0,callData:L.data,target:L.to})),E=U0({abi:wC,args:[N],functionName:"aggregate3"}),O=await t.request({method:"eth_call",params:[{data:E,to:l},h]});return Rg({abi:wC,args:[N],functionName:"aggregate3",data:O||"0x"})}}),[{returnData:v,success:x}]=await g({data:o,to:c});if(!x)throw new fS({data:v});return v==="0x"?{data:void 0}:{data:v}}function Q4e(t){const{code:e,data:r}=t;return AF({abi:oz(["constructor(bytes, bytes)"]),bytecode:q4e,args:[e,r]})}function Y4e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return AF({abi:oz(["constructor(address, bytes, address, bytes)"]),bytecode:V4e,args:[i,e,r,n]})}function J4e(t){var r;if(!(t instanceof Fe))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 g0(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=U0({abi:r,args:i,functionName:s});try{const{data:c}=await on(t,gS,"call")({...o,data:a,to:n});return Rg({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw $v(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function X4e(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=L2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=U0({abi:NM,functionName:"addr",...n!=null?{args:[ub(i),BigInt(n)]}:{args:[ub(i)]}}),d={address:c,abi:KF,functionName:"resolve",args:[d0(pS(i)),l],blockNumber:e,blockTag:r},h=on(t,g0,"readContract"),g=s?await h({...d,args:[...d.args,s]}):await h(d);if(g[0]==="0x")return null;const v=Rg({abi:NM,args:n!=null?[ub(i),BigInt(n)]:void 0,functionName:"addr",data:g[0]});return v==="0x"||kg(v)==="0x00"?null:v}catch(l){if(o)throw l;if(hS(l,"resolve"))return null;throw l}}class e8e extends Fe{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 Em extends Fe{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class mS extends Fe{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 t8e extends Fe{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const r8e=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,n8e=/^(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\-.]+))?(?\/.*)?$/,i8e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,s8e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function o8e(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 DM(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function hz({uri:t,gatewayUrls:e}){const r=i8e.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=DM(e==null?void 0:e.ipfs,"https://ipfs.io"),i=DM(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(r8e),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},d=o==="ipns:/"||a==="ipns/",h=o==="ipfs:/"||a==="ipfs/"||n8e.test(t);if(t.startsWith("http")&&!d&&!h){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||h)&&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 wS({gatewayUrls:t,uri:pz(r)})}catch{throw new mS({uri:e})}}async function wS({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=hz({uri:e,gatewayUrls:t});if(n||await o8e(r))return r;throw new mS({uri:e})}function c8e(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 Em({reason:"Only EIP-155 supported"});if(!o)throw new Em({reason:"Chain ID not found"});if(!c)throw new Em({reason:"Contract address not found"});if(!i)throw new Em({reason:"Token ID not found"});if(!a)throw new Em({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function l8e(t,{nft:e}){if(e.namespace==="erc721")return g0(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 g0(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 t8e({namespace:e.namespace})}async function u8e(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?d8e(t,{gatewayUrls:e,record:r}):wS({uri:r,gatewayUrls:e})}async function d8e(t,{gatewayUrls:e,record:r}){const n=c8e(r),i=await l8e(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=hz({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 wS({uri:pz(d),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),a8e({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function f8e(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=L2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:KF,functionName:"resolve",args:[d0(pS(n)),U0({abi:RM,functionName:"text",args:[ub(n),i]})],blockNumber:e,blockTag:r},d=on(t,g0,"readContract"),h=s?await d({...l,args:[...l.args,s]}):await d(l);if(h[0]==="0x")return null;const g=Rg({abi:RM,functionName:"text",data:h[0]});return g===""?null:g}catch(l){if(o)throw l;if(hS(l,"resolve"))return null;throw l}}async function h8e(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await on(t,f8e,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await u8e(t,{record:c,gatewayUrls:n})}catch{return null}}async function p8e(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=L2({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:$6e,functionName:"reverse",args:[d0(pS(c))],blockNumber:r,blockTag:n},d=on(t,g0,"readContract"),[h,g]=i?await d({...l,args:[...l.args,i]}):await d(l);return e.toLowerCase()!==g.toLowerCase()?null:h}catch(l){if(s)throw l;if(hS(l,"reverse"))return null;throw l}}const g8e=new Map,m8e=new Map;function w8e(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,g8e),n=e(t,m8e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function v8e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=w8e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function b8e(t,{cacheTime:e=t.cacheTime}={}){const r=await v8e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:y8e(t.uid),cacheTime:e});return BigInt(r)}function x8e(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 gz(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var d,h,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 kF({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((g=(h=(d=t.chain)==null?void 0:d.formatters)==null?void 0:h.transaction)==null?void 0:g.format)||$F)(c)}const _8e={"0x0":"reverted","0x1":"success"};function C8e(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=>x8e(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?u0(t.transactionIndex):null,status:t.status?_8e[t.status]:null,type:t.type?OF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}async function LM(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new PF({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||C8e)(r)}async function A8e(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=L2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const h=[[]];let g=0,v=0;for(let N=0;N0&&v>l&&h[g].length>0&&(g++,v=(H.length-2)/2,h[g]=[]),h[g]=[...h[g],{allowFailure:!0,callData:H,target:O}]}catch(H){const I=$v(H,{abi:E,address:O,args:L,docsPath:"/docs/contract/multicall",functionName:U});if(!r)throw I;h[g]=[...h[g],{allowFailure:!0,callData:"0x",target:O}]}}const x=await Promise.allSettled(h.map(N=>on(t,g0,"readContract")({abi:wC,address:d,args:[N],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),R=[];for(let N=0;Nq9.get(t)||[],s=()=>{const d=i();q9.set(t,d.filter(h=>h.id!==n))},o=()=>{const d=BM.get(t);i().length===1&&d&&d(),s()},a=i();if(q9.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const d in e)c[d]=(...h)=>{var v,x;const g=i();if(g.length!==0)for(const R of g)(x=(v=R.fns)[d])==null||x.call(v,...h)};const l=r(c);return typeof l=="function"&&BM.set(t,l),o}async function Y5(t){return new Promise(e=>setTimeout(e,t))}function S8e(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 Y5(c);const l=async()=>{i&&(await t({unpoll:s}),await Y5(n),l())};l()})(),s}function I8e(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 h=uc(["watchBlockNumber",t.uid,e,r,o]);return AC(h,{onBlockNumber:n,onError:i},g=>S8e(async()=>{var v;try{const x=await on(t,b8e,"getBlockNumber")({cacheTime:0});if(c){if(x===c)return;if(x-c>1&&r)for(let R=c+1n;Rc)&&(g.onBlockNumber(x,c),c=x)}catch(x){(v=g.onError)==null||v.call(g,x)}},{emitOnBegin:e,interval:o}))})():(()=>{const h=uc(["watchBlockNumber",t.uid,e,r]);return AC(h,{onBlockNumber:n,onError:i},g=>{let v=!0,x=()=>v=!1;return(async()=>{try{const R=(()=>{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 R.subscribe({params:["newHeads"],onData(N){var O;if(!v)return;const E=G1((O=N.result)==null?void 0:O.number);g.onBlockNumber(E,c),c=E},onError(N){var E;(E=g.onError)==null||E.call(g,N)}});x=M,v||x()}catch(R){i==null||i(R)}})(),()=>x()})})()}const Py=new VE(8192);function T8e(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(Py.get(r))return Py.get(r);const n=t().finally(()=>Py.delete(r));return Py.set(r,n),n}function J5(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 Y5(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?gf(I4(`${a}.${uc(r)}`)):void 0;return T8e(()=>J5(async()=>{try{return await t(r)}catch(l){const d=l;switch(d.code){case xv.code:throw new xv(d);case _v.code:throw new _v(d);case Cv.code:throw new Cv(d,{method:r.method});case Av.code:throw new Av(d);case p0.code:throw new p0(d);case Ev.code:throw new Ev(d);case Sv.code:throw new Sv(d);case Yd.code:throw new Yd(d);case Z1.code:throw new Z1(d);case Iv.code:throw new Iv(d,{method:r.method});case Q1.code:throw new Q1(d);case Tv.code:throw new Tv(d);case hn.code:throw new hn(d);case kv.code:throw new kv(d);case Pv.code:throw new Pv(d);case Rv.code:throw new Rv(d);case Nv.code:throw new Nv(d);case Js.code:throw new Js(d);case 5e3:throw new hn(d);default:throw l instanceof Fe?l:new n6e(d)}}},{delay:({count:l,error:d})=>{var h;if(d&&d instanceof iw){const g=(h=d==null?void 0:d.headers)==null?void 0:h.get("Retry-After");if(g!=null&&g.match(/\d/))return Number.parseInt(g)*1e3}return~~(1<P8e(l)}),{enabled:i,id:c})}}function P8e(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Q1.code||t.code===p0.code:t instanceof iw&&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 R8e(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function mz(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 N8e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const UM=N8e();function M8e(t,e={}){return{async request(r){var h;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 mz(async({signal:x})=>{const R={...a,body:Array.isArray(n)?uc(n.map(E=>({jsonrpc:"2.0",id:E.id??UM.take(),...E}))):uc({jsonrpc:"2.0",id:n.id??UM.take(),...n}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:d||(o>0?x:null)},M=new Request(t,R);return i&&await i(M),await fetch(t,R)},{errorInstance:new SM({body:n,url:t}),timeout:o,signal:!0});s&&await s(g);let v;if((h=g.headers.get("Content-Type"))!=null&&h.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 iw({body:n,details:uc(v.error)||g.statusText,headers:g.headers,status:g.status,url:t});return v}catch(g){throw g instanceof iw||g instanceof SM?g:new iw({body:n,cause:g,url:t})}}}}class O8e extends Fe{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function $8e(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new O8e({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 D8e(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<{a&&setTimeout(()=>x(new e6e({hash:r})),a);const R=AC(c,{onReplaced:n,resolve:v,reject:x},M=>{const N=on(t,I8e,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(E){const O=U=>{N(),U(),R()};let L=E;if(!g)try{if(h){if(e>1&&(!h.blockNumber||L-h.blockNumber+1nM.resolve(h));return}if(l||(g=!0,await J5(async()=>{l=await on(t,gz,"getTransaction")({hash:r}),l.blockNumber&&(L=l.blockNumber)},{delay:o,retryCount:s}),g=!1),h=await on(t,LM,"getTransactionReceipt")({hash:r}),e>1&&(!h.blockNumber||L-h.blockNumber+1nM.resolve(h))}catch(U){if(U instanceof kF||U instanceof PF){if(!l){g=!1;return}try{d=l,g=!0;const H=await J5(()=>on(t,Mv,"getBlock")({blockNumber:L,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:F})=>F instanceof MF});g=!1;const I=H.transactions.find(({from:F,nonce:K})=>F===d.from&&K===d.nonce);if(!I||(h=await on(t,LM,"getTransactionReceipt")({hash:I.hash}),e>1&&(!h.blockNumber||L-h.blockNumber+1n{var F;(F=M.onReplaced)==null||F.call(M,{reason:T,replacedTransaction:d,transaction:I,transactionReceipt:h}),M.resolve(h)})}catch(H){O(()=>M.reject(H))}}else O(()=>M.reject(U))}}})})})}async function L8e(t,{account:e=t.account,message:r}){if(!e)throw new JE({docsPath:"/docs/actions/wallet/signMessage"});const n=Rc(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?I4(r):r.raw instanceof Uint8Array?d0(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function B8e(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?Rc(a.account):t.account,l=U0({abi:r,args:i,functionName:o});try{const{data:d}=await on(t,gS,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),h=Rg({abi:r,args:i,functionName:o,data:d||"0x"}),g=r.filter(v=>"name"in v&&v.name===e.functionName);return{result:h,request:{abi:g,address:n,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(d){throw $v(d,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}async function U8e(t,e){const{abi:r,account:n=t.account,address:i,args:s,dataSuffix:o,functionName:a,...c}=e;if(!n)throw new JE({docsPath:"/docs/contract/writeContract"});const l=Rc(n),d=U0({abi:r,args:s,functionName:a});try{return await on(t,qF,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:i,account:l,...c})}catch(h){throw $v(h,{abi:r,address:i,args:s,docsPath:"/docs/contract/writeContract",functionName:a,sender:l.address})}}const EC=256;let Ry=EC,Ny;function wz(t=11){if(!Ny||Ry+t>EC*2){Ny="",Ry=0;for(let e=0;e{const E=N(M);for(const L in x)delete E[L];const O={...M,...E};return Object.assign(O,{extend:R(O)})}}return Object.assign(x,{extend:R(x)})}function vS({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){const c=wz();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:k8e(r,{retryCount:n,retryDelay:i,uid:c}),value:a}}function j8e(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>vS({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}function F8e(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 h=t,g=()=>{};const v=vS({key:r,name:n,async request({method:x,params:R}){const M=async(N=0)=>{const E=h[N]({...d,chain:a,retryCount:0,timeout:l});try{const O=await E.request({method:x,params:R});return g({method:x,params:R,response:O,transport:E,status:"success"}),O}catch(O){if(g({error:O,method:x,params:R,transport:E,status:"error"}),z8e(O)||N===h.length-1)throw O;return M(N+1)}};return M()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:x=>g=x,transports:h.map(x=>x({chain:a,retryCount:0}))});if(i){const x=typeof i=="object"?i:{};W8e({chain:a,interval:x.interval??c,onTransports:R=>h=R,sampleCount:x.sampleCount,timeout:x.timeout,transports:h,weights:x.weights})}return v}}function z8e(t){return"code"in t&&typeof t.code=="number"&&(t.code===Z1.code||t.code===hn.code||t.code===5e3)}function W8e({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 h=await Promise.all(s.map(async x=>{const R=x({chain:t,retryCount:0,timeout:i}),M=Date.now();let N,E;try{await R.request({method:"net_listening"}),E=1}catch{E=0}finally{N=Date.now()}return{latency:N-M,success:E}}));l.push(h),l.length>n&&l.shift();const g=Math.max(...l.map(x=>Math.max(...x.map(({latency:R})=>R)))),v=s.map((x,R)=>{const M=l.map(U=>U[R].latency),E=1-M.reduce((U,H)=>U+H,0)/M.length/g,O=l.map(U=>U[R].success),L=O.reduce((U,H)=>U+H,0)/O.length;return L===0?[0,R]:[c*E+a*L,R]}).sort((x,R)=>R[0]-x[0]);r(v.map(([,x])=>s[x])),await Y5(e),d()};d()}class H8e extends Fe{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 V9(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:h})=>{const{batchSize:g=1e3,wait:v=0}=typeof r=="object"?r:{},x=e.retryCount??d,R=h??e.timeout??1e4,M=t||(l==null?void 0:l.rpcUrls.default.http[0]);if(!M)throw new H8e;const N=M8e(M,{fetchOptions:n,onRequest:o,onResponse:a,timeout:R});return vS({key:i,name:s,async request({method:E,params:O}){const L={method:E,params:O},{schedule:U}=fz({id:M,wait:v,shouldSplitBatch(F){return F.length>g},fn:F=>N.request({body:F}),sort:(F,K)=>F.id-K.id}),H=async F=>r?U(F):[await N.request({body:F})],[{error:I,result:T}]=await H(L);if(I)throw new RF({body:L,error:I,url:M});return T},retryCount:x,retryDelay:c,timeout:R,type:"http"},{fetchOptions:n,url:M})}}let K9=!1;async function q8e(t,e={}){var l,d;if(K9)return[];K9=!0,t.setState(h=>({...h,status:h.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const h of e.connectors){let g;typeof h=="function"?g=t._internal.connectors.setup(h):g=h,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[,h]of t.state.connections)i[h.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((h,g)=>(i[h.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const h of s){const g=await h.getProvider().catch(()=>{});if(!g||c.some(R=>R===g)||!await h.isAuthorized())continue;const x=await h.connect({isReconnecting:!0}).catch(()=>null);x&&(h.emitter.off("connect",t._internal.events.connect),h.emitter.on("change",t._internal.events.change),h.emitter.on("disconnect",t._internal.events.disconnect),t.setState(R=>{const M=new Map(o?R.connections:new Map).set(h.uid,{accounts:x.accounts,chainId:x.chainId,connector:h});return{...R,current:o?R.current:h.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:h}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(h=>({...h,status:"connected"})):t.setState(h=>({...h,connections:new Map,current:null,status:"disconnected"}))),K9=!1,a}function V8e(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 K8e(){const t=new Set;let e=[];const r=()=>V8e(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 G8e={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"},Z8e=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 h=o(n.getState());l=g=>{const v=o(g);if(!d(h,v)){const x=h;a(h=v,x)}},c!=null&&c.fireImmediately&&a(h,h)}return i(l)},t(e,r,n)},Q8e=Z8e;function Y8e(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 Dv=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return Dv(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Dv(n)(r)}}}},J8e=(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=Dv(s.serialize),h=()=>{const M=s.partialize({...n()});let N;const E=d({state:M,version:s.version}).then(O=>l.setItem(s.name,O)).catch(O=>{N=O});if(N)throw N;return E},g=i.setState;i.setState=(M,N)=>{g(M,N),h()};const v=t((...M)=>{r(...M),h()},n,i);let x;const R=()=>{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 Dv(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 O;return x=s.merge(E,(O=n())!=null?O:v),r(x,!0),h()}).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:()=>R(),hasHydrated:()=>o,onHydrate:M=>(a.add(M),()=>{a.delete(M)}),onFinishHydration:M=>(c.add(M),()=>{c.delete(M)})},R(),x||v},X8e=(t,e)=>(r,n,i)=>{let s={storage:Y8e(()=>localStorage),partialize:R=>R,version:0,merge:(R,M)=>({...M,...R}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...R)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...R)},n,i);const d=()=>{const R=s.partialize({...n()});return l.setItem(s.name,{state:R,version:s.version})},h=i.setState;i.setState=(R,M)=>{h(R,M),d()};const g=t((...R)=>{r(...R),d()},n,i);let v;const x=()=>{var R,M;if(!l)return;o=!1,a.forEach(E=>{var O;return E((O=n())!=null?O:g)});const N=((M=s.onRehydrateStorage)==null?void 0:M.call(s,(R=n())!=null?R:g))||void 0;return Dv(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 O;return v=s.merge(E,(O=n())!=null?O: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:R=>{s={...s,...R},R.storage&&(l=R.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:R=>(a.add(R),()=>{a.delete(R)}),onFinishHydration:R=>(c.add(R),()=>{c.delete(R)})},s.skipHydration||x(),v||g},exe=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((G8e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),J8e(t,e)):X8e(t,e),txe=exe,rxe={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"},jM=t=>{let e;const r=new Set,n=(c,l)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const h=e;e=l??typeof d!="object"?d:Object.assign({},e,d),r.forEach(g=>g(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{(rxe?"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},G9=t=>t?jM(t):jM;var yz={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,h,g){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new i(d,h||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,h;if(this._eventsCount===0)return l;for(h in d=this._events)e.call(d,h)&&l.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},a.prototype.listeners=function(l){var d=r?r+l:l,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,v=h.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?q8e(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}function oxe(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=it.useRef(!0);return it.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const axe=it.createContext(void 0);function cxe(t){const{children:e,config:r}=t,n={value:r};return it.createElement(oxe,t,it.createElement(axe.Provider,n,e))}var $4=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(){}},D4=typeof window>"u"||"Deno"in globalThis;function Qa(){}function lxe(t,e){return typeof t=="function"?t(e):t}function uxe(t){return typeof t=="number"&&t>=0&&t!==1/0}function dxe(t,e){return Math.max(t+(e||0)-Date.now(),0)}function FM(t,e){return typeof t=="function"?t(e):t}function fxe(t,e){return typeof t=="function"?t(e):t}function zM(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==yS(o,e.options))return!1}else if(!Bv(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 WM(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Lv(e.options.mutationKey)!==Lv(s))return!1}else if(!Bv(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function yS(t,e){return((e==null?void 0:e.queryKeyHashFn)||Lv)(t)}function Lv(t){return JSON.stringify(t,(e,r)=>SC(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Bv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!Bv(t[r],e[r])):!1}function bz(t,e){if(t===e)return t;const r=HM(t)&&HM(e);if(r||SC(t)&&SC(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 pxe(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?bz(t,e):e}function gxe(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function mxe(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var xz=Symbol();function _z(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===xz?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var yh,kd,Xp,EO,wxe=(EO=class extends $4{constructor(){super();Fr(this,yh);Fr(this,kd);Fr(this,Xp);pr(this,Xp,e=>{if(!D4&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Oe(this,kd)||this.setEventListener(Oe(this,Xp))}onUnsubscribe(){var e;this.hasListeners()||((e=Oe(this,kd))==null||e.call(this),pr(this,kd,void 0))}setEventListener(e){var r;pr(this,Xp,e),(r=Oe(this,kd))==null||r.call(this),pr(this,kd,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){Oe(this,yh)!==e&&(pr(this,yh,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof Oe(this,yh)=="boolean"?Oe(this,yh):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},yh=new WeakMap,kd=new WeakMap,Xp=new WeakMap,EO),Cz=new wxe,e1,Pd,t1,SO,vxe=(SO=class extends $4{constructor(){super();Fr(this,e1,!0);Fr(this,Pd);Fr(this,t1);pr(this,t1,e=>{if(!D4&&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,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(this.setOnline.bind(this)))}setOnline(e){Oe(this,e1)!==e&&(pr(this,e1,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return Oe(this,e1)}},e1=new WeakMap,Pd=new WeakMap,t1=new WeakMap,SO),X5=new vxe;function yxe(t){return Math.min(1e3*2**t,3e4)}function Az(t){return(t??"online")==="online"?X5.isOnline():!0}var Ez=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Z9(t){return t instanceof Ez}function Sz(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 Ez(N)),(E=t.abort)==null||E.call(t))},l=()=>{e=!0},d=()=>{e=!1},h=()=>Cz.isFocused()&&(t.networkMode==="always"||X5.isOnline())&&t.canRun(),g=()=>Az(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))},R=()=>new Promise(N=>{var E;i=O=>{(n||h())&&N(O)},(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(O){N=Promise.reject(O)}Promise.resolve(N).then(v).catch(O=>{var T;if(n)return;const L=t.retry??(D4?0:3),U=t.retryDelay??yxe,H=typeof U=="function"?U(r,O):U,I=L===!0||typeof L=="number"&&rh()?void 0:R()).then(()=>{e?x(O):M()})})};return{promise:a,cancel:c,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:d,canStart:g,start:()=>(g()?M():R().then(M),a)}}function bxe(){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 ds=bxe(),bh,IO,Iz=(IO=class{constructor(){Fr(this,bh)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uxe(this.gcTime)&&pr(this,bh,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(D4?1/0:5*60*1e3))}clearGcTimeout(){Oe(this,bh)&&(clearTimeout(Oe(this,bh)),pr(this,bh,void 0))}},bh=new WeakMap,IO),r1,n1,sa,Ki,qv,xh,Ya,au,TO,xxe=(TO=class extends Iz{constructor(e){super();Fr(this,Ya);Fr(this,r1);Fr(this,n1);Fr(this,sa);Fr(this,Ki);Fr(this,qv);Fr(this,xh);pr(this,xh,!1),pr(this,qv,e.defaultOptions),this.setOptions(e.options),this.observers=[],pr(this,sa,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,pr(this,r1,Cxe(this.options)),this.state=e.state??Oe(this,r1),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Oe(this,Ki))==null?void 0:e.promise}setOptions(e){this.options={...Oe(this,qv),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Oe(this,sa).remove(this)}setData(e,r){const n=pxe(this.state.data,e,this.options);return ji(this,Ya,au).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){ji(this,Ya,au).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,i;const r=(n=Oe(this,Ki))==null?void 0:n.promise;return(i=Oe(this,Ki))==null||i.cancel(e),r?r.then(Qa).catch(Qa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Oe(this,r1))}isActive(){return this.observers.some(e=>fxe(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||!dxe(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Ki))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Ki))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Oe(this,sa).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,Ki)&&(Oe(this,xh)?Oe(this,Ki).cancel({revert:!0}):Oe(this,Ki).cancelRetry()),this.scheduleGc()),Oe(this,sa).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ji(this,Ya,au).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,Ki))return Oe(this,Ki).continueRetry(),Oe(this,Ki).promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(g=>g.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(pr(this,xh,!0),n.signal)})},s=()=>{const h=_z(this.options,r),g={queryKey:this.queryKey,meta:this.meta};return i(g),pr(this,xh,!1),this.options.persister?this.options.persister(h,g,this):h(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,n1,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=o.fetchOptions)==null?void 0:l.meta))&&ji(this,Ya,au).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=h=>{var g,v,x,R;Z9(h)&&h.silent||ji(this,Ya,au).call(this,{type:"error",error:h}),Z9(h)||((v=(g=Oe(this,sa).config).onError)==null||v.call(g,h,this),(R=(x=Oe(this,sa).config).onSettled)==null||R.call(x,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return pr(this,Ki,Sz({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var g,v,x,R;if(h===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(M){a(M);return}(v=(g=Oe(this,sa).config).onSuccess)==null||v.call(g,h,this),(R=(x=Oe(this,sa).config).onSettled)==null||R.call(x,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(h,g)=>{ji(this,Ya,au).call(this,{type:"failed",failureCount:h,error:g})},onPause:()=>{ji(this,Ya,au).call(this,{type:"pause"})},onContinue:()=>{ji(this,Ya,au).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),Oe(this,Ki).start()}},r1=new WeakMap,n1=new WeakMap,sa=new WeakMap,Ki=new WeakMap,qv=new WeakMap,xh=new WeakMap,Ya=new WeakSet,au=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,..._xe(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 Z9(i)&&i.revert&&Oe(this,n1)?{...Oe(this,n1),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),ds.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Oe(this,sa).notify({query:this,type:"updated",action:e})})},TO);function _xe(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Az(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Cxe(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 Qc,kO,Axe=(kO=class extends $4{constructor(e={}){super();Fr(this,Qc);this.config=e,pr(this,Qc,new Map)}build(e,r,n){const i=r.queryKey,s=r.queryHash??yS(i,r);let o=this.get(s);return o||(o=new xxe({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){Oe(this,Qc).has(e.queryHash)||(Oe(this,Qc).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=Oe(this,Qc).get(e.queryHash);r&&(e.destroy(),r===e&&Oe(this,Qc).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ds.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Oe(this,Qc).get(e)}getAll(){return[...Oe(this,Qc).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>zM(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>zM(e,n)):r}notify(e){ds.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){ds.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ds.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qc=new WeakMap,kO),Yc,cs,_h,Jc,pd,PO,Exe=(PO=class extends Iz{constructor(e){super();Fr(this,Jc);Fr(this,Yc);Fr(this,cs);Fr(this,_h);this.mutationId=e.mutationId,pr(this,cs,e.mutationCache),pr(this,Yc,[]),this.state=e.state||Sxe(),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,Yc).includes(e)||(Oe(this,Yc).push(e),this.clearGcTimeout(),Oe(this,cs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){pr(this,Yc,Oe(this,Yc).filter(r=>r!==e)),this.scheduleGc(),Oe(this,cs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Oe(this,Yc).length||(this.state.status==="pending"?this.scheduleGc():Oe(this,cs).remove(this))}continue(){var e;return((e=Oe(this,_h))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,l,d,h,g,v,x,R,M,N,E,O,L,U,H,I;pr(this,_h,Sz({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(T,F)=>{ji(this,Jc,pd).call(this,{type:"failed",failureCount:T,error:F})},onPause:()=>{ji(this,Jc,pd).call(this,{type:"pause"})},onContinue:()=>{ji(this,Jc,pd).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Oe(this,cs).canRun(this)}));const r=this.state.status==="pending",n=!Oe(this,_h).canStart();try{if(!r){ji(this,Jc,pd).call(this,{type:"pending",variables:e,isPaused:n}),await((s=(i=Oe(this,cs).config).onMutate)==null?void 0:s.call(i,e,this));const F=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));F!==this.state.context&&ji(this,Jc,pd).call(this,{type:"pending",context:F,variables:e,isPaused:n})}const T=await Oe(this,_h).start();return await((l=(c=Oe(this,cs).config).onSuccess)==null?void 0:l.call(c,T,e,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,T,e,this.state.context)),await((v=(g=Oe(this,cs).config).onSettled)==null?void 0:v.call(g,T,null,this.state.variables,this.state.context,this)),await((R=(x=this.options).onSettled)==null?void 0:R.call(x,T,null,e,this.state.context)),ji(this,Jc,pd).call(this,{type:"success",data:T}),T}catch(T){try{throw await((N=(M=Oe(this,cs).config).onError)==null?void 0:N.call(M,T,e,this.state.context,this)),await((O=(E=this.options).onError)==null?void 0:O.call(E,T,e,this.state.context)),await((U=(L=Oe(this,cs).config).onSettled)==null?void 0:U.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{ji(this,Jc,pd).call(this,{type:"error",error:T})}}finally{Oe(this,cs).runNext(this)}}},Yc=new WeakMap,cs=new WeakMap,_h=new WeakMap,Jc=new WeakSet,pd=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),ds.batch(()=>{Oe(this,Yc).forEach(n=>{n.onMutationUpdate(e)}),Oe(this,cs).notify({mutation:this,type:"updated",action:e})})},PO);function Sxe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var co,Vv,RO,Ixe=(RO=class extends $4{constructor(e={}){super();Fr(this,co);Fr(this,Vv);this.config=e,pr(this,co,new Map),pr(this,Vv,Date.now())}build(e,r,n){const i=new Exe({mutationCache:this,mutationId:++W3(this,Vv)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){const r=My(e),n=Oe(this,co).get(r)??[];n.push(e),Oe(this,co).set(r,n),this.notify({type:"added",mutation:e})}remove(e){var n;const r=My(e);if(Oe(this,co).has(r)){const i=(n=Oe(this,co).get(r))==null?void 0:n.filter(s=>s!==e);i&&(i.length===0?Oe(this,co).delete(r):Oe(this,co).set(r,i))}this.notify({type:"removed",mutation:e})}canRun(e){var n;const r=(n=Oe(this,co).get(My(e)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}runNext(e){var n;const r=(n=Oe(this,co).get(My(e)))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){ds.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...Oe(this,co).values()].flat()}find(e){const r={exact:!0,...e};return this.getAll().find(n=>WM(r,n))}findAll(e={}){return this.getAll().filter(r=>WM(e,r))}notify(e){ds.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return ds.batch(()=>Promise.all(e.map(r=>r.continue().catch(Qa))))}},co=new WeakMap,Vv=new WeakMap,RO);function My(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function VM(t){return{onFetch:(e,r)=>{var d,h,g,v,x;const n=e.options,i=(g=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.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 R=!1;const M=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(e.signal.aborted?R=!0:e.signal.addEventListener("abort",()=>{R=!0}),e.signal)})},N=_z(e.options,e.fetchOptions),E=async(O,L,U)=>{if(R)return Promise.reject();if(L==null&&O.pages.length)return Promise.resolve(O);const H={queryKey:e.queryKey,pageParam:L,direction:U?"backward":"forward",meta:e.options.meta};M(H);const I=await N(H),{maxPages:T}=e.options,F=U?mxe:gxe;return{pages:F(O.pages,I,T),pageParams:F(O.pageParams,L,T)}};if(i&&s.length){const O=i==="backward",L=O?Txe:KM,U={pages:s,pageParams:o},H=L(n,U);a=await E(U,H,O)}else{const O=t??s.length;do{const L=c===0?o[0]??n.initialPageParam:KM(n,a);if(c>0&&L==null)break;a=await E(a,L),c++}while(c{var R,M;return(M=(R=e.options).persister)==null?void 0:M.call(R,l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=l}}}function KM(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 Txe(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 Nn,Rd,Nd,i1,s1,Md,o1,a1,NO,kxe=(NO=class{constructor(t={}){Fr(this,Nn);Fr(this,Rd);Fr(this,Nd);Fr(this,i1);Fr(this,s1);Fr(this,Md);Fr(this,o1);Fr(this,a1);pr(this,Nn,t.queryCache||new Axe),pr(this,Rd,t.mutationCache||new Ixe),pr(this,Nd,t.defaultOptions||{}),pr(this,i1,new Map),pr(this,s1,new Map),pr(this,Md,0)}mount(){W3(this,Md)._++,Oe(this,Md)===1&&(pr(this,o1,Cz.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,Nn).onFocus())})),pr(this,a1,X5.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,Nn).onOnline())})))}unmount(){var t,e;W3(this,Md)._--,Oe(this,Md)===0&&((t=Oe(this,o1))==null||t.call(this),pr(this,o1,void 0),(e=Oe(this,a1))==null||e.call(this),pr(this,a1,void 0))}isFetching(t){return Oe(this,Nn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Oe(this,Rd).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Oe(this,Nn).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,Nn).build(this,r);return t.revalidateIfStale&&n.isStaleByTime(FM(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(e)}}getQueriesData(t){return Oe(this,Nn).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,Nn).get(n.queryHash),s=i==null?void 0:i.state.data,o=lxe(e,s);if(o!==void 0)return Oe(this,Nn).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return ds.batch(()=>Oe(this,Nn).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,Nn).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=Oe(this,Nn);ds.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=Oe(this,Nn),n={type:"active",...t};return ds.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(n,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},n=ds.batch(()=>Oe(this,Nn).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(Qa).catch(Qa)}invalidateQueries(t={},e={}){return ds.batch(()=>{if(Oe(this,Nn).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=ds.batch(()=>Oe(this,Nn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Qa)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Qa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=Oe(this,Nn).build(this,e);return r.isStaleByTime(FM(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Qa).catch(Qa)}fetchInfiniteQuery(t){return t.behavior=VM(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Qa).catch(Qa)}ensureInfiniteQueryData(t){return t.behavior=VM(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return X5.isOnline()?Oe(this,Rd).resumePausedMutations():Promise.resolve()}getQueryCache(){return Oe(this,Nn)}getMutationCache(){return Oe(this,Rd)}getDefaultOptions(){return Oe(this,Nd)}setDefaultOptions(t){pr(this,Nd,t)}setQueryDefaults(t,e){Oe(this,i1).set(Lv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Oe(this,i1).values()];let r={};return e.forEach(n=>{Bv(t,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(t,e){Oe(this,s1).set(Lv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Oe(this,s1).values()];let r={};return e.forEach(n=>{Bv(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Oe(this,Nd).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=yS(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===xz&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Oe(this,Nd).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Oe(this,Nn).clear(),Oe(this,Rd).clear()}},Nn=new WeakMap,Rd=new WeakMap,Nd=new WeakMap,i1=new WeakMap,s1=new WeakMap,Md=new WeakMap,o1=new WeakMap,a1=new WeakMap,NO),Tz=it.createContext(void 0),oTe=t=>{const e=it.useContext(Tz);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Pxe=({client:t,children:e})=>(it.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),ze.jsx(Tz.Provider,{value:t,children:e}));function kz(t,e){return`https://rpc.walletconnect.org/v1/?chainId=${e}:${t}`}const Pz={id:"eip155:1",chainId:1,name:"Ethereum",currency:"ETH",explorerUrl:"https://etherscan.io",rpcUrl:kz(1,"eip155"),chainNamespace:"eip155"},Rz={id:"eip155:10",chainId:10,name:"Optimism",currency:"ETH",explorerUrl:"https://optimistic.etherscan.io",rpcUrl:kz(10,"eip155"),chainNamespace:"eip155"};function Ji(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 db="2.13.7",Rxe=()=>`@wagmi/core@${db}`;var Nz=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)},e6,Mz;class xc extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Rxe()}constructor(e,r={}){var s;super(),e6.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 xc?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof xc&&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 Nz(this,e6,"m",Mz).call(this,this,e)}}e6=new WeakSet,Mz=function t(e,r){return r!=null&&r(e)?e:e.cause?Nz(this,e6,"m",t).call(this,e.cause,r):e};class m0 extends xc{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Nxe extends xc{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Oz extends xc{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Mxe extends xc{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 Oxe extends xc{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 $xe extends xc{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 GM(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 Nxe;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 B2(t,e={}){let r;if(e.connector){const{connector:l}=e;if(t.state.status==="reconnecting"&&!l.getAccounts&&!l.getChainId)throw new $xe({connector:l});const[d,h]=await Promise.all([l.getAccounts(),l.getChainId()]);r={accounts:d,chainId:h,connector:l}}else r=t.state.connections.get(t.state.current);if(!r)throw new Oz;const n=e.chainId??r.chainId,i=await r.connector.getChainId();if(i!==r.chainId)throw new Oxe({connectionChainId:r.chainId,connectorChainId:i});const s=r.connector;if(s.getClient)return s.getClient({chainId:n});const o=Rc(e.account??r.accounts[0]);if(o.address=zs(o.address),e.account&&!r.accounts.some(l=>l.toLowerCase()===o.address.toLowerCase()))throw new Mxe({address:o.address,connector:s});const a=t.chains.find(l=>l.id===n),c=await r.connector.getProvider({chainId:n});return vz({account:o,chain:a,name:"Connector Client",transport:l=>j8e(c)({...l,retryCount:0})})}async function Dxe(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 Lxe(t,e){const{chainId:r,connector:n,...i}=e;let s;e.account?s=e.account:s=(await B2(t,{account:e.account,chainId:r,connector:n})).account;const o=t.getClient({chainId:r});return Ji(o,oS,"estimateGas")({...i,account:s})}function $z(t){return typeof t=="number"?t:t==="wei"?0:Math.abs(Q5e[t])}function U2(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 Bxe(t,e){const{allowFailure:r=!0,chainId:n,contracts:i,...s}=e,o=t.getClient({chainId:n});return Ji(o,A8e,"multicall")({allowFailure:r,contracts:i,...s})}function Uxe(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,g0,"readContract")(n)}async function jxe(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])=>Bxe(t,{...s,allowFailure:r,blockNumber:n,blockTag:i,chainId:Number.parseInt(g),contracts:v.map(({contract:x})=>x)})),d=(await Promise.all(l())).flat(),h=Object.values(c).flatMap(g=>g.map(({index:v})=>v));return d.reduce((g,v,x)=>(g&&(g[h[x]]=v),g),[])}catch(c){if(c instanceof dS)throw c;const l=()=>o.map(d=>Uxe(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 Fxe(t,e){const{address:r,blockNumber:n,blockTag:i,chainId:s,token:o,unit:a="ether"}=e;if(o)try{return ZM(t,{balanceAddress:r,chainId:s,symbolType:"string",tokenAddress:o})}catch(g){if(g instanceof dS){const v=await ZM(t,{balanceAddress:r,chainId:s,symbolType:"bytes32",tokenAddress:o}),x=dF(kg(v.symbol,{dir:"right"}));return{...v,symbol:x}}throw g}const c=t.getClient({chainId:s}),d=await Ji(c,UF,"getBalance")(n?{address:r,blockNumber:n}:{address:r,blockTag:i}),h=t.chains.find(g=>g.id===s)??c.chain;return{decimals:h.nativeCurrency.decimals,formatted:$2(d,$z(a)),symbol:h.nativeCurrency.symbol,value:d}}async function ZM(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 jxe(t,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[r],chainId:n},{...a,functionName:"decimals",chainId:n},{...a,functionName:"symbol",chainId:n}]}),h=$2(c??"0",$z(o??l));return{decimals:l,formatted:h,symbol:d,value:c}}function Uv(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(!Uv(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&&!Uv(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let Oy=[];function zxe(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||Uv(Oy,e)?Oy:(Oy=e,e)}let Q9=[];function Wxe(t){const e=t.connectors;return Uv(Q9,e)?Q9:(Q9=e,e)}function Hxe(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,X4e,"getEnsAddress")(n)}function QM(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,h8e,"getEnsAvatar")(n)}function qxe(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,p8e,"getEnsName")(n)}async function Vxe(t,e){const{account:r,chainId:n,...i}=e,s=r??U2(t).address,o=t.getClient({chainId:n});return Ji(o,cS,"prepareTransactionRequest")({...i,...s?{account:s}:{}})}let Y9=!1;async function YM(t,e={}){var l,d;if(Y9)return[];Y9=!0,t.setState(h=>({...h,status:h.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const h of e.connectors){let g;typeof h=="function"?g=t._internal.connectors.setup(h):g=h,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[,h]of t.state.connections)i[h.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((h,g)=>(i[h.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const h of s){const g=await h.getProvider().catch(()=>{});if(!g||c.some(R=>R===g)||!await h.isAuthorized())continue;const x=await h.connect({isReconnecting:!0}).catch(()=>null);x&&(h.emitter.off("connect",t._internal.events.connect),h.emitter.on("change",t._internal.events.change),h.emitter.on("disconnect",t._internal.events.disconnect),t.setState(R=>{const M=new Map(o?R.connections:new Map).set(h.uid,{accounts:x.accounts,chainId:x.chainId,connector:h});return{...R,current:o?R.current:h.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:h}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(h=>({...h,status:"connected"})):t.setState(h=>({...h,connections:new Map,current:null,status:"disconnected"}))),Y9=!1,a}async function Kxe(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 B2(t,{account:r,chainId:n,connector:i});const{connector:c}=U2(t),l=await(async()=>{var g;if(!(!("data"in e)||!e.data)&&!((g=i??c)!=null&&g.supportsSimulation)&&s!==null)return s===void 0?Ji(a,oS,"estimateGas")({...o,account:r,chain:n?{id:n}:null}):s})();return await Ji(a,qF,"sendTransaction")({...o,...r?{account:r}:{},gas:l,chain:n?{id:n}:null})}async function Gxe(t,e){const{account:r,connector:n,...i}=e;let s;return typeof r=="object"&&r.type==="local"?s=t.getClient():s=await B2(t,{account:r,connector:n}),Ji(s,L8e,"signMessage")({...i,...r?{account:r}:{}})}async function Zxe(t,e){const{abi:r,chainId:n,connector:i,...s}=e;let o;e.account?o=e.account:o=(await B2(t,{chainId:n,connector:i})).account;const a=t.getClient({chainId:n}),c=Ji(a,B8e,"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 Qxe(t,e){var i;const{connector:r}=e,n=t.state.connections.get(r.uid);if(!n)throw new Oz;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 xd extends xc{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class Yxe extends xc{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 Jxe(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 Yxe({connector:a});return await a.switchChain({addEthereumChainParameter:r,chainId:n})}const s=t.chains.find(a=>a.id===n);if(!s)throw new m0;return t.setState(a=>({...a,chainId:n})),s}function Xxe(t,e){const{onChange:r}=e;return t.subscribe(()=>U2(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return Uv(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 e9e(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}async function t9e(t,e){const{chainId:r,timeout:n=0,...i}=e,s=t.getClient({chainId:r}),a=await Ji(s,D8e,"waitForTransactionReceipt")({...i,timeout:n});if(a.status==="reverted"){const l=await Ji(s,gz,"getTransaction")({hash:a.transactionHash}),h=await Ji(s,gS,"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=h!=null&&h.data?dF(`0x${h.data.substring(138)}`):"unknown reason";throw new Error(g)}return{...a,chainId:s.chain.id}}async function r9e(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 B2(t,{account:r,chainId:n,connector:i});const{connector:c}=U2(t);let l;if(s==="prepared"||c!=null&&c.supportsSimulation)l=o;else{const{request:g}=await Zxe(t,{...o,account:r,chainId:n});l=g}return await Ji(a,U8e,"writeContract")({...l,...r?{account:r}:{},chain:n?{id:n}:null})}const n9e=/(rabby|trustwallet)/,i9e={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:fb(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return fb(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:fb(t,"isPhantom")}}};L4.type="injected";function L4(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"?{...i9e[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 n9e.test(this.id.toLowerCase())},type:L4.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,R,M,N,E;const h=await this.getProvider();if(!h)throw new xd;let g=[];if(d)g=await this.getAccounts().catch(()=>[]);else if(e)try{g=(M=(R=(x=(v=(await h.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:v.caveats)==null?void 0:x[0])==null?void 0:R.value)==null?void 0:M.map(L=>zs(L)),g.length>0&&(g=await this.getAccounts())}catch(O){const L=O;if(L.code===hn.code)throw new hn(L);if(L.code===Yd.code)throw L}try{!(g!=null&&g.length)&&!d&&(g=(await h.request({method:"eth_requestAccounts"})).map(U=>zs(U))),o&&(h.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),h.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),h.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),h.on("disconnect",a));let O=await this.getChainId();if(l&&O!==l){const L=await this.switchChain({chainId:l}).catch(U=>{if(U.code===hn.code)throw U;return{id:O}});O=(L==null?void 0:L.id)??O}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:O}}catch(O){const L=O;throw L.code===hn.code?new hn(L):L.code===Yd.code?new Yd(L):L}},async disconnect(){var d,h;const l=await this.getProvider();if(!l)throw new xd;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 mz(()=>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((h=c.storage)==null?void 0:h.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new xd;return(await l.request({method:"eth_accounts"})).map(h=>zs(h))},async getChainId(){const l=await this.getProvider();if(!l)throw new xd;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=fb(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()),R=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()),R))]))return!0}throw new xd}return!!(await J5(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){var v,x,R,M;const h=await this.getProvider();if(!h)throw new xd;const g=c.chains.find(N=>N.id===d);if(!g)throw new Js(new m0);try{return await Promise.all([h.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:O,...L}=g.blockExplorers??{};let U;l!=null&&l.blockExplorerUrls?U=l.blockExplorerUrls:O&&(U=[O.url,...Object.values(L).map(F=>F.url)]);let H;(R=l==null?void 0:l.rpcUrls)!=null&&R.length?H=l.rpcUrls:H=[((M=g.rpcUrls.default)==null?void 0:M.http[0])??""];const I={blockExplorerUrls:U,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 h.request({method:"wallet_addEthereumChain",params:[I]}),await this.getChainId()!==d)throw new hn(new Error("User rejected switch after adding network."));return g}catch(O){throw new hn(O)}throw E.code===hn.code?new hn(E):new Js(E)}},async onAccountsChanged(l){var d;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const h=(await this.getChainId()).toString();this.onConnect({chainId:h}),e&&await((d=c.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(h=>zs(h))})},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 h=Number(l.chainId);c.emitter.emit("connect",{accounts:d,chainId:h});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 fb(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 ixe})}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 o9e(t){return new s9e(t)}function a9e(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 JM(t,e){return t.slice(0,e).join(".")||"."}function XM(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 u9e(t){const{deserialize:e=a9e,key:r="wagmi",serialize:n=l9e,storage:i=Dz}=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 Dz={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},IC=256;let $y=IC,Dy;function d9e(t=11){if(!Dy||$y+t>IC*2){Dy="",$y=0;for(let e=0;es.chains),c=G9(()=>[...s.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(d))??[]].map(l));function l(U){var T;const H=o9e(d9e()),I={...U({emitter:H,chains:a.getState(),storage:r,transports:s.transports}),emitter:H,uid:H.uid};return H.on("connect",O),(T=I.setup)==null||T.call(I),I}function d(U){const{info:H}=U,I=U.provider;return L4({target:{...H,id:H.rdns,provider:I}})}const h=new Map;function g(U={}){const H=U.chainId??M.getState().chainId,I=a.getState().find(F=>F.id===H);if(U.chainId&&!I)throw new m0;{const F=h.get(M.getState().chainId);if(F&&!I)return F;if(!I)throw new m0}{const F=h.get(H);if(F)return F}let T;if(s.client)T=s.client({chain:I});else{const F=I.id,K=a.getState().map(p=>p.id),B={},_=Object.entries(s);for(const[p,m]of _)if(!(p==="chains"||p==="client"||p==="connectors"||p==="transports"))if(typeof m=="object")if(F in m)B[p]=m[F];else{if(K.some(A=>A in m))continue;B[p]=m}else B[p]=m;T=vz({...B,chain:I,batch:B.batch??{multicall:!0},transport:p=>s.transports[F]({...p,connectors:c})})}return h.set(H,T),T}function v(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let x;const R="0.0.0-canary-";db.startsWith(R)?x=Number.parseInt(db.replace(R,"")):x=Number.parseInt(db.split(".")[0]??"0");const M=G9(Q8e(r?txe(v,{migrate(U,H){if(H===x)return U;const I=v(),T=N(U,I.chainId);return{...I,chainId:T}},name:"store",partialize(U){return{connections:{__type:"Map",value:Array.from(U.connections.entries()).map(([H,I])=>{const{id:T,name:F,type:K,uid:B}=I.connector;return[H,{...I,connector:{id:T,name:F,type:K,uid:B}}]})},chainId:U.chainId,current:U.current}},merge(U,H){typeof U=="object"&&U&&"status"in U&&delete U.status;const I=N(U,H.chainId);return{...H,...U,chainId:I}},skipHydration:i,storage:r,version:x}):v));function N(U,H){return U&&typeof U=="object"&&"chainId"in U&&typeof U.chainId=="number"&&a.getState().some(I=>I.id===U.chainId)?U.chainId:H}n&&M.subscribe(({connections:U,current:H})=>{var I;return H?(I=U.get(H))==null?void 0:I.chainId:void 0},U=>{if(a.getState().some(I=>I.id===U))return M.setState(I=>({...I,chainId:U??I.chainId}))}),o==null||o.subscribe(U=>{const H=new Map;for(const T of c.getState())H.set(T.id,!0);const I=[];for(const T of U){const F=l(d(T));H.has(F.id)||I.push(F)}r&&!M.persist.hasHydrated()||c.setState(T=>[...T,...I],!0)});function E(U){M.setState(H=>{const I=H.connections.get(U.uid);return I?{...H,connections:new Map(H.connections).set(U.uid,{accounts:U.accounts??I.accounts,chainId:U.chainId??I.chainId,connector:I.connector})}:H})}function O(U){M.getState().status==="connecting"||M.getState().status==="reconnecting"||M.setState(H=>{const I=c.getState().find(T=>T.uid===U.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(U.uid,{accounts:U.accounts,chainId:U.chainId,connector:I}),current:U.uid,status:"connected"}):H})}function L(U){M.setState(H=>{const I=H.connections.get(U.uid);if(I){const F=I.connector;F.emitter.listenerCount("change")&&I.connector.emitter.off("change",E),F.emitter.listenerCount("disconnect")&&I.connector.emitter.off("disconnect",L),F.emitter.listenerCount("connect")||I.connector.emitter.on("connect",O)}if(H.connections.delete(U.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(U){let H;typeof U=="function"?H=U(M.getState()):H=U;const I=v();typeof H!="object"&&(H=I),Object.keys(I).some(F=>!(F in H))&&(H=I),M.setState(H,!0)},subscribe(U,H,I){return M.subscribe(U,H,I?{...I,fireImmediately:I.emitImmediately}:void 0)},_internal:{mipd:o,store:M,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(U){const H=typeof U=="function"?U(a.getState()):U;if(H.length!==0)return a.setState(H,!0)},subscribe(U){return a.subscribe(U)}},connectors:{providerDetailToConnector:d,setup:l,setState(U){return c.setState(typeof U=="function"?U(c.getState()):U,!0)},subscribe(U){return c.subscribe(U)}},events:{change:E,connect:O,disconnect:L}}}}const eO=R8e({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 h9e(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 p9e(){return{supportsAllNetworks:!0,approvedCaipNetworkIds:ua.WalletConnectRpcChainIds.map(t=>`${cr.EIP155}:${t}`)}}function g9e({chain:t,projectId:e}){var i,s;const r=Be.getBlockchainApiUrl(),n=(s=(i=t.rpcUrls[0])==null?void 0:i.http)==null?void 0:s[0];return ua.WalletConnectRpcChainIds.includes(t.id)?F8e([V9(`${r}/v1/?chainId=${cr.EIP155}:${t.id}&projectId=${e}`,{fetchOptions:{headers:{"Content-Type":"text/plain"}}}),V9(n)]):V9(n)}function tO(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 Lz(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 m9e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/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 rO=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),nO=4;function w9e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let U=1;U>--c&1}const h=31,g=2**h,v=g>>>1,x=v>>1,R=g-1;let M=0;for(let U=0;U1;){let K=H+I>>>1;U>>1|d(),T=T<<1^v,F=(F^v)<<1|v|1;E=T,O=1+F-T}let L=n-4;return N.map(U=>{switch(U-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 U-1}})}function v9e(t){let e=0;return()=>t[e++]}function Bz(t){return v9e(w9e(y9e(t)))}function y9e(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 b9e(t){return t&1?~t>>1:t>>1}function x9e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=jv(t);if(e.length)return e})}function jz(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(_9e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(C9e(r,t))}return e.flat()}function Fv(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function Fz(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function _9e(t,e){let r=1+e(),n=e(),i=Fv(e);return Fz(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((d,h)=>{let g=h*n;return[c+h*r,l.map(v=>v+g)]})})}function C9e(t,e){let r=1+e();return Fz(r,1+t,e).map(i=>[i[0],i.slice(1)])}function A9e(t){let e=[],r=jv(t);return i(n([]),[]),e;function n(s){let o=t(),a=Fv(()=>{let c=jv(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 E9e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function zz(t){return`{${E9e(t)}}`}function S9e(t){let e=[];for(let r=0,n=t.length;r>24&255}function qz(t){return t&16777215}let TC,iO,kC,hb;function O9e(){let t=Bz(T9e);TC=new Map(Uz(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),iO=new Set(jv(t)),kC=new Map,hb=new Map;for(let[e,r]of jz(t)){if(!iO.has(e)&&r.length==2){let[n,i]=r,s=hb.get(n);s||(s=new Map,hb.set(n,s)),s.set(i,e)}kC.set(e,r.reverse())}}function Vz(t){return t>=zv&&t=t6&&t=r6&&en6&&e0&&i(n6+l)}else{let o=kC.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Dm(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=$9e(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 Gz(t){return Kz(t).map(qz)}function L9e(t){return D9e(Kz(t))}const sO=45,Zz=".",Qz=65039,Yz=1,$p=t=>Array.from(t);function Wv(t,e){return t.P.has(e)||t.Q.has(e)}class B9e extends Array{get is_emoji(){return!0}}let PC,Jz,wh,RC,Xz,Yp,J9,mp,eW,oO,NC;function bS(){if(PC)return;let t=Bz(m9e);const e=()=>jv(t),r=()=>new Set(e());PC=new Map(jz(t)),Jz=r(),wh=e(),RC=new Set(e().map(d=>wh[d])),wh=new Set(wh),Xz=r(),r();let n=Uz(t),i=t();const s=()=>new Set(e().flatMap(d=>n[d]).concat(e()));Yp=Fv(d=>{let h=Fv(t).map(g=>g+96);if(h.length){let g=d>=i;h[0]-=32,h=Y1(h),g&&(h=`Restricted[${h}]`);let v=s(),x=s(),R=!t();return{N:h,P:v,Q:x,M:R,R:g}}}),J9=r(),mp=new Map;let o=e().concat($p(J9)).sort((d,h)=>d-h);o.forEach((d,h)=>{let g=t(),v=o[h]=g?o[h-g]:{V:[],M:new Map};v.V.push(d),J9.has(d)||mp.set(d,v)});for(let{V:d,M:h}of new Set(mp.values())){let g=[];for(let x of d){let R=Yp.filter(N=>Wv(N,x)),M=g.find(({G:N})=>R.some(E=>N.has(E)));M||(M={G:new Set,V:[]},g.push(M)),M.V.push(x),R.forEach(N=>M.G.add(N))}let v=g.flatMap(x=>$p(x.G));for(let{G:x,V:R}of g){let M=new Set(v.filter(N=>!x.has(N)));for(let N of R)h.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 Yp){for(let h of d.P)l(h);for(let h of d.Q)l(h)}for(let d of a)!mp.has(d)&&!c.has(d)&&mp.set(d,Yz);eW=new Set($p(a).concat($p(Gz(a)))),oO=A9e(t).map(d=>B9e.from(d)).sort(I9e),NC=new Map;for(let d of oO){let h=[NC];for(let g of d){let v=h.map(x=>{let R=x.get(g);return R||(R=new Map,x.set(g,R)),R});g===Qz?h.push(...v):h=v}for(let g of h)g.V=d}}function xS(t){return(tW(t)?"":`${_S(B4([t]))} `)+zz(t)}function _S(t){return`"${t}"‎`}function U9e(t){if(t.length>=4&&t[2]==sO&&t[3]==sO)throw new Error(`invalid label extension: "${Y1(t.slice(0,4))}"`)}function j9e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function F9e(t){let e=t[0],r=rO.get(e);if(r)throw sw(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=S9e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=Z9e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let d=o.output=a.flat();if(j9e(d),!(o.emoji=c>1||a[0].is_emoji)&&d.every(g=>g<128))U9e(d),l="ASCII";else{let g=a.flatMap(v=>v.is_emoji?[]:v);if(!g.length)l="Emoji";else{if(wh.has(d[0]))throw sw("leading combining mark");for(let R=1;Ro.has(a)):$p(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Wv(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function V9e(t){let e=Yp;for(let r of t){let n=e.filter(i=>Wv(i,r));if(!n.length)throw Yp.some(i=>Wv(i,r))?nW(e[0],r):rW(r);if(e=n,n.length==1)break}return e}function K9e(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 ${_S(B4(e))}: ${i}`)}return Y1(n)}).join(Zz)}function rW(t){return new Error(`disallowed character: ${xS(t)}`)}function nW(t,e){let r=xS(e),n=Yp.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function sw(t){return new Error(`illegal placement: ${t}`)}function G9e(t,e){for(let r of e)if(!Wv(t,r))throw nW(t,r);if(t.M){let r=Gz(e);for(let n=1,i=r.length;nnO)throw new Error(`excessive non-spacing marks: ${_S(B4(r.slice(n-1,s)))} (${s-n}/${nO})`);n=s}}}function Z9e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=Y9e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(eW.has(o))i.push(o);else{let a=PC.get(o);if(a)i.push(...a);else if(!Jz.has(o))throw rW(o)}}}return i.length&&n.push(e(i)),n}function Q9e(t){return t.filter(e=>e!=Qz)}function Y9e(t,e){let r=NC,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 aO(t){return W9e(t)}CS.type="walletConnect";function CS(t,e){const r=t.isNewChainsStale??!0;let n,i,s,o,a,c,l,d;return h=>({id:"walletConnect",name:"WalletConnect",type:CS.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 xd;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=Dj.createNamespaces(t.networks);await v.connect({optionalNamespaces:N,..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(t.networks.map(E=>Number(E.chainId)))}const R=(await v.enable()).map(N=>zs(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:R,chainId:M}}catch(v){throw/(user rejected|connection request reset)/i.test(v==null?void 0:v.message)?new hn(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 R,M,N;const g=await this.getProvider();if(!((R=g==null?void 0:g.session)!=null&&R.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 R,M,N;async function v(){var L;if(!t.networks.map(U=>Number(U.chainId)).length)return;const O=(L=e.universalAdapter)==null?void 0:L.getWalletConnectProvider();if(!O)throw new Error("Provider not found");return O}n||(i||(i=v()),n=await i,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY));const x=(R=e.getCaipNetwork())==null?void 0:R.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,O;const g=(M=e.getCaipNetwork())==null?void 0:M.chainId;if(g)return g;const x=(O=(E=(N=(await this.getProvider()).session)==null?void 0:N.namespaces.eip155)==null?void 0:E.chains)==null?void 0:O[0],R=t.networks.find(L=>L.id===x);return R==null?void 0:R.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 xd;const R=t.networks.find(O=>O.chainId===v),[M]=R?Lz([R]):[];if(!M)throw new Js(new m0);try{R!=null&&R.id&&x.setDefaultChain(R==null?void 0:R.id),await x.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(v)}]}),h.emitter.emit("change",{chainId:Number(v)});const O=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...O,v]),M}catch(O){const L=O;if(/(?:user rejected)/iu.test(L.message))throw new hn(L);try{let U;g!=null&&g.blockExplorerUrls?U=g.blockExplorerUrls:U=(N=M.blockExplorers)!=null&&N.default.url?[(E=M.blockExplorers)==null?void 0:E.default.url]:[];const H={blockExplorerUrls:U,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(U){throw new hn(U)}}},onAccountsChanged(g){g.length===0?this.onDisconnect():h.emitter.emit("change",{accounts:g.map(v=>zs(v))})},onChainChanged(g){const v=Number(g);h.emitter.emit("change",{chainId:v})},async onConnect(g){const v=Number(g.chainId),x=await this.getAccounts();h.emitter.emit("connect",{accounts:x,chainId:v})},async onDisconnect(g){this.setRequestedChainsIds([]),h.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){h.emitter.emit("message",{type:"display_uri",data:g})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var x,R,M;if(!((x=n==null?void 0:n.session)!=null&&x.namespaces))return[];const g=(M=(R=n==null?void 0:n.session)==null?void 0:R.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=h.storage)==null?void 0:v.getItem(this.requestedChainsStorageKey))??[];return[...new Set(g)]},async isChainsStale(){if(!r)return!1;const g=h.chains.map(R=>R.id),v=this.getNamespaceChainsIds();if(v.length&&!v.some(R=>g.includes(R)))return!1;const x=await this.getRequestedChainsIds();return!g.every(R=>x.includes(Number(R)))},async setRequestedChainsIds(g){var v;await((v=h.storage)==null?void 0:v.setItem(this.requestedChainsStorageKey,g))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}U4.type="coinbaseWallet";function U4(t={}){return t.version==="3"||t.headlessMode?X9e(t):J9e(t)}function J9e(t){let e,r,n,i,s;return o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:U4.type,async connect({chainId:a}={}){try{const c=await this.getProvider(),l=(await c.request({method:"eth_requestAccounts"})).map(h=>zs(h));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 h=await this.switchChain({chainId:a}).catch(g=>{if(g.code===hn.code)throw g;return{id:d}});d=(h==null?void 0:h.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 hn(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=>zs(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 Dn(async()=>{const{default:l}=await import("./index-TYE6PGSe.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 h,g,v,x;const l=o.chains.find(R=>R.id===c);if(!l)throw new Js(new m0);const d=await this.getProvider();try{return await d.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(l.id)}]}),l}catch(R){if(R.code===4902)try{let M;a!=null&&a.blockExplorerUrls?M=a.blockExplorerUrls:M=(h=l.blockExplorers)!=null&&h.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 hn(M)}throw new Js(R)}},onAccountsChanged(a){a.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:a.map(c=>zs(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 X9e(t){let r,n,i,s,o;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:U4.type,async connect({chainId:c}={}){try{const l=await this.getProvider(),d=(await l.request({method:"eth_requestAccounts"})).map(g=>zs(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 h=await this.getChainId();if(c&&h!==c){const g=await this.switchChain({chainId:c}).catch(v=>{if(v.code===hn.code)throw v;return{id:h}});h=(g==null?void 0:g.id)??h}return{accounts:d,chainId:h}}catch(l){throw/(user closed modal|accounts received is empty|user denied account)/i.test(l.message)?new hn(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=>zs(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 Dn(async()=>{const{default:R}=await import("./index-DuaFf-vM.js").then(M=>M.i);return{default:R}},__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(),h=a.chains.find(x=>t.chainId?x.id===t.chainId:x.id===d)||a.chains[0],g=t.chainId||(h==null?void 0:h.id),v=t.jsonRpcUrl||(h==null?void 0:h.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,R;const d=a.chains.find(M=>M.id===l);if(!d)throw new Js(new m0);const h=await this.getProvider();try{return await h.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=[((R=d.rpcUrls.default)==null?void 0:R.http[0])??""];const O={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 h.request({method:"wallet_addEthereumChain",params:[O]}),d}catch(N){throw new hn(N)}throw new Js(M)}},onAccountsChanged(c){c.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:c.map(l=>zs(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 ow{constructor(){}static getInstance(e,r){return ow.instance||(ow.instance=new ire(e,r)),ow.instance}}function e7e(t){function e(r){return Ga.parseEvmChainId(r)||1}return r=>({id:cr.AUTH_CONNECTOR_ID,name:"AppKit Auth",type:"w3mAuth",chain:yn.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=ow.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 Js(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 Js(i):i}},onAccountsChanged(n){n.length===0?this.onDisconnect():r.emitter.emit("change",{accounts:n.map(zs)})},onChainChanged(n){const i=Number(n);r.emitter.emit("change",{chainId:i})},async onDisconnect(n){await(await this.getProvider()).disconnect()}})}const t7e=["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 r7e{constructor(e){var s,o,a;this.appKit=void 0,this.options=void 0,this.chainNamespace=yn.CHAIN.EVM,this.defaultCaipNetwork=void 0,this.tokens=vP.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:Sw.extendRpcUrlWithProjectId(c.rpcUrl,e.projectId)})),this.wagmiChains=Lz(this.caipNetworks.filter(c=>c.chainNamespace===yn.CHAIN.EVM));const r=this.wagmiChains.map(c=>[c.id,g9e({chain:c,projectId:e.projectId})]),n=Object.fromEntries(r),i=[...e.connectors??[]];this.wagmiConfig=f9e({...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,h,g;const n=[];e.enableWalletConnect!==!1&&n.push(CS(e,r)),e.enableInjected!==!1&&n.push(L4({shimDisconnect:!0})),e.enableCoinbase!==!1&&n.push(U4({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?Sn.DEFAULT_FEATURES.email:(l=e.features)==null?void 0:l.email,s=(d=e.features)!=null&&d.socials?((g=(h=e.features)==null?void 0:h.socials)==null?void 0:g.length)>0:Sn.DEFAULT_FEATURES.socials;(i||s)&&n.push(e7e({chains:this.wagmiChains,options:{projectId:e.projectId}})),n.forEach(v=>{const x=this.wagmiConfig._internal.connectors.setup(v);this.wagmiConfig._internal.connectors.setState(R=>[...R,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=vP.getCaipTokens(r.tokens),this.setCustomConnectors(r,e),!this.wagmiConfig)throw new Error("appkit:wagmiConfig - is undefined");this.networkControllerClient={switchCaipNetwork:async o=>{const a=Number(Ga.caipNetworkIdToNumber(o==null?void 0:o.id));a&&this.wagmiConfig&&await Jxe(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(p9e());else if(((d=c==null?void 0:c.connector)==null?void 0:d.id)===cr.WALLET_CONNECT_CONNECTOR_ID){const h=this.wagmiConfig.connectors.find(g=>g.id===cr.WALLET_CONNECT_CONNECTOR_ID);o(h9e(h))}o({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})}},this.connectionControllerClient={connectWalletConnect:async()=>{var x,R,M,N,E,O,L,U,H,I,T,F;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=(R=(x=this.options)==null?void 0:x.siweConfig)==null?void 0:R.getMessageParams)==null?void 0:M.call(R)),l=(O=(E=(N=this.options)==null?void 0:N.siweConfig)==null?void 0:E.options)==null?void 0:O.enabled,d=typeof(a==null?void 0:a.authenticate)=="function",h=c&&Object.keys(c||{}).length>0,g=(L=this.options)==null?void 0:L.siweConfig;if(l&&d&&h&&g){await o.setRequestedChainsIds(c.chains);const{SIWEController:K,getDidChainId:B,getDidAddress:_}=await Dn(async()=>{const{SIWEController:A,getDidChainId:P,getDidAddress:S}=await import("./index-C90-4id0.js");return{SIWEController:A,getDidChainId:P,getDidAddress:S}},[]),p=(U=this.caipNetworks)==null?void 0:U.filter(A=>A.chainNamespace==="eip155").map(A=>A.id);c.chains=(H=this.caipNetworks)==null?void 0:H.filter(A=>A.chainNamespace==="eip155").map(A=>A.chainId);const m=await a.authenticate({nonce:await g.getNonce(),methods:[...t7e],...c,chains:p}),w=(I=m==null?void 0:m.auths)==null?void 0:I[0];if(w){const{p:A,s:P}=w,S=B(A.iss),k=_(A.iss);k&&S&&K.setSession({address:k,chainId:parseInt(S,10)});try{const y=a.client.formatAuthMessage({request:A,iss:A.iss});await K.verifyMessage({message:y,signature:P.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(Ga.caipNetworkIdToNumber((F=(T=this.appKit)==null?void 0:T.getCaipNetwork())==null?void 0:F.id));await GM(this.wagmiConfig,{connector:o,chainId:v})},connectExternal:async({id:o,provider:a,info:c})=>{var h,g,v,x;if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const l=this.wagmiConfig.connectors.find(R=>R.id===o);if(!l)throw new Error("connectionControllerClient:connectExternal - connector is undefined");(h=this.appKit)==null||h.setClientId(null),a&&c&&l.id===cr.EIP6963_CONNECTOR_ID&&((g=l.setEip6963Wallet)==null||g.call(l,{provider:a,info:c}));const d=Number(Ga.caipNetworkIdToNumber((x=(v=this.appKit)==null?void 0:v.getCaipNetwork())==null?void 0:x.id));await GM(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 Dxe(this.wagmiConfig),(c=(a=(o=this.options)==null?void 0:o.siweConfig)==null?void 0:a.options)!=null&&c.signOutOnDisconnect){const{SIWEController:h}=await Dn(async()=>{const{SIWEController:g}=await import("./index-C90-4id0.js");return{SIWEController:g}},[]);await h.signOut()}nn.removeItem(rn.WALLET_ID),nn.removeItem(rn.CONNECTED_CONNECTOR),nn.removeItem(rn.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=tO(a);return Gxe(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 Lxe(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}=U2(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 Vxe(this.wagmiConfig,c);const l=await Kxe(this.wagmiConfig,c);return await t9e(this.wagmiConfig,{hash:l,timeout:25e3}),l},writeContract:async o=>{var h,g,v,x;const a=((h=this.appKit)==null?void 0:h.getCaipAddress())||"",c=tO(a),l=Number(Ga.caipNetworkIdToNumber((v=(g=this.appKit)==null?void 0:g.getCaipNetwork())==null?void 0:v.id));return await r9e(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(Ga.caipNetworkIdToNumber((c=(a=this.appKit)==null?void 0:a.getCaipNetwork())==null?void 0:c.id));let h=!1,g=!1;return YJ(o)&&(g=await((l=this.appKit)==null?void 0:l.resolveReownName(o))||!1),d===1&&(h=await Hxe(this.wagmiConfig,{name:aO(o),chainId:d})),h||g||!1}catch{return!1}},getEnsAvatar:async o=>{var l,d;const a=Number(Ga.caipNetworkIdToNumber((d=(l=this.appKit)==null?void 0:l.getCaipNetwork())==null?void 0:d.id));return a!==eO.id?!1:await QM(this.wagmiConfig,{name:aO(o),chainId:a})||!1},parseUnits:$8e,formatUnits:$2},pe.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),e9e(this.wagmiConfig,{onChange:o=>{this.syncConnectors(o),this.syncAuthConnector(o.find(a=>a.id===cr.AUTH_CONNECTOR_ID))}}),Xxe(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=zxe(this.wagmiConfig)[0])==null?void 0:a.connector;l&&Qxe(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(Ga.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,h,g,v,x,R,M,N,E,O,L,U,H;const o=pe.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),nn.removeItem(rn.WALLET_ID);return}if(this.wagmiConfig&&n){if(n&&n.name==="WalletConnect"&&n.getProvider&&e){const I=r||Number(Ga.caipNetworkIdToNumber((g=(h=this.appKit)==null?void 0:h.getCaipNetwork())==null?void 0:g.id)),T=await n.getProvider(),F=((v=T==null?void 0:T.session)==null?void 0:v.namespaces)||{},K=F?Object.keys(F):[],B=(x=this.appKit)==null?void 0:x.getPreferredAccountType();K.forEach(_=>{var w,A,P;const p=_,m=(w=F==null?void 0:F[_])==null?void 0:w.accounts[0];j1.setProvider(p,T),j1.setProviderId(p,"walletConnect"),(A=this.appKit)==null||A.setPreferredAccountType(B,p),(P=this.appKit)==null||P.setCaipAddress(m,p)}),((M=(R=this.appKit)==null?void 0:R.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),(O=this.appKit)==null?void 0:O.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(F=>({address:F,type:"eoa"})),this.chainNamespace))}else if(s==="reconnecting"){(U=this.appKit)==null||U.setLoading(!0);const T=Wxe(this.wagmiConfig).find(F=>F.id===n.id);T&&(await YM(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(h=>h.chainId===r);if(i&&r&&((a=this.appKit)==null||a.setCaipNetwork({chainId:i.chainId,id:i.id,name:i.name||"",imageId:ua.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 h=`eip155:${r}:${e}`;if((c=this.appKit)==null||c.setCaipAddress(h,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===eO.id){const l=await qxe(this.wagmiConfig,{address:e,chainId:r});if(l){(s=this.appKit)==null||s.setProfileName(l,this.chainNamespace);const d=await QM(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 Fxe(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:ua.ConnectorExplorerIds[a],imageUrl:((v=(g=this.options)==null?void 0:g.connectorImages)==null?void 0:v[a])??d,name:ua.ConnectorNamesMap[a]??c,imageId:ua.ConnectorImageIds[a],type:ua.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;Qi.checkIfRequestExists(a)?Qi.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,h;((c=this.appKit)==null?void 0:c.isOpen())&&((l=this.appKit)!=null&&l.isTransactionStackEmpty()?(d=this.appKit)==null||d.close():(h=this.appKit)==null||h.popTransactionStack(!0))}),s.onRpcSuccess((a,c)=>{var d,h,g;Qi.checkIfRequestIsSafe(c)||((d=this.appKit)!=null&&d.isTransactionStackEmpty()?(h=this.appKit)==null||h.close():(g=this.appKit)==null||g.popTransactionStack())}),s.onNotConnected(()=>{var d,h,g;const a=(d=this.appKit)==null?void 0:d.getIsConnectedState(),l=nn.getItem(rn.CONNECTED_CONNECTOR)==="AUTH";!a&&l&&((h=this.appKit)==null||h.setCaipAddress(void 0,this.chainNamespace),(g=this.appKit)==null||g.setLoading(!1))}),s.onIsConnected(()=>{s.connect()}),s.onConnect(a=>{var l,d,h,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),(h=this.appKit)==null||h.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&&YM(this.wagmiConfig,{connectors:[e]}))})}}async listenModal(e){const r=await e.getProvider();this.subscribeState(n=>{n.open||r.rejectRpcRequests()})}}const cO="pushstate",lO="popstate",iW="beforeunload",sW=t=>(t.preventDefault(),t.returnValue=""),n7e=()=>{removeEventListener(iW,sW,{capture:!0})};function oW(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=uO(a),s(()=>{t.pushState(o,a),i()},c)},replace:(o,a,c)=>{a=uO(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(iW,sW,{capture:!0}),()=>{n=n.filter(a=>a!==o),n.length||n7e()}),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 uO(t){return t||(t={}),{...t,key:o7e()}}function aW(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)??(R=>R),s=(t==null?void 0:t.parseLocation)??(()=>Hv(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));let o=s(),a;const c=()=>o;let l,d;const h=()=>{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=(R,M,N)=>{const E=i(M);d||(a=o),o=Hv(M,N),l={href:E,state:N,isPush:(l==null?void 0:l.isPush)||R==="push"},d||(d=Promise.resolve().then(()=>h()))},v=()=>{o=s(),x.notify()},x=oW({getLocation:c,getLength:()=>e.history.length,pushState:(R,M)=>g("push",R,M),replaceState:(R,M)=>g("replace",R,M),back:()=>e.history.back(),forward:()=>e.history.forward(),go:R=>e.history.go(R),createHref:R=>i(R),flush:h,destroy:()=>{e.history.pushState=r,e.history.replaceState=n,e.removeEventListener(cO,v),e.removeEventListener(lO,v)},onBlocked:R=>{a&&o!==a&&(o=a,R())}});return e.addEventListener(cO,v),e.addEventListener(lO,v),e.history.pushState=function(...R){const M=r.apply(e.history,R);return x._ignoreSubscribers||v(),M},e.history.replaceState=function(...R){const M=n.apply(e.history,R);return x._ignoreSubscribers||v(),M},x}function i7e(t){const e=typeof document<"u"?window:void 0;return aW({window:e,parseLocation:()=>{const r=e.location.hash.split("#").slice(1).join("#")??"/";return Hv(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 oW({getLocation:()=>Hv(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 Hv(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 o7e(){return(Math.random()+1).toString(36).substring(7)}var a7e="Invariant failed";function Bs(t,e){if(!t)throw new Error(a7e)}const X9=it.createContext(null);function cW(){return typeof document>"u"?X9:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=X9,X9)}function $f(t){const e=it.useContext(cW());return t==null||t.warn,e}var lW={exports:{}},uW={},dW={exports:{}},fW={};/** +`):`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 U4e extends Fe{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 j4e extends Fe{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 fS extends Fe{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 hS(t,e){var n,i,s,o,a,c;if(!(t instanceof Fe))return!1;const r=t.walk(l=>l instanceof CC);return r instanceof CC?!!(((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===lz[50]):!1}function dz(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Wu(e)?e:null}function ub(t){let e=new Uint8Array(32).fill(0);if(!t)return Ti(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=dz(r[n]),s=i?S4(i):gf(kh(r[n]),"bytes");e=gf(h0([e,s]),"bytes")}return Ti(e)}function F4e(t){return`[${t.slice(2)}]`}function z4e(t){const e=new Uint8Array(32).fill(0);return t?dz(t)||gf(kh(t)):Ti(e)}function pS(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(kh(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=kh(F4e(z4e(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 W4e=3;function $v(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:d}=t instanceof fS?t:t instanceof Fe?t.walk(g=>"data"in g)||t.walk():{},h=t instanceof k4?new U4e({functionName:s}):[W4e,p0.code].includes(a)&&(c||l||d)?new CC({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:d??l}):t;return new dS(h,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const H4e="0x82ad56cb",q4e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",V4e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",sTe="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function K4e(t,{docsPath:e,...r}){const n=(()=>{const i=rS(t,r);return i instanceof M4?t:i})();return new B4e(n,{docsPath:e,...r})}const H9=new Map;function fz({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const d=c();o();const h=d.map(({args:g})=>g);h.length!==0&&t(h).then(g=>{var v;i&&Array.isArray(g)&&g.sort(i);for(let x=0;x{var v;for(let x=0;xH9.delete(e),a=()=>c().map(({args:d})=>d),c=()=>H9.get(e)||[],l=d=>H9.set(e,[...c(),d]);return{flush:o,async schedule(d){const h={},g=new Promise((R,M)=>{h.resolve=R,h.reject=M});return(r==null?void 0:r([...a(),d]))&&s(),c().length>0?(l({args:d,pendingPromise:h}),g):(l({args:d,pendingPromise:h}),setTimeout(s,n),g)}}}async function gS(t,e){var B,_,p,m;const{account:r=t.account,batch:n=!!((B=t.batch)!=null&&B.multicall),blockNumber:i,blockTag:s="latest",accessList:o,blobs:a,code:c,data:l,factory:d,factoryData:h,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:R,maxPriorityFeePerGas:M,nonce:N,to:E,value:O,stateOverride:L,...U}=e,H=r?Rc(r):void 0;if(c&&(d||h))throw new Fe("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&E)throw new Fe("Cannot provide both `code` & `to` as parameters.");const I=c&&l,T=d&&h&&E&&l,F=I||T,K=I?Q4e({code:c,data:l}):T?Y4e({data:l,factory:d,factoryData:h,to:E}):l;try{O4(e);const A=(i?gr(i):void 0)||s,P=BF(L),S=(m=(p=(_=t.chain)==null?void 0:_.formatters)==null?void 0:p.transactionRequest)==null?void 0:m.format,y=(S||iS)({...nS(U,{format:S}),from:H==null?void 0:H.address,accessList:o,blobs:a,data:K,gas:g,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:R,maxPriorityFeePerGas:M,nonce:N,to:F?void 0:E,value:O});if(n&&G4e({request:y})&&!P)try{return await Z4e(t,{...y,blockNumber:i,blockTag:s})}catch(V){if(!(V instanceof TF)&&!(V instanceof aC))throw V}const b=await t.request({method:"eth_call",params:P?[y,A,P]:[y,A]});return b==="0x"?{data:void 0}:{data:b}}catch(w){const A=J4e(w),{offchainLookup:P,offchainLookupSignature:S}=await Dn(async()=>{const{offchainLookup:k,offchainLookupSignature:y}=await import("./ccip-DJxiIDgE.js");return{offchainLookup:k,offchainLookupSignature:y}},__vite__mapDeps([0,1]));if(t.ccipRead!==!1&&(A==null?void 0:A.slice(0,10))===S&&E)return{data:await P(t,{data:A,to:E})};throw F&&(A==null?void 0:A.slice(0,10))==="0x101bb98d"?new j4e({factory:d}):K4e(w,{...e,account:H,chain:t.chain})}}function G4e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(H4e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Z4e(t,e){var R;const{batchSize:r=1024,wait:n=0}=typeof((R=t.batch)==null?void 0:R.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 TF;l=L2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const h=(i?gr(i):void 0)||s,{schedule:g}=fz({id:`${t.uid}.${h}`,wait:n,shouldSplitBatch(M){return M.reduce((E,{data:O})=>E+(O.length-2),0)>r*2},fn:async M=>{const N=M.map(L=>({allowFailure:!0,callData:L.data,target:L.to})),E=U0({abi:wC,args:[N],functionName:"aggregate3"}),O=await t.request({method:"eth_call",params:[{data:E,to:l},h]});return Rg({abi:wC,args:[N],functionName:"aggregate3",data:O||"0x"})}}),[{returnData:v,success:x}]=await g({data:o,to:c});if(!x)throw new fS({data:v});return v==="0x"?{data:void 0}:{data:v}}function Q4e(t){const{code:e,data:r}=t;return AF({abi:oz(["constructor(bytes, bytes)"]),bytecode:q4e,args:[e,r]})}function Y4e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return AF({abi:oz(["constructor(address, bytes, address, bytes)"]),bytecode:V4e,args:[i,e,r,n]})}function J4e(t){var r;if(!(t instanceof Fe))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 g0(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=U0({abi:r,args:i,functionName:s});try{const{data:c}=await on(t,gS,"call")({...o,data:a,to:n});return Rg({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw $v(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function X4e(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=L2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=U0({abi:NM,functionName:"addr",...n!=null?{args:[ub(i),BigInt(n)]}:{args:[ub(i)]}}),d={address:c,abi:KF,functionName:"resolve",args:[d0(pS(i)),l],blockNumber:e,blockTag:r},h=on(t,g0,"readContract"),g=s?await h({...d,args:[...d.args,s]}):await h(d);if(g[0]==="0x")return null;const v=Rg({abi:NM,args:n!=null?[ub(i),BigInt(n)]:void 0,functionName:"addr",data:g[0]});return v==="0x"||kg(v)==="0x00"?null:v}catch(l){if(o)throw l;if(hS(l,"resolve"))return null;throw l}}class e8e extends Fe{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 Em extends Fe{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class mS extends Fe{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 t8e extends Fe{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const r8e=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,n8e=/^(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\-.]+))?(?\/.*)?$/,i8e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,s8e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function o8e(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 DM(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function hz({uri:t,gatewayUrls:e}){const r=i8e.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=DM(e==null?void 0:e.ipfs,"https://ipfs.io"),i=DM(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(r8e),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},d=o==="ipns:/"||a==="ipns/",h=o==="ipfs:/"||a==="ipfs/"||n8e.test(t);if(t.startsWith("http")&&!d&&!h){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||h)&&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 wS({gatewayUrls:t,uri:pz(r)})}catch{throw new mS({uri:e})}}async function wS({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=hz({uri:e,gatewayUrls:t});if(n||await o8e(r))return r;throw new mS({uri:e})}function c8e(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 Em({reason:"Only EIP-155 supported"});if(!o)throw new Em({reason:"Chain ID not found"});if(!c)throw new Em({reason:"Contract address not found"});if(!i)throw new Em({reason:"Token ID not found"});if(!a)throw new Em({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function l8e(t,{nft:e}){if(e.namespace==="erc721")return g0(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 g0(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 t8e({namespace:e.namespace})}async function u8e(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?d8e(t,{gatewayUrls:e,record:r}):wS({uri:r,gatewayUrls:e})}async function d8e(t,{gatewayUrls:e,record:r}){const n=c8e(r),i=await l8e(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=hz({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 wS({uri:pz(d),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),a8e({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function f8e(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=L2({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:KF,functionName:"resolve",args:[d0(pS(n)),U0({abi:RM,functionName:"text",args:[ub(n),i]})],blockNumber:e,blockTag:r},d=on(t,g0,"readContract"),h=s?await d({...l,args:[...l.args,s]}):await d(l);if(h[0]==="0x")return null;const g=Rg({abi:RM,functionName:"text",data:h[0]});return g===""?null:g}catch(l){if(o)throw l;if(hS(l,"resolve"))return null;throw l}}async function h8e(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await on(t,f8e,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await u8e(t,{record:c,gatewayUrls:n})}catch{return null}}async function p8e(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=L2({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:$6e,functionName:"reverse",args:[d0(pS(c))],blockNumber:r,blockTag:n},d=on(t,g0,"readContract"),[h,g]=i?await d({...l,args:[...l.args,i]}):await d(l);return e.toLowerCase()!==g.toLowerCase()?null:h}catch(l){if(s)throw l;if(hS(l,"reverse"))return null;throw l}}const g8e=new Map,m8e=new Map;function w8e(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,g8e),n=e(t,m8e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function v8e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=w8e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function b8e(t,{cacheTime:e=t.cacheTime}={}){const r=await v8e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:y8e(t.uid),cacheTime:e});return BigInt(r)}function x8e(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 gz(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var d,h,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 kF({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((g=(h=(d=t.chain)==null?void 0:d.formatters)==null?void 0:h.transaction)==null?void 0:g.format)||$F)(c)}const _8e={"0x0":"reverted","0x1":"success"};function C8e(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=>x8e(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?u0(t.transactionIndex):null,status:t.status?_8e[t.status]:null,type:t.type?OF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}async function LM(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new PF({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||C8e)(r)}async function A8e(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=L2({blockNumber:i,chain:t.chain,contract:"multicall3"})}const h=[[]];let g=0,v=0;for(let N=0;N0&&v>l&&h[g].length>0&&(g++,v=(H.length-2)/2,h[g]=[]),h[g]=[...h[g],{allowFailure:!0,callData:H,target:O}]}catch(H){const I=$v(H,{abi:E,address:O,args:L,docsPath:"/docs/contract/multicall",functionName:U});if(!r)throw I;h[g]=[...h[g],{allowFailure:!0,callData:"0x",target:O}]}}const x=await Promise.allSettled(h.map(N=>on(t,g0,"readContract")({abi:wC,address:d,args:[N],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),R=[];for(let N=0;Nq9.get(t)||[],s=()=>{const d=i();q9.set(t,d.filter(h=>h.id!==n))},o=()=>{const d=BM.get(t);i().length===1&&d&&d(),s()},a=i();if(q9.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const d in e)c[d]=(...h)=>{var v,x;const g=i();if(g.length!==0)for(const R of g)(x=(v=R.fns)[d])==null||x.call(v,...h)};const l=r(c);return typeof l=="function"&&BM.set(t,l),o}async function Y5(t){return new Promise(e=>setTimeout(e,t))}function S8e(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 Y5(c);const l=async()=>{i&&(await t({unpoll:s}),await Y5(n),l())};l()})(),s}function I8e(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 h=uc(["watchBlockNumber",t.uid,e,r,o]);return AC(h,{onBlockNumber:n,onError:i},g=>S8e(async()=>{var v;try{const x=await on(t,b8e,"getBlockNumber")({cacheTime:0});if(c){if(x===c)return;if(x-c>1&&r)for(let R=c+1n;Rc)&&(g.onBlockNumber(x,c),c=x)}catch(x){(v=g.onError)==null||v.call(g,x)}},{emitOnBegin:e,interval:o}))})():(()=>{const h=uc(["watchBlockNumber",t.uid,e,r]);return AC(h,{onBlockNumber:n,onError:i},g=>{let v=!0,x=()=>v=!1;return(async()=>{try{const R=(()=>{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 R.subscribe({params:["newHeads"],onData(N){var O;if(!v)return;const E=G1((O=N.result)==null?void 0:O.number);g.onBlockNumber(E,c),c=E},onError(N){var E;(E=g.onError)==null||E.call(g,N)}});x=M,v||x()}catch(R){i==null||i(R)}})(),()=>x()})})()}const Py=new VE(8192);function T8e(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(Py.get(r))return Py.get(r);const n=t().finally(()=>Py.delete(r));return Py.set(r,n),n}function J5(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 Y5(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?gf(I4(`${a}.${uc(r)}`)):void 0;return T8e(()=>J5(async()=>{try{return await t(r)}catch(l){const d=l;switch(d.code){case xv.code:throw new xv(d);case _v.code:throw new _v(d);case Cv.code:throw new Cv(d,{method:r.method});case Av.code:throw new Av(d);case p0.code:throw new p0(d);case Ev.code:throw new Ev(d);case Sv.code:throw new Sv(d);case Yd.code:throw new Yd(d);case Z1.code:throw new Z1(d);case Iv.code:throw new Iv(d,{method:r.method});case Q1.code:throw new Q1(d);case Tv.code:throw new Tv(d);case hn.code:throw new hn(d);case kv.code:throw new kv(d);case Pv.code:throw new Pv(d);case Rv.code:throw new Rv(d);case Nv.code:throw new Nv(d);case Js.code:throw new Js(d);case 5e3:throw new hn(d);default:throw l instanceof Fe?l:new n6e(d)}}},{delay:({count:l,error:d})=>{var h;if(d&&d instanceof iw){const g=(h=d==null?void 0:d.headers)==null?void 0:h.get("Retry-After");if(g!=null&&g.match(/\d/))return Number.parseInt(g)*1e3}return~~(1<P8e(l)}),{enabled:i,id:c})}}function P8e(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Q1.code||t.code===p0.code:t instanceof iw&&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 R8e(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function mz(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 N8e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const UM=N8e();function M8e(t,e={}){return{async request(r){var h;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 mz(async({signal:x})=>{const R={...a,body:Array.isArray(n)?uc(n.map(E=>({jsonrpc:"2.0",id:E.id??UM.take(),...E}))):uc({jsonrpc:"2.0",id:n.id??UM.take(),...n}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:d||(o>0?x:null)},M=new Request(t,R);return i&&await i(M),await fetch(t,R)},{errorInstance:new SM({body:n,url:t}),timeout:o,signal:!0});s&&await s(g);let v;if((h=g.headers.get("Content-Type"))!=null&&h.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 iw({body:n,details:uc(v.error)||g.statusText,headers:g.headers,status:g.status,url:t});return v}catch(g){throw g instanceof iw||g instanceof SM?g:new iw({body:n,cause:g,url:t})}}}}class O8e extends Fe{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function $8e(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new O8e({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 D8e(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<{a&&setTimeout(()=>x(new e6e({hash:r})),a);const R=AC(c,{onReplaced:n,resolve:v,reject:x},M=>{const N=on(t,I8e,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(E){const O=U=>{N(),U(),R()};let L=E;if(!g)try{if(h){if(e>1&&(!h.blockNumber||L-h.blockNumber+1nM.resolve(h));return}if(l||(g=!0,await J5(async()=>{l=await on(t,gz,"getTransaction")({hash:r}),l.blockNumber&&(L=l.blockNumber)},{delay:o,retryCount:s}),g=!1),h=await on(t,LM,"getTransactionReceipt")({hash:r}),e>1&&(!h.blockNumber||L-h.blockNumber+1nM.resolve(h))}catch(U){if(U instanceof kF||U instanceof PF){if(!l){g=!1;return}try{d=l,g=!0;const H=await J5(()=>on(t,Mv,"getBlock")({blockNumber:L,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:F})=>F instanceof MF});g=!1;const I=H.transactions.find(({from:F,nonce:K})=>F===d.from&&K===d.nonce);if(!I||(h=await on(t,LM,"getTransactionReceipt")({hash:I.hash}),e>1&&(!h.blockNumber||L-h.blockNumber+1n{var F;(F=M.onReplaced)==null||F.call(M,{reason:T,replacedTransaction:d,transaction:I,transactionReceipt:h}),M.resolve(h)})}catch(H){O(()=>M.reject(H))}}else O(()=>M.reject(U))}}})})})}async function L8e(t,{account:e=t.account,message:r}){if(!e)throw new JE({docsPath:"/docs/actions/wallet/signMessage"});const n=Rc(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?I4(r):r.raw instanceof Uint8Array?d0(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function B8e(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?Rc(a.account):t.account,l=U0({abi:r,args:i,functionName:o});try{const{data:d}=await on(t,gS,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),h=Rg({abi:r,args:i,functionName:o,data:d||"0x"}),g=r.filter(v=>"name"in v&&v.name===e.functionName);return{result:h,request:{abi:g,address:n,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(d){throw $v(d,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}async function U8e(t,e){const{abi:r,account:n=t.account,address:i,args:s,dataSuffix:o,functionName:a,...c}=e;if(!n)throw new JE({docsPath:"/docs/contract/writeContract"});const l=Rc(n),d=U0({abi:r,args:s,functionName:a});try{return await on(t,qF,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:i,account:l,...c})}catch(h){throw $v(h,{abi:r,address:i,args:s,docsPath:"/docs/contract/writeContract",functionName:a,sender:l.address})}}const EC=256;let Ry=EC,Ny;function wz(t=11){if(!Ny||Ry+t>EC*2){Ny="",Ry=0;for(let e=0;e{const E=N(M);for(const L in x)delete E[L];const O={...M,...E};return Object.assign(O,{extend:R(O)})}}return Object.assign(x,{extend:R(x)})}function vS({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){const c=wz();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:k8e(r,{retryCount:n,retryDelay:i,uid:c}),value:a}}function j8e(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>vS({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}function F8e(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 h=t,g=()=>{};const v=vS({key:r,name:n,async request({method:x,params:R}){const M=async(N=0)=>{const E=h[N]({...d,chain:a,retryCount:0,timeout:l});try{const O=await E.request({method:x,params:R});return g({method:x,params:R,response:O,transport:E,status:"success"}),O}catch(O){if(g({error:O,method:x,params:R,transport:E,status:"error"}),z8e(O)||N===h.length-1)throw O;return M(N+1)}};return M()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:x=>g=x,transports:h.map(x=>x({chain:a,retryCount:0}))});if(i){const x=typeof i=="object"?i:{};W8e({chain:a,interval:x.interval??c,onTransports:R=>h=R,sampleCount:x.sampleCount,timeout:x.timeout,transports:h,weights:x.weights})}return v}}function z8e(t){return"code"in t&&typeof t.code=="number"&&(t.code===Z1.code||t.code===hn.code||t.code===5e3)}function W8e({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 h=await Promise.all(s.map(async x=>{const R=x({chain:t,retryCount:0,timeout:i}),M=Date.now();let N,E;try{await R.request({method:"net_listening"}),E=1}catch{E=0}finally{N=Date.now()}return{latency:N-M,success:E}}));l.push(h),l.length>n&&l.shift();const g=Math.max(...l.map(x=>Math.max(...x.map(({latency:R})=>R)))),v=s.map((x,R)=>{const M=l.map(U=>U[R].latency),E=1-M.reduce((U,H)=>U+H,0)/M.length/g,O=l.map(U=>U[R].success),L=O.reduce((U,H)=>U+H,0)/O.length;return L===0?[0,R]:[c*E+a*L,R]}).sort((x,R)=>R[0]-x[0]);r(v.map(([,x])=>s[x])),await Y5(e),d()};d()}class H8e extends Fe{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 V9(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:h})=>{const{batchSize:g=1e3,wait:v=0}=typeof r=="object"?r:{},x=e.retryCount??d,R=h??e.timeout??1e4,M=t||(l==null?void 0:l.rpcUrls.default.http[0]);if(!M)throw new H8e;const N=M8e(M,{fetchOptions:n,onRequest:o,onResponse:a,timeout:R});return vS({key:i,name:s,async request({method:E,params:O}){const L={method:E,params:O},{schedule:U}=fz({id:M,wait:v,shouldSplitBatch(F){return F.length>g},fn:F=>N.request({body:F}),sort:(F,K)=>F.id-K.id}),H=async F=>r?U(F):[await N.request({body:F})],[{error:I,result:T}]=await H(L);if(I)throw new RF({body:L,error:I,url:M});return T},retryCount:x,retryDelay:c,timeout:R,type:"http"},{fetchOptions:n,url:M})}}let K9=!1;async function q8e(t,e={}){var l,d;if(K9)return[];K9=!0,t.setState(h=>({...h,status:h.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const h of e.connectors){let g;typeof h=="function"?g=t._internal.connectors.setup(h):g=h,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[,h]of t.state.connections)i[h.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((h,g)=>(i[h.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const h of s){const g=await h.getProvider().catch(()=>{});if(!g||c.some(R=>R===g)||!await h.isAuthorized())continue;const x=await h.connect({isReconnecting:!0}).catch(()=>null);x&&(h.emitter.off("connect",t._internal.events.connect),h.emitter.on("change",t._internal.events.change),h.emitter.on("disconnect",t._internal.events.disconnect),t.setState(R=>{const M=new Map(o?R.connections:new Map).set(h.uid,{accounts:x.accounts,chainId:x.chainId,connector:h});return{...R,current:o?R.current:h.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:h}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(h=>({...h,status:"connected"})):t.setState(h=>({...h,connections:new Map,current:null,status:"disconnected"}))),K9=!1,a}function V8e(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 K8e(){const t=new Set;let e=[];const r=()=>V8e(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 G8e={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"},Z8e=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 h=o(n.getState());l=g=>{const v=o(g);if(!d(h,v)){const x=h;a(h=v,x)}},c!=null&&c.fireImmediately&&a(h,h)}return i(l)},t(e,r,n)},Q8e=Z8e;function Y8e(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 Dv=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return Dv(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Dv(n)(r)}}}},J8e=(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=Dv(s.serialize),h=()=>{const M=s.partialize({...n()});let N;const E=d({state:M,version:s.version}).then(O=>l.setItem(s.name,O)).catch(O=>{N=O});if(N)throw N;return E},g=i.setState;i.setState=(M,N)=>{g(M,N),h()};const v=t((...M)=>{r(...M),h()},n,i);let x;const R=()=>{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 Dv(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 O;return x=s.merge(E,(O=n())!=null?O:v),r(x,!0),h()}).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:()=>R(),hasHydrated:()=>o,onHydrate:M=>(a.add(M),()=>{a.delete(M)}),onFinishHydration:M=>(c.add(M),()=>{c.delete(M)})},R(),x||v},X8e=(t,e)=>(r,n,i)=>{let s={storage:Y8e(()=>localStorage),partialize:R=>R,version:0,merge:(R,M)=>({...M,...R}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...R)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...R)},n,i);const d=()=>{const R=s.partialize({...n()});return l.setItem(s.name,{state:R,version:s.version})},h=i.setState;i.setState=(R,M)=>{h(R,M),d()};const g=t((...R)=>{r(...R),d()},n,i);let v;const x=()=>{var R,M;if(!l)return;o=!1,a.forEach(E=>{var O;return E((O=n())!=null?O:g)});const N=((M=s.onRehydrateStorage)==null?void 0:M.call(s,(R=n())!=null?R:g))||void 0;return Dv(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 O;return v=s.merge(E,(O=n())!=null?O: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:R=>{s={...s,...R},R.storage&&(l=R.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:R=>(a.add(R),()=>{a.delete(R)}),onFinishHydration:R=>(c.add(R),()=>{c.delete(R)})},s.skipHydration||x(),v||g},exe=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((G8e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),J8e(t,e)):X8e(t,e),txe=exe,rxe={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"},jM=t=>{let e;const r=new Set,n=(c,l)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const h=e;e=l??typeof d!="object"?d:Object.assign({},e,d),r.forEach(g=>g(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{(rxe?"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},G9=t=>t?jM(t):jM;var yz={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,h,g){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new i(d,h||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,h;if(this._eventsCount===0)return l;for(h in d=this._events)e.call(d,h)&&l.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},a.prototype.listeners=function(l){var d=r?r+l:l,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,v=h.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?q8e(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}function oxe(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=it.useRef(!0);return it.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const axe=it.createContext(void 0);function cxe(t){const{children:e,config:r}=t,n={value:r};return it.createElement(oxe,t,it.createElement(axe.Provider,n,e))}var $4=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(){}},D4=typeof window>"u"||"Deno"in globalThis;function Qa(){}function lxe(t,e){return typeof t=="function"?t(e):t}function uxe(t){return typeof t=="number"&&t>=0&&t!==1/0}function dxe(t,e){return Math.max(t+(e||0)-Date.now(),0)}function FM(t,e){return typeof t=="function"?t(e):t}function fxe(t,e){return typeof t=="function"?t(e):t}function zM(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==yS(o,e.options))return!1}else if(!Bv(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 WM(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Lv(e.options.mutationKey)!==Lv(s))return!1}else if(!Bv(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function yS(t,e){return((e==null?void 0:e.queryKeyHashFn)||Lv)(t)}function Lv(t){return JSON.stringify(t,(e,r)=>SC(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Bv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!Bv(t[r],e[r])):!1}function bz(t,e){if(t===e)return t;const r=HM(t)&&HM(e);if(r||SC(t)&&SC(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 pxe(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?bz(t,e):e}function gxe(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function mxe(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var xz=Symbol();function _z(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===xz?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var yh,kd,Xp,EO,wxe=(EO=class extends $4{constructor(){super();Fr(this,yh);Fr(this,kd);Fr(this,Xp);pr(this,Xp,e=>{if(!D4&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Oe(this,kd)||this.setEventListener(Oe(this,Xp))}onUnsubscribe(){var e;this.hasListeners()||((e=Oe(this,kd))==null||e.call(this),pr(this,kd,void 0))}setEventListener(e){var r;pr(this,Xp,e),(r=Oe(this,kd))==null||r.call(this),pr(this,kd,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){Oe(this,yh)!==e&&(pr(this,yh,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof Oe(this,yh)=="boolean"?Oe(this,yh):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},yh=new WeakMap,kd=new WeakMap,Xp=new WeakMap,EO),Cz=new wxe,e1,Pd,t1,SO,vxe=(SO=class extends $4{constructor(){super();Fr(this,e1,!0);Fr(this,Pd);Fr(this,t1);pr(this,t1,e=>{if(!D4&&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,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(this.setOnline.bind(this)))}setOnline(e){Oe(this,e1)!==e&&(pr(this,e1,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return Oe(this,e1)}},e1=new WeakMap,Pd=new WeakMap,t1=new WeakMap,SO),X5=new vxe;function yxe(t){return Math.min(1e3*2**t,3e4)}function Az(t){return(t??"online")==="online"?X5.isOnline():!0}var Ez=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Z9(t){return t instanceof Ez}function Sz(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 Ez(N)),(E=t.abort)==null||E.call(t))},l=()=>{e=!0},d=()=>{e=!1},h=()=>Cz.isFocused()&&(t.networkMode==="always"||X5.isOnline())&&t.canRun(),g=()=>Az(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))},R=()=>new Promise(N=>{var E;i=O=>{(n||h())&&N(O)},(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(O){N=Promise.reject(O)}Promise.resolve(N).then(v).catch(O=>{var T;if(n)return;const L=t.retry??(D4?0:3),U=t.retryDelay??yxe,H=typeof U=="function"?U(r,O):U,I=L===!0||typeof L=="number"&&rh()?void 0:R()).then(()=>{e?x(O):M()})})};return{promise:a,cancel:c,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:d,canStart:g,start:()=>(g()?M():R().then(M),a)}}function bxe(){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 ds=bxe(),bh,IO,Iz=(IO=class{constructor(){Fr(this,bh)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uxe(this.gcTime)&&pr(this,bh,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(D4?1/0:5*60*1e3))}clearGcTimeout(){Oe(this,bh)&&(clearTimeout(Oe(this,bh)),pr(this,bh,void 0))}},bh=new WeakMap,IO),r1,n1,sa,Ki,qv,xh,Ya,au,TO,xxe=(TO=class extends Iz{constructor(e){super();Fr(this,Ya);Fr(this,r1);Fr(this,n1);Fr(this,sa);Fr(this,Ki);Fr(this,qv);Fr(this,xh);pr(this,xh,!1),pr(this,qv,e.defaultOptions),this.setOptions(e.options),this.observers=[],pr(this,sa,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,pr(this,r1,Cxe(this.options)),this.state=e.state??Oe(this,r1),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Oe(this,Ki))==null?void 0:e.promise}setOptions(e){this.options={...Oe(this,qv),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Oe(this,sa).remove(this)}setData(e,r){const n=pxe(this.state.data,e,this.options);return ji(this,Ya,au).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){ji(this,Ya,au).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,i;const r=(n=Oe(this,Ki))==null?void 0:n.promise;return(i=Oe(this,Ki))==null||i.cancel(e),r?r.then(Qa).catch(Qa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Oe(this,r1))}isActive(){return this.observers.some(e=>fxe(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||!dxe(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Ki))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=Oe(this,Ki))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Oe(this,sa).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,Ki)&&(Oe(this,xh)?Oe(this,Ki).cancel({revert:!0}):Oe(this,Ki).cancelRetry()),this.scheduleGc()),Oe(this,sa).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ji(this,Ya,au).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,Ki))return Oe(this,Ki).continueRetry(),Oe(this,Ki).promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(g=>g.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(pr(this,xh,!0),n.signal)})},s=()=>{const h=_z(this.options,r),g={queryKey:this.queryKey,meta:this.meta};return i(g),pr(this,xh,!1),this.options.persister?this.options.persister(h,g,this):h(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,n1,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=o.fetchOptions)==null?void 0:l.meta))&&ji(this,Ya,au).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=h=>{var g,v,x,R;Z9(h)&&h.silent||ji(this,Ya,au).call(this,{type:"error",error:h}),Z9(h)||((v=(g=Oe(this,sa).config).onError)==null||v.call(g,h,this),(R=(x=Oe(this,sa).config).onSettled)==null||R.call(x,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return pr(this,Ki,Sz({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var g,v,x,R;if(h===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(M){a(M);return}(v=(g=Oe(this,sa).config).onSuccess)==null||v.call(g,h,this),(R=(x=Oe(this,sa).config).onSettled)==null||R.call(x,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(h,g)=>{ji(this,Ya,au).call(this,{type:"failed",failureCount:h,error:g})},onPause:()=>{ji(this,Ya,au).call(this,{type:"pause"})},onContinue:()=>{ji(this,Ya,au).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),Oe(this,Ki).start()}},r1=new WeakMap,n1=new WeakMap,sa=new WeakMap,Ki=new WeakMap,qv=new WeakMap,xh=new WeakMap,Ya=new WeakSet,au=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,..._xe(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 Z9(i)&&i.revert&&Oe(this,n1)?{...Oe(this,n1),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),ds.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Oe(this,sa).notify({query:this,type:"updated",action:e})})},TO);function _xe(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Az(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Cxe(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 Qc,kO,Axe=(kO=class extends $4{constructor(e={}){super();Fr(this,Qc);this.config=e,pr(this,Qc,new Map)}build(e,r,n){const i=r.queryKey,s=r.queryHash??yS(i,r);let o=this.get(s);return o||(o=new xxe({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){Oe(this,Qc).has(e.queryHash)||(Oe(this,Qc).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=Oe(this,Qc).get(e.queryHash);r&&(e.destroy(),r===e&&Oe(this,Qc).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ds.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Oe(this,Qc).get(e)}getAll(){return[...Oe(this,Qc).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>zM(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>zM(e,n)):r}notify(e){ds.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){ds.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ds.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qc=new WeakMap,kO),Yc,cs,_h,Jc,pd,PO,Exe=(PO=class extends Iz{constructor(e){super();Fr(this,Jc);Fr(this,Yc);Fr(this,cs);Fr(this,_h);this.mutationId=e.mutationId,pr(this,cs,e.mutationCache),pr(this,Yc,[]),this.state=e.state||Sxe(),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,Yc).includes(e)||(Oe(this,Yc).push(e),this.clearGcTimeout(),Oe(this,cs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){pr(this,Yc,Oe(this,Yc).filter(r=>r!==e)),this.scheduleGc(),Oe(this,cs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Oe(this,Yc).length||(this.state.status==="pending"?this.scheduleGc():Oe(this,cs).remove(this))}continue(){var e;return((e=Oe(this,_h))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,l,d,h,g,v,x,R,M,N,E,O,L,U,H,I;pr(this,_h,Sz({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(T,F)=>{ji(this,Jc,pd).call(this,{type:"failed",failureCount:T,error:F})},onPause:()=>{ji(this,Jc,pd).call(this,{type:"pause"})},onContinue:()=>{ji(this,Jc,pd).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Oe(this,cs).canRun(this)}));const r=this.state.status==="pending",n=!Oe(this,_h).canStart();try{if(!r){ji(this,Jc,pd).call(this,{type:"pending",variables:e,isPaused:n}),await((s=(i=Oe(this,cs).config).onMutate)==null?void 0:s.call(i,e,this));const F=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));F!==this.state.context&&ji(this,Jc,pd).call(this,{type:"pending",context:F,variables:e,isPaused:n})}const T=await Oe(this,_h).start();return await((l=(c=Oe(this,cs).config).onSuccess)==null?void 0:l.call(c,T,e,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,T,e,this.state.context)),await((v=(g=Oe(this,cs).config).onSettled)==null?void 0:v.call(g,T,null,this.state.variables,this.state.context,this)),await((R=(x=this.options).onSettled)==null?void 0:R.call(x,T,null,e,this.state.context)),ji(this,Jc,pd).call(this,{type:"success",data:T}),T}catch(T){try{throw await((N=(M=Oe(this,cs).config).onError)==null?void 0:N.call(M,T,e,this.state.context,this)),await((O=(E=this.options).onError)==null?void 0:O.call(E,T,e,this.state.context)),await((U=(L=Oe(this,cs).config).onSettled)==null?void 0:U.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{ji(this,Jc,pd).call(this,{type:"error",error:T})}}finally{Oe(this,cs).runNext(this)}}},Yc=new WeakMap,cs=new WeakMap,_h=new WeakMap,Jc=new WeakSet,pd=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),ds.batch(()=>{Oe(this,Yc).forEach(n=>{n.onMutationUpdate(e)}),Oe(this,cs).notify({mutation:this,type:"updated",action:e})})},PO);function Sxe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var co,Vv,RO,Ixe=(RO=class extends $4{constructor(e={}){super();Fr(this,co);Fr(this,Vv);this.config=e,pr(this,co,new Map),pr(this,Vv,Date.now())}build(e,r,n){const i=new Exe({mutationCache:this,mutationId:++W3(this,Vv)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){const r=My(e),n=Oe(this,co).get(r)??[];n.push(e),Oe(this,co).set(r,n),this.notify({type:"added",mutation:e})}remove(e){var n;const r=My(e);if(Oe(this,co).has(r)){const i=(n=Oe(this,co).get(r))==null?void 0:n.filter(s=>s!==e);i&&(i.length===0?Oe(this,co).delete(r):Oe(this,co).set(r,i))}this.notify({type:"removed",mutation:e})}canRun(e){var n;const r=(n=Oe(this,co).get(My(e)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}runNext(e){var n;const r=(n=Oe(this,co).get(My(e)))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){ds.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...Oe(this,co).values()].flat()}find(e){const r={exact:!0,...e};return this.getAll().find(n=>WM(r,n))}findAll(e={}){return this.getAll().filter(r=>WM(e,r))}notify(e){ds.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return ds.batch(()=>Promise.all(e.map(r=>r.continue().catch(Qa))))}},co=new WeakMap,Vv=new WeakMap,RO);function My(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function VM(t){return{onFetch:(e,r)=>{var d,h,g,v,x;const n=e.options,i=(g=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.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 R=!1;const M=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(e.signal.aborted?R=!0:e.signal.addEventListener("abort",()=>{R=!0}),e.signal)})},N=_z(e.options,e.fetchOptions),E=async(O,L,U)=>{if(R)return Promise.reject();if(L==null&&O.pages.length)return Promise.resolve(O);const H={queryKey:e.queryKey,pageParam:L,direction:U?"backward":"forward",meta:e.options.meta};M(H);const I=await N(H),{maxPages:T}=e.options,F=U?mxe:gxe;return{pages:F(O.pages,I,T),pageParams:F(O.pageParams,L,T)}};if(i&&s.length){const O=i==="backward",L=O?Txe:KM,U={pages:s,pageParams:o},H=L(n,U);a=await E(U,H,O)}else{const O=t??s.length;do{const L=c===0?o[0]??n.initialPageParam:KM(n,a);if(c>0&&L==null)break;a=await E(a,L),c++}while(c{var R,M;return(M=(R=e.options).persister)==null?void 0:M.call(R,l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=l}}}function KM(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 Txe(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 Nn,Rd,Nd,i1,s1,Md,o1,a1,NO,kxe=(NO=class{constructor(t={}){Fr(this,Nn);Fr(this,Rd);Fr(this,Nd);Fr(this,i1);Fr(this,s1);Fr(this,Md);Fr(this,o1);Fr(this,a1);pr(this,Nn,t.queryCache||new Axe),pr(this,Rd,t.mutationCache||new Ixe),pr(this,Nd,t.defaultOptions||{}),pr(this,i1,new Map),pr(this,s1,new Map),pr(this,Md,0)}mount(){W3(this,Md)._++,Oe(this,Md)===1&&(pr(this,o1,Cz.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,Nn).onFocus())})),pr(this,a1,X5.subscribe(async t=>{t&&(await this.resumePausedMutations(),Oe(this,Nn).onOnline())})))}unmount(){var t,e;W3(this,Md)._--,Oe(this,Md)===0&&((t=Oe(this,o1))==null||t.call(this),pr(this,o1,void 0),(e=Oe(this,a1))==null||e.call(this),pr(this,a1,void 0))}isFetching(t){return Oe(this,Nn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Oe(this,Rd).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Oe(this,Nn).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,Nn).build(this,r);return t.revalidateIfStale&&n.isStaleByTime(FM(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(e)}}getQueriesData(t){return Oe(this,Nn).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,Nn).get(n.queryHash),s=i==null?void 0:i.state.data,o=lxe(e,s);if(o!==void 0)return Oe(this,Nn).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return ds.batch(()=>Oe(this,Nn).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,Nn).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=Oe(this,Nn);ds.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=Oe(this,Nn),n={type:"active",...t};return ds.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(n,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},n=ds.batch(()=>Oe(this,Nn).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(Qa).catch(Qa)}invalidateQueries(t={},e={}){return ds.batch(()=>{if(Oe(this,Nn).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=ds.batch(()=>Oe(this,Nn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Qa)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Qa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=Oe(this,Nn).build(this,e);return r.isStaleByTime(FM(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Qa).catch(Qa)}fetchInfiniteQuery(t){return t.behavior=VM(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Qa).catch(Qa)}ensureInfiniteQueryData(t){return t.behavior=VM(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return X5.isOnline()?Oe(this,Rd).resumePausedMutations():Promise.resolve()}getQueryCache(){return Oe(this,Nn)}getMutationCache(){return Oe(this,Rd)}getDefaultOptions(){return Oe(this,Nd)}setDefaultOptions(t){pr(this,Nd,t)}setQueryDefaults(t,e){Oe(this,i1).set(Lv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Oe(this,i1).values()];let r={};return e.forEach(n=>{Bv(t,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(t,e){Oe(this,s1).set(Lv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Oe(this,s1).values()];let r={};return e.forEach(n=>{Bv(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Oe(this,Nd).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=yS(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===xz&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Oe(this,Nd).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Oe(this,Nn).clear(),Oe(this,Rd).clear()}},Nn=new WeakMap,Rd=new WeakMap,Nd=new WeakMap,i1=new WeakMap,s1=new WeakMap,Md=new WeakMap,o1=new WeakMap,a1=new WeakMap,NO),Tz=it.createContext(void 0),aTe=t=>{const e=it.useContext(Tz);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Pxe=({client:t,children:e})=>(it.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),ze.jsx(Tz.Provider,{value:t,children:e}));function kz(t,e){return`https://rpc.walletconnect.org/v1/?chainId=${e}:${t}`}const Pz={id:"eip155:1",chainId:1,name:"Ethereum",currency:"ETH",explorerUrl:"https://etherscan.io",rpcUrl:kz(1,"eip155"),chainNamespace:"eip155"},Rz={id:"eip155:10",chainId:10,name:"Optimism",currency:"ETH",explorerUrl:"https://optimistic.etherscan.io",rpcUrl:kz(10,"eip155"),chainNamespace:"eip155"};function Ji(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 db="2.13.7",Rxe=()=>`@wagmi/core@${db}`;var Nz=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)},e6,Mz;class xc extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Rxe()}constructor(e,r={}){var s;super(),e6.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 xc?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof xc&&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 Nz(this,e6,"m",Mz).call(this,this,e)}}e6=new WeakSet,Mz=function t(e,r){return r!=null&&r(e)?e:e.cause?Nz(this,e6,"m",t).call(this,e.cause,r):e};class m0 extends xc{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Nxe extends xc{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Oz extends xc{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Mxe extends xc{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 Oxe extends xc{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 $xe extends xc{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 GM(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 Nxe;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 B2(t,e={}){let r;if(e.connector){const{connector:l}=e;if(t.state.status==="reconnecting"&&!l.getAccounts&&!l.getChainId)throw new $xe({connector:l});const[d,h]=await Promise.all([l.getAccounts(),l.getChainId()]);r={accounts:d,chainId:h,connector:l}}else r=t.state.connections.get(t.state.current);if(!r)throw new Oz;const n=e.chainId??r.chainId,i=await r.connector.getChainId();if(i!==r.chainId)throw new Oxe({connectionChainId:r.chainId,connectorChainId:i});const s=r.connector;if(s.getClient)return s.getClient({chainId:n});const o=Rc(e.account??r.accounts[0]);if(o.address=zs(o.address),e.account&&!r.accounts.some(l=>l.toLowerCase()===o.address.toLowerCase()))throw new Mxe({address:o.address,connector:s});const a=t.chains.find(l=>l.id===n),c=await r.connector.getProvider({chainId:n});return vz({account:o,chain:a,name:"Connector Client",transport:l=>j8e(c)({...l,retryCount:0})})}async function Dxe(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 Lxe(t,e){const{chainId:r,connector:n,...i}=e;let s;e.account?s=e.account:s=(await B2(t,{account:e.account,chainId:r,connector:n})).account;const o=t.getClient({chainId:r});return Ji(o,oS,"estimateGas")({...i,account:s})}function $z(t){return typeof t=="number"?t:t==="wei"?0:Math.abs(Q5e[t])}function U2(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 Bxe(t,e){const{allowFailure:r=!0,chainId:n,contracts:i,...s}=e,o=t.getClient({chainId:n});return Ji(o,A8e,"multicall")({allowFailure:r,contracts:i,...s})}function Uxe(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,g0,"readContract")(n)}async function jxe(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])=>Bxe(t,{...s,allowFailure:r,blockNumber:n,blockTag:i,chainId:Number.parseInt(g),contracts:v.map(({contract:x})=>x)})),d=(await Promise.all(l())).flat(),h=Object.values(c).flatMap(g=>g.map(({index:v})=>v));return d.reduce((g,v,x)=>(g&&(g[h[x]]=v),g),[])}catch(c){if(c instanceof dS)throw c;const l=()=>o.map(d=>Uxe(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 Fxe(t,e){const{address:r,blockNumber:n,blockTag:i,chainId:s,token:o,unit:a="ether"}=e;if(o)try{return ZM(t,{balanceAddress:r,chainId:s,symbolType:"string",tokenAddress:o})}catch(g){if(g instanceof dS){const v=await ZM(t,{balanceAddress:r,chainId:s,symbolType:"bytes32",tokenAddress:o}),x=dF(kg(v.symbol,{dir:"right"}));return{...v,symbol:x}}throw g}const c=t.getClient({chainId:s}),d=await Ji(c,UF,"getBalance")(n?{address:r,blockNumber:n}:{address:r,blockTag:i}),h=t.chains.find(g=>g.id===s)??c.chain;return{decimals:h.nativeCurrency.decimals,formatted:$2(d,$z(a)),symbol:h.nativeCurrency.symbol,value:d}}async function ZM(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 jxe(t,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[r],chainId:n},{...a,functionName:"decimals",chainId:n},{...a,functionName:"symbol",chainId:n}]}),h=$2(c??"0",$z(o??l));return{decimals:l,formatted:h,symbol:d,value:c}}function Uv(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(!Uv(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&&!Uv(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let Oy=[];function zxe(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||Uv(Oy,e)?Oy:(Oy=e,e)}let Q9=[];function Wxe(t){const e=t.connectors;return Uv(Q9,e)?Q9:(Q9=e,e)}function Hxe(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,X4e,"getEnsAddress")(n)}function QM(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,h8e,"getEnsAvatar")(n)}function qxe(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return Ji(i,p8e,"getEnsName")(n)}async function Vxe(t,e){const{account:r,chainId:n,...i}=e,s=r??U2(t).address,o=t.getClient({chainId:n});return Ji(o,cS,"prepareTransactionRequest")({...i,...s?{account:s}:{}})}let Y9=!1;async function YM(t,e={}){var l,d;if(Y9)return[];Y9=!0,t.setState(h=>({...h,status:h.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const h of e.connectors){let g;typeof h=="function"?g=t._internal.connectors.setup(h):g=h,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[,h]of t.state.connections)i[h.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((h,g)=>(i[h.id]??10)-(i[g.id]??10)):r;let o=!1;const a=[],c=[];for(const h of s){const g=await h.getProvider().catch(()=>{});if(!g||c.some(R=>R===g)||!await h.isAuthorized())continue;const x=await h.connect({isReconnecting:!0}).catch(()=>null);x&&(h.emitter.off("connect",t._internal.events.connect),h.emitter.on("change",t._internal.events.change),h.emitter.on("disconnect",t._internal.events.disconnect),t.setState(R=>{const M=new Map(o?R.connections:new Map).set(h.uid,{accounts:x.accounts,chainId:x.chainId,connector:h});return{...R,current:o?R.current:h.uid,connections:M}}),a.push({accounts:x.accounts,chainId:x.chainId,connector:h}),c.push(g),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(h=>({...h,status:"connected"})):t.setState(h=>({...h,connections:new Map,current:null,status:"disconnected"}))),Y9=!1,a}async function Kxe(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 B2(t,{account:r,chainId:n,connector:i});const{connector:c}=U2(t),l=await(async()=>{var g;if(!(!("data"in e)||!e.data)&&!((g=i??c)!=null&&g.supportsSimulation)&&s!==null)return s===void 0?Ji(a,oS,"estimateGas")({...o,account:r,chain:n?{id:n}:null}):s})();return await Ji(a,qF,"sendTransaction")({...o,...r?{account:r}:{},gas:l,chain:n?{id:n}:null})}async function Gxe(t,e){const{account:r,connector:n,...i}=e;let s;return typeof r=="object"&&r.type==="local"?s=t.getClient():s=await B2(t,{account:r,connector:n}),Ji(s,L8e,"signMessage")({...i,...r?{account:r}:{}})}async function Zxe(t,e){const{abi:r,chainId:n,connector:i,...s}=e;let o;e.account?o=e.account:o=(await B2(t,{chainId:n,connector:i})).account;const a=t.getClient({chainId:n}),c=Ji(a,B8e,"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 Qxe(t,e){var i;const{connector:r}=e,n=t.state.connections.get(r.uid);if(!n)throw new Oz;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 xd extends xc{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class Yxe extends xc{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 Jxe(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 Yxe({connector:a});return await a.switchChain({addEthereumChainParameter:r,chainId:n})}const s=t.chains.find(a=>a.id===n);if(!s)throw new m0;return t.setState(a=>({...a,chainId:n})),s}function Xxe(t,e){const{onChange:r}=e;return t.subscribe(()=>U2(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return Uv(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 e9e(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}async function t9e(t,e){const{chainId:r,timeout:n=0,...i}=e,s=t.getClient({chainId:r}),a=await Ji(s,D8e,"waitForTransactionReceipt")({...i,timeout:n});if(a.status==="reverted"){const l=await Ji(s,gz,"getTransaction")({hash:a.transactionHash}),h=await Ji(s,gS,"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=h!=null&&h.data?dF(`0x${h.data.substring(138)}`):"unknown reason";throw new Error(g)}return{...a,chainId:s.chain.id}}async function r9e(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 B2(t,{account:r,chainId:n,connector:i});const{connector:c}=U2(t);let l;if(s==="prepared"||c!=null&&c.supportsSimulation)l=o;else{const{request:g}=await Zxe(t,{...o,account:r,chainId:n});l=g}return await Ji(a,U8e,"writeContract")({...l,...r?{account:r}:{},chain:n?{id:n}:null})}const n9e=/(rabby|trustwallet)/,i9e={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:fb(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return fb(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:fb(t,"isPhantom")}}};L4.type="injected";function L4(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"?{...i9e[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 n9e.test(this.id.toLowerCase())},type:L4.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,R,M,N,E;const h=await this.getProvider();if(!h)throw new xd;let g=[];if(d)g=await this.getAccounts().catch(()=>[]);else if(e)try{g=(M=(R=(x=(v=(await h.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:v.caveats)==null?void 0:x[0])==null?void 0:R.value)==null?void 0:M.map(L=>zs(L)),g.length>0&&(g=await this.getAccounts())}catch(O){const L=O;if(L.code===hn.code)throw new hn(L);if(L.code===Yd.code)throw L}try{!(g!=null&&g.length)&&!d&&(g=(await h.request({method:"eth_requestAccounts"})).map(U=>zs(U))),o&&(h.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),h.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),h.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),h.on("disconnect",a));let O=await this.getChainId();if(l&&O!==l){const L=await this.switchChain({chainId:l}).catch(U=>{if(U.code===hn.code)throw U;return{id:O}});O=(L==null?void 0:L.id)??O}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:O}}catch(O){const L=O;throw L.code===hn.code?new hn(L):L.code===Yd.code?new Yd(L):L}},async disconnect(){var d,h;const l=await this.getProvider();if(!l)throw new xd;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 mz(()=>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((h=c.storage)==null?void 0:h.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new xd;return(await l.request({method:"eth_accounts"})).map(h=>zs(h))},async getChainId(){const l=await this.getProvider();if(!l)throw new xd;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=fb(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()),R=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()),R))]))return!0}throw new xd}return!!(await J5(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){var v,x,R,M;const h=await this.getProvider();if(!h)throw new xd;const g=c.chains.find(N=>N.id===d);if(!g)throw new Js(new m0);try{return await Promise.all([h.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:O,...L}=g.blockExplorers??{};let U;l!=null&&l.blockExplorerUrls?U=l.blockExplorerUrls:O&&(U=[O.url,...Object.values(L).map(F=>F.url)]);let H;(R=l==null?void 0:l.rpcUrls)!=null&&R.length?H=l.rpcUrls:H=[((M=g.rpcUrls.default)==null?void 0:M.http[0])??""];const I={blockExplorerUrls:U,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 h.request({method:"wallet_addEthereumChain",params:[I]}),await this.getChainId()!==d)throw new hn(new Error("User rejected switch after adding network."));return g}catch(O){throw new hn(O)}throw E.code===hn.code?new hn(E):new Js(E)}},async onAccountsChanged(l){var d;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const h=(await this.getChainId()).toString();this.onConnect({chainId:h}),e&&await((d=c.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(h=>zs(h))})},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 h=Number(l.chainId);c.emitter.emit("connect",{accounts:d,chainId:h});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 fb(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 ixe})}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 o9e(t){return new s9e(t)}function a9e(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 JM(t,e){return t.slice(0,e).join(".")||"."}function XM(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 u9e(t){const{deserialize:e=a9e,key:r="wagmi",serialize:n=l9e,storage:i=Dz}=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 Dz={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},IC=256;let $y=IC,Dy;function d9e(t=11){if(!Dy||$y+t>IC*2){Dy="",$y=0;for(let e=0;es.chains),c=G9(()=>[...s.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(d))??[]].map(l));function l(U){var T;const H=o9e(d9e()),I={...U({emitter:H,chains:a.getState(),storage:r,transports:s.transports}),emitter:H,uid:H.uid};return H.on("connect",O),(T=I.setup)==null||T.call(I),I}function d(U){const{info:H}=U,I=U.provider;return L4({target:{...H,id:H.rdns,provider:I}})}const h=new Map;function g(U={}){const H=U.chainId??M.getState().chainId,I=a.getState().find(F=>F.id===H);if(U.chainId&&!I)throw new m0;{const F=h.get(M.getState().chainId);if(F&&!I)return F;if(!I)throw new m0}{const F=h.get(H);if(F)return F}let T;if(s.client)T=s.client({chain:I});else{const F=I.id,K=a.getState().map(p=>p.id),B={},_=Object.entries(s);for(const[p,m]of _)if(!(p==="chains"||p==="client"||p==="connectors"||p==="transports"))if(typeof m=="object")if(F in m)B[p]=m[F];else{if(K.some(A=>A in m))continue;B[p]=m}else B[p]=m;T=vz({...B,chain:I,batch:B.batch??{multicall:!0},transport:p=>s.transports[F]({...p,connectors:c})})}return h.set(H,T),T}function v(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let x;const R="0.0.0-canary-";db.startsWith(R)?x=Number.parseInt(db.replace(R,"")):x=Number.parseInt(db.split(".")[0]??"0");const M=G9(Q8e(r?txe(v,{migrate(U,H){if(H===x)return U;const I=v(),T=N(U,I.chainId);return{...I,chainId:T}},name:"store",partialize(U){return{connections:{__type:"Map",value:Array.from(U.connections.entries()).map(([H,I])=>{const{id:T,name:F,type:K,uid:B}=I.connector;return[H,{...I,connector:{id:T,name:F,type:K,uid:B}}]})},chainId:U.chainId,current:U.current}},merge(U,H){typeof U=="object"&&U&&"status"in U&&delete U.status;const I=N(U,H.chainId);return{...H,...U,chainId:I}},skipHydration:i,storage:r,version:x}):v));function N(U,H){return U&&typeof U=="object"&&"chainId"in U&&typeof U.chainId=="number"&&a.getState().some(I=>I.id===U.chainId)?U.chainId:H}n&&M.subscribe(({connections:U,current:H})=>{var I;return H?(I=U.get(H))==null?void 0:I.chainId:void 0},U=>{if(a.getState().some(I=>I.id===U))return M.setState(I=>({...I,chainId:U??I.chainId}))}),o==null||o.subscribe(U=>{const H=new Map;for(const T of c.getState())H.set(T.id,!0);const I=[];for(const T of U){const F=l(d(T));H.has(F.id)||I.push(F)}r&&!M.persist.hasHydrated()||c.setState(T=>[...T,...I],!0)});function E(U){M.setState(H=>{const I=H.connections.get(U.uid);return I?{...H,connections:new Map(H.connections).set(U.uid,{accounts:U.accounts??I.accounts,chainId:U.chainId??I.chainId,connector:I.connector})}:H})}function O(U){M.getState().status==="connecting"||M.getState().status==="reconnecting"||M.setState(H=>{const I=c.getState().find(T=>T.uid===U.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(U.uid,{accounts:U.accounts,chainId:U.chainId,connector:I}),current:U.uid,status:"connected"}):H})}function L(U){M.setState(H=>{const I=H.connections.get(U.uid);if(I){const F=I.connector;F.emitter.listenerCount("change")&&I.connector.emitter.off("change",E),F.emitter.listenerCount("disconnect")&&I.connector.emitter.off("disconnect",L),F.emitter.listenerCount("connect")||I.connector.emitter.on("connect",O)}if(H.connections.delete(U.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(U){let H;typeof U=="function"?H=U(M.getState()):H=U;const I=v();typeof H!="object"&&(H=I),Object.keys(I).some(F=>!(F in H))&&(H=I),M.setState(H,!0)},subscribe(U,H,I){return M.subscribe(U,H,I?{...I,fireImmediately:I.emitImmediately}:void 0)},_internal:{mipd:o,store:M,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(U){const H=typeof U=="function"?U(a.getState()):U;if(H.length!==0)return a.setState(H,!0)},subscribe(U){return a.subscribe(U)}},connectors:{providerDetailToConnector:d,setup:l,setState(U){return c.setState(typeof U=="function"?U(c.getState()):U,!0)},subscribe(U){return c.subscribe(U)}},events:{change:E,connect:O,disconnect:L}}}}const eO=R8e({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 h9e(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 p9e(){return{supportsAllNetworks:!0,approvedCaipNetworkIds:ua.WalletConnectRpcChainIds.map(t=>`${cr.EIP155}:${t}`)}}function g9e({chain:t,projectId:e}){var i,s;const r=Be.getBlockchainApiUrl(),n=(s=(i=t.rpcUrls[0])==null?void 0:i.http)==null?void 0:s[0];return ua.WalletConnectRpcChainIds.includes(t.id)?F8e([V9(`${r}/v1/?chainId=${cr.EIP155}:${t.id}&projectId=${e}`,{fetchOptions:{headers:{"Content-Type":"text/plain"}}}),V9(n)]):V9(n)}function tO(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 Lz(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 m9e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/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 rO=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),nO=4;function w9e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let U=1;U>--c&1}const h=31,g=2**h,v=g>>>1,x=v>>1,R=g-1;let M=0;for(let U=0;U1;){let K=H+I>>>1;U>>1|d(),T=T<<1^v,F=(F^v)<<1|v|1;E=T,O=1+F-T}let L=n-4;return N.map(U=>{switch(U-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 U-1}})}function v9e(t){let e=0;return()=>t[e++]}function Bz(t){return v9e(w9e(y9e(t)))}function y9e(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 b9e(t){return t&1?~t>>1:t>>1}function x9e(t,e){let r=Array(t);for(let n=0,i=0;n{let e=jv(t);if(e.length)return e})}function jz(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(_9e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(C9e(r,t))}return e.flat()}function Fv(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function Fz(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(s));return n}function _9e(t,e){let r=1+e(),n=e(),i=Fv(e);return Fz(i.length,1+t,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((d,h)=>{let g=h*n;return[c+h*r,l.map(v=>v+g)]})})}function C9e(t,e){let r=1+e();return Fz(r,1+t,e).map(i=>[i[0],i.slice(1)])}function A9e(t){let e=[],r=jv(t);return i(n([]),[]),e;function n(s){let o=t(),a=Fv(()=>{let c=jv(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 E9e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function zz(t){return`{${E9e(t)}}`}function S9e(t){let e=[];for(let r=0,n=t.length;r>24&255}function qz(t){return t&16777215}let TC,iO,kC,hb;function O9e(){let t=Bz(T9e);TC=new Map(Uz(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),iO=new Set(jv(t)),kC=new Map,hb=new Map;for(let[e,r]of jz(t)){if(!iO.has(e)&&r.length==2){let[n,i]=r,s=hb.get(n);s||(s=new Map,hb.set(n,s)),s.set(i,e)}kC.set(e,r.reverse())}}function Vz(t){return t>=zv&&t=t6&&t=r6&&en6&&e0&&i(n6+l)}else{let o=kC.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Dm(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=$9e(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 Gz(t){return Kz(t).map(qz)}function L9e(t){return D9e(Kz(t))}const sO=45,Zz=".",Qz=65039,Yz=1,$p=t=>Array.from(t);function Wv(t,e){return t.P.has(e)||t.Q.has(e)}class B9e extends Array{get is_emoji(){return!0}}let PC,Jz,wh,RC,Xz,Yp,J9,mp,eW,oO,NC;function bS(){if(PC)return;let t=Bz(m9e);const e=()=>jv(t),r=()=>new Set(e());PC=new Map(jz(t)),Jz=r(),wh=e(),RC=new Set(e().map(d=>wh[d])),wh=new Set(wh),Xz=r(),r();let n=Uz(t),i=t();const s=()=>new Set(e().flatMap(d=>n[d]).concat(e()));Yp=Fv(d=>{let h=Fv(t).map(g=>g+96);if(h.length){let g=d>=i;h[0]-=32,h=Y1(h),g&&(h=`Restricted[${h}]`);let v=s(),x=s(),R=!t();return{N:h,P:v,Q:x,M:R,R:g}}}),J9=r(),mp=new Map;let o=e().concat($p(J9)).sort((d,h)=>d-h);o.forEach((d,h)=>{let g=t(),v=o[h]=g?o[h-g]:{V:[],M:new Map};v.V.push(d),J9.has(d)||mp.set(d,v)});for(let{V:d,M:h}of new Set(mp.values())){let g=[];for(let x of d){let R=Yp.filter(N=>Wv(N,x)),M=g.find(({G:N})=>R.some(E=>N.has(E)));M||(M={G:new Set,V:[]},g.push(M)),M.V.push(x),R.forEach(N=>M.G.add(N))}let v=g.flatMap(x=>$p(x.G));for(let{G:x,V:R}of g){let M=new Set(v.filter(N=>!x.has(N)));for(let N of R)h.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 Yp){for(let h of d.P)l(h);for(let h of d.Q)l(h)}for(let d of a)!mp.has(d)&&!c.has(d)&&mp.set(d,Yz);eW=new Set($p(a).concat($p(Gz(a)))),oO=A9e(t).map(d=>B9e.from(d)).sort(I9e),NC=new Map;for(let d of oO){let h=[NC];for(let g of d){let v=h.map(x=>{let R=x.get(g);return R||(R=new Map,x.set(g,R)),R});g===Qz?h.push(...v):h=v}for(let g of h)g.V=d}}function xS(t){return(tW(t)?"":`${_S(B4([t]))} `)+zz(t)}function _S(t){return`"${t}"‎`}function U9e(t){if(t.length>=4&&t[2]==sO&&t[3]==sO)throw new Error(`invalid label extension: "${Y1(t.slice(0,4))}"`)}function j9e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function F9e(t){let e=t[0],r=rO.get(e);if(r)throw sw(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s{let s=S9e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=Z9e(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let d=o.output=a.flat();if(j9e(d),!(o.emoji=c>1||a[0].is_emoji)&&d.every(g=>g<128))U9e(d),l="ASCII";else{let g=a.flatMap(v=>v.is_emoji?[]:v);if(!g.length)l="Emoji";else{if(wh.has(d[0]))throw sw("leading combining mark");for(let R=1;Ro.has(a)):$p(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Wv(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function V9e(t){let e=Yp;for(let r of t){let n=e.filter(i=>Wv(i,r));if(!n.length)throw Yp.some(i=>Wv(i,r))?nW(e[0],r):rW(r);if(e=n,n.length==1)break}return e}function K9e(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 ${_S(B4(e))}: ${i}`)}return Y1(n)}).join(Zz)}function rW(t){return new Error(`disallowed character: ${xS(t)}`)}function nW(t,e){let r=xS(e),n=Yp.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function sw(t){return new Error(`illegal placement: ${t}`)}function G9e(t,e){for(let r of e)if(!Wv(t,r))throw nW(t,r);if(t.M){let r=Gz(e);for(let n=1,i=r.length;nnO)throw new Error(`excessive non-spacing marks: ${_S(B4(r.slice(n-1,s)))} (${s-n}/${nO})`);n=s}}}function Z9e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=Y9e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(eW.has(o))i.push(o);else{let a=PC.get(o);if(a)i.push(...a);else if(!Jz.has(o))throw rW(o)}}}return i.length&&n.push(e(i)),n}function Q9e(t){return t.filter(e=>e!=Qz)}function Y9e(t,e){let r=NC,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 aO(t){return W9e(t)}CS.type="walletConnect";function CS(t,e){const r=t.isNewChainsStale??!0;let n,i,s,o,a,c,l,d;return h=>({id:"walletConnect",name:"WalletConnect",type:CS.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 xd;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=Dj.createNamespaces(t.networks);await v.connect({optionalNamespaces:N,..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(t.networks.map(E=>Number(E.chainId)))}const R=(await v.enable()).map(N=>zs(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:R,chainId:M}}catch(v){throw/(user rejected|connection request reset)/i.test(v==null?void 0:v.message)?new hn(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 R,M,N;const g=await this.getProvider();if(!((R=g==null?void 0:g.session)!=null&&R.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 R,M,N;async function v(){var L;if(!t.networks.map(U=>Number(U.chainId)).length)return;const O=(L=e.universalAdapter)==null?void 0:L.getWalletConnectProvider();if(!O)throw new Error("Provider not found");return O}n||(i||(i=v()),n=await i,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY));const x=(R=e.getCaipNetwork())==null?void 0:R.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,O;const g=(M=e.getCaipNetwork())==null?void 0:M.chainId;if(g)return g;const x=(O=(E=(N=(await this.getProvider()).session)==null?void 0:N.namespaces.eip155)==null?void 0:E.chains)==null?void 0:O[0],R=t.networks.find(L=>L.id===x);return R==null?void 0:R.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 xd;const R=t.networks.find(O=>O.chainId===v),[M]=R?Lz([R]):[];if(!M)throw new Js(new m0);try{R!=null&&R.id&&x.setDefaultChain(R==null?void 0:R.id),await x.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(v)}]}),h.emitter.emit("change",{chainId:Number(v)});const O=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...O,v]),M}catch(O){const L=O;if(/(?:user rejected)/iu.test(L.message))throw new hn(L);try{let U;g!=null&&g.blockExplorerUrls?U=g.blockExplorerUrls:U=(N=M.blockExplorers)!=null&&N.default.url?[(E=M.blockExplorers)==null?void 0:E.default.url]:[];const H={blockExplorerUrls:U,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(U){throw new hn(U)}}},onAccountsChanged(g){g.length===0?this.onDisconnect():h.emitter.emit("change",{accounts:g.map(v=>zs(v))})},onChainChanged(g){const v=Number(g);h.emitter.emit("change",{chainId:v})},async onConnect(g){const v=Number(g.chainId),x=await this.getAccounts();h.emitter.emit("connect",{accounts:x,chainId:v})},async onDisconnect(g){this.setRequestedChainsIds([]),h.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){h.emitter.emit("message",{type:"display_uri",data:g})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var x,R,M;if(!((x=n==null?void 0:n.session)!=null&&x.namespaces))return[];const g=(M=(R=n==null?void 0:n.session)==null?void 0:R.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=h.storage)==null?void 0:v.getItem(this.requestedChainsStorageKey))??[];return[...new Set(g)]},async isChainsStale(){if(!r)return!1;const g=h.chains.map(R=>R.id),v=this.getNamespaceChainsIds();if(v.length&&!v.some(R=>g.includes(R)))return!1;const x=await this.getRequestedChainsIds();return!g.every(R=>x.includes(Number(R)))},async setRequestedChainsIds(g){var v;await((v=h.storage)==null?void 0:v.setItem(this.requestedChainsStorageKey,g))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}U4.type="coinbaseWallet";function U4(t={}){return t.version==="3"||t.headlessMode?X9e(t):J9e(t)}function J9e(t){let e,r,n,i,s;return o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:U4.type,async connect({chainId:a}={}){try{const c=await this.getProvider(),l=(await c.request({method:"eth_requestAccounts"})).map(h=>zs(h));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 h=await this.switchChain({chainId:a}).catch(g=>{if(g.code===hn.code)throw g;return{id:d}});d=(h==null?void 0:h.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 hn(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=>zs(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 Dn(async()=>{const{default:l}=await import("./index-CD5LSkva.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 h,g,v,x;const l=o.chains.find(R=>R.id===c);if(!l)throw new Js(new m0);const d=await this.getProvider();try{return await d.request({method:"wallet_switchEthereumChain",params:[{chainId:gr(l.id)}]}),l}catch(R){if(R.code===4902)try{let M;a!=null&&a.blockExplorerUrls?M=a.blockExplorerUrls:M=(h=l.blockExplorers)!=null&&h.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 hn(M)}throw new Js(R)}},onAccountsChanged(a){a.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:a.map(c=>zs(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 X9e(t){let r,n,i,s,o;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:U4.type,async connect({chainId:c}={}){try{const l=await this.getProvider(),d=(await l.request({method:"eth_requestAccounts"})).map(g=>zs(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 h=await this.getChainId();if(c&&h!==c){const g=await this.switchChain({chainId:c}).catch(v=>{if(v.code===hn.code)throw v;return{id:h}});h=(g==null?void 0:g.id)??h}return{accounts:d,chainId:h}}catch(l){throw/(user closed modal|accounts received is empty|user denied account)/i.test(l.message)?new hn(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=>zs(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 Dn(async()=>{const{default:R}=await import("./index-F-gjaB_2.js").then(M=>M.i);return{default:R}},__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(),h=a.chains.find(x=>t.chainId?x.id===t.chainId:x.id===d)||a.chains[0],g=t.chainId||(h==null?void 0:h.id),v=t.jsonRpcUrl||(h==null?void 0:h.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,R;const d=a.chains.find(M=>M.id===l);if(!d)throw new Js(new m0);const h=await this.getProvider();try{return await h.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=[((R=d.rpcUrls.default)==null?void 0:R.http[0])??""];const O={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 h.request({method:"wallet_addEthereumChain",params:[O]}),d}catch(N){throw new hn(N)}throw new Js(M)}},onAccountsChanged(c){c.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:c.map(l=>zs(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 ow{constructor(){}static getInstance(e,r){return ow.instance||(ow.instance=new ire(e,r)),ow.instance}}function e7e(t){function e(r){return Ga.parseEvmChainId(r)||1}return r=>({id:cr.AUTH_CONNECTOR_ID,name:"AppKit Auth",type:"w3mAuth",chain:yn.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=ow.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 Js(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 Js(i):i}},onAccountsChanged(n){n.length===0?this.onDisconnect():r.emitter.emit("change",{accounts:n.map(zs)})},onChainChanged(n){const i=Number(n);r.emitter.emit("change",{chainId:i})},async onDisconnect(n){await(await this.getProvider()).disconnect()}})}const t7e=["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 r7e{constructor(e){var s,o,a;this.appKit=void 0,this.options=void 0,this.chainNamespace=yn.CHAIN.EVM,this.defaultCaipNetwork=void 0,this.tokens=vP.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:Sw.extendRpcUrlWithProjectId(c.rpcUrl,e.projectId)})),this.wagmiChains=Lz(this.caipNetworks.filter(c=>c.chainNamespace===yn.CHAIN.EVM));const r=this.wagmiChains.map(c=>[c.id,g9e({chain:c,projectId:e.projectId})]),n=Object.fromEntries(r),i=[...e.connectors??[]];this.wagmiConfig=f9e({...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,h,g;const n=[];e.enableWalletConnect!==!1&&n.push(CS(e,r)),e.enableInjected!==!1&&n.push(L4({shimDisconnect:!0})),e.enableCoinbase!==!1&&n.push(U4({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?Sn.DEFAULT_FEATURES.email:(l=e.features)==null?void 0:l.email,s=(d=e.features)!=null&&d.socials?((g=(h=e.features)==null?void 0:h.socials)==null?void 0:g.length)>0:Sn.DEFAULT_FEATURES.socials;(i||s)&&n.push(e7e({chains:this.wagmiChains,options:{projectId:e.projectId}})),n.forEach(v=>{const x=this.wagmiConfig._internal.connectors.setup(v);this.wagmiConfig._internal.connectors.setState(R=>[...R,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=vP.getCaipTokens(r.tokens),this.setCustomConnectors(r,e),!this.wagmiConfig)throw new Error("appkit:wagmiConfig - is undefined");this.networkControllerClient={switchCaipNetwork:async o=>{const a=Number(Ga.caipNetworkIdToNumber(o==null?void 0:o.id));a&&this.wagmiConfig&&await Jxe(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(p9e());else if(((d=c==null?void 0:c.connector)==null?void 0:d.id)===cr.WALLET_CONNECT_CONNECTOR_ID){const h=this.wagmiConfig.connectors.find(g=>g.id===cr.WALLET_CONNECT_CONNECTOR_ID);o(h9e(h))}o({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})}},this.connectionControllerClient={connectWalletConnect:async()=>{var x,R,M,N,E,O,L,U,H,I,T,F;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=(R=(x=this.options)==null?void 0:x.siweConfig)==null?void 0:R.getMessageParams)==null?void 0:M.call(R)),l=(O=(E=(N=this.options)==null?void 0:N.siweConfig)==null?void 0:E.options)==null?void 0:O.enabled,d=typeof(a==null?void 0:a.authenticate)=="function",h=c&&Object.keys(c||{}).length>0,g=(L=this.options)==null?void 0:L.siweConfig;if(l&&d&&h&&g){await o.setRequestedChainsIds(c.chains);const{SIWEController:K,getDidChainId:B,getDidAddress:_}=await Dn(async()=>{const{SIWEController:A,getDidChainId:P,getDidAddress:S}=await import("./index-DzmO8s0j.js");return{SIWEController:A,getDidChainId:P,getDidAddress:S}},[]),p=(U=this.caipNetworks)==null?void 0:U.filter(A=>A.chainNamespace==="eip155").map(A=>A.id);c.chains=(H=this.caipNetworks)==null?void 0:H.filter(A=>A.chainNamespace==="eip155").map(A=>A.chainId);const m=await a.authenticate({nonce:await g.getNonce(),methods:[...t7e],...c,chains:p}),w=(I=m==null?void 0:m.auths)==null?void 0:I[0];if(w){const{p:A,s:P}=w,S=B(A.iss),k=_(A.iss);k&&S&&K.setSession({address:k,chainId:parseInt(S,10)});try{const y=a.client.formatAuthMessage({request:A,iss:A.iss});await K.verifyMessage({message:y,signature:P.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(Ga.caipNetworkIdToNumber((F=(T=this.appKit)==null?void 0:T.getCaipNetwork())==null?void 0:F.id));await GM(this.wagmiConfig,{connector:o,chainId:v})},connectExternal:async({id:o,provider:a,info:c})=>{var h,g,v,x;if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const l=this.wagmiConfig.connectors.find(R=>R.id===o);if(!l)throw new Error("connectionControllerClient:connectExternal - connector is undefined");(h=this.appKit)==null||h.setClientId(null),a&&c&&l.id===cr.EIP6963_CONNECTOR_ID&&((g=l.setEip6963Wallet)==null||g.call(l,{provider:a,info:c}));const d=Number(Ga.caipNetworkIdToNumber((x=(v=this.appKit)==null?void 0:v.getCaipNetwork())==null?void 0:x.id));await GM(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 Dxe(this.wagmiConfig),(c=(a=(o=this.options)==null?void 0:o.siweConfig)==null?void 0:a.options)!=null&&c.signOutOnDisconnect){const{SIWEController:h}=await Dn(async()=>{const{SIWEController:g}=await import("./index-DzmO8s0j.js");return{SIWEController:g}},[]);await h.signOut()}nn.removeItem(rn.WALLET_ID),nn.removeItem(rn.CONNECTED_CONNECTOR),nn.removeItem(rn.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=tO(a);return Gxe(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 Lxe(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}=U2(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 Vxe(this.wagmiConfig,c);const l=await Kxe(this.wagmiConfig,c);return await t9e(this.wagmiConfig,{hash:l,timeout:25e3}),l},writeContract:async o=>{var h,g,v,x;const a=((h=this.appKit)==null?void 0:h.getCaipAddress())||"",c=tO(a),l=Number(Ga.caipNetworkIdToNumber((v=(g=this.appKit)==null?void 0:g.getCaipNetwork())==null?void 0:v.id));return await r9e(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(Ga.caipNetworkIdToNumber((c=(a=this.appKit)==null?void 0:a.getCaipNetwork())==null?void 0:c.id));let h=!1,g=!1;return YJ(o)&&(g=await((l=this.appKit)==null?void 0:l.resolveReownName(o))||!1),d===1&&(h=await Hxe(this.wagmiConfig,{name:aO(o),chainId:d})),h||g||!1}catch{return!1}},getEnsAvatar:async o=>{var l,d;const a=Number(Ga.caipNetworkIdToNumber((d=(l=this.appKit)==null?void 0:l.getCaipNetwork())==null?void 0:d.id));return a!==eO.id?!1:await QM(this.wagmiConfig,{name:aO(o),chainId:a})||!1},parseUnits:$8e,formatUnits:$2},pe.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),e9e(this.wagmiConfig,{onChange:o=>{this.syncConnectors(o),this.syncAuthConnector(o.find(a=>a.id===cr.AUTH_CONNECTOR_ID))}}),Xxe(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=zxe(this.wagmiConfig)[0])==null?void 0:a.connector;l&&Qxe(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(Ga.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,h,g,v,x,R,M,N,E,O,L,U,H;const o=pe.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),nn.removeItem(rn.WALLET_ID);return}if(this.wagmiConfig&&n){if(n&&n.name==="WalletConnect"&&n.getProvider&&e){const I=r||Number(Ga.caipNetworkIdToNumber((g=(h=this.appKit)==null?void 0:h.getCaipNetwork())==null?void 0:g.id)),T=await n.getProvider(),F=((v=T==null?void 0:T.session)==null?void 0:v.namespaces)||{},K=F?Object.keys(F):[],B=(x=this.appKit)==null?void 0:x.getPreferredAccountType();K.forEach(_=>{var w,A,P;const p=_,m=(w=F==null?void 0:F[_])==null?void 0:w.accounts[0];j1.setProvider(p,T),j1.setProviderId(p,"walletConnect"),(A=this.appKit)==null||A.setPreferredAccountType(B,p),(P=this.appKit)==null||P.setCaipAddress(m,p)}),((M=(R=this.appKit)==null?void 0:R.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),(O=this.appKit)==null?void 0:O.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(F=>({address:F,type:"eoa"})),this.chainNamespace))}else if(s==="reconnecting"){(U=this.appKit)==null||U.setLoading(!0);const T=Wxe(this.wagmiConfig).find(F=>F.id===n.id);T&&(await YM(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(h=>h.chainId===r);if(i&&r&&((a=this.appKit)==null||a.setCaipNetwork({chainId:i.chainId,id:i.id,name:i.name||"",imageId:ua.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 h=`eip155:${r}:${e}`;if((c=this.appKit)==null||c.setCaipAddress(h,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===eO.id){const l=await qxe(this.wagmiConfig,{address:e,chainId:r});if(l){(s=this.appKit)==null||s.setProfileName(l,this.chainNamespace);const d=await QM(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 Fxe(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:ua.ConnectorExplorerIds[a],imageUrl:((v=(g=this.options)==null?void 0:g.connectorImages)==null?void 0:v[a])??d,name:ua.ConnectorNamesMap[a]??c,imageId:ua.ConnectorImageIds[a],type:ua.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;Qi.checkIfRequestExists(a)?Qi.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,h;((c=this.appKit)==null?void 0:c.isOpen())&&((l=this.appKit)!=null&&l.isTransactionStackEmpty()?(d=this.appKit)==null||d.close():(h=this.appKit)==null||h.popTransactionStack(!0))}),s.onRpcSuccess((a,c)=>{var d,h,g;Qi.checkIfRequestIsSafe(c)||((d=this.appKit)!=null&&d.isTransactionStackEmpty()?(h=this.appKit)==null||h.close():(g=this.appKit)==null||g.popTransactionStack())}),s.onNotConnected(()=>{var d,h,g;const a=(d=this.appKit)==null?void 0:d.getIsConnectedState(),l=nn.getItem(rn.CONNECTED_CONNECTOR)==="AUTH";!a&&l&&((h=this.appKit)==null||h.setCaipAddress(void 0,this.chainNamespace),(g=this.appKit)==null||g.setLoading(!1))}),s.onIsConnected(()=>{s.connect()}),s.onConnect(a=>{var l,d,h,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),(h=this.appKit)==null||h.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&&YM(this.wagmiConfig,{connectors:[e]}))})}}async listenModal(e){const r=await e.getProvider();this.subscribeState(n=>{n.open||r.rejectRpcRequests()})}}const cO="pushstate",lO="popstate",iW="beforeunload",sW=t=>(t.preventDefault(),t.returnValue=""),n7e=()=>{removeEventListener(iW,sW,{capture:!0})};function oW(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=uO(a),s(()=>{t.pushState(o,a),i()},c)},replace:(o,a,c)=>{a=uO(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(iW,sW,{capture:!0}),()=>{n=n.filter(a=>a!==o),n.length||n7e()}),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 uO(t){return t||(t={}),{...t,key:o7e()}}function aW(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)??(R=>R),s=(t==null?void 0:t.parseLocation)??(()=>Hv(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));let o=s(),a;const c=()=>o;let l,d;const h=()=>{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=(R,M,N)=>{const E=i(M);d||(a=o),o=Hv(M,N),l={href:E,state:N,isPush:(l==null?void 0:l.isPush)||R==="push"},d||(d=Promise.resolve().then(()=>h()))},v=()=>{o=s(),x.notify()},x=oW({getLocation:c,getLength:()=>e.history.length,pushState:(R,M)=>g("push",R,M),replaceState:(R,M)=>g("replace",R,M),back:()=>e.history.back(),forward:()=>e.history.forward(),go:R=>e.history.go(R),createHref:R=>i(R),flush:h,destroy:()=>{e.history.pushState=r,e.history.replaceState=n,e.removeEventListener(cO,v),e.removeEventListener(lO,v)},onBlocked:R=>{a&&o!==a&&(o=a,R())}});return e.addEventListener(cO,v),e.addEventListener(lO,v),e.history.pushState=function(...R){const M=r.apply(e.history,R);return x._ignoreSubscribers||v(),M},e.history.replaceState=function(...R){const M=n.apply(e.history,R);return x._ignoreSubscribers||v(),M},x}function i7e(t){const e=typeof document<"u"?window:void 0;return aW({window:e,parseLocation:()=>{const r=e.location.hash.split("#").slice(1).join("#")??"/";return Hv(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 oW({getLocation:()=>Hv(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 Hv(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 o7e(){return(Math.random()+1).toString(36).substring(7)}var a7e="Invariant failed";function Bs(t,e){if(!t)throw new Error(a7e)}const X9=it.createContext(null);function cW(){return typeof document>"u"?X9:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=X9,X9)}function $f(t){const e=it.useContext(cW());return t==null||t.warn,e}var lW={exports:{}},uW={},dW={exports:{}},fW={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -11090,7 +11090,7 @@ ${m6e(v)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMess * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var j4=it,v7e=w7e;function y7e(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var b7e=typeof Object.is=="function"?Object.is:y7e,x7e=v7e.useSyncExternalStore,_7e=j4.useRef,C7e=j4.useEffect,A7e=j4.useMemo,E7e=j4.useDebugValue;uW.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=_7e(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=A7e(function(){function c(v){if(!l){if(l=!0,d=v,v=n(v),i!==void 0&&o.hasValue){var x=o.value;if(i(x,v))return h=x}return h=v}if(x=h,b7e(d,v))return x;var R=n(v);return i!==void 0&&i(x,R)?x:(d=v,h=R)}var l=!1,d,h,g=r===void 0?null:r;return[function(){return c(e())},g===null?void 0:function(){return c(g())}]},[e,r,n,i]);var a=x7e(t,s[0],s[1]);return C7e(function(){o.hasValue=!0,o.value=a},[a]),E7e(a),a};lW.exports=uW;var S7e=lW.exports;class I7e{constructor(e,r){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=n=>{var i,s;this.listeners.add(n);const o=(s=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:s.call(i,n,this);return()=>{this.listeners.delete(n),o==null||o()}},this.setState=n=>{var i,s,o;const a=this.state;this.state=(i=this.options)!=null&&i.updateFn?this.options.updateFn(a)(n):n(a),(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),this._flush()},this._flush=()=>{if(this._batching)return;const n=++this._flushing;this.listeners.forEach(i=>{this._flushing===n&&i()})},this.batch=n=>{if(this._batching)return n();this._batching=!0,n(),this._batching=!1,this._flush()},this.state=e,this.options=r}}function T7e(t,e=r=>r){return S7e.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,k7e)}function k7e(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;n{e.substring(0,1)==="?"&&(e=e.substring(1));const r=R7e(e);for(const n in r){const i=r[n];if(typeof i=="string")try{r[n]=t(i)}catch{}}return r}}function $7e(t,e){function r(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(typeof n=="string"&&typeof e=="function")try{return e(n),t(n)}catch{}return n}return n=>{n={...n},Object.keys(n).forEach(s=>{const o=n[s];typeof o>"u"||o===void 0?delete n[s]:n[s]=r(o)});const i=P7e(n).toString();return i?`?${i}`:""}}function aw(t){return t[t.length-1]}function D7e(t){return typeof t=="function"}function Dp(t,e){return D7e(t)?t(e):t}function cw(t,e){return e.reduce((r,n)=>(r[n]=t[n],r),{})}function wp(t,e){if(t===e)return t;const r=e,n=hO(t)&&hO(r);if(n||eg(t)&&eg(r)){const i=n?t:Object.keys(t),s=i.length,o=n?r:Object.keys(r),a=o.length,c=n?[]:{};let l=0;for(let d=0;d"u")return!0;const r=e.prototype;return!(!fO(r)||!r.hasOwnProperty("isPrototypeOf"))}function fO(t){return Object.prototype.toString.call(t)==="[object Object]"}function hO(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Jp(t,e,r=!1){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(eg(t)&&eg(e)){const n=Object.keys(t).filter(s=>t[s]!==void 0),i=Object.keys(e).filter(s=>e[s]!==void 0);return!r&&n.length!==i.length?!1:!i.some(s=>!(s in t)||!Jp(t[s],e[s],r))}return Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:!t.some((n,i)=>!Jp(n,e[i],r)):!1}const t7=typeof window<"u"?it.useLayoutEffect:it.useEffect;function vp(t){let e,r;const n=new Promise((i,s)=>{e=i,r=s});return n.status="pending",n.resolve=i=>{n.status="resolved",n.value=i,e(i),t==null||t(i)},n.reject=i=>{n.status="rejected",r(i)},n}function pO(t){const e=it.useRef({value:t,prev:null}),r=e.current.value;return t!==r&&(e.current={value:t,prev:r}),e.current.prev}function L7e(t,e,r={},n={}){const i=it.useRef(typeof IntersectionObserver=="function"),s=it.useRef(null);return it.useEffect(()=>{if(!(!t.current||!i.current||n.disabled))return s.current=new IntersectionObserver(([o])=>{e(o)},r),s.current.observe(t.current),()=>{var o;(o=s.current)==null||o.disconnect()}},[e,r,n.disabled,t]),s.current}function B7e(t){const e=it.useRef(null);return it.useEffect(()=>{t&&(typeof t=="function"?t(e.current):t.current=e.current)}),e}function Jd(t){return F4(t.filter(e=>e!==void 0).join("/"))}function F4(t){return t.replace(/\/{2,}/g,"/")}function AS(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function vh(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function U7e(t){return vh(AS(t))}function s6(t,e){return t.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function j7e(t,e,r){return s6(t,r)===s6(e,r)}function F7e({basepath:t,base:e,to:r,trailingSlash:n="never"}){var i,s;e=o6(t,e),r=o6(t,r);let o=tg(e);const a=tg(r);o.length>1&&((i=aw(o))==null?void 0:i.value)==="/"&&o.pop(),a.forEach((l,d)=>{l.value==="/"?d?d===a.length-1&&o.push(l):o=[l]:l.value===".."?o.pop():l.value==="."||o.push(l)}),o.length>1&&(((s=aw(o))==null?void 0:s.value)==="/"?n==="never"&&o.pop():n==="always"&&o.push({type:"pathname",value:"/"}));const c=Jd([t,...o.map(l=>l.value)]);return F4(c)}function tg(t){if(!t)return[];t=F4(t);const e=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map(n=>n==="$"||n==="*"?{type:"wildcard",value:n}:n.charAt(0)==="$"?{type:"param",value:n}:{type:"pathname",value:decodeURI(n)})),t.slice(-1)==="/"&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function r7({path:t,params:e,leaveWildcards:r,leaveParams:n}){const i=tg(t),s={};for(const[o,a]of Object.entries(e)){const c=typeof a=="string";["*","_splat"].includes(o)?s[o]=c?encodeURI(a):a:s[o]=c?encodeURIComponent(a):a}return Jd(i.map(o=>{if(o.type==="wildcard"){const a=s._splat;return r?`${o.value}${a??""}`:a}if(o.type==="param"){if(n){const a=s[o.value];return`${o.value}${a??""}`}return s[o.value.substring(1)]??"undefined"}return o.value}))}function Ly(t,e,r){const n=z7e(t,e,r);if(!(r.to&&!n))return n??{}}function o6(t,e){switch(!0){case t==="/":return e;case e===t:return"";case e.length{for(let c=0;c=i.length-1,g=c>=s.length-1;if(d){if(d.type==="wildcard"){const v=decodeURI(Jd(i.slice(c).map(x=>x.value)));return o["*"]=v,o._splat=v,!0}if(d.type==="pathname"){if(d.value==="/"&&!(l!=null&&l.value))return!0;if(l){if(r.caseSensitive){if(d.value!==l.value)return!1}else if(d.value.toLowerCase()!==l.value.toLowerCase())return!1}}if(!l)return!1;if(d.type==="param"){if(l.value==="/")return!1;l.value.charAt(0)!=="$"&&(o[d.value.substring(1)]=decodeURIComponent(l.value))}}if(!h&&g)return o["**"]=Jd(i.slice(c+1).map(v=>v.value)),!!r.fuzzy&&(d==null?void 0:d.value)!=="/"}return!0})()?o:void 0}function ah(t){return!!(t!=null&&t.isRedirect)}function gO(t){return!!(t!=null&&t.isRedirect)&&t.href}function ES(t){const e=t.errorComponent??z4;return ze.jsx(W7e,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:r,reset:n})=>r?it.createElement(e,{error:r,reset:n}):t.children})}class W7e extends it.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,r){r.error&&r.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,r){this.props.onCatch&&this.props.onCatch(e,r)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function z4({error:t}){const[e,r]=it.useState(!1);return ze.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[ze.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[ze.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),ze.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(n=>!n),children:e?"Hide Error":"Show Error"})]}),ze.jsx("div",{style:{height:".25rem"}}),e?ze.jsx("div",{children:ze.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?ze.jsx("code",{children:t.message}):null})}):null]})}function vo(t){const e=$f({warn:(t==null?void 0:t.router)===void 0});return T7e(((t==null?void 0:t.router)||e).__store,t==null?void 0:t.select)}function ec(t){return!!(t!=null&&t.isNotFound)}function H7e(t){const e=vo({select:r=>`not-found-${r.location.pathname}-${r.status}`});return ze.jsx(ES,{getResetKey:()=>e,onCatch:(r,n)=>{var i;if(ec(r))(i=t.onCatch)==null||i.call(t,r,n);else throw r},errorComponent:({error:r})=>{var n;if(ec(r))return(n=t.fallback)==null?void 0:n.call(t,r);throw r},children:t.children})}function q7e(){return ze.jsx("p",{children:"Not Found"})}const V7e={stringify:t=>JSON.stringify(t,function(r,n){const i=this[r],s=mO.find(o=>o.stringifyCondition(i));return s?s.stringify(i):n}),parse:t=>JSON.parse(t,function(r,n){const i=this[r],s=mO.find(o=>o.parseCondition(i));return s?s.parse(i):n})},mO=[{stringifyCondition:t=>t instanceof Date,stringify:t=>({$date:t.toISOString()}),parseCondition:t=>eg(t)&&t.$date,parse:t=>new Date(t.$date)},{stringifyCondition:t=>t===void 0,stringify:()=>({$undefined:""}),parseCondition:t=>eg(t)&&t.$undefined==="",parse:()=>{}}],hW=["component","errorComponent","pendingComponent","notFoundComponent"];function K7e(t){var e;for(const r of hW)if((e=t.options[r])!=null&&e.preload)return!0;return!1}function G7e(t){return new Z7e(t)}class Z7e{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.subscribers=new Set,this.startReactTransition=r=>r(),this.update=r=>{r.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.");const n=this.options;this.options={...this.options,...r},this.isServer=this.options.isServer??typeof document>"u",(!this.basepath||r.basepath&&r.basepath!==n.basepath)&&(r.basepath===void 0||r.basepath===""||r.basepath==="/"?this.basepath="/":this.basepath=`/${U7e(r.basepath)}`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(this.isServer?s7e({initialEntries:[this.basepath||"/"]}):aW()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new I7e(J7e(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(i=>!["redirected"].includes(i.status))}}}))},this.buildRouteTree=()=>{this.routesById={},this.routesByPath={};const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999,defaultSsr:this.options.defaultSsr}),this.routesById[r.id]=r);const n=o=>{o.forEach((a,c)=>{a.init({originalIndex:c,defaultSsr:this.options.defaultSsr});const l=this.routesById[a.id];if(Bs(!l,`Duplicate routes found with id: ${String(a.id)}`),this.routesById[a.id]=a,!a.isRoot&&a.path){const h=vh(a.fullPath);(!this.routesByPath[h]||a.fullPath.endsWith("/"))&&(this.routesByPath[h]=a)}const d=a.children;d!=null&&d.length&&n(d)})};n([this.routeTree]);const i=[];Object.values(this.routesById).forEach((o,a)=>{var c;if(o.isRoot||!o.path)return;const l=AS(o.fullPath),d=tg(l);for(;d.length>1&&((c=d[0])==null?void 0:c.value)==="/";)d.shift();const h=d.map(g=>g.value==="/"?.75:g.type==="param"?.5:g.type==="wildcard"?.25:1);i.push({child:o,trimmed:l,parsed:d,index:a,scores:h})}),this.flatRoutes=i.sort((o,a)=>{const c=Math.min(o.scores.length,a.scores.length);for(let l=0;la.parsed[l].value?1:-1;return o.index-a.index}).map((o,a)=>(o.child.rank=a,o.child))},this.subscribe=(r,n)=>{const i={eventType:r,fn:n};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=r=>{this.subscribers.forEach(n=>{n.eventType===r.type&&n.fn(r)})},this.parseLocation=r=>{const n=({pathname:a,search:c,hash:l,state:d})=>{const h=this.options.parseSearch(c),g=this.options.stringifySearch(h);return{pathname:a,searchStr:g,search:wp(r==null?void 0:r.search,h),hash:l.split("#").reverse()[0]??"",href:`${a}${g}${l}`,state:wp(r==null?void 0:r.state,d)}},i=n(this.history.location),{__tempLocation:s,__tempKey:o}=i.state;if(s&&(!o||o===this.tempLocationKey)){const a=n(s);return a.state.key=i.state.key,delete a.state.__tempLocation,{...a,maskedLocation:i}}return i},this.resolvePathWithBase=(r,n)=>F7e({basepath:this.basepath,base:r,to:F4(n),trailingSlash:this.options.trailingSlash}),this.cancelMatch=r=>{const n=this.getMatch(r);n&&(n.abortController.abort(),clearTimeout(n.pendingTimeout))},this.cancelMatches=()=>{var r;(r=this.state.pendingMatches)==null||r.forEach(n=>{this.cancelMatch(n.id)})},this.buildLocation=r=>{const n=(s={},o)=>{var a,c,l,d,h;const g=s._fromLocation?this.matchRoutes(s._fromLocation):this.state.matches,v=s.from!=null?g.find(w=>Ly(this.basepath,vh(w.pathname),{to:s.from,caseSensitive:!1,fuzzy:!1})):void 0,x=(v==null?void 0:v.pathname)||this.latestLocation.pathname;Bs(s.from==null||v!=null,"Could not find match for from: "+s.from);const R=(a=this.state.pendingMatches)!=null&&a.length?(c=aw(this.state.pendingMatches))==null?void 0:c.search:((l=aw(g))==null?void 0:l.search)||this.latestLocation.search,M=o==null?void 0:o.filter(w=>g.find(A=>A.routeId===w.routeId)),N=this.routesById[(d=M==null?void 0:M.find(w=>w.pathname===x))==null?void 0:d.routeId];let E=s.to?this.resolvePathWithBase(x,`${s.to}`):this.resolvePathWithBase(x,(N==null?void 0:N.to)??x);const O={...(h=aw(g))==null?void 0:h.params};let L=(s.params??!0)===!0?O:{...O,...Dp(s.params,O)};Object.keys(L).length>0&&(o==null||o.map(w=>{var A;const P=this.looseRoutesById[w.routeId];return((A=P==null?void 0:P.options.params)==null?void 0:A.stringify)??P.options.stringifyParams}).filter(Boolean).forEach(w=>{L={...L,...w(L)}})),E=r7({path:E,params:L??{},leaveWildcards:!1,leaveParams:r.leaveParams});const U=(M==null?void 0:M.map(w=>this.looseRoutesById[w.routeId].options.preSearchFilters??[]).flat().filter(Boolean))??[],H=(M==null?void 0:M.map(w=>this.looseRoutesById[w.routeId].options.postSearchFilters??[]).flat().filter(Boolean))??[],I=U.length?U.reduce((w,A)=>A(w),R):R,T=s.search===!0?I:s.search?Dp(s.search,I):U.length?I:{},F=H.length?H.reduce((w,A)=>A(w),T):T,K=wp(R,F),B=this.options.stringifySearch(K),_=s.hash===!0?this.latestLocation.hash:s.hash?Dp(s.hash,this.latestLocation.hash):void 0,p=_?`#${_}`:"";let m=s.state===!0?this.latestLocation.state:s.state?Dp(s.state,this.latestLocation.state):{};return m=wp(this.latestLocation.state,m),{pathname:E,search:K,searchStr:B,state:m,hash:_??"",href:`${E}${B}${p}`,unmaskOnReload:s.unmaskOnReload}},i=(s={},o)=>{var a;const c=n(s);let l=o?n(o):void 0;if(!l){let x={};const R=(a=this.options.routeMasks)==null?void 0:a.find(M=>{const N=Ly(this.basepath,c.pathname,{to:M.from,caseSensitive:!1,fuzzy:!1});return N?(x=N,!0):!1});if(R){const{from:M,...N}=R;o={...cw(r,["from"]),...N,params:x},l=n(o)}}const d=this.matchRoutes(c),h=l?this.matchRoutes(l):void 0,g=l?n(o,h):void 0,v=n(s,d);return g&&(v.maskedLocation=g),v};return r.mask?i(r,{...cw(r,["from"]),...r.mask}):i(r)},this.commitLocation=({viewTransition:r,ignoreBlocker:n,...i})=>{const s=()=>{i.state.key=this.latestLocation.state.key;const c=Jp(i.state,this.latestLocation.state);return delete i.state.key,c},o=this.latestLocation.href===i.href,a=this.commitLocationPromise;if(this.commitLocationPromise=vp(()=>{a==null||a.resolve()}),o&&s())this.load();else{let{maskedLocation:c,...l}=i;c&&(l={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...l,search:l.searchStr,state:{...l.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(l.unmaskOnReload??this.options.unmaskOnReload??!1)&&(l.state.__tempKey=this.tempLocationKey)),this.shouldViewTransition=r,this.history[i.replace?"replace":"push"](l.href,l.state,{ignoreBlocker:n})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:n,viewTransition:i,ignoreBlocker:s,...o}={})=>{const a=o.href;if(a){const l=Hv(a,{});o.to=l.pathname,o.search=this.options.parseSearch(l.search),o.hash=l.hash}const c=this.buildLocation(o);return this.commitLocation({...c,viewTransition:i,replace:r,resetScroll:n,ignoreBlocker:s})},this.navigate=({to:r,...n})=>{const i=String(r);let s;try{new URL(`${i}`),s=!0}catch{}return Bs(!s),this.buildAndCommitLocation({...n,to:r})},this.load=async()=>{this.latestLocation=this.parseLocation(this.latestLocation);let r,n,i;for(i=new Promise(s=>{this.startReactTransition(async()=>{var o;try{const a=this.latestLocation,c=this.state.resolvedLocation,l=c.href!==a.href;this.cancelMatches();let d;this.__store.batch(()=>{d=this.matchRoutes(a),this.__store.setState(h=>({...h,status:"pending",isLoading:!0,location:a,pendingMatches:d,cachedMatches:h.cachedMatches.filter(g=>!d.find(v=>v.id===g.id))}))}),this.state.redirect||this.emit({type:"onBeforeNavigate",fromLocation:c,toLocation:a,pathChanged:l}),this.emit({type:"onBeforeLoad",fromLocation:c,toLocation:a,pathChanged:l}),await this.loadMatches({matches:d,location:a,onReady:async()=>{this.startViewTransition(async()=>{let h,g,v;this.__store.batch(()=>{this.__store.setState(x=>{const R=x.matches,M=x.pendingMatches||x.matches;return h=R.filter(N=>!M.find(E=>E.id===N.id)),g=M.filter(N=>!R.find(E=>E.id===N.id)),v=R.filter(N=>M.find(E=>E.id===N.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:M,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...h.filter(N=>N.status!=="error")]}}),this.cleanCache()}),[[h,"onLeave"],[g,"onEnter"],[v,"onStay"]].forEach(([x,R])=>{x.forEach(M=>{var N,E;(E=(N=this.looseRoutesById[M.routeId].options)[R])==null||E.call(N,M)})})})}})}catch(a){gO(a)?(r=a,this.isServer||this.navigate({...a,replace:!0,ignoreBlocker:!0})):ec(a)&&(n=a),this.__store.setState(c=>({...c,statusCode:r?r.statusCode:n?404:c.matches.some(l=>l.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===i&&((o=this.commitLocationPromise)==null||o.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),s()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise},this.startViewTransition=r=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;delete this.shouldViewTransition,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"?document.startViewTransition(r):r()},this.updateMatch=(r,n)=>{var i;let s;const o=(i=this.state.pendingMatches)==null?void 0:i.find(l=>l.id===r),a=this.state.matches.find(l=>l.id===r),c=o?"pendingMatches":a?"matches":"cachedMatches";return this.__store.setState(l=>{var d;return{...l,[c]:(d=l[c])==null?void 0:d.map(h=>h.id===r?s=n(h):h)}}),s},this.getMatch=r=>[...this.state.cachedMatches,...this.state.pendingMatches??[],...this.state.matches].find(n=>n.id===r),this.loadMatches=async({location:r,matches:n,preload:i,onReady:s,updateMatch:o=this.updateMatch})=>{let a,c=!1;const l=async()=>{c||(c=!0,await(s==null?void 0:s()))};!this.isServer&&!this.state.matches.length&&l();const d=(h,g)=>{var v,x,R;if(gO(g))throw g;if(ah(g)||ec(g)){if(o(h.id,M=>({...M,status:ah(g)?"redirected":ec(g)?"notFound":"error",isFetching:!1,error:g,beforeLoadPromise:void 0,loaderPromise:void 0})),g.routeId||(g.routeId=h.routeId),(v=h.beforeLoadPromise)==null||v.resolve(),(x=h.loaderPromise)==null||x.resolve(),(R=h.loadPromise)==null||R.resolve(),ah(g))throw c=!0,g=this.resolveRedirect({...g,_fromLocation:r}),g;if(ec(g))throw this._handleNotFound(n,g,{updateMatch:o}),g}};try{await new Promise((h,g)=>{(async()=>{var v,x,R;try{const M=(O,L,U)=>{var H,I;const{id:T,routeId:F}=n[O],K=this.looseRoutesById[F];if(L instanceof Promise)throw L;L.routerCode=U,a=a??O,d(this.getMatch(T),L);try{(I=(H=K.options).onError)==null||I.call(H,L)}catch(B){L=B,d(this.getMatch(T),L)}o(T,B=>{var _;return(_=B.beforeLoadPromise)==null||_.resolve(),{...B,error:L,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController,beforeLoadPromise:void 0}})};for(const[O,{id:L,routeId:U}]of n.entries()){const H=this.getMatch(L),I=(v=n[O-1])==null?void 0:v.id,T=this.looseRoutesById[U],F=T.options.pendingMs??this.options.defaultPendingMs,K=!!(s&&!this.isServer&&!i&&(T.options.loader||T.options.beforeLoad)&&typeof F=="number"&&F!==1/0&&(T.options.pendingComponent??this.options.defaultPendingComponent));if(H.beforeLoadPromise||H.loaderPromise)K&&setTimeout(()=>{try{l()}catch{}},F),await H.beforeLoadPromise;else{try{o(L,V=>({...V,loadPromise:vp(()=>{var ce;(ce=V.loadPromise)==null||ce.resolve()}),beforeLoadPromise:vp()}));const B=new AbortController;let _;K&&(_=setTimeout(()=>{try{l()}catch{}},F));const{paramsError:p,searchError:m}=this.getMatch(L);p&&M(O,p,"PARSE_PARAMS"),m&&M(O,m,"VALIDATE_SEARCH");const w=()=>I?this.getMatch(I).context:this.options.context??{};o(L,V=>({...V,isFetching:"beforeLoad",fetchCount:V.fetchCount+1,abortController:B,pendingTimeout:_,context:{...w(),...V.__routeContext,...V.__beforeLoadContext}}));const{search:A,params:P,context:S,cause:k}=this.getMatch(L),y={search:A,abortController:B,params:P,preload:!!i,context:S,location:r,navigate:V=>this.navigate({...V,_fromLocation:r}),buildLocation:this.buildLocation,cause:i?"preload":k,matches:n};let b=await((R=(x=T.options).beforeLoad)==null?void 0:R.call(x,y))??{};this.serializeLoaderData&&(b=this.serializeLoaderData("__beforeLoadContext",b,{router:this,match:this.getMatch(L)})),(ah(b)||ec(b))&&M(O,b,"BEFORE_LOAD"),o(L,V=>({...V,__beforeLoadContext:b,context:{...w(),...V.__routeContext,...b},abortController:B}))}catch(B){M(O,B,"BEFORE_LOAD")}o(L,B=>{var _;return(_=B.beforeLoadPromise)==null||_.resolve(),{...B,beforeLoadPromise:void 0,isFetching:!1}})}}const N=n.slice(0,a),E=[];N.forEach(({id:O,routeId:L},U)=>{E.push((async()=>{const{loaderPromise:H}=this.getMatch(O);let I=!1;if(H)await H;else{const T=E[U-1],F=this.looseRoutesById[L],K=()=>{const{params:y,loaderDeps:b,abortController:V,context:ce,cause:de}=this.getMatch(O);return{params:y,deps:b,preload:!!i,parentMatchPromise:T,abortController:V,context:ce,location:r,navigate:W=>this.navigate({...W,_fromLocation:r}),cause:i?"preload":de,route:F}},B=Date.now()-this.getMatch(O).updatedAt,_=i?F.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:F.options.staleTime??this.options.defaultStaleTime??0,p=F.options.shouldReload,m=typeof p=="function"?p(K()):p;o(O,y=>({...y,loaderPromise:vp(),preload:!!i&&!this.state.matches.find(b=>b.id===O)}));const w=async()=>{var y,b,V,ce,de,W,le,Y;try{const re=async()=>{const ne=this.getMatch(O);ne.minPendingPromise&&await ne.minPendingPromise};try{F._lazyPromise=F._lazyPromise||(F.lazyFn?F.lazyFn().then(xe=>{Object.assign(F.options,xe.options)}):Promise.resolve());const ne=this.getMatch(O).componentsPromise||F._lazyPromise.then(()=>Promise.all(hW.map(async xe=>{const Ae=F.options[xe];Ae!=null&&Ae.preload&&await Ae.preload()})));o(O,xe=>({...xe,isFetching:"loader",componentsPromise:ne}));let D=await((b=(y=F.options).loader)==null?void 0:b.call(y,K()));this.serializeLoaderData&&(D=this.serializeLoaderData("loaderData",D,{router:this,match:this.getMatch(O)})),d(this.getMatch(O),D),await F._lazyPromise,await re();const ee=(ce=(V=F.options).meta)==null?void 0:ce.call(V,{matches:n,match:this.getMatch(O),params:this.getMatch(O).params,loaderData:D}),ge=(W=(de=F.options).headers)==null?void 0:W.call(de,{loaderData:D});o(O,xe=>({...xe,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:D,meta:ee,headers:ge}))}catch(ne){let D=ne;await re(),d(this.getMatch(O),ne);try{(Y=(le=F.options).onError)==null||Y.call(le,ne)}catch(ee){D=ee,d(this.getMatch(O),ee)}o(O,ee=>({...ee,error:D,status:"error",isFetching:!1}))}await this.getMatch(O).componentsPromise}catch(re){d(this.getMatch(O),re)}},{status:A,invalid:P}=this.getMatch(O);I=A==="success"&&(P||(m??B>_)),i&&F.options.preload===!1||(I?(async()=>{try{await w()}catch{}})():A!=="success"&&await w());const{loaderPromise:S,loadPromise:k}=this.getMatch(O);S==null||S.resolve(),k==null||k.resolve()}o(O,T=>({...T,isFetching:I?T.isFetching:!1,loaderPromise:void 0,invalid:!1}))})())}),await Promise.all(E),h()}catch(M){g(M)}})()}),await l()}catch(h){if(ah(h)||ec(h))throw ec(h)&&!i&&await l(),h}return n},this.invalidate=()=>{const r=n=>({...n,invalid:!0,...n.status==="error"?{status:"pending",error:void 0}:{}});return this.__store.setState(n=>{var i;return{...n,matches:n.matches.map(r),cachedMatches:n.cachedMatches.map(r),pendingMatches:(i=n.pendingMatches)==null?void 0:i.map(r)}}),this.load()},this.resolveRedirect=r=>{const n=r;return n.href||(n.href=this.buildLocation(n).href),n},this.cleanCache=()=>{this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(n=>{const i=this.looseRoutesById[n.routeId];if(!i.options.loader)return!1;const s=(n.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return n.status!=="error"&&Date.now()-n.updatedAt{const n=this.buildLocation(r);let i=this.matchRoutes(n,{throwOnError:!0,preload:!0});const s=Object.fromEntries([...this.state.matches,...this.state.pendingMatches??[],...this.state.cachedMatches].map(a=>[a.id,!0]));this.__store.batch(()=>{i.forEach(a=>{s[a.id]||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id));try{return i=await this.loadMatches({matches:i,location:n,preload:!0,updateMatch:(a,c)=>{o.has(a)?i=i.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),i}catch(a){if(ah(a))return await this.preloadRoute({...a,_fromLocation:n});console.error(a);return}},this.matchRoute=(r,n)=>{const i={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},s=this.buildLocation(i);if(n!=null&&n.pending&&this.state.status!=="pending")return!1;const a=((n==null?void 0:n.pending)===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation,c=Ly(this.basepath,a.pathname,{...n,to:s.pathname});return!c||r.params&&!Jp(c,r.params,!0)?!1:c&&((n==null?void 0:n.includeSearch)??!0)?Jp(a.search,s.search,!0)?c:!1:c},this.dehydrate=()=>{var r;const n=((r=this.options.errorSerializer)==null?void 0:r.serialize)??X7e;return{state:{dehydratedMatches:this.state.matches.map(i=>({...cw(i,["id","status","updatedAt"]),error:i.error?{data:n(i.error),__isServerError:!0}:void 0}))},manifest:this.manifest}},this.hydrate=()=>{var r,n,i;let s;typeof document<"u"&&(s=this.options.transformer.parse((r=window.__TSR__)==null?void 0:r.dehydrated)),Bs(s),this.dehydratedData=s.payload,(i=(n=this.options).hydrate)==null||i.call(n,s.payload);const o=s.router.state,a=this.matchRoutes(this.state.location).map(c=>{const l=o.dehydratedMatches.find(d=>d.id===c.id);return Bs(l,`Could not find a client-side match for dehydrated match with id: ${c.id}!`),{...c,...l}});this.__store.setState(c=>({...c,matches:a})),this.manifest=s.router.manifest},this.injectedHtml=[],this.injectHtml=r=>{const n=()=>(this.injectedHtml=this.injectedHtml.filter(i=>i!==n),r);this.injectedHtml.push(n)},this.streamedKeys=new Set,this.getStreamedValue=r=>{var n;if(this.isServer)return;const i=(n=window.__TSR__)==null?void 0:n.streamedValues[r];if(i)return i.parsed||(i.parsed=this.options.transformer.parse(i.value)),i.parsed},this.streamValue=(r,n)=>{var i;this.streamedKeys.has(r),this.streamedKeys.add(r);const s=`__TSR__.streamedValues['${r}'] = { value: ${(i=this.serializer)==null?void 0:i.call(this,this.options.transformer.stringify(n))}}`;this.injectHtml(` - + +
diff --git a/logo.css b/logo.css new file mode 100644 index 0000000..badf3f6 --- /dev/null +++ b/logo.css @@ -0,0 +1,50 @@ +@import url('https://fonts.googleapis.com/css2?family=Saira:ital,wght@0,100..900;1,100..900&display=swap'); +#logo text { + fill: currentColor; + /* filter: url(#d); */ + font-size: 2000px; + /* opacity: 0.9; */ + stroke: #000; + stroke-linecap: round; + stroke-linejoin: round; + /* stroke-opacity: 0.5; */ + stroke-width: 150px; + text-align: center; + line-height: 0.96; + paint-order: stroke fill markers; + text-anchor: middle; + font-family: Saira; + filter: drop-shadow(0 0 20px #E2FF00); +} +@media (prefers-color-scheme: dark) { + #logo text { + stroke-width: 200px; + } +} +.book > path { + animation: alternate-reverse var(--dur, 20s) rainbow infinite ease-in-out; + animation-delay: var(--delay); +} +.book:nth-of-type(1) { fill: #268404; --delay: 0s } +.book:nth-of-type(2) { --delay: 2s; --dur: 15s } +.book:nth-of-type(3) { --delay: 4s; --dur: 18s } +.book:nth-of-type(4) { --delay: 6s; --dur: 12s } +.book:nth-of-type(5) { --delay: 8s; --dur: 21s } +.book:nth-of-type(6) { --delay: 10s; --dur: 14s } + +#table > path { + /* filter: url(#a); */ +} + +@keyframes rainbow { + 10% { fill: red } + 20% { fill: orange } + 30% { fill: yellow } + 40% { fill: green } + 50% { fill: blue } + 60% { fill: indigo } + 70% { fill: violet } + 80% { fill: blue } + 90% { fill: orangered } + 100% { fill: red } +} diff --git a/logo.square.svg b/logo.square.svg new file mode 100644 index 0000000..2e96ce8 --- /dev/null +++ b/logo.square.svg @@ -0,0 +1,620 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dAcademy + + diff --git a/logo.svg b/logo.svg new file mode 100644 index 0000000..f84201a --- /dev/null +++ b/logo.svg @@ -0,0 +1,162 @@ + + \ No newline at end of file