@orbs-network/spot-react 0.0.87 → 0.0.88

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-B7mnk8Bz.js";
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-D-u_j_fu.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;
@@ -3008,7 +3008,7 @@ const Zw = async ({
3008
3008
  }) => (await Promise.all([
3009
3009
  s ? Zw({ chainId: r, signal: e, page: t, limit: n, filters: { accounts: [a], configs: s.twapConfig ? [s.twapConfig] : [] } }) : Promise.resolve([]),
3010
3010
  $w({ chainId: r, signal: e, account: a, exchange: s == null ? void 0 : s.adapter })
3011
- ]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), e3 = "0.0.87", t3 = {
3011
+ ]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), e3 = "0.0.88", t3 = {
3012
3012
  version: e3
3013
3013
  };
3014
3014
  var go = class {
@@ -11665,7 +11665,7 @@ async function xu(e, t) {
11665
11665
  });
11666
11666
  return ie === "0x" ? { data: void 0 } : { data: ie };
11667
11667
  } catch (U) {
11668
- const F = c7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-DuJ8G2e2.js");
11668
+ const F = c7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-14HmcN4t.js");
11669
11669
  if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === L && T)
11670
11670
  return { data: await R(e, { data: F, to: T }) };
11671
11671
  throw C && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new RE({ factory: f }) : u0(U, {
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@orbs-network/spot-react",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
4
4
  "description": "Spot React Components - React components for Spot SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/spot-react.umd.cjs",
@@ -1,4 +1,4 @@
1
- import { aW as e, C as r, aa as t, D as i, aG as n, aU as E, aS as o, aV as T, aT as _, aQ as P, aK as u, an as A, aI as l, aH as O, am as d, ar as I, aF as R, ax as S, av as g, aw as L, az as D, ay as M, T as m, aN as C, aO as b, aM as U, aL as p, aP as N, Q as c, R as F, P as k, O as y, aR as B, ao as h, aJ as G, au as x, S as Y, M as f, N as H, aA as W, ap as v, aq as w, ab as K, bi as V, al as z, X as Q, a1 as X, a7 as j, Y as q, F as J, ak as Z, at as $, a$ as aa, be as sa, b1 as ea, aX as ra, aY as ta, a_ as ia, bh as na, b2 as Ea, a9 as oa, bd as Ta, b4 as _a, b9 as Pa, b0 as ua, bg as Aa, bb as la, a0 as Oa, ba as da, bc as Ia, ad as Ra, ag as Sa, ae as ga, ah as La, a4 as Da, af as Ma, aE as ma, bf as Ca, b3 as ba, b7 as Ua, b5 as pa, b8 as Na, b6 as ca, aZ as Fa, ai as ka, a8 as ya, $ as Ba, Z as ha, aD as Ga, a2 as xa, a3 as Ya, aC as fa, aj as Ha, _ as Wa, U as va, as as wa, ac as Ka, a6 as Va, a5 as za, bj as Qa, W as Xa, V as ja, y as qa, q as Ja, m as Za, h as $a, j as as, L as ss, t as es, r as rs, k as ts, A as is, E as ns, o as Es, J as os, x as Ts, K as _s, I as Ps, G as us, z as As, p as ls, v as Os, u as ds, w as Is, n as Rs, aB as Ss } from "./index-B7mnk8Bz.js";
1
+ import { aW as e, C as r, aa as t, D as i, aG as n, aU as E, aS as o, aV as T, aT as _, aQ as P, aK as u, an as A, aI as l, aH as O, am as d, ar as I, aF as R, ax as S, av as g, aw as L, az as D, ay as M, T as m, aN as C, aO as b, aM as U, aL as p, aP as N, Q as c, R as F, P as k, O as y, aR as B, ao as h, aJ as G, au as x, S as Y, M as f, N as H, aA as W, ap as v, aq as w, ab as K, bi as V, al as z, X as Q, a1 as X, a7 as j, Y as q, F as J, ak as Z, at as $, a$ as aa, be as sa, b1 as ea, aX as ra, aY as ta, a_ as ia, bh as na, b2 as Ea, a9 as oa, bd as Ta, b4 as _a, b9 as Pa, b0 as ua, bg as Aa, bb as la, a0 as Oa, ba as da, bc as Ia, ad as Ra, ag as Sa, ae as ga, ah as La, a4 as Da, af as Ma, aE as ma, bf as Ca, b3 as ba, b7 as Ua, b5 as pa, b8 as Na, b6 as ca, aZ as Fa, ai as ka, a8 as ya, $ as Ba, Z as ha, aD as Ga, a2 as xa, a3 as Ya, aC as fa, aj as Ha, _ as Wa, U as va, as as wa, ac as Ka, a6 as Va, a5 as za, bj as Qa, W as Xa, V as ja, y as qa, q as Ja, m as Za, h as $a, j as as, L as ss, t as es, r as rs, k as ts, A as is, E as ns, o as Es, J as os, x as Ts, K as _s, I as Ps, G as us, z as As, p as ls, v as Os, u as ds, w as Is, n as Rs, aB as Ss } from "./index-D-u_j_fu.js";
2
2
  export {
3
3
  e as CRASH_ERROR_MESSAGE,
4
4
  r as Components,
@@ -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 Iw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Bw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{try{const a=await Aw({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([Pw({chainId:e,orders:a,signal:t}),Sw({chainId:e,orders:a,signal:t})]),c=a.map(u=>{const d=o==null?void 0:o.filter(f=>f.TWAP_id===Number(u.Contract_id)&&Us(f.exchange,u.exchange)&&Us(f.twapAddress,u.twapAddress));return Cw(u,e,d,Fw(u,d||[],i))}).sort((u,d)=>d.createdAt-u.createdAt),l=new Set;return c.filter(u=>l.has(u.id)?!1:(l.add(u.id),!0))}catch{return[]}},Fw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Us(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Um(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Dm(e.ask_srcAmount,a);return Uw(o,e.ask_deadline*1e3,n)},Dm=(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))},Uw=(e,t,r)=>e===100?ct.Completed:r==="CANCELED"?ct.Canceled:r==="COMPLETED"?ct.Completed:t>Date.now()?ct.Open:ct.Expired,_m=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Bw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:s.twapConfig?[s.twapConfig]:[]}}):Promise.resolve([]),Ew({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),Ow={version:"0.0.87"};var Sa=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(){}},Dw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_w=(v5=class{constructor(){le(this,fn,Dw);le(this,fa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,fa)&&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,fa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&J(this,fa,!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,fa,!0),N(this,fn).setInterval(e,t)}clearInterval(e){N(this,fn).clearInterval(e)}},fn=new WeakMap,fa=new WeakMap,v5),_s=new _w;function Mw(e){setTimeout(e,0)}var Ms=typeof window>"u"||"Deno"in globalThis;function Gt(){}function Nw(e,t){return typeof e=="function"?e(t):e}function yd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Mm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xn(e,t){return typeof e=="function"?e(t):e}function wr(e,t){return typeof e=="function"?e(t):e}function Nm(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==gd(o,t.options))return!1}else if(!Do(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 Lm(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Ns(t.options.mutationKey)!==Ns(a))return!1}else if(!Do(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function gd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ns)(e)}function Ns(e){return JSON.stringify(e,(t,r)=>wd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Do(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Do(e[r],t[r])):!1}var Lw=Object.prototype.hasOwnProperty;function xd(e,t){if(e===t)return e;const r=zm(e)&&zm(t);if(!r&&!(wd(e)&&wd(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:Lw.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const h=xd(d,f);i[u]=h,h===d&&c++}return s===o&&c===s?e:i}function Dc(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 zm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function wd(e){if(!Rm(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Rm(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Rm(e){return Object.prototype.toString.call(e)==="[object Object]"}function zw(e){return new Promise(t=>{_s.setTimeout(t,e)})}function vd(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 xd(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 xd(e,t)}return t}function Rw(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Hw(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var _c=Symbol();function Hm(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===_c&&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===_c?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $m(e,t){return typeof e=="function"?e(...t):!!e}var $w=(E5=class extends Sa{constructor(){super();le(this,ha);le(this,vs);le(this,wo);J(this,wo,t=>{if(!Ms&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,vs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,vs))==null||t.call(this),J(this,vs,void 0))}setEventListener(t){var r;J(this,wo,t),(r=N(this,vs))==null||r.call(this),J(this,vs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,ha)!==t&&(J(this,ha,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,ha)=="boolean"?N(this,ha):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ha=new WeakMap,vs=new WeakMap,wo=new WeakMap,E5),Ed=new $w;function kd(){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 Gw=Mw;function jw(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Gw;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=jw(),Vw=(k5=class extends Sa{constructor(){super();le(this,vo,!0);le(this,Es);le(this,Eo);J(this,Eo,t=>{if(!Ms&&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,Es)||this.setEventListener(N(this,Eo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Es))==null||t.call(this),J(this,Es,void 0))}setEventListener(t){var r;J(this,Eo,t),(r=N(this,Es))==null||r.call(this),J(this,Es,t(this.setOnline.bind(this)))}setOnline(t){N(this,vo)!==t&&(J(this,vo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,vo)}},vo=new WeakMap,Es=new WeakMap,Eo=new WeakMap,k5),Mc=new Vw;function Ww(e){return Math.min(1e3*2**e,3e4)}function Gm(e){return(e??"online")==="online"?Mc.isOnline():!0}var Cd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function jm(e){let t=!1,r=0,n;const s=kd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new Cd(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>Ed.isFocused()&&(e.networkMode==="always"||Mc.isOnline())&&e.canRun(),u=()=>Gm(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)}),b=()=>{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??(Ms?0:3),A=e.retryDelay??Ww,T=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),zw(T).then(()=>l()?void 0:h()).then(()=>{t?f(v):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():h().then(b),s)}}var Vm=(C5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yd(this.gcTime)&&J(this,ma,_s.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ms?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(_s.clearTimeout(N(this,ma)),J(this,ma,void 0))}},ma=new WeakMap,C5),qw=(T5=class extends Vm{constructor(t){super();le(this,Yr);le(this,ba);le(this,ko);le(this,Br);le(this,ya);le(this,Bt);le(this,kc);le(this,ga);J(this,ga,!1),J(this,kc,t.defaultOptions),this.setOptions(t.options),this.observers=[],J(this,ya,t.client),J(this,Br,N(this,ya).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,ba,Km(this.options)),this.state=t.state??N(this,ba),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,kc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Km(this.options);r.data!==void 0&&(this.setState(qm(r.data,r.dataUpdatedAt)),J(this,ba,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=vd(this.state.data,t,this.options);return Se(this,Yr,Kn).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,Kn).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(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ba))}isActive(){return this.observers.some(t=>wr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_c||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xn(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:!Mm(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,ga)?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,Kn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,h,b,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 T=this.observers.find(D=>D.options.queryFn);T&&this.setOptions(T.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=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(J(this,ga,!0),n.signal)})},a=()=>{const T=Hm(this.options,r),z=(()=>{const S={client:N(this,ya),queryKey:this.queryKey,meta:this.meta};return s(S),S})();return J(this,ga,!1),this.options.persister?this.options.persister(T,z,this):T(z)},i=(()=>{const T={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ya),state:this.state,fetchFn:a};return s(T),T})();(l=this.options.behavior)==null||l.onFetch(i,this),J(this,ko,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Yr,Kn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),J(this,Bt,jm({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof Cd&&T.revert&&this.setState({...N(this,ko),fetchStatus:"idle"}),n.abort()},onFail:(T,D)=>{Se(this,Yr,Kn).call(this,{type:"failed",failureCount:T,error:D})},onPause:()=>{Se(this,Yr,Kn).call(this,{type:"pause"})},onContinue:()=>{Se(this,Yr,Kn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const T=await N(this,Bt).start();if(T===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(T),(h=(f=N(this,Br).config).onSuccess)==null||h.call(f,T,this),(g=(b=N(this,Br).config).onSettled)==null||g.call(b,T,this.state.error,this),T}catch(T){if(T instanceof Cd){if(T.silent)return N(this,Bt).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Se(this,Yr,Kn).call(this,{type:"error",error:T}),(v=(E=N(this,Br).config).onError)==null||v.call(E,T,this),(A=(w=N(this,Br).config).onSettled)==null||A.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},ba=new WeakMap,ko=new WeakMap,Br=new WeakMap,ya=new WeakMap,Bt=new WeakMap,kc=new WeakMap,ga=new WeakMap,Yr=new WeakSet,Kn=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,...Wm(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...qm(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return J(this,ko,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})})},T5);function Wm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gm(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qm(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Km(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 Kw=(A5=class extends Sa{constructor(t,r){super();le(this,We);le(this,sr);le(this,_e);le(this,Cc);le(this,qt);le(this,xa);le(this,Co);le(this,Gn);le(this,ks);le(this,Tc);le(this,To);le(this,Ao);le(this,wa);le(this,va);le(this,Cs);le(this,So,new Set);this.options=r,J(this,sr,t),J(this,ks,null),J(this,Gn,kd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,_e).addObserver(this),Ym(N(this,_e),this.options)?Se(this,We,Pc).call(this):this.updateResult(),Se(this,We,Bh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Td(N(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Td(N(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,We,Fh).call(this),Se(this,We,Uh).call(this),N(this,_e).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,_e);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wr(this.options.enabled,N(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,We,Oh).call(this),N(this,_e).setOptions(this.options),r._defaulted&&!Dc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,_e),observer:this});const s=this.hasListeners();s&&Zm(N(this,_e),n,this.options,r)&&Se(this,We,Pc).call(this),this.updateResult(),s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||Xn(this.options.staleTime,N(this,_e))!==Xn(r.staleTime,N(this,_e)))&&Se(this,We,Sh).call(this);const a=Se(this,We,Ph).call(this);s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||a!==N(this,Cs))&&Se(this,We,Ih).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return Zw(this,n)&&(J(this,qt,n),J(this,Co,this.options),J(this,xa,N(this,_e).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,Gn).status==="pending"&&N(this,Gn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,So).add(t)}getCurrentQuery(){return N(this,_e)}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,We,Pc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var y;const n=N(this,_e),s=this.options,a=N(this,qt),o=N(this,xa),i=N(this,Co),l=t!==n?t.state:N(this,Cc),{state:u}=t;let d={...u},f=!1,h;if(r._optimisticResults){const x=this.hasListeners(),C=!x&&Ym(t,r),I=x&&Zm(t,n,r,s);(C||I)&&(d={...d,...Wm(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,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((y=N(this,Ao))==null?void 0:y.state.data,N(this,Ao)):r.placeholderData,x!==void 0&&(E="success",h=vd(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,Tc))h=N(this,To);else try{J(this,Tc,r.select),h=r.select(h),h=vd(a==null?void 0:a.data,h,r),J(this,To,h),J(this,ks,null)}catch(x){J(this,ks,x)}N(this,ks)&&(b=N(this,ks),h=N(this,To),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",A=E==="pending",T=E==="error",D=A&&w,z=h!==void 0,m={status:E,fetchStatus:d.fetchStatus,isPending:A,isSuccess:E==="success",isError:T,isInitialLoading:D,isLoading:D,data:h,dataUpdatedAt:d.dataUpdatedAt,error:b,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:T&&!z,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&z,isStale:Ad(t,r),refetch:this.refetch,promise:N(this,Gn),isEnabled:wr(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)},C=()=>{const F=J(this,Gn,m.promise=kd());x(F)},I=N(this,Gn);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(m.status==="error"||m.data!==I.value)&&C();break;case"rejected":(m.status!=="error"||m.error!==I.reason)&&C();break}}return m}updateResult(){const t=N(this,qt),r=this.createResult(N(this,_e),this.options);if(J(this,xa,N(this,_e).state),J(this,Co,this.options),N(this,xa).data!==void 0&&J(this,Ao,N(this,_e)),Dc(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,So).size)return!0;const o=new Set(a??N(this,So));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,We,z5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,We,Bh).call(this)}},sr=new WeakMap,_e=new WeakMap,Cc=new WeakMap,qt=new WeakMap,xa=new WeakMap,Co=new WeakMap,Gn=new WeakMap,ks=new WeakMap,Tc=new WeakMap,To=new WeakMap,Ao=new WeakMap,wa=new WeakMap,va=new WeakMap,Cs=new WeakMap,So=new WeakMap,We=new WeakSet,Pc=function(t){Se(this,We,Oh).call(this);let r=N(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Gt)),r},Sh=function(){Se(this,We,Fh).call(this);const t=Xn(this.options.staleTime,N(this,_e));if(Ms||N(this,qt).isStale||!yd(t))return;const n=Mm(N(this,qt).dataUpdatedAt,t)+1;J(this,wa,_s.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},Ph=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,_e)):this.options.refetchInterval)??!1},Ih=function(t){Se(this,We,Uh).call(this),J(this,Cs,t),!(Ms||wr(this.options.enabled,N(this,_e))===!1||!yd(N(this,Cs))||N(this,Cs)===0)&&J(this,va,_s.setInterval(()=>{(this.options.refetchIntervalInBackground||Ed.isFocused())&&Se(this,We,Pc).call(this)},N(this,Cs)))},Bh=function(){Se(this,We,Sh).call(this),Se(this,We,Ih).call(this,Se(this,We,Ph).call(this))},Fh=function(){N(this,wa)&&(_s.clearTimeout(N(this,wa)),J(this,wa,void 0))},Uh=function(){N(this,va)&&(_s.clearInterval(N(this,va)),J(this,va,void 0))},Oh=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,_e))return;const r=N(this,_e);J(this,_e,t),J(this,Cc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},z5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,_e),type:"observerResultsUpdated"})})},A5);function Yw(e,t){return wr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ym(e,t){return Yw(e,t)||e.state.data!==void 0&&Td(e,t,t.refetchOnMount)}function Td(e,t,r){if(wr(t.enabled,e)!==!1&&Xn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ad(e,t)}return!1}function Zm(e,t,r,n){return(e!==t||wr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ad(e,r)}function Ad(e,t){return wr(t.enabled,e)!==!1&&e.isStaleByTime(Xn(t.staleTime,e))}function Zw(e,t){return!Dc(e.getCurrentResult(),t)}function Xm(e){return{onFetch:(t,r)=>{var u,d,f,h,b;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=((b=t.state.data)==null?void 0:b.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=Hm(t.options,t.fetchOptions),w=async(A,T,D)=>{if(g)return Promise.reject();if(T==null&&A.pages.length)return Promise.resolve(A);const S=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:T,direction:D?"backward":"forward",meta:t.options.meta};return E(C),C})(),m=await v(S),{maxPages:y}=t.options,x=D?Hw:Rw;return{pages:x(A.pages,m,y),pageParams:x(A.pageParams,T,y)}};if(s&&a.length){const A=s==="backward",T=A?Xw:Qm,D={pages:a,pageParams:o},z=T(n,D);i=await w(D,z,A)}else{const A=e??a.length;do{const T=c===0?o[0]??n.initialPageParam:Qm(n,i);if(c>0&&T==null)break;i=await w(i,T),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 Qm(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 Xw(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=(S5=class extends Vm{constructor(t){super();le(this,mn);le(this,Ac);le(this,hn);le(this,Kt);le(this,Ea);J(this,Ac,t.client),this.mutationId=t.mutationId,J(this,Kt,t.mutationCache),J(this,hn,[]),this.state=t.state||Jm(),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,Kt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,hn,N(this,hn).filter(r=>r!==t)),this.scheduleGc(),N(this,Kt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,hn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Kt).remove(this))}continue(){var t;return((t=N(this,Ea))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,h,b,g,E,v,w,A,T,D,z,S,m,y;const r=()=>{Se(this,mn,Is).call(this,{type:"continue"})},n={client:N(this,Ac),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,Ea,jm({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,C)=>{Se(this,mn,Is).call(this,{type:"failed",failureCount:x,error:C})},onPause:()=>{Se(this,mn,Is).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Kt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,Ea).canStart();try{if(s)r();else{Se(this,mn,Is).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Kt).config).onMutate)==null?void 0:i.call(o,t,this,n));const C=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));C!==this.state.context&&Se(this,mn,Is).call(this,{type:"pending",context:C,variables:t,isPaused:a})}const x=await N(this,Ea).start();return await((d=(u=N(this,Kt).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=(b=N(this,Kt).config).onSettled)==null?void 0:g.call(b,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,Is).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Kt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,n)),await((D=(T=this.options).onError)==null?void 0:D.call(T,x,t,this.state.context,n)),await((S=(z=N(this,Kt).config).onSettled)==null?void 0:S.call(z,void 0,x,this.state.variables,this.state.context,this,n)),await((y=(m=this.options).onSettled)==null?void 0:y.call(m,void 0,x,t,this.state.context,n)),x}finally{Se(this,mn,Is).call(this,{type:"error",error:x})}}finally{N(this,Kt).runNext(this)}}},Ac=new WeakMap,hn=new WeakMap,Kt=new WeakMap,Ea=new WeakMap,mn=new WeakSet,Is=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,Kt).notify({mutation:this,type:"updated",action:t})})},S5);function Jm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jw=(P5=class extends Sa{constructor(t={}){super();le(this,jn);le(this,Zr);le(this,Sc);this.config=t,J(this,jn,new Set),J(this,Zr,new Map),J(this,Sc,0)}build(t,r,n){const s=new Qw({client:t,mutationCache:this,mutationId:++Xu(this,Sc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,jn).add(t);const r=Nc(t);if(typeof r=="string"){const n=N(this,Zr).get(r);n?n.push(t):N(this,Zr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jn).delete(t)){const r=Nc(t);if(typeof r=="string"){const n=N(this,Zr).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,Zr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Nc(t);if(typeof r=="string"){const n=N(this,Zr).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=Nc(t);if(typeof r=="string"){const s=(n=N(this,Zr).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,jn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jn).clear(),N(this,Zr).clear()})}getAll(){return Array.from(N(this,jn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Lm(r,n))}findAll(t={}){return this.getAll().filter(r=>Lm(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(Gt))))}},jn=new WeakMap,Zr=new WeakMap,Sc=new WeakMap,P5);function Nc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var e3=(I5=class extends Sa{constructor(t,r){super();le(this,qn);le(this,Vn);le(this,Ts);le(this,ar);le(this,Wn);J(this,Vn,t),this.setOptions(r),this.bindMethods(),Se(this,qn,Qu).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,Vn).defaultMutationOptions(t),Dc(this.options,r)||N(this,Vn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ns(r.mutationKey)!==Ns(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,qn,Qu).call(this),Se(this,qn,Dh).call(this,t)}getCurrentResult(){return N(this,Ts)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),J(this,ar,void 0),Se(this,qn,Qu).call(this),Se(this,qn,Dh).call(this)}mutate(t,r){var n;return J(this,Wn,r),(n=N(this,ar))==null||n.removeObserver(this),J(this,ar,N(this,Vn).getMutationCache().build(N(this,Vn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},Vn=new WeakMap,Ts=new WeakMap,ar=new WeakMap,Wn=new WeakMap,qn=new WeakSet,Qu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Jm();J(this,Ts,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Dh=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Wn)&&this.hasListeners()){const u=N(this,Ts).variables,d=N(this,Ts).context,f={client:N(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Wn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Wn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Ts))})})},I5),t3=(B5=class extends Sa{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??gd(s,r);let o=this.get(a);return o||(o=new qw({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=>Nm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Nm(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,B5),r3=(F5=class{constructor(e={}){le(this,ft);le(this,As);le(this,Ss);le(this,Po);le(this,Io);le(this,Ps);le(this,Bo);le(this,Fo);J(this,ft,e.queryCache||new t3),J(this,As,e.mutationCache||new Jw),J(this,Ss,e.defaultOptions||{}),J(this,Po,new Map),J(this,Io,new Map),J(this,Ps,0)}mount(){Xu(this,Ps)._++,N(this,Ps)===1&&(J(this,Bo,Ed.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),J(this,Fo,Mc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Xu(this,Ps)._--,N(this,Ps)===0&&((e=N(this,Bo))==null||e.call(this),J(this,Bo,void 0),(t=N(this,Fo))==null||t.call(this),J(this,Fo,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,As).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(Xn(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=Nw(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(Gt).catch(Gt)}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(Gt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Gt)}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(Xn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e.behavior=Xm(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e.behavior=Xm(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mc.isOnline()?N(this,As).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,As)}getDefaultOptions(){return N(this,Ss)}setDefaultOptions(e){J(this,Ss,e)}setQueryDefaults(e,t){N(this,Po).set(Ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Po).values()],r={};return t.forEach(n=>{Do(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,Io).set(Ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Io).values()],r={};return t.forEach(n=>{Do(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ss).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gd(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===_c&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Ss).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,As).clear()}},ft=new WeakMap,As=new WeakMap,Ss=new WeakMap,Po=new WeakMap,Io=new WeakMap,Ps=new WeakMap,Bo=new WeakMap,Fo=new WeakMap,F5),e1=xt.createContext(void 0),Sd=e=>{const t=xt.useContext(e1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},n3=({client:e,children:t})=>(xt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(e1.Provider,{value:e,children:t})),t1=xt.createContext(!1),s3=()=>xt.useContext(t1);t1.Provider;function a3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o3=xt.createContext(a3()),i3=()=>xt.useContext(o3),c3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},l3=e=>{xt.useEffect(()=>{e.clearReset()},[e])},u3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||$m(r,[e.error,n])),d3=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))}},p3=(e,t)=>e.isLoading&&e.isFetching&&!t,f3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,r1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function h3(e,t,r){var d,f,h,b,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=s3(),s=i3(),a=Sd(),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",d3(o),c3(o,s),l3(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)):Gt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),xt.useEffect(()=>{c.setOptions(o)},[o,c]),f3(o,l))throw r1(o,c,s);if(u3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((b=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||b.call(h,o,l),o.experimental_prefetchInRender&&!Ms&&p3(l,n)){const E=i?r1(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(Gt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function m3(e,t){return h3(e,Kw)}function Qr(e,t){const r=Sd(),[n]=xt.useState(()=>new e3(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(Gt)},[n]);if(s.error&&$m(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const b3=M.createContext(null),Pd={didCatch:!1,error:null};class y3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Pd}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(Pd)}}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&&g3(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(Pd)}}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(b3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function g3(){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 n1=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},x3=(e=>e?n1(e):n1),w3=e=>e;function v3(e,t=w3){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 s1=e=>{const t=x3(e),r=n=>v3(t,n);return Object.assign(r,t),r},E3=(e=>e?s1(e):s1),a1={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},ee=E3((e,t)=>({state:a1,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...a1,currentTime:Date.now(),swapExecution:{...t().state.swapExecution,status:void 0},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 Le=e=>`orbs_${e}`;function _o({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Le("Text")}`,children:e})}const o1=M.createContext({});function k3({children:e,...t}){return B.jsx(o1.Provider,{value:t,children:e})}const Jr=()=>M.useContext(o1);var ht=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(ht||{});const C3=({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:`${Le("Spinner")} ${e}`,style:a})};function Lc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Le("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Le("TradeStepLayoutHeader"),children:[B.jsx(I3,{}),s&&B.jsx(_o,{className:Le("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Le("TradeStepLayoutBody"),children:t}),B.jsx(T3,{link:r,text:n}),a]})}const T3=({link:e,text:t})=>{const{swapStatus:r}=Jr();return!e&&!t?null:B.jsxs("div",{className:Le("TradeStepLayoutFooter"),children:[B.jsx(F3,{}),e?B.jsx(A3,{link:e,text:t}):r===ht.FAILED?void 0:B.jsx(_o,{children:t})]})},A3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Le("TradeStepLayoutFooterLink"),href:e,children:t});function S3(){const{components:e}=Jr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Le("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 P3(){const{components:e}=Jr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Le("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 I3=()=>{const{swapStatus:e}=Jr();return e===ht.SUCCESS?B.jsx(S3,{}):e===ht.FAILED?B.jsx(P3,{}):B.jsx(B3,{})},B3=()=>{const{components:e}=Jr();return e.Loader?e.Loader:B.jsx(C3,{size:60,borderWidth:5,className:Le("TradeStepLayoutSpinner")})},F3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Jr();return r!==ht.LOADING||e===1?null:B.jsx("div",{className:Le("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Le("StepIndicatorLine")})})},U3=({error:e,footerLink:t,footerText:r})=>B.jsx(Lc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Le("FailedContentMsg"),children:"Something went wrong"}),className:Le("FailedContent")});function O3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Le("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 i1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Jr();return B.jsxs("div",{className:Le("TradePreview"),children:[B.jsx(c1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(O3,{}),B.jsx(c1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},c1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Le("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Le("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(_o,{children:[t," ",e==null?void 0:e.symbol]})]});function D3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Lc,{title:e,className:Le("Success"),body:!n&&B.jsx(i1,{}),footerLink:t,footerText:r})}const l1=({$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:`${Le("FlexColumn")} ${n}`,style:a,children:r})};function u1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Le("SkeletonLoader")} ${t}`})}const _3=()=>B.jsxs("div",{className:`${Le("MainContentLoader")}`,children:[B.jsx(u1,{className:`${Le("MainContentCircleLoader")}`}),B.jsx(u1,{className:`${Le("MainContentRectengularLoader")}`})]}),M3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Jr(),d=B.jsx(p1,{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(N3,{}):B.jsxs(l1,{children:[d,B.jsx(_3,{})]}):B.jsx(l1,{children:d})},d1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Le("MainToken")}`,children:[B.jsxs("div",{className:`${Le("MainTokenLeft")}`,children:[B.jsx(_o,{className:`${Le("MainTokenTitle")}`,children:n}),B.jsx(_o,{className:` ${Le("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Le("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Le("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function N3(){const{currentStep:e}=Jr();return e?B.jsx(Lc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(i1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const p1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Le("Main")}`,children:[B.jsx(d1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(d1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qn=e=>B.jsx(k3,{...e,children:B.jsx(L3,{})}),L3=()=>{const{swapStatus:e,components:t,className:r}=Jr();return B.jsx("div",{className:`${Le("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})};Qn.Success=D3,Qn.Failed=U3,Qn.Main=M3,Qn.StepLayout=Lc;var Ls=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ls||{});const z3="1.2.3";let Zt=class _h extends Error{constructor(t,r={}){var o;const n=r.cause instanceof _h?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,s=r.cause instanceof _h&&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@${z3}`].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 Iw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Bw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{try{const a=await Aw({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([Pw({chainId:e,orders:a,signal:t}),Sw({chainId:e,orders:a,signal:t})]),c=a.map(u=>{const d=o==null?void 0:o.filter(f=>f.TWAP_id===Number(u.Contract_id)&&Us(f.exchange,u.exchange)&&Us(f.twapAddress,u.twapAddress));return Cw(u,e,d,Fw(u,d||[],i))}).sort((u,d)=>d.createdAt-u.createdAt),l=new Set;return c.filter(u=>l.has(u.id)?!1:(l.add(u.id),!0))}catch{return[]}},Fw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Us(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Um(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Dm(e.ask_srcAmount,a);return Uw(o,e.ask_deadline*1e3,n)},Dm=(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))},Uw=(e,t,r)=>e===100?ct.Completed:r==="CANCELED"?ct.Canceled:r==="COMPLETED"?ct.Completed:t>Date.now()?ct.Open:ct.Expired,_m=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Bw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:s.twapConfig?[s.twapConfig]:[]}}):Promise.resolve([]),Ew({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),Ow={version:"0.0.88"};var Sa=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(){}},Dw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_w=(v5=class{constructor(){le(this,fn,Dw);le(this,fa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,fa)&&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,fa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&J(this,fa,!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,fa,!0),N(this,fn).setInterval(e,t)}clearInterval(e){N(this,fn).clearInterval(e)}},fn=new WeakMap,fa=new WeakMap,v5),_s=new _w;function Mw(e){setTimeout(e,0)}var Ms=typeof window>"u"||"Deno"in globalThis;function Gt(){}function Nw(e,t){return typeof e=="function"?e(t):e}function yd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Mm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xn(e,t){return typeof e=="function"?e(t):e}function wr(e,t){return typeof e=="function"?e(t):e}function Nm(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==gd(o,t.options))return!1}else if(!Do(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 Lm(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Ns(t.options.mutationKey)!==Ns(a))return!1}else if(!Do(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function gd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ns)(e)}function Ns(e){return JSON.stringify(e,(t,r)=>wd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Do(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Do(e[r],t[r])):!1}var Lw=Object.prototype.hasOwnProperty;function xd(e,t){if(e===t)return e;const r=zm(e)&&zm(t);if(!r&&!(wd(e)&&wd(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:Lw.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const h=xd(d,f);i[u]=h,h===d&&c++}return s===o&&c===s?e:i}function Dc(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 zm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function wd(e){if(!Rm(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Rm(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Rm(e){return Object.prototype.toString.call(e)==="[object Object]"}function zw(e){return new Promise(t=>{_s.setTimeout(t,e)})}function vd(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 xd(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 xd(e,t)}return t}function Rw(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Hw(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var _c=Symbol();function Hm(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===_c&&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===_c?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $m(e,t){return typeof e=="function"?e(...t):!!e}var $w=(E5=class extends Sa{constructor(){super();le(this,ha);le(this,vs);le(this,wo);J(this,wo,t=>{if(!Ms&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,vs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,vs))==null||t.call(this),J(this,vs,void 0))}setEventListener(t){var r;J(this,wo,t),(r=N(this,vs))==null||r.call(this),J(this,vs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,ha)!==t&&(J(this,ha,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,ha)=="boolean"?N(this,ha):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ha=new WeakMap,vs=new WeakMap,wo=new WeakMap,E5),Ed=new $w;function kd(){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 Gw=Mw;function jw(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Gw;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=jw(),Vw=(k5=class extends Sa{constructor(){super();le(this,vo,!0);le(this,Es);le(this,Eo);J(this,Eo,t=>{if(!Ms&&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,Es)||this.setEventListener(N(this,Eo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Es))==null||t.call(this),J(this,Es,void 0))}setEventListener(t){var r;J(this,Eo,t),(r=N(this,Es))==null||r.call(this),J(this,Es,t(this.setOnline.bind(this)))}setOnline(t){N(this,vo)!==t&&(J(this,vo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,vo)}},vo=new WeakMap,Es=new WeakMap,Eo=new WeakMap,k5),Mc=new Vw;function Ww(e){return Math.min(1e3*2**e,3e4)}function Gm(e){return(e??"online")==="online"?Mc.isOnline():!0}var Cd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function jm(e){let t=!1,r=0,n;const s=kd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new Cd(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>Ed.isFocused()&&(e.networkMode==="always"||Mc.isOnline())&&e.canRun(),u=()=>Gm(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)}),b=()=>{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??(Ms?0:3),A=e.retryDelay??Ww,T=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),zw(T).then(()=>l()?void 0:h()).then(()=>{t?f(v):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():h().then(b),s)}}var Vm=(C5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yd(this.gcTime)&&J(this,ma,_s.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ms?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(_s.clearTimeout(N(this,ma)),J(this,ma,void 0))}},ma=new WeakMap,C5),qw=(T5=class extends Vm{constructor(t){super();le(this,Yr);le(this,ba);le(this,ko);le(this,Br);le(this,ya);le(this,Bt);le(this,kc);le(this,ga);J(this,ga,!1),J(this,kc,t.defaultOptions),this.setOptions(t.options),this.observers=[],J(this,ya,t.client),J(this,Br,N(this,ya).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,ba,Km(this.options)),this.state=t.state??N(this,ba),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,kc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Km(this.options);r.data!==void 0&&(this.setState(qm(r.data,r.dataUpdatedAt)),J(this,ba,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=vd(this.state.data,t,this.options);return Se(this,Yr,Kn).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,Kn).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(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ba))}isActive(){return this.observers.some(t=>wr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_c||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xn(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:!Mm(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,ga)?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,Kn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,h,b,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 T=this.observers.find(D=>D.options.queryFn);T&&this.setOptions(T.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=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(J(this,ga,!0),n.signal)})},a=()=>{const T=Hm(this.options,r),z=(()=>{const S={client:N(this,ya),queryKey:this.queryKey,meta:this.meta};return s(S),S})();return J(this,ga,!1),this.options.persister?this.options.persister(T,z,this):T(z)},i=(()=>{const T={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ya),state:this.state,fetchFn:a};return s(T),T})();(l=this.options.behavior)==null||l.onFetch(i,this),J(this,ko,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Yr,Kn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),J(this,Bt,jm({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof Cd&&T.revert&&this.setState({...N(this,ko),fetchStatus:"idle"}),n.abort()},onFail:(T,D)=>{Se(this,Yr,Kn).call(this,{type:"failed",failureCount:T,error:D})},onPause:()=>{Se(this,Yr,Kn).call(this,{type:"pause"})},onContinue:()=>{Se(this,Yr,Kn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const T=await N(this,Bt).start();if(T===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(T),(h=(f=N(this,Br).config).onSuccess)==null||h.call(f,T,this),(g=(b=N(this,Br).config).onSettled)==null||g.call(b,T,this.state.error,this),T}catch(T){if(T instanceof Cd){if(T.silent)return N(this,Bt).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Se(this,Yr,Kn).call(this,{type:"error",error:T}),(v=(E=N(this,Br).config).onError)==null||v.call(E,T,this),(A=(w=N(this,Br).config).onSettled)==null||A.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},ba=new WeakMap,ko=new WeakMap,Br=new WeakMap,ya=new WeakMap,Bt=new WeakMap,kc=new WeakMap,ga=new WeakMap,Yr=new WeakSet,Kn=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,...Wm(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...qm(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return J(this,ko,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})})},T5);function Wm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gm(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qm(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Km(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 Kw=(A5=class extends Sa{constructor(t,r){super();le(this,We);le(this,sr);le(this,_e);le(this,Cc);le(this,qt);le(this,xa);le(this,Co);le(this,Gn);le(this,ks);le(this,Tc);le(this,To);le(this,Ao);le(this,wa);le(this,va);le(this,Cs);le(this,So,new Set);this.options=r,J(this,sr,t),J(this,ks,null),J(this,Gn,kd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,_e).addObserver(this),Ym(N(this,_e),this.options)?Se(this,We,Pc).call(this):this.updateResult(),Se(this,We,Bh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Td(N(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Td(N(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,We,Fh).call(this),Se(this,We,Uh).call(this),N(this,_e).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,_e);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wr(this.options.enabled,N(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,We,Oh).call(this),N(this,_e).setOptions(this.options),r._defaulted&&!Dc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,_e),observer:this});const s=this.hasListeners();s&&Zm(N(this,_e),n,this.options,r)&&Se(this,We,Pc).call(this),this.updateResult(),s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||Xn(this.options.staleTime,N(this,_e))!==Xn(r.staleTime,N(this,_e)))&&Se(this,We,Sh).call(this);const a=Se(this,We,Ph).call(this);s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||a!==N(this,Cs))&&Se(this,We,Ih).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return Zw(this,n)&&(J(this,qt,n),J(this,Co,this.options),J(this,xa,N(this,_e).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,Gn).status==="pending"&&N(this,Gn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,So).add(t)}getCurrentQuery(){return N(this,_e)}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,We,Pc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var y;const n=N(this,_e),s=this.options,a=N(this,qt),o=N(this,xa),i=N(this,Co),l=t!==n?t.state:N(this,Cc),{state:u}=t;let d={...u},f=!1,h;if(r._optimisticResults){const x=this.hasListeners(),C=!x&&Ym(t,r),I=x&&Zm(t,n,r,s);(C||I)&&(d={...d,...Wm(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,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((y=N(this,Ao))==null?void 0:y.state.data,N(this,Ao)):r.placeholderData,x!==void 0&&(E="success",h=vd(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,Tc))h=N(this,To);else try{J(this,Tc,r.select),h=r.select(h),h=vd(a==null?void 0:a.data,h,r),J(this,To,h),J(this,ks,null)}catch(x){J(this,ks,x)}N(this,ks)&&(b=N(this,ks),h=N(this,To),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",A=E==="pending",T=E==="error",D=A&&w,z=h!==void 0,m={status:E,fetchStatus:d.fetchStatus,isPending:A,isSuccess:E==="success",isError:T,isInitialLoading:D,isLoading:D,data:h,dataUpdatedAt:d.dataUpdatedAt,error:b,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:T&&!z,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&z,isStale:Ad(t,r),refetch:this.refetch,promise:N(this,Gn),isEnabled:wr(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)},C=()=>{const F=J(this,Gn,m.promise=kd());x(F)},I=N(this,Gn);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(m.status==="error"||m.data!==I.value)&&C();break;case"rejected":(m.status!=="error"||m.error!==I.reason)&&C();break}}return m}updateResult(){const t=N(this,qt),r=this.createResult(N(this,_e),this.options);if(J(this,xa,N(this,_e).state),J(this,Co,this.options),N(this,xa).data!==void 0&&J(this,Ao,N(this,_e)),Dc(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,So).size)return!0;const o=new Set(a??N(this,So));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,We,z5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,We,Bh).call(this)}},sr=new WeakMap,_e=new WeakMap,Cc=new WeakMap,qt=new WeakMap,xa=new WeakMap,Co=new WeakMap,Gn=new WeakMap,ks=new WeakMap,Tc=new WeakMap,To=new WeakMap,Ao=new WeakMap,wa=new WeakMap,va=new WeakMap,Cs=new WeakMap,So=new WeakMap,We=new WeakSet,Pc=function(t){Se(this,We,Oh).call(this);let r=N(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Gt)),r},Sh=function(){Se(this,We,Fh).call(this);const t=Xn(this.options.staleTime,N(this,_e));if(Ms||N(this,qt).isStale||!yd(t))return;const n=Mm(N(this,qt).dataUpdatedAt,t)+1;J(this,wa,_s.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},Ph=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,_e)):this.options.refetchInterval)??!1},Ih=function(t){Se(this,We,Uh).call(this),J(this,Cs,t),!(Ms||wr(this.options.enabled,N(this,_e))===!1||!yd(N(this,Cs))||N(this,Cs)===0)&&J(this,va,_s.setInterval(()=>{(this.options.refetchIntervalInBackground||Ed.isFocused())&&Se(this,We,Pc).call(this)},N(this,Cs)))},Bh=function(){Se(this,We,Sh).call(this),Se(this,We,Ih).call(this,Se(this,We,Ph).call(this))},Fh=function(){N(this,wa)&&(_s.clearTimeout(N(this,wa)),J(this,wa,void 0))},Uh=function(){N(this,va)&&(_s.clearInterval(N(this,va)),J(this,va,void 0))},Oh=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,_e))return;const r=N(this,_e);J(this,_e,t),J(this,Cc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},z5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,_e),type:"observerResultsUpdated"})})},A5);function Yw(e,t){return wr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ym(e,t){return Yw(e,t)||e.state.data!==void 0&&Td(e,t,t.refetchOnMount)}function Td(e,t,r){if(wr(t.enabled,e)!==!1&&Xn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ad(e,t)}return!1}function Zm(e,t,r,n){return(e!==t||wr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ad(e,r)}function Ad(e,t){return wr(t.enabled,e)!==!1&&e.isStaleByTime(Xn(t.staleTime,e))}function Zw(e,t){return!Dc(e.getCurrentResult(),t)}function Xm(e){return{onFetch:(t,r)=>{var u,d,f,h,b;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=((b=t.state.data)==null?void 0:b.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=Hm(t.options,t.fetchOptions),w=async(A,T,D)=>{if(g)return Promise.reject();if(T==null&&A.pages.length)return Promise.resolve(A);const S=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:T,direction:D?"backward":"forward",meta:t.options.meta};return E(C),C})(),m=await v(S),{maxPages:y}=t.options,x=D?Hw:Rw;return{pages:x(A.pages,m,y),pageParams:x(A.pageParams,T,y)}};if(s&&a.length){const A=s==="backward",T=A?Xw:Qm,D={pages:a,pageParams:o},z=T(n,D);i=await w(D,z,A)}else{const A=e??a.length;do{const T=c===0?o[0]??n.initialPageParam:Qm(n,i);if(c>0&&T==null)break;i=await w(i,T),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 Qm(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 Xw(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=(S5=class extends Vm{constructor(t){super();le(this,mn);le(this,Ac);le(this,hn);le(this,Kt);le(this,Ea);J(this,Ac,t.client),this.mutationId=t.mutationId,J(this,Kt,t.mutationCache),J(this,hn,[]),this.state=t.state||Jm(),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,Kt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,hn,N(this,hn).filter(r=>r!==t)),this.scheduleGc(),N(this,Kt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,hn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Kt).remove(this))}continue(){var t;return((t=N(this,Ea))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,h,b,g,E,v,w,A,T,D,z,S,m,y;const r=()=>{Se(this,mn,Is).call(this,{type:"continue"})},n={client:N(this,Ac),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,Ea,jm({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,C)=>{Se(this,mn,Is).call(this,{type:"failed",failureCount:x,error:C})},onPause:()=>{Se(this,mn,Is).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Kt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,Ea).canStart();try{if(s)r();else{Se(this,mn,Is).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Kt).config).onMutate)==null?void 0:i.call(o,t,this,n));const C=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));C!==this.state.context&&Se(this,mn,Is).call(this,{type:"pending",context:C,variables:t,isPaused:a})}const x=await N(this,Ea).start();return await((d=(u=N(this,Kt).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=(b=N(this,Kt).config).onSettled)==null?void 0:g.call(b,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,Is).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Kt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,n)),await((D=(T=this.options).onError)==null?void 0:D.call(T,x,t,this.state.context,n)),await((S=(z=N(this,Kt).config).onSettled)==null?void 0:S.call(z,void 0,x,this.state.variables,this.state.context,this,n)),await((y=(m=this.options).onSettled)==null?void 0:y.call(m,void 0,x,t,this.state.context,n)),x}finally{Se(this,mn,Is).call(this,{type:"error",error:x})}}finally{N(this,Kt).runNext(this)}}},Ac=new WeakMap,hn=new WeakMap,Kt=new WeakMap,Ea=new WeakMap,mn=new WeakSet,Is=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,Kt).notify({mutation:this,type:"updated",action:t})})},S5);function Jm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jw=(P5=class extends Sa{constructor(t={}){super();le(this,jn);le(this,Zr);le(this,Sc);this.config=t,J(this,jn,new Set),J(this,Zr,new Map),J(this,Sc,0)}build(t,r,n){const s=new Qw({client:t,mutationCache:this,mutationId:++Xu(this,Sc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,jn).add(t);const r=Nc(t);if(typeof r=="string"){const n=N(this,Zr).get(r);n?n.push(t):N(this,Zr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jn).delete(t)){const r=Nc(t);if(typeof r=="string"){const n=N(this,Zr).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,Zr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Nc(t);if(typeof r=="string"){const n=N(this,Zr).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=Nc(t);if(typeof r=="string"){const s=(n=N(this,Zr).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,jn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jn).clear(),N(this,Zr).clear()})}getAll(){return Array.from(N(this,jn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Lm(r,n))}findAll(t={}){return this.getAll().filter(r=>Lm(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(Gt))))}},jn=new WeakMap,Zr=new WeakMap,Sc=new WeakMap,P5);function Nc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var e3=(I5=class extends Sa{constructor(t,r){super();le(this,qn);le(this,Vn);le(this,Ts);le(this,ar);le(this,Wn);J(this,Vn,t),this.setOptions(r),this.bindMethods(),Se(this,qn,Qu).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,Vn).defaultMutationOptions(t),Dc(this.options,r)||N(this,Vn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ns(r.mutationKey)!==Ns(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,qn,Qu).call(this),Se(this,qn,Dh).call(this,t)}getCurrentResult(){return N(this,Ts)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),J(this,ar,void 0),Se(this,qn,Qu).call(this),Se(this,qn,Dh).call(this)}mutate(t,r){var n;return J(this,Wn,r),(n=N(this,ar))==null||n.removeObserver(this),J(this,ar,N(this,Vn).getMutationCache().build(N(this,Vn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},Vn=new WeakMap,Ts=new WeakMap,ar=new WeakMap,Wn=new WeakMap,qn=new WeakSet,Qu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Jm();J(this,Ts,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Dh=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Wn)&&this.hasListeners()){const u=N(this,Ts).variables,d=N(this,Ts).context,f={client:N(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Wn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Wn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Ts))})})},I5),t3=(B5=class extends Sa{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??gd(s,r);let o=this.get(a);return o||(o=new qw({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=>Nm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Nm(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,B5),r3=(F5=class{constructor(e={}){le(this,ft);le(this,As);le(this,Ss);le(this,Po);le(this,Io);le(this,Ps);le(this,Bo);le(this,Fo);J(this,ft,e.queryCache||new t3),J(this,As,e.mutationCache||new Jw),J(this,Ss,e.defaultOptions||{}),J(this,Po,new Map),J(this,Io,new Map),J(this,Ps,0)}mount(){Xu(this,Ps)._++,N(this,Ps)===1&&(J(this,Bo,Ed.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),J(this,Fo,Mc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Xu(this,Ps)._--,N(this,Ps)===0&&((e=N(this,Bo))==null||e.call(this),J(this,Bo,void 0),(t=N(this,Fo))==null||t.call(this),J(this,Fo,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,As).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(Xn(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=Nw(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(Gt).catch(Gt)}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(Gt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Gt)}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(Xn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e.behavior=Xm(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e.behavior=Xm(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mc.isOnline()?N(this,As).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,As)}getDefaultOptions(){return N(this,Ss)}setDefaultOptions(e){J(this,Ss,e)}setQueryDefaults(e,t){N(this,Po).set(Ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Po).values()],r={};return t.forEach(n=>{Do(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,Io).set(Ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Io).values()],r={};return t.forEach(n=>{Do(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ss).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gd(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===_c&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Ss).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,As).clear()}},ft=new WeakMap,As=new WeakMap,Ss=new WeakMap,Po=new WeakMap,Io=new WeakMap,Ps=new WeakMap,Bo=new WeakMap,Fo=new WeakMap,F5),e1=xt.createContext(void 0),Sd=e=>{const t=xt.useContext(e1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},n3=({client:e,children:t})=>(xt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(e1.Provider,{value:e,children:t})),t1=xt.createContext(!1),s3=()=>xt.useContext(t1);t1.Provider;function a3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o3=xt.createContext(a3()),i3=()=>xt.useContext(o3),c3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},l3=e=>{xt.useEffect(()=>{e.clearReset()},[e])},u3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||$m(r,[e.error,n])),d3=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))}},p3=(e,t)=>e.isLoading&&e.isFetching&&!t,f3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,r1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function h3(e,t,r){var d,f,h,b,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=s3(),s=i3(),a=Sd(),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",d3(o),c3(o,s),l3(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)):Gt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),xt.useEffect(()=>{c.setOptions(o)},[o,c]),f3(o,l))throw r1(o,c,s);if(u3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((b=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||b.call(h,o,l),o.experimental_prefetchInRender&&!Ms&&p3(l,n)){const E=i?r1(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(Gt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function m3(e,t){return h3(e,Kw)}function Qr(e,t){const r=Sd(),[n]=xt.useState(()=>new e3(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(Gt)},[n]);if(s.error&&$m(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const b3=M.createContext(null),Pd={didCatch:!1,error:null};class y3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Pd}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(Pd)}}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&&g3(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(Pd)}}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(b3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function g3(){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 n1=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},x3=(e=>e?n1(e):n1),w3=e=>e;function v3(e,t=w3){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 s1=e=>{const t=x3(e),r=n=>v3(t,n);return Object.assign(r,t),r},E3=(e=>e?s1(e):s1),a1={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},ee=E3((e,t)=>({state:a1,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...a1,currentTime:Date.now(),swapExecution:{...t().state.swapExecution,status:void 0},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 Le=e=>`orbs_${e}`;function _o({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Le("Text")}`,children:e})}const o1=M.createContext({});function k3({children:e,...t}){return B.jsx(o1.Provider,{value:t,children:e})}const Jr=()=>M.useContext(o1);var ht=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(ht||{});const C3=({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:`${Le("Spinner")} ${e}`,style:a})};function Lc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Le("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Le("TradeStepLayoutHeader"),children:[B.jsx(I3,{}),s&&B.jsx(_o,{className:Le("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Le("TradeStepLayoutBody"),children:t}),B.jsx(T3,{link:r,text:n}),a]})}const T3=({link:e,text:t})=>{const{swapStatus:r}=Jr();return!e&&!t?null:B.jsxs("div",{className:Le("TradeStepLayoutFooter"),children:[B.jsx(F3,{}),e?B.jsx(A3,{link:e,text:t}):r===ht.FAILED?void 0:B.jsx(_o,{children:t})]})},A3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Le("TradeStepLayoutFooterLink"),href:e,children:t});function S3(){const{components:e}=Jr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Le("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 P3(){const{components:e}=Jr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Le("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 I3=()=>{const{swapStatus:e}=Jr();return e===ht.SUCCESS?B.jsx(S3,{}):e===ht.FAILED?B.jsx(P3,{}):B.jsx(B3,{})},B3=()=>{const{components:e}=Jr();return e.Loader?e.Loader:B.jsx(C3,{size:60,borderWidth:5,className:Le("TradeStepLayoutSpinner")})},F3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Jr();return r!==ht.LOADING||e===1?null:B.jsx("div",{className:Le("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Le("StepIndicatorLine")})})},U3=({error:e,footerLink:t,footerText:r})=>B.jsx(Lc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Le("FailedContentMsg"),children:"Something went wrong"}),className:Le("FailedContent")});function O3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Le("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 i1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Jr();return B.jsxs("div",{className:Le("TradePreview"),children:[B.jsx(c1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(O3,{}),B.jsx(c1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},c1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Le("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Le("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(_o,{children:[t," ",e==null?void 0:e.symbol]})]});function D3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Lc,{title:e,className:Le("Success"),body:!n&&B.jsx(i1,{}),footerLink:t,footerText:r})}const l1=({$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:`${Le("FlexColumn")} ${n}`,style:a,children:r})};function u1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Le("SkeletonLoader")} ${t}`})}const _3=()=>B.jsxs("div",{className:`${Le("MainContentLoader")}`,children:[B.jsx(u1,{className:`${Le("MainContentCircleLoader")}`}),B.jsx(u1,{className:`${Le("MainContentRectengularLoader")}`})]}),M3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Jr(),d=B.jsx(p1,{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(N3,{}):B.jsxs(l1,{children:[d,B.jsx(_3,{})]}):B.jsx(l1,{children:d})},d1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Le("MainToken")}`,children:[B.jsxs("div",{className:`${Le("MainTokenLeft")}`,children:[B.jsx(_o,{className:`${Le("MainTokenTitle")}`,children:n}),B.jsx(_o,{className:` ${Le("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Le("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Le("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function N3(){const{currentStep:e}=Jr();return e?B.jsx(Lc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(i1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const p1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Le("Main")}`,children:[B.jsx(d1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(d1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qn=e=>B.jsx(k3,{...e,children:B.jsx(L3,{})}),L3=()=>{const{swapStatus:e,components:t,className:r}=Jr();return B.jsx("div",{className:`${Le("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})};Qn.Success=D3,Qn.Failed=U3,Qn.Main=M3,Qn.StepLayout=Lc;var Ls=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ls||{});const z3="1.2.3";let Zt=class _h extends Error{constructor(t,r={}){var o;const n=r.cause instanceof _h?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,s=r.cause instanceof _h&&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@${z3}`].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 f1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,h1=/^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)?$/,m1=/^\(.+?\).*?$/,b1=/^tuple(?<array>(\[(\d*)\])*)$/;function Id(e){let t=e.type;if(b1.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+=Id(a),s<r-1&&(t+=", ")}const n=xn(b1,e.type);return t+=`)${(n==null?void 0:n.array)||""}`,Id({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Pa(e){let t="";const r=e.length;for(let n=0;n<r;n++){const s=e[n];t+=Id(s),n!==r-1&&(t+=", ")}return t}function zc(e){var t;return e.type==="function"?`function ${e.name}(${Pa(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${Pa(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Pa(e.inputs)})`:e.type==="error"?`error ${e.name}(${Pa(e.inputs)})`:e.type==="constructor"?`constructor(${Pa(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const y1=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function R3(e){return y1.test(e)}function H3(e){return xn(y1,e)}const g1=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function $3(e){return g1.test(e)}function G3(e){return xn(g1,e)}const x1=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function j3(e){return x1.test(e)}function V3(e){return xn(x1,e)}const w1=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Rc(e){return w1.test(e)}function W3(e){return xn(w1,e)}const v1=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function q3(e){return v1.test(e)}function K3(e){return xn(v1,e)}const E1=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Y3(e){return E1.test(e)}function Z3(e){return xn(E1,e)}const X3=/^receive\(\) external payable$/;function Q3(e){return X3.test(e)}const k1=new Set(["memory","indexed","storage","calldata"]),J3=new Set(["indexed"]),Bd=new Set(["calldata","memory","storage"]);class e8 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 t8 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 r8 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 n8 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 s8 extends Zt{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class a8 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 o8 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 i8 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 c8 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 Ia 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 l8 extends Zt{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class u8 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 d8 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 p8 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 f8(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 Fd=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 Ud(e,t={}){if(j3(e))return h8(e,t);if($3(e))return m8(e,t);if(R3(e))return b8(e,t);if(q3(e))return y8(e,t);if(Y3(e))return g8(e);if(Q3(e))return{type:"receive",stateMutability:"payable"};throw new l8({signature:e})}function h8(e,t={}){const r=V3(e);if(!r)throw new Ia({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:Bd,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:Bd,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:s,outputs:o}}function m8(e,t={}){const r=G3(e);if(!r)throw new Ia({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:J3,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:s}}function b8(e,t={}){const r=H3(e);if(!r)throw new Ia({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 y8(e,t={}){const r=K3(e);if(!r)throw new Ia({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 g8(e){const t=Z3(e);if(!t)throw new Ia({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const x8=/^(?<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$_]*))?$/,w8=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,v8=/^u?int$/;function wn(e,t){var d,f;const r=f8(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Fd.has(r))return Fd.get(r);const n=m1.test(e),s=xn(n?w8:x8,e);if(!s)throw new s8({param:e});if(s.name&&k8(s.name))throw new a8({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),b=[],g=h.length;for(let E=0;E<g;E++)b.push(wn(h[E],{structs:i}));l={components:b}}else if(s.type in i)c="tuple",l={components:i[s.type]};else if(v8.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"&&!C1(c))throw new r8({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 o8({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(Bd.has(s.modifier)&&!C8(c,!!s.array))throw new i8({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const u={type:`${c}${s.array??""}`,...a,...o,...l};return Fd.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 p8({current:r,depth:n});return t.push(r.trim()),t}function C1(e){return e==="address"||e==="bool"||e==="function"||e==="string"||f1.test(e)||h1.test(e)}const E8=/^(?: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 k8(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||f1.test(e)||h1.test(e)||E8.test(e)}function C8(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Od(e){const t={},r=e.length;for(let o=0;o<r;o++){const i=e[o];if(!Rc(i))continue;const c=W3(i);if(!c)throw new Ia({signature:i,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const b=l[f].trim();if(!b)continue;const g=wn(b,{type:"struct"});u.push(g)}if(!u.length)throw new u8({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]=T1(c,t)}return n}const T8=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function T1(e=[],t={},r=new Set){const n=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(m1.test(o.type))n.push(o);else{const c=xn(T8,o.type);if(!(c!=null&&c.type))throw new c8({abiParameter:o});const{array:l,type:u}=c;if(u in t){if(r.has(u))throw new d8({type:u});n.push({...o,type:`tuple${l??""}`,components:T1(t[u],t,new Set([...r,u]))})}else if(C1(u))n.push(o);else throw new t8({type:u})}}return n}function A1(e){const t=Od(e),r=[],n=e.length;for(let s=0;s<n;s++){const a=e[s];Rc(a)||r.push(Ud(a,t))}return r}function S1(e){let t;if(typeof e=="string")t=Ud(e);else{const r=Od(e),n=e.length;for(let s=0;s<n;s++){const a=e[s];if(!Rc(a)){t=Ud(a,r);break}}}if(!t)throw new e8({signature:e});return t}function P1(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:k1}))}else{const r=Od(e),n=e.length;for(let s=0;s<n;s++){const a=e[s];if(Rc(a))continue;const o=or(a),i=o.length;for(let c=0;c<i;c++)t.push(wn(o[c],{modifiers:k1,structs:r}))}}if(t.length===0)throw new n8({params:e});return t}function se(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 Dr(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new z8(e.type);return`${e.name}(${Hc(e.inputs,{includeName:t})})`}function Hc(e,{includeName:t=!1}={}){return e?e.map(r=>A8(r,{includeName:t})).join(t?", ":","):""}function A8(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Hc(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function _r(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 _r(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const I1="2.43.3";let Mo={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${I1}`},$=class Mh extends Error{constructor(t,r={}){var i;const n=(()=>{var c;return r.cause instanceof Mh?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),s=r.cause instanceof Mh&&r.cause.docsPath||r.docsPath,a=(i=Mo.getDocsUrl)==null?void 0:i.call(Mo,{...r,docsPath:s}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...Mo.version?[`Version: ${Mo.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=I1}walk(t){return B1(this,t)}};function B1(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?B1(e.cause,t):t?null:e}class S8 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 F1 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(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbs-network/spot-react",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
4
4
  "description": "Spot React Components - React components for Spot SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/spot-react.umd.cjs",