@orbs-network/spot-react 0.0.61 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-
|
|
1
|
+
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-CoBdoP6X.js";
|
|
2
2
|
class S extends p {
|
|
3
3
|
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
|
4
4
|
var o;
|
|
@@ -2933,7 +2933,7 @@ const Kw = async ({
|
|
|
2933
2933
|
}) => (await Promise.all([
|
|
2934
2934
|
s ? Kw({ chainId: r, signal: e, page: t, limit: n, filters: { accounts: [a], configs: s.twapConfig ? [s.twapConfig] : [] } }) : Promise.resolve([]),
|
|
2935
2935
|
zw({ chainId: r, signal: e, account: a, exchange: s == null ? void 0 : s.adapter })
|
|
2936
|
-
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Jw = "0.0.
|
|
2936
|
+
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Jw = "0.0.62", e3 = {
|
|
2937
2937
|
version: Jw
|
|
2938
2938
|
};
|
|
2939
2939
|
var bo = class {
|
|
@@ -11587,7 +11587,7 @@ async function gu(e, t) {
|
|
|
11587
11587
|
});
|
|
11588
11588
|
return ie === "0x" ? { data: void 0 } : { data: ie };
|
|
11589
11589
|
} catch (U) {
|
|
11590
|
-
const F = i7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-
|
|
11590
|
+
const F = i7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-CKFojjiu.js");
|
|
11591
11591
|
if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === L && C)
|
|
11592
11592
|
return { data: await R(e, { data: F, to: C }) };
|
|
11593
11593
|
throw S && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new ME({ factory: f }) : i0(U, {
|
package/dist/spot-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aR as e, C as r, a6 as t, D as i, aB as n, aP as E, aN as o, aQ as _, aO as T, aL as P, aF as u, ai as A, aD as l, aC as I, ah as R, am as O, aA as S, as as d, aq as L, ar as g, au as D, at as M, M as C, aI as m, aJ as U, aH as b, aG as p, aK as N, O as c, K as F, P as k, J as y, aM as B, aj as G, aE as h, ap as x, S as Y, G as f, I as H, av as W, ak as v, al as w, a7 as K, bd as V, ag as z, R as Q, Z as X, a3 as j, T as q, W as J, af as Z, ao as $, aW as aa, b9 as sa, aY as ea, aS as ra, aT as ta, aV as ia, bc as na, aZ as Ea, a5 as oa, b8 as _a, a$ as Ta, b4 as Pa, aX as ua, bb as Aa, b6 as la, Y as Ia, b5 as Ra, b7 as Oa, a9 as Sa, ac as da, aa as La, ad as ga, a0 as Da, ab as Ma, az as Ca, ba as ma, a_ as Ua, b2 as ba, b0 as pa, b3 as Na, b1 as ca, aU as Fa, a4 as ka, X as ya, U as Ba, ay as Ga, _ as ha, $ as xa, ax as Ya, ae as fa, V as Ha, L as Wa, an as va, a8 as wa, a2 as Ka, a1 as Va, be as za, Q as Qa, N as Xa, y as ja, q as qa, m as Ja, h as Za, j as $a, F as as, t as ss, r as es, k as rs, A as ts, o as is, E as ns, x as Es, z as os, p as _s, v as Ts, u as Ps, w as us, n as As, aw as ls } from "./index-
|
|
1
|
+
import { aR as e, C as r, a6 as t, D as i, aB as n, aP as E, aN as o, aQ as _, aO as T, aL as P, aF as u, ai as A, aD as l, aC as I, ah as R, am as O, aA as S, as as d, aq as L, ar as g, au as D, at as M, M as C, aI as m, aJ as U, aH as b, aG as p, aK as N, O as c, K as F, P as k, J as y, aM as B, aj as G, aE as h, ap as x, S as Y, G as f, I as H, av as W, ak as v, al as w, a7 as K, bd as V, ag as z, R as Q, Z as X, a3 as j, T as q, W as J, af as Z, ao as $, aW as aa, b9 as sa, aY as ea, aS as ra, aT as ta, aV as ia, bc as na, aZ as Ea, a5 as oa, b8 as _a, a$ as Ta, b4 as Pa, aX as ua, bb as Aa, b6 as la, Y as Ia, b5 as Ra, b7 as Oa, a9 as Sa, ac as da, aa as La, ad as ga, a0 as Da, ab as Ma, az as Ca, ba as ma, a_ as Ua, b2 as ba, b0 as pa, b3 as Na, b1 as ca, aU as Fa, a4 as ka, X as ya, U as Ba, ay as Ga, _ as ha, $ as xa, ax as Ya, ae as fa, V as Ha, L as Wa, an as va, a8 as wa, a2 as Ka, a1 as Va, be as za, Q as Qa, N as Xa, y as ja, q as qa, m as Ja, h as Za, j as $a, F as as, t as ss, r as es, k as rs, A as ts, o as is, E as ns, x as Es, z as os, p as _s, v as Ts, u as Ps, w as us, n as As, aw as ls } from "./index-CoBdoP6X.js";
|
|
2
2
|
export {
|
|
3
3
|
e as CRASH_ERROR_MESSAGE,
|
|
4
4
|
r as Components,
|
package/dist/spot-react.umd.cjs
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
dollarValueOut
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(h=>({...h,timestamp:new Date(h.timestamp).getTime()}))}})};class Cw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Tw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{try{const a=await vw({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([kw({chainId:e,orders:a,signal:t}),Ew({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Ps(d.exchange,l.exchange)&&Ps(d.twapAddress,l.twapAddress));return xw(l,e,u,Aw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)}catch{return[]}},Aw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ps(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Fm(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Om(e.ask_srcAmount,a);return Sw(o,e.ask_deadline*1e3,n)},Om=(e,t)=>{if(!t||!e)return 0;const r=j(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Sw=(e,t,r)=>e===100?ct.Completed:r==="CANCELED"?ct.Canceled:r==="COMPLETED"?ct.Completed:t>Date.now()?ct.Open:ct.Expired,Dm=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Tw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:s.twapConfig?[s.twapConfig]:[]}}):Promise.resolve([]),yw({chainId:r,signal:e,account:a,exchange:s==null?void 0:s.adapter})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Pw={version:"0.0.61"};var Ta=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Iw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Bw=(y5=class{constructor(){le(this,fn,Iw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fn),provider:e}),J(this,fn,e),process.env.NODE_ENV!=="production"&&J(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&J(this,pa,!0),N(this,fn).setTimeout(e,t)}clearTimeout(e){N(this,fn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&J(this,pa,!0),N(this,fn).setInterval(e,t)}clearInterval(e){N(this,fn).clearInterval(e)}},fn=new WeakMap,pa=new WeakMap,y5),Fs=new Bw;function Fw(e){setTimeout(e,0)}var Us=typeof window>"u"||"Deno"in globalThis;function jt(){}function Uw(e,t){return typeof e=="function"?e(t):e}function md(e){return typeof e=="number"&&e>=0&&e!==1/0}function _m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zn(e,t){return typeof e=="function"?e(t):e}function vr(e,t){return typeof e=="function"?e(t):e}function Mm(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==bd(o,t.options))return!1}else if(!Uo(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Nm(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Os(t.options.mutationKey)!==Os(a))return!1}else if(!Uo(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function bd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Os)(e)}function Os(e){return JSON.stringify(e,(t,r)=>gd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Uo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Uo(e[r],t[r])):!1}var Ow=Object.prototype.hasOwnProperty;function yd(e,t){if(e===t)return e;const r=Lm(e)&&Lm(t);if(!r&&!(gd(e)&&gd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:Ow.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const h=yd(d,f);i[u]=h,h===d&&c++}return s===o&&c===s?e:i}function Uc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Lm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gd(e){if(!zm(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!zm(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function zm(e){return Object.prototype.toString.call(e)==="[object Object]"}function Dw(e){return new Promise(t=>{Fs.setTimeout(t,e)})}function xd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return yd(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return yd(e,t)}return t}function _w(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Mw(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Oc=Symbol();function Rm(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Oc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Oc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hm(e,t){return typeof e=="function"?e(...t):!!e}var Nw=(g5=class extends Ta{constructor(){super();le(this,fa);le(this,ys);le(this,go);J(this,go,t=>{if(!Us&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,ys)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,ys))==null||t.call(this),J(this,ys,void 0))}setEventListener(t){var r;J(this,go,t),(r=N(this,ys))==null||r.call(this),J(this,ys,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(J(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,ys=new WeakMap,go=new WeakMap,g5),wd=new Nw;function vd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Lw=Fw;function zw(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Lw;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var kt=zw(),Rw=(x5=class extends Ta{constructor(){super();le(this,xo,!0);le(this,gs);le(this,wo);J(this,wo,t=>{if(!Us&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),J(this,gs,void 0))}setEventListener(t){var r;J(this,wo,t),(r=N(this,gs))==null||r.call(this),J(this,gs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(J(this,xo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,gs=new WeakMap,wo=new WeakMap,x5),Dc=new Rw;function Hw(e){return Math.min(1e3*2**e,3e4)}function $m(e){return(e??"online")==="online"?Dc.isOnline():!0}var Ed=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Gm(e){let t=!1,r=0,n;const s=vd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new Ed(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>wd.isFocused()&&(e.networkMode==="always"||Dc.isOnline())&&e.canRun(),u=()=>$m(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},h=()=>new Promise(g=>{var E;n=v=>{(a()||l())&&g(v)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var z;if(a())return;const w=e.retry??(Us?0:3),A=e.retryDelay??Hw,C=typeof A=="function"?A(r,v):A,D=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,v);if(t||!D){f(v);return}r++,(z=e.onFail)==null||z.call(e,r,v),Dw(C).then(()=>l()?void 0:h()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():h().then(y),s)}}var jm=(w5=class{constructor(){le(this,ha)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),md(this.gcTime)&&J(this,ha,Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Us?1/0:300*1e3))}clearGcTimeout(){N(this,ha)&&(Fs.clearTimeout(N(this,ha)),J(this,ha,void 0))}},ha=new WeakMap,w5),$w=(v5=class extends jm{constructor(t){super();le(this,Yr);le(this,ma);le(this,vo);le(this,Br);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);J(this,ya,!1),J(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],J(this,ba,t.client),J(this,Br,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,ma,qm(this.options)),this.state=t.state??N(this,ma),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=qm(this.options);r.data!==void 0&&(this.setState(Wm(r.data,r.dataUpdatedAt)),J(this,ma,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=xd(this.state.data,t,this.options);return Se(this,Yr,qn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Se(this,Yr,qn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ma))}isActive(){return this.observers.some(t=>vr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Zn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!_m(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Yr,qn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,h,y,g,E,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(D=>D.options.queryFn);C&&this.setOptions(C.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(J(this,ya,!0),n.signal)})},a=()=>{const C=Rm(this.options,r),z=(()=>{const T={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return J(this,ya,!1),this.options.persister?this.options.persister(C,z,this):C(z)},i=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(C),C})();(l=this.options.behavior)==null||l.onFetch(i,this),J(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Yr,qn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),J(this,Bt,Gm({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:C=>{C instanceof Ed&&C.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),n.abort()},onFail:(C,D)=>{Se(this,Yr,qn).call(this,{type:"failed",failureCount:C,error:D})},onPause:()=>{Se(this,Yr,qn).call(this,{type:"pause"})},onContinue:()=>{Se(this,Yr,qn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const C=await N(this,Bt).start();if(C===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(C),(h=(f=N(this,Br).config).onSuccess)==null||h.call(f,C,this),(g=(y=N(this,Br).config).onSettled)==null||g.call(y,C,this.state.error,this),C}catch(C){if(C instanceof Ed){if(C.silent)return N(this,Bt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Se(this,Yr,qn).call(this,{type:"error",error:C}),(v=(E=N(this,Br).config).onError)==null||v.call(E,C,this),(A=(w=N(this,Br).config).onSettled)==null||A.call(w,this.state.data,C,this),C}finally{this.scheduleGc()}}},ma=new WeakMap,vo=new WeakMap,Br=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Yr=new WeakSet,qn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Vm(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Wm(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return J(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Br).notify({query:this,type:"updated",action:t})})},v5);function Vm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$m(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Wm(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qm(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Gw=(E5=class extends Ta{constructor(t,r){super();le(this,Ve);le(this,sr);le(this,Oe);le(this,vc);le(this,qt);le(this,ga);le(this,Eo);le(this,$n);le(this,xs);le(this,Ec);le(this,ko);le(this,Co);le(this,xa);le(this,wa);le(this,ws);le(this,To,new Set);this.options=r,J(this,sr,t),J(this,xs,null),J(this,$n,vd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Oe).addObserver(this),Ym(N(this,Oe),this.options)?Se(this,Ve,Tc).call(this):this.updateResult(),Se(this,Ve,Ph).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kd(N(this,Oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kd(N(this,Oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ve,Ih).call(this),Se(this,Ve,Bh).call(this),N(this,Oe).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,Oe);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vr(this.options.enabled,N(this,Oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ve,Fh).call(this),N(this,Oe).setOptions(this.options),r._defaulted&&!Uc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Oe),observer:this});const s=this.hasListeners();s&&Km(N(this,Oe),n,this.options,r)&&Se(this,Ve,Tc).call(this),this.updateResult(),s&&(N(this,Oe)!==n||vr(this.options.enabled,N(this,Oe))!==vr(r.enabled,N(this,Oe))||Zn(this.options.staleTime,N(this,Oe))!==Zn(r.staleTime,N(this,Oe)))&&Se(this,Ve,Th).call(this);const a=Se(this,Ve,Ah).call(this);s&&(N(this,Oe)!==n||vr(this.options.enabled,N(this,Oe))!==vr(r.enabled,N(this,Oe))||a!==N(this,ws))&&Se(this,Ve,Sh).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return Vw(this,n)&&(J(this,qt,n),J(this,Eo,this.options),J(this,ga,N(this,Oe).state)),n}getCurrentResult(){return N(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,$n).status==="pending"&&N(this,$n).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,To).add(t)}getCurrentQuery(){return N(this,Oe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,sr).defaultQueryOptions(t),n=N(this,sr).getQueryCache().build(N(this,sr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,Ve,Tc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var b;const n=N(this,Oe),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,Eo),l=t!==n?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,h;if(r._optimisticResults){const x=this.hasListeners(),S=!x&&Ym(t,r),I=x&&Km(t,n,r,s);(S||I)&&(d={...d,...Vm(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:E}=d;h=d.data;let v=!1;if(r.placeholderData!==void 0&&h===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof r.placeholderData=="function"?r.placeholderData((b=N(this,Co))==null?void 0:b.state.data,N(this,Co)):r.placeholderData,x!==void 0&&(E="success",h=xd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&h!==void 0&&!v)if(a&&h===(o==null?void 0:o.data)&&r.select===N(this,Ec))h=N(this,ko);else try{J(this,Ec,r.select),h=r.select(h),h=xd(a==null?void 0:a.data,h,r),J(this,ko,h),J(this,xs,null)}catch(x){J(this,xs,x)}N(this,xs)&&(y=N(this,xs),h=N(this,ko),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",A=E==="pending",C=E==="error",D=A&&w,z=h!==void 0,m={status:E,fetchStatus:d.fetchStatus,isPending:A,isSuccess:E==="success",isError:C,isInitialLoading:D,isLoading:D,data:h,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!A,isLoadingError:C&&!z,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&z,isStale:Cd(t,r),refetch:this.refetch,promise:N(this,$n),isEnabled:vr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{m.status==="error"?F.reject(m.error):m.data!==void 0&&F.resolve(m.data)},S=()=>{const F=J(this,$n,m.promise=vd());x(F)},I=N(this,$n);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(m.status==="error"||m.data!==I.value)&&S();break;case"rejected":(m.status!=="error"||m.error!==I.reason)&&S();break}}return m}updateResult(){const t=N(this,qt),r=this.createResult(N(this,Oe),this.options);if(J(this,ga,N(this,Oe).state),J(this,Eo,this.options),N(this,ga).data!==void 0&&J(this,Co,N(this,Oe)),Uc(r,t))return;J(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,To).size)return!0;const o=new Set(a??N(this,To));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Se(this,Ve,_5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ve,Ph).call(this)}},sr=new WeakMap,Oe=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,Eo=new WeakMap,$n=new WeakMap,xs=new WeakMap,Ec=new WeakMap,ko=new WeakMap,Co=new WeakMap,xa=new WeakMap,wa=new WeakMap,ws=new WeakMap,To=new WeakMap,Ve=new WeakSet,Tc=function(t){Se(this,Ve,Fh).call(this);let r=N(this,Oe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},Th=function(){Se(this,Ve,Ih).call(this);const t=Zn(this.options.staleTime,N(this,Oe));if(Us||N(this,qt).isStale||!md(t))return;const n=_m(N(this,qt).dataUpdatedAt,t)+1;J(this,xa,Fs.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},Ah=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Oe)):this.options.refetchInterval)??!1},Sh=function(t){Se(this,Ve,Bh).call(this),J(this,ws,t),!(Us||vr(this.options.enabled,N(this,Oe))===!1||!md(N(this,ws))||N(this,ws)===0)&&J(this,wa,Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||wd.isFocused())&&Se(this,Ve,Tc).call(this)},N(this,ws)))},Ph=function(){Se(this,Ve,Th).call(this),Se(this,Ve,Sh).call(this,Se(this,Ve,Ah).call(this))},Ih=function(){N(this,xa)&&(Fs.clearTimeout(N(this,xa)),J(this,xa,void 0))},Bh=function(){N(this,wa)&&(Fs.clearInterval(N(this,wa)),J(this,wa,void 0))},Fh=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,Oe))return;const r=N(this,Oe);J(this,Oe,t),J(this,vc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},_5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,Oe),type:"observerResultsUpdated"})})},E5);function jw(e,t){return vr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ym(e,t){return jw(e,t)||e.state.data!==void 0&&kd(e,t,t.refetchOnMount)}function kd(e,t,r){if(vr(t.enabled,e)!==!1&&Zn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Cd(e,t)}return!1}function Km(e,t,r,n){return(e!==t||vr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Cd(e,r)}function Cd(e,t){return vr(t.enabled,e)!==!1&&e.isStaleByTime(Zn(t.staleTime,e))}function Vw(e,t){return!Uc(e.getCurrentResult(),t)}function Zm(e){return{onFetch:(t,r)=>{var u,d,f,h,y;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Rm(t.options,t.fetchOptions),w=async(A,C,D)=>{if(g)return Promise.reject();if(C==null&&A.pages.length)return Promise.resolve(A);const T=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:C,direction:D?"backward":"forward",meta:t.options.meta};return E(S),S})(),m=await v(T),{maxPages:b}=t.options,x=D?Mw:_w;return{pages:x(A.pages,m,b),pageParams:x(A.pageParams,C,b)}};if(s&&a.length){const A=s==="backward",C=A?Ww:Xm,D={pages:a,pageParams:o},z=C(n,D);i=await w(D,z,A)}else{const A=e??a.length;do{const C=c===0?o[0]??n.initialPageParam:Xm(n,i);if(c>0&&C==null)break;i=await w(i,C),c++}while(c<A)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Xm(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Ww(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var qw=(k5=class extends jm{constructor(t){super();le(this,mn);le(this,kc);le(this,hn);le(this,Yt);le(this,va);J(this,kc,t.client),this.mutationId=t.mutationId,J(this,Yt,t.mutationCache),J(this,hn,[]),this.state=t.state||Qm(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,hn).includes(t)||(N(this,hn).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,hn,N(this,hn).filter(r=>r!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,hn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,h,y,g,E,v,w,A,C,D,z,T,m,b;const r=()=>{Se(this,mn,Ts).call(this,{type:"continue"})},n={client:N(this,kc),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,va,Gm({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Se(this,mn,Ts).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Se(this,mn,Ts).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)r();else{Se(this,mn,Ts).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,n));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));S!==this.state.context&&Se(this,mn,Ts).call(this,{type:"pending",context:S,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,x,t,this.state.context,n)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,n)),await((v=(E=this.options).onSettled)==null?void 0:v.call(E,x,null,t,this.state.context,n)),Se(this,mn,Ts).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,n)),await((D=(C=this.options).onError)==null?void 0:D.call(C,x,t,this.state.context,n)),await((T=(z=N(this,Yt).config).onSettled)==null?void 0:T.call(z,void 0,x,this.state.variables,this.state.context,this,n)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,void 0,x,t,this.state.context,n)),x}finally{Se(this,mn,Ts).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},kc=new WeakMap,hn=new WeakMap,Yt=new WeakMap,va=new WeakMap,mn=new WeakSet,Ts=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{N(this,hn).forEach(n=>{n.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},k5);function Qm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yw=(C5=class extends Ta{constructor(t={}){super();le(this,Gn);le(this,Kr);le(this,Cc);this.config=t,J(this,Gn,new Set),J(this,Kr,new Map),J(this,Cc,0)}build(t,r,n){const s=new qw({client:t,mutationCache:this,mutationId:++Zu(this,Cc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,Gn).add(t);const r=_c(t);if(typeof r=="string"){const n=N(this,Kr).get(r);n?n.push(t):N(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,Gn).delete(t)){const r=_c(t);if(typeof r=="string"){const n=N(this,Kr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=_c(t);if(typeof r=="string"){const n=N(this,Kr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=_c(t);if(typeof r=="string"){const s=(n=N(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,Gn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,Gn).clear(),N(this,Kr).clear()})}getAll(){return Array.from(N(this,Gn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Nm(r,n))}findAll(t={}){return this.getAll().filter(r=>Nm(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(jt))))}},Gn=new WeakMap,Kr=new WeakMap,Cc=new WeakMap,C5);function _c(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Kw=(T5=class extends Ta{constructor(t,r){super();le(this,Wn);le(this,jn);le(this,vs);le(this,ar);le(this,Vn);J(this,jn,t),this.setOptions(r),this.bindMethods(),Se(this,Wn,Xu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,jn).defaultMutationOptions(t),Uc(this.options,r)||N(this,jn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Os(r.mutationKey)!==Os(this.options.mutationKey)?this.reset():((n=N(this,ar))==null?void 0:n.state.status)==="pending"&&N(this,ar).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,ar))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,Wn,Xu).call(this),Se(this,Wn,Uh).call(this,t)}getCurrentResult(){return N(this,vs)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),J(this,ar,void 0),Se(this,Wn,Xu).call(this),Se(this,Wn,Uh).call(this)}mutate(t,r){var n;return J(this,Vn,r),(n=N(this,ar))==null||n.removeObserver(this),J(this,ar,N(this,jn).getMutationCache().build(N(this,jn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},jn=new WeakMap,vs=new WeakMap,ar=new WeakMap,Vn=new WeakMap,Wn=new WeakSet,Xu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Qm();J(this,vs,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Uh=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Vn)&&this.hasListeners()){const u=N(this,vs).variables,d=N(this,vs).context,f={client:N(this,jn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Vn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Vn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Vn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Vn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,vs))})})},T5),Zw=(A5=class extends Ta{constructor(t={}){super();le(this,bn);this.config=t,J(this,bn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??bd(s,r);let o=this.get(a);return o||(o=new $w({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,bn).has(t.queryHash)||(N(this,bn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,bn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,bn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,bn).get(t)}getAll(){return[...N(this,bn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Mm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Mm(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bn=new WeakMap,A5),Xw=(S5=class{constructor(e={}){le(this,ft);le(this,Es);le(this,ks);le(this,Ao);le(this,So);le(this,Cs);le(this,Po);le(this,Io);J(this,ft,e.queryCache||new Zw),J(this,Es,e.mutationCache||new Yw),J(this,ks,e.defaultOptions||{}),J(this,Ao,new Map),J(this,So,new Map),J(this,Cs,0)}mount(){Zu(this,Cs)._++,N(this,Cs)===1&&(J(this,Po,wd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),J(this,Io,Dc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Zu(this,Cs)._--,N(this,Cs)===0&&((e=N(this,Po))==null||e.call(this),J(this,Po,void 0),(t=N(this,Io))==null||t.call(this),J(this,Io,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,ft).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Zn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(n.queryHash),a=s==null?void 0:s.state.data,o=Uw(t,a);if(o!==void 0)return N(this,ft).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,ft);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,ft).build(this,t);return r.isStaleByTime(Zn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=Zm(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=Zm(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dc.isOnline()?N(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,Es)}getDefaultOptions(){return N(this,ks)}setDefaultOptions(e){J(this,ks,e)}setQueryDefaults(e,t){N(this,Ao).set(Os(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Ao).values()],r={};return t.forEach(n=>{Uo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,So).set(Os(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,So).values()],r={};return t.forEach(n=>{Uo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,ks).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Oc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,Es).clear()}},ft=new WeakMap,Es=new WeakMap,ks=new WeakMap,Ao=new WeakMap,So=new WeakMap,Cs=new WeakMap,Po=new WeakMap,Io=new WeakMap,S5),Jm=xt.createContext(void 0),Mc=e=>{const t=xt.useContext(Jm);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qw=({client:e,children:t})=>(xt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Jm.Provider,{value:e,children:t})),e1=xt.createContext(!1),Jw=()=>xt.useContext(e1);e1.Provider;function e3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var t3=xt.createContext(e3()),r3=()=>xt.useContext(t3),n3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},s3=e=>{xt.useEffect(()=>{e.clearReset()},[e])},a3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Hm(r,[e.error,n])),o3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},i3=(e,t)=>e.isLoading&&e.isFetching&&!t,c3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,t1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function l3(e,t,r){var d,f,h,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Jw(),s=r3(),a=Mc(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",o3(o),n3(o,s),s3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=xt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(xt.useSyncExternalStore(xt.useCallback(E=>{const v=u?c.subscribe(kt.batchCalls(E)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),xt.useEffect(()=>{c.setOptions(o)},[o,c]),c3(o,l))throw t1(o,c,s);if(a3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||y.call(h,o,l),o.experimental_prefetchInRender&&!Us&&i3(l,n)){const E=i?t1(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function u3(e,t){return l3(e,Gw)}function Zr(e,t){const r=Mc(),[n]=xt.useState(()=>new Kw(r,e));xt.useEffect(()=>{n.setOptions(e)},[n,e]);const s=xt.useSyncExternalStore(xt.useCallback(o=>n.subscribe(kt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=xt.useCallback((o,i)=>{n.mutate(o,i).catch(jt)},[n]);if(s.error&&Hm(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const d3=M.createContext(null),Td={didCatch:!1,error:null};class p3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Td}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(Td)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&f3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(Td)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(d3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function f3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const r1=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(h=>h(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},h3=(e=>e?r1(e):r1),m3=e=>e;function b3(e,t=m3){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const n1=e=>{const t=h3(e),r=n=>b3(t,n);return Object.assign(r,t),r},y3=(e=>e?n1(e):n1),s1={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},te=y3((e,t)=>({state:s1,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...s1,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Ne=e=>`orbs_${e}`;function Oo({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const a1=M.createContext({});function g3({children:e,...t}){return B.jsx(a1.Provider,{value:t,children:e})}const Xr=()=>M.useContext(a1);var ht=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(ht||{});const x3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Nc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(C3,{}),s&&B.jsx(Oo,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(w3,{link:r,text:n}),a]})}const w3=({link:e,text:t})=>{const{swapStatus:r}=Xr();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(A3,{}),e?B.jsx(v3,{link:e,text:t}):r===ht.FAILED?void 0:B.jsx(Oo,{children:t})]})},v3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function E3(){const{components:e}=Xr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Ne("TradeStepLayoutSuccessIcon"),children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function k3(){const{components:e}=Xr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Ne("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const C3=()=>{const{swapStatus:e}=Xr();return e===ht.SUCCESS?B.jsx(E3,{}):e===ht.FAILED?B.jsx(k3,{}):B.jsx(T3,{})},T3=()=>{const{components:e}=Xr();return e.Loader?e.Loader:B.jsx(x3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},A3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Xr();return r!==ht.LOADING||e===1?null:B.jsx("div",{className:Ne("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Ne("StepIndicatorLine")})})},S3=({error:e,footerLink:t,footerText:r})=>B.jsx(Nc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function P3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Ne("TradepPreviewIcon"),children:B.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const o1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Xr();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(i1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(P3,{}),B.jsx(i1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},i1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Oo,{children:[t," ",e==null?void 0:e.symbol]})]});function I3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Nc,{title:e,className:Ne("Success"),body:!n&&B.jsx(o1,{}),footerLink:t,footerText:r})}const c1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${n}`,style:a,children:r})};function l1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const B3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(l1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(l1,{className:`${Ne("MainContentRectengularLoader")}`})]}),F3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Xr(),d=B.jsx(d1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(U3,{}):B.jsxs(c1,{children:[d,B.jsx(B3,{})]}):B.jsx(c1,{children:d})},u1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Oo,{className:`${Ne("MainTokenTitle")}`,children:n}),B.jsx(Oo,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Ne("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function U3(){const{currentStep:e}=Xr();return e?B.jsx(Nc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(o1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const d1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(u1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(u1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Xn=e=>B.jsx(g3,{...e,children:B.jsx(O3,{})}),O3=()=>{const{swapStatus:e,components:t,className:r}=Xr();return B.jsx("div",{className:`${Ne("SwapFlow")} ${r}`,children:e===ht.SUCCESS?t==null?void 0:t.Success:e===ht.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Xn.Success=I3,Xn.Failed=S3,Xn.Main=F3,Xn.StepLayout=Nc;var Ds=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ds||{});const D3="1.2.3";let Zt=class Oh extends Error{constructor(t,r={}){var o;const n=r.cause instanceof Oh?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,s=r.cause instanceof Oh&&r.cause.docsPath||r.docsPath,a=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${D3}`].join(`
|
|
64
|
+
`,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(h=>({...h,timestamp:new Date(h.timestamp).getTime()}))}})};class Cw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Tw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{try{const a=await vw({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([kw({chainId:e,orders:a,signal:t}),Ew({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Ps(d.exchange,l.exchange)&&Ps(d.twapAddress,l.twapAddress));return xw(l,e,u,Aw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)}catch{return[]}},Aw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ps(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Fm(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Om(e.ask_srcAmount,a);return Sw(o,e.ask_deadline*1e3,n)},Om=(e,t)=>{if(!t||!e)return 0;const r=j(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Sw=(e,t,r)=>e===100?ct.Completed:r==="CANCELED"?ct.Canceled:r==="COMPLETED"?ct.Completed:t>Date.now()?ct.Open:ct.Expired,Dm=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Tw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:s.twapConfig?[s.twapConfig]:[]}}):Promise.resolve([]),yw({chainId:r,signal:e,account:a,exchange:s==null?void 0:s.adapter})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Pw={version:"0.0.62"};var Ta=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Iw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Bw=(y5=class{constructor(){le(this,fn,Iw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fn),provider:e}),J(this,fn,e),process.env.NODE_ENV!=="production"&&J(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&J(this,pa,!0),N(this,fn).setTimeout(e,t)}clearTimeout(e){N(this,fn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&J(this,pa,!0),N(this,fn).setInterval(e,t)}clearInterval(e){N(this,fn).clearInterval(e)}},fn=new WeakMap,pa=new WeakMap,y5),Fs=new Bw;function Fw(e){setTimeout(e,0)}var Us=typeof window>"u"||"Deno"in globalThis;function jt(){}function Uw(e,t){return typeof e=="function"?e(t):e}function md(e){return typeof e=="number"&&e>=0&&e!==1/0}function _m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zn(e,t){return typeof e=="function"?e(t):e}function vr(e,t){return typeof e=="function"?e(t):e}function Mm(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==bd(o,t.options))return!1}else if(!Uo(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Nm(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Os(t.options.mutationKey)!==Os(a))return!1}else if(!Uo(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function bd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Os)(e)}function Os(e){return JSON.stringify(e,(t,r)=>gd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Uo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Uo(e[r],t[r])):!1}var Ow=Object.prototype.hasOwnProperty;function yd(e,t){if(e===t)return e;const r=Lm(e)&&Lm(t);if(!r&&!(gd(e)&&gd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:Ow.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const h=yd(d,f);i[u]=h,h===d&&c++}return s===o&&c===s?e:i}function Uc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Lm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gd(e){if(!zm(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!zm(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function zm(e){return Object.prototype.toString.call(e)==="[object Object]"}function Dw(e){return new Promise(t=>{Fs.setTimeout(t,e)})}function xd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return yd(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return yd(e,t)}return t}function _w(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Mw(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Oc=Symbol();function Rm(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Oc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Oc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hm(e,t){return typeof e=="function"?e(...t):!!e}var Nw=(g5=class extends Ta{constructor(){super();le(this,fa);le(this,ys);le(this,go);J(this,go,t=>{if(!Us&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,ys)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,ys))==null||t.call(this),J(this,ys,void 0))}setEventListener(t){var r;J(this,go,t),(r=N(this,ys))==null||r.call(this),J(this,ys,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(J(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,ys=new WeakMap,go=new WeakMap,g5),wd=new Nw;function vd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Lw=Fw;function zw(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Lw;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var kt=zw(),Rw=(x5=class extends Ta{constructor(){super();le(this,xo,!0);le(this,gs);le(this,wo);J(this,wo,t=>{if(!Us&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),J(this,gs,void 0))}setEventListener(t){var r;J(this,wo,t),(r=N(this,gs))==null||r.call(this),J(this,gs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(J(this,xo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,gs=new WeakMap,wo=new WeakMap,x5),Dc=new Rw;function Hw(e){return Math.min(1e3*2**e,3e4)}function $m(e){return(e??"online")==="online"?Dc.isOnline():!0}var Ed=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Gm(e){let t=!1,r=0,n;const s=vd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new Ed(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>wd.isFocused()&&(e.networkMode==="always"||Dc.isOnline())&&e.canRun(),u=()=>$m(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},h=()=>new Promise(g=>{var E;n=v=>{(a()||l())&&g(v)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var z;if(a())return;const w=e.retry??(Us?0:3),A=e.retryDelay??Hw,C=typeof A=="function"?A(r,v):A,D=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,v);if(t||!D){f(v);return}r++,(z=e.onFail)==null||z.call(e,r,v),Dw(C).then(()=>l()?void 0:h()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():h().then(y),s)}}var jm=(w5=class{constructor(){le(this,ha)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),md(this.gcTime)&&J(this,ha,Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Us?1/0:300*1e3))}clearGcTimeout(){N(this,ha)&&(Fs.clearTimeout(N(this,ha)),J(this,ha,void 0))}},ha=new WeakMap,w5),$w=(v5=class extends jm{constructor(t){super();le(this,Yr);le(this,ma);le(this,vo);le(this,Br);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);J(this,ya,!1),J(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],J(this,ba,t.client),J(this,Br,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,ma,qm(this.options)),this.state=t.state??N(this,ma),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=qm(this.options);r.data!==void 0&&(this.setState(Wm(r.data,r.dataUpdatedAt)),J(this,ma,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=xd(this.state.data,t,this.options);return Se(this,Yr,qn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Se(this,Yr,qn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ma))}isActive(){return this.observers.some(t=>vr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Zn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!_m(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Yr,qn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,h,y,g,E,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(D=>D.options.queryFn);C&&this.setOptions(C.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(J(this,ya,!0),n.signal)})},a=()=>{const C=Rm(this.options,r),z=(()=>{const T={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return J(this,ya,!1),this.options.persister?this.options.persister(C,z,this):C(z)},i=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(C),C})();(l=this.options.behavior)==null||l.onFetch(i,this),J(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Yr,qn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),J(this,Bt,Gm({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:C=>{C instanceof Ed&&C.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),n.abort()},onFail:(C,D)=>{Se(this,Yr,qn).call(this,{type:"failed",failureCount:C,error:D})},onPause:()=>{Se(this,Yr,qn).call(this,{type:"pause"})},onContinue:()=>{Se(this,Yr,qn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const C=await N(this,Bt).start();if(C===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(C),(h=(f=N(this,Br).config).onSuccess)==null||h.call(f,C,this),(g=(y=N(this,Br).config).onSettled)==null||g.call(y,C,this.state.error,this),C}catch(C){if(C instanceof Ed){if(C.silent)return N(this,Bt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Se(this,Yr,qn).call(this,{type:"error",error:C}),(v=(E=N(this,Br).config).onError)==null||v.call(E,C,this),(A=(w=N(this,Br).config).onSettled)==null||A.call(w,this.state.data,C,this),C}finally{this.scheduleGc()}}},ma=new WeakMap,vo=new WeakMap,Br=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Yr=new WeakSet,qn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Vm(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Wm(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return J(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Br).notify({query:this,type:"updated",action:t})})},v5);function Vm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$m(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Wm(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qm(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Gw=(E5=class extends Ta{constructor(t,r){super();le(this,Ve);le(this,sr);le(this,Oe);le(this,vc);le(this,qt);le(this,ga);le(this,Eo);le(this,$n);le(this,xs);le(this,Ec);le(this,ko);le(this,Co);le(this,xa);le(this,wa);le(this,ws);le(this,To,new Set);this.options=r,J(this,sr,t),J(this,xs,null),J(this,$n,vd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Oe).addObserver(this),Ym(N(this,Oe),this.options)?Se(this,Ve,Tc).call(this):this.updateResult(),Se(this,Ve,Ph).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kd(N(this,Oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kd(N(this,Oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ve,Ih).call(this),Se(this,Ve,Bh).call(this),N(this,Oe).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,Oe);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vr(this.options.enabled,N(this,Oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ve,Fh).call(this),N(this,Oe).setOptions(this.options),r._defaulted&&!Uc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Oe),observer:this});const s=this.hasListeners();s&&Km(N(this,Oe),n,this.options,r)&&Se(this,Ve,Tc).call(this),this.updateResult(),s&&(N(this,Oe)!==n||vr(this.options.enabled,N(this,Oe))!==vr(r.enabled,N(this,Oe))||Zn(this.options.staleTime,N(this,Oe))!==Zn(r.staleTime,N(this,Oe)))&&Se(this,Ve,Th).call(this);const a=Se(this,Ve,Ah).call(this);s&&(N(this,Oe)!==n||vr(this.options.enabled,N(this,Oe))!==vr(r.enabled,N(this,Oe))||a!==N(this,ws))&&Se(this,Ve,Sh).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return Vw(this,n)&&(J(this,qt,n),J(this,Eo,this.options),J(this,ga,N(this,Oe).state)),n}getCurrentResult(){return N(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,$n).status==="pending"&&N(this,$n).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,To).add(t)}getCurrentQuery(){return N(this,Oe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,sr).defaultQueryOptions(t),n=N(this,sr).getQueryCache().build(N(this,sr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,Ve,Tc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var b;const n=N(this,Oe),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,Eo),l=t!==n?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,h;if(r._optimisticResults){const x=this.hasListeners(),S=!x&&Ym(t,r),I=x&&Km(t,n,r,s);(S||I)&&(d={...d,...Vm(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:E}=d;h=d.data;let v=!1;if(r.placeholderData!==void 0&&h===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof r.placeholderData=="function"?r.placeholderData((b=N(this,Co))==null?void 0:b.state.data,N(this,Co)):r.placeholderData,x!==void 0&&(E="success",h=xd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&h!==void 0&&!v)if(a&&h===(o==null?void 0:o.data)&&r.select===N(this,Ec))h=N(this,ko);else try{J(this,Ec,r.select),h=r.select(h),h=xd(a==null?void 0:a.data,h,r),J(this,ko,h),J(this,xs,null)}catch(x){J(this,xs,x)}N(this,xs)&&(y=N(this,xs),h=N(this,ko),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",A=E==="pending",C=E==="error",D=A&&w,z=h!==void 0,m={status:E,fetchStatus:d.fetchStatus,isPending:A,isSuccess:E==="success",isError:C,isInitialLoading:D,isLoading:D,data:h,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!A,isLoadingError:C&&!z,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&z,isStale:Cd(t,r),refetch:this.refetch,promise:N(this,$n),isEnabled:vr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{m.status==="error"?F.reject(m.error):m.data!==void 0&&F.resolve(m.data)},S=()=>{const F=J(this,$n,m.promise=vd());x(F)},I=N(this,$n);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(m.status==="error"||m.data!==I.value)&&S();break;case"rejected":(m.status!=="error"||m.error!==I.reason)&&S();break}}return m}updateResult(){const t=N(this,qt),r=this.createResult(N(this,Oe),this.options);if(J(this,ga,N(this,Oe).state),J(this,Eo,this.options),N(this,ga).data!==void 0&&J(this,Co,N(this,Oe)),Uc(r,t))return;J(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,To).size)return!0;const o=new Set(a??N(this,To));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Se(this,Ve,_5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ve,Ph).call(this)}},sr=new WeakMap,Oe=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,Eo=new WeakMap,$n=new WeakMap,xs=new WeakMap,Ec=new WeakMap,ko=new WeakMap,Co=new WeakMap,xa=new WeakMap,wa=new WeakMap,ws=new WeakMap,To=new WeakMap,Ve=new WeakSet,Tc=function(t){Se(this,Ve,Fh).call(this);let r=N(this,Oe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},Th=function(){Se(this,Ve,Ih).call(this);const t=Zn(this.options.staleTime,N(this,Oe));if(Us||N(this,qt).isStale||!md(t))return;const n=_m(N(this,qt).dataUpdatedAt,t)+1;J(this,xa,Fs.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},Ah=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Oe)):this.options.refetchInterval)??!1},Sh=function(t){Se(this,Ve,Bh).call(this),J(this,ws,t),!(Us||vr(this.options.enabled,N(this,Oe))===!1||!md(N(this,ws))||N(this,ws)===0)&&J(this,wa,Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||wd.isFocused())&&Se(this,Ve,Tc).call(this)},N(this,ws)))},Ph=function(){Se(this,Ve,Th).call(this),Se(this,Ve,Sh).call(this,Se(this,Ve,Ah).call(this))},Ih=function(){N(this,xa)&&(Fs.clearTimeout(N(this,xa)),J(this,xa,void 0))},Bh=function(){N(this,wa)&&(Fs.clearInterval(N(this,wa)),J(this,wa,void 0))},Fh=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,Oe))return;const r=N(this,Oe);J(this,Oe,t),J(this,vc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},_5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,Oe),type:"observerResultsUpdated"})})},E5);function jw(e,t){return vr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ym(e,t){return jw(e,t)||e.state.data!==void 0&&kd(e,t,t.refetchOnMount)}function kd(e,t,r){if(vr(t.enabled,e)!==!1&&Zn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Cd(e,t)}return!1}function Km(e,t,r,n){return(e!==t||vr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Cd(e,r)}function Cd(e,t){return vr(t.enabled,e)!==!1&&e.isStaleByTime(Zn(t.staleTime,e))}function Vw(e,t){return!Uc(e.getCurrentResult(),t)}function Zm(e){return{onFetch:(t,r)=>{var u,d,f,h,y;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Rm(t.options,t.fetchOptions),w=async(A,C,D)=>{if(g)return Promise.reject();if(C==null&&A.pages.length)return Promise.resolve(A);const T=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:C,direction:D?"backward":"forward",meta:t.options.meta};return E(S),S})(),m=await v(T),{maxPages:b}=t.options,x=D?Mw:_w;return{pages:x(A.pages,m,b),pageParams:x(A.pageParams,C,b)}};if(s&&a.length){const A=s==="backward",C=A?Ww:Xm,D={pages:a,pageParams:o},z=C(n,D);i=await w(D,z,A)}else{const A=e??a.length;do{const C=c===0?o[0]??n.initialPageParam:Xm(n,i);if(c>0&&C==null)break;i=await w(i,C),c++}while(c<A)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Xm(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Ww(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var qw=(k5=class extends jm{constructor(t){super();le(this,mn);le(this,kc);le(this,hn);le(this,Yt);le(this,va);J(this,kc,t.client),this.mutationId=t.mutationId,J(this,Yt,t.mutationCache),J(this,hn,[]),this.state=t.state||Qm(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,hn).includes(t)||(N(this,hn).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,hn,N(this,hn).filter(r=>r!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,hn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,h,y,g,E,v,w,A,C,D,z,T,m,b;const r=()=>{Se(this,mn,Ts).call(this,{type:"continue"})},n={client:N(this,kc),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,va,Gm({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Se(this,mn,Ts).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Se(this,mn,Ts).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)r();else{Se(this,mn,Ts).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,n));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));S!==this.state.context&&Se(this,mn,Ts).call(this,{type:"pending",context:S,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,x,t,this.state.context,n)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,n)),await((v=(E=this.options).onSettled)==null?void 0:v.call(E,x,null,t,this.state.context,n)),Se(this,mn,Ts).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,n)),await((D=(C=this.options).onError)==null?void 0:D.call(C,x,t,this.state.context,n)),await((T=(z=N(this,Yt).config).onSettled)==null?void 0:T.call(z,void 0,x,this.state.variables,this.state.context,this,n)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,void 0,x,t,this.state.context,n)),x}finally{Se(this,mn,Ts).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},kc=new WeakMap,hn=new WeakMap,Yt=new WeakMap,va=new WeakMap,mn=new WeakSet,Ts=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{N(this,hn).forEach(n=>{n.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},k5);function Qm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yw=(C5=class extends Ta{constructor(t={}){super();le(this,Gn);le(this,Kr);le(this,Cc);this.config=t,J(this,Gn,new Set),J(this,Kr,new Map),J(this,Cc,0)}build(t,r,n){const s=new qw({client:t,mutationCache:this,mutationId:++Zu(this,Cc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,Gn).add(t);const r=_c(t);if(typeof r=="string"){const n=N(this,Kr).get(r);n?n.push(t):N(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,Gn).delete(t)){const r=_c(t);if(typeof r=="string"){const n=N(this,Kr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=_c(t);if(typeof r=="string"){const n=N(this,Kr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=_c(t);if(typeof r=="string"){const s=(n=N(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,Gn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,Gn).clear(),N(this,Kr).clear()})}getAll(){return Array.from(N(this,Gn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Nm(r,n))}findAll(t={}){return this.getAll().filter(r=>Nm(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(jt))))}},Gn=new WeakMap,Kr=new WeakMap,Cc=new WeakMap,C5);function _c(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Kw=(T5=class extends Ta{constructor(t,r){super();le(this,Wn);le(this,jn);le(this,vs);le(this,ar);le(this,Vn);J(this,jn,t),this.setOptions(r),this.bindMethods(),Se(this,Wn,Xu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,jn).defaultMutationOptions(t),Uc(this.options,r)||N(this,jn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Os(r.mutationKey)!==Os(this.options.mutationKey)?this.reset():((n=N(this,ar))==null?void 0:n.state.status)==="pending"&&N(this,ar).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,ar))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,Wn,Xu).call(this),Se(this,Wn,Uh).call(this,t)}getCurrentResult(){return N(this,vs)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),J(this,ar,void 0),Se(this,Wn,Xu).call(this),Se(this,Wn,Uh).call(this)}mutate(t,r){var n;return J(this,Vn,r),(n=N(this,ar))==null||n.removeObserver(this),J(this,ar,N(this,jn).getMutationCache().build(N(this,jn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},jn=new WeakMap,vs=new WeakMap,ar=new WeakMap,Vn=new WeakMap,Wn=new WeakSet,Xu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Qm();J(this,vs,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Uh=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Vn)&&this.hasListeners()){const u=N(this,vs).variables,d=N(this,vs).context,f={client:N(this,jn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Vn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Vn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Vn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Vn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,vs))})})},T5),Zw=(A5=class extends Ta{constructor(t={}){super();le(this,bn);this.config=t,J(this,bn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??bd(s,r);let o=this.get(a);return o||(o=new $w({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,bn).has(t.queryHash)||(N(this,bn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,bn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,bn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,bn).get(t)}getAll(){return[...N(this,bn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Mm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Mm(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bn=new WeakMap,A5),Xw=(S5=class{constructor(e={}){le(this,ft);le(this,Es);le(this,ks);le(this,Ao);le(this,So);le(this,Cs);le(this,Po);le(this,Io);J(this,ft,e.queryCache||new Zw),J(this,Es,e.mutationCache||new Yw),J(this,ks,e.defaultOptions||{}),J(this,Ao,new Map),J(this,So,new Map),J(this,Cs,0)}mount(){Zu(this,Cs)._++,N(this,Cs)===1&&(J(this,Po,wd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),J(this,Io,Dc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Zu(this,Cs)._--,N(this,Cs)===0&&((e=N(this,Po))==null||e.call(this),J(this,Po,void 0),(t=N(this,Io))==null||t.call(this),J(this,Io,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,ft).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Zn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(n.queryHash),a=s==null?void 0:s.state.data,o=Uw(t,a);if(o!==void 0)return N(this,ft).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,ft);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,ft).build(this,t);return r.isStaleByTime(Zn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=Zm(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=Zm(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dc.isOnline()?N(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,Es)}getDefaultOptions(){return N(this,ks)}setDefaultOptions(e){J(this,ks,e)}setQueryDefaults(e,t){N(this,Ao).set(Os(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Ao).values()],r={};return t.forEach(n=>{Uo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,So).set(Os(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,So).values()],r={};return t.forEach(n=>{Uo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,ks).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Oc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,Es).clear()}},ft=new WeakMap,Es=new WeakMap,ks=new WeakMap,Ao=new WeakMap,So=new WeakMap,Cs=new WeakMap,Po=new WeakMap,Io=new WeakMap,S5),Jm=xt.createContext(void 0),Mc=e=>{const t=xt.useContext(Jm);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qw=({client:e,children:t})=>(xt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Jm.Provider,{value:e,children:t})),e1=xt.createContext(!1),Jw=()=>xt.useContext(e1);e1.Provider;function e3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var t3=xt.createContext(e3()),r3=()=>xt.useContext(t3),n3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},s3=e=>{xt.useEffect(()=>{e.clearReset()},[e])},a3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Hm(r,[e.error,n])),o3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},i3=(e,t)=>e.isLoading&&e.isFetching&&!t,c3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,t1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function l3(e,t,r){var d,f,h,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Jw(),s=r3(),a=Mc(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",o3(o),n3(o,s),s3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=xt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(xt.useSyncExternalStore(xt.useCallback(E=>{const v=u?c.subscribe(kt.batchCalls(E)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),xt.useEffect(()=>{c.setOptions(o)},[o,c]),c3(o,l))throw t1(o,c,s);if(a3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||y.call(h,o,l),o.experimental_prefetchInRender&&!Us&&i3(l,n)){const E=i?t1(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function u3(e,t){return l3(e,Gw)}function Zr(e,t){const r=Mc(),[n]=xt.useState(()=>new Kw(r,e));xt.useEffect(()=>{n.setOptions(e)},[n,e]);const s=xt.useSyncExternalStore(xt.useCallback(o=>n.subscribe(kt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=xt.useCallback((o,i)=>{n.mutate(o,i).catch(jt)},[n]);if(s.error&&Hm(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const d3=M.createContext(null),Td={didCatch:!1,error:null};class p3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Td}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(Td)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&f3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(Td)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(d3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function f3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const r1=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(h=>h(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},h3=(e=>e?r1(e):r1),m3=e=>e;function b3(e,t=m3){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const n1=e=>{const t=h3(e),r=n=>b3(t,n);return Object.assign(r,t),r},y3=(e=>e?n1(e):n1),s1={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},te=y3((e,t)=>({state:s1,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...s1,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Ne=e=>`orbs_${e}`;function Oo({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const a1=M.createContext({});function g3({children:e,...t}){return B.jsx(a1.Provider,{value:t,children:e})}const Xr=()=>M.useContext(a1);var ht=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(ht||{});const x3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Nc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(C3,{}),s&&B.jsx(Oo,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(w3,{link:r,text:n}),a]})}const w3=({link:e,text:t})=>{const{swapStatus:r}=Xr();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(A3,{}),e?B.jsx(v3,{link:e,text:t}):r===ht.FAILED?void 0:B.jsx(Oo,{children:t})]})},v3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function E3(){const{components:e}=Xr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Ne("TradeStepLayoutSuccessIcon"),children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function k3(){const{components:e}=Xr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Ne("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const C3=()=>{const{swapStatus:e}=Xr();return e===ht.SUCCESS?B.jsx(E3,{}):e===ht.FAILED?B.jsx(k3,{}):B.jsx(T3,{})},T3=()=>{const{components:e}=Xr();return e.Loader?e.Loader:B.jsx(x3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},A3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Xr();return r!==ht.LOADING||e===1?null:B.jsx("div",{className:Ne("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Ne("StepIndicatorLine")})})},S3=({error:e,footerLink:t,footerText:r})=>B.jsx(Nc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function P3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Ne("TradepPreviewIcon"),children:B.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const o1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Xr();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(i1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(P3,{}),B.jsx(i1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},i1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Oo,{children:[t," ",e==null?void 0:e.symbol]})]});function I3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Nc,{title:e,className:Ne("Success"),body:!n&&B.jsx(o1,{}),footerLink:t,footerText:r})}const c1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${n}`,style:a,children:r})};function l1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const B3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(l1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(l1,{className:`${Ne("MainContentRectengularLoader")}`})]}),F3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Xr(),d=B.jsx(d1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(U3,{}):B.jsxs(c1,{children:[d,B.jsx(B3,{})]}):B.jsx(c1,{children:d})},u1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Oo,{className:`${Ne("MainTokenTitle")}`,children:n}),B.jsx(Oo,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Ne("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function U3(){const{currentStep:e}=Xr();return e?B.jsx(Nc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(o1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const d1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(u1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(u1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Xn=e=>B.jsx(g3,{...e,children:B.jsx(O3,{})}),O3=()=>{const{swapStatus:e,components:t,className:r}=Xr();return B.jsx("div",{className:`${Ne("SwapFlow")} ${r}`,children:e===ht.SUCCESS?t==null?void 0:t.Success:e===ht.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Xn.Success=I3,Xn.Failed=S3,Xn.Main=F3,Xn.StepLayout=Nc;var Ds=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ds||{});const D3="1.2.3";let Zt=class Oh extends Error{constructor(t,r={}){var o;const n=r.cause instanceof Oh?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,s=r.cause instanceof Oh&&r.cause.docsPath||r.docsPath,a=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${D3}`].join(`
|
|
65
65
|
`);super(a),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=s,this.metaMessages=r.metaMessages,this.shortMessage=t}};function xn(e,t){const r=e.exec(t);return r==null?void 0:r.groups}const p1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,f1=/^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)?$/,h1=/^\(.+?\).*?$/,m1=/^tuple(?<array>(\[(\d*)\])*)$/;function Ad(e){let t=e.type;if(m1.test(e.type)&&"components"in e){t="(";const r=e.components.length;for(let s=0;s<r;s++){const a=e.components[s];t+=Ad(a),s<r-1&&(t+=", ")}const n=xn(m1,e.type);return t+=`)${(n==null?void 0:n.array)||""}`,Ad({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Aa(e){let t="";const r=e.length;for(let n=0;n<r;n++){const s=e[n];t+=Ad(s),n!==r-1&&(t+=", ")}return t}function Lc(e){var t;return e.type==="function"?`function ${e.name}(${Aa(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${Aa(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Aa(e.inputs)})`:e.type==="error"?`error ${e.name}(${Aa(e.inputs)})`:e.type==="constructor"?`constructor(${Aa(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const b1=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function _3(e){return b1.test(e)}function M3(e){return xn(b1,e)}const y1=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function N3(e){return y1.test(e)}function L3(e){return xn(y1,e)}const g1=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function z3(e){return g1.test(e)}function R3(e){return xn(g1,e)}const x1=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function zc(e){return x1.test(e)}function H3(e){return xn(x1,e)}const w1=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function $3(e){return w1.test(e)}function G3(e){return xn(w1,e)}const v1=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function j3(e){return v1.test(e)}function V3(e){return xn(v1,e)}const W3=/^receive\(\) external payable$/;function q3(e){return W3.test(e)}const E1=new Set(["memory","indexed","storage","calldata"]),Y3=new Set(["indexed"]),Sd=new Set(["calldata","memory","storage"]);class K3 extends Zt{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Z3 extends Zt{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" 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 X3 extends Zt{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Q3 extends Zt{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class J3 extends Zt{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class e8 extends Zt{constructor({param:t,name:r}){super("Invalid ABI parameter.",{details:t,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 t8 extends Zt{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class r8 extends Zt{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,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 n8 extends Zt{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Sa extends Zt{constructor({signature:t,type:r}){super(`Invalid ${r} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class s8 extends Zt{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class a8 extends Zt{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class o8 extends Zt{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class i8 extends Zt{constructor({current:t,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${t.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 c8(e,t,r){let n="";if(r)for(const s of Object.entries(r)){if(!s)continue;let a="";for(const o of s[1])a+=`[${o.type}${o.name?`:${o.name}`:""}]`;n+=`(${s[0]}{${a}})`}return t?`${t}:${e}${n}`:`${e}${n}`}const Pd=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 Id(e,t={}){if(z3(e))return l8(e,t);if(N3(e))return u8(e,t);if(_3(e))return d8(e,t);if($3(e))return p8(e,t);if(j3(e))return f8(e);if(q3(e))return{type:"receive",stateMutability:"payable"};throw new s8({signature:e})}function l8(e,t={}){const r=R3(e);if(!r)throw new Sa({signature:e,type:"function"});const n=or(r.parameters),s=[],a=n.length;for(let i=0;i<a;i++)s.push(wn(n[i],{modifiers:Sd,structs:t,type:"function"}));const o=[];if(r.returns){const i=or(r.returns),c=i.length;for(let l=0;l<c;l++)o.push(wn(i[l],{modifiers:Sd,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:s,outputs:o}}function u8(e,t={}){const r=L3(e);if(!r)throw new Sa({signature:e,type:"event"});const n=or(r.parameters),s=[],a=n.length;for(let o=0;o<a;o++)s.push(wn(n[o],{modifiers:Y3,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:s}}function d8(e,t={}){const r=M3(e);if(!r)throw new Sa({signature:e,type:"error"});const n=or(r.parameters),s=[],a=n.length;for(let o=0;o<a;o++)s.push(wn(n[o],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:s}}function p8(e,t={}){const r=G3(e);if(!r)throw new Sa({signature:e,type:"constructor"});const n=or(r.parameters),s=[],a=n.length;for(let o=0;o<a;o++)s.push(wn(n[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:s}}function f8(e){const t=V3(e);if(!t)throw new Sa({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const h8=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,m8=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,b8=/^u?int$/;function wn(e,t){var d,f;const r=c8(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Pd.has(r))return Pd.get(r);const n=h1.test(e),s=xn(n?m8:h8,e);if(!s)throw new J3({param:e});if(s.name&&g8(s.name))throw new e8({param:e,name:s.name});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},i=(t==null?void 0:t.structs)??{};let c,l={};if(n){c="tuple";const h=or(s.type),y=[],g=h.length;for(let E=0;E<g;E++)y.push(wn(h[E],{structs:i}));l={components:y}}else if(s.type in i)c="tuple",l={components:i[s.type]};else if(b8.test(s.type))c=`${s.type}256`;else if(s.type==="address payable")c="address";else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!k1(c))throw new X3({type:c});if(s.modifier){if(!((f=(d=t==null?void 0:t.modifiers)==null?void 0:d.has)!=null&&f.call(d,s.modifier)))throw new t8({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(Sd.has(s.modifier)&&!x8(c,!!s.array))throw new r8({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const u={type:`${c}${s.array??""}`,...a,...o,...l};return Pd.set(r,u),u}function or(e,t=[],r="",n=0){const s=e.trim().length;for(let a=0;a<s;a++){const o=e[a],i=e.slice(a+1);switch(o){case",":return n===0?or(i,[...t,r.trim()]):or(i,t,`${r}${o}`,n);case"(":return or(i,t,`${r}${o}`,n+1);case")":return or(i,t,`${r}${o}`,n-1);default:return or(i,t,`${r}${o}`,n)}}if(r==="")return t;if(n!==0)throw new i8({current:r,depth:n});return t.push(r.trim()),t}function k1(e){return e==="address"||e==="bool"||e==="function"||e==="string"||p1.test(e)||f1.test(e)}const y8=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function g8(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||p1.test(e)||f1.test(e)||y8.test(e)}function x8(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Bd(e){const t={},r=e.length;for(let o=0;o<r;o++){const i=e[o];if(!zc(i))continue;const c=H3(i);if(!c)throw new Sa({signature:i,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const y=l[f].trim();if(!y)continue;const g=wn(y,{type:"struct"});u.push(g)}if(!u.length)throw new a8({signature:i});t[c.name]=u}const n={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[i,c]=s[o];n[i]=C1(c,t)}return n}const w8=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function C1(e=[],t={},r=new Set){const n=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(h1.test(o.type))n.push(o);else{const c=xn(w8,o.type);if(!(c!=null&&c.type))throw new n8({abiParameter:o});const{array:l,type:u}=c;if(u in t){if(r.has(u))throw new o8({type:u});n.push({...o,type:`tuple${l??""}`,components:C1(t[u],t,new Set([...r,u]))})}else if(k1(u))n.push(o);else throw new Z3({type:u})}}return n}function T1(e){const t=Bd(e),r=[],n=e.length;for(let s=0;s<n;s++){const a=e[s];zc(a)||r.push(Id(a,t))}return r}function A1(e){let t;if(typeof e=="string")t=Id(e);else{const r=Bd(e),n=e.length;for(let s=0;s<n;s++){const a=e[s];if(!zc(a)){t=Id(a,r);break}}}if(!t)throw new K3({signature:e});return t}function S1(e){const t=[];if(typeof e=="string"){const r=or(e),n=r.length;for(let s=0;s<n;s++)t.push(wn(r[s],{modifiers:E1}))}else{const r=Bd(e),n=e.length;for(let s=0;s<n;s++){const a=e[s];if(zc(a))continue;const o=or(a),i=o.length;for(let c=0;c<i;c++)t.push(wn(o[c],{modifiers:E1,structs:r}))}}if(t.length===0)throw new Q3({params:e});return t}function ne(e,t,r){const n=e[t.name];if(typeof n=="function")return n;const s=e[r];return typeof s=="function"?s:a=>t(e,a)}function Or(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new D8(e.type);return`${e.name}(${Rc(e.inputs,{includeName:t})})`}function Rc(e,{includeName:t=!1}={}){return e?e.map(r=>v8(r,{includeName:t})).join(t?", ":","):""}function v8(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Rc(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Dr(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ut(e){return Dr(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const P1="2.43.3";let Do={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${P1}`},$=class Dh extends Error{constructor(t,r={}){var i;const n=(()=>{var c;return r.cause instanceof Dh?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),s=r.cause instanceof Dh&&r.cause.docsPath||r.docsPath,a=(i=Do.getDocsUrl)==null?void 0:i.call(Do,{...r,docsPath:s}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...Do.version?[`Version: ${Do.version}`]:[]].join(`
|
|
66
66
|
`);super(o,r.cause?{cause:r.cause}:void 0),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,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=P1}walk(t){return I1(this,t)}};function I1(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?I1(e.cause,t):t?null:e}class E8 extends ${constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
67
67
|
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class B1 extends ${constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|