@txnlab/use-wallet-ui-react 0.2.0 → 0.2.1
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.
- package/README.md +5 -4
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/style.css +909 -916
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
34
34
|
<%s key={someKey} {...props} />`,z,ae,de,ae),M[ae+z]=!0)}if(ae=null,j!==void 0&&(n(j),ae=""+j),i(L)&&(n(L.key),ae=""+L.key),"key"in L){j={};for(var pe in L)pe!=="key"&&(j[pe]=L[pe])}else j=L;return ae&&a(j,typeof P=="function"?P.displayName||P.name||"Unknown":P),u(P,ae,V,q,o(),j,X,ee)}function h(P){typeof P=="object"&&P!==null&&P.$$typeof===p&&P._store&&(P._store.validated=1)}var E=C,p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),I=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),b=Symbol.for("react.client.reference"),w=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,A=Array.isArray,k=console.createTask?console.createTask:function(){return null};E={"react-stack-bottom-frame":function(P){return P()}};var m,S={},F=E["react-stack-bottom-frame"].bind(E,s)(),v=k(r(s)),M={};An.Fragment=y,An.jsx=function(P,L,j,z,q){var V=1e4>w.recentlyCreatedOwnerStacks++;return d(P,L,j,!1,z,q,V?Error("react-stack-top-frame"):F,V?k(r(P)):v)},An.jsxs=function(P,L,j,z,q){var V=1e4>w.recentlyCreatedOwnerStacks++;return d(P,L,j,!0,z,q,V?Error("react-stack-top-frame"):F,V?k(r(P)):v)}}()),An}var ms;function Ml(){return ms||(ms=1,process.env.NODE_ENV==="production"?nr.exports=Fl():nr.exports=Pl()),nr.exports}var $=Ml();function Fi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Fi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Il(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Fi(e))&&(r&&(r+=" "),r+=t);return r}const Uo="-",Dl=e=>{const t=Ll(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Uo);return a[0]===""&&a.length!==1&&a.shift(),Pi(a,t)||Nl(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Pi=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Pi(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Uo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},gs=/^\[(.+)\]$/,Nl=e=>{if(gs.test(e)){const t=gs.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ll=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)so(n[o],r,o,t);return r},so=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:bs(t,o);s.classGroupId=n;return}if(typeof o=="function"){if($l(o)){so(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{so(i,bs(t,s),n,r)})})},bs=(e,t)=>{let n=e;return t.split(Uo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$l=e=>e.isThemeGetter,jl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},io="!",ao=":",Bl=ao.length,Hl=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,u;for(let g=0;g<o.length;g++){let y=o[g];if(i===0&&a===0){if(y===ao){s.push(o.slice(l,g)),l=g+Bl;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const d=s.length===0?o:o.substring(l),h=Ul(d),E=h!==d,p=u&&u>l?u-l:void 0;return{modifiers:s,hasImportantModifier:E,baseClassName:h,maybePostfixModifierPosition:p}};if(t){const o=t+ao,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Ul=e=>e.endsWith(io)?e.substring(0,e.length-1):e.startsWith(io)?e.substring(1):e,Wl=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},ql=e=>({cache:jl(e.cacheSize),parseClassName:Hl(e),sortModifiers:Wl(e),...Dl(e)}),zl=/\s+/,Gl=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(zl);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:h,modifiers:E,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let O=!!y,N=r(O?g.substring(0,y):g);if(!N){if(!O){l=d+(l.length>0?" "+l:l);continue}if(N=r(g),!N){l=d+(l.length>0?" "+l:l);continue}O=!1}const x=s(E).join(":"),I=p?x+io:x,B=I+N;if(i.includes(B))continue;i.push(B);const U=o(N,O);for(let H=0;H<U.length;++H){const W=U[H];i.push(I+W)}l=d+(l.length>0?" "+l:l)}return l};function Vl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Mi(t))&&(r&&(r+=" "),r+=n);return r}const Mi=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mi(e[r]))&&(n&&(n+=" "),n+=t);return n};function _l(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((d,h)=>h(d),e());return n=ql(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=Gl(l,n);return o(l,d),d}return function(){return s(Vl.apply(null,arguments))}}const ge=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ii=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Di=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ql=/^\d+\/\d+$/,Kl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yl=/\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$/,Xl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xt=e=>Ql.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),mt=e=>!!e&&Number.isInteger(Number(e)),Br=e=>e.endsWith("%")&&oe(e.slice(0,-1)),it=e=>Kl.test(e),ec=()=>!0,tc=e=>Yl.test(e)&&!Xl.test(e),Ni=()=>!1,nc=e=>Jl.test(e),rc=e=>Zl.test(e),oc=e=>!K(e)&&!Y(e),sc=e=>yn(e,ji,Ni),K=e=>Ii.test(e),Tt=e=>yn(e,Bi,tc),Hr=e=>yn(e,uc,oe),vs=e=>yn(e,Li,Ni),ic=e=>yn(e,$i,rc),rr=e=>yn(e,Hi,nc),Y=e=>Di.test(e),On=e=>wn(e,Bi),ac=e=>wn(e,fc),ys=e=>wn(e,Li),lc=e=>wn(e,ji),cc=e=>wn(e,$i),or=e=>wn(e,Hi,!0),yn=(e,t,n)=>{const r=Ii.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wn=(e,t,n=!1)=>{const r=Di.exec(e);return r?r[1]?t(r[1]):n:!1},Li=e=>e==="position"||e==="percentage",$i=e=>e==="image"||e==="url",ji=e=>e==="length"||e==="size"||e==="bg-size",Bi=e=>e==="length",uc=e=>e==="number",fc=e=>e==="family-name",Hi=e=>e==="shadow",dc=()=>{const e=ge("color"),t=ge("font"),n=ge("text"),r=ge("font-weight"),o=ge("tracking"),s=ge("leading"),i=ge("breakpoint"),a=ge("container"),l=ge("spacing"),u=ge("radius"),d=ge("shadow"),h=ge("inset-shadow"),E=ge("text-shadow"),p=ge("drop-shadow"),g=ge("blur"),y=ge("perspective"),O=ge("aspect"),N=ge("ease"),x=ge("animate"),I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...B(),Y,K],H=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],c=()=>[Y,K,l],f=()=>[Xt,"full","auto",...c()],b=()=>[mt,"none","subgrid",Y,K],w=()=>["auto",{span:["full",mt,Y,K]},mt,Y,K],R=()=>[mt,"auto",Y,K],A=()=>["auto","min","max","fr",Y,K],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],m=()=>["start","end","center","stretch","center-safe","end-safe"],S=()=>["auto",...c()],F=()=>[Xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...c()],v=()=>[e,Y,K],M=()=>[...B(),ys,vs,{position:[Y,K]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",lc,sc,{size:[Y,K]}],j=()=>[Br,On,Tt],z=()=>["","none","full",u,Y,K],q=()=>["",oe,On,Tt],V=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[oe,Br,ys,vs],ae=()=>["","none",g,Y,K],de=()=>["none",oe,Y,K],pe=()=>["none",oe,Y,K],Z=()=>[oe,Y,K],G=()=>[Xt,"full",...c()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[it],breakpoint:[it],color:[ec],container:[it],"drop-shadow":[it],ease:["in","out","in-out"],font:[oc],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[it],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[it],shadow:[it],spacing:["px",oe],text:[it],"text-shadow":[it],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xt,K,Y,O]}],container:["container"],columns:[{columns:[oe,K,Y,a]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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:U()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:f()}],"inset-x":[{"inset-x":f()}],"inset-y":[{"inset-y":f()}],start:[{start:f()}],end:[{end:f()}],top:[{top:f()}],right:[{right:f()}],bottom:[{bottom:f()}],left:[{left:f()}],visibility:["visible","invisible","collapse"],z:[{z:[mt,"auto",Y,K]}],basis:[{basis:[Xt,"full","auto",a,...c()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,Xt,"auto","initial","none",K]}],grow:[{grow:["",oe,Y,K]}],shrink:[{shrink:["",oe,Y,K]}],order:[{order:[mt,"first","last","none",Y,K]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:w()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:w()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:c()}],"gap-x":[{"gap-x":c()}],"gap-y":[{"gap-y":c()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...m(),"normal"]}],"justify-self":[{"justify-self":["auto",...m()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...m(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...m(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...m(),"baseline"]}],"place-self":[{"place-self":["auto",...m()]}],p:[{p:c()}],px:[{px:c()}],py:[{py:c()}],ps:[{ps:c()}],pe:[{pe:c()}],pt:[{pt:c()}],pr:[{pr:c()}],pb:[{pb:c()}],pl:[{pl:c()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":c()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":c()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[a,"screen",...F()]}],"min-w":[{"min-w":[a,"screen","none",...F()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...F()]}],h:[{h:["screen",...F()]}],"min-h":[{"min-h":["screen","none",...F()]}],"max-h":[{"max-h":["screen",...F()]}],"font-size":[{text:["base",n,On,Tt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Y,Hr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Br,K]}],"font-family":[{font:[ac,K,t]}],"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,Y,K]}],"line-clamp":[{"line-clamp":[oe,"none",Y,Hr]}],leading:[{leading:[s,...c()]}],"list-image":[{"list-image":["none",Y,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Y,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",Y,Tt]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[oe,"auto",Y,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:c()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y,K]}],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",Y,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mt,Y,K],radial:["",Y,K],conic:[mt,Y,K]},cc,ic]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...V(),"hidden","none"]}],"divide-style":[{divide:[...V(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...V(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,Y,K]}],"outline-w":[{outline:["",oe,On,Tt]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",d,or,rr]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",h,or,rr]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[oe,Tt]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",E,or,rr]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[oe,Y,K]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"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":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[Y,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"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":B()}],"mask-image-conic-pos":[{"mask-conic":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Y,K]}],filter:[{filter:["","none",Y,K]}],blur:[{blur:ae()}],brightness:[{brightness:[oe,Y,K]}],contrast:[{contrast:[oe,Y,K]}],"drop-shadow":[{"drop-shadow":["","none",p,or,rr]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",oe,Y,K]}],"hue-rotate":[{"hue-rotate":[oe,Y,K]}],invert:[{invert:["",oe,Y,K]}],saturate:[{saturate:[oe,Y,K]}],sepia:[{sepia:["",oe,Y,K]}],"backdrop-filter":[{"backdrop-filter":["","none",Y,K]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[oe,Y,K]}],"backdrop-contrast":[{"backdrop-contrast":[oe,Y,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,Y,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,Y,K]}],"backdrop-invert":[{"backdrop-invert":["",oe,Y,K]}],"backdrop-opacity":[{"backdrop-opacity":[oe,Y,K]}],"backdrop-saturate":[{"backdrop-saturate":[oe,Y,K]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,Y,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":c()}],"border-spacing-x":[{"border-spacing-x":c()}],"border-spacing-y":[{"border-spacing-y":c()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Y,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",Y,K]}],ease:[{ease:["linear","initial",N,Y,K]}],delay:[{delay:[oe,Y,K]}],animate:[{animate:["none",x,Y,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Y,K]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[Y,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"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",Y,K]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":c()}],"scroll-mx":[{"scroll-mx":c()}],"scroll-my":[{"scroll-my":c()}],"scroll-ms":[{"scroll-ms":c()}],"scroll-me":[{"scroll-me":c()}],"scroll-mt":[{"scroll-mt":c()}],"scroll-mr":[{"scroll-mr":c()}],"scroll-mb":[{"scroll-mb":c()}],"scroll-ml":[{"scroll-ml":c()}],"scroll-p":[{"scroll-p":c()}],"scroll-px":[{"scroll-px":c()}],"scroll-py":[{"scroll-py":c()}],"scroll-ps":[{"scroll-ps":c()}],"scroll-pe":[{"scroll-pe":c()}],"scroll-pt":[{"scroll-pt":c()}],"scroll-pr":[{"scroll-pr":c()}],"scroll-pb":[{"scroll-pb":c()}],"scroll-pl":[{"scroll-pl":c()}],"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",Y,K]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[oe,On,Tt,Hr]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hc=_l(dc);function en(...e){return hc(Il(e))}const Wo=C.forwardRef(({className:e="",children:t,style:n,...r},o)=>$.jsx("button",{ref:o,className:en("bg-[#2D2DF1] dark:bg-[#BFBFF9] transition-colors hover:bg-[#2929D9] dark:hover:bg-[#D4D4FA] text-white dark:text-[#001324] font-bold py-2.5 px-4 rounded-xl disabled:opacity-50 wallet-custom-font",e),style:n,...r,type:"button","data-wallet-ui":!0,children:t||"Connect Wallet"}));Wo.displayName="ConnectWalletButton";function Cr(){return typeof window<"u"}function At(e){return Ui(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ot(e){var t;return(t=(Ui(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ui(e){return Cr()?e instanceof Node||e instanceof Le(e).Node:!1}function ue(e){return Cr()?e instanceof Element||e instanceof Le(e).Element:!1}function be(e){return Cr()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function lo(e){return!Cr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}function _n(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function pc(e){return["table","td","th"].includes(At(e))}function kr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function qo(e){const t=Ar(),n=ue(e)?qe(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function mc(e){let t=ht(e);for(;be(t)&&!ut(t);){if(qo(t))return t;if(kr(t))return null;t=ht(t)}return null}function Ar(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ut(e){return["html","body","#document"].includes(At(e))}function qe(e){return Le(e).getComputedStyle(e)}function Or(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ht(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lo(e)&&e.host||ot(e);return lo(t)?t.host:t}function Wi(e){const t=ht(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&_n(t)?t:Wi(t)}function Ct(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wi(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Le(o);if(s){const a=co(i);return t.concat(i,i.visualViewport||[],_n(o)?o:[],a&&n?Ct(a):[])}return t.concat(o,Ct(o,[],n))}function co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ie(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&lo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function qi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function zi(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function gc(e){return e.mozInputSource===0&&e.isTrusted?!0:uo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function bc(e){return yc()?!1:!uo()&&e.width===0&&e.height===0||uo()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function vc(){return/apple/i.test(navigator.vendor)}function uo(){const e=/android/i;return e.test(qi())||e.test(zi())}function yc(){return zi().includes("jsdom/")}function ws(e,t){return["mouse","pen"].includes(e)}function wc(e){return"nativeEvent"in e}function xc(e){return e.matches("html,body")}function De(e){return(e==null?void 0:e.ownerDocument)||document}function Ur(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Dt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ec="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Gi(e){return be(e)&&e.matches(Ec)}function Wr(e){e.preventDefault(),e.stopPropagation()}function xs(e){return e?e.getAttribute("role")==="combobox"&&Gi(e):!1}const Vt=Math.min,Se=Math.max,$n=Math.round,sr=Math.floor,rt=e=>({x:e,y:e}),Rc={left:"right",right:"left",bottom:"top",top:"bottom"},Sc={start:"end",end:"start"};function Es(e,t,n){return Se(e,Vt(t,n))}function xn(e,t){return typeof e=="function"?e(t):e}function kt(e){return e.split("-")[0]}function Qn(e){return e.split("-")[1]}function Vi(e){return e==="x"?"y":"x"}function _i(e){return e==="y"?"height":"width"}function _t(e){return["top","bottom"].includes(kt(e))?"y":"x"}function Qi(e){return Vi(_t(e))}function Cc(e,t,n){n===void 0&&(n=!1);const r=Qn(e),o=Qi(e),s=_i(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=pr(i)),[i,pr(i)]}function kc(e){const t=pr(e);return[fo(e),t,fo(t)]}function fo(e){return e.replace(/start|end/g,t=>Sc[t])}function Ac(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function Oc(e,t,n,r){const o=Qn(e);let s=Ac(kt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(fo)))),s}function pr(e){return e.replace(/left|right|bottom|top/g,t=>Rc[t])}function Tc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fc(e){return typeof e!="number"?Tc(e):{top:e,right:e,bottom:e,left:e}}function mr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
35
35
|
* tabbable 6.2.0
|
|
36
36
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
37
|
-
*/var Pc=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],gr=Pc.join(","),Ki=typeof Element>"u",bn=Ki?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,br=!Ki&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},vr=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},Mc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ic=function(t,n,r){if(vr(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(gr));return n&&bn.call(t,gr)&&o.unshift(t),o=o.filter(r),o},Dc=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!vr(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,u=e(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var d=bn.call(i,gr);d&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),E=!vr(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&E){var p=e(h===!0?i.children:h.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Yi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Xi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Mc(t))&&!Yi(t)?0:t.tabIndex},Nc=function(t,n){var r=Xi(t);return r<0&&n&&!Yi(t)?0:r},Lc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ji=function(t){return t.tagName==="INPUT"},$c=function(t){return Ji(t)&&t.type==="hidden"},jc=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Bc=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Hc=function(t){if(!t.name)return!0;var n=t.form||br(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Bc(o,t.form);return!s||s===t},Uc=function(t){return Ji(t)&&t.type==="radio"},Wc=function(t){return Uc(t)&&!Hc(t)},qc=function(t){var n,r=t&&br(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var u,d,h;r=br(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((d=o)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return s},Rs=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},zc=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=bn.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(bn.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=br(t);if(l&&!l.shadowRoot&&o(l)===!0)return Rs(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(qc(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Rs(t);return!1},Gc=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return bn.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Vc=function(t,n){return!(n.disabled||vr(n)||$c(n)||zc(n,t)||jc(n)||Gc(n))},ho=function(t,n){return!(Wc(n)||Xi(n)<0||!Vc(t,n))},_c=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Qc=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=Nc(a,i),u=i?e(o.candidates):a;l===0?i?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:u})}),r.sort(Lc).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Tr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Dc([t],n.includeContainer,{filter:ho.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_c}):r=Ic(t,n.includeContainer,ho.bind(null,n)),Qc(r)},Kc=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return bn.call(t,gr)===!1?!1:ho(n,t)};function Ss(e,t,n){let{reference:r,floating:o}=e;const s=_t(t),i=Qi(t),a=_i(i),l=kt(t),u=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,E=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-o.width,y:h};break;default:p={x:r.x,y:r.y}}switch(Qn(t)){case"start":p[i]-=E*(n&&u?-1:1);break;case"end":p[i]+=E*(n&&u?-1:1);break}return p}const Yc=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Ss(u,r,l),E=r,p={},g=0;for(let y=0;y<a.length;y++){const{name:O,fn:N}=a[y],{x,y:I,data:B,reset:U}=await N({x:d,y:h,initialPlacement:r,placement:E,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});d=x??d,h=I??h,p={...p,[O]:{...p[O],...B}},U&&g<=50&&(g++,typeof U=="object"&&(U.placement&&(E=U.placement),U.rects&&(u=U.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):U.rects),{x:d,y:h}=Ss(u,E,l)),y=-1)}return{x:d,y:h,placement:E,strategy:o,middlewareData:p}};async function Fr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:E=!1,padding:p=0}=xn(t,e),g=Fc(p),O=a[E?h==="floating"?"reference":"floating":h],N=mr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(O)))==null||n?O:O.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),x=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,I=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),B=await(s.isElement==null?void 0:s.isElement(I))?await(s.getScale==null?void 0:s.getScale(I))||{x:1,y:1}:{x:1,y:1},U=mr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:I,strategy:l}):x);return{top:(N.top-U.top+g.top)/B.y,bottom:(U.bottom-N.bottom+g.bottom)/B.y,left:(N.left-U.left+g.left)/B.x,right:(U.right-N.right+g.right)/B.x}}const Xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:E,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...O}=xn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const N=kt(o),x=_t(a),I=kt(a)===a,B=await(l.isRTL==null?void 0:l.isRTL(u.floating)),U=E||(I||!y?[pr(a)]:kc(a)),H=g!=="none";!E&&H&&U.push(...Oc(a,y,g,B));const W=[a,...U],c=await Fr(t,O),f=[];let b=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&f.push(c[N]),h){const k=Cc(o,i,B);f.push(c[k[0]],c[k[1]])}if(b=[...b,{placement:o,overflows:f}],!f.every(k=>k<=0)){var w,R;const k=(((w=s.flip)==null?void 0:w.index)||0)+1,m=W[k];if(m)return{data:{index:k,overflows:b},reset:{placement:m}};let S=(R=b.filter(F=>F.overflows[0]<=0).sort((F,v)=>F.overflows[1]-v.overflows[1])[0])==null?void 0:R.placement;if(!S)switch(p){case"bestFit":{var A;const F=(A=b.filter(v=>{if(H){const M=_t(v.placement);return M===x||M==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(M=>M>0).reduce((M,P)=>M+P,0)]).sort((v,M)=>v[1]-M[1])[0])==null?void 0:A[0];F&&(S=F);break}case"initialPlacement":S=a;break}if(o!==S)return{reset:{placement:S}}}return{}}}};async function Jc(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=kt(n),a=Qn(n),l=_t(n)==="y",u=["left","top"].includes(i)?-1:1,d=s&&l?-1:1,h=xn(t,e);let{mainAxis:E,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:E*u}:{x:E*u,y:p*d}}const Zc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Jc(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},eu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:O=>{let{x:N,y:x}=O;return{x:N,y:x}}},...l}=xn(e,t),u={x:n,y:r},d=await Fr(t,l),h=_t(kt(o)),E=Vi(h);let p=u[E],g=u[h];if(s){const O=E==="y"?"top":"left",N=E==="y"?"bottom":"right",x=p+d[O],I=p-d[N];p=Es(x,p,I)}if(i){const O=h==="y"?"top":"left",N=h==="y"?"bottom":"right",x=g+d[O],I=g-d[N];g=Es(x,g,I)}const y=a.fn({...t,[E]:p,[h]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[E]:s,[h]:i}}}}}},tu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=xn(e,t),d=await Fr(t,u),h=kt(o),E=Qn(o),p=_t(o)==="y",{width:g,height:y}=s.floating;let O,N;h==="top"||h==="bottom"?(O=h,N=E===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(N=h,O=E==="end"?"top":"bottom");const x=y-d.top-d.bottom,I=g-d.left-d.right,B=Vt(y-d[O],x),U=Vt(g-d[N],I),H=!t.middlewareData.shift;let W=B,c=U;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(c=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=x),H&&!E){const b=Se(d.left,0),w=Se(d.right,0),R=Se(d.top,0),A=Se(d.bottom,0);p?c=g-2*(b!==0||w!==0?b+w:Se(d.left,d.right)):W=y-2*(R!==0||A!==0?R+A:Se(d.top,d.bottom))}await l({...t,availableWidth:c,availableHeight:W});const f=await i.getDimensions(a.floating);return g!==f.width||y!==f.height?{reset:{rects:!0}}:{}}}};function Zi(e){const t=qe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=$n(n)!==s||$n(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function zo(e){return ue(e)?e:e.contextElement}function tn(e){const t=zo(e);if(!be(t))return rt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Zi(t);let i=(s?$n(n.width):n.width)/r,a=(s?$n(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const nu=rt(0);function ea(e){const t=Le(e);return!Ar()||!t.visualViewport?nu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ru(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Le(e)?!1:t}function Qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=zo(e);let i=rt(1);t&&(r?ue(r)&&(i=tn(r)):i=tn(e));const a=ru(s,n,r)?ea(s):rt(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,h=o.height/i.y;if(s){const E=Le(s),p=r&&ue(r)?Le(r):r;let g=E,y=co(g);for(;y&&r&&p!==g;){const O=tn(y),N=y.getBoundingClientRect(),x=qe(y),I=N.left+(y.clientLeft+parseFloat(x.paddingLeft))*O.x,B=N.top+(y.clientTop+parseFloat(x.paddingTop))*O.y;l*=O.x,u*=O.y,d*=O.x,h*=O.y,l+=I,u+=B,g=Le(y),y=co(g)}}return mr({width:d,height:h,x:l,y:u})}function Go(e,t){const n=Or(e).scrollLeft;return t?t.left+n:Qt(ot(e)).left+n}function ta(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Go(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function ou(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ot(r),a=t?kr(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=rt(1);const d=rt(0),h=be(r);if((h||!h&&!s)&&((At(r)!=="body"||_n(i))&&(l=Or(r)),be(r))){const p=Qt(r);u=tn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const E=i&&!h&&!s?ta(i,l,!0):rt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+E.x,y:n.y*u.y-l.scrollTop*u.y+d.y+E.y}}function su(e){return Array.from(e.getClientRects())}function iu(e){const t=ot(e),n=Or(e),r=e.ownerDocument.body,o=Se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Go(e);const a=-n.scrollTop;return qe(r).direction==="rtl"&&(i+=Se(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function au(e,t){const n=Le(e),r=ot(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=Ar();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function lu(e,t){const n=Qt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=be(e)?tn(e):rt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Cs(e,t,n){let r;if(t==="viewport")r=au(e,n);else if(t==="document")r=iu(ot(e));else if(ue(t))r=lu(t,n);else{const o=ea(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mr(r)}function na(e,t){const n=ht(e);return n===t||!ue(n)||ut(n)?!1:qe(n).position==="fixed"||na(n,t)}function cu(e,t){const n=t.get(e);if(n)return n;let r=Ct(e,[],!1).filter(a=>ue(a)&&At(a)!=="body"),o=null;const s=qe(e).position==="fixed";let i=s?ht(e):e;for(;ue(i)&&!ut(i);){const a=qe(i),l=qo(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||_n(i)&&!l&&na(e,i))?r=r.filter(d=>d!==i):o=a,i=ht(i)}return t.set(e,r),r}function uu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?kr(t)?[]:cu(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const h=Cs(t,d,o);return u.top=Se(h.top,u.top),u.right=Vt(h.right,u.right),u.bottom=Vt(h.bottom,u.bottom),u.left=Se(h.left,u.left),u},Cs(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fu(e){const{width:t,height:n}=Zi(e);return{width:t,height:n}}function du(e,t,n){const r=be(t),o=ot(t),s=n==="fixed",i=Qt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=rt(0);if(r||!r&&!s)if((At(t)!=="body"||_n(o))&&(a=Or(t)),r){const E=Qt(t,!0,s,t);l.x=E.x+t.clientLeft,l.y=E.y+t.clientTop}else o&&(l.x=Go(o));const u=o&&!r&&!s?ta(o,a):rt(0),d=i.left+a.scrollLeft-l.x-u.x,h=i.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:i.width,height:i.height}}function qr(e){return qe(e).position==="static"}function ks(e,t){if(!be(e)||qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ot(e)===n&&(n=n.ownerDocument.body),n}function ra(e,t){const n=Le(e);if(kr(e))return n;if(!be(e)){let o=ht(e);for(;o&&!ut(o);){if(ue(o)&&!qr(o))return o;o=ht(o)}return n}let r=ks(e,t);for(;r&&pc(r)&&qr(r);)r=ks(r,t);return r&&ut(r)&&qr(r)&&!qo(r)?n:r||mc(e)||n}const hu=async function(e){const t=this.getOffsetParent||ra,n=this.getDimensions,r=await n(e.floating);return{reference:du(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pu(e){return qe(e).direction==="rtl"}const mu={convertOffsetParentRelativeRectToViewportRelativeRect:ou,getDocumentElement:ot,getClippingRect:uu,getOffsetParent:ra,getElementRects:hu,getClientRects:su,getDimensions:fu,getScale:tn,isElement:ue,isRTL:pu};function oa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gu(e,t){let n=null,r;const o=ot(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:E,height:p}=u;if(a||t(),!E||!p)return;const g=sr(h),y=sr(o.clientWidth-(d+E)),O=sr(o.clientHeight-(h+p)),N=sr(d),I={rootMargin:-g+"px "+-y+"px "+-O+"px "+-N+"px",threshold:Se(0,Vt(1,l))||1};let B=!0;function U(H){const W=H[0].intersectionRatio;if(W!==l){if(!B)return i();W?i(!1,W):r=setTimeout(()=>{i(!1,1e-7)},1e3)}W===1&&!oa(u,e.getBoundingClientRect())&&i(),B=!1}try{n=new IntersectionObserver(U,{...I,root:o.ownerDocument})}catch{n=new IntersectionObserver(U,I)}n.observe(e)}return i(!0),s}function sa(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=zo(e),d=o||s?[...u?Ct(u):[],...Ct(t)]:[];d.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const h=u&&a?gu(u,n):null;let E=-1,p=null;i&&(p=new ResizeObserver(N=>{let[x]=N;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var I;(I=p)==null||I.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let g,y=l?Qt(e):null;l&&O();function O(){const N=Qt(e);y&&!oa(y,N)&&n(),y=N,g=requestAnimationFrame(O)}return n(),()=>{var N;d.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),h==null||h(),(N=p)==null||N.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const zr=Fr,bu=Zc,vu=eu,yu=Xc,wu=tu,xu=(e,t,n)=>{const r=new Map,o={platform:mu,...n},s={...o.platform,_c:r};return Yc(e,t,{...o,platform:s})};var hr=typeof document<"u"?C.useLayoutEffect:C.useEffect;function yr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!yr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ia(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function As(e,t){const n=ia(e);return Math.round(t*n)/n}function Gr(e){const t=D.useRef(e);return hr(()=>{t.current=e}),t}function aa(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,h]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[E,p]=D.useState(r);yr(E,r)||p(r);const[g,y]=D.useState(null),[O,N]=D.useState(null),x=D.useCallback(v=>{v!==H.current&&(H.current=v,y(v))},[]),I=D.useCallback(v=>{v!==W.current&&(W.current=v,N(v))},[]),B=s||g,U=i||O,H=D.useRef(null),W=D.useRef(null),c=D.useRef(d),f=l!=null,b=Gr(l),w=Gr(o),R=Gr(u),A=D.useCallback(()=>{if(!H.current||!W.current)return;const v={placement:t,strategy:n,middleware:E};w.current&&(v.platform=w.current),xu(H.current,W.current,v).then(M=>{const P={...M,isPositioned:R.current!==!1};k.current&&!yr(c.current,P)&&(c.current=P,Ln.flushSync(()=>{h(P)}))})},[E,t,n,w,R]);hr(()=>{u===!1&&c.current.isPositioned&&(c.current.isPositioned=!1,h(v=>({...v,isPositioned:!1})))},[u]);const k=D.useRef(!1);hr(()=>(k.current=!0,()=>{k.current=!1}),[]),hr(()=>{if(B&&(H.current=B),U&&(W.current=U),B&&U){if(b.current)return b.current(B,U,A);A()}},[B,U,A,b,f]);const m=D.useMemo(()=>({reference:H,floating:W,setReference:x,setFloating:I}),[x,I]),S=D.useMemo(()=>({reference:B,floating:U}),[B,U]),F=D.useMemo(()=>{const v={position:n,left:0,top:0};if(!S.floating)return v;const M=As(S.floating,d.x),P=As(S.floating,d.y);return a?{...v,transform:"translate("+M+"px, "+P+"px)",...ia(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:P}},[n,a,S.floating,d.x,d.y]);return D.useMemo(()=>({...d,update:A,refs:m,elements:S,floatingStyles:F}),[d,A,m,S,F])}const Vo=(e,t)=>({...bu(e),options:[e,t]}),la=(e,t)=>({...vu(e),options:[e,t]}),ca=(e,t)=>({...yu(e),options:[e,t]}),Eu=(e,t)=>({...wu(e),options:[e,t]});function Ru(e){const t=D.useRef(void 0),n=D.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s==null?void 0:s())}},e);return D.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const ua={...D},Su=ua.useInsertionEffect,Cu=Su||(e=>e());function tt(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Cu(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Ne=typeof document<"u"?C.useLayoutEffect:C.useEffect;let Os=!1,ku=0;const Ts=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ku++;function Au(){const[e,t]=D.useState(()=>Os?Ts():void 0);return Ne(()=>{e==null&&t(Ts())},[]),D.useEffect(()=>{Os=!0},[]),e}const Ou=ua.useId,vn=Ou||Au;let po;process.env.NODE_ENV!=="production"&&(po=new Set);function Tu(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=po)!=null&&e.has(o))){var s;(s=po)==null||s.add(o),console.error(o)}}function Fu(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Pu=D.createContext(null),Mu=D.createContext(null),fa=()=>{var e;return((e=D.useContext(Pu))==null?void 0:e.id)||null},_o=()=>D.useContext(Mu);function jn(e){return"data-floating-ui-"+e}function Vr(e){const t=C.useRef(e);return Ne(()=>{t.current=e}),t}let Fs=0;function Jt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Fs);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Fs=requestAnimationFrame(s)}function Ps(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function Mn(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}let Zt=new WeakMap,ir=new WeakSet,ar={},_r=0;const Iu=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,da=e=>e&&(e.host||da(e.parentNode)),Du=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=da(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Nu(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Du(t,e),a=new Set,l=new Set(i),u=[];ar[o]||(ar[o]=new WeakMap);const d=ar[o];i.forEach(h),E(t),a.clear();function h(p){!p||a.has(p)||(a.add(p),p.parentNode&&h(p.parentNode))}function E(p){!p||l.has(p)||[].forEach.call(p.children,g=>{if(At(g)!=="script")if(a.has(g))E(g);else{const y=s?g.getAttribute(s):null,O=y!==null&&y!=="false",N=Zt.get(g)||0,x=s?N+1:N,I=(d.get(g)||0)+1;Zt.set(g,x),d.set(g,I),u.push(g),x===1&&O&&ir.add(g),I===1&&g.setAttribute(o,""),!O&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return _r++,()=>{u.forEach(p=>{const g=Zt.get(p)||0,y=s?g-1:g,O=(d.get(p)||0)-1;Zt.set(p,y),d.set(p,O),y||(!ir.has(p)&&s&&p.removeAttribute(s),ir.delete(p)),O||p.removeAttribute(o)}),_r--,_r||(Zt=new WeakMap,Zt=new WeakMap,ir=new WeakSet,ar={})}}function Ms(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=De(e[0]).body;return Nu(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Pr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ha(e,t){const n=Tr(e,Pr());t==="prev"&&n.reverse();const r=n.indexOf(Pt(De(e)));return n.slice(r+1)[0]}function pa(e){return ha(De(e).body,"next")||e}function ma(e){return ha(De(e).body,"prev")||e}function In(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ie(n,r)}function Lu(e){Tr(e,Pr()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Is(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Mr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},wr=D.forwardRef(function(t,n){const[r,o]=D.useState();Ne(()=>{vc()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[jn("focus-guard")]:"",style:Mr};return $.jsx("span",{...t,...s})}),ga=D.createContext(null),Ds=jn("portal");function $u(e){e===void 0&&(e={});const{id:t,root:n}=e,r=vn(),o=va(),[s,i]=D.useState(null),a=D.useRef(null);return Ne(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Ne(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(Ds,""),l.appendChild(u),a.current=u,i(u)},[t,r]),Ne(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!ue(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const d=document.createElement("div");d.id=r,d.setAttribute(Ds,""),l=u||l,l.appendChild(d),a.current=d,i(d)},[t,n,r,o]),s}function ba(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=$u({id:n,root:r}),[i,a]=D.useState(null),l=D.useRef(null),u=D.useRef(null),d=D.useRef(null),h=D.useRef(null),E=i==null?void 0:i.modal,p=i==null?void 0:i.open,g=!!i&&!i.modal&&i.open&&o&&!!(r||s);return D.useEffect(()=>{if(!s||!o||E)return;function y(O){s&&In(O)&&(O.type==="focusin"?Is:Lu)(s)}return s.addEventListener("focusin",y,!0),s.addEventListener("focusout",y,!0),()=>{s.removeEventListener("focusin",y,!0),s.removeEventListener("focusout",y,!0)}},[s,o,E]),D.useEffect(()=>{s&&(p||Is(s))},[p,s]),$.jsxs(ga.Provider,{value:D.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:h,portalNode:s,setFocusManagerState:a}),[o,s]),children:[g&&s&&$.jsx(wr,{"data-type":"outside",ref:l,onFocus:y=>{if(In(y,s)){var O;(O=d.current)==null||O.focus()}else{const N=i?i.domReference:null,x=ma(N);x==null||x.focus()}}}),g&&s&&$.jsx("span",{"aria-owns":s.id,style:Mr}),s&&Ln.createPortal(t,s),g&&s&&$.jsx(wr,{"data-type":"outside",ref:u,onFocus:y=>{if(In(y,s)){var O;(O=h.current)==null||O.focus()}else{const N=i?i.domReference:null,x=pa(N);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,y.nativeEvent,"focus-out"))}}})]})}const va=()=>D.useContext(ga),mo="data-floating-ui-focusable";function Ns(e){return e?e.hasAttribute(mo)?e:e.querySelector("["+mo+"]")||e:null}function Ls(e){return D.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const ju=20;let Mt=[];function Bu(e){Mt=Mt.filter(t=>t.isConnected),e&&At(e)!=="body"&&(Mt.push(e),Mt.length>ju&&(Mt=Mt.slice(-20)))}function $s(){return Mt.slice().reverse().find(e=>e.isConnected)}function Hu(e){const t=Pr();return Kc(e,t)?e:Tr(e,t)[0]||e}const Uu=D.forwardRef(function(t,n){return $.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Mr})});function ya(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0,outsideElementsInert:E=!1,getInsideElements:p=()=>[]}=e,{open:g,onOpenChange:y,events:O,dataRef:N,elements:{domReference:x,floating:I}}=t,B=tt(()=>{var Z;return(Z=N.current.floatingContext)==null?void 0:Z.nodeId}),U=tt(p),H=typeof i=="number"&&i<0,W=xs(x)&&H,c=Iu(),f=c?s:!0,b=!f||c&&E,w=Vr(o),R=Vr(i),A=Vr(a),k=_o(),m=va(),S=D.useRef(null),F=D.useRef(null),v=D.useRef(!1),M=D.useRef(!1),P=D.useRef(-1),L=m!=null,j=Ns(I),z=tt(function(Z){return Z===void 0&&(Z=j),Z?Tr(Z,Pr()):[]}),q=tt(Z=>{const G=z(Z);return w.current.map(_=>x&&_==="reference"?x:j&&_==="floating"?j:G).filter(Boolean).flat()});D.useEffect(()=>{if(r||!u)return;function Z(_){if(_.key==="Tab"){Ie(j,Pt(De(j)))&&z().length===0&&!W&&Wr(_);const J=q(),ne=Dt(_);w.current[0]==="reference"&&ne===x&&(Wr(_),_.shiftKey?Jt(J[J.length-1]):Jt(J[1])),w.current[1]==="floating"&&ne===j&&_.shiftKey&&(Wr(_),Jt(J[0]))}}const G=De(j);return G.addEventListener("keydown",Z),()=>{G.removeEventListener("keydown",Z)}},[r,x,j,u,w,W,z,q]),D.useEffect(()=>{if(r||!I)return;function Z(G){const _=Dt(G),ne=z().indexOf(_);ne!==-1&&(P.current=ne)}return I.addEventListener("focusin",Z),()=>{I.removeEventListener("focusin",Z)}},[r,I,z]),D.useEffect(()=>{if(r||!h)return;function Z(){M.current=!0,setTimeout(()=>{M.current=!1})}function G(_){const J=_.relatedTarget;queueMicrotask(()=>{const ne=B(),Pe=!(Ie(x,J)||Ie(I,J)||Ie(J,I)||Ie(m==null?void 0:m.portalNode,J)||J!=null&&J.hasAttribute(jn("focus-guard"))||k&&(Mn(k.nodesRef.current,ne).find(Oe=>{var me,Ee;return Ie((me=Oe.context)==null?void 0:me.elements.floating,J)||Ie((Ee=Oe.context)==null?void 0:Ee.elements.domReference,J)})||Ps(k.nodesRef.current,ne).find(Oe=>{var me,Ee,Ce;return[(me=Oe.context)==null?void 0:me.elements.floating,Ns((Ee=Oe.context)==null?void 0:Ee.elements.floating)].includes(J)||((Ce=Oe.context)==null?void 0:Ce.elements.domReference)===J})));if(l&&Pe&&Pt(De(j))===De(j).body){be(j)&&j.focus();const Oe=P.current,me=z(),Ee=me[Oe]||me[me.length-1]||j;be(Ee)&&Ee.focus()}(W||!u)&&J&&Pe&&!M.current&&J!==$s()&&(v.current=!0,y(!1,_,"focus-out"))})}if(I&&be(x))return x.addEventListener("focusout",G),x.addEventListener("pointerdown",Z),I.addEventListener("focusout",G),()=>{x.removeEventListener("focusout",G),x.removeEventListener("pointerdown",Z),I.removeEventListener("focusout",G)}},[r,x,I,j,u,k,m,y,h,l,z,W,B]);const V=D.useRef(null),X=D.useRef(null),ee=Ls([V,m==null?void 0:m.beforeInsideRef]),ae=Ls([X,m==null?void 0:m.afterInsideRef]);D.useEffect(()=>{var Z,G;if(r||!I)return;const _=Array.from((m==null||(Z=m.portalNode)==null?void 0:Z.querySelectorAll("["+jn("portal")+"]"))||[]),J=k?Ps(k.nodesRef.current,B()):[],ne=k&&!u?J.map(Ee=>{var Ce;return(Ce=Ee.context)==null?void 0:Ce.elements.floating}):[],Pe=(G=J.find(Ee=>{var Ce;return xs(((Ce=Ee.context)==null?void 0:Ce.elements.domReference)||null)}))==null||(G=G.context)==null?void 0:G.elements.domReference,Oe=[I,Pe,..._,...ne,...U(),S.current,F.current,V.current,X.current,m==null?void 0:m.beforeOutsideRef.current,m==null?void 0:m.afterOutsideRef.current,w.current.includes("reference")||W?x:null].filter(Ee=>Ee!=null),me=u||W?Ms(Oe,!b,b):Ms(Oe);return()=>{me()}},[r,x,I,u,w,m,W,f,b,k,B,U]),Ne(()=>{if(r||!be(j))return;const Z=De(j),G=Pt(Z);queueMicrotask(()=>{const _=q(j),J=R.current,ne=(typeof J=="number"?_[J]:J.current)||j,Pe=Ie(j,G);!H&&!Pe&&g&&Jt(ne,{preventScroll:ne===j})})},[r,g,j,H,q,R]),Ne(()=>{if(r||!j)return;let Z=!1,G=!1;const _=De(j),J=Pt(_);let Pe=N.current.openEvent;Bu(J);function Oe(Ce){let{open:Zn,reason:Cn,event:Ye,nested:er}=Ce;if(Zn&&(Pe=Ye),Cn==="escape-key"&&(G=!0),["hover","safe-polygon"].includes(Cn)&&Ye.type==="mouseleave"&&(v.current=!0),Cn==="outside-press")if(er)v.current=!1,Z=!0;else if(gc(Ye)||bc(Ye))v.current=!1;else{let us=!1;document.createElement("div").focus({get preventScroll(){return us=!0,!1}}),us?(v.current=!1,Z=!0):v.current=!0}}O.on("openchange",Oe);const me=_.createElement("span");me.setAttribute("tabindex","-1"),me.setAttribute("aria-hidden","true"),Object.assign(me.style,Mr),L&&x&&x.insertAdjacentElement("afterend",me);function Ee(){return typeof A.current=="boolean"?G&&x?x:$s()||me:A.current.current||me}return()=>{O.off("openchange",Oe);const Ce=Pt(_),Zn=Ie(I,Ce)||k&&Mn(k.nodesRef.current,B()).some(Ye=>{var er;return Ie((er=Ye.context)==null?void 0:er.elements.floating,Ce)});(Zn||Pe&&["click","mousedown"].includes(Pe.type))&&(G=!0);const Cn=Ee();queueMicrotask(()=>{const Ye=Hu(Cn);A.current&&!v.current&&be(Ye)&&(!(Ye!==Ce&&Ce!==_.body)||Zn)&&Ye.focus({preventScroll:Z}),me.remove()})}},[r,I,j,A,N,O,k,L,x,B]),D.useEffect(()=>{queueMicrotask(()=>{v.current=!1})},[r]),Ne(()=>{if(!r&&m)return m.setFocusManagerState({modal:u,closeOnFocusOut:h,open:g,onOpenChange:y,domReference:x}),()=>{m.setFocusManagerState(null)}},[r,m,u,g,y,h,x]),Ne(()=>{if(r||!j||typeof MutationObserver!="function"||H)return;const Z=()=>{const _=j.getAttribute("tabindex"),J=z(),ne=Pt(De(I)),Pe=J.indexOf(ne);Pe!==-1&&(P.current=Pe),w.current.includes("floating")||ne!==x&&J.length===0?_!=="0"&&j.setAttribute("tabindex","0"):_!=="-1"&&j.setAttribute("tabindex","-1")};Z();const G=new MutationObserver(Z);return G.observe(j,{childList:!0,subtree:!0,attributes:!0}),()=>{G.disconnect()}},[r,I,j,x,w,z,H]);function de(Z){return r||!d||!u?null:$.jsx(Uu,{ref:Z==="start"?S:F,onClick:G=>y(!1,G.nativeEvent),children:typeof d=="string"?d:"Dismiss"})}const pe=!r&&f&&(u?!W:!0)&&(L||u);return $.jsxs($.Fragment,{children:[pe&&$.jsx(wr,{"data-type":"inside",ref:ee,onFocus:Z=>{if(u){const _=q();Jt(o[0]==="reference"?_[0]:_[_.length-1])}else if(m!=null&&m.preserveTabOrder&&m.portalNode)if(v.current=!1,In(Z,m.portalNode)){const _=pa(x);_==null||_.focus()}else{var G;(G=m.beforeOutsideRef.current)==null||G.focus()}}}),!W&&de("start"),n,de("end"),pe&&$.jsx(wr,{"data-type":"inside",ref:ae,onFocus:Z=>{if(u)Jt(q()[0]);else if(m!=null&&m.preserveTabOrder&&m.portalNode)if(h&&(v.current=!0),In(Z,m.portalNode)){const _=ma(x);_==null||_.focus()}else{var G;(G=m.afterOutsideRef.current)==null||G.focus()}}})]})}let lr=0;function Wu(){const e=/iP(hone|ad|od)|iOS/.test(qi()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,s=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var a,l;const u=((a=window.visualViewport)==null?void 0:a.offsetLeft)||0,d=((l=window.visualViewport)==null?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(d))+"px",left:-(s-Math.floor(u))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(s,i))}}let js=()=>{};const qu=D.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return Ne(()=>{if(r)return lr++,lr===1&&(js=Wu()),()=>{lr--,lr===0&&js()}},[r]),$.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Bs(e){return be(e.target)&&e.target.tagName==="BUTTON"}function zu(e){return be(e.target)&&e.target.tagName==="A"}function Hs(e){return Gi(e)}function wa(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:h=!0}=t,E=D.useRef(),p=D.useRef(!1),g=D.useMemo(()=>({onPointerDown(y){E.current=y.pointerType},onMouseDown(y){const O=E.current;y.button===0&&a!=="click"&&(ws(O)&&u||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,y.nativeEvent,"click"):(y.preventDefault(),r(!0,y.nativeEvent,"click"))))},onClick(y){const O=E.current;if(a==="mousedown"&&E.current){E.current=void 0;return}ws(O)&&u||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,y.nativeEvent,"click"):r(!0,y.nativeEvent,"click"))},onKeyDown(y){E.current=void 0,!(y.defaultPrevented||!d||Bs(y))&&(y.key===" "&&!Hs(s)&&(y.preventDefault(),p.current=!0),!zu(y)&&y.key==="Enter"&&r(!(n&&l),y.nativeEvent,"click"))},onKeyUp(y){y.defaultPrevented||!d||Bs(y)||Hs(s)||y.key===" "&&p.current&&(p.current=!1,r(!(n&&l),y.nativeEvent,"click"))}}),[o,s,a,u,d,r,n,h,l]);return D.useMemo(()=>i?{reference:g}:{},[i,g])}const Gu={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Vu={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Us=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function xa(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:E=!1,bubbles:p,capture:g}=t,y=_o(),O=tt(typeof l=="function"?l:()=>!1),N=typeof l=="function"?O:l,x=D.useRef(!1),I=D.useRef(!1),{escapeKey:B,outsidePress:U}=Us(p),{escapeKey:H,outsidePress:W}=Us(g),c=D.useRef(!1),f=tt(m=>{var S;if(!n||!i||!a||m.key!=="Escape"||c.current)return;const F=(S=s.current.floatingContext)==null?void 0:S.nodeId,v=y?Mn(y.nodesRef.current,F):[];if(!B&&(m.stopPropagation(),v.length>0)){let M=!0;if(v.forEach(P=>{var L;if((L=P.context)!=null&&L.open&&!P.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,wc(m)?m.nativeEvent:m,"escape-key")}),b=tt(m=>{var S;const F=()=>{var v;f(m),(v=Dt(m))==null||v.removeEventListener("keydown",F)};(S=Dt(m))==null||S.addEventListener("keydown",F)}),w=tt(m=>{var S;const F=x.current;x.current=!1;const v=I.current;if(I.current=!1,u==="click"&&v||F||typeof N=="function"&&!N(m))return;const M=Dt(m),P="["+jn("inert")+"]",L=De(o.floating).querySelectorAll(P);let j=ue(M)?M:null;for(;j&&!ut(j);){const X=ht(j);if(ut(X)||!ue(X))break;j=X}if(L.length&&ue(M)&&!xc(M)&&!Ie(M,o.floating)&&Array.from(L).every(X=>!Ie(j,X)))return;if(be(M)&&k){const X=ut(M),ee=qe(M),ae=/auto|scroll/,de=X||ae.test(ee.overflowX),pe=X||ae.test(ee.overflowY),Z=de&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,G=pe&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,_=ee.direction==="rtl",J=G&&(_?m.offsetX<=M.offsetWidth-M.clientWidth:m.offsetX>M.clientWidth),ne=Z&&m.offsetY>M.clientHeight;if(J||ne)return}const z=(S=s.current.floatingContext)==null?void 0:S.nodeId,q=y&&Mn(y.nodesRef.current,z).some(X=>{var ee;return Ur(m,(ee=X.context)==null?void 0:ee.elements.floating)});if(Ur(m,o.floating)||Ur(m,o.domReference)||q)return;const V=y?Mn(y.nodesRef.current,z):[];if(V.length>0){let X=!0;if(V.forEach(ee=>{var ae;if((ae=ee.context)!=null&&ae.open&&!ee.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}r(!1,m,"outside-press")}),R=tt(m=>{var S;const F=()=>{var v;w(m),(v=Dt(m))==null||v.removeEventListener(u,F)};(S=Dt(m))==null||S.addEventListener(u,F)});D.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=B,s.current.__outsidePressBubbles=U;let m=-1;function S(L){r(!1,L,"ancestor-scroll")}function F(){window.clearTimeout(m),c.current=!0}function v(){m=window.setTimeout(()=>{c.current=!1},Ar()?5:0)}const M=De(o.floating);a&&(M.addEventListener("keydown",H?b:f,H),M.addEventListener("compositionstart",F),M.addEventListener("compositionend",v)),N&&M.addEventListener(u,W?R:w,W);let P=[];return E&&(ue(o.domReference)&&(P=Ct(o.domReference)),ue(o.floating)&&(P=P.concat(Ct(o.floating))),!ue(o.reference)&&o.reference&&o.reference.contextElement&&(P=P.concat(Ct(o.reference.contextElement)))),P=P.filter(L=>{var j;return L!==((j=M.defaultView)==null?void 0:j.visualViewport)}),P.forEach(L=>{L.addEventListener("scroll",S,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",H?b:f,H),M.removeEventListener("compositionstart",F),M.removeEventListener("compositionend",v)),N&&M.removeEventListener(u,W?R:w,W),P.forEach(L=>{L.removeEventListener("scroll",S)}),window.clearTimeout(m)}},[s,o,a,N,u,n,r,E,i,B,U,f,H,b,w,W,R]),D.useEffect(()=>{x.current=!1},[N,u]);const A=D.useMemo(()=>({onKeyDown:f,...d&&{[Gu[h]]:m=>{r(!1,m.nativeEvent,"reference-press")},...h!=="click"&&{onClick(m){r(!1,m.nativeEvent,"reference-press")}}}}),[f,r,d,h]),k=D.useMemo(()=>({onKeyDown:f,onMouseDown(){I.current=!0},onMouseUp(){I.current=!0},[Vu[u]]:()=>{x.current=!0}}),[f,u]);return D.useMemo(()=>i?{reference:A,floating:k}:{},[i,A,k])}function _u(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=vn(),s=D.useRef({}),[i]=D.useState(()=>Fu()),a=fa()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!ue(p)&&Tu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=D.useState(r.reference),d=tt((p,g,y)=>{s.current.openEvent=p?g:void 0,i.emit("openchange",{open:p,event:g,reason:y,nested:a}),n==null||n(p,g,y)}),h=D.useMemo(()=>({setPositionReference:u}),[]),E=D.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return D.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:E,events:i,floatingId:o,refs:h}),[t,d,E,i,o,h])}function Ea(e){e===void 0&&(e={});const{nodeId:t}=e,n=_u({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=D.useState(null),[a,l]=D.useState(null),d=(o==null?void 0:o.domReference)||s,h=D.useRef(null),E=_o();Ne(()=>{d&&(h.current=d)},[d]);const p=aa({...e,elements:{...o,...a&&{reference:a}}}),g=D.useCallback(I=>{const B=ue(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;l(B),p.refs.setReference(B)},[p.refs]),y=D.useCallback(I=>{(ue(I)||I===null)&&(h.current=I,i(I)),(ue(p.refs.reference.current)||p.refs.reference.current===null||I!==null&&!ue(I))&&p.refs.setReference(I)},[p.refs]),O=D.useMemo(()=>({...p.refs,setReference:y,setPositionReference:g,domReference:h}),[p.refs,y,g]),N=D.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),x=D.useMemo(()=>({...p,...r,refs:O,elements:N,nodeId:t}),[p,O,N,t,r]);return Ne(()=>{r.dataRef.current.floatingContext=x;const I=E==null?void 0:E.nodesRef.current.find(B=>B.id===t);I&&(I.context=x)}),D.useMemo(()=>({...p,context:x,refs:O,elements:N}),[p,O,N,x])}const Ws="active",qs="selected";function Qr(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Ws]:i,[qs]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[mo]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[u,d]=l;if(!(o&&[Ws,qs].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var h;(h=r.get(u))==null||h.push(d),i[u]=function(){for(var E,p=arguments.length,g=new Array(p),y=0;y<p;y++)g[y]=arguments[y];return(E=r.get(u))==null?void 0:E.map(O=>O(...g)).find(O=>O!==void 0)}}}else i[u]=d}),i),{})}}function Ra(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=D.useCallback(a=>Qr(a,e,"reference"),t),s=D.useCallback(a=>Qr(a,e,"floating"),n),i=D.useCallback(a=>Qr(a,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Qu=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ku(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=Qu.get(i))!=null?n:i,l=vn(),d=fa()!=null,h=D.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&d&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,d,r,l,i]),E=D.useMemo(()=>{const g={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?g:{...g,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),p=D.useCallback(g=>{let{active:y,selected:O}=g;const N={role:"option",...y&&{id:o+"-option"}};switch(i){case"select":return{...N,"aria-selected":y&&O};case"combobox":return{...N,...y&&{"aria-selected":!0}}}return{}},[o,i]);return D.useMemo(()=>s?{reference:h,floating:E,item:p}:{},[s,h,E,p])}function Sa({wallets:e,handleWalletClick:t}){return $.jsxs("ul",{className:"space-y-1.5","data-wallet-ui":!0,children:[e.map(n=>$.jsx("li",{children:$.jsxs("button",{onClick:()=>t(n),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-gray-800 dark:text-[#E9E9FD] transition-colors hover:bg-[#E9E9FD] dark:hover:bg-[#192A39] rounded-xl",children:[$.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-md overflow-hidden bg-gray-50 dark:bg-transparent flex items-center justify-center",children:$.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),$.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&$.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400",children:"No wallets found."})]})}function Ca({children:e}){const[t,n]=C.useState(!1),[r,o]=C.useState(null),{wallets:s,activeAddress:i}=dt.useWallet(),{refs:a,context:l}=Ea({open:t,onOpenChange:H=>{H&&i||(H?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),u=wa(l),d=xa(l,{outsidePressEvent:"mousedown"}),h=Ku(l,{role:"dialog"}),{getReferenceProps:E,getFloatingProps:p}=Ra([u,d,h]),g=vn(),y=vn(),O=async H=>{try{await H.connect(),l.onOpenChange(!1)}catch(W){console.error(`Error connecting to ${H.metadata.name}:`,W),l.onOpenChange(!1)}},N=H=>{i||l.onOpenChange(!0)},x=e||$.jsx(Wo,{}),I=Ru([a.setReference,x.ref||null]),B={...E(),ref:I,onClick:N},U=C.cloneElement(x,B);return $.jsxs($.Fragment,{children:[U,$.jsx(ba,{id:"wallet-dialog-portal","data-wallet-ui":!0,children:t&&$.jsx(qu,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-black/30 dark:bg-black/50 data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":r,lockScroll:!0,children:$.jsx(ya,{context:l,modal:!0,children:$.jsxs("div",{ref:a.setFloating,...p({"aria-labelledby":g,"aria-describedby":y}),"data-state":r,className:"w-full max-w-sm rounded-3xl bg-white dark:bg-[#001324] 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:[$.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[$.jsx("h2",{id:g,className:"text-xl font-bold text-gray-900 dark:text-[#E9E9FD] wallet-custom-font",children:"Connect a Wallet"}),$.jsx("button",{onClick:()=>l.onOpenChange(!1),className:"absolute right-4 rounded-full bg-gray-100 dark:bg-[#192A39]/75 p-2 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-[#192A39] hover:text-gray-700 dark:hover:text-[#D4D4FA]","aria-label":"Close dialog",children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:$.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"})})})]}),$.jsx("div",{className:"px-4 pb-3",children:$.jsx(Sa,{wallets:s,handleWalletClick:O})}),$.jsxs("div",{className:"px-6 py-5 border-t border-gray-200 dark:border-[#192A39] flex items-center justify-between",children:[$.jsx("span",{className:"text-gray-600 dark:text-[#99A1A7] text-sm",children:"Need an Algorand wallet?"}),$.jsx("a",{href:"https://algorand.co/wallets",className:"text-[#2D2DF1]/80 dark:text-[#6C6CF1] font-medium text-sm hover:text-[#2D2DF1] dark:hover:text-[#8080F3]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})]})}var Yu=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Kr=Math.ceil,je=Math.floor,Te="[BigNumber Error] ",zs=Te+"Number primitive has more than 15 significant digits: ",ze=1e14,re=14,Gs=9007199254740991,Yr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gt=1e7,Me=1e9;function ka(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},s=new x(1),i=20,a=4,l=-7,u=21,d=-1e7,h=1e7,E=!1,p=1,g=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},O="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function x(c,f){var b,w,R,A,k,m,S,F,v=this;if(!(v instanceof x))return new x(c,f);if(f==null){if(c&&c._isBigNumber===!0){v.s=c.s,!c.c||c.e>h?v.c=v.e=null:c.e<d?v.c=[v.e=0]:(v.e=c.e,v.c=c.c.slice());return}if((m=typeof c=="number")&&c*0==0){if(v.s=1/c<0?(c=-c,-1):1,c===~~c){for(A=0,k=c;k>=10;k/=10,A++);A>h?v.c=v.e=null:(v.e=A,v.c=[c]);return}F=String(c)}else{if(!Yu.test(F=String(c)))return r(v,F,m);v.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(A=F.indexOf("."))>-1&&(F=F.replace(".","")),(k=F.search(/e/i))>0?(A<0&&(A=k),A+=+F.slice(k+1),F=F.substring(0,k)):A<0&&(A=F.length)}else{if(fe(f,2,O.length,"Base"),f==10&&N)return v=new x(c),H(v,i+v.e+1,a);if(F=String(c),m=typeof c=="number"){if(c*0!=0)return r(v,F,m,f);if(v.s=1/c<0?(F=F.slice(1),-1):1,x.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(zs+c)}else v.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(b=O.slice(0,f),A=k=0,S=F.length;k<S;k++)if(b.indexOf(w=F.charAt(k))<0){if(w=="."){if(k>A){A=S;continue}}else if(!R&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){R=!0,k=-1,A=0;continue}return r(v,String(c),m,f)}m=!1,F=n(F,f,10,v.s),(A=F.indexOf("."))>-1?F=F.replace(".",""):A=F.length}for(k=0;F.charCodeAt(k)===48;k++);for(S=F.length;F.charCodeAt(--S)===48;);if(F=F.slice(k,++S)){if(S-=k,m&&x.DEBUG&&S>15&&(c>Gs||c!==je(c)))throw Error(zs+v.s*c);if((A=A-k-1)>h)v.c=v.e=null;else if(A<d)v.c=[v.e=0];else{if(v.e=A,v.c=[],k=(A+1)%re,A<0&&(k+=re),k<S){for(k&&v.c.push(+F.slice(0,k)),S-=re;k<S;)v.c.push(+F.slice(k,k+=re));k=re-(F=F.slice(k)).length}else k-=S;for(;k--;F+="0");v.c.push(+F)}}else v.c=[v.e=0]}x.clone=ka,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(c){var f,b;if(c!=null)if(typeof c=="object"){if(c.hasOwnProperty(f="DECIMAL_PLACES")&&(b=c[f],fe(b,0,Me,f),i=b),c.hasOwnProperty(f="ROUNDING_MODE")&&(b=c[f],fe(b,0,8,f),a=b),c.hasOwnProperty(f="EXPONENTIAL_AT")&&(b=c[f],b&&b.pop?(fe(b[0],-1e9,0,f),fe(b[1],0,Me,f),l=b[0],u=b[1]):(fe(b,-1e9,Me,f),l=-(u=b<0?-b:b))),c.hasOwnProperty(f="RANGE"))if(b=c[f],b&&b.pop)fe(b[0],-1e9,-1,f),fe(b[1],1,Me,f),d=b[0],h=b[1];else if(fe(b,-1e9,Me,f),b)d=-(h=b<0?-b:b);else throw Error(Te+f+" cannot be zero: "+b);if(c.hasOwnProperty(f="CRYPTO"))if(b=c[f],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))E=b;else throw E=!b,Error(Te+"crypto unavailable");else E=b;else throw Error(Te+f+" not true or false: "+b);if(c.hasOwnProperty(f="MODULO_MODE")&&(b=c[f],fe(b,0,9,f),p=b),c.hasOwnProperty(f="POW_PRECISION")&&(b=c[f],fe(b,0,Me,f),g=b),c.hasOwnProperty(f="FORMAT"))if(b=c[f],typeof b=="object")y=b;else throw Error(Te+f+" not an object: "+b);if(c.hasOwnProperty(f="ALPHABET"))if(b=c[f],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))N=b.slice(0,10)=="0123456789",O=b;else throw Error(Te+f+" invalid: "+b)}else throw Error(Te+"Object expected: "+c);return{DECIMAL_PLACES:i,ROUNDING_MODE:a,EXPONENTIAL_AT:[l,u],RANGE:[d,h],CRYPTO:E,MODULO_MODE:p,POW_PRECISION:g,FORMAT:y,ALPHABET:O}},x.isBigNumber=function(c){if(!c||c._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var f,b,w=c.c,R=c.e,A=c.s;e:if({}.toString.call(w)=="[object Array]"){if((A===1||A===-1)&&R>=-1e9&&R<=Me&&R===je(R)){if(w[0]===0){if(R===0&&w.length===1)return!0;break e}if(f=(R+1)%re,f<1&&(f+=re),String(w[0]).length==f){for(f=0;f<w.length;f++)if(b=w[f],b<0||b>=ze||b!==je(b))break e;if(b!==0)return!0}}}else if(w===null&&R===null&&(A===null||A===1||A===-1))return!0;throw Error(Te+"Invalid BigNumber: "+c)},x.maximum=x.max=function(){return B(arguments,-1)},x.minimum=x.min=function(){return B(arguments,1)},x.random=function(){var c=9007199254740992,f=Math.random()*c&2097151?function(){return je(Math.random()*c)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var w,R,A,k,m,S=0,F=[],v=new x(s);if(b==null?b=i:fe(b,0,Me),k=Kr(b/re),E)if(crypto.getRandomValues){for(w=crypto.getRandomValues(new Uint32Array(k*=2));S<k;)m=w[S]*131072+(w[S+1]>>>11),m>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),w[S]=R[0],w[S+1]=R[1]):(F.push(m%1e14),S+=2);S=k/2}else if(crypto.randomBytes){for(w=crypto.randomBytes(k*=7);S<k;)m=(w[S]&31)*281474976710656+w[S+1]*1099511627776+w[S+2]*4294967296+w[S+3]*16777216+(w[S+4]<<16)+(w[S+5]<<8)+w[S+6],m>=9e15?crypto.randomBytes(7).copy(w,S):(F.push(m%1e14),S+=7);S=k/7}else throw E=!1,Error(Te+"crypto unavailable");if(!E)for(;S<k;)m=f(),m<9e15&&(F[S++]=m%1e14);for(k=F[--S],b%=re,k&&b&&(m=Yr[re-b],F[S]=je(k/m)*m);F[S]===0;F.pop(),S--);if(S<0)F=[A=0];else{for(A=-1;F[0]===0;F.splice(0,1),A-=re);for(S=1,m=F[0];m>=10;m/=10,S++);S<re&&(A-=re-S)}return v.e=A,v.c=F,v}}(),x.sum=function(){for(var c=1,f=arguments,b=new x(f[0]);c<f.length;)b=b.plus(f[c++]);return b},n=function(){var c="0123456789";function f(b,w,R,A){for(var k,m=[0],S,F=0,v=b.length;F<v;){for(S=m.length;S--;m[S]*=w);for(m[0]+=A.indexOf(b.charAt(F++)),k=0;k<m.length;k++)m[k]>R-1&&(m[k+1]==null&&(m[k+1]=0),m[k+1]+=m[k]/R|0,m[k]%=R)}return m.reverse()}return function(b,w,R,A,k){var m,S,F,v,M,P,L,j,z=b.indexOf("."),q=i,V=a;for(z>=0&&(v=g,g=0,b=b.replace(".",""),j=new x(w),P=j.pow(b.length-z),g=v,j.c=f(at($e(P.c),P.e,"0"),10,R,c),j.e=j.c.length),L=f(b,w,R,k?(m=O,c):(m=c,O)),F=v=L.length;L[--v]==0;L.pop());if(!L[0])return m.charAt(0);if(z<0?--F:(P.c=L,P.e=F,P.s=A,P=t(P,j,q,V,R),L=P.c,M=P.r,F=P.e),S=F+q+1,z=L[S],v=R/2,M=M||S<0||L[S+1]!=null,M=V<4?(z!=null||M)&&(V==0||V==(P.s<0?3:2)):z>v||z==v&&(V==4||M||V==6&&L[S-1]&1||V==(P.s<0?8:7)),S<1||!L[0])b=M?at(m.charAt(1),-q,m.charAt(0)):m.charAt(0);else{if(L.length=S,M)for(--R;++L[--S]>R;)L[S]=0,S||(++F,L=[1].concat(L));for(v=L.length;!L[--v];);for(z=0,b="";z<=v;b+=m.charAt(L[z++]));b=at(b,F,m.charAt(0))}return b}}(),t=function(){function c(w,R,A){var k,m,S,F,v=0,M=w.length,P=R%gt,L=R/gt|0;for(w=w.slice();M--;)S=w[M]%gt,F=w[M]/gt|0,k=L*S+F*P,m=P*S+k%gt*gt+v,v=(m/A|0)+(k/gt|0)+L*F,w[M]=m%A;return v&&(w=[v].concat(w)),w}function f(w,R,A,k){var m,S;if(A!=k)S=A>k?1:-1;else for(m=S=0;m<A;m++)if(w[m]!=R[m]){S=w[m]>R[m]?1:-1;break}return S}function b(w,R,A,k){for(var m=0;A--;)w[A]-=m,m=w[A]<R[A]?1:0,w[A]=m*k+w[A]-R[A];for(;!w[0]&&w.length>1;w.splice(0,1));}return function(w,R,A,k,m){var S,F,v,M,P,L,j,z,q,V,X,ee,ae,de,pe,Z,G,_=w.s==R.s?1:-1,J=w.c,ne=R.c;if(!J||!J[0]||!ne||!ne[0])return new x(!w.s||!R.s||(J?ne&&J[0]==ne[0]:!ne)?NaN:J&&J[0]==0||!ne?_*0:_/0);for(z=new x(_),q=z.c=[],F=w.e-R.e,_=A+F+1,m||(m=ze,F=Be(w.e/re)-Be(R.e/re),_=_/re|0),v=0;ne[v]==(J[v]||0);v++);if(ne[v]>(J[v]||0)&&F--,_<0)q.push(1),M=!0;else{for(de=J.length,Z=ne.length,v=0,_+=2,P=je(m/(ne[0]+1)),P>1&&(ne=c(ne,P,m),J=c(J,P,m),Z=ne.length,de=J.length),ae=Z,V=J.slice(0,Z),X=V.length;X<Z;V[X++]=0);G=ne.slice(),G=[0].concat(G),pe=ne[0],ne[1]>=m/2&&pe++;do{if(P=0,S=f(ne,V,Z,X),S<0){if(ee=V[0],Z!=X&&(ee=ee*m+(V[1]||0)),P=je(ee/pe),P>1)for(P>=m&&(P=m-1),L=c(ne,P,m),j=L.length,X=V.length;f(L,V,j,X)==1;)P--,b(L,Z<j?G:ne,j,m),j=L.length,S=1;else P==0&&(S=P=1),L=ne.slice(),j=L.length;if(j<X&&(L=[0].concat(L)),b(V,L,X,m),X=V.length,S==-1)for(;f(ne,V,Z,X)<1;)P++,b(V,Z<X?G:ne,X,m),X=V.length}else S===0&&(P++,V=[0]);q[v++]=P,V[0]?V[X++]=J[ae]||0:(V=[J[ae]],X=1)}while((ae++<de||V[0]!=null)&&_--);M=V[0]!=null,q[0]||q.splice(0,1)}if(m==ze){for(v=1,_=q[0];_>=10;_/=10,v++);H(z,A+(z.e=v+F*re-1)+1,k,M)}else z.e=F,z.r=+M;return z}}();function I(c,f,b,w){var R,A,k,m,S;if(b==null?b=a:fe(b,0,8),!c.c)return c.toString();if(R=c.c[0],k=c.e,f==null)S=$e(c.c),S=w==1||w==2&&(k<=l||k>=u)?ur(S,k):at(S,k,"0");else if(c=H(new x(c),f,b),A=c.e,S=$e(c.c),m=S.length,w==1||w==2&&(f<=A||A<=l)){for(;m<f;S+="0",m++);S=ur(S,A)}else if(f-=k,S=at(S,A,"0"),A+1>m){if(--f>0)for(S+=".";f--;S+="0");}else if(f+=A-m,f>0)for(A+1==m&&(S+=".");f--;S+="0");return c.s<0&&R?"-"+S:S}function B(c,f){for(var b,w,R=1,A=new x(c[0]);R<c.length;R++)w=new x(c[R]),(!w.s||(b=Ft(A,w))===f||b===0&&A.s===f)&&(A=w);return A}function U(c,f,b){for(var w=1,R=f.length;!f[--R];f.pop());for(R=f[0];R>=10;R/=10,w++);return(b=w+b*re-1)>h?c.c=c.e=null:b<d?c.c=[c.e=0]:(c.e=b,c.c=f),c}r=function(){var c=/^(-?)0([xbo])(?=\w[\w.]*$)/i,f=/^([^.]+)\.$/,b=/^\.([^.]+)$/,w=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(A,k,m,S){var F,v=m?k:k.replace(R,"");if(w.test(v))A.s=isNaN(v)?null:v<0?-1:1;else{if(!m&&(v=v.replace(c,function(M,P,L){return F=(L=L.toLowerCase())=="x"?16:L=="b"?2:8,!S||S==F?P:M}),S&&(F=S,v=v.replace(f,"$1").replace(b,"0.$1")),k!=v))return new x(v,F);if(x.DEBUG)throw Error(Te+"Not a"+(S?" base "+S:"")+" number: "+k);A.s=null}A.c=A.e=null}}();function H(c,f,b,w){var R,A,k,m,S,F,v,M=c.c,P=Yr;if(M){e:{for(R=1,m=M[0];m>=10;m/=10,R++);if(A=f-R,A<0)A+=re,k=f,S=M[F=0],v=je(S/P[R-k-1]%10);else if(F=Kr((A+1)/re),F>=M.length)if(w){for(;M.length<=F;M.push(0));S=v=0,R=1,A%=re,k=A-re+1}else break e;else{for(S=m=M[F],R=1;m>=10;m/=10,R++);A%=re,k=A-re+R,v=k<0?0:je(S/P[R-k-1]%10)}if(w=w||f<0||M[F+1]!=null||(k<0?S:S%P[R-k-1]),w=b<4?(v||w)&&(b==0||b==(c.s<0?3:2)):v>5||v==5&&(b==4||w||b==6&&(A>0?k>0?S/P[R-k]:0:M[F-1])%10&1||b==(c.s<0?8:7)),f<1||!M[0])return M.length=0,w?(f-=c.e+1,M[0]=P[(re-f%re)%re],c.e=-f||0):M[0]=c.e=0,c;if(A==0?(M.length=F,m=1,F--):(M.length=F+1,m=P[re-A],M[F]=k>0?je(S/P[R-k]%P[k])*m:0),w)for(;;)if(F==0){for(A=1,k=M[0];k>=10;k/=10,A++);for(k=M[0]+=m,m=1;k>=10;k/=10,m++);A!=m&&(c.e++,M[0]==ze&&(M[0]=1));break}else{if(M[F]+=m,M[F]!=ze)break;M[F--]=0,m=1}for(A=M.length;M[--A]===0;M.pop());}c.e>h?c.c=c.e=null:c.e<d&&(c.c=[c.e=0])}return c}function W(c){var f,b=c.e;return b===null?c.toString():(f=$e(c.c),f=b<=l||b>=u?ur(f,b):at(f,b,"0"),c.s<0?"-"+f:f)}return o.absoluteValue=o.abs=function(){var c=new x(this);return c.s<0&&(c.s=1),c},o.comparedTo=function(c,f){return Ft(this,new x(c,f))},o.decimalPlaces=o.dp=function(c,f){var b,w,R,A=this;if(c!=null)return fe(c,0,Me),f==null?f=a:fe(f,0,8),H(new x(A),c+A.e+1,f);if(!(b=A.c))return null;if(w=((R=b.length-1)-Be(this.e/re))*re,R=b[R])for(;R%10==0;R/=10,w--);return w<0&&(w=0),w},o.dividedBy=o.div=function(c,f){return t(this,new x(c,f),i,a)},o.dividedToIntegerBy=o.idiv=function(c,f){return t(this,new x(c,f),0,1)},o.exponentiatedBy=o.pow=function(c,f){var b,w,R,A,k,m,S,F,v,M=this;if(c=new x(c),c.c&&!c.isInteger())throw Error(Te+"Exponent not an integer: "+W(c));if(f!=null&&(f=new x(f)),m=c.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!c.c||!c.c[0])return v=new x(Math.pow(+W(M),m?c.s*(2-cr(c)):+W(c))),f?v.mod(f):v;if(S=c.s<0,f){if(f.c?!f.c[0]:!f.s)return new x(NaN);w=!S&&M.isInteger()&&f.isInteger(),w&&(M=M.mod(f))}else{if(c.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||m&&M.c[1]>=24e7:M.c[0]<8e13||m&&M.c[0]<=9999975e7)))return A=M.s<0&&cr(c)?-0:0,M.e>-1&&(A=1/A),new x(S?1/A:A);g&&(A=Kr(g/re+2))}for(m?(b=new x(.5),S&&(c.s=1),F=cr(c)):(R=Math.abs(+W(c)),F=R%2),v=new x(s);;){if(F){if(v=v.times(M),!v.c)break;A?v.c.length>A&&(v.c.length=A):w&&(v=v.mod(f))}if(R){if(R=je(R/2),R===0)break;F=R%2}else if(c=c.times(b),H(c,c.e+1,1),c.e>14)F=cr(c);else{if(R=+W(c),R===0)break;F=R%2}M=M.times(M),A?M.c&&M.c.length>A&&(M.c.length=A):w&&(M=M.mod(f))}return w?v:(S&&(v=s.div(v)),f?v.mod(f):A?H(v,g,a,k):v)},o.integerValue=function(c){var f=new x(this);return c==null?c=a:fe(c,0,8),H(f,f.e+1,c)},o.isEqualTo=o.eq=function(c,f){return Ft(this,new x(c,f))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(c,f){return Ft(this,new x(c,f))>0},o.isGreaterThanOrEqualTo=o.gte=function(c,f){return(f=Ft(this,new x(c,f)))===1||f===0},o.isInteger=function(){return!!this.c&&Be(this.e/re)>this.c.length-2},o.isLessThan=o.lt=function(c,f){return Ft(this,new x(c,f))<0},o.isLessThanOrEqualTo=o.lte=function(c,f){return(f=Ft(this,new x(c,f)))===-1||f===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(c,f){var b,w,R,A,k=this,m=k.s;if(c=new x(c,f),f=c.s,!m||!f)return new x(NaN);if(m!=f)return c.s=-f,k.plus(c);var S=k.e/re,F=c.e/re,v=k.c,M=c.c;if(!S||!F){if(!v||!M)return v?(c.s=-f,c):new x(M?k:NaN);if(!v[0]||!M[0])return M[0]?(c.s=-f,c):new x(v[0]?k:a==3?-0:0)}if(S=Be(S),F=Be(F),v=v.slice(),m=S-F){for((A=m<0)?(m=-m,R=v):(F=S,R=M),R.reverse(),f=m;f--;R.push(0));R.reverse()}else for(w=(A=(m=v.length)<(f=M.length))?m:f,m=f=0;f<w;f++)if(v[f]!=M[f]){A=v[f]<M[f];break}if(A&&(R=v,v=M,M=R,c.s=-c.s),f=(w=M.length)-(b=v.length),f>0)for(;f--;v[b++]=0);for(f=ze-1;w>m;){if(v[--w]<M[w]){for(b=w;b&&!v[--b];v[b]=f);--v[b],v[w]+=ze}v[w]-=M[w]}for(;v[0]==0;v.splice(0,1),--F);return v[0]?U(c,v,F):(c.s=a==3?-1:1,c.c=[c.e=0],c)},o.modulo=o.mod=function(c,f){var b,w,R=this;return c=new x(c,f),!R.c||!c.s||c.c&&!c.c[0]?new x(NaN):!c.c||R.c&&!R.c[0]?new x(R):(p==9?(w=c.s,c.s=1,b=t(R,c,0,3),c.s=w,b.s*=w):b=t(R,c,0,p),c=R.minus(b.times(c)),!c.c[0]&&p==1&&(c.s=R.s),c)},o.multipliedBy=o.times=function(c,f){var b,w,R,A,k,m,S,F,v,M,P,L,j,z,q,V=this,X=V.c,ee=(c=new x(c,f)).c;if(!X||!ee||!X[0]||!ee[0])return!V.s||!c.s||X&&!X[0]&&!ee||ee&&!ee[0]&&!X?c.c=c.e=c.s=null:(c.s*=V.s,!X||!ee?c.c=c.e=null:(c.c=[0],c.e=0)),c;for(w=Be(V.e/re)+Be(c.e/re),c.s*=V.s,S=X.length,M=ee.length,S<M&&(j=X,X=ee,ee=j,R=S,S=M,M=R),R=S+M,j=[];R--;j.push(0));for(z=ze,q=gt,R=M;--R>=0;){for(b=0,P=ee[R]%q,L=ee[R]/q|0,k=S,A=R+k;A>R;)F=X[--k]%q,v=X[k]/q|0,m=L*F+v*P,F=P*F+m%q*q+j[A]+b,b=(F/z|0)+(m/q|0)+L*v,j[A--]=F%z;j[A]=b}return b?++w:j.splice(0,1),U(c,j,w)},o.negated=function(){var c=new x(this);return c.s=-c.s||null,c},o.plus=function(c,f){var b,w=this,R=w.s;if(c=new x(c,f),f=c.s,!R||!f)return new x(NaN);if(R!=f)return c.s=-f,w.minus(c);var A=w.e/re,k=c.e/re,m=w.c,S=c.c;if(!A||!k){if(!m||!S)return new x(R/0);if(!m[0]||!S[0])return S[0]?c:new x(m[0]?w:R*0)}if(A=Be(A),k=Be(k),m=m.slice(),R=A-k){for(R>0?(k=A,b=S):(R=-R,b=m),b.reverse();R--;b.push(0));b.reverse()}for(R=m.length,f=S.length,R-f<0&&(b=S,S=m,m=b,f=R),R=0;f;)R=(m[--f]=m[f]+S[f]+R)/ze|0,m[f]=ze===m[f]?0:m[f]%ze;return R&&(m=[R].concat(m),++k),U(c,m,k)},o.precision=o.sd=function(c,f){var b,w,R,A=this;if(c!=null&&c!==!!c)return fe(c,1,Me),f==null?f=a:fe(f,0,8),H(new x(A),c,f);if(!(b=A.c))return null;if(R=b.length-1,w=R*re+1,R=b[R]){for(;R%10==0;R/=10,w--);for(R=b[0];R>=10;R/=10,w++);}return c&&A.e+1>w&&(w=A.e+1),w},o.shiftedBy=function(c){return fe(c,-9007199254740991,Gs),this.times("1e"+c)},o.squareRoot=o.sqrt=function(){var c,f,b,w,R,A=this,k=A.c,m=A.s,S=A.e,F=i+4,v=new x("0.5");if(m!==1||!k||!k[0])return new x(!m||m<0&&(!k||k[0])?NaN:k?A:1/0);if(m=Math.sqrt(+W(A)),m==0||m==1/0?(f=$e(k),(f.length+S)%2==0&&(f+="0"),m=Math.sqrt(+f),S=Be((S+1)/2)-(S<0||S%2),m==1/0?f="5e"+S:(f=m.toExponential(),f=f.slice(0,f.indexOf("e")+1)+S),b=new x(f)):b=new x(m+""),b.c[0]){for(S=b.e,m=S+F,m<3&&(m=0);;)if(R=b,b=v.times(R.plus(t(A,R,F,1))),$e(R.c).slice(0,m)===(f=$e(b.c)).slice(0,m))if(b.e<S&&--m,f=f.slice(m-3,m+1),f=="9999"||!w&&f=="4999"){if(!w&&(H(R,R.e+i+2,0),R.times(R).eq(A))){b=R;break}F+=4,m+=4,w=1}else{(!+f||!+f.slice(1)&&f.charAt(0)=="5")&&(H(b,b.e+i+2,1),c=!b.times(b).eq(A));break}}return H(b,b.e+i+1,a,c)},o.toExponential=function(c,f){return c!=null&&(fe(c,0,Me),c++),I(this,c,f,1)},o.toFixed=function(c,f){return c!=null&&(fe(c,0,Me),c=c+this.e+1),I(this,c,f)},o.toFormat=function(c,f,b){var w,R=this;if(b==null)c!=null&&f&&typeof f=="object"?(b=f,f=null):c&&typeof c=="object"?(b=c,c=f=null):b=y;else if(typeof b!="object")throw Error(Te+"Argument not an object: "+b);if(w=R.toFixed(c,f),R.c){var A,k=w.split("."),m=+b.groupSize,S=+b.secondaryGroupSize,F=b.groupSeparator||"",v=k[0],M=k[1],P=R.s<0,L=P?v.slice(1):v,j=L.length;if(S&&(A=m,m=S,S=A,j-=A),m>0&&j>0){for(A=j%m||m,v=L.substr(0,A);A<j;A+=m)v+=F+L.substr(A,m);S>0&&(v+=F+L.slice(A)),P&&(v="-"+v)}w=M?v+(b.decimalSeparator||"")+((S=+b.fractionGroupSize)?M.replace(new RegExp("\\d{"+S+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):M):v}return(b.prefix||"")+w+(b.suffix||"")},o.toFraction=function(c){var f,b,w,R,A,k,m,S,F,v,M,P,L=this,j=L.c;if(c!=null&&(m=new x(c),!m.isInteger()&&(m.c||m.s!==1)||m.lt(s)))throw Error(Te+"Argument "+(m.isInteger()?"out of range: ":"not an integer: ")+W(m));if(!j)return new x(L);for(f=new x(s),F=b=new x(s),w=S=new x(s),P=$e(j),A=f.e=P.length-L.e-1,f.c[0]=Yr[(k=A%re)<0?re+k:k],c=!c||m.comparedTo(f)>0?A>0?f:F:m,k=h,h=1/0,m=new x(P),S.c[0]=0;v=t(m,f,0,1),R=b.plus(v.times(w)),R.comparedTo(c)!=1;)b=w,w=R,F=S.plus(v.times(R=F)),S=R,f=m.minus(v.times(R=f)),m=R;return R=t(c.minus(b),w,0,1),S=S.plus(R.times(F)),b=b.plus(R.times(w)),S.s=F.s=L.s,A=A*2,M=t(F,w,A,a).minus(L).abs().comparedTo(t(S,b,A,a).minus(L).abs())<1?[F,w]:[S,b],h=k,M},o.toNumber=function(){return+W(this)},o.toPrecision=function(c,f){return c!=null&&fe(c,1,Me),I(this,c,f,2)},o.toString=function(c){var f,b=this,w=b.s,R=b.e;return R===null?w?(f="Infinity",w<0&&(f="-"+f)):f="NaN":(c==null?f=R<=l||R>=u?ur($e(b.c),R):at($e(b.c),R,"0"):c===10&&N?(b=H(new x(b),i+R+1,a),f=at($e(b.c),b.e,"0")):(fe(c,2,O.length,"Base"),f=n(at($e(b.c),R,"0"),10,c,w,!0)),w<0&&b.c[0]&&(f="-"+f)),f},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&x.set(e),x}function Be(e){var t=e|0;return e>0||e===t?t:t-1}function $e(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=re-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Ft(e,t){var n,r,o=e.c,s=t.c,i=e.s,a=t.s,l=e.e,u=t.e;if(!i||!a)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-a:i;if(i!=a)return i;if(n=i<0,r=l==u,!o||!s)return r?0:!o^n?1:-1;if(!r)return l>u^n?1:-1;for(a=(l=o.length)<(u=s.length)?l:u,i=0;i<a;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return l==u?0:l>u^n?1:-1}function fe(e,t,n,r){if(e<t||e>n||e!==je(e))throw Error(Te+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cr(e){var t=e.c.length-1;return Be(e.e/re)==t&&e.c[t]%2!=0}function ur(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function at(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}ka();const Xu=100000n,Ju=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,a=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),l=r==="auto"?a>=Xu:r,u=typeof i=="bigint"?Number(i):i,d=s&&u!==0&&Math.abs(u)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:d?20:o??2,minimumFractionDigits:d?0:o??2});if(!l)return d?h.format(Vs(u)):h.format(i);const E=[{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(p=>a>=p.threshold);if(E){const p=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),g=Number(i)/E.divisor;return p.format(g)+E.suffix}return d?h.format(Vs(u)):h.format(i)};function Vs(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}function Fn(e,t=5,n=5){return e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:""}var Kn=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=typeof window>"u"||"Deno"in globalThis;function Ue(){}function Zu(e,t){return typeof e=="function"?e(t):e}function go(e){return typeof e=="number"&&e>=0&&e!==1/0}function Aa(e,t){return Math.max(e+(t||0)-Date.now(),0)}function nn(e,t){return typeof e=="function"?e(t):e}function _e(e,t){return typeof e=="function"?e(t):e}function _s(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Qo(i,t.options))return!1}else if(!Hn(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Qs(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Bn(t.options.mutationKey)!==Bn(s))return!1}else if(!Hn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Qo(e,t){return((t==null?void 0:t.queryKeyHashFn)||Bn)(e)}function Bn(e){return JSON.stringify(e,(t,n)=>yo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Hn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Hn(e[n],t[n])):!1}function bo(e,t){if(e===t)return e;const n=Ks(e)&&Ks(t);if(n||yo(e)&&yo(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const d=n?u:s[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=bo(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function vo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ks(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yo(e){if(!Ys(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ys(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ys(e){return Object.prototype.toString.call(e)==="[object Object]"}function ef(e){return new Promise(t=>{setTimeout(t,e)})}function wo(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return bo(e,t)}return t}function tf(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nf(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xr=Symbol();function Oa(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===xr&&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===xr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $t,vt,rn,wi,rf=(wi=class extends Kn{constructor(){super();te(this,$t);te(this,vt);te(this,rn);Q(this,rn,t=>{if(!Kt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,vt)||this.setEventListener(T(this,rn))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,vt))==null||t.call(this),Q(this,vt,void 0))}setEventListener(t){var n;Q(this,rn,t),(n=T(this,vt))==null||n.call(this),Q(this,vt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,$t)!==t&&(Q(this,$t,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,$t)=="boolean"?T(this,$t):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$t=new WeakMap,vt=new WeakMap,rn=new WeakMap,wi),Ko=new rf,on,yt,sn,xi,of=(xi=class extends Kn{constructor(){super();te(this,on,!0);te(this,yt);te(this,sn);Q(this,sn,t=>{if(!Kt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,yt)||this.setEventListener(T(this,sn))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,yt))==null||t.call(this),Q(this,yt,void 0))}setEventListener(t){var n;Q(this,sn,t),(n=T(this,yt))==null||n.call(this),Q(this,yt,t(this.setOnline.bind(this)))}setOnline(t){T(this,on)!==t&&(Q(this,on,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,on)}},on=new WeakMap,yt=new WeakMap,sn=new WeakMap,xi),Er=new of;function xo(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function sf(e){return Math.min(1e3*2**e,3e4)}function Ta(e){return(e??"online")==="online"?Er.isOnline():!0}var Fa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Xr(e){return e instanceof Fa}function Pa(e){let t=!1,n=0,r=!1,o;const s=xo(),i=y=>{var O;r||(E(new Fa(y)),(O=e.abort)==null||O.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Ko.isFocused()&&(e.networkMode==="always"||Er.isOnline())&&e.canRun(),d=()=>Ta(e.networkMode)&&e.canRun(),h=y=>{var O;r||(r=!0,(O=e.onSuccess)==null||O.call(e,y),o==null||o(),s.resolve(y))},E=y=>{var O;r||(r=!0,(O=e.onError)==null||O.call(e,y),o==null||o(),s.reject(y))},p=()=>new Promise(y=>{var O;o=N=>{(r||u())&&y(N)},(O=e.onPause)==null||O.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),g=()=>{if(r)return;let y;const O=n===0?e.initialPromise:void 0;try{y=O??e.fn()}catch(N){y=Promise.reject(N)}Promise.resolve(y).then(h).catch(N=>{var H;if(r)return;const x=e.retry??(Kt?0:3),I=e.retryDelay??sf,B=typeof I=="function"?I(n,N):I,U=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,N);if(t||!U){E(N);return}n++,(H=e.onFail)==null||H.call(e,n,N),ef(B).then(()=>u()?void 0:p()).then(()=>{t?E(N):g()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}var af=e=>setTimeout(e,0);function lf(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=af;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var xe=lf(),jt,Ei,Ma=(Ei=class{constructor(){te(this,jt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),go(this.gcTime)&&Q(this,jt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kt?1/0:5*60*1e3))}clearGcTimeout(){T(this,jt)&&(clearTimeout(T(this,jt)),Q(this,jt,void 0))}},jt=new WeakMap,Ei),an,ln,He,Bt,Re,qn,Ht,Ge,lt,Ri,cf=(Ri=class extends Ma{constructor(t){super();te(this,Ge);te(this,an);te(this,ln);te(this,He);te(this,Bt);te(this,Re);te(this,qn);te(this,Ht);Q(this,Ht,!1),Q(this,qn,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,Bt,t.client),Q(this,He,T(this,Bt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,an,uf(this.options)),this.state=t.state??T(this,an),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,Re))==null?void 0:t.promise}setOptions(t){this.options={...T(this,qn),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,He).remove(this)}setData(t,n){const r=wo(this.state.data,t,this.options);return se(this,Ge,lt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,Ge,lt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=T(this,Re))==null?void 0:r.promise;return(o=T(this,Re))==null||o.cancel(t),n?n.then(Ue).catch(Ue):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,an))}isActive(){return this.observers.some(t=>_e(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Aa(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Re))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Re))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,He).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,Re)&&(T(this,Ht)?T(this,Re).cancel({revert:!0}):T(this,Re).cancelRetry()),this.scheduleGc()),T(this,He).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,Ge,lt).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,Re))return T(this,Re).continueRetry(),T(this,Re).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(E=>E.options.queryFn);h&&this.setOptions(h.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Q(this,Ht,!0),r.signal)})},s=()=>{const h=Oa(this.options,n),E={client:T(this,Bt),queryKey:this.queryKey,meta:this.meta};return o(E),Q(this,Ht,!1),this.options.persister?this.options.persister(h,E,this):h(E)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:T(this,Bt),state:this.state,fetchFn:s};o(i),(l=this.options.behavior)==null||l.onFetch(i,this),Q(this,ln,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&se(this,Ge,lt).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta});const a=h=>{var E,p,g,y;Xr(h)&&h.silent||se(this,Ge,lt).call(this,{type:"error",error:h}),Xr(h)||((p=(E=T(this,He).config).onError)==null||p.call(E,h,this),(y=(g=T(this,He).config).onSettled)==null||y.call(g,this.state.data,h,this)),this.scheduleGc()};return Q(this,Re,Pa({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var E,p,g,y;if(h===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(O){a(O);return}(p=(E=T(this,He).config).onSuccess)==null||p.call(E,h,this),(y=(g=T(this,He).config).onSettled)==null||y.call(g,h,this.state.error,this),this.scheduleGc()},onError:a,onFail:(h,E)=>{se(this,Ge,lt).call(this,{type:"failed",failureCount:h,error:E})},onPause:()=>{se(this,Ge,lt).call(this,{type:"pause"})},onContinue:()=>{se(this,Ge,lt).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),T(this,Re).start()}},an=new WeakMap,ln=new WeakMap,He=new WeakMap,Bt=new WeakMap,Re=new WeakMap,qn=new WeakMap,Ht=new WeakMap,Ge=new WeakSet,lt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ia(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Xr(o)&&o.revert&&T(this,ln)?{...T(this,ln),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),xe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,He).notify({query:this,type:"updated",action:t})})},Ri);function Ia(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ta(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uf(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Xe,Si,ff=(Si=class extends Kn{constructor(t={}){super();te(this,Xe);this.config=t,Q(this,Xe,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Qo(o,n);let i=this.get(s);return i||(i=new cf({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){T(this,Xe).has(t.queryHash)||(T(this,Xe).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,Xe).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,Xe).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){xe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,Xe).get(t)}getAll(){return[...T(this,Xe).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_s(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>_s(t,r)):n}notify(t){xe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){xe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){xe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xe=new WeakMap,Si),Je,ke,Ut,Ze,bt,Ci,df=(Ci=class extends Ma{constructor(t){super();te(this,Ze);te(this,Je);te(this,ke);te(this,Ut);this.mutationId=t.mutationId,Q(this,ke,t.mutationCache),Q(this,Je,[]),this.state=t.state||hf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Je).includes(t)||(T(this,Je).push(t),this.clearGcTimeout(),T(this,ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Je,T(this,Je).filter(n=>n!==t)),this.scheduleGc(),T(this,ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Je).length||(this.state.status==="pending"?this.scheduleGc():T(this,ke).remove(this))}continue(){var t;return((t=T(this,Ut))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,l,u,d,h,E,p,g,y,O,N,x,I,B,U,H,W;Q(this,Ut,Pa({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(c,f)=>{se(this,Ze,bt).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{se(this,Ze,bt).call(this,{type:"pause"})},onContinue:()=>{se(this,Ze,bt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,ke).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Ut).canStart();try{if(!n){se(this,Ze,bt).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=T(this,ke).config).onMutate)==null?void 0:s.call(o,t,this));const f=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));f!==this.state.context&&se(this,Ze,bt).call(this,{type:"pending",context:f,variables:t,isPaused:r})}const c=await T(this,Ut).start();return await((u=(l=T(this,ke).config).onSuccess)==null?void 0:u.call(l,c,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,c,t,this.state.context)),await((p=(E=T(this,ke).config).onSettled)==null?void 0:p.call(E,c,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,c,null,t,this.state.context)),se(this,Ze,bt).call(this,{type:"success",data:c}),c}catch(c){try{throw await((N=(O=T(this,ke).config).onError)==null?void 0:N.call(O,c,t,this.state.context,this)),await((I=(x=this.options).onError)==null?void 0:I.call(x,c,t,this.state.context)),await((U=(B=T(this,ke).config).onSettled)==null?void 0:U.call(B,void 0,c,this.state.variables,this.state.context,this)),await((W=(H=this.options).onSettled)==null?void 0:W.call(H,void 0,c,t,this.state.context)),c}finally{se(this,Ze,bt).call(this,{type:"error",error:c})}}finally{T(this,ke).runNext(this)}}},Je=new WeakMap,ke=new WeakMap,Ut=new WeakMap,Ze=new WeakSet,bt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),xe.batch(()=>{T(this,Je).forEach(r=>{r.onMutationUpdate(t)}),T(this,ke).notify({mutation:this,type:"updated",action:t})})},Ci);function hf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ct,Ve,zn,ki,pf=(ki=class extends Kn{constructor(t={}){super();te(this,ct);te(this,Ve);te(this,zn);this.config=t,Q(this,ct,new Set),Q(this,Ve,new Map),Q(this,zn,0)}build(t,n,r){const o=new df({mutationCache:this,mutationId:++tr(this,zn)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){T(this,ct).add(t);const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n);r?r.push(t):T(this,Ve).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,ct).delete(t)){const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&T(this,Ve).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=fr(t);if(typeof n=="string"){const o=(r=T(this,Ve).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){xe.batch(()=>{T(this,ct).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,ct).clear(),T(this,Ve).clear()})}getAll(){return Array.from(T(this,ct))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qs(n,r))}findAll(t={}){return this.getAll().filter(n=>Qs(t,n))}notify(t){xe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return xe.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ue))))}},ct=new WeakMap,Ve=new WeakMap,zn=new WeakMap,ki);function fr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Xs(e){return{onFetch:(t,n)=>{var d,h,E,p,g;const r=t.options,o=(E=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:E.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const O=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},N=Oa(t.options,t.fetchOptions),x=async(I,B,U)=>{if(y)return Promise.reject();if(B==null&&I.pages.length)return Promise.resolve(I);const H={client:t.client,queryKey:t.queryKey,pageParam:B,direction:U?"backward":"forward",meta:t.options.meta};O(H);const W=await N(H),{maxPages:c}=t.options,f=U?nf:tf;return{pages:f(I.pages,W,c),pageParams:f(I.pageParams,B,c)}};if(o&&s.length){const I=o==="backward",B=I?mf:Js,U={pages:s,pageParams:i},H=B(r,U);a=await x(U,H,I)}else{const I=e??s.length;do{const B=l===0?i[0]??r.initialPageParam:Js(r,a);if(l>0&&B==null)break;a=await x(a,B),l++}while(l<I)}return a};t.options.persister?t.fetchFn=()=>{var y,O;return(O=(y=t.options).persister)==null?void 0:O.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Js(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mf(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var he,wt,xt,cn,un,Et,fn,dn,Ai,gf=(Ai=class{constructor(e={}){te(this,he);te(this,wt);te(this,xt);te(this,cn);te(this,un);te(this,Et);te(this,fn);te(this,dn);Q(this,he,e.queryCache||new ff),Q(this,wt,e.mutationCache||new pf),Q(this,xt,e.defaultOptions||{}),Q(this,cn,new Map),Q(this,un,new Map),Q(this,Et,0)}mount(){tr(this,Et)._++,T(this,Et)===1&&(Q(this,fn,Ko.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,he).onFocus())})),Q(this,dn,Er.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,he).onOnline())})))}unmount(){var e,t;tr(this,Et)._--,T(this,Et)===0&&((e=T(this,fn))==null||e.call(this),Q(this,fn,void 0),(t=T(this,dn))==null||t.call(this),Q(this,dn,void 0))}isFetching(e){return T(this,he).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,wt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,he).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=T(this,he).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return T(this,he).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=T(this,he).get(r.queryHash),s=o==null?void 0:o.state.data,i=Zu(t,s);if(i!==void 0)return T(this,he).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return xe.batch(()=>T(this,he).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,he).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,he);xe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,he);return xe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=xe.batch(()=>T(this,he).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ue).catch(Ue)}invalidateQueries(e,t={}){return xe.batch(()=>(T(this,he).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=xe.batch(()=>T(this,he).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ue)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ue)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,he).build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ue).catch(Ue)}fetchInfiniteQuery(e){return e.behavior=Xs(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ue).catch(Ue)}ensureInfiniteQueryData(e){return e.behavior=Xs(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Er.isOnline()?T(this,wt).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,he)}getMutationCache(){return T(this,wt)}getDefaultOptions(){return T(this,xt)}setDefaultOptions(e){Q(this,xt,e)}setQueryDefaults(e,t){T(this,cn).set(Bn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,cn).values()],n={};return t.forEach(r=>{Hn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,un).set(Bn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,un).values()],n={};return t.forEach(r=>{Hn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,xt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qo(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===xr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,xt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,he).clear(),T(this,wt).clear()}},he=new WeakMap,wt=new WeakMap,xt=new WeakMap,cn=new WeakMap,un=new WeakMap,Et=new WeakMap,fn=new WeakMap,dn=new WeakMap,Ai),Fe,ie,Gn,Ae,Wt,hn,Rt,et,Vn,pn,mn,qt,zt,St,gn,ce,Pn,Eo,Ro,So,Co,ko,Ao,Oo,Da,Oi,bf=(Oi=class extends Kn{constructor(t,n){super();te(this,ce);te(this,Fe);te(this,ie);te(this,Gn);te(this,Ae);te(this,Wt);te(this,hn);te(this,Rt);te(this,et);te(this,Vn);te(this,pn);te(this,mn);te(this,qt);te(this,zt);te(this,St);te(this,gn,new Set);this.options=n,Q(this,Fe,t),Q(this,et,null),Q(this,Rt,xo()),this.options.experimental_prefetchInRender||T(this,Rt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,ie).addObserver(this),Zs(T(this,ie),this.options)?se(this,ce,Pn).call(this):this.updateResult(),se(this,ce,Co).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return To(T(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return To(T(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,ce,ko).call(this),se(this,ce,Ao).call(this),T(this,ie).removeObserver(this)}setOptions(t){const n=this.options,r=T(this,ie);if(this.options=T(this,Fe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _e(this.options.enabled,T(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,ce,Oo).call(this),T(this,ie).setOptions(this.options),n._defaulted&&!vo(this.options,n)&&T(this,Fe).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,ie),observer:this});const o=this.hasListeners();o&&ei(T(this,ie),r,this.options,n)&&se(this,ce,Pn).call(this),this.updateResult(),o&&(T(this,ie)!==r||_e(this.options.enabled,T(this,ie))!==_e(n.enabled,T(this,ie))||nn(this.options.staleTime,T(this,ie))!==nn(n.staleTime,T(this,ie)))&&se(this,ce,Eo).call(this);const s=se(this,ce,Ro).call(this);o&&(T(this,ie)!==r||_e(this.options.enabled,T(this,ie))!==_e(n.enabled,T(this,ie))||s!==T(this,St))&&se(this,ce,So).call(this,s)}getOptimisticResult(t){const n=T(this,Fe).getQueryCache().build(T(this,Fe),t),r=this.createResult(n,t);return yf(this,r)&&(Q(this,Ae,r),Q(this,hn,this.options),Q(this,Wt,T(this,ie).state)),r}getCurrentResult(){return T(this,Ae)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){T(this,gn).add(t)}getCurrentQuery(){return T(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,Fe).defaultQueryOptions(t),r=T(this,Fe).getQueryCache().build(T(this,Fe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,ce,Pn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ae)))}createResult(t,n){var c;const r=T(this,ie),o=this.options,s=T(this,Ae),i=T(this,Wt),a=T(this,hn),u=t!==r?t.state:T(this,Gn),{state:d}=t;let h={...d},E=!1,p;if(n._optimisticResults){const f=this.hasListeners(),b=!f&&Zs(t,n),w=f&&ei(t,r,n,o);(b||w)&&(h={...h,...Ia(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:O}=h;if(n.select&&h.data!==void 0)if(s&&h.data===(i==null?void 0:i.data)&&n.select===T(this,Vn))p=T(this,pn);else try{Q(this,Vn,n.select),p=n.select(h.data),p=wo(s==null?void 0:s.data,p,n),Q(this,pn,p),Q(this,et,null)}catch(f){Q(this,et,f)}else p=h.data;if(n.placeholderData!==void 0&&p===void 0&&O==="pending"){let f;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))f=s.data;else if(f=typeof n.placeholderData=="function"?n.placeholderData((c=T(this,mn))==null?void 0:c.state.data,T(this,mn)):n.placeholderData,n.select&&f!==void 0)try{f=n.select(f),Q(this,et,null)}catch(b){Q(this,et,b)}f!==void 0&&(O="success",p=wo(s==null?void 0:s.data,f,n),E=!0)}T(this,et)&&(g=T(this,et),p=T(this,pn),y=Date.now(),O="error");const N=h.fetchStatus==="fetching",x=O==="pending",I=O==="error",B=x&&N,U=p!==void 0,W={status:O,fetchStatus:h.fetchStatus,isPending:x,isSuccess:O==="success",isError:I,isInitialLoading:B,isLoading:B,data:p,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:N,isRefetching:N&&!x,isLoadingError:I&&!U,isPaused:h.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:I&&U,isStale:Yo(t,n),refetch:this.refetch,promise:T(this,Rt)};if(this.options.experimental_prefetchInRender){const f=R=>{W.status==="error"?R.reject(W.error):W.data!==void 0&&R.resolve(W.data)},b=()=>{const R=Q(this,Rt,W.promise=xo());f(R)},w=T(this,Rt);switch(w.status){case"pending":t.queryHash===r.queryHash&&f(w);break;case"fulfilled":(W.status==="error"||W.data!==w.value)&&b();break;case"rejected":(W.status!=="error"||W.error!==w.reason)&&b();break}}return W}updateResult(){const t=T(this,Ae),n=this.createResult(T(this,ie),this.options);if(Q(this,Wt,T(this,ie).state),Q(this,hn,this.options),T(this,Wt).data!==void 0&&Q(this,mn,T(this,ie)),vo(n,t))return;Q(this,Ae,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!T(this,gn).size)return!0;const i=new Set(s??T(this,gn));return this.options.throwOnError&&i.add("error"),Object.keys(T(this,Ae)).some(a=>{const l=a;return T(this,Ae)[l]!==t[l]&&i.has(l)})};se(this,ce,Da).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,ce,Co).call(this)}},Fe=new WeakMap,ie=new WeakMap,Gn=new WeakMap,Ae=new WeakMap,Wt=new WeakMap,hn=new WeakMap,Rt=new WeakMap,et=new WeakMap,Vn=new WeakMap,pn=new WeakMap,mn=new WeakMap,qt=new WeakMap,zt=new WeakMap,St=new WeakMap,gn=new WeakMap,ce=new WeakSet,Pn=function(t){se(this,ce,Oo).call(this);let n=T(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ue)),n},Eo=function(){se(this,ce,ko).call(this);const t=nn(this.options.staleTime,T(this,ie));if(Kt||T(this,Ae).isStale||!go(t))return;const r=Aa(T(this,Ae).dataUpdatedAt,t)+1;Q(this,qt,setTimeout(()=>{T(this,Ae).isStale||this.updateResult()},r))},Ro=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,ie)):this.options.refetchInterval)??!1},So=function(t){se(this,ce,Ao).call(this),Q(this,St,t),!(Kt||_e(this.options.enabled,T(this,ie))===!1||!go(T(this,St))||T(this,St)===0)&&Q(this,zt,setInterval(()=>{(this.options.refetchIntervalInBackground||Ko.isFocused())&&se(this,ce,Pn).call(this)},T(this,St)))},Co=function(){se(this,ce,Eo).call(this),se(this,ce,So).call(this,se(this,ce,Ro).call(this))},ko=function(){T(this,qt)&&(clearTimeout(T(this,qt)),Q(this,qt,void 0))},Ao=function(){T(this,zt)&&(clearInterval(T(this,zt)),Q(this,zt,void 0))},Oo=function(){const t=T(this,Fe).getQueryCache().build(T(this,Fe),this.options);if(t===T(this,ie))return;const n=T(this,ie);Q(this,ie,t),Q(this,Gn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Da=function(t){xe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Ae))}),T(this,Fe).getQueryCache().notify({query:T(this,ie),type:"observerResultsUpdated"})})},Oi);function vf(e,t){return _e(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zs(e,t){return vf(e,t)||e.state.data!==void 0&&To(e,t,t.refetchOnMount)}function To(e,t,n){if(_e(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yo(e,t)}return!1}function ei(e,t,n,r){return(e!==t||_e(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yo(e,n)}function Yo(e,t){return _e(t.enabled,e)!==!1&&e.isStaleByTime(nn(t.staleTime,e))}function yf(e,t){return!vo(e.getCurrentResult(),t)}var Na=D.createContext(void 0),La=e=>{const t=D.useContext(Na);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$a=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),$.jsx(Na.Provider,{value:e,children:t})),wf=D.createContext(!1),xf=()=>D.useContext(wf);function Ef(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rf=D.createContext(Ef()),Sf=()=>D.useContext(Rf);function Cf(e,t){return typeof e=="function"?e(...t):!!e}function ti(){}var kf=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Af=e=>{D.useEffect(()=>{e.clearReset()},[e])},Of=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Cf(n,[e.error,r])),Tf=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Ff=(e,t)=>e.isLoading&&e.isFetching&&!t,Pf=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ni=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Mf(e,t,n){var h,E,p,g,y;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=La(),o=xf(),s=Sf(),i=r.defaultQueryOptions(e);(E=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||E.call(h,i),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=o?"isRestoring":"optimistic",Tf(i),kf(i,s),Af(s);const a=!r.getQueryCache().get(i.queryHash),[l]=D.useState(()=>new t(r,i)),u=l.getOptimisticResult(i),d=!o&&e.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(O=>{const N=d?l.subscribe(xe.batchCalls(O)):ti;return l.updateResult(),N},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),D.useEffect(()=>{l.setOptions(i)},[i,l]),Pf(i,u))throw ni(i,l,s);if(Of({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((g=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,i,u),i.experimental_prefetchInRender&&!Kt&&Ff(u,o)){const O=a?ni(i,l,s):(y=r.getQueryCache().get(i.queryHash))==null?void 0:y.promise;O==null||O.catch(ti).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?u:l.trackResult(u)}function Xo(e,t){return Mf(e,bf)}function Jo(e={}){const{activeAddress:t}=dt.useWallet(),{activeNetwork:n}=dt.useNetwork(),{enabled:r=!0,view:o="thumbnail"}=e;return Xo({queryKey:["nfd",t,n,o],queryFn:async({signal:s})=>{if(!t)return null;const l=await fetch(`${n==="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(l.status===404)return null;if(!l.ok)throw new Error(`NFD lookup failed: ${l.statusText}`);return(await l.json())[t]},enabled:r&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const If="https://ipfs.algonode.dev",Df=async e=>{if(!e.startsWith("ipfs://"))return e;const t=e.replace("ipfs://",""),n=`https://images.nf.domains/ipfs/${t}`;try{if((await fetch(n,{method:"HEAD"})).ok)return n}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}return`${If}/ipfs/${t}`};function Zo({nfd:e,alt:t,className:n,size:r=40,fallback:o,lightOnly:s=!1}){var d,h,E,p;const i=((h=(d=e==null?void 0:e.properties)==null?void 0:d.userDefined)==null?void 0:h.avatar)||((p=(E=e==null?void 0:e.properties)==null?void 0:E.verified)==null?void 0:p.avatar)||null,a=t||(e==null?void 0:e.name)||"NFD Avatar",{data:l,isLoading:u}=Xo({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await Df(i):i:null,enabled:!!i,staleTime:60*60*1e3,gcTime:24*60*60*1e3});return u||!l?o?$.jsx($.Fragment,{children:o}):$.jsx("div",{className:en("flex items-center justify-center rounded-full",s?"bg-gray-200 dark:bg-gray-200":"bg-gray-200 dark:bg-[#192A39]",n),style:{width:`${r}px`,height:`${r}px`},"aria-label":a,role:"img","data-wallet-ui":!0,children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:en("text-gray-400",!s&&"dark:text-gray-500"),style:{width:`${Math.max(r/2,12)}px`,height:`${Math.max(r/2,12)}px`},children:$.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"})})}):$.jsx("img",{src:l,alt:a,className:en("rounded-full",n),style:{width:`${r}px`,height:`${r}px`,objectFit:"cover"},loading:"lazy"})}const Ir=C.forwardRef(({className:e="",children:t,style:n,...r},o)=>{var u;const{activeAddress:s}=dt.useWallet(),i=Jo({enabled:!!s}),a=((u=i.data)==null?void 0:u.name)??null;return $.jsx("button",{ref:o,className:en("flex items-center",e),style:n,disabled:!1,...r,type:"button","data-wallet-ui":!0,children:t||$.jsx("div",{className:"flex items-center",children:$.jsxs("div",{className:"flex items-center py-2.5 pl-3 md:pl-3.5 pr-3 bg-[#2D2DF1] dark:bg-[#BFBFF9] text-white dark:text-[#001324] rounded-xl font-bold",children:[s&&$.jsx("div",{className:"mr-1 md:mr-2 h-6 w-6 overflow-hidden",children:$.jsx(Zo,{nfd:i.data,alt:`${a||s} avatar`,size:24,lightOnly:!0})}),$.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:a||(s?Fn(s,6,4):"Connect")}),s&&$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:$.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})})});Ir.displayName="ConnectedWalletButton";const ja=typeof document<"u"?C.useLayoutEffect:()=>{};function Nf(e){const t=C.useRef(null);return ja(()=>{t.current=e},[e]),C.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ot=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Nt=e=>e&&"window"in e&&e.window===e?e:Ot(e).defaultView||window;function Lf(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function $f(e){return Lf(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let jf=!1;function es(){return jf}function Ba(e,t){if(!es())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:$f(n)?n=n.host:n=n.parentNode}return!1}const Fo=(e=document)=>{var t;if(!es())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Ha(e){return es()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Bf(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Hf(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 Ua(e){let t=null;return()=>(t==null&&(t=e()),t)}const Uf=Ua(function(){return Hf(/^Mac/i)}),Wf=Ua(function(){return Bf(/Android/i)});function Wa(){let e=C.useRef(new Map),t=C.useCallback((o,s,i,a)=>{let l=a!=null&&a.once?(...u)=>{e.current.delete(i),i(...u)}:i;e.current.set(i,{type:s,eventTarget:o,fn:l,options:a}),o.addEventListener(s,l,a)},[]),n=C.useCallback((o,s,i,a)=>{var l;let u=((l=e.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(s,u,a),e.current.delete(i)},[]),r=C.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return C.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function qf(e){return e.mozInputSource===0&&e.isTrusted?!0:Wf()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class qa{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function za(e){let t=C.useRef({isFocused:!1,observer:null});ja(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Nf(r=>{e==null||e(r)});return C.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{t.current.isFocused=!1,o.disabled&&n(new qa("blur",i)),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 a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let zf=!1,Yn=null,Po=new Set,Dn=new Map,Yt=!1,Mo=!1;const Gf={Tab:!0,Escape:!0};function ts(e,t){for(let n of Po)n(e,t)}function Vf(e){return!(e.metaKey||!Uf()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Rr(e){Yt=!0,Vf(e)&&(Yn="keyboard",ts("keyboard",e))}function We(e){Yn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Yt=!0,ts("pointer",e))}function Ga(e){qf(e)&&(Yt=!0,Yn="virtual")}function Va(e){e.target===window||e.target===document||zf||!e.isTrusted||(!Yt&&!Mo&&(Yn="virtual",ts("virtual",e)),Yt=!1,Mo=!1)}function _a(){Yt=!1,Mo=!0}function Io(e){if(typeof window>"u"||Dn.get(Nt(e)))return;const t=Nt(e),n=Ot(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Yt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Rr,!0),n.addEventListener("keyup",Rr,!0),n.addEventListener("click",Ga,!0),t.addEventListener("focus",Va,!0),t.addEventListener("blur",_a,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",We,!0),n.addEventListener("pointermove",We,!0),n.addEventListener("pointerup",We,!0)):(n.addEventListener("mousedown",We,!0),n.addEventListener("mousemove",We,!0),n.addEventListener("mouseup",We,!0)),t.addEventListener("beforeunload",()=>{Qa(e)},{once:!0}),Dn.set(t,{focus:r})}const Qa=(e,t)=>{const n=Nt(e),r=Ot(e);t&&r.removeEventListener("DOMContentLoaded",t),Dn.has(n)&&(n.HTMLElement.prototype.focus=Dn.get(n).focus,r.removeEventListener("keydown",Rr,!0),r.removeEventListener("keyup",Rr,!0),r.removeEventListener("click",Ga,!0),n.removeEventListener("focus",Va,!0),n.removeEventListener("blur",_a,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",We,!0),r.removeEventListener("pointermove",We,!0),r.removeEventListener("pointerup",We,!0)):(r.removeEventListener("mousedown",We,!0),r.removeEventListener("mousemove",We,!0),r.removeEventListener("mouseup",We,!0)),Dn.delete(n))};function _f(e){const t=Ot(e);let n;return t.readyState!=="loading"?Io(e):(n=()=>{Io(e)},t.addEventListener("DOMContentLoaded",n)),()=>Qa(e,n)}typeof document<"u"&&_f();function Ka(){return Yn!=="pointer"}const Qf=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Kf(e,t,n){let r=Ot(n==null?void 0:n.target);const o=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Nt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Qf.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!Gf[n.key])}function Yf(e,t,n){Io(),C.useEffect(()=>{let r=(o,s)=>{Kf(!!(n!=null&&n.isTextInput),o,s)&&e(Ka())};return Po.add(r),()=>{Po.delete(r)}},t)}function Xf(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=C.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),i=za(s),a=C.useCallback(l=>{const u=Ot(l.target),d=u?Fo(u):Fo();l.target===l.currentTarget&&d===Ha(l.nativeEvent)&&(n&&n(l),o&&o(!0),i(l))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?s:void 0}}}function Jf(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=C.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:a}=Wa(),l=C.useCallback(h=>{h.currentTarget.contains(h.target)&&s.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(s.current.isFocusWithin=!1,a(),n&&n(h),o&&o(!1))},[n,o,s,a]),u=za(l),d=C.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const E=Ot(h.target),p=Fo(E);if(!s.current.isFocusWithin&&p===Ha(h.nativeEvent)){r&&r(h),o&&o(!0),s.current.isFocusWithin=!0,u(h);let g=h.currentTarget;i(E,"focus",y=>{if(s.current.isFocusWithin&&!Ba(g,y.target)){let O=new qa("blur",new E.defaultView.FocusEvent("blur",{relatedTarget:y.target}));O.target=g,O.currentTarget=g,l(O)}},{capture:!0})}},[r,o,u,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:l}}}let Sr=!1,Jr=0;function Do(){Sr=!0,setTimeout(()=>{Sr=!1},50)}function ri(e){e.pointerType==="touch"&&Do()}function Zf(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",ri):document.addEventListener("touchend",Do),Jr++,()=>{Jr--,!(Jr>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ri):document.removeEventListener("touchend",Do))}}function ed(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=C.useState(!1),a=C.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;C.useEffect(Zf,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=Wa(),{hoverProps:d,triggerHoverEnd:h}=C.useMemo(()=>{let E=(y,O)=>{if(a.pointerType=O,o||O==="touch"||a.isHovered||!y.currentTarget.contains(y.target))return;a.isHovered=!0;let N=y.currentTarget;a.target=N,l(Ot(y.target),"pointerover",x=>{a.isHovered&&a.target&&!Ba(a.target,x.target)&&p(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:O}),n&&n(!0),i(!0)},p=(y,O)=>{let N=a.target;a.pointerType="",a.target=null,!(O==="touch"||!a.isHovered||!N)&&(a.isHovered=!1,u(),r&&r({type:"hoverend",target:N,pointerType:O}),n&&n(!1),i(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=y=>{Sr&&y.pointerType==="mouse"||E(y,y.pointerType)},g.onPointerLeave=y=>{!o&&y.currentTarget.contains(y.target)&&p(y,y.pointerType)}):(g.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=y=>{!a.ignoreEmulatedMouseEvents&&!Sr&&E(y,"mouse"),a.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=y=>{!o&&y.currentTarget.contains(y.target)&&p(y,"mouse")}),{hoverProps:g,triggerHoverEnd:p}},[t,n,r,o,a,l,u]);return C.useEffect(()=>{o&&h({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:d,isHovered:s}}function td(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=C.useRef({isFocused:!1,isFocusVisible:t||Ka()}),[s,i]=C.useState(!1),[a,l]=C.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=C.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=C.useCallback(p=>{o.current.isFocused=p,i(p),u()},[u]);Yf(p=>{o.current.isFocusVisible=p,u()},[],{isTextInput:n});let{focusProps:h}=Xf({isDisabled:r,onFocusChange:d}),{focusWithinProps:E}=Jf({isDisabled:!r,onFocusWithinChange:d});return{isFocused:s,isFocusVisible:a,focusProps:r?E:h}}var nd=Object.defineProperty,rd=(e,t,n)=>t in e?nd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zr=(e,t,n)=>(rd(e,typeof t!="symbol"?t+"":t,n),n);let od=class{constructor(){Zr(this,"current",this.detect()),Zr(this,"handoffState","pending"),Zr(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"}},Gt=new od;function Xn(e){var t,n;return Gt.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function Ya(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function pt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ya(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=pt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function En(){let[e]=C.useState(pt);return C.useEffect(()=>()=>e.dispose(),[e]),e}let we=(e,t)=>{Gt.isServer?C.useEffect(e,t):C.useLayoutEffect(e,t)};function Rn(e){let t=C.useRef(e);return we(()=>{t.current=e},[e]),t}let le=function(e){let t=Rn(e);return C.useCallback((...n)=>t.current(...n),[t])};function sd(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function id(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ad({disabled:e=!1}={}){let t=C.useRef(null),[n,r]=C.useState(!1),o=En(),s=le(()=>{t.current=null,r(!1),o.dispose()}),i=le(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Xn(a.currentTarget);o.addEventListener(l,"pointerup",s,!1),o.addEventListener(l,"pointermove",u=>{if(t.current){let d=sd(u);r(id(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}let ld=C.createContext(void 0);function ns(){return C.useContext(ld)}function oi(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ft(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=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(r,ft),r}var No=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(No||{}),cd=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(cd||{});function Qe(){let e=fd();return C.useCallback(t=>ud({mergeRefs:e,...t}),[e])}function ud({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:a}){a=a??dd;let l=Xa(t,e);if(s)return dr(l,n,r,i,a);let u=o??0;if(u&2){let{static:d=!1,...h}=l;if(d)return dr(h,n,r,i,a)}if(u&1){let{unmount:d=!0,...h}=l;return ft(d?0:1,{0(){return null},1(){return dr({...h,hidden:!0,style:{display:"none"}},n,r,i,a)}})}return dr(l,n,r,i,a)}function dr(e,t={},n,r,o){let{as:s=n,children:i,refName:a="ref",...l}=eo(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let E=!1,p=[];for(let[g,y]of Object.entries(t))typeof y=="boolean"&&(E=!0),y===!0&&p.push(g.replace(/([A-Z])/g,O=>`-${O.toLowerCase()}`));if(E){h["data-headlessui-state"]=p.join(" ");for(let g of p)h[`data-${g}`]=""}}if(s===C.Fragment&&(Object.keys(It(l)).length>0||Object.keys(It(h)).length>0))if(!C.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(It(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(It(l)).concat(Object.keys(It(h))).map(E=>` - ${E}`).join(`
|
|
37
|
+
*/var Pc=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],gr=Pc.join(","),Ki=typeof Element>"u",bn=Ki?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,br=!Ki&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},vr=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},Mc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ic=function(t,n,r){if(vr(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(gr));return n&&bn.call(t,gr)&&o.unshift(t),o=o.filter(r),o},Dc=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!vr(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,u=e(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var d=bn.call(i,gr);d&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),E=!vr(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&E){var p=e(h===!0?i.children:h.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Yi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Xi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Mc(t))&&!Yi(t)?0:t.tabIndex},Nc=function(t,n){var r=Xi(t);return r<0&&n&&!Yi(t)?0:r},Lc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ji=function(t){return t.tagName==="INPUT"},$c=function(t){return Ji(t)&&t.type==="hidden"},jc=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Bc=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Hc=function(t){if(!t.name)return!0;var n=t.form||br(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Bc(o,t.form);return!s||s===t},Uc=function(t){return Ji(t)&&t.type==="radio"},Wc=function(t){return Uc(t)&&!Hc(t)},qc=function(t){var n,r=t&&br(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var u,d,h;r=br(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((d=o)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return s},Rs=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},zc=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=bn.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(bn.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=br(t);if(l&&!l.shadowRoot&&o(l)===!0)return Rs(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(qc(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Rs(t);return!1},Gc=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return bn.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Vc=function(t,n){return!(n.disabled||vr(n)||$c(n)||zc(n,t)||jc(n)||Gc(n))},ho=function(t,n){return!(Wc(n)||Xi(n)<0||!Vc(t,n))},_c=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Qc=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=Nc(a,i),u=i?e(o.candidates):a;l===0?i?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:u})}),r.sort(Lc).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Tr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Dc([t],n.includeContainer,{filter:ho.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_c}):r=Ic(t,n.includeContainer,ho.bind(null,n)),Qc(r)},Kc=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return bn.call(t,gr)===!1?!1:ho(n,t)};function Ss(e,t,n){let{reference:r,floating:o}=e;const s=_t(t),i=Qi(t),a=_i(i),l=kt(t),u=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,E=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-o.width,y:h};break;default:p={x:r.x,y:r.y}}switch(Qn(t)){case"start":p[i]-=E*(n&&u?-1:1);break;case"end":p[i]+=E*(n&&u?-1:1);break}return p}const Yc=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Ss(u,r,l),E=r,p={},g=0;for(let y=0;y<a.length;y++){const{name:O,fn:N}=a[y],{x,y:I,data:B,reset:U}=await N({x:d,y:h,initialPlacement:r,placement:E,strategy:o,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});d=x??d,h=I??h,p={...p,[O]:{...p[O],...B}},U&&g<=50&&(g++,typeof U=="object"&&(U.placement&&(E=U.placement),U.rects&&(u=U.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):U.rects),{x:d,y:h}=Ss(u,E,l)),y=-1)}return{x:d,y:h,placement:E,strategy:o,middlewareData:p}};async function Fr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:E=!1,padding:p=0}=xn(t,e),g=Fc(p),O=a[E?h==="floating"?"reference":"floating":h],N=mr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(O)))==null||n?O:O.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),x=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,I=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),B=await(s.isElement==null?void 0:s.isElement(I))?await(s.getScale==null?void 0:s.getScale(I))||{x:1,y:1}:{x:1,y:1},U=mr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:I,strategy:l}):x);return{top:(N.top-U.top+g.top)/B.y,bottom:(U.bottom-N.bottom+g.bottom)/B.y,left:(N.left-U.left+g.left)/B.x,right:(U.right-N.right+g.right)/B.x}}const Xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:E,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...O}=xn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const N=kt(o),x=_t(a),I=kt(a)===a,B=await(l.isRTL==null?void 0:l.isRTL(u.floating)),U=E||(I||!y?[pr(a)]:kc(a)),H=g!=="none";!E&&H&&U.push(...Oc(a,y,g,B));const W=[a,...U],c=await Fr(t,O),f=[];let b=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&f.push(c[N]),h){const k=Cc(o,i,B);f.push(c[k[0]],c[k[1]])}if(b=[...b,{placement:o,overflows:f}],!f.every(k=>k<=0)){var w,R;const k=(((w=s.flip)==null?void 0:w.index)||0)+1,m=W[k];if(m)return{data:{index:k,overflows:b},reset:{placement:m}};let S=(R=b.filter(F=>F.overflows[0]<=0).sort((F,v)=>F.overflows[1]-v.overflows[1])[0])==null?void 0:R.placement;if(!S)switch(p){case"bestFit":{var A;const F=(A=b.filter(v=>{if(H){const M=_t(v.placement);return M===x||M==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(M=>M>0).reduce((M,P)=>M+P,0)]).sort((v,M)=>v[1]-M[1])[0])==null?void 0:A[0];F&&(S=F);break}case"initialPlacement":S=a;break}if(o!==S)return{reset:{placement:S}}}return{}}}};async function Jc(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=kt(n),a=Qn(n),l=_t(n)==="y",u=["left","top"].includes(i)?-1:1,d=s&&l?-1:1,h=xn(t,e);let{mainAxis:E,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:E*u}:{x:E*u,y:p*d}}const Zc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Jc(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},eu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:O=>{let{x:N,y:x}=O;return{x:N,y:x}}},...l}=xn(e,t),u={x:n,y:r},d=await Fr(t,l),h=_t(kt(o)),E=Vi(h);let p=u[E],g=u[h];if(s){const O=E==="y"?"top":"left",N=E==="y"?"bottom":"right",x=p+d[O],I=p-d[N];p=Es(x,p,I)}if(i){const O=h==="y"?"top":"left",N=h==="y"?"bottom":"right",x=g+d[O],I=g-d[N];g=Es(x,g,I)}const y=a.fn({...t,[E]:p,[h]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[E]:s,[h]:i}}}}}},tu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=xn(e,t),d=await Fr(t,u),h=kt(o),E=Qn(o),p=_t(o)==="y",{width:g,height:y}=s.floating;let O,N;h==="top"||h==="bottom"?(O=h,N=E===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(N=h,O=E==="end"?"top":"bottom");const x=y-d.top-d.bottom,I=g-d.left-d.right,B=Vt(y-d[O],x),U=Vt(g-d[N],I),H=!t.middlewareData.shift;let W=B,c=U;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(c=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=x),H&&!E){const b=Se(d.left,0),w=Se(d.right,0),R=Se(d.top,0),A=Se(d.bottom,0);p?c=g-2*(b!==0||w!==0?b+w:Se(d.left,d.right)):W=y-2*(R!==0||A!==0?R+A:Se(d.top,d.bottom))}await l({...t,availableWidth:c,availableHeight:W});const f=await i.getDimensions(a.floating);return g!==f.width||y!==f.height?{reset:{rects:!0}}:{}}}};function Zi(e){const t=qe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=$n(n)!==s||$n(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function zo(e){return ue(e)?e:e.contextElement}function tn(e){const t=zo(e);if(!be(t))return rt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Zi(t);let i=(s?$n(n.width):n.width)/r,a=(s?$n(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const nu=rt(0);function ea(e){const t=Le(e);return!Ar()||!t.visualViewport?nu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ru(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Le(e)?!1:t}function Qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=zo(e);let i=rt(1);t&&(r?ue(r)&&(i=tn(r)):i=tn(e));const a=ru(s,n,r)?ea(s):rt(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,h=o.height/i.y;if(s){const E=Le(s),p=r&&ue(r)?Le(r):r;let g=E,y=co(g);for(;y&&r&&p!==g;){const O=tn(y),N=y.getBoundingClientRect(),x=qe(y),I=N.left+(y.clientLeft+parseFloat(x.paddingLeft))*O.x,B=N.top+(y.clientTop+parseFloat(x.paddingTop))*O.y;l*=O.x,u*=O.y,d*=O.x,h*=O.y,l+=I,u+=B,g=Le(y),y=co(g)}}return mr({width:d,height:h,x:l,y:u})}function Go(e,t){const n=Or(e).scrollLeft;return t?t.left+n:Qt(ot(e)).left+n}function ta(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Go(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function ou(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ot(r),a=t?kr(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=rt(1);const d=rt(0),h=be(r);if((h||!h&&!s)&&((At(r)!=="body"||_n(i))&&(l=Or(r)),be(r))){const p=Qt(r);u=tn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const E=i&&!h&&!s?ta(i,l,!0):rt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+E.x,y:n.y*u.y-l.scrollTop*u.y+d.y+E.y}}function su(e){return Array.from(e.getClientRects())}function iu(e){const t=ot(e),n=Or(e),r=e.ownerDocument.body,o=Se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Go(e);const a=-n.scrollTop;return qe(r).direction==="rtl"&&(i+=Se(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function au(e,t){const n=Le(e),r=ot(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=Ar();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function lu(e,t){const n=Qt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=be(e)?tn(e):rt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Cs(e,t,n){let r;if(t==="viewport")r=au(e,n);else if(t==="document")r=iu(ot(e));else if(ue(t))r=lu(t,n);else{const o=ea(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return mr(r)}function na(e,t){const n=ht(e);return n===t||!ue(n)||ut(n)?!1:qe(n).position==="fixed"||na(n,t)}function cu(e,t){const n=t.get(e);if(n)return n;let r=Ct(e,[],!1).filter(a=>ue(a)&&At(a)!=="body"),o=null;const s=qe(e).position==="fixed";let i=s?ht(e):e;for(;ue(i)&&!ut(i);){const a=qe(i),l=qo(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||_n(i)&&!l&&na(e,i))?r=r.filter(d=>d!==i):o=a,i=ht(i)}return t.set(e,r),r}function uu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?kr(t)?[]:cu(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const h=Cs(t,d,o);return u.top=Se(h.top,u.top),u.right=Vt(h.right,u.right),u.bottom=Vt(h.bottom,u.bottom),u.left=Se(h.left,u.left),u},Cs(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fu(e){const{width:t,height:n}=Zi(e);return{width:t,height:n}}function du(e,t,n){const r=be(t),o=ot(t),s=n==="fixed",i=Qt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=rt(0);if(r||!r&&!s)if((At(t)!=="body"||_n(o))&&(a=Or(t)),r){const E=Qt(t,!0,s,t);l.x=E.x+t.clientLeft,l.y=E.y+t.clientTop}else o&&(l.x=Go(o));const u=o&&!r&&!s?ta(o,a):rt(0),d=i.left+a.scrollLeft-l.x-u.x,h=i.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:i.width,height:i.height}}function qr(e){return qe(e).position==="static"}function ks(e,t){if(!be(e)||qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ot(e)===n&&(n=n.ownerDocument.body),n}function ra(e,t){const n=Le(e);if(kr(e))return n;if(!be(e)){let o=ht(e);for(;o&&!ut(o);){if(ue(o)&&!qr(o))return o;o=ht(o)}return n}let r=ks(e,t);for(;r&&pc(r)&&qr(r);)r=ks(r,t);return r&&ut(r)&&qr(r)&&!qo(r)?n:r||mc(e)||n}const hu=async function(e){const t=this.getOffsetParent||ra,n=this.getDimensions,r=await n(e.floating);return{reference:du(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pu(e){return qe(e).direction==="rtl"}const mu={convertOffsetParentRelativeRectToViewportRelativeRect:ou,getDocumentElement:ot,getClippingRect:uu,getOffsetParent:ra,getElementRects:hu,getClientRects:su,getDimensions:fu,getScale:tn,isElement:ue,isRTL:pu};function oa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gu(e,t){let n=null,r;const o=ot(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:E,height:p}=u;if(a||t(),!E||!p)return;const g=sr(h),y=sr(o.clientWidth-(d+E)),O=sr(o.clientHeight-(h+p)),N=sr(d),I={rootMargin:-g+"px "+-y+"px "+-O+"px "+-N+"px",threshold:Se(0,Vt(1,l))||1};let B=!0;function U(H){const W=H[0].intersectionRatio;if(W!==l){if(!B)return i();W?i(!1,W):r=setTimeout(()=>{i(!1,1e-7)},1e3)}W===1&&!oa(u,e.getBoundingClientRect())&&i(),B=!1}try{n=new IntersectionObserver(U,{...I,root:o.ownerDocument})}catch{n=new IntersectionObserver(U,I)}n.observe(e)}return i(!0),s}function sa(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=zo(e),d=o||s?[...u?Ct(u):[],...Ct(t)]:[];d.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const h=u&&a?gu(u,n):null;let E=-1,p=null;i&&(p=new ResizeObserver(N=>{let[x]=N;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var I;(I=p)==null||I.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let g,y=l?Qt(e):null;l&&O();function O(){const N=Qt(e);y&&!oa(y,N)&&n(),y=N,g=requestAnimationFrame(O)}return n(),()=>{var N;d.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),h==null||h(),(N=p)==null||N.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const zr=Fr,bu=Zc,vu=eu,yu=Xc,wu=tu,xu=(e,t,n)=>{const r=new Map,o={platform:mu,...n},s={...o.platform,_c:r};return Yc(e,t,{...o,platform:s})};var hr=typeof document<"u"?C.useLayoutEffect:C.useEffect;function yr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!yr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ia(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function As(e,t){const n=ia(e);return Math.round(t*n)/n}function Gr(e){const t=D.useRef(e);return hr(()=>{t.current=e}),t}function aa(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,h]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[E,p]=D.useState(r);yr(E,r)||p(r);const[g,y]=D.useState(null),[O,N]=D.useState(null),x=D.useCallback(v=>{v!==H.current&&(H.current=v,y(v))},[]),I=D.useCallback(v=>{v!==W.current&&(W.current=v,N(v))},[]),B=s||g,U=i||O,H=D.useRef(null),W=D.useRef(null),c=D.useRef(d),f=l!=null,b=Gr(l),w=Gr(o),R=Gr(u),A=D.useCallback(()=>{if(!H.current||!W.current)return;const v={placement:t,strategy:n,middleware:E};w.current&&(v.platform=w.current),xu(H.current,W.current,v).then(M=>{const P={...M,isPositioned:R.current!==!1};k.current&&!yr(c.current,P)&&(c.current=P,Ln.flushSync(()=>{h(P)}))})},[E,t,n,w,R]);hr(()=>{u===!1&&c.current.isPositioned&&(c.current.isPositioned=!1,h(v=>({...v,isPositioned:!1})))},[u]);const k=D.useRef(!1);hr(()=>(k.current=!0,()=>{k.current=!1}),[]),hr(()=>{if(B&&(H.current=B),U&&(W.current=U),B&&U){if(b.current)return b.current(B,U,A);A()}},[B,U,A,b,f]);const m=D.useMemo(()=>({reference:H,floating:W,setReference:x,setFloating:I}),[x,I]),S=D.useMemo(()=>({reference:B,floating:U}),[B,U]),F=D.useMemo(()=>{const v={position:n,left:0,top:0};if(!S.floating)return v;const M=As(S.floating,d.x),P=As(S.floating,d.y);return a?{...v,transform:"translate("+M+"px, "+P+"px)",...ia(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:P}},[n,a,S.floating,d.x,d.y]);return D.useMemo(()=>({...d,update:A,refs:m,elements:S,floatingStyles:F}),[d,A,m,S,F])}const Vo=(e,t)=>({...bu(e),options:[e,t]}),la=(e,t)=>({...vu(e),options:[e,t]}),ca=(e,t)=>({...yu(e),options:[e,t]}),Eu=(e,t)=>({...wu(e),options:[e,t]});function Ru(e){const t=D.useRef(void 0),n=D.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s==null?void 0:s())}},e);return D.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const ua={...D},Su=ua.useInsertionEffect,Cu=Su||(e=>e());function tt(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Cu(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Ne=typeof document<"u"?C.useLayoutEffect:C.useEffect;let Os=!1,ku=0;const Ts=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ku++;function Au(){const[e,t]=D.useState(()=>Os?Ts():void 0);return Ne(()=>{e==null&&t(Ts())},[]),D.useEffect(()=>{Os=!0},[]),e}const Ou=ua.useId,vn=Ou||Au;let po;process.env.NODE_ENV!=="production"&&(po=new Set);function Tu(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=po)!=null&&e.has(o))){var s;(s=po)==null||s.add(o),console.error(o)}}function Fu(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Pu=D.createContext(null),Mu=D.createContext(null),fa=()=>{var e;return((e=D.useContext(Pu))==null?void 0:e.id)||null},_o=()=>D.useContext(Mu);function jn(e){return"data-floating-ui-"+e}function Vr(e){const t=C.useRef(e);return Ne(()=>{t.current=e}),t}let Fs=0;function Jt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Fs);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Fs=requestAnimationFrame(s)}function Ps(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function Mn(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}let Zt=new WeakMap,ir=new WeakSet,ar={},_r=0;const Iu=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,da=e=>e&&(e.host||da(e.parentNode)),Du=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=da(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Nu(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Du(t,e),a=new Set,l=new Set(i),u=[];ar[o]||(ar[o]=new WeakMap);const d=ar[o];i.forEach(h),E(t),a.clear();function h(p){!p||a.has(p)||(a.add(p),p.parentNode&&h(p.parentNode))}function E(p){!p||l.has(p)||[].forEach.call(p.children,g=>{if(At(g)!=="script")if(a.has(g))E(g);else{const y=s?g.getAttribute(s):null,O=y!==null&&y!=="false",N=Zt.get(g)||0,x=s?N+1:N,I=(d.get(g)||0)+1;Zt.set(g,x),d.set(g,I),u.push(g),x===1&&O&&ir.add(g),I===1&&g.setAttribute(o,""),!O&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return _r++,()=>{u.forEach(p=>{const g=Zt.get(p)||0,y=s?g-1:g,O=(d.get(p)||0)-1;Zt.set(p,y),d.set(p,O),y||(!ir.has(p)&&s&&p.removeAttribute(s),ir.delete(p)),O||p.removeAttribute(o)}),_r--,_r||(Zt=new WeakMap,Zt=new WeakMap,ir=new WeakSet,ar={})}}function Ms(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=De(e[0]).body;return Nu(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Pr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ha(e,t){const n=Tr(e,Pr());t==="prev"&&n.reverse();const r=n.indexOf(Pt(De(e)));return n.slice(r+1)[0]}function pa(e){return ha(De(e).body,"next")||e}function ma(e){return ha(De(e).body,"prev")||e}function In(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ie(n,r)}function Lu(e){Tr(e,Pr()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Is(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Mr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},wr=D.forwardRef(function(t,n){const[r,o]=D.useState();Ne(()=>{vc()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[jn("focus-guard")]:"",style:Mr};return $.jsx("span",{...t,...s})}),ga=D.createContext(null),Ds=jn("portal");function $u(e){e===void 0&&(e={});const{id:t,root:n}=e,r=vn(),o=va(),[s,i]=D.useState(null),a=D.useRef(null);return Ne(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Ne(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(Ds,""),l.appendChild(u),a.current=u,i(u)},[t,r]),Ne(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!ue(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const d=document.createElement("div");d.id=r,d.setAttribute(Ds,""),l=u||l,l.appendChild(d),a.current=d,i(d)},[t,n,r,o]),s}function ba(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=$u({id:n,root:r}),[i,a]=D.useState(null),l=D.useRef(null),u=D.useRef(null),d=D.useRef(null),h=D.useRef(null),E=i==null?void 0:i.modal,p=i==null?void 0:i.open,g=!!i&&!i.modal&&i.open&&o&&!!(r||s);return D.useEffect(()=>{if(!s||!o||E)return;function y(O){s&&In(O)&&(O.type==="focusin"?Is:Lu)(s)}return s.addEventListener("focusin",y,!0),s.addEventListener("focusout",y,!0),()=>{s.removeEventListener("focusin",y,!0),s.removeEventListener("focusout",y,!0)}},[s,o,E]),D.useEffect(()=>{s&&(p||Is(s))},[p,s]),$.jsxs(ga.Provider,{value:D.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:h,portalNode:s,setFocusManagerState:a}),[o,s]),children:[g&&s&&$.jsx(wr,{"data-type":"outside",ref:l,onFocus:y=>{if(In(y,s)){var O;(O=d.current)==null||O.focus()}else{const N=i?i.domReference:null,x=ma(N);x==null||x.focus()}}}),g&&s&&$.jsx("span",{"aria-owns":s.id,style:Mr}),s&&Ln.createPortal(t,s),g&&s&&$.jsx(wr,{"data-type":"outside",ref:u,onFocus:y=>{if(In(y,s)){var O;(O=h.current)==null||O.focus()}else{const N=i?i.domReference:null,x=pa(N);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,y.nativeEvent,"focus-out"))}}})]})}const va=()=>D.useContext(ga),mo="data-floating-ui-focusable";function Ns(e){return e?e.hasAttribute(mo)?e:e.querySelector("["+mo+"]")||e:null}function Ls(e){return D.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const ju=20;let Mt=[];function Bu(e){Mt=Mt.filter(t=>t.isConnected),e&&At(e)!=="body"&&(Mt.push(e),Mt.length>ju&&(Mt=Mt.slice(-20)))}function $s(){return Mt.slice().reverse().find(e=>e.isConnected)}function Hu(e){const t=Pr();return Kc(e,t)?e:Tr(e,t)[0]||e}const Uu=D.forwardRef(function(t,n){return $.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Mr})});function ya(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0,outsideElementsInert:E=!1,getInsideElements:p=()=>[]}=e,{open:g,onOpenChange:y,events:O,dataRef:N,elements:{domReference:x,floating:I}}=t,B=tt(()=>{var Z;return(Z=N.current.floatingContext)==null?void 0:Z.nodeId}),U=tt(p),H=typeof i=="number"&&i<0,W=xs(x)&&H,c=Iu(),f=c?s:!0,b=!f||c&&E,w=Vr(o),R=Vr(i),A=Vr(a),k=_o(),m=va(),S=D.useRef(null),F=D.useRef(null),v=D.useRef(!1),M=D.useRef(!1),P=D.useRef(-1),L=m!=null,j=Ns(I),z=tt(function(Z){return Z===void 0&&(Z=j),Z?Tr(Z,Pr()):[]}),q=tt(Z=>{const G=z(Z);return w.current.map(_=>x&&_==="reference"?x:j&&_==="floating"?j:G).filter(Boolean).flat()});D.useEffect(()=>{if(r||!u)return;function Z(_){if(_.key==="Tab"){Ie(j,Pt(De(j)))&&z().length===0&&!W&&Wr(_);const J=q(),ne=Dt(_);w.current[0]==="reference"&&ne===x&&(Wr(_),_.shiftKey?Jt(J[J.length-1]):Jt(J[1])),w.current[1]==="floating"&&ne===j&&_.shiftKey&&(Wr(_),Jt(J[0]))}}const G=De(j);return G.addEventListener("keydown",Z),()=>{G.removeEventListener("keydown",Z)}},[r,x,j,u,w,W,z,q]),D.useEffect(()=>{if(r||!I)return;function Z(G){const _=Dt(G),ne=z().indexOf(_);ne!==-1&&(P.current=ne)}return I.addEventListener("focusin",Z),()=>{I.removeEventListener("focusin",Z)}},[r,I,z]),D.useEffect(()=>{if(r||!h)return;function Z(){M.current=!0,setTimeout(()=>{M.current=!1})}function G(_){const J=_.relatedTarget;queueMicrotask(()=>{const ne=B(),Pe=!(Ie(x,J)||Ie(I,J)||Ie(J,I)||Ie(m==null?void 0:m.portalNode,J)||J!=null&&J.hasAttribute(jn("focus-guard"))||k&&(Mn(k.nodesRef.current,ne).find(Oe=>{var me,Ee;return Ie((me=Oe.context)==null?void 0:me.elements.floating,J)||Ie((Ee=Oe.context)==null?void 0:Ee.elements.domReference,J)})||Ps(k.nodesRef.current,ne).find(Oe=>{var me,Ee,Ce;return[(me=Oe.context)==null?void 0:me.elements.floating,Ns((Ee=Oe.context)==null?void 0:Ee.elements.floating)].includes(J)||((Ce=Oe.context)==null?void 0:Ce.elements.domReference)===J})));if(l&&Pe&&Pt(De(j))===De(j).body){be(j)&&j.focus();const Oe=P.current,me=z(),Ee=me[Oe]||me[me.length-1]||j;be(Ee)&&Ee.focus()}(W||!u)&&J&&Pe&&!M.current&&J!==$s()&&(v.current=!0,y(!1,_,"focus-out"))})}if(I&&be(x))return x.addEventListener("focusout",G),x.addEventListener("pointerdown",Z),I.addEventListener("focusout",G),()=>{x.removeEventListener("focusout",G),x.removeEventListener("pointerdown",Z),I.removeEventListener("focusout",G)}},[r,x,I,j,u,k,m,y,h,l,z,W,B]);const V=D.useRef(null),X=D.useRef(null),ee=Ls([V,m==null?void 0:m.beforeInsideRef]),ae=Ls([X,m==null?void 0:m.afterInsideRef]);D.useEffect(()=>{var Z,G;if(r||!I)return;const _=Array.from((m==null||(Z=m.portalNode)==null?void 0:Z.querySelectorAll("["+jn("portal")+"]"))||[]),J=k?Ps(k.nodesRef.current,B()):[],ne=k&&!u?J.map(Ee=>{var Ce;return(Ce=Ee.context)==null?void 0:Ce.elements.floating}):[],Pe=(G=J.find(Ee=>{var Ce;return xs(((Ce=Ee.context)==null?void 0:Ce.elements.domReference)||null)}))==null||(G=G.context)==null?void 0:G.elements.domReference,Oe=[I,Pe,..._,...ne,...U(),S.current,F.current,V.current,X.current,m==null?void 0:m.beforeOutsideRef.current,m==null?void 0:m.afterOutsideRef.current,w.current.includes("reference")||W?x:null].filter(Ee=>Ee!=null),me=u||W?Ms(Oe,!b,b):Ms(Oe);return()=>{me()}},[r,x,I,u,w,m,W,f,b,k,B,U]),Ne(()=>{if(r||!be(j))return;const Z=De(j),G=Pt(Z);queueMicrotask(()=>{const _=q(j),J=R.current,ne=(typeof J=="number"?_[J]:J.current)||j,Pe=Ie(j,G);!H&&!Pe&&g&&Jt(ne,{preventScroll:ne===j})})},[r,g,j,H,q,R]),Ne(()=>{if(r||!j)return;let Z=!1,G=!1;const _=De(j),J=Pt(_);let Pe=N.current.openEvent;Bu(J);function Oe(Ce){let{open:Zn,reason:Cn,event:Ye,nested:er}=Ce;if(Zn&&(Pe=Ye),Cn==="escape-key"&&(G=!0),["hover","safe-polygon"].includes(Cn)&&Ye.type==="mouseleave"&&(v.current=!0),Cn==="outside-press")if(er)v.current=!1,Z=!0;else if(gc(Ye)||bc(Ye))v.current=!1;else{let us=!1;document.createElement("div").focus({get preventScroll(){return us=!0,!1}}),us?(v.current=!1,Z=!0):v.current=!0}}O.on("openchange",Oe);const me=_.createElement("span");me.setAttribute("tabindex","-1"),me.setAttribute("aria-hidden","true"),Object.assign(me.style,Mr),L&&x&&x.insertAdjacentElement("afterend",me);function Ee(){return typeof A.current=="boolean"?G&&x?x:$s()||me:A.current.current||me}return()=>{O.off("openchange",Oe);const Ce=Pt(_),Zn=Ie(I,Ce)||k&&Mn(k.nodesRef.current,B()).some(Ye=>{var er;return Ie((er=Ye.context)==null?void 0:er.elements.floating,Ce)});(Zn||Pe&&["click","mousedown"].includes(Pe.type))&&(G=!0);const Cn=Ee();queueMicrotask(()=>{const Ye=Hu(Cn);A.current&&!v.current&&be(Ye)&&(!(Ye!==Ce&&Ce!==_.body)||Zn)&&Ye.focus({preventScroll:Z}),me.remove()})}},[r,I,j,A,N,O,k,L,x,B]),D.useEffect(()=>{queueMicrotask(()=>{v.current=!1})},[r]),Ne(()=>{if(!r&&m)return m.setFocusManagerState({modal:u,closeOnFocusOut:h,open:g,onOpenChange:y,domReference:x}),()=>{m.setFocusManagerState(null)}},[r,m,u,g,y,h,x]),Ne(()=>{if(r||!j||typeof MutationObserver!="function"||H)return;const Z=()=>{const _=j.getAttribute("tabindex"),J=z(),ne=Pt(De(I)),Pe=J.indexOf(ne);Pe!==-1&&(P.current=Pe),w.current.includes("floating")||ne!==x&&J.length===0?_!=="0"&&j.setAttribute("tabindex","0"):_!=="-1"&&j.setAttribute("tabindex","-1")};Z();const G=new MutationObserver(Z);return G.observe(j,{childList:!0,subtree:!0,attributes:!0}),()=>{G.disconnect()}},[r,I,j,x,w,z,H]);function de(Z){return r||!d||!u?null:$.jsx(Uu,{ref:Z==="start"?S:F,onClick:G=>y(!1,G.nativeEvent),children:typeof d=="string"?d:"Dismiss"})}const pe=!r&&f&&(u?!W:!0)&&(L||u);return $.jsxs($.Fragment,{children:[pe&&$.jsx(wr,{"data-type":"inside",ref:ee,onFocus:Z=>{if(u){const _=q();Jt(o[0]==="reference"?_[0]:_[_.length-1])}else if(m!=null&&m.preserveTabOrder&&m.portalNode)if(v.current=!1,In(Z,m.portalNode)){const _=pa(x);_==null||_.focus()}else{var G;(G=m.beforeOutsideRef.current)==null||G.focus()}}}),!W&&de("start"),n,de("end"),pe&&$.jsx(wr,{"data-type":"inside",ref:ae,onFocus:Z=>{if(u)Jt(q()[0]);else if(m!=null&&m.preserveTabOrder&&m.portalNode)if(h&&(v.current=!0),In(Z,m.portalNode)){const _=ma(x);_==null||_.focus()}else{var G;(G=m.afterOutsideRef.current)==null||G.focus()}}})]})}let lr=0;function Wu(){const e=/iP(hone|ad|od)|iOS/.test(qi()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,s=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var a,l;const u=((a=window.visualViewport)==null?void 0:a.offsetLeft)||0,d=((l=window.visualViewport)==null?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(d))+"px",left:-(s-Math.floor(u))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(s,i))}}let js=()=>{};const qu=D.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return Ne(()=>{if(r)return lr++,lr===1&&(js=Wu()),()=>{lr--,lr===0&&js()}},[r]),$.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Bs(e){return be(e.target)&&e.target.tagName==="BUTTON"}function zu(e){return be(e.target)&&e.target.tagName==="A"}function Hs(e){return Gi(e)}function wa(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:h=!0}=t,E=D.useRef(),p=D.useRef(!1),g=D.useMemo(()=>({onPointerDown(y){E.current=y.pointerType},onMouseDown(y){const O=E.current;y.button===0&&a!=="click"&&(ws(O)&&u||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,y.nativeEvent,"click"):(y.preventDefault(),r(!0,y.nativeEvent,"click"))))},onClick(y){const O=E.current;if(a==="mousedown"&&E.current){E.current=void 0;return}ws(O)&&u||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,y.nativeEvent,"click"):r(!0,y.nativeEvent,"click"))},onKeyDown(y){E.current=void 0,!(y.defaultPrevented||!d||Bs(y))&&(y.key===" "&&!Hs(s)&&(y.preventDefault(),p.current=!0),!zu(y)&&y.key==="Enter"&&r(!(n&&l),y.nativeEvent,"click"))},onKeyUp(y){y.defaultPrevented||!d||Bs(y)||Hs(s)||y.key===" "&&p.current&&(p.current=!1,r(!(n&&l),y.nativeEvent,"click"))}}),[o,s,a,u,d,r,n,h,l]);return D.useMemo(()=>i?{reference:g}:{},[i,g])}const Gu={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Vu={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Us=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function xa(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:E=!1,bubbles:p,capture:g}=t,y=_o(),O=tt(typeof l=="function"?l:()=>!1),N=typeof l=="function"?O:l,x=D.useRef(!1),I=D.useRef(!1),{escapeKey:B,outsidePress:U}=Us(p),{escapeKey:H,outsidePress:W}=Us(g),c=D.useRef(!1),f=tt(m=>{var S;if(!n||!i||!a||m.key!=="Escape"||c.current)return;const F=(S=s.current.floatingContext)==null?void 0:S.nodeId,v=y?Mn(y.nodesRef.current,F):[];if(!B&&(m.stopPropagation(),v.length>0)){let M=!0;if(v.forEach(P=>{var L;if((L=P.context)!=null&&L.open&&!P.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,wc(m)?m.nativeEvent:m,"escape-key")}),b=tt(m=>{var S;const F=()=>{var v;f(m),(v=Dt(m))==null||v.removeEventListener("keydown",F)};(S=Dt(m))==null||S.addEventListener("keydown",F)}),w=tt(m=>{var S;const F=x.current;x.current=!1;const v=I.current;if(I.current=!1,u==="click"&&v||F||typeof N=="function"&&!N(m))return;const M=Dt(m),P="["+jn("inert")+"]",L=De(o.floating).querySelectorAll(P);let j=ue(M)?M:null;for(;j&&!ut(j);){const X=ht(j);if(ut(X)||!ue(X))break;j=X}if(L.length&&ue(M)&&!xc(M)&&!Ie(M,o.floating)&&Array.from(L).every(X=>!Ie(j,X)))return;if(be(M)&&k){const X=ut(M),ee=qe(M),ae=/auto|scroll/,de=X||ae.test(ee.overflowX),pe=X||ae.test(ee.overflowY),Z=de&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,G=pe&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,_=ee.direction==="rtl",J=G&&(_?m.offsetX<=M.offsetWidth-M.clientWidth:m.offsetX>M.clientWidth),ne=Z&&m.offsetY>M.clientHeight;if(J||ne)return}const z=(S=s.current.floatingContext)==null?void 0:S.nodeId,q=y&&Mn(y.nodesRef.current,z).some(X=>{var ee;return Ur(m,(ee=X.context)==null?void 0:ee.elements.floating)});if(Ur(m,o.floating)||Ur(m,o.domReference)||q)return;const V=y?Mn(y.nodesRef.current,z):[];if(V.length>0){let X=!0;if(V.forEach(ee=>{var ae;if((ae=ee.context)!=null&&ae.open&&!ee.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}r(!1,m,"outside-press")}),R=tt(m=>{var S;const F=()=>{var v;w(m),(v=Dt(m))==null||v.removeEventListener(u,F)};(S=Dt(m))==null||S.addEventListener(u,F)});D.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=B,s.current.__outsidePressBubbles=U;let m=-1;function S(L){r(!1,L,"ancestor-scroll")}function F(){window.clearTimeout(m),c.current=!0}function v(){m=window.setTimeout(()=>{c.current=!1},Ar()?5:0)}const M=De(o.floating);a&&(M.addEventListener("keydown",H?b:f,H),M.addEventListener("compositionstart",F),M.addEventListener("compositionend",v)),N&&M.addEventListener(u,W?R:w,W);let P=[];return E&&(ue(o.domReference)&&(P=Ct(o.domReference)),ue(o.floating)&&(P=P.concat(Ct(o.floating))),!ue(o.reference)&&o.reference&&o.reference.contextElement&&(P=P.concat(Ct(o.reference.contextElement)))),P=P.filter(L=>{var j;return L!==((j=M.defaultView)==null?void 0:j.visualViewport)}),P.forEach(L=>{L.addEventListener("scroll",S,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",H?b:f,H),M.removeEventListener("compositionstart",F),M.removeEventListener("compositionend",v)),N&&M.removeEventListener(u,W?R:w,W),P.forEach(L=>{L.removeEventListener("scroll",S)}),window.clearTimeout(m)}},[s,o,a,N,u,n,r,E,i,B,U,f,H,b,w,W,R]),D.useEffect(()=>{x.current=!1},[N,u]);const A=D.useMemo(()=>({onKeyDown:f,...d&&{[Gu[h]]:m=>{r(!1,m.nativeEvent,"reference-press")},...h!=="click"&&{onClick(m){r(!1,m.nativeEvent,"reference-press")}}}}),[f,r,d,h]),k=D.useMemo(()=>({onKeyDown:f,onMouseDown(){I.current=!0},onMouseUp(){I.current=!0},[Vu[u]]:()=>{x.current=!0}}),[f,u]);return D.useMemo(()=>i?{reference:A,floating:k}:{},[i,A,k])}function _u(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=vn(),s=D.useRef({}),[i]=D.useState(()=>Fu()),a=fa()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!ue(p)&&Tu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=D.useState(r.reference),d=tt((p,g,y)=>{s.current.openEvent=p?g:void 0,i.emit("openchange",{open:p,event:g,reason:y,nested:a}),n==null||n(p,g,y)}),h=D.useMemo(()=>({setPositionReference:u}),[]),E=D.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return D.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:E,events:i,floatingId:o,refs:h}),[t,d,E,i,o,h])}function Ea(e){e===void 0&&(e={});const{nodeId:t}=e,n=_u({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=D.useState(null),[a,l]=D.useState(null),d=(o==null?void 0:o.domReference)||s,h=D.useRef(null),E=_o();Ne(()=>{d&&(h.current=d)},[d]);const p=aa({...e,elements:{...o,...a&&{reference:a}}}),g=D.useCallback(I=>{const B=ue(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;l(B),p.refs.setReference(B)},[p.refs]),y=D.useCallback(I=>{(ue(I)||I===null)&&(h.current=I,i(I)),(ue(p.refs.reference.current)||p.refs.reference.current===null||I!==null&&!ue(I))&&p.refs.setReference(I)},[p.refs]),O=D.useMemo(()=>({...p.refs,setReference:y,setPositionReference:g,domReference:h}),[p.refs,y,g]),N=D.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),x=D.useMemo(()=>({...p,...r,refs:O,elements:N,nodeId:t}),[p,O,N,t,r]);return Ne(()=>{r.dataRef.current.floatingContext=x;const I=E==null?void 0:E.nodesRef.current.find(B=>B.id===t);I&&(I.context=x)}),D.useMemo(()=>({...p,context:x,refs:O,elements:N}),[p,O,N,x])}const Ws="active",qs="selected";function Qr(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Ws]:i,[qs]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[mo]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[u,d]=l;if(!(o&&[Ws,qs].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var h;(h=r.get(u))==null||h.push(d),i[u]=function(){for(var E,p=arguments.length,g=new Array(p),y=0;y<p;y++)g[y]=arguments[y];return(E=r.get(u))==null?void 0:E.map(O=>O(...g)).find(O=>O!==void 0)}}}else i[u]=d}),i),{})}}function Ra(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=D.useCallback(a=>Qr(a,e,"reference"),t),s=D.useCallback(a=>Qr(a,e,"floating"),n),i=D.useCallback(a=>Qr(a,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Qu=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ku(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=Qu.get(i))!=null?n:i,l=vn(),d=fa()!=null,h=D.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&d&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,d,r,l,i]),E=D.useMemo(()=>{const g={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?g:{...g,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),p=D.useCallback(g=>{let{active:y,selected:O}=g;const N={role:"option",...y&&{id:o+"-option"}};switch(i){case"select":return{...N,"aria-selected":y&&O};case"combobox":return{...N,...y&&{"aria-selected":!0}}}return{}},[o,i]);return D.useMemo(()=>s?{reference:h,floating:E,item:p}:{},[s,h,E,p])}function Sa({wallets:e,handleWalletClick:t}){return $.jsxs("ul",{className:"space-y-1.5","data-wallet-ui":!0,children:[e.map(n=>$.jsx("li",{children:$.jsxs("button",{onClick:()=>t(n),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-gray-800 dark:text-[#E9E9FD] transition-colors hover:bg-[#E9E9FD] dark:hover:bg-[#192A39] rounded-xl",children:[$.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-md overflow-hidden bg-gray-50 dark:bg-transparent flex items-center justify-center",children:$.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),$.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&$.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400",children:"No wallets found."})]})}function Ca({children:e}){const[t,n]=C.useState(!1),[r,o]=C.useState(null),{wallets:s,activeAddress:i}=dt.useWallet(),{refs:a,context:l}=Ea({open:t,onOpenChange:H=>{H&&i||(H?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),u=wa(l),d=xa(l,{outsidePressEvent:"mousedown"}),h=Ku(l,{role:"dialog"}),{getReferenceProps:E,getFloatingProps:p}=Ra([u,d,h]),g=vn(),y=vn(),O=async H=>{try{await H.connect(),l.onOpenChange(!1)}catch(W){console.error(`Error connecting to ${H.metadata.name}:`,W),l.onOpenChange(!1)}},N=H=>{i||l.onOpenChange(!0)},x=e||$.jsx(Wo,{}),I=Ru([a.setReference,x.ref||null]),B={...E(),ref:I,onClick:N},U=C.cloneElement(x,B);return $.jsxs($.Fragment,{children:[U,$.jsx(ba,{id:"wallet-dialog-portal",children:t&&$.jsx(qu,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-black/30 dark:bg-black/50 data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":r,lockScroll:!0,"data-wallet-ui":!0,children:$.jsx(ya,{context:l,modal:!0,children:$.jsxs("div",{ref:a.setFloating,...p({"aria-labelledby":g,"aria-describedby":y}),"data-state":r,className:"w-full max-w-sm rounded-3xl bg-white dark:bg-[#001324] 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:[$.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[$.jsx("h2",{id:g,className:"text-xl font-bold text-gray-900 dark:text-[#E9E9FD] wallet-custom-font",children:"Connect a Wallet"}),$.jsx("button",{onClick:()=>l.onOpenChange(!1),className:"absolute right-4 rounded-full bg-gray-100 dark:bg-[#192A39]/75 p-2 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-[#192A39] hover:text-gray-700 dark:hover:text-[#D4D4FA]","aria-label":"Close dialog",children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:$.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"})})})]}),$.jsx("div",{className:"px-4 pb-3",children:$.jsx(Sa,{wallets:s,handleWalletClick:O})}),$.jsxs("div",{className:"px-6 py-5 border-t border-gray-200 dark:border-[#192A39] flex items-center justify-between",children:[$.jsx("span",{className:"text-gray-600 dark:text-[#99A1A7] text-sm",children:"Need an Algorand wallet?"}),$.jsx("a",{href:"https://algorand.co/wallets",className:"text-[#2D2DF1]/80 dark:text-[#6C6CF1] font-medium text-sm hover:text-[#2D2DF1] dark:hover:text-[#8080F3]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})]})}var Yu=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Kr=Math.ceil,je=Math.floor,Te="[BigNumber Error] ",zs=Te+"Number primitive has more than 15 significant digits: ",ze=1e14,re=14,Gs=9007199254740991,Yr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gt=1e7,Me=1e9;function ka(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},s=new x(1),i=20,a=4,l=-7,u=21,d=-1e7,h=1e7,E=!1,p=1,g=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},O="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function x(c,f){var b,w,R,A,k,m,S,F,v=this;if(!(v instanceof x))return new x(c,f);if(f==null){if(c&&c._isBigNumber===!0){v.s=c.s,!c.c||c.e>h?v.c=v.e=null:c.e<d?v.c=[v.e=0]:(v.e=c.e,v.c=c.c.slice());return}if((m=typeof c=="number")&&c*0==0){if(v.s=1/c<0?(c=-c,-1):1,c===~~c){for(A=0,k=c;k>=10;k/=10,A++);A>h?v.c=v.e=null:(v.e=A,v.c=[c]);return}F=String(c)}else{if(!Yu.test(F=String(c)))return r(v,F,m);v.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(A=F.indexOf("."))>-1&&(F=F.replace(".","")),(k=F.search(/e/i))>0?(A<0&&(A=k),A+=+F.slice(k+1),F=F.substring(0,k)):A<0&&(A=F.length)}else{if(fe(f,2,O.length,"Base"),f==10&&N)return v=new x(c),H(v,i+v.e+1,a);if(F=String(c),m=typeof c=="number"){if(c*0!=0)return r(v,F,m,f);if(v.s=1/c<0?(F=F.slice(1),-1):1,x.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(zs+c)}else v.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(b=O.slice(0,f),A=k=0,S=F.length;k<S;k++)if(b.indexOf(w=F.charAt(k))<0){if(w=="."){if(k>A){A=S;continue}}else if(!R&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){R=!0,k=-1,A=0;continue}return r(v,String(c),m,f)}m=!1,F=n(F,f,10,v.s),(A=F.indexOf("."))>-1?F=F.replace(".",""):A=F.length}for(k=0;F.charCodeAt(k)===48;k++);for(S=F.length;F.charCodeAt(--S)===48;);if(F=F.slice(k,++S)){if(S-=k,m&&x.DEBUG&&S>15&&(c>Gs||c!==je(c)))throw Error(zs+v.s*c);if((A=A-k-1)>h)v.c=v.e=null;else if(A<d)v.c=[v.e=0];else{if(v.e=A,v.c=[],k=(A+1)%re,A<0&&(k+=re),k<S){for(k&&v.c.push(+F.slice(0,k)),S-=re;k<S;)v.c.push(+F.slice(k,k+=re));k=re-(F=F.slice(k)).length}else k-=S;for(;k--;F+="0");v.c.push(+F)}}else v.c=[v.e=0]}x.clone=ka,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(c){var f,b;if(c!=null)if(typeof c=="object"){if(c.hasOwnProperty(f="DECIMAL_PLACES")&&(b=c[f],fe(b,0,Me,f),i=b),c.hasOwnProperty(f="ROUNDING_MODE")&&(b=c[f],fe(b,0,8,f),a=b),c.hasOwnProperty(f="EXPONENTIAL_AT")&&(b=c[f],b&&b.pop?(fe(b[0],-1e9,0,f),fe(b[1],0,Me,f),l=b[0],u=b[1]):(fe(b,-1e9,Me,f),l=-(u=b<0?-b:b))),c.hasOwnProperty(f="RANGE"))if(b=c[f],b&&b.pop)fe(b[0],-1e9,-1,f),fe(b[1],1,Me,f),d=b[0],h=b[1];else if(fe(b,-1e9,Me,f),b)d=-(h=b<0?-b:b);else throw Error(Te+f+" cannot be zero: "+b);if(c.hasOwnProperty(f="CRYPTO"))if(b=c[f],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))E=b;else throw E=!b,Error(Te+"crypto unavailable");else E=b;else throw Error(Te+f+" not true or false: "+b);if(c.hasOwnProperty(f="MODULO_MODE")&&(b=c[f],fe(b,0,9,f),p=b),c.hasOwnProperty(f="POW_PRECISION")&&(b=c[f],fe(b,0,Me,f),g=b),c.hasOwnProperty(f="FORMAT"))if(b=c[f],typeof b=="object")y=b;else throw Error(Te+f+" not an object: "+b);if(c.hasOwnProperty(f="ALPHABET"))if(b=c[f],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))N=b.slice(0,10)=="0123456789",O=b;else throw Error(Te+f+" invalid: "+b)}else throw Error(Te+"Object expected: "+c);return{DECIMAL_PLACES:i,ROUNDING_MODE:a,EXPONENTIAL_AT:[l,u],RANGE:[d,h],CRYPTO:E,MODULO_MODE:p,POW_PRECISION:g,FORMAT:y,ALPHABET:O}},x.isBigNumber=function(c){if(!c||c._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var f,b,w=c.c,R=c.e,A=c.s;e:if({}.toString.call(w)=="[object Array]"){if((A===1||A===-1)&&R>=-1e9&&R<=Me&&R===je(R)){if(w[0]===0){if(R===0&&w.length===1)return!0;break e}if(f=(R+1)%re,f<1&&(f+=re),String(w[0]).length==f){for(f=0;f<w.length;f++)if(b=w[f],b<0||b>=ze||b!==je(b))break e;if(b!==0)return!0}}}else if(w===null&&R===null&&(A===null||A===1||A===-1))return!0;throw Error(Te+"Invalid BigNumber: "+c)},x.maximum=x.max=function(){return B(arguments,-1)},x.minimum=x.min=function(){return B(arguments,1)},x.random=function(){var c=9007199254740992,f=Math.random()*c&2097151?function(){return je(Math.random()*c)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var w,R,A,k,m,S=0,F=[],v=new x(s);if(b==null?b=i:fe(b,0,Me),k=Kr(b/re),E)if(crypto.getRandomValues){for(w=crypto.getRandomValues(new Uint32Array(k*=2));S<k;)m=w[S]*131072+(w[S+1]>>>11),m>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),w[S]=R[0],w[S+1]=R[1]):(F.push(m%1e14),S+=2);S=k/2}else if(crypto.randomBytes){for(w=crypto.randomBytes(k*=7);S<k;)m=(w[S]&31)*281474976710656+w[S+1]*1099511627776+w[S+2]*4294967296+w[S+3]*16777216+(w[S+4]<<16)+(w[S+5]<<8)+w[S+6],m>=9e15?crypto.randomBytes(7).copy(w,S):(F.push(m%1e14),S+=7);S=k/7}else throw E=!1,Error(Te+"crypto unavailable");if(!E)for(;S<k;)m=f(),m<9e15&&(F[S++]=m%1e14);for(k=F[--S],b%=re,k&&b&&(m=Yr[re-b],F[S]=je(k/m)*m);F[S]===0;F.pop(),S--);if(S<0)F=[A=0];else{for(A=-1;F[0]===0;F.splice(0,1),A-=re);for(S=1,m=F[0];m>=10;m/=10,S++);S<re&&(A-=re-S)}return v.e=A,v.c=F,v}}(),x.sum=function(){for(var c=1,f=arguments,b=new x(f[0]);c<f.length;)b=b.plus(f[c++]);return b},n=function(){var c="0123456789";function f(b,w,R,A){for(var k,m=[0],S,F=0,v=b.length;F<v;){for(S=m.length;S--;m[S]*=w);for(m[0]+=A.indexOf(b.charAt(F++)),k=0;k<m.length;k++)m[k]>R-1&&(m[k+1]==null&&(m[k+1]=0),m[k+1]+=m[k]/R|0,m[k]%=R)}return m.reverse()}return function(b,w,R,A,k){var m,S,F,v,M,P,L,j,z=b.indexOf("."),q=i,V=a;for(z>=0&&(v=g,g=0,b=b.replace(".",""),j=new x(w),P=j.pow(b.length-z),g=v,j.c=f(at($e(P.c),P.e,"0"),10,R,c),j.e=j.c.length),L=f(b,w,R,k?(m=O,c):(m=c,O)),F=v=L.length;L[--v]==0;L.pop());if(!L[0])return m.charAt(0);if(z<0?--F:(P.c=L,P.e=F,P.s=A,P=t(P,j,q,V,R),L=P.c,M=P.r,F=P.e),S=F+q+1,z=L[S],v=R/2,M=M||S<0||L[S+1]!=null,M=V<4?(z!=null||M)&&(V==0||V==(P.s<0?3:2)):z>v||z==v&&(V==4||M||V==6&&L[S-1]&1||V==(P.s<0?8:7)),S<1||!L[0])b=M?at(m.charAt(1),-q,m.charAt(0)):m.charAt(0);else{if(L.length=S,M)for(--R;++L[--S]>R;)L[S]=0,S||(++F,L=[1].concat(L));for(v=L.length;!L[--v];);for(z=0,b="";z<=v;b+=m.charAt(L[z++]));b=at(b,F,m.charAt(0))}return b}}(),t=function(){function c(w,R,A){var k,m,S,F,v=0,M=w.length,P=R%gt,L=R/gt|0;for(w=w.slice();M--;)S=w[M]%gt,F=w[M]/gt|0,k=L*S+F*P,m=P*S+k%gt*gt+v,v=(m/A|0)+(k/gt|0)+L*F,w[M]=m%A;return v&&(w=[v].concat(w)),w}function f(w,R,A,k){var m,S;if(A!=k)S=A>k?1:-1;else for(m=S=0;m<A;m++)if(w[m]!=R[m]){S=w[m]>R[m]?1:-1;break}return S}function b(w,R,A,k){for(var m=0;A--;)w[A]-=m,m=w[A]<R[A]?1:0,w[A]=m*k+w[A]-R[A];for(;!w[0]&&w.length>1;w.splice(0,1));}return function(w,R,A,k,m){var S,F,v,M,P,L,j,z,q,V,X,ee,ae,de,pe,Z,G,_=w.s==R.s?1:-1,J=w.c,ne=R.c;if(!J||!J[0]||!ne||!ne[0])return new x(!w.s||!R.s||(J?ne&&J[0]==ne[0]:!ne)?NaN:J&&J[0]==0||!ne?_*0:_/0);for(z=new x(_),q=z.c=[],F=w.e-R.e,_=A+F+1,m||(m=ze,F=Be(w.e/re)-Be(R.e/re),_=_/re|0),v=0;ne[v]==(J[v]||0);v++);if(ne[v]>(J[v]||0)&&F--,_<0)q.push(1),M=!0;else{for(de=J.length,Z=ne.length,v=0,_+=2,P=je(m/(ne[0]+1)),P>1&&(ne=c(ne,P,m),J=c(J,P,m),Z=ne.length,de=J.length),ae=Z,V=J.slice(0,Z),X=V.length;X<Z;V[X++]=0);G=ne.slice(),G=[0].concat(G),pe=ne[0],ne[1]>=m/2&&pe++;do{if(P=0,S=f(ne,V,Z,X),S<0){if(ee=V[0],Z!=X&&(ee=ee*m+(V[1]||0)),P=je(ee/pe),P>1)for(P>=m&&(P=m-1),L=c(ne,P,m),j=L.length,X=V.length;f(L,V,j,X)==1;)P--,b(L,Z<j?G:ne,j,m),j=L.length,S=1;else P==0&&(S=P=1),L=ne.slice(),j=L.length;if(j<X&&(L=[0].concat(L)),b(V,L,X,m),X=V.length,S==-1)for(;f(ne,V,Z,X)<1;)P++,b(V,Z<X?G:ne,X,m),X=V.length}else S===0&&(P++,V=[0]);q[v++]=P,V[0]?V[X++]=J[ae]||0:(V=[J[ae]],X=1)}while((ae++<de||V[0]!=null)&&_--);M=V[0]!=null,q[0]||q.splice(0,1)}if(m==ze){for(v=1,_=q[0];_>=10;_/=10,v++);H(z,A+(z.e=v+F*re-1)+1,k,M)}else z.e=F,z.r=+M;return z}}();function I(c,f,b,w){var R,A,k,m,S;if(b==null?b=a:fe(b,0,8),!c.c)return c.toString();if(R=c.c[0],k=c.e,f==null)S=$e(c.c),S=w==1||w==2&&(k<=l||k>=u)?ur(S,k):at(S,k,"0");else if(c=H(new x(c),f,b),A=c.e,S=$e(c.c),m=S.length,w==1||w==2&&(f<=A||A<=l)){for(;m<f;S+="0",m++);S=ur(S,A)}else if(f-=k,S=at(S,A,"0"),A+1>m){if(--f>0)for(S+=".";f--;S+="0");}else if(f+=A-m,f>0)for(A+1==m&&(S+=".");f--;S+="0");return c.s<0&&R?"-"+S:S}function B(c,f){for(var b,w,R=1,A=new x(c[0]);R<c.length;R++)w=new x(c[R]),(!w.s||(b=Ft(A,w))===f||b===0&&A.s===f)&&(A=w);return A}function U(c,f,b){for(var w=1,R=f.length;!f[--R];f.pop());for(R=f[0];R>=10;R/=10,w++);return(b=w+b*re-1)>h?c.c=c.e=null:b<d?c.c=[c.e=0]:(c.e=b,c.c=f),c}r=function(){var c=/^(-?)0([xbo])(?=\w[\w.]*$)/i,f=/^([^.]+)\.$/,b=/^\.([^.]+)$/,w=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(A,k,m,S){var F,v=m?k:k.replace(R,"");if(w.test(v))A.s=isNaN(v)?null:v<0?-1:1;else{if(!m&&(v=v.replace(c,function(M,P,L){return F=(L=L.toLowerCase())=="x"?16:L=="b"?2:8,!S||S==F?P:M}),S&&(F=S,v=v.replace(f,"$1").replace(b,"0.$1")),k!=v))return new x(v,F);if(x.DEBUG)throw Error(Te+"Not a"+(S?" base "+S:"")+" number: "+k);A.s=null}A.c=A.e=null}}();function H(c,f,b,w){var R,A,k,m,S,F,v,M=c.c,P=Yr;if(M){e:{for(R=1,m=M[0];m>=10;m/=10,R++);if(A=f-R,A<0)A+=re,k=f,S=M[F=0],v=je(S/P[R-k-1]%10);else if(F=Kr((A+1)/re),F>=M.length)if(w){for(;M.length<=F;M.push(0));S=v=0,R=1,A%=re,k=A-re+1}else break e;else{for(S=m=M[F],R=1;m>=10;m/=10,R++);A%=re,k=A-re+R,v=k<0?0:je(S/P[R-k-1]%10)}if(w=w||f<0||M[F+1]!=null||(k<0?S:S%P[R-k-1]),w=b<4?(v||w)&&(b==0||b==(c.s<0?3:2)):v>5||v==5&&(b==4||w||b==6&&(A>0?k>0?S/P[R-k]:0:M[F-1])%10&1||b==(c.s<0?8:7)),f<1||!M[0])return M.length=0,w?(f-=c.e+1,M[0]=P[(re-f%re)%re],c.e=-f||0):M[0]=c.e=0,c;if(A==0?(M.length=F,m=1,F--):(M.length=F+1,m=P[re-A],M[F]=k>0?je(S/P[R-k]%P[k])*m:0),w)for(;;)if(F==0){for(A=1,k=M[0];k>=10;k/=10,A++);for(k=M[0]+=m,m=1;k>=10;k/=10,m++);A!=m&&(c.e++,M[0]==ze&&(M[0]=1));break}else{if(M[F]+=m,M[F]!=ze)break;M[F--]=0,m=1}for(A=M.length;M[--A]===0;M.pop());}c.e>h?c.c=c.e=null:c.e<d&&(c.c=[c.e=0])}return c}function W(c){var f,b=c.e;return b===null?c.toString():(f=$e(c.c),f=b<=l||b>=u?ur(f,b):at(f,b,"0"),c.s<0?"-"+f:f)}return o.absoluteValue=o.abs=function(){var c=new x(this);return c.s<0&&(c.s=1),c},o.comparedTo=function(c,f){return Ft(this,new x(c,f))},o.decimalPlaces=o.dp=function(c,f){var b,w,R,A=this;if(c!=null)return fe(c,0,Me),f==null?f=a:fe(f,0,8),H(new x(A),c+A.e+1,f);if(!(b=A.c))return null;if(w=((R=b.length-1)-Be(this.e/re))*re,R=b[R])for(;R%10==0;R/=10,w--);return w<0&&(w=0),w},o.dividedBy=o.div=function(c,f){return t(this,new x(c,f),i,a)},o.dividedToIntegerBy=o.idiv=function(c,f){return t(this,new x(c,f),0,1)},o.exponentiatedBy=o.pow=function(c,f){var b,w,R,A,k,m,S,F,v,M=this;if(c=new x(c),c.c&&!c.isInteger())throw Error(Te+"Exponent not an integer: "+W(c));if(f!=null&&(f=new x(f)),m=c.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!c.c||!c.c[0])return v=new x(Math.pow(+W(M),m?c.s*(2-cr(c)):+W(c))),f?v.mod(f):v;if(S=c.s<0,f){if(f.c?!f.c[0]:!f.s)return new x(NaN);w=!S&&M.isInteger()&&f.isInteger(),w&&(M=M.mod(f))}else{if(c.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||m&&M.c[1]>=24e7:M.c[0]<8e13||m&&M.c[0]<=9999975e7)))return A=M.s<0&&cr(c)?-0:0,M.e>-1&&(A=1/A),new x(S?1/A:A);g&&(A=Kr(g/re+2))}for(m?(b=new x(.5),S&&(c.s=1),F=cr(c)):(R=Math.abs(+W(c)),F=R%2),v=new x(s);;){if(F){if(v=v.times(M),!v.c)break;A?v.c.length>A&&(v.c.length=A):w&&(v=v.mod(f))}if(R){if(R=je(R/2),R===0)break;F=R%2}else if(c=c.times(b),H(c,c.e+1,1),c.e>14)F=cr(c);else{if(R=+W(c),R===0)break;F=R%2}M=M.times(M),A?M.c&&M.c.length>A&&(M.c.length=A):w&&(M=M.mod(f))}return w?v:(S&&(v=s.div(v)),f?v.mod(f):A?H(v,g,a,k):v)},o.integerValue=function(c){var f=new x(this);return c==null?c=a:fe(c,0,8),H(f,f.e+1,c)},o.isEqualTo=o.eq=function(c,f){return Ft(this,new x(c,f))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(c,f){return Ft(this,new x(c,f))>0},o.isGreaterThanOrEqualTo=o.gte=function(c,f){return(f=Ft(this,new x(c,f)))===1||f===0},o.isInteger=function(){return!!this.c&&Be(this.e/re)>this.c.length-2},o.isLessThan=o.lt=function(c,f){return Ft(this,new x(c,f))<0},o.isLessThanOrEqualTo=o.lte=function(c,f){return(f=Ft(this,new x(c,f)))===-1||f===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(c,f){var b,w,R,A,k=this,m=k.s;if(c=new x(c,f),f=c.s,!m||!f)return new x(NaN);if(m!=f)return c.s=-f,k.plus(c);var S=k.e/re,F=c.e/re,v=k.c,M=c.c;if(!S||!F){if(!v||!M)return v?(c.s=-f,c):new x(M?k:NaN);if(!v[0]||!M[0])return M[0]?(c.s=-f,c):new x(v[0]?k:a==3?-0:0)}if(S=Be(S),F=Be(F),v=v.slice(),m=S-F){for((A=m<0)?(m=-m,R=v):(F=S,R=M),R.reverse(),f=m;f--;R.push(0));R.reverse()}else for(w=(A=(m=v.length)<(f=M.length))?m:f,m=f=0;f<w;f++)if(v[f]!=M[f]){A=v[f]<M[f];break}if(A&&(R=v,v=M,M=R,c.s=-c.s),f=(w=M.length)-(b=v.length),f>0)for(;f--;v[b++]=0);for(f=ze-1;w>m;){if(v[--w]<M[w]){for(b=w;b&&!v[--b];v[b]=f);--v[b],v[w]+=ze}v[w]-=M[w]}for(;v[0]==0;v.splice(0,1),--F);return v[0]?U(c,v,F):(c.s=a==3?-1:1,c.c=[c.e=0],c)},o.modulo=o.mod=function(c,f){var b,w,R=this;return c=new x(c,f),!R.c||!c.s||c.c&&!c.c[0]?new x(NaN):!c.c||R.c&&!R.c[0]?new x(R):(p==9?(w=c.s,c.s=1,b=t(R,c,0,3),c.s=w,b.s*=w):b=t(R,c,0,p),c=R.minus(b.times(c)),!c.c[0]&&p==1&&(c.s=R.s),c)},o.multipliedBy=o.times=function(c,f){var b,w,R,A,k,m,S,F,v,M,P,L,j,z,q,V=this,X=V.c,ee=(c=new x(c,f)).c;if(!X||!ee||!X[0]||!ee[0])return!V.s||!c.s||X&&!X[0]&&!ee||ee&&!ee[0]&&!X?c.c=c.e=c.s=null:(c.s*=V.s,!X||!ee?c.c=c.e=null:(c.c=[0],c.e=0)),c;for(w=Be(V.e/re)+Be(c.e/re),c.s*=V.s,S=X.length,M=ee.length,S<M&&(j=X,X=ee,ee=j,R=S,S=M,M=R),R=S+M,j=[];R--;j.push(0));for(z=ze,q=gt,R=M;--R>=0;){for(b=0,P=ee[R]%q,L=ee[R]/q|0,k=S,A=R+k;A>R;)F=X[--k]%q,v=X[k]/q|0,m=L*F+v*P,F=P*F+m%q*q+j[A]+b,b=(F/z|0)+(m/q|0)+L*v,j[A--]=F%z;j[A]=b}return b?++w:j.splice(0,1),U(c,j,w)},o.negated=function(){var c=new x(this);return c.s=-c.s||null,c},o.plus=function(c,f){var b,w=this,R=w.s;if(c=new x(c,f),f=c.s,!R||!f)return new x(NaN);if(R!=f)return c.s=-f,w.minus(c);var A=w.e/re,k=c.e/re,m=w.c,S=c.c;if(!A||!k){if(!m||!S)return new x(R/0);if(!m[0]||!S[0])return S[0]?c:new x(m[0]?w:R*0)}if(A=Be(A),k=Be(k),m=m.slice(),R=A-k){for(R>0?(k=A,b=S):(R=-R,b=m),b.reverse();R--;b.push(0));b.reverse()}for(R=m.length,f=S.length,R-f<0&&(b=S,S=m,m=b,f=R),R=0;f;)R=(m[--f]=m[f]+S[f]+R)/ze|0,m[f]=ze===m[f]?0:m[f]%ze;return R&&(m=[R].concat(m),++k),U(c,m,k)},o.precision=o.sd=function(c,f){var b,w,R,A=this;if(c!=null&&c!==!!c)return fe(c,1,Me),f==null?f=a:fe(f,0,8),H(new x(A),c,f);if(!(b=A.c))return null;if(R=b.length-1,w=R*re+1,R=b[R]){for(;R%10==0;R/=10,w--);for(R=b[0];R>=10;R/=10,w++);}return c&&A.e+1>w&&(w=A.e+1),w},o.shiftedBy=function(c){return fe(c,-9007199254740991,Gs),this.times("1e"+c)},o.squareRoot=o.sqrt=function(){var c,f,b,w,R,A=this,k=A.c,m=A.s,S=A.e,F=i+4,v=new x("0.5");if(m!==1||!k||!k[0])return new x(!m||m<0&&(!k||k[0])?NaN:k?A:1/0);if(m=Math.sqrt(+W(A)),m==0||m==1/0?(f=$e(k),(f.length+S)%2==0&&(f+="0"),m=Math.sqrt(+f),S=Be((S+1)/2)-(S<0||S%2),m==1/0?f="5e"+S:(f=m.toExponential(),f=f.slice(0,f.indexOf("e")+1)+S),b=new x(f)):b=new x(m+""),b.c[0]){for(S=b.e,m=S+F,m<3&&(m=0);;)if(R=b,b=v.times(R.plus(t(A,R,F,1))),$e(R.c).slice(0,m)===(f=$e(b.c)).slice(0,m))if(b.e<S&&--m,f=f.slice(m-3,m+1),f=="9999"||!w&&f=="4999"){if(!w&&(H(R,R.e+i+2,0),R.times(R).eq(A))){b=R;break}F+=4,m+=4,w=1}else{(!+f||!+f.slice(1)&&f.charAt(0)=="5")&&(H(b,b.e+i+2,1),c=!b.times(b).eq(A));break}}return H(b,b.e+i+1,a,c)},o.toExponential=function(c,f){return c!=null&&(fe(c,0,Me),c++),I(this,c,f,1)},o.toFixed=function(c,f){return c!=null&&(fe(c,0,Me),c=c+this.e+1),I(this,c,f)},o.toFormat=function(c,f,b){var w,R=this;if(b==null)c!=null&&f&&typeof f=="object"?(b=f,f=null):c&&typeof c=="object"?(b=c,c=f=null):b=y;else if(typeof b!="object")throw Error(Te+"Argument not an object: "+b);if(w=R.toFixed(c,f),R.c){var A,k=w.split("."),m=+b.groupSize,S=+b.secondaryGroupSize,F=b.groupSeparator||"",v=k[0],M=k[1],P=R.s<0,L=P?v.slice(1):v,j=L.length;if(S&&(A=m,m=S,S=A,j-=A),m>0&&j>0){for(A=j%m||m,v=L.substr(0,A);A<j;A+=m)v+=F+L.substr(A,m);S>0&&(v+=F+L.slice(A)),P&&(v="-"+v)}w=M?v+(b.decimalSeparator||"")+((S=+b.fractionGroupSize)?M.replace(new RegExp("\\d{"+S+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):M):v}return(b.prefix||"")+w+(b.suffix||"")},o.toFraction=function(c){var f,b,w,R,A,k,m,S,F,v,M,P,L=this,j=L.c;if(c!=null&&(m=new x(c),!m.isInteger()&&(m.c||m.s!==1)||m.lt(s)))throw Error(Te+"Argument "+(m.isInteger()?"out of range: ":"not an integer: ")+W(m));if(!j)return new x(L);for(f=new x(s),F=b=new x(s),w=S=new x(s),P=$e(j),A=f.e=P.length-L.e-1,f.c[0]=Yr[(k=A%re)<0?re+k:k],c=!c||m.comparedTo(f)>0?A>0?f:F:m,k=h,h=1/0,m=new x(P),S.c[0]=0;v=t(m,f,0,1),R=b.plus(v.times(w)),R.comparedTo(c)!=1;)b=w,w=R,F=S.plus(v.times(R=F)),S=R,f=m.minus(v.times(R=f)),m=R;return R=t(c.minus(b),w,0,1),S=S.plus(R.times(F)),b=b.plus(R.times(w)),S.s=F.s=L.s,A=A*2,M=t(F,w,A,a).minus(L).abs().comparedTo(t(S,b,A,a).minus(L).abs())<1?[F,w]:[S,b],h=k,M},o.toNumber=function(){return+W(this)},o.toPrecision=function(c,f){return c!=null&&fe(c,1,Me),I(this,c,f,2)},o.toString=function(c){var f,b=this,w=b.s,R=b.e;return R===null?w?(f="Infinity",w<0&&(f="-"+f)):f="NaN":(c==null?f=R<=l||R>=u?ur($e(b.c),R):at($e(b.c),R,"0"):c===10&&N?(b=H(new x(b),i+R+1,a),f=at($e(b.c),b.e,"0")):(fe(c,2,O.length,"Base"),f=n(at($e(b.c),R,"0"),10,c,w,!0)),w<0&&b.c[0]&&(f="-"+f)),f},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&x.set(e),x}function Be(e){var t=e|0;return e>0||e===t?t:t-1}function $e(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=re-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Ft(e,t){var n,r,o=e.c,s=t.c,i=e.s,a=t.s,l=e.e,u=t.e;if(!i||!a)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-a:i;if(i!=a)return i;if(n=i<0,r=l==u,!o||!s)return r?0:!o^n?1:-1;if(!r)return l>u^n?1:-1;for(a=(l=o.length)<(u=s.length)?l:u,i=0;i<a;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return l==u?0:l>u^n?1:-1}function fe(e,t,n,r){if(e<t||e>n||e!==je(e))throw Error(Te+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function cr(e){var t=e.c.length-1;return Be(e.e/re)==t&&e.c[t]%2!=0}function ur(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function at(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}ka();const Xu=100000n,Ju=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,a=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),l=r==="auto"?a>=Xu:r,u=typeof i=="bigint"?Number(i):i,d=s&&u!==0&&Math.abs(u)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:d?20:o??2,minimumFractionDigits:d?0:o??2});if(!l)return d?h.format(Vs(u)):h.format(i);const E=[{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(p=>a>=p.threshold);if(E){const p=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),g=Number(i)/E.divisor;return p.format(g)+E.suffix}return d?h.format(Vs(u)):h.format(i)};function Vs(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}function Fn(e,t=5,n=5){return e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:""}var Kn=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=typeof window>"u"||"Deno"in globalThis;function Ue(){}function Zu(e,t){return typeof e=="function"?e(t):e}function go(e){return typeof e=="number"&&e>=0&&e!==1/0}function Aa(e,t){return Math.max(e+(t||0)-Date.now(),0)}function nn(e,t){return typeof e=="function"?e(t):e}function _e(e,t){return typeof e=="function"?e(t):e}function _s(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Qo(i,t.options))return!1}else if(!Hn(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Qs(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Bn(t.options.mutationKey)!==Bn(s))return!1}else if(!Hn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Qo(e,t){return((t==null?void 0:t.queryKeyHashFn)||Bn)(e)}function Bn(e){return JSON.stringify(e,(t,n)=>yo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Hn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Hn(e[n],t[n])):!1}function bo(e,t){if(e===t)return e;const n=Ks(e)&&Ks(t);if(n||yo(e)&&yo(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const d=n?u:s[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=bo(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function vo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ks(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yo(e){if(!Ys(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ys(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ys(e){return Object.prototype.toString.call(e)==="[object Object]"}function ef(e){return new Promise(t=>{setTimeout(t,e)})}function wo(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return bo(e,t)}return t}function tf(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nf(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xr=Symbol();function Oa(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===xr&&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===xr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $t,vt,rn,wi,rf=(wi=class extends Kn{constructor(){super();te(this,$t);te(this,vt);te(this,rn);Q(this,rn,t=>{if(!Kt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,vt)||this.setEventListener(T(this,rn))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,vt))==null||t.call(this),Q(this,vt,void 0))}setEventListener(t){var n;Q(this,rn,t),(n=T(this,vt))==null||n.call(this),Q(this,vt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,$t)!==t&&(Q(this,$t,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,$t)=="boolean"?T(this,$t):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$t=new WeakMap,vt=new WeakMap,rn=new WeakMap,wi),Ko=new rf,on,yt,sn,xi,of=(xi=class extends Kn{constructor(){super();te(this,on,!0);te(this,yt);te(this,sn);Q(this,sn,t=>{if(!Kt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,yt)||this.setEventListener(T(this,sn))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,yt))==null||t.call(this),Q(this,yt,void 0))}setEventListener(t){var n;Q(this,sn,t),(n=T(this,yt))==null||n.call(this),Q(this,yt,t(this.setOnline.bind(this)))}setOnline(t){T(this,on)!==t&&(Q(this,on,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,on)}},on=new WeakMap,yt=new WeakMap,sn=new WeakMap,xi),Er=new of;function xo(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function sf(e){return Math.min(1e3*2**e,3e4)}function Ta(e){return(e??"online")==="online"?Er.isOnline():!0}var Fa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Xr(e){return e instanceof Fa}function Pa(e){let t=!1,n=0,r=!1,o;const s=xo(),i=y=>{var O;r||(E(new Fa(y)),(O=e.abort)==null||O.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Ko.isFocused()&&(e.networkMode==="always"||Er.isOnline())&&e.canRun(),d=()=>Ta(e.networkMode)&&e.canRun(),h=y=>{var O;r||(r=!0,(O=e.onSuccess)==null||O.call(e,y),o==null||o(),s.resolve(y))},E=y=>{var O;r||(r=!0,(O=e.onError)==null||O.call(e,y),o==null||o(),s.reject(y))},p=()=>new Promise(y=>{var O;o=N=>{(r||u())&&y(N)},(O=e.onPause)==null||O.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),g=()=>{if(r)return;let y;const O=n===0?e.initialPromise:void 0;try{y=O??e.fn()}catch(N){y=Promise.reject(N)}Promise.resolve(y).then(h).catch(N=>{var H;if(r)return;const x=e.retry??(Kt?0:3),I=e.retryDelay??sf,B=typeof I=="function"?I(n,N):I,U=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,N);if(t||!U){E(N);return}n++,(H=e.onFail)==null||H.call(e,n,N),ef(B).then(()=>u()?void 0:p()).then(()=>{t?E(N):g()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}var af=e=>setTimeout(e,0);function lf(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=af;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var xe=lf(),jt,Ei,Ma=(Ei=class{constructor(){te(this,jt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),go(this.gcTime)&&Q(this,jt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kt?1/0:5*60*1e3))}clearGcTimeout(){T(this,jt)&&(clearTimeout(T(this,jt)),Q(this,jt,void 0))}},jt=new WeakMap,Ei),an,ln,He,Bt,Re,qn,Ht,Ge,lt,Ri,cf=(Ri=class extends Ma{constructor(t){super();te(this,Ge);te(this,an);te(this,ln);te(this,He);te(this,Bt);te(this,Re);te(this,qn);te(this,Ht);Q(this,Ht,!1),Q(this,qn,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,Bt,t.client),Q(this,He,T(this,Bt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,an,uf(this.options)),this.state=t.state??T(this,an),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,Re))==null?void 0:t.promise}setOptions(t){this.options={...T(this,qn),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,He).remove(this)}setData(t,n){const r=wo(this.state.data,t,this.options);return se(this,Ge,lt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,Ge,lt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=T(this,Re))==null?void 0:r.promise;return(o=T(this,Re))==null||o.cancel(t),n?n.then(Ue).catch(Ue):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,an))}isActive(){return this.observers.some(t=>_e(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Aa(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Re))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Re))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,He).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,Re)&&(T(this,Ht)?T(this,Re).cancel({revert:!0}):T(this,Re).cancelRetry()),this.scheduleGc()),T(this,He).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,Ge,lt).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,Re))return T(this,Re).continueRetry(),T(this,Re).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(E=>E.options.queryFn);h&&this.setOptions(h.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Q(this,Ht,!0),r.signal)})},s=()=>{const h=Oa(this.options,n),E={client:T(this,Bt),queryKey:this.queryKey,meta:this.meta};return o(E),Q(this,Ht,!1),this.options.persister?this.options.persister(h,E,this):h(E)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:T(this,Bt),state:this.state,fetchFn:s};o(i),(l=this.options.behavior)==null||l.onFetch(i,this),Q(this,ln,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&se(this,Ge,lt).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta});const a=h=>{var E,p,g,y;Xr(h)&&h.silent||se(this,Ge,lt).call(this,{type:"error",error:h}),Xr(h)||((p=(E=T(this,He).config).onError)==null||p.call(E,h,this),(y=(g=T(this,He).config).onSettled)==null||y.call(g,this.state.data,h,this)),this.scheduleGc()};return Q(this,Re,Pa({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var E,p,g,y;if(h===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(O){a(O);return}(p=(E=T(this,He).config).onSuccess)==null||p.call(E,h,this),(y=(g=T(this,He).config).onSettled)==null||y.call(g,h,this.state.error,this),this.scheduleGc()},onError:a,onFail:(h,E)=>{se(this,Ge,lt).call(this,{type:"failed",failureCount:h,error:E})},onPause:()=>{se(this,Ge,lt).call(this,{type:"pause"})},onContinue:()=>{se(this,Ge,lt).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),T(this,Re).start()}},an=new WeakMap,ln=new WeakMap,He=new WeakMap,Bt=new WeakMap,Re=new WeakMap,qn=new WeakMap,Ht=new WeakMap,Ge=new WeakSet,lt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ia(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Xr(o)&&o.revert&&T(this,ln)?{...T(this,ln),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),xe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,He).notify({query:this,type:"updated",action:t})})},Ri);function Ia(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ta(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uf(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Xe,Si,ff=(Si=class extends Kn{constructor(t={}){super();te(this,Xe);this.config=t,Q(this,Xe,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Qo(o,n);let i=this.get(s);return i||(i=new cf({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){T(this,Xe).has(t.queryHash)||(T(this,Xe).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,Xe).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,Xe).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){xe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,Xe).get(t)}getAll(){return[...T(this,Xe).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_s(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>_s(t,r)):n}notify(t){xe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){xe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){xe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xe=new WeakMap,Si),Je,ke,Ut,Ze,bt,Ci,df=(Ci=class extends Ma{constructor(t){super();te(this,Ze);te(this,Je);te(this,ke);te(this,Ut);this.mutationId=t.mutationId,Q(this,ke,t.mutationCache),Q(this,Je,[]),this.state=t.state||hf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Je).includes(t)||(T(this,Je).push(t),this.clearGcTimeout(),T(this,ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Je,T(this,Je).filter(n=>n!==t)),this.scheduleGc(),T(this,ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Je).length||(this.state.status==="pending"?this.scheduleGc():T(this,ke).remove(this))}continue(){var t;return((t=T(this,Ut))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,l,u,d,h,E,p,g,y,O,N,x,I,B,U,H,W;Q(this,Ut,Pa({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(c,f)=>{se(this,Ze,bt).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{se(this,Ze,bt).call(this,{type:"pause"})},onContinue:()=>{se(this,Ze,bt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,ke).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Ut).canStart();try{if(!n){se(this,Ze,bt).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=T(this,ke).config).onMutate)==null?void 0:s.call(o,t,this));const f=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));f!==this.state.context&&se(this,Ze,bt).call(this,{type:"pending",context:f,variables:t,isPaused:r})}const c=await T(this,Ut).start();return await((u=(l=T(this,ke).config).onSuccess)==null?void 0:u.call(l,c,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,c,t,this.state.context)),await((p=(E=T(this,ke).config).onSettled)==null?void 0:p.call(E,c,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,c,null,t,this.state.context)),se(this,Ze,bt).call(this,{type:"success",data:c}),c}catch(c){try{throw await((N=(O=T(this,ke).config).onError)==null?void 0:N.call(O,c,t,this.state.context,this)),await((I=(x=this.options).onError)==null?void 0:I.call(x,c,t,this.state.context)),await((U=(B=T(this,ke).config).onSettled)==null?void 0:U.call(B,void 0,c,this.state.variables,this.state.context,this)),await((W=(H=this.options).onSettled)==null?void 0:W.call(H,void 0,c,t,this.state.context)),c}finally{se(this,Ze,bt).call(this,{type:"error",error:c})}}finally{T(this,ke).runNext(this)}}},Je=new WeakMap,ke=new WeakMap,Ut=new WeakMap,Ze=new WeakSet,bt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),xe.batch(()=>{T(this,Je).forEach(r=>{r.onMutationUpdate(t)}),T(this,ke).notify({mutation:this,type:"updated",action:t})})},Ci);function hf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ct,Ve,zn,ki,pf=(ki=class extends Kn{constructor(t={}){super();te(this,ct);te(this,Ve);te(this,zn);this.config=t,Q(this,ct,new Set),Q(this,Ve,new Map),Q(this,zn,0)}build(t,n,r){const o=new df({mutationCache:this,mutationId:++tr(this,zn)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){T(this,ct).add(t);const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n);r?r.push(t):T(this,Ve).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,ct).delete(t)){const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&T(this,Ve).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=fr(t);if(typeof n=="string"){const r=T(this,Ve).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=fr(t);if(typeof n=="string"){const o=(r=T(this,Ve).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){xe.batch(()=>{T(this,ct).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,ct).clear(),T(this,Ve).clear()})}getAll(){return Array.from(T(this,ct))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qs(n,r))}findAll(t={}){return this.getAll().filter(n=>Qs(t,n))}notify(t){xe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return xe.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ue))))}},ct=new WeakMap,Ve=new WeakMap,zn=new WeakMap,ki);function fr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Xs(e){return{onFetch:(t,n)=>{var d,h,E,p,g;const r=t.options,o=(E=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:E.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const O=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},N=Oa(t.options,t.fetchOptions),x=async(I,B,U)=>{if(y)return Promise.reject();if(B==null&&I.pages.length)return Promise.resolve(I);const H={client:t.client,queryKey:t.queryKey,pageParam:B,direction:U?"backward":"forward",meta:t.options.meta};O(H);const W=await N(H),{maxPages:c}=t.options,f=U?nf:tf;return{pages:f(I.pages,W,c),pageParams:f(I.pageParams,B,c)}};if(o&&s.length){const I=o==="backward",B=I?mf:Js,U={pages:s,pageParams:i},H=B(r,U);a=await x(U,H,I)}else{const I=e??s.length;do{const B=l===0?i[0]??r.initialPageParam:Js(r,a);if(l>0&&B==null)break;a=await x(a,B),l++}while(l<I)}return a};t.options.persister?t.fetchFn=()=>{var y,O;return(O=(y=t.options).persister)==null?void 0:O.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Js(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mf(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var he,wt,xt,cn,un,Et,fn,dn,Ai,gf=(Ai=class{constructor(e={}){te(this,he);te(this,wt);te(this,xt);te(this,cn);te(this,un);te(this,Et);te(this,fn);te(this,dn);Q(this,he,e.queryCache||new ff),Q(this,wt,e.mutationCache||new pf),Q(this,xt,e.defaultOptions||{}),Q(this,cn,new Map),Q(this,un,new Map),Q(this,Et,0)}mount(){tr(this,Et)._++,T(this,Et)===1&&(Q(this,fn,Ko.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,he).onFocus())})),Q(this,dn,Er.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,he).onOnline())})))}unmount(){var e,t;tr(this,Et)._--,T(this,Et)===0&&((e=T(this,fn))==null||e.call(this),Q(this,fn,void 0),(t=T(this,dn))==null||t.call(this),Q(this,dn,void 0))}isFetching(e){return T(this,he).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,wt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,he).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=T(this,he).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return T(this,he).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=T(this,he).get(r.queryHash),s=o==null?void 0:o.state.data,i=Zu(t,s);if(i!==void 0)return T(this,he).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return xe.batch(()=>T(this,he).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,he).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,he);xe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,he);return xe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=xe.batch(()=>T(this,he).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ue).catch(Ue)}invalidateQueries(e,t={}){return xe.batch(()=>(T(this,he).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=xe.batch(()=>T(this,he).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ue)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ue)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,he).build(this,t);return n.isStaleByTime(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ue).catch(Ue)}fetchInfiniteQuery(e){return e.behavior=Xs(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ue).catch(Ue)}ensureInfiniteQueryData(e){return e.behavior=Xs(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Er.isOnline()?T(this,wt).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,he)}getMutationCache(){return T(this,wt)}getDefaultOptions(){return T(this,xt)}setDefaultOptions(e){Q(this,xt,e)}setQueryDefaults(e,t){T(this,cn).set(Bn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,cn).values()],n={};return t.forEach(r=>{Hn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,un).set(Bn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,un).values()],n={};return t.forEach(r=>{Hn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,xt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qo(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===xr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,xt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,he).clear(),T(this,wt).clear()}},he=new WeakMap,wt=new WeakMap,xt=new WeakMap,cn=new WeakMap,un=new WeakMap,Et=new WeakMap,fn=new WeakMap,dn=new WeakMap,Ai),Fe,ie,Gn,Ae,Wt,hn,Rt,et,Vn,pn,mn,qt,zt,St,gn,ce,Pn,Eo,Ro,So,Co,ko,Ao,Oo,Da,Oi,bf=(Oi=class extends Kn{constructor(t,n){super();te(this,ce);te(this,Fe);te(this,ie);te(this,Gn);te(this,Ae);te(this,Wt);te(this,hn);te(this,Rt);te(this,et);te(this,Vn);te(this,pn);te(this,mn);te(this,qt);te(this,zt);te(this,St);te(this,gn,new Set);this.options=n,Q(this,Fe,t),Q(this,et,null),Q(this,Rt,xo()),this.options.experimental_prefetchInRender||T(this,Rt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,ie).addObserver(this),Zs(T(this,ie),this.options)?se(this,ce,Pn).call(this):this.updateResult(),se(this,ce,Co).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return To(T(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return To(T(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,ce,ko).call(this),se(this,ce,Ao).call(this),T(this,ie).removeObserver(this)}setOptions(t){const n=this.options,r=T(this,ie);if(this.options=T(this,Fe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _e(this.options.enabled,T(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,ce,Oo).call(this),T(this,ie).setOptions(this.options),n._defaulted&&!vo(this.options,n)&&T(this,Fe).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,ie),observer:this});const o=this.hasListeners();o&&ei(T(this,ie),r,this.options,n)&&se(this,ce,Pn).call(this),this.updateResult(),o&&(T(this,ie)!==r||_e(this.options.enabled,T(this,ie))!==_e(n.enabled,T(this,ie))||nn(this.options.staleTime,T(this,ie))!==nn(n.staleTime,T(this,ie)))&&se(this,ce,Eo).call(this);const s=se(this,ce,Ro).call(this);o&&(T(this,ie)!==r||_e(this.options.enabled,T(this,ie))!==_e(n.enabled,T(this,ie))||s!==T(this,St))&&se(this,ce,So).call(this,s)}getOptimisticResult(t){const n=T(this,Fe).getQueryCache().build(T(this,Fe),t),r=this.createResult(n,t);return yf(this,r)&&(Q(this,Ae,r),Q(this,hn,this.options),Q(this,Wt,T(this,ie).state)),r}getCurrentResult(){return T(this,Ae)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){T(this,gn).add(t)}getCurrentQuery(){return T(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,Fe).defaultQueryOptions(t),r=T(this,Fe).getQueryCache().build(T(this,Fe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,ce,Pn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ae)))}createResult(t,n){var c;const r=T(this,ie),o=this.options,s=T(this,Ae),i=T(this,Wt),a=T(this,hn),u=t!==r?t.state:T(this,Gn),{state:d}=t;let h={...d},E=!1,p;if(n._optimisticResults){const f=this.hasListeners(),b=!f&&Zs(t,n),w=f&&ei(t,r,n,o);(b||w)&&(h={...h,...Ia(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:O}=h;if(n.select&&h.data!==void 0)if(s&&h.data===(i==null?void 0:i.data)&&n.select===T(this,Vn))p=T(this,pn);else try{Q(this,Vn,n.select),p=n.select(h.data),p=wo(s==null?void 0:s.data,p,n),Q(this,pn,p),Q(this,et,null)}catch(f){Q(this,et,f)}else p=h.data;if(n.placeholderData!==void 0&&p===void 0&&O==="pending"){let f;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))f=s.data;else if(f=typeof n.placeholderData=="function"?n.placeholderData((c=T(this,mn))==null?void 0:c.state.data,T(this,mn)):n.placeholderData,n.select&&f!==void 0)try{f=n.select(f),Q(this,et,null)}catch(b){Q(this,et,b)}f!==void 0&&(O="success",p=wo(s==null?void 0:s.data,f,n),E=!0)}T(this,et)&&(g=T(this,et),p=T(this,pn),y=Date.now(),O="error");const N=h.fetchStatus==="fetching",x=O==="pending",I=O==="error",B=x&&N,U=p!==void 0,W={status:O,fetchStatus:h.fetchStatus,isPending:x,isSuccess:O==="success",isError:I,isInitialLoading:B,isLoading:B,data:p,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:N,isRefetching:N&&!x,isLoadingError:I&&!U,isPaused:h.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:I&&U,isStale:Yo(t,n),refetch:this.refetch,promise:T(this,Rt)};if(this.options.experimental_prefetchInRender){const f=R=>{W.status==="error"?R.reject(W.error):W.data!==void 0&&R.resolve(W.data)},b=()=>{const R=Q(this,Rt,W.promise=xo());f(R)},w=T(this,Rt);switch(w.status){case"pending":t.queryHash===r.queryHash&&f(w);break;case"fulfilled":(W.status==="error"||W.data!==w.value)&&b();break;case"rejected":(W.status!=="error"||W.error!==w.reason)&&b();break}}return W}updateResult(){const t=T(this,Ae),n=this.createResult(T(this,ie),this.options);if(Q(this,Wt,T(this,ie).state),Q(this,hn,this.options),T(this,Wt).data!==void 0&&Q(this,mn,T(this,ie)),vo(n,t))return;Q(this,Ae,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!T(this,gn).size)return!0;const i=new Set(s??T(this,gn));return this.options.throwOnError&&i.add("error"),Object.keys(T(this,Ae)).some(a=>{const l=a;return T(this,Ae)[l]!==t[l]&&i.has(l)})};se(this,ce,Da).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,ce,Co).call(this)}},Fe=new WeakMap,ie=new WeakMap,Gn=new WeakMap,Ae=new WeakMap,Wt=new WeakMap,hn=new WeakMap,Rt=new WeakMap,et=new WeakMap,Vn=new WeakMap,pn=new WeakMap,mn=new WeakMap,qt=new WeakMap,zt=new WeakMap,St=new WeakMap,gn=new WeakMap,ce=new WeakSet,Pn=function(t){se(this,ce,Oo).call(this);let n=T(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ue)),n},Eo=function(){se(this,ce,ko).call(this);const t=nn(this.options.staleTime,T(this,ie));if(Kt||T(this,Ae).isStale||!go(t))return;const r=Aa(T(this,Ae).dataUpdatedAt,t)+1;Q(this,qt,setTimeout(()=>{T(this,Ae).isStale||this.updateResult()},r))},Ro=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,ie)):this.options.refetchInterval)??!1},So=function(t){se(this,ce,Ao).call(this),Q(this,St,t),!(Kt||_e(this.options.enabled,T(this,ie))===!1||!go(T(this,St))||T(this,St)===0)&&Q(this,zt,setInterval(()=>{(this.options.refetchIntervalInBackground||Ko.isFocused())&&se(this,ce,Pn).call(this)},T(this,St)))},Co=function(){se(this,ce,Eo).call(this),se(this,ce,So).call(this,se(this,ce,Ro).call(this))},ko=function(){T(this,qt)&&(clearTimeout(T(this,qt)),Q(this,qt,void 0))},Ao=function(){T(this,zt)&&(clearInterval(T(this,zt)),Q(this,zt,void 0))},Oo=function(){const t=T(this,Fe).getQueryCache().build(T(this,Fe),this.options);if(t===T(this,ie))return;const n=T(this,ie);Q(this,ie,t),Q(this,Gn,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Da=function(t){xe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Ae))}),T(this,Fe).getQueryCache().notify({query:T(this,ie),type:"observerResultsUpdated"})})},Oi);function vf(e,t){return _e(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zs(e,t){return vf(e,t)||e.state.data!==void 0&&To(e,t,t.refetchOnMount)}function To(e,t,n){if(_e(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yo(e,t)}return!1}function ei(e,t,n,r){return(e!==t||_e(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yo(e,n)}function Yo(e,t){return _e(t.enabled,e)!==!1&&e.isStaleByTime(nn(t.staleTime,e))}function yf(e,t){return!vo(e.getCurrentResult(),t)}var Na=D.createContext(void 0),La=e=>{const t=D.useContext(Na);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$a=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),$.jsx(Na.Provider,{value:e,children:t})),wf=D.createContext(!1),xf=()=>D.useContext(wf);function Ef(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rf=D.createContext(Ef()),Sf=()=>D.useContext(Rf);function Cf(e,t){return typeof e=="function"?e(...t):!!e}function ti(){}var kf=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Af=e=>{D.useEffect(()=>{e.clearReset()},[e])},Of=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Cf(n,[e.error,r])),Tf=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Ff=(e,t)=>e.isLoading&&e.isFetching&&!t,Pf=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ni=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Mf(e,t,n){var h,E,p,g,y;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=La(),o=xf(),s=Sf(),i=r.defaultQueryOptions(e);(E=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||E.call(h,i),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=o?"isRestoring":"optimistic",Tf(i),kf(i,s),Af(s);const a=!r.getQueryCache().get(i.queryHash),[l]=D.useState(()=>new t(r,i)),u=l.getOptimisticResult(i),d=!o&&e.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(O=>{const N=d?l.subscribe(xe.batchCalls(O)):ti;return l.updateResult(),N},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),D.useEffect(()=>{l.setOptions(i)},[i,l]),Pf(i,u))throw ni(i,l,s);if(Of({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((g=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,i,u),i.experimental_prefetchInRender&&!Kt&&Ff(u,o)){const O=a?ni(i,l,s):(y=r.getQueryCache().get(i.queryHash))==null?void 0:y.promise;O==null||O.catch(ti).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?u:l.trackResult(u)}function Xo(e,t){return Mf(e,bf)}function Jo(e={}){const{activeAddress:t}=dt.useWallet(),{activeNetwork:n}=dt.useNetwork(),{enabled:r=!0,view:o="thumbnail"}=e;return Xo({queryKey:["nfd",t,n,o],queryFn:async({signal:s})=>{if(!t)return null;const l=await fetch(`${n==="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(l.status===404)return null;if(!l.ok)throw new Error(`NFD lookup failed: ${l.statusText}`);return(await l.json())[t]},enabled:r&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const If="https://ipfs.algonode.dev",Df=async e=>{if(!e.startsWith("ipfs://"))return e;const t=e.replace("ipfs://",""),n=`https://images.nf.domains/ipfs/${t}`;try{if((await fetch(n,{method:"HEAD"})).ok)return n}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}return`${If}/ipfs/${t}`};function Zo({nfd:e,alt:t,className:n,size:r=40,fallback:o,lightOnly:s=!1}){var d,h,E,p;const i=((h=(d=e==null?void 0:e.properties)==null?void 0:d.userDefined)==null?void 0:h.avatar)||((p=(E=e==null?void 0:e.properties)==null?void 0:E.verified)==null?void 0:p.avatar)||null,a=t||(e==null?void 0:e.name)||"NFD Avatar",{data:l,isLoading:u}=Xo({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await Df(i):i:null,enabled:!!i,staleTime:60*60*1e3,gcTime:24*60*60*1e3});return u||!l?o?$.jsx($.Fragment,{children:o}):$.jsx("div",{className:en("flex items-center justify-center rounded-full",s?"bg-gray-200 dark:bg-gray-200":"bg-gray-200 dark:bg-[#192A39]",n),style:{width:`${r}px`,height:`${r}px`},"aria-label":a,role:"img","data-wallet-ui":!0,children:$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:en("text-gray-400",!s&&"dark:text-gray-500"),style:{width:`${Math.max(r/2,12)}px`,height:`${Math.max(r/2,12)}px`},children:$.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"})})}):$.jsx("img",{src:l,alt:a,className:en("rounded-full",n),style:{width:`${r}px`,height:`${r}px`,objectFit:"cover"},loading:"lazy"})}const Ir=C.forwardRef(({className:e="",children:t,style:n,...r},o)=>{var u;const{activeAddress:s}=dt.useWallet(),i=Jo({enabled:!!s}),a=((u=i.data)==null?void 0:u.name)??null;return $.jsx("button",{ref:o,className:en("flex items-center",e),style:n,disabled:!1,...r,type:"button","data-wallet-ui":!0,children:t||$.jsx("div",{className:"flex items-center",children:$.jsxs("div",{className:"flex items-center py-2.5 pl-3 md:pl-3.5 pr-3 bg-[#2D2DF1] dark:bg-[#BFBFF9] text-white dark:text-[#001324] rounded-xl font-bold",children:[s&&$.jsx("div",{className:"mr-1 md:mr-2 h-6 w-6 overflow-hidden",children:$.jsx(Zo,{nfd:i.data,alt:`${a||s} avatar`,size:24,lightOnly:!0})}),$.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:a||(s?Fn(s,6,4):"Connect")}),s&&$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:$.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})})});Ir.displayName="ConnectedWalletButton";const ja=typeof document<"u"?C.useLayoutEffect:()=>{};function Nf(e){const t=C.useRef(null);return ja(()=>{t.current=e},[e]),C.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ot=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Nt=e=>e&&"window"in e&&e.window===e?e:Ot(e).defaultView||window;function Lf(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function $f(e){return Lf(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let jf=!1;function es(){return jf}function Ba(e,t){if(!es())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:$f(n)?n=n.host:n=n.parentNode}return!1}const Fo=(e=document)=>{var t;if(!es())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Ha(e){return es()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Bf(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Hf(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 Ua(e){let t=null;return()=>(t==null&&(t=e()),t)}const Uf=Ua(function(){return Hf(/^Mac/i)}),Wf=Ua(function(){return Bf(/Android/i)});function Wa(){let e=C.useRef(new Map),t=C.useCallback((o,s,i,a)=>{let l=a!=null&&a.once?(...u)=>{e.current.delete(i),i(...u)}:i;e.current.set(i,{type:s,eventTarget:o,fn:l,options:a}),o.addEventListener(s,l,a)},[]),n=C.useCallback((o,s,i,a)=>{var l;let u=((l=e.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(s,u,a),e.current.delete(i)},[]),r=C.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return C.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function qf(e){return e.mozInputSource===0&&e.isTrusted?!0:Wf()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class qa{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function za(e){let t=C.useRef({isFocused:!1,observer:null});ja(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Nf(r=>{e==null||e(r)});return C.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{t.current.isFocused=!1,o.disabled&&n(new qa("blur",i)),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 a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let zf=!1,Yn=null,Po=new Set,Dn=new Map,Yt=!1,Mo=!1;const Gf={Tab:!0,Escape:!0};function ts(e,t){for(let n of Po)n(e,t)}function Vf(e){return!(e.metaKey||!Uf()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Rr(e){Yt=!0,Vf(e)&&(Yn="keyboard",ts("keyboard",e))}function We(e){Yn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Yt=!0,ts("pointer",e))}function Ga(e){qf(e)&&(Yt=!0,Yn="virtual")}function Va(e){e.target===window||e.target===document||zf||!e.isTrusted||(!Yt&&!Mo&&(Yn="virtual",ts("virtual",e)),Yt=!1,Mo=!1)}function _a(){Yt=!1,Mo=!0}function Io(e){if(typeof window>"u"||Dn.get(Nt(e)))return;const t=Nt(e),n=Ot(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Yt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Rr,!0),n.addEventListener("keyup",Rr,!0),n.addEventListener("click",Ga,!0),t.addEventListener("focus",Va,!0),t.addEventListener("blur",_a,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",We,!0),n.addEventListener("pointermove",We,!0),n.addEventListener("pointerup",We,!0)):(n.addEventListener("mousedown",We,!0),n.addEventListener("mousemove",We,!0),n.addEventListener("mouseup",We,!0)),t.addEventListener("beforeunload",()=>{Qa(e)},{once:!0}),Dn.set(t,{focus:r})}const Qa=(e,t)=>{const n=Nt(e),r=Ot(e);t&&r.removeEventListener("DOMContentLoaded",t),Dn.has(n)&&(n.HTMLElement.prototype.focus=Dn.get(n).focus,r.removeEventListener("keydown",Rr,!0),r.removeEventListener("keyup",Rr,!0),r.removeEventListener("click",Ga,!0),n.removeEventListener("focus",Va,!0),n.removeEventListener("blur",_a,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",We,!0),r.removeEventListener("pointermove",We,!0),r.removeEventListener("pointerup",We,!0)):(r.removeEventListener("mousedown",We,!0),r.removeEventListener("mousemove",We,!0),r.removeEventListener("mouseup",We,!0)),Dn.delete(n))};function _f(e){const t=Ot(e);let n;return t.readyState!=="loading"?Io(e):(n=()=>{Io(e)},t.addEventListener("DOMContentLoaded",n)),()=>Qa(e,n)}typeof document<"u"&&_f();function Ka(){return Yn!=="pointer"}const Qf=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Kf(e,t,n){let r=Ot(n==null?void 0:n.target);const o=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Nt(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Nt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Qf.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!Gf[n.key])}function Yf(e,t,n){Io(),C.useEffect(()=>{let r=(o,s)=>{Kf(!!(n!=null&&n.isTextInput),o,s)&&e(Ka())};return Po.add(r),()=>{Po.delete(r)}},t)}function Xf(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=C.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),i=za(s),a=C.useCallback(l=>{const u=Ot(l.target),d=u?Fo(u):Fo();l.target===l.currentTarget&&d===Ha(l.nativeEvent)&&(n&&n(l),o&&o(!0),i(l))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?s:void 0}}}function Jf(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=C.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:a}=Wa(),l=C.useCallback(h=>{h.currentTarget.contains(h.target)&&s.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(s.current.isFocusWithin=!1,a(),n&&n(h),o&&o(!1))},[n,o,s,a]),u=za(l),d=C.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const E=Ot(h.target),p=Fo(E);if(!s.current.isFocusWithin&&p===Ha(h.nativeEvent)){r&&r(h),o&&o(!0),s.current.isFocusWithin=!0,u(h);let g=h.currentTarget;i(E,"focus",y=>{if(s.current.isFocusWithin&&!Ba(g,y.target)){let O=new qa("blur",new E.defaultView.FocusEvent("blur",{relatedTarget:y.target}));O.target=g,O.currentTarget=g,l(O)}},{capture:!0})}},[r,o,u,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:l}}}let Sr=!1,Jr=0;function Do(){Sr=!0,setTimeout(()=>{Sr=!1},50)}function ri(e){e.pointerType==="touch"&&Do()}function Zf(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",ri):document.addEventListener("touchend",Do),Jr++,()=>{Jr--,!(Jr>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ri):document.removeEventListener("touchend",Do))}}function ed(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=C.useState(!1),a=C.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;C.useEffect(Zf,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=Wa(),{hoverProps:d,triggerHoverEnd:h}=C.useMemo(()=>{let E=(y,O)=>{if(a.pointerType=O,o||O==="touch"||a.isHovered||!y.currentTarget.contains(y.target))return;a.isHovered=!0;let N=y.currentTarget;a.target=N,l(Ot(y.target),"pointerover",x=>{a.isHovered&&a.target&&!Ba(a.target,x.target)&&p(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:O}),n&&n(!0),i(!0)},p=(y,O)=>{let N=a.target;a.pointerType="",a.target=null,!(O==="touch"||!a.isHovered||!N)&&(a.isHovered=!1,u(),r&&r({type:"hoverend",target:N,pointerType:O}),n&&n(!1),i(!1))},g={};return typeof PointerEvent<"u"?(g.onPointerEnter=y=>{Sr&&y.pointerType==="mouse"||E(y,y.pointerType)},g.onPointerLeave=y=>{!o&&y.currentTarget.contains(y.target)&&p(y,y.pointerType)}):(g.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},g.onMouseEnter=y=>{!a.ignoreEmulatedMouseEvents&&!Sr&&E(y,"mouse"),a.ignoreEmulatedMouseEvents=!1},g.onMouseLeave=y=>{!o&&y.currentTarget.contains(y.target)&&p(y,"mouse")}),{hoverProps:g,triggerHoverEnd:p}},[t,n,r,o,a,l,u]);return C.useEffect(()=>{o&&h({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:d,isHovered:s}}function td(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=C.useRef({isFocused:!1,isFocusVisible:t||Ka()}),[s,i]=C.useState(!1),[a,l]=C.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=C.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=C.useCallback(p=>{o.current.isFocused=p,i(p),u()},[u]);Yf(p=>{o.current.isFocusVisible=p,u()},[],{isTextInput:n});let{focusProps:h}=Xf({isDisabled:r,onFocusChange:d}),{focusWithinProps:E}=Jf({isDisabled:!r,onFocusWithinChange:d});return{isFocused:s,isFocusVisible:a,focusProps:r?E:h}}var nd=Object.defineProperty,rd=(e,t,n)=>t in e?nd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zr=(e,t,n)=>(rd(e,typeof t!="symbol"?t+"":t,n),n);let od=class{constructor(){Zr(this,"current",this.detect()),Zr(this,"handoffState","pending"),Zr(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"}},Gt=new od;function Xn(e){var t,n;return Gt.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function Ya(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function pt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ya(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=pt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function En(){let[e]=C.useState(pt);return C.useEffect(()=>()=>e.dispose(),[e]),e}let we=(e,t)=>{Gt.isServer?C.useEffect(e,t):C.useLayoutEffect(e,t)};function Rn(e){let t=C.useRef(e);return we(()=>{t.current=e},[e]),t}let le=function(e){let t=Rn(e);return C.useCallback((...n)=>t.current(...n),[t])};function sd(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function id(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ad({disabled:e=!1}={}){let t=C.useRef(null),[n,r]=C.useState(!1),o=En(),s=le(()=>{t.current=null,r(!1),o.dispose()}),i=le(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Xn(a.currentTarget);o.addEventListener(l,"pointerup",s,!1),o.addEventListener(l,"pointermove",u=>{if(t.current){let d=sd(u);r(id(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}let ld=C.createContext(void 0);function ns(){return C.useContext(ld)}function oi(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ft(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=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(r,ft),r}var No=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(No||{}),cd=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(cd||{});function Qe(){let e=fd();return C.useCallback(t=>ud({mergeRefs:e,...t}),[e])}function ud({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:a}){a=a??dd;let l=Xa(t,e);if(s)return dr(l,n,r,i,a);let u=o??0;if(u&2){let{static:d=!1,...h}=l;if(d)return dr(h,n,r,i,a)}if(u&1){let{unmount:d=!0,...h}=l;return ft(d?0:1,{0(){return null},1(){return dr({...h,hidden:!0,style:{display:"none"}},n,r,i,a)}})}return dr(l,n,r,i,a)}function dr(e,t={},n,r,o){let{as:s=n,children:i,refName:a="ref",...l}=eo(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let E=!1,p=[];for(let[g,y]of Object.entries(t))typeof y=="boolean"&&(E=!0),y===!0&&p.push(g.replace(/([A-Z])/g,O=>`-${O.toLowerCase()}`));if(E){h["data-headlessui-state"]=p.join(" ");for(let g of p)h[`data-${g}`]=""}}if(s===C.Fragment&&(Object.keys(It(l)).length>0||Object.keys(It(h)).length>0))if(!C.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(It(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(It(l)).concat(Object.keys(It(h))).map(E=>` - ${E}`).join(`
|
|
38
38
|
`),"","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(E=>` - ${E}`).join(`
|
|
39
39
|
`)].join(`
|
|
40
40
|
`))}else{let E=d.props,p=E==null?void 0:E.className,g=typeof p=="function"?(...N)=>oi(p(...N),l.className):oi(p,l.className),y=g?{className:g}:{},O=Xa(d.props,It(eo(l,["ref"])));for(let N in h)N in O&&delete h[N];return C.cloneElement(d,Object.assign({},O,h,u,{ref:o(hd(d),u.ref)},y))}return C.createElement(s,Object.assign({},eo(l,["ref"]),s!==C.Fragment&&u,s!==C.Fragment&&h),d)}function fd(){let e=C.useRef([]),t=C.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function dd(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Xa(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let a of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...s)}}});return t}function Ja(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function Ke(e){var t;return Object.assign(C.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function It(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function eo(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function hd(e){return C.version.split(".")[0]>="19"?e.props.ref:e.ref}function pd(e,t,n){let[r,o]=C.useState(n),s=e!==void 0,i=C.useRef(s),a=C.useRef(!1),l=C.useRef(!1);return s&&!i.current&&!a.current?(a.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&&!l.current&&(l.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:r,le(u=>(s||o(u),t==null?void 0:t(u)))]}function md(e){let[t]=C.useState(e);return t}function Za(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))tl(n,el(t,r),o);return n}function el(e,t){return e?e+"["+t+"]":t}function tl(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())tl(e,el(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Za(n,t,e)}function gd(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.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}(n=r.requestSubmit)==null||n.call(r)}}let bd="span";var rs=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(rs||{});function vd(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&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",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Qe()({ourProps:s,theirProps:o,slot:{},defaultTag:bd,name:"Hidden"})}let nl=Ke(vd),yd=C.createContext(null);function wd({children:e}){let t=C.useContext(yd);if(!t)return C.createElement(C.Fragment,null,e);let{target:n}=t;return n?nt.createPortal(C.createElement(C.Fragment,null,e),n):null}function xd({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=C.useState(null),a=En();return C.useEffect(()=>{if(r&&s)return a.addEventListener(s,"reset",r)},[s,t,r]),C.createElement(wd,null,C.createElement(Ed,{setForm:i,formId:t}),Za(e).map(([l,u])=>C.createElement(nl,{features:rs.Hidden,...It({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:u,...o})})))}function Ed({setForm:e,formId:t}){return C.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:C.createElement(nl,{features:rs.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Rd=C.createContext(void 0);function rl(){return C.useContext(Rd)}function Sd(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Cd(n)?!1:r}function Cd(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let ol=Symbol();function kd(e,t=!0){return Object.assign(e,{[ol]:t})}function st(...e){let t=C.useRef(e);C.useEffect(()=>{t.current=e},[e]);let n=le(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[ol]))?void 0:n}let os=C.createContext(null);os.displayName="DescriptionContext";function sl(){let e=C.useContext(os);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,sl),t}return e}function Ad(){var e,t;return(t=(e=C.useContext(os))==null?void 0:e.value)!=null?t:void 0}let Od="p";function Td(e,t){let n=C.useId(),r=ns(),{id:o=`headlessui-description-${n}`,...s}=e,i=sl(),a=st(t);we(()=>i.register(o),[o,i.register]);let l=r||!1,u=C.useMemo(()=>({...i.slot,disabled:l}),[i.slot,l]),d={ref:a,...i.props,id:o};return Qe()({ourProps:d,theirProps:s,slot:u,defaultTag:Od,name:i.name||"Description"})}let Fd=Ke(Td);Object.assign(Fd,{});var ye=(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))(ye||{});let Dr=C.createContext(null);Dr.displayName="LabelContext";function il(){let e=C.useContext(Dr);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,il),t}return e}function al(e){var t,n,r;let o=(n=(t=C.useContext(Dr))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Pd({inherit:e=!1}={}){let t=al(),[n,r]=C.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,C.useMemo(()=>function(s){let i=le(l=>(r(u=>[...u,l]),()=>r(u=>{let d=u.slice(),h=d.indexOf(l);return h!==-1&&d.splice(h,1),d}))),a=C.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 C.createElement(Dr.Provider,{value:a},s.children)},[r])]}let Md="label";function Id(e,t){var n;let r=C.useId(),o=il(),s=rl(),i=ns(),{id:a=`headlessui-label-${r}`,htmlFor:l=s??((n=o.props)==null?void 0:n.htmlFor),passive:u=!1,...d}=e,h=st(t);we(()=>o.register(a),[a,o.register]);let E=le(O=>{let N=O.currentTarget;if(N instanceof HTMLLabelElement&&O.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(O),N instanceof HTMLLabelElement){let x=document.getElementById(N.htmlFor);if(x){let I=x.getAttribute("disabled");if(I==="true"||I==="")return;let B=x.getAttribute("aria-disabled");if(B==="true"||B==="")return;(x instanceof HTMLInputElement&&(x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),p=i||!1,g=C.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),y={ref:h,...o.props,id:a,htmlFor:l,onClick:E};return u&&("onClick"in y&&(delete y.htmlFor,delete y.onClick),"onClick"in d&&delete d.onClick),Qe()({ourProps:y,theirProps:d,slot:g,defaultTag:l?Md:"div",name:o.name||"Label"})}let Dd=Ke(Id),ll=Object.assign(Dd,{});function Nd(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 Ld(e=Nd){return C.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function $d(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function jd(e,t=!1){let[n,r]=C.useReducer(()=>({}),{}),o=C.useMemo(()=>$d(e),[e,n]);return we(()=>{if(!e)return;let s=new ResizeObserver(r);return s.observe(e),()=>{s.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Bd=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function cl(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(a=>a()))}}}function ul(e){return C.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Hd=new Bd(()=>cl(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function ss(e,t){let n=Hd.get(t),r=C.useId(),o=ul(n);if(we(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let s=o.indexOf(r),i=o.length;return s===-1&&(s=i,i+=1),s===i-1}let Lo=new Map,Nn=new Map;function si(e){var t;let n=(t=Nn.get(e))!=null?t:0;return Nn.set(e,n+1),n!==0?()=>ii(e):(Lo.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ii(e))}function ii(e){var t;let n=(t=Nn.get(e))!=null?t:1;if(n===1?Nn.delete(e):Nn.set(e,n-1),n!==1)return;let r=Lo.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Lo.delete(e))}function Ud(e,{allowed:t,disallowed:n}={}){let r=ss(e,"inert-others");we(()=>{var o,s;if(!r)return;let i=pt();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&i.add(si(l));let a=(s=t==null?void 0:t())!=null?s:[];for(let l of a){if(!l)continue;let u=Xn(l);if(!u)continue;let d=l.parentElement;for(;d&&d!==u.body;){for(let h of d.children)a.some(E=>h.contains(E))||i.add(si(h));d=d.parentElement}}return i.dispose},[r,t,n])}function Wd(e,t,n){let r=Rn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});C.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let s=pt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let $o=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),qd=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var jo=(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))(jo||{}),zd=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(zd||{}),Gd=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Gd||{});function fl(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($o)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Vd(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(qd)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var is=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(is||{});function dl(e,t=0){var n;return e===((n=Xn(e))==null?void 0:n.body)?!1:ft(t,{0(){return e.matches($o)},1(){let r=e;for(;r!==null;){if(r.matches($o))return!0;r=r.parentElement}return!1}})}var _d=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(_d||{});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 Qd=["textarea","input"].join(",");function Kd(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Qd))!=null?n:!1}function hl(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);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 Yd(e,t){return Xd(fl(),t,{relativeTo:e})}function Xd(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?hl(e):e:t&64?Vd(e):fl(e);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(g=>g!=null&&"current"in g?(g==null?void 0:g.current)===p:g===p))),r=r??s.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+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}:{},d=0,h=i.length,E;do{if(d>=h||d+h<=0)return 0;let p=l+d;if(t&16)p=(p+h)%h;else{if(p<0)return 3;if(p>=h)return 1}E=i[p],E==null||E.focus(u),d+=a}while(E!==s.activeElement);return t&6&&Kd(E)&&E.select(),2}function pl(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Jd(){return/Android/gi.test(window.navigator.userAgent)}function Zd(){return pl()||Jd()}function Tn(e,t,n,r){let o=Rn(n);C.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function eh(e,t,n,r){let o=Rn(n);C.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const ai=30;function th(e,t,n){let r=ss(e,"outside-click"),o=Rn(n),s=C.useCallback(function(l,u){if(l.defaultPrevented)return;let d=u(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let h=function E(p){return typeof p=="function"?E(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let E of h)if(E!==null&&(E.contains(d)||l.composed&&l.composedPath().includes(E)))return;return!dl(d,is.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o,t]),i=C.useRef(null);Tn(r,"pointerdown",l=>{var u,d;i.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Tn(r,"mousedown",l=>{var u,d;i.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Tn(r,"click",l=>{Zd()||i.current&&(s(l,()=>i.current),i.current=null)},!0);let a=C.useRef({x:0,y:0});Tn(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),Tn(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-a.current.x)>=ai||Math.abs(u.y-a.current.y)>=ai))return s(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),eh(r,"blur",l=>s(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Bo(...e){return C.useMemo(()=>Xn(...e),[...e])}function nh(e,t){return C.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function rh(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function oh(){return pl()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(s=>s()).some(s=>s.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=pt();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),d=e.querySelector(u);d&&!r(d)&&(i=d)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;s!==l&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function sh(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ih(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Lt=cl(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:pt(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:ih(n)},o=[oh(),rh(),sh()];o.forEach(({before:s})=>s==null?void 0:s(r)),o.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Lt.subscribe(()=>{let e=Lt.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Lt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Lt.dispatch("TEARDOWN",n)}});function ah(e,t,n=()=>({containers:[]})){let r=ul(Lt),o=t?r.get(t):void 0,s=o?o.count>0:!1;return we(()=>{if(!(!t||!e))return Lt.dispatch("PUSH",t,n),()=>Lt.dispatch("POP",t,n)},[e,t]),s}function lh(e,t,n=()=>[document.body]){let r=ss(e,"scroll-lock");ah(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function li(e){return[e.screenX,e.screenY]}function ch(){let e=C.useRef([-1,-1]);return{wasMoved(t){let n=li(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=li(t)}}}function uh(e=0){let[t,n]=C.useState(e),r=C.useCallback(l=>n(l),[t]),o=C.useCallback(l=>n(u=>u|l),[t]),s=C.useCallback(l=>(t&l)===l,[t]),i=C.useCallback(l=>n(u=>u&~l),[n]),a=C.useCallback(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:a}}var ci,ui;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ci=process==null?void 0:process.env)==null?void 0:ci.NODE_ENV)==="test"&&typeof((ui=Element==null?void 0:Element.prototype)==null?void 0:ui.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(`
|