@orbs-network/spot-react 0.0.12 → 0.0.13

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-BgXrmDmS.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-CXDjLyJG.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;
@@ -2882,7 +2882,7 @@ const jm = (e) => {
2882
2882
  }
2883
2883
  });
2884
2884
  }
2885
- })), t3 = "0.0.12", n3 = {
2885
+ })), t3 = "0.0.13", n3 = {
2886
2886
  version: t3
2887
2887
  };
2888
2888
  var yo = class {
@@ -11060,7 +11060,7 @@ async function bu(e, t) {
11060
11060
  });
11061
11061
  return ie === "0x" ? { data: void 0 } : { data: ie };
11062
11062
  } catch (O) {
11063
- const F = zk(O), { offchainLookup: N, offchainLookupSignature: L } = await import("./ccip-Bsz9ejO8.js");
11063
+ const F = zk(O), { offchainLookup: N, offchainLookupSignature: L } = await import("./ccip-B0SUbLBC.js");
11064
11064
  if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === L && T)
11065
11065
  return { data: await N(e, { data: F, to: T }) };
11066
11066
  throw S && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new hE({ factory: f }) : s0(O, {
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@orbs-network/spot-react",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
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 { Configs, ORBS_TWAP_FAQ_URL, ORBS_LOGO, ORBS_LOGO_FALLBACK, ORBS_WEBSITE_URL, DISCLAIMER_URL, TimeUnit } from '../../spot-ui/src/index.ts';
1
+ import { Configs, ORBS_TWAP_FAQ_URL, ORBS_LOGO, ORBS_LOGO_FALLBACK, ORBS_WEBSITE_URL, DISCLAIMER_URL, TimeUnit } from '@orbs-network/spot-ui';
2
2
  export declare const REFETCH_ORDER_HISTORY = 20000;
3
3
  export declare const MIN_NATIVE_BALANCE = 0.01;
4
4
  export declare const SLIPPAGE_MULTIPLIER = 10;
@@ -1,4 +1,4 @@
1
- import { Order, OrderStatus } from '../../../spot-ui/src/index.ts';
1
+ import { Order, OrderStatus } from '@orbs-network/spot-ui';
2
2
  import { Token } from '../types';
3
3
  export declare const useOrderName: (order?: Order) => string;
4
4
  export declare const usePersistedOrdersStore: () => {
@@ -5,7 +5,7 @@ export declare const useBuildRePermitOrderDataCallback: () => {
5
5
  chainId: number;
6
6
  verifyingContract: `0x${string}`;
7
7
  };
8
- order: import('../../../spot-ui/src/index.ts').RePermitOrder;
8
+ order: import('@orbs-network/spot-ui').RePermitOrder;
9
9
  types: {
10
10
  RePermitWitnessTransferFrom: {
11
11
  name: string;
@@ -1,4 +1,4 @@
1
- import { Order } from '../../../spot-ui/src/index.ts';
1
+ import { Order } from '@orbs-network/spot-ui';
2
2
  export declare const useCancelOrderMutation: () => import('@tanstack/react-query').UseMutationResult<string[] | undefined, Error, {
3
3
  orders: Order[];
4
4
  }, unknown>;
@@ -1,4 +1,4 @@
1
- import { TimeDuration, TimeUnit } from '../../../spot-ui/src/index.ts';
1
+ import { TimeDuration, TimeUnit } from '@orbs-network/spot-ui';
2
2
  import { InputError } from '../types';
3
3
  export declare const useDuration: () => {
4
4
  duration: TimeDuration;
@@ -1,4 +1,4 @@
1
- import { TimeDuration, TimeUnit } from '../../../spot-ui/src/index.ts';
1
+ import { TimeDuration, TimeUnit } from '@orbs-network/spot-ui';
2
2
  import { InputError } from '..';
3
3
  export declare const useFillDelay: () => {
4
4
  fillDelay: TimeDuration;
@@ -1,4 +1,4 @@
1
- import { Order } from '../../../spot-ui/src/index.ts';
1
+ import { Order } from '@orbs-network/spot-ui';
2
2
  export declare const useHistoryOrder: (orderId?: string) => {
3
3
  title: string;
4
4
  createdAt: {
@@ -1,2 +1,2 @@
1
- export declare const useSubmitOrderMutation: () => import('@tanstack/react-query').UseMutationResult<import('../../../spot-ui/src/index.ts').Order | undefined, Error, void, unknown>;
1
+ export declare const useSubmitOrderMutation: () => import('@tanstack/react-query').UseMutationResult<import('@orbs-network/spot-ui').Order | undefined, Error, void, unknown>;
2
2
  //# sourceMappingURL=use-submit-order.d.ts.map
@@ -99,6 +99,6 @@ export declare const useSubmitSwapPanel: () => {
99
99
  resetSwap: () => void;
100
100
  onCloseModal: () => void;
101
101
  onOpenModal: () => void;
102
- onSubmitOrder: () => Promise<import('../../../spot-ui/src/index.ts').Order | undefined>;
102
+ onSubmitOrder: () => Promise<import('@orbs-network/spot-ui').Order | undefined>;
103
103
  };
104
104
  //# sourceMappingURL=use-submit-swap-panel.d.ts.map
@@ -26,6 +26,6 @@ declare const Components: {
26
26
  SubmitOrderPanel: (props: import('./types').SubmitOrderPanelProps) => import("react/jsx-runtime").JSX.Element;
27
27
  Orders: () => import("react/jsx-runtime").JSX.Element;
28
28
  };
29
- export * from '../../spot-ui/src/index.ts';
29
+ export * from '@orbs-network/spot-ui';
30
30
  export { SpotProvider, ORBS_WEBSITE_URL, ORBS_LOGO, DEFAULT_DURATION_OPTIONS, DISCLAIMER_URL, Components, useTradesPanel, useDurationPanel, useFillDelayPanel, useLimitPricePanel, useMarketPricePanel, useSrcTokenPanel, useDstTokenPanel, useTriggerPricePanel, useOrderHistoryPanel, useSubmitSwapPanel, useDisclaimerPanel, useInvertTradePanel, useInputErrors, useTogglePricePanel, useBuildRePermitOrderDataCallback, useTypedSrcAmount };
31
31
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { CSSProperties, FC, ReactNode } from 'react';
2
- import { Partners, Module, Order, OrderStatus, SpotConfig, TimeDuration } from '../../spot-ui/src/index.ts';
2
+ import { Partners, Module, Order, OrderStatus, SpotConfig, TimeDuration } from '@orbs-network/spot-ui';
3
3
  import { SwapStatus } from '@orbs-network/swap-ui';
4
4
  import { createPublicClient, createWalletClient, TransactionReceipt as _TransactionReceipt, Abi } from 'viem';
5
- export type { Order } from '../../spot-ui/src/index.ts';
6
- export { OrderStatus, type TwapFill, OrderType, Module } from '../../spot-ui/src/index.ts';
5
+ export type { Order } from '@orbs-network/spot-ui';
6
+ export { OrderStatus, type TwapFill, OrderType, Module } from '@orbs-network/spot-ui';
7
7
  export type TransactionReceipt = _TransactionReceipt;
8
8
  export interface Translations {
9
9
  deadlineTooltip: string;
@@ -1,5 +1,5 @@
1
1
  import { AddressPadding, OrderType, Token } from './types';
2
- import { eqIgnoreCase, isNativeAddress, Order } from '../../spot-ui/src/index.ts';
2
+ import { eqIgnoreCase, isNativeAddress, Order } from '@orbs-network/spot-ui';
3
3
  export declare const removeCommas: (numStr: string) => string;
4
4
  type CopyFn = (text: string) => Promise<boolean>;
5
5
  export declare const copy: CopyFn;
@@ -1,5 +1,5 @@
1
1
  import "react";
2
- import { C as r, F as t, D as i, aE as n, aP as E, aN as o, aQ as _, aO as T, j as P, aI as l, an as u, aG as A, ak as I, aF as R, am as L, I as S, aD as O, ap as g, av as D, at as d, au as m, ax as M, aw as C, Q as U, h as c, aL as p, aK as N, aJ as k, O as F, M as b, N as B, P as y, L as G, aM as h, aj as x, al as Y, aH as f, as as v, S as w, J as H, K as W, ay as K, ao as Q, aq as V, ac as X, ad as z, a9 as j, bb as q, T as J, a0 as Z, a6 as $, U as aa, X as sa, ai as ea, ar as ra, aV as ta, b9 as ia, aY as na, aR as Ea, aS as oa, aU as _a, aZ as Ta, a8 as Pa, b8 as la, a$ as ua, b4 as Aa, aW as Ia, b6 as Ra, Z as La, b5 as Sa, b7 as Oa, aX as ga, ab as Da, _ as da, ae as ma, $ as Ma, a3 as Ca, ag as Ua, aC as ca, ba as pa, af as Na, a_ as ka, b2 as Fa, b0 as ba, b3 as Ba, b1 as ya, aT as Ga, a7 as ha, Y as xa, V as Ya, aB as fa, a1 as va, a2 as wa, aA as Ha, ah as Wa, W as Ka, R as Qa, aa as Va, a5 as Xa, a4 as za, bc as ja, A as qa, w as Ja, q as Za, k as $a, m as as, G as ss, y as es, x as rs, n as ts, o as is, t as ns, p as Es, v as os, z as _s, u as Ts, r as Ps, E as ls, az as us } from "./index-BgXrmDmS.js";
2
+ import { C as r, F as t, D as i, aE as n, aP as E, aN as o, aQ as _, aO as T, j as P, aI as l, an as u, aG as A, ak as I, aF as R, am as L, I as S, aD as O, ap as g, av as D, at as d, au as m, ax as M, aw as C, Q as U, h as c, aL as p, aK as N, aJ as k, O as F, M as b, N as B, P as y, L as G, aM as h, aj as x, al as Y, aH as f, as as v, S as w, J as H, K as W, ay as K, ao as Q, aq as V, ac as X, ad as z, a9 as j, bb as q, T as J, a0 as Z, a6 as $, U as aa, X as sa, ai as ea, ar as ra, aV as ta, b9 as ia, aY as na, aR as Ea, aS as oa, aU as _a, aZ as Ta, a8 as Pa, b8 as la, a$ as ua, b4 as Aa, aW as Ia, b6 as Ra, Z as La, b5 as Sa, b7 as Oa, aX as ga, ab as Da, _ as da, ae as ma, $ as Ma, a3 as Ca, ag as Ua, aC as ca, ba as pa, af as Na, a_ as ka, b2 as Fa, b0 as ba, b3 as Ba, b1 as ya, aT as Ga, a7 as ha, Y as xa, V as Ya, aB as fa, a1 as va, a2 as wa, aA as Ha, ah as Wa, W as Ka, R as Qa, aa as Va, a5 as Xa, a4 as za, bc as ja, A as qa, w as Ja, q as Za, k as $a, m as as, G as ss, y as es, x as rs, n as ts, o as is, t as ns, p as Es, v as os, z as _s, u as Ts, r as Ps, E as ls, az as us } from "./index-CXDjLyJG.js";
3
3
  export {
4
4
  r as Components,
5
5
  t as Configs,
@@ -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(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class Pw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Bw=async({chainId:e,signal:t,page:n,limit:r,filters:s})=>{const a=await Aw({chainId:e,signal:t,page:n,limit:r,filters:s}),[o,i]=await Promise.all([Iw({chainId:e,orders:a,signal:t}),Sw({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Is(d.exchange,l.exchange)&&Is(d.twapAddress,l.twapAddress));return Tw(l,e,u,Ow(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Ow=(e,t,n)=>{var o;const r=(o=n==null?void 0:n.find(i=>i.twapId===e.Contract_id.toString()&&Is(i.twapAddress,e.twapAddress)))==null?void 0:o.status,{filledSrcAmount:s}=Th(t),a=Ah(e.ask_srcAmount,s);return Fw(a,e.ask_deadline*1e3,r)},Ah=(e,t)=>{if(!t||!e)return 0;const n=j(t).dividedBy(e).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},Fw=(e,t,n)=>e===100?Qe.Completed:n==="CANCELED"?Qe.Canceled:n==="COMPLETED"?Qe.Completed:t>Date.now()?Qe.Open:Qe.Expired,Sh=async({signal:e,page:t,chainId:n,limit:r,config:s,account:a})=>(await Promise.all([s?Bw({chainId:n,signal:e,page:t,limit:r,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),vw({chainId:n,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Ih=e=>{let t;const n=new Set,r=(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),n.forEach(m=>m(t,f))}},s=()=>t,i={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,s,i);return i},Uw=(e=>e?Ih(e):Ih),Dw=e=>e;function _w(e,t=Dw){const n=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(n),n}const Ph=e=>{const t=Uw(e),n=r=>_w(t,r);return Object.assign(n,t),n},Mw=(e=>e?Ph(e):Ph),Bh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=Mw((e,t)=>({state:Bh,updateState:n=>e(r=>({state:{...r.state,...n}})),updateSwapExecution:n=>e(r=>({state:{...r.state,swapExecution:{...r.state.swapExecution,...n}}})),resetState:()=>{e({state:{...Bh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}})),Nw={version:"0.0.12"};var Ca=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(){}},Lw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zw=(m5=class{constructor(){le(this,fr,Lw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fr),provider:e}),ee(this,fr,e),process.env.NODE_ENV!=="production"&&ee(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fr).setTimeout(e,t)}clearTimeout(e){N(this,fr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fr).setInterval(e,t)}clearInterval(e){N(this,fr).clearInterval(e)}},fr=new WeakMap,pa=new WeakMap,m5),Os=new zw;function Rw(e){setTimeout(e,0)}var Fs=typeof window>"u"||"Deno"in globalThis;function jt(){}function Hw(e,t){return typeof e=="function"?e(t):e}function fd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Oh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xr(e,t){return typeof e=="function"?e(t):e}function En(e,t){return typeof e=="function"?e(t):e}function Fh(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(r){if(t.queryHash!==md(o,t.options))return!1}else if(!Fo(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Uh(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Us(t.options.mutationKey)!==Us(a))return!1}else if(!Fo(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function md(e,t){return((t==null?void 0:t.queryKeyHashFn)||Us)(e)}function Us(e){return JSON.stringify(e,(t,n)=>bd(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Fo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Fo(e[n],t[n])):!1}var $w=Object.prototype.hasOwnProperty;function hd(e,t){if(e===t)return e;const n=Dh(e)&&Dh(t);if(!n&&!(bd(e)&&bd(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,i=n?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=n?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(n?l<s:$w.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=hd(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Fc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Dh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bd(e){if(!_h(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_h(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _h(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gw(e){return new Promise(t=>{Os.setTimeout(t,e)})}function yd(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return hd(e,t)}catch(r){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. [${n.queryHash}]: ${r}`),r}return hd(e,t)}return t}function jw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Vw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uc=Symbol();function Mh(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Uc&&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===Uc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Nh(e,t){return typeof e=="function"?e(...t):!!e}var Ww=(h5=class extends Ca{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Fs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),ee(this,gs,void 0))}setEventListener(t){var n;ee(this,go,t),(n=N(this,gs))==null||n.call(this),ee(this,gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,gs=new WeakMap,go=new WeakMap,h5),gd=new Ww;function xd(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var qw=Rw;function Yw(){let e=[],t=0,n=i=>{i()},r=i=>{i()},s=qw;const a=i=>{t?e.push(i):s(()=>{n(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{r(()=>{i.forEach(c=>{n(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=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{s=i}}}var kt=Yw(),Kw=(b5=class extends Ca{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Fs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,xs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,xs))==null||t.call(this),ee(this,xs,void 0))}setEventListener(t){var n;ee(this,wo,t),(n=N(this,xs))==null||n.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,b5),Dc=new Kw;function Zw(e){return Math.min(1e3*2**e,3e4)}function Lh(e){return(e??"online")==="online"?Dc.isOnline():!0}var wd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zh(e){let t=!1,n=0,r;const s=xd(),a=()=>s.status!=="pending",o=g=>{var k;if(!a()){const v=new wd(g);f(v),(k=e.onCancel)==null||k.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>gd.isFocused()&&(e.networkMode==="always"||Dc.isOnline())&&e.canRun(),u=()=>Lh(e.networkMode)&&e.canRun(),d=g=>{a()||(r==null||r(),s.resolve(g))},f=g=>{a()||(r==null||r(),s.reject(g))},m=()=>new Promise(g=>{var k;r=v=>{(a()||l())&&g(v)},(k=e.onPause)==null||k.call(e)}).then(()=>{var g;r=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const k=n===0?e.initialPromise:void 0;try{g=k??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Fs?0:3),A=e.retryDelay??Zw,T=typeof A=="function"?A(n,v):A,D=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,v);if(t||!D){f(v);return}n++,(L=e.onFail)==null||L.call(e,n,v),Gw(T).then(()=>l()?void 0:m()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var Rh=(y5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fd(this.gcTime)&&ee(this,ma,Os.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fs?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Os.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,y5),Xw=(g5=class extends Rh{constructor(t){super();le(this,Zn);le(this,ha);le(this,vo);le(this,On);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);ee(this,ya,!1),ee(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,On,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,Gh(this.options)),this.state=t.state??N(this,ha),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Gh(this.options);n.data!==void 0&&(this.setState($h(n.data,n.dataUpdatedAt)),ee(this,ha,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,On).remove(this)}setData(t,n){const r=yd(this.state.data,t,this.options);return Se(this,Zn,Yr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Se(this,Zn,Yr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=N(this,Bt))==null?void 0:r.promise;return(s=N(this,Bt))==null||s.cancel(t),n?n.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ha))}isActive(){return this.observers.some(t=>En(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xr(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:!Oh(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,On).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,On).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Zn,Yr).call(this,{type:"invalidate"})}async fetch(t,n){var c,l,u,d,f,m,y,g,k,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.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 r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),r.signal)})},a=()=>{const T=Mh(this.options,n),L=(()=>{const C={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return ee(this,ya,!1),this.options.persister?this.options.persister(T,L,this):T(L)},i=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(T),T})();(l=this.options.behavior)==null||l.onFetch(i,this),ee(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Zn,Yr).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,zh({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof wd&&T.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),r.abort()},onFail:(T,D)=>{Se(this,Zn,Yr).call(this,{type:"failed",failureCount:T,error:D})},onPause:()=>{Se(this,Zn,Yr).call(this,{type:"pause"})},onContinue:()=>{Se(this,Zn,Yr).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),(m=(f=N(this,On).config).onSuccess)==null||m.call(f,T,this),(g=(y=N(this,On).config).onSettled)==null||g.call(y,T,this.state.error,this),T}catch(T){if(T instanceof wd){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,Zn,Yr).call(this,{type:"error",error:T}),(v=(k=N(this,On).config).onError)==null||v.call(k,T,this),(A=(w=N(this,On).config).onSettled)==null||A.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,On=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Zn=new WeakSet,Yr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Hh(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...$h(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),kt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,On).notify({query:this,type:"updated",action:t})})},g5);function Hh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $h(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qw=(x5=class extends Ca{constructor(t,n){super();le(this,Ve);le(this,sn);le(this,Ue);le(this,vc);le(this,qt);le(this,ga);le(this,ko);le(this,Gr);le(this,ws);le(this,kc);le(this,Eo);le(this,To);le(this,xa);le(this,wa);le(this,vs);le(this,Co,new Set);this.options=n,ee(this,sn,t),ee(this,ws,null),ee(this,Gr,xd()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ue).addObserver(this),jh(N(this,Ue),this.options)?Se(this,Ve,Cc).call(this):this.updateResult(),Se(this,Ve,Cm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vd(N(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vd(N(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ve,Am).call(this),Se(this,Ve,Sm).call(this),N(this,Ue).removeObserver(this)}setOptions(t){const n=this.options,r=N(this,Ue);if(this.options=N(this,sn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof En(this.options.enabled,N(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ve,Im).call(this),N(this,Ue).setOptions(this.options),n._defaulted&&!Fc(this.options,n)&&N(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ue),observer:this});const s=this.hasListeners();s&&Vh(N(this,Ue),r,this.options,n)&&Se(this,Ve,Cc).call(this),this.updateResult(),s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||Xr(this.options.staleTime,N(this,Ue))!==Xr(n.staleTime,N(this,Ue)))&&Se(this,Ve,km).call(this);const a=Se(this,Ve,Em).call(this);s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||a!==N(this,vs))&&Se(this,Ve,Tm).call(this,a)}getOptimisticResult(t){const n=N(this,sn).getQueryCache().build(N(this,sn),t),r=this.createResult(n,t);return e3(this,r)&&(ee(this,qt,r),ee(this,ko,this.options),ee(this,ga,N(this,Ue).state)),r}getCurrentResult(){return N(this,qt)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gr).status==="pending"&&N(this,Gr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){N(this,Co).add(t)}getCurrentQuery(){return N(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,sn).defaultQueryOptions(t),r=N(this,sn).getQueryCache().build(N(this,sn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Se(this,Ve,Cc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,n){var b;const r=N(this,Ue),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,ko),l=t!==r?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,m;if(n._optimisticResults){const x=this.hasListeners(),S=!x&&jh(t,n),P=x&&Vh(t,r,n,s);(S||P)&&(d={...d,...Hh(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:k}=d;m=d.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&k==="pending"){let x;a!=null&&a.isPlaceholderData&&n.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof n.placeholderData=="function"?n.placeholderData((b=N(this,To))==null?void 0:b.state.data,N(this,To)):n.placeholderData,x!==void 0&&(k="success",m=yd(a==null?void 0:a.data,x,n),f=!0)}if(n.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&n.select===N(this,kc))m=N(this,Eo);else try{ee(this,kc,n.select),m=n.select(m),m=yd(a==null?void 0:a.data,m,n),ee(this,Eo,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,Eo),g=Date.now(),k="error");const w=d.fetchStatus==="fetching",A=k==="pending",T=k==="error",D=A&&w,L=m!==void 0,h={status:k,fetchStatus:d.fetchStatus,isPending:A,isSuccess:k==="success",isError:T,isInitialLoading:D,isLoading:D,data:m,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!A,isLoadingError:T&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&L,isStale:kd(t,n),refetch:this.refetch,promise:N(this,Gr),isEnabled:En(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=O=>{h.status==="error"?O.reject(h.error):h.data!==void 0&&O.resolve(h.data)},S=()=>{const O=ee(this,Gr,h.promise=xd());x(O)},P=N(this,Gr);switch(P.status){case"pending":t.queryHash===r.queryHash&&x(P);break;case"fulfilled":(h.status==="error"||h.data!==P.value)&&S();break;case"rejected":(h.status!=="error"||h.error!==P.reason)&&S();break}}return h}updateResult(){const t=N(this,qt),n=this.createResult(N(this,Ue),this.options);if(ee(this,ga,N(this,Ue).state),ee(this,ko,this.options),N(this,ga).data!==void 0&&ee(this,To,N(this,Ue)),Fc(n,t))return;ee(this,qt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,Co).size)return!0;const o=new Set(a??N(this,Co));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Se(this,Ve,F5).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ve,Cm).call(this)}},sn=new WeakMap,Ue=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,ko=new WeakMap,Gr=new WeakMap,ws=new WeakMap,kc=new WeakMap,Eo=new WeakMap,To=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,Co=new WeakMap,Ve=new WeakSet,Cc=function(t){Se(this,Ve,Im).call(this);let n=N(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jt)),n},km=function(){Se(this,Ve,Am).call(this);const t=Xr(this.options.staleTime,N(this,Ue));if(Fs||N(this,qt).isStale||!fd(t))return;const r=Oh(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Os.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},r))},Em=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ue)):this.options.refetchInterval)??!1},Tm=function(t){Se(this,Ve,Sm).call(this),ee(this,vs,t),!(Fs||En(this.options.enabled,N(this,Ue))===!1||!fd(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Os.setInterval(()=>{(this.options.refetchIntervalInBackground||gd.isFocused())&&Se(this,Ve,Cc).call(this)},N(this,vs)))},Cm=function(){Se(this,Ve,km).call(this),Se(this,Ve,Tm).call(this,Se(this,Ve,Em).call(this))},Am=function(){N(this,xa)&&(Os.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Sm=function(){N(this,wa)&&(Os.clearInterval(N(this,wa)),ee(this,wa,void 0))},Im=function(){const t=N(this,sn).getQueryCache().build(N(this,sn),this.options);if(t===N(this,Ue))return;const n=N(this,Ue);ee(this,Ue,t),ee(this,vc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},F5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,qt))}),N(this,sn).getQueryCache().notify({query:N(this,Ue),type:"observerResultsUpdated"})})},x5);function Jw(e,t){return En(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function jh(e,t){return Jw(e,t)||e.state.data!==void 0&&vd(e,t,t.refetchOnMount)}function vd(e,t,n){if(En(t.enabled,e)!==!1&&Xr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&kd(e,t)}return!1}function Vh(e,t,n,r){return(e!==t||En(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kd(e,n)}function kd(e,t){return En(t.enabled,e)!==!1&&e.isStaleByTime(Xr(t.staleTime,e))}function e3(e,t){return!Fc(e.getCurrentResult(),t)}function Wh(e){return{onFetch:(t,n)=>{var u,d,f,m,y;const r=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const k=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Mh(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 C=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:T,direction:D?"backward":"forward",meta:t.options.meta};return k(S),S})(),h=await v(C),{maxPages:b}=t.options,x=D?Vw:jw;return{pages:x(A.pages,h,b),pageParams:x(A.pageParams,T,b)}};if(s&&a.length){const A=s==="backward",T=A?t3:qh,D={pages:a,pageParams:o},L=T(r,D);i=await w(D,L,A)}else{const A=e??a.length;do{const T=c===0?o[0]??r.initialPageParam:qh(r,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,k;return(k=(g=t.options).persister)==null?void 0:k.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function qh(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function t3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var n3=(w5=class extends Rh{constructor(t){super();le(this,hr);le(this,Ec);le(this,mr);le(this,Yt);le(this,va);ee(this,Ec,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,mr,[]),this.state=t.state||Yh(),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,mr).includes(t)||(N(this,mr).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,mr,N(this,mr).filter(n=>n!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,mr).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,y,g,k,v,w,A,T,D,L,C,h,b;const n=()=>{Se(this,hr,As).call(this,{type:"continue"})},r={client:N(this,Ec),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,zh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Se(this,hr,As).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Se(this,hr,As).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)n();else{Se(this,hr,As).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,r));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,r));S!==this.state.context&&Se(this,hr,As).call(this,{type:"pending",context:S,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,r)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,r)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,r)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,x,null,t,this.state.context,r)),Se(this,hr,As).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,r)),await((D=(T=this.options).onError)==null?void 0:D.call(T,x,t,this.state.context,r)),await((C=(L=N(this,Yt).config).onSettled)==null?void 0:C.call(L,void 0,x,this.state.variables,this.state.context,this,r)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,r)),x}finally{Se(this,hr,As).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},Ec=new WeakMap,mr=new WeakMap,Yt=new WeakMap,va=new WeakMap,hr=new WeakSet,As=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),kt.batch(()=>{N(this,mr).forEach(r=>{r.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},w5);function Yh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var r3=(v5=class extends Ca{constructor(t={}){super();le(this,jr);le(this,Xn);le(this,Tc);this.config=t,ee(this,jr,new Set),ee(this,Xn,new Map),ee(this,Tc,0)}build(t,n,r){const s=new n3({client:t,mutationCache:this,mutationId:++Ku(this,Tc)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){N(this,jr).add(t);const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);r?r.push(t):N(this,Xn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jr).delete(t)){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&N(this,Xn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=_c(t);if(typeof n=="string"){const s=(r=N(this,Xn).get(n))==null?void 0:r.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,jr).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jr).clear(),N(this,Xn).clear()})}getAll(){return Array.from(N(this,jr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Uh(n,r))}findAll(t={}){return this.getAll().filter(n=>Uh(t,n))}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return kt.batch(()=>Promise.all(t.map(n=>n.continue().catch(jt))))}},jr=new WeakMap,Xn=new WeakMap,Tc=new WeakMap,v5);function _c(e){var t;return(t=e.options.scope)==null?void 0:t.id}var s3=(k5=class extends Ca{constructor(t,n){super();le(this,qr);le(this,Vr);le(this,ks);le(this,an);le(this,Wr);ee(this,Vr,t),this.setOptions(n),this.bindMethods(),Se(this,qr,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=N(this,Vr).defaultMutationOptions(t),Fc(this.options,n)||N(this,Vr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,an),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Us(n.mutationKey)!==Us(this.options.mutationKey)?this.reset():((r=N(this,an))==null?void 0:r.state.status)==="pending"&&N(this,an).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,an))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,qr,Zu).call(this),Se(this,qr,Pm).call(this,t)}getCurrentResult(){return N(this,ks)}reset(){var t;(t=N(this,an))==null||t.removeObserver(this),ee(this,an,void 0),Se(this,qr,Zu).call(this),Se(this,qr,Pm).call(this)}mutate(t,n){var r;return ee(this,Wr,n),(r=N(this,an))==null||r.removeObserver(this),ee(this,an,N(this,Vr).getMutationCache().build(N(this,Vr),this.options)),N(this,an).addObserver(this),N(this,an).execute(t)}},Vr=new WeakMap,ks=new WeakMap,an=new WeakMap,Wr=new WeakMap,qr=new WeakSet,Zu=function(){var n;const t=((n=N(this,an))==null?void 0:n.state)??Yh();ee(this,ks,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Pm=function(t){kt.batch(()=>{var n,r,s,a,o,i,c,l;if(N(this,Wr)&&this.hasListeners()){const u=N(this,ks).variables,d=N(this,ks).context,f={client:N(this,Vr),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((r=(n=N(this,Wr)).onSuccess)==null||r.call(n,t.data,u,d,f),(a=(s=N(this,Wr)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wr)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wr)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,ks))})})},k5),a3=(E5=class extends Ca{constructor(t={}){super();le(this,br);this.config=t,ee(this,br,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??md(s,n);let o=this.get(a);return o||(o=new Xw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,br).has(t.queryHash)||(N(this,br).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,br).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,br).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,br).get(t)}getAll(){return[...N(this,br).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Fh(t,r)):n}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},br=new WeakMap,E5),o3=(T5=class{constructor(e={}){le(this,ft);le(this,Es);le(this,Ts);le(this,Ao);le(this,So);le(this,Cs);le(this,Io);le(this,Po);ee(this,ft,e.queryCache||new a3),ee(this,Es,e.mutationCache||new r3),ee(this,Ts,e.defaultOptions||{}),ee(this,Ao,new Map),ee(this,So,new Map),ee(this,Cs,0)}mount(){Ku(this,Cs)._++,N(this,Cs)===1&&(ee(this,Io,gd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Po,Dc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Cs)._--,N(this,Cs)===0&&((e=N(this,Io))==null||e.call(this),ee(this,Io,void 0),(t=N(this,Po))==null||t.call(this),ee(this,Po,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,ft).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(r.queryHash),a=s==null?void 0:s.state.data,o=Hw(t,a);if(o!==void 0)return N(this,ft).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,ft);return kt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(n=>{n.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,ft).build(this,t);return n.isStaleByTime(Xr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=Wh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=Wh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dc.isOnline()?N(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,Es)}getDefaultOptions(){return N(this,Ts)}setDefaultOptions(e){ee(this,Ts,e)}setQueryDefaults(e,t){N(this,Ao).set(Us(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Ao).values()],n={};return t.forEach(r=>{Fo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,So).set(Us(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,So).values()],n={};return t.forEach(r=>{Fo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ts).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=md(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===Uc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Ts).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,Es).clear()}},ft=new WeakMap,Es=new WeakMap,Ts=new WeakMap,Ao=new WeakMap,So=new WeakMap,Cs=new WeakMap,Io=new WeakMap,Po=new WeakMap,T5),Kh=gt.createContext(void 0),Uo=e=>{const t=gt.useContext(Kh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},i3=({client:e,children:t})=>(gt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Kh.Provider,{value:e,children:t})),Zh=gt.createContext(!1),c3=()=>gt.useContext(Zh);Zh.Provider;function l3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var u3=gt.createContext(l3()),d3=()=>gt.useContext(u3),p3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},f3=e=>{gt.useEffect(()=>{e.clearReset()},[e])},m3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Nh(n,[e.error,r])),h3=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},b3=(e,t)=>e.isLoading&&e.isFetching&&!t,y3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Xh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function g3(e,t,n){var d,f,m,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=c3(),s=d3(),a=Uo(),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=r?"isRestoring":"optimistic",h3(o),p3(o,s),f3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=gt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(gt.useSyncExternalStore(gt.useCallback(k=>{const v=u?c.subscribe(kt.batchCalls(k)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),gt.useEffect(()=>{c.setOptions(o)},[o,c]),y3(o,l))throw Xh(o,c,s);if(m3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,l),o.experimental_prefetchInRender&&!Fs&&b3(l,r)){const k=i?Xh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;k==null||k.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function x3(e,t){return g3(e,Qw)}function xr(e,t){const n=Uo(),[r]=gt.useState(()=>new s3(n,e));gt.useEffect(()=>{r.setOptions(e)},[r,e]);const s=gt.useSyncExternalStore(gt.useCallback(o=>r.subscribe(kt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=gt.useCallback((o,i)=>{r.mutate(o,i).catch(jt)},[r]);if(s.error&&Nh(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const w3="1.2.3";let Zt=class Bm extends Error{constructor(t,n={}){var o;const r=n.cause instanceof Bm?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof Bm&&n.cause.docsPath||n.docsPath,a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${w3}`].join(`
64
+ `,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class Pw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Bw=async({chainId:e,signal:t,page:n,limit:r,filters:s})=>{const a=await Aw({chainId:e,signal:t,page:n,limit:r,filters:s}),[o,i]=await Promise.all([Iw({chainId:e,orders:a,signal:t}),Sw({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Is(d.exchange,l.exchange)&&Is(d.twapAddress,l.twapAddress));return Tw(l,e,u,Ow(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Ow=(e,t,n)=>{var o;const r=(o=n==null?void 0:n.find(i=>i.twapId===e.Contract_id.toString()&&Is(i.twapAddress,e.twapAddress)))==null?void 0:o.status,{filledSrcAmount:s}=Th(t),a=Ah(e.ask_srcAmount,s);return Fw(a,e.ask_deadline*1e3,r)},Ah=(e,t)=>{if(!t||!e)return 0;const n=j(t).dividedBy(e).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},Fw=(e,t,n)=>e===100?Qe.Completed:n==="CANCELED"?Qe.Canceled:n==="COMPLETED"?Qe.Completed:t>Date.now()?Qe.Open:Qe.Expired,Sh=async({signal:e,page:t,chainId:n,limit:r,config:s,account:a})=>(await Promise.all([s?Bw({chainId:n,signal:e,page:t,limit:r,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),vw({chainId:n,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Ih=e=>{let t;const n=new Set,r=(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),n.forEach(m=>m(t,f))}},s=()=>t,i={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,s,i);return i},Uw=(e=>e?Ih(e):Ih),Dw=e=>e;function _w(e,t=Dw){const n=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(n),n}const Ph=e=>{const t=Uw(e),n=r=>_w(t,r);return Object.assign(n,t),n},Mw=(e=>e?Ph(e):Ph),Bh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=Mw((e,t)=>({state:Bh,updateState:n=>e(r=>({state:{...r.state,...n}})),updateSwapExecution:n=>e(r=>({state:{...r.state,swapExecution:{...r.state.swapExecution,...n}}})),resetState:()=>{e({state:{...Bh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}})),Nw={version:"0.0.13"};var Ca=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(){}},Lw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zw=(m5=class{constructor(){le(this,fr,Lw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,fr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,fr),provider:e}),ee(this,fr,e),process.env.NODE_ENV!=="production"&&ee(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fr).setTimeout(e,t)}clearTimeout(e){N(this,fr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,fr).setInterval(e,t)}clearInterval(e){N(this,fr).clearInterval(e)}},fr=new WeakMap,pa=new WeakMap,m5),Os=new zw;function Rw(e){setTimeout(e,0)}var Fs=typeof window>"u"||"Deno"in globalThis;function jt(){}function Hw(e,t){return typeof e=="function"?e(t):e}function fd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Oh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xr(e,t){return typeof e=="function"?e(t):e}function En(e,t){return typeof e=="function"?e(t):e}function Fh(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(r){if(t.queryHash!==md(o,t.options))return!1}else if(!Fo(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Uh(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Us(t.options.mutationKey)!==Us(a))return!1}else if(!Fo(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function md(e,t){return((t==null?void 0:t.queryKeyHashFn)||Us)(e)}function Us(e){return JSON.stringify(e,(t,n)=>bd(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Fo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Fo(e[n],t[n])):!1}var $w=Object.prototype.hasOwnProperty;function hd(e,t){if(e===t)return e;const n=Dh(e)&&Dh(t);if(!n&&!(bd(e)&&bd(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,i=n?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=n?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(n?l<s:$w.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=hd(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Fc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Dh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bd(e){if(!_h(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_h(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _h(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gw(e){return new Promise(t=>{Os.setTimeout(t,e)})}function yd(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return hd(e,t)}catch(r){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. [${n.queryHash}]: ${r}`),r}return hd(e,t)}return t}function jw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Vw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uc=Symbol();function Mh(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Uc&&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===Uc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Nh(e,t){return typeof e=="function"?e(...t):!!e}var Ww=(h5=class extends Ca{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Fs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),ee(this,gs,void 0))}setEventListener(t){var n;ee(this,go,t),(n=N(this,gs))==null||n.call(this),ee(this,gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,gs=new WeakMap,go=new WeakMap,h5),gd=new Ww;function xd(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var qw=Rw;function Yw(){let e=[],t=0,n=i=>{i()},r=i=>{i()},s=qw;const a=i=>{t?e.push(i):s(()=>{n(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{r(()=>{i.forEach(c=>{n(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=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{s=i}}}var kt=Yw(),Kw=(b5=class extends Ca{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Fs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,xs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,xs))==null||t.call(this),ee(this,xs,void 0))}setEventListener(t){var n;ee(this,wo,t),(n=N(this,xs))==null||n.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,b5),Dc=new Kw;function Zw(e){return Math.min(1e3*2**e,3e4)}function Lh(e){return(e??"online")==="online"?Dc.isOnline():!0}var wd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zh(e){let t=!1,n=0,r;const s=xd(),a=()=>s.status!=="pending",o=g=>{var k;if(!a()){const v=new wd(g);f(v),(k=e.onCancel)==null||k.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>gd.isFocused()&&(e.networkMode==="always"||Dc.isOnline())&&e.canRun(),u=()=>Lh(e.networkMode)&&e.canRun(),d=g=>{a()||(r==null||r(),s.resolve(g))},f=g=>{a()||(r==null||r(),s.reject(g))},m=()=>new Promise(g=>{var k;r=v=>{(a()||l())&&g(v)},(k=e.onPause)==null||k.call(e)}).then(()=>{var g;r=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const k=n===0?e.initialPromise:void 0;try{g=k??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Fs?0:3),A=e.retryDelay??Zw,T=typeof A=="function"?A(n,v):A,D=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,v);if(t||!D){f(v);return}n++,(L=e.onFail)==null||L.call(e,n,v),Gw(T).then(()=>l()?void 0:m()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var Rh=(y5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fd(this.gcTime)&&ee(this,ma,Os.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fs?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Os.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,y5),Xw=(g5=class extends Rh{constructor(t){super();le(this,Zn);le(this,ha);le(this,vo);le(this,On);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);ee(this,ya,!1),ee(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,On,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,Gh(this.options)),this.state=t.state??N(this,ha),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Gh(this.options);n.data!==void 0&&(this.setState($h(n.data,n.dataUpdatedAt)),ee(this,ha,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,On).remove(this)}setData(t,n){const r=yd(this.state.data,t,this.options);return Se(this,Zn,Yr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Se(this,Zn,Yr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=N(this,Bt))==null?void 0:r.promise;return(s=N(this,Bt))==null||s.cancel(t),n?n.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ha))}isActive(){return this.observers.some(t=>En(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xr(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:!Oh(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Bt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,On).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,On).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Zn,Yr).call(this,{type:"invalidate"})}async fetch(t,n){var c,l,u,d,f,m,y,g,k,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.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 r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),r.signal)})},a=()=>{const T=Mh(this.options,n),L=(()=>{const C={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return ee(this,ya,!1),this.options.persister?this.options.persister(T,L,this):T(L)},i=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(T),T})();(l=this.options.behavior)==null||l.onFetch(i,this),ee(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Zn,Yr).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,zh({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof wd&&T.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),r.abort()},onFail:(T,D)=>{Se(this,Zn,Yr).call(this,{type:"failed",failureCount:T,error:D})},onPause:()=>{Se(this,Zn,Yr).call(this,{type:"pause"})},onContinue:()=>{Se(this,Zn,Yr).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),(m=(f=N(this,On).config).onSuccess)==null||m.call(f,T,this),(g=(y=N(this,On).config).onSettled)==null||g.call(y,T,this.state.error,this),T}catch(T){if(T instanceof wd){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,Zn,Yr).call(this,{type:"error",error:T}),(v=(k=N(this,On).config).onError)==null||v.call(k,T,this),(A=(w=N(this,On).config).onSettled)==null||A.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,On=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Zn=new WeakSet,Yr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Hh(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...$h(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),kt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,On).notify({query:this,type:"updated",action:t})})},g5);function Hh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $h(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qw=(x5=class extends Ca{constructor(t,n){super();le(this,Ve);le(this,sn);le(this,Ue);le(this,vc);le(this,qt);le(this,ga);le(this,ko);le(this,Gr);le(this,ws);le(this,kc);le(this,Eo);le(this,To);le(this,xa);le(this,wa);le(this,vs);le(this,Co,new Set);this.options=n,ee(this,sn,t),ee(this,ws,null),ee(this,Gr,xd()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ue).addObserver(this),jh(N(this,Ue),this.options)?Se(this,Ve,Cc).call(this):this.updateResult(),Se(this,Ve,Cm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vd(N(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vd(N(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ve,Am).call(this),Se(this,Ve,Sm).call(this),N(this,Ue).removeObserver(this)}setOptions(t){const n=this.options,r=N(this,Ue);if(this.options=N(this,sn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof En(this.options.enabled,N(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ve,Im).call(this),N(this,Ue).setOptions(this.options),n._defaulted&&!Fc(this.options,n)&&N(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ue),observer:this});const s=this.hasListeners();s&&Vh(N(this,Ue),r,this.options,n)&&Se(this,Ve,Cc).call(this),this.updateResult(),s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||Xr(this.options.staleTime,N(this,Ue))!==Xr(n.staleTime,N(this,Ue)))&&Se(this,Ve,km).call(this);const a=Se(this,Ve,Em).call(this);s&&(N(this,Ue)!==r||En(this.options.enabled,N(this,Ue))!==En(n.enabled,N(this,Ue))||a!==N(this,vs))&&Se(this,Ve,Tm).call(this,a)}getOptimisticResult(t){const n=N(this,sn).getQueryCache().build(N(this,sn),t),r=this.createResult(n,t);return e3(this,r)&&(ee(this,qt,r),ee(this,ko,this.options),ee(this,ga,N(this,Ue).state)),r}getCurrentResult(){return N(this,qt)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gr).status==="pending"&&N(this,Gr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){N(this,Co).add(t)}getCurrentQuery(){return N(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,sn).defaultQueryOptions(t),r=N(this,sn).getQueryCache().build(N(this,sn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Se(this,Ve,Cc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,n){var b;const r=N(this,Ue),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,ko),l=t!==r?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,m;if(n._optimisticResults){const x=this.hasListeners(),S=!x&&jh(t,n),P=x&&Vh(t,r,n,s);(S||P)&&(d={...d,...Hh(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:k}=d;m=d.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&k==="pending"){let x;a!=null&&a.isPlaceholderData&&n.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof n.placeholderData=="function"?n.placeholderData((b=N(this,To))==null?void 0:b.state.data,N(this,To)):n.placeholderData,x!==void 0&&(k="success",m=yd(a==null?void 0:a.data,x,n),f=!0)}if(n.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&n.select===N(this,kc))m=N(this,Eo);else try{ee(this,kc,n.select),m=n.select(m),m=yd(a==null?void 0:a.data,m,n),ee(this,Eo,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,Eo),g=Date.now(),k="error");const w=d.fetchStatus==="fetching",A=k==="pending",T=k==="error",D=A&&w,L=m!==void 0,h={status:k,fetchStatus:d.fetchStatus,isPending:A,isSuccess:k==="success",isError:T,isInitialLoading:D,isLoading:D,data:m,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!A,isLoadingError:T&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&L,isStale:kd(t,n),refetch:this.refetch,promise:N(this,Gr),isEnabled:En(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=O=>{h.status==="error"?O.reject(h.error):h.data!==void 0&&O.resolve(h.data)},S=()=>{const O=ee(this,Gr,h.promise=xd());x(O)},P=N(this,Gr);switch(P.status){case"pending":t.queryHash===r.queryHash&&x(P);break;case"fulfilled":(h.status==="error"||h.data!==P.value)&&S();break;case"rejected":(h.status!=="error"||h.error!==P.reason)&&S();break}}return h}updateResult(){const t=N(this,qt),n=this.createResult(N(this,Ue),this.options);if(ee(this,ga,N(this,Ue).state),ee(this,ko,this.options),N(this,ga).data!==void 0&&ee(this,To,N(this,Ue)),Fc(n,t))return;ee(this,qt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,Co).size)return!0;const o=new Set(a??N(this,Co));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Se(this,Ve,F5).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ve,Cm).call(this)}},sn=new WeakMap,Ue=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,ko=new WeakMap,Gr=new WeakMap,ws=new WeakMap,kc=new WeakMap,Eo=new WeakMap,To=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,Co=new WeakMap,Ve=new WeakSet,Cc=function(t){Se(this,Ve,Im).call(this);let n=N(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jt)),n},km=function(){Se(this,Ve,Am).call(this);const t=Xr(this.options.staleTime,N(this,Ue));if(Fs||N(this,qt).isStale||!fd(t))return;const r=Oh(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Os.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},r))},Em=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ue)):this.options.refetchInterval)??!1},Tm=function(t){Se(this,Ve,Sm).call(this),ee(this,vs,t),!(Fs||En(this.options.enabled,N(this,Ue))===!1||!fd(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Os.setInterval(()=>{(this.options.refetchIntervalInBackground||gd.isFocused())&&Se(this,Ve,Cc).call(this)},N(this,vs)))},Cm=function(){Se(this,Ve,km).call(this),Se(this,Ve,Tm).call(this,Se(this,Ve,Em).call(this))},Am=function(){N(this,xa)&&(Os.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Sm=function(){N(this,wa)&&(Os.clearInterval(N(this,wa)),ee(this,wa,void 0))},Im=function(){const t=N(this,sn).getQueryCache().build(N(this,sn),this.options);if(t===N(this,Ue))return;const n=N(this,Ue);ee(this,Ue,t),ee(this,vc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},F5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,qt))}),N(this,sn).getQueryCache().notify({query:N(this,Ue),type:"observerResultsUpdated"})})},x5);function Jw(e,t){return En(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function jh(e,t){return Jw(e,t)||e.state.data!==void 0&&vd(e,t,t.refetchOnMount)}function vd(e,t,n){if(En(t.enabled,e)!==!1&&Xr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&kd(e,t)}return!1}function Vh(e,t,n,r){return(e!==t||En(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kd(e,n)}function kd(e,t){return En(t.enabled,e)!==!1&&e.isStaleByTime(Xr(t.staleTime,e))}function e3(e,t){return!Fc(e.getCurrentResult(),t)}function Wh(e){return{onFetch:(t,n)=>{var u,d,f,m,y;const r=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const k=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Mh(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 C=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:T,direction:D?"backward":"forward",meta:t.options.meta};return k(S),S})(),h=await v(C),{maxPages:b}=t.options,x=D?Vw:jw;return{pages:x(A.pages,h,b),pageParams:x(A.pageParams,T,b)}};if(s&&a.length){const A=s==="backward",T=A?t3:qh,D={pages:a,pageParams:o},L=T(r,D);i=await w(D,L,A)}else{const A=e??a.length;do{const T=c===0?o[0]??r.initialPageParam:qh(r,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,k;return(k=(g=t.options).persister)==null?void 0:k.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function qh(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function t3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var n3=(w5=class extends Rh{constructor(t){super();le(this,hr);le(this,Ec);le(this,mr);le(this,Yt);le(this,va);ee(this,Ec,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,mr,[]),this.state=t.state||Yh(),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,mr).includes(t)||(N(this,mr).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,mr,N(this,mr).filter(n=>n!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,mr).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,y,g,k,v,w,A,T,D,L,C,h,b;const n=()=>{Se(this,hr,As).call(this,{type:"continue"})},r={client:N(this,Ec),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,zh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Se(this,hr,As).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Se(this,hr,As).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)n();else{Se(this,hr,As).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,r));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,r));S!==this.state.context&&Se(this,hr,As).call(this,{type:"pending",context:S,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,r)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,r)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,r)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,x,null,t,this.state.context,r)),Se(this,hr,As).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,r)),await((D=(T=this.options).onError)==null?void 0:D.call(T,x,t,this.state.context,r)),await((C=(L=N(this,Yt).config).onSettled)==null?void 0:C.call(L,void 0,x,this.state.variables,this.state.context,this,r)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,r)),x}finally{Se(this,hr,As).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},Ec=new WeakMap,mr=new WeakMap,Yt=new WeakMap,va=new WeakMap,hr=new WeakSet,As=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),kt.batch(()=>{N(this,mr).forEach(r=>{r.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},w5);function Yh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var r3=(v5=class extends Ca{constructor(t={}){super();le(this,jr);le(this,Xn);le(this,Tc);this.config=t,ee(this,jr,new Set),ee(this,Xn,new Map),ee(this,Tc,0)}build(t,n,r){const s=new n3({client:t,mutationCache:this,mutationId:++Ku(this,Tc)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){N(this,jr).add(t);const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);r?r.push(t):N(this,Xn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jr).delete(t)){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&N(this,Xn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_c(t);if(typeof n=="string"){const r=N(this,Xn).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=_c(t);if(typeof n=="string"){const s=(r=N(this,Xn).get(n))==null?void 0:r.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,jr).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jr).clear(),N(this,Xn).clear()})}getAll(){return Array.from(N(this,jr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Uh(n,r))}findAll(t={}){return this.getAll().filter(n=>Uh(t,n))}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return kt.batch(()=>Promise.all(t.map(n=>n.continue().catch(jt))))}},jr=new WeakMap,Xn=new WeakMap,Tc=new WeakMap,v5);function _c(e){var t;return(t=e.options.scope)==null?void 0:t.id}var s3=(k5=class extends Ca{constructor(t,n){super();le(this,qr);le(this,Vr);le(this,ks);le(this,an);le(this,Wr);ee(this,Vr,t),this.setOptions(n),this.bindMethods(),Se(this,qr,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=N(this,Vr).defaultMutationOptions(t),Fc(this.options,n)||N(this,Vr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,an),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Us(n.mutationKey)!==Us(this.options.mutationKey)?this.reset():((r=N(this,an))==null?void 0:r.state.status)==="pending"&&N(this,an).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,an))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,qr,Zu).call(this),Se(this,qr,Pm).call(this,t)}getCurrentResult(){return N(this,ks)}reset(){var t;(t=N(this,an))==null||t.removeObserver(this),ee(this,an,void 0),Se(this,qr,Zu).call(this),Se(this,qr,Pm).call(this)}mutate(t,n){var r;return ee(this,Wr,n),(r=N(this,an))==null||r.removeObserver(this),ee(this,an,N(this,Vr).getMutationCache().build(N(this,Vr),this.options)),N(this,an).addObserver(this),N(this,an).execute(t)}},Vr=new WeakMap,ks=new WeakMap,an=new WeakMap,Wr=new WeakMap,qr=new WeakSet,Zu=function(){var n;const t=((n=N(this,an))==null?void 0:n.state)??Yh();ee(this,ks,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Pm=function(t){kt.batch(()=>{var n,r,s,a,o,i,c,l;if(N(this,Wr)&&this.hasListeners()){const u=N(this,ks).variables,d=N(this,ks).context,f={client:N(this,Vr),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((r=(n=N(this,Wr)).onSuccess)==null||r.call(n,t.data,u,d,f),(a=(s=N(this,Wr)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wr)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wr)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,ks))})})},k5),a3=(E5=class extends Ca{constructor(t={}){super();le(this,br);this.config=t,ee(this,br,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??md(s,n);let o=this.get(a);return o||(o=new Xw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,br).has(t.queryHash)||(N(this,br).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,br).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,br).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,br).get(t)}getAll(){return[...N(this,br).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Fh(t,r)):n}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},br=new WeakMap,E5),o3=(T5=class{constructor(e={}){le(this,ft);le(this,Es);le(this,Ts);le(this,Ao);le(this,So);le(this,Cs);le(this,Io);le(this,Po);ee(this,ft,e.queryCache||new a3),ee(this,Es,e.mutationCache||new r3),ee(this,Ts,e.defaultOptions||{}),ee(this,Ao,new Map),ee(this,So,new Map),ee(this,Cs,0)}mount(){Ku(this,Cs)._++,N(this,Cs)===1&&(ee(this,Io,gd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Po,Dc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Cs)._--,N(this,Cs)===0&&((e=N(this,Io))==null||e.call(this),ee(this,Io,void 0),(t=N(this,Po))==null||t.call(this),ee(this,Po,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,ft).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(r.queryHash),a=s==null?void 0:s.state.data,o=Hw(t,a);if(o!==void 0)return N(this,ft).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,ft).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,ft);return kt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(n=>{n.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,ft).build(this,t);return n.isStaleByTime(Xr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=Wh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=Wh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dc.isOnline()?N(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,Es)}getDefaultOptions(){return N(this,Ts)}setDefaultOptions(e){ee(this,Ts,e)}setQueryDefaults(e,t){N(this,Ao).set(Us(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Ao).values()],n={};return t.forEach(r=>{Fo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,So).set(Us(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,So).values()],n={};return t.forEach(r=>{Fo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ts).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=md(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===Uc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Ts).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,Es).clear()}},ft=new WeakMap,Es=new WeakMap,Ts=new WeakMap,Ao=new WeakMap,So=new WeakMap,Cs=new WeakMap,Io=new WeakMap,Po=new WeakMap,T5),Kh=gt.createContext(void 0),Uo=e=>{const t=gt.useContext(Kh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},i3=({client:e,children:t})=>(gt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(Kh.Provider,{value:e,children:t})),Zh=gt.createContext(!1),c3=()=>gt.useContext(Zh);Zh.Provider;function l3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var u3=gt.createContext(l3()),d3=()=>gt.useContext(u3),p3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},f3=e=>{gt.useEffect(()=>{e.clearReset()},[e])},m3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Nh(n,[e.error,r])),h3=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},b3=(e,t)=>e.isLoading&&e.isFetching&&!t,y3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Xh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function g3(e,t,n){var d,f,m,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=c3(),s=d3(),a=Uo(),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=r?"isRestoring":"optimistic",h3(o),p3(o,s),f3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=gt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(gt.useSyncExternalStore(gt.useCallback(k=>{const v=u?c.subscribe(kt.batchCalls(k)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),gt.useEffect(()=>{c.setOptions(o)},[o,c]),y3(o,l))throw Xh(o,c,s);if(m3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,l),o.experimental_prefetchInRender&&!Fs&&b3(l,r)){const k=i?Xh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;k==null||k.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function x3(e,t){return g3(e,Qw)}function xr(e,t){const n=Uo(),[r]=gt.useState(()=>new s3(n,e));gt.useEffect(()=>{r.setOptions(e)},[r,e]);const s=gt.useSyncExternalStore(gt.useCallback(o=>r.subscribe(kt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=gt.useCallback((o,i)=>{r.mutate(o,i).catch(jt)},[r]);if(s.error&&Nh(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const w3="1.2.3";let Zt=class Bm extends Error{constructor(t,n={}){var o;const r=n.cause instanceof Bm?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof Bm&&n.cause.docsPath||n.docsPath,a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${w3}`].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"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function wr(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Qh=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Jh=/^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)?$/,e1=/^\(.+?\).*?$/,t1=/^tuple(?<array>(\[(\d*)\])*)$/;function Ed(e){let t=e.type;if(t1.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const a=e.components[s];t+=Ed(a),s<n-1&&(t+=", ")}const r=wr(t1,e.type);return t+=`)${(r==null?void 0:r.array)||""}`,Ed({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Aa(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=Ed(s),r!==n-1&&(t+=", ")}return t}function Mc(e){var t;return e.type==="function"?`function ${e.name}(${Aa(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${Aa(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Aa(e.inputs)})`:e.type==="error"?`error ${e.name}(${Aa(e.inputs)})`:e.type==="constructor"?`constructor(${Aa(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const n1=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function v3(e){return n1.test(e)}function k3(e){return wr(n1,e)}const r1=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function E3(e){return r1.test(e)}function T3(e){return wr(r1,e)}const s1=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function C3(e){return s1.test(e)}function A3(e){return wr(s1,e)}const a1=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Nc(e){return a1.test(e)}function S3(e){return wr(a1,e)}const o1=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function I3(e){return o1.test(e)}function P3(e){return wr(o1,e)}const i1=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function B3(e){return i1.test(e)}function O3(e){return wr(i1,e)}const F3=/^receive\(\) external payable$/;function U3(e){return F3.test(e)}const c1=new Set(["memory","indexed","storage","calldata"]),D3=new Set(["indexed"]),Td=new Set(["calldata","memory","storage"]);class _3 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 M3 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 N3 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 L3 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 z3 extends Zt{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class R3 extends Zt{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" 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 H3 extends Zt{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class $3 extends Zt{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class G3 extends Zt{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Sa extends Zt{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class j3 extends Zt{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class V3 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 W3 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 q3 extends Zt{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Y3(e,t,n){let r="";if(n)for(const s of Object.entries(n)){if(!s)continue;let a="";for(const o of s[1])a+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${s[0]}{${a}})`}return t?`${t}:${e}${r}`:`${e}${r}`}const Cd=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 Ad(e,t={}){if(C3(e))return K3(e,t);if(E3(e))return Z3(e,t);if(v3(e))return X3(e,t);if(I3(e))return Q3(e,t);if(B3(e))return J3(e);if(U3(e))return{type:"receive",stateMutability:"payable"};throw new j3({signature:e})}function K3(e,t={}){const n=A3(e);if(!n)throw new Sa({signature:e,type:"function"});const r=on(n.parameters),s=[],a=r.length;for(let i=0;i<a;i++)s.push(vr(r[i],{modifiers:Td,structs:t,type:"function"}));const o=[];if(n.returns){const i=on(n.returns),c=i.length;for(let l=0;l<c;l++)o.push(vr(i[l],{modifiers:Td,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:o}}function Z3(e,t={}){const n=T3(e);if(!n)throw new Sa({signature:e,type:"event"});const r=on(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(vr(r[o],{modifiers:D3,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}function X3(e,t={}){const n=k3(e);if(!n)throw new Sa({signature:e,type:"error"});const r=on(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(vr(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}function Q3(e,t={}){const n=P3(e);if(!n)throw new Sa({signature:e,type:"constructor"});const r=on(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(vr(r[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function J3(e){const t=O3(e);if(!t)throw new Sa({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const e8=/^(?<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$_]*))?$/,t8=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,n8=/^u?int$/;function vr(e,t){var d,f;const n=Y3(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Cd.has(n))return Cd.get(n);const r=e1.test(e),s=wr(r?t8:e8,e);if(!s)throw new z3({param:e});if(s.name&&s8(s.name))throw new R3({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(r){c="tuple";const m=on(s.type),y=[],g=m.length;for(let k=0;k<g;k++)y.push(vr(m[k],{structs:i}));l={components:y}}else if(s.type in i)c="tuple",l={components:i[s.type]};else if(n8.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"&&!l1(c))throw new N3({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 H3({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(Td.has(s.modifier)&&!a8(c,!!s.array))throw new $3({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const u={type:`${c}${s.array??""}`,...a,...o,...l};return Cd.set(n,u),u}function on(e,t=[],n="",r=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 r===0?on(i,[...t,n.trim()]):on(i,t,`${n}${o}`,r);case"(":return on(i,t,`${n}${o}`,r+1);case")":return on(i,t,`${n}${o}`,r-1);default:return on(i,t,`${n}${o}`,r)}}if(n==="")return t;if(r!==0)throw new q3({current:n,depth:r});return t.push(n.trim()),t}function l1(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Qh.test(e)||Jh.test(e)}const r8=/^(?: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 s8(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Qh.test(e)||Jh.test(e)||r8.test(e)}function a8(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Sd(e){const t={},n=e.length;for(let o=0;o<n;o++){const i=e[o];if(!Nc(i))continue;const c=S3(i);if(!c)throw new Sa({signature:i,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const y=l[f].trim();if(!y)continue;const g=vr(y,{type:"struct"});u.push(g)}if(!u.length)throw new V3({signature:i});t[c.name]=u}const r={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[i,c]=s[o];r[i]=u1(c,t)}return r}const o8=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function u1(e=[],t={},n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(e1.test(o.type))r.push(o);else{const c=wr(o8,o.type);if(!(c!=null&&c.type))throw new G3({abiParameter:o});const{array:l,type:u}=c;if(u in t){if(n.has(u))throw new W3({type:u});r.push({...o,type:`tuple${l??""}`,components:u1(t[u],t,new Set([...n,u]))})}else if(l1(u))r.push(o);else throw new M3({type:u})}}return r}function d1(e){const t=Sd(e),n=[],r=e.length;for(let s=0;s<r;s++){const a=e[s];Nc(a)||n.push(Ad(a,t))}return n}function p1(e){let t;if(typeof e=="string")t=Ad(e);else{const n=Sd(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!Nc(a)){t=Ad(a,n);break}}}if(!t)throw new _3({signature:e});return t}function f1(e){const t=[];if(typeof e=="string"){const n=on(e),r=n.length;for(let s=0;s<r;s++)t.push(vr(n[s],{modifiers:c1}))}else{const n=Sd(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(Nc(a))continue;const o=on(a),i=o.length;for(let c=0;c<i;c++)t.push(vr(o[c],{modifiers:c1,structs:n}))}}if(t.length===0)throw new L3({params:e});return t}function re(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:a=>t(e,a)}function Dn(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new w8(e.type);return`${e.name}(${Lc(e.inputs,{includeName:t})})`}function Lc(e,{includeName:t=!1}={}){return e?e.map(n=>i8(n,{includeName:t})).join(t?", ":","):""}function i8(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Lc(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function _n(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function lt(e){return _n(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const m1="2.43.3";let Do={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${m1}`},$=class Om extends Error{constructor(t,n={}){var i;const r=(()=>{var c;return n.cause instanceof Om?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof Om&&n.cause.docsPath||n.docsPath,a=(i=Do.getDocsUrl)==null?void 0:i.call(Do,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...Do.version?[`Version: ${Do.version}`]:[]].join(`
66
66
  `);super(o,n.cause?{cause:n.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=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=m1}walk(t){return h1(this,t)}};function h1(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?h1(e.cause,t):t?null:e}class c8 extends ${constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
67
67
  `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class b1 extends ${constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbs-network/spot-react",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Spot React Components - React components for Spot SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/spot-react.umd.cjs",