@bonfida/sns-widget
Version:
SNS Widget for 3rd-party apps for quick domain search and register
6 lines • 443 kB
JavaScript
"use client";"use strict";var Na=e=>{throw TypeError(e)};var Vo=(e,t,n)=>t.has(e)||Na("Cannot "+n);var T=(e,t,n)=>(Vo(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>t.has(e)?Na("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),re=(e,t,n,i)=>(Vo(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),ge=(e,t,n)=>(Vo(e,t,"access private method"),n);var Xr=(e,t,n,i)=>({set _(u){re(e,t,u,n)},get _(){return T(e,t,i)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),_=require("react"),Bo=require("@solana/wallet-adapter-react"),Hl=require("@solana/wallet-adapter-wallets"),Rf=require("@solana/wallet-adapter-react-ui"),M=require("@solana/web3.js"),Oe=require("./index-C026-m4n.cjs"),en=require("@solana/spl-token"),_l=require("@pythnetwork/client");function Gl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const yt=Gl(_);var Gr=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(){}};function Wl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wt,Qt,Lf={exports:{}},Le=Lf.exports={};function vs(){throw new Error("setTimeout has not been defined")}function Es(){throw new Error("clearTimeout has not been defined")}function Tf(e){if(Wt===setTimeout)return setTimeout(e,0);if((Wt===vs||!Wt)&&setTimeout)return Wt=setTimeout,setTimeout(e,0);try{return Wt(e,0)}catch{try{return Wt.call(null,e,0)}catch{return Wt.call(this,e,0)}}}(function(){try{Wt=typeof setTimeout=="function"?setTimeout:vs}catch{Wt=vs}try{Qt=typeof clearTimeout=="function"?clearTimeout:Es}catch{Qt=Es}})();var Rn,Jt=[],nr=!1,vo=-1;function Ql(){nr&&Rn&&(nr=!1,Rn.length?Jt=Rn.concat(Jt):vo=-1,Jt.length&&Of())}function Of(){if(!nr){var e=Tf(Ql);nr=!0;for(var t=Jt.length;t;){for(Rn=Jt,Jt=[];++vo<t;)Rn&&Rn[vo].run();vo=-1,t=Jt.length}Rn=null,nr=!1,function(n){if(Qt===clearTimeout)return clearTimeout(n);if((Qt===Es||!Qt)&&clearTimeout)return Qt=clearTimeout,clearTimeout(n);try{return Qt(n)}catch{try{return Qt.call(null,n)}catch{return Qt.call(this,n)}}}(e)}}function ja(e,t){this.fun=e,this.array=t}function Zt(){}Le.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Jt.push(new ja(e,t)),Jt.length!==1||nr||Tf(Of)},ja.prototype.run=function(){this.fun.apply(null,this.array)},Le.title="browser",Le.browser=!0,Le.env={},Le.argv=[],Le.version="",Le.versions={},Le.on=Zt,Le.addListener=Zt,Le.once=Zt,Le.off=Zt,Le.removeListener=Zt,Le.removeAllListeners=Zt,Le.emit=Zt,Le.prependListener=Zt,Le.prependOnceListener=Zt,Le.listeners=function(e){return[]},Le.binding=function(e){throw new Error("process.binding is not supported")},Le.cwd=function(){return"/"},Le.chdir=function(e){throw new Error("process.chdir is not supported")},Le.umask=function(){return 0};const vr=Wl(Lf.exports);var Er=typeof window>"u"||"Deno"in globalThis;function pt(){}function xs(e){return typeof e=="number"&&e>=0&&e!==1/0}function Pf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function rr(e,t){return typeof e=="function"?e(t):e}function Et(e,t){return typeof e=="function"?e(t):e}function Da(e,t){const{type:n="all",exact:i,fetchStatus:u,predicate:h,queryKey:c,stale:p}=e;if(c){if(i){if(t.queryHash!==ia(c,t.options))return!1}else if(!Fr(t.queryKey,c))return!1}if(n!=="all"){const w=t.isActive();if(n==="active"&&!w||n==="inactive"&&w)return!1}return(typeof p!="boolean"||t.isStale()===p)&&(!u||u===t.state.fetchStatus)&&!(h&&!h(t))}function Fa(e,t){const{exact:n,status:i,predicate:u,mutationKey:h}=e;if(h){if(!t.options.mutationKey)return!1;if(n){if(Dr(t.options.mutationKey)!==Dr(h))return!1}else if(!Fr(t.options.mutationKey,h))return!1}return(!i||t.state.status===i)&&!(u&&!u(t))}function ia(e,t){return((t==null?void 0:t.queryKeyHashFn)||Dr)(e)}function Dr(e){return JSON.stringify(e,(t,n)=>As(n)?Object.keys(n).sort().reduce((i,u)=>(i[u]=n[u],i),{}):n)}function Fr(e,t){return e===t||typeof e==typeof t&&!(!e||!t||typeof e!="object"||typeof t!="object")&&!Object.keys(t).some(n=>!Fr(e[n],t[n]))}function kf(e,t){if(e===t)return e;const n=Ma(e)&&Ma(t);if(n||As(e)&&As(t)){const i=n?e:Object.keys(e),u=i.length,h=n?t:Object.keys(t),c=h.length,p=n?[]:{};let w=0;for(let m=0;m<c;m++){const g=n?m:h[m];(!n&&i.includes(g)||n)&&e[g]===void 0&&t[g]===void 0?(p[g]=void 0,w++):(p[g]=kf(e[g],t[g]),p[g]===e[g]&&e[g]!==void 0&&w++)}return u===c&&w===u?e:p}return t}function qo(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 Ma(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function As(e){if(!za(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!!za(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function za(e){return Object.prototype.toString.call(e)==="[object Object]"}function Bs(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?kf(e,t):t}function $l(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function Xl(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var Is=Symbol();function Nf(e,t){return vr.env.NODE_ENV!=="production"&&e.queryFn===Is&&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!==Is?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var Ln,gn,ar,vf,sa=new(vf=class extends Gr{constructor(){super();ue(this,Ln);ue(this,gn);ue(this,ar);re(this,ar,t=>{if(!Er&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,gn)||this.setEventListener(T(this,ar))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,gn))==null||t.call(this),re(this,gn,void 0))}setEventListener(t){var n;re(this,ar,t),(n=T(this,gn))==null||n.call(this),re(this,gn,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){T(this,Ln)!==t&&(re(this,Ln,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,Ln)=="boolean"?T(this,Ln):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ln=new WeakMap,gn=new WeakMap,ar=new WeakMap,vf),ur,wn,cr,Ef,Io=new(Ef=class extends Gr{constructor(){super();ue(this,ur,!0);ue(this,wn);ue(this,cr);re(this,cr,t=>{if(!Er&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){T(this,wn)||this.setEventListener(T(this,cr))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,wn))==null||t.call(this),re(this,wn,void 0))}setEventListener(t){var n;re(this,cr,t),(n=T(this,wn))==null||n.call(this),re(this,wn,t(this.setOnline.bind(this)))}setOnline(t){T(this,ur)!==t&&(re(this,ur,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return T(this,ur)}},ur=new WeakMap,wn=new WeakMap,cr=new WeakMap,Ef);function Yl(e){return Math.min(1e3*2**e,3e4)}function jf(e){return(e??"online")!=="online"||Io.isOnline()}var Df=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Zo(e){return e instanceof Df}function Ff(e){let t,n,i,u=!1,h=0,c=!1;const p=new Promise((b,v)=>{n=b,i=v}),w=()=>sa.isFocused()&&(e.networkMode==="always"||Io.isOnline())&&e.canRun(),m=()=>jf(e.networkMode)&&e.canRun(),g=b=>{var v;c||(c=!0,(v=e.onSuccess)==null||v.call(e,b),t==null||t(),n(b))},I=b=>{var v;c||(c=!0,(v=e.onError)==null||v.call(e,b),t==null||t(),i(b))},x=()=>new Promise(b=>{var v;t=E=>{(c||w())&&b(E)},(v=e.onPause)==null||v.call(e)}).then(()=>{var b;t=void 0,c||((b=e.onContinue)==null||b.call(e))}),d=()=>{if(c)return;let b;const v=h===0?e.initialPromise:void 0;try{b=v??e.fn()}catch(E){b=Promise.reject(E)}Promise.resolve(b).then(g).catch(E=>{var X;if(c)return;const S=e.retry??(Er?0:3),B=e.retryDelay??Yl,O=typeof B=="function"?B(h,E):B,K=S===!0||typeof S=="number"&&h<S||typeof S=="function"&&S(h,E);var q;!u&&K?(h++,(X=e.onFail)==null||X.call(e,h,E),(q=O,new Promise(ne=>{setTimeout(ne,q)})).then(()=>w()?void 0:x()).then(()=>{u?I(E):d()})):I(E)})};return{promise:p,cancel:b=>{var v;c||(I(new Df(b)),(v=e.abort)==null||v.call(e))},continue:()=>(t==null||t(),p),cancelRetry:()=>{u=!0},continueRetry:()=>{u=!1},canStart:m,start:()=>(m()?d():x().then(d),p)}}var $e=function(){let e=[],t=0,n=p=>{p()},i=p=>{p()},u=p=>setTimeout(p,0);const h=p=>{t?e.push(p):u(()=>{n(p)})},c=()=>{const p=e;e=[],p.length&&u(()=>{i(()=>{p.forEach(w=>{n(w)})})})};return{batch:p=>{let w;t++;try{w=p()}finally{t--,t||c()}return w},batchCalls:p=>(...w)=>{h(()=>{p(...w)})},schedule:h,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{i=p},setScheduler:p=>{u=p}}}(),Tn,xf,Mf=(xf=class{constructor(){ue(this,Tn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xs(this.gcTime)&&re(this,Tn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Er?1/0:3e5))}clearGcTimeout(){T(this,Tn)&&(clearTimeout(T(this,Tn)),re(this,Tn,void 0))}},Tn=new WeakMap,xf),fr,hr,dt,Xe,Zr,On,vt,Gt,Af,Jl=(Af=class extends Mf{constructor(t){super();ue(this,vt);ue(this,fr);ue(this,hr);ue(this,dt);ue(this,Xe);ue(this,Zr);ue(this,On);re(this,On,!1),re(this,Zr,t.defaultOptions),this.setOptions(t.options),this.observers=[],re(this,dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,re(this,fr,function(n){const i=typeof n.initialData=="function"?n.initialData():n.initialData,u=i!==void 0,h=u?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:u?h??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:u?"success":"pending",fetchStatus:"idle"}}(this.options)),this.state=t.state??T(this,fr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,Xe))==null?void 0:t.promise}setOptions(t){this.options={...T(this,Zr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||this.state.fetchStatus!=="idle"||T(this,dt).remove(this)}setData(t,n){const i=Bs(this.state.data,t,this.options);return ge(this,vt,Gt).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){ge(this,vt,Gt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,u;const n=(i=T(this,Xe))==null?void 0:i.promise;return(u=T(this,Xe))==null||u.cancel(t),n?n.then(pt).catch(pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,fr))}isActive(){return this.observers.some(t=>Et(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0)}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Pf(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Xe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Xe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,Xe)&&(T(this,On)?T(this,Xe).cancel({revert:!0}):T(this,Xe).cancelRetry()),this.scheduleGc()),T(this,dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,vt,Gt).call(this,{type:"invalidate"})}fetch(t,n){var p,w,m;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,Xe))return T(this,Xe).continueRetry(),T(this,Xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(I=>I.options.queryFn);g&&this.setOptions(g.options)}vr.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 i=new AbortController,u=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(re(this,On,!0),i.signal)})},h={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const g=Nf(this.options,n),I={queryKey:this.queryKey,meta:this.meta};return u(I),re(this,On,!1),this.options.persister?this.options.persister(g,I,this):g(I)}};u(h),(p=this.options.behavior)==null||p.onFetch(h,this),re(this,hr,this.state),this.state.fetchStatus!=="idle"&&this.state.fetchMeta===((w=h.fetchOptions)==null?void 0:w.meta)||ge(this,vt,Gt).call(this,{type:"fetch",meta:(m=h.fetchOptions)==null?void 0:m.meta});const c=g=>{var I,x,d,b;Zo(g)&&g.silent||ge(this,vt,Gt).call(this,{type:"error",error:g}),Zo(g)||((x=(I=T(this,dt).config).onError)==null||x.call(I,g,this),(b=(d=T(this,dt).config).onSettled)==null||b.call(d,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return re(this,Xe,Ff({initialPromise:n==null?void 0:n.initialPromise,fn:h.fetchFn,abort:i.abort.bind(i),onSuccess:g=>{var I,x,d,b;if(g===void 0)return vr.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}`),void c(new Error(`${this.queryHash} data is undefined`));this.setData(g),(x=(I=T(this,dt).config).onSuccess)==null||x.call(I,g,this),(b=(d=T(this,dt).config).onSettled)==null||b.call(d,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(g,I)=>{ge(this,vt,Gt).call(this,{type:"failed",failureCount:g,error:I})},onPause:()=>{ge(this,vt,Gt).call(this,{type:"pause"})},onContinue:()=>{ge(this,vt,Gt).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0})),T(this,Xe).start()}},fr=new WeakMap,hr=new WeakMap,dt=new WeakMap,Xe=new WeakMap,Zr=new WeakMap,On=new WeakMap,vt=new WeakSet,Gt=function(t){this.state=(n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...zf(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Zo(i)&&i.revert&&T(this,hr)?{...T(this,hr),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}})(this.state),$e.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),T(this,dt).notify({query:this,type:"updated",action:t})})},Af);function zf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}var Nt,Bf,e0=(Bf=class extends Gr{constructor(t={}){super();ue(this,Nt);this.config=t,re(this,Nt,new Map)}build(t,n,i){const u=n.queryKey,h=n.queryHash??ia(u,n);let c=this.get(h);return c||(c=new Jl({cache:this,queryKey:u,queryHash:h,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(u)}),this.add(c)),c}add(t){T(this,Nt).has(t.queryHash)||(T(this,Nt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,Nt).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,Nt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$e.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,Nt).get(t)}getAll(){return[...T(this,Nt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>Da(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>Da(t,i)):n}notify(t){$e.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){$e.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$e.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Nt=new WeakMap,Bf),jt,Je,Pn,Dt,ln,If,t0=(If=class extends Mf{constructor(t){super();ue(this,Dt);ue(this,jt);ue(this,Je);ue(this,Pn);this.mutationId=t.mutationId,re(this,Je,t.mutationCache),re(this,jt,[]),this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,jt).includes(t)||(T(this,jt).push(t),this.clearGcTimeout(),T(this,Je).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){re(this,jt,T(this,jt).filter(n=>n!==t)),this.scheduleGc(),T(this,Je).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,jt).length||(this.state.status==="pending"?this.scheduleGc():T(this,Je).remove(this))}continue(){var t;return((t=T(this,Pn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,h,c,p,w,m,g,I,x,d,b,v,E,S,B,O,K,q,X,ne;re(this,Pn,Ff({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:($,ce)=>{ge(this,Dt,ln).call(this,{type:"failed",failureCount:$,error:ce})},onPause:()=>{ge(this,Dt,ln).call(this,{type:"pause"})},onContinue:()=>{ge(this,Dt,ln).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Je).canRun(this)}));const n=this.state.status==="pending",i=!T(this,Pn).canStart();try{if(!n){ge(this,Dt,ln).call(this,{type:"pending",variables:t,isPaused:i}),await((h=(u=T(this,Je).config).onMutate)==null?void 0:h.call(u,t,this));const ce=await((p=(c=this.options).onMutate)==null?void 0:p.call(c,t));ce!==this.state.context&&ge(this,Dt,ln).call(this,{type:"pending",context:ce,variables:t,isPaused:i})}const $=await T(this,Pn).start();return await((m=(w=T(this,Je).config).onSuccess)==null?void 0:m.call(w,$,t,this.state.context,this)),await((I=(g=this.options).onSuccess)==null?void 0:I.call(g,$,t,this.state.context)),await((d=(x=T(this,Je).config).onSettled)==null?void 0:d.call(x,$,null,this.state.variables,this.state.context,this)),await((v=(b=this.options).onSettled)==null?void 0:v.call(b,$,null,t,this.state.context)),ge(this,Dt,ln).call(this,{type:"success",data:$}),$}catch($){try{throw await((S=(E=T(this,Je).config).onError)==null?void 0:S.call(E,$,t,this.state.context,this)),await((O=(B=this.options).onError)==null?void 0:O.call(B,$,t,this.state.context)),await((q=(K=T(this,Je).config).onSettled)==null?void 0:q.call(K,void 0,$,this.state.variables,this.state.context,this)),await((ne=(X=this.options).onSettled)==null?void 0:ne.call(X,void 0,$,t,this.state.context)),$}finally{ge(this,Dt,ln).call(this,{type:"error",error:$})}}finally{T(this,Je).runNext(this)}}},jt=new WeakMap,Je=new WeakMap,Pn=new WeakMap,Dt=new WeakSet,ln=function(t){this.state=(n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),$e.batch(()=>{T(this,jt).forEach(n=>{n.onMutationUpdate(t)}),T(this,Je).notify({mutation:this,type:"updated",action:t})})},If),ut,Kr,Sf,n0=(Sf=class extends Gr{constructor(t={}){super();ue(this,ut);ue(this,Kr);this.config=t,re(this,ut,new Map),re(this,Kr,Date.now())}build(t,n,i){const u=new t0({mutationCache:this,mutationId:++Xr(this,Kr)._,options:t.defaultMutationOptions(n),state:i});return this.add(u),u}add(t){const n=Yr(t),i=T(this,ut).get(n)??[];i.push(t),T(this,ut).set(n,i),this.notify({type:"added",mutation:t})}remove(t){var i;const n=Yr(t);if(T(this,ut).has(n)){const u=(i=T(this,ut).get(n))==null?void 0:i.filter(h=>h!==t);u&&(u.length===0?T(this,ut).delete(n):T(this,ut).set(n,u))}this.notify({type:"removed",mutation:t})}canRun(t){var i;const n=(i=T(this,ut).get(Yr(t)))==null?void 0:i.find(u=>u.state.status==="pending");return!n||n===t}runNext(t){var i;const n=(i=T(this,ut).get(Yr(t)))==null?void 0:i.find(u=>u!==t&&u.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){$e.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...T(this,ut).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(i=>Fa(n,i))}findAll(t={}){return this.getAll().filter(n=>Fa(t,n))}notify(t){$e.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return $e.batch(()=>Promise.all(t.map(n=>n.continue().catch(pt))))}},ut=new WeakMap,Kr=new WeakMap,Sf);function Yr(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function r0(e){return{onFetch:(t,n)=>{const i=async()=>{var d,b,v,E,S;const u=t.options,h=(v=(b=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:b.fetchMore)==null?void 0:v.direction,c=((E=t.state.data)==null?void 0:E.pages)||[],p=((S=t.state.data)==null?void 0:S.pageParams)||[],w={pages:[],pageParams:[]};let m=!1;const g=Nf(t.options,t.fetchOptions),I=async(B,O,K)=>{if(m)return Promise.reject();if(O==null&&B.pages.length)return Promise.resolve(B);const q={queryKey:t.queryKey,pageParam:O,direction:K?"backward":"forward",meta:t.options.meta};var X;X=q,Object.defineProperty(X,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)});const ne=await g(q),{maxPages:$}=t.options,ce=K?Xl:$l;return{pages:ce(B.pages,ne,$),pageParams:ce(B.pageParams,O,$)}};let x;if(h&&c.length){const B=h==="backward",O={pages:c,pageParams:p},K=(B?o0:Va)(u,O);x=await I(O,K,B)}else{x=await I(w,p[0]??u.initialPageParam);const B=e??c.length;for(let O=1;O<B;O++){const K=Va(u,x);if(K==null)break;x=await I(x,K)}}return x};t.options.persister?t.fetchFn=()=>{var u,h;return(h=(u=t.options).persister)==null?void 0:h.call(u,i,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=i}}}function Va(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function o0(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var Re,bn,mn,lr,dr,vn,pr,yr,Uf,i0=(Uf=class{constructor(e={}){ue(this,Re);ue(this,bn);ue(this,mn);ue(this,lr);ue(this,dr);ue(this,vn);ue(this,pr);ue(this,yr);re(this,Re,e.queryCache||new e0),re(this,bn,e.mutationCache||new n0),re(this,mn,e.defaultOptions||{}),re(this,lr,new Map),re(this,dr,new Map),re(this,vn,0)}mount(){Xr(this,vn)._++,T(this,vn)===1&&(re(this,pr,sa.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Re).onFocus())})),re(this,yr,Io.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Re).onOnline())})))}unmount(){var e,t;Xr(this,vn)._--,T(this,vn)===0&&((e=T(this,pr))==null||e.call(this),re(this,pr,void 0),(t=T(this,yr))==null||t.call(this),re(this,yr,void 0))}isFetching(e){return T(this,Re).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,bn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Re).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),i=T(this,Re).build(this,n);return e.revalidateIfStale&&i.isStaleByTime(rr(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return T(this,Re).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),u=T(this,Re).get(i.queryHash),h=u==null?void 0:u.state.data,c=function(p,w){return typeof p=="function"?p(w):p}(t,h);if(c!==void 0)return T(this,Re).build(this,i).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return $e.batch(()=>T(this,Re).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Re).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,Re);$e.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,Re),i={type:"active",...e};return $e.batch(()=>(n.findAll(e).forEach(u=>{u.reset()}),this.refetchQueries(i,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},i=$e.batch(()=>T(this,Re).findAll(e).map(u=>u.cancel(n)));return Promise.all(i).then(pt).catch(pt)}invalidateQueries(e={},t={}){return $e.batch(()=>{if(T(this,Re).findAll(e).forEach(i=>{i.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},i=$e.batch(()=>T(this,Re).findAll(e).filter(u=>!u.isDisabled()).map(u=>{let h=u.fetch(void 0,n);return n.throwOnError||(h=h.catch(pt)),u.state.fetchStatus==="paused"?Promise.resolve():h}));return Promise.all(i).then(pt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,Re).build(this,t);return n.isStaleByTime(rr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pt).catch(pt)}fetchInfiniteQuery(e){return e.behavior=r0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pt).catch(pt)}resumePausedMutations(){return Io.isOnline()?T(this,bn).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Re)}getMutationCache(){return T(this,bn)}getDefaultOptions(){return T(this,mn)}setDefaultOptions(e){re(this,mn,e)}setQueryDefaults(e,t){T(this,lr).set(Dr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,lr).values()];let n={};return t.forEach(i=>{Fr(e,i.queryKey)&&(n={...n,...i.defaultOptions})}),n}setMutationDefaults(e,t){T(this,dr).set(Dr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,dr).values()];let n={};return t.forEach(i=>{Fr(e,i.mutationKey)&&(n={...n,...i.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,mn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ia(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.enabled!==!0&&t.queryFn===Is&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,mn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Re).clear(),T(this,bn).clear()}},Re=new WeakMap,bn=new WeakMap,mn=new WeakMap,lr=new WeakMap,dr=new WeakMap,vn=new WeakMap,pr=new WeakMap,yr=new WeakMap,Uf),tt,we,Hr,et,kn,gr,Ft,_r,wr,br,Nn,jn,En,mr,Ae,kr,Ss,Us,Cs,Rs,Ls,Ts,Os,Vf,Cf,s0=(Cf=class extends Gr{constructor(t,n){super();ue(this,Ae);ue(this,tt);ue(this,we);ue(this,Hr);ue(this,et);ue(this,kn);ue(this,gr);ue(this,Ft);ue(this,_r);ue(this,wr);ue(this,br);ue(this,Nn);ue(this,jn);ue(this,En);ue(this,mr,new Set);this.options=n,re(this,tt,t),re(this,Ft,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,we).addObserver(this),qa(T(this,we),this.options)?ge(this,Ae,kr).call(this):this.updateResult(),ge(this,Ae,Rs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ps(T(this,we),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ps(T(this,we),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,Ae,Ls).call(this),ge(this,Ae,Ts).call(this),T(this,we).removeObserver(this)}setOptions(t,n){const i=this.options,u=T(this,we);if(this.options=T(this,tt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Et(this.options.enabled,T(this,we))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,Ae,Os).call(this),T(this,we).setOptions(this.options),i._defaulted&&!qo(this.options,i)&&T(this,tt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,we),observer:this});const h=this.hasListeners();h&&Za(T(this,we),u,this.options,i)&&ge(this,Ae,kr).call(this),this.updateResult(n),!h||T(this,we)===u&&Et(this.options.enabled,T(this,we))===Et(i.enabled,T(this,we))&&rr(this.options.staleTime,T(this,we))===rr(i.staleTime,T(this,we))||ge(this,Ae,Ss).call(this);const c=ge(this,Ae,Us).call(this);!h||T(this,we)===u&&Et(this.options.enabled,T(this,we))===Et(i.enabled,T(this,we))&&c===T(this,En)||ge(this,Ae,Cs).call(this,c)}getOptimisticResult(t){const n=T(this,tt).getQueryCache().build(T(this,tt),t),i=this.createResult(n,t);return function(u,h){return!qo(u.getCurrentResult(),h)}(this,i)&&(re(this,et,i),re(this,gr,this.options),re(this,kn,T(this,we).state)),i}getCurrentResult(){return T(this,et)}trackResult(t,n){const i={};return Object.keys(t).forEach(u=>{Object.defineProperty(i,u,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(u),n==null||n(u),t[u])})}),i}trackProp(t){T(this,mr).add(t)}getCurrentQuery(){return T(this,we)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,tt).defaultQueryOptions(t),i=T(this,tt).getQueryCache().build(T(this,tt),n);return i.isFetchingOptimistic=!0,i.fetch().then(()=>this.createResult(i,n))}fetch(t){return ge(this,Ae,kr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,et)))}createResult(t,n){var q;const i=T(this,we),u=this.options,h=T(this,et),c=T(this,kn),p=T(this,gr),w=t!==i?t.state:T(this,Hr),{state:m}=t;let g,I={...m},x=!1;if(n._optimisticResults){const X=this.hasListeners(),ne=!X&&qa(t,n),$=X&&Za(t,i,n,u);(ne||$)&&(I={...I,...zf(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(I.fetchStatus="idle")}let{error:d,errorUpdatedAt:b,status:v}=I;if(n.select&&I.data!==void 0)if(h&&I.data===(c==null?void 0:c.data)&&n.select===T(this,_r))g=T(this,wr);else try{re(this,_r,n.select),g=n.select(I.data),g=Bs(h==null?void 0:h.data,g,n),re(this,wr,g),re(this,Ft,null)}catch(X){re(this,Ft,X)}else g=I.data;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let X;if(h!=null&&h.isPlaceholderData&&n.placeholderData===(p==null?void 0:p.placeholderData))X=h.data;else if(X=typeof n.placeholderData=="function"?n.placeholderData((q=T(this,br))==null?void 0:q.state.data,T(this,br)):n.placeholderData,n.select&&X!==void 0)try{X=n.select(X),re(this,Ft,null)}catch(ne){re(this,Ft,ne)}X!==void 0&&(v="success",g=Bs(h==null?void 0:h.data,X,n),x=!0)}T(this,Ft)&&(d=T(this,Ft),g=T(this,wr),b=Date.now(),v="error");const E=I.fetchStatus==="fetching",S=v==="pending",B=v==="error",O=S&&E,K=g!==void 0;return{status:v,fetchStatus:I.fetchStatus,isPending:S,isSuccess:v==="success",isError:B,isInitialLoading:O,isLoading:O,data:g,dataUpdatedAt:I.dataUpdatedAt,error:d,errorUpdatedAt:b,failureCount:I.fetchFailureCount,failureReason:I.fetchFailureReason,errorUpdateCount:I.errorUpdateCount,isFetched:I.dataUpdateCount>0||I.errorUpdateCount>0,isFetchedAfterMount:I.dataUpdateCount>w.dataUpdateCount||I.errorUpdateCount>w.errorUpdateCount,isFetching:E,isRefetching:E&&!S,isLoadingError:B&&!K,isPaused:I.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:B&&K,isStale:aa(t,n),refetch:this.refetch}}updateResult(t){const n=T(this,et),i=this.createResult(T(this,we),this.options);if(re(this,kn,T(this,we).state),re(this,gr,this.options),T(this,kn).data!==void 0&&re(this,br,T(this,we)),qo(i,n))return;re(this,et,i);const u={};(t==null?void 0:t.listeners)!==!1&&(()=>{if(!n)return!0;const{notifyOnChangeProps:h}=this.options,c=typeof h=="function"?h():h;if(c==="all"||!c&&!T(this,mr).size)return!0;const p=new Set(c??T(this,mr));return this.options.throwOnError&&p.add("error"),Object.keys(T(this,et)).some(w=>{const m=w;return T(this,et)[m]!==n[m]&&p.has(m)})})()&&(u.listeners=!0),ge(this,Ae,Vf).call(this,{...u,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,Ae,Rs).call(this)}},tt=new WeakMap,we=new WeakMap,Hr=new WeakMap,et=new WeakMap,kn=new WeakMap,gr=new WeakMap,Ft=new WeakMap,_r=new WeakMap,wr=new WeakMap,br=new WeakMap,Nn=new WeakMap,jn=new WeakMap,En=new WeakMap,mr=new WeakMap,Ae=new WeakSet,kr=function(t){ge(this,Ae,Os).call(this);let n=T(this,we).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pt)),n},Ss=function(){ge(this,Ae,Ls).call(this);const t=rr(this.options.staleTime,T(this,we));if(Er||T(this,et).isStale||!xs(t))return;const n=Pf(T(this,et).dataUpdatedAt,t)+1;re(this,Nn,setTimeout(()=>{T(this,et).isStale||this.updateResult()},n))},Us=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,we)):this.options.refetchInterval)??!1},Cs=function(t){ge(this,Ae,Ts).call(this),re(this,En,t),!Er&&Et(this.options.enabled,T(this,we))!==!1&&xs(T(this,En))&&T(this,En)!==0&&re(this,jn,setInterval(()=>{(this.options.refetchIntervalInBackground||sa.isFocused())&&ge(this,Ae,kr).call(this)},T(this,En)))},Rs=function(){ge(this,Ae,Ss).call(this),ge(this,Ae,Cs).call(this,ge(this,Ae,Us).call(this))},Ls=function(){T(this,Nn)&&(clearTimeout(T(this,Nn)),re(this,Nn,void 0))},Ts=function(){T(this,jn)&&(clearInterval(T(this,jn)),re(this,jn,void 0))},Os=function(){const t=T(this,tt).getQueryCache().build(T(this,tt),this.options);if(t===T(this,we))return;const n=T(this,we);re(this,we,t),re(this,Hr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Vf=function(t){$e.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,et))}),T(this,tt).getQueryCache().notify({query:T(this,we),type:"observerResultsUpdated"})})},Cf);function qa(e,t){return function(n,i){return Et(i.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&i.retryOnMount===!1)}(e,t)||e.state.data!==void 0&&Ps(e,t,t.refetchOnMount)}function Ps(e,t,n){if(Et(t.enabled,e)!==!1){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&aa(e,t)}return!1}function Za(e,t,n,i){return(e!==t||Et(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&aa(e,n)}function aa(e,t){return Et(t.enabled,e)!==!1&&e.isStaleByTime(rr(t.staleTime,e))}var qf=yt.createContext(void 0),a0=e=>{const t=yt.useContext(qf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},u0=({client:e,children:t})=>(yt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),C.jsx(qf.Provider,{value:e,children:t})),Zf=yt.createContext(!1),c0=()=>yt.useContext(Zf);Zf.Provider;var f0=yt.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),h0=()=>yt.useContext(f0),l0=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},d0=e=>{yt.useEffect(()=>{e.clearReset()},[e])},p0=({result:e,errorResetBoundary:t,throwOnError:n,query:i})=>{return e.isError&&!t.isReset()&&!e.isFetching&&i&&(u=n,h=[e.error,i],typeof u=="function"?u(...h):!!u);var u,h},y0=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},g0=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,w0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ka(e,t){return function(n,i,u){var I,x,d,b;if(vr.env.NODE_ENV!=="production"&&(typeof n!="object"||Array.isArray(n)))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 h=a0(),c=c0(),p=h0(),w=h.defaultQueryOptions(n);(x=(I=h.getDefaultOptions().queries)==null?void 0:I._experimental_beforeQuery)==null||x.call(I,w),w._optimisticResults=c?"isRestoring":"optimistic",y0(w),l0(w,p),d0(p);const[m]=yt.useState(()=>new i(h,w)),g=m.getOptimisticResult(w);if(yt.useSyncExternalStore(yt.useCallback(v=>{const E=c?()=>{}:m.subscribe($e.batchCalls(v));return m.updateResult(),E},[m,c]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),yt.useEffect(()=>{m.setOptions(w,{listeners:!1})},[w,m]),g0(w,g))throw w0(w,m,p);if(p0({result:g,errorResetBoundary:p,throwOnError:w.throwOnError,query:h.getQueryCache().get(w.queryHash)}))throw g.error;return(b=(d=h.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||b.call(d,w,g),w.notifyOnChangeProps?g:m.trackResult(g)}(e,s0)}var Mr=function(e){return typeof e=="function"},Kf=vr.env.NODE_ENV==="development"||vr.env.NODE_ENV==="test";function b0(e){Kf&&(Mr(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=_.useRef(e);t.current=_.useMemo(function(){return e},[e]);var n=_.useRef();return n.current||(n.current=function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];return t.current.apply(this,i)}),n.current}const m0=(Ko=_.useEffect,function(e,t){var n=_.useRef(!1);Ko(function(){return function(){n.current=!1}},[]),Ko(function(){if(n.current)return e();n.current=!0},t)});var Ko;function Ha(e,t){if(e===t)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function Hf(e){var t=_.useRef(e);return t.current=e,t}function v0(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,u.get?u:{enumerable:!0,get:function(){return e[i]}})}),n}var _f=!(typeof window>"u"||!window.document||!window.document.createElement);function Gf(e,t){if(_f)return e?Mr(e)?e():"current"in e?e.current:e:t}var _a,E0=(_a=_.useEffect,function(e,t,n){var i=_.useRef(!1),u=_.useRef([]),h=_.useRef([]),c=_.useRef();_a(function(){var p,w=(Array.isArray(n)?n:[n]).map(function(m){return Gf(m)});if(!i.current)return i.current=!0,u.current=w,h.current=t,void(c.current=e());w.length===u.current.length&&Ha(u.current,w)&&Ha(h.current,t)||((p=c.current)===null||p===void 0||p.call(c),u.current=w,h.current=t,c.current=e())}),function(p){Kf&&(Mr(p)||console.error("useUnmount expected parameter is a function, got ".concat(typeof p)));var w=Hf(p);_.useEffect(function(){return function(){w.current()}},[])}(function(){var p;(p=c.current)===null||p===void 0||p.call(c),i.current=!1})});const So=globalThis||self;function Ga(e,t,n){n===void 0&&(n={});var i=n.enable,u=i===void 0||i,h=Hf(t);E0(function(){if(u){var c=Gf(n.target,window);if(c!=null&&c.addEventListener){var p=function(w){return h.current(w)};return c.addEventListener(e,p,{capture:n.capture,once:n.once,passive:n.passive}),function(){c.removeEventListener(e,p,{capture:n.capture})}}}},[e,n.capture,n.once,n.passive,u],n.target)}var Wa="AHOOKS_SYNC_STORAGE_EVENT_NAME",Qa,x0=(Qa=function(){return _f?sessionStorage:void 0},function(e,t){var n;t===void 0&&(t={});var i=t.listenStorageChange,u=i!==void 0&&i,h=t.onError,c=h===void 0?function(x){console.error(x)}:h;try{n=Qa()}catch(x){c(x)}function p(){try{var x=n==null?void 0:n.getItem(e);if(x)return d=x,t.deserializer?t.deserializer(d):JSON.parse(d)}catch(b){c(b)}var d;return Mr(t.defaultValue)?t.defaultValue():t.defaultValue}var w=function(x,d){var b=typeof Symbol=="function"&&x[Symbol.iterator];if(!b)return x;var v,E,S=b.call(x),B=[];try{for(;(d===void 0||d-- >0)&&!(v=S.next()).done;)B.push(v.value)}catch(O){E={error:O}}finally{try{v&&!v.done&&(b=S.return)&&b.call(S)}finally{if(E)throw E.error}}return B}(_.useState(p),2),m=w[0],g=w[1];m0(function(){g(p())},[e]);var I=function(x){x.key===e&&x.storageArea===n&&g(p())};return Ga("storage",I,{enable:u}),Ga(Wa,function(x){I(x.detail)},{enable:u}),[m,b0(function(x){var d=Mr(x)?x(m):x;u||g(d);try{var b=void 0,v=n==null?void 0:n.getItem(e);(function(E){return E===void 0})(d)?(b=null,n==null||n.removeItem(e)):(b=function(E){return t.serializer?t.serializer(E):JSON.stringify(E)}(d),n==null||n.setItem(e,b)),dispatchEvent(new CustomEvent(Wa,{detail:{key:e,newValue:b,oldValue:v,storageArea:n}}))}catch(E){c(E)}})]});const Wr=_.createContext({cart:{},isCartEmpty:!0,addToCart:()=>{},emptyCart:()=>{},removeFromCart:()=>{},referrerKey:void 0}),A0=({children:e,referrerKey:t}={})=>{const[n={},i]=x0("sns-widget-cart",{defaultValue:{}}),u=!Object.values(n).length;return C.jsx(Wr.Provider,{value:{cart:n,addToCart:h=>{i({...n,[h.domain]:h})},removeFromCart:h=>{const c={...n};delete c[h],i(c)},isCartEmpty:u,emptyCart:()=>i({}),referrerKey:t},children:e})},No=_.createContext({status:null,setStatus:()=>{},setError:()=>{}}),B0=({children:e})=>{const[t,n]=_.useState(null);return C.jsx(No.Provider,{value:{status:t,setStatus:n,setError:i=>{n({status:"error",message:i})}},children:e})},ua=_.createContext({connection:null});function ca(){return _.useContext(ua)}const I0=({children:e})=>{const{connection:t}=Bo.useConnection();return C.jsx(ua.Provider,{value:{connection:t},children:e})},S0=({children:e,connection:t})=>t?t?C.jsx(ua.Provider,{value:{connection:t},children:e}):C.jsx(C.Fragment,{children:e}):C.jsx(I0,{children:e}),fa=_.createContext({publicKey:null,wallets:[],wallet:null,connect:async()=>{},select:()=>{},connecting:!1,connected:!1,disconnect:async()=>{},visible:!1,setVisible:()=>{},connection:null,signAllTransactions:async e=>e});function Uo(){return _.useContext(fa)}const U0=({children:e})=>{const t=Bo.useWallet(),{connection:n}=ca(),{visible:i,setVisible:u}=Rf.useWalletModal(),h={visible:i,setVisible:u,connection:n,...t};return C.jsx(fa.Provider,{value:h,children:e})},C0=({children:e,passthroughWallet:t})=>{const{connection:n}=ca();return t?t?C.jsx(fa.Provider,{value:{...t,connection:n},children:e}):C.jsx(C.Fragment,{children:e}):C.jsx(U0,{children:e})},R0=({children:e,endpoint:t,connection:n,passthroughWallet:i})=>{const u=_.useMemo(()=>t&&!n?({children:c})=>C.jsx(Bo.ConnectionProvider,{endpoint:t,children:c}):_.Fragment,[t,n]),h=_.useMemo(()=>i?_.Fragment:({children:c})=>C.jsx(Bo.WalletProvider,{wallets:[new Hl.SolflareWalletAdapter],autoConnect:!0,children:c}),[i]);return C.jsx(u,{children:C.jsx(h,{children:C.jsx(Rf.WalletModalProvider,{children:C.jsx(S0,{connection:n,children:C.jsx(C0,{passthroughWallet:i,children:e})})})})})};for(var Ve={},L0={byteLength:function(e){var t=Xa(e),n=t[0],i=t[1];return 3*(n+i)/4-i},toByteArray:function(e){var t,n,i=Xa(e),u=i[0],h=i[1],c=new T0(function(m,g,I){return 3*(g+I)/4-I}(0,u,h)),p=0,w=h>0?u-4:u;for(n=0;n<w;n+=4)t=ct[e.charCodeAt(n)]<<18|ct[e.charCodeAt(n+1)]<<12|ct[e.charCodeAt(n+2)]<<6|ct[e.charCodeAt(n+3)],c[p++]=t>>16&255,c[p++]=t>>8&255,c[p++]=255&t;return h===2&&(t=ct[e.charCodeAt(n)]<<2|ct[e.charCodeAt(n+1)]>>4,c[p++]=255&t),h===1&&(t=ct[e.charCodeAt(n)]<<10|ct[e.charCodeAt(n+1)]<<4|ct[e.charCodeAt(n+2)]>>2,c[p++]=t>>8&255,c[p++]=255&t),c},fromByteArray:function(e){for(var t,n=e.length,i=n%3,u=[],h=16383,c=0,p=n-i;c<p;c+=h)u.push(O0(e,c,c+h>p?p:c+h));return i===1?(t=e[n-1],u.push(Mt[t>>2]+Mt[t<<4&63]+"==")):i===2&&(t=(e[n-2]<<8)+e[n-1],u.push(Mt[t>>10]+Mt[t>>4&63]+Mt[t<<2&63]+"=")),u.join("")}},Mt=[],ct=[],T0=typeof Uint8Array<"u"?Uint8Array:Array,$a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Dn=0;Dn<64;++Dn)Mt[Dn]=$a[Dn],ct[$a.charCodeAt(Dn)]=Dn;function Xa(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return n===-1&&(n=t),[n,n===t?0:4-n%4]}function O0(e,t,n){for(var i,u,h=[],c=t;c<n;c+=3)i=(e[c]<<16&16711680)+(e[c+1]<<8&65280)+(255&e[c+2]),h.push(Mt[(u=i)>>18&63]+Mt[u>>12&63]+Mt[u>>6&63]+Mt[63&u]);return h.join("")}ct[45]=62,ct[95]=63;var P0={read:function(e,t,n,i,u){var h,c,p=8*u-i-1,w=(1<<p)-1,m=w>>1,g=-7,I=n?u-1:0,x=n?-1:1,d=e[t+I];for(I+=x,h=d&(1<<-g)-1,d>>=-g,g+=p;g>0;h=256*h+e[t+I],I+=x,g-=8);for(c=h&(1<<-g)-1,h>>=-g,g+=i;g>0;c=256*c+e[t+I],I+=x,g-=8);if(h===0)h=1-m;else{if(h===w)return c?NaN:1/0*(d?-1:1);c+=Math.pow(2,i),h-=m}return(d?-1:1)*c*Math.pow(2,h-i)},write:function(e,t,n,i,u,h){var c,p,w,m=8*h-u-1,g=(1<<m)-1,I=g>>1,x=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:h-1,b=i?1:-1,v=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(p=isNaN(t)?1:0,c=g):(c=Math.floor(Math.log(t)/Math.LN2),t*(w=Math.pow(2,-c))<1&&(c--,w*=2),(t+=c+I>=1?x/w:x*Math.pow(2,1-I))*w>=2&&(c++,w/=2),c+I>=g?(p=0,c=g):c+I>=1?(p=(t*w-1)*Math.pow(2,u),c+=I):(p=t*Math.pow(2,I-1)*Math.pow(2,u),c=0));u>=8;e[n+d]=255&p,d+=b,p/=256,u-=8);for(c=c<<u|p,m+=u;m>0;e[n+d]=255&c,d+=b,c/=256,m-=8);e[n+d-b]|=128*v}};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(e){const t=L0,n=P0,i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=m,e.SlowBuffer=function(s){return+s!=s&&(s=0),m.alloc(+s)},e.INSPECT_MAX_BYTES=50;const u=2147483647;e.kMaxLength=u;const{Uint8Array:h,ArrayBuffer:c,SharedArrayBuffer:p}=globalThis;function w(s){if(s>u)throw new RangeError('The value "'+s+'" is invalid for option "size"');const f=new h(s);return Object.setPrototypeOf(f,m.prototype),f}function m(s,f,l){if(typeof s=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(s)}return g(s,f,l)}function g(s,f,l){if(typeof s=="string")return function(U,P){if(typeof P=="string"&&P!==""||(P="utf8"),!m.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const j=0|E(U,P);let Z=w(j);const Ue=Z.write(U,P);return Ue!==j&&(Z=Z.slice(0,Ue)),Z}(s,f);if(c.isView(s))return function(U){if(ae(U,h)){const P=new h(U);return b(P.buffer,P.byteOffset,P.byteLength)}return d(U)}(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(ae(s,c)||s&&ae(s.buffer,c)||p!==void 0&&(ae(s,p)||s&&ae(s.buffer,p)))return b(s,f,l);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const y=s.valueOf&&s.valueOf();if(y!=null&&y!==s)return m.from(y,f,l);const A=function(U){if(m.isBuffer(U)){const P=0|v(U.length),j=w(P);return j.length===0||U.copy(j,0,0,P),j}if(U.length!==void 0)return typeof U.length!="number"||it(U.length)?w(0):d(U);if(U.type==="Buffer"&&Array.isArray(U.data))return d(U.data)}(s);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return m.from(s[Symbol.toPrimitive]("string"),f,l);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}function I(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function x(s){return I(s),w(s<0?0:0|v(s))}function d(s){const f=s.length<0?0:0|v(s.length),l=w(f);for(let y=0;y<f;y+=1)l[y]=255&s[y];return l}function b(s,f,l){if(f<0||s.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<f+(l||0))throw new RangeError('"length" is outside of buffer bounds');let y;return y=f===void 0&&l===void 0?new h(s):l===void 0?new h(s,f):new h(s,f,l),Object.setPrototypeOf(y,m.prototype),y}function v(s){if(s>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|s}function E(s,f){if(m.isBuffer(s))return s.length;if(c.isView(s)||ae(s,c))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Recei