@txnlab/use-wallet-ui-react 1.3.0 → 1.4.0

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.
Files changed (57) hide show
  1. package/README.md +95 -2
  2. package/dist/cjs/chunks/passkey-C8Dw6sNL.cjs +2 -0
  3. package/dist/cjs/chunks/passkey-C8Dw6sNL.cjs.map +1 -0
  4. package/dist/cjs/index.cjs +14 -14
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/plugins/passkey.cjs +2 -0
  7. package/dist/cjs/plugins/passkey.cjs.map +1 -0
  8. package/dist/esm/chunks/passkey-BbgvIGki.js +44 -0
  9. package/dist/esm/chunks/passkey-BbgvIGki.js.map +1 -0
  10. package/dist/esm/index.js +2966 -2679
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/plugins/passkey.js +578 -0
  13. package/dist/esm/plugins/passkey.js.map +1 -0
  14. package/dist/style.css +152 -0
  15. package/dist/types/components/ConnectWalletMenu.d.ts +7 -1
  16. package/dist/types/components/ConnectWalletMenu.d.ts.map +1 -1
  17. package/dist/types/components/ConnectedWalletMenu.d.ts.map +1 -1
  18. package/dist/types/components/PasskeyConnect.d.ts +29 -0
  19. package/dist/types/components/PasskeyConnect.d.ts.map +1 -0
  20. package/dist/types/components/WalletButton.d.ts +7 -1
  21. package/dist/types/components/WalletButton.d.ts.map +1 -1
  22. package/dist/types/components/WalletGroupLabel.d.ts +6 -0
  23. package/dist/types/components/WalletGroupLabel.d.ts.map +1 -0
  24. package/dist/types/components/WalletIcon.d.ts +6 -0
  25. package/dist/types/components/WalletIcon.d.ts.map +1 -0
  26. package/dist/types/components/WalletList.d.ts.map +1 -1
  27. package/dist/types/index.d.cts +5 -0
  28. package/dist/types/index.d.ts +5 -0
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/plugins/passkey/PasskeyDisclosure.d.ts +11 -0
  31. package/dist/types/plugins/passkey/PasskeyDisclosure.d.ts.map +1 -0
  32. package/dist/types/plugins/passkey/PasskeyRecoveryDialog.d.ts +10 -0
  33. package/dist/types/plugins/passkey/PasskeyRecoveryDialog.d.ts.map +1 -0
  34. package/dist/types/plugins/passkey/PasskeyRecoveryMenuButton.d.ts +5 -0
  35. package/dist/types/plugins/passkey/PasskeyRecoveryMenuButton.d.ts.map +1 -0
  36. package/dist/types/plugins/passkey/PasskeySessionControl.d.ts +6 -0
  37. package/dist/types/plugins/passkey/PasskeySessionControl.d.ts.map +1 -0
  38. package/dist/types/plugins/passkey/constants.d.ts +3 -0
  39. package/dist/types/plugins/passkey/constants.d.ts.map +1 -0
  40. package/dist/types/plugins/passkey/index.d.cts +36 -0
  41. package/dist/types/plugins/passkey/index.d.ts +36 -0
  42. package/dist/types/plugins/passkey/index.d.ts.map +1 -0
  43. package/dist/types/plugins/passkey/index.test.d.ts +2 -0
  44. package/dist/types/plugins/passkey/index.test.d.ts.map +1 -0
  45. package/dist/types/plugins/passkey/storage.d.ts +5 -0
  46. package/dist/types/plugins/passkey/storage.d.ts.map +1 -0
  47. package/dist/types/plugins/passkey/storage.test.d.ts +2 -0
  48. package/dist/types/plugins/passkey/storage.test.d.ts.map +1 -0
  49. package/dist/types/plugins/passkey/usePasskeyAdapter.d.ts +10 -0
  50. package/dist/types/plugins/passkey/usePasskeyAdapter.d.ts.map +1 -0
  51. package/dist/types/providers/WalletUIProvider.d.ts +15 -1
  52. package/dist/types/providers/WalletUIProvider.d.ts.map +1 -1
  53. package/dist/types/utils/passkey.d.ts +59 -0
  54. package/dist/types/utils/passkey.d.ts.map +1 -0
  55. package/dist/types/utils/passkey.test.d.ts +2 -0
  56. package/dist/types/utils/passkey.test.d.ts.map +1 -0
  57. package/package.json +13 -2
@@ -1,4 +1,4 @@
1
- "use strict";var po=e=>{throw TypeError(e)};var Zr=(e,t,r)=>t.has(e)||po("Cannot "+r);var b=(e,t,r)=>(Zr(e,t,"read from private field"),r?r.call(e):t.get(e)),_=(e,t,r)=>t.has(e)?po("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),U=(e,t,r,n)=>(Zr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(Zr(e,t,"access private method"),r);var Ar=(e,t,r,n)=>({set _(o){U(e,t,o,r)},get _(){return b(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),p=require("react"),K=require("./chunks/floating-ui.react-ChfuPAKc.cjs"),_e=require("@txnlab/use-wallet-react"),$t=require("react-dom");var en=typeof document<"u"?document.currentScript:null;function Os(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const V=Os(p),vn=Os($t),ua=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{mo()}):setTimeout(mo,0))},mo=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let r="";try{r=new URL("data:font/woff2;base64,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",typeof document>"u"?require("url").pathToFileURL(__filename).href:en&&en.tagName.toUpperCase()==="SCRIPT"&&en.src||new URL("index.cjs",document.baseURI).href).toString()}catch(n){console.warn("Could not resolve font URL. Using fallback styling.",n)}t.textContent=`
1
+ "use strict";var wo=e=>{throw TypeError(e)};var rn=(e,t,r)=>t.has(e)||wo("Cannot "+r);var b=(e,t,r)=>(rn(e,t,"read from private field"),r?r.call(e):t.get(e)),_=(e,t,r)=>t.has(e)?wo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),B=(e,t,r,n)=>(rn(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(rn(e,t,"access private method"),r);var Pr=(e,t,r,n)=>({set _(o){B(e,t,o,r)},get _(){return b(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),p=require("react"),K=require("./chunks/floating-ui.react-ChfuPAKc.cjs"),Ke=require("@txnlab/use-wallet-react"),tt=require("./chunks/passkey-C8Dw6sNL.cjs"),Dt=require("react-dom");var nn=typeof document<"u"?document.currentScript:null;function js(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const V=js(p),wn=js(Dt),ya=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{xo()}):setTimeout(xo,0))},xo=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let r="";try{r=new URL("data:font/woff2;base64,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",typeof document>"u"?require("url").pathToFileURL(__filename).href:nn&&nn.tagName.toUpperCase()==="SCRIPT"&&nn.src||new URL("index.cjs",document.baseURI).href).toString()}catch(n){console.warn("Could not resolve font URL. Using fallback styling.",n)}t.textContent=`
2
2
  @font-face {
3
3
  font-family: 'Aeonik';
4
4
  src: url('${r}') format('woff2');
@@ -10,7 +10,7 @@
10
10
  .wallet-custom-font {
11
11
  font-family: 'Aeonik', system-ui, sans-serif !important;
12
12
  }
13
- `,document.head.insertBefore(t,document.head.firstChild),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},da=()=>{typeof window<"u"&&ua()};function As(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=As(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function fa(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=As(e))&&(n&&(n+=" "),n+=t);return n}const ha=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},pa=(e,t)=>({classGroupId:e,validator:t}),Rs=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Ur="-",go=[],ma="arbitrary..",ga=e=>{const t=ba(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return va(i);const l=i.split(Ur),c=l[0]===""&&l.length>1?1:0;return Ts(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],d=r[i];return c?d?ha(d,c):c:d||go}return r[i]||go}}},Ts=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const d=Ts(e,t+1,s);if(d)return d}const i=r.validators;if(i===null)return;const l=t===0?e.join(Ur):e.slice(t).join(Ur),c=i.length;for(let d=0;d<c;d++){const g=i[d];if(g.validator(l))return g.classGroupId}},va=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?ma+n:void 0})(),ba=e=>{const{theme:t,classGroups:r}=e;return ya(r,t)},ya=(e,t)=>{const r=Rs();for(const n in e){const o=e[n];qn(o,r,n,t)}return r},qn=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];wa(i,t,r,n)}},wa=(e,t,r,n)=>{if(typeof e=="string"){xa(e,t,r);return}if(typeof e=="function"){Ea(e,t,r,n);return}Sa(e,t,r,n)},xa=(e,t,r)=>{const n=e===""?t:Ps(t,e);n.classGroupId=r},Ea=(e,t,r,n)=>{if(Ca(e)){qn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(pa(r,e))},Sa=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,c]=o[i];qn(c,Ps(t,l),r,n)}},Ps=(e,t)=>{let r=e;const n=t.split(Ur),o=n.length;for(let s=0;s<o;s++){const i=n[s];let l=r.nextPart.get(i);l||(l=Rs(),r.nextPart.set(i,l)),r=l}return r},Ca=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ka=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,i)=>{r[s]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let i=r[s];if(i!==void 0)return i;if((i=n[s])!==void 0)return o(s,i),i},set(s,i){s in r?r[s]=i:o(s,i)}}},bn="!",vo=":",Oa=[],bo=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Aa=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,l=0,c=0,d;const g=o.length;for(let O=0;O<g;O++){const F=o[O];if(i===0&&l===0){if(F===vo){s.push(o.slice(c,O)),c=O+1;continue}if(F==="/"){d=O;continue}}F==="["?i++:F==="]"?i--:F==="("?l++:F===")"&&l--}const v=s.length===0?o:o.slice(c);let x=v,h=!1;v.endsWith(bn)?(x=v.slice(0,-1),h=!0):v.startsWith(bn)&&(x=v.slice(1),h=!0);const k=d&&d>c?d-c:void 0;return bo(s,h,x,k)};if(t){const o=t+vo,s=n;n=i=>i.startsWith(o)?s(i.slice(o.length)):bo(Oa,!1,i,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},Ra=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const i=r[s],l=i[0]==="[",c=t.has(i);l||c?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(i)):o.push(i)}return o.length>0&&(o.sort(),n.push(...o)),n}},Ta=e=>({cache:ka(e.cacheSize),parseClassName:Aa(e),sortModifiers:Ra(e),postfixLookupClassGroupIds:Pa(e),...ga(e)}),Pa=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},Fa=/\s+/,Ia=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,l=[],c=e.trim().split(Fa);let d="";for(let g=c.length-1;g>=0;g-=1){const v=c[g],{isExternal:x,modifiers:h,hasImportantModifier:k,baseClassName:O,maybePostfixModifierPosition:F}=r(v);if(x){d=v+(d.length>0?" "+d:d);continue}let N=!!F,S;if(N){const Q=O.substring(0,F);S=n(Q);const a=S&&i[S]?n(O):void 0;a&&a!==S&&(S=a,N=!1)}else S=n(O);if(!S){if(!N){d=v+(d.length>0?" "+d:d);continue}if(S=n(O),!S){d=v+(d.length>0?" "+d:d);continue}N=!1}const $=h.length===0?"":h.length===1?h[0]:s(h).join(":"),j=k?$+bn:$,B=j+S;if(l.indexOf(B)>-1)continue;l.push(B);const H=o(S,N);for(let Q=0;Q<H.length;++Q){const a=H[Q];l.push(j+a)}d=v+(d.length>0?" "+d:d)}return d},Ma=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Fs(r))&&(o&&(o+=" "),o+=n);return o},Fs=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Fs(e[n]))&&(r&&(r+=" "),r+=t);return r},Na=(e,...t)=>{let r,n,o,s;const i=c=>{const d=t.reduce((g,v)=>v(g),e());return r=Ta(d),n=r.cache.get,o=r.cache.set,s=l,l(c)},l=c=>{const d=n(c);if(d)return d;const g=Ia(c,r);return o(c,g),g};return s=i,(...c)=>s(Ma(...c))},$a=[],de=e=>{const t=r=>r[e]||$a;return t.isThemeGetter=!0,t},Is=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ms=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ja=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Da=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,La=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ba=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ua=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ha=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>ja.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),He=e=>!!e&&Number.isInteger(Number(e)),tn=e=>e.endsWith("%")&&X(e.slice(0,-1)),Xe=e=>Da.test(e),Ns=()=>!0,Wa=e=>La.test(e)&&!Ba.test(e),Vn=()=>!1,za=e=>Ua.test(e),Ga=e=>Ha.test(e),qa=e=>!z(e)&&!G(e),Va=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Qa=e=>vt(e,Ds,Vn),z=e=>Is.test(e),yt=e=>vt(e,Ls,Wa),yo=e=>vt(e,tl,X),_a=e=>vt(e,Us,Ns),Ka=e=>vt(e,Bs,Vn),wo=e=>vt(e,$s,Vn),Ya=e=>vt(e,js,Ga),Rr=e=>vt(e,Hs,za),G=e=>Ms.test(e),sr=e=>Dt(e,Ls),Xa=e=>Dt(e,Bs),xo=e=>Dt(e,$s),Ja=e=>Dt(e,Ds),Za=e=>Dt(e,js),Tr=e=>Dt(e,Hs,!0),el=e=>Dt(e,Us,!0),vt=(e,t,r)=>{const n=Is.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Dt=(e,t,r=!1)=>{const n=Ms.exec(e);return n?n[1]?t(n[1]):r:!1},$s=e=>e==="position"||e==="percentage",js=e=>e==="image"||e==="url",Ds=e=>e==="length"||e==="size"||e==="bg-size",Ls=e=>e==="length",tl=e=>e==="number",Bs=e=>e==="family-name",Us=e=>e==="number"||e==="weight",Hs=e=>e==="shadow",rl=()=>{const e=de("color"),t=de("font"),r=de("text"),n=de("font-weight"),o=de("tracking"),s=de("leading"),i=de("breakpoint"),l=de("container"),c=de("spacing"),d=de("radius"),g=de("shadow"),v=de("inset-shadow"),x=de("text-shadow"),h=de("drop-shadow"),k=de("blur"),O=de("perspective"),F=de("aspect"),N=de("ease"),S=de("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...j(),G,z],H=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],a=()=>[G,z,c],u=()=>[ot,"full","auto",...a()],f=()=>[He,"none","subgrid",G,z],E=()=>["auto",{span:["full",He,G,z]},He,G,z],y=()=>[He,"auto",G,z],C=()=>["auto","min","max","fr",G,z],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],m=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...a()],T=()=>[ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...a()],R=()=>[ot,"screen","full","dvw","lvw","svw","min","max","fit",...a()],I=()=>[ot,"screen","full","lh","dvh","lvh","svh","min","max","fit",...a()],M=()=>[e,G,z],W=()=>[...j(),xo,wo,{position:[G,z]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",Ja,Qa,{size:[G,z]}],ne=()=>[tn,sr,yt],L=()=>["","none","full",d,G,z],D=()=>["",X,sr,yt],te=()=>["solid","dashed","dotted","double"],$e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[X,tn,xo,wo],Lt=()=>["","none",k,G,z],be=()=>["none",X,G,z],Ue=()=>["none",X,G,z],me=()=>[X,G,z],ue=()=>[ot,"full",...a()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xe],breakpoint:[Xe],color:[Ns],container:[Xe],"drop-shadow":[Xe],ease:["in","out","in-out"],font:[qa],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xe],shadow:[Xe],spacing:["px",X],text:[Xe],"text-shadow":[Xe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ot,z,G,F]}],container:["container"],"container-type":[{"@container":["","normal","size",G,z]}],"container-named":[Va],columns:[{columns:[X,z,G,l]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:u()}],"inset-x":[{"inset-x":u()}],"inset-y":[{"inset-y":u()}],start:[{"inset-s":u(),start:u()}],end:[{"inset-e":u(),end:u()}],"inset-bs":[{"inset-bs":u()}],"inset-be":[{"inset-be":u()}],top:[{top:u()}],right:[{right:u()}],bottom:[{bottom:u()}],left:[{left:u()}],visibility:["visible","invisible","collapse"],z:[{z:[He,"auto",G,z]}],basis:[{basis:[ot,"full","auto",l,...a()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[X,ot,"auto","initial","none",z]}],grow:[{grow:["",X,G,z]}],shrink:[{shrink:["",X,G,z]}],order:[{order:[He,"first","last","none",G,z]}],"grid-cols":[{"grid-cols":f()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":y()}],"col-end":[{"col-end":y()}],"grid-rows":[{"grid-rows":f()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":y()}],"row-end":[{"row-end":y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:a()}],"gap-x":[{"gap-x":a()}],"gap-y":[{"gap-y":a()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...m(),"normal"]}],"justify-self":[{"justify-self":["auto",...m()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...m(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...m(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...m(),"baseline"]}],"place-self":[{"place-self":["auto",...m()]}],p:[{p:a()}],px:[{px:a()}],py:[{py:a()}],ps:[{ps:a()}],pe:[{pe:a()}],pbs:[{pbs:a()}],pbe:[{pbe:a()}],pt:[{pt:a()}],pr:[{pr:a()}],pb:[{pb:a()}],pl:[{pl:a()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mbs:[{mbs:w()}],mbe:[{mbe:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":a()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":a()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[l,"screen",...T()]}],"min-w":[{"min-w":[l,"screen","none",...T()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",r,sr,yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,el,_a]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tn,z]}],"font-family":[{font:[Xa,Ka,t]}],"font-features":[{"font-features":[z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,G,z]}],"line-clamp":[{"line-clamp":[X,"none",G,yo]}],leading:[{leading:[s,...a()]}],"list-image":[{"list-image":["none",G,z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",G,z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[X,"from-font","auto",G,yt]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[X,"auto",G,z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:a()}],"tab-size":[{tab:[He,G,z]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G,z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G,z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},He,G,z],radial:["",G,z],conic:[He,G,z]},Za,Ya]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-bs":[{"border-bs":D()}],"border-w-be":[{"border-be":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[X,G,z]}],"outline-w":[{outline:["",X,sr,yt]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",g,Tr,Rr]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",v,Tr,Rr]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[X,yt]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",x,Tr,Rr]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[X,G,z]}],"mix-blend":[{"mix-blend":[...$e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[G,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",G,z]}],filter:[{filter:["","none",G,z]}],blur:[{blur:Lt()}],brightness:[{brightness:[X,G,z]}],contrast:[{contrast:[X,G,z]}],"drop-shadow":[{"drop-shadow":["","none",h,Tr,Rr]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",X,G,z]}],"hue-rotate":[{"hue-rotate":[X,G,z]}],invert:[{invert:["",X,G,z]}],saturate:[{saturate:[X,G,z]}],sepia:[{sepia:["",X,G,z]}],"backdrop-filter":[{"backdrop-filter":["","none",G,z]}],"backdrop-blur":[{"backdrop-blur":Lt()}],"backdrop-brightness":[{"backdrop-brightness":[X,G,z]}],"backdrop-contrast":[{"backdrop-contrast":[X,G,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",X,G,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,G,z]}],"backdrop-invert":[{"backdrop-invert":["",X,G,z]}],"backdrop-opacity":[{"backdrop-opacity":[X,G,z]}],"backdrop-saturate":[{"backdrop-saturate":[X,G,z]}],"backdrop-sepia":[{"backdrop-sepia":["",X,G,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":a()}],"border-spacing-x":[{"border-spacing-x":a()}],"border-spacing-y":[{"border-spacing-y":a()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",G,z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[X,"initial",G,z]}],ease:[{ease:["linear","initial",N,G,z]}],delay:[{delay:[X,G,z]}],animate:[{animate:["none",S,G,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,G,z]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[G,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],zoom:[{zoom:[He,G,z]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G,z]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":a()}],"scroll-mx":[{"scroll-mx":a()}],"scroll-my":[{"scroll-my":a()}],"scroll-ms":[{"scroll-ms":a()}],"scroll-me":[{"scroll-me":a()}],"scroll-mbs":[{"scroll-mbs":a()}],"scroll-mbe":[{"scroll-mbe":a()}],"scroll-mt":[{"scroll-mt":a()}],"scroll-mr":[{"scroll-mr":a()}],"scroll-mb":[{"scroll-mb":a()}],"scroll-ml":[{"scroll-ml":a()}],"scroll-p":[{"scroll-p":a()}],"scroll-px":[{"scroll-px":a()}],"scroll-py":[{"scroll-py":a()}],"scroll-ps":[{"scroll-ps":a()}],"scroll-pe":[{"scroll-pe":a()}],"scroll-pbs":[{"scroll-pbs":a()}],"scroll-pbe":[{"scroll-pbe":a()}],"scroll-pt":[{"scroll-pt":a()}],"scroll-pr":[{"scroll-pr":a()}],"scroll-pb":[{"scroll-pb":a()}],"scroll-pl":[{"scroll-pl":a()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G,z]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[X,sr,yt,yo]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nl=Na(rl);function er(...e){return nl(fa(e))}const ol={sm:"py-1.5 px-3 text-sm rounded-lg",md:"py-2.5 px-4 text-base rounded-xl",lg:"py-3 px-5 text-lg rounded-xl"},Vr=p.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>P.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:er("bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] font-bold cursor-pointer disabled:opacity-50 wallet-custom-font",ol[n],e),style:r,...o,type:"button",children:t||"Connect Wallet"}));Vr.displayName="ConnectWalletButton";var Sr=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(){}},kt,at,Ht,gs,sl=(gs=class extends Sr{constructor(){super();_(this,kt);_(this,at);_(this,Ht);U(this,Ht,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){b(this,at)||this.setEventListener(b(this,Ht))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,at))==null||t.call(this),U(this,at,void 0))}setEventListener(t){var r;U(this,Ht,t),(r=b(this,at))==null||r.call(this),U(this,at,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){b(this,kt)!==t&&(U(this,kt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof b(this,kt)=="boolean"?b(this,kt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},kt=new WeakMap,at=new WeakMap,Ht=new WeakMap,gs),Qn=new sl,il={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ze,Ot,vs,al=(vs=class{constructor(){_(this,ze,il);_(this,Ot,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&b(this,Ot)&&e!==b(this,ze)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:b(this,ze),provider:e}),U(this,ze,e),process.env.NODE_ENV!=="production"&&U(this,Ot,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&U(this,Ot,!0),b(this,ze).setTimeout(e,t)}clearTimeout(e){b(this,ze).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&U(this,Ot,!0),b(this,ze).setInterval(e,t)}clearInterval(e){b(this,ze).clearInterval(e)}},ze=new WeakMap,Ot=new WeakMap,vs),Et=new al;function ll(e){setTimeout(e,0)}var cl=typeof window>"u"||"Deno"in globalThis;function Se(){}function ul(e,t){return typeof e=="function"?e(t):e}function yn(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ws(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mt(e,t){return typeof e=="function"?e(t):e}function Ae(e,t){return typeof e=="function"?e(t):e}function Eo(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==_n(i,t.options))return!1}else if(!pr(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||s&&!s(t))}function So(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(hr(t.options.mutationKey)!==hr(s))return!1}else if(!pr(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function _n(e,t){return((t==null?void 0:t.queryKeyHashFn)||hr)(e)}function hr(e){return JSON.stringify(e,(t,r)=>En(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function pr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pr(e[r],t[r])):!1}var dl=Object.prototype.hasOwnProperty;function wn(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Co(e)&&Co(t);if(!n&&!(En(e)&&En(t)))return t;const s=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let d=0;for(let g=0;g<l;g++){const v=n?g:i[g],x=e[v],h=t[v];if(x===h){c[v]=x,(n?g<s:dl.call(e,v))&&d++;continue}if(x===null||h===null||typeof x!="object"||typeof h!="object"){c[v]=h;continue}const k=wn(x,h,r+1);c[v]=k,k===x&&d++}return s===l&&d===s?e:c}function xn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Co(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function En(e){if(!ko(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!ko(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ko(e){return Object.prototype.toString.call(e)==="[object Object]"}function fl(e){return new Promise(t=>{Et.setTimeout(t,e)})}function Sn(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return wn(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return wn(e,t)}return t}function hl(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function pl(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Hr=Symbol();function zs(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Hr&&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===Hr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gs(e,t){return typeof e=="function"?e(...t):!!e}function ml(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var mr=(()=>{let e=()=>cl;return{isServer(){return e()},setIsServer(t){e=t}}})();function Cn(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var gl=ll;function vl(){let e=[],t=0,r=l=>{l()},n=l=>{l()},o=gl;const s=l=>{t?e.push(l):o(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&o(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{o=l}}}var pe=vl(),Wt,lt,zt,bs,bl=(bs=class extends Sr{constructor(){super();_(this,Wt,!0);_(this,lt);_(this,zt);U(this,zt,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){b(this,lt)||this.setEventListener(b(this,zt))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,lt))==null||t.call(this),U(this,lt,void 0))}setEventListener(t){var r;U(this,zt,t),(r=b(this,lt))==null||r.call(this),U(this,lt,t(this.setOnline.bind(this)))}setOnline(t){b(this,Wt)!==t&&(U(this,Wt,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return b(this,Wt)}},Wt=new WeakMap,lt=new WeakMap,zt=new WeakMap,bs),Wr=new bl;function yl(e){return Math.min(1e3*2**e,3e4)}function qs(e){return(e??"online")==="online"?Wr.isOnline():!0}var kn=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vs(e){let t=!1,r=0,n;const o=Cn(),s=()=>o.status!=="pending",i=O=>{var F;if(!s()){const N=new kn(O);x(N),(F=e.onCancel)==null||F.call(e,N)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>Qn.isFocused()&&(e.networkMode==="always"||Wr.isOnline())&&e.canRun(),g=()=>qs(e.networkMode)&&e.canRun(),v=O=>{s()||(n==null||n(),o.resolve(O))},x=O=>{s()||(n==null||n(),o.reject(O))},h=()=>new Promise(O=>{var F;n=N=>{(s()||d())&&O(N)},(F=e.onPause)==null||F.call(e)}).then(()=>{var O;n=void 0,s()||(O=e.onContinue)==null||O.call(e)}),k=()=>{if(s())return;let O;const F=r===0?e.initialPromise:void 0;try{O=F??e.fn()}catch(N){O=Promise.reject(N)}Promise.resolve(O).then(v).catch(N=>{var H;if(s())return;const S=e.retry??(mr.isServer()?0:3),$=e.retryDelay??yl,j=typeof $=="function"?$(r,N):$,B=S===!0||typeof S=="number"&&r<S||typeof S=="function"&&S(r,N);if(t||!B){x(N);return}r++,(H=e.onFail)==null||H.call(e,r,N),fl(j).then(()=>d()?void 0:h()).then(()=>{t?x(N):k()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:l,continueRetry:c,canStart:g,start:()=>(g()?k():h().then(k),o)}}var At,ys,Qs=(ys=class{constructor(){_(this,At)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yn(this.gcTime)&&U(this,At,Et.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mr.isServer()?1/0:300*1e3))}clearGcTimeout(){b(this,At)!==void 0&&(Et.clearTimeout(b(this,At)),U(this,At,void 0))}},At=new WeakMap,ys);function wl(e){return{onFetch:(t,r)=>{var g,v,x,h,k;const n=t.options,o=(x=(v=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],i=((k=t.state.data)==null?void 0:k.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let O=!1;const F=$=>{ml($,()=>t.signal,()=>O=!0)},N=zs(t.options,t.fetchOptions),S=async($,j,B)=>{if(O)return Promise.reject(t.signal.reason);if(j==null&&$.pages.length)return Promise.resolve($);const Q=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:j,direction:B?"backward":"forward",meta:t.options.meta};return F(E),E})(),a=await N(Q),{maxPages:u}=t.options,f=B?pl:hl;return{pages:f($.pages,a,u),pageParams:f($.pageParams,j,u)}};if(o&&s.length){const $=o==="backward",j=$?xl:Oo,B={pages:s,pageParams:i},H=j(n,B);l=await S(B,H,$)}else{const $=e??s.length;do{const j=c===0?i[0]??n.initialPageParam:Oo(n,l);if(c>0&&j==null)break;l=await S(l,j),c++}while(c<$)}return l};t.options.persister?t.fetchFn=()=>{var O,F;return(F=(O=t.options).persister)==null?void 0:F.call(O,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function Oo(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function xl(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Gt,Rt,qt,Me,Tt,fe,br,Pt,Oe,_s,Ze,ws,El=(ws=class extends Qs{constructor(t){super();_(this,Oe);_(this,Gt);_(this,Rt);_(this,qt);_(this,Me);_(this,Tt);_(this,fe);_(this,br);_(this,Pt);U(this,Pt,!1),U(this,br,t.defaultOptions),this.setOptions(t.options),this.observers=[],U(this,Tt,t.client),U(this,Me,b(this,Tt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,U(this,Rt,Ro(this.options)),this.state=t.state??b(this,Rt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return b(this,Gt)}get promise(){var t;return(t=b(this,fe))==null?void 0:t.promise}setOptions(t){if(this.options={...b(this,br),...t},t!=null&&t._type&&U(this,Gt,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Ro(this.options);r.data!==void 0&&(this.setState(Ao(r.data,r.dataUpdatedAt)),U(this,Rt,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&b(this,Me).remove(this)}setData(t,r){const n=Sn(this.state.data,t,this.options);return Z(this,Oe,Ze).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Z(this,Oe,Ze).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=b(this,fe))==null?void 0:n.promise;return(o=b(this,fe))==null||o.cancel(t),r?r.then(Se).catch(Se):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return b(this,Rt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ae(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>mt(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:!Ws(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),b(this,Me).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(b(this,fe)&&(b(this,Pt)||Z(this,Oe,_s).call(this)?b(this,fe).cancel({revert:!0}):b(this,fe).cancelRetry()),this.scheduleGc()),b(this,Me).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,Oe,Ze).call(this,{type:"invalidate"})}async fetch(t,r){var d,g,v,x,h,k,O,F,N,S,$;if(this.state.fetchStatus!=="idle"&&((d=b(this,fe))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(b(this,fe))return b(this,fe).continueRetry(),b(this,fe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(B=>B.options.queryFn);j&&this.setOptions(j.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(U(this,Pt,!0),n.signal)})},s=()=>{const j=zs(this.options,r),H=(()=>{const Q={client:b(this,Tt),queryKey:this.queryKey,meta:this.meta};return o(Q),Q})();return U(this,Pt,!1),this.options.persister?this.options.persister(j,H,this):j(H)},l=(()=>{const j={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:b(this,Tt),state:this.state,fetchFn:s};return o(j),j})(),c=b(this,Gt)==="infinite"?wl(this.options.pages):this.options.behavior;c==null||c.onFetch(l,this),U(this,qt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=l.fetchOptions)==null?void 0:g.meta))&&Z(this,Oe,Ze).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta}),U(this,fe,Vs({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:j=>{j instanceof kn&&j.revert&&this.setState({...b(this,qt),fetchStatus:"idle"}),n.abort()},onFail:(j,B)=>{Z(this,Oe,Ze).call(this,{type:"failed",failureCount:j,error:B})},onPause:()=>{Z(this,Oe,Ze).call(this,{type:"pause"})},onContinue:()=>{Z(this,Oe,Ze).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const j=await b(this,fe).start();if(j===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(j),(h=(x=b(this,Me).config).onSuccess)==null||h.call(x,j,this),(O=(k=b(this,Me).config).onSettled)==null||O.call(k,j,this.state.error,this),j}catch(j){if(j instanceof kn){if(j.silent)return b(this,fe).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Z(this,Oe,Ze).call(this,{type:"error",error:j}),(N=(F=b(this,Me).config).onError)==null||N.call(F,j,this),($=(S=b(this,Me).config).onSettled)==null||$.call(S,this.state.data,j,this),j}finally{this.scheduleGc()}}},Gt=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Me=new WeakMap,Tt=new WeakMap,fe=new WeakMap,br=new WeakMap,Pt=new WeakMap,Oe=new WeakSet,_s=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ze=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ks(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Ao(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return U(this,qt,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pe.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),b(this,Me).notify({query:this,type:"updated",action:t})})},ws);function Ks(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qs(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ao(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ro(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ee,ee,yr,ye,Ft,Vt,et,ct,wr,Qt,_t,It,Mt,ut,Kt,re,ar,On,An,Rn,Tn,Pn,Fn,In,Ys,xs,Sl=(xs=class extends Sr{constructor(t,r){super();_(this,re);_(this,Ee);_(this,ee);_(this,yr);_(this,ye);_(this,Ft);_(this,Vt);_(this,et);_(this,ct);_(this,wr);_(this,Qt);_(this,_t);_(this,It);_(this,Mt);_(this,ut);_(this,Kt,new Set);this.options=r,U(this,Ee,t),U(this,ct,null),U(this,et,Cn()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,ee).addObserver(this),To(b(this,ee),this.options)?Z(this,re,ar).call(this):this.updateResult(),Z(this,re,Tn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mn(b(this,ee),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mn(b(this,ee),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Z(this,re,Pn).call(this),Z(this,re,Fn).call(this),b(this,ee).removeObserver(this)}setOptions(t){const r=this.options,n=b(this,ee);if(this.options=b(this,Ee).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ae(this.options.enabled,b(this,ee))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Z(this,re,In).call(this),b(this,ee).setOptions(this.options),r._defaulted&&!xn(this.options,r)&&b(this,Ee).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,ee),observer:this});const o=this.hasListeners();o&&Po(b(this,ee),n,this.options,r)&&Z(this,re,ar).call(this),this.updateResult(),o&&(b(this,ee)!==n||Ae(this.options.enabled,b(this,ee))!==Ae(r.enabled,b(this,ee))||mt(this.options.staleTime,b(this,ee))!==mt(r.staleTime,b(this,ee)))&&Z(this,re,On).call(this);const s=Z(this,re,An).call(this);o&&(b(this,ee)!==n||Ae(this.options.enabled,b(this,ee))!==Ae(r.enabled,b(this,ee))||s!==b(this,ut))&&Z(this,re,Rn).call(this,s)}getOptimisticResult(t){const r=b(this,Ee).getQueryCache().build(b(this,Ee),t),n=this.createResult(r,t);return kl(this,n)&&(U(this,ye,n),U(this,Vt,this.options),U(this,Ft,b(this,ee).state)),n}getCurrentResult(){return b(this,ye)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&b(this,et).status==="pending"&&b(this,et).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){b(this,Kt).add(t)}getCurrentQuery(){return b(this,ee)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=b(this,Ee).defaultQueryOptions(t),n=b(this,Ee).getQueryCache().build(b(this,Ee),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Z(this,re,ar).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),b(this,ye)))}createResult(t,r){var u;const n=b(this,ee),o=this.options,s=b(this,ye),i=b(this,Ft),l=b(this,Vt),d=t!==n?t.state:b(this,yr),{state:g}=t;let v={...g},x=!1,h;if(r._optimisticResults){const f=this.hasListeners(),E=!f&&To(t,r),y=f&&Po(t,n,r,o);(E||y)&&(v={...v,...Ks(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:k,errorUpdatedAt:O,status:F}=v;h=v.data;let N=!1;if(r.placeholderData!==void 0&&h===void 0&&F==="pending"){let f;s!=null&&s.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(f=s.data,N=!0):f=typeof r.placeholderData=="function"?r.placeholderData((u=b(this,_t))==null?void 0:u.state.data,b(this,_t)):r.placeholderData,f!==void 0&&(F="success",h=Sn(s==null?void 0:s.data,f,r),x=!0)}if(r.select&&h!==void 0&&!N)if(s&&h===(i==null?void 0:i.data)&&r.select===b(this,wr))h=b(this,Qt);else try{U(this,wr,r.select),h=r.select(h),h=Sn(s==null?void 0:s.data,h,r),U(this,Qt,h),U(this,ct,null)}catch(f){U(this,ct,f)}b(this,ct)&&(k=b(this,ct),h=b(this,Qt),O=Date.now(),F="error");const S=v.fetchStatus==="fetching",$=F==="pending",j=F==="error",B=$&&S,H=h!==void 0,a={status:F,fetchStatus:v.fetchStatus,isPending:$,isSuccess:F==="success",isError:j,isInitialLoading:B,isLoading:B,data:h,dataUpdatedAt:v.dataUpdatedAt,error:k,errorUpdatedAt:O,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:v.dataUpdateCount>d.dataUpdateCount||v.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!$,isLoadingError:j&&!H,isPaused:v.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:j&&H,isStale:Kn(t,r),refetch:this.refetch,promise:b(this,et),isEnabled:Ae(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const f=a.data!==void 0,E=a.status==="error"&&!f,y=m=>{E?m.reject(a.error):f&&m.resolve(a.data)},C=()=>{const m=U(this,et,a.promise=Cn());y(m)},A=b(this,et);switch(A.status){case"pending":t.queryHash===n.queryHash&&y(A);break;case"fulfilled":(E||a.data!==A.value)&&C();break;case"rejected":(!E||a.error!==A.reason)&&C();break}}return a}updateResult(){const t=b(this,ye),r=this.createResult(b(this,ee),this.options);if(U(this,Ft,b(this,ee).state),U(this,Vt,this.options),b(this,Ft).data!==void 0&&U(this,_t,b(this,ee)),xn(r,t))return;U(this,ye,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!b(this,Kt).size)return!0;const i=new Set(s??b(this,Kt));return this.options.throwOnError&&i.add("error"),Object.keys(b(this,ye)).some(l=>{const c=l;return b(this,ye)[c]!==t[c]&&i.has(c)})};Z(this,re,Ys).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Z(this,re,Tn).call(this)}},Ee=new WeakMap,ee=new WeakMap,yr=new WeakMap,ye=new WeakMap,Ft=new WeakMap,Vt=new WeakMap,et=new WeakMap,ct=new WeakMap,wr=new WeakMap,Qt=new WeakMap,_t=new WeakMap,It=new WeakMap,Mt=new WeakMap,ut=new WeakMap,Kt=new WeakMap,re=new WeakSet,ar=function(t){Z(this,re,In).call(this);let r=b(this,ee).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Se)),r},On=function(){Z(this,re,Pn).call(this);const t=mt(this.options.staleTime,b(this,ee));if(mr.isServer()||b(this,ye).isStale||!yn(t))return;const n=Ws(b(this,ye).dataUpdatedAt,t)+1;U(this,It,Et.setTimeout(()=>{b(this,ye).isStale||this.updateResult()},n))},An=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,ee)):this.options.refetchInterval)??!1},Rn=function(t){Z(this,re,Fn).call(this),U(this,ut,t),!(mr.isServer()||Ae(this.options.enabled,b(this,ee))===!1||!yn(b(this,ut))||b(this,ut)===0)&&U(this,Mt,Et.setInterval(()=>{(this.options.refetchIntervalInBackground||Qn.isFocused())&&Z(this,re,ar).call(this)},b(this,ut)))},Tn=function(){Z(this,re,On).call(this),Z(this,re,Rn).call(this,Z(this,re,An).call(this))},Pn=function(){b(this,It)!==void 0&&(Et.clearTimeout(b(this,It)),U(this,It,void 0))},Fn=function(){b(this,Mt)!==void 0&&(Et.clearInterval(b(this,Mt)),U(this,Mt,void 0))},In=function(){const t=b(this,Ee).getQueryCache().build(b(this,Ee),this.options);if(t===b(this,ee))return;const r=b(this,ee);U(this,ee,t),U(this,yr,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Ys=function(t){pe.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(b(this,ye))}),b(this,Ee).getQueryCache().notify({query:b(this,ee),type:"observerResultsUpdated"})})},xs);function Cl(e,t){return Ae(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ae(t.retryOnMount,e)===!1)}function To(e,t){return Cl(e,t)||e.state.data!==void 0&&Mn(e,t,t.refetchOnMount)}function Mn(e,t,r){if(Ae(t.enabled,e)!==!1&&mt(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Kn(e,t)}return!1}function Po(e,t,r,n){return(e!==t||Ae(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Kn(e,r)}function Kn(e,t){return Ae(t.enabled,e)!==!1&&e.isStaleByTime(mt(t.staleTime,e))}function kl(e,t){return!xn(e.getCurrentResult(),t)}var xr,Ge,ge,Nt,qe,it,Es,Ol=(Es=class extends Qs{constructor(t){super();_(this,qe);_(this,xr);_(this,Ge);_(this,ge);_(this,Nt);U(this,xr,t.client),this.mutationId=t.mutationId,U(this,ge,t.mutationCache),U(this,Ge,[]),this.state=t.state||Al(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){b(this,Ge).includes(t)||(b(this,Ge).push(t),this.clearGcTimeout(),b(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){U(this,Ge,b(this,Ge).filter(r=>r!==t)),this.scheduleGc(),b(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){b(this,Ge).length||(this.state.status==="pending"?this.scheduleGc():b(this,ge).remove(this))}continue(){var t;return((t=b(this,Nt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,l,c,d,g,v,x,h,k,O,F,N,S,$,j,B,H,Q;const r=()=>{Z(this,qe,it).call(this,{type:"continue"})},n={client:b(this,xr),meta:this.options.meta,mutationKey:this.options.mutationKey};U(this,Nt,Vs({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,u)=>{Z(this,qe,it).call(this,{type:"failed",failureCount:a,error:u})},onPause:()=>{Z(this,qe,it).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>b(this,ge).canRun(this)}));const o=this.state.status==="pending",s=!b(this,Nt).canStart();try{if(o)r();else{Z(this,qe,it).call(this,{type:"pending",variables:t,isPaused:s}),b(this,ge).config.onMutate&&await b(this,ge).config.onMutate(t,this,n);const u=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t,n));u!==this.state.context&&Z(this,qe,it).call(this,{type:"pending",context:u,variables:t,isPaused:s})}const a=await b(this,Nt).start();return await((d=(c=b(this,ge).config).onSuccess)==null?void 0:d.call(c,a,t,this.state.context,this,n)),await((v=(g=this.options).onSuccess)==null?void 0:v.call(g,a,t,this.state.context,n)),await((h=(x=b(this,ge).config).onSettled)==null?void 0:h.call(x,a,null,this.state.variables,this.state.context,this,n)),await((O=(k=this.options).onSettled)==null?void 0:O.call(k,a,null,t,this.state.context,n)),Z(this,qe,it).call(this,{type:"success",data:a}),a}catch(a){try{await((N=(F=b(this,ge).config).onError)==null?void 0:N.call(F,a,t,this.state.context,this,n))}catch(u){Promise.reject(u)}try{await(($=(S=this.options).onError)==null?void 0:$.call(S,a,t,this.state.context,n))}catch(u){Promise.reject(u)}try{await((B=(j=b(this,ge).config).onSettled)==null?void 0:B.call(j,void 0,a,this.state.variables,this.state.context,this,n))}catch(u){Promise.reject(u)}try{await((Q=(H=this.options).onSettled)==null?void 0:Q.call(H,void 0,a,t,this.state.context,n))}catch(u){Promise.reject(u)}throw Z(this,qe,it).call(this,{type:"error",error:a}),a}finally{b(this,ge).runNext(this)}}},xr=new WeakMap,Ge=new WeakMap,ge=new WeakMap,Nt=new WeakMap,qe=new WeakSet,it=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),pe.batch(()=>{b(this,Ge).forEach(n=>{n.onMutationUpdate(t)}),b(this,ge).notify({mutation:this,type:"updated",action:t})})},Es);function Al(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tt,De,Er,Ss,Rl=(Ss=class extends Sr{constructor(t={}){super();_(this,tt);_(this,De);_(this,Er);this.config=t,U(this,tt,new Set),U(this,De,new Map),U(this,Er,0)}build(t,r,n){const o=new Ol({client:t,mutationCache:this,mutationId:++Ar(this,Er)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){b(this,tt).add(t);const r=Pr(t);if(typeof r=="string"){const n=b(this,De).get(r);n?n.push(t):b(this,De).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(b(this,tt).delete(t)){const r=Pr(t);if(typeof r=="string"){const n=b(this,De).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&b(this,De).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Pr(t);if(typeof r=="string"){const n=b(this,De).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Pr(t);if(typeof r=="string"){const o=(n=b(this,De).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pe.batch(()=>{b(this,tt).forEach(t=>{this.notify({type:"removed",mutation:t})}),b(this,tt).clear(),b(this,De).clear()})}getAll(){return Array.from(b(this,tt))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>So(r,n))}findAll(t={}){return this.getAll().filter(r=>So(t,r))}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return pe.batch(()=>Promise.all(t.map(r=>r.continue().catch(Se))))}},tt=new WeakMap,De=new WeakMap,Er=new WeakMap,Ss);function Pr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ve,Cs,Tl=(Cs=class extends Sr{constructor(t={}){super();_(this,Ve);this.config=t,U(this,Ve,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??_n(o,r);let i=this.get(s);return i||(i=new El({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){b(this,Ve).has(t.queryHash)||(b(this,Ve).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=b(this,Ve).get(t.queryHash);r&&(t.destroy(),r===t&&b(this,Ve).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return b(this,Ve).get(t)}getAll(){return[...b(this,Ve).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Eo(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Eo(t,n)):r}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ve=new WeakMap,Cs),le,dt,ft,Yt,Xt,ht,Jt,Zt,ks,Pl=(ks=class{constructor(e={}){_(this,le);_(this,dt);_(this,ft);_(this,Yt);_(this,Xt);_(this,ht);_(this,Jt);_(this,Zt);U(this,le,e.queryCache||new Tl),U(this,dt,e.mutationCache||new Rl),U(this,ft,e.defaultOptions||{}),U(this,Yt,new Map),U(this,Xt,new Map),U(this,ht,0)}mount(){Ar(this,ht)._++,b(this,ht)===1&&(U(this,Jt,Qn.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onFocus())})),U(this,Zt,Wr.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onOnline())})))}unmount(){var e,t;Ar(this,ht)._--,b(this,ht)===0&&((e=b(this,Jt))==null||e.call(this),U(this,Jt,void 0),(t=b(this,Zt))==null||t.call(this),U(this,Zt,void 0))}isFetching(e){return b(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return b(this,dt).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=b(this,le).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(mt(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return b(this,le).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=b(this,le).get(n.queryHash),s=o==null?void 0:o.state.data,i=ul(t,s);if(i!==void 0)return b(this,le).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return pe.batch(()=>b(this,le).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=b(this,le);pe.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=b(this,le);return pe.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=pe.batch(()=>b(this,le).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(Se).catch(Se)}invalidateQueries(e,t={}){return pe.batch(()=>(b(this,le).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=pe.batch(()=>b(this,le).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(Se)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Se)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=b(this,le).build(this,t);return r.isStaleByTime(mt(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Se).catch(Se)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Se).catch(Se)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Wr.isOnline()?b(this,dt).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(this,le)}getMutationCache(){return b(this,dt)}getDefaultOptions(){return b(this,ft)}setDefaultOptions(e){U(this,ft,e)}setQueryDefaults(e,t){b(this,Yt).set(hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...b(this,Yt).values()],r={};return t.forEach(n=>{pr(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){b(this,Xt).set(hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...b(this,Xt).values()],r={};return t.forEach(n=>{pr(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...b(this,ft).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_n(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===Hr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(this,ft).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(this,le).clear(),b(this,dt).clear()}},le=new WeakMap,dt=new WeakMap,ft=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,ht=new WeakMap,Jt=new WeakMap,Zt=new WeakMap,ks),Xs=V.createContext(void 0),Js=e=>{const t=V.useContext(Xs);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yn=({client:e,children:t})=>(V.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),P.jsx(Xs.Provider,{value:e,children:t})),Fl=V.createContext(!1),Il=()=>V.useContext(Fl);function Ml(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Nl=V.createContext(Ml()),$l=()=>V.useContext(Nl),jl=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Gs(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Dl=e=>{V.useEffect(()=>{e.clearReset()},[e])},Ll=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||Gs(r,[e.error,n])),Bl=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ul=(e,t)=>e.isLoading&&e.isFetching&&!t,Hl=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Fo=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Wl(e,t,r){var x,h,k,O;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Il(),o=$l(),s=Js(),i=s.defaultQueryOptions(e);(h=(x=s.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||h.call(x,i);const l=s.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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`)),i._optimisticResults=n?"isRestoring":"optimistic",Bl(i),jl(i,o,l),Dl(o);const c=!s.getQueryCache().get(i.queryHash),[d]=V.useState(()=>new t(s,i)),g=d.getOptimisticResult(i),v=!n&&e.subscribed!==!1;if(V.useSyncExternalStore(V.useCallback(F=>{const N=v?d.subscribe(pe.batchCalls(F)):Se;return d.updateResult(),N},[d,v]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),V.useEffect(()=>{d.setOptions(i)},[i,d]),Hl(i,g))throw Fo(i,d,o);if(Ll({result:g,errorResetBoundary:o,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw g.error;if((O=(k=s.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||O.call(k,i,g),i.experimental_prefetchInRender&&!mr.isServer()&&Ul(g,n)){const F=c?Fo(i,d,o):l==null?void 0:l.promise;F==null||F.catch(Se).finally(()=>{d.updateResult()})}return i.notifyOnChangeProps?g:d.trackResult(g)}function Xn(e,t){return Wl(e,Sl)}function Zs(e){const[t,r]=p.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return p.useEffect(()=>{if(e!=="system")return;const n=window.matchMedia("(prefers-color-scheme: dark)");r(n.matches?"dark":"light");const o=s=>{r(s.matches?"dark":"light")};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),e==="system"?t:e}const Io=["after-balance","after-accounts","after-wallet-info","before-actions","actions"],zl={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]},Gl={activeAddress:null,activeWallet:null,theme:"system",resolvedTheme:"light",openDialog:()=>{},closeDialog:()=>{}},ql={menuItemsBySlot:zl,dialogs:[],openDialog:()=>{},closeDialog:()=>{},openDialogs:new Set,panels:[],plugins:[],renderContext:Gl},ei=p.createContext(void 0);function Cr(){const e=p.useContext(ei);return e||ql}function Vl({plugins:e,ctx:t,children:r}){return e.reduceRight((n,o)=>o.Provider?P.jsx(o.Provider,{ctx:t,children:n}):n,r)}function Ql(e){const t=p.useRef(e),r=t.current.map(o=>o.id).join("\0"),n=e.map(o=>o.id).join("\0");return r!==n&&(t.current=e),t.current}function _l({plugins:e,renderContext:t,children:r}){const n=Ql(e);p.useMemo(()=>{if(process.env.NODE_ENV==="production")return;const h=new Set,k=new Set,O=new Set,F=new Set;for(const N of n){h.has(N.id)&&console.warn(`[WalletUI] Duplicate plugin ID: "${N.id}"`),h.add(N.id);for(const S of N.menuItems??[])k.has(S.key)&&console.warn(`[WalletUI] Duplicate menu item key: "${S.key}" (plugin: "${N.id}")`),k.add(S.key);for(const S of N.dialogs??[])O.has(S.key)&&console.warn(`[WalletUI] Duplicate dialog key: "${S.key}" (plugin: "${N.id}")`),O.add(S.key);for(const S of N.panels??[])F.has(S.key)&&console.warn(`[WalletUI] Duplicate panel key: "${S.key}" (plugin: "${N.id}")`),F.add(S.key)}},[n]);const[o,s]=p.useState(new Set),i=p.useCallback(h=>{s(k=>{const O=new Set(k);return O.add(h),O})},[]),l=p.useCallback(h=>{s(k=>{const O=new Set(k);return O.delete(h),O})},[]),c=p.useMemo(()=>{const h={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]};for(const k of n)if(k.menuItems)for(const O of k.menuItems)Io.includes(O.slot)&&h[O.slot].push(O);for(const k of Io)h[k].sort((O,F)=>(O.order??100)-(F.order??100));return h},[n]),d=p.useMemo(()=>n.flatMap(h=>h.dialogs??[]),[n]),g=p.useMemo(()=>n.flatMap(h=>h.panels??[]).sort((h,k)=>(h.order??100)-(k.order??100)),[n]),v=p.useMemo(()=>({...t,openDialog:i,closeDialog:l}),[t,i,l]),x=p.useMemo(()=>({menuItemsBySlot:c,dialogs:d,openDialog:i,closeDialog:l,openDialogs:o,panels:g,plugins:n,renderContext:v}),[c,d,i,l,o,g,n,v]);return P.jsx(ei.Provider,{value:x,children:P.jsx(Vl,{plugins:n,ctx:v,children:r})})}function Kl(){const{dialogs:e,openDialogs:t,closeDialog:r,renderContext:n}=Cr(),{queryClient:o,theme:s}=tr(),i=s==="system"?void 0:s;return P.jsx(P.Fragment,{children:e.map(l=>{const c=t.has(l.key);return c?P.jsx(K.FloatingPortal,{id:`wallet-plugin-${l.key}`,children:P.jsx(Yn,{client:o,children:P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":i,children:l.render({isOpen:c,onClose:()=>r(l.key),ctx:n})})})},l.key):null})})}function rn(e,t){try{const r=t();r&&typeof r.catch=="function"&&r.catch(n=>{console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,n)})}catch(r){console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,r)}}function Yl(){const{plugins:e,renderContext:t}=Cr(),r=p.useRef(null),n=p.useRef(null);return p.useEffect(()=>{var l,c,d,g;const o=r.current,s=n.current,i=((l=t.activeWallet)==null?void 0:l.id)??null;if(!s&&i)for(const v of e)(c=v.lifecycle)!=null&&c.onConnect&&rn(v,()=>v.lifecycle.onConnect(t));if(s&&!i)for(const v of e)(d=v.lifecycle)!=null&&d.onDisconnect&&rn(v,()=>v.lifecycle.onDisconnect());if(i&&o&&t.activeAddress&&o!==t.activeAddress){for(const v of e)if((g=v.lifecycle)!=null&&g.onAccountChange){const x=t.activeAddress,h=o;rn(v,()=>v.lifecycle.onAccountChange(x,h,t))}}r.current=t.activeAddress,n.current=i},[t,e]),null}const Mo="wallet-ui-theme-styles",Xl=`
13
+ `,document.head.insertBefore(t,document.head.firstChild),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},wa=()=>{typeof window<"u"&&ya()};function Ms(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Ms(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xa(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ms(e))&&(n&&(n+=" "),n+=t);return n}const Ea=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Sa=(e,t)=>({classGroupId:e,validator:t}),$s=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),zr="-",Eo=[],ka="arbitrary..",Ca=e=>{const t=Aa(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Oa(i);const l=i.split(zr),c=l[0]===""&&l.length>1?1:0;return Ds(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?Ea(u,c):c:u||Eo}return r[i]||Eo}}},Ds=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const u=Ds(e,t+1,s);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(zr):e.slice(t).join(zr),c=i.length;for(let u=0;u<c;u++){const g=i[u];if(g.validator(l))return g.classGroupId}},Oa=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?ka+n:void 0})(),Aa=e=>{const{theme:t,classGroups:r}=e;return Ra(r,t)},Ra=(e,t)=>{const r=$s();for(const n in e){const o=e[n];Xn(o,r,n,t)}return r},Xn=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Pa(i,t,r,n)}},Pa=(e,t,r,n)=>{if(typeof e=="string"){Ta(e,t,r);return}if(typeof e=="function"){Fa(e,t,r,n);return}Na(e,t,r,n)},Ta=(e,t,r)=>{const n=e===""?t:Ls(t,e);n.classGroupId=r},Fa=(e,t,r,n)=>{if(Ia(e)){Xn(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Sa(r,e))},Na=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,c]=o[i];Xn(c,Ls(t,l),r,n)}},Ls=(e,t)=>{let r=e;const n=t.split(zr),o=n.length;for(let s=0;s<o;s++){const i=n[s];let l=r.nextPart.get(i);l||(l=$s(),r.nextPart.set(i,l)),r=l}return r},Ia=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ja=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,i)=>{r[s]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let i=r[s];if(i!==void 0)return i;if((i=n[s])!==void 0)return o(s,i),i},set(s,i){s in r?r[s]=i:o(s,i)}}},xn="!",So=":",Ma=[],ko=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),$a=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,l=0,c=0,u;const g=o.length;for(let P=0;P<g;P++){const F=o[P];if(i===0&&l===0){if(F===So){s.push(o.slice(c,P)),c=P+1;continue}if(F==="/"){u=P;continue}}F==="["?i++:F==="]"?i--:F==="("?l++:F===")"&&l--}const v=s.length===0?o:o.slice(c);let S=v,h=!1;v.endsWith(xn)?(S=v.slice(0,-1),h=!0):v.startsWith(xn)&&(S=v.slice(1),h=!0);const R=u&&u>c?u-c:void 0;return ko(s,h,S,R)};if(t){const o=t+So,s=n;n=i=>i.startsWith(o)?s(i.slice(o.length)):ko(Ma,!1,i,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},Da=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const i=r[s],l=i[0]==="[",c=t.has(i);l||c?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(i)):o.push(i)}return o.length>0&&(o.sort(),n.push(...o)),n}},La=e=>({cache:ja(e.cacheSize),parseClassName:$a(e),sortModifiers:Da(e),postfixLookupClassGroupIds:Ba(e),...Ca(e)}),Ba=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},Ua=/\s+/,Wa=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,l=[],c=e.trim().split(Ua);let u="";for(let g=c.length-1;g>=0;g-=1){const v=c[g],{isExternal:S,modifiers:h,hasImportantModifier:R,baseClassName:P,maybePostfixModifierPosition:F}=r(v);if(S){u=v+(u.length>0?" "+u:u);continue}let $=!!F,C;if($){const Q=P.substring(0,F);C=n(Q);const a=C&&i[C]?n(P):void 0;a&&a!==C&&(C=a,$=!1)}else C=n(P);if(!C){if(!$){u=v+(u.length>0?" "+u:u);continue}if(C=n(P),!C){u=v+(u.length>0?" "+u:u);continue}$=!1}const j=h.length===0?"":h.length===1?h[0]:s(h).join(":"),D=R?j+xn:j,L=D+C;if(l.indexOf(L)>-1)continue;l.push(L);const U=o(C,$);for(let Q=0;Q<U.length;++Q){const a=U[Q];l.push(D+a)}u=v+(u.length>0?" "+u:u)}return u},Ha=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Bs(r))&&(o&&(o+=" "),o+=n);return o},Bs=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Bs(e[n]))&&(r&&(r+=" "),r+=t);return r},za=(e,...t)=>{let r,n,o,s;const i=c=>{const u=t.reduce((g,v)=>v(g),e());return r=La(u),n=r.cache.get,o=r.cache.set,s=l,l(c)},l=c=>{const u=n(c);if(u)return u;const g=Wa(c,r);return o(c,g),g};return s=i,(...c)=>s(Ha(...c))},Ga=[],de=e=>{const t=r=>r[e]||Ga;return t.isThemeGetter=!0,t},Us=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ws=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qa=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Va=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_a=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ka=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ya=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,it=e=>qa.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),He=e=>!!e&&Number.isInteger(Number(e)),on=e=>e.endsWith("%")&&X(e.slice(0,-1)),Je=e=>Va.test(e),Hs=()=>!0,Xa=e=>Qa.test(e)&&!_a.test(e),Jn=()=>!1,Ja=e=>Ka.test(e),Za=e=>Ya.test(e),el=e=>!H(e)&&!z(e),tl=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),rl=e=>yt(e,qs,Jn),H=e=>Us.test(e),xt=e=>yt(e,Vs,Xa),Co=e=>yt(e,ul,X),nl=e=>yt(e,_s,Hs),ol=e=>yt(e,Qs,Jn),Oo=e=>yt(e,zs,Jn),sl=e=>yt(e,Gs,Za),Tr=e=>yt(e,Ks,Ja),z=e=>Ws.test(e),ir=e=>Bt(e,Vs),il=e=>Bt(e,Qs),Ao=e=>Bt(e,zs),al=e=>Bt(e,qs),ll=e=>Bt(e,Gs),Fr=e=>Bt(e,Ks,!0),cl=e=>Bt(e,_s,!0),yt=(e,t,r)=>{const n=Us.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Bt=(e,t,r=!1)=>{const n=Ws.exec(e);return n?n[1]?t(n[1]):r:!1},zs=e=>e==="position"||e==="percentage",Gs=e=>e==="image"||e==="url",qs=e=>e==="length"||e==="size"||e==="bg-size",Vs=e=>e==="length",ul=e=>e==="number",Qs=e=>e==="family-name",_s=e=>e==="number"||e==="weight",Ks=e=>e==="shadow",dl=()=>{const e=de("color"),t=de("font"),r=de("text"),n=de("font-weight"),o=de("tracking"),s=de("leading"),i=de("breakpoint"),l=de("container"),c=de("spacing"),u=de("radius"),g=de("shadow"),v=de("inset-shadow"),S=de("text-shadow"),h=de("drop-shadow"),R=de("blur"),P=de("perspective"),F=de("aspect"),$=de("ease"),C=de("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...D(),z,H],U=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],a=()=>[z,H,c],d=()=>[it,"full","auto",...a()],f=()=>[He,"none","subgrid",z,H],E=()=>["auto",{span:["full",He,z,H]},He,z,H],y=()=>[He,"auto",z,H],k=()=>["auto","min","max","fr",z,H],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],m=()=>["start","end","center","stretch","center-safe","end-safe"],x=()=>["auto",...a()],O=()=>[it,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...a()],A=()=>[it,"screen","full","dvw","lvw","svw","min","max","fit",...a()],N=()=>[it,"screen","full","lh","dvh","lvh","svh","min","max","fit",...a()],I=()=>[e,z,H],W=()=>[...D(),Ao,Oo,{position:[z,H]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",al,rl,{size:[z,H]}],ne=()=>[on,ir,xt],q=()=>["","none","full",u,z,H],M=()=>["",X,ir,xt],te=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[X,on,Ao,Oo],Ut=()=>["","none",R,z,H],be=()=>["none",X,z,H],We=()=>["none",X,z,H],me=()=>[X,z,H],ue=()=>[it,"full",...a()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Je],breakpoint:[Je],color:[Hs],container:[Je],"drop-shadow":[Je],ease:["in","out","in-out"],font:[el],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Je],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Je],shadow:[Je],spacing:["px",X],text:[Je],"text-shadow":[Je],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",it,H,z,F]}],container:["container"],"container-type":[{"@container":["","normal","size",z,H]}],"container-named":[tl],columns:[{columns:[X,H,z,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:d()}],"inset-x":[{"inset-x":d()}],"inset-y":[{"inset-y":d()}],start:[{"inset-s":d(),start:d()}],end:[{"inset-e":d(),end:d()}],"inset-bs":[{"inset-bs":d()}],"inset-be":[{"inset-be":d()}],top:[{top:d()}],right:[{right:d()}],bottom:[{bottom:d()}],left:[{left:d()}],visibility:["visible","invisible","collapse"],z:[{z:[He,"auto",z,H]}],basis:[{basis:[it,"full","auto",l,...a()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[X,it,"auto","initial","none",H]}],grow:[{grow:["",X,z,H]}],shrink:[{shrink:["",X,z,H]}],order:[{order:[He,"first","last","none",z,H]}],"grid-cols":[{"grid-cols":f()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":y()}],"col-end":[{"col-end":y()}],"grid-rows":[{"grid-rows":f()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":y()}],"row-end":[{"row-end":y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:a()}],"gap-x":[{"gap-x":a()}],"gap-y":[{"gap-y":a()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...m(),"normal"]}],"justify-self":[{"justify-self":["auto",...m()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...m(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...m(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...m(),"baseline"]}],"place-self":[{"place-self":["auto",...m()]}],p:[{p:a()}],px:[{px:a()}],py:[{py:a()}],ps:[{ps:a()}],pe:[{pe:a()}],pbs:[{pbs:a()}],pbe:[{pbe:a()}],pt:[{pt:a()}],pr:[{pr:a()}],pb:[{pb:a()}],pl:[{pl:a()}],m:[{m:x()}],mx:[{mx:x()}],my:[{my:x()}],ms:[{ms:x()}],me:[{me:x()}],mbs:[{mbs:x()}],mbe:[{mbe:x()}],mt:[{mt:x()}],mr:[{mr:x()}],mb:[{mb:x()}],ml:[{ml:x()}],"space-x":[{"space-x":a()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":a()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...A()]}],"min-inline-size":[{"min-inline":["auto",...A()]}],"max-inline-size":[{"max-inline":["none",...A()]}],"block-size":[{block:["auto",...N()]}],"min-block-size":[{"min-block":["auto",...N()]}],"max-block-size":[{"max-block":["none",...N()]}],w:[{w:[l,"screen",...O()]}],"min-w":[{"min-w":[l,"screen","none",...O()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",r,ir,xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,cl,nl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",on,H]}],"font-family":[{font:[il,ol,t]}],"font-features":[{"font-features":[H]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,z,H]}],"line-clamp":[{"line-clamp":[X,"none",z,Co]}],leading:[{leading:[s,...a()]}],"list-image":[{"list-image":["none",z,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",z,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[X,"from-font","auto",z,xt]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[X,"auto",z,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:a()}],"tab-size":[{tab:[He,z,H]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z,H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",z,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},He,z,H],radial:["",z,H],conic:[He,z,H]},ll,sl]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-bs":[{"border-bs":M()}],"border-w-be":[{"border-be":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[X,z,H]}],"outline-w":[{outline:["",X,ir,xt]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",g,Fr,Tr]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",v,Fr,Tr]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[X,xt]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",S,Fr,Tr]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[X,z,H]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[z,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",z,H]}],filter:[{filter:["","none",z,H]}],blur:[{blur:Ut()}],brightness:[{brightness:[X,z,H]}],contrast:[{contrast:[X,z,H]}],"drop-shadow":[{"drop-shadow":["","none",h,Fr,Tr]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",X,z,H]}],"hue-rotate":[{"hue-rotate":[X,z,H]}],invert:[{invert:["",X,z,H]}],saturate:[{saturate:[X,z,H]}],sepia:[{sepia:["",X,z,H]}],"backdrop-filter":[{"backdrop-filter":["","none",z,H]}],"backdrop-blur":[{"backdrop-blur":Ut()}],"backdrop-brightness":[{"backdrop-brightness":[X,z,H]}],"backdrop-contrast":[{"backdrop-contrast":[X,z,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",X,z,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,z,H]}],"backdrop-invert":[{"backdrop-invert":["",X,z,H]}],"backdrop-opacity":[{"backdrop-opacity":[X,z,H]}],"backdrop-saturate":[{"backdrop-saturate":[X,z,H]}],"backdrop-sepia":[{"backdrop-sepia":["",X,z,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":a()}],"border-spacing-x":[{"border-spacing-x":a()}],"border-spacing-y":[{"border-spacing-y":a()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",z,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[X,"initial",z,H]}],ease:[{ease:["linear","initial",$,z,H]}],delay:[{delay:[X,z,H]}],animate:[{animate:["none",C,z,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[P,z,H]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:We()}],"scale-x":[{"scale-x":We()}],"scale-y":[{"scale-y":We()}],"scale-z":[{"scale-z":We()}],"scale-3d":["scale-3d"],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[z,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],zoom:[{zoom:[He,z,H]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z,H]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":a()}],"scroll-mx":[{"scroll-mx":a()}],"scroll-my":[{"scroll-my":a()}],"scroll-ms":[{"scroll-ms":a()}],"scroll-me":[{"scroll-me":a()}],"scroll-mbs":[{"scroll-mbs":a()}],"scroll-mbe":[{"scroll-mbe":a()}],"scroll-mt":[{"scroll-mt":a()}],"scroll-mr":[{"scroll-mr":a()}],"scroll-mb":[{"scroll-mb":a()}],"scroll-ml":[{"scroll-ml":a()}],"scroll-p":[{"scroll-p":a()}],"scroll-px":[{"scroll-px":a()}],"scroll-py":[{"scroll-py":a()}],"scroll-ps":[{"scroll-ps":a()}],"scroll-pe":[{"scroll-pe":a()}],"scroll-pbs":[{"scroll-pbs":a()}],"scroll-pbe":[{"scroll-pbe":a()}],"scroll-pt":[{"scroll-pt":a()}],"scroll-pr":[{"scroll-pr":a()}],"scroll-pb":[{"scroll-pb":a()}],"scroll-pl":[{"scroll-pl":a()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",z,H]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[X,ir,xt,Co]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},fl=za(dl);function Le(...e){return fl(xa(e))}const hl={sm:"py-1.5 px-3 text-sm rounded-lg",md:"py-2.5 px-4 text-base rounded-xl",lg:"py-3 px-5 text-lg rounded-xl"},Kr=p.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>w.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:Le("bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] font-bold cursor-pointer disabled:opacity-50 wallet-custom-font",hl[n],e),style:r,...o,type:"button",children:t||"Connect Wallet"}));Kr.displayName="ConnectWalletButton";var Cr=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(){}},At,ct,zt,ks,pl=(ks=class extends Cr{constructor(){super();_(this,At);_(this,ct);_(this,zt);B(this,zt,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){b(this,ct)||this.setEventListener(b(this,zt))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,ct))==null||t.call(this),B(this,ct,void 0))}setEventListener(t){var r;B(this,zt,t),(r=b(this,ct))==null||r.call(this),B(this,ct,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){b(this,At)!==t&&(B(this,At,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof b(this,At)=="boolean"?b(this,At):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},At=new WeakMap,ct=new WeakMap,zt=new WeakMap,ks),Zn=new pl,ml={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ge,Rt,Cs,gl=(Cs=class{constructor(){_(this,Ge,ml);_(this,Rt,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&b(this,Rt)&&e!==b(this,Ge)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:b(this,Ge),provider:e}),B(this,Ge,e),process.env.NODE_ENV!=="production"&&B(this,Rt,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&B(this,Rt,!0),b(this,Ge).setTimeout(e,t)}clearTimeout(e){b(this,Ge).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&B(this,Rt,!0),b(this,Ge).setInterval(e,t)}clearInterval(e){b(this,Ge).clearInterval(e)}},Ge=new WeakMap,Rt=new WeakMap,Cs),kt=new gl;function vl(e){setTimeout(e,0)}var bl=typeof window>"u"||"Deno"in globalThis;function Se(){}function yl(e,t){return typeof e=="function"?e(t):e}function En(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ys(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vt(e,t){return typeof e=="function"?e(t):e}function Ae(e,t){return typeof e=="function"?e(t):e}function Ro(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==eo(i,t.options))return!1}else if(!gr(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||s&&!s(t))}function Po(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(mr(t.options.mutationKey)!==mr(s))return!1}else if(!gr(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function eo(e,t){return((t==null?void 0:t.queryKeyHashFn)||mr)(e)}function mr(e){return JSON.stringify(e,(t,r)=>Cn(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function gr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>gr(e[r],t[r])):!1}var wl=Object.prototype.hasOwnProperty;function Sn(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=To(e)&&To(t);if(!n&&!(Cn(e)&&Cn(t)))return t;const s=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let g=0;g<l;g++){const v=n?g:i[g],S=e[v],h=t[v];if(S===h){c[v]=S,(n?g<s:wl.call(e,v))&&u++;continue}if(S===null||h===null||typeof S!="object"||typeof h!="object"){c[v]=h;continue}const R=Sn(S,h,r+1);c[v]=R,R===S&&u++}return s===l&&u===s?e:c}function kn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function To(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Cn(e){if(!Fo(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Fo(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fo(e){return Object.prototype.toString.call(e)==="[object Object]"}function xl(e){return new Promise(t=>{kt.setTimeout(t,e)})}function On(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Sn(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Sn(e,t)}return t}function El(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Sl(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Gr=Symbol();function Xs(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Gr&&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===Gr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Js(e,t){return typeof e=="function"?e(...t):!!e}function kl(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var vr=(()=>{let e=()=>bl;return{isServer(){return e()},setIsServer(t){e=t}}})();function An(){let e,t;const r=new Promise((o,s)=>{e=o,t=s});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}var Cl=vl;function Ol(){let e=[],t=0,r=l=>{l()},n=l=>{l()},o=Cl;const s=l=>{t?e.push(l):o(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&o(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{o=l}}}var pe=Ol(),Gt,ut,qt,Os,Al=(Os=class extends Cr{constructor(){super();_(this,Gt,!0);_(this,ut);_(this,qt);B(this,qt,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){b(this,ut)||this.setEventListener(b(this,qt))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,ut))==null||t.call(this),B(this,ut,void 0))}setEventListener(t){var r;B(this,qt,t),(r=b(this,ut))==null||r.call(this),B(this,ut,t(this.setOnline.bind(this)))}setOnline(t){b(this,Gt)!==t&&(B(this,Gt,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return b(this,Gt)}},Gt=new WeakMap,ut=new WeakMap,qt=new WeakMap,Os),qr=new Al;function Rl(e){return Math.min(1e3*2**e,3e4)}function Zs(e){return(e??"online")==="online"?qr.isOnline():!0}var Rn=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ei(e){let t=!1,r=0,n;const o=An(),s=()=>o.status!=="pending",i=P=>{var F;if(!s()){const $=new Rn(P);S($),(F=e.onCancel)==null||F.call(e,$)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Zn.isFocused()&&(e.networkMode==="always"||qr.isOnline())&&e.canRun(),g=()=>Zs(e.networkMode)&&e.canRun(),v=P=>{s()||(n==null||n(),o.resolve(P))},S=P=>{s()||(n==null||n(),o.reject(P))},h=()=>new Promise(P=>{var F;n=$=>{(s()||u())&&P($)},(F=e.onPause)==null||F.call(e)}).then(()=>{var P;n=void 0,s()||(P=e.onContinue)==null||P.call(e)}),R=()=>{if(s())return;let P;const F=r===0?e.initialPromise:void 0;try{P=F??e.fn()}catch($){P=Promise.reject($)}Promise.resolve(P).then(v).catch($=>{var U;if(s())return;const C=e.retry??(vr.isServer()?0:3),j=e.retryDelay??Rl,D=typeof j=="function"?j(r,$):j,L=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,$);if(t||!L){S($);return}r++,(U=e.onFail)==null||U.call(e,r,$),xl(D).then(()=>u()?void 0:h()).then(()=>{t?S($):R()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(n==null||n(),o),cancelRetry:l,continueRetry:c,canStart:g,start:()=>(g()?R():h().then(R),o)}}var Pt,As,ti=(As=class{constructor(){_(this,Pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),En(this.gcTime)&&B(this,Pt,kt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vr.isServer()?1/0:300*1e3))}clearGcTimeout(){b(this,Pt)!==void 0&&(kt.clearTimeout(b(this,Pt)),B(this,Pt,void 0))}},Pt=new WeakMap,As);function Pl(e){return{onFetch:(t,r)=>{var g,v,S,h,R;const n=t.options,o=(S=(v=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:v.fetchMore)==null?void 0:S.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],i=((R=t.state.data)==null?void 0:R.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let P=!1;const F=j=>{kl(j,()=>t.signal,()=>P=!0)},$=Xs(t.options,t.fetchOptions),C=async(j,D,L)=>{if(P)return Promise.reject(t.signal.reason);if(D==null&&j.pages.length)return Promise.resolve(j);const Q=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:D,direction:L?"backward":"forward",meta:t.options.meta};return F(E),E})(),a=await $(Q),{maxPages:d}=t.options,f=L?Sl:El;return{pages:f(j.pages,a,d),pageParams:f(j.pageParams,D,d)}};if(o&&s.length){const j=o==="backward",D=j?Tl:No,L={pages:s,pageParams:i},U=D(n,L);l=await C(L,U,j)}else{const j=e??s.length;do{const D=c===0?i[0]??n.initialPageParam:No(n,l);if(c>0&&D==null)break;l=await C(l,D),c++}while(c<j)}return l};t.options.persister?t.fetchFn=()=>{var P,F;return(F=(P=t.options).persister)==null?void 0:F.call(P,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function No(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Tl(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Vt,Tt,Qt,Ie,Ft,fe,wr,Nt,Oe,ri,et,Rs,Fl=(Rs=class extends ti{constructor(t){super();_(this,Oe);_(this,Vt);_(this,Tt);_(this,Qt);_(this,Ie);_(this,Ft);_(this,fe);_(this,wr);_(this,Nt);B(this,Nt,!1),B(this,wr,t.defaultOptions),this.setOptions(t.options),this.observers=[],B(this,Ft,t.client),B(this,Ie,b(this,Ft).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,B(this,Tt,jo(this.options)),this.state=t.state??b(this,Tt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return b(this,Vt)}get promise(){var t;return(t=b(this,fe))==null?void 0:t.promise}setOptions(t){if(this.options={...b(this,wr),...t},t!=null&&t._type&&B(this,Vt,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=jo(this.options);r.data!==void 0&&(this.setState(Io(r.data,r.dataUpdatedAt)),B(this,Tt,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&b(this,Ie).remove(this)}setData(t,r){const n=On(this.state.data,t,this.options);return Z(this,Oe,et).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Z(this,Oe,et).call(this,{type:"setState",state:t})}cancel(t){var n,o;const r=(n=b(this,fe))==null?void 0:n.promise;return(o=b(this,fe))==null||o.cancel(t),r?r.then(Se).catch(Se):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return b(this,Tt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ae(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vt(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:!Ys(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,fe))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),b(this,Ie).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(b(this,fe)&&(b(this,Nt)||Z(this,Oe,ri).call(this)?b(this,fe).cancel({revert:!0}):b(this,fe).cancelRetry()),this.scheduleGc()),b(this,Ie).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,Oe,et).call(this,{type:"invalidate"})}async fetch(t,r){var u,g,v,S,h,R,P,F,$,C,j;if(this.state.fetchStatus!=="idle"&&((u=b(this,fe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(b(this,fe))return b(this,fe).continueRetry(),b(this,fe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const D=this.observers.find(L=>L.options.queryFn);D&&this.setOptions(D.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,o=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>(B(this,Nt,!0),n.signal)})},s=()=>{const D=Xs(this.options,r),U=(()=>{const Q={client:b(this,Ft),queryKey:this.queryKey,meta:this.meta};return o(Q),Q})();return B(this,Nt,!1),this.options.persister?this.options.persister(D,U,this):D(U)},l=(()=>{const D={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:b(this,Ft),state:this.state,fetchFn:s};return o(D),D})(),c=b(this,Vt)==="infinite"?Pl(this.options.pages):this.options.behavior;c==null||c.onFetch(l,this),B(this,Qt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=l.fetchOptions)==null?void 0:g.meta))&&Z(this,Oe,et).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta}),B(this,fe,ei({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:D=>{D instanceof Rn&&D.revert&&this.setState({...b(this,Qt),fetchStatus:"idle"}),n.abort()},onFail:(D,L)=>{Z(this,Oe,et).call(this,{type:"failed",failureCount:D,error:L})},onPause:()=>{Z(this,Oe,et).call(this,{type:"pause"})},onContinue:()=>{Z(this,Oe,et).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const D=await b(this,fe).start();if(D===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(D),(h=(S=b(this,Ie).config).onSuccess)==null||h.call(S,D,this),(P=(R=b(this,Ie).config).onSettled)==null||P.call(R,D,this.state.error,this),D}catch(D){if(D instanceof Rn){if(D.silent)return b(this,fe).promise;if(D.revert){if(this.state.data===void 0)throw D;return this.state.data}}throw Z(this,Oe,et).call(this,{type:"error",error:D}),($=(F=b(this,Ie).config).onError)==null||$.call(F,D,this),(j=(C=b(this,Ie).config).onSettled)==null||j.call(C,this.state.data,D,this),D}finally{this.scheduleGc()}}},Vt=new WeakMap,Tt=new WeakMap,Qt=new WeakMap,Ie=new WeakMap,Ft=new WeakMap,fe=new WeakMap,wr=new WeakMap,Nt=new WeakMap,Oe=new WeakSet,ri=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},et=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...ni(n.data,this.options),fetchMeta:t.meta??null};case"success":const o={...n,...Io(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return B(this,Qt,t.manual?o:void 0),o;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pe.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),b(this,Ie).notify({query:this,type:"updated",action:t})})},Rs);function ni(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zs(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Io(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jo(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ee,ee,xr,ye,It,_t,rt,dt,Er,Kt,Yt,jt,Mt,ft,Xt,re,cr,Pn,Tn,Fn,Nn,In,jn,Mn,oi,Ps,Nl=(Ps=class extends Cr{constructor(t,r){super();_(this,re);_(this,Ee);_(this,ee);_(this,xr);_(this,ye);_(this,It);_(this,_t);_(this,rt);_(this,dt);_(this,Er);_(this,Kt);_(this,Yt);_(this,jt);_(this,Mt);_(this,ft);_(this,Xt,new Set);this.options=r,B(this,Ee,t),B(this,dt,null),B(this,rt,An()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,ee).addObserver(this),Mo(b(this,ee),this.options)?Z(this,re,cr).call(this):this.updateResult(),Z(this,re,Nn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $n(b(this,ee),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $n(b(this,ee),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Z(this,re,In).call(this),Z(this,re,jn).call(this),b(this,ee).removeObserver(this)}setOptions(t){const r=this.options,n=b(this,ee);if(this.options=b(this,Ee).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ae(this.options.enabled,b(this,ee))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Z(this,re,Mn).call(this),b(this,ee).setOptions(this.options),r._defaulted&&!kn(this.options,r)&&b(this,Ee).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,ee),observer:this});const o=this.hasListeners();o&&$o(b(this,ee),n,this.options,r)&&Z(this,re,cr).call(this),this.updateResult(),o&&(b(this,ee)!==n||Ae(this.options.enabled,b(this,ee))!==Ae(r.enabled,b(this,ee))||vt(this.options.staleTime,b(this,ee))!==vt(r.staleTime,b(this,ee)))&&Z(this,re,Pn).call(this);const s=Z(this,re,Tn).call(this);o&&(b(this,ee)!==n||Ae(this.options.enabled,b(this,ee))!==Ae(r.enabled,b(this,ee))||s!==b(this,ft))&&Z(this,re,Fn).call(this,s)}getOptimisticResult(t){const r=b(this,Ee).getQueryCache().build(b(this,Ee),t),n=this.createResult(r,t);return jl(this,n)&&(B(this,ye,n),B(this,_t,this.options),B(this,It,b(this,ee).state)),n}getCurrentResult(){return b(this,ye)}trackResult(t,r){return new Proxy(t,{get:(n,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&b(this,rt).status==="pending"&&b(this,rt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,o))})}trackProp(t){b(this,Xt).add(t)}getCurrentQuery(){return b(this,ee)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=b(this,Ee).defaultQueryOptions(t),n=b(this,Ee).getQueryCache().build(b(this,Ee),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Z(this,re,cr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),b(this,ye)))}createResult(t,r){var d;const n=b(this,ee),o=this.options,s=b(this,ye),i=b(this,It),l=b(this,_t),u=t!==n?t.state:b(this,xr),{state:g}=t;let v={...g},S=!1,h;if(r._optimisticResults){const f=this.hasListeners(),E=!f&&Mo(t,r),y=f&&$o(t,n,r,o);(E||y)&&(v={...v,...ni(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:R,errorUpdatedAt:P,status:F}=v;h=v.data;let $=!1;if(r.placeholderData!==void 0&&h===void 0&&F==="pending"){let f;s!=null&&s.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(f=s.data,$=!0):f=typeof r.placeholderData=="function"?r.placeholderData((d=b(this,Yt))==null?void 0:d.state.data,b(this,Yt)):r.placeholderData,f!==void 0&&(F="success",h=On(s==null?void 0:s.data,f,r),S=!0)}if(r.select&&h!==void 0&&!$)if(s&&h===(i==null?void 0:i.data)&&r.select===b(this,Er))h=b(this,Kt);else try{B(this,Er,r.select),h=r.select(h),h=On(s==null?void 0:s.data,h,r),B(this,Kt,h),B(this,dt,null)}catch(f){B(this,dt,f)}b(this,dt)&&(R=b(this,dt),h=b(this,Kt),P=Date.now(),F="error");const C=v.fetchStatus==="fetching",j=F==="pending",D=F==="error",L=j&&C,U=h!==void 0,a={status:F,fetchStatus:v.fetchStatus,isPending:j,isSuccess:F==="success",isError:D,isInitialLoading:L,isLoading:L,data:h,dataUpdatedAt:v.dataUpdatedAt,error:R,errorUpdatedAt:P,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:v.dataUpdateCount>u.dataUpdateCount||v.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!j,isLoadingError:D&&!U,isPaused:v.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:D&&U,isStale:to(t,r),refetch:this.refetch,promise:b(this,rt),isEnabled:Ae(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const f=a.data!==void 0,E=a.status==="error"&&!f,y=m=>{E?m.reject(a.error):f&&m.resolve(a.data)},k=()=>{const m=B(this,rt,a.promise=An());y(m)},T=b(this,rt);switch(T.status){case"pending":t.queryHash===n.queryHash&&y(T);break;case"fulfilled":(E||a.data!==T.value)&&k();break;case"rejected":(!E||a.error!==T.reason)&&k();break}}return a}updateResult(){const t=b(this,ye),r=this.createResult(b(this,ee),this.options);if(B(this,It,b(this,ee).state),B(this,_t,this.options),b(this,It).data!==void 0&&B(this,Yt,b(this,ee)),kn(r,t))return;B(this,ye,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!b(this,Xt).size)return!0;const i=new Set(s??b(this,Xt));return this.options.throwOnError&&i.add("error"),Object.keys(b(this,ye)).some(l=>{const c=l;return b(this,ye)[c]!==t[c]&&i.has(c)})};Z(this,re,oi).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Z(this,re,Nn).call(this)}},Ee=new WeakMap,ee=new WeakMap,xr=new WeakMap,ye=new WeakMap,It=new WeakMap,_t=new WeakMap,rt=new WeakMap,dt=new WeakMap,Er=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,jt=new WeakMap,Mt=new WeakMap,ft=new WeakMap,Xt=new WeakMap,re=new WeakSet,cr=function(t){Z(this,re,Mn).call(this);let r=b(this,ee).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Se)),r},Pn=function(){Z(this,re,In).call(this);const t=vt(this.options.staleTime,b(this,ee));if(vr.isServer()||b(this,ye).isStale||!En(t))return;const n=Ys(b(this,ye).dataUpdatedAt,t)+1;B(this,jt,kt.setTimeout(()=>{b(this,ye).isStale||this.updateResult()},n))},Tn=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,ee)):this.options.refetchInterval)??!1},Fn=function(t){Z(this,re,jn).call(this),B(this,ft,t),!(vr.isServer()||Ae(this.options.enabled,b(this,ee))===!1||!En(b(this,ft))||b(this,ft)===0)&&B(this,Mt,kt.setInterval(()=>{(this.options.refetchIntervalInBackground||Zn.isFocused())&&Z(this,re,cr).call(this)},b(this,ft)))},Nn=function(){Z(this,re,Pn).call(this),Z(this,re,Fn).call(this,Z(this,re,Tn).call(this))},In=function(){b(this,jt)!==void 0&&(kt.clearTimeout(b(this,jt)),B(this,jt,void 0))},jn=function(){b(this,Mt)!==void 0&&(kt.clearInterval(b(this,Mt)),B(this,Mt,void 0))},Mn=function(){const t=b(this,Ee).getQueryCache().build(b(this,Ee),this.options);if(t===b(this,ee))return;const r=b(this,ee);B(this,ee,t),B(this,xr,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},oi=function(t){pe.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(b(this,ye))}),b(this,Ee).getQueryCache().notify({query:b(this,ee),type:"observerResultsUpdated"})})},Ps);function Il(e,t){return Ae(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ae(t.retryOnMount,e)===!1)}function Mo(e,t){return Il(e,t)||e.state.data!==void 0&&$n(e,t,t.refetchOnMount)}function $n(e,t,r){if(Ae(t.enabled,e)!==!1&&vt(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&to(e,t)}return!1}function $o(e,t,r,n){return(e!==t||Ae(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&to(e,r)}function to(e,t){return Ae(t.enabled,e)!==!1&&e.isStaleByTime(vt(t.staleTime,e))}function jl(e,t){return!kn(e.getCurrentResult(),t)}var Sr,qe,ge,$t,Ve,lt,Ts,Ml=(Ts=class extends ti{constructor(t){super();_(this,Ve);_(this,Sr);_(this,qe);_(this,ge);_(this,$t);B(this,Sr,t.client),this.mutationId=t.mutationId,B(this,ge,t.mutationCache),B(this,qe,[]),this.state=t.state||$l(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){b(this,qe).includes(t)||(b(this,qe).push(t),this.clearGcTimeout(),b(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){B(this,qe,b(this,qe).filter(r=>r!==t)),this.scheduleGc(),b(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){b(this,qe).length||(this.state.status==="pending"?this.scheduleGc():b(this,ge).remove(this))}continue(){var t;return((t=b(this,$t))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,l,c,u,g,v,S,h,R,P,F,$,C,j,D,L,U,Q;const r=()=>{Z(this,Ve,lt).call(this,{type:"continue"})},n={client:b(this,Sr),meta:this.options.meta,mutationKey:this.options.mutationKey};B(this,$t,ei({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,d)=>{Z(this,Ve,lt).call(this,{type:"failed",failureCount:a,error:d})},onPause:()=>{Z(this,Ve,lt).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>b(this,ge).canRun(this)}));const o=this.state.status==="pending",s=!b(this,$t).canStart();try{if(o)r();else{Z(this,Ve,lt).call(this,{type:"pending",variables:t,isPaused:s}),b(this,ge).config.onMutate&&await b(this,ge).config.onMutate(t,this,n);const d=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t,n));d!==this.state.context&&Z(this,Ve,lt).call(this,{type:"pending",context:d,variables:t,isPaused:s})}const a=await b(this,$t).start();return await((u=(c=b(this,ge).config).onSuccess)==null?void 0:u.call(c,a,t,this.state.context,this,n)),await((v=(g=this.options).onSuccess)==null?void 0:v.call(g,a,t,this.state.context,n)),await((h=(S=b(this,ge).config).onSettled)==null?void 0:h.call(S,a,null,this.state.variables,this.state.context,this,n)),await((P=(R=this.options).onSettled)==null?void 0:P.call(R,a,null,t,this.state.context,n)),Z(this,Ve,lt).call(this,{type:"success",data:a}),a}catch(a){try{await(($=(F=b(this,ge).config).onError)==null?void 0:$.call(F,a,t,this.state.context,this,n))}catch(d){Promise.reject(d)}try{await((j=(C=this.options).onError)==null?void 0:j.call(C,a,t,this.state.context,n))}catch(d){Promise.reject(d)}try{await((L=(D=b(this,ge).config).onSettled)==null?void 0:L.call(D,void 0,a,this.state.variables,this.state.context,this,n))}catch(d){Promise.reject(d)}try{await((Q=(U=this.options).onSettled)==null?void 0:Q.call(U,void 0,a,t,this.state.context,n))}catch(d){Promise.reject(d)}throw Z(this,Ve,lt).call(this,{type:"error",error:a}),a}finally{b(this,ge).runNext(this)}}},Sr=new WeakMap,qe=new WeakMap,ge=new WeakMap,$t=new WeakMap,Ve=new WeakSet,lt=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),pe.batch(()=>{b(this,qe).forEach(n=>{n.onMutationUpdate(t)}),b(this,ge).notify({mutation:this,type:"updated",action:t})})},Ts);function $l(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nt,De,kr,Fs,Dl=(Fs=class extends Cr{constructor(t={}){super();_(this,nt);_(this,De);_(this,kr);this.config=t,B(this,nt,new Set),B(this,De,new Map),B(this,kr,0)}build(t,r,n){const o=new Ml({client:t,mutationCache:this,mutationId:++Pr(this,kr)._,options:t.defaultMutationOptions(r),state:n});return this.add(o),o}add(t){b(this,nt).add(t);const r=Nr(t);if(typeof r=="string"){const n=b(this,De).get(r);n?n.push(t):b(this,De).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(b(this,nt).delete(t)){const r=Nr(t);if(typeof r=="string"){const n=b(this,De).get(r);if(n)if(n.length>1){const o=n.indexOf(t);o!==-1&&n.splice(o,1)}else n[0]===t&&b(this,De).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Nr(t);if(typeof r=="string"){const n=b(this,De).get(r),o=n==null?void 0:n.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var n;const r=Nr(t);if(typeof r=="string"){const o=(n=b(this,De).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pe.batch(()=>{b(this,nt).forEach(t=>{this.notify({type:"removed",mutation:t})}),b(this,nt).clear(),b(this,De).clear()})}getAll(){return Array.from(b(this,nt))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Po(r,n))}findAll(t={}){return this.getAll().filter(r=>Po(t,r))}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return pe.batch(()=>Promise.all(t.map(r=>r.continue().catch(Se))))}},nt=new WeakMap,De=new WeakMap,kr=new WeakMap,Fs);function Nr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Qe,Ns,Ll=(Ns=class extends Cr{constructor(t={}){super();_(this,Qe);this.config=t,B(this,Qe,new Map)}build(t,r,n){const o=r.queryKey,s=r.queryHash??eo(o,r);let i=this.get(s);return i||(i=new Fl({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){b(this,Qe).has(t.queryHash)||(b(this,Qe).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=b(this,Qe).get(t.queryHash);r&&(t.destroy(),r===t&&b(this,Qe).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return b(this,Qe).get(t)}getAll(){return[...b(this,Qe).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ro(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Ro(t,n)):r}notify(t){pe.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qe=new WeakMap,Ns),le,ht,pt,Jt,Zt,mt,er,tr,Is,Bl=(Is=class{constructor(e={}){_(this,le);_(this,ht);_(this,pt);_(this,Jt);_(this,Zt);_(this,mt);_(this,er);_(this,tr);B(this,le,e.queryCache||new Ll),B(this,ht,e.mutationCache||new Dl),B(this,pt,e.defaultOptions||{}),B(this,Jt,new Map),B(this,Zt,new Map),B(this,mt,0)}mount(){Pr(this,mt)._++,b(this,mt)===1&&(B(this,er,Zn.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onFocus())})),B(this,tr,qr.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(this,le).onOnline())})))}unmount(){var e,t;Pr(this,mt)._--,b(this,mt)===0&&((e=b(this,er))==null||e.call(this),B(this,er,void 0),(t=b(this,tr))==null||t.call(this),B(this,tr,void 0))}isFetching(e){return b(this,le).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return b(this,ht).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=b(this,le).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(vt(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return b(this,le).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=b(this,le).get(n.queryHash),s=o==null?void 0:o.state.data,i=yl(t,s);if(i!==void 0)return b(this,le).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return pe.batch(()=>b(this,le).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=b(this,le).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=b(this,le);pe.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=b(this,le);return pe.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=pe.batch(()=>b(this,le).findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(Se).catch(Se)}invalidateQueries(e,t={}){return pe.batch(()=>(b(this,le).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=pe.batch(()=>b(this,le).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(Se)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Se)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=b(this,le).build(this,t);return r.isStaleByTime(vt(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Se).catch(Se)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Se).catch(Se)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return qr.isOnline()?b(this,ht).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(this,le)}getMutationCache(){return b(this,ht)}getDefaultOptions(){return b(this,pt)}setDefaultOptions(e){B(this,pt,e)}setQueryDefaults(e,t){b(this,Jt).set(mr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...b(this,Jt).values()],r={};return t.forEach(n=>{gr(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){b(this,Zt).set(mr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...b(this,Zt).values()],r={};return t.forEach(n=>{gr(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...b(this,pt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=eo(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===Gr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(this,pt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(this,le).clear(),b(this,ht).clear()}},le=new WeakMap,ht=new WeakMap,pt=new WeakMap,Jt=new WeakMap,Zt=new WeakMap,mt=new WeakMap,er=new WeakMap,tr=new WeakMap,Is),si=V.createContext(void 0),ii=e=>{const t=V.useContext(si);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ro=({client:e,children:t})=>(V.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(si.Provider,{value:e,children:t})),Ul=V.createContext(!1),Wl=()=>V.useContext(Ul);function Hl(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var zl=V.createContext(Hl()),Gl=()=>V.useContext(zl),ql=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Js(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Vl=e=>{V.useEffect(()=>{e.clearReset()},[e])},Ql=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||Js(r,[e.error,n])),_l=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Kl=(e,t)=>e.isLoading&&e.isFetching&&!t,Yl=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Do=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Xl(e,t,r){var S,h,R,P;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Wl(),o=Gl(),s=ii(),i=s.defaultQueryOptions(e);(h=(S=s.getDefaultOptions().queries)==null?void 0:S._experimental_beforeQuery)==null||h.call(S,i);const l=s.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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`)),i._optimisticResults=n?"isRestoring":"optimistic",_l(i),ql(i,o,l),Vl(o);const c=!s.getQueryCache().get(i.queryHash),[u]=V.useState(()=>new t(s,i)),g=u.getOptimisticResult(i),v=!n&&e.subscribed!==!1;if(V.useSyncExternalStore(V.useCallback(F=>{const $=v?u.subscribe(pe.batchCalls(F)):Se;return u.updateResult(),$},[u,v]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),V.useEffect(()=>{u.setOptions(i)},[i,u]),Yl(i,g))throw Do(i,u,o);if(Ql({result:g,errorResetBoundary:o,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw g.error;if((P=(R=s.getDefaultOptions().queries)==null?void 0:R._experimental_afterQuery)==null||P.call(R,i,g),i.experimental_prefetchInRender&&!vr.isServer()&&Kl(g,n)){const F=c?Do(i,u,o):l==null?void 0:l.promise;F==null||F.catch(Se).finally(()=>{u.updateResult()})}return i.notifyOnChangeProps?g:u.trackResult(g)}function no(e,t){return Xl(e,Nl)}function ai(e){const[t,r]=p.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return p.useEffect(()=>{if(e!=="system")return;const n=window.matchMedia("(prefers-color-scheme: dark)");r(n.matches?"dark":"light");const o=s=>{r(s.matches?"dark":"light")};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),e==="system"?t:e}const Lo=["after-balance","after-accounts","after-wallet-info","before-actions","actions"],Jl={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]},Zl={activeAddress:null,activeWallet:null,theme:"system",resolvedTheme:"light",openDialog:()=>{},closeDialog:()=>{}},ec={menuItemsBySlot:Jl,dialogs:[],openDialog:()=>{},closeDialog:()=>{},openDialogs:new Set,panels:[],plugins:[],renderContext:Zl},li=p.createContext(void 0);function Or(){const e=p.useContext(li);return e||ec}function tc({plugins:e,ctx:t,children:r}){return e.reduceRight((n,o)=>o.Provider?w.jsx(o.Provider,{ctx:t,children:n}):n,r)}function rc(e){const t=p.useRef(e),r=t.current.map(o=>o.id).join("\0"),n=e.map(o=>o.id).join("\0");return r!==n&&(t.current=e),t.current}function nc({plugins:e,renderContext:t,children:r}){const n=rc(e);p.useMemo(()=>{if(process.env.NODE_ENV==="production")return;const h=new Set,R=new Set,P=new Set,F=new Set;for(const $ of n){h.has($.id)&&console.warn(`[WalletUI] Duplicate plugin ID: "${$.id}"`),h.add($.id);for(const C of $.menuItems??[])R.has(C.key)&&console.warn(`[WalletUI] Duplicate menu item key: "${C.key}" (plugin: "${$.id}")`),R.add(C.key);for(const C of $.dialogs??[])P.has(C.key)&&console.warn(`[WalletUI] Duplicate dialog key: "${C.key}" (plugin: "${$.id}")`),P.add(C.key);for(const C of $.panels??[])F.has(C.key)&&console.warn(`[WalletUI] Duplicate panel key: "${C.key}" (plugin: "${$.id}")`),F.add(C.key)}},[n]);const[o,s]=p.useState(new Set),i=p.useCallback(h=>{s(R=>{const P=new Set(R);return P.add(h),P})},[]),l=p.useCallback(h=>{s(R=>{const P=new Set(R);return P.delete(h),P})},[]),c=p.useMemo(()=>{const h={"after-balance":[],"after-accounts":[],"after-wallet-info":[],"before-actions":[],actions:[]};for(const R of n)if(R.menuItems)for(const P of R.menuItems)Lo.includes(P.slot)&&h[P.slot].push(P);for(const R of Lo)h[R].sort((P,F)=>(P.order??100)-(F.order??100));return h},[n]),u=p.useMemo(()=>n.flatMap(h=>h.dialogs??[]),[n]),g=p.useMemo(()=>n.flatMap(h=>h.panels??[]).sort((h,R)=>(h.order??100)-(R.order??100)),[n]),v=p.useMemo(()=>({...t,openDialog:i,closeDialog:l}),[t,i,l]),S=p.useMemo(()=>({menuItemsBySlot:c,dialogs:u,openDialog:i,closeDialog:l,openDialogs:o,panels:g,plugins:n,renderContext:v}),[c,u,i,l,o,g,n,v]);return w.jsx(li.Provider,{value:S,children:w.jsx(tc,{plugins:n,ctx:v,children:r})})}function oc(){const{dialogs:e,openDialogs:t,closeDialog:r,renderContext:n}=Or(),{queryClient:o,theme:s}=rr(),i=s==="system"?void 0:s;return w.jsx(w.Fragment,{children:e.map(l=>{const c=t.has(l.key);return c?w.jsx(K.FloatingPortal,{id:`wallet-plugin-${l.key}`,children:w.jsx(ro,{client:o,children:w.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":i,children:l.render({isOpen:c,onClose:()=>r(l.key),ctx:n})})})},l.key):null})})}function sn(e,t){try{const r=t();r&&typeof r.catch=="function"&&r.catch(n=>{console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,n)})}catch(r){console.error(`[WalletUI] Plugin "${e.id}" lifecycle hook error:`,r)}}function sc(){const{plugins:e,renderContext:t}=Or(),r=p.useRef(null),n=p.useRef(null);return p.useEffect(()=>{var l,c,u,g;const o=r.current,s=n.current,i=((l=t.activeWallet)==null?void 0:l.id)??null;if(!s&&i)for(const v of e)(c=v.lifecycle)!=null&&c.onConnect&&sn(v,()=>v.lifecycle.onConnect(t));if(s&&!i)for(const v of e)(u=v.lifecycle)!=null&&u.onDisconnect&&sn(v,()=>v.lifecycle.onDisconnect());if(i&&o&&t.activeAddress&&o!==t.activeAddress){for(const v of e)if((g=v.lifecycle)!=null&&g.onAccountChange){const S=t.activeAddress,h=o;sn(v,()=>v.lifecycle.onAccountChange(S,h,t))}}r.current=t.activeAddress,n.current=i},[t,e]),null}const Bo="wallet-ui-theme-styles",ic=`
14
14
  --wui-color-primary: #2d2df1;
15
15
  --wui-color-primary-hover: #2929d9;
16
16
  --wui-color-primary-text: #ffffff;
@@ -30,7 +30,7 @@
30
30
  --wui-color-danger-text: #b91c1c;
31
31
  --wui-color-avatar-bg: #e5e7eb;
32
32
  --wui-color-avatar-icon: #9ca3af;
33
- `,nn=`
33
+ `,an=`
34
34
  --wui-color-primary: #bfbff9;
35
35
  --wui-color-primary-hover: #d4d4fa;
36
36
  --wui-color-primary-text: #001324;
@@ -50,32 +50,32 @@
50
50
  --wui-color-danger-text: #fca5a5;
51
51
  --wui-color-avatar-bg: #192a39;
52
52
  --wui-color-avatar-icon: #6b7280;
53
- `;function Jl(){if(document.getElementById(Mo))return;const e=document.createElement("style");e.id=Mo,e.textContent=`
53
+ `;function ac(){if(document.getElementById(Bo))return;const e=document.createElement("style");e.id=Bo,e.textContent=`
54
54
  /* Light mode (default) */
55
55
  [data-wallet-theme] {
56
- ${Xl}
56
+ ${ic}
57
57
  }
58
58
 
59
59
  /* Dark mode via data-theme attribute (explicit) */
60
60
  [data-wallet-theme][data-theme='dark'] {
61
- ${nn}
61
+ ${an}
62
62
  }
63
63
 
64
64
  /* Dark mode via .dark class on ancestor (Tailwind convention) */
65
65
  .dark [data-wallet-theme]:not([data-theme='light']) {
66
- ${nn}
66
+ ${an}
67
67
  }
68
68
 
69
69
  /* Dark mode via system preference (when theme="system" or no explicit theme) */
70
70
  @media (prefers-color-scheme: dark) {
71
71
  [data-wallet-theme]:not([data-theme='light']):not([data-theme='dark']) {
72
- ${nn}
72
+ ${an}
73
73
  }
74
74
  }
75
- `,document.head.insertBefore(e,document.head.firstChild)}const Zl=()=>new Pl({defaultOptions:{queries:{staleTime:300*1e3,gcTime:3600*1e3,refetchOnWindowFocus:!0,refetchInterval:600*1e3,retry:(e,t)=>t instanceof Error&&t.message.includes("404")?!1:e<3}}}),ti=p.createContext(void 0);function ec({enabled:e,nfdView:t}){const r=Js(),{activeAddress:n,activeWallet:o,algodClient:s}=_e.useWallet(),{activeNetwork:i}=_e.useNetwork(),l=p.useRef(null);return p.useEffect(()=>{if(!e){l.current=n;return}const c=l.current===null&&n!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&s!==void 0;if(l.current=n,!c)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const d=o.accounts.map(g=>g.address);if(d.length>0){const v=[];for(let x=0;x<d.length;x+=20)v.push(d.slice(x,x+20));v.forEach(async x=>{const k=i==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",O=new URLSearchParams;x.forEach(F=>{O.append("address",F)}),O.append("view",t);try{const F=await fetch(`${k}/nfd/lookup?${O.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!F.ok&&F.status!==404)throw new Error(`NFD prefetch lookup failed: ${F.statusText}`);const N=F.status===404?{}:await F.json();x.forEach(S=>{const $=N[S]||null;r.setQueryData(["nfd",S,i,t],$)})}catch(F){console.error("Error prefetching NFD data:",F)}})}d.forEach(g=>{r.prefetchQuery({queryKey:["account-balance",g],queryFn:async()=>{try{const v=await s.accountInformation(g).do();return Number(v.amount)}catch(v){throw new Error(`Error fetching account balance: ${v}`)}}})})},[n,o,i,t,s,r,e]),null}function tc({children:e,queryClient:t,enablePrefetching:r=!0,prefetchNfdView:n="thumbnail",theme:o="system",plugins:s=[]}){const i=p.useMemo(()=>t||Zl(),[t]),l=Zs(o);p.useEffect(()=>{Jl()},[]);const c=p.useMemo(()=>({queryClient:i,theme:o,resolvedTheme:l}),[i,o,l]),d=o==="system"?void 0:o,g=P.jsx(ti.Provider,{value:c,children:P.jsxs("div",{"data-wallet-theme":!0,"data-theme":d,children:[P.jsx(ec,{enabled:r,nfdView:n}),P.jsx(rc,{plugins:s,children:e})]})});return t?g:P.jsx(Yn,{client:i,children:g})}function rc({plugins:e,children:t}){const{activeAddress:r,activeWallet:n}=_e.useWallet(),{theme:o,resolvedTheme:s}=tr(),i=p.useMemo(()=>({activeAddress:r,activeWallet:n,theme:o,resolvedTheme:s,openDialog:()=>{},closeDialog:()=>{}}),[r,n,o,s]);return e.length===0?P.jsx(P.Fragment,{children:t}):P.jsxs(_l,{plugins:e,renderContext:i,children:[P.jsx(Yl,{}),P.jsx(Kl,{}),t]})}function tr(){const e=p.useContext(ti);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function ri({wallets:e,handleWalletClick:t}){return P.jsxs("ul",{className:"space-y-1.5",children:[e.map(r=>P.jsx("li",{children:P.jsxs("button",{onClick:()=>t(r),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-[var(--wui-color-text)] transition-colors hover:bg-[var(--wui-color-bg-hover)] rounded-xl",children:[P.jsx("div",{className:"shrink-0 h-8 w-8 rounded-md overflow-hidden bg-[var(--wui-color-bg-secondary)] flex items-center justify-center",children:P.jsx("img",{src:r.metadata.icon,alt:`${r.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),P.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:r.metadata.name})]})},r.id)),e.length===0&&P.jsx("p",{className:"text-center text-[var(--wui-color-text-secondary)]",children:"No wallets found."})]})}function ni({children:e}){const[t,r]=p.useState(!1),[n,o]=p.useState(null),{wallets:s,availableWallets:i,activeAddress:l}=_e.useWallet(),{theme:c}=tr(),d=i??s,g=c==="system"?void 0:c,{refs:v,context:x}=K.useFloating({open:t,onOpenChange:f=>{f&&l||(f?(r(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{r(!1),o(null)},150)))}}),h=K.useClick(x),k=K.useDismiss(x,{outsidePressEvent:"mousedown"}),O=K.useRole(x,{role:"dialog"}),{getReferenceProps:F,getFloatingProps:N}=K.useInteractions([h,k,O]),S=K.useId(),$=K.useId(),j=async f=>{try{await f.connect(),x.onOpenChange(!1)}catch(E){console.error(`Error connecting to ${f.metadata.name}:`,E),x.onOpenChange(!1)}},B=f=>{l||x.onOpenChange(!0)},H=e||P.jsx(Vr,{}),Q=K.useMergeRefs([v.setReference,H.ref||null]),a={...F(),ref:Q,onClick:B},u=p.cloneElement(H,a);return P.jsxs(P.Fragment,{children:[u,P.jsx(K.FloatingPortal,{id:"wallet-dialog-portal",children:t&&P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":g,children:P.jsx(K.FloatingOverlay,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-[var(--wui-color-overlay)] data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":n,lockScroll:!0,children:P.jsx(K.FloatingFocusManager,{context:x,modal:!0,children:P.jsxs("div",{ref:v.setFloating,...N({"aria-labelledby":S,"aria-describedby":$}),role:"dialog","data-state":n,className:"w-full max-w-sm rounded-3xl bg-[var(--wui-color-bg)] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[P.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[P.jsx("h2",{id:S,className:"text-xl font-bold text-[var(--wui-color-text)] wallet-custom-font",children:"Connect a Wallet"}),P.jsx("button",{onClick:()=>x.onOpenChange(!1),className:"absolute right-4 rounded-full bg-[var(--wui-color-bg-tertiary)] p-2 text-[var(--wui-color-text-secondary)] hover:brightness-90 transition-all","aria-label":"Close dialog",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),P.jsx("div",{className:"px-4 pb-3",children:P.jsx(ri,{wallets:d,handleWalletClick:j})}),P.jsxs("div",{className:"px-6 py-5 border-t border-[var(--wui-color-border)] flex items-center justify-between",children:[P.jsx("span",{className:"text-[var(--wui-color-text-secondary)] text-sm",children:"Need an Algorand wallet?"}),P.jsx("a",{href:"https://algorand.co/wallets",className:"text-[var(--wui-color-link)] font-medium text-sm hover:text-[var(--wui-color-link-hover)]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})})]})}var nc=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,on=Math.ceil,Fe=Math.floor,xe="[BigNumber Error] ",No=xe+"Number primitive has more than 15 significant digits: ",je=1e14,Y=14,$o=9007199254740991,sn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],st=1e7,ke=1e9;function oi(e){var t,r,n,o=S.prototype={constructor:S,toString:null,valueOf:null},s=new S(1),i=20,l=4,c=-7,d=21,g=-1e7,v=1e7,x=!1,h=1,k=0,O={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function S(a,u){var f,E,y,C,A,m,w,T,R=this;if(!(R instanceof S))return new S(a,u);if(u==null){if(a&&a._isBigNumber===!0){R.s=a.s,!a.c||a.e>v?R.c=R.e=null:a.e<g?R.c=[R.e=0]:(R.e=a.e,R.c=a.c.slice());return}if((m=typeof a=="number")&&a*0==0){if(R.s=1/a<0?(a=-a,-1):1,a===~~a){for(C=0,A=a;A>=10;A/=10,C++);C>v?R.c=R.e=null:(R.e=C,R.c=[a]);return}T=String(a)}else{if(!nc.test(T=String(a)))return n(R,T,m);R.s=T.charCodeAt(0)==45?(T=T.slice(1),-1):1}(C=T.indexOf("."))>-1&&(T=T.replace(".","")),(A=T.search(/e/i))>0?(C<0&&(C=A),C+=+T.slice(A+1),T=T.substring(0,A)):C<0&&(C=T.length)}else{if(ie(u,2,F.length,"Base"),u==10&&N)return R=new S(a),H(R,i+R.e+1,l);if(T=String(a),m=typeof a=="number"){if(a*0!=0)return n(R,T,m,u);if(R.s=1/a<0?(T=T.slice(1),-1):1,S.DEBUG&&T.replace(/^0\.0*|\./,"").length>15)throw Error(No+a)}else R.s=T.charCodeAt(0)===45?(T=T.slice(1),-1):1;for(f=F.slice(0,u),C=A=0,w=T.length;A<w;A++)if(f.indexOf(E=T.charAt(A))<0){if(E=="."){if(A>C){C=w;continue}}else if(!y&&(T==T.toUpperCase()&&(T=T.toLowerCase())||T==T.toLowerCase()&&(T=T.toUpperCase()))){y=!0,A=-1,C=0;continue}return n(R,String(a),m,u)}m=!1,T=r(T,u,10,R.s),(C=T.indexOf("."))>-1?T=T.replace(".",""):C=T.length}for(A=0;T.charCodeAt(A)===48;A++);for(w=T.length;T.charCodeAt(--w)===48;);if(T=T.slice(A,++w)){if(w-=A,m&&S.DEBUG&&w>15&&(a>$o||a!==Fe(a)))throw Error(No+R.s*a);if((C=C-A-1)>v)R.c=R.e=null;else if(C<g)R.c=[R.e=0];else{if(R.e=C,R.c=[],A=(C+1)%Y,C<0&&(A+=Y),A<w){for(A&&R.c.push(+T.slice(0,A)),w-=Y;A<w;)R.c.push(+T.slice(A,A+=Y));A=Y-(T=T.slice(A)).length}else A-=w;for(;A--;T+="0");R.c.push(+T)}}else R.c=[R.e=0]}S.clone=oi,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(a){var u,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(u="DECIMAL_PLACES")&&(f=a[u],ie(f,0,ke,u),i=f),a.hasOwnProperty(u="ROUNDING_MODE")&&(f=a[u],ie(f,0,8,u),l=f),a.hasOwnProperty(u="EXPONENTIAL_AT")&&(f=a[u],f&&f.pop?(ie(f[0],-1e9,0,u),ie(f[1],0,ke,u),c=f[0],d=f[1]):(ie(f,-1e9,ke,u),c=-(d=f<0?-f:f))),a.hasOwnProperty(u="RANGE"))if(f=a[u],f&&f.pop)ie(f[0],-1e9,-1,u),ie(f[1],1,ke,u),g=f[0],v=f[1];else if(ie(f,-1e9,ke,u),f)g=-(v=f<0?-f:f);else throw Error(xe+u+" cannot be zero: "+f);if(a.hasOwnProperty(u="CRYPTO"))if(f=a[u],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))x=f;else throw x=!f,Error(xe+"crypto unavailable");else x=f;else throw Error(xe+u+" not true or false: "+f);if(a.hasOwnProperty(u="MODULO_MODE")&&(f=a[u],ie(f,0,9,u),h=f),a.hasOwnProperty(u="POW_PRECISION")&&(f=a[u],ie(f,0,ke,u),k=f),a.hasOwnProperty(u="FORMAT"))if(f=a[u],typeof f=="object")O=f;else throw Error(xe+u+" not an object: "+f);if(a.hasOwnProperty(u="ALPHABET"))if(f=a[u],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))N=f.slice(0,10)=="0123456789",F=f;else throw Error(xe+u+" invalid: "+f)}else throw Error(xe+"Object expected: "+a);return{DECIMAL_PLACES:i,ROUNDING_MODE:l,EXPONENTIAL_AT:[c,d],RANGE:[g,v],CRYPTO:x,MODULO_MODE:h,POW_PRECISION:k,FORMAT:O,ALPHABET:F}},S.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!S.DEBUG)return!0;var u,f,E=a.c,y=a.e,C=a.s;e:if({}.toString.call(E)=="[object Array]"){if((C===1||C===-1)&&y>=-1e9&&y<=ke&&y===Fe(y)){if(E[0]===0){if(y===0&&E.length===1)return!0;break e}if(u=(y+1)%Y,u<1&&(u+=Y),String(E[0]).length==u){for(u=0;u<E.length;u++)if(f=E[u],f<0||f>=je||f!==Fe(f))break e;if(f!==0)return!0}}}else if(E===null&&y===null&&(C===null||C===1||C===-1))return!0;throw Error(xe+"Invalid BigNumber: "+a)},S.maximum=S.max=function(){return j(arguments,-1)},S.minimum=S.min=function(){return j(arguments,1)},S.random=(function(){var a=9007199254740992,u=Math.random()*a&2097151?function(){return Fe(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var E,y,C,A,m,w=0,T=[],R=new S(s);if(f==null?f=i:ie(f,0,ke),A=on(f/Y),x)if(crypto.getRandomValues){for(E=crypto.getRandomValues(new Uint32Array(A*=2));w<A;)m=E[w]*131072+(E[w+1]>>>11),m>=9e15?(y=crypto.getRandomValues(new Uint32Array(2)),E[w]=y[0],E[w+1]=y[1]):(T.push(m%1e14),w+=2);w=A/2}else if(crypto.randomBytes){for(E=crypto.randomBytes(A*=7);w<A;)m=(E[w]&31)*281474976710656+E[w+1]*1099511627776+E[w+2]*4294967296+E[w+3]*16777216+(E[w+4]<<16)+(E[w+5]<<8)+E[w+6],m>=9e15?crypto.randomBytes(7).copy(E,w):(T.push(m%1e14),w+=7);w=A/7}else throw x=!1,Error(xe+"crypto unavailable");if(!x)for(;w<A;)m=u(),m<9e15&&(T[w++]=m%1e14);for(A=T[--w],f%=Y,A&&f&&(m=sn[Y-f],T[w]=Fe(A/m)*m);T[w]===0;T.pop(),w--);if(w<0)T=[C=0];else{for(C=-1;T[0]===0;T.splice(0,1),C-=Y);for(w=1,m=T[0];m>=10;m/=10,w++);w<Y&&(C-=Y-w)}return R.e=C,R.c=T,R}})(),S.sum=function(){for(var a=1,u=arguments,f=new S(u[0]);a<u.length;)f=f.plus(u[a++]);return f},r=(function(){var a="0123456789";function u(f,E,y,C){for(var A,m=[0],w,T=0,R=f.length;T<R;){for(w=m.length;w--;m[w]*=E);for(m[0]+=C.indexOf(f.charAt(T++)),A=0;A<m.length;A++)m[A]>y-1&&(m[A+1]==null&&(m[A+1]=0),m[A+1]+=m[A]/y|0,m[A]%=y)}return m.reverse()}return function(f,E,y,C,A){var m,w,T,R,I,M,W,q,J=f.indexOf("."),ne=i,L=l;for(J>=0&&(R=k,k=0,f=f.replace(".",""),q=new S(E),M=q.pow(f.length-J),k=R,q.c=u(Je(Te(M.c),M.e,"0"),10,y,a),q.e=q.c.length),W=u(f,E,y,A?(m=F,a):(m=a,F)),T=R=W.length;W[--R]==0;W.pop());if(!W[0])return m.charAt(0);if(J<0?--T:(M.c=W,M.e=T,M.s=C,M=t(M,q,ne,L,y),W=M.c,I=M.r,T=M.e),w=T+ne+1,J=W[w],R=y/2,I=I||w<0||W[w+1]!=null,I=L<4?(J!=null||I)&&(L==0||L==(M.s<0?3:2)):J>R||J==R&&(L==4||I||L==6&&W[w-1]&1||L==(M.s<0?8:7)),w<1||!W[0])f=I?Je(m.charAt(1),-ne,m.charAt(0)):m.charAt(0);else{if(W.length=w,I)for(--y;++W[--w]>y;)W[w]=0,w||(++T,W=[1].concat(W));for(R=W.length;!W[--R];);for(J=0,f="";J<=R;f+=m.charAt(W[J++]));f=Je(f,T,m.charAt(0))}return f}})(),t=(function(){function a(E,y,C){var A,m,w,T,R=0,I=E.length,M=y%st,W=y/st|0;for(E=E.slice();I--;)w=E[I]%st,T=E[I]/st|0,A=W*w+T*M,m=M*w+A%st*st+R,R=(m/C|0)+(A/st|0)+W*T,E[I]=m%C;return R&&(E=[R].concat(E)),E}function u(E,y,C,A){var m,w;if(C!=A)w=C>A?1:-1;else for(m=w=0;m<C;m++)if(E[m]!=y[m]){w=E[m]>y[m]?1:-1;break}return w}function f(E,y,C,A){for(var m=0;C--;)E[C]-=m,m=E[C]<y[C]?1:0,E[C]=m*A+E[C]-y[C];for(;!E[0]&&E.length>1;E.splice(0,1));}return function(E,y,C,A,m){var w,T,R,I,M,W,q,J,ne,L,D,te,$e,se,Lt,be,Ue,me=E.s==y.s?1:-1,ue=E.c,ae=y.c;if(!ue||!ue[0]||!ae||!ae[0])return new S(!E.s||!y.s||(ue?ae&&ue[0]==ae[0]:!ae)?NaN:ue&&ue[0]==0||!ae?me*0:me/0);for(J=new S(me),ne=J.c=[],T=E.e-y.e,me=C+T+1,m||(m=je,T=Ie(E.e/Y)-Ie(y.e/Y),me=me/Y|0),R=0;ae[R]==(ue[R]||0);R++);if(ae[R]>(ue[R]||0)&&T--,me<0)ne.push(1),I=!0;else{for(se=ue.length,be=ae.length,R=0,me+=2,M=Fe(m/(ae[0]+1)),M>1&&(ae=a(ae,M,m),ue=a(ue,M,m),be=ae.length,se=ue.length),$e=be,L=ue.slice(0,be),D=L.length;D<be;L[D++]=0);Ue=ae.slice(),Ue=[0].concat(Ue),Lt=ae[0],ae[1]>=m/2&&Lt++;do{if(M=0,w=u(ae,L,be,D),w<0){if(te=L[0],be!=D&&(te=te*m+(L[1]||0)),M=Fe(te/Lt),M>1)for(M>=m&&(M=m-1),W=a(ae,M,m),q=W.length,D=L.length;u(W,L,q,D)==1;)M--,f(W,be<q?Ue:ae,q,m),q=W.length,w=1;else M==0&&(w=M=1),W=ae.slice(),q=W.length;if(q<D&&(W=[0].concat(W)),f(L,W,D,m),D=L.length,w==-1)for(;u(ae,L,be,D)<1;)M++,f(L,be<D?Ue:ae,D,m),D=L.length}else w===0&&(M++,L=[0]);ne[R++]=M,L[0]?L[D++]=ue[$e]||0:(L=[ue[$e]],D=1)}while(($e++<se||L[0]!=null)&&me--);I=L[0]!=null,ne[0]||ne.splice(0,1)}if(m==je){for(R=1,me=ne[0];me>=10;me/=10,R++);H(J,C+(J.e=R+T*Y-1)+1,A,I)}else J.e=T,J.r=+I;return J}})();function $(a,u,f,E){var y,C,A,m,w;if(f==null?f=l:ie(f,0,8),!a.c)return a.toString();if(y=a.c[0],A=a.e,u==null)w=Te(a.c),w=E==1||E==2&&(A<=c||A>=d)?Ir(w,A):Je(w,A,"0");else if(a=H(new S(a),u,f),C=a.e,w=Te(a.c),m=w.length,E==1||E==2&&(u<=C||C<=c)){for(;m<u;w+="0",m++);w=Ir(w,C)}else if(u-=A,w=Je(w,C,"0"),C+1>m){if(--u>0)for(w+=".";u--;w+="0");}else if(u+=C-m,u>0)for(C+1==m&&(w+=".");u--;w+="0");return a.s<0&&y?"-"+w:w}function j(a,u){for(var f,E,y=1,C=new S(a[0]);y<a.length;y++)E=new S(a[y]),(!E.s||(f=wt(C,E))===u||f===0&&C.s===u)&&(C=E);return C}function B(a,u,f){for(var E=1,y=u.length;!u[--y];u.pop());for(y=u[0];y>=10;y/=10,E++);return(f=E+f*Y-1)>v?a.c=a.e=null:f<g?a.c=[a.e=0]:(a.e=f,a.c=u),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,f=/^\.([^.]+)$/,E=/^-?(Infinity|NaN)$/,y=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(C,A,m,w){var T,R=m?A:A.replace(y,"");if(E.test(R))C.s=isNaN(R)?null:R<0?-1:1;else{if(!m&&(R=R.replace(a,function(I,M,W){return T=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!w||w==T?M:I}),w&&(T=w,R=R.replace(u,"$1").replace(f,"0.$1")),A!=R))return new S(R,T);if(S.DEBUG)throw Error(xe+"Not a"+(w?" base "+w:"")+" number: "+A);C.s=null}C.c=C.e=null}})();function H(a,u,f,E){var y,C,A,m,w,T,R,I=a.c,M=sn;if(I){e:{for(y=1,m=I[0];m>=10;m/=10,y++);if(C=u-y,C<0)C+=Y,A=u,w=I[T=0],R=Fe(w/M[y-A-1]%10);else if(T=on((C+1)/Y),T>=I.length)if(E){for(;I.length<=T;I.push(0));w=R=0,y=1,C%=Y,A=C-Y+1}else break e;else{for(w=m=I[T],y=1;m>=10;m/=10,y++);C%=Y,A=C-Y+y,R=A<0?0:Fe(w/M[y-A-1]%10)}if(E=E||u<0||I[T+1]!=null||(A<0?w:w%M[y-A-1]),E=f<4?(R||E)&&(f==0||f==(a.s<0?3:2)):R>5||R==5&&(f==4||E||f==6&&(C>0?A>0?w/M[y-A]:0:I[T-1])%10&1||f==(a.s<0?8:7)),u<1||!I[0])return I.length=0,E?(u-=a.e+1,I[0]=M[(Y-u%Y)%Y],a.e=-u||0):I[0]=a.e=0,a;if(C==0?(I.length=T,m=1,T--):(I.length=T+1,m=M[Y-C],I[T]=A>0?Fe(w/M[y-A]%M[A])*m:0),E)for(;;)if(T==0){for(C=1,A=I[0];A>=10;A/=10,C++);for(A=I[0]+=m,m=1;A>=10;A/=10,m++);C!=m&&(a.e++,I[0]==je&&(I[0]=1));break}else{if(I[T]+=m,I[T]!=je)break;I[T--]=0,m=1}for(C=I.length;I[--C]===0;I.pop());}a.e>v?a.c=a.e=null:a.e<g&&(a.c=[a.e=0])}return a}function Q(a){var u,f=a.e;return f===null?a.toString():(u=Te(a.c),u=f<=c||f>=d?Ir(u,f):Je(u,f,"0"),a.s<0?"-"+u:u)}return o.absoluteValue=o.abs=function(){var a=new S(this);return a.s<0&&(a.s=1),a},o.comparedTo=function(a,u){return wt(this,new S(a,u))},o.decimalPlaces=o.dp=function(a,u){var f,E,y,C=this;if(a!=null)return ie(a,0,ke),u==null?u=l:ie(u,0,8),H(new S(C),a+C.e+1,u);if(!(f=C.c))return null;if(E=((y=f.length-1)-Ie(this.e/Y))*Y,y=f[y])for(;y%10==0;y/=10,E--);return E<0&&(E=0),E},o.dividedBy=o.div=function(a,u){return t(this,new S(a,u),i,l)},o.dividedToIntegerBy=o.idiv=function(a,u){return t(this,new S(a,u),0,1)},o.exponentiatedBy=o.pow=function(a,u){var f,E,y,C,A,m,w,T,R,I=this;if(a=new S(a),a.c&&!a.isInteger())throw Error(xe+"Exponent not an integer: "+Q(a));if(u!=null&&(u=new S(u)),m=a.e>14,!I.c||!I.c[0]||I.c[0]==1&&!I.e&&I.c.length==1||!a.c||!a.c[0])return R=new S(Math.pow(+Q(I),m?a.s*(2-Fr(a)):+Q(a))),u?R.mod(u):R;if(w=a.s<0,u){if(u.c?!u.c[0]:!u.s)return new S(NaN);E=!w&&I.isInteger()&&u.isInteger(),E&&(I=I.mod(u))}else{if(a.e>9&&(I.e>0||I.e<-1||(I.e==0?I.c[0]>1||m&&I.c[1]>=24e7:I.c[0]<8e13||m&&I.c[0]<=9999975e7)))return C=I.s<0&&Fr(a)?-0:0,I.e>-1&&(C=1/C),new S(w?1/C:C);k&&(C=on(k/Y+2))}for(m?(f=new S(.5),w&&(a.s=1),T=Fr(a)):(y=Math.abs(+Q(a)),T=y%2),R=new S(s);;){if(T){if(R=R.times(I),!R.c)break;C?R.c.length>C&&(R.c.length=C):E&&(R=R.mod(u))}if(y){if(y=Fe(y/2),y===0)break;T=y%2}else if(a=a.times(f),H(a,a.e+1,1),a.e>14)T=Fr(a);else{if(y=+Q(a),y===0)break;T=y%2}I=I.times(I),C?I.c&&I.c.length>C&&(I.c.length=C):E&&(I=I.mod(u))}return E?R:(w&&(R=s.div(R)),u?R.mod(u):C?H(R,k,l,A):R)},o.integerValue=function(a){var u=new S(this);return a==null?a=l:ie(a,0,8),H(u,u.e+1,a)},o.isEqualTo=o.eq=function(a,u){return wt(this,new S(a,u))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(a,u){return wt(this,new S(a,u))>0},o.isGreaterThanOrEqualTo=o.gte=function(a,u){return(u=wt(this,new S(a,u)))===1||u===0},o.isInteger=function(){return!!this.c&&Ie(this.e/Y)>this.c.length-2},o.isLessThan=o.lt=function(a,u){return wt(this,new S(a,u))<0},o.isLessThanOrEqualTo=o.lte=function(a,u){return(u=wt(this,new S(a,u)))===-1||u===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(a,u){var f,E,y,C,A=this,m=A.s;if(a=new S(a,u),u=a.s,!m||!u)return new S(NaN);if(m!=u)return a.s=-u,A.plus(a);var w=A.e/Y,T=a.e/Y,R=A.c,I=a.c;if(!w||!T){if(!R||!I)return R?(a.s=-u,a):new S(I?A:NaN);if(!R[0]||!I[0])return I[0]?(a.s=-u,a):new S(R[0]?A:l==3?-0:0)}if(w=Ie(w),T=Ie(T),R=R.slice(),m=w-T){for((C=m<0)?(m=-m,y=R):(T=w,y=I),y.reverse(),u=m;u--;y.push(0));y.reverse()}else for(E=(C=(m=R.length)<(u=I.length))?m:u,m=u=0;u<E;u++)if(R[u]!=I[u]){C=R[u]<I[u];break}if(C&&(y=R,R=I,I=y,a.s=-a.s),u=(E=I.length)-(f=R.length),u>0)for(;u--;R[f++]=0);for(u=je-1;E>m;){if(R[--E]<I[E]){for(f=E;f&&!R[--f];R[f]=u);--R[f],R[E]+=je}R[E]-=I[E]}for(;R[0]==0;R.splice(0,1),--T);return R[0]?B(a,R,T):(a.s=l==3?-1:1,a.c=[a.e=0],a)},o.modulo=o.mod=function(a,u){var f,E,y=this;return a=new S(a,u),!y.c||!a.s||a.c&&!a.c[0]?new S(NaN):!a.c||y.c&&!y.c[0]?new S(y):(h==9?(E=a.s,a.s=1,f=t(y,a,0,3),a.s=E,f.s*=E):f=t(y,a,0,h),a=y.minus(f.times(a)),!a.c[0]&&h==1&&(a.s=y.s),a)},o.multipliedBy=o.times=function(a,u){var f,E,y,C,A,m,w,T,R,I,M,W,q,J,ne,L=this,D=L.c,te=(a=new S(a,u)).c;if(!D||!te||!D[0]||!te[0])return!L.s||!a.s||D&&!D[0]&&!te||te&&!te[0]&&!D?a.c=a.e=a.s=null:(a.s*=L.s,!D||!te?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(E=Ie(L.e/Y)+Ie(a.e/Y),a.s*=L.s,w=D.length,I=te.length,w<I&&(q=D,D=te,te=q,y=w,w=I,I=y),y=w+I,q=[];y--;q.push(0));for(J=je,ne=st,y=I;--y>=0;){for(f=0,M=te[y]%ne,W=te[y]/ne|0,A=w,C=y+A;C>y;)T=D[--A]%ne,R=D[A]/ne|0,m=W*T+R*M,T=M*T+m%ne*ne+q[C]+f,f=(T/J|0)+(m/ne|0)+W*R,q[C--]=T%J;q[C]=f}return f?++E:q.splice(0,1),B(a,q,E)},o.negated=function(){var a=new S(this);return a.s=-a.s||null,a},o.plus=function(a,u){var f,E=this,y=E.s;if(a=new S(a,u),u=a.s,!y||!u)return new S(NaN);if(y!=u)return a.s=-u,E.minus(a);var C=E.e/Y,A=a.e/Y,m=E.c,w=a.c;if(!C||!A){if(!m||!w)return new S(y/0);if(!m[0]||!w[0])return w[0]?a:new S(m[0]?E:y*0)}if(C=Ie(C),A=Ie(A),m=m.slice(),y=C-A){for(y>0?(A=C,f=w):(y=-y,f=m),f.reverse();y--;f.push(0));f.reverse()}for(y=m.length,u=w.length,y-u<0&&(f=w,w=m,m=f,u=y),y=0;u;)y=(m[--u]=m[u]+w[u]+y)/je|0,m[u]=je===m[u]?0:m[u]%je;return y&&(m=[y].concat(m),++A),B(a,m,A)},o.precision=o.sd=function(a,u){var f,E,y,C=this;if(a!=null&&a!==!!a)return ie(a,1,ke),u==null?u=l:ie(u,0,8),H(new S(C),a,u);if(!(f=C.c))return null;if(y=f.length-1,E=y*Y+1,y=f[y]){for(;y%10==0;y/=10,E--);for(y=f[0];y>=10;y/=10,E++);}return a&&C.e+1>E&&(E=C.e+1),E},o.shiftedBy=function(a){return ie(a,-9007199254740991,$o),this.times("1e"+a)},o.squareRoot=o.sqrt=function(){var a,u,f,E,y,C=this,A=C.c,m=C.s,w=C.e,T=i+4,R=new S("0.5");if(m!==1||!A||!A[0])return new S(!m||m<0&&(!A||A[0])?NaN:A?C:1/0);if(m=Math.sqrt(+Q(C)),m==0||m==1/0?(u=Te(A),(u.length+w)%2==0&&(u+="0"),m=Math.sqrt(+u),w=Ie((w+1)/2)-(w<0||w%2),m==1/0?u="5e"+w:(u=m.toExponential(),u=u.slice(0,u.indexOf("e")+1)+w),f=new S(u)):f=new S(m+""),f.c[0]){for(w=f.e,m=w+T,m<3&&(m=0);;)if(y=f,f=R.times(y.plus(t(C,y,T,1))),Te(y.c).slice(0,m)===(u=Te(f.c)).slice(0,m))if(f.e<w&&--m,u=u.slice(m-3,m+1),u=="9999"||!E&&u=="4999"){if(!E&&(H(y,y.e+i+2,0),y.times(y).eq(C))){f=y;break}T+=4,m+=4,E=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(H(f,f.e+i+2,1),a=!f.times(f).eq(C));break}}return H(f,f.e+i+1,l,a)},o.toExponential=function(a,u){return a!=null&&(ie(a,0,ke),a++),$(this,a,u,1)},o.toFixed=function(a,u){return a!=null&&(ie(a,0,ke),a=a+this.e+1),$(this,a,u)},o.toFormat=function(a,u,f){var E,y=this;if(f==null)a!=null&&u&&typeof u=="object"?(f=u,u=null):a&&typeof a=="object"?(f=a,a=u=null):f=O;else if(typeof f!="object")throw Error(xe+"Argument not an object: "+f);if(E=y.toFixed(a,u),y.c){var C,A=E.split("."),m=+f.groupSize,w=+f.secondaryGroupSize,T=f.groupSeparator||"",R=A[0],I=A[1],M=y.s<0,W=M?R.slice(1):R,q=W.length;if(w&&(C=m,m=w,w=C,q-=C),m>0&&q>0){for(C=q%m||m,R=W.substr(0,C);C<q;C+=m)R+=T+W.substr(C,m);w>0&&(R+=T+W.slice(C)),M&&(R="-"+R)}E=I?R+(f.decimalSeparator||"")+((w=+f.fractionGroupSize)?I.replace(new RegExp("\\d{"+w+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):I):R}return(f.prefix||"")+E+(f.suffix||"")},o.toFraction=function(a){var u,f,E,y,C,A,m,w,T,R,I,M,W=this,q=W.c;if(a!=null&&(m=new S(a),!m.isInteger()&&(m.c||m.s!==1)||m.lt(s)))throw Error(xe+"Argument "+(m.isInteger()?"out of range: ":"not an integer: ")+Q(m));if(!q)return new S(W);for(u=new S(s),T=f=new S(s),E=w=new S(s),M=Te(q),C=u.e=M.length-W.e-1,u.c[0]=sn[(A=C%Y)<0?Y+A:A],a=!a||m.comparedTo(u)>0?C>0?u:T:m,A=v,v=1/0,m=new S(M),w.c[0]=0;R=t(m,u,0,1),y=f.plus(R.times(E)),y.comparedTo(a)!=1;)f=E,E=y,T=w.plus(R.times(y=T)),w=y,u=m.minus(R.times(y=u)),m=y;return y=t(a.minus(f),E,0,1),w=w.plus(y.times(T)),f=f.plus(y.times(E)),w.s=T.s=W.s,C=C*2,I=t(T,E,C,l).minus(W).abs().comparedTo(t(w,f,C,l).minus(W).abs())<1?[T,E]:[w,f],v=A,I},o.toNumber=function(){return+Q(this)},o.toPrecision=function(a,u){return a!=null&&ie(a,1,ke),$(this,a,u,2)},o.toString=function(a){var u,f=this,E=f.s,y=f.e;return y===null?E?(u="Infinity",E<0&&(u="-"+u)):u="NaN":(a==null?u=y<=c||y>=d?Ir(Te(f.c),y):Je(Te(f.c),y,"0"):a===10&&N?(f=H(new S(f),i+y+1,l),u=Je(Te(f.c),f.e,"0")):(ie(a,2,F.length,"Base"),u=r(Je(Te(f.c),y,"0"),10,a,E,!0)),E<0&&f.c[0]&&(u="-"+u)),u},o.valueOf=o.toJSON=function(){return Q(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&S.set(e),S}function Ie(e){var t=e|0;return e>0||e===t?t:t-1}function Te(e){for(var t,r,n=1,o=e.length,s=e[0]+"";n<o;){for(t=e[n++]+"",r=Y-t.length;r--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function wt(e,t){var r,n,o=e.c,s=t.c,i=e.s,l=t.s,c=e.e,d=t.e;if(!i||!l)return null;if(r=o&&!o[0],n=s&&!s[0],r||n)return r?n?0:-l:i;if(i!=l)return i;if(r=i<0,n=c==d,!o||!s)return n?0:!o^r?1:-1;if(!n)return c>d^r?1:-1;for(l=(c=o.length)<(d=s.length)?c:d,i=0;i<l;i++)if(o[i]!=s[i])return o[i]>s[i]^r?1:-1;return c==d?0:c>d^r?1:-1}function ie(e,t,r,n){if(e<t||e>r||e!==Fe(e))throw Error(xe+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Fr(e){var t=e.c.length-1;return Ie(e.e/Y)==t&&e.c[t]%2!=0}function Ir(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Je(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(n=e.length,++t>n){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}oi();const oc=100000n,sc=(e,t={})=>{const{style:r="decimal",compact:n=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,l=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),c=n==="auto"?l>=oc:n,d=typeof i=="bigint"?Number(i):i,g=s&&d!==0&&Math.abs(d)<Math.pow(10,-(o??2)),v=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:g?20:o??2,minimumFractionDigits:g?0:o??2});if(!c)return g?v.format(jo(d)):v.format(i);const x=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(h=>l>=h.threshold);if(x){const h=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),k=Number(i)/x.divisor;return h.format(k)+x.suffix}return g?v.format(jo(d)):v.format(i)};function jo(e){if(e===0)return 0;const t=e.toExponential().split("e"),r=parseInt(t[1]),n=Math.abs(r);return Number(e.toFixed(n))}function lr(e,t=5,r=5){return e?e.length<=t+r?e:`${e.slice(0,t)}...${e.slice(-r)}`:""}function Jn(e={}){const{activeAddress:t}=_e.useWallet(),{activeNetwork:r}=_e.useNetwork(),{enabled:n=!0,view:o="thumbnail"}=e;return Xn({queryKey:["nfd",t,r,o],queryFn:async({signal:s})=>{if(!t)return null;const c=await fetch(`${r==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains"}/nfd/lookup?address=${encodeURIComponent(t)}&view=${o}`,{method:"GET",headers:{Accept:"application/json"},signal:s});if(c.status===404)return null;if(!c.ok)throw new Error(`NFD lookup failed: ${c.statusText}`);return(await c.json())[t]},enabled:n&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const ic="https://ipfs.algonode.dev";function Do(e){const t=e.trim();if(t.startsWith("ipfs://")){const r=t.slice(7);return r.length>0?r:null}try{const r=new URL(t);if(r.protocol!=="http:"&&r.protocol!=="https:")return null;const n="/ipfs/",o=r.pathname.indexOf(n);if(o===-1)return null;const s=r.pathname.slice(o+n.length);return s.length>0?s:null}catch{return null}}const si=async e=>{const t=Do(e);if(!t)return e;const r=`https://images.nf.domains/ipfs/${t}`,n=`${ic}/ipfs/${t}`,o=s=>s.startsWith("image/");try{const s=await fetch(r,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return r}}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}try{const s=await fetch(n,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return n;if(i==="application/json")try{const d=(await(await fetch(n)).json()).image;if(typeof d=="string"&&d.length>0){if(Do(d))return await si(d);if(d.startsWith("http"))try{const g=await fetch(d,{method:"HEAD"});if(g.ok){const v=g.headers.get("content-type");if(v&&o(v))return d}}catch{console.error("Error checking HTTP image URL")}}}catch{console.error("Error processing JSON metadata")}}}catch{console.error(`Error checking gateway for CID ${t}`)}return n};function Zn({nfd:e,alt:t,className:r,size:n=40,fallback:o,lightOnly:s=!1}){var g,v,x,h;const i=((v=(g=e==null?void 0:e.properties)==null?void 0:g.userDefined)==null?void 0:v.avatar)||((h=(x=e==null?void 0:e.properties)==null?void 0:x.verified)==null?void 0:h.avatar)||null,l=t||(e==null?void 0:e.name)||"NFD Avatar",{data:c,isLoading:d}=Xn({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await si(i):i:null,enabled:!!i,staleTime:3600*1e3,gcTime:1440*60*1e3});return d||!c?o?P.jsx(P.Fragment,{children:o}):P.jsx("div",{"data-wallet-ui":!0,className:er("flex items-center justify-center rounded-full",r),style:{width:`${n}px`,height:`${n}px`,backgroundColor:s?"#e5e7eb":"var(--wui-color-avatar-bg)"},"aria-label":l,role:"img",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:{width:`${Math.max(n/2,12)}px`,height:`${Math.max(n/2,12)}px`,color:s?"#9ca3af":"var(--wui-color-avatar-icon)"},children:P.jsx("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"})})}):P.jsx("img",{src:c,alt:l,className:er("rounded-full",r),style:{width:`${n}px`,height:`${n}px`,objectFit:"cover"},loading:"lazy"})}const ac={sm:"py-1.5 pl-2 md:pl-2.5 pr-2 text-sm rounded-lg",md:"py-2.5 pl-3 md:pl-3.5 pr-3 text-base rounded-xl",lg:"py-3 pl-3.5 md:pl-4 pr-3.5 text-lg rounded-xl"},lc={sm:20,md:24,lg:28},cc={sm:"mr-1 md:mr-1.5 h-5 w-5",md:"mr-1 md:mr-2 h-6 w-6",lg:"mr-1.5 md:mr-2.5 h-7 w-7"},Lo={sm:{width:14,height:14},md:{width:18,height:18},lg:{width:20,height:20}},Qr=p.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>{var g;const{activeAddress:i}=_e.useWallet(),l=Jn({enabled:!!i}),c=((g=l.data)==null?void 0:g.name)??null;return P.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:er("flex items-center bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] cursor-pointer font-bold",ac[n],e),style:r,disabled:!1,...o,type:"button",children:t||P.jsxs("div",{className:"flex items-center",children:[i&&P.jsx("div",{className:er("overflow-hidden",cc[n]),children:P.jsx(Zn,{nfd:l.data,alt:`${c||i} avatar`,size:lc[n],lightOnly:!0})}),P.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:c||(i?lr(i,6,4):"Connect")}),i&&P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Lo[n].width,height:Lo[n].height,viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:P.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})});Qr.displayName="ConnectedWalletButton";const ii=typeof document<"u"?p.useLayoutEffect:()=>{};function uc(e){const t=p.useRef(null);return ii(()=>{t.current=e},[e]),p.useCallback((...r)=>{const n=t.current;return n==null?void 0:n(...r)},[])}const bt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},St=e=>e&&"window"in e&&e.window===e?e:bt(e).defaultView||window;function dc(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function fc(e){return dc(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let hc=!1;function eo(){return hc}function ai(e,t){if(!eo())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:fc(r)?r=r.host:r=r.parentNode}return!1}const Nn=(e=document)=>{var t;if(!eo())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function li(e){return eo()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function _r(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(r=>e.test(r.brand)))||e.test(window.navigator.userAgent)}function to(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function rt(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const ro=rt(function(){return to(/^Mac/i)}),pc=rt(function(){return to(/^iPhone/i)}),mc=rt(function(){return to(/^iPad/i)||ro()&&navigator.maxTouchPoints>1}),gc=rt(function(){return pc()||mc()});rt(function(){return ro()||gc()});rt(function(){return _r(/AppleWebKit/i)&&!vc()});const vc=rt(function(){return _r(/Chrome/i)}),bc=rt(function(){return _r(/Android/i)});rt(function(){return _r(/Firefox/i)});function ci(){let e=p.useRef(new Map),t=p.useCallback((o,s,i,l)=>{let c=l!=null&&l.once?(...d)=>{e.current.delete(i),i(...d)}:i;e.current.set(i,{type:s,eventTarget:o,fn:c,options:l}),o.addEventListener(s,c,l)},[]),r=p.useCallback((o,s,i,l)=>{var c;let d=((c=e.current.get(i))===null||c===void 0?void 0:c.fn)||i;o.removeEventListener(s,d,l),e.current.delete(i)},[]),n=p.useCallback(()=>{e.current.forEach((o,s)=>{r(o.eventTarget,o.type,s,o.options)})},[r]);return p.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function yc(e){return e.mozInputSource===0&&e.isTrusted?!0:bc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ui(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function wc(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function di(e){let t=p.useRef({isFocused:!1,observer:null});ii(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=uc(n=>{e==null||e(n)});return p.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=n.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let l=ui(i);r(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let l=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let xc=!1,kr=null,$n=new Set,dr=new Map,jt=!1,jn=!1;const Ec={Tab:!0,Escape:!0};function no(e,t){for(let r of $n)r(e,t)}function Sc(e){return!(e.metaKey||!ro()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function zr(e){jt=!0,Sc(e)&&(kr="keyboard",no("keyboard",e))}function Ne(e){kr="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(jt=!0,no("pointer",e))}function fi(e){yc(e)&&(jt=!0,kr="virtual")}function hi(e){e.target===window||e.target===document||xc||!e.isTrusted||(!jt&&!jn&&(kr="virtual",no("virtual",e)),jt=!1,jn=!1)}function pi(){jt=!1,jn=!0}function Dn(e){if(typeof window>"u"||typeof document>"u"||dr.get(St(e)))return;const t=St(e),r=bt(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){jt=!0,n.apply(this,arguments)},r.addEventListener("keydown",zr,!0),r.addEventListener("keyup",zr,!0),r.addEventListener("click",fi,!0),t.addEventListener("focus",hi,!0),t.addEventListener("blur",pi,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",Ne,!0),r.addEventListener("pointermove",Ne,!0),r.addEventListener("pointerup",Ne,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",Ne,!0),r.addEventListener("mousemove",Ne,!0),r.addEventListener("mouseup",Ne,!0)),t.addEventListener("beforeunload",()=>{mi(e)},{once:!0}),dr.set(t,{focus:n})}const mi=(e,t)=>{const r=St(e),n=bt(e);t&&n.removeEventListener("DOMContentLoaded",t),dr.has(r)&&(r.HTMLElement.prototype.focus=dr.get(r).focus,n.removeEventListener("keydown",zr,!0),n.removeEventListener("keyup",zr,!0),n.removeEventListener("click",fi,!0),r.removeEventListener("focus",hi,!0),r.removeEventListener("blur",pi,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",Ne,!0),n.removeEventListener("pointermove",Ne,!0),n.removeEventListener("pointerup",Ne,!0)):process.env.NODE_ENV==="test"&&(n.removeEventListener("mousedown",Ne,!0),n.removeEventListener("mousemove",Ne,!0),n.removeEventListener("mouseup",Ne,!0)),dr.delete(r))};function Cc(e){const t=bt(e);let r;return t.readyState!=="loading"?Dn(e):(r=()=>{Dn(e)},t.addEventListener("DOMContentLoaded",r)),()=>mi(e,r)}typeof document<"u"&&Cc();function gi(){return kr!=="pointer"}const kc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Oc(e,t,r){let n=bt(r==null?void 0:r.target);const o=typeof window<"u"?St(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?St(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?St(r==null?void 0:r.target).HTMLElement:HTMLElement,l=typeof window<"u"?St(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return e=e||n.activeElement instanceof o&&!kc.has(n.activeElement.type)||n.activeElement instanceof s||n.activeElement instanceof i&&n.activeElement.isContentEditable,!(e&&t==="keyboard"&&r instanceof l&&!Ec[r.key])}function Ac(e,t,r){Dn(),p.useEffect(()=>{let n=(o,s)=>{Oc(!!(r!=null&&r.isTextInput),o,s)&&e(gi())};return $n.add(n),()=>{$n.delete(n)}},t)}function Rc(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:o}=e;const s=p.useCallback(c=>{if(c.target===c.currentTarget)return n&&n(c),o&&o(!1),!0},[n,o]),i=di(s),l=p.useCallback(c=>{const d=bt(c.target),g=d?Nn(d):Nn();c.target===c.currentTarget&&g===li(c.nativeEvent)&&(r&&r(c),o&&o(!0),i(c))},[o,r,i]);return{focusProps:{onFocus:!t&&(r||o||n)?l:void 0,onBlur:!t&&(n||o)?s:void 0}}}function Tc(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:o}=e,s=p.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:l}=ci(),c=p.useCallback(v=>{v.currentTarget.contains(v.target)&&s.current.isFocusWithin&&!v.currentTarget.contains(v.relatedTarget)&&(s.current.isFocusWithin=!1,l(),r&&r(v),o&&o(!1))},[r,o,s,l]),d=di(c),g=p.useCallback(v=>{if(!v.currentTarget.contains(v.target))return;const x=bt(v.target),h=Nn(x);if(!s.current.isFocusWithin&&h===li(v.nativeEvent)){n&&n(v),o&&o(!0),s.current.isFocusWithin=!0,d(v);let k=v.currentTarget;i(x,"focus",O=>{if(s.current.isFocusWithin&&!ai(k,O.target)){let F=new x.defaultView.FocusEvent("blur",{relatedTarget:O.target});wc(F,k);let N=ui(F);c(N)}},{capture:!0})}},[n,o,d,i,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:g,onBlur:c}}}let Gr=!1,an=0;function Ln(){Gr=!0,setTimeout(()=>{Gr=!1},50)}function Bo(e){e.pointerType==="touch"&&Ln()}function Pc(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ln),an++,()=>{an--,!(an>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Bo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ln))}}function Fc(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:o}=e,[s,i]=p.useState(!1),l=p.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;p.useEffect(Pc,[]);let{addGlobalListener:c,removeAllGlobalListeners:d}=ci(),{hoverProps:g,triggerHoverEnd:v}=p.useMemo(()=>{let x=(O,F)=>{if(l.pointerType=F,o||F==="touch"||l.isHovered||!O.currentTarget.contains(O.target))return;l.isHovered=!0;let N=O.currentTarget;l.target=N,c(bt(O.target),"pointerover",S=>{l.isHovered&&l.target&&!ai(l.target,S.target)&&h(S,S.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:F}),r&&r(!0),i(!0)},h=(O,F)=>{let N=l.target;l.pointerType="",l.target=null,!(F==="touch"||!l.isHovered||!N)&&(l.isHovered=!1,d(),n&&n({type:"hoverend",target:N,pointerType:F}),r&&r(!1),i(!1))},k={};return typeof PointerEvent<"u"?(k.onPointerEnter=O=>{Gr&&O.pointerType==="mouse"||x(O,O.pointerType)},k.onPointerLeave=O=>{!o&&O.currentTarget.contains(O.target)&&h(O,O.pointerType)}):process.env.NODE_ENV==="test"&&(k.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},k.onMouseEnter=O=>{!l.ignoreEmulatedMouseEvents&&!Gr&&x(O,"mouse"),l.ignoreEmulatedMouseEvents=!1},k.onMouseLeave=O=>{!o&&O.currentTarget.contains(O.target)&&h(O,"mouse")}),{hoverProps:k,triggerHoverEnd:h}},[t,r,n,o,l,c,d]);return p.useEffect(()=>{o&&v({currentTarget:l.target},l.pointerType)},[o]),{hoverProps:g,isHovered:s}}function Ic(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,o=p.useRef({isFocused:!1,isFocusVisible:t||gi()}),[s,i]=p.useState(!1),[l,c]=p.useState(()=>o.current.isFocused&&o.current.isFocusVisible),d=p.useCallback(()=>c(o.current.isFocused&&o.current.isFocusVisible),[]),g=p.useCallback(h=>{o.current.isFocused=h,i(h),d()},[d]);Ac(h=>{o.current.isFocusVisible=h,d()},[],{isTextInput:r});let{focusProps:v}=Rc({isDisabled:n,onFocusChange:g}),{focusWithinProps:x}=Tc({isDisabled:!n,onFocusWithinChange:g});return{isFocused:s,isFocusVisible:l,focusProps:n?x:v}}var Mc=Object.defineProperty,Nc=(e,t,r)=>t in e?Mc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ln=(e,t,r)=>(Nc(e,typeof t!="symbol"?t+"":t,r),r);let $c=class{constructor(){ln(this,"current",this.detect()),ln(this,"handoffState","pending"),ln(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Qe=new $c;function Kr(e){var t;return Qe.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function qr(e){var t,r;return Qe.isServer?null:e==null?document:(r=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?r:document}function vi(e){var t,r;return(r=(t=qr(e))==null?void 0:t.activeElement)!=null?r:null}function jc(e){return vi(e)===e}function bi(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Re(){let e=[],t={addEventListener(r,n,o,s){return r.addEventListener(n,o,s),t.add(()=>r.removeEventListener(n,o,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return bi(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=Re();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function rr(){let[e]=p.useState(Re);return p.useEffect(()=>()=>e.dispose(),[e]),e}let we=(e,t)=>{Qe.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function nr(e){let t=p.useRef(e);return we(()=>{t.current=e},[e]),t}let oe=function(e){let t=nr(e);return p.useCallback((...r)=>t.current(...r),[t])};function Dc(e){let t=e.width/2,r=e.height/2;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function Lc(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Bc({disabled:e=!1}={}){let t=p.useRef(null),[r,n]=p.useState(!1),o=rr(),s=oe(()=>{t.current=null,n(!1),o.dispose()}),i=oe(l=>{if(o.dispose(),t.current===null){t.current=l.currentTarget,n(!0);{let c=Kr(l.currentTarget);o.addEventListener(c,"pointerup",s,!1),o.addEventListener(c,"pointermove",d=>{if(t.current){let g=Dc(d);n(Lc(g,t.current.getBoundingClientRect()))}},!1),o.addEventListener(c,"pointercancel",s,!1)}}});return{pressed:r,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function gt(e){return p.useMemo(()=>e,Object.values(e))}let Uc=p.createContext(void 0);function oo(){return p.useContext(Uc)}function Uo(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Ke(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ke),n}var Bn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Bn||{}),Hc=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Hc||{});function Le(){let e=zc();return p.useCallback(t=>Wc({mergeRefs:e,...t}),[e])}function Wc({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:s=!0,name:i,mergeRefs:l}){l=l??Gc;let c=yi(t,e);if(s)return Mr(c,r,n,i,l);let d=o??0;if(d&2){let{static:g=!1,...v}=c;if(g)return Mr(v,r,n,i,l)}if(d&1){let{unmount:g=!0,...v}=c;return Ke(g?0:1,{0(){return null},1(){return Mr({...v,hidden:!0,style:{display:"none"}},r,n,i,l)}})}return Mr(c,r,n,i,l)}function Mr(e,t={},r,n,o){let{as:s=r,children:i,refName:l="ref",...c}=cn(e,["unmount","static"]),d=e.ref!==void 0?{[l]:e.ref}:{},g=typeof i=="function"?i(t):i;g=xi(g),"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let v={};if(t){let x=!1,h=[];for(let[k,O]of Object.entries(t))typeof O=="boolean"&&(x=!0),O===!0&&h.push(k.replace(/([A-Z])/g,F=>`-${F.toLowerCase()}`));if(x){v["data-headlessui-state"]=h.join(" ");for(let k of h)v[`data-${k}`]=""}}if(Dr(s)&&(Object.keys(xt(c)).length>0||Object.keys(xt(v)).length>0))if(!p.isValidElement(g)||Array.isArray(g)&&g.length>1||Vc(g)){if(Object.keys(xt(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(xt(c)).concat(Object.keys(xt(v))).map(x=>` - ${x}`).join(`
76
- `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(x=>` - ${x}`).join(`
75
+ `,document.head.insertBefore(e,document.head.firstChild)}const lc=()=>new Bl({defaultOptions:{queries:{staleTime:300*1e3,gcTime:3600*1e3,refetchOnWindowFocus:!0,refetchInterval:600*1e3,retry:(e,t)=>t instanceof Error&&t.message.includes("404")?!1:e<3}}}),ci=p.createContext(void 0);function cc({enabled:e,nfdView:t}){const r=ii(),{activeAddress:n,activeWallet:o,algodClient:s}=Ke.useWallet(),{activeNetwork:i}=Ke.useNetwork(),l=p.useRef(null);return p.useEffect(()=>{if(!e){l.current=n;return}const c=l.current===null&&n!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&s!==void 0;if(l.current=n,!c)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const u=o.accounts.map(g=>g.address);if(u.length>0){const v=[];for(let S=0;S<u.length;S+=20)v.push(u.slice(S,S+20));v.forEach(async S=>{const R=i==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",P=new URLSearchParams;S.forEach(F=>{P.append("address",F)}),P.append("view",t);try{const F=await fetch(`${R}/nfd/lookup?${P.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!F.ok&&F.status!==404)throw new Error(`NFD prefetch lookup failed: ${F.statusText}`);const $=F.status===404?{}:await F.json();S.forEach(C=>{const j=$[C]||null;r.setQueryData(["nfd",C,i,t],j)})}catch(F){console.error("Error prefetching NFD data:",F)}})}u.forEach(g=>{r.prefetchQuery({queryKey:["account-balance",g],queryFn:async()=>{try{const v=await s.accountInformation(g).do();return Number(v.amount)}catch(v){throw new Error(`Error fetching account balance: ${v}`)}}})})},[n,o,i,t,s,r,e]),null}function uc({children:e,queryClient:t,enablePrefetching:r=!0,prefetchNfdView:n="thumbnail",theme:o="system",plugins:s=[],passkeyLayout:i="list"}){const l=p.useMemo(()=>t||lc(),[t]),c=ai(o);p.useEffect(()=>{ac()},[]);const u=p.useMemo(()=>({queryClient:l,theme:o,resolvedTheme:c,passkeyLayout:i}),[l,o,c,i]),g=o==="system"?void 0:o,v=w.jsx(ci.Provider,{value:u,children:w.jsxs("div",{"data-wallet-theme":!0,"data-theme":g,children:[w.jsx(cc,{enabled:r,nfdView:n}),w.jsx(dc,{plugins:s,children:e})]})});return t?v:w.jsx(ro,{client:l,children:v})}function dc({plugins:e,children:t}){const{activeAddress:r,activeWallet:n}=Ke.useWallet(),{theme:o,resolvedTheme:s}=rr(),i=p.useMemo(()=>({activeAddress:r,activeWallet:n,theme:o,resolvedTheme:s,openDialog:()=>{},closeDialog:()=>{}}),[r,n,o,s]);return e.length===0?w.jsx(w.Fragment,{children:t}):w.jsxs(nc,{plugins:e,renderContext:i,children:[w.jsx(sc,{}),w.jsx(oc,{}),t]})}function rr(){const e=p.useContext(ci);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function ui({children:e}){return w.jsx("p",{className:"px-1.5 text-xs font-semibold uppercase tracking-wide text-[var(--wui-color-text-secondary)]",children:e})}function di({wallet:e}){return w.jsx("div",{className:"shrink-0 h-8 w-8 rounded-md overflow-hidden bg-[var(--wui-color-bg-secondary)] flex items-center justify-center",children:w.jsx("img",{src:e.metadata.icon,alt:`${e.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})})}const ar="Waiting for your passkey…",Uo="flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-[var(--wui-color-text)] transition-colors hover:bg-[var(--wui-color-bg-hover)] disabled:hover:bg-transparent rounded-xl";function Ir(e){return e?"disabled:cursor-wait":"disabled:opacity-50 disabled:cursor-not-allowed"}function Dn({wallet:e,handleWalletClick:t,status:r,layout:n="list",showLabel:o=!0}){const s=(r==null?void 0:r.walletId)===e.id?r:null,i=!!(s!=null&&s.pending),l=i?(s==null?void 0:s.action)??"sign-in":null,c=l==="sign-in",u=l==="create",g=w.jsx("p",{role:"status",className:"sr-only",children:i?ar:""});return n==="list"?w.jsxs("div",{"data-passkey-connect":"list",className:"flex flex-col gap-1",children:[o&&w.jsx(ui,{children:"Passkey"}),w.jsxs("ul",{className:"space-y-1.5",children:[w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:()=>t(e),disabled:i,"aria-busy":c,className:Le(Uo,Ir(c)),children:[c?w.jsx(Wo,{}):w.jsx(di,{wallet:e}),w.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:c?ar:"Sign in with passkey"})]})}),w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:()=>t(e,{create:!0}),disabled:i,"aria-busy":u,className:Le(Uo,Ir(u)),children:[u?w.jsx(Wo,{}):w.jsx("div",{className:"shrink-0 h-8 w-8 rounded-md border-[1.5px] border-dashed border-[var(--wui-color-text-tertiary)] text-[var(--wui-color-text-secondary)] flex items-center justify-center",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round","aria-hidden":"true",children:w.jsx("path",{d:"M12 5v14M5 12h14"})})}),w.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:u?ar:"Create a passkey"})]})})]}),g,!i&&(s==null?void 0:s.error)&&w.jsx("p",{role:"alert",className:"mx-1.5 mb-1 rounded-lg bg-[var(--wui-color-danger-bg)] px-3 py-2 text-sm text-[var(--wui-color-danger-text)]",children:s.error})]}):w.jsxs("div",{"data-passkey-connect":"featured",className:"flex flex-col gap-2.5 px-[22px] pt-1 pb-4",children:[w.jsxs("button",{type:"button",onClick:()=>t(e),disabled:i,"aria-busy":c,className:Le("flex w-full items-center justify-center gap-2.5 rounded-[14px] px-4 py-3 text-base font-semibold bg-[var(--wui-color-primary)] text-[var(--wui-color-primary-text)] hover:bg-[var(--wui-color-primary-hover)] transition-colors",Ir(c)),children:[c?w.jsx(Ln,{className:"h-5 w-5"}):w.jsx(fc,{}),c?ar:"Continue with passkey"]}),w.jsxs("p",{className:"text-center text-sm text-[var(--wui-color-text-secondary)]",children:[!u&&"New here? ",w.jsxs("button",{type:"button",onClick:()=>t(e,{create:!0}),disabled:i,"aria-busy":u,className:Le("inline-flex items-center gap-1.5 font-medium text-[var(--wui-color-link)] hover:text-[var(--wui-color-link-hover)]",Ir(u)),children:[u&&w.jsx(Ln,{className:"h-3.5 w-3.5"}),u?ar:"Create a passkey"]})]}),g,!i&&(s==null?void 0:s.error)&&w.jsx("p",{role:"alert",className:"rounded-lg bg-[var(--wui-color-danger-bg)] px-3 py-2 text-sm text-[var(--wui-color-danger-text)]",children:s.error})]})}function Wo(){return w.jsx("div",{className:"shrink-0 h-8 w-8 rounded-md bg-[var(--wui-color-bg-secondary)] text-[var(--wui-color-text-secondary)] flex items-center justify-center",children:w.jsx(Ln,{className:"h-[18px] w-[18px]"})})}function Ln({className:e}){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:Le("shrink-0 animate-spin",e),fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function fc(){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[w.jsx("path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}),w.jsx("circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"})]})}function Bn({wallets:e,handleWalletClick:t}){return w.jsxs("ul",{className:"space-y-1.5",children:[e.map(r=>w.jsx("li",{children:w.jsxs("button",{onClick:()=>t(r),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-[var(--wui-color-text)] transition-colors hover:bg-[var(--wui-color-bg-hover)] rounded-xl",children:[w.jsx(di,{wallet:r}),w.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:r.metadata.name})]})},r.id)),e.length===0&&w.jsx("p",{className:"text-center text-[var(--wui-color-text-secondary)]",children:"No wallets found."})]})}function fi({children:e,passkeyLayout:t}){const[r,n]=p.useState(!1),[o,s]=p.useState(null),[i,l]=p.useState(null),{wallets:c,availableWallets:u,activeAddress:g}=Ke.useWallet(),{theme:v,passkeyLayout:S}=rr(),h=tt.resolvePasskeyLayout(t,S),R=u??c,P=R.find(tt.isPasskeyWallet),F=R.filter(O=>!tt.isPasskeyWallet(O)),$=v==="system"?void 0:v,{refs:C,context:j}=K.useFloating({open:r,onOpenChange:O=>{O&&g||(O?(n(!0),s("starting"),l(null),requestAnimationFrame(()=>{s("entered")})):(s("exiting"),l(null),setTimeout(()=>{n(!1),s(null)},150)))}}),D=K.useClick(j),L=K.useDismiss(j,{outsidePressEvent:"mousedown"}),U=K.useRole(j,{role:"dialog"}),{getReferenceProps:Q,getFloatingProps:a}=K.useInteractions([D,L,U]),d=K.useId(),f=K.useId(),E=async(O,A)=>{const N=tt.isPasskeyWallet(O);try{const I=O.connect(A);N&&l({walletId:O.id,pending:!0,error:null,action:A!=null&&A.create?"create":"sign-in"}),await I,j.onOpenChange(!1)}catch(I){console.error(`Error connecting to ${O.metadata.name}:`,I);const W=N?tt.getPasskeyErrorMessage(I):null;if(W){const G=!(A!=null&&A.create)&&tt.getPasskeyErrorCode(I)==="cancelled"?" New here? Choose 'Create a passkey'.":"";l({walletId:O.id,pending:!1,error:W+G});return}j.onOpenChange(!1)}},y=O=>{g||j.onOpenChange(!0)},k=e||w.jsx(Kr,{}),T=K.useMergeRefs([C.setReference,k.ref||null]),m={...Q(),ref:T,onClick:y},x=p.cloneElement(k,m);return w.jsxs(w.Fragment,{children:[x,w.jsx(K.FloatingPortal,{id:"wallet-dialog-portal",children:r&&w.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":$,children:w.jsx(K.FloatingOverlay,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-[var(--wui-color-overlay)] data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":o,lockScroll:!0,children:w.jsx(K.FloatingFocusManager,{context:j,modal:!0,children:w.jsxs("div",{ref:C.setFloating,...a({"aria-labelledby":d,"aria-describedby":f}),role:"dialog","data-state":o,className:"w-full max-w-sm rounded-3xl bg-[var(--wui-color-bg)] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[w.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[w.jsx("h2",{id:d,className:"text-xl font-bold text-[var(--wui-color-text)] wallet-custom-font",children:"Connect a Wallet"}),w.jsx("button",{onClick:()=>j.onOpenChange(!1),className:"absolute right-4 rounded-full bg-[var(--wui-color-bg-tertiary)] p-2 text-[var(--wui-color-text-secondary)] hover:brightness-90 transition-all","aria-label":"Close dialog",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),P&&h==="list"?w.jsx("div",{className:"px-4 pb-3",children:w.jsxs("div",{className:"flex flex-col gap-2.5",children:[w.jsx(Dn,{layout:"list",showLabel:F.length>0,wallet:P,handleWalletClick:E,status:i}),F.length>0&&w.jsxs("div",{className:"flex flex-col gap-1",children:[w.jsx(ui,{children:"Wallets"}),w.jsx(Bn,{wallets:F,handleWalletClick:E})]})]})}):w.jsxs(w.Fragment,{children:[P&&w.jsx(Dn,{layout:"featured",wallet:P,handleWalletClick:E,status:i}),P&&F.length>0&&w.jsxs("div",{className:"flex items-center gap-3 px-6 pt-1 pb-2.5 text-xs text-[var(--wui-color-text-secondary)]",children:[w.jsx("span",{className:"flex-1 h-px bg-[var(--wui-color-border)]","aria-hidden":"true"}),"or connect a wallet",w.jsx("span",{className:"flex-1 h-px bg-[var(--wui-color-border)]","aria-hidden":"true"})]}),(!P||F.length>0)&&w.jsx("div",{className:"px-4 pb-3",children:w.jsx(Bn,{wallets:F,handleWalletClick:E})})]}),w.jsxs("div",{className:"px-6 py-5 border-t border-[var(--wui-color-border)] flex items-center justify-between",children:[w.jsx("span",{className:"text-[var(--wui-color-text-secondary)] text-sm",children:"Need an Algorand wallet?"}),w.jsx("a",{href:"https://algorand.co/wallets",className:"text-[var(--wui-color-link)] font-medium text-sm hover:text-[var(--wui-color-link-hover)]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})})]})}var hc=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ln=Math.ceil,Fe=Math.floor,xe="[BigNumber Error] ",Ho=xe+"Number primitive has more than 15 significant digits: ",$e=1e14,Y=14,zo=9007199254740991,cn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],at=1e7,Ce=1e9;function hi(e){var t,r,n,o=C.prototype={constructor:C,toString:null,valueOf:null},s=new C(1),i=20,l=4,c=-7,u=21,g=-1e7,v=1e7,S=!1,h=1,R=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function C(a,d){var f,E,y,k,T,m,x,O,A=this;if(!(A instanceof C))return new C(a,d);if(d==null){if(a&&a._isBigNumber===!0){A.s=a.s,!a.c||a.e>v?A.c=A.e=null:a.e<g?A.c=[A.e=0]:(A.e=a.e,A.c=a.c.slice());return}if((m=typeof a=="number")&&a*0==0){if(A.s=1/a<0?(a=-a,-1):1,a===~~a){for(k=0,T=a;T>=10;T/=10,k++);k>v?A.c=A.e=null:(A.e=k,A.c=[a]);return}O=String(a)}else{if(!hc.test(O=String(a)))return n(A,O,m);A.s=O.charCodeAt(0)==45?(O=O.slice(1),-1):1}(k=O.indexOf("."))>-1&&(O=O.replace(".","")),(T=O.search(/e/i))>0?(k<0&&(k=T),k+=+O.slice(T+1),O=O.substring(0,T)):k<0&&(k=O.length)}else{if(ie(d,2,F.length,"Base"),d==10&&$)return A=new C(a),U(A,i+A.e+1,l);if(O=String(a),m=typeof a=="number"){if(a*0!=0)return n(A,O,m,d);if(A.s=1/a<0?(O=O.slice(1),-1):1,C.DEBUG&&O.replace(/^0\.0*|\./,"").length>15)throw Error(Ho+a)}else A.s=O.charCodeAt(0)===45?(O=O.slice(1),-1):1;for(f=F.slice(0,d),k=T=0,x=O.length;T<x;T++)if(f.indexOf(E=O.charAt(T))<0){if(E=="."){if(T>k){k=x;continue}}else if(!y&&(O==O.toUpperCase()&&(O=O.toLowerCase())||O==O.toLowerCase()&&(O=O.toUpperCase()))){y=!0,T=-1,k=0;continue}return n(A,String(a),m,d)}m=!1,O=r(O,d,10,A.s),(k=O.indexOf("."))>-1?O=O.replace(".",""):k=O.length}for(T=0;O.charCodeAt(T)===48;T++);for(x=O.length;O.charCodeAt(--x)===48;);if(O=O.slice(T,++x)){if(x-=T,m&&C.DEBUG&&x>15&&(a>zo||a!==Fe(a)))throw Error(Ho+A.s*a);if((k=k-T-1)>v)A.c=A.e=null;else if(k<g)A.c=[A.e=0];else{if(A.e=k,A.c=[],T=(k+1)%Y,k<0&&(T+=Y),T<x){for(T&&A.c.push(+O.slice(0,T)),x-=Y;T<x;)A.c.push(+O.slice(T,T+=Y));T=Y-(O=O.slice(T)).length}else T-=x;for(;T--;O+="0");A.c.push(+O)}}else A.c=[A.e=0]}C.clone=hi,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(a){var d,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(d="DECIMAL_PLACES")&&(f=a[d],ie(f,0,Ce,d),i=f),a.hasOwnProperty(d="ROUNDING_MODE")&&(f=a[d],ie(f,0,8,d),l=f),a.hasOwnProperty(d="EXPONENTIAL_AT")&&(f=a[d],f&&f.pop?(ie(f[0],-1e9,0,d),ie(f[1],0,Ce,d),c=f[0],u=f[1]):(ie(f,-1e9,Ce,d),c=-(u=f<0?-f:f))),a.hasOwnProperty(d="RANGE"))if(f=a[d],f&&f.pop)ie(f[0],-1e9,-1,d),ie(f[1],1,Ce,d),g=f[0],v=f[1];else if(ie(f,-1e9,Ce,d),f)g=-(v=f<0?-f:f);else throw Error(xe+d+" cannot be zero: "+f);if(a.hasOwnProperty(d="CRYPTO"))if(f=a[d],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))S=f;else throw S=!f,Error(xe+"crypto unavailable");else S=f;else throw Error(xe+d+" not true or false: "+f);if(a.hasOwnProperty(d="MODULO_MODE")&&(f=a[d],ie(f,0,9,d),h=f),a.hasOwnProperty(d="POW_PRECISION")&&(f=a[d],ie(f,0,Ce,d),R=f),a.hasOwnProperty(d="FORMAT"))if(f=a[d],typeof f=="object")P=f;else throw Error(xe+d+" not an object: "+f);if(a.hasOwnProperty(d="ALPHABET"))if(f=a[d],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))$=f.slice(0,10)=="0123456789",F=f;else throw Error(xe+d+" invalid: "+f)}else throw Error(xe+"Object expected: "+a);return{DECIMAL_PLACES:i,ROUNDING_MODE:l,EXPONENTIAL_AT:[c,u],RANGE:[g,v],CRYPTO:S,MODULO_MODE:h,POW_PRECISION:R,FORMAT:P,ALPHABET:F}},C.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!C.DEBUG)return!0;var d,f,E=a.c,y=a.e,k=a.s;e:if({}.toString.call(E)=="[object Array]"){if((k===1||k===-1)&&y>=-1e9&&y<=Ce&&y===Fe(y)){if(E[0]===0){if(y===0&&E.length===1)return!0;break e}if(d=(y+1)%Y,d<1&&(d+=Y),String(E[0]).length==d){for(d=0;d<E.length;d++)if(f=E[d],f<0||f>=$e||f!==Fe(f))break e;if(f!==0)return!0}}}else if(E===null&&y===null&&(k===null||k===1||k===-1))return!0;throw Error(xe+"Invalid BigNumber: "+a)},C.maximum=C.max=function(){return D(arguments,-1)},C.minimum=C.min=function(){return D(arguments,1)},C.random=(function(){var a=9007199254740992,d=Math.random()*a&2097151?function(){return Fe(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var E,y,k,T,m,x=0,O=[],A=new C(s);if(f==null?f=i:ie(f,0,Ce),T=ln(f/Y),S)if(crypto.getRandomValues){for(E=crypto.getRandomValues(new Uint32Array(T*=2));x<T;)m=E[x]*131072+(E[x+1]>>>11),m>=9e15?(y=crypto.getRandomValues(new Uint32Array(2)),E[x]=y[0],E[x+1]=y[1]):(O.push(m%1e14),x+=2);x=T/2}else if(crypto.randomBytes){for(E=crypto.randomBytes(T*=7);x<T;)m=(E[x]&31)*281474976710656+E[x+1]*1099511627776+E[x+2]*4294967296+E[x+3]*16777216+(E[x+4]<<16)+(E[x+5]<<8)+E[x+6],m>=9e15?crypto.randomBytes(7).copy(E,x):(O.push(m%1e14),x+=7);x=T/7}else throw S=!1,Error(xe+"crypto unavailable");if(!S)for(;x<T;)m=d(),m<9e15&&(O[x++]=m%1e14);for(T=O[--x],f%=Y,T&&f&&(m=cn[Y-f],O[x]=Fe(T/m)*m);O[x]===0;O.pop(),x--);if(x<0)O=[k=0];else{for(k=-1;O[0]===0;O.splice(0,1),k-=Y);for(x=1,m=O[0];m>=10;m/=10,x++);x<Y&&(k-=Y-x)}return A.e=k,A.c=O,A}})(),C.sum=function(){for(var a=1,d=arguments,f=new C(d[0]);a<d.length;)f=f.plus(d[a++]);return f},r=(function(){var a="0123456789";function d(f,E,y,k){for(var T,m=[0],x,O=0,A=f.length;O<A;){for(x=m.length;x--;m[x]*=E);for(m[0]+=k.indexOf(f.charAt(O++)),T=0;T<m.length;T++)m[T]>y-1&&(m[T+1]==null&&(m[T+1]=0),m[T+1]+=m[T]/y|0,m[T]%=y)}return m.reverse()}return function(f,E,y,k,T){var m,x,O,A,N,I,W,G,J=f.indexOf("."),ne=i,q=l;for(J>=0&&(A=R,R=0,f=f.replace(".",""),G=new C(E),I=G.pow(f.length-J),R=A,G.c=d(Ze(Pe(I.c),I.e,"0"),10,y,a),G.e=G.c.length),W=d(f,E,y,T?(m=F,a):(m=a,F)),O=A=W.length;W[--A]==0;W.pop());if(!W[0])return m.charAt(0);if(J<0?--O:(I.c=W,I.e=O,I.s=k,I=t(I,G,ne,q,y),W=I.c,N=I.r,O=I.e),x=O+ne+1,J=W[x],A=y/2,N=N||x<0||W[x+1]!=null,N=q<4?(J!=null||N)&&(q==0||q==(I.s<0?3:2)):J>A||J==A&&(q==4||N||q==6&&W[x-1]&1||q==(I.s<0?8:7)),x<1||!W[0])f=N?Ze(m.charAt(1),-ne,m.charAt(0)):m.charAt(0);else{if(W.length=x,N)for(--y;++W[--x]>y;)W[x]=0,x||(++O,W=[1].concat(W));for(A=W.length;!W[--A];);for(J=0,f="";J<=A;f+=m.charAt(W[J++]));f=Ze(f,O,m.charAt(0))}return f}})(),t=(function(){function a(E,y,k){var T,m,x,O,A=0,N=E.length,I=y%at,W=y/at|0;for(E=E.slice();N--;)x=E[N]%at,O=E[N]/at|0,T=W*x+O*I,m=I*x+T%at*at+A,A=(m/k|0)+(T/at|0)+W*O,E[N]=m%k;return A&&(E=[A].concat(E)),E}function d(E,y,k,T){var m,x;if(k!=T)x=k>T?1:-1;else for(m=x=0;m<k;m++)if(E[m]!=y[m]){x=E[m]>y[m]?1:-1;break}return x}function f(E,y,k,T){for(var m=0;k--;)E[k]-=m,m=E[k]<y[k]?1:0,E[k]=m*T+E[k]-y[k];for(;!E[0]&&E.length>1;E.splice(0,1));}return function(E,y,k,T,m){var x,O,A,N,I,W,G,J,ne,q,M,te,Me,se,Ut,be,We,me=E.s==y.s?1:-1,ue=E.c,ae=y.c;if(!ue||!ue[0]||!ae||!ae[0])return new C(!E.s||!y.s||(ue?ae&&ue[0]==ae[0]:!ae)?NaN:ue&&ue[0]==0||!ae?me*0:me/0);for(J=new C(me),ne=J.c=[],O=E.e-y.e,me=k+O+1,m||(m=$e,O=Ne(E.e/Y)-Ne(y.e/Y),me=me/Y|0),A=0;ae[A]==(ue[A]||0);A++);if(ae[A]>(ue[A]||0)&&O--,me<0)ne.push(1),N=!0;else{for(se=ue.length,be=ae.length,A=0,me+=2,I=Fe(m/(ae[0]+1)),I>1&&(ae=a(ae,I,m),ue=a(ue,I,m),be=ae.length,se=ue.length),Me=be,q=ue.slice(0,be),M=q.length;M<be;q[M++]=0);We=ae.slice(),We=[0].concat(We),Ut=ae[0],ae[1]>=m/2&&Ut++;do{if(I=0,x=d(ae,q,be,M),x<0){if(te=q[0],be!=M&&(te=te*m+(q[1]||0)),I=Fe(te/Ut),I>1)for(I>=m&&(I=m-1),W=a(ae,I,m),G=W.length,M=q.length;d(W,q,G,M)==1;)I--,f(W,be<G?We:ae,G,m),G=W.length,x=1;else I==0&&(x=I=1),W=ae.slice(),G=W.length;if(G<M&&(W=[0].concat(W)),f(q,W,M,m),M=q.length,x==-1)for(;d(ae,q,be,M)<1;)I++,f(q,be<M?We:ae,M,m),M=q.length}else x===0&&(I++,q=[0]);ne[A++]=I,q[0]?q[M++]=ue[Me]||0:(q=[ue[Me]],M=1)}while((Me++<se||q[0]!=null)&&me--);N=q[0]!=null,ne[0]||ne.splice(0,1)}if(m==$e){for(A=1,me=ne[0];me>=10;me/=10,A++);U(J,k+(J.e=A+O*Y-1)+1,T,N)}else J.e=O,J.r=+N;return J}})();function j(a,d,f,E){var y,k,T,m,x;if(f==null?f=l:ie(f,0,8),!a.c)return a.toString();if(y=a.c[0],T=a.e,d==null)x=Pe(a.c),x=E==1||E==2&&(T<=c||T>=u)?Mr(x,T):Ze(x,T,"0");else if(a=U(new C(a),d,f),k=a.e,x=Pe(a.c),m=x.length,E==1||E==2&&(d<=k||k<=c)){for(;m<d;x+="0",m++);x=Mr(x,k)}else if(d-=T,x=Ze(x,k,"0"),k+1>m){if(--d>0)for(x+=".";d--;x+="0");}else if(d+=k-m,d>0)for(k+1==m&&(x+=".");d--;x+="0");return a.s<0&&y?"-"+x:x}function D(a,d){for(var f,E,y=1,k=new C(a[0]);y<a.length;y++)E=new C(a[y]),(!E.s||(f=Et(k,E))===d||f===0&&k.s===d)&&(k=E);return k}function L(a,d,f){for(var E=1,y=d.length;!d[--y];d.pop());for(y=d[0];y>=10;y/=10,E++);return(f=E+f*Y-1)>v?a.c=a.e=null:f<g?a.c=[a.e=0]:(a.e=f,a.c=d),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,d=/^([^.]+)\.$/,f=/^\.([^.]+)$/,E=/^-?(Infinity|NaN)$/,y=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(k,T,m,x){var O,A=m?T:T.replace(y,"");if(E.test(A))k.s=isNaN(A)?null:A<0?-1:1;else{if(!m&&(A=A.replace(a,function(N,I,W){return O=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!x||x==O?I:N}),x&&(O=x,A=A.replace(d,"$1").replace(f,"0.$1")),T!=A))return new C(A,O);if(C.DEBUG)throw Error(xe+"Not a"+(x?" base "+x:"")+" number: "+T);k.s=null}k.c=k.e=null}})();function U(a,d,f,E){var y,k,T,m,x,O,A,N=a.c,I=cn;if(N){e:{for(y=1,m=N[0];m>=10;m/=10,y++);if(k=d-y,k<0)k+=Y,T=d,x=N[O=0],A=Fe(x/I[y-T-1]%10);else if(O=ln((k+1)/Y),O>=N.length)if(E){for(;N.length<=O;N.push(0));x=A=0,y=1,k%=Y,T=k-Y+1}else break e;else{for(x=m=N[O],y=1;m>=10;m/=10,y++);k%=Y,T=k-Y+y,A=T<0?0:Fe(x/I[y-T-1]%10)}if(E=E||d<0||N[O+1]!=null||(T<0?x:x%I[y-T-1]),E=f<4?(A||E)&&(f==0||f==(a.s<0?3:2)):A>5||A==5&&(f==4||E||f==6&&(k>0?T>0?x/I[y-T]:0:N[O-1])%10&1||f==(a.s<0?8:7)),d<1||!N[0])return N.length=0,E?(d-=a.e+1,N[0]=I[(Y-d%Y)%Y],a.e=-d||0):N[0]=a.e=0,a;if(k==0?(N.length=O,m=1,O--):(N.length=O+1,m=I[Y-k],N[O]=T>0?Fe(x/I[y-T]%I[T])*m:0),E)for(;;)if(O==0){for(k=1,T=N[0];T>=10;T/=10,k++);for(T=N[0]+=m,m=1;T>=10;T/=10,m++);k!=m&&(a.e++,N[0]==$e&&(N[0]=1));break}else{if(N[O]+=m,N[O]!=$e)break;N[O--]=0,m=1}for(k=N.length;N[--k]===0;N.pop());}a.e>v?a.c=a.e=null:a.e<g&&(a.c=[a.e=0])}return a}function Q(a){var d,f=a.e;return f===null?a.toString():(d=Pe(a.c),d=f<=c||f>=u?Mr(d,f):Ze(d,f,"0"),a.s<0?"-"+d:d)}return o.absoluteValue=o.abs=function(){var a=new C(this);return a.s<0&&(a.s=1),a},o.comparedTo=function(a,d){return Et(this,new C(a,d))},o.decimalPlaces=o.dp=function(a,d){var f,E,y,k=this;if(a!=null)return ie(a,0,Ce),d==null?d=l:ie(d,0,8),U(new C(k),a+k.e+1,d);if(!(f=k.c))return null;if(E=((y=f.length-1)-Ne(this.e/Y))*Y,y=f[y])for(;y%10==0;y/=10,E--);return E<0&&(E=0),E},o.dividedBy=o.div=function(a,d){return t(this,new C(a,d),i,l)},o.dividedToIntegerBy=o.idiv=function(a,d){return t(this,new C(a,d),0,1)},o.exponentiatedBy=o.pow=function(a,d){var f,E,y,k,T,m,x,O,A,N=this;if(a=new C(a),a.c&&!a.isInteger())throw Error(xe+"Exponent not an integer: "+Q(a));if(d!=null&&(d=new C(d)),m=a.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!a.c||!a.c[0])return A=new C(Math.pow(+Q(N),m?a.s*(2-jr(a)):+Q(a))),d?A.mod(d):A;if(x=a.s<0,d){if(d.c?!d.c[0]:!d.s)return new C(NaN);E=!x&&N.isInteger()&&d.isInteger(),E&&(N=N.mod(d))}else{if(a.e>9&&(N.e>0||N.e<-1||(N.e==0?N.c[0]>1||m&&N.c[1]>=24e7:N.c[0]<8e13||m&&N.c[0]<=9999975e7)))return k=N.s<0&&jr(a)?-0:0,N.e>-1&&(k=1/k),new C(x?1/k:k);R&&(k=ln(R/Y+2))}for(m?(f=new C(.5),x&&(a.s=1),O=jr(a)):(y=Math.abs(+Q(a)),O=y%2),A=new C(s);;){if(O){if(A=A.times(N),!A.c)break;k?A.c.length>k&&(A.c.length=k):E&&(A=A.mod(d))}if(y){if(y=Fe(y/2),y===0)break;O=y%2}else if(a=a.times(f),U(a,a.e+1,1),a.e>14)O=jr(a);else{if(y=+Q(a),y===0)break;O=y%2}N=N.times(N),k?N.c&&N.c.length>k&&(N.c.length=k):E&&(N=N.mod(d))}return E?A:(x&&(A=s.div(A)),d?A.mod(d):k?U(A,R,l,T):A)},o.integerValue=function(a){var d=new C(this);return a==null?a=l:ie(a,0,8),U(d,d.e+1,a)},o.isEqualTo=o.eq=function(a,d){return Et(this,new C(a,d))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(a,d){return Et(this,new C(a,d))>0},o.isGreaterThanOrEqualTo=o.gte=function(a,d){return(d=Et(this,new C(a,d)))===1||d===0},o.isInteger=function(){return!!this.c&&Ne(this.e/Y)>this.c.length-2},o.isLessThan=o.lt=function(a,d){return Et(this,new C(a,d))<0},o.isLessThanOrEqualTo=o.lte=function(a,d){return(d=Et(this,new C(a,d)))===-1||d===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(a,d){var f,E,y,k,T=this,m=T.s;if(a=new C(a,d),d=a.s,!m||!d)return new C(NaN);if(m!=d)return a.s=-d,T.plus(a);var x=T.e/Y,O=a.e/Y,A=T.c,N=a.c;if(!x||!O){if(!A||!N)return A?(a.s=-d,a):new C(N?T:NaN);if(!A[0]||!N[0])return N[0]?(a.s=-d,a):new C(A[0]?T:l==3?-0:0)}if(x=Ne(x),O=Ne(O),A=A.slice(),m=x-O){for((k=m<0)?(m=-m,y=A):(O=x,y=N),y.reverse(),d=m;d--;y.push(0));y.reverse()}else for(E=(k=(m=A.length)<(d=N.length))?m:d,m=d=0;d<E;d++)if(A[d]!=N[d]){k=A[d]<N[d];break}if(k&&(y=A,A=N,N=y,a.s=-a.s),d=(E=N.length)-(f=A.length),d>0)for(;d--;A[f++]=0);for(d=$e-1;E>m;){if(A[--E]<N[E]){for(f=E;f&&!A[--f];A[f]=d);--A[f],A[E]+=$e}A[E]-=N[E]}for(;A[0]==0;A.splice(0,1),--O);return A[0]?L(a,A,O):(a.s=l==3?-1:1,a.c=[a.e=0],a)},o.modulo=o.mod=function(a,d){var f,E,y=this;return a=new C(a,d),!y.c||!a.s||a.c&&!a.c[0]?new C(NaN):!a.c||y.c&&!y.c[0]?new C(y):(h==9?(E=a.s,a.s=1,f=t(y,a,0,3),a.s=E,f.s*=E):f=t(y,a,0,h),a=y.minus(f.times(a)),!a.c[0]&&h==1&&(a.s=y.s),a)},o.multipliedBy=o.times=function(a,d){var f,E,y,k,T,m,x,O,A,N,I,W,G,J,ne,q=this,M=q.c,te=(a=new C(a,d)).c;if(!M||!te||!M[0]||!te[0])return!q.s||!a.s||M&&!M[0]&&!te||te&&!te[0]&&!M?a.c=a.e=a.s=null:(a.s*=q.s,!M||!te?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(E=Ne(q.e/Y)+Ne(a.e/Y),a.s*=q.s,x=M.length,N=te.length,x<N&&(G=M,M=te,te=G,y=x,x=N,N=y),y=x+N,G=[];y--;G.push(0));for(J=$e,ne=at,y=N;--y>=0;){for(f=0,I=te[y]%ne,W=te[y]/ne|0,T=x,k=y+T;k>y;)O=M[--T]%ne,A=M[T]/ne|0,m=W*O+A*I,O=I*O+m%ne*ne+G[k]+f,f=(O/J|0)+(m/ne|0)+W*A,G[k--]=O%J;G[k]=f}return f?++E:G.splice(0,1),L(a,G,E)},o.negated=function(){var a=new C(this);return a.s=-a.s||null,a},o.plus=function(a,d){var f,E=this,y=E.s;if(a=new C(a,d),d=a.s,!y||!d)return new C(NaN);if(y!=d)return a.s=-d,E.minus(a);var k=E.e/Y,T=a.e/Y,m=E.c,x=a.c;if(!k||!T){if(!m||!x)return new C(y/0);if(!m[0]||!x[0])return x[0]?a:new C(m[0]?E:y*0)}if(k=Ne(k),T=Ne(T),m=m.slice(),y=k-T){for(y>0?(T=k,f=x):(y=-y,f=m),f.reverse();y--;f.push(0));f.reverse()}for(y=m.length,d=x.length,y-d<0&&(f=x,x=m,m=f,d=y),y=0;d;)y=(m[--d]=m[d]+x[d]+y)/$e|0,m[d]=$e===m[d]?0:m[d]%$e;return y&&(m=[y].concat(m),++T),L(a,m,T)},o.precision=o.sd=function(a,d){var f,E,y,k=this;if(a!=null&&a!==!!a)return ie(a,1,Ce),d==null?d=l:ie(d,0,8),U(new C(k),a,d);if(!(f=k.c))return null;if(y=f.length-1,E=y*Y+1,y=f[y]){for(;y%10==0;y/=10,E--);for(y=f[0];y>=10;y/=10,E++);}return a&&k.e+1>E&&(E=k.e+1),E},o.shiftedBy=function(a){return ie(a,-9007199254740991,zo),this.times("1e"+a)},o.squareRoot=o.sqrt=function(){var a,d,f,E,y,k=this,T=k.c,m=k.s,x=k.e,O=i+4,A=new C("0.5");if(m!==1||!T||!T[0])return new C(!m||m<0&&(!T||T[0])?NaN:T?k:1/0);if(m=Math.sqrt(+Q(k)),m==0||m==1/0?(d=Pe(T),(d.length+x)%2==0&&(d+="0"),m=Math.sqrt(+d),x=Ne((x+1)/2)-(x<0||x%2),m==1/0?d="5e"+x:(d=m.toExponential(),d=d.slice(0,d.indexOf("e")+1)+x),f=new C(d)):f=new C(m+""),f.c[0]){for(x=f.e,m=x+O,m<3&&(m=0);;)if(y=f,f=A.times(y.plus(t(k,y,O,1))),Pe(y.c).slice(0,m)===(d=Pe(f.c)).slice(0,m))if(f.e<x&&--m,d=d.slice(m-3,m+1),d=="9999"||!E&&d=="4999"){if(!E&&(U(y,y.e+i+2,0),y.times(y).eq(k))){f=y;break}O+=4,m+=4,E=1}else{(!+d||!+d.slice(1)&&d.charAt(0)=="5")&&(U(f,f.e+i+2,1),a=!f.times(f).eq(k));break}}return U(f,f.e+i+1,l,a)},o.toExponential=function(a,d){return a!=null&&(ie(a,0,Ce),a++),j(this,a,d,1)},o.toFixed=function(a,d){return a!=null&&(ie(a,0,Ce),a=a+this.e+1),j(this,a,d)},o.toFormat=function(a,d,f){var E,y=this;if(f==null)a!=null&&d&&typeof d=="object"?(f=d,d=null):a&&typeof a=="object"?(f=a,a=d=null):f=P;else if(typeof f!="object")throw Error(xe+"Argument not an object: "+f);if(E=y.toFixed(a,d),y.c){var k,T=E.split("."),m=+f.groupSize,x=+f.secondaryGroupSize,O=f.groupSeparator||"",A=T[0],N=T[1],I=y.s<0,W=I?A.slice(1):A,G=W.length;if(x&&(k=m,m=x,x=k,G-=k),m>0&&G>0){for(k=G%m||m,A=W.substr(0,k);k<G;k+=m)A+=O+W.substr(k,m);x>0&&(A+=O+W.slice(k)),I&&(A="-"+A)}E=N?A+(f.decimalSeparator||"")+((x=+f.fractionGroupSize)?N.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):N):A}return(f.prefix||"")+E+(f.suffix||"")},o.toFraction=function(a){var d,f,E,y,k,T,m,x,O,A,N,I,W=this,G=W.c;if(a!=null&&(m=new C(a),!m.isInteger()&&(m.c||m.s!==1)||m.lt(s)))throw Error(xe+"Argument "+(m.isInteger()?"out of range: ":"not an integer: ")+Q(m));if(!G)return new C(W);for(d=new C(s),O=f=new C(s),E=x=new C(s),I=Pe(G),k=d.e=I.length-W.e-1,d.c[0]=cn[(T=k%Y)<0?Y+T:T],a=!a||m.comparedTo(d)>0?k>0?d:O:m,T=v,v=1/0,m=new C(I),x.c[0]=0;A=t(m,d,0,1),y=f.plus(A.times(E)),y.comparedTo(a)!=1;)f=E,E=y,O=x.plus(A.times(y=O)),x=y,d=m.minus(A.times(y=d)),m=y;return y=t(a.minus(f),E,0,1),x=x.plus(y.times(O)),f=f.plus(y.times(E)),x.s=O.s=W.s,k=k*2,N=t(O,E,k,l).minus(W).abs().comparedTo(t(x,f,k,l).minus(W).abs())<1?[O,E]:[x,f],v=T,N},o.toNumber=function(){return+Q(this)},o.toPrecision=function(a,d){return a!=null&&ie(a,1,Ce),j(this,a,d,2)},o.toString=function(a){var d,f=this,E=f.s,y=f.e;return y===null?E?(d="Infinity",E<0&&(d="-"+d)):d="NaN":(a==null?d=y<=c||y>=u?Mr(Pe(f.c),y):Ze(Pe(f.c),y,"0"):a===10&&$?(f=U(new C(f),i+y+1,l),d=Ze(Pe(f.c),f.e,"0")):(ie(a,2,F.length,"Base"),d=r(Ze(Pe(f.c),y,"0"),10,a,E,!0)),E<0&&f.c[0]&&(d="-"+d)),d},o.valueOf=o.toJSON=function(){return Q(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&C.set(e),C}function Ne(e){var t=e|0;return e>0||e===t?t:t-1}function Pe(e){for(var t,r,n=1,o=e.length,s=e[0]+"";n<o;){for(t=e[n++]+"",r=Y-t.length;r--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Et(e,t){var r,n,o=e.c,s=t.c,i=e.s,l=t.s,c=e.e,u=t.e;if(!i||!l)return null;if(r=o&&!o[0],n=s&&!s[0],r||n)return r?n?0:-l:i;if(i!=l)return i;if(r=i<0,n=c==u,!o||!s)return n?0:!o^r?1:-1;if(!n)return c>u^r?1:-1;for(l=(c=o.length)<(u=s.length)?c:u,i=0;i<l;i++)if(o[i]!=s[i])return o[i]>s[i]^r?1:-1;return c==u?0:c>u^r?1:-1}function ie(e,t,r,n){if(e<t||e>r||e!==Fe(e))throw Error(xe+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function jr(e){var t=e.c.length-1;return Ne(e.e/Y)==t&&e.c[t]%2!=0}function Mr(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Ze(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(n=e.length,++t>n){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}hi();const pc=100000n,mc=(e,t={})=>{const{style:r="decimal",compact:n=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,l=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),c=n==="auto"?l>=pc:n,u=typeof i=="bigint"?Number(i):i,g=s&&u!==0&&Math.abs(u)<Math.pow(10,-(o??2)),v=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:g?20:o??2,minimumFractionDigits:g?0:o??2});if(!c)return g?v.format(Go(u)):v.format(i);const S=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(h=>l>=h.threshold);if(S){const h=new Intl.NumberFormat("en-US",{style:r,...r==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),R=Number(i)/S.divisor;return h.format(R)+S.suffix}return g?v.format(Go(u)):v.format(i)};function Go(e){if(e===0)return 0;const t=e.toExponential().split("e"),r=parseInt(t[1]),n=Math.abs(r);return Number(e.toFixed(n))}function ur(e,t=5,r=5){return e?e.length<=t+r?e:`${e.slice(0,t)}...${e.slice(-r)}`:""}function oo(e={}){const{activeAddress:t}=Ke.useWallet(),{activeNetwork:r}=Ke.useNetwork(),{enabled:n=!0,view:o="thumbnail"}=e;return no({queryKey:["nfd",t,r,o],queryFn:async({signal:s})=>{if(!t)return null;const c=await fetch(`${r==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains"}/nfd/lookup?address=${encodeURIComponent(t)}&view=${o}`,{method:"GET",headers:{Accept:"application/json"},signal:s});if(c.status===404)return null;if(!c.ok)throw new Error(`NFD lookup failed: ${c.statusText}`);return(await c.json())[t]},enabled:n&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const gc="https://ipfs.algonode.dev";function qo(e){const t=e.trim();if(t.startsWith("ipfs://")){const r=t.slice(7);return r.length>0?r:null}try{const r=new URL(t);if(r.protocol!=="http:"&&r.protocol!=="https:")return null;const n="/ipfs/",o=r.pathname.indexOf(n);if(o===-1)return null;const s=r.pathname.slice(o+n.length);return s.length>0?s:null}catch{return null}}const pi=async e=>{const t=qo(e);if(!t)return e;const r=`https://images.nf.domains/ipfs/${t}`,n=`${gc}/ipfs/${t}`,o=s=>s.startsWith("image/");try{const s=await fetch(r,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return r}}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}try{const s=await fetch(n,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return n;if(i==="application/json")try{const u=(await(await fetch(n)).json()).image;if(typeof u=="string"&&u.length>0){if(qo(u))return await pi(u);if(u.startsWith("http"))try{const g=await fetch(u,{method:"HEAD"});if(g.ok){const v=g.headers.get("content-type");if(v&&o(v))return u}}catch{console.error("Error checking HTTP image URL")}}}catch{console.error("Error processing JSON metadata")}}}catch{console.error(`Error checking gateway for CID ${t}`)}return n};function so({nfd:e,alt:t,className:r,size:n=40,fallback:o,lightOnly:s=!1}){var g,v,S,h;const i=((v=(g=e==null?void 0:e.properties)==null?void 0:g.userDefined)==null?void 0:v.avatar)||((h=(S=e==null?void 0:e.properties)==null?void 0:S.verified)==null?void 0:h.avatar)||null,l=t||(e==null?void 0:e.name)||"NFD Avatar",{data:c,isLoading:u}=no({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await pi(i):i:null,enabled:!!i,staleTime:3600*1e3,gcTime:1440*60*1e3});return u||!c?o?w.jsx(w.Fragment,{children:o}):w.jsx("div",{"data-wallet-ui":!0,className:Le("flex items-center justify-center rounded-full",r),style:{width:`${n}px`,height:`${n}px`,backgroundColor:s?"#e5e7eb":"var(--wui-color-avatar-bg)"},"aria-label":l,role:"img",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:{width:`${Math.max(n/2,12)}px`,height:`${Math.max(n/2,12)}px`,color:s?"#9ca3af":"var(--wui-color-avatar-icon)"},children:w.jsx("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"})})}):w.jsx("img",{src:c,alt:l,className:Le("rounded-full",r),style:{width:`${n}px`,height:`${n}px`,objectFit:"cover"},loading:"lazy"})}const vc={sm:"py-1.5 pl-2 md:pl-2.5 pr-2 text-sm rounded-lg",md:"py-2.5 pl-3 md:pl-3.5 pr-3 text-base rounded-xl",lg:"py-3 pl-3.5 md:pl-4 pr-3.5 text-lg rounded-xl"},bc={sm:20,md:24,lg:28},yc={sm:"mr-1 md:mr-1.5 h-5 w-5",md:"mr-1 md:mr-2 h-6 w-6",lg:"mr-1.5 md:mr-2.5 h-7 w-7"},Vo={sm:{width:14,height:14},md:{width:18,height:18},lg:{width:20,height:20}},Yr=p.forwardRef(({className:e="",children:t,style:r,size:n="md",...o},s)=>{var g;const{activeAddress:i}=Ke.useWallet(),l=oo({enabled:!!i}),c=((g=l.data)==null?void 0:g.name)??null;return w.jsx("button",{ref:s,"data-wallet-ui":!0,"data-wallet-button":!0,className:Le("flex items-center bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] cursor-pointer font-bold",vc[n],e),style:r,disabled:!1,...o,type:"button",children:t||w.jsxs("div",{className:"flex items-center",children:[i&&w.jsx("div",{className:Le("overflow-hidden",yc[n]),children:w.jsx(so,{nfd:l.data,alt:`${c||i} avatar`,size:bc[n],lightOnly:!0})}),w.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:c||(i?ur(i,6,4):"Connect")}),i&&w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Vo[n].width,height:Vo[n].height,viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:w.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})});Yr.displayName="ConnectedWalletButton";const mi=typeof document<"u"?p.useLayoutEffect:()=>{};function wc(e){const t=p.useRef(null);return mi(()=>{t.current=e},[e]),p.useCallback((...r)=>{const n=t.current;return n==null?void 0:n(...r)},[])}const wt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Ct=e=>e&&"window"in e&&e.window===e?e:wt(e).defaultView||window;function xc(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Ec(e){return xc(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Sc=!1;function io(){return Sc}function gi(e,t){if(!io())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:Ec(r)?r=r.host:r=r.parentNode}return!1}const Un=(e=document)=>{var t;if(!io())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function vi(e){return io()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Xr(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(r=>e.test(r.brand)))||e.test(window.navigator.userAgent)}function ao(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ot(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const lo=ot(function(){return ao(/^Mac/i)}),kc=ot(function(){return ao(/^iPhone/i)}),Cc=ot(function(){return ao(/^iPad/i)||lo()&&navigator.maxTouchPoints>1}),Oc=ot(function(){return kc()||Cc()});ot(function(){return lo()||Oc()});ot(function(){return Xr(/AppleWebKit/i)&&!Ac()});const Ac=ot(function(){return Xr(/Chrome/i)}),Rc=ot(function(){return Xr(/Android/i)});ot(function(){return Xr(/Firefox/i)});function bi(){let e=p.useRef(new Map),t=p.useCallback((o,s,i,l)=>{let c=l!=null&&l.once?(...u)=>{e.current.delete(i),i(...u)}:i;e.current.set(i,{type:s,eventTarget:o,fn:c,options:l}),o.addEventListener(s,c,l)},[]),r=p.useCallback((o,s,i,l)=>{var c;let u=((c=e.current.get(i))===null||c===void 0?void 0:c.fn)||i;o.removeEventListener(s,u,l),e.current.delete(i)},[]),n=p.useCallback(()=>{e.current.forEach((o,s)=>{r(o.eventTarget,o.type,s,o.options)})},[r]);return p.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function Pc(e){return e.mozInputSource===0&&e.isTrusted?!0:Rc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function yi(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Tc(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function wi(e){let t=p.useRef({isFocused:!1,observer:null});mi(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=wc(n=>{e==null||e(n)});return p.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=n.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let l=yi(i);r(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let l=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let Fc=!1,Ar=null,Wn=new Set,hr=new Map,Lt=!1,Hn=!1;const Nc={Tab:!0,Escape:!0};function co(e,t){for(let r of Wn)r(e,t)}function Ic(e){return!(e.metaKey||!lo()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Vr(e){Lt=!0,Ic(e)&&(Ar="keyboard",co("keyboard",e))}function je(e){Ar="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Lt=!0,co("pointer",e))}function xi(e){Pc(e)&&(Lt=!0,Ar="virtual")}function Ei(e){e.target===window||e.target===document||Fc||!e.isTrusted||(!Lt&&!Hn&&(Ar="virtual",co("virtual",e)),Lt=!1,Hn=!1)}function Si(){Lt=!1,Hn=!0}function zn(e){if(typeof window>"u"||typeof document>"u"||hr.get(Ct(e)))return;const t=Ct(e),r=wt(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Lt=!0,n.apply(this,arguments)},r.addEventListener("keydown",Vr,!0),r.addEventListener("keyup",Vr,!0),r.addEventListener("click",xi,!0),t.addEventListener("focus",Ei,!0),t.addEventListener("blur",Si,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",je,!0),r.addEventListener("pointermove",je,!0),r.addEventListener("pointerup",je,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",je,!0),r.addEventListener("mousemove",je,!0),r.addEventListener("mouseup",je,!0)),t.addEventListener("beforeunload",()=>{ki(e)},{once:!0}),hr.set(t,{focus:n})}const ki=(e,t)=>{const r=Ct(e),n=wt(e);t&&n.removeEventListener("DOMContentLoaded",t),hr.has(r)&&(r.HTMLElement.prototype.focus=hr.get(r).focus,n.removeEventListener("keydown",Vr,!0),n.removeEventListener("keyup",Vr,!0),n.removeEventListener("click",xi,!0),r.removeEventListener("focus",Ei,!0),r.removeEventListener("blur",Si,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",je,!0),n.removeEventListener("pointermove",je,!0),n.removeEventListener("pointerup",je,!0)):process.env.NODE_ENV==="test"&&(n.removeEventListener("mousedown",je,!0),n.removeEventListener("mousemove",je,!0),n.removeEventListener("mouseup",je,!0)),hr.delete(r))};function jc(e){const t=wt(e);let r;return t.readyState!=="loading"?zn(e):(r=()=>{zn(e)},t.addEventListener("DOMContentLoaded",r)),()=>ki(e,r)}typeof document<"u"&&jc();function Ci(){return Ar!=="pointer"}const Mc=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function $c(e,t,r){let n=wt(r==null?void 0:r.target);const o=typeof window<"u"?Ct(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Ct(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Ct(r==null?void 0:r.target).HTMLElement:HTMLElement,l=typeof window<"u"?Ct(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return e=e||n.activeElement instanceof o&&!Mc.has(n.activeElement.type)||n.activeElement instanceof s||n.activeElement instanceof i&&n.activeElement.isContentEditable,!(e&&t==="keyboard"&&r instanceof l&&!Nc[r.key])}function Dc(e,t,r){zn(),p.useEffect(()=>{let n=(o,s)=>{$c(!!(r!=null&&r.isTextInput),o,s)&&e(Ci())};return Wn.add(n),()=>{Wn.delete(n)}},t)}function Lc(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:o}=e;const s=p.useCallback(c=>{if(c.target===c.currentTarget)return n&&n(c),o&&o(!1),!0},[n,o]),i=wi(s),l=p.useCallback(c=>{const u=wt(c.target),g=u?Un(u):Un();c.target===c.currentTarget&&g===vi(c.nativeEvent)&&(r&&r(c),o&&o(!0),i(c))},[o,r,i]);return{focusProps:{onFocus:!t&&(r||o||n)?l:void 0,onBlur:!t&&(n||o)?s:void 0}}}function Bc(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:o}=e,s=p.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:l}=bi(),c=p.useCallback(v=>{v.currentTarget.contains(v.target)&&s.current.isFocusWithin&&!v.currentTarget.contains(v.relatedTarget)&&(s.current.isFocusWithin=!1,l(),r&&r(v),o&&o(!1))},[r,o,s,l]),u=wi(c),g=p.useCallback(v=>{if(!v.currentTarget.contains(v.target))return;const S=wt(v.target),h=Un(S);if(!s.current.isFocusWithin&&h===vi(v.nativeEvent)){n&&n(v),o&&o(!0),s.current.isFocusWithin=!0,u(v);let R=v.currentTarget;i(S,"focus",P=>{if(s.current.isFocusWithin&&!gi(R,P.target)){let F=new S.defaultView.FocusEvent("blur",{relatedTarget:P.target});Tc(F,R);let $=yi(F);c($)}},{capture:!0})}},[n,o,u,i,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:g,onBlur:c}}}let Qr=!1,un=0;function Gn(){Qr=!0,setTimeout(()=>{Qr=!1},50)}function Qo(e){e.pointerType==="touch"&&Gn()}function Uc(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Qo):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Gn),un++,()=>{un--,!(un>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Qo):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Gn))}}function Wc(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:o}=e,[s,i]=p.useState(!1),l=p.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;p.useEffect(Uc,[]);let{addGlobalListener:c,removeAllGlobalListeners:u}=bi(),{hoverProps:g,triggerHoverEnd:v}=p.useMemo(()=>{let S=(P,F)=>{if(l.pointerType=F,o||F==="touch"||l.isHovered||!P.currentTarget.contains(P.target))return;l.isHovered=!0;let $=P.currentTarget;l.target=$,c(wt(P.target),"pointerover",C=>{l.isHovered&&l.target&&!gi(l.target,C.target)&&h(C,C.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:$,pointerType:F}),r&&r(!0),i(!0)},h=(P,F)=>{let $=l.target;l.pointerType="",l.target=null,!(F==="touch"||!l.isHovered||!$)&&(l.isHovered=!1,u(),n&&n({type:"hoverend",target:$,pointerType:F}),r&&r(!1),i(!1))},R={};return typeof PointerEvent<"u"?(R.onPointerEnter=P=>{Qr&&P.pointerType==="mouse"||S(P,P.pointerType)},R.onPointerLeave=P=>{!o&&P.currentTarget.contains(P.target)&&h(P,P.pointerType)}):process.env.NODE_ENV==="test"&&(R.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},R.onMouseEnter=P=>{!l.ignoreEmulatedMouseEvents&&!Qr&&S(P,"mouse"),l.ignoreEmulatedMouseEvents=!1},R.onMouseLeave=P=>{!o&&P.currentTarget.contains(P.target)&&h(P,"mouse")}),{hoverProps:R,triggerHoverEnd:h}},[t,r,n,o,l,c,u]);return p.useEffect(()=>{o&&v({currentTarget:l.target},l.pointerType)},[o]),{hoverProps:g,isHovered:s}}function Hc(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,o=p.useRef({isFocused:!1,isFocusVisible:t||Ci()}),[s,i]=p.useState(!1),[l,c]=p.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=p.useCallback(()=>c(o.current.isFocused&&o.current.isFocusVisible),[]),g=p.useCallback(h=>{o.current.isFocused=h,i(h),u()},[u]);Dc(h=>{o.current.isFocusVisible=h,u()},[],{isTextInput:r});let{focusProps:v}=Lc({isDisabled:n,onFocusChange:g}),{focusWithinProps:S}=Bc({isDisabled:!n,onFocusWithinChange:g});return{isFocused:s,isFocusVisible:l,focusProps:n?S:v}}var zc=Object.defineProperty,Gc=(e,t,r)=>t in e?zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dn=(e,t,r)=>(Gc(e,typeof t!="symbol"?t+"":t,r),r);let qc=class{constructor(){dn(this,"current",this.detect()),dn(this,"handoffState","pending"),dn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},_e=new qc;function Jr(e){var t;return _e.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function _r(e){var t,r;return _e.isServer?null:e==null?document:(r=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?r:document}function Oi(e){var t,r;return(r=(t=_r(e))==null?void 0:t.activeElement)!=null?r:null}function Vc(e){return Oi(e)===e}function Ai(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Re(){let e=[],t={addEventListener(r,n,o,s){return r.addEventListener(n,o,s),t.add(()=>r.removeEventListener(n,o,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Ai(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,o){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:o}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=Re();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let o of e.splice(n,1))o()}},dispose(){for(let r of e.splice(0))r()}};return t}function nr(){let[e]=p.useState(Re);return p.useEffect(()=>()=>e.dispose(),[e]),e}let we=(e,t)=>{_e.isServer?p.useEffect(e,t):p.useLayoutEffect(e,t)};function or(e){let t=p.useRef(e);return we(()=>{t.current=e},[e]),t}let oe=function(e){let t=or(e);return p.useCallback((...r)=>t.current(...r),[t])};function Qc(e){let t=e.width/2,r=e.height/2;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function _c(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Kc({disabled:e=!1}={}){let t=p.useRef(null),[r,n]=p.useState(!1),o=nr(),s=oe(()=>{t.current=null,n(!1),o.dispose()}),i=oe(l=>{if(o.dispose(),t.current===null){t.current=l.currentTarget,n(!0);{let c=Jr(l.currentTarget);o.addEventListener(c,"pointerup",s,!1),o.addEventListener(c,"pointermove",u=>{if(t.current){let g=Qc(u);n(_c(g,t.current.getBoundingClientRect()))}},!1),o.addEventListener(c,"pointercancel",s,!1)}}});return{pressed:r,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function bt(e){return p.useMemo(()=>e,Object.values(e))}let Yc=p.createContext(void 0);function uo(){return p.useContext(Yc)}function _o(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Ye(e,t,...r){if(e in t){let o=t[e];return typeof o=="function"?o(...r):o}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ye),n}var qn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(qn||{}),Xc=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Xc||{});function Be(){let e=Zc();return p.useCallback(t=>Jc({mergeRefs:e,...t}),[e])}function Jc({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:o,visible:s=!0,name:i,mergeRefs:l}){l=l??eu;let c=Ri(t,e);if(s)return $r(c,r,n,i,l);let u=o??0;if(u&2){let{static:g=!1,...v}=c;if(g)return $r(v,r,n,i,l)}if(u&1){let{unmount:g=!0,...v}=c;return Ye(g?0:1,{0(){return null},1(){return $r({...v,hidden:!0,style:{display:"none"}},r,n,i,l)}})}return $r(c,r,n,i,l)}function $r(e,t={},r,n,o){let{as:s=r,children:i,refName:l="ref",...c}=fn(e,["unmount","static"]),u=e.ref!==void 0?{[l]:e.ref}:{},g=typeof i=="function"?i(t):i;g=Ti(g),"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let v={};if(t){let S=!1,h=[];for(let[R,P]of Object.entries(t))typeof P=="boolean"&&(S=!0),P===!0&&h.push(R.replace(/([A-Z])/g,F=>`-${F.toLowerCase()}`));if(S){v["data-headlessui-state"]=h.join(" ");for(let R of h)v[`data-${R}`]=""}}if(Ur(s)&&(Object.keys(St(c)).length>0||Object.keys(St(v)).length>0))if(!p.isValidElement(g)||Array.isArray(g)&&g.length>1||ru(g)){if(Object.keys(St(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(St(c)).concat(Object.keys(St(v))).map(S=>` - ${S}`).join(`
76
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(S=>` - ${S}`).join(`
77
77
  `)].join(`
78
- `))}else{let x=g.props,h=x==null?void 0:x.className,k=typeof h=="function"?(...N)=>Uo(h(...N),c.className):Uo(h,c.className),O=k?{className:k}:{},F=yi(g.props,xt(cn(c,["ref"])));for(let N in v)N in F&&delete v[N];return p.cloneElement(g,Object.assign({},F,v,d,{ref:o(qc(g),d.ref)},O))}return p.createElement(s,Object.assign({},cn(c,["ref"]),!Dr(s)&&d,!Dr(s)&&v),g)}function zc(){let e=p.useRef([]),t=p.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function Gc(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function yi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...s){let i=r[n];for(let l of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;l(o,...s)}}});return t}function wi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];for(let n in r)Object.assign(t,{[n](...o){let s=r[n];for(let i of s)i==null||i(...o)}});return t}function Be(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function xt(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function cn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function qc(e){return p.version.split(".")[0]>="19"?e.props.ref:e.ref}function xi(e){if(e!=null&&e.$$typeof===Symbol.for("react.lazy")){let t=e._payload;if(t!=null&&t.status==="fulfilled")return xi(t.value)}return e}function Dr(e){return e===p.Fragment||e===Symbol.for("react.fragment")}function Vc(e){return Dr(e.type)}function Qc(e,t,r){let[n,o]=p.useState(r),s=e!==void 0,i=p.useRef(s),l=p.useRef(!1),c=p.useRef(!1);return s&&!i.current&&!l.current?(l.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!c.current&&(c.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:n,oe(d=>(s||$t.flushSync(()=>o(d)),t==null?void 0:t(d)))]}function _c(e){let[t]=p.useState(e);return t}function Ei(e={},t=null,r=[]){for(let[n,o]of Object.entries(e))Ci(r,Si(t,n),o);return r}function Si(e,t){return e?e+"["+t+"]":t}function Ci(e,t,r){if(Array.isArray(r))for(let[n,o]of r.entries())Ci(e,Si(t,n.toString()),o);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):Yc(r)&&!p.isValidElement(r)&&Ei(r,t,e)}function Kc(e){var t,r;let n=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(n){for(let o of n.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(r=n.requestSubmit)==null||r.call(n)}}function Yc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let Xc="span";var so=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(so||{});function Jc(e,t){var r;let{features:n=1,...o}=e,s={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Le()({ourProps:s,theirProps:o,slot:{},defaultTag:Xc,name:"Hidden"})}let ki=Be(Jc),Zc=p.createContext(null);function eu({children:e}){let t=p.useContext(Zc);if(!t)return p.createElement(p.Fragment,null,e);let{target:r}=t;return r?$t.createPortal(p.createElement(p.Fragment,null,e),r):null}function tu({data:e,form:t,disabled:r,onReset:n,overrides:o}){let[s,i]=p.useState(null),l=rr();return p.useEffect(()=>{if(n&&s)return l.addEventListener(s,"reset",n)},[s,t,n]),p.createElement(eu,null,p.createElement(ru,{setForm:i,formId:t}),Ei(e).map(([c,d])=>p.createElement(ki,{features:so.Hidden,...xt({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:c,value:d,...o})})))}function ru({setForm:e,formId:t}){return p.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:p.createElement(ki,{features:so.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let n=r.closest("form");n&&e(n)}})}let nu=p.createContext(void 0);function Oi(){return p.useContext(nu)}function Ai(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Yr(e){return Ai(e)&&"tagName"in e}function nt(e){return Yr(e)&&"accessKey"in e}function Bt(e){return Yr(e)&&"tabIndex"in e}function ou(e){return Yr(e)&&"style"in e}function su(e){return nt(e)&&e.nodeName==="IFRAME"}function Ri(e){return nt(e)&&e.nodeName==="INPUT"}function Ho(e){return nt(e)&&e.nodeName==="LABEL"}function iu(e){return nt(e)&&e.nodeName==="FIELDSET"}function Ti(e){return nt(e)&&e.nodeName==="LEGEND"}function au(e){return Yr(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Wo(e){let t=e.parentElement,r=null;for(;t&&!iu(t);)Ti(t)&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&lu(r)?!1:n}function lu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Ti(t))return!1;t=t.previousElementSibling}return!0}let Pi=Symbol();function cu(e,t=!0){return Object.assign(e,{[Pi]:t})}function Ye(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let r=oe(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Pi]))?void 0:r}let io=p.createContext(null);io.displayName="DescriptionContext";function Fi(){let e=p.useContext(io);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Fi),t}return e}function uu(){var e,t;return(t=(e=p.useContext(io))==null?void 0:e.value)!=null?t:void 0}let du="p";function fu(e,t){let r=p.useId(),n=oo(),{id:o=`headlessui-description-${r}`,...s}=e,i=Fi(),l=Ye(t);we(()=>i.register(o),[o,i.register]);let c=gt({...i.slot,disabled:n||!1}),d={ref:l,...i.props,id:o};return Le()({ourProps:d,theirProps:s,slot:c,defaultTag:du,name:i.name||"Description"})}let hu=Be(fu);Object.assign(hu,{});var he=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(he||{});let Xr=p.createContext(null);Xr.displayName="LabelContext";function Ii(){let e=p.useContext(Xr);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ii),t}return e}function Mi(e){var t,r,n;let o=(r=(t=p.useContext(Xr))==null?void 0:t.value)!=null?r:void 0;return((n=e==null?void 0:e.length)!=null?n:0)>0?[o,...e].filter(Boolean).join(" "):o}function pu({inherit:e=!1}={}){let t=Mi(),[r,n]=p.useState([]),o=e?[t,...r].filter(Boolean):r;return[o.length>0?o.join(" "):void 0,p.useMemo(()=>function(s){let i=oe(c=>(n(d=>[...d,c]),()=>n(d=>{let g=d.slice(),v=g.indexOf(c);return v!==-1&&g.splice(v,1),g}))),l=p.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return p.createElement(Xr.Provider,{value:l},s.children)},[n])]}let mu="label";function gu(e,t){var r;let n=p.useId(),o=Ii(),s=Oi(),i=oo(),{id:l=`headlessui-label-${n}`,htmlFor:c=s??((r=o.props)==null?void 0:r.htmlFor),passive:d=!1,...g}=e,v=Ye(t);we(()=>o.register(l),[l,o.register]);let x=oe(O=>{let F=O.currentTarget;if(!(O.target!==O.currentTarget&&au(O.target))&&(Ho(F)&&O.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(O),Ho(F))){let N=document.getElementById(F.htmlFor);if(N){let S=N.getAttribute("disabled");if(S==="true"||S==="")return;let $=N.getAttribute("aria-disabled");if($==="true"||$==="")return;(Ri(N)&&(N.type==="file"||N.type==="radio"||N.type==="checkbox")||N.role==="radio"||N.role==="checkbox"||N.role==="switch")&&N.click(),N.focus({preventScroll:!0})}}}),h=gt({...o.slot,disabled:i||!1}),k={ref:v,...o.props,id:l,htmlFor:c,onClick:x};return d&&("onClick"in k&&(delete k.htmlFor,delete k.onClick),"onClick"in g&&delete g.onClick),Le()({ourProps:k,theirProps:g,slot:h,defaultTag:c?mu:"div",name:o.name||"Label"})}let vu=Be(gu),Ni=Object.assign(vu,{});function bu(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function yu(e=bu){return p.useCallback((t,r)=>{if(typeof e=="string"){let n=e;return(t==null?void 0:t[n])===(r==null?void 0:r[n])}return e(t,r)},[e])}function zo(e){if(e===null)return{width:0,height:0};let{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r}}function wu(e,t,r=!1){let[n,o]=p.useState(()=>zo(t));return we(()=>{if(!t||!e)return;let s=Re();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(l=>{let c=zo(t);return c.width===l.width&&c.height===l.height?l:c})}),()=>{s.dispose()}},[t,e]),r?{width:`${n.width}px`,height:`${n.height}px`}:n}var $i=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))($i||{});function xu(e){let t=p.useRef(null),r=oe(o=>{t.current=o.pointerType,!Wo(o.currentTarget)&&o.pointerType==="mouse"&&o.button===$i.Left&&(o.preventDefault(),e(o))}),n=oe(o=>{t.current!=="mouse"&&(Wo(o.currentTarget)||e(o))});return{onPointerDown:r,onClick:n}}let ji=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};var Eu=Object.defineProperty,Su=(e,t,r)=>t in e?Eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cu=(e,t,r)=>(Su(e,t+"",r),r),Di=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Pe=(e,t,r)=>(Di(e,t,"read from private field"),r?r.call(e):t.get(e)),un=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Go=(e,t,r,n)=>(Di(e,t,"write to private field"),t.set(e,r),r),We,cr,ur;let Li=class{constructor(t){un(this,We,{}),un(this,cr,new ji(()=>new Set)),un(this,ur,new Set),Cu(this,"disposables",Re()),Go(this,We,t),Qe.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Pe(this,We)}subscribe(t,r){if(Qe.isServer)return()=>{};let n={selector:t,callback:r,current:t(Pe(this,We))};return Pe(this,ur).add(n),this.disposables.add(()=>{Pe(this,ur).delete(n)})}on(t,r){return Qe.isServer?()=>{}:(Pe(this,cr).get(t).add(r),this.disposables.add(()=>{Pe(this,cr).get(t).delete(r)}))}send(t){let r=this.reduce(Pe(this,We),t);if(r!==Pe(this,We)){Go(this,We,r);for(let n of Pe(this,ur)){let o=n.selector(Pe(this,We));Bi(n.current,o)||(n.current=o,n.callback(o))}for(let n of Pe(this,cr).get(t.type))n(Pe(this,We),t)}}};We=new WeakMap,cr=new WeakMap,ur=new WeakMap;function Bi(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:dn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:dn(e.entries(),t.entries()):qo(e)&&qo(t)?dn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function dn(e,t){do{let r=e.next(),n=t.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}while(!0)}function qo(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function fn(e){let[t,r]=e(),n=Re();return(...o)=>{t(...o),n.dispose(),n.microTask(r)}}var ku=Object.defineProperty,Ou=(e,t,r)=>t in e?ku(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vo=(e,t,r)=>(Ou(e,typeof t!="symbol"?t+"":t,r),r),Ui=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ui||{});let Au={0(e,t){let r=t.id,n=e.stack,o=e.stack.indexOf(r);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(r),n=s,{...e,stack:n}}return{...e,stack:[...e.stack,r]}},1(e,t){let r=t.id,n=e.stack.indexOf(r);if(n===-1)return e;let o=e.stack.slice();return o.splice(n,1),{...e,stack:o}}},Ru=class Hi extends Li{constructor(){super(...arguments),Vo(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Vo(this,"selectors",{isTop:(t,r)=>t.stack[t.stack.length-1]===r,inStack:(t,r)=>t.stack.includes(r)})}static new(){return new Hi({stack:[]})}reduce(t,r){return Ke(r.type,Au,t,r)}};const ao=new ji(()=>Ru.new());var Nr={exports:{}},hn={};/**
78
+ `))}else{let S=g.props,h=S==null?void 0:S.className,R=typeof h=="function"?(...$)=>_o(h(...$),c.className):_o(h,c.className),P=R?{className:R}:{},F=Ri(g.props,St(fn(c,["ref"])));for(let $ in v)$ in F&&delete v[$];return p.cloneElement(g,Object.assign({},F,v,u,{ref:o(tu(g),u.ref)},P))}return p.createElement(s,Object.assign({},fn(c,["ref"]),!Ur(s)&&u,!Ur(s)&&v),g)}function Zc(){let e=p.useRef([]),t=p.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function eu(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function Ri(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let n in r)Object.assign(t,{[n](o,...s){let i=r[n];for(let l of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;l(o,...s)}}});return t}function Pi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(r[o]!=null||(r[o]=[]),r[o].push(n[o])):t[o]=n[o];for(let n in r)Object.assign(t,{[n](...o){let s=r[n];for(let i of s)i==null||i(...o)}});return t}function Ue(e){var t;return Object.assign(p.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function St(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function fn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function tu(e){return p.version.split(".")[0]>="19"?e.props.ref:e.ref}function Ti(e){if(e!=null&&e.$$typeof===Symbol.for("react.lazy")){let t=e._payload;if(t!=null&&t.status==="fulfilled")return Ti(t.value)}return e}function Ur(e){return e===p.Fragment||e===Symbol.for("react.fragment")}function ru(e){return Ur(e.type)}function nu(e,t,r){let[n,o]=p.useState(r),s=e!==void 0,i=p.useRef(s),l=p.useRef(!1),c=p.useRef(!1);return s&&!i.current&&!l.current?(l.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!c.current&&(c.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:n,oe(u=>(s||Dt.flushSync(()=>o(u)),t==null?void 0:t(u)))]}function ou(e){let[t]=p.useState(e);return t}function Fi(e={},t=null,r=[]){for(let[n,o]of Object.entries(e))Ii(r,Ni(t,n),o);return r}function Ni(e,t){return e?e+"["+t+"]":t}function Ii(e,t,r){if(Array.isArray(r))for(let[n,o]of r.entries())Ii(e,Ni(t,n.toString()),o);else r instanceof Date?e.push([t,r.toISOString()]):typeof r=="boolean"?e.push([t,r?"1":"0"]):typeof r=="string"?e.push([t,r]):typeof r=="number"?e.push([t,`${r}`]):r==null?e.push([t,""]):iu(r)&&!p.isValidElement(r)&&Fi(r,t,e)}function su(e){var t,r;let n=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(n){for(let o of n.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(r=n.requestSubmit)==null||r.call(n)}}function iu(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let au="span";var fo=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(fo||{});function lu(e,t){var r;let{features:n=1,...o}=e,s={ref:t,"aria-hidden":(n&2)===2?!0:(r=o["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Be()({ourProps:s,theirProps:o,slot:{},defaultTag:au,name:"Hidden"})}let ji=Ue(lu),cu=p.createContext(null);function uu({children:e}){let t=p.useContext(cu);if(!t)return p.createElement(p.Fragment,null,e);let{target:r}=t;return r?Dt.createPortal(p.createElement(p.Fragment,null,e),r):null}function du({data:e,form:t,disabled:r,onReset:n,overrides:o}){let[s,i]=p.useState(null),l=nr();return p.useEffect(()=>{if(n&&s)return l.addEventListener(s,"reset",n)},[s,t,n]),p.createElement(uu,null,p.createElement(fu,{setForm:i,formId:t}),Fi(e).map(([c,u])=>p.createElement(ji,{features:fo.Hidden,...St({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:r,name:c,value:u,...o})})))}function fu({setForm:e,formId:t}){return p.useEffect(()=>{if(t){let r=document.getElementById(t);r&&e(r)}},[e,t]),t?null:p.createElement(ji,{features:fo.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:r=>{if(!r)return;let n=r.closest("form");n&&e(n)}})}let hu=p.createContext(void 0);function Mi(){return p.useContext(hu)}function $i(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Zr(e){return $i(e)&&"tagName"in e}function st(e){return Zr(e)&&"accessKey"in e}function Wt(e){return Zr(e)&&"tabIndex"in e}function pu(e){return Zr(e)&&"style"in e}function mu(e){return st(e)&&e.nodeName==="IFRAME"}function Di(e){return st(e)&&e.nodeName==="INPUT"}function Ko(e){return st(e)&&e.nodeName==="LABEL"}function gu(e){return st(e)&&e.nodeName==="FIELDSET"}function Li(e){return st(e)&&e.nodeName==="LEGEND"}function vu(e){return Zr(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Yo(e){let t=e.parentElement,r=null;for(;t&&!gu(t);)Li(t)&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&bu(r)?!1:n}function bu(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Li(t))return!1;t=t.previousElementSibling}return!0}let Bi=Symbol();function yu(e,t=!0){return Object.assign(e,{[Bi]:t})}function Xe(...e){let t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]);let r=oe(n=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Bi]))?void 0:r}let ho=p.createContext(null);ho.displayName="DescriptionContext";function Ui(){let e=p.useContext(ho);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ui),t}return e}function wu(){var e,t;return(t=(e=p.useContext(ho))==null?void 0:e.value)!=null?t:void 0}let xu="p";function Eu(e,t){let r=p.useId(),n=uo(),{id:o=`headlessui-description-${r}`,...s}=e,i=Ui(),l=Xe(t);we(()=>i.register(o),[o,i.register]);let c=bt({...i.slot,disabled:n||!1}),u={ref:l,...i.props,id:o};return Be()({ourProps:u,theirProps:s,slot:c,defaultTag:xu,name:i.name||"Description"})}let Su=Ue(Eu);Object.assign(Su,{});var he=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(he||{});let en=p.createContext(null);en.displayName="LabelContext";function Wi(){let e=p.useContext(en);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Wi),t}return e}function Hi(e){var t,r,n;let o=(r=(t=p.useContext(en))==null?void 0:t.value)!=null?r:void 0;return((n=e==null?void 0:e.length)!=null?n:0)>0?[o,...e].filter(Boolean).join(" "):o}function ku({inherit:e=!1}={}){let t=Hi(),[r,n]=p.useState([]),o=e?[t,...r].filter(Boolean):r;return[o.length>0?o.join(" "):void 0,p.useMemo(()=>function(s){let i=oe(c=>(n(u=>[...u,c]),()=>n(u=>{let g=u.slice(),v=g.indexOf(c);return v!==-1&&g.splice(v,1),g}))),l=p.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return p.createElement(en.Provider,{value:l},s.children)},[n])]}let Cu="label";function Ou(e,t){var r;let n=p.useId(),o=Wi(),s=Mi(),i=uo(),{id:l=`headlessui-label-${n}`,htmlFor:c=s??((r=o.props)==null?void 0:r.htmlFor),passive:u=!1,...g}=e,v=Xe(t);we(()=>o.register(l),[l,o.register]);let S=oe(P=>{let F=P.currentTarget;if(!(P.target!==P.currentTarget&&vu(P.target))&&(Ko(F)&&P.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(P),Ko(F))){let $=document.getElementById(F.htmlFor);if($){let C=$.getAttribute("disabled");if(C==="true"||C==="")return;let j=$.getAttribute("aria-disabled");if(j==="true"||j==="")return;(Di($)&&($.type==="file"||$.type==="radio"||$.type==="checkbox")||$.role==="radio"||$.role==="checkbox"||$.role==="switch")&&$.click(),$.focus({preventScroll:!0})}}}),h=bt({...o.slot,disabled:i||!1}),R={ref:v,...o.props,id:l,htmlFor:c,onClick:S};return u&&("onClick"in R&&(delete R.htmlFor,delete R.onClick),"onClick"in g&&delete g.onClick),Be()({ourProps:R,theirProps:g,slot:h,defaultTag:c?Cu:"div",name:o.name||"Label"})}let Au=Ue(Ou),zi=Object.assign(Au,{});function Ru(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Pu(e=Ru){return p.useCallback((t,r)=>{if(typeof e=="string"){let n=e;return(t==null?void 0:t[n])===(r==null?void 0:r[n])}return e(t,r)},[e])}function Xo(e){if(e===null)return{width:0,height:0};let{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r}}function Tu(e,t,r=!1){let[n,o]=p.useState(()=>Xo(t));return we(()=>{if(!t||!e)return;let s=Re();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(l=>{let c=Xo(t);return c.width===l.width&&c.height===l.height?l:c})}),()=>{s.dispose()}},[t,e]),r?{width:`${n.width}px`,height:`${n.height}px`}:n}var Gi=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Gi||{});function Fu(e){let t=p.useRef(null),r=oe(o=>{t.current=o.pointerType,!Yo(o.currentTarget)&&o.pointerType==="mouse"&&o.button===Gi.Left&&(o.preventDefault(),e(o))}),n=oe(o=>{t.current!=="mouse"&&(Yo(o.currentTarget)||e(o))});return{onPointerDown:r,onClick:n}}let qi=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};var Nu=Object.defineProperty,Iu=(e,t,r)=>t in e?Nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ju=(e,t,r)=>(Iu(e,t+"",r),r),Vi=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Te=(e,t,r)=>(Vi(e,t,"read from private field"),r?r.call(e):t.get(e)),hn=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Jo=(e,t,r,n)=>(Vi(e,t,"write to private field"),t.set(e,r),r),ze,dr,fr;let Qi=class{constructor(t){hn(this,ze,{}),hn(this,dr,new qi(()=>new Set)),hn(this,fr,new Set),ju(this,"disposables",Re()),Jo(this,ze,t),_e.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Te(this,ze)}subscribe(t,r){if(_e.isServer)return()=>{};let n={selector:t,callback:r,current:t(Te(this,ze))};return Te(this,fr).add(n),this.disposables.add(()=>{Te(this,fr).delete(n)})}on(t,r){return _e.isServer?()=>{}:(Te(this,dr).get(t).add(r),this.disposables.add(()=>{Te(this,dr).get(t).delete(r)}))}send(t){let r=this.reduce(Te(this,ze),t);if(r!==Te(this,ze)){Jo(this,ze,r);for(let n of Te(this,fr)){let o=n.selector(Te(this,ze));_i(n.current,o)||(n.current=o,n.callback(o))}for(let n of Te(this,dr).get(t.type))n(Te(this,ze),t)}}};ze=new WeakMap,dr=new WeakMap,fr=new WeakMap;function _i(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:pn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:pn(e.entries(),t.entries()):Zo(e)&&Zo(t)?pn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function pn(e,t){do{let r=e.next(),n=t.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}while(!0)}function Zo(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function mn(e){let[t,r]=e(),n=Re();return(...o)=>{t(...o),n.dispose(),n.microTask(r)}}var Mu=Object.defineProperty,$u=(e,t,r)=>t in e?Mu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,es=(e,t,r)=>($u(e,typeof t!="symbol"?t+"":t,r),r),Ki=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ki||{});let Du={0(e,t){let r=t.id,n=e.stack,o=e.stack.indexOf(r);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(r),n=s,{...e,stack:n}}return{...e,stack:[...e.stack,r]}},1(e,t){let r=t.id,n=e.stack.indexOf(r);if(n===-1)return e;let o=e.stack.slice();return o.splice(n,1),{...e,stack:o}}},Lu=class Yi extends Qi{constructor(){super(...arguments),es(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),es(this,"selectors",{isTop:(t,r)=>t.stack[t.stack.length-1]===r,inStack:(t,r)=>t.stack.includes(r)})}static new(){return new Yi({stack:[]})}reduce(t,r){return Ye(r.type,Du,t,r)}};const po=new qi(()=>Lu.new());var Dr={exports:{}},gn={};/**
79
79
  * @license React
80
80
  * use-sync-external-store-with-selector.production.js
81
81
  *
@@ -83,7 +83,7 @@
83
83
  *
84
84
  * This source code is licensed under the MIT license found in the
85
85
  * LICENSE file in the root directory of this source tree.
86
- */var Qo;function Tu(){if(Qo)return hn;Qo=1;var e=p;function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,l=e.useDebugValue;return hn.useSyncExternalStoreWithSelector=function(c,d,g,v,x){var h=o(null);if(h.current===null){var k={hasValue:!1,value:null};h.current=k}else k=h.current;h=i(function(){function F(B){if(!N){if(N=!0,S=B,B=v(B),x!==void 0&&k.hasValue){var H=k.value;if(x(H,B))return $=H}return $=B}if(H=$,r(S,B))return H;var Q=v(B);return x!==void 0&&x(H,Q)?(S=B,H):(S=B,$=Q)}var N=!1,S,$,j=g===void 0?null:g;return[function(){return F(d())},j===null?void 0:function(){return F(j())}]},[d,g,v,x]);var O=n(c,h[0],h[1]);return s(function(){k.hasValue=!0,k.value=O},[O]),l(O),O},hn}var pn={};/**
86
+ */var ts;function Bu(){if(ts)return gn;ts=1;var e=p;function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,l=e.useDebugValue;return gn.useSyncExternalStoreWithSelector=function(c,u,g,v,S){var h=o(null);if(h.current===null){var R={hasValue:!1,value:null};h.current=R}else R=h.current;h=i(function(){function F(L){if(!$){if($=!0,C=L,L=v(L),S!==void 0&&R.hasValue){var U=R.value;if(S(U,L))return j=U}return j=L}if(U=j,r(C,L))return U;var Q=v(L);return S!==void 0&&S(U,Q)?(C=L,U):(C=L,j=Q)}var $=!1,C,j,D=g===void 0?null:g;return[function(){return F(u())},D===null?void 0:function(){return F(D())}]},[u,g,v,S]);var P=n(c,h[0],h[1]);return s(function(){R.hasValue=!0,R.value=P},[P]),l(P),P},gn}var vn={};/**
87
87
  * @license React
88
88
  * use-sync-external-store-with-selector.development.js
89
89
  *
@@ -91,6 +91,6 @@
91
91
  *
92
92
  * This source code is licensed under the MIT license found in the
93
93
  * LICENSE file in the root directory of this source tree.
94
- */var _o;function Pu(){return _o||(_o=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,l=t.useDebugValue;pn.useSyncExternalStoreWithSelector=function(c,d,g,v,x){var h=o(null);if(h.current===null){var k={hasValue:!1,value:null};h.current=k}else k=h.current;h=i(function(){function F(B){if(!N){if(N=!0,S=B,B=v(B),x!==void 0&&k.hasValue){var H=k.value;if(x(H,B))return $=H}return $=B}if(H=$,r(S,B))return H;var Q=v(B);return x!==void 0&&x(H,Q)?(S=B,H):(S=B,$=Q)}var N=!1,S,$,j=g===void 0?null:g;return[function(){return F(d())},j===null?void 0:function(){return F(j())}]},[d,g,v,x]);var O=n(c,h[0],h[1]);return s(function(){k.hasValue=!0,k.value=O},[O]),l(O),O},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),pn}var Ko;function Fu(){return Ko||(Ko=1,process.env.NODE_ENV==="production"?Nr.exports=Tu():Nr.exports=Pu()),Nr.exports}var Iu=Fu();function Ce(e,t,r=Bi){return Iu.useSyncExternalStoreWithSelector(oe(n=>e.subscribe(Mu,n)),oe(()=>e.state),oe(()=>e.state),oe(t),r)}function Mu(e){return e}function Wi(e,t){let r=p.useId(),n=ao.get(t),[o,s]=Ce(n,p.useCallback(i=>[n.selectors.isTop(i,r),n.selectors.inStack(i,r)],[n,r]));return we(()=>{if(e)return n.actions.push(r),()=>n.actions.pop(r)},[n,e,r]),e?s?o:!0:!1}let Un=new Map,fr=new Map;function Yo(e){var t;let r=(t=fr.get(e))!=null?t:0;return fr.set(e,r+1),r!==0?()=>Xo(e):(Un.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Xo(e))}function Xo(e){var t;let r=(t=fr.get(e))!=null?t:1;if(r===1?fr.delete(e):fr.set(e,r-1),r!==1)return;let n=Un.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,Un.delete(e))}function Nu(e,{allowed:t,disallowed:r}={}){let n=Wi(e,"inert-others");we(()=>{var o,s;if(!n)return;let i=Re();for(let c of(o=r==null?void 0:r())!=null?o:[])c&&i.add(Yo(c));let l=(s=t==null?void 0:t())!=null?s:[];for(let c of l){if(!c)continue;let d=Kr(c);if(!d)continue;let g=c.parentElement;for(;g&&g!==d.body;){for(let v of g.children)l.some(x=>v.contains(x))||i.add(Yo(v));g=g.parentElement}}return i.dispose},[n,t,r])}function $u(e,t,r){let n=nr(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});p.useEffect(()=>{if(!e)return;let o=t===null?null:nt(t)?t:t.current;if(!o)return;let s=Re();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,n,e])}let Hn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),ju=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Wn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Wn||{}),Du=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Du||{}),Lu=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Lu||{});function zi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Hn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Bu(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ju)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var lo=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(lo||{});function Gi(e,t=0){var r;return e===((r=Kr(e))==null?void 0:r.body)?!1:Ke(t,{0(){return e.matches(Hn)},1(){let n=e;for(;n!==null;){if(n.matches(Hn))return!0;n=n.parentElement}return!1}})}var Uu=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Uu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Hu=["textarea","input"].join(",");function Wu(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Hu))!=null?r:!1}function qi(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),s=t(n);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function zu(e,t,r=e===null?document.body:qr(e)){return Gu(zi(r),t,{relativeTo:e})}function Gu(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?qr(e[0]):document:qr(e),i=Array.isArray(e)?r?qi(e):e:t&64?Bu(e):zi(e);o.length>0&&i.length>1&&(i=i.filter(h=>!o.some(k=>k!=null&&"current"in k?(k==null?void 0:k.current)===h:k===h))),n=n??(s==null?void 0:s.activeElement);let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=t&32?{preventScroll:!0}:{},g=0,v=i.length,x;do{if(g>=v||g+v<=0)return 0;let h=c+g;if(t&16)h=(h+v)%v;else{if(h<0)return 3;if(h>=v)return 1}x=i[h],x==null||x.focus(d),g+=l}while(x!==vi(x));return t&6&&Wu(x)&&x.select(),2}function Vi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function qu(){return/Android/gi.test(window.navigator.userAgent)}function Jo(){return Vi()||qu()}function Ut(e,t,r,n){let o=nr(r);p.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,n),()=>document.removeEventListener(t,s,n)},[e,t,n])}function Vu(e,t,r,n){let o=nr(r);p.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,n),()=>window.removeEventListener(t,s,n)},[e,t,n])}const Zo=30;function Qu(e,t,r){let n=nr(r),o=p.useCallback(function(l,c){if(l.defaultPrevented)return;let d=c(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let g=(function v(x){return typeof x=="function"?v(x()):Array.isArray(x)||x instanceof Set?x:[x]})(t);for(let v of g)if(v!==null&&(v.contains(d)||l.composed&&l.composedPath().includes(v)))return;return!Gi(d,lo.Loose)&&d.tabIndex!==-1&&l.preventDefault(),n.current(l,d)},[n,t]),s=p.useRef(null);Ut(e,"pointerdown",l=>{var c,d;Jo()||(s.current=((d=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:d[0])||l.target)},!0),Ut(e,"pointerup",l=>{if(Jo()||!s.current)return;let c=s.current;return s.current=null,o(l,()=>c)},!0);let i=p.useRef({x:0,y:0});Ut(e,"touchstart",l=>{i.current.x=l.touches[0].clientX,i.current.y=l.touches[0].clientY},!0),Ut(e,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-i.current.x)>=Zo||Math.abs(c.y-i.current.y)>=Zo))return o(l,()=>Bt(l.target)?l.target:null)},!0),Vu(e,"blur",l=>o(l,()=>su(window.document.activeElement)?window.document.activeElement:null),!0)}function zn(...e){return p.useMemo(()=>Kr(...e),[...e])}var _u=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(_u||{});const $r={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Ku=200,es=5;function Yu(e,{trigger:t,action:r,close:n,select:o}){let s=p.useRef(null),i=p.useRef(null),l=p.useRef(null);Ut(e&&t!==null,"pointerdown",c=>{Ai(c==null?void 0:c.target)&&t!=null&&t.contains(c.target)&&(i.current=c.x,l.current=c.y,s.current=c.timeStamp)}),Ut(e&&t!==null,"pointerup",c=>{var d,g;let v=s.current;if(v===null||(s.current=null,!Bt(c.target))||Math.abs(c.x-((d=i.current)!=null?d:c.x))<es&&Math.abs(c.y-((g=l.current)!=null?g:c.y))<es)return;let x=r(c);switch(x.kind){case 0:return;case 1:{c.timeStamp-v>Ku&&(o(x.target),n());break}case 2:{n();break}}},{capture:!0})}function Xu(e,t){return p.useMemo(()=>{var r;if(e.type)return e.type;let n=(r=e.as)!=null?r:"button";if(typeof n=="string"&&n.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Ju(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Zu(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...s){let i=t[o].call(r,...s);i&&(r=i,n.forEach(l=>l()))}}}function ed(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,e-o);r.style(n,"paddingRight",`${s}px`)}}}function td(){return Vi()?{before({doc:e,d:t,meta:r}){function n(o){for(let s of r().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=Re();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",l=>{if(Bt(l.target))try{let c=l.target.closest("a");if(!c)return;let{hash:d}=new URL(c.href),g=e.querySelector(d);Bt(g)&&!n(g)&&(i=g)}catch{}},!0),t.group(l=>{t.addEventListener(e,"touchstart",c=>{if(l.dispose(),Bt(c.target)&&ou(c.target))if(n(c.target)){let d=c.target;for(;d.parentElement&&n(d.parentElement);)d=d.parentElement;l.style(d,"overscrollBehavior","contain")}else l.style(c.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",l=>{if(Bt(l.target)){if(Ri(l.target))return;if(n(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;s!==c&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function rd(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ts(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Ct=Zu(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Re(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=ts(n.meta),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t),r.computedMeta=ts(r.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},r=[td(),ed(),rd()];r.forEach(({before:n})=>n==null?void 0:n(t)),r.forEach(({after:n})=>n==null?void 0:n(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ct.subscribe(()=>{let e=Ct.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&Ct.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Ct.dispatch("TEARDOWN",r)}});function nd(e,t,r=()=>({containers:[]})){let n=Ju(Ct),o=t?n.get(t):void 0,s=o?o.count>0:!1;return we(()=>{if(!(!t||!e))return Ct.dispatch("PUSH",t,r),()=>Ct.dispatch("POP",t,r)},[e,t]),s}function od(e,t,r=()=>[document.body]){let n=Wi(e,"scroll-lock");nd(n,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],r]}})}function rs(e){return[e.screenX,e.screenY]}function sd(){let e=p.useRef([-1,-1]);return{wasMoved(t){let r=rs(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=rs(t)}}}function id(e=0){let[t,r]=p.useState(e),n=p.useCallback(c=>r(c),[]),o=p.useCallback(c=>r(d=>d|c),[]),s=p.useCallback(c=>(t&c)===c,[t]),i=p.useCallback(c=>r(d=>d&~c),[]),l=p.useCallback(c=>r(d=>d^c),[]);return{flags:t,setFlag:n,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:l}}var ns,os;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ns=process==null?void 0:process.env)==null?void 0:ns.NODE_ENV)==="test"&&typeof((os=Element==null?void 0:Element.prototype)==null?void 0:os.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
95
- `)),[]});var ad=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(ad||{});function ld(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function cd(e,t,r,n){let[o,s]=p.useState(r),{hasFlag:i,addFlag:l,removeFlag:c}=id(e&&o?3:0),d=p.useRef(!1),g=p.useRef(!1),v=rr();return we(()=>{var x;if(e){if(r&&s(!0),!t){r&&l(3);return}return(x=void 0)==null||x.call(n,r),ud(t,{inFlight:d,prepare(){g.current?g.current=!1:g.current=d.current,d.current=!0,!g.current&&(r?(l(3),c(4)):(l(4),c(2)))},run(){g.current?r?(c(3),l(4)):(c(4),l(3)):r?c(1):l(1)},done(){var h;g.current&&hd(t)||(d.current=!1,c(7),r||s(!1),(h=void 0)==null||h.call(n,r))}})}},[e,r,t,v]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ud(e,{prepare:t,run:r,done:n,inFlight:o}){let s=Re();return fd(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(dd(e,n))})}),s.dispose}function dd(e,t){var r,n;let o=Re();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(l=>l instanceof CSSTransition))!=null?n:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(l=>l.finished)).then(()=>{s||t()}),o.dispose)}function fd(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.style.transition=n}function hd(e){var t,r;return((r=(t=e.getAnimations)==null?void 0:t.call(e))!=null?r:[]).some(n=>n instanceof CSSTransition&&n.playState!=="finished")}function pd(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}const Qi={...V},md=Qi.useInsertionEffect,gd=md||(e=>e());function _i(e){const t=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return gd(()=>{t.current=e}),V.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}var Gn=typeof document<"u"?p.useLayoutEffect:p.useEffect;let ss=!1,vd=0;const is=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+vd++;function bd(){const[e,t]=V.useState(()=>ss?is():void 0);return Gn(()=>{e==null&&t(is())},[]),V.useEffect(()=>{ss=!0},[]),e}const yd=Qi.useId,wd=yd||bd;let gr;process.env.NODE_ENV!=="production"&&(gr=new Set);function xd(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=gr)!=null&&e.has(o))){var s;(s=gr)==null||s.add(o),console.warn(o)}}function Ed(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=gr)!=null&&e.has(o))){var s;(s=gr)==null||s.add(o),console.error(o)}}function Sd(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,((n=e.get(t))==null?void 0:n.filter(o=>o!==r))||[])}}}const Cd=V.createContext(null),kd=V.createContext(null),Od=()=>{var e;return((e=V.useContext(Cd))==null?void 0:e.id)||null},Ad=()=>V.useContext(kd),Rd="data-floating-ui-focusable";function Td(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=wd(),s=V.useRef({}),[i]=V.useState(()=>Sd()),l=Od()!=null;if(process.env.NODE_ENV!=="production"){const h=n.reference;h&&!K.isElement(h)&&Ed("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,d]=V.useState(n.reference),g=_i((h,k,O)=>{s.current.openEvent=h?k:void 0,i.emit("openchange",{open:h,event:k,reason:O,nested:l}),r==null||r(h,k,O)}),v=V.useMemo(()=>({setPositionReference:d}),[]),x=V.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return V.useMemo(()=>({dataRef:s,open:t,onOpenChange:g,elements:x,events:i,floatingId:o,refs:v}),[t,g,x,i,o,v])}function Pd(e){e===void 0&&(e={});const{nodeId:t}=e,r=Td({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[s,i]=V.useState(null),[l,c]=V.useState(null),g=(o==null?void 0:o.domReference)||s,v=V.useRef(null),x=Ad();Gn(()=>{g&&(v.current=g)},[g]);const h=K.useFloating$1({...e,elements:{...o,...l&&{reference:l}}}),k=V.useCallback($=>{const j=K.isElement($)?{getBoundingClientRect:()=>$.getBoundingClientRect(),contextElement:$}:$;c(j),h.refs.setReference(j)},[h.refs]),O=V.useCallback($=>{(K.isElement($)||$===null)&&(v.current=$,i($)),(K.isElement(h.refs.reference.current)||h.refs.reference.current===null||$!==null&&!K.isElement($))&&h.refs.setReference($)},[h.refs]),F=V.useMemo(()=>({...h.refs,setReference:O,setPositionReference:k,domReference:v}),[h.refs,O,k]),N=V.useMemo(()=>({...h.elements,domReference:g}),[h.elements,g]),S=V.useMemo(()=>({...h,...n,refs:F,elements:N,nodeId:t}),[h,F,N,t,n]);return Gn(()=>{n.dataRef.current.floatingContext=S;const $=x==null?void 0:x.nodesRef.current.find(j=>j.id===t);$&&($.context=S)}),V.useMemo(()=>({...h,context:S,refs:F,elements:N}),[h,F,N,S])}const as="active",ls="selected";function mn(e,t,r){const n=new Map,o=r==="item";let s=e;if(o&&e){const{[as]:i,[ls]:l,...c}=e;s=c}return{...r==="floating"&&{tabIndex:-1,[Rd]:""},...s,...t.map(i=>{const l=i?i[r]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(c=>{let[d,g]=c;if(!(o&&[as,ls].includes(d)))if(d.indexOf("on")===0){if(n.has(d)||n.set(d,[]),typeof g=="function"){var v;(v=n.get(d))==null||v.push(g),i[d]=function(){for(var x,h=arguments.length,k=new Array(h),O=0;O<h;O++)k[O]=arguments[O];return(x=n.get(d))==null?void 0:x.map(F=>F(...k)).find(F=>F!==void 0)}}}else i[d]=g}),i),{})}}function Fd(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),r=e.map(l=>l==null?void 0:l.floating),n=e.map(l=>l==null?void 0:l.item),o=V.useCallback(l=>mn(l,e,"reference"),t),s=V.useCallback(l=>mn(l,e,"floating"),r),i=V.useCallback(l=>mn(l,e,"item"),n);return V.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function cs(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Id=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:d,...g}=K.evaluate(e,t),{rects:v,elements:{floating:x}}=t,h=r.current[i],k=(d==null?void 0:d.current)||x,O=x.clientTop||k.clientTop,F=x.clientTop!==0,N=k.clientTop!==0,S=x===k;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||xd('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const $={...t,...await K.offset(-h.offsetTop-x.clientTop-v.reference.height/2-h.offsetHeight/2-s).fn(t)},j=await K.detectOverflow(cs($,k.scrollHeight+O+x.clientTop),g),B=await K.detectOverflow($,{...g,elementContext:"reference"}),H=K.max(0,j.top),Q=$.y+H,f=(k.scrollHeight>k.clientHeight?E=>E:K.round)(K.max(0,k.scrollHeight+(F&&S||N?O*2:0)-H-K.max(0,j.bottom)));if(k.style.maxHeight=f+"px",k.scrollTop=H,o){const E=k.offsetHeight<h.offsetHeight*K.min(l,r.current.length)-1||B.top>=-c||B.bottom>=-c;vn.flushSync(()=>o(E))}return n&&(n.current=await K.detectOverflow(cs({...$,y:Q},k.offsetHeight+O+x.clientTop),g)),{y:Q}}});function Md(e,t){const{open:r,elements:n}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:l}=t,c=_i(l),d=V.useRef(!1),g=V.useRef(null),v=V.useRef(null);V.useEffect(()=>{if(!o)return;function h(O){if(O.ctrlKey||!k||s.current==null)return;const F=O.deltaY,N=s.current.top>=-.5,S=s.current.bottom>=-.5,$=k.scrollHeight-k.clientHeight,j=F<0?-1:1,B=F<0?"max":"min";k.scrollHeight<=k.clientHeight||(!N&&F>0||!S&&F<0?(O.preventDefault(),vn.flushSync(()=>{c(H=>H+Math[B](F,$*j))})):/firefox/i.test(pd())&&(k.scrollTop+=F))}const k=(i==null?void 0:i.current)||n.floating;if(r&&k)return k.addEventListener("wheel",h),requestAnimationFrame(()=>{g.current=k.scrollTop,s.current!=null&&(v.current={...s.current})}),()=>{g.current=null,v.current=null,k.removeEventListener("wheel",h)}},[o,r,n.floating,s,i,c]);const x=V.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const h=(i==null?void 0:i.current)||n.floating;if(!(!s.current||!h||!d.current)){if(g.current!==null){const k=h.scrollTop-g.current;(s.current.bottom<-.5&&k<-1||s.current.top<-.5&&k>1)&&vn.flushSync(()=>c(O=>O+k))}requestAnimationFrame(()=>{g.current=h.scrollTop})}}}),[n.floating,c,s,i]);return V.useMemo(()=>o?{floating:x}:{},[o,x])}let or=p.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});or.displayName="FloatingContext";let co=p.createContext(null);co.displayName="PlacementContext";function Nd(e){return p.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function $d(){return p.useContext(or).setReference}function jd(){return p.useContext(or).getReferenceProps}function Dd(){let{getFloatingProps:e,slot:t}=p.useContext(or);return p.useCallback((...r)=>Object.assign({},e(...r),{"data-anchor":t.anchor}),[e,t])}function Ld(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=p.useContext(co),r=p.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);we(()=>{t==null||t(r??null)},[t,r]);let n=p.useContext(or);return p.useMemo(()=>[n.setFloating,e?n.styles:{}],[n.setFloating,e,n.styles])}let us=4;function Bd({children:e,enabled:t=!0}){let[r,n]=p.useState(null),[o,s]=p.useState(0),i=p.useRef(null),[l,c]=p.useState(null);Ud(l);let d=t&&r!==null&&l!==null,{to:g="bottom",gap:v=0,offset:x=0,padding:h=0,inner:k}=Hd(r,l),[O,F="center"]=g.split(" ");we(()=>{d&&s(0)},[d]);let{refs:N,floatingStyles:S,context:$}=Pd({open:d,placement:O==="selection"?F==="center"?"bottom":`bottom-${F}`:F==="center"?`${O}`:`${O}-${F}`,strategy:"absolute",transform:!1,middleware:[K.offset({mainAxis:O==="selection"?0:v,crossAxis:x}),K.shift({padding:h}),O!=="selection"&&K.flip({padding:h}),O==="selection"&&k?Id({...k,padding:h,overflowRef:i,offset:o,minItemsVisible:us,referenceOverflowThreshold:h,onFallbackChange(E){var y,C;if(!E)return;let A=$.elements.floating;if(!A)return;let m=parseFloat(getComputedStyle(A).scrollPaddingBottom)||0,w=Math.min(us,A.childElementCount),T=0,R=0;for(let I of(C=(y=$.elements.floating)==null?void 0:y.childNodes)!=null?C:[])if(nt(I)){let M=I.offsetTop,W=M+I.clientHeight+m,q=A.scrollTop,J=q+A.clientHeight;if(M>=q&&W<=J)w--;else{R=Math.max(0,Math.min(W,J)-Math.max(M,q)),T=I.clientHeight;break}}w>=1&&s(I=>{let M=T*w-R+m;return I>=M?I:M})}}):null,K.size({padding:h,apply({availableWidth:E,availableHeight:y,elements:C}){Object.assign(C.floating.style,{overflow:"auto",maxWidth:`${E}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${y}px)`})}})].filter(Boolean),whileElementsMounted:K.autoUpdate}),[j=O,B=F]=$.placement.split("-");O==="selection"&&(j="selection");let H=p.useMemo(()=>({anchor:[j,B].filter(Boolean).join(" ")}),[j,B]),Q=Md($,{overflowRef:i,onChange:s}),{getReferenceProps:a,getFloatingProps:u}=Fd([Q]),f=oe(E=>{c(E),N.setFloating(E)});return V.createElement(co.Provider,{value:n},V.createElement(or.Provider,{value:{setFloating:f,setReference:N.setReference,styles:S,getReferenceProps:a,getFloatingProps:u,slot:H}},e))}function Ud(e){we(()=>{if(!e)return;let t=new MutationObserver(()=>{let r=window.getComputedStyle(e).maxHeight,n=parseFloat(r);if(isNaN(n))return;let o=parseInt(r);isNaN(o)||n!==o&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Hd(e,t){var r,n,o;let s=gn((r=e==null?void 0:e.gap)!=null?r:"var(--anchor-gap, 0)",t),i=gn((n=e==null?void 0:e.offset)!=null?n:"var(--anchor-offset, 0)",t),l=gn((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:l}}function gn(e,t,r=void 0){let n=rr(),o=oe((c,d)=>{if(c==null)return[r,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!d)return[r,null];let g=ds(c,d);return[g,v=>{let x=Ki(c);{let h=x.map(k=>window.getComputedStyle(d).getPropertyValue(k));n.requestAnimationFrame(function k(){n.nextFrame(k);let O=!1;for(let[N,S]of x.entries()){let $=window.getComputedStyle(d).getPropertyValue(S);if(h[N]!==$){h[N]=$,O=!0;break}}if(!O)return;let F=ds(c,d);g!==F&&(v(F),g=F)})}return n.dispose}]}return[r,null]}),s=p.useMemo(()=>o(e,t)[0],[e,t]),[i=s,l]=p.useState();return we(()=>{let[c,d]=o(e,t);if(l(c),!!d)return d(l)},[e,t]),i}function Ki(e){let t=/var\((.*)\)/.exec(e);if(t){let r=t[1].indexOf(",");if(r===-1)return[t[1]];let n=t[1].slice(0,r).trim(),o=t[1].slice(r+1).trim();return o?[n,...Ki(o)]:[n]}return[]}function ds(e,t){let r=document.createElement("div");t.appendChild(r),r.style.setProperty("margin-top","0px","important"),r.style.setProperty("margin-top",e,"important");let n=parseFloat(window.getComputedStyle(r).marginTop)||0;return t.removeChild(r),n}function Wd({children:e,freeze:t},r){let n=Yi(t,e);return p.isValidElement(n)?p.cloneElement(n,{ref:r}):p.createElement(p.Fragment,null,n)}p.forwardRef(Wd);function Yi(e,t){let[r,n]=p.useState(t);return!e&&r!==t&&n(t),e?r:t}let uo=p.createContext(null);uo.displayName="OpenClosedContext";var vr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(vr||{});function zd(){return p.useContext(uo)}function Gd({value:e,children:t}){return p.createElement(uo.Provider,{value:e},t)}function qd(e){throw new Error("Unexpected object: "+e)}var ce=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ce||{});function jr(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),o=n??-1;switch(e.focus){case 0:{for(let s=0;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 1:{o===-1&&(o=r.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 2:{for(let s=o+1;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 3:{for(let s=r.length-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 4:{for(let s=0;s<r.length;++s)if(t.resolveId(r[s],s,r)===e.id)return s;return n}case 5:return null;default:qd(e)}}function Xi(e){let t=oe(e),r=p.useRef(!1);p.useEffect(()=>(r.current=!1,()=>{r.current=!0,bi(()=>{r.current&&t()})}),[t])}function Vd(){let e=typeof document>"u";return"useSyncExternalStore"in V?(t=>t.useSyncExternalStore)(V)(()=>()=>{},()=>!1,()=>!e):!1}function Qd(){let e=Vd(),[t,r]=V.useState(Qe.isHandoffComplete);return t&&Qe.isHandoffComplete===!1&&r(!1),V.useEffect(()=>{t!==!0&&r(!0)},[t]),V.useEffect(()=>Qe.handoff(),[]),e?!1:t}let _d=p.createContext(!1);function Kd(){return p.useContext(_d)}function Yd(e){let t=Kd(),r=p.useContext(Zi),[n,o]=p.useState(()=>{var s;if(!t&&r!==null)return(s=r.current)!=null?s:null;if(Qe.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return p.useEffect(()=>{n!==null&&(e!=null&&e.body.contains(n)||e==null||e.body.appendChild(n))},[n,e]),p.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let Ji=p.Fragment,Xd=Be(function(e,t){let{ownerDocument:r=null,...n}=e,o=p.useRef(null),s=Ye(cu(h=>{o.current=h}),t),i=zn(o.current),l=r??i,c=Yd(l),d=p.useContext(tf),g=rr(),v=Qd(),x=Le();return Xi(()=>{var h;c&&c.childNodes.length<=0&&((h=c.parentElement)==null||h.removeChild(c))}),!c||!v?null:$t.createPortal(p.createElement("div",{"data-headlessui-portal":"",ref:h=>{g.dispose(),d&&h&&g.add(d.register(h))}},x({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:Ji,name:"Portal"})),c)});function Jd(e,t){let r=Ye(t),{enabled:n=!0,ownerDocument:o,...s}=e,i=Le();return n?p.createElement(Xd,{...s,ownerDocument:o,ref:r}):i({ourProps:{ref:r},theirProps:s,slot:{},defaultTag:Ji,name:"Portal"})}let Zd=p.Fragment,Zi=p.createContext(null);function ef(e,t){let{target:r,...n}=e,o={ref:Ye(t)},s=Le();return p.createElement(Zi.Provider,{value:r},s({ourProps:o,theirProps:n,defaultTag:Zd,name:"Popover.Group"}))}let tf=p.createContext(null),rf=Be(Jd),nf=Be(ef),of=Object.assign(rf,{Group:nf});const Lr={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ea(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function sf(e,t,r){let n=Re();if(t.kind==="Tracked"){let o=function(){s!==ea(e)&&(n.dispose(),r())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),n.add(()=>i.disconnect()),n.addEventListener(window,"scroll",o,{passive:!0}),n.addEventListener(window,"resize",o)}return()=>n.dispose()}let fs=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function hs(e){var t,r;let n=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!nt(o))return n;let s=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let i=s?(r=o.innerText)!=null?r:"":n;return fs.test(i)&&(i=i.replace(fs,"")),i}function af(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():hs(s).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return hs(e).trim()}function lf(e){let t=p.useRef(""),r=p.useRef("");return oe(()=>{let n=e.current;if(!n)return"";let o=n.innerText;if(t.current===o)return r.current;let s=af(n).trim().toLowerCase();return t.current=o,r.current=s,s})}var cf=Object.defineProperty,uf=(e,t,r)=>t in e?cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ps=(e,t,r)=>(uf(e,typeof t!="symbol"?t+"":t,r),r),ve=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ve||{}),pt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(pt||{}),Br=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Br||{}),ta=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(ta||{});function ms(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=qi(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=r?n.indexOf(r):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let df={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Lr.Tracked(ea(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:ce.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let r=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(s=>n(s.dataRef.current.value));return o!==-1&&(r=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:r,__demoMode:!1,buttonPositionState:Lr.Idle}},2(e,t){var r,n,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(r=t.trigger)!=null?r:1,__demoMode:!1};if(t.focus===ce.Nothing)return{...l,activeOptionIndex:null};if(t.focus===ce.Specific)return{...l,activeOptionIndex:e.options.findIndex(g=>g.id===t.id)};if(t.focus===ce.Previous){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,x=jr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(x!==null){let h=e.options[x].dataRef.current.domRef;if(((n=v.current)==null?void 0:n.previousElementSibling)===h.current||((o=h.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:x}}}}else if(t.focus===ce.Next){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,x=jr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(x!==null){let h=e.options[x].dataRef.current.domRef;if(((s=v.current)==null?void 0:s.nextElementSibling)===h.current||((i=h.current)==null?void 0:i.nextElementSibling)===null)return{...l,activeOptionIndex:x}}}}let c=ms(e),d=jr(t,{resolveItems:()=>c.options,resolveActiveIndex:()=>c.activeOptionIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});return{...l,...c,activeOptionIndex:d}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(i=>{var l;return!i.dataRef.current.disabled&&((l=i.dataRef.current.textValue)==null?void 0:l.startsWith(n))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let r=e.options.concat(t.options),n=e.activeOptionIndex;if(e.pendingFocus.focus!==ce.Nothing&&(n=jr(e.pendingFocus,{resolveItems:()=>r,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=r.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(n=s)}}return{...e,options:r,activeOptionIndex:n,pendingFocus:{focus:ce.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let r=e.options,n=[],o=new Set(t.options);for(let[s,i]of r.entries())if(o.has(i.id)&&(n.push(s),o.delete(i.id),o.size===0))break;if(n.length>0){r=r.slice();for(let s of n.reverse())r.splice(s,1)}return{...e,options:r,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...ms(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Lr.Moved}}};class fo extends Li{constructor(t){super(t),ps(this,"actions",{onChange:r=>{let{onChange:n,compare:o,mode:s,value:i}=this.state.dataRef.current;return Ke(s,{0:()=>n==null?void 0:n(r),1:()=>{let l=i.slice(),c=l.findIndex(d=>o(d,r));return c===-1?l.push(r):l.splice(c,1),n==null?void 0:n(l)}})},registerOption:fn(()=>{let r=[],n=new Set;return[(o,s)=>{n.has(s)||(n.add(s),r.push({id:o,dataRef:s}))},()=>(n.clear(),this.send({type:6,options:r.splice(0)}))]}),unregisterOption:fn(()=>{let r=[];return[n=>r.push(n),()=>{this.send({type:7,options:r.splice(0)})}]}),goToOption:fn(()=>{let r=null;return[(n,o)=>{r={type:2,...n,trigger:o}},()=>r&&this.send(r)]}),closeListbox:()=>{this.send({type:1})},openListbox:r=>{this.send({type:0,focus:r})},selectActiveOption:()=>{var r;if(this.state.activeOptionIndex!==null){let{dataRef:n}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(n.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(r=this.state.buttonElement)==null||r.focus({preventScroll:!0}))},selectOption:r=>{this.send({type:5,value:r})},search:r=>{this.send({type:3,value:r})},clearSearch:()=>{this.send({type:4})},setButtonElement:r=>{this.send({type:8,element:r})},setOptionsElement:r=>{this.send({type:9,element:r})}}),ps(this,"selectors",{activeDescendantId(r){var n;let o=r.activeOptionIndex,s=r.options;return o===null||(n=s[o])==null?void 0:n.id},isActive(r,n){var o;let s=r.activeOptionIndex,i=r.options;return s!==null?((o=i[s])==null?void 0:o.id)===n:!1},hasFrozenValue(r){return r.frozenValue},shouldScrollIntoView(r,n){return r.__demoMode||r.listboxState!==0||r.activationTrigger===0?!1:this.isActive(r,n)},didButtonMove(r){return r.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let r=this.state.id,n=ao.get(null);this.disposables.add(n.on(Ui.Push,o=>{!n.selectors.isTop(o,r)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>n.actions.push(r)),this.on(1,()=>n.actions.pop(r))}this.disposables.group(r=>{this.on(1,n=>{n.buttonElement&&(r.dispose(),r.add(sf(n.buttonElement,n.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(r,n)=>{var o;this.actions.onChange(n.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:r=!1}){return new fo({id:t,dataRef:{current:{}},listboxState:r?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ce.Nothing},frozenValue:!1,__demoMode:r,buttonPositionState:Lr.Idle})}reduce(t,r){return Ke(r.type,df,t,r)}}const ra=p.createContext(null);function ho(e){let t=p.useContext(ra);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,na),r}return t}function na({id:e,__demoMode:t=!1}){let r=p.useMemo(()=>fo.new({id:e,__demoMode:t}),[]);return Xi(()=>r.dispose()),r}let Jr=p.createContext(null);Jr.displayName="ListboxDataContext";function Or(e){let t=p.useContext(Jr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Or),r}return t}let ff=p.Fragment;function hf(e,t){let r=p.useId(),n=oo(),{value:o,defaultValue:s,form:i,name:l,onChange:c,by:d,invalid:g=!1,disabled:v=n||!1,horizontal:x=!1,multiple:h=!1,__demoMode:k=!1,...O}=e;const F=x?"horizontal":"vertical";let N=Ye(t),S=_c(s),[$=h?[]:void 0,j]=Qc(o,c,S),B=na({id:r,__demoMode:k}),H=p.useRef({static:!1,hold:!1}),Q=p.useRef(new Map),a=yu(d),u=p.useCallback(q=>Ke(f.mode,{[pt.Multi]:()=>$.some(J=>a(J,q)),[pt.Single]:()=>a($,q)}),[$]),f=gt({value:$,disabled:v,invalid:g,mode:h?pt.Multi:pt.Single,orientation:F,onChange:j,compare:a,isSelected:u,optionsPropsRef:H,listRef:Q});we(()=>{B.state.dataRef.current=f},[f]);let E=Ce(B,q=>q.listboxState),y=ao.get(null),C=Ce(y,p.useCallback(q=>y.selectors.isTop(q,r),[y,r])),[A,m]=Ce(B,q=>[q.buttonElement,q.optionsElement]);Qu(C,[A,m],(q,J)=>{B.send({type:ta.CloseListbox}),Gi(J,lo.Loose)||(q.preventDefault(),A==null||A.focus())});let w=gt({open:E===ve.Open,disabled:v,invalid:g,value:$}),[T,R]=pu({inherit:!0}),I={ref:N},M=p.useCallback(()=>{if(S!==void 0)return j==null?void 0:j(S)},[j,S]),W=Le();return p.createElement(R,{value:T,props:{htmlFor:A==null?void 0:A.id},slot:{open:E===ve.Open,disabled:v}},p.createElement(Bd,null,p.createElement(ra.Provider,{value:B},p.createElement(Jr.Provider,{value:f},p.createElement(Gd,{value:Ke(E,{[ve.Open]:vr.Open,[ve.Closed]:vr.Closed})},l!=null&&$!=null&&p.createElement(tu,{disabled:v,data:{[l]:$},form:i,onReset:M}),W({ourProps:I,theirProps:O,slot:w,defaultTag:ff,name:"Listbox"}))))))}let pf="button";function mf(e,t){let r=p.useId(),n=Oi(),o=Or("Listbox.Button"),s=ho("Listbox.Button"),{id:i=n||`headlessui-listbox-button-${r}`,disabled:l=o.disabled||!1,autoFocus:c=!1,...d}=e,g=Ye(t,$d(),s.actions.setButtonElement),v=jd(),[x,h,k]=Ce(s,m=>[m.listboxState,m.buttonElement,m.optionsElement]),O=x===ve.Open;Yu(O,{trigger:h,action:p.useCallback(m=>{if(h!=null&&h.contains(m.target))return $r.Ignore;let w=m.target.closest('[role="option"]:not([data-disabled])');return nt(w)?$r.Select(w):k!=null&&k.contains(m.target)?$r.Ignore:$r.Close},[h,k]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let F=oe(m=>{switch(m.key){case he.Enter:Kc(m.currentTarget);break;case he.Space:case he.ArrowDown:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.First});break;case he.ArrowUp:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.Last});break}}),N=oe(m=>{switch(m.key){case he.Space:m.preventDefault();break}}),S=xu(m=>{var w;s.state.listboxState===ve.Open?($t.flushSync(()=>s.actions.closeListbox()),(w=s.state.buttonElement)==null||w.focus({preventScroll:!0})):(m.preventDefault(),s.actions.openListbox({focus:ce.Nothing}))}),$=oe(m=>m.preventDefault()),j=Mi([i]),B=uu(),{isFocusVisible:H,focusProps:Q}=Ic({autoFocus:c}),{isHovered:a,hoverProps:u}=Fc({isDisabled:l}),{pressed:f,pressProps:E}=Bc({disabled:l}),y=gt({open:x===ve.Open,active:f||x===ve.Open,disabled:l,invalid:o.invalid,value:o.value,hover:a,focus:H,autofocus:c}),C=Ce(s,m=>m.listboxState===ve.Open),A=wi(v(),{ref:g,id:i,type:Xu(e,h),"aria-haspopup":"listbox","aria-controls":k==null?void 0:k.id,"aria-expanded":C,"aria-labelledby":j,"aria-describedby":B,disabled:l||void 0,autoFocus:c,onKeyDown:F,onKeyUp:N,onKeyPress:$},S,Q,u,E);return Le()({ourProps:A,theirProps:d,slot:y,defaultTag:pf,name:"Listbox.Button"})}let oa=p.createContext(!1),gf="div",vf=Bn.RenderStrategy|Bn.Static;function bf(e,t){let r=p.useId(),{id:n=`headlessui-listbox-options-${r}`,anchor:o,portal:s=!1,modal:i=!0,transition:l=!1,...c}=e,d=Nd(o),[g,v]=p.useState(null);d&&(s=!0);let x=Or("Listbox.Options"),h=ho("Listbox.Options"),[k,O,F,N]=Ce(h,D=>[D.listboxState,D.buttonElement,D.optionsElement,D.__demoMode]),S=zn(O),$=zn(F),j=zd(),[B,H]=cd(l,g,j!==null?(j&vr.Open)===vr.Open:k===ve.Open);$u(B,O,h.actions.closeListbox);let Q=N?!1:i&&k===ve.Open;od(Q,$);let a=N?!1:i&&k===ve.Open;Nu(a,{allowed:p.useCallback(()=>[O,F],[O,F])});let u=Ce(h,h.selectors.didButtonMove)?!1:B,f=Ce(h,h.selectors.hasFrozenValue)&&!e.static,E=Yi(f,x.value),y=p.useCallback(D=>x.compare(E,D),[x.compare,E]),C=Ce(h,D=>{var te;if(d==null||!((te=d==null?void 0:d.to)!=null&&te.includes("selection")))return null;let $e=D.options.findIndex(se=>y(se.dataRef.current.value));return $e===-1&&($e=0),$e}),A=(()=>{if(d==null)return;if(C===null)return{...d,inner:void 0};let D=Array.from(x.listRef.current.values());return{...d,inner:{listRef:{current:D},index:C}}})(),[m,w]=Ld(A),T=Dd(),R=Ye(t,d?m:null,h.actions.setOptionsElement,v),I=rr();p.useEffect(()=>{let D=F;D&&k===ve.Open&&(jc(D)||D==null||D.focus({preventScroll:!0}))},[k,F]);let M=oe(D=>{var te;switch(I.dispose(),D.key){case he.Space:if(h.state.searchQuery!=="")return D.preventDefault(),D.stopPropagation(),h.actions.search(D.key);case he.Enter:D.preventDefault(),D.stopPropagation(),h.actions.selectActiveOption();break;case Ke(x.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.Next});case Ke(x.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.Previous});case he.Home:case he.PageUp:return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.First});case he.End:case he.PageDown:return D.preventDefault(),D.stopPropagation(),h.actions.goToOption({focus:ce.Last});case he.Escape:D.preventDefault(),D.stopPropagation(),$t.flushSync(()=>h.actions.closeListbox()),(te=h.state.buttonElement)==null||te.focus({preventScroll:!0});return;case he.Tab:D.preventDefault(),D.stopPropagation(),$t.flushSync(()=>h.actions.closeListbox()),zu(h.state.buttonElement,D.shiftKey?Wn.Previous:Wn.Next);break;default:D.key.length===1&&(h.actions.search(D.key),I.setTimeout(()=>h.actions.clearSearch(),350));break}}),W=Ce(h,D=>{var te;return(te=D.buttonElement)==null?void 0:te.id}),q=gt({open:k===ve.Open}),J=wi(d?T():{},{id:n,ref:R,"aria-activedescendant":Ce(h,h.selectors.activeDescendantId),"aria-multiselectable":x.mode===pt.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":x.orientation,onKeyDown:M,role:"listbox",tabIndex:k===ve.Open?0:void 0,style:{...c.style,...w,"--button-width":wu(B,O,!0).width},...ld(H)}),ne=Le(),L=p.useMemo(()=>x.mode===pt.Multi?x:{...x,isSelected:y},[x,y]);return p.createElement(of,{enabled:s?e.static||B:!1,ownerDocument:S},p.createElement(Jr.Provider,{value:L},ne({ourProps:J,theirProps:c,slot:q,defaultTag:gf,features:vf,visible:u,name:"Listbox.Options"})))}let yf="div";function wf(e,t){let r=p.useId(),{id:n=`headlessui-listbox-option-${r}`,disabled:o=!1,value:s,...i}=e,l=p.useContext(oa)===!0,c=Or("Listbox.Option"),d=ho("Listbox.Option"),g=Ce(d,f=>d.selectors.isActive(f,n)),v=c.isSelected(s),x=p.useRef(null),h=lf(x),k=nr({disabled:o,value:s,domRef:x,get textValue(){return h()}}),O=Ye(t,x,f=>{f?c.listRef.current.set(n,f):c.listRef.current.delete(n)}),F=Ce(d,f=>d.selectors.shouldScrollIntoView(f,n));we(()=>{if(F)return Re().requestAnimationFrame(()=>{var f,E;(E=(f=x.current)==null?void 0:f.scrollIntoView)==null||E.call(f,{block:"nearest"})})},[F,x]),we(()=>{if(!l)return d.actions.registerOption(n,k),()=>d.actions.unregisterOption(n)},[k,n,l]);let N=oe(f=>{if(o)return f.preventDefault();d.actions.selectOption(s)}),S=oe(()=>{if(o)return d.actions.goToOption({focus:ce.Nothing});d.actions.goToOption({focus:ce.Specific,id:n})}),$=sd(),j=oe(f=>$.update(f)),B=oe(f=>{$.wasMoved(f)&&(o||g&&d.state.activationTrigger===Br.Pointer||d.actions.goToOption({focus:ce.Specific,id:n},Br.Pointer))}),H=oe(f=>{$.wasMoved(f)&&(o||g&&d.state.activationTrigger===Br.Pointer&&d.actions.goToOption({focus:ce.Nothing}))}),Q=gt({active:g,focus:g,selected:v,disabled:o,selectedOption:v&&l}),a=l?{}:{id:n,ref:O,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":v,disabled:void 0,onClick:N,onFocus:S,onPointerEnter:j,onMouseEnter:j,onPointerMove:B,onMouseMove:B,onPointerLeave:H,onMouseLeave:H},u=Le();return!v&&l?null:u({ourProps:a,theirProps:i,slot:Q,defaultTag:yf,name:"Listbox.Option"})}let xf=p.Fragment;function Ef(e,t){let{options:r,placeholder:n,...o}=e,s={ref:Ye(t)},i=Or("ListboxSelectedOption"),l=gt({}),c=i.value===void 0||i.value===null||i.mode===pt.Multi&&Array.isArray(i.value)&&i.value.length===0,d=Le();return p.createElement(oa.Provider,{value:!0},d({ourProps:s,theirProps:{...o,children:p.createElement(p.Fragment,null,n&&c?n:r)},slot:l,defaultTag:xf,name:"ListboxSelectedOption"}))}let Sf=Be(hf),sa=Be(mf),Cf=Ni,ia=Be(bf),aa=Be(wf),kf=Be(Ef),Of=Object.assign(Sf,{Button:sa,Label:Cf,Options:ia,Option:aa,SelectedOption:kf});function la(e={}){const{activeAddress:t,algodClient:r}=_e.useWallet(),{enabled:n=!0}=e;return Xn({queryKey:["account-info",t],queryFn:async()=>{if(!t||!r)return null;try{return await r.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:n&&!!t&&!!r,refetchOnWindowFocus:!0})}function ir({slot:e,ctx:t}){const{menuItemsBySlot:r}=Cr(),n=r[e];return!n||n.length===0?null:P.jsx(P.Fragment,{children:n.filter(o=>!o.enabled||o.enabled(t)).map(o=>P.jsx(p.Fragment,{children:o.render(t)},o.key))})}function Af({className:e,scale:t=.85}){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:er("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor",children:P.jsx("path",{d:"M23.98 23.99h-3.75l-2.44-9.07-5.25 9.07H8.34l8.1-14.04-1.3-4.88L4.22 24H.02L13.88 0h3.67l1.61 5.96h3.79l-2.59 4.5 3.62 13.53z"})})}function Rf({children:e}){var ne;const{activeAddress:t,activeWallet:r}=_e.useWallet(),{theme:n,resolvedTheme:o}=tr(),{openDialog:s,closeDialog:i,panels:l}=Cr(),[c,d]=p.useState(!1),[g,v]=p.useState(null),[x,h]=p.useState(!1),[k,O]=p.useState(()=>{const L=localStorage.getItem("uwui:balance-preference");return L?L==="available":!1}),F=n==="system"?void 0:n,N=Jn({enabled:!!t}),S=((ne=N.data)==null?void 0:ne.name)??null,{data:$}=la({enabled:!!t}),j=p.useMemo(()=>!$||$.amount===void 0?null:Number($.amount)/1e6,[$]),B=p.useMemo(()=>{if(!$||$.amount===void 0||$.minBalance===void 0)return null;const L=Number($.amount)-Number($.minBalance);return Math.max(0,L/1e6)},[$]),H=k?B:j,{refs:Q,floatingStyles:a,context:u}=K.useFloating({open:c,onOpenChange:L=>{d(L),L||v(null)},placement:"bottom-end",middleware:[K.offset(8),K.flip(),K.shift()],whileElementsMounted:K.autoUpdate}),f=K.useClick(u),E=K.useDismiss(u,{outsidePressEvent:"mousedown"}),{getReferenceProps:y,getFloatingProps:C}=K.useInteractions([f,E]),A=K.useId(),m=()=>{t&&(navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3))},w=async()=>{if(r)try{await r.disconnect(),d(!1)}catch(L){console.error("Error disconnecting wallet:",L)}},T=L=>{r&&r.setActiveAccount&&r.setActiveAccount(L)},R=()=>{const L=!k;O(L),localStorage.setItem("uwui:balance-preference",L?"available":"total")},I=p.useMemo(()=>({activeAddress:t,activeWallet:r,theme:n,resolvedTheme:o,closeMenu:()=>d(!1),openDialog:s,closeDialog:i,setActivePanel:v,activePanel:g}),[t,r,n,o,s,i,g]),M=p.useMemo(()=>l.filter(L=>!L.enabled||L.enabled(I)),[l,I]),W=g?l.find(L=>L.key===g):null,q=e||P.jsx(Qr,{}),J=p.cloneElement(q,y({ref:Q.setReference}));return P.jsxs(P.Fragment,{children:[J,c&&P.jsx(K.FloatingPortal,{children:P.jsx(K.FloatingFocusManager,{context:u,modal:!1,children:P.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":F,children:P.jsx("div",{ref:Q.setFloating,style:a,...C(),role:"menu","aria-labelledby":A,className:"z-50 w-80 rounded-xl bg-[var(--wui-color-bg)] shadow-xl border border-[var(--wui-color-border)]",children:P.jsx("div",{className:"p-4",children:W?P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx("button",{onClick:()=>v(null),className:"p-1 rounded-md hover:bg-[var(--wui-color-bg-secondary)] transition-colors text-[var(--wui-color-text-secondary)]","aria-label":"Back to menu",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:P.jsx("path",{d:"m15 18-6-6 6-6"})})}),P.jsx("h3",{className:"text-sm font-medium text-[var(--wui-color-text)]",children:W.label})]}),W.render({ctx:I,goBack:()=>v(null)})]}):P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[P.jsx("div",{className:"h-12 w-12 overflow-hidden",children:P.jsx(Zn,{nfd:N.data,alt:`${S||t} avatar`,size:48})}),P.jsxs("div",{children:[P.jsx("h3",{id:A,className:"text-lg font-bold text-[var(--wui-color-text)] max-w-[220px] truncate wallet-custom-font",children:S||(t?lr(t,6,4):"My Wallet")}),S&&t&&P.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:lr(t,6,4)})]})]}),P.jsx("div",{className:"mb-4 bg-[var(--wui-color-bg-secondary)] rounded-lg p-3",children:P.jsxs("div",{className:"flex justify-between items-center",children:[H!==null&&P.jsxs("span",{className:"text-base font-medium text-[var(--wui-color-text)] flex items-center gap-1",children:[sc(H,{fractionDigits:4}),P.jsx(Af,{})]}),P.jsxs("button",{onClick:R,className:"flex items-center gap-1 text-sm text-[var(--wui-color-text-secondary)] bg-[var(--wui-color-bg-tertiary)] py-1 pl-2.5 pr-2 rounded-md hover:brightness-90 transition-all focus:outline-none",title:k?"Show total balance":"Show available balance",children:[k?"Available":"Total",P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-0.5 opacity-80",children:[P.jsx("path",{d:"m17 10-5-5-5 5"}),P.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),P.jsx(ir,{slot:"after-balance",ctx:I}),r&&r.accounts&&r.accounts.length>1&&P.jsx("div",{className:"mb-4",children:P.jsxs(Of,{value:t||"",onChange:T,children:[P.jsx(Ni,{className:"block text-sm font-medium text-[var(--wui-color-text-secondary)] mb-1",children:"Select Account"}),P.jsxs("div",{className:"relative mt-1",children:[P.jsxs(sa,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-[var(--wui-color-border)] bg-[var(--wui-color-bg-secondary)] py-2 px-3 text-left text-[var(--wui-color-text)] shadow-sm focus:outline-none focus:ring-2 focus:ring-[var(--wui-color-primary)] focus:border-transparent text-sm",children:[P.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?lr(t,6,4):"Select account"}),P.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-[var(--wui-color-text-secondary)]","aria-hidden":"true",children:P.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),P.jsx(ia,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-[var(--wui-color-bg-secondary)] py-1 shadow-lg ring-1 ring-black/5 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:r.accounts.map(L=>P.jsxs(aa,{value:L.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-[var(--wui-color-text)] data-[focus]:bg-[var(--wui-color-bg-hover)] data-[focus]:outline-none",children:[P.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:lr(L.address,6,4)}),P.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[var(--wui-color-primary)] group-[&:not([data-selected])]:hidden",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:P.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},L.address))})]})]})}),P.jsx(ir,{slot:"after-accounts",ctx:I}),P.jsx("div",{className:"border-t border-[var(--wui-color-border)] mt-2 mb-2"}),r&&P.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[P.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:r.metadata.icon?P.jsx("img",{src:r.metadata.icon,alt:`${r.metadata.name} icon`,className:"max-w-full max-h-full"}):P.jsx("div",{className:"h-5 w-5 rounded-full bg-[var(--wui-color-bg-tertiary)] flex items-center justify-center",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 text-[var(--wui-color-text-tertiary)]",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M17 9c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9zm-1 0v8h-4V9h4zM8 4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V4zM3 3h4v14H3V3z",clipRule:"evenodd"})})})}),P.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:r.metadata.name})]}),P.jsx(ir,{slot:"after-wallet-info",ctx:I}),P.jsx(ir,{slot:"before-actions",ctx:I}),M.length>0&&P.jsx("div",{className:"flex flex-col gap-1 mb-2",children:M.map(L=>P.jsxs("button",{onClick:()=>v(L.key),className:"w-full flex items-center justify-between py-2 px-2 rounded-lg text-sm text-[var(--wui-color-text)] hover:bg-[var(--wui-color-bg-secondary)] transition-colors",children:[P.jsxs("span",{className:"flex items-center gap-2",children:[L.icon&&P.jsx(L.icon,{className:"h-4 w-4 text-[var(--wui-color-text-secondary)]"}),L.label]}),P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[var(--wui-color-text-tertiary)]",children:P.jsx("path",{d:"m9 18 6-6-6-6"})})]},L.key))}),P.jsx("div",{className:"border-t border-[var(--wui-color-border)] mb-3 mt-2"}),P.jsxs("div",{className:"flex gap-2",children:[P.jsx("button",{onClick:m,className:"flex-1 py-2 px-4 bg-[var(--wui-color-bg-tertiary)] text-[var(--wui-color-text-secondary)] font-medium rounded-xl hover:brightness-90 transition-all text-sm flex items-center justify-center",title:"Copy address",children:x?P.jsxs(P.Fragment,{children:[P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:P.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):P.jsxs(P.Fragment,{children:[P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[P.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),P.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),P.jsx(ir,{slot:"actions",ctx:I}),P.jsx("button",{onClick:w,className:"flex-1 py-2 px-4 bg-[var(--wui-color-danger-bg)] text-[var(--wui-color-danger-text)] font-medium rounded-xl hover:bg-[var(--wui-color-danger-bg-hover)] transition-colors text-sm",children:"Disconnect"})]})]})})})})})})]})}function ca(e){const{queryClient:t}=tr();return P.jsx(Yn,{client:t,children:P.jsx(Rf,{...e})})}function Tf({size:e,className:t,style:r}){const{activeAddress:n}=_e.useWallet();return n?P.jsx(ca,{children:P.jsx(Qr,{size:e,className:t,style:r})}):P.jsx(ni,{children:P.jsx(Vr,{size:e,className:t,style:r})})}da();exports.ConnectWalletButton=Vr;exports.ConnectWalletMenu=ni;exports.ConnectedWalletButton=Qr;exports.ConnectedWalletMenu=ca;exports.NfdAvatar=Zn;exports.WalletButton=Tf;exports.WalletList=ri;exports.WalletUIProvider=tc;exports.useAccountInfo=la;exports.useNfd=Jn;exports.usePlugins=Cr;exports.useResolvedTheme=Zs;exports.useWalletUI=tr;
94
+ */var rs;function Uu(){return rs||(rs=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,l=t.useDebugValue;vn.useSyncExternalStoreWithSelector=function(c,u,g,v,S){var h=o(null);if(h.current===null){var R={hasValue:!1,value:null};h.current=R}else R=h.current;h=i(function(){function F(L){if(!$){if($=!0,C=L,L=v(L),S!==void 0&&R.hasValue){var U=R.value;if(S(U,L))return j=U}return j=L}if(U=j,r(C,L))return U;var Q=v(L);return S!==void 0&&S(U,Q)?(C=L,U):(C=L,j=Q)}var $=!1,C,j,D=g===void 0?null:g;return[function(){return F(u())},D===null?void 0:function(){return F(D())}]},[u,g,v,S]);var P=n(c,h[0],h[1]);return s(function(){R.hasValue=!0,R.value=P},[P]),l(P),P},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),vn}var ns;function Wu(){return ns||(ns=1,process.env.NODE_ENV==="production"?Dr.exports=Bu():Dr.exports=Uu()),Dr.exports}var Hu=Wu();function ke(e,t,r=_i){return Hu.useSyncExternalStoreWithSelector(oe(n=>e.subscribe(zu,n)),oe(()=>e.state),oe(()=>e.state),oe(t),r)}function zu(e){return e}function Xi(e,t){let r=p.useId(),n=po.get(t),[o,s]=ke(n,p.useCallback(i=>[n.selectors.isTop(i,r),n.selectors.inStack(i,r)],[n,r]));return we(()=>{if(e)return n.actions.push(r),()=>n.actions.pop(r)},[n,e,r]),e?s?o:!0:!1}let Vn=new Map,pr=new Map;function os(e){var t;let r=(t=pr.get(e))!=null?t:0;return pr.set(e,r+1),r!==0?()=>ss(e):(Vn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ss(e))}function ss(e){var t;let r=(t=pr.get(e))!=null?t:1;if(r===1?pr.delete(e):pr.set(e,r-1),r!==1)return;let n=Vn.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,Vn.delete(e))}function Gu(e,{allowed:t,disallowed:r}={}){let n=Xi(e,"inert-others");we(()=>{var o,s;if(!n)return;let i=Re();for(let c of(o=r==null?void 0:r())!=null?o:[])c&&i.add(os(c));let l=(s=t==null?void 0:t())!=null?s:[];for(let c of l){if(!c)continue;let u=Jr(c);if(!u)continue;let g=c.parentElement;for(;g&&g!==u.body;){for(let v of g.children)l.some(S=>v.contains(S))||i.add(os(v));g=g.parentElement}}return i.dispose},[n,t,r])}function qu(e,t,r){let n=or(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});p.useEffect(()=>{if(!e)return;let o=t===null?null:st(t)?t:t.current;if(!o)return;let s=Re();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>n.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,n,e])}let Qn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Vu=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var _n=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(_n||{}),Qu=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Qu||{}),_u=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(_u||{});function Ji(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Qn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ku(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Vu)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var mo=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(mo||{});function Zi(e,t=0){var r;return e===((r=Jr(e))==null?void 0:r.body)?!1:Ye(t,{0(){return e.matches(Qn)},1(){let n=e;for(;n!==null;){if(n.matches(Qn))return!0;n=n.parentElement}return!1}})}var Yu=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Yu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Xu=["textarea","input"].join(",");function Ju(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Xu))!=null?r:!1}function ea(e,t=r=>r){return e.slice().sort((r,n)=>{let o=t(r),s=t(n);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Zu(e,t,r=e===null?document.body:_r(e)){return ed(Ji(r),t,{relativeTo:e})}function ed(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?_r(e[0]):document:_r(e),i=Array.isArray(e)?r?ea(e):e:t&64?Ku(e):Ji(e);o.length>0&&i.length>1&&(i=i.filter(h=>!o.some(R=>R!=null&&"current"in R?(R==null?void 0:R.current)===h:R===h))),n=n??(s==null?void 0:s.activeElement);let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(n))-1;if(t&4)return Math.max(0,i.indexOf(n))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},g=0,v=i.length,S;do{if(g>=v||g+v<=0)return 0;let h=c+g;if(t&16)h=(h+v)%v;else{if(h<0)return 3;if(h>=v)return 1}S=i[h],S==null||S.focus(u),g+=l}while(S!==Oi(S));return t&6&&Ju(S)&&S.select(),2}function ta(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function td(){return/Android/gi.test(window.navigator.userAgent)}function is(){return ta()||td()}function Ht(e,t,r,n){let o=or(r);p.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,n),()=>document.removeEventListener(t,s,n)},[e,t,n])}function rd(e,t,r,n){let o=or(r);p.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,n),()=>window.removeEventListener(t,s,n)},[e,t,n])}const as=30;function nd(e,t,r){let n=or(r),o=p.useCallback(function(l,c){if(l.defaultPrevented)return;let u=c(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let g=(function v(S){return typeof S=="function"?v(S()):Array.isArray(S)||S instanceof Set?S:[S]})(t);for(let v of g)if(v!==null&&(v.contains(u)||l.composed&&l.composedPath().includes(v)))return;return!Zi(u,mo.Loose)&&u.tabIndex!==-1&&l.preventDefault(),n.current(l,u)},[n,t]),s=p.useRef(null);Ht(e,"pointerdown",l=>{var c,u;is()||(s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target)},!0),Ht(e,"pointerup",l=>{if(is()||!s.current)return;let c=s.current;return s.current=null,o(l,()=>c)},!0);let i=p.useRef({x:0,y:0});Ht(e,"touchstart",l=>{i.current.x=l.touches[0].clientX,i.current.y=l.touches[0].clientY},!0),Ht(e,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-i.current.x)>=as||Math.abs(c.y-i.current.y)>=as))return o(l,()=>Wt(l.target)?l.target:null)},!0),rd(e,"blur",l=>o(l,()=>mu(window.document.activeElement)?window.document.activeElement:null),!0)}function Kn(...e){return p.useMemo(()=>Jr(...e),[...e])}var od=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(od||{});const Lr={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},sd=200,ls=5;function id(e,{trigger:t,action:r,close:n,select:o}){let s=p.useRef(null),i=p.useRef(null),l=p.useRef(null);Ht(e&&t!==null,"pointerdown",c=>{$i(c==null?void 0:c.target)&&t!=null&&t.contains(c.target)&&(i.current=c.x,l.current=c.y,s.current=c.timeStamp)}),Ht(e&&t!==null,"pointerup",c=>{var u,g;let v=s.current;if(v===null||(s.current=null,!Wt(c.target))||Math.abs(c.x-((u=i.current)!=null?u:c.x))<ls&&Math.abs(c.y-((g=l.current)!=null?g:c.y))<ls)return;let S=r(c);switch(S.kind){case 0:return;case 1:{c.timeStamp-v>sd&&(o(S.target),n());break}case 2:{n();break}}},{capture:!0})}function ad(e,t){return p.useMemo(()=>{var r;if(e.type)return e.type;let n=(r=e.as)!=null?r:"button";if(typeof n=="string"&&n.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function ld(e){return p.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function cd(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...s){let i=t[o].call(r,...s);i&&(r=i,n.forEach(l=>l()))}}}function ud(){let e;return{before({doc:t}){var r;let n=t.documentElement,o=(r=t.defaultView)!=null?r:window;e=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,e-o);r.style(n,"paddingRight",`${s}px`)}}}function dd(){return ta()?{before({doc:e,d:t,meta:r}){function n(o){for(let s of r().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=Re();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",l=>{if(Wt(l.target))try{let c=l.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),g=e.querySelector(u);Wt(g)&&!n(g)&&(i=g)}catch{}},!0),t.group(l=>{t.addEventListener(e,"touchstart",c=>{if(l.dispose(),Wt(c.target)&&pu(c.target))if(n(c.target)){let u=c.target;for(;u.parentElement&&n(u.parentElement);)u=u.parentElement;l.style(u,"overscrollBehavior","contain")}else l.style(c.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",l=>{if(Wt(l.target)){if(Di(l.target))return;if(n(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;s!==c&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function fd(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function cs(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let Ot=cd(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Re(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=cs(n.meta),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t),r.computedMeta=cs(r.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},r=[dd(),ud(),fd()];r.forEach(({before:n})=>n==null?void 0:n(t)),r.forEach(({after:n})=>n==null?void 0:n(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ot.subscribe(()=>{let e=Ot.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",o=r.count!==0;(o&&!n||!o&&n)&&Ot.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Ot.dispatch("TEARDOWN",r)}});function hd(e,t,r=()=>({containers:[]})){let n=ld(Ot),o=t?n.get(t):void 0,s=o?o.count>0:!1;return we(()=>{if(!(!t||!e))return Ot.dispatch("PUSH",t,r),()=>Ot.dispatch("POP",t,r)},[e,t]),s}function pd(e,t,r=()=>[document.body]){let n=Xi(e,"scroll-lock");hd(n,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],r]}})}function us(e){return[e.screenX,e.screenY]}function md(){let e=p.useRef([-1,-1]);return{wasMoved(t){let r=us(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=us(t)}}}function gd(e=0){let[t,r]=p.useState(e),n=p.useCallback(c=>r(c),[]),o=p.useCallback(c=>r(u=>u|c),[]),s=p.useCallback(c=>(t&c)===c,[t]),i=p.useCallback(c=>r(u=>u&~c),[]),l=p.useCallback(c=>r(u=>u^c),[]);return{flags:t,setFlag:n,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:l}}var ds,fs;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ds=process==null?void 0:process.env)==null?void 0:ds.NODE_ENV)==="test"&&typeof((fs=Element==null?void 0:Element.prototype)==null?void 0:fs.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
95
+ `)),[]});var vd=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(vd||{});function bd(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function yd(e,t,r,n){let[o,s]=p.useState(r),{hasFlag:i,addFlag:l,removeFlag:c}=gd(e&&o?3:0),u=p.useRef(!1),g=p.useRef(!1),v=nr();return we(()=>{var S;if(e){if(r&&s(!0),!t){r&&l(3);return}return(S=void 0)==null||S.call(n,r),wd(t,{inFlight:u,prepare(){g.current?g.current=!1:g.current=u.current,u.current=!0,!g.current&&(r?(l(3),c(4)):(l(4),c(2)))},run(){g.current?r?(c(3),l(4)):(c(4),l(3)):r?c(1):l(1)},done(){var h;g.current&&Sd(t)||(u.current=!1,c(7),r||s(!1),(h=void 0)==null||h.call(n,r))}})}},[e,r,t,v]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function wd(e,{prepare:t,run:r,done:n,inFlight:o}){let s=Re();return Ed(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(xd(e,n))})}),s.dispose}function xd(e,t){var r,n;let o=Re();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(l=>l instanceof CSSTransition))!=null?n:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(l=>l.finished)).then(()=>{s||t()}),o.dispose)}function Ed(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.style.transition=n}function Sd(e){var t,r;return((r=(t=e.getAnimations)==null?void 0:t.call(e))!=null?r:[]).some(n=>n instanceof CSSTransition&&n.playState!=="finished")}function kd(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}const ra={...V},Cd=ra.useInsertionEffect,Od=Cd||(e=>e());function na(e){const t=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Od(()=>{t.current=e}),V.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}var Yn=typeof document<"u"?p.useLayoutEffect:p.useEffect;let hs=!1,Ad=0;const ps=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ad++;function Rd(){const[e,t]=V.useState(()=>hs?ps():void 0);return Yn(()=>{e==null&&t(ps())},[]),V.useEffect(()=>{hs=!0},[]),e}const Pd=ra.useId,Td=Pd||Rd;let br;process.env.NODE_ENV!=="production"&&(br=new Set);function Fd(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=br)!=null&&e.has(o))){var s;(s=br)==null||s.add(o),console.warn(o)}}function Nd(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=br)!=null&&e.has(o))){var s;(s=br)==null||s.add(o),console.error(o)}}function Id(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,((n=e.get(t))==null?void 0:n.filter(o=>o!==r))||[])}}}const jd=V.createContext(null),Md=V.createContext(null),$d=()=>{var e;return((e=V.useContext(jd))==null?void 0:e.id)||null},Dd=()=>V.useContext(Md),Ld="data-floating-ui-focusable";function Bd(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=Td(),s=V.useRef({}),[i]=V.useState(()=>Id()),l=$d()!=null;if(process.env.NODE_ENV!=="production"){const h=n.reference;h&&!K.isElement(h)&&Nd("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,u]=V.useState(n.reference),g=na((h,R,P)=>{s.current.openEvent=h?R:void 0,i.emit("openchange",{open:h,event:R,reason:P,nested:l}),r==null||r(h,R,P)}),v=V.useMemo(()=>({setPositionReference:u}),[]),S=V.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return V.useMemo(()=>({dataRef:s,open:t,onOpenChange:g,elements:S,events:i,floatingId:o,refs:v}),[t,g,S,i,o,v])}function Ud(e){e===void 0&&(e={});const{nodeId:t}=e,r=Bd({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[s,i]=V.useState(null),[l,c]=V.useState(null),g=(o==null?void 0:o.domReference)||s,v=V.useRef(null),S=Dd();Yn(()=>{g&&(v.current=g)},[g]);const h=K.useFloating$1({...e,elements:{...o,...l&&{reference:l}}}),R=V.useCallback(j=>{const D=K.isElement(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),contextElement:j}:j;c(D),h.refs.setReference(D)},[h.refs]),P=V.useCallback(j=>{(K.isElement(j)||j===null)&&(v.current=j,i(j)),(K.isElement(h.refs.reference.current)||h.refs.reference.current===null||j!==null&&!K.isElement(j))&&h.refs.setReference(j)},[h.refs]),F=V.useMemo(()=>({...h.refs,setReference:P,setPositionReference:R,domReference:v}),[h.refs,P,R]),$=V.useMemo(()=>({...h.elements,domReference:g}),[h.elements,g]),C=V.useMemo(()=>({...h,...n,refs:F,elements:$,nodeId:t}),[h,F,$,t,n]);return Yn(()=>{n.dataRef.current.floatingContext=C;const j=S==null?void 0:S.nodesRef.current.find(D=>D.id===t);j&&(j.context=C)}),V.useMemo(()=>({...h,context:C,refs:F,elements:$}),[h,F,$,C])}const ms="active",gs="selected";function bn(e,t,r){const n=new Map,o=r==="item";let s=e;if(o&&e){const{[ms]:i,[gs]:l,...c}=e;s=c}return{...r==="floating"&&{tabIndex:-1,[Ld]:""},...s,...t.map(i=>{const l=i?i[r]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(c=>{let[u,g]=c;if(!(o&&[ms,gs].includes(u)))if(u.indexOf("on")===0){if(n.has(u)||n.set(u,[]),typeof g=="function"){var v;(v=n.get(u))==null||v.push(g),i[u]=function(){for(var S,h=arguments.length,R=new Array(h),P=0;P<h;P++)R[P]=arguments[P];return(S=n.get(u))==null?void 0:S.map(F=>F(...R)).find(F=>F!==void 0)}}}else i[u]=g}),i),{})}}function Wd(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),r=e.map(l=>l==null?void 0:l.floating),n=e.map(l=>l==null?void 0:l.item),o=V.useCallback(l=>bn(l,e,"reference"),t),s=V.useCallback(l=>bn(l,e,"floating"),r),i=V.useCallback(l=>bn(l,e,"item"),n);return V.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function vs(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Hd=e=>({name:"inner",options:e,async fn(t){const{listRef:r,overflowRef:n,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:u,...g}=K.evaluate(e,t),{rects:v,elements:{floating:S}}=t,h=r.current[i],R=(u==null?void 0:u.current)||S,P=S.clientTop||R.clientTop,F=S.clientTop!==0,$=R.clientTop!==0,C=S===R;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Fd('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const j={...t,...await K.offset(-h.offsetTop-S.clientTop-v.reference.height/2-h.offsetHeight/2-s).fn(t)},D=await K.detectOverflow(vs(j,R.scrollHeight+P+S.clientTop),g),L=await K.detectOverflow(j,{...g,elementContext:"reference"}),U=K.max(0,D.top),Q=j.y+U,f=(R.scrollHeight>R.clientHeight?E=>E:K.round)(K.max(0,R.scrollHeight+(F&&C||$?P*2:0)-U-K.max(0,D.bottom)));if(R.style.maxHeight=f+"px",R.scrollTop=U,o){const E=R.offsetHeight<h.offsetHeight*K.min(l,r.current.length)-1||L.top>=-c||L.bottom>=-c;wn.flushSync(()=>o(E))}return n&&(n.current=await K.detectOverflow(vs({...j,y:Q},R.offsetHeight+P+S.clientTop),g)),{y:Q}}});function zd(e,t){const{open:r,elements:n}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:l}=t,c=na(l),u=V.useRef(!1),g=V.useRef(null),v=V.useRef(null);V.useEffect(()=>{if(!o)return;function h(P){if(P.ctrlKey||!R||s.current==null)return;const F=P.deltaY,$=s.current.top>=-.5,C=s.current.bottom>=-.5,j=R.scrollHeight-R.clientHeight,D=F<0?-1:1,L=F<0?"max":"min";R.scrollHeight<=R.clientHeight||(!$&&F>0||!C&&F<0?(P.preventDefault(),wn.flushSync(()=>{c(U=>U+Math[L](F,j*D))})):/firefox/i.test(kd())&&(R.scrollTop+=F))}const R=(i==null?void 0:i.current)||n.floating;if(r&&R)return R.addEventListener("wheel",h),requestAnimationFrame(()=>{g.current=R.scrollTop,s.current!=null&&(v.current={...s.current})}),()=>{g.current=null,v.current=null,R.removeEventListener("wheel",h)}},[o,r,n.floating,s,i,c]);const S=V.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const h=(i==null?void 0:i.current)||n.floating;if(!(!s.current||!h||!u.current)){if(g.current!==null){const R=h.scrollTop-g.current;(s.current.bottom<-.5&&R<-1||s.current.top<-.5&&R>1)&&wn.flushSync(()=>c(P=>P+R))}requestAnimationFrame(()=>{g.current=h.scrollTop})}}}),[n.floating,c,s,i]);return V.useMemo(()=>o?{floating:S}:{},[o,S])}let sr=p.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});sr.displayName="FloatingContext";let go=p.createContext(null);go.displayName="PlacementContext";function Gd(e){return p.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function qd(){return p.useContext(sr).setReference}function Vd(){return p.useContext(sr).getReferenceProps}function Qd(){let{getFloatingProps:e,slot:t}=p.useContext(sr);return p.useCallback((...r)=>Object.assign({},e(...r),{"data-anchor":t.anchor}),[e,t])}function _d(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=p.useContext(go),r=p.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);we(()=>{t==null||t(r??null)},[t,r]);let n=p.useContext(sr);return p.useMemo(()=>[n.setFloating,e?n.styles:{}],[n.setFloating,e,n.styles])}let bs=4;function Kd({children:e,enabled:t=!0}){let[r,n]=p.useState(null),[o,s]=p.useState(0),i=p.useRef(null),[l,c]=p.useState(null);Yd(l);let u=t&&r!==null&&l!==null,{to:g="bottom",gap:v=0,offset:S=0,padding:h=0,inner:R}=Xd(r,l),[P,F="center"]=g.split(" ");we(()=>{u&&s(0)},[u]);let{refs:$,floatingStyles:C,context:j}=Ud({open:u,placement:P==="selection"?F==="center"?"bottom":`bottom-${F}`:F==="center"?`${P}`:`${P}-${F}`,strategy:"absolute",transform:!1,middleware:[K.offset({mainAxis:P==="selection"?0:v,crossAxis:S}),K.shift({padding:h}),P!=="selection"&&K.flip({padding:h}),P==="selection"&&R?Hd({...R,padding:h,overflowRef:i,offset:o,minItemsVisible:bs,referenceOverflowThreshold:h,onFallbackChange(E){var y,k;if(!E)return;let T=j.elements.floating;if(!T)return;let m=parseFloat(getComputedStyle(T).scrollPaddingBottom)||0,x=Math.min(bs,T.childElementCount),O=0,A=0;for(let N of(k=(y=j.elements.floating)==null?void 0:y.childNodes)!=null?k:[])if(st(N)){let I=N.offsetTop,W=I+N.clientHeight+m,G=T.scrollTop,J=G+T.clientHeight;if(I>=G&&W<=J)x--;else{A=Math.max(0,Math.min(W,J)-Math.max(I,G)),O=N.clientHeight;break}}x>=1&&s(N=>{let I=O*x-A+m;return N>=I?N:I})}}):null,K.size({padding:h,apply({availableWidth:E,availableHeight:y,elements:k}){Object.assign(k.floating.style,{overflow:"auto",maxWidth:`${E}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${y}px)`})}})].filter(Boolean),whileElementsMounted:K.autoUpdate}),[D=P,L=F]=j.placement.split("-");P==="selection"&&(D="selection");let U=p.useMemo(()=>({anchor:[D,L].filter(Boolean).join(" ")}),[D,L]),Q=zd(j,{overflowRef:i,onChange:s}),{getReferenceProps:a,getFloatingProps:d}=Wd([Q]),f=oe(E=>{c(E),$.setFloating(E)});return V.createElement(go.Provider,{value:n},V.createElement(sr.Provider,{value:{setFloating:f,setReference:$.setReference,styles:C,getReferenceProps:a,getFloatingProps:d,slot:U}},e))}function Yd(e){we(()=>{if(!e)return;let t=new MutationObserver(()=>{let r=window.getComputedStyle(e).maxHeight,n=parseFloat(r);if(isNaN(n))return;let o=parseInt(r);isNaN(o)||n!==o&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Xd(e,t){var r,n,o;let s=yn((r=e==null?void 0:e.gap)!=null?r:"var(--anchor-gap, 0)",t),i=yn((n=e==null?void 0:e.offset)!=null?n:"var(--anchor-offset, 0)",t),l=yn((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:l}}function yn(e,t,r=void 0){let n=nr(),o=oe((c,u)=>{if(c==null)return[r,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!u)return[r,null];let g=ys(c,u);return[g,v=>{let S=oa(c);{let h=S.map(R=>window.getComputedStyle(u).getPropertyValue(R));n.requestAnimationFrame(function R(){n.nextFrame(R);let P=!1;for(let[$,C]of S.entries()){let j=window.getComputedStyle(u).getPropertyValue(C);if(h[$]!==j){h[$]=j,P=!0;break}}if(!P)return;let F=ys(c,u);g!==F&&(v(F),g=F)})}return n.dispose}]}return[r,null]}),s=p.useMemo(()=>o(e,t)[0],[e,t]),[i=s,l]=p.useState();return we(()=>{let[c,u]=o(e,t);if(l(c),!!u)return u(l)},[e,t]),i}function oa(e){let t=/var\((.*)\)/.exec(e);if(t){let r=t[1].indexOf(",");if(r===-1)return[t[1]];let n=t[1].slice(0,r).trim(),o=t[1].slice(r+1).trim();return o?[n,...oa(o)]:[n]}return[]}function ys(e,t){let r=document.createElement("div");t.appendChild(r),r.style.setProperty("margin-top","0px","important"),r.style.setProperty("margin-top",e,"important");let n=parseFloat(window.getComputedStyle(r).marginTop)||0;return t.removeChild(r),n}function Jd({children:e,freeze:t},r){let n=sa(t,e);return p.isValidElement(n)?p.cloneElement(n,{ref:r}):p.createElement(p.Fragment,null,n)}p.forwardRef(Jd);function sa(e,t){let[r,n]=p.useState(t);return!e&&r!==t&&n(t),e?r:t}let vo=p.createContext(null);vo.displayName="OpenClosedContext";var yr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(yr||{});function Zd(){return p.useContext(vo)}function ef({value:e,children:t}){return p.createElement(vo.Provider,{value:e},t)}function tf(e){throw new Error("Unexpected object: "+e)}var ce=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ce||{});function Br(e,t){let r=t.resolveItems();if(r.length<=0)return null;let n=t.resolveActiveIndex(),o=n??-1;switch(e.focus){case 0:{for(let s=0;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 1:{o===-1&&(o=r.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 2:{for(let s=o+1;s<r.length;++s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 3:{for(let s=r.length-1;s>=0;--s)if(!t.resolveDisabled(r[s],s,r))return s;return n}case 4:{for(let s=0;s<r.length;++s)if(t.resolveId(r[s],s,r)===e.id)return s;return n}case 5:return null;default:tf(e)}}function ia(e){let t=oe(e),r=p.useRef(!1);p.useEffect(()=>(r.current=!1,()=>{r.current=!0,Ai(()=>{r.current&&t()})}),[t])}function rf(){let e=typeof document>"u";return"useSyncExternalStore"in V?(t=>t.useSyncExternalStore)(V)(()=>()=>{},()=>!1,()=>!e):!1}function nf(){let e=rf(),[t,r]=V.useState(_e.isHandoffComplete);return t&&_e.isHandoffComplete===!1&&r(!1),V.useEffect(()=>{t!==!0&&r(!0)},[t]),V.useEffect(()=>_e.handoff(),[]),e?!1:t}let of=p.createContext(!1);function sf(){return p.useContext(of)}function af(e){let t=sf(),r=p.useContext(la),[n,o]=p.useState(()=>{var s;if(!t&&r!==null)return(s=r.current)!=null?s:null;if(_e.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return p.useEffect(()=>{n!==null&&(e!=null&&e.body.contains(n)||e==null||e.body.appendChild(n))},[n,e]),p.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let aa=p.Fragment,lf=Ue(function(e,t){let{ownerDocument:r=null,...n}=e,o=p.useRef(null),s=Xe(yu(h=>{o.current=h}),t),i=Kn(o.current),l=r??i,c=af(l),u=p.useContext(ff),g=nr(),v=nf(),S=Be();return ia(()=>{var h;c&&c.childNodes.length<=0&&((h=c.parentElement)==null||h.removeChild(c))}),!c||!v?null:Dt.createPortal(p.createElement("div",{"data-headlessui-portal":"",ref:h=>{g.dispose(),u&&h&&g.add(u.register(h))}},S({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:aa,name:"Portal"})),c)});function cf(e,t){let r=Xe(t),{enabled:n=!0,ownerDocument:o,...s}=e,i=Be();return n?p.createElement(lf,{...s,ownerDocument:o,ref:r}):i({ourProps:{ref:r},theirProps:s,slot:{},defaultTag:aa,name:"Portal"})}let uf=p.Fragment,la=p.createContext(null);function df(e,t){let{target:r,...n}=e,o={ref:Xe(t)},s=Be();return p.createElement(la.Provider,{value:r},s({ourProps:o,theirProps:n,defaultTag:uf,name:"Popover.Group"}))}let ff=p.createContext(null),hf=Ue(cf),pf=Ue(df),mf=Object.assign(hf,{Group:pf});const Wr={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ca(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function gf(e,t,r){let n=Re();if(t.kind==="Tracked"){let o=function(){s!==ca(e)&&(n.dispose(),r())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),n.add(()=>i.disconnect()),n.addEventListener(window,"scroll",o,{passive:!0}),n.addEventListener(window,"resize",o)}return()=>n.dispose()}let ws=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function xs(e){var t,r;let n=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!st(o))return n;let s=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let i=s?(r=o.innerText)!=null?r:"":n;return ws.test(i)&&(i=i.replace(ws,"")),i}function vf(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():xs(s).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return xs(e).trim()}function bf(e){let t=p.useRef(""),r=p.useRef("");return oe(()=>{let n=e.current;if(!n)return"";let o=n.innerText;if(t.current===o)return r.current;let s=vf(n).trim().toLowerCase();return t.current=o,r.current=s,s})}var yf=Object.defineProperty,wf=(e,t,r)=>t in e?yf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Es=(e,t,r)=>(wf(e,typeof t!="symbol"?t+"":t,r),r),ve=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ve||{}),gt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(gt||{}),Hr=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Hr||{}),ua=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(ua||{});function Ss(e,t=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=ea(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=r?n.indexOf(r):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let xf={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Wr.Tracked(ca(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:ce.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let r=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(s=>n(s.dataRef.current.value));return o!==-1&&(r=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:r,__demoMode:!1,buttonPositionState:Wr.Idle}},2(e,t){var r,n,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(r=t.trigger)!=null?r:1,__demoMode:!1};if(t.focus===ce.Nothing)return{...l,activeOptionIndex:null};if(t.focus===ce.Specific)return{...l,activeOptionIndex:e.options.findIndex(g=>g.id===t.id)};if(t.focus===ce.Previous){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,S=Br(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(S!==null){let h=e.options[S].dataRef.current.domRef;if(((n=v.current)==null?void 0:n.previousElementSibling)===h.current||((o=h.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:S}}}}else if(t.focus===ce.Next){let g=e.activeOptionIndex;if(g!==null){let v=e.options[g].dataRef.current.domRef,S=Br(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(S!==null){let h=e.options[S].dataRef.current.domRef;if(((s=v.current)==null?void 0:s.nextElementSibling)===h.current||((i=h.current)==null?void 0:i.nextElementSibling)===null)return{...l,activeOptionIndex:S}}}}let c=Ss(e),u=Br(t,{resolveItems:()=>c.options,resolveActiveIndex:()=>c.activeOptionIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});return{...l,...c,activeOptionIndex:u}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+r).concat(e.options.slice(0,e.activeOptionIndex+r)):e.options).find(i=>{var l;return!i.dataRef.current.disabled&&((l=i.dataRef.current.textValue)==null?void 0:l.startsWith(n))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let r=e.options.concat(t.options),n=e.activeOptionIndex;if(e.pendingFocus.focus!==ce.Nothing&&(n=Br(e.pendingFocus,{resolveItems:()=>r,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=r.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(n=s)}}return{...e,options:r,activeOptionIndex:n,pendingFocus:{focus:ce.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let r=e.options,n=[],o=new Set(t.options);for(let[s,i]of r.entries())if(o.has(i.id)&&(n.push(s),o.delete(i.id),o.size===0))break;if(n.length>0){r=r.slice();for(let s of n.reverse())r.splice(s,1)}return{...e,options:r,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...Ss(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Wr.Moved}}};class bo extends Qi{constructor(t){super(t),Es(this,"actions",{onChange:r=>{let{onChange:n,compare:o,mode:s,value:i}=this.state.dataRef.current;return Ye(s,{0:()=>n==null?void 0:n(r),1:()=>{let l=i.slice(),c=l.findIndex(u=>o(u,r));return c===-1?l.push(r):l.splice(c,1),n==null?void 0:n(l)}})},registerOption:mn(()=>{let r=[],n=new Set;return[(o,s)=>{n.has(s)||(n.add(s),r.push({id:o,dataRef:s}))},()=>(n.clear(),this.send({type:6,options:r.splice(0)}))]}),unregisterOption:mn(()=>{let r=[];return[n=>r.push(n),()=>{this.send({type:7,options:r.splice(0)})}]}),goToOption:mn(()=>{let r=null;return[(n,o)=>{r={type:2,...n,trigger:o}},()=>r&&this.send(r)]}),closeListbox:()=>{this.send({type:1})},openListbox:r=>{this.send({type:0,focus:r})},selectActiveOption:()=>{var r;if(this.state.activeOptionIndex!==null){let{dataRef:n}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(n.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(r=this.state.buttonElement)==null||r.focus({preventScroll:!0}))},selectOption:r=>{this.send({type:5,value:r})},search:r=>{this.send({type:3,value:r})},clearSearch:()=>{this.send({type:4})},setButtonElement:r=>{this.send({type:8,element:r})},setOptionsElement:r=>{this.send({type:9,element:r})}}),Es(this,"selectors",{activeDescendantId(r){var n;let o=r.activeOptionIndex,s=r.options;return o===null||(n=s[o])==null?void 0:n.id},isActive(r,n){var o;let s=r.activeOptionIndex,i=r.options;return s!==null?((o=i[s])==null?void 0:o.id)===n:!1},hasFrozenValue(r){return r.frozenValue},shouldScrollIntoView(r,n){return r.__demoMode||r.listboxState!==0||r.activationTrigger===0?!1:this.isActive(r,n)},didButtonMove(r){return r.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let r=this.state.id,n=po.get(null);this.disposables.add(n.on(Ki.Push,o=>{!n.selectors.isTop(o,r)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>n.actions.push(r)),this.on(1,()=>n.actions.pop(r))}this.disposables.group(r=>{this.on(1,n=>{n.buttonElement&&(r.dispose(),r.add(gf(n.buttonElement,n.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(r,n)=>{var o;this.actions.onChange(n.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:r=!1}){return new bo({id:t,dataRef:{current:{}},listboxState:r?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ce.Nothing},frozenValue:!1,__demoMode:r,buttonPositionState:Wr.Idle})}reduce(t,r){return Ye(r.type,xf,t,r)}}const da=p.createContext(null);function yo(e){let t=p.useContext(da);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,fa),r}return t}function fa({id:e,__demoMode:t=!1}){let r=p.useMemo(()=>bo.new({id:e,__demoMode:t}),[]);return ia(()=>r.dispose()),r}let tn=p.createContext(null);tn.displayName="ListboxDataContext";function Rr(e){let t=p.useContext(tn);if(t===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Rr),r}return t}let Ef=p.Fragment;function Sf(e,t){let r=p.useId(),n=uo(),{value:o,defaultValue:s,form:i,name:l,onChange:c,by:u,invalid:g=!1,disabled:v=n||!1,horizontal:S=!1,multiple:h=!1,__demoMode:R=!1,...P}=e;const F=S?"horizontal":"vertical";let $=Xe(t),C=ou(s),[j=h?[]:void 0,D]=nu(o,c,C),L=fa({id:r,__demoMode:R}),U=p.useRef({static:!1,hold:!1}),Q=p.useRef(new Map),a=Pu(u),d=p.useCallback(G=>Ye(f.mode,{[gt.Multi]:()=>j.some(J=>a(J,G)),[gt.Single]:()=>a(j,G)}),[j]),f=bt({value:j,disabled:v,invalid:g,mode:h?gt.Multi:gt.Single,orientation:F,onChange:D,compare:a,isSelected:d,optionsPropsRef:U,listRef:Q});we(()=>{L.state.dataRef.current=f},[f]);let E=ke(L,G=>G.listboxState),y=po.get(null),k=ke(y,p.useCallback(G=>y.selectors.isTop(G,r),[y,r])),[T,m]=ke(L,G=>[G.buttonElement,G.optionsElement]);nd(k,[T,m],(G,J)=>{L.send({type:ua.CloseListbox}),Zi(J,mo.Loose)||(G.preventDefault(),T==null||T.focus())});let x=bt({open:E===ve.Open,disabled:v,invalid:g,value:j}),[O,A]=ku({inherit:!0}),N={ref:$},I=p.useCallback(()=>{if(C!==void 0)return D==null?void 0:D(C)},[D,C]),W=Be();return p.createElement(A,{value:O,props:{htmlFor:T==null?void 0:T.id},slot:{open:E===ve.Open,disabled:v}},p.createElement(Kd,null,p.createElement(da.Provider,{value:L},p.createElement(tn.Provider,{value:f},p.createElement(ef,{value:Ye(E,{[ve.Open]:yr.Open,[ve.Closed]:yr.Closed})},l!=null&&j!=null&&p.createElement(du,{disabled:v,data:{[l]:j},form:i,onReset:I}),W({ourProps:N,theirProps:P,slot:x,defaultTag:Ef,name:"Listbox"}))))))}let kf="button";function Cf(e,t){let r=p.useId(),n=Mi(),o=Rr("Listbox.Button"),s=yo("Listbox.Button"),{id:i=n||`headlessui-listbox-button-${r}`,disabled:l=o.disabled||!1,autoFocus:c=!1,...u}=e,g=Xe(t,qd(),s.actions.setButtonElement),v=Vd(),[S,h,R]=ke(s,m=>[m.listboxState,m.buttonElement,m.optionsElement]),P=S===ve.Open;id(P,{trigger:h,action:p.useCallback(m=>{if(h!=null&&h.contains(m.target))return Lr.Ignore;let x=m.target.closest('[role="option"]:not([data-disabled])');return st(x)?Lr.Select(x):R!=null&&R.contains(m.target)?Lr.Ignore:Lr.Close},[h,R]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let F=oe(m=>{switch(m.key){case he.Enter:su(m.currentTarget);break;case he.Space:case he.ArrowDown:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.First});break;case he.ArrowUp:m.preventDefault(),s.actions.openListbox({focus:o.value?ce.Nothing:ce.Last});break}}),$=oe(m=>{switch(m.key){case he.Space:m.preventDefault();break}}),C=Fu(m=>{var x;s.state.listboxState===ve.Open?(Dt.flushSync(()=>s.actions.closeListbox()),(x=s.state.buttonElement)==null||x.focus({preventScroll:!0})):(m.preventDefault(),s.actions.openListbox({focus:ce.Nothing}))}),j=oe(m=>m.preventDefault()),D=Hi([i]),L=wu(),{isFocusVisible:U,focusProps:Q}=Hc({autoFocus:c}),{isHovered:a,hoverProps:d}=Wc({isDisabled:l}),{pressed:f,pressProps:E}=Kc({disabled:l}),y=bt({open:S===ve.Open,active:f||S===ve.Open,disabled:l,invalid:o.invalid,value:o.value,hover:a,focus:U,autofocus:c}),k=ke(s,m=>m.listboxState===ve.Open),T=Pi(v(),{ref:g,id:i,type:ad(e,h),"aria-haspopup":"listbox","aria-controls":R==null?void 0:R.id,"aria-expanded":k,"aria-labelledby":D,"aria-describedby":L,disabled:l||void 0,autoFocus:c,onKeyDown:F,onKeyUp:$,onKeyPress:j},C,Q,d,E);return Be()({ourProps:T,theirProps:u,slot:y,defaultTag:kf,name:"Listbox.Button"})}let ha=p.createContext(!1),Of="div",Af=qn.RenderStrategy|qn.Static;function Rf(e,t){let r=p.useId(),{id:n=`headlessui-listbox-options-${r}`,anchor:o,portal:s=!1,modal:i=!0,transition:l=!1,...c}=e,u=Gd(o),[g,v]=p.useState(null);u&&(s=!0);let S=Rr("Listbox.Options"),h=yo("Listbox.Options"),[R,P,F,$]=ke(h,M=>[M.listboxState,M.buttonElement,M.optionsElement,M.__demoMode]),C=Kn(P),j=Kn(F),D=Zd(),[L,U]=yd(l,g,D!==null?(D&yr.Open)===yr.Open:R===ve.Open);qu(L,P,h.actions.closeListbox);let Q=$?!1:i&&R===ve.Open;pd(Q,j);let a=$?!1:i&&R===ve.Open;Gu(a,{allowed:p.useCallback(()=>[P,F],[P,F])});let d=ke(h,h.selectors.didButtonMove)?!1:L,f=ke(h,h.selectors.hasFrozenValue)&&!e.static,E=sa(f,S.value),y=p.useCallback(M=>S.compare(E,M),[S.compare,E]),k=ke(h,M=>{var te;if(u==null||!((te=u==null?void 0:u.to)!=null&&te.includes("selection")))return null;let Me=M.options.findIndex(se=>y(se.dataRef.current.value));return Me===-1&&(Me=0),Me}),T=(()=>{if(u==null)return;if(k===null)return{...u,inner:void 0};let M=Array.from(S.listRef.current.values());return{...u,inner:{listRef:{current:M},index:k}}})(),[m,x]=_d(T),O=Qd(),A=Xe(t,u?m:null,h.actions.setOptionsElement,v),N=nr();p.useEffect(()=>{let M=F;M&&R===ve.Open&&(Vc(M)||M==null||M.focus({preventScroll:!0}))},[R,F]);let I=oe(M=>{var te;switch(N.dispose(),M.key){case he.Space:if(h.state.searchQuery!=="")return M.preventDefault(),M.stopPropagation(),h.actions.search(M.key);case he.Enter:M.preventDefault(),M.stopPropagation(),h.actions.selectActiveOption();break;case Ye(S.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return M.preventDefault(),M.stopPropagation(),h.actions.goToOption({focus:ce.Next});case Ye(S.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return M.preventDefault(),M.stopPropagation(),h.actions.goToOption({focus:ce.Previous});case he.Home:case he.PageUp:return M.preventDefault(),M.stopPropagation(),h.actions.goToOption({focus:ce.First});case he.End:case he.PageDown:return M.preventDefault(),M.stopPropagation(),h.actions.goToOption({focus:ce.Last});case he.Escape:M.preventDefault(),M.stopPropagation(),Dt.flushSync(()=>h.actions.closeListbox()),(te=h.state.buttonElement)==null||te.focus({preventScroll:!0});return;case he.Tab:M.preventDefault(),M.stopPropagation(),Dt.flushSync(()=>h.actions.closeListbox()),Zu(h.state.buttonElement,M.shiftKey?_n.Previous:_n.Next);break;default:M.key.length===1&&(h.actions.search(M.key),N.setTimeout(()=>h.actions.clearSearch(),350));break}}),W=ke(h,M=>{var te;return(te=M.buttonElement)==null?void 0:te.id}),G=bt({open:R===ve.Open}),J=Pi(u?O():{},{id:n,ref:A,"aria-activedescendant":ke(h,h.selectors.activeDescendantId),"aria-multiselectable":S.mode===gt.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":S.orientation,onKeyDown:I,role:"listbox",tabIndex:R===ve.Open?0:void 0,style:{...c.style,...x,"--button-width":Tu(L,P,!0).width},...bd(U)}),ne=Be(),q=p.useMemo(()=>S.mode===gt.Multi?S:{...S,isSelected:y},[S,y]);return p.createElement(mf,{enabled:s?e.static||L:!1,ownerDocument:C},p.createElement(tn.Provider,{value:q},ne({ourProps:J,theirProps:c,slot:G,defaultTag:Of,features:Af,visible:d,name:"Listbox.Options"})))}let Pf="div";function Tf(e,t){let r=p.useId(),{id:n=`headlessui-listbox-option-${r}`,disabled:o=!1,value:s,...i}=e,l=p.useContext(ha)===!0,c=Rr("Listbox.Option"),u=yo("Listbox.Option"),g=ke(u,f=>u.selectors.isActive(f,n)),v=c.isSelected(s),S=p.useRef(null),h=bf(S),R=or({disabled:o,value:s,domRef:S,get textValue(){return h()}}),P=Xe(t,S,f=>{f?c.listRef.current.set(n,f):c.listRef.current.delete(n)}),F=ke(u,f=>u.selectors.shouldScrollIntoView(f,n));we(()=>{if(F)return Re().requestAnimationFrame(()=>{var f,E;(E=(f=S.current)==null?void 0:f.scrollIntoView)==null||E.call(f,{block:"nearest"})})},[F,S]),we(()=>{if(!l)return u.actions.registerOption(n,R),()=>u.actions.unregisterOption(n)},[R,n,l]);let $=oe(f=>{if(o)return f.preventDefault();u.actions.selectOption(s)}),C=oe(()=>{if(o)return u.actions.goToOption({focus:ce.Nothing});u.actions.goToOption({focus:ce.Specific,id:n})}),j=md(),D=oe(f=>j.update(f)),L=oe(f=>{j.wasMoved(f)&&(o||g&&u.state.activationTrigger===Hr.Pointer||u.actions.goToOption({focus:ce.Specific,id:n},Hr.Pointer))}),U=oe(f=>{j.wasMoved(f)&&(o||g&&u.state.activationTrigger===Hr.Pointer&&u.actions.goToOption({focus:ce.Nothing}))}),Q=bt({active:g,focus:g,selected:v,disabled:o,selectedOption:v&&l}),a=l?{}:{id:n,ref:P,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":v,disabled:void 0,onClick:$,onFocus:C,onPointerEnter:D,onMouseEnter:D,onPointerMove:L,onMouseMove:L,onPointerLeave:U,onMouseLeave:U},d=Be();return!v&&l?null:d({ourProps:a,theirProps:i,slot:Q,defaultTag:Pf,name:"Listbox.Option"})}let Ff=p.Fragment;function Nf(e,t){let{options:r,placeholder:n,...o}=e,s={ref:Xe(t)},i=Rr("ListboxSelectedOption"),l=bt({}),c=i.value===void 0||i.value===null||i.mode===gt.Multi&&Array.isArray(i.value)&&i.value.length===0,u=Be();return p.createElement(ha.Provider,{value:!0},u({ourProps:s,theirProps:{...o,children:p.createElement(p.Fragment,null,n&&c?n:r)},slot:l,defaultTag:Ff,name:"ListboxSelectedOption"}))}let If=Ue(Sf),pa=Ue(Cf),jf=zi,ma=Ue(Rf),ga=Ue(Tf),Mf=Ue(Nf),$f=Object.assign(If,{Button:pa,Label:jf,Options:ma,Option:ga,SelectedOption:Mf});function va(e={}){const{activeAddress:t,algodClient:r}=Ke.useWallet(),{enabled:n=!0}=e;return no({queryKey:["account-info",t],queryFn:async()=>{if(!t||!r)return null;try{return await r.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:n&&!!t&&!!r,refetchOnWindowFocus:!0})}function lr({slot:e,ctx:t}){const{menuItemsBySlot:r}=Or(),n=r[e];return!n||n.length===0?null:w.jsx(w.Fragment,{children:n.filter(o=>!o.enabled||o.enabled(t)).map(o=>w.jsx(p.Fragment,{children:o.render(t)},o.key))})}function Df({className:e,scale:t=.85}){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:Le("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor",children:w.jsx("path",{d:"M23.98 23.99h-3.75l-2.44-9.07-5.25 9.07H8.34l8.1-14.04-1.3-4.88L4.22 24H.02L13.88 0h3.67l1.61 5.96h3.79l-2.59 4.5 3.62 13.53z"})})}function Lf({children:e}){var ne,q;const{activeAddress:t,activeWallet:r}=Ke.useWallet(),{theme:n,resolvedTheme:o}=rr(),{openDialog:s,closeDialog:i,panels:l}=Or(),[c,u]=p.useState(!1),[g,v]=p.useState(null),[S,h]=p.useState(!1),[R,P]=p.useState(()=>{const M=localStorage.getItem("uwui:balance-preference");return M?M==="available":!1}),F=n==="system"?void 0:n,$=oo({enabled:!!t}),C=((ne=$.data)==null?void 0:ne.name)??null,{data:j}=va({enabled:!!t}),D=p.useMemo(()=>!j||j.amount===void 0?null:Number(j.amount)/1e6,[j]),L=p.useMemo(()=>{if(!j||j.amount===void 0||j.minBalance===void 0)return null;const M=Number(j.amount)-Number(j.minBalance);return Math.max(0,M/1e6)},[j]),U=R?L:D,{refs:Q,floatingStyles:a,context:d}=K.useFloating({open:c,onOpenChange:M=>{u(M),M||v(null)},placement:"bottom-end",middleware:[K.offset(8),K.flip(),K.shift()],whileElementsMounted:K.autoUpdate}),f=K.useClick(d),E=K.useDismiss(d,{outsidePressEvent:"mousedown"}),{getReferenceProps:y,getFloatingProps:k}=K.useInteractions([f,E]),T=K.useId(),m=()=>{t&&(navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3))},x=async()=>{if(r)try{await r.disconnect(),u(!1)}catch(M){console.error("Error disconnecting wallet:",M)}},O=M=>{r&&r.setActiveAccount&&r.setActiveAccount(M)},A=()=>{const M=!R;P(M),localStorage.setItem("uwui:balance-preference",M?"available":"total")},N=p.useMemo(()=>({activeAddress:t,activeWallet:r,theme:n,resolvedTheme:o,closeMenu:()=>u(!1),openDialog:s,closeDialog:i,setActivePanel:v,activePanel:g}),[t,r,n,o,s,i,g]),I=p.useMemo(()=>l.filter(M=>!M.enabled||M.enabled(N)),[l,N]),W=g?l.find(M=>M.key===g):null,G=e||w.jsx(Yr,{}),J=p.cloneElement(G,y({ref:Q.setReference}));return w.jsxs(w.Fragment,{children:[J,c&&w.jsx(K.FloatingPortal,{children:w.jsx(K.FloatingFocusManager,{context:d,modal:!1,children:w.jsx("div",{"data-wallet-theme":!0,"data-wallet-ui":!0,"data-theme":F,children:w.jsx("div",{ref:Q.setFloating,style:a,...k(),role:"menu","aria-labelledby":T,className:"z-50 w-80 rounded-xl bg-[var(--wui-color-bg)] shadow-xl border border-[var(--wui-color-border)]",children:w.jsx("div",{className:"p-4",children:W?w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[w.jsx("button",{onClick:()=>v(null),className:"p-1 rounded-md hover:bg-[var(--wui-color-bg-secondary)] transition-colors text-[var(--wui-color-text-secondary)]","aria-label":"Back to menu",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("path",{d:"m15 18-6-6 6-6"})})}),w.jsx("h3",{className:"text-sm font-medium text-[var(--wui-color-text)]",children:W.label})]}),W.render({ctx:N,goBack:()=>v(null)})]}):w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[w.jsx("div",{className:"h-12 w-12 overflow-hidden",children:w.jsx(so,{nfd:$.data,alt:`${C||t} avatar`,size:48})}),w.jsxs("div",{children:[w.jsx("h3",{id:T,className:"text-lg font-bold text-[var(--wui-color-text)] max-w-[220px] truncate wallet-custom-font",children:C||(t?ur(t,6,4):"My Wallet")}),C&&t&&w.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:ur(t,6,4)})]})]}),w.jsx("div",{className:"mb-4 bg-[var(--wui-color-bg-secondary)] rounded-lg p-3",children:w.jsxs("div",{className:"flex justify-between items-center",children:[U!==null&&w.jsxs("span",{className:"text-base font-medium text-[var(--wui-color-text)] flex items-center gap-1",children:[mc(U,{fractionDigits:4}),w.jsx(Df,{})]}),w.jsxs("button",{onClick:A,className:"flex items-center gap-1 text-sm text-[var(--wui-color-text-secondary)] bg-[var(--wui-color-bg-tertiary)] py-1 pl-2.5 pr-2 rounded-md hover:brightness-90 transition-all focus:outline-none",title:R?"Show total balance":"Show available balance",children:[R?"Available":"Total",w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-0.5 opacity-80",children:[w.jsx("path",{d:"m17 10-5-5-5 5"}),w.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),w.jsx(lr,{slot:"after-balance",ctx:N}),r&&r.accounts&&r.accounts.length>1&&w.jsx("div",{className:"mb-4",children:w.jsxs($f,{value:t||"",onChange:O,children:[w.jsx(zi,{className:"block text-sm font-medium text-[var(--wui-color-text-secondary)] mb-1",children:"Select Account"}),w.jsxs("div",{className:"relative mt-1",children:[w.jsxs(pa,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-[var(--wui-color-border)] bg-[var(--wui-color-bg-secondary)] py-2 px-3 text-left text-[var(--wui-color-text)] shadow-sm focus:outline-none focus:ring-2 focus:ring-[var(--wui-color-primary)] focus:border-transparent text-sm",children:[w.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?ur(t,6,4):"Select account"}),w.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-[var(--wui-color-text-secondary)]","aria-hidden":"true",children:w.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),w.jsx(ma,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-[var(--wui-color-bg-secondary)] py-1 shadow-lg ring-1 ring-black/5 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:r.accounts.map(M=>w.jsxs(ga,{value:M.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-[var(--wui-color-text)] data-[focus]:bg-[var(--wui-color-bg-hover)] data-[focus]:outline-none",children:[w.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:ur(M.address,6,4)}),w.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[var(--wui-color-primary)] group-[&:not([data-selected])]:hidden",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:w.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},M.address))})]})]})}),w.jsx(lr,{slot:"after-accounts",ctx:N}),w.jsx("div",{className:"border-t border-[var(--wui-color-border)] mt-2 mb-2"}),r&&w.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[w.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:r.metadata.icon?w.jsx("img",{src:r.metadata.icon,alt:`${r.metadata.name} icon`,className:"max-w-full max-h-full"}):w.jsx("div",{className:"h-5 w-5 rounded-full bg-[var(--wui-color-bg-tertiary)] flex items-center justify-center",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 text-[var(--wui-color-text-tertiary)]",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M17 9c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9zm-1 0v8h-4V9h4zM8 4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V4zM3 3h4v14H3V3z",clipRule:"evenodd"})})})}),w.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:r.metadata.name}),tt.isPasskeyWallet(r)&&w.jsx("span",{"data-passkey-domain":!0,className:"rounded-md bg-[var(--wui-color-bg-tertiary)] px-[7px] py-px text-xs text-[var(--wui-color-text-secondary)]",children:tt.getPasskeyAccountDomain((q=r.activeAccount)==null?void 0:q.name)})]}),w.jsx(lr,{slot:"after-wallet-info",ctx:N}),w.jsx(lr,{slot:"before-actions",ctx:N}),I.length>0&&w.jsx("div",{className:"flex flex-col gap-1 mb-2",children:I.map(M=>w.jsxs("button",{onClick:()=>v(M.key),className:"w-full flex items-center justify-between py-2 px-2 rounded-lg text-sm text-[var(--wui-color-text)] hover:bg-[var(--wui-color-bg-secondary)] transition-colors",children:[w.jsxs("span",{className:"flex items-center gap-2",children:[M.icon&&w.jsx(M.icon,{className:"h-4 w-4 text-[var(--wui-color-text-secondary)]"}),M.label]}),w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[var(--wui-color-text-tertiary)]",children:w.jsx("path",{d:"m9 18 6-6-6-6"})})]},M.key))}),w.jsx("div",{className:"border-t border-[var(--wui-color-border)] mb-3 mt-2"}),w.jsxs("div",{className:"flex gap-2",children:[w.jsx("button",{onClick:m,className:"flex-1 py-2 px-4 bg-[var(--wui-color-bg-tertiary)] text-[var(--wui-color-text-secondary)] font-medium rounded-xl hover:brightness-90 transition-all text-sm flex items-center justify-center",title:"Copy address",children:S?w.jsxs(w.Fragment,{children:[w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):w.jsxs(w.Fragment,{children:[w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[w.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),w.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),w.jsx(lr,{slot:"actions",ctx:N}),w.jsx("button",{onClick:x,className:"flex-1 py-2 px-4 bg-[var(--wui-color-danger-bg)] text-[var(--wui-color-danger-text)] font-medium rounded-xl hover:bg-[var(--wui-color-danger-bg-hover)] transition-colors text-sm",children:"Disconnect"})]})]})})})})})})]})}function ba(e){const{queryClient:t}=rr();return w.jsx(ro,{client:t,children:w.jsx(Lf,{...e})})}function Bf({size:e,className:t,style:r,passkeyLayout:n}){const{activeAddress:o}=Ke.useWallet();return o?w.jsx(ba,{children:w.jsx(Yr,{size:e,className:t,style:r})}):w.jsx(fi,{passkeyLayout:n,children:w.jsx(Kr,{size:e,className:t,style:r})})}wa();exports.getPasskeyErrorMessage=tt.getPasskeyErrorMessage;exports.ConnectWalletButton=Kr;exports.ConnectWalletMenu=fi;exports.ConnectedWalletButton=Yr;exports.ConnectedWalletMenu=ba;exports.NfdAvatar=so;exports.PasskeyConnect=Dn;exports.WalletButton=Bf;exports.WalletList=Bn;exports.WalletUIProvider=uc;exports.useAccountInfo=va;exports.useNfd=oo;exports.usePlugins=Or;exports.useResolvedTheme=ai;exports.useWalletUI=rr;
96
96
  //# sourceMappingURL=index.cjs.map