p.length-2?p.length-1:e.length-l;n>0;n--)if(void 0!==p[n])for(i=0;i0&&kn)s.push(e);else{for(;n>=i&&!c||c&&i1)throw new r.Exception("Uncaught Syntax error");return o[0].value>1e15?"Infinity":parseFloat(o[0].value.toFixed(15))},r.eval=function(e,t,n){return void 0===t?this.lex(e).toPostfix().postfixEval():void 0!==n?this.lex(e,t).toPostfix().postfixEval(n):void 0!==t.length?this.lex(e,t).toPostfix().postfixEval():this.lex(e).toPostfix().postfixEval(t)},e.exports=r},38617:function(e,t,n){"use strict";n.d(t,{F:function(){return u},f:function(){return c}});var r=n(2784);let i=["light","dark"],o="(prefers-color-scheme: dark)",a="undefined"==typeof window,s=(0,r.createContext)(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!==(e=(0,r.useContext)(s))&&void 0!==e?e:l},c=e=>(0,r.useContext)(s)?r.createElement(r.Fragment,null,e.children):r.createElement(f,e),d=["light","dark"],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=d,defaultTheme:c=n?"system":"light",attribute:f="data-theme",value:g,children:y,nonce:x})=>{let[b,w]=(0,r.useState)(()=>p(l,c)),[E,j]=(0,r.useState)(()=>p(l)),k=g?Object.values(g):u,S=(0,r.useCallback)(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=v());let o=g?g[r]:r,s=t?m():null,l=document.documentElement;if("class"===f?(l.classList.remove(...k),o&&l.classList.add(o)):o?l.setAttribute(f,o):l.removeAttribute(f),a){let e=i.includes(c)?c:null,t=i.includes(r)?r:e;l.style.colorScheme=t}null==s||s()},[]),_=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(l,e)}catch(e){}},[e]),O=(0,r.useCallback)(t=>{let r=v(t);j(r),"system"===b&&n&&!e&&S("system")},[b,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(o);return e.addListener(O),O(e),()=>e.removeListener(O)},[O]),(0,r.useEffect)(()=>{let e=e=>{e.key===l&&_(e.newValue||c)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[_]),(0,r.useEffect)(()=>{S(null!=e?e:b)},[e,b]);let C=(0,r.useMemo)(()=>({theme:b,setTheme:_,forcedTheme:e,resolvedTheme:"system"===b?E:b,themes:n?[...u,"system"]:u,systemTheme:n?E:void 0}),[b,_,e,E,n,u]);return r.createElement(s.Provider,{value:C},r.createElement(h,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:a,storageKey:l,themes:u,defaultTheme:c,attribute:f,value:g,children:y,attrs:k,nonce:x}),y)},h=(0,r.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:a,enableColorScheme:s,defaultTheme:l,value:u,attrs:c,nonce:d})=>{let f="system"===l,h="class"===n?`var d=document.documentElement,c=d.classList;c.remove(${c.map(e=>`'${e}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=s?i.includes(l)&&l?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${l}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(e,t=!1,r=!0)=>{let o=u?u[e]:e,a=t?e+"|| ''":`'${o}'`,l="";return s&&r&&!t&&i.includes(e)&&(l+=`d.style.colorScheme = '${e}';`),"class"===n?l+=t||o?`c.add(${a})`:"null":o&&(l+=`d[s](n,${a})`),l},v=e?`!function(){${h}${m(e)}}()`:a?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${o}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}${f?"":"else{"+m(l,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}else{${m(l,!1,!1)};}${p}}catch(t){}}();`;return r.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:v}})},()=>!0),p=(e,t)=>{let n;if(!a){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},m=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},v=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light")},86570:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(76133)}])},4941:function(e,t,n){"use strict";n.d(t,{Ul:function(){return s},WD:function(){return l},fu:function(){return c},o4:function(){return u}});var r=n(52322),i=n(79798),o=n(82851),a=n(99182);function s(e){let{currentPage:t,parentPage:n,commandPage:s,className:l,...u}=e,c=(0,a.U8)(e=>e.search);if((null==n?void 0:n.namespace)===(null==t?void 0:t.namespace)&&!c)return(0,r.jsx)(a.mY.Item,{className:(0,o.cx)((0,i.Vkc)(),"group",l),value:"".concat(null==s?void 0:s.label," ").concat(u.children.toString()),...u})}function l(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,a.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(a.mY.Item,{className:(0,o.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function u(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,a.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||!t||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(a.mY.Item,{className:(0,o.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function c(e){let{heading:t,currentPage:n,commandPage:o,...s}=e,l=(0,a.U8)(e=>e.search);return(0,r.jsx)(a.mY.Group,{heading:l&&(null==n?void 0:n.namespace)!==o.namespace&&(0,r.jsx)(i.__J,{className:"px-1",size:"12",children:o.label}),...s})}n(2784)},3639:function(e,t,n){"use strict";n.d(t,{F:function(){return y}});var r=n(52322),i=n(4941);let o={namespace:"contracts/filterStatus",label:"Contracts filter by status"},a=[{id:"filterStatusActive",value:"active",label:"Contract is active"},{id:"filterStatusSuccessful",value:"successful",label:"Contract was successful"},{id:"filterStatusPending",value:"pending",label:"Contract is pending"},{id:"filterStatusRejected",value:"rejected",label:"Contract was rejected"},{id:"filterStatusFailed",value:"failed",label:"Contract has failed"}];function s(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:o,children:a.map(e=>(0,r.jsx)(i.WD,{currentPage:n,commandPage:o,onSelect:()=>{t(e)},children:e.label},e.id+e.value))})}var l=n(22515),u=n(734);let c={namespace:"contracts/filterAddress",label:"Contracts filter by ID"};function d(e){let{select:t,currentPage:n}=e,{openDialog:o}=(0,l.Rh)(),a=(0,u.O)("");return(0,r.jsx)(i.fu,{currentPage:n,commandPage:c,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:c,onSelect:()=>{t(),o("contractsFilterContractId")},children:a.label})})}function f(e){let{select:t,currentPage:n,parentPage:o,commandPage:a}=e,{openDialog:s}=(0,l.Rh)();return(0,r.jsx)(i.Ul,{currentPage:n,parentPage:o,commandPage:a,onSelect:()=>{t(),s("contractsFilterContractId")},children:c.label})}function h(e){let{currentPage:t,select:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s,{currentPage:t,select:n}),(0,r.jsx)(d,{currentPage:t,select:n})]})}let p={namespace:"contracts",label:"Contracts"};function m(e){let{currentPage:t,parentPage:n,pushPage:a,select:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:p,onSelect:()=>{a(o)},children:o.label}),(0,r.jsx)(f,{currentPage:t,parentPage:n,commandPage:p,select:s})]})}var v=n(92838),g=n(2784);function y(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,{setFilter:s}=(0,v.G)(),l=(0,g.useCallback)(e=>{o&&o(),e&&s(e),a&&a()},[s,o,a]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m,{parentPage:n,currentPage:t,pushPage:i,select:l}),(0,r.jsx)(h,{currentPage:t,select:l})]})}},71930:function(e,t,n){"use strict";n.d(t,{_:function(){return i},h:function(){return o}});var r=n(27444);let i={home:"/",volumes:{index:"/volumes"},contracts:{index:"/contracts"},config:{index:"/config",host:"/config#host",pricing:"/config#pricing",dns:"/config#dns",bandwidth:"/config#bandwidth",registry:"/config#registry",accounts:"/config#accounts"},wallet:{view:"/wallet"},node:{index:"/node",txPool:"/node/txpool",peers:"/node/peers"},login:"/login"},o=r.dk},99957:function(e,t,n){"use strict";n.d(t,{iV:function(){return w},ZR:function(){return b}});var r=n(52322),i=n(2784),o=n(79798),a=n(27444);let s=[{value:"",label:"Off"},{value:"route53",label:"Route 53"},{value:"noip",label:"No-IP"},{value:"duckdns",label:"Duck DNS"},{value:"cloudflare",label:"Cloudflare"}],l={acceptingContracts:!1,netAddress:"",maxContractDuration:void 0,contractPrice:void 0,baseRPCPrice:void 0,sectorAccessPrice:void 0,collateralMultiplier:void 0,maxCollateral:void 0,storagePrice:void 0,egressPrice:void 0,ingressPrice:void 0,priceTableValidity:void 0,maxRegistryEntries:void 0,accountExpiry:void 0,maxAccountBalance:void 0,ingressLimit:void 0,egressLimit:void 0,dnsProvider:"",dnsIpv4:!1,dnsIpv6:!1,dnsDuckDnsToken:"",dnsNoIpEmail:"",dnsNoIpPassword:"",dnsAwsId:"",dnsAwsSecret:"",dnsAwsZoneId:"",dnsCloudflareToken:"",dnsCloudflareZoneId:""};var u=n(25205),c=n(6391),d=n.n(c),f=n(94977);function h(e,t){return new(d())(12960).times(e).div((0,u.S5)(1)).times(t)}function p(e,t){return t?new(d())(new(d())(e).div(t.sc.usd).div(10).toFixed(0)).times(10):void 0}var m=n(63955),v=n(92762),g=n(95753),y=n(47025);let x=(0,i.createContext)({}),b=()=>(0,i.useContext)(x);function w(e){let{children:t}=e,n=function(){let e=(0,a.rV)({standalone:"configSettingsForm",config:{swr:{refreshInterval:(0,o.sWj)(1)}}}),t=(0,a.Te)(),n=(0,a.uo)({disabled:!e.data||!e.data.ddns.provider,config:{swr:{revalidateOnFocus:!1,errorRetryCount:0}}}),[c,x]=(0,v.Z)("v0/config/showAdvanced",{defaultValue:!1}),b=(0,m.cI)({mode:"all",defaultValues:l}),w=b.watch("storagePrice"),E=b.watch("collateralMultiplier"),j=(0,i.useCallback)(e=>{let t;let n=(t=null,"duckdns"===e.ddns.provider&&(t={dnsDuckDnsToken:e.ddns.options.token}),"noip"===e.ddns.provider&&(t={dnsNoIpEmail:e.ddns.options.email,dnsNoIpPassword:e.ddns.options.password}),"route53"===e.ddns.provider&&(t={dnsAwsId:e.ddns.options.id,dnsAwsSecret:e.ddns.options.secret,dnsAwsZoneId:e.ddns.options.zoneID}),"cloudflare"===e.ddns.provider&&(t={dnsCloudflareToken:e.ddns.options.token,dnsCloudflareZoneId:e.ddns.options.zoneID}),{acceptingContracts:e.acceptingContracts,netAddress:e.netAddress,maxContractDuration:new(d())(e.maxContractDuration).div((0,u.S5)(1)),contractPrice:(0,u.ll)(e.contractPrice,6),baseRPCPrice:(0,u.ll)((0,f.sS)(e.baseRPCPrice),6),sectorAccessPrice:(0,u.ll)((0,f.nS)(e.sectorAccessPrice),6),collateralMultiplier:new(d())(e.collateralMultiplier),maxCollateral:(0,u.ll)(e.maxCollateral,6),storagePrice:(0,u.ll)((0,f.SY)(e.storagePrice),6),egressPrice:(0,u.ll)((0,f.B1)(e.egressPrice),6),ingressPrice:(0,u.ll)((0,f.dK)(e.ingressPrice),6),priceTableValidity:new(d())(e.priceTableValidity).div(1e9).div(60),maxRegistryEntries:new(d())(e.maxRegistryEntries),accountExpiry:new(d())(e.accountExpiry).div(1e9).div(86400),maxAccountBalance:(0,u.ll)(e.maxAccountBalance,6),ingressLimit:(0,u.BT)(new(d())(e.ingressLimit)),egressLimit:(0,u.BT)(new(d())(e.egressLimit)),dnsProvider:e.ddns.provider,dnsIpv4:e.ddns.ipv4,dnsIpv6:e.ddns.ipv6,...t});return b.reset(n),n},[b]),k=(0,i.useMemo)(()=>[e.data],[e.data]),S=(0,i.useCallback)(()=>e.data?j(e.data):null,[j,e.data]),[_,O]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(!_){let e=S();e&&O(!0)}},[_,S]);let C=(0,i.useCallback)(async()=>{let t=await e.mutate();t?(j(t),await n.mutate()):(0,o.OHV)("Error fetching settings.")},[e,j,n]),M=(0,i.useCallback)(async n=>{if(e.data)try{var r;let i;let a={};c||(a.maxCollateral=h(n.storagePrice,n.collateralMultiplier));let s={...n,...a},l=await t.patch({payload:(r=e.data,i=null,"duckdns"===s.dnsProvider&&(i={token:s.dnsDuckDnsToken}),"noip"===s.dnsProvider&&(i={email:s.dnsNoIpEmail,password:s.dnsNoIpPassword}),"route53"===s.dnsProvider&&(i={id:s.dnsAwsId,secret:s.dnsAwsSecret,zoneID:s.dnsAwsZoneId}),"cloudflare"===s.dnsProvider&&(i={token:s.dnsCloudflareToken,zoneID:s.dnsCloudflareZoneId}),{...r,acceptingContracts:s.acceptingContracts,netAddress:s.netAddress,maxContractDuration:Number(s.maxContractDuration.times((0,u.S5)(1)).toFixed(0)),contractPrice:(0,u.qN)(s.contractPrice).toString(),baseRPCPrice:s.baseRPCPrice.div((0,u.ll)((0,f.sS)(1))).toFixed(0),sectorAccessPrice:s.sectorAccessPrice.div((0,u.ll)((0,f.nS)(1))).toFixed(0),collateralMultiplier:s.collateralMultiplier.toNumber(),maxCollateral:(0,u.qN)(s.maxCollateral).toString(),storagePrice:s.storagePrice.div((0,u.ll)((0,f.SY)(1))).toFixed(0),egressPrice:s.egressPrice.div((0,u.ll)((0,f.B1)(1))).toFixed(0),ingressPrice:s.ingressPrice.div((0,u.ll)((0,f.dK)(1))).toFixed(0),priceTableValidity:Number(s.priceTableValidity.times(60).times(1e9).toFixed(0)),maxRegistryEntries:Number(s.maxRegistryEntries.toFixed(0)),accountExpiry:Number(s.accountExpiry.times(86400).times(1e9).toFixed(0)),maxAccountBalance:(0,u.qN)(s.maxAccountBalance).toString(),ingressLimit:Number((0,u.Y)(s.ingressLimit).toFixed(0)),egressLimit:Number((0,u.Y)(s.egressLimit).toFixed(0)),ddns:{...null==r?void 0:r.ddns,provider:s.dnsProvider,ipv4:s.dnsIpv4,ipv6:s.dnsIpv6,options:i}})});if(l.error)throw Error(l.error);b.formState.dirtyFields.netAddress?(0,o.OPV)("Settings have been saved. Address has changed, make sure to re-announce the host.",{duration:2e4}):(0,o.OPV)("Settings have been saved."),await C()}catch(e){(0,o.OHV)(e.message),console.log(e)}},[b,c,e,t,C]),A=(0,y.BW)(),T=(0,i.useMemo)(()=>{var e;return function(e){let{showAdvanced:t,storageTBMonth:n,collateralMultiplier:i,rates:o}=e;return{acceptingContracts:{type:"boolean",category:"host",title:"Accepting contracts",description:(0,r.jsx)(r.Fragment,{children:"Whether or not the host is accepting contracts."}),validation:{}},netAddress:{type:"text",category:"host",title:"Address",description:(0,r.jsx)(r.Fragment,{children:"The network address of the host."}),placeholder:"my.host.com:9882",validation:{required:"required"}},maxContractDuration:{type:"number",category:"host",title:"Maximum contract duration",units:"months",decimalsLimit:2,suggestion:new(d())(6),suggestionTip:"The default maximum duration is 6 months.",description:(0,r.jsx)(r.Fragment,{children:"The maximum contract duration that the host will accept."}),hidden:!t,validation:{required:"required",validate:{min:e=>new(d())(e).gte((0,u.E6)(4320))||"must be at least 1 month"}}},storagePrice:{title:"Storage price",type:"siacoin",category:"pricing",units:"SC/TB/month",decimalsLimitSc:6,suggestion:o?p(1,o):void 0,suggestionTip:"The suggested storage price in siacoins per TB per month.",description:(0,r.jsx)(r.Fragment,{children:"The host's storage price in siacoins per TB per month."}),validation:{required:"required"}},egressPrice:{title:"Egress price",type:"siacoin",category:"pricing",units:"SC/TB",decimalsLimitSc:6,suggestion:o?p(10,o):void 0,suggestionTip:"The suggested egress price in siacoins for egress per TB.",description:(0,r.jsx)(r.Fragment,{children:"The host's egress price in siacoins per TB."}),validation:{required:"required"}},ingressPrice:{title:"Ingress price",type:"siacoin",category:"pricing",units:"SC/TB",suggestion:o?p(.05,o):void 0,suggestionTip:"The suggested ingress price in siacoins per TB.",decimalsLimitSc:6,description:(0,r.jsx)(r.Fragment,{children:"The host's ingress price in siacoins per TB."}),validation:{required:"required"}},collateralMultiplier:{title:"Collateral multiplier",type:"number",category:"pricing",units:"* storage price",placeholder:"2",decimalsLimit:1,description:(0,r.jsx)(r.Fragment,{children:"The host's target collateral as a multiple of storage price."}),suggestion:new(d())(2),suggestionTip:"The default multiplier is 2x the storage price.",validation:{required:"required"}},maxCollateral:{title:"Maximum collateral",type:"siacoin",category:"pricing",decimalsLimitSc:6,suggestion:n&&i?h(n,i):void 0,suggestionTip:"The suggested maximum collateral.",description:(0,r.jsx)(r.Fragment,{children:"The host's maximum collateral in siacoins."}),hidden:!t,validation:{required:"required"}},contractPrice:{title:"Contract price",type:"siacoin",category:"pricing",decimalsLimitSc:6,suggestionTip:"The suggested contract price.",tipsDecimalsLimitSc:1,suggestion:new(d())(.2),description:(0,r.jsx)(r.Fragment,{children:"The host's contract price in siacoins."}),hidden:!t,validation:{required:"required"}},baseRPCPrice:{title:"Base RPC price",type:"siacoin",category:"pricing",units:"SC/million",suggestion:new(d())(1),suggestionTip:"The suggested base RPC price in siacoins per million calls.",decimalsLimitSc:6,description:(0,r.jsx)(r.Fragment,{children:"The host's base RPC price in siacoins per million calls."}),hidden:!t,validation:{required:"required"}},sectorAccessPrice:{title:"Sector access price",type:"siacoin",category:"pricing",units:"SC/million",decimalsLimitSc:6,suggestion:new(d())(1),suggestionTip:"The suggested sector access price in siacoins per million sectors.",description:(0,r.jsx)(r.Fragment,{children:"The host's sector access price in siacoins per million sectors."}),hidden:!t,validation:{required:"required"}},priceTableValidity:{title:"Price table validity",type:"number",category:"pricing",units:"minutes",suggestion:new(d())(30),suggestionTip:"The suggested price table validity.",description:(0,r.jsx)(r.Fragment,{children:"How long a renter's registered price table remains valid."}),hidden:!t,validation:{required:"required"}},maxRegistryEntries:{title:"Maximum registry size",type:"number",category:"registry",units:"entries",suggestion:new(d())(1e3),suggestionTip:"The suggested maximum registry size.",decimalsLimit:0,description:(0,r.jsx)(r.Fragment,{children:"The maximum number of registry entries that the host will store. Each registry entry is up to 113 bytes."}),hidden:!t,validation:{required:"required"}},accountExpiry:{title:"Expiry",type:"number",category:"RHP3",units:"days",suggestion:new(d())(30),suggestionTip:"The suggested account expiry.",description:(0,r.jsx)(r.Fragment,{children:"How long a renter's ephemeral accounts are inactive before the host prunes them and recovers the remaining funds."}),hidden:!t,validation:{required:"required",validate:{min:e=>new(d())(e).gte(7)||"must be at least 1 week"}}},maxAccountBalance:{title:"Maximum balance",type:"siacoin",category:"RHP3",suggestion:new(d())(10),suggestionTip:"The suggested maximum account balance.",description:(0,r.jsx)(r.Fragment,{children:"Maximum balance a renter's ephemeral account can have. When the limit is reached, deposits are rejected until some of the funds have been spent."}),hidden:!t,validation:{required:"required",validate:{min:e=>new(d())(e).gte(1)||"must be at least 1 SC"}}},ingressLimit:{title:"Ingress limit",type:"number",category:"bandwidth",units:"MB/second",description:(0,r.jsx)(r.Fragment,{children:"The maximum amount of ingress bandwidth traffic in MB per second."}),validation:{required:"required"}},egressLimit:{title:"Egress limit",type:"number",category:"bandwidth",units:"MB/second",description:(0,r.jsx)(r.Fragment,{children:"The maximum amount of egress bandwidth traffic in MB per second."}),validation:{required:"required"}},dnsProvider:{title:"Dynamic DNS Provider",type:"select",category:"DNS",options:s,description:(0,r.jsx)(r.Fragment,{children:"Enable dynamic DNS with one of the supported providers."}),validation:{validate:e=>!!s.find(t=>t.value===e)||"must be one of supported providers"}},dnsIpv4:{title:"IPv4",type:"boolean",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"Whether IPv4 is enabled."}),show:e=>!!e.dnsProvider,validation:{validate:(e,t)=>!t.dnsProvider||!!(e||t.dnsIpv6)||"at least one of IPv4 and IPv6 must be enabled"},trigger:["dnsIpv6"]},dnsIpv6:{type:"boolean",title:"IPv6",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"Whether IPv6 is enabled."}),show:e=>!!e.dnsProvider,validation:{validate:(e,t)=>!t.dnsProvider||!!(e||t.dnsIpv4)||"at least one of IPv4 and IPv6 must be enabled"},trigger:["dnsIpv4"]},dnsDuckDnsToken:{type:"text",title:"Token",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"DuckDNS token."}),show:e=>"duckdns"===e.dnsProvider,validation:{validate:(e,t)=>"duckdns"!==t.dnsProvider||!!e||"required"}},dnsNoIpEmail:{type:"text",title:"Email",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"No-IP email."}),show:e=>"noip"===e.dnsProvider,validation:{validate:(e,t)=>"noip"!==t.dnsProvider||!!e||"required"}},dnsNoIpPassword:{type:"password",title:"Password",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"No-IP password."}),show:e=>"noip"===e.dnsProvider,validation:{validate:(e,t)=>"noip"!==t.dnsProvider||!!e||"required"}},dnsAwsId:{type:"text",title:"ID",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"AWS Route53 ID."}),show:e=>"route53"===e.dnsProvider,validation:{validate:(e,t)=>"route53"!==t.dnsProvider||!!e||"required"}},dnsAwsSecret:{type:"password",title:"Secret",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"AWS Route53 secret."}),show:e=>"route53"===e.dnsProvider,validation:{validate:(e,t)=>"route53"!==t.dnsProvider||!!e||"required"}},dnsAwsZoneId:{type:"text",title:"Zone ID",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"AWS Route53 zone ID."}),show:e=>"route53"===e.dnsProvider,validation:{validate:(e,t)=>"route53"!==t.dnsProvider||!!e||"required"}},dnsCloudflareToken:{type:"text",title:"Token",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"Cloudflare token."}),show:e=>"cloudflare"===e.dnsProvider,validation:{validate:(e,t)=>"cloudflare"!==t.dnsProvider||!!e||"required"}},dnsCloudflareZoneId:{type:"text",title:"Zone ID",category:"DNS",description:(0,r.jsx)(r.Fragment,{children:"Cloudflare zone ID."}),show:e=>"cloudflare"===e.dnsProvider,validation:{validate:(e,t)=>"cloudflare"!==t.dnsProvider||!!e||"required"}}}}({showAdvanced:c,storageTBMonth:w,collateralMultiplier:E,rates:null===(e=A.data)||void 0===e?void 0:e.rates})},[c,w,E,A.data]),P=(0,o.WsO)(T),N=(0,i.useMemo)(()=>b.handleSubmit(M,P),[b,M,P]),R=(0,i.useCallback)(()=>{let e=b.getValues(),t=S();if(t)for(let[n,r]of(b.reset(t),Object.entries(e)))b.setValue(n,r,{shouldDirty:!0})},[b,S]),{isUnlockedAndAuthedRoute:D}=(0,g.Hv)();(0,i.useEffect)(()=>{D&&C()},[D]),(0,i.useEffect)(()=>{b.formState.isSubmitting||R()},[b,c,k]);let L=Object.entries(b.formState.dirtyFields).filter(e=>{let[t,n]=e;return!!n}).length;return{fields:T,settings:e,dynDNSCheck:n,changeCount:L,revalidateAndResetFormData:C,form:b,onSubmit:N,showAdvanced:c,setShowAdvanced:x}}();return(0,r.jsx)(x.Provider,{value:n,children:t})}},92838:function(e,t,n){"use strict";n.d(t,{x:function(){return b},G:function(){return x}});var r=n(52322),i=n(79798),o=n(5632),a=n(27444),s=n(2784),l=n(56860),u=n(41775),c=n(25205),d=n(22515);function f(e){let{id:t,status:n,contentProps:o,buttonProps:l}=e,c=(0,a.kr)(),{openDialog:f}=(0,d.Rh)(),h=(0,s.useCallback)(async()=>{let e=await c.put({params:{id:t}});e.error?(0,i.OHV)(e.error):(0,i.OPV)((0,r.jsxs)(r.Fragment,{children:["Integrity check successfully started, depending on contract data size this operation can take a while. Check ",(0,r.jsx)(i.EKh,{children:"hostd"})," ",(0,r.jsx)(i.rUS,{onClick:()=>f("alerts"),children:"alerts"})," for status updates."]}),{duration:12e3})},[t,c,f]),p=["active","pending"].includes(n);return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",...l,children:(0,r.jsx)(u.iG7,{})}),contentProps:{align:"start",...o},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Contract ",t.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsx)(i.ua7,{content:p?"Trigger a data integrity check":"Data integrity check only available for active or pending contracts",children:(0,r.jsx)("div",{children:(0,r.jsxs)(i.Xiv,{disabled:!p,onSelect:()=>h(),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(u.dDl,{})}),"Integrity check"]})})})]})}let h=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:{id:t,status:n}}=e;return(0,r.jsx)(f,{id:t,status:n})}},{id:"contractId",label:"contract ID",category:"general",render:e=>{let{data:t,context:n}=e,{id:o,renewedFrom:a,isRenewedFrom:s,renewedTo:l,isRenewedTo:c}=t;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(i.XxW,{size:"12",value:(0,i.I13)(o),type:"contract",siascanUrl:n.siascanUrl}),s&&(0,r.jsx)(i.ua7,{content:"Renewed from",align:"start",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(i.xvT,{color:"subtle",children:(0,r.jsx)(u.L6f,{className:"scale-75"})}),(0,r.jsx)(i.XxW,{color:"subtle",size:"10",type:"contract",value:(0,i.I13)(a),siascanUrl:n.siascanUrl})]})}),c&&(0,r.jsx)(i.ua7,{content:"Renewed to",align:"start",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(i.xvT,{color:"subtle",children:(0,r.jsx)(u.IRm,{className:"scale-75"})}),(0,r.jsx)(i.XxW,{color:"subtle",size:"10",value:(0,i.I13)(l),type:"contract",siascanUrl:n.siascanUrl})]})})]})}},{id:"status",label:"status",category:"general",render:e=>{let{data:{status:t}}=e;return(0,r.jsx)(i.Cts,{variant:"active"===t?"amber":"failed"===t?"red":"pending"===t?"amber":"rejected"===t?"red":"successful"===t?"green":void 0,children:t})}},{id:"timeline",label:"timeline",category:"time",render:e=>{let{data:t,context:{currentHeight:n,contractsTimeRange:o}}=e,{contractHeightStart:a,contractHeightEnd:s,revision:l,status:u}=t;return(0,r.jsx)("div",{className:"w-[400px]",children:(0,r.jsx)(i.TaT,{currentHeight:n,contractHeightStart:a,contractHeightEnd:"rejected"===u?void 0:s,proofWindowHeightStart:"rejected"===u?void 0:l.windowStart,proofWindowHeightEnd:"rejected"===u?void 0:l.windowEnd,range:o})})}},{id:"contractHeightStart",label:"start date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{contractHeightStart:t},context:{currentHeight:n}}=e;return(0,r.jsx)(i.xvT,{size:"12",children:(0,c.rN)((0,c.jr)(n,t))})}},{id:"contractHeightEnd",label:"expiration date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{contractHeightEnd:t},context:{currentHeight:n}}=e;return(0,r.jsx)(i.xvT,{size:"12",children:(0,c.rN)((0,c.jr)(n,t))})}},{id:"payoutHeight",label:"payout date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{payoutHeight:t},context:{currentHeight:n}}=e;return(0,r.jsx)(i.xvT,{size:"12",children:(0,c.rN)((0,c.jr)(n,t))})}},{id:"filesize",label:"data size",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{revision:{filesize:t}}}=e;return(0,r.jsx)(i.m2c,{size:"12",value:t,variant:"value",format:e=>(0,c.vW)(e.toNumber())})}},{id:"fileMerkleRoot",label:"merkle root",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{revision:{fileMerkleRoot:t}}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:(0,i.I13)(t)})}},{id:"payout",label:"payout",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{revision:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.payout})}},{id:"remainingRenterFunds",label:"remaining renter funds",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{revision:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.remainingRenterFunds})}},{id:"lockedCollateral",label:"locked collateral",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{lockedCollateral:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t})}},{id:"usageRiskedCollateral",label:"risked collateral",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{usage:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.riskedCollateral})}},{id:"usageTotal",label:"total usage",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{usage:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.total})}},{id:"usageStorage",label:"storage usage",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{usage:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.storage})}},{id:"usageIngress",label:"ingress usage",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{usage:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.ingress})}},{id:"usageEgress",label:"egress usage",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{usage:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.egress})}},{id:"usageAccountFunding",label:"account funding usage",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{usage:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.accountFunding})}},{id:"usageRpc",label:"RPC usage",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{usage:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.rpc})}}].map(e=>({...e,..."financial"===e.category?{icon:(0,r.jsx)(u.dZ8,{className:"relative opacity-50 scale-75"}),label:e.label,tip:"financial: ".concat(e.label)}:{label:e.label,tip:e.label}}));var p=n(6391),m=n.n(p),v=n(25573),g=n(90089);let y=(0,s.createContext)({}),x=()=>(0,s.useContext)(y);function b(e){let{children:t}=e,n=function(){var e,t;let n=(0,o.useRouter)(),r=Number(n.query.limit||50),u=Number(n.query.offset||0),{filters:c,setFilter:d,removeFilter:f,removeLastFilter:p,resetFilters:y}=(0,i.Uu5)(),{configurableColumns:x,enabledColumns:b,sortableColumns:w,toggleColumnVisibility:E,setColumnsVisible:j,setColumnsHidden:k,toggleSort:S,setSortDirection:_,setSortField:O,sortField:C,sortDirection:M,resetDefaultColumnVisibility:A}=(0,i.oy6)("hostd/v0/contracts",{columns:h,columnsDefaultVisible:l.gd,sortOptions:l.Fo,defaultSortField:l.nw}),T=(0,a.GP)({payload:{limit:r,offset:u,sortField:null===(e=l.Fo.find(e=>e.id===C))||void 0===e?void 0:e.value,sortDesc:"desc"===M,contractIDs:c.filter(e=>"filterContractId"===e.id).map(e=>e.value),statuses:c.filter(e=>e.id.startsWith("filterStatus")).map(e=>e.value)},config:{swr:{refreshInterval:(0,i.XBW)(60)}}}),P=function(e){let{response:t}=e;return(0,s.useMemo)(()=>{var e;return t.data?(null===(e=t.data.contracts)||void 0===e?void 0:e.map(e=>(function(e){var t;let n=new(m())(e.usage.accountFunding||0),r=new(m())(e.usage.egress||0),i=new(m())(e.usage.ingress||0),o=new(m())(e.usage.riskedCollateral||0),a=new(m())(e.usage.rpc||0),s=new(m())(e.usage.storage||0),l=n.plus(r).plus(i).plus(a).plus(s),u=e.resolutionHeight>0?e.resolutionHeight+144:e.revision.windowEnd+144;return{id:e.revision.parentID,revision:{parentID:e.revision.parentID,unlockConditions:e.revision.unlockConditions,filesize:new(m())(e.revision.filesize||0),fileMerkleRoot:e.revision.fileMerkleRoot,windowStart:e.revision.windowStart,windowEnd:e.revision.windowEnd,payout:new(m())("active"==e.status||e.resolutionHeight>0?e.revision.validProofOutputs[1].value:e.revision.missedProofOutputs[1].value),remainingRenterFunds:new(m())((null===(t=e.revision.validProofOutputs)||void 0===t?void 0:t[0].value)||0),validProofOutputs:e.revision.validProofOutputs,missedProofOutputs:e.revision.missedProofOutputs,unlockHash:e.revision.unlockHash,revisionNumber:e.revision.revisionNumber},usage:{total:l,accountFunding:n,egress:r,ingress:i,riskedCollateral:o,rpc:a,storage:s},lockedCollateral:new(m())(e.lockedCollateral||0),hostSignature:e.hostSignature,renterSignature:e.renterSignature,status:e.status,negotiationHeight:e.negotiationHeight,formationConfirmed:e.formationConfirmed,revisionConfirmed:e.revisionConfirmed,resolutionHeight:e.resolutionHeight,payoutHeight:u,contractHeightStart:e.negotiationHeight,contractHeightEnd:e.revision.windowStart,renewedTo:e.renewedTo,renewedFrom:e.renewedFrom,isRenewedFrom:"fcid:0000000000000000000000000000000000000000000000000000000000000000"!==e.renewedFrom,isRenewedTo:"fcid:0000000000000000000000000000000000000000000000000000000000000000"!==e.renewedTo}})(e)))||[]:null},[t.data])}({response:T}),N=(0,s.useMemo)(()=>h.filter(e=>b.includes(e.id)),[b]),R=T.isValidating,D=T.error,L=(0,i.c2j)(P,R,D,c),{estimatedBlockHeight:F,isSynced:V,nodeBlockHeight:z}=(0,v.n)(),I=V?z:F,{range:Z}=(0,s.useMemo)(()=>(0,i.EJC)(I,P||[]),[I,P]),B=(0,g.B)(),H=(0,s.useMemo)(()=>({contractsTimeRange:Z,currentHeight:I,siascanUrl:B}),[Z,I,B]);return{dataState:L,offset:u,limit:r,cellContext:H,pageCount:(null==P?void 0:P.length)||0,totalCount:null===(t=T.data)||void 0===t?void 0:t.count,columns:N,dataset:P,configurableColumns:x,enabledColumns:b,sortableColumns:w,toggleColumnVisibility:E,setColumnsVisible:j,setColumnsHidden:k,toggleSort:S,setSortDirection:_,setSortField:O,sortField:C,sortDirection:M,resetDefaultColumnVisibility:A,filters:c,setFilter:d,removeFilter:f,removeLastFilter:p,resetFilters:y}}();return(0,r.jsx)(y.Provider,{value:n,children:t})}},56860:function(e,t,n){"use strict";n.d(t,{Fo:function(){return i},gd:function(){return r},nw:function(){return o}});let r=["contractId","status","usageTotal","lockedCollateral","timeline"],i=[{id:"status",value:"status",label:"status",category:"general"},{id:"timeline",value:"negotiationHeight",label:"timeline",category:"time"},{id:"contractHeightStart",value:"negotiationHeight",label:"start height",category:"time"},{id:"contractHeightEnd",value:"expirationHeight",label:"expiration height",category:"time"}],o="timeline"},22515:function(e,t,n){"use strict";n.d(t,{Tu:function(){return ev},xQ:function(){return eg},Rh:function(){return em}});var r=n(52322),i=n(2784),o=n(79798),a=n(27444),s=n(25205),l=n(63955);function u(e,t,n){var r=this,o=(0,i.useRef)(null),a=(0,i.useRef)(0),s=(0,i.useRef)(null),l=(0,i.useRef)([]),u=(0,i.useRef)(),c=(0,i.useRef)(),d=(0,i.useRef)(e),f=(0,i.useRef)(!0);(0,i.useEffect)(function(){d.current=e},[e]);var h=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw TypeError("Expected a function");t=+t||0;var p=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,v="maxWait"in n,g=v?Math.max(+n.maxWait||0,t):null;return(0,i.useEffect)(function(){return f.current=!0,function(){f.current=!1}},[]),(0,i.useMemo)(function(){var e=function(e){var t=l.current,n=u.current;return l.current=u.current=null,a.current=e,c.current=d.current.apply(n,t)},n=function(e,t){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(e):setTimeout(e,t)},i=function(e){if(!f.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||v&&e-a.current>=g},y=function(t){return s.current=null,m&&l.current?e(t):(l.current=u.current=null,c.current)},x=function e(){var r=Date.now();if(i(r))return y(r);if(f.current){var s=t-(r-o.current);n(e,v?Math.min(s,g-(r-a.current)):s)}},b=function(){var d=Date.now(),h=i(d);if(l.current=[].slice.call(arguments),u.current=r,o.current=d,h){if(!s.current&&f.current)return a.current=o.current,n(x,t),p?e(o.current):c.current;if(v)return n(x,t),e(o.current)}return s.current||n(x,t),c.current};return b.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,l.current=o.current=u.current=s.current=null},b.isPending=function(){return!!s.current},b.flush=function(){return s.current?y(Date.now()):c.current},b},[p,v,t,g,m,h])}function c(e,t){return e===t}function d(e){return"function"==typeof e?function(){return e}:e}var f=n(99182),h=n(4941),p=n(41775);function m(e){let{search:t}=e;return(0,r.jsxs)(o.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:(0,r.jsx)(p.Qbr,{})}),(0,r.jsx)(o.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No matching directory.":"Select a directory to get started."})]})}function v(){var e;let t=(0,a.On)({config:{swr:{revalidateOnFocus:!1,keepPreviousData:!0}}});return(null===(e=t.data)||void 0===e?void 0:e.os)==="windows"?"\\":"/"}var g=n(5648),y=n.n(g),x=n(1573),b=n.n(x);function w(e){let{currentPath:t,childPath:n,separator:r}=e;return"\\"===t&&n.endsWith(":")?n+r:E(t,n,r)}function E(e,t,n){e=e===n?e:b()(e,n),t=y()(t,n);let r="";return(r=e.length?t.length&&t!==n?e===n?n+t:e+n+t:e:t).endsWith(":")?r+n:r}function j(){return(0,r.jsxs)(o.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:(0,r.jsx)(p.Qbr,{})}),(0,r.jsx)(o.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:"Error loading directory."})]})}function k(e){let{path:t,onCreate:n}=e,s=v(),l=(0,a.Kw)(),[u,c]=(0,i.useState)(""),d=(0,i.useCallback)(async()=>{let e=await l.put({payload:{path:w({currentPath:t,childPath:u,separator:s})}});e.error?(0,o.OHV)("Error creating directory: ".concat(e.error)):(n(u),c(""))},[l,u,n,t,s]);return(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden w-full",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"group-data-[selected=true]:text-gray-1000 dark:group-data-[selected=true]:text-graydark-1000",children:(0,r.jsx)(p.L37,{})}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(o.nvn,{focus:"none",variant:"ghost",placeholder:"type new directory name",className:"!pl-0 font-normal h-5",value:u,onChange:e=>{c(e.currentTarget.value)},onKeyUp:e=>{e.stopPropagation(),"Enter"===e.key&&d()},size:"small"})})]})}function S(e){let{path:t,setPath:n,commandPage:i,currentPage:a,beforeSelect:s,afterSelect:l}=e,u=v();return(0,r.jsx)(h.WD,{commandPage:i,currentPage:a,onSelect:()=>{t&&(s&&s(),n(function(e,t){if(e.endsWith(":\\"))return t;let n="".concat(e.split(t).slice(0,-1).join(t));return""===n?t:n.endsWith(":")?n+t:n}(t,u)),l&&l())},value:"..",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"group-data-[selected=true]:text-gray-1000 dark:group-data-[selected=true]:text-graydark-1000",children:(0,r.jsx)(p.ROc,{size:16})}),(0,r.jsx)(o.xvT,{ellipsis:!0,children:".."})]})},"..")}let _={namespace:"volumes/directorySelect",label:"Directory select"};function O(e){var t,n,i,a,s,l,u;let{path:c,dir:d,setPath:g,currentPage:y,beforeSelect:x,afterSelect:b}=e,E=v(),O=(null===(t=d.data)||void 0===t?void 0:t.path)===E,C=(null===(n=d.data)||void 0===n?void 0:n.path)==="\\";return(0,r.jsxs)(h.fu,{currentPage:y,commandPage:_,children:[d.isValidating||!d.data||d.error?null:O?null:(0,r.jsx)(S,{path:d.data.path,setPath:g,currentPage:y,commandPage:_,afterSelect:b,beforeSelect:x}),(0,r.jsxs)(f.mY.Empty,{children:[!d.isValidating&&d.error?(0,r.jsx)(j,{}):null,d.isValidating||d.error||(null===(a=d.data)||void 0===a?void 0:null===(i=a.directories)||void 0===i?void 0:i.length)?null:(0,r.jsx)(m,{search:c})]}),!d.isValidating&&!d.error&&(null===(l=d.data)||void 0===l?void 0:null===(s=l.directories)||void 0===s?void 0:s.length)?d.data.directories.map(e=>(0,r.jsx)(h.WD,{commandPage:_,currentPage:y,onSelect:()=>{x&&x();let t=w({currentPath:d.data.path,childPath:e,separator:E});g(t),b&&b()},value:e,children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"group-data-[selected=true]:text-gray-1000 dark:group-data-[selected=true]:text-graydark-1000",children:(0,r.jsx)(p.ROc,{size:16})}),(0,r.jsx)(o.xvT,{ellipsis:!0,children:e})]})},e)):null,!C&&!d.isValidating&&!d.error&&(0,r.jsx)(h.WD,{commandPage:_,currentPage:y,value:"create new directory",children:(0,r.jsx)(k,{path:null===(u=d.data)||void 0===u?void 0:u.path,onCreate:e=>{d.mutate(t=>{var n;return{...t,directories:(null==t?void 0:null===(n=t.directories)||void 0===n?void 0:n.concat(e))||[e]}})}})})]})}function C(e){let{path:t,dir:n,onChange:i}=e;return(0,r.jsx)(f.mY,{label:"Select volume",shouldFilter:!1,children:(0,r.jsx)(o.s_4,{className:"h-[200px] p-1 overflow-hidden",children:(0,r.jsx)(o.xrM,{keyToResetScrollbars:t,children:(0,r.jsx)(f.mY.List,{children:(0,r.jsx)(O,{path:t,dir:n,setPath:i,currentPage:_})})})})})}var M=n(82851);function A(e){let{label:t,newSizeGB:n,currentSizeGB:i=0,maxSizeGB:a=0}=e,l=in,c=n>a;return(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"relative w-full h-1 rounded-lg bg-gray-300 dark:bg-graydark-300 overflow-hidden",children:[(0,r.jsx)("div",{className:(0,M.cx)("absolute h-1 rounded-tl-lg rounded-bl-lg",void 0!==n&&u?"bg-red-500 dark:bg-red-500":"bg-gray-700 dark:bg-graydark-800",l?"z-10":"z-0"),style:{width:a?"".concat(i/a*100,"%"):"0%"}}),(0,r.jsx)("div",{className:(0,M.cx)("absolute h-1 rounded-tl-lg rounded-bl-lg",c?"bg-amber-500 dark:bg-amber-500":void 0!==n&&l?"bg-green-500 dark:bg-green-500":"bg-gray-700 dark:bg-graydark-800",u?"z-10":"z-0"),style:{width:a?"".concat(n/a*100,"%"):"0%"}})]}),(0,r.jsxs)("div",{className:"h-4 flex justify-between",children:[t||(0,r.jsx)("div",{}),void 0!==n&&a?(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:"".concat((n/a*100).toFixed(0),"% of ").concat((0,s.vW)((0,s.Hz)(a))," available")}):null]})]})}let T={size:void 0,name:"",path:"~",immediatePath:"~"};function P(e){var t;let{trigger:n,open:c,onOpenChange:d}=e,{closeDialog:f}=em(),h=(0,a.HU)(),p=v(),m=(0,l.cI)({mode:"all",defaultValues:T}),g=m.watch("path"),y=m.watch("immediatePath"),x=m.watch("name"),b=m.watch("size"),w=u(()=>{g!==y&&m.setValue("path",y)},500);(0,i.useEffect)(()=>{w()},[y]),(0,i.useEffect)(()=>{g!==y&&m.setValue("immediatePath",g)},[g]);let j=(0,i.useCallback)(async e=>{let t=await h.post({payload:{localPath:E(g,x,p),maxSectors:(0,o.WN2)(e.size).toNumber()}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("New volume created."),m.reset(T),f())},[m,h,f,x,g,p]),k=(0,a.cM)({disabled:!c,params:{path:""===g?p:g},config:{swr:{shouldRetryOnError:!1}}});(0,i.useEffect)(()=>{k.error&&m.setError("immediatePath",{message:"Directory does not exist"})},[k.error]),(0,i.useEffect)(()=>{k.data&&k.data.path!==g&&m.setValue("path",k.data.path)},[k.data]);let S=(null==b?void 0:b.toNumber())||0,_=k.data?(0,s.Uz)(k.data.freeBytes).toNumber():0,O=(0,s.Uz)((null===(t=k.data)||void 0===t?void 0:t.freeBytes)||0).toNumber(),M=(0,i.useMemo)(()=>({name:{type:"text",title:"Name",placeholder:"data.dat",validation:{required:"required"}},immediatePath:{type:"text",title:"Location",placeholder:"Enter a directory or select one below",validation:{required:"required",validate:{}}},path:{type:"text",title:"Location",validation:{required:"required",validate:{req:e=>"\\"!==e||"directory within a drive required"}}},size:{type:"number",title:"Size",decimalsLimit:0,units:"GB",placeholder:"1,000",validation:{required:"required",validate:{between:e=>{let t="Must be between ".concat((0,s.vW)((0,s.Hz)(10))," and ").concat((0,s.vW)((0,s.Hz)(O),{fixed:3}));return e<=O&&e>=10||t},nospace:()=>O>10||"not enough space in directory"}}}}),[O]),P=(0,o.WsO)(M);return m.register("path",M.path.validation),(0,r.jsx)(o.VqE,{title:"Create Volume",trigger:n,open:c,onOpenChange:e=>{e||m.reset(T),d(e)},contentVariants:{className:"w-[400px]"},onSubmit:m.handleSubmit(j,P),controls:(0,r.jsx)("div",{className:"flex flex-col gap-1",children:(0,r.jsx)(o.ZqQ,{form:m,children:"Create"})}),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.nvN,{size:"14",children:"Create a new volume. Select a system directory and specific the size of the volume."}),(0,r.jsx)(o.yEL,{name:"name",form:m,fields:M}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{className:"flex flex-col gap-1",children:(0,r.jsx)(o.yEL,{name:"immediatePath",form:m,fields:M})}),(0,r.jsx)(C,{path:g,dir:k,onChange:e=>m.setValue("path",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})})]}),(0,r.jsx)(o.jIp,{name:"size",form:m,fields:M}),(0,r.jsx)(A,{newSizeGB:S,currentSizeGB:0,maxSizeGB:_})]})})}let N={size:void 0};function R(e){var t,n;let{trigger:u,open:c,onOpenChange:d}=e,{id:f,closeDialog:h}=em(),p=v(),m=(0,a.ST)({disabled:!f,params:{id:f}}),g=(0,a.cM)({disabled:!c||!m.data,params:{path:null===(t=m.data)||void 0===t?void 0:t.localPath.split(p).slice(0,-1).join(p)}}),y=(0,a.G)(),x=(0,l.cI)({mode:"all",defaultValues:N}),b=x.watch("size"),w=(0,i.useCallback)(async e=>{let t=await y.put({params:{id:Number(f)},payload:{maxSectors:(0,o.WN2)(e.size).toNumber()}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("Volume resizing initiated."),x.reset(N),h())},[x,f,y,h]);(0,i.useEffect)(()=>{m.data&&x.reset(N)},[m.data]);let E=null==b?void 0:b.toNumber(),j=m.data?(0,o.bjP)(m.data.totalSectors).toNumber():0,k=g.data?(0,s.Uz)(g.data.totalBytes).toNumber():0,S=j=1,O=(0,i.useMemo)(()=>({size:{type:"number",title:"New size",decimalsLimit:0,units:"GB",placeholder:"1,000",validation:{required:"required",validate:{between:e=>{let t="Must be between ".concat((0,s.vW)((0,s.Hz)(10))," and ").concat((0,s.vW)((0,s.Hz)(k),{fixed:3}));return e<=k&&e>=10||t}}}}}),[k]),C=(0,o.WsO)(O);return(0,r.jsx)(o.VqE,{title:"Resize Volume",trigger:u,open:c,onOpenChange:e=>{e||x.reset(N),d(e)},contentVariants:{className:"max-w-[400px]"},onSubmit:x.handleSubmit(w,C),controls:(0,r.jsx)("div",{className:"flex flex-col gap-1",children:(0,r.jsx)(o.ZqQ,{form:x,children:"Resize"})}),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)(o.nvN,{size:"14",children:["Grow or shrink the volume. When growing a volume, make sure to check that there is enough space on-disk. When shrinking a volume, any data that needs to be moved will be placed into other volumes, meaning that no data will be lost. If ",(0,r.jsx)(o.EKh,{children:"hostd"})," is unable to migrate the data, an error will be returned and the operation will be stopped."]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(o.__J,{children:"Volume"}),(0,r.jsx)(o.xvT,{font:"mono",ellipsis:!0,children:null===(n=m.data)||void 0===n?void 0:n.localPath})]}),(0,r.jsx)(o.jIp,{name:"size",form:x,fields:O}),(0,r.jsx)(A,{currentSizeGB:j,newSizeGB:E,maxSizeGB:k,label:_?(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:S?"Increase by ".concat((0,s.vW)((0,s.Hz)(E-j))):"Decrease by ".concat((0,s.vW)((0,s.Hz)(j-E)))}):(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:"Current size is ".concat((0,s.vW)((0,s.Hz)(j)))})})]})})}let D={path:"",force:!1};function L(e){var t,n,u;let{trigger:c,open:d,onOpenChange:f}=e,{id:h,closeDialog:p}=em(),m=(0,a.uq)(),v=(0,a.ST)({disabled:!h,params:{id:h}}),g=(0,o.x9T)(null===(t=v.data)||void 0===t?void 0:t.totalSectors),y=(0,o.x9T)(null===(n=v.data)||void 0===n?void 0:n.usedSectors),x=null===(u=v.data)||void 0===u?void 0:u.localPath,b=(0,l.cI)({mode:"all",defaultValues:D}),w=(0,i.useCallback)(async e=>{var t;let n=await m.delete({params:{id:null===(t=v.data)||void 0===t?void 0:t.id,force:e.force}});n.error?(0,o.OHV)(n.error):((0,o.OPV)("Volume permanently deleted."),b.reset(),p())},[b,v.data,m,p]),E=(0,i.useMemo)(()=>({path:{type:"text",title:"Path",placeholder:x,validation:{required:"required",validate:{equals:e=>e===x||"directory path does not match"}}},force:{type:"boolean",title:"Force",validation:{}}}),[x]),j=(0,o.WsO)(E);return(0,r.jsx)(o.VqE,{title:"Delete Volume",trigger:c,open:d,onOpenChange:e=>{e||b.reset(D),f(e)},contentVariants:{className:"w-[400px]"},onSubmit:b.handleSubmit(w,j),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.nvN,{size:"14",children:"Are you sure you would like to delete the volume?"}),(0,r.jsxs)(o.nvN,{size:"14",children:[(0,r.jsx)(o.EKh,{children:"hostd"})," will move"," ",(0,r.jsx)(o.xvT,{weight:"semibold",children:(0,s.vW)(y)})," of stored data and will lose ",(0,r.jsx)(o.xvT,{weight:"semibold",children:(0,s.vW)(g)})," ","of storage capacity. It is not recommended to remove or resize volumes when contracts are about to expire."]}),(0,r.jsx)(o.nvN,{size:"14",children:"Enter the volume path to confirm the removal."}),(0,r.jsx)(o.yEL,{name:"path",form:b,fields:E}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(o.QBj,{name:"force",size:"medium",form:b,fields:E}),(0,r.jsx)(o.Yqd,{children:(0,r.jsx)("div",{className:"flex gap-1 max-w-[200px]",children:(0,r.jsx)(o.nvN,{size:"14",children:"Force deleting a volume will remove the volume even if the data can NOT be relocated - this will result in severe data loss and contract failure. Be extremely careful when using this option."})})})]}),(0,r.jsx)(o.ZqQ,{variant:"red",form:b,children:"Delete"})]})})}var F=n(6391),V=n.n(F);function z(){let{dialog:e,openDialog:t,closeDialog:n}=em(),s=(0,a.Os)(),l=(0,a.cj)(),u=(0,i.useCallback)(async e=>{let{sc:t,address:n}=e,r=await l.post({payload:{address:n,amount:t.toString()}});return r.error?{error:r.error}:{transactionId:r.data}},[l]);return(0,r.jsx)(o.weF,{balance:s.data?new(V())(s.data.spendable):void 0,send:u,open:"sendSiacoin"===e,onOpenChange:r=>r?t(e):n()})}var I=n(63171);function Z(){let{id:e,dialog:t,openDialog:n,closeDialog:a}=em(),{dataset:s}=(0,I.n)(),l=(0,i.useMemo)(()=>null==s?void 0:s.find(t=>t.id===e),[s,e]);return(0,r.jsx)(o.mPE,{id:e,transaction:l,open:"transactionDetails"===t,onOpenChange:e=>e?n(t):a()})}var B=n(734),H=n(95753),U=n(71930),W=n(5632);let q={namespace:"wallet",label:"Wallet"};function $(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:s,closeDialog:l}=em(),u=(0,W.useRouter)(),c=(0,a.On)({config:{swr:{revalidateOnFocus:!1,keepPreviousData:!0}}});return(0,r.jsxs)(h.fu,{currentPage:t,commandPage:q,children:[(0,r.jsx)(h.Ul,{currentPage:t,parentPage:n,commandPage:q,onSelect:()=>{i(q)},children:q.label}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:q,onSelect:()=>{u.push(U._.wallet.view),l()},children:"View wallet transactions"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:q,onSelect:()=>{s("sendSiacoin")},children:"Send siacoin"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:q,onSelect:()=>{s("addressDetails")},children:"Receive siacoin"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:q,onSelect:()=>{s("addressDetails")},children:"View wallet address"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:q,onSelect:()=>{var e;(0,o.vQq)(null===(e=c.data)||void 0===e?void 0:e.walletAddress,"wallet address"),l()},children:"Copy wallet address to clipboard"})]})}var Y=n(38617);let G={namespace:"settings",label:"Settings"};function X(e){let{currentPage:t,parentPage:n}=e,{openDialog:i,closeDialog:o}=em(),{setTheme:a}=(0,Y.F)(),{settings:s,setSettings:l,lock:u,currencyOptions:c,setCurrency:d}=(0,H.Hv)();return(0,r.jsxs)(h.fu,{currentPage:t,commandPage:G,children:[(0,r.jsx)(h.Ul,{currentPage:t,parentPage:n,commandPage:G,onSelect:()=>{i("settings")},children:"Open settings"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:G,onSelect:()=>{l({siaCentral:!s.siaCentral}),o()},children:(s.siaCentral?"Disable":"Enable")+" external API - Sia Central exchange rates"}),(0,r.jsx)(h.o4,{currentPage:t,commandPage:G,onSelect:()=>{u(),o()},children:"Lock hostd"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:G,onSelect:()=>{i("settings")},children:"Open interface theme menu"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:G,onSelect:()=>{a("system"),o()},children:"Set theme to system preference"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:G,onSelect:()=>{a("dark"),o()},children:"Set theme to dark"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:G,onSelect:()=>{a("light"),o()},children:"Set theme to light"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:G,onSelect:()=>{i("settings")},children:"Open currency settings menu"}),c.map(e=>{let{id:n,label:i}=e;return(0,r.jsx)(h.WD,{currentPage:t,commandPage:G,onSelect:()=>{d(n),o()},children:"Set currency to ".concat(i)},n)})]})}let K={namespace:"node",label:"Blockchain node"};function Q(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:o,closeDialog:a}=em(),s=(0,W.useRouter)();return(0,r.jsxs)(h.fu,{currentPage:t,commandPage:K,children:[(0,r.jsx)(h.Ul,{currentPage:t,parentPage:n,commandPage:K,onSelect:()=>{i(K)},children:K.label}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:K,onSelect:()=>{o("connectPeer")},children:"Connect to a peer"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:K,onSelect:()=>{s.push(U._.node.index),a()},children:"View peers"})]})}var J=n(99957);let ee={namespace:"configuration",label:"Configuration"};function et(e){let{currentPage:t,parentPage:n,pushPage:i}=e,o=(0,W.useRouter)(),{showAdvanced:a}=(0,J.ZR)(),{closeDialog:s}=em();return(0,r.jsxs)(h.fu,{currentPage:t,commandPage:ee,children:[(0,r.jsx)(h.Ul,{currentPage:t,parentPage:n,commandPage:ee,onSelect:()=>{i(ee)},children:ee.label}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:ee,onSelect:()=>{o.push(U._.config.index),s()},children:"Open configuration"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:ee,onSelect:()=>{o.push(U._.config.host),s()},children:"Configure host"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:ee,onSelect:()=>{o.push(U._.config.pricing),s()},children:"Configure pricing"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:ee,onSelect:()=>{o.push(U._.config.dns),s()},children:"Configure DNS"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:ee,onSelect:()=>{o.push(U._.config.bandwidth),s()},children:"Configure bandwidth"}),a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.WD,{currentPage:t,commandPage:ee,onSelect:()=>{o.push(U._.config.registry),s()},children:"Configure registry"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:ee,onSelect:()=>{o.push(U._.config.accounts),s()},children:"Configure accounts"})]})]})}var en=n(92838);function er(e){let{search:t}=e;return(0,r.jsxs)(o.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:(0,r.jsx)(p.owP,{})}),(0,r.jsx)(o.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No results matching query.":"Type a query to get started."})]})}var ei=n(3639);let eo={namespace:"contracts",label:"Contracts"};function ea(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,s=(0,W.useRouter)(),{closeDialog:l}=em();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(eo)},children:eo.label}),(0,r.jsx)(h.fu,{currentPage:t,commandPage:eo,children:(0,r.jsx)(h.WD,{currentPage:t,commandPage:eo,onSelect:()=>{s.push(U._.contracts.index),l()},children:"View contracts"})}),(0,r.jsx)(ei.F,{parentPage:eo,currentPage:t,beforeSelect:o,afterSelect:a,pushPage:i})]})}let es={namespace:"volumes",label:"Volumes"};function el(e){let{currentPage:t,parentPage:n,pushPage:i}=e,o=(0,W.useRouter)(),{openDialog:a,closeDialog:s}=em();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(es)},children:es.label}),(0,r.jsxs)(h.fu,{currentPage:t,commandPage:es,children:[(0,r.jsx)(h.WD,{currentPage:t,commandPage:es,onSelect:()=>{o.push(U._.volumes.index),s()},children:"View volumes"}),(0,r.jsx)(h.WD,{currentPage:t,commandPage:es,onSelect:()=>{a("volumeCreate")},children:"Create volume"})]})]})}function eu(e){var t,n,a,s,l,h,p,m,v;let{panel:g}=e,y=(0,W.useRouter)(),{resetFilters:x}=(0,en.G)(),{closeDialog:b}=em(),[w,E]=(0,i.useState)(""),[j]=(s=t&&t.equalityFn||c,h=(a=(n=(0,i.useState)(d(w)))[1],l=[n[0],(0,i.useCallback)(function(e){return a(d(e))},[])])[0],p=l[1],m=u((0,i.useCallback)(function(e){return p(e)},[p]),500,t),s((v=(0,i.useRef)(w)).current,w)||(m(w),v.current=w),[h,m]),[k,S]=(0,i.useState)([]),_=k[k.length-1],O=0===k.length,C=(0,i.useCallback)(e=>{S(t=>[...t,e])},[S]),A=(0,i.useCallback)(()=>{b()},[b]),T=(0,i.useCallback)(()=>{E("")},[E]),P=(null==_?void 0:_.empty)||er;return(0,r.jsxs)(f.mY,{label:"Command Menu",loop:!0,className:(0,M.cx)(g&&(0,o.z$)()),onKeyDown:e=>{(k.length>0&&"Escape"===e.key||"Backspace"===e.key&&!w)&&(e.preventDefault(),S(e=>e.slice(0,-1)))},children:[_&&(0,r.jsx)(o.__J,{className:"px-2",children:_.label}),(0,r.jsx)(f.mY.Input,{value:w,onValueChange:E,className:(0,o.cEb)({variant:"ghost",focus:"none"}),placeholder:(null==_?void 0:_.prompt)||(O?"Search for commands, eg: theme, redundancy":"Search commands")}),(0,r.jsx)(o.Z0O,{className:"my-2"}),(0,r.jsxs)(f.mY.List,{children:[(0,r.jsx)(f.mY.Empty,{children:(0,r.jsx)(P,{search:w,debouncedSearch:j})}),(0,r.jsx)(X,{currentPage:_,pushPage:C}),(0,r.jsx)($,{currentPage:_,pushPage:C}),(0,r.jsx)(el,{currentPage:_,pushPage:C}),(0,r.jsx)(ea,{currentPage:_,pushPage:C,beforeSelect:()=>{A(),x()},afterSelect:()=>{y.pathname.startsWith(U._.contracts.index)||y.push(U._.contracts.index),T()}}),(0,r.jsx)(et,{currentPage:_,pushPage:C}),(0,r.jsx)(Q,{currentPage:_,pushPage:C})]})]})}function ec(e){let{open:t,onOpenChange:n,setOpen:a}=e,{isUnlockedAndAuthedRoute:s}=(0,H.Hv)(),{isConnected:l}=(0,o.Y97)({route:U.h});return(0,i.useEffect)(()=>{if(!s||!l)return;let e=e=>{"k"===e.key&&e.metaKey&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s,l,a]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.VqE,{open:t,onOpenChange:n,contentVariants:{className:"!absolute !p-1 w-[450px] top-[200px]"},bodyClassName:"!px-1 !py-1",closeClassName:"hidden",children:(0,r.jsx)(eu,{})})})}function ed(e){let{open:t,onOpenChange:n}=e,s=(0,a.Z7)(),l=(0,a.Uy)(),u=(0,i.useCallback)(async e=>{let t=await l.post({payload:[e]});t.error?(0,o.OHV)("Error dismissing alert."):(0,o.OPV)("Alert has been dismissed.")},[l]),c=(0,i.useCallback)(async(e,t)=>{if(!s.data)return;let n=await l.post({payload:e});n.error?(0,o.OHV)(t?"Error dismissing all ".concat(t," alerts."):"Error dismissing all alerts."):(0,o.OPV)(t?"All ".concat(t," alerts have been dismissed."):"All alerts have been dismissed.")},[l,s]);return(0,r.jsx)(o.hcY,{open:t,onOpenChange:e=>{n(e)},alerts:s,dataFieldOrder:ef,dataFields:eh,dismissMany:c,dismissOne:u})}let ef=["error","contractID","blockHeight","resolution","volume","volumeID","elapsed","error","checked","missing","corrupt","total","oldSectors","currentSectors","targetSectors","migratedSectors","migrated","target","force"],eh={error:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"error"}),(0,r.jsx)(o.xvT,{color:"contrast",children:t})]})}},contractId:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"contract ID"}),(0,r.jsx)(o.XxW,{value:String(t)})]})}},blockHeight:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"block height"}),(0,r.jsx)(o.XxW,{value:String(t),type:"block"})]})}},resolution:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"resolution"}),(0,r.jsx)(o.XxW,{value:String(t)})]})}},volume:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"volume"}),(0,r.jsx)(o.XxW,{value:String(t)})]})}},volumeID:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"volume ID"}),(0,r.jsx)(o.XxW,{value:String(t)})]})}},elapsed:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"elapsed"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:(0,s.bc)(Number(t))})]})}},checked:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"checked"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},missing:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"missing"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},corrupt:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"corrupt"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},total:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"total"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},oldSectors:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"old sectors"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},currentSectors:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"current sectors"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},targetSectors:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"target sectors"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},migratedSectors:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"migrated sectors"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},migrated:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"migrated"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},target:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"target"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t.toLocaleString()})]})}},force:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"force"}),(0,r.jsx)(o.xvT,{color:"contrast",ellipsis:!0,children:t?"true":"false"})]})}}},ep=(0,i.createContext)({}),em=()=>(0,i.useContext)(ep);function ev(e){let{children:t}=e,n=function(){let[e,t]=(0,i.useState)(),[n,r]=(0,i.useState)(),o=(0,i.useCallback)((e,n)=>{t(e),r(n)},[t,r]),[a,s]=(0,i.useState)(),l=(0,i.useCallback)(e=>{t("confirm"),s(e)},[t,s]),u=(0,i.useCallback)(()=>{t(void 0),r(void 0),s(void 0)},[t,r,s]),c=(0,i.useCallback)(e=>{e||u()},[u]);return{dialog:e,id:n,openDialog:o,confirm:a,openConfirmDialog:l,closeDialog:u,onOpenChange:c}}();return(0,r.jsx)(ep.Provider,{value:n,children:t})}function eg(){var e;let{dialog:t,openDialog:n,openConfirmDialog:i,onOpenChange:s,closeDialog:l,confirm:u}=em(),c=(0,a.Wl)(),d=(0,a.Os)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ec,{open:"cmdk"===t,onOpenChange:s,setOpen:()=>n("cmdk")}),(0,r.jsx)(o.DLL,{open:"settings"===t,onOpenChange:s}),(0,r.jsx)(ed,{open:"alerts"===t,onOpenChange:s}),(0,r.jsx)(z,{}),(0,r.jsx)(o.YNn,{open:"addressDetails"===t,address:null===(e=d.data)||void 0===e?void 0:e.address,isValidating:d.isValidating,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(Z,{}),(0,r.jsx)(o.D_D,{connect:e=>c.put({payload:{address:e}}),open:"connectPeer"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(P,{open:"volumeCreate"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(R,{open:"volumeResize"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(L,{open:"volumeDelete"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(B.Y,{open:"contractsFilterContractId"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(o.QHy,{open:"confirm"===t,params:u,onOpenChange:e=>e?i(u):l()})]})}},5187:function(e,t,n){"use strict";n.d(t,{C:function(){return E},B:function(){return w}});var r=n(52322),i=n(2784),o=n(79798),a=n(25205);let s={successful:{color:o.O9T.green[600]},active:{color:o.O9T.amber[600]},pending:{color:o.O9T.amber[600],pattern:!0},rejected:{color:o.O9T.red[600]},failed:{color:o.O9T.red[600]},storage:{label:"storage",color:o.O9T.emerald[600]},storagePhysical:{color:o.O9T.indigo[600]},ingress:{label:"ingress",color:o.O9T.pink[600]},egress:{label:"egress",color:o.O9T.blue[600]},registry:{label:"registry",color:o.O9T.purple[600]},storageWrites:{label:"storage write",color:o.O9T.pink[600]},storageReads:{label:"storage read",color:o.O9T.blue[600]},registryReads:{label:"registry reads",color:o.O9T.green[600]},registryWrites:{label:"registry writes",color:o.O9T.yellow[600]},rpc:{label:"RPC",color:o.O9T.slate[500]},capacityStorage:{label:"capacity",color:o.O9T.neutral[500]},capacityRegistry:{label:"capacity",color:o.O9T.neutral[500]},contract:{color:o.O9T.red[800]},collateral:{color:o.O9T.amber[600]},sectorsTemp:{label:"temp sectors",color:o.O9T.amber[600]},sectorsContract:{label:"contract sectors",color:o.O9T.green[600]},sectorAccess:{label:"sector access",color:o.O9T.blue[600]},sc:{color:o.O9T.green[600]},sf:{color:o.O9T.amber[600]},locked:{color:o.O9T.purple[600]},risked:{color:o.O9T.amber[600]},burnt:{color:o.O9T.red[600]}};var l=n(27444);function u(e,t,n){return{...e,category:t,pattern:n}}function c(e,t,n){return{...e,category:t,label:n}}var d=n(6391),f=n.n(d),h=n(14817),p=n(66700);function m(e,t){for(var n=Math.abs(e).toString();n.length"7"===e.value),b=(0,i.createContext)({}),w=()=>(0,i.useContext)(b);function E(e){let{children:t}=e,n=function(){let[e,t]=(0,y.Z)("v0/metrics/dataTimeSpan",{defaultValue:x.value}),[n,d]=(0,y.Z)("v0/metrics/dataInterval",{defaultValue:x.interval}),b=function(e){let[t,n]=(0,i.useState)(new Date().getTime());return(0,i.useEffect)(()=>{n(new Date().getTime());let t=setInterval(()=>{n(new Date().getTime()),console.log("reset time range")},(0,h.uQ)(e));return()=>clearInterval(t)},[e]),t}(n),w=(0,i.useMemo)(()=>(0,o.OQF)(e,b),[e,b]),E=(0,i.useCallback)(e=>{let n=h.lv.find(t=>t.value===e);d(n.interval),t(n.value)},[t,d]),j=(0,i.useMemo)(()=>(0,o.kOJ)(n),[n]),k=(0,l.KU)({params:{interval:n,start:function(e,t){(0,v.Z)(1,arguments);var n=(0,p.Z)(e);if(isNaN(n.getTime()))throw RangeError("Invalid time value");var r=null!=t&&t.format?String(t.format):"extended",i=null!=t&&t.representation?String(t.representation):"complete";if("extended"!==r&&"basic"!==r)throw RangeError("format must be 'extended' or 'basic'");if("date"!==i&&"time"!==i&&"complete"!==i)throw RangeError("representation must be 'date', 'time', or 'complete'");var o="",a="",s="extended"===r?"-":"";if("time"!==i){var l=m(n.getDate(),2),u=m(n.getMonth()+1,2),c=m(n.getFullYear(),4);o="".concat(c).concat(s).concat(u).concat(s).concat(l)}if("date"!==i){var d=n.getTimezoneOffset();if(0!==d){var f=Math.abs(d),h=m(Math.floor(f/60),2),g=m(f%60,2);a="".concat(d<0?"+":"-").concat(h,":").concat(g)}else a="Z";var y=m(n.getHours(),2),x=m(n.getMinutes(),2),b=m(n.getSeconds(),2),w=""===o?"":"T",E=[y,x,b].join("extended"===r?":":"");o="".concat(o).concat(w).concat(E).concat(a)}return o}(new Date(w.start-(0,h.uQ)(n)))},config:{swr:{revalidateOnFocus:!1,refreshInterval:(0,o.sWj)(5)}}}),S=(0,i.useMemo)(()=>{var e;let t=(0,o.Y_Z)(null===(e=k.data)||void 0===e?void 0:e.map(e=>({storagePotential:Number(e.revenue.potential.storage),ingressPotential:Number(e.revenue.potential.ingress),egressPotential:Number(e.revenue.potential.egress),rpcPotential:Number(e.revenue.potential.rpc),storage:Number(e.revenue.earned.storage),ingress:Number(e.revenue.earned.ingress),egress:Number(e.revenue.earned.egress),rpc:Number(e.revenue.earned.rpc),potential:new(f())(e.revenue.potential.storage).plus(e.revenue.potential.ingress).plus(e.revenue.potential.egress).plus(e.revenue.potential.rpc).toNumber(),earned:new(f())(e.revenue.earned.storage).plus(e.revenue.earned.ingress).plus(e.revenue.earned.egress).plus(e.revenue.earned.rpc).toNumber(),timestamp:new Date(e.timestamp).getTime()})),"delta"),n=(0,o.fVJ)(t),i=t.map(e=>({storagePotential:Math.max(e.storagePotential,0),ingressPotential:Math.max(e.ingressPotential,0),egressPotential:Math.max(e.egressPotential,0),rpcPotential:Math.max(e.rpcPotential,0),storage:Math.max(e.storage,0),ingress:Math.max(e.ingress,0),egress:Math.max(e.egress,0),rpc:Math.max(e.rpc,0),timestamp:new Date(e.timestamp).getTime()}));return{data:i,stats:n,config:{enabledGraph:["storage","storagePotential","ingress","ingressPotential","egress","egressPotential","rpc","rpcPotential"],enabledTip:["storage","storagePotential","ingress","ingressPotential","egress","egressPotential","rpc","rpcPotential"],categories:["earned","potential"],data:{storagePotential:u(s.storage,"potential",!0),ingressPotential:u(s.ingress,"potential",!0),egressPotential:u(s.egress,"potential",!0),registryReadPotential:u(s.registryReads,"potential",!0),registryWritePotential:u(s.registryWrites,"potential",!0),rpcPotential:u(s.rpc,"potential",!0),storage:u(s.storage,"earned"),ingress:u(s.ingress,"earned"),egress:u(s.egress,"earned"),registryRead:u(s.registryReads,"earned"),registryWrite:u(s.registryWrites,"earned"),rpc:u(s.rpc,"earned"),earned:c({},"earned","total"),potential:c({},"potential","total")},formatComponent:function(e){let{value:t}=e;return(0,r.jsx)(o.ho9,{variant:"value",value:new(f())(t)})},formatTickY:e=>(0,a.Vz)(e,{fixed:0,dynamicUnits:!0}),formatTimestamp:j,disableAnimations:!0,chartType:"barstack",stackOffset:"diverging"},isLoading:k.isValidating}},[k,j]),_=(0,i.useMemo)(()=>{var e;let t=(0,o.Y_Z)(null===(e=k.data)||void 0===e?void 0:e.map(e=>({locked:Number(e.contracts.lockedCollateral),risked:Number(e.contracts.riskedCollateral),timestamp:new Date(e.timestamp).getTime()})).slice(1),"none"),n=(0,o.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["locked","risked"],enabledTip:["locked","risked"],data:{locked:s.locked,risked:s.risked},formatComponent:function(e){let{value:t}=e;return(0,r.jsx)(o.ho9,{variant:"value",value:new(f())(t)})},formatTimestamp:j,formatTickY:e=>(0,a.Vz)(e,{fixed:0,dynamicUnits:!0}),disableAnimations:!0,chartType:"area",curveType:"linear",stackOffset:"none"},isLoading:k.isValidating}},[k,j]),O=(0,i.useMemo)(()=>{var e;let t=(0,o.Y_Z)(null===(e=k.data)||void 0===e?void 0:e.map(e=>({baseRPC:(0,g.sS)(e.pricing.baseRPCPrice).toNumber(),collateral:(0,g.c5)(new(f())(e.pricing.storagePrice).times(e.pricing.collateralMultiplier)).toNumber(),contract:Number(e.pricing.contractPrice),egress:(0,g.B1)(e.pricing.egressPrice).toNumber(),ingress:(0,g.dK)(e.pricing.ingressPrice).toNumber(),sectorAccess:(0,g.nS)(e.pricing.sectorAccessPrice).toNumber(),storage:(0,g.SY)(e.pricing.storagePrice).toNumber(),timestamp:new Date(e.timestamp).getTime()})).slice(1),"none"),n=(0,o.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["storage","ingress","egress","collateral","contract","sectorAccess","baseRPC"],enabledTip:["storage","ingress","egress","collateral","contract","sectorAccess","baseRPC"],data:{baseRPC:s.rpc,sectorAccess:s.sectorAccess,contract:s.contract,collateral:s.collateral,egress:s.egress,ingress:s.ingress,storage:s.storage},formatComponent:function(e){let{value:t}=e;return(0,r.jsx)(o.ho9,{variant:"value",value:new(f())(t)})},formatTimestamp:j,formatTickY:e=>(0,a.Vz)(e,{fixed:0,dynamicUnits:!0}),disableAnimations:!0,chartType:"line",curveType:"linear",stackOffset:"none"},isLoading:k.isValidating}},[k,j]),C=(0,i.useMemo)(()=>{var e;let t=(0,o.Y_Z)(null===(e=k.data)||void 0===e?void 0:e.map(e=>({active:e.contracts.active,failed:e.contracts.failed,pending:e.contracts.pending,rejected:e.contracts.rejected,successful:e.contracts.successful,timestamp:new Date(e.timestamp).getTime()})).slice(1),"none"),n=(0,o.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["successful","active","pending","rejected","failed"],enabledTip:["successful","active","pending","rejected","failed"],data:{active:s.active,failed:s.failed,pending:s.pending,rejected:s.rejected,successful:s.successful},format:e=>"".concat(e," contracts"),formatTimestamp:j,formatTickY:e=>(0,a.yF)(e),disableAnimations:!0,chartType:"areastack",curveType:"linear",stackOffset:"none"},isLoading:k.isValidating}},[k,j]),M=(0,i.useMemo)(()=>{var e;let t=(0,o.Y_Z)(null===(e=k.data)||void 0===e?void 0:e.map(e=>({maxSectors:(0,a.B$)(e.storage.totalSectors).times(4).toNumber(),tempSectors:(0,a.B$)(e.storage.tempSectors).times(4).toNumber(),physicalSectors:(0,a.B$)(e.storage.physicalSectors).times(4).toNumber(),contractSectors:(0,a.B$)(e.storage.contractSectors).times(4).toNumber(),timestamp:new Date(e.timestamp).getTime()})).slice(1),"none"),n=(0,o.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["contractSectors","physicalSectors","tempSectors","maxSectors"],enabledTip:["contractSectors","physicalSectors","tempSectors","maxSectors"],categories:["storage used","storage capacity"],data:{maxSectors:c(s.capacityStorage,"storage capacity","sectors"),physicalSectors:c(s.storagePhysical,"storage used","sectors physical"),tempSectors:c(s.sectorsTemp,"storage used","sectors temp"),contractSectors:c(s.storage,"storage used","sectors contract")},format:e=>(0,a.vW)(e),formatTimestamp:j,formatTickY:e=>(0,a.vW)(e,{fixed:0}),disableAnimations:!0,chartType:"line",curveType:"linear",stackOffset:"none"},isLoading:k.isValidating}},[k,j]),A=(0,i.useMemo)(()=>{var e;let t=(0,o.Y_Z)(null===(e=k.data)||void 0===e?void 0:e.map(e=>({storageReads:e.storage.reads,storageWrites:e.storage.writes,timestamp:new Date(e.timestamp).getTime()})),"delta"),n=(0,o.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["storageReads","storageWrites"],enabledTip:["storageReads","storageWrites"],data:{storageReads:s.storageReads,storageWrites:s.storageWrites},format:e=>(0,a.yF)(e),formatTickY:e=>(0,a.yF)(e),formatTimestamp:j,disableAnimations:!0,chartType:"line",curveType:"linear",stackOffset:"none"},isLoading:k.isValidating}},[k,j]),T=(0,i.useMemo)(()=>{var e;let t=(0,o.Y_Z)(null===(e=k.data)||void 0===e?void 0:e.map(e=>({egress:e.data.rhp.egress,ingress:e.data.rhp.ingress,timestamp:new Date(e.timestamp).getTime()})),"delta"),n=(0,o.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["ingress","egress"],enabledTip:["ingress","egress"],data:{ingress:s.ingress,egress:s.egress},format:e=>(0,a.vW)(e),formatTimestamp:j,formatTickY:e=>(0,a.vW)(e,{fixed:0}),disableAnimations:!0,chartType:"line",curveType:"linear",stackOffset:"none"},isLoading:k.isValidating}},[k,j]);return{dataTimeSpan:e,setDataTimeSpan:E,timeRange:w,dataInterval:n,setDataInterval:d,operations:A,revenue:S,collateral:_,contracts:C,storage:M,pricing:O,bandwidth:T}}();return(0,r.jsx)(b.Provider,{value:n,children:t})}},14817:function(e,t,n){"use strict";n.d(t,{lv:function(){return i},uQ:function(){return o}});var r=n(79798);let i=[{label:"1D",interval:"15m",value:"1"},{label:"7D",interval:"hourly",value:"7"},{label:"1M",interval:"daily",value:"30"},{label:"3M",interval:"daily",value:"90"},{label:"1Y",interval:"daily",value:"365"},{label:"ALL",interval:"weekly",value:"all"}];function o(e){return"5m"===e?(0,r.sWj)(5):"15m"===e?(0,r.sWj)(15):"hourly"===e?(0,r.ytg)(1):"daily"===e?(0,r.NrH)(1):"weekly"===e?(0,r.NrH)(7):"monthly"===e?(0,r.NrH)(30):"yearly"===e?(0,r.NrH)(365):0}},63171:function(e,t,n){"use strict";n.d(t,{n:function(){return p},v:function(){return m}});var r=n(52322),i=n(79798),o=n(27444),a=n(2784),s=n(22515),l=n(6391),u=n.n(l),c=n(5632),d=n(90089);let f=[],h=(0,a.createContext)({}),p=()=>(0,a.useContext)(h);function m(e){let{children:t}=e,n=function(){let e=(0,c.useRouter)(),t=Number(e.query.limit||50),n=Number(e.query.offset||0),r=(0,o.Qq)({params:{limit:t,offset:n},config:{swr:{refreshInterval:(0,i.XBW)(60)}}}),l=(0,o.a0)({config:{swr:{refreshInterval:(0,i.XBW)(60)}}}),{openDialog:h}=(0,s.Rh)(),p=(0,d.B)(),m=(0,a.useMemo)(()=>l.data&&r.data?[...(l.data||[]).map(e=>{let t="transaction"!==e.source;return{id:e.id,type:"transaction",unconfirmed:!0,txType:(0,i.leQ)(e.transaction,e.source),hash:e.id,inflow:e.inflow,outflow:e.outflow,sc:new(u())(e.inflow).minus(e.outflow),siascanUrl:t?void 0:p,timestamp:new Date(e.timestamp).getTime(),onClick:()=>h("transactionDetails",e.id),raw:e.transaction}}),...(r.data||[]).map(e=>{let t="transaction"!==e.source;return{id:e.id,type:"transaction",unconfirmed:!1,txType:(0,i.leQ)(e.transaction,e.source),hash:e.id,inflow:e.inflow,outflow:e.outflow,sc:new(u())(e.inflow).minus(e.outflow),siascanUrl:t?void 0:p,timestamp:new Date(e.timestamp).getTime(),onClick:()=>h("transactionDetails",e.id),raw:e.transaction}}).sort((e,t)=>e.timestamp{let e=new Date().getTime(),t=(0,i.NrH)(30);return new Date(e-t).toISOString()},[]),g=(0,o.KU)({params:{interval:"daily",start:v}}),y=(0,a.useMemo)(()=>(g.data||[]).map(e=>({sc:Number(e.balance),timestamp:new Date(e.timestamp).getTime()})).sort((e,t)=>e.timestamp>=t.timestamp?1:-1),[g.data]),x=r.error,b=(0,i.c2j)(m,r.isValidating,x,f);return{balances:y,metrics:g,dataset:m,error:x,dataState:b,offset:n,limit:t,pageCount:(null==m?void 0:m.length)||0}}();return(0,r.jsx)(h.Provider,{value:n,children:t})}},78743:function(e,t,n){"use strict";n.d(t,{Y:function(){return y},F:function(){return g}});var r=n(52322),i=n(79798),o=n(27444),a=n(2784);let s=["actions","path","storage","available","readOnly","successfulReads","successfulWrites","failedReads","failedWrites"];var l=n(41775),u=n(25205),c=n(22515);function d(e){var t,n;let{id:a,contentProps:s,buttonProps:u}=e,{openDialog:d}=(0,c.Rh)(),h=(0,o.Rz)(),p=(0,o.ST)({params:{id:a}}),m=(0,o._3)(),v=p.data&&"ready"==p.data.status,g=p.data&&!["ready","unavailable"].includes(p.data.status);return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",...u,children:(0,r.jsx)(l.iG7,{})}),contentProps:{align:"start",...s},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Volume ",p.data?(0,i.$Gg)(null===(t=p.data)||void 0===t?void 0:t.localPath,24):a]})}),(0,r.jsx)(i.Juw,{children:"Actions"}),g?(0,r.jsxs)(i.Xiv,{onSelect:async()=>{var e;let t=null===(e=p.data)||void 0===e?void 0:e.status,n=await m.delete({params:{id:Number(a)}});n.error?(0,i.OHV)("Error canceling volume ".concat(f(t),".")):(0,i.OPV)("Successfully canceled volume ".concat(f(t),"."))},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(l.PcV,{})}),"Cancel ".concat(f(null===(n=p.data)||void 0===n?void 0:n.status))]}):null,p.data?(0,r.jsxs)(i.Xiv,{disabled:!v,onSelect:async()=>{let e=!p.data.readOnly,t=await h.put({params:{id:Number(a)},payload:{readOnly:e}});t.error?(0,i.OHV)(e?"Error setting volume to read-only.":"Error setting volume to read/write."):(0,i.OPV)(e?"Volume set to read-only.":"Volume set to read/write.")},children:[(0,r.jsx)(i.KpP,{children:p.data.readOnly?(0,r.jsx)(l.dr6,{}):(0,r.jsx)(l.Lur,{})}),p.data.readOnly?"Set to read/write":"Set to read-only"]}):null,(0,r.jsxs)(i.Xiv,{disabled:!v,onSelect:()=>d("volumeResize",a),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(l.BB5,{})}),"Resize"]}),(0,r.jsxs)(i.Xiv,{disabled:g,onSelect:()=>d("volumeDelete",a),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(l.Jrl,{})}),"Delete"]})]})}function f(e){return"resizing"===e?"resize":"creating"===e?"creation":"removing"===e?"removal":"operation"}let h=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:t}=e;return(0,r.jsx)(d,{id:t.id})}},{id:"path",label:"path",category:"general",render:e=>{let{data:t}=e;return(0,r.jsx)(i.xvT,{font:"mono",ellipsis:!0,children:t.localPath})}},{id:"available",label:"status",category:"general",render:e=>{var t;let{data:n}=e;return(0,r.jsx)(i.ua7,{side:"right",content:n.available?"available":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.xvT,{children:"unavailable"}),(0,r.jsx)("div",{className:"flex flex-col",children:null===(t=n.errors)||void 0===t?void 0:t.map(e=>(0,r.jsx)(i.xvT,{size:"10",noWrap:!0,children:e},e))})]}),children:(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[n.available&&"ready"===n.status&&(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(l.DI$,{})}),n.available&&"ready"!==n.status&&(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(l.dsj,{})}),!n.available&&(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(l.SmH,{})}),(0,r.jsx)(i.xvT,{size:"12",className:"relative -top-px",children:n.status})]})})}},{id:"readOnly",label:"read/write",category:"general",render:e=>{let{data:t}=e;return t.readOnly?(0,r.jsx)(i.ua7,{content:"Read-only",children:(0,r.jsx)(i.xvT,{children:(0,r.jsx)(l.Lur,{})})}):(0,r.jsx)(i.ua7,{content:"Read and write enabled",children:(0,r.jsx)(i.xvT,{color:"subtle",children:(0,r.jsx)(l.dr6,{})})})}},{id:"storage",label:"storage",category:"general",render:e=>{let{data:t}=e;return(0,r.jsx)("div",{className:"flex gap-1 w-full max-w-[200px] pt-[10px]",children:(0,r.jsx)(i.kod,{variant:"accent",value:t.usedBytes,max:t.totalBytes,label:"".concat((0,u.vW)(t.usedBytes)," / ").concat((0,u.vW)(t.totalBytes))})})}},{id:"successfulReads",label:"successful reads",category:"operations",render:e=>{let{data:t}=e;return(0,r.jsx)(i.m2c,{variant:"value",size:"12",value:t.successfulReads,format:e=>e.toNumber().toLocaleString()})}},{id:"successfulWrites",label:"successful writes",category:"operations",render:e=>{let{data:t}=e;return(0,r.jsx)(i.m2c,{variant:"value",size:"12",value:t.successfulWrites,format:e=>e.toNumber().toLocaleString()})}},{id:"failedReads",label:"failed reads",category:"operations",render:e=>{let{data:t}=e;return(0,r.jsx)(i.m2c,{variant:"value",size:"12",value:t.failedReads,format:e=>e.toNumber().toLocaleString()})}},{id:"failedWrites",label:"failed writes",category:"operations",render:e=>{let{data:t}=e;return(0,r.jsx)(i.m2c,{variant:"value",size:"12",value:t.failedWrites,format:e=>e.toNumber().toLocaleString()})}}];var p=n(6391),m=n.n(p);let v=(0,a.createContext)({}),g=()=>(0,a.useContext)(v);function y(e){let{children:t}=e,n=function(){let{configurableColumns:e,enabledColumns:t,toggleColumnVisibility:n,setColumnsVisible:r,setColumnsHidden:l,toggleSort:c,setSortDirection:d,setSortField:f,sortField:p,sortDirection:v,resetDefaultColumnVisibility:g}=(0,i.oy6)("hostd/v0/volumes",{columns:h,columnsDefaultVisible:s}),y=(0,o.Fn)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.find(e=>!["ready","unavailable"].includes(e.status)))?(0,i.XBW)(5):(0,i.XBW)(60)}}}),x=function(e){let{response:t}=e;return(0,a.useMemo)(()=>{var e;return t.data?(null===(e=t.data)||void 0===e?void 0:e.map(e=>({id:String(e.id),localPath:e.localPath,usedSectors:e.usedSectors,usedBytes:new(m())(e.usedSectors).times((0,u.B$)(4)).toNumber(),totalBytes:new(m())(e.totalSectors).times((0,u.B$)(4)).toNumber(),totalSectors:e.totalSectors,status:e.status,readOnly:e.readOnly,available:e.available,failedReads:new(m())(e.failedReads),failedWrites:new(m())(e.failedWrites),successfulReads:new(m())(e.successfulReads),successfulWrites:new(m())(e.successfulWrites),errors:e.errors})))||[]:null},[t.data])}({response:y}),b=(0,a.useMemo)(()=>h.filter(e=>t.includes(e.id)),[t]),w=y.isValidating,E=y.error,j=(0,i.c2j)(x,w,E,[]);return{dataState:j,totalCount:(null==x?void 0:x.length)||0,isLoading:y.isValidating,columns:b,dataset:x,configurableColumns:e,enabledColumns:t,toggleColumnVisibility:n,setColumnsVisible:r,setColumnsHidden:l,toggleSort:c,setSortDirection:d,setSortField:f,sortField:p,sortDirection:v,resetDefaultColumnVisibility:g}}();return(0,r.jsx)(v.Provider,{value:n,children:t})}},734:function(e,t,n){"use strict";n.d(t,{O:function(){return u},Y:function(){return f}});var r=n(52322),i=n(79798),o=n(92838),a=n(63397),s=n(24511),l=n(22515);function u(e){return{id:"filterContractId",value:e,label:"contract ID is ".concat(e)}}let c={contractId:""},d=s.Ry().shape({contractId:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,o.G)(),p=(0,a.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.contractId)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by contract ID",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Contract ID",name:"contractId",placeholder:"Exact match for contract ID",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},90089:function(e,t,n){"use strict";n.d(t,{B:function(){return o}});var r=n(79798),i=n(27444);function o(){var e;let t=(0,i.On)();return(null===(e=t.data)||void 0===e?void 0:e.network)==="Zen Testnet"?r.nNd.explore.testnetZen:r.nNd.explore.mainnet}},25573:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(95753),i=n(27444);function o(){var e,t,n,o;let{isUnlockedAndAuthedRoute:a}=(0,r.Hv)(),s=(0,i.d$)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.synced)?6e4:1e4}}}),l=(0,i.nH)(),u=s.data?null===(e=s.data)||void 0===e?void 0:e.chainIndex.height:0,c=(0,i.Os)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.scanHeight)>=u?6e4:1e4}}}),d=a&&u&&l?Number((100*Math.min(u/l,1)).toFixed(1)):0,f=a&&u&&c.data?Number((100*Math.min(c.data.scanHeight/l,1)).toFixed(1)):0;return{isSynced:null===(t=s.data)||void 0===t?void 0:t.synced,isWalletSynced:(null===(n=s.data)||void 0===n?void 0:n.synced)&&(null===(o=c.data)||void 0===o?void 0:o.scanHeight)>=u-1,nodeBlockHeight:u,estimatedBlockHeight:l,syncPercent:d,walletScanPercent:f,moreThan100BlocksToSync:!!u&&!!l&&l-u>100,firstTimeSyncing:!!u&&!!l&&l-u>5e4}}},94977:function(e,t,n){"use strict";n.d(t,{B1:function(){return m},K9:function(){return c},LP:function(){return v},SY:function(){return s},c5:function(){return h},co:function(){return l},dK:function(){return g},dz:function(){return a},nS:function(){return d},rZ:function(){return f},s2:function(){return p},sS:function(){return u}});var r=n(25205),i=n(6391),o=n.n(i);let a="/TB/month";function s(e){return new(o())(e).times((0,r.xf)(1)).times((0,r.S5)(1))}let l="/million";function u(e){return new(o())(e).times(1e7)}let c="/million";function d(e){return new(o())(e).times(1e7)}let f="/TB/month";function h(e){return new(o())(e).times((0,r.xf)(1)).times((0,r.S5)(1))}let p="/TB";function m(e){return new(o())(e).times((0,r.xf)(1))}let v="/TB";function g(e){return new(o())(e).times((0,r.xf)(1))}},76133:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var r=n(52322);n(37832);var i=n(79798),o=n(92838),a=n(5187),s=n(22515),l=n(78743),u=n(99957),c=n(41775),d=n(25573),f=n(71930),h=n(27444),p=n(6391),m=n.n(p),v=n(25205),g=n(95753),y=n(92762);function x(){var e;let{isUnlockedAndAuthedRoute:t}=(0,g.Hv)(),{openDialog:n}=(0,s.Rh)(),{dataset:o}=(0,l.F)(),a=(0,h.rV)(),u=(0,h.Os)(),[p,x]=(0,y.Z)("v0/hostd/onboarding/maximized",{defaultValue:!0}),w=(0,d.n)();if(!t)return null;let E=new(m())(u.data?u.data.confirmed+u.data.unconfirmed:0),j=(0,v.qN)(0),k=u.data&&E.gt(j),S=(null==o?void 0:o.length)>0,_=null===(e=a.data)||void 0===e?void 0:e.acceptingContracts,O=w.isSynced,C=[k,S,_,O],M=C.length,A=C.filter(e=>e).length;return M===A?null:p?(0,r.jsx)("div",{className:"z-20 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.s_4,{className:"w-[400px] flex flex-col max-h-[600px]",children:(0,r.jsxs)(i.xrM,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)(i.TRl,{}),(0,r.jsx)(i.xvT,{size:"20",weight:"semibold",children:"Welcome to Sia"})]}),(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>x(!1),children:(0,r.jsx)(c.mli,{})})]}),(0,r.jsx)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:(0,r.jsx)(i.xvT,{size:"14",children:"Get set up by completing the following steps. Once they are complete, your host is ready to store data."})}),(0,r.jsx)(b,{title:(0,r.jsx)(i.rUS,{href:f._.wallet.view,onClick:()=>n("addressDetails"),ellipsis:!0,size:"14",underline:"hover",children:"Step 1: Fund your wallet"}),description:"Fund your wallet with siacoin to cover required contract collateral.".concat(w.isWalletSynced?"":" Balance will not be accurate until wallet is finished scanning."),action:k?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(c.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[!w.isWalletSynced&&(0,r.jsx)(i.ua7,{content:"Wallet scanning progress ".concat(w.walletScanPercent,"%"),children:(0,r.jsxs)(i.xvT,{size:"14",children:[w.walletScanPercent,"%"]})}),(0,r.jsx)(i.rUS,{href:f._.wallet.view,onClick:()=>n("addressDetails"),children:(0,r.jsx)(c.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(c.Fs9,{})})]})}),(0,r.jsx)(b,{title:(0,r.jsx)(i.rUS,{href:f._.volumes.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 2: Add a volume"}),description:"Add a system volume that will be used to store data.",action:S?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(c.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.rUS,{href:f._.volumes.index,children:(0,r.jsx)(c.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(c.Fs9,{})})]})}),(0,r.jsx)(b,{title:(0,r.jsx)(i.rUS,{href:f._.config.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 3: Configure pricing and settings"}),description:"Configure your host's pricing and settings and start accepting contracts.",action:_?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(c.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.rUS,{href:f._.config.index,children:(0,r.jsx)(c.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(c.Fs9,{})})]})}),(0,r.jsx)(b,{title:(0,r.jsx)(i.rUS,{href:f._.node.index,underline:"hover",ellipsis:!0,size:"14",children:"Step 4: Wait for the blockchain to sync"}),description:"The blockchain will sync in the background, this takes some time. No user action required.",action:O?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(c.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.xvT,{ellipsis:!0,size:"14",children:[w.syncPercent,"%"]}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(c.hzZ,{})})]})})]})})}):(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.zxk,{onClick:()=>x(!0),size:"large",className:"flex gap-3 !px-3",children:(0,r.jsxs)(i.xvT,{className:"flex items-center gap-1",children:[(0,r.jsx)(i.TRl,{}),"Setup: ",A,"/",M," steps complete"]})})})}function b(e){let{title:t,action:n,description:o}=e;return(0,r.jsx)("div",{className:"border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)("div",{className:"flex-1 flex items-center",children:t}),n]}),(0,r.jsx)("div",{className:"pr-5",children:(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:o})})]})})}var w=n(63171);function E(e){let{children:t}=e;return(0,r.jsx)(s.Tu,{children:(0,r.jsx)(u.iV,{children:(0,r.jsx)(w.v,{children:(0,r.jsx)(l.Y,{children:(0,r.jsx)(o.x,{children:(0,r.jsxs)(a.C,{children:[(0,r.jsx)(s.xQ,{}),(0,r.jsx)(x,{}),t]})})})})})})}var j=n(1240),k=n.n(j),S=n(49854),_=n.n(S),O=n(82851);let C=(0,O.cx)(k().variable,_().variable);function M(e){let{Component:t,pageProps:n}=e;return(0,r.jsx)(i.PD$,{className:C,fallback:n.fallback,passwordProtectRequestHooks:!0,lockRoutes:f._,children:(0,r.jsx)(E,{children:(0,r.jsx)(t,{...n})})})}},79798:function(e,t,n){"use strict";let r,i,o,a;n.d(t,{hcY:function(){return SI},tU3:function(){return SL},zXq:function(){return S1},juT:function(){return Ss},Cts:function(){return lf},Z58:function(){return _R},WVB:function(){return c_},zxk:function(){return s5},b0u:function(){return EP},EKh:function(){return lm},vRO:function(){return Ot},QHy:function(){return _J},TaT:function(){return _$},eQh:function(){return lg},HfT:function(){return _2},ncR:function(){return k$},A06:function(){return _z},Vy9:function(){return _I},VqE:function(){return l3},h_2:function(){return cT},Xiv:function(){return cP},Juw:function(){return cN},KpP:function(){return cR},XOF:function(){return kq},jIp:function(){return On},QBj:function(){return Or},yEL:function(){return SK},cB7:function(){return kJ},ZqQ:function(){return kQ},IKw:function(){return k5},WN2:function(){return Ov},X6q:function(){return cz},Yqd:function(){return fb},__J:function(){return cY},rUS:function(){return cK},TRl:function(){return cJ},kFS:function(){return cO},FzK:function(){return _X},Clw:function(){return cS},PD$:function(){return Ol},Wxm:function(){return fk},uDJ:function(){return k7},wFK:function(){return k9},s_4:function(){return tG},nvN:function(){return t$},u5Q:function(){return _D},j4H:function(){return fw},J2e:function(){return df},kod:function(){return d_},xrM:function(){return l1},PhF:function(){return fj},Z0O:function(){return cb},DLL:function(){return _k},KJW:function(){return Sd},rsf:function(){return fI},D_D:function(){return _p},iA_:function(){return k6},t6k:function(){return _4},xvT:function(){return tq},nvn:function(){return dJ},ua7:function(){return s4},mPE:function(){return _m},XxW:function(){return ky},m2c:function(){return kS},ho9:function(){return kk},QUh:function(){return __},weF:function(){return _t},YNn:function(){return _y},DmW:function(){return _x},O9T:function(){return mJ},fVJ:function(){return _T},vQq:function(){return kl},NrH:function(){return EO},Y_Z:function(){return _O},EJC:function(){return Og},kOJ:function(){return _A},OQF:function(){return _C},leQ:function(){return kf},ytg:function(){return E_},Vkc:function(){return cE},sWj:function(){return ES},z$:function(){return tY},XBW:function(){return EC},x9T:function(){return Op},bjP:function(){return Om},I13:function(){return kc},cEb:function(){return dQ},OHV:function(){return ko},OPV:function(){return ki},$Gg:function(){return ku},Y97:function(){return SD},c2j:function(){return SF},WsO:function(){return SX},Uu5:function(){return Oh},oy6:function(){return Of},nNd:function(){return _b}});var s,l,u,c,d,f,h,p,m,v,g,y,x=n(52322),b=n(2784),w=n.t(b,2),E=n(7896),j=n(34540),k=n(26215),S=n(99575);function _(e){let t=e+"CollectionProvider",[n,r]=(0,j.b)(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=b.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(a,n),s=(0,k.e)(t,i.collectionRef);return b.createElement(S.g7,{ref:s},r)}),l=e+"CollectionItemSlot",u="data-radix-collection-item",c=b.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=b.useRef(null),s=(0,k.e)(t,a),c=o(l,n);return b.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>void c.itemMap.delete(a))),b.createElement(S.g7,{[u]:"",ref:s},r)});return[{Provider:e=>{let{scope:t,children:n}=e,r=b.useRef(null),o=b.useRef(new Map).current;return b.createElement(i,{scope:t,itemMap:o,collectionRef:r},n)},Slot:s,ItemSlot:c},function(t){let n=o(e+"CollectionConsumer",t),r=b.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()),i=r.sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current));return i},[n.collectionRef,n.itemMap]);return r},r]}var O=n(41816),C=n(73597),M=n(72130),A=n(64680),T=n(28245),P=n(26074);let N="Collapsible",[R,D]=(0,j.b)(N),[L,F]=R(N),V=((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l=!1,u]=(0,C.T)({prop:r,defaultProp:i,onChange:a});return(0,b.createElement)(L,{scope:n,disabled:o,contentId:(0,P.M)(),open:l,onOpenToggle:(0,b.useCallback)(()=>u(e=>!e),[u])},(0,b.createElement)(M.WV.div,(0,E.Z)({"data-state":I(l),"data-disabled":o?"":void 0},s,{ref:t})))},"CollapsibleContent"),z=((e,t)=>{let{forceMount:n,...r}=e,i=F(V,e.__scopeCollapsible);return(0,b.createElement)(T.z,{present:n||i.open},({present:e})=>(0,b.createElement)(z,(0,E.Z)({},r,{ref:t,present:e})))},(0,b.forwardRef)((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...o}=e,a=F(V,n),[s,l]=(0,b.useState)(r),u=(0,b.useRef)(null),c=(0,k.e)(t,u),d=(0,b.useRef)(0),f=d.current,h=(0,b.useRef)(0),p=h.current,m=a.open||s,v=(0,b.useRef)(m),g=(0,b.useRef)();return(0,b.useEffect)(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,A.b)(()=>{let e=u.current;if(e){g.current=g.current||{transitionDuration:e.style.transitionDuration,animationDuration:e.style.animationDuration,animationFillMode:e.style.animationFillMode},e.style.transitionDuration="0s",e.style.animationDuration="0s",e.style.animationFillMode="none";let t=e.getBoundingClientRect();d.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=g.current.transitionDuration,e.style.animationDuration=g.current.animationDuration,e.style.animationFillMode=g.current.animationFillMode),l(r)}},[a.open,r]),(0,b.createElement)(M.WV.div,(0,E.Z)({"data-state":I(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m},o,{ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)}));function I(e){return e?"open":"closed"}let Z="Accordion",B=["Home","End","ArrowDown","ArrowUp"],[H,U,W]=_(Z),[q,$]=(0,j.b)(Z,[W,D]),Y=(D(),b.forwardRef((e,t)=>{let{type:n,...r}=e;return b.createElement(H.Provider,{scope:e.__scopeAccordion},"multiple"===n?b.createElement(ee,(0,E.Z)({},r,{ref:t})):b.createElement(J,(0,E.Z)({},r,{ref:t})))}));Y.propTypes={type(e){let t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===e.type&&"string"==typeof t?Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(t)?Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};let[G,X]=q(Z),[K,Q]=q(Z,{collapsible:!1}),J=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...a}=e,[s,l]=(0,C.T)({prop:n,defaultProp:r,onChange:i});return b.createElement(G,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:b.useCallback(()=>o&&l(""),[o,l])},b.createElement(K,{scope:e.__scopeAccordion,collapsible:o},b.createElement(er,(0,E.Z)({},a,{ref:t}))))}),ee=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[a=[],s]=(0,C.T)({prop:n,defaultProp:r,onChange:i}),l=b.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=b.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return b.createElement(G,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:u},b.createElement(K,{scope:e.__scopeAccordion,collapsible:!0},b.createElement(er,(0,E.Z)({},o,{ref:t}))))}),[et,en]=q(Z),er=b.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,...i}=e,o=b.useRef(null),a=(0,k.e)(o,t),s=U(n),l=(0,O.M)(e.onKeyDown,e=>{var t;if(!B.includes(e.key))return;let n=e.target,r=s().filter(e=>{var t;return!(null!==(t=e.ref.current)&&void 0!==t&&t.disabled)}),i=r.findIndex(e=>e.ref.current===n),o=r.length;if(-1===i)return;e.preventDefault();let a=i;switch(e.key){case"Home":a=0;break;case"End":a=o-1;break;case"ArrowDown":a=i+1;break;case"ArrowUp":(a=i-1)<0&&(a=o-1)}let l=a%o;null===(t=r[l].ref.current)||void 0===t||t.focus()});return b.createElement(et,{scope:n,disabled:r},b.createElement(H.Slot,{scope:n},b.createElement(M.WV.div,(0,E.Z)({},i,{ref:a,onKeyDown:r?void 0:l}))))}),[ei,eo]=q("AccordionItem");var ea=n(82851),es=n(83317);function el(e){return e.split("-")[0]}function eu(e){return e.split("-")[1]}function ec(e){return["top","bottom"].includes(el(e))?"x":"y"}function ed(e){return"y"===e?"height":"width"}function ef(e,t,n){let r,{reference:i,floating:o}=e,a=i.x+i.width/2-o.width/2,s=i.y+i.height/2-o.height/2,l=ec(t),u=ed(l),c=i[u]/2-o[u]/2,d="x"===l;switch(el(t)){case"top":r={x:a,y:i.y-o.height};break;case"bottom":r={x:a,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:s};break;case"left":r={x:i.x-o.width,y:s};break;default:r={x:i.x,y:i.y}}switch(eu(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}let eh=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await (null==a.isRTL?void 0:a.isRTL(t)),l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:c}=ef(l,r,s),d=r,f={},h=0;for(let n=0;n({name:"arrow",options:e,async fn(t){let{element:n,padding:r=0}=null!=e?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(null==n)return{};let u=ep(r),c={x:i,y:o},d=ec(a),f=eu(a),h=ed(d),p=await l.getDimensions(n),m="y"===d?"top":"left",v="y"===d?"bottom":"right",g=s.reference[h]+s.reference[d]-c[d]-s.floating[h],y=c[d]-s.reference[d],x=await (null==l.getOffsetParent?void 0:l.getOffsetParent(n)),b=x?"y"===d?x.clientHeight||0:x.clientWidth||0:0;0===b&&(b=s.floating[h]);let w=u[m],E=b-p[h]-u[v],j=b/2-p[h]/2+(g/2-y/2),k=ey(w,eg(j,E)),S=("start"===f?u[m]:u[v])>0&&j!==k&&s.reference[h]<=s.floating[h];return{[d]:c[d]-(S?jeb[e])}let eE={start:"end",end:"start"};function ej(e){return e.replace(/start|end/g,e=>eE[e])}let ek=["top","right","bottom","left"];ek.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let eS=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,i,o;let{placement:a,middlewareData:s,rects:l,initialPlacement:u,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...g}=e,y=el(a),x=p||(y!==u&&v?function(e){let t=ew(e);return[ej(e),t,ej(t)]}(u):[ew(u)]),b=[u,...x],w=await ev(t,g),E=[],j=(null==(n=s.flip)?void 0:n.overflows)||[];if(f&&E.push(w[y]),h){let{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);let r=eu(e),i=ec(e),o=ed(i),a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=ew(a)),{main:a,cross:ew(a)}}(a,l,await (null==c.isRTL?void 0:c.isRTL(d.floating)));E.push(w[e],w[t])}if(j=[...j,{placement:a,overflows:E}],!E.every(e=>e<=0)){let e=(null!=(r=null==(i=s.flip)?void 0:i.index)?r:0)+1,t=b[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n="bottom";switch(m){case"bestFit":{let e=null==(o=j.map(e=>[e,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0].placement;e&&(n=e);break}case"initialPlacement":n=u}if(a!==n)return{reset:{placement:n}}}return{}}}};function e_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eO(e){return ek.some(t=>e[t]>=0)}let eC=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){let{rects:r}=e;switch(t){case"referenceHidden":{let t=e_(await ev(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:eO(t)}}}case"escaped":{let t=e_(await ev(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:eO(t)}}}default:return{}}}}},eM=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){let{x:n,y:r}=t,i=await async function(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),a=el(n),s=eu(n),l="x"===ec(n),u=["left","top"].includes(a)?-1:1,c=o&&l?-1:1,d="function"==typeof t?t(e):t,{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function eA(e){return"x"===e?"y":"x"}let eT=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,u={x:n,y:r},c=await ev(t,l),d=ec(el(i)),f=eA(d),h=u[d],p=u[f];if(o){let e="y"===d?"bottom":"right";h=ey(h+c["y"===d?"top":"left"],eg(h,h-c[e]))}a&&(p=ey(p+c["y"===f?"top":"left"],eg(p,p-c["y"===f?"bottom":"right"])));let m=s.fn({...t,[d]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},eP=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,c={x:n,y:r},d=ec(i),f=eA(d),h=c[d],p=c[f],m="function"==typeof s?s({...o,placement:i}):s,v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,n=o.reference[d]+o.reference[e]-v.mainAxis;hn&&(h=n)}if(u){var g,y,x,b;let e="y"===d?"width":"height",t=["top","left"].includes(el(i)),n=o.reference[f]-o.floating[e]+(t&&null!=(g=null==(y=a.offset)?void 0:y[f])?g:0)+(t?0:v.crossAxis),r=o.reference[f]+o.reference[e]+(t?0:null!=(x=null==(b=a.offset)?void 0:b[f])?x:0)-(t?v.crossAxis:0);pr&&(p=r)}return{[d]:h,[f]:p}}}};function eN(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function eR(e){if(null==e)return window;if(!eN(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function eD(e){return eR(e).getComputedStyle(e)}function eL(e){return eN(e)?"":e?(e.nodeName||"").toLowerCase():""}function eF(){let e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function eV(e){return e instanceof eR(e).HTMLElement}function ez(e){return e instanceof eR(e).Element}function eI(e){return"undefined"!=typeof ShadowRoot&&(e instanceof eR(e).ShadowRoot||e instanceof ShadowRoot)}function eZ(e){let{overflow:t,overflowX:n,overflowY:r}=eD(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function eB(e){let t=/firefox/i.test(eF()),n=eD(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function eH(){return!/^((?!chrome|android).)*safari/i.test(eF())}let eU=Math.min,eW=Math.max,eq=Math.round;function e$(e,t,n){var r,i,o,a;void 0===t&&(t=!1),void 0===n&&(n=!1);let s=e.getBoundingClientRect(),l=1,u=1;t&&eV(e)&&(l=e.offsetWidth>0&&eq(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&eq(s.height)/e.offsetHeight||1);let c=ez(e)?eR(e):window,d=!eH()&&n,f=(s.left+(d&&null!=(r=null==(i=c.visualViewport)?void 0:i.offsetLeft)?r:0))/l,h=(s.top+(d&&null!=(o=null==(a=c.visualViewport)?void 0:a.offsetTop)?o:0))/u,p=s.width/l,m=s.height/u;return{width:p,height:m,top:h,right:f+p,bottom:h+m,left:f,x:f,y:h}}function eY(e){return((e instanceof eR(e).Node?e.ownerDocument:e.document)||window.document).documentElement}function eG(e){return ez(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function eX(e){return e$(eY(e)).left+eG(e).scrollLeft}function eK(e){return"html"===eL(e)?e:e.assignedSlot||e.parentNode||(eI(e)?e.host:null)||eY(e)}function eQ(e){return eV(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function eJ(e){let t=eR(e),n=eQ(e);for(;n&&["table","td","th"].includes(eL(n))&&"static"===getComputedStyle(n).position;)n=eQ(n);return n&&("html"===eL(n)||"body"===eL(n)&&"static"===getComputedStyle(n).position&&!eB(n))?t:n||function(e){let t=eK(e);for(eI(t)&&(t=t.host);eV(t)&&!["html","body"].includes(eL(t));){if(eB(t))return t;t=t.parentNode}return null}(e)||t}function e0(e){if(eV(e))return{width:e.offsetWidth,height:e.offsetHeight};let t=e$(e);return{width:t.width,height:t.height}}function e1(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=eK(t);return["html","body","#document"].includes(eL(n))?t.ownerDocument.body:eV(n)&&eZ(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=eR(r),a=i?[o].concat(o.visualViewport||[],eZ(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(e1(a))}function e2(e,t,n){return"viewport"===t?em(function(e,t){let n=eR(e),r=eY(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;let e=eH();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n)):ez(t)?function(e,t){let n=e$(e,!1,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):em(function(e){var t;let n=eY(e),r=eG(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=eW(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=eW(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+eX(e),l=-r.scrollTop;return"rtl"===eD(i||n).direction&&(s+=eW(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(eY(e)))}let e4={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?function(e){let t=e1(e),n=["absolute","fixed"].includes(eD(e).position)&&eV(e)?eJ(e):e;return ez(n)?t.filter(e=>ez(e)&&function(e,t){let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&eI(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==eL(e)):[]}(t):[].concat(n),r],a=o[0],s=o.reduce((e,n)=>{let r=e2(t,n,i);return e.top=eW(r.top,e.top),e.right=eU(r.right,e.right),e.bottom=eU(r.bottom,e.bottom),e.left=eW(r.left,e.left),e},e2(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=eV(n),o=eY(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==eL(n)||eZ(o))&&(a=eG(n)),eV(n))){let e=e$(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:ez,getDimensions:e0,getOffsetParent:eJ,getDocumentElement:eY,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:function(e,t,n){let r=eV(t),i=eY(t),o=e$(e,r&&function(e){let t=e$(e);return eq(t.width)!==e.offsetWidth||eq(t.height)!==e.offsetHeight}(t),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n){if(("body"!==eL(t)||eZ(i))&&(a=eG(t)),eV(t)){let e=e$(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=eX(i))}return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}(t,eJ(n),r),floating:{...e0(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===eD(e).direction};function e3(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,c=l||u?[...ez(e)?e1(e):[],...e1(t)]:[];c.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),u&&e.addEventListener("resize",n)});let d,f=null;if(a){let r=!0;f=new ResizeObserver(()=>{r||n(),r=!1}),ez(e)&&!s&&f.observe(e),f.observe(t)}let h=s?e$(e):null;return s&&function t(){let r=e$(e);h&&(r.x!==h.x||r.y!==h.y||r.width!==h.width||r.height!==h.height)&&n(),h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{l&&e.removeEventListener("scroll",n),u&&e.removeEventListener("resize",n)}),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(d)}}let e5=(e,t,n)=>eh(e,t,{platform:e4,...n});var e6=n(28316),e8="undefined"!=typeof document?b.useLayoutEffect:b.useEffect;function e7(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=void 0===e?{}:e,o=b.useRef(null),a=b.useRef(null),s=function(e){let t=b.useRef(e);return e8(()=>{t.current=e}),t}(i),l=b.useRef(null),[u,c]=b.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[d,f]=b.useState(t);!function e(t,n){let r,i,o;if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let r=o[i];if(("_owner"!==r||!t.$$typeof)&&!e(t[r],n[r]))return!1}return!0}return t!=t&&n!=n}(null==d?void 0:d.map(e=>{let{options:t}=e;return t}),null==t?void 0:t.map(e=>{let{options:t}=e;return t}))&&f(t);let h=b.useCallback(()=>{o.current&&a.current&&e5(o.current,a.current,{middleware:d,placement:n,strategy:r}).then(e=>{p.current&&e6.flushSync(()=>{c(e)})})},[d,n,r]);e8(()=>{p.current&&h()},[h]);let p=b.useRef(!1);e8(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=b.useCallback(()=>{if("function"==typeof l.current&&(l.current(),l.current=null),o.current&&a.current){if(s.current){let e=s.current(o.current,a.current,h);l.current=e}else h()}},[h,s]),v=b.useCallback(e=>{o.current=e,m()},[m]),g=b.useCallback(e=>{a.current=e,m()},[m]),y=b.useMemo(()=>({reference:o,floating:a}),[]);return b.useMemo(()=>({...u,update:h,refs:y,reference:v,floating:g}),[u,h,y,v,g])}let e9=e=>{let{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){if(Object.prototype.hasOwnProperty.call(t,"current")){if(null!=t.current)return ex({element:t.current,padding:n}).fn(e)}else if(t)return ex({element:t,padding:n}).fn(e);return{}}}},te=(0,b.forwardRef)((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,b.createElement)(M.WV.svg,(0,E.Z)({},o,{ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,b.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function tt(e){let[t,n]=(0,b.useState)(void 0);return(0,A.b)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}let tn="Popper",[tr,ti]=(0,j.b)(tn),[to,ta]=tr(tn),ts=(0,b.forwardRef)((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,o=ta("PopperAnchor",n),a=(0,b.useRef)(null),s=(0,k.e)(t,a);return(0,b.useEffect)(()=>{o.onAnchorChange((null==r?void 0:r.current)||a.current)}),r?null:(0,b.createElement)(M.WV.div,(0,E.Z)({},i,{ref:s}))}),tl="PopperContent",[tu,tc]=tr(tl),[td,tf]=tr(tl,{hasParent:!1,positionUpdateFns:new Set}),th=(0,b.forwardRef)((e,t)=>{var n,r,i,o,a,s,l,u;let{__scopePopper:c,side:d="bottom",sideOffset:f=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:x=!1,avoidCollisions:w=!0,...E}=e,j=ta(tl,c),[S,_]=(0,b.useState)(null),O=(0,k.e)(t,e=>_(e)),[C,T]=(0,b.useState)(null),P=tt(C),N=null!==(n=null==P?void 0:P.width)&&void 0!==n?n:0,R=null!==(r=null==P?void 0:P.height)&&void 0!==r?r:0,D="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},L=Array.isArray(v)?v:[v],F=L.length>0,V={padding:D,boundary:L.filter(tg),altBoundary:F},{reference:z,floating:I,strategy:Z,x:B,y:H,placement:U,middlewareData:W,update:q}=e7({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:e3,middleware:[eM({mainAxis:f+R,alignmentAxis:p}),w?eT({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?eP():void 0,...V}):void 0,C?e9({element:C,padding:m}):void 0,w?eS({...V}):void 0,ty({arrowWidth:N,arrowHeight:R}),x?eC({strategy:"referenceHidden"}):void 0].filter(tv)});(0,A.b)(()=>{z(j.anchor)},[z,j.anchor]);let $=null!==B&&null!==H,[Y,G]=tx(U),X=null===(i=W.arrow)||void 0===i?void 0:i.x,K=null===(o=W.arrow)||void 0===o?void 0:o.y,Q=(null===(a=W.arrow)||void 0===a?void 0:a.centerOffset)!==0,[J,ee]=(0,b.useState)();(0,A.b)(()=>{S&&ee(window.getComputedStyle(S).zIndex)},[S]);let{hasParent:et,positionUpdateFns:en}=tf(tl,c),er=!et;(0,b.useLayoutEffect)(()=>{if(!er)return en.add(q),()=>{en.delete(q)}},[er,en,q]),(0,b.useLayoutEffect)(()=>{er&&$&&Array.from(en).reverse().forEach(e=>requestAnimationFrame(e))},[er,$,en]);let ei={"data-side":Y,"data-align":G,...E,ref:O,style:{...E.style,animation:$?void 0:"none",opacity:null!==(s=W.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return(0,b.createElement)("div",{ref:I,"data-radix-popper-content-wrapper":"",style:{position:Z,left:0,top:0,transform:$?`translate3d(${Math.round(B)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[null===(l=W.transformOrigin)||void 0===l?void 0:l.x,null===(u=W.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},(0,b.createElement)(tu,{scope:c,placedSide:Y,onArrowChange:T,arrowX:X,arrowY:K,shouldHideArrow:Q},er?(0,b.createElement)(td,{scope:c,hasParent:!0,positionUpdateFns:en},(0,b.createElement)(M.WV.div,ei)):(0,b.createElement)(M.WV.div,ei)))}),tp={top:"bottom",right:"left",bottom:"top",left:"right"},tm=(0,b.forwardRef)(function(e,t){let{__scopePopper:n,...r}=e,i=tc("PopperArrow",n),o=tp[i.placedSide];return(0,b.createElement)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},(0,b.createElement)(te,(0,E.Z)({},r,{ref:t,style:{...r.style,display:"block"}})))});function tv(e){return void 0!==e}function tg(e){return null!==e}let ty=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;let{placement:s,rects:l,middlewareData:u}=t,c=(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,p]=tx(s),m={start:"0%",center:"50%",end:"100%"}[p],v=(null!==(r=null===(i=u.arrow)||void 0===i?void 0:i.x)&&void 0!==r?r:0)+d/2,g=(null!==(o=null===(a=u.arrow)||void 0===a?void 0:a.y)&&void 0!==o?o:0)+f/2,y="",x="";return"bottom"===h?(y=c?m:`${v}px`,x=`${-f}px`):"top"===h?(y=c?m:`${v}px`,x=`${l.floating.height+f}px`):"right"===h?(y=`${-f}px`,x=c?m:`${g}px`):"left"===h&&(y=`${l.floating.width+f}px`,x=c?m:`${g}px`),{data:{x:y,y:x}}}});function tx(e){let[t,n="center"]=e.split("-");return[t,n]}let tb=e=>{let{__scopePopper:t,children:n}=e,[r,i]=(0,b.useState)(null);return(0,b.createElement)(to,{scope:t,anchor:r,onAnchorChange:i},n)};var tw=n(6500);let tE=(0,b.forwardRef)((e,t)=>(0,b.createElement)(M.WV.span,(0,E.Z)({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),[tj,tk]=(0,j.b)("Tooltip",[ti]),tS=ti(),t_="tooltip.open",[tO,tC]=tj("TooltipProvider"),tM="Tooltip",[tA,tT]=tj(tM),tP="TooltipTrigger",tN=(0,b.forwardRef)((e,t)=>{let{__scopeTooltip:n,...r}=e,i=tT(tP,n),o=tC(tP,n),a=tS(n),s=(0,b.useRef)(null),l=(0,k.e)(t,s,i.onTriggerChange),u=(0,b.useRef)(!1),c=(0,b.useRef)(!1),d=(0,b.useCallback)(()=>u.current=!1,[]);return(0,b.useEffect)(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,b.createElement)(ts,(0,E.Z)({asChild:!0},a),(0,b.createElement)(M.WV.button,(0,E.Z)({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:(0,O.M)(e.onPointerMove,e=>{"touch"===e.pointerType||c.current||o.isPointerInTransitRef.current||(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:(0,O.M)(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:(0,O.M)(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:(0,O.M)(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:(0,O.M)(e.onBlur,i.onClose),onClick:(0,O.M)(e.onClick,e=>{let t=0===e.detail;t&&i.onClose()})})))}),tR="TooltipPortal",[tD,tL]=tj(tR,{forceMount:void 0}),tF="TooltipContent",tV=(0,b.forwardRef)((e,t)=>{let n=tL(tF,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=tT(tF,e.__scopeTooltip);return(0,b.createElement)(T.z,{present:r||a.open},a.disableHoverableContent?(0,b.createElement)(tB,(0,E.Z)({side:i},o,{ref:t})):(0,b.createElement)(tz,(0,E.Z)({side:i},o,{ref:t})))}),tz=(0,b.forwardRef)((e,t)=>{let n=tT(tF,e.__scopeTooltip),r=tC(tF,e.__scopeTooltip),i=(0,b.useRef)(null),o=(0,k.e)(t,i),[a,s]=(0,b.useState)(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=(0,b.useCallback)(()=>{s(null),d(!1)},[d]),h=(0,b.useCallback)((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:return null}}(r,n.getBoundingClientRect()),o="right"===i||"bottom"===i?-5:5,a="right"===i||"left"===i?{x:e.clientX+o,y:e.clientY}:{x:e.clientX,y:e.clientY+o},l=function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect()),u=function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(t)}([a,...l]);s(u),d(!0)},[d]);return(0,b.useEffect)(()=>()=>f(),[f]),(0,b.useEffect)(()=>{if(l&&c){let e=e=>h(e,c),t=e=>h(e,l);return l.addEventListener("pointerleave",e),c.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),c.removeEventListener("pointerleave",t)}}},[l,c,h,f]),(0,b.useEffect)(()=>{if(a){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=(null==l?void 0:l.contains(t))||(null==c?void 0:c.contains(t)),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;er!=u>r&&n<(l-a)*(r-s)/(u-s)+a;c&&(i=!i)}return i}(n,a);r?f():i&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[l,c,a,u,f]),(0,b.createElement)(tB,(0,E.Z)({},e,{ref:o}))}),[tI,tZ]=tj(tM,{isInside:!1}),tB=(0,b.forwardRef)((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=tT(tF,n),u=tS(n),{onClose:c}=l;return(0,b.useEffect)(()=>(document.addEventListener(t_,c),()=>document.removeEventListener(t_,c)),[c]),(0,b.useEffect)(()=>{if(l.trigger){let e=e=>{let t=e.target;null!=t&&t.contains(l.trigger)&&c()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[l.trigger,c]),(0,b.createElement)(es.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:c},(0,b.createElement)(th,(0,E.Z)({"data-state":l.stateAttribute},u,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,b.createElement)(S.A4,null,r),(0,b.createElement)(tI,{scope:n,isInside:!0},(0,b.createElement)(tE,{id:l.contentId,role:"tooltip"},i||r))))}),tH=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=tC(tM,e.__scopeTooltip),u=tS(t),[c,d]=(0,b.useState)(null),f=(0,P.M)(),h=(0,b.useRef)(0),p=null!=a?a:l.disableHoverableContent,m=null!=s?s:l.delayDuration,v=(0,b.useRef)(!1),[g=!1,y]=(0,C.T)({prop:r,defaultProp:i,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(t_))):l.onClose(),null==o||o(e)}}),x=(0,b.useMemo)(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),w=(0,b.useCallback)(()=>{window.clearTimeout(h.current),v.current=!1,y(!0)},[y]),E=(0,b.useCallback)(()=>{window.clearTimeout(h.current),y(!1)},[y]),j=(0,b.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,y(!0)},m)},[m,y]);return(0,b.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,b.createElement)(tb,u,(0,b.createElement)(tA,{scope:t,contentId:f,open:g,stateAttribute:x,trigger:c,onTriggerChange:d,onTriggerEnter:(0,b.useCallback)(()=>{l.isOpenDelayed?j():w()},[l.isOpenDelayed,j,w]),onTriggerLeave:(0,b.useCallback)(()=>{p?E():window.clearTimeout(h.current)},[E,p]),onOpen:w,onClose:E,disableHoverableContent:p},n))},tU=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=tT(tR,t);return(0,b.createElement)(tD,{scope:t,forceMount:n},(0,b.createElement)(T.z,{present:n||o.open},(0,b.createElement)(tw.h,{asChild:!0,container:i},r)))},tW=(0,ea.j)([],{variants:{display:{default:"inline-block",none:""},font:{mono:"font-mono",sans:"font-sans"},color:{verySubtle:"text-gray-700 dark:text-graydark-700",subtle:"text-gray-1000 dark:text-graydark-1000",contrast:"text-gray-1100 dark:text-white",lo:"text-white dark:text-graydark-50",accent:"text-accent-1100 dark:text-accentdark-1100",red:"text-red-700 dark:text-red-400",green:"text-emerald-700 dark:text-emerald-500",amber:"text-amber-600 dark:text-amber-500",none:""},weight:{extrabold:"font-extrabold",bold:"font-bold",medium:"font-medium",semibold:"font-semibold",regular:"font-normal",normal:"font-normal",light:"font-light",none:""},size:{10:"text-xxs",12:"text-xs",14:"text-sm",16:"text-base",18:"text-lg",20:"text-xl",24:"text-2xl",30:"text-3xl",36:"text-4xl",40:"text-5xl",48:"text-5xl",60:"text-6xl",64:"text-6xl"},scaleSize:{12:"text-xxs md:text-xs",14:"text-xs md:text-sm",16:"text-sm md:text-base",18:"text-base md:text-lg",20:"text-base md:text-xl",24:"text-xl md:text-2xl",30:"text-2xl md:text-3xl",36:"text-3xl md:text-4xl",40:"text-4xl md:text-5xl",48:"text-4xl md:text-5xl",60:"text-5xl md:text-6xl",64:"text-5xl md:text-6xl"},noWrap:{true:"whitespace-nowrap"},underline:{accent:"underline underline-offset-2 decoration-2 decoration-accent-900 dark:decoration-accentdark-900",show:"underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",hover:"hover:underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",none:""},ellipsis:{true:"overflow-hidden text-ellipsis whitespace-nowrap"},wrapEllipsis:{true:"overflow-hidden text-ellipsis"}},defaultVariants:{display:"default",weight:"regular",font:"sans",color:"contrast",underline:"none"}}),tq=b.forwardRef((e,t)=>{let{tag:n="span",className:r,font:i,color:o,weight:a,size:s,scaleSize:l,noWrap:u,underline:c,ellipsis:d,wrapEllipsis:f,...h}=e;return(0,x.jsx)(n,{ref:t,className:(0,ea.cx)(r,tW({font:i,color:o,weight:a,size:s,scaleSize:l,underline:c,noWrap:u,ellipsis:d,wrapEllipsis:f})),...h})}),t$=b.forwardRef((e,t)=>{let{size:n="18",...r}=e;return(0,x.jsx)(tq,{tag:"p",...r,ref:t,weight:"regular",scaleSize:n,color:"subtle",className:(0,ea.cx)("leading-relaxed md:leading-relaxed",e.className)})}),tY=(0,ea.j)(["bg-white dark:bg-graydark-200","transition-shadow ease-in-out duration-300","shadow-sm hover:shadow","rounded","border","border-gray-400 dark:border-graydark-400"]),tG=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)("div",{ref:t,className:tY({className:n}),...r})});var tX=n(34406);let tK=(void 0===tX||tX.env,"production"),tQ=1/60*1e3,tJ="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),t0="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(tJ()),tQ),t1=!0,t2=!1,t4=!1,t3={delta:0,timestamp:0},t5=["read","update","preRender","render","postRender"],t6=t5.reduce((e,t)=>(e[t]=function(e){let t=[],n=[],r=0,i=!1,o=!1,a=new WeakSet,s={schedule:(e,o=!1,s=!1)=>{let l=s&&i,u=l?t:n;return o&&a.add(e),-1===u.indexOf(e)&&(u.push(e),l&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length)for(let n=0;nt2=!0),e),{}),t8=t5.reduce((e,t)=>{let n=t6[t];return e[t]=(e,t=!1,r=!1)=>(t2||nn(),n.schedule(e,t,r)),e},{}),t7=t5.reduce((e,t)=>(e[t]=t6[t].cancel,e),{}),t9=t5.reduce((e,t)=>(e[t]=()=>t6[t].process(t3),e),{}),ne=e=>t6[e].process(t3),nt=e=>{t2=!1,t3.delta=t1?tQ:Math.max(Math.min(e-t3.timestamp,40),1),t3.timestamp=e,t4=!0,t5.forEach(ne),t4=!1,t2&&(t1=!1,t0(nt))},nn=()=>{t2=!0,t1=!0,t4||t0(nt)},nr=()=>t3,ni="undefined"!=typeof document,no=ni?b.useLayoutEffect:b.useEffect;function na(){let e=(0,b.useRef)(!1);return no(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let ns=(0,b.createContext)(null);function nl(e){let t=(0,b.useRef)(null);return null===t.current&&(t.current=e()),t.current}class nu extends b.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function nc({children:e,isPresent:t}){let n=(0,b.useId)(),r=(0,b.useRef)(null),i=(0,b.useRef)({width:0,height:0,top:0,left:0});return(0,b.useInsertionEffect)(()=>{let{width:e,height:o,top:a,left:s}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;let l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
- [data-motion-pop-id="${n}"] {
- position: absolute !important;
- width: ${e}px !important;
- height: ${o}px !important;
- top: ${a}px !important;
- left: ${s}px !important;
- }
- `),()=>{document.head.removeChild(l)}},[t]),b.createElement(nu,{isPresent:t,childRef:r,sizeRef:i},b.cloneElement(e,{ref:r}))}let nd=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{let s=nl(nf),l=(0,b.useId)(),u=(0,b.useMemo)(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:e=>{for(let t of(s.set(e,!0),s.values()))if(!t)return;r&&r()},register:e=>(s.set(e,!1),()=>s.delete(e))}),o?void 0:[n]);return(0,b.useMemo)(()=>{s.forEach((e,t)=>s.set(t,!1))},[n]),b.useEffect(()=>{n||s.size||!r||r()},[n]),"popLayout"===a&&(e=b.createElement(nc,{isPresent:n},e)),b.createElement(ns.Provider,{value:u},e)};function nf(){return new Map}let nh=(0,b.createContext)({});function np(e){return(0,b.useEffect)(()=>()=>e(),[])}let nm=new Set;function nv(e,t,n){e||nm.has(t)||(console.warn(t),n&&console.warn(n),nm.add(t))}let ng=e=>e.key||"",ny=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",nv(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=function(){let e=na(),[t,n]=(0,b.useState)(0),r=(0,b.useCallback)(()=>{e.current&&n(t+1)},[t]),i=(0,b.useCallback)(()=>t8.postRender(r),[r]);return[i,t]}(),l=(0,b.useContext)(nh).forceRender;l&&(s=l);let u=na(),c=function(e){let t=[];return b.Children.forEach(e,e=>{(0,b.isValidElement)(e)&&t.push(e)}),t}(e),d=c,f=new Set,h=(0,b.useRef)(d),p=(0,b.useRef)(new Map).current,m=(0,b.useRef)(!0);if(no(()=>{m.current=!1,function(e,t){e.forEach(e=>{let n=ng(e);t.set(n,e)})}(c,p),h.current=d}),np(()=>{m.current=!0,p.clear(),f.clear()}),m.current)return b.createElement(b.Fragment,null,d.map(e=>b.createElement(nd,{key:ng(e),isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:o,mode:a},e)));d=[...d];let v=h.current.map(ng),g=c.map(ng),y=v.length;for(let e=0;e{if(-1!==g.indexOf(e))return;let n=p.get(e);if(!n)return;let i=v.indexOf(e);d.splice(i,0,b.createElement(nd,{key:ng(n),isPresent:!1,onExitComplete:()=>{p.delete(e),f.delete(e);let t=h.current.findIndex(t=>t.key===e);if(h.current.splice(t,1),!f.size){if(h.current=c,!1===u.current)return;s(),r&&r()}},custom:t,presenceAffectsLayout:o,mode:a},n))}),d=d.map(e=>{let t=e.key;return f.has(t)?e:b.createElement(nd,{key:ng(e),isPresent:!0,presenceAffectsLayout:o,mode:a},e)}),"production"!==tK&&"wait"===a&&d.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),b.createElement(b.Fragment,null,f.size?d:d.map(e=>(0,b.cloneElement)(e)))},nx=(0,b.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),nb=(0,b.createContext)({}),nw=(0,b.createContext)({strict:!1});function nE(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function nj(e){return"string"==typeof e||Array.isArray(e)}function nk(e){return"object"==typeof e&&"function"==typeof e.start}let nS=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function n_(e){return nk(e.animate)||nS.some(t=>nj(e[t]))}function nO(e){return!!(n_(e)||e.variants)}function nC(e){return Array.isArray(e)?e.join(" "):e}let nM=e=>({isEnabled:t=>e.some(e=>!!t[e])}),nA={measureLayout:nM(["layout","layoutId","drag"]),animation:nM(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:nM(["exit"]),drag:nM(["drag","dragControls"]),focus:nM(["whileFocus"]),hover:nM(["whileHover","onHoverStart","onHoverEnd"]),tap:nM(["whileTap","onTap","onTapStart","onTapCancel"]),pan:nM(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:nM(["whileInView","onViewportEnter","onViewportLeave"])},nT={hasAnimatedSinceResize:!0,hasEverUpdated:!1},nP=1;class nN extends b.Component{getSnapshotBeforeUpdate(){let{visualElement:e,props:t}=this.props;return e&&e.setProps(t),null}componentDidUpdate(){}render(){return this.props.children}}let nR=(0,b.createContext)({}),nD=Symbol.for("motionComponentSymbol"),nL=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function nF(e){if("string"!=typeof e||e.includes("-"));else if(nL.indexOf(e)>-1||/[A-Z]/.test(e))return!0;return!1}let nV={},nz=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],nI=new Set(nz);function nZ(e,{layout:t,layoutId:n}){return nI.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!nV[e]||"opacity"===e)}let nB=e=>!!(null==e?void 0:e.getVelocity),nH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nU=(e,t)=>nz.indexOf(e)-nz.indexOf(t);function nW(e){return e.startsWith("--")}let nq=(e,t)=>t&&"number"==typeof e?t.transform(e):e,n$=(e,t)=>n=>Math.max(Math.min(n,t),e),nY=e=>e%1?Number(e.toFixed(5)):e,nG=/(-)?([\d]*\.?[\d])+/g,nX=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,nK=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function nQ(e){return"string"==typeof e}let nJ=e=>({test:t=>nQ(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),n0=nJ("deg"),n1=nJ("%"),n2=nJ("px"),n4=nJ("vh"),n3=nJ("vw"),n5=Object.assign(Object.assign({},n1),{parse:e=>n1.parse(e)/100,transform:e=>n1.transform(100*e)}),n6={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},n8=Object.assign(Object.assign({},n6),{transform:n$(0,1)}),n7=Object.assign(Object.assign({},n6),{default:1}),n9={...n6,transform:Math.round},re={borderWidth:n2,borderTopWidth:n2,borderRightWidth:n2,borderBottomWidth:n2,borderLeftWidth:n2,borderRadius:n2,radius:n2,borderTopLeftRadius:n2,borderTopRightRadius:n2,borderBottomRightRadius:n2,borderBottomLeftRadius:n2,width:n2,maxWidth:n2,height:n2,maxHeight:n2,size:n2,top:n2,right:n2,bottom:n2,left:n2,padding:n2,paddingTop:n2,paddingRight:n2,paddingBottom:n2,paddingLeft:n2,margin:n2,marginTop:n2,marginRight:n2,marginBottom:n2,marginLeft:n2,rotate:n0,rotateX:n0,rotateY:n0,rotateZ:n0,scale:n7,scaleX:n7,scaleY:n7,scaleZ:n7,skew:n0,skewX:n0,skewY:n0,distance:n2,translateX:n2,translateY:n2,translateZ:n2,x:n2,y:n2,z:n2,perspective:n2,transformPerspective:n2,opacity:n8,originX:n5,originY:n5,originZ:n2,zIndex:n9,fillOpacity:n8,strokeOpacity:n8,numOctaves:n9};function rt(e,t,n,r){let{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,c=!1,d=!0;for(let e in t){let n=t[e];if(nW(e)){o[e]=n;continue}let r=re[e],f=nq(n,r);if(nI.has(e)){if(u=!0,a[e]=f,s.push(e),!d)continue;n!==(r.default||0)&&(d=!1)}else e.startsWith("origin")?(c=!0,l[e]=f):i[e]=f}if(!t.transform&&(u||r?i.transform=function({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";for(let n of(t.sort(nU),t))a+=`${nH[n]||n}(${e[n]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}(e,n,d,r):i.transform&&(i.transform="none")),c){let{originX:e="50%",originY:t="50%",originZ:n=0}=l;i.transformOrigin=`${e} ${t} ${n}`}}let rn=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function rr(e,t,n){for(let r in t)nB(t[r])||nZ(r,n)||(e[r]=t[r])}function ri(e,t,n){let r={},i=function(e,t,n){let r=e.style||{},i={};return rr(i,r,e),Object.assign(i,function({transformTemplate:e},t,n){return(0,b.useMemo)(()=>{let r=rn();return rt(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}(e,t,n)),e.transformValues?e.transformValues(i):i}(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),r.style=i,r}let ro=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function ra(e){return ro.has(e)}let rs=e=>!ra(e);try{(EL=require("@emotion/is-prop-valid").default)&&(rs=e=>e.startsWith("on")?!ra(e):EL(e))}catch(e){}function rl(e,t,n){return"string"==typeof e?e:n2.transform(t+n*e)}let ru={offset:"stroke-dashoffset",array:"stroke-dasharray"},rc={offset:"strokeDashoffset",array:"strokeDasharray"};function rd(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,c){rt(e,l,u,c),e.attrs=e.style,e.style={};let{attrs:d,style:f,dimensions:h}=e;d.transform&&(h&&(f.transform=d.transform),delete d.transform),h&&(void 0!==r||void 0!==i||f.transform)&&(f.transformOrigin=function(e,t,n){let r=rl(t,e.x,e.width),i=rl(n,e.y,e.height);return`${r} ${i}`}(h,void 0!==r?r:.5,void 0!==i?i:.5)),void 0!==t&&(d.x=t),void 0!==n&&(d.y=n),void 0!==o&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;let o=i?ru:rc;e[o.offset]=n2.transform(-r);let a=n2.transform(t),s=n2.transform(n);e[o.array]=`${a} ${s}`}(d,o,a,s,!1)}let rf=()=>({...rn(),attrs:{}});function rh(e,t){let n=(0,b.useMemo)(()=>{let n=rf();return rd(n,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};rr(t,e.style,e),n.style={...t,...n.style}}return n}let rp=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function rm(e,{style:t,vars:n},r,i){for(let o in Object.assign(e.style,t,i&&i.getProjectionStyles(r)),n)e.style.setProperty(o,n[o])}let rv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function rg(e,t,n,r){for(let n in rm(e,t,void 0,r),t.attrs)e.setAttribute(rv.has(n)?n:rp(n),t.attrs[n])}function ry(e){let{style:t}=e,n={};for(let r in t)(nB(t[r])||nZ(r,e))&&(n[r]=t[r]);return n}function rx(e){let t=ry(e);for(let n in e)if(nB(e[n])){let r="x"===n||"y"===n?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function rb(e,t,n,r={},i={}){return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,i)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,i)),t}let rw=e=>Array.isArray(e),rE=e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue),rj=e=>rw(e)?e[e.length-1]||0:e;function rk(e){let t=nB(e)?e.get():e;return rE(t)?t.toValue():t}let rS=e=>(t,n)=>{let r=(0,b.useContext)(nb),i=(0,b.useContext)(ns),o=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){let a={latestValues:function(e,t,n,r){let i={},o=r(e);for(let e in o)i[e]=rk(o[e]);let{initial:a,animate:s}=e,l=n_(e),u=nO(e);t&&u&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let c=!!n&&!1===n.initial;c=c||!1===a;let d=c?s:a;if(d&&"boolean"!=typeof d&&!nk(d)){let t=Array.isArray(d)?d:[d];t.forEach(t=>{let n=rb(e,t);if(!n)return;let{transitionEnd:r,transition:o,...a}=n;for(let e in a){let t=a[e];if(Array.isArray(t)){let e=c?t.length-1:0;t=t[e]}null!==t&&(i[e]=t)}for(let e in r)i[e]=r[e]})}return i}(r,i,o,e),renderState:t()};return n&&(a.mount=e=>n(r,e,a)),a})(e,t,r,i);return n?o():nl(o)},r_={useVisualState:rS({scrapeMotionValuesFromProps:rx,createRenderState:rf,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}rd(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),rg(t,n)}})},rO={useVisualState:rS({scrapeMotionValuesFromProps:ry,createRenderState:rn})};function rC(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function rM(e,t,n,r){(0,b.useEffect)(()=>{let i=e.current;if(n&&i)return rC(i,t,n,r)},[e,t,n,r])}function rA(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function rT(e){let t=!!e.touches;return t}(EF=EB||(EB={})).Animate="animate",EF.Hover="whileHover",EF.Tap="whileTap",EF.Drag="whileDrag",EF.Focus="whileFocus",EF.InView="whileInView",EF.Exit="exit";let rP={pageX:0,pageY:0};function rN(e,t="page"){return{point:rT(e)?function(e,t="page"){let n=e.touches[0]||e.changedTouches[0],r=n||rP;return{x:r[t+"X"],y:r[t+"Y"]}}(e,t):function(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}(e,t)}}let rR=(e,t=!1)=>{let n=t=>e(t,rN(t));return t?e=>{let t=e instanceof MouseEvent,r=!t||t&&0===e.button;r&&n(e)}:n},rD=()=>ni&&null===window.onpointerdown,rL=()=>ni&&null===window.ontouchstart,rF=()=>ni&&null===window.onmousedown,rV={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},rz={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function rI(e){if(rD());else if(rL())return rz[e];else if(rF())return rV[e];return e}function rZ(e,t,n,r){return rC(e,rI(t),rR(n,"pointerdown"===t),r)}function rB(e,t,n,r){return rM(e,rI(t),n&&rR(n,"pointerdown"===t),r)}function rH(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}let rU=rH("dragHorizontal"),rW=rH("dragVertical");function rq(e){let t=!1;if("y"===e)t=rW();else if("x"===e)t=rU();else{let e=rU(),n=rW();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function r$(){let e=rq(!0);return!e||(e(),!1)}function rY(e,t,n){return(r,i)=>{!(!rA(r)||r$())&&(e.animationState&&e.animationState.setActive(EB.Hover,t),n&&n(r,i))}}let rG=(e,t)=>!!t&&(e===t||rG(e,t.parentElement)),rX=(e,t)=>n=>t(e(n)),rK=(...e)=>e.reduce(rX),rQ=new WeakMap,rJ=new WeakMap,r0=e=>{let t=rQ.get(e.target);t&&t(e)},r1=e=>{e.forEach(r0)},r2={some:0,all:1};function r4(e,t,n,{root:r,margin:i,amount:o="some",once:a}){(0,b.useEffect)(()=>{if(!e||!n.current)return;let s={root:null==r?void 0:r.current,rootMargin:i,threshold:"number"==typeof o?o:r2[o]};return function(e,t,n){let r=function({root:e,...t}){let n=e||document;rJ.has(n)||rJ.set(n,{});let r=rJ.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(r1,{root:e,...t})),r[i]}(t);return rQ.set(e,n),r.observe(e),()=>{rQ.delete(e),r.unobserve(e)}}(n.current,s,e=>{let{isIntersecting:r}=e;if(t.isInView===r||(t.isInView=r,a&&!r&&t.hasEnteredView))return;r&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(EB.InView,r);let i=n.getProps(),o=r?i.onViewportEnter:i.onViewportLeave;o&&o(e)})},[e,r,i,o])}function r3(e,t,n,{fallback:r=!0}){(0,b.useEffect)(()=>{e&&r&&("production"!==tK&&nv(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;let{onViewportEnter:e}=n.getProps();e&&e(null),n.animationState&&n.animationState.setActive(EB.InView,!0)}))},[e])}let r5=e=>t=>(e(t),null),r6={inView:r5(function({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){let o=(0,b.useRef)({hasEnteredView:!1,isInView:!1}),a=!!(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1);let s="undefined"==typeof IntersectionObserver?r3:r4;s(a,o.current,e,i)}),tap:r5(function({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){let o=e||t||n||r,a=(0,b.useRef)(!1),s=(0,b.useRef)(null),l={passive:!(t||e||n||h)};function u(){s.current&&s.current(),s.current=null}function c(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(EB.Tap,!1),!r$()}function d(t,r){c()&&(rG(i.current,t.target)?e&&e(t,r):n&&n(t,r))}function f(e,t){c()&&n&&n(e,t)}function h(e,n){u(),!a.current&&(a.current=!0,s.current=rK(rZ(window,"pointerup",d,l),rZ(window,"pointercancel",f,l)),i.animationState&&i.animationState.setActive(EB.Tap,!0),t&&t(e,n))}rB(i,"pointerdown",o?h:void 0,l),np(u)}),focus:r5(function({whileFocus:e,visualElement:t}){let{animationState:n}=t;rM(t,"focus",e?()=>{n&&n.setActive(EB.Focus,!0)}:void 0),rM(t,"blur",e?()=>{n&&n.setActive(EB.Focus,!1)}:void 0)}),hover:r5(function({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){rB(r,"pointerenter",e||n?rY(r,!0,e):void 0,{passive:!e}),rB(r,"pointerleave",t||n?rY(r,!1,t):void 0,{passive:!t})})};function r8(){let e=(0,b.useContext)(ns);if(null===e)return[!0,null];let{isPresent:t,onExitComplete:n,register:r}=e,i=(0,b.useId)();return(0,b.useEffect)(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function r7(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;rt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var ie=function(){},it=function(){};let ir=(e,t,n)=>Math.min(Math.max(n,e),t);function ii(e,t){return e*Math.sqrt(1-t*t)}let io=["duration","bounce"],ia=["stiffness","damping","mass"];function is(e,t){return t.some(t=>void 0!==e[t])}function il(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=r9(e,["from","to","restSpeed","restDelta"]);let a={done:!1,value:t},{stiffness:s,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:f}=function(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!is(e,ia)&&is(e,io)){let n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;ie(e<=1e4,"Spring duration must be 10 seconds or less");let a=1-t;a=ir(.05,1,a),e=ir(.01,10,e/1e3),a<1?(i=t=>{let r=t*a,i=r*e,o=ii(t,a),s=Math.exp(-i);return .001-(r-n)/o*s},o=t=>{let r=t*a,o=r*e,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-o),u=ii(Math.pow(t,2),a),c=-i(t)+.001>0?-1:1;return c*((o*n+n-s)*l)/u}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return -.001+r*i},o=t=>{let r=Math.exp(-t*e),i=(n-t)*(e*e);return r*i});let s=5/e,l=function(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}(i,o,s);if(e*=1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(l,2)*r;return{stiffness:t,damping:2*a*Math.sqrt(r*t),duration:e}}}(e);(t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(o),h=iu,p=iu;function m(){let e=c?-(c/1e3):0,r=n-t,o=l/(2*Math.sqrt(s*u)),a=Math.sqrt(s/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-t)/100,.4)),o<1){let t=ii(a,o);h=i=>{let s=Math.exp(-o*a*i);return n-s*((e+o*a*r)/t*Math.sin(t*i)+r*Math.cos(t*i))},p=n=>{let i=Math.exp(-o*a*n);return o*a*i*(Math.sin(t*n)*(e+o*a*r)/t+r*Math.cos(t*n))-i*(Math.cos(t*n)*(e+o*a*r)-t*r*Math.sin(t*n))}}else if(1===o)h=t=>n-Math.exp(-a*t)*(r+(e+a*r)*t);else{let t=a*Math.sqrt(o*o-1);h=i=>{let s=Math.exp(-o*a*i),l=Math.min(t*i,300);return n-s*((e+o*a*r)*Math.sinh(l)+t*r*Math.cosh(l))/t}}}return m(),{next:e=>{let t=h(e);if(f)a.done=e>=d;else{let o=1e3*p(e),s=Math.abs(o)<=r,l=Math.abs(n-t)<=i;a.done=s&&l}return a.value=a.done?n:t,a},flipTarget:()=>{c=-c,[t,n]=[n,t],m()}}}il.needsInterpolation=(e,t)=>"string"==typeof e||"string"==typeof t;let iu=e=>0,ic=(e,t,n)=>{let r=t-e;return 0===r?1:(n-e)/r},id=(e,t,n)=>-n*e+n*t+e,ih=(e,t)=>n=>!!(nQ(n)&&nK.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),ip=(e,t,n)=>r=>{if(!nQ(r))return r;let[i,o,a,s]=r.match(nG);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},im=n$(0,255),iv=Object.assign(Object.assign({},n6),{transform:e=>Math.round(im(e))}),ig={test:ih("rgb","red"),parse:ip("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+iv.transform(e)+", "+iv.transform(t)+", "+iv.transform(n)+", "+nY(n8.transform(r))+")"},iy={test:ih("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:ig.transform},ix={test:ih("hsl","hue"),parse:ip("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+n1.transform(nY(t))+", "+n1.transform(nY(n))+", "+nY(n8.transform(r))+")"};function ib(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iw({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,o=0,a=0;if(t/=100){let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ib(s,r,e+1/3),o=ib(s,r,e),a=ib(s,r,e-1/3)}else i=o=a=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*a),alpha:r}}let iE=(e,t,n)=>{let r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},ij=[iy,ig,ix],ik=e=>ij.find(t=>t.test(e)),iS=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,i_=(e,t)=>{let n=ik(e),r=ik(t);it(!!n,iS(e)),it(!!r,iS(t));let i=n.parse(e),o=r.parse(t);n===ix&&(i=iw(i),n=ig),r===ix&&(o=iw(o),r=ig);let a=Object.assign({},i);return e=>{for(let t in a)"alpha"!==t&&(a[t]=iE(i[t],o[t],e));return a.alpha=id(i.alpha,o.alpha,e),n.transform(a)}},iO={test:e=>ig.test(e)||iy.test(e)||ix.test(e),parse:e=>ig.test(e)?ig.parse(e):ix.test(e)?ix.parse(e):iy.parse(e),transform:e=>nQ(e)?e:e.hasOwnProperty("red")?ig.transform(e):ix.transform(e)},iC="${c}",iM="${n}";function iA(e){"number"==typeof e&&(e=`${e}`);let t=[],n=0,r=e.match(nX);r&&(n=r.length,e=e.replace(nX,iC),t.push(...r.map(iO.parse)));let i=e.match(nG);return i&&(e=e.replace(nG,iM),t.push(...i.map(n6.parse))),{values:t,numColors:n,tokenised:e}}function iT(e){return iA(e).values}function iP(e){let{values:t,numColors:n,tokenised:r}=iA(e),i=t.length;return e=>{let t=r;for(let r=0;r"number"==typeof e?0:e,iR={test:function(e){var t,n,r,i;return isNaN(e)&&nQ(e)&&(null!==(n=null===(t=e.match(nG))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(i=null===(r=e.match(nX))||void 0===r?void 0:r.length)&&void 0!==i?i:0)>0},parse:iT,createTransformer:iP,getAnimatableNone:function(e){let t=iT(e),n=iP(e);return n(t.map(iN))}},iD=e=>"number"==typeof e;function iL(e,t){return iD(e)?n=>id(e,t,n):iO.test(e)?i_(e,t):iI(e,t)}let iF=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>iL(e,t[n]));return e=>{for(let t=0;t{let n=Object.assign(Object.assign({},e),t),r={};for(let i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=iL(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}};function iz(e){let t=iR.parse(e),n=t.length,r=0,i=0,o=0;for(let e=0;e{let n=iR.createTransformer(t),r=iz(e),i=iz(t),o=r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers;return o?rK(iF(r.parsed,i.parsed),n):(ie(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),n=>`${n>0?t:e}`)},iZ=(e,t)=>n=>id(e,t,n);function iB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let o=e.length;it(o===t.length,"Both input and output ranges must be the same length"),it(!r||!Array.isArray(r)||r.length===o-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());let a=function(e,t,n){var r;let i=[],o=n||("number"==typeof(r=e[0])?iZ:"string"==typeof r?iO.test(r)?i_:iI:Array.isArray(r)?iF:"object"==typeof r?iV:void 0),a=e.length-1;for(let n=0;nn(ic(e,t,r))}(e,a):function(e,t){let n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let t=1;for(;ti)&&t!==r;t++);o=t-1}let s=ic(e[o],e[o+1],i);return t[o](s)}}(e,a);return n?t=>s(ir(e[0],e[o-1],t)):s}let iH=e=>t=>1-e(1-t),iU=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iW=e=>t=>t*t*((e+1)*t-e),iq=4/11,i$=8/11,iY=e=>e,iG=e=>Math.pow(e,2),iX=iH(iG),iK=iU(iG),iQ=e=>1-Math.sin(Math.acos(e)),iJ=iH(iQ),i0=iU(iJ),i1=iW(1.525),i2=iH(i1),i4=iU(i1),i3=(e=>{let t=iW(1.525);return e=>(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))})(0),i5=4356/361,i6=35442/1805,i8=16061/1805,i7=e=>{if(1===e||0===e)return e;let t=e*e;return e0!==n?n/(t-1):0)}(a)).map(e=>e*i);function l(){return iB(s,a,{ease:Array.isArray(n)?n:a.map(()=>n||iK).splice(0,a.length-1)})}let u=l();return{next:e=>(o.value=u(e),o.done=e>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}let ot={keyframes:oe,spring:il,decay:function({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){let a={done:!1,value:t},s=n*e,l=t+s,u=void 0===o?l:o(l);return u!==l&&(s=u-t),{next:e=>{let t=-s*Math.exp(-e/r);return a.done=!(t>i||t<-i),a.value=a.done?u:u+t,a},flipTarget:()=>{}}}};function on(e,t,n=0){return e-t-n}let or=e=>{let t=({delta:t})=>e(t);return{start:()=>t8.update(t,!0),stop:()=>t7.update(t)}};function oi(e){let t,n,r;var i,{from:o,autoplay:a=!0,driver:s=or,elapsed:l=0,repeat:u=0,repeatType:c="loop",repeatDelay:d=0,onPlay:f,onStop:h,onComplete:p,onRepeat:m,onUpdate:v}=e,g=r9(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:y}=g,x=0,b=g.duration,w=!1,E=!0,j=function(e){if(Array.isArray(e.to))return oe;if(ot[e.type])return ot[e.type];let t=new Set(Object.keys(e));if(t.has("ease")||t.has("duration")&&!t.has("dampingRatio"));else if(t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta"))return il;return oe}(g);(null===(i=j.needsInterpolation)||void 0===i?void 0:i.call(j,o,y))&&(r=iB([0,100],[o,y],{clamp:!1}),o=0,y=100);let k=j(Object.assign(Object.assign({},g),{from:o,to:y}));return a&&(null==f||f(),(t=s(function(e){if(E||(e=-e),l+=e,!w){let e=k.next(Math.max(0,l));n=e.value,r&&(n=r(n)),w=E?e.done:l<=0}if(null==v||v(n),w){if(0===x&&(null!=b||(b=l)),x=o+d:i<=-d)&&(x++,"reverse"===c?l=function(e,t,n=0,r=!0){return r?on(t+-e,t,n):t-(e-t)+n}(l,b,d,E=x%2==0):(l=on(l,b,d),"mirror"===c&&k.flipTarget()),w=!1,m&&m())}else t.stop(),p&&p()}})).start()),{stop:()=>{null==h||h(),t.stop()}}}let oo=e=>1e3*e,oa=(e,t)=>1-3*t+3*e,os=(e,t)=>3*t-6*e,ol=e=>3*e,ou=(e,t,n)=>((oa(t,n)*e+os(t,n))*e+ol(t))*e,oc=(e,t,n)=>3*oa(t,n)*e*e+2*os(t,n)*e+ol(t),od={linear:iY,easeIn:iG,easeInOut:iK,easeOut:iX,circIn:iQ,circInOut:i0,circOut:iJ,backIn:i1,backInOut:i4,backOut:i2,anticipate:i3,bounceIn:i9,bounceInOut:e=>e<.5?.5*(1-i7(1-2*e)):.5*i7(2*e-1)+.5,bounceOut:i7},of=e=>{if(Array.isArray(e)){it(4===e.length,"Cubic bezier arrays must contain four numerical values.");let[t,n,r,i]=e;return function(e,t,n,r){if(e===t&&n===r)return iY;let i=new Float32Array(11);for(let t=0;t<11;++t)i[t]=ou(.1*t,e,n);return o=>0===o||1===o?o:ou(function(t){let r=0,o=1;for(;10!==o&&i[o]<=t;++o)r+=.1;--o;let a=(t-i[o])/(i[o+1]-i[o]),s=r+.1*a,l=oc(s,e,n);return l>=.001?function(e,t,n,r){for(let i=0;i<8;++i){let i=oc(t,n,r);if(0===i)break;let o=ou(t,n,r)-e;t-=o/i}return t}(t,s,e,n):0===l?s:function(e,t,n,r,i){let o,a;let s=0;do(o=ou(a=t+(n-t)/2,r,i)-e)>0?n=a:t=a;while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+.1,e,n)}(o),t,r)}(t,n,r,i)}return"string"==typeof e?(it(void 0!==od[e],`Invalid easing type '${e}'`),od[e]):e},oh=e=>Array.isArray(e)&&"number"!=typeof e[0],op=(e,t)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&iR.test(t)&&!t.startsWith("url(")),om=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),ov=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),og=()=>({type:"keyframes",ease:"linear",duration:.3}),oy=e=>({type:"keyframes",duration:.8,values:e}),ox={x:om,y:om,z:om,rotate:om,rotateX:om,rotateY:om,rotateZ:om,scaleX:ov,scaleY:ov,scale:ov,opacity:og,backgroundColor:og,color:og,default:ov},ob=(e,t)=>({to:t,...(rw(t)?oy:ox[e]||ox.default)(t)}),ow=new Set(["brightness","contrast","saturate","opacity"]);function oE(e){let[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[r]=n.match(nG)||[];if(!r)return e;let i=n.replace(r,""),o=ow.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}let oj=/([a-z-]*)\(.*?\)/g,ok=Object.assign(Object.assign({},iR),{getAnimatableNone:e=>{let t=e.match(oj);return t?t.map(oE).join(" "):e}}),oS={...re,color:iO,backgroundColor:iO,outlineColor:iO,fill:iO,stroke:iO,borderColor:iO,borderTopColor:iO,borderRightColor:iO,borderBottomColor:iO,borderLeftColor:iO,filter:ok,WebkitFilter:ok},o_=e=>oS[e];function oO(e,t){var n;let r=o_(e);return r!==ok&&(r=iR),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,t)}let oC={current:!1};function oM(e,t){let n=performance.now(),r=({timestamp:i})=>{let o=i-n;o>=t&&(t7.read(r),e(o-t))};return t8.read(r,!0),()=>t7.read(r)}let oA=!1;function oT(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function oP(e){return"number"==typeof e?0:oO("",e)}function oN(e,t){return e[t]||e.default||e}function oR(e,t,n,r={}){return oC.current&&(r={type:!1}),t.start(i=>{let o,a;let s=function(e,t,n,r,i){let o=oN(r,e)||{},a=void 0!==o.from?o.from:t.get(),s=op(e,n);"none"===a&&s&&"string"==typeof n?a=oO(e,n):oT(a)&&"string"==typeof n?a=oP(n):!Array.isArray(n)&&oT(n)&&"string"==typeof a&&(n=oP(a));let l=op(e,a);return ie(l===s,`You are trying to animate ${e} from "${a}" to "${n}". ${a} is not an animatable value - to enable this animation set ${a} to a value animatable to ${n} via the \`style\` property.`),l&&s&&!1!==o.type?function(){var r;let s={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:e=>t.set(e)};return"inertia"===o.type||"decay"===o.type?function({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:d,onComplete:f,onStop:h}){let p;function m(e){return void 0!==n&&er}function v(e){return void 0===n?r:void 0===r?n:Math.abs(n-e){var n;null==d||d(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:f,onStop:h}))}function y(e){g(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},e))}if(m(e))y({from:e,velocity:t,to:v(e)});else{let r,a,s=i*t+e;void 0!==u&&(s=u(s));let c=v(s),d=c===n?-1:1;g({type:"decay",from:e,velocity:t,timeConstant:o,power:i,restDelta:l,modifyTarget:u,onUpdate:m(s)?e=>{var n;r=a,a=e,t=(n=nr().delta)?(e-r)*(1e3/n):0,(1===d&&e>c||-1===d&&enull==p?void 0:p.stop()}}({...s,...o}):oi({...(r=o,Array.isArray(s.to)&&void 0===r.duration&&(r.duration=.8),Array.isArray(s.to)&&null===s.to[0]&&(s.to=[...s.to],s.to[0]=s.from),!function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}(r)&&(r={...r,...ob(e,s.to)}),{...s,...function({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){let a={...o};return t&&(a.offset=t),o.duration&&(a.duration=oo(o.duration)),o.repeatDelay&&(a.repeatDelay=oo(o.repeatDelay)),e&&(a.ease=oh(e)?e.map(of):of(e)),"tween"===o.type&&(a.type="keyframes"),(n||i||r)&&(ie(!oA,"yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."),oA=!0,n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),"spring"!==o.type&&(a.type="keyframes"),a}(r)}),onUpdate:e=>{s.onUpdate(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{s.onComplete(),o.onComplete&&o.onComplete()}})}:function(){let e=rj(n);return t.set(e),i(),o.onUpdate&&o.onUpdate(e),o.onComplete&&o.onComplete(),{stop:()=>{}}}}(e,t,n,r,i),l=function(e,t){var n,r;let i=oN(e,t)||{};return null!==(r=null!==(n=i.delay)&&void 0!==n?n:e.delay)&&void 0!==r?r:0}(r,e),u=()=>o=s();return l?a=oM(u,oo(l)):u(),()=>{a&&a(),o&&o.stop()}})}let oD=e=>/^\-?\d*\.?\d+$/.test(e),oL=e=>/^0[^.\s]+$/.test(e);function oF(e,t){-1===e.indexOf(t)&&e.push(t)}function oV(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}class oz{constructor(){this.subscriptions=[]}add(e){return oF(this.subscriptions,e),()=>oV(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i!isNaN(parseFloat(e));class oZ{constructor(e){this.version="7.6.5",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new oz,this.velocityUpdateSubscribers=new oz,this.renderSubscribers=new oz,this.canTrackVelocity=!1,this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;let{delta:n,timestamp:r}=nr();this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,t8.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),t&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>t8.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=oI(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(e){return e(this.get()),this.renderSubscribers.add(e)}attach(e){this.passiveEffect=e}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){var e,t;return this.canTrackVelocity?(e=parseFloat(this.current)-parseFloat(this.prev),(t=this.timeDelta)?e*(1e3/t):0):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.stopAnimation=e(t)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function oB(e){return new oZ(e)}let oH=e=>t=>t.test(e),oU=[n6,n2,n1,n0,n3,n4,{test:e=>"auto"===e,parse:e=>e}],oW=e=>oU.find(oH(e)),oq=[...oU,iO,iR],o$=e=>oq.find(oH(e));function oY(e,t,n){let r=e.getProps();return rb(r,t,void 0!==n?n:r.custom,function(e){let t={};return e.values.forEach((e,n)=>t[n]=e.get()),t}(e),function(e){let t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}(e))}function oG(e){return!!(nB(e)&&e.add)}function oX(e,t,n={}){var r;let i=oY(e,t,n.custom),{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);let a=i?()=>oK(e,i,n):()=>Promise.resolve(),s=(null===(r=e.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{let{delayChildren:i=0,staggerChildren:a,staggerDirection:s}=o;return function(e,t,n=0,r=0,i=1,o){let a=[],s=(e.variantChildren.size-1)*r,l=1===i?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(oQ).forEach((e,r)=>{a.push(oX(e,t,{...o,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,i+r,a,s,n)}:()=>Promise.resolve(),{when:l}=o;if(!l)return Promise.all([a(),s(n.delay)]);{let[e,t]="beforeChildren"===l?[a,s]:[s,a];return e().then(t)}}function oK(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t),u=e.getValue("willChange");r&&(a=r);let c=[],d=i&&(null===(o=e.animationState)||void 0===o?void 0:o.getState()[i]);for(let t in l){let r=e.getValue(t),i=l[t];if(!r||void 0===i||d&&function({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}(d,t))continue;let o={delay:n,...a};e.shouldReduceMotion&&nI.has(t)&&(o={...o,type:!1,delay:0});let s=oR(t,r,i,o);oG(u)&&(u.add(t),s=s.then(()=>u.remove(t))),c.push(s)}return Promise.all(c).then(()=>{s&&function(e,t){let n=oY(e,t),{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};for(let t in o={...o,...r}){let n=rj(o[t]);e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,oB(n))}}(e,s)})}function oQ(e,t){return e.sortNodePosition(t)}let oJ=[EB.Animate,EB.InView,EB.Focus,EB.Hover,EB.Tap,EB.Drag,EB.Exit],o0=[...oJ].reverse(),o1=oJ.length;function o2(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let o4={animation:r5(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>(function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){let i=t.map(t=>oX(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=oX(e,t,n);else{let i="function"==typeof t?oY(e,t,n.custom):t;r=oK(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))})(e,t,n))),n={[EB.Animate]:o2(!0),[EB.InView]:o2(),[EB.Hover]:o2(),[EB.Tap]:o2(),[EB.Drag]:o2(),[EB.Focus]:o2(),[EB.Exit]:o2()},r=!0,i=(t,n)=>{let r=oY(e,n);if(r){let{transition:e,transitionEnd:n,...i}=r;t={...t,...i,...n}}return t};function o(o,a){var s,l;let u=e.getProps(),c=e.getVariantContext(!0)||{},d=[],f=new Set,h={},p=1/0;for(let t=0;tp&&y,j=Array.isArray(g)?g:[g],k=j.reduce(i,{});!1===x&&(k={});let{prevResolvedValues:S={}}=v,_={...S,...k},O=e=>{E=!0,f.delete(e),v.needsAnimating[e]=!0};for(let e in _){let t=k[e],n=S[e];h.hasOwnProperty(e)||(t!==n?rw(t)&&rw(n)?!r7(t,n)||w?O(e):v.protectedKeys[e]=!0:void 0!==t?O(e):f.add(e):void 0!==t&&f.has(e)?O(e):v.protectedKeys[e]=!0)}v.prevProp=g,v.prevResolvedValues=k,v.isActive&&(h={...h,...k}),r&&e.blockInitialAnimation&&(E=!1),E&&!b&&d.push(...j.map(e=>({animation:e,options:{type:m,...o}})))}if(f.size){let t={};f.forEach(n=>{let r=e.getBaseTarget(n);void 0!==r&&(t[n]=r)}),d.push({animation:t})}let m=!!d.length;return r&&!1===u.initial&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}return{animateChanges:o,setActive:function(t,r,i){var a;if(n[t].isActive===r)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)}),n[t].isActive=r;let s=o(i,t);for(let e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}(e)),nk(t)&&(0,b.useEffect)(()=>t.subscribe(e),[t])}),exit:r5(e=>{let{custom:t,visualElement:n}=e,[r,i]=r8(),o=(0,b.useContext)(ns);(0,b.useEffect)(()=>{n.isPresent=r;let e=n.animationState&&n.animationState.setActive(EB.Exit,!r,{custom:o&&o.custom||t});e&&!r&&e.then(i)},[r])})},o3=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),o5=e=>o3(e)&&e.hasOwnProperty("z"),o6=(e,t)=>Math.abs(e-t);function o8(e,t){if(iD(e)&&iD(t))return o6(e,t);if(o3(e)&&o3(t)){let n=o6(e.x,t.x),r=o6(e.y,t.y),i=o5(e)&&o5(t)?o6(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}class o7{constructor(e,t,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=at(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=o8(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=nr();this.history.push({...r,timestamp:i});let{onStart:o,onMove:a}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{if(this.lastMoveEvent=e,this.lastMoveEventInfo=o9(t,this.transformPagePoint),rA(e)&&0===e.buttons){this.handlePointerUp(e,t);return}t8.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r}=this.handlers,i=at(o9(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},rT(e)&&e.touches.length>1)return;this.handlers=t,this.transformPagePoint=n;let r=rN(e),i=o9(r,this.transformPagePoint),{point:o}=i,{timestamp:a}=nr();this.history=[{...o,timestamp:a}];let{onSessionStart:s}=t;s&&s(e,at(i,this.history)),this.removeListeners=rK(rZ(window,"pointermove",this.handlePointerMove),rZ(window,"pointerup",this.handlePointerUp),rZ(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),t7.update(this.updatePoint)}}function o9(e,t){return t?{point:t(e.point)}:e}function ae(e,t){return{x:e.x-t.x,y:e.y-t.y}}function at({point:e},t){return{point:e,delta:ae(e,an(t)),offset:ae(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=an(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>oo(.1)));)n--;if(!r)return{x:0,y:0};let o=(i.timestamp-r.timestamp)/1e3;if(0===o)return{x:0,y:0};let a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}(t,0)}}function an(e){return e[e.length-1]}function ar(e){return e.max-e.min}function ai(e,t=0,n=.01){return o8(e,t)({translate:0,scale:1,origin:0,originPoint:0}),am=()=>({x:ap(),y:ap()}),av=()=>({min:0,max:0}),ag=()=>({x:av(),y:av()});function ay(e){return[e("x"),e("y")]}function ax({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ab(e){return void 0===e||1===e}function aw({scale:e,scaleX:t,scaleY:n}){return!ab(e)||!ab(t)||!ab(n)}function aE(e){return aw(e)||aj(e)||e.z||e.rotate||e.rotateX||e.rotateY}function aj(e){var t,n;return(t=e.x)&&"0%"!==t||(n=e.y)&&"0%"!==n}function ak(e,t,n,r,i){return void 0!==i&&(e=r+i*(e-r)),r+n*(e-r)+t}function aS(e,t=0,n=1,r,i){e.min=ak(e.min,t,n,r,i),e.max=ak(e.max,t,n,r,i)}function a_(e,{x:t,y:n}){aS(e.x,t.translate,t.scale,t.originPoint),aS(e.y,n.translate,n.scale,n.originPoint)}function aO(e,t){e.min=e.min+t,e.max=e.max+t}function aC(e,t,[n,r,i]){let o=void 0!==t[i]?t[i]:.5,a=id(e.min,e.max,o);aS(e,t[n],t[r],a,t.scale)}let aM=["x","scaleX","originX"],aA=["y","scaleY","originY"];function aT(e,t){aC(e.x,t,aM),aC(e.y,t,aA)}function aP(e,t){return ax(function(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}let aN=new WeakMap;class aR{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ag(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){!1!==this.visualElement.isPresent&&(this.panSession=new o7(e,{onSessionStart:e=>{this.stopAnimation(),t&&this.snapToCursor(rN(e,"page").point)},onStart:(e,t)=>{var n;let{drag:r,dragPropagation:i,onDragStart:o}=this.getProps();(!r||i||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=rq(r),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ay(e=>{var t,n;let r=this.getAxisMotionValue(e).get()||0;if(n1.test(r)){let i=null===(n=null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.actual[e];if(i){let e=ar(i);r=e*(parseFloat(r)/100)}}this.originPoint[e]=r}),null==o||o(e,t),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(EB.Drag,!0))},onMove:(e,t)=>{let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;let{offset:a}=t;if(r&&null===this.currentDirection){this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(a),null!==this.currentDirection&&(null==i||i(this.currentDirection));return}this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),null==o||o(e,t)},onSessionEnd:(e,t)=>this.stop(e,t)},{transformPagePoint:this.visualElement.getTransformPagePoint()}))}stop(e,t){let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:r}=t;this.startAnimation(r);let{onDragEnd:i}=this.getProps();null==i||i(e,t)}cancel(){var e,t;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(EB.Drag,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!aD(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?id(n,e,r.max):Math.min(e,n)),e}(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{layout:n}=this.visualElement.projection||{},r=this.constraints;e&&nE(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=function(e,{top:t,left:n,bottom:r,right:i}){return{x:ac(e.x,n,i),y:ac(e.y,t,r)}}(n.actual,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:af(e,"left","right"),y:af(e,"top","bottom")}}(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&ay(e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.actual[e],this.constraints[e]))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!nE(t))return!1;let r=t.current;it(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;let o=function(e,t,n){let r=aP(e,n),{scroll:i}=t;return i&&(aO(r.x,i.x),aO(r.y,i.y)),r}(r,i.root,this.visualElement.getTransformPagePoint()),a={x:ad((e=i.layout.actual).x,o.x),y:ad(e.y,o.y)};if(n){let e=n(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=ax(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),s=this.constraints||{},l=ay(a=>{var l;if(!aD(a,t,this.currentDirection))return;let u=null!==(l=null==s?void 0:s[a])&&void 0!==l?l:{};o&&(u={min:0,max:0});let c={type:"inertia",velocity:n?e[a]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(a,c)});return Promise.all(l).then(a)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return oR(e,n,0,t)}stopAnimation(){ay(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var t,n;let r="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[r];return i||this.visualElement.getValue(e,null!==(n=null===(t=this.visualElement.getProps().initial)||void 0===t?void 0:t[e])&&void 0!==n?n:0)}snapToCursor(e){ay(t=>{let{drag:n}=this.getProps();if(!aD(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:o}=r.layout.actual[t];i.set(e[t]-id(n,o,.5))}})}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;let{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!nE(n)||!r||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};ay(e=>{let t=this.getAxisMotionValue(e);if(t){let n=t.get();i[e]=function(e,t){let n=.5,r=ar(e),i=ar(t);return i>r?n=ic(t.min,t.max-r,e.min):r>i&&(n=ic(e.min,e.max-i,t.min)),ir(0,1,n)}({min:n,max:n},this.constraints[e])}});let{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",null===(e=r.root)||void 0===e||e.updateScroll(),r.updateLayout(),this.resolveConstraints(),ay(e=>{if(!aD(e,t,null))return;let n=this.getAxisMotionValue(e),{min:r,max:o}=this.constraints[e];n.set(id(r,o,i[e]))})}addListeners(){var e;if(!this.visualElement.current)return;aN.set(this.visualElement,this);let t=this.visualElement.current,n=rZ(t,"pointerdown",e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),r=()=>{let{dragConstraints:e}=this.getProps();nE(e)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(null===(e=i.root)||void 0===e||e.updateScroll(),i.updateLayout()),r();let a=rC(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ay(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),null==s||s()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=.35,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function aD(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}let aL={pan:r5(function({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){let o=e||t||n||r,a=(0,b.useRef)(null),{transformPagePoint:s}=(0,b.useContext)(nx),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(e,t)=>{a.current=null,n&&n(e,t)}};(0,b.useEffect)(()=>{null!==a.current&&a.current.updateHandlers(l)}),rB(i,"pointerdown",o&&function(e){a.current=new o7(e,l,{transformPagePoint:s})}),np(()=>a.current&&a.current.end())}),drag:r5(function(e){let{dragControls:t,visualElement:n}=e,r=nl(()=>new aR(n));(0,b.useEffect)(()=>t&&t.subscribe(r),[r,t]),(0,b.useEffect)(()=>r.addListeners(),[r])})};function aF(e){return"string"==typeof e&&e.startsWith("var(--")}let aV=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function az(e,t,n=1){it(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,i]=function(e){let t=aV.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]}(e);if(!r)return;let o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():aF(i)?az(i,t,n+1):i}let aI=new Set(["width","height","top","left","right","bottom","x","y"]),aZ=e=>aI.has(e),aB=e=>Object.keys(e).some(aZ),aH=(e,t)=>{e.set(t,!1),e.set(t)},aU=e=>e===n6||e===n2;(EV=EH||(EH={})).width="width",EV.height="height",EV.left="left",EV.right="right",EV.top="top",EV.bottom="bottom";let aW=(e,t)=>parseFloat(e.split(", ")[t]),aq=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/);if(i)return aW(i[1],t);{let t=r.match(/^matrix\((.+)\)$/);return t?aW(t[1],e):0}},a$=new Set(["x","y","z"]),aY=nz.filter(e=>!a$.has(e)),aG={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:aq(4,13),y:aq(5,14)},aX=(e,t,n)=>{let r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach(e=>{s[e]=aG[e](r,o)}),t.render();let l=t.measureViewportBox();return n.forEach(n=>{let r=t.getValue(n);aH(r,s[n]),e[n]=aG[n](l,o)}),e},aK=(e,t,n={},r={})=>{t={...t},r={...r};let i=Object.keys(t).filter(aZ),o=[],a=!1,s=[];if(i.forEach(i=>{let l;let u=e.getValue(i);if(!e.hasValue(i))return;let c=n[i],d=oW(c),f=t[i];if(rw(f)){let e=f.length,t=null===f[0]?1:0;d=oW(c=f[t]);for(let n=t;n{let r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),a=!0),s.push(i),r[i]=void 0!==r[i]?r[i]:t[i],aH(u,f))}}),!s.length)return{target:t,transitionEnd:r};{let n=s.indexOf("height")>=0?window.pageYOffset:null,i=aX(t,e,s);return o.length&&o.forEach(([t,n])=>{e.getValue(t).set(n)}),e.render(),ni&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}},aQ=(e,t,n,r)=>{var i,o;let a=function(e,{...t},n){let r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};for(let i in n&&(n={...n}),e.values.forEach(e=>{let t=e.get();if(!aF(t))return;let n=az(t,r);n&&e.set(n)}),t){let e=t[i];if(!aF(e))continue;let o=az(e,r);o&&(t[i]=o,n&&void 0===n[i]&&(n[i]=e))}return{target:t,transitionEnd:n}}(e,t,r);return t=a.target,r=a.transitionEnd,i=t,o=r,aB(i)?aK(e,i,n,o):{target:i,transitionEnd:o}},aJ={current:null},a0={current:!1},a1=Object.keys(nA),a2=a1.length,a4=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class a3{constructor({parent:e,props:t,reducedMotionConfig:n,visualState:r},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>t8.render(this.render,!1,!0);let{latestValues:o,renderState:a}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=t,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=n_(t),this.isVariantNode=nO(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:s,...l}=this.scrapeMotionValuesFromProps(t);for(let e in l){let t=l[e];void 0!==o[e]&&nB(t)&&(t.set(o[e],!1),oG(s)&&s.add(e))}if(t.values)for(let e in t.values){let n=t.values[e];void 0!==o[e]&&nB(n)&&n.set(o[e])}}scrapeMotionValuesFromProps(e){return{}}mount(e){var t;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(t=this.parent)||void 0===t?void 0:t.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),a0.current||function(){if(a0.current=!0,ni){if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>aJ.current=e.matches;e.addListener(t),t()}else aJ.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||aJ.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,t,n;for(let r in null===(e=this.projection)||void 0===e||e.unmount(),t7.update(this.notifyUpdate),t7.render(this.render),this.valueSubscriptions.forEach(e=>e()),null===(t=this.removeFromVariantTree)||void 0===t||t.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this),this.events)this.events[r].clear();this.current=null}bindToMotionValue(e,t){let n=t.onChange(t=>{this.latestValues[e]=t,this.props.onUpdate&&t8.update(this.notifyUpdate,!1,!0)}),r=t.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(e,()=>{n(),r()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures(e,t,n,r,i,o){let a=[];"production"!==tK&&n&&t&&it(!1,"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.");for(let t=0;tthis.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ag()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=e;for(let t=0;tn.variantChildren.delete(e)}addValue(e,t){this.hasValue(e)&&this.removeValue(e),this.values.set(e,t),this.latestValues[e]=t.get(),this.bindToMotionValue(e,t)}removeValue(e){var t;this.values.delete(e),null===(t=this.valueSubscriptions.get(e))||void 0===t||t(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=oB(t),this.addValue(e,n)),n}readValue(e){return void 0===this.latestValues[e]&&this.current?this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;let{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(t=rb(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==r)return r;let i=this.getBaseTargetFromProps(this.props,e);return void 0===i||nB(i)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new oz),this.events[e].add(t)}notify(e,...t){var n;null===(n=this.events[e])||void 0===n||n.notify(...t)}}let a5=["initial",...oJ],a6=a5.length;class a8 extends a3{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){var n;return null===(n=e.style)||void 0===n?void 0:n[t]}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},{transformValues:r},i){let o=function(e,t,n){var r;let i={};for(let o in e){let e=function(e,t){if(!t)return;let n=t[e]||t.default||t;return n.from}(o,t);i[o]=void 0!==e?e:null===(r=n.getValue(o))||void 0===r?void 0:r.get()}return i}(n,e||{},this);if(r&&(t&&(t=r(t)),n&&(n=r(n)),o&&(o=r(o))),i){!function(e,t,n){var r,i;let o=Object.keys(t).filter(t=>!e.hasValue(t)),a=o.length;if(a)for(let s=0;snF(e)?new a9(t,{enableHardwareAcceleration:!1}):new a7(t,{enableHardwareAcceleration:!0});function st(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let sn={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!n2.test(e))return e;e=parseFloat(e)}let n=st(e,t.target.x),r=st(e,t.target.y);return`${n}% ${r}%`}},sr="_$css",si={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=e.includes("var("),o=[];i&&(e=e.replace(aV,e=>(o.push(e),sr)));let a=iR.parse(e);if(a.length>5)return r;let s=iR.createTransformer(e),l="number"!=typeof a[0]?1:0,u=n.x.scale*t.x,c=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=c;let d=id(u,c,.5);"number"==typeof a[2+l]&&(a[2+l]/=d),"number"==typeof a[3+l]&&(a[3+l]/=d);let f=s(a);if(i){let e=0;f=f.replace(sr,()=>{let t=o[e];return e++,t})}return f}};class so extends b.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;Object.assign(nV,sa),i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nT.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,o=n.projection;return o&&(o.isPresent=i,r||e.layoutDependency!==t||void 0===t?o.willUpdate():this.safeToRemove(),e.isPresent===i||(i?o.promote():o.relegate()||t8.postRender(()=>{var e;(null===(e=o.getStack())||void 0===e?void 0:e.members.length)||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),(null==t?void 0:t.group)&&t.group.remove(r),(null==n?void 0:n.deregister)&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;null==e||e()}render(){return null}}let sa={borderRadius:{...sn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sn,borderTopRightRadius:sn,borderBottomLeftRadius:sn,borderBottomRightRadius:sn,boxShadow:si},ss=["TopLeft","TopRight","BottomLeft","BottomRight"],sl=ss.length,su=e=>"string"==typeof e?parseFloat(e):e,sc=e=>"number"==typeof e||n2.test(e);function sd(e,t){var n;return null!==(n=e[t])&&void 0!==n?n:e.borderRadius}let sf=sp(0,.5,iJ),sh=sp(.5,.95,iY);function sp(e,t,n){return r=>rt?1:n(ic(e,t,r))}function sm(e,t){e.min=t.min,e.max=t.max}function sv(e,t){sm(e.x,t.x),sm(e.y,t.y)}function sg(e,t,n,r,i){return e-=t,e=r+1/n*(e-r),void 0!==i&&(e=r+1/i*(e-r)),e}function sy(e,t,[n,r,i],o,a){!function(e,t=0,n=1,r=.5,i,o=e,a=e){if(n1.test(t)){t=parseFloat(t);let e=id(a.min,a.max,t/100);t=e-a.min}if("number"!=typeof t)return;let s=id(o.min,o.max,r);e===o&&(s-=t),e.min=sg(e.min,t,n,s,i),e.max=sg(e.max,t,n,s,i)}(e,t[n],t[r],t[i],t.scale,o,a)}let sx=["x","scaleX","originX"],sb=["y","scaleY","originY"];function sw(e,t,n,r){sy(e.x,t,sx,null==n?void 0:n.x,null==r?void 0:r.x),sy(e.y,t,sb,null==n?void 0:n.y,null==r?void 0:r.y)}function sE(e){return 0===e.translate&&1===e.scale}function sj(e){return sE(e.x)&&sE(e.y)}function sk(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function sS(e){return ar(e.x)/ar(e.y)}class s_{constructor(){this.members=[]}add(e){oF(this.members,e),e.scheduleRender()}remove(e){if(oV(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t;let n=this.members.findIndex(t=>e===t);if(0===n)return!1;for(let e=n;e>=0;e--){let n=this.members[e];if(!1!==n.isPresent){t=n;break}}return!!t&&(this.promote(t),!0)}promote(e,t){var n;let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues,e.snapshot.isShared=!0),(null===(n=e.root)||void 0===n?void 0:n.isUpdating)&&(e.isLayoutDirty=!0);let{crossfade:i}=e.options;!1===i&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,n,r,i,o;null===(n=(t=e.options).onExitComplete)||void 0===n||n.call(t),null===(o=null===(r=e.resumingFrom)||void 0===r?void 0:(i=r.options).onExitComplete)||void 0===o||o.call(i)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function sO(e,t,n){let r=e.x.translate/t.x,i=e.y.translate/t.y,o=`translate3d(${r}px, ${i}px, 0) `;if(o+=`scale(${1/t.x}, ${1/t.y}) `,n){let{rotate:e,rotateX:t,rotateY:r}=n;e&&(o+=`rotate(${e}deg) `),t&&(o+=`rotateX(${t}deg) `),r&&(o+=`rotateY(${r}deg) `)}let a=e.x.scale*t.x,s=e.y.scale*t.y;return"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"==(o+=`scale(${a}, ${s})`)?"none":o}let sC=(e,t)=>e.depth-t.depth;class sM{constructor(){this.children=[],this.isDirty=!1}add(e){oF(this.children,e),this.isDirty=!0}remove(e){oV(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(sC),this.isDirty=!1,this.children.forEach(e)}}let sA=["","X","Y","Z"];function sT({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e,n={},r=null==t?void 0:t()){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(sV),this.nodes.forEach(sz)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=e,this.latestValues=n,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0,e&&this.root.registerPotentialNode(e,this);for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=oM(r,250),nT.hasAnimatedSinceResize&&(nT.hasAnimatedSinceResize=!1,this.nodes.forEach(sF))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&a&&(i||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{var i,o,s,l,u;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let c=null!==(o=null!==(i=this.options.transition)&&void 0!==i?i:a.getDefaultTransition())&&void 0!==o?o:sW,{onLayoutAnimationStart:d,onLayoutAnimationComplete:f}=a.getProps(),h=!this.targetLayout||!sk(this.targetLayout,r)||n,p=!t&&n;if((null===(s=this.resumeFrom)||void 0===s?void 0:s.instance)||p||t&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,p);let t={...oN(c,"layout"),onPlay:d,onComplete:f};a.shouldReduceMotion&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||0!==this.animationProgress||sF(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=r})}unmount(){var e,t;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(e=this.getStack())||void 0===e||e.remove(this),null===(t=this.parent)||void 0===t||t.children.delete(this),this.instance=void 0,t7.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var e;return this.isAnimationBlocked||(null===(e=this.parent)||void 0===e?void 0:e.isTreeAnimationBlocked())||!1}startUpdate(){var e;this.isUpdateBlocked()||(this.isUpdating=!0,null===(e=this.nodes)||void 0===e||e.forEach(sI))}willUpdate(e=!0){var t,n,r;if(this.root.isUpdateBlocked()){null===(n=(t=this.options).onExitComplete)||void 0===n||n.call(t);return}if(this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;let e=this.measure(),t=this.removeTransform(this.removeElementScroll(e));sY(t),this.snapshot={measured:e,layout:t,latestValues:{}}}updateLayout(){var e;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0),c=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(sU));this.animationProgress=0,this.mixTargetDelta=t=>{var n,r,d;let f=t/1e3;sB(a.x,e.x,f),sB(a.y,e.y,f),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(au(s,this.layout.actual,this.relativeParent.layout.actual),r=this.relativeTarget,d=this.relativeTargetOrigin,sH(r.x,d.x,s.x,f),sH(r.y,d.y,s.y,f)),l&&(this.animationValues=o,function(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=id(0,null!==(a=n.opacity)&&void 0!==a?a:1,sf(r)),e.opacityExit=id(null!==(s=t.opacity)&&void 0!==s?s:1,0,sh(r))):o&&(e.opacity=id(null!==(l=t.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,r));for(let i=0;i{nT.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n={}){let r=nB(e)?e:oB(e);return oR("",r,1e3,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}(0,0,{...e,onUpdate:t=>{var n;this.mixTargetDelta(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:()=>{var t;null===(t=e.onComplete)||void 0===t||t.call(e),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var e;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(e=this.getStack())||void 0===e||e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var e;this.currentAnimation&&(null===(e=this.mixTargetDelta)||void 0===e||e.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&sG(this.options.animationType,this.layout.actual,r.actual)){n=this.target||ag();let t=ar(this.layout.actual.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=ar(this.layout.actual.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}sv(t,n),aT(t,i),aa(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){var n,r,i;this.sharedNodes.has(e)||this.sharedNodes.set(e,new s_);let o=this.sharedNodes.get(e);o.add(t),t.promote({transition:null===(n=t.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(r=t.options.initialPromotionConfig)||void 0===r?void 0:r.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(r,t)})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){var e;let{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;let{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,n={};for(let r=0;r{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(sD),this.root.sharedNodes.clear()}}}function sP(e){e.updateLayout()}function sN(e){var t,n,r;let i=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){let{actual:t,measured:n}=e.layout,{animationType:r}=e.options;"size"===r?ay(e=>{let n=i.isShared?i.measured[e]:i.layout[e],r=ar(n);n.min=t[e].min,n.max=n.min+r}):sG(r,i.layout,t)&&ay(e=>{let n=i.isShared?i.measured[e]:i.layout[e],r=ar(t[e]);n.max=n.min+r});let o=am();aa(o,t,i.layout);let a=am();i.isShared?aa(a,e.applyTransform(n,!0),i.measured):aa(a,t,i.layout);let s=!sj(o),l=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:e,layout:r}=n;if(e&&r){let n=ag();au(n,i.layout,e.layout);let o=ag();au(o,t,r.actual),sk(n,o)||(l=!0)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:i,delta:a,layoutDelta:o,hasLayoutChanged:s,hasRelativeTargetChanged:l})}else e.isLead()&&(null===(r=(n=e.options).onExitComplete)||void 0===r||r.call(n));e.options.transition=void 0}function sR(e){e.clearSnapshot()}function sD(e){e.clearMeasurements()}function sL(e){let{visualElement:t}=e.options;(null==t?void 0:t.getProps().onBeforeLayoutMeasure)&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function sF(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function sV(e){e.resolveTargetDelta()}function sz(e){e.calcProjection()}function sI(e){e.resetRotation()}function sZ(e){e.removeLeadSnapshot()}function sB(e,t,n){e.translate=id(t.translate,0,n),e.scale=id(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function sH(e,t,n,r){e.min=id(t.min,n.min,r),e.max=id(t.max,n.max,r)}function sU(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let sW={duration:.45,ease:[.4,0,.1,1]};function sq(e,t){let n=e.root;for(let t=e.path.length-1;t>=0;t--)if(e.path[t].instance){n=e.path[t];break}let r=n&&n!==e.root?n.instance:document,i=r.querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function s$(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function sY(e){s$(e.x),s$(e.y)}function sG(e,t,n){return"position"===e||"preserve-aspect"===e&&!function(e,t,n=.1){return o8(e,t)<=n}(sS(t),sS(n),.2)}let sX=sT({attachResizeListener:(e,t)=>rC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),sK={current:void 0},sQ=sT({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sK.current){let e=new sX(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),sK.current=e}return sK.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),sJ={...o4,...r6,...aL,measureLayout:function(e){let[t,n]=r8(),r=(0,b.useContext)(nh);return b.createElement(so,{...e,layoutGroup:r,switchLayoutGroup:(0,b.useContext)(nR),isPresent:t,safeToRemove:n})}},s0=function(e){function t(t,n={}){return function({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&function(e){for(let t in e)"projectionNodeConstructor"===t?nA.projectionNodeConstructor=e[t]:nA[t].Component=e[t]}(e);let a=(0,b.forwardRef)(function(a,s){var l;let u={...(0,b.useContext)(nx),...a,layoutId:function({layoutId:e}){let t=(0,b.useContext)(nh).id;return t&&void 0!==e?t+"-"+e:e}(a)},{isStatic:c}=u,d=null,f=function(e){let{initial:t,animate:n}=function(e,t){if(n_(e)){let{initial:t,animate:n}=e;return{initial:!1===t||nj(t)?t:void 0,animate:nj(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,b.useContext)(nb));return(0,b.useMemo)(()=>({initial:t,animate:n}),[nC(t),nC(n)])}(a),h=c?void 0:nl(()=>{if(nT.hasEverUpdated)return nP++}),p=i(a,c);if(!c&&ni){f.visualElement=function(e,t,n,r){let i=(0,b.useContext)(nb).visualElement,o=(0,b.useContext)(nw),a=(0,b.useContext)(ns),s=(0,b.useContext)(nx).reducedMotion,l=(0,b.useRef)();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:s}));let u=l.current;return no(()=>{u&&u.render()}),(0,b.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),no(()=>()=>u&&u.notify("Unmount"),[]),u}(o,p,u,t);let r=(0,b.useContext)(nw).strict,i=(0,b.useContext)(nR);f.visualElement&&(d=f.visualElement.loadFeatures(u,r,e,h,n||nA.projectionNodeConstructor,i))}return b.createElement(nN,{visualElement:f.visualElement,props:u},d,b.createElement(nb.Provider,{value:f},r(o,a,h,(l=f.visualElement,(0,b.useCallback)(e=>{e&&p.mount&&p.mount(e),l&&(e?l.mount(e):l.unmount()),s&&("function"==typeof s?s(e):nE(s)&&(s.current=e))},[l])),p,c,f.visualElement)))});return a[nD]=o,a}(e(t,n))}if("undefined"==typeof Proxy)return t;let n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}((e,t)=>(function(e,{forwardMotionProps:t=!1},n,r,i){let o=nF(e)?r_:rO;return{...o,preloadedFeatures:n,useRender:function(e=!1){return(t,n,r,i,{latestValues:o},a)=>{let s=nF(t)?rh:ri,l=s(n,o,a),u=function(e,t,n){let r={};for(let i in e)(rs(i)||!0===n&&ra(i)||!t&&!ra(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(n,"string"==typeof t,e),c={...u,...l,ref:i};return r&&(c["data-projection-id"]=r),(0,b.createElement)(t,c)}}(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}})(e,t,sJ,se,sQ));function s1(e){let{open:t,onOpenChange:n}=e,[r,i]=(0,b.useState)(!1),o=(0,b.useMemo)(()=>n?t:r,[n,r,t]),a=(0,b.useCallback)(e=>{n?n(e):i(e)},[n]);return{open:o,onOpenChange:a}}let s2={show:{opacity:[0,1],scale:[.95,1],transition:{duration:.1,ease:"easeOut"}},exit:{opacity:[1,0],scale:[1,.95],transition:{duration:.1,ease:"easeIn"}}};function s4(e){let{children:t,content:n,defaultOpen:r,open:i,onOpenChange:o,delayDuration:a=300,disableHoverableContent:s,...l}=e,{open:u,onOpenChange:c}=s1({open:i,onOpenChange:o});return(0,x.jsxs)(tH,{open:u,delayDuration:a,disableHoverableContent:s,defaultOpen:r,onOpenChange:c,children:[(0,x.jsx)(tN,{asChild:!0,children:t}),(0,x.jsx)(ny,{children:n&&u?(0,x.jsx)(tU,{forceMount:!0,children:(0,x.jsx)(tV,{forceMount:!0,asChild:!0,side:"top",align:"center",sideOffset:l.sideOffset||5,...l,children:(0,x.jsx)(s0.div,{variants:s2,initial:"init",animate:"show",exit:"exit",className:(0,ea.cx)("relative","z-50","data-[side=top]:bottom-1","data-[side=top]:origin-bottom","data-[side=bottom]:top-1","data-[side=bottom]:origin-top","data-[side=left]:right-1","data-[side=left]:origin-right","data-[side=right]:left-1","data-[side=right]:origin-left"),children:(0,x.jsx)("div",{className:(0,ea.cx)("py-1 px-2","max-w-xs","overflow-hidden",tY()),children:(0,x.jsx)(t$,{size:"12",children:n})})})})}):null})]})}let s3=(0,ea.j)(["inline-flex","gap-1","appearance-none","shrink-0","items-center","justify-center","select-none","leading-normal","font-sans","cursor-pointer","overflow-hidden","focus:z-10","disabled:cursor-auto","disabled:pointer-events-none","outline-none","focus:ring ring-blue-500 dark:ring-blue-200","transition-colors duration-75"],{variants:{size:{small:["text-xs","px-2","h-7"],medium:["text-base","px-4","h-10"],large:["text-lg","px-4","h-12"],none:[]},state:{waiting:["pointer-events-none"]},disabled:{true:"cursor-auto pointer-events-none"},rounded:{true:"rounded",false:""},variant:{accent:["border","text-white dark:text-white","enabled:bg-green-700 enabled:dark:bg-green-700","enabled:border-green-800/30 enabled:dark:border-green-600/70","enabled:hover:bg-green-800/90 dark:enabled:hover:bg-green-700/90","enabled:hover:border-green-800/50 enabled:hover:dark:border-green-600","disabled:text-white/50 disabled:dark:text-white/50","disabled:bg-green-700/70 disabled:dark:bg-green-600/70","disabled:border-green-600/50 disabled:dark:border-green-500/30","[&[href]]:bg-green-700 [&[href]]:dark:bg-green-700","[&[href]]:border-green-800/30 [&[href]]:dark:border-green-600/70","[&[href]]:hover:bg-green-800/90 dark:[&[href]]:hover:bg-green-700/90","[&[href]]:hover:border-green-800/50 [href]]:hover:dark:border-green-600"],red:["border","bg-red-700 dark:bg-red-700","border-red-800/30 dark:border-red-600/70","enabled:hover:bg-red-800/90 dark:enabled:hover:bg-red-700/90","enabled:hover:border-red-800/50 enabled:hover:dark:border-red-600","disabled:bg-red-700/70 disabled:dark:bg-red-600/70","disabled:border-red-600/50 disabled:dark:border-red-500/30","text-white dark:text-white","disabled:text-white/50 disabled:dark:text-white/50"],amber:["border","bg-amber-700 dark:bg-amber-700","border-amber-800/30 dark:border-amber-600/70","enabled:hover:bg-amber-800/90 dark:enabled:hover:bg-amber-700/90","enabled:hover:border-amber-800/50 enabled:hover:dark:border-amber-600","disabled:bg-amber-700/70 disabled:dark:bg-amber-600/70","disabled:border-amber-600/50 disabled:dark:border-amber-500/30","text-white dark:text-white","disabled:text-white/50 disabled:dark:text-white/50"],gray:["border","bg-white dark:bg-graydark-200","enabled:hover:bg-gray-50 dark:enabled:hover:bg-graydark-300","disabled:bg-gray-200 disabled:dark:bg-graydark-200","border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","text-gray-1100 dark:text-gray-300","disabled:text-gray-600 disabled:dark:text-graydark-700"],active:["border","bg-gray-200 dark:bg-graydark-400","enabled:hover:bg-gray-50 dark:enabled:hover:bg-graydark-300","disabled:bg-gray-200 disabled:dark:bg-graydark-200","border-gray-500 dark:border-graydark-500","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","text-gray-1100 dark:text-white","disabled:text-gray-600 disabled:dark:text-graydark-700"],inactive:["border","bg-white dark:bg-graydark-200","enabled:hover:bg-gray-50 dark:enabled:hover:bg-graydark-300","disabled:bg-gray-200 disabled:dark:bg-graydark-200","border-gray-400/70 dark:border-graydark-400/70","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","text-gray-1100/30 dark:text-white/30","enabled:hover:text-gray-1100 enabled:hover:dark:text-white","disabled:text-gray-600 disabled:dark:text-graydark-700"],ghost:["appearance-none border-none bg-transparent","text-gray-1100 dark:text-white","disabled:text-gray-600 disabled:dark:text-graydark-700"],state:["open:text-gray-1100 open:dark:text-white","hover:text-gray-1000 hover:dark:text-graydark-1000","text-gray-700 dark:text-graydark-800"]},icon:{contrast:"",hover:"[&>svg]:opacity-50 hover:[&>svg]:opacity-100 transition-opacity",subtle:"[&>svg]:opacity-50"},color:{verySubtle:"!text-gray-700 dark:!text-graydark-700",subtle:"!text-gray-1000 dark:!text-graydark-1000",contrast:"!text-gray-1100 dark:!text-white",lo:"!text-white dark:!text-graydark-50",accent:"!text-accent-1100 dark:!text-accentdark-1100",red:"!text-red-700 dark:!text-red-400",green:"!text-emerald-700 dark:!text-emerald-500",amber:"!text-amber-600 dark:!text-amber-500",none:""}},defaultVariants:{variant:"gray",size:"small",rounded:!0,icon:"subtle",color:"none"}}),s5=b.forwardRef((e,t)=>{let{variant:n,size:r,state:i,rounded:o,disabled:a,icon:s,color:l,tip:u,tipAlign:c,tipSide:d,className:f,type:h="button",...p}=e;return u?(0,x.jsx)(s4,{content:u,align:c,side:d,children:(0,x.jsx)("button",{ref:t,type:h,disabled:a,className:s3({variant:n,size:r,state:i,rounded:o,disabled:a,icon:s,color:l,className:f}),...p})}):(0,x.jsx)("button",{ref:t,disabled:a,type:h,className:s3({variant:n,size:r,state:i,rounded:o,disabled:a,icon:s,color:l,className:f}),...p})});var s6=n(41775);(0,ea.j)([],{variants:{variant:{default:"border-t border-gray-500 dark:border-graydark-500 last-of-type:border-b",ghost:""}},defaultVariants:{variant:"default"}});let s8=(0,ea.j)("border border-gray-500 dark:border-graydark-500 bg-gray-100 dark:bg-graydark-100 rounded p-4"),s7=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)("div",{...r,className:s8({className:n}),ref:t})});var s9=n(86029);let le="Avatar",[lt,ln]=(0,j.b)(le),[lr,li]=lt(le),lo=(0,b.forwardRef)((e,t)=>{let{__scopeAvatar:n,...r}=e,[i,o]=(0,b.useState)("idle");return(0,b.createElement)(lr,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},(0,b.createElement)(M.WV.span,(0,E.Z)({},r,{ref:t})))}),la=(0,b.forwardRef)((e,t)=>{let{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=li("AvatarImage",n),s=function(e){let[t,n]=(0,b.useState)("idle");return(0,b.useEffect)(()=>{if(!e){n("error");return}let t=!0,r=new window.Image,i=e=>()=>{t&&n(e)};return n("loading"),r.onload=i("loaded"),r.onerror=i("error"),r.src=e,()=>{t=!1}},[e]),t}(r),l=(0,s9.W)(e=>{i(e),a.onImageLoadingStatusChange(e)});return(0,A.b)(()=>{"idle"!==s&&l(s)},[s,l]),"loaded"===s?(0,b.createElement)(M.WV.img,(0,E.Z)({},o,{ref:t,src:r})):null}),ls=(0,b.forwardRef)((e,t)=>{let{__scopeAvatar:n,delayMs:r,...i}=e,o=li("AvatarFallback",n),[a,s]=(0,b.useState)(void 0===r);return(0,b.useEffect)(()=>{if(void 0!==r){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),a&&"loaded"!==o.imageLoadingStatus?(0,b.createElement)(M.WV.span,(0,E.Z)({},i,{ref:t})):null}),ll=(0,ea.j)(["items-center justify-center align-middle flex flex-shrink-0 relative","overflow-hidden select-none outline-none","font-sans font-medium text-sm","border"],{variants:{size:{1:"w-6 h-6",2:"w-12 h-12",3:"w-16 h-16",4:"w-28 h-28"},variant:{filter:"bg-transparent",hiContrast:["bg-gray-900 dark:bg-white text-white dark:text-gray-1100","border-gray-900 dark:border-white text-white dark:text-gray-1100"],gray:["bg-gray-500 dark:bg-gray-800 text-gray-1100 dark:text-white","border-gray-500 dark:border-gray-800 text-gray-1100 dark:text-white"]},shape:{square:"rounded",circle:"rounded-full"},inactive:{true:"opacity-30"},interactive:{true:"cursor-pointer"}},defaultVariants:{size:"2",variant:"gray",shape:"circle"}}),lu=(0,ea.j)("uppercase",{variants:{size:{1:"text-sm",2:"text-base",3:"text-lg",4:"text-lg"}},defaultVariants:{size:"2"}}),lc=b.forwardRef((e,t)=>{let{alt:n,src:r,fallback:i,size:o,variant:a,shape:s,interactive:l,inactive:u,className:c,...d}=e;return(0,x.jsx)("div",{className:(0,ea.cx)("relative h-fit w-fit",c),children:(0,x.jsxs)(lo,{...d,ref:t,className:ll({className:c,size:o,variant:a,interactive:l,inactive:u,shape:s}),children:["filter"===a&&(0,x.jsx)("div",{className:"absolute w-full h-full z-10",style:{backgroundColor:"rgba(30, 169, 76, 0.3)"}}),(0,x.jsx)(la,{alt:n,src:r,className:"flex object-cover h-full align-middle w-full"}),(0,x.jsx)(ls,{className:lu({size:o}),children:i})]})})}),ld=(0,ea.j)(["items-center appearance-none inline-flex flex-shrink-0 whitespace-nowrap","font-sans font-regular text-sm","justify-center align-middle outline-none p-0 decoration-none select-none","disabled:pointer-events-none","py-0.5 px-2"],{variants:{variant:{active:["border","bg-gray-800 text-gray-900 border-gray-900","dark:bg-transparent dark:text-white dark:border-white/10"],simple:"bg-gray-300 dark:bg-graydark-800 text-gray-900 dark:text-white",green:["border","[&>svg]:opacity-50","bg-green-700 dark:bg-green-700","border-green-800/30 dark:border-green-600/70","hover:bg-green-800/90 dark:hover:bg-green-700/90","hover:border-green-800/50 hover:dark:border-green-600","text-white dark:text-white"],accent:["border","[&>svg]:opacity-50","bg-green-700 dark:bg-green-700","border-green-800/30 dark:border-green-600/70","hover:bg-green-800/90 dark:hover:bg-green-700/90","hover:border-green-800/50 hover:dark:border-green-600","text-white dark:text-white"],red:["border","[&>svg]:opacity-50","bg-red-700 dark:bg-red-700","border-red-800/30 dark:border-red-600/70","hover:bg-red-800/90 dark:hover:bg-red-700/90","hover:border-red-800/50 hover:dark:border-red-600","text-white dark:text-white"],amber:["border","[&>svg]:opacity-50","bg-amber-700 dark:bg-amber-700","border-amber-800/30 dark:border-amber-600/70","hover:bg-amber-800/90 dark:hover:bg-amber-700/90","hover:border-amber-800/50 hover:dark:border-amber-600","text-white dark:text-white"],gray:["border","[&>svg]:opacity-50","bg-white dark:bg-graydark-200","border-gray-400 dark:border-graydark-400","hover:bg-gray-50 dark:hover:bg-graydark-300","hover:border-gray-500 hover:dark:border-graydark-500","text-gray-1100 dark:text-white"],inactive:["border","[&>svg]:opacity-50","bg-white dark:bg-transparent","border-gray-400 dark:border-graydark-400","hover:border-gray-500 hover:dark:border-graydark-500","text-gray-1100/30 dark:text-white/30","hover:text-gray-1100/50 hover:dark:text-white/50"]},interactive:{true:"cursor-pointer"},rounded:{true:"rounded",false:""}},defaultVariants:{variant:"gray",rounded:!0}}),lf=b.forwardRef((e,t)=>{let{variant:n,interactive:r,rounded:i,className:o,...a}=e;return(0,x.jsx)("div",{...a,className:ld({variant:n,interactive:r,rounded:i,className:o}),ref:t})}),lh=b.forwardRef((e,t)=>{let{className:n,size:r,color:i,...o}=e;return(0,x.jsx)("pre",{children:(0,x.jsx)("code",{className:(0,ea.cx)(tW({font:"mono",size:r,color:i}),"block","w-full","overflow-auto","p-3","bg-white dark:bg-graydark-200","border border-gray-400 dark:border-graydark-400","rounded",n),...o,ref:t})})}),lp=(0,ea.j)(["font-mono","whitespace-nowrap","rounded"],{variants:{color:{gray:["bg-gray-200 dark:bg-graydark-200","text-gray-1100 dark:text-graydark-1100"],accent:["bg-accent-200 dark:bg-accentdark-200","text-accent-1100 dark:text-accentdark-1100"]}},defaultVariants:{color:"accent"}}),lm=b.forwardRef((e,t)=>{let{color:n,className:r,...i}=e;return(0,x.jsx)("code",{...i,className:lp({color:n,className:r}),ref:t})}),lv=(0,ea.j)(["flex","relative","[&>*]:rounded-none [&>*:last-child]:rounded-r [&>*:first-child]:rounded-l","[&>*]:border-r-0 [&>*]:border-l [&>*:first-child]:border-l [&>*:last-child]:border-r"]),lg=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)("div",{ref:t,className:lv({className:n}),...r})});(0,ea.j)(["select-none appearance-none outline-none overflow-hidden","inline-flex items-center justify-center","focus:ring ring-blue-500 dark:ring-blue-200","border","bg-gray-300 dark:bg-graydark-50","autofill:bg-blue-100 autofill:dark:bg-blue-800","border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","disabled:cursor-default","enabled:data-[state=checked]:bg-green-600 dark:enabled:data-[state=checked]:bg-green-500","disabled:data-[state=checked]:bg-green-600/50 dark:disabled:data-[state=checked]:bg-green-500/50"],{variants:{size:{small:"w-4 h-4 rounded",medium:"w-6 h-6 rounded"}},defaultVariants:{size:"small"}});let ly=(0,ea.j)(["flex-shrink-0 w-full mx-auto"],{variants:{pad:{true:"px-5 md:px-10",false:""},size:{1:"max-w-screen-sm",2:"max-w-screen-md",3:"max-w-[1145px]",4:"max-w-screen-2xl",full:"max-w-none"}},defaultVariants:{pad:!0,size:"3"}}),lx=b.forwardRef((e,t)=>{let{className:n,pad:r,size:i,...o}=e;return(0,x.jsx)("div",{ref:t,...o,className:ly({size:i,pad:r,className:n})})});var lb=n(72331);let lw=(0,b.createContext)(void 0);function lE(e){let t=(0,b.useContext)(lw);return e||t||"ltr"}let lj="ScrollArea",[lk,lS]=(0,j.b)(lj),[l_,lO]=lk(lj),lC=(0,b.forwardRef)((e,t)=>{let{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[s,l]=(0,b.useState)(null),[u,c]=(0,b.useState)(null),[d,f]=(0,b.useState)(null),[h,p]=(0,b.useState)(null),[m,v]=(0,b.useState)(null),[g,y]=(0,b.useState)(0),[x,w]=(0,b.useState)(0),[j,S]=(0,b.useState)(!1),[_,O]=(0,b.useState)(!1),C=(0,k.e)(t,e=>l(e)),A=lE(i);return(0,b.createElement)(l_,{scope:n,type:r,dir:A,scrollHideDelay:o,scrollArea:s,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:p,scrollbarXEnabled:j,onScrollbarXEnabledChange:S,scrollbarY:m,onScrollbarYChange:v,scrollbarYEnabled:_,onScrollbarYEnabledChange:O,onCornerWidthChange:y,onCornerHeightChange:w},(0,b.createElement)(M.WV.div,(0,E.Z)({dir:A},a,{ref:C,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})))}),lM=(0,b.forwardRef)((e,t)=>{let{__scopeScrollArea:n,children:r,...i}=e,o=lO("ScrollAreaViewport",n),a=(0,b.useRef)(null),s=(0,k.e)(t,a,o.onViewportChange);return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),(0,b.createElement)(M.WV.div,(0,E.Z)({"data-radix-scroll-area-viewport":""},i,{ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),(0,b.createElement)("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),lA="ScrollAreaScrollbar",lT=(0,b.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=lO(lA,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s="horizontal"===e.orientation;return(0,b.useEffect)(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),"hover"===i.type?(0,b.createElement)(lP,(0,E.Z)({},r,{ref:t,forceMount:n})):"scroll"===i.type?(0,b.createElement)(lN,(0,E.Z)({},r,{ref:t,forceMount:n})):"auto"===i.type?(0,b.createElement)(lR,(0,E.Z)({},r,{ref:t,forceMount:n})):"always"===i.type?(0,b.createElement)(lD,(0,E.Z)({},r,{ref:t})):null}),lP=(0,b.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=lO(lA,e.__scopeScrollArea),[o,a]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),a(!0)},r=()=>{t=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[i.scrollArea,i.scrollHideDelay]),(0,b.createElement)(T.z,{present:n||o},(0,b.createElement)(lR,(0,E.Z)({"data-state":o?"visible":"hidden"},r,{ref:t})))}),lN=(0,b.forwardRef)((e,t)=>{var n;let{forceMount:r,...i}=e,o=lO(lA,e.__scopeScrollArea),a="horizontal"===e.orientation,s=lJ(()=>u("SCROLL_END"),100),[l,u]=(n={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},(0,b.useReducer)((e,t)=>{let r=n[e][t];return null!=r?r:e},"hidden"));return(0,b.useEffect)(()=>{if("idle"===l){let e=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,o.scrollHideDelay,u]),(0,b.useEffect)(()=>{let e=o.viewport,t=a?"scrollLeft":"scrollTop";if(e){let n=e[t],r=()=>{let r=e[t],i=n!==r;i&&(u("SCROLL"),s()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[o.viewport,a,u,s]),(0,b.createElement)(T.z,{present:r||"hidden"!==l},(0,b.createElement)(lD,(0,E.Z)({"data-state":"hidden"===l?"hidden":"visible"},i,{ref:t,onPointerEnter:(0,O.M)(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:(0,O.M)(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),lR=(0,b.forwardRef)((e,t)=>{let n=lO(lA,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=(0,b.useState)(!1),s="horizontal"===e.orientation,l=lJ(()=>{if(n.viewport){let e=n.viewport.offsetWidth{let{orientation:n="vertical",...r}=e,i=lO(lA,e.__scopeScrollArea),o=(0,b.useRef)(null),a=(0,b.useRef)(0),[s,l]=(0,b.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=lY(s.viewport,s.content),c={...r,sizes:s,onSizesChange:l,hasThumb:!!(u>0&&u<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:e=>a.current=e};function d(e,t){return function(e,t,n,r="ltr"){let i=lG(n),o=t||i/2,a=n.scrollbar.paddingStart+o,s=n.scrollbar.size-n.scrollbar.paddingEnd-(i-o),l=n.content-n.viewport,u=lK([a,s],"ltr"===r?[0,l]:[-1*l,0]);return u(e)}(e,a.current,s,t)}return"horizontal"===n?(0,b.createElement)(lL,(0,E.Z)({},c,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=i.viewport.scrollLeft,t=lX(e,s,i.dir);o.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}})):"vertical"===n?(0,b.createElement)(lF,(0,E.Z)({},c,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=i.viewport.scrollTop,t=lX(e,s);o.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}})):null}),lL=(0,b.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=lO(lA,e.__scopeScrollArea),[a,s]=(0,b.useState)(),l=(0,b.useRef)(null),u=(0,k.e)(t,l,o.onScrollbarXChange);return(0,b.useEffect)(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,b.createElement)(lI,(0,E.Z)({"data-orientation":"horizontal"},i,{ref:u,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":lG(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),r>0&&r{l.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:l$(a.paddingLeft),paddingEnd:l$(a.paddingRight)}})}}))}),lF=(0,b.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=lO(lA,e.__scopeScrollArea),[a,s]=(0,b.useState)(),l=(0,b.useRef)(null),u=(0,k.e)(t,l,o.onScrollbarYChange);return(0,b.useEffect)(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,b.createElement)(lI,(0,E.Z)({"data-orientation":"vertical"},i,{ref:u,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":lG(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),r>0&&r{l.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:l$(a.paddingTop),paddingEnd:l$(a.paddingBottom)}})}}))}),[lV,lz]=lk(lA),lI=(0,b.forwardRef)((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=e,h=lO(lA,n),[p,m]=(0,b.useState)(null),v=(0,k.e)(t,e=>m(e)),g=(0,b.useRef)(null),y=(0,b.useRef)(""),x=h.viewport,w=r.content-r.viewport,j=(0,s9.W)(c),S=(0,s9.W)(l),_=lJ(d,10);function C(e){if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;u({x:t,y:n})}}return(0,b.useEffect)(()=>{let e=e=>{let t=e.target,n=null==p?void 0:p.contains(t);n&&j(e,w)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,p,w,j]),(0,b.useEffect)(S,[r,S]),l0(p,_),l0(h.content,_),(0,b.createElement)(lV,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:(0,s9.W)(o),onThumbPointerUp:(0,s9.W)(a),onThumbPositionChange:S,onThumbPointerDown:(0,s9.W)(s)},(0,b.createElement)(M.WV.div,(0,E.Z)({},f,{ref:v,style:{position:"absolute",...f.style},onPointerDown:(0,O.M)(e.onPointerDown,e=>{if(0===e.button){let t=e.target;t.setPointerCapture(e.pointerId),g.current=p.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C(e)}}),onPointerMove:(0,O.M)(e.onPointerMove,C),onPointerUp:(0,O.M)(e.onPointerUp,e=>{let t=e.target;t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,g.current=null})})))}),lZ="ScrollAreaThumb",lB=(0,b.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=lz(lZ,e.__scopeScrollArea);return(0,b.createElement)(T.z,{present:n||i.hasThumb},(0,b.createElement)(lH,(0,E.Z)({ref:t},r)))}),lH=(0,b.forwardRef)((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,o=lO(lZ,n),a=lz(lZ,n),{onThumbPositionChange:s}=a,l=(0,k.e)(t,e=>a.onThumbChange(e)),u=(0,b.useRef)(),c=lJ(()=>{u.current&&(u.current(),u.current=void 0)},100);return(0,b.useEffect)(()=>{let e=o.viewport;if(e){let t=()=>{if(c(),!u.current){let t=lQ(e,s);u.current=t,s()}};return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,c,s]),(0,b.createElement)(M.WV.div,(0,E.Z)({"data-state":a.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:(0,O.M)(e.onPointerDownCapture,e=>{let t=e.target,n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;a.onThumbPointerDown({x:r,y:i})}),onPointerUp:(0,O.M)(e.onPointerUp,a.onThumbPointerUp)}))}),lU="ScrollAreaCorner",lW=(0,b.forwardRef)((e,t)=>{let n=lO(lU,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY),i="scroll"!==n.type&&r;return i?(0,b.createElement)(lq,(0,E.Z)({},e,{ref:t})):null}),lq=(0,b.forwardRef)((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=lO(lU,n),[o,a]=(0,b.useState)(0),[s,l]=(0,b.useState)(0);return l0(i.scrollbarX,()=>{var e;let t=(null===(e=i.scrollbarX)||void 0===e?void 0:e.offsetHeight)||0;i.onCornerHeightChange(t),l(t)}),l0(i.scrollbarY,()=>{var e;let t=(null===(e=i.scrollbarY)||void 0===e?void 0:e.offsetWidth)||0;i.onCornerWidthChange(t),a(t)}),o&&s?(0,b.createElement)(M.WV.div,(0,E.Z)({},r,{ref:t,style:{width:o,height:s,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}})):null});function l$(e){return e?parseInt(e,10):0}function lY(e,t){let n=e/t;return isNaN(n)?0:n}function lG(e){let t=lY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function lX(e,t,n="ltr"){let r=lG(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s="ltr"===n?[0,a]:[-1*a,0],l=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,s),u=lK([0,a],[0,o-r]);return u(l)}function lK(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}let lQ=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return!function i(){let o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function lJ(e,t){let n=(0,s9.W)(e),r=(0,b.useRef)(0);return(0,b.useEffect)(()=>()=>window.clearTimeout(r.current),[]),(0,b.useCallback)(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function l0(e,t){let n=(0,s9.W)(t);(0,A.b)(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}let l1=b.forwardRef((e,t)=>{let{id:n,className:r,style:i,children:o,keyToResetScrollbars:a}=e;return(0,x.jsxs)(lC,{className:(0,ea.cx)("w-full h-full overflow-hidden",r),style:i,children:[(0,x.jsx)(lM,{id:n,ref:t,className:"w-full h-full [&>div]:!block [&>div]:!h-full",children:o}),(0,x.jsx)(lT,{orientation:"vertical",className:"z-10 flex select-none touch-none transition-colors hover:bg-black/20 w-1.5 m-px",children:(0,x.jsx)(lB,{className:(0,ea.cx)("flex-1 relative bg-gray-300 rounded",'before:content[""] before:absolute before:top-1/2 before:left-1/2 -translate-x-1/2 -translate-y-1/2 w-full h-full')})},a?"v-".concat(a):void 0),(0,x.jsx)(lT,{orientation:"horizontal",className:"z-10 flex flex-col select-none touch-none transition-colors duration-1000 hover:bg-black/20 h-1 m-px",children:(0,x.jsx)(lB,{className:(0,ea.cx)("flex-1 relative bg-gray-300 rounded",'before:content[""] before:absolute before:top-1/2 before:left-1/2 -translate-x-1/2 -translate-y-1/2 w-full h-full')})},a?"h-".concat(a):void 0),(0,x.jsx)(lW,{className:"bg-black/70"})]})}),l2=(0,ea.j)(["z-20","overflow-hidden"],{variants:{variant:{default:"flex items-center justify-center w-full h-full",none:""}},defaultVariants:{variant:"default"}}),l4={show:{scale:[.95,1],transition:{duration:.1,ease:"easeOut"}},exit:{opacity:[1,0],scale:[1,.95],transition:{duration:.1,ease:"easeIn"}}},l3=b.forwardRef((e,t)=>{let{trigger:n,rootProps:r,open:i,onOpenChange:o,onSubmit:a,title:s,description:l,containerVariants:u,contentVariants:c,controls:d,children:f,bodyClassName:h,closeClassName:p,dynamicHeight:m=!0}=e,{open:v,onOpenChange:g}=s1({open:i,onOpenChange:o});return(0,x.jsxs)(lb.fC,{open:v,onOpenChange:g,...r,children:[n&&(0,x.jsx)(lb.xz,{asChild:!0,children:n}),(0,x.jsx)(ny,{children:v?(0,x.jsx)(lb.h_,{forceMount:!0,children:(0,x.jsx)(lb.VY,{asChild:!0,forceMount:!0,ref:t,children:(0,x.jsxs)("div",{className:"fixed w-full h-full top-0 left-0 z-20",children:[(0,x.jsx)(lb.aV,{onClick:()=>g(!1),className:"fixed z-10 top-0 right-0 bottom-0 left-0 inset-0 transition-opacity opacity-0 open:opacity-10 dark:open:opacity-20 bg-black"}),(0,x.jsx)(s0.div,{variants:l4,initial:"init",animate:"show",exit:"exit",className:l2(u),children:(0,x.jsx)(l8,{title:s,description:l,contentVariants:c,onSubmit:a,controls:d,bodyClassName:h,closeClassName:p,dynamicHeight:m,children:f})})]})})}):null})]})});function l5(e){let{className:t}=e;return(0,x.jsx)(lb.x8,{asChild:!0,type:"button",children:(0,x.jsx)("div",{className:(0,ea.cx)("appearance-none",t),children:(0,x.jsx)(s5,{size:"small",variant:"ghost",type:"button",children:(0,x.jsx)(s6.QN4,{})})})})}let l6=(0,ea.j)(["relative","z-40","overflow-hidden"],{variants:{variant:{default:[tY()],none:""}},defaultVariants:{variant:"default"}}),l8=b.forwardRef((e,t)=>{let{children:n,onSubmit:r,title:i,description:o,controls:a,contentVariants:s,closeClassName:l,bodyClassName:u,dynamicHeight:c=!0}=e,{ref:d,height:f}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],[t,n]=(0,b.useState)(0),r=(0,b.useRef)(null);return(0,b.useLayoutEffect)(()=>{if(!r.current)return;let e=r.current,t=()=>n(e.clientHeight);t(),r.current.addEventListener("resize",t);let i=new ResizeObserver(t);return i.observe(e),()=>{e.removeEventListener("resize",t),i.unobserve(e)}},e),{ref:r,height:t}}([n,o]),[h,p]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{p(f>.7*window.innerHeight)},[f]),(0,x.jsxs)(r?"form":"div",{onSubmit:r,ref:t,className:l6(s),children:[i&&(0,x.jsx)(lb.Dx,{className:l7({showSeparator:h}),children:i}),(0,x.jsx)(l1,{style:{height:c?"".concat(f,"px"):void 0,maxHeight:c?"70vh":void 0},children:(0,x.jsxs)("div",{ref:d,className:(0,ea.cx)("p-4",u),children:[o&&(0,x.jsx)(lb.dk,{className:l9(),children:o}),n]})}),a&&(0,x.jsx)(ue,{separator:h,children:a}),(0,x.jsx)(l5,{className:l||"absolute top-3.5 right-2"})]})}),l7=(0,ea.j)(["pt-4 pb-2 px-4 w-full",tW({size:"20",weight:"semibold",font:"sans",color:"contrast"})],{variants:{showSeparator:{true:"border-b border-gray-200 dark:border-graydark-200"}}}),l9=(0,ea.j)([tW({color:"subtle",size:"14"}),"py-2"]);function ue(e){let{children:t,separator:n=!0}=e;return(0,x.jsx)("div",{className:(0,ea.cx)("py-2 mx-3",n?"border-t border-gray-200 dark:border-graydark-200":""),children:t})}var ut=n(55070),un=n(77334);let ur="rovingFocusGroup.onEntryFocus",ui={bubbles:!1,cancelable:!0},uo="RovingFocusGroup",[ua,us,ul]=_(uo),[uu,uc]=(0,j.b)(uo,[ul]),[ud,uf]=uu(uo),uh=(0,b.forwardRef)((e,t)=>(0,b.createElement)(ua.Provider,{scope:e.__scopeRovingFocusGroup},(0,b.createElement)(ua.Slot,{scope:e.__scopeRovingFocusGroup},(0,b.createElement)(up,(0,E.Z)({},e,{ref:t}))))),up=(0,b.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,d=(0,b.useRef)(null),f=(0,k.e)(t,d),h=lE(o),[p=null,m]=(0,C.T)({prop:a,defaultProp:s,onChange:l}),[v,g]=(0,b.useState)(!1),y=(0,s9.W)(u),x=us(n),w=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let e=d.current;if(e)return e.addEventListener(ur,y),()=>e.removeEventListener(ur,y)},[y]),(0,b.createElement)(ud,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:p,onItemFocus:(0,b.useCallback)(e=>m(e),[m]),onItemShiftTab:(0,b.useCallback)(()=>g(!0),[])},(0,b.createElement)(M.WV.div,(0,E.Z)({tabIndex:v?-1:0,"data-orientation":r},c,{ref:f,style:{outline:"none",...e.style},onMouseDown:(0,O.M)(e.onMouseDown,()=>{w.current=!0}),onFocus:(0,O.M)(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(ur,ui);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable),t=e.find(e=>e.active),n=e.find(e=>e.id===p),r=[t,n,...e].filter(Boolean),i=r.map(e=>e.ref.current);ug(i)}}w.current=!1}),onBlur:(0,O.M)(e.onBlur,()=>g(!1))})))}),um=(0,b.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=(0,P.M)(),s=uf("RovingFocusGroupItem",n),l=s.currentTabStopId===a,u=us(n);return(0,b.createElement)(ua.ItemSlot,{scope:n,id:a,focusable:r,active:i},(0,b.createElement)(M.WV.span,(0,E.Z)({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:(0,O.M)(e.onMouseDown,e=>{r?s.onItemFocus(a):e.preventDefault()}),onFocus:(0,O.M)(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:(0,O.M)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){s.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let i=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return uv[i]}(e,s.orientation,s.dir);if(void 0!==t){e.preventDefault();let i=u().filter(e=>e.focusable),o=i.map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){var n,r;"prev"===t&&o.reverse();let i=o.indexOf(e.currentTarget);o=s.loop?(n=o,r=i+1,n.map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>ug(o))}})})))}),uv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ug(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}var uy=n(49732),ux=n(88965);let ub=["Enter"," "],uw=["ArrowUp","PageDown","End"],uE=["ArrowDown","PageUp","Home",...uw],uj={ltr:[...ub,"ArrowRight"],rtl:[...ub,"ArrowLeft"]},uk={ltr:["ArrowLeft"],rtl:["ArrowRight"]},uS="Menu",[u_,uO,uC]=_(uS),[uM,uA]=(0,j.b)(uS,[uC,ti,uc]),uT=ti(),uP=uc(),[uN,uR]=uM(uS),[uD,uL]=uM(uS),uF=(0,b.forwardRef)((e,t)=>{let{__scopeMenu:n,...r}=e,i=uT(n);return(0,b.createElement)(ts,(0,E.Z)({},i,r,{ref:t}))}),uV="MenuPortal",[uz,uI]=uM(uV,{forceMount:void 0}),uZ="MenuContent",[uB,uH]=uM(uZ),uU=(0,b.forwardRef)((e,t)=>{let n=uI(uZ,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=uR(uZ,e.__scopeMenu),a=uL(uZ,e.__scopeMenu);return(0,b.createElement)(u_.Provider,{scope:e.__scopeMenu},(0,b.createElement)(T.z,{present:r||o.open},(0,b.createElement)(u_.Slot,{scope:e.__scopeMenu},a.modal?(0,b.createElement)(uW,(0,E.Z)({},i,{ref:t})):(0,b.createElement)(uq,(0,E.Z)({},i,{ref:t})))))}),uW=(0,b.forwardRef)((e,t)=>{let n=uR(uZ,e.__scopeMenu),r=(0,b.useRef)(null),i=(0,k.e)(t,r);return(0,b.useEffect)(()=>{let e=r.current;if(e)return(0,uy.R)(e)},[]),(0,b.createElement)(u$,(0,E.Z)({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:(0,O.M)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),uq=(0,b.forwardRef)((e,t)=>{let n=uR(uZ,e.__scopeMenu);return(0,b.createElement)(u$,(0,E.Z)({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),u$=(0,b.forwardRef)((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:d,onDismiss:f,disableOutsideScroll:h,...p}=e,m=uR(uZ,n),v=uL(uZ,n),g=uT(n),y=uP(n),x=uO(n),[w,j]=(0,b.useState)(null),_=(0,b.useRef)(null),C=(0,k.e)(t,_,m.onContentChange),M=(0,b.useRef)(0),A=(0,b.useRef)(""),T=(0,b.useRef)(0),P=(0,b.useRef)(null),N=(0,b.useRef)("right"),R=(0,b.useRef)(0),D=h?ux.Z:b.Fragment,L=h?{as:S.g7,allowPinchZoom:!0}:void 0,F=e=>{var t,n;let r=A.current+e,i=x().filter(e=>!e.disabled),o=document.activeElement,a=null===(t=i.find(e=>e.ref.current===o))||void 0===t?void 0:t.textValue,s=i.map(e=>e.textValue),l=function(e,t,n){var r;let i=t.length>1&&Array.from(t).every(e=>e===t[0]),o=i?t[0]:t,a=n?e.indexOf(n):-1,s=(r=Math.max(a,0),e.map((t,n)=>e[(r+n)%e.length])),l=1===o.length;l&&(s=s.filter(e=>e!==n));let u=s.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}(s,r,a),u=null===(n=i.find(e=>e.textValue===l))||void 0===n?void 0:n.ref.current;!function e(t){A.current=t,window.clearTimeout(M.current),""!==t&&(M.current=window.setTimeout(()=>e(""),1e3))}(r),u&&setTimeout(()=>u.focus())};(0,b.useEffect)(()=>()=>window.clearTimeout(M.current),[]),(0,ut.EW)();let V=(0,b.useCallback)(e=>{var t,n;let r=N.current===(null===(t=P.current)||void 0===t?void 0:t.side);return r&&function(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;er!=u>r&&n<(l-a)*(r-s)/(u-s)+a;c&&(i=!i)}return i}(n,t)}(e,null===(n=P.current)||void 0===n?void 0:n.area)},[]);return(0,b.createElement)(uB,{scope:n,searchRef:A,onItemEnter:(0,b.useCallback)(e=>{V(e)&&e.preventDefault()},[V]),onItemLeave:(0,b.useCallback)(e=>{var t;V(e)||(null===(t=_.current)||void 0===t||t.focus(),j(null))},[V]),onTriggerLeave:(0,b.useCallback)(e=>{V(e)&&e.preventDefault()},[V]),pointerGraceTimerRef:T,onPointerGraceIntentChange:(0,b.useCallback)(e=>{P.current=e},[])},(0,b.createElement)(D,L,(0,b.createElement)(un.M,{asChild:!0,trapped:i,onMountAutoFocus:(0,O.M)(o,e=>{var t;e.preventDefault(),null===(t=_.current)||void 0===t||t.focus()}),onUnmountAutoFocus:a},(0,b.createElement)(es.XB,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:d,onDismiss:f},(0,b.createElement)(uh,(0,E.Z)({asChild:!0},y,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:j,onEntryFocus:e=>{v.isUsingKeyboardRef.current||e.preventDefault()}}),(0,b.createElement)(th,(0,E.Z)({role:"menu","aria-orientation":"vertical","data-state":u7(m.open),dir:v.dir},g,p,{ref:C,style:{outline:"none",...p.style},onKeyDown:(0,O.M)(p.onKeyDown,e=>{let t=e.target,n=t.closest('[role="menu"]')===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,i=1===e.key.length;n&&("Tab"===e.key&&e.preventDefault(),!r&&i&&F(e.key));let o=_.current;if(e.target!==o||!uE.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled),s=a.map(e=>e.ref.current);uw.includes(e.key)&&s.reverse(),function(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}(s)}),onBlur:(0,O.M)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),A.current="")}),onPointerMove:(0,O.M)(e.onPointerMove,ce(e=>{let t=e.target,n=R.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>R.current?"right":"left";N.current=t,R.current=e.clientX}}))})))))))}),uY=(0,b.forwardRef)((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,b.createElement)(M.WV.div,(0,E.Z)({role:"group"},r,{ref:t}))}),uG=(0,b.forwardRef)((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,b.createElement)(M.WV.div,(0,E.Z)({},r,{ref:t}))}),uX="MenuItem",uK="menu.itemSelect",uQ=(0,b.forwardRef)((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,o=(0,b.useRef)(null),a=uL(uX,e.__scopeMenu),s=uH(uX,e.__scopeMenu),l=(0,k.e)(t,o),u=(0,b.useRef)(!1);return(0,b.createElement)(uJ,(0,E.Z)({},i,{ref:l,disabled:n,onClick:(0,O.M)(e.onClick,()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(uK,{bubbles:!0,cancelable:!0});e.addEventListener(uK,e=>null==r?void 0:r(e),{once:!0}),(0,M.jH)(e,t),t.defaultPrevented?u.current=!1:a.onClose()}}),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),u.current=!0},onPointerUp:(0,O.M)(e.onPointerUp,e=>{var t;u.current||null===(t=e.currentTarget)||void 0===t||t.click()}),onKeyDown:(0,O.M)(e.onKeyDown,e=>{let t=""!==s.searchRef.current;!n&&(!t||" "!==e.key)&&ub.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})}))}),uJ=(0,b.forwardRef)((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=uH(uX,n),s=uP(n),l=(0,b.useRef)(null),u=(0,k.e)(t,l),[c,d]=(0,b.useState)(!1),[f,h]=(0,b.useState)("");return(0,b.useEffect)(()=>{let e=l.current;if(e){var t;h((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}},[o.children]),(0,b.createElement)(u_.ItemSlot,{scope:n,disabled:r,textValue:null!=i?i:f},(0,b.createElement)(um,(0,E.Z)({asChild:!0},s,{focusable:!r}),(0,b.createElement)(M.WV.div,(0,E.Z)({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:(0,O.M)(e.onPointerMove,ce(e=>{if(r)a.onItemLeave(e);else if(a.onItemEnter(e),!e.defaultPrevented){let t=e.currentTarget;t.focus()}})),onPointerLeave:(0,O.M)(e.onPointerLeave,ce(e=>a.onItemLeave(e))),onFocus:(0,O.M)(e.onFocus,()=>d(!0)),onBlur:(0,O.M)(e.onBlur,()=>d(!1))}))))}),[u0,u1]=((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,b.createElement)(u4,{scope:e.__scopeMenu,checked:n},(0,b.createElement)(uQ,(0,E.Z)({role:"menuitemcheckbox","aria-checked":n},i,{ref:t,"data-state":u9(n),onSelect:(0,O.M)(i.onSelect,()=>null==r?void 0:r(!n),{checkForDefaultPrevented:!1})})))},uM("MenuRadioGroup",{value:void 0,onValueChange:()=>{}})),u2=((e,t)=>{let{value:n,onValueChange:r,...i}=e,o=(0,s9.W)(r);return(0,b.createElement)(u0,{scope:e.__scopeMenu,value:n,onValueChange:o},(0,b.createElement)(uY,(0,E.Z)({},i,{ref:t})))},"MenuItemIndicator"),[u4,u3]=uM(u2,{checked:!1}),[u5,u6]=((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,o=u3(u2,n);return(0,b.createElement)(T.z,{present:r||o.checked},(0,b.createElement)(M.WV.span,(0,E.Z)({},i,{ref:t,"data-state":u9(o.checked)})))},uM("MenuSub")),u8="MenuSubTrigger";function u7(e){return e?"open":"closed"}function u9(e){return e?"checked":"unchecked"}function ce(e){return t=>"mouse"===t.pointerType?e(t):void 0}(e,t)=>{let n=uR(u8,e.__scopeMenu),r=uL(u8,e.__scopeMenu),i=u6(u8,e.__scopeMenu),o=uH(u8,e.__scopeMenu),a=(0,b.useRef)(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},c=(0,b.useCallback)(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return(0,b.useEffect)(()=>c,[c]),(0,b.useEffect)(()=>{let e=s.current;return()=>{window.clearTimeout(e),l(null)}},[s,l]),(0,b.createElement)(uF,(0,E.Z)({asChild:!0},u),(0,b.createElement)(uJ,(0,E.Z)({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":u7(n.open)},e,{ref:(0,k.F)(t,i.onTriggerChange),onClick:t=>{var r;null===(r=e.onClick)||void 0===r||r.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:(0,O.M)(e.onPointerMove,ce(t=>{o.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||a.current||(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:(0,O.M)(e.onPointerLeave,ce(e=>{var t,r;c();let i=null===(t=n.content)||void 0===t?void 0:t.getBoundingClientRect();if(i){let t=null===(r=n.content)||void 0===r?void 0:r.dataset.side,a="right"===t,l=i[a?"left":"right"],u=i[a?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:l,y:i.top},{x:u,y:i.top},{x:u,y:i.bottom},{x:l,y:i.bottom}],side:t}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:(0,O.M)(e.onKeyDown,t=>{let i=""!==o.searchRef.current;if(!e.disabled&&(!i||" "!==t.key)&&uj[r.dir].includes(t.key)){var a;n.onOpenChange(!0),null===(a=n.content)||void 0===a||a.focus(),t.preventDefault()}})})))},(e,t)=>{let n=uI(uZ,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=uR(uZ,e.__scopeMenu),a=uL(uZ,e.__scopeMenu),s=u6("MenuSubContent",e.__scopeMenu),l=(0,b.useRef)(null),u=(0,k.e)(t,l);return(0,b.createElement)(u_.Provider,{scope:e.__scopeMenu},(0,b.createElement)(T.z,{present:r||o.open},(0,b.createElement)(u_.Slot,{scope:e.__scopeMenu},(0,b.createElement)(u$,(0,E.Z)({id:s.contentId,"aria-labelledby":s.triggerId},i,{ref:u,align:"start",side:"rtl"===a.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;a.isUsingKeyboardRef.current&&(null===(t=l.current)||void 0===t||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,O.M)(e.onFocusOutside,e=>{e.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:(0,O.M)(e.onEscapeKeyDown,a.onClose),onKeyDown:(0,O.M)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=uk[a.dir].includes(e.key);if(t&&n){var r;o.onOpenChange(!1),null===(r=s.trigger)||void 0===r||r.focus(),e.preventDefault()}})})))))};let ct=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=uT(t),[l,u]=(0,b.useState)(null),c=(0,b.useRef)(!1),d=(0,s9.W)(o),f=lE(i);return(0,b.useEffect)(()=>{let e=()=>{c.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>c.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,b.createElement)(tb,s,(0,b.createElement)(uN,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u},(0,b.createElement)(uD,{scope:t,onClose:(0,b.useCallback)(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:a},r)))},cn=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=uR(uV,t);return(0,b.createElement)(uz,{scope:t,forceMount:n},(0,b.createElement)(T.z,{present:n||o.open},(0,b.createElement)(tw.h,{asChild:!0,container:i},r)))},cr="DropdownMenu",[ci,co]=(0,j.b)(cr,[uA]),ca=uA(),[cs,cl]=ci(cr),cu=(0,b.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=cl("DropdownMenuTrigger",n),a=ca(n);return(0,b.createElement)(uF,(0,E.Z)({asChild:!0},a),(0,b.createElement)(M.WV.button,(0,E.Z)({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":!!o.open||void 0,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:(0,k.F)(t,o.triggerRef),onPointerDown:(0,O.M)(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:(0,O.M)(e.onKeyDown,e=>{!r&&(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),[" ","ArrowDown"].includes(e.key)&&e.preventDefault())})})))}),cc=(0,b.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=cl("DropdownMenuContent",n),o=ca(n),a=(0,b.useRef)(!1);return(0,b.createElement)(uU,(0,E.Z)({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:(0,O.M)(e.onCloseAutoFocus,e=>{var t;a.current||null===(t=i.triggerRef.current)||void 0===t||t.focus(),a.current=!1,e.preventDefault()}),onInteractOutside:(0,O.M)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!i.modal||r)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}}))}),cd=(0,b.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ca(n);return(0,b.createElement)(uG,(0,E.Z)({},i,r,{ref:t}))}),cf=(0,b.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ca(n);return(0,b.createElement)(uQ,(0,E.Z)({},i,r,{ref:t}))}),ch=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=ca(t),u=(0,b.useRef)(null),[c=!1,d]=(0,C.T)({prop:i,defaultProp:o,onChange:a});return(0,b.createElement)(cs,{scope:t,triggerId:(0,P.M)(),triggerRef:u,contentId:(0,P.M)(),open:c,onOpenChange:d,onOpenToggle:(0,b.useCallback)(()=>d(e=>!e),[d]),modal:s},(0,b.createElement)(ct,(0,E.Z)({},l,{open:c,onOpenChange:d,dir:r,modal:s}),n))},cp=e=>{let{__scopeDropdownMenu:t,...n}=e,r=ca(t);return(0,b.createElement)(cn,(0,E.Z)({},r,n))},cm="horizontal",cv=["horizontal","vertical"],cg=(0,b.forwardRef)((e,t)=>{let{decorative:n,orientation:r=cm,...i}=e,o=cy(r)?r:cm;return(0,b.createElement)(M.WV.div,(0,E.Z)({"data-orientation":o},n?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"},i,{ref:t}))});function cy(e){return cv.includes(e)}cg.propTypes={orientation(e,t,n){let r=e[t],i=String(r);return r&&!cy(r)?Error(`Invalid prop \`orientation\` of value \`${i}\` supplied to \`${n}\`, expected one of:
- - horizontal
- - vertical
-
-Defaulting to \`${cm}\`.`):null}};let cx=(0,ea.j)(["m-0 flex-shrink-0 cursor-default"],{variants:{variant:{vertical:"border-r",horizontal:"border-b"},color:{subtle:"border-gray-300 dark:border-graydark-300",verySubtle:"border-gray-100 dark:border-graydark-100",panel:"border-gray-100 dark:border-graydark-400/50"}},defaultVariants:{variant:"horizontal",color:"subtle"}}),cb=b.forwardRef((e,t)=>{let{variant:n,color:r,className:i,...o}=e;return(0,x.jsx)(cg,{ref:t,className:cx({variant:n,color:r,className:i}),...o})}),cw=function(){let{className:e,font:t,color:n="subtle",weight:r="medium",size:i="14",scaleSize:o,noWrap:a,ellipsis:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ea.cx)(tW({font:t,color:n,weight:r,size:i,scaleSize:o,noWrap:a,ellipsis:s,className:e}),["relative","flex","items-center","tabular-nums","select-none","whitespace-nowrap","px-1.5","py-1.5"])},cE=function(){let{className:e,font:t,color:n="contrast",weight:r="medium",size:i="14",scaleSize:o,noWrap:a,ellipsis:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ea.cx)(cw({font:t,color:n,weight:r,size:i,scaleSize:o,noWrap:a,ellipsis:s,className:e}),["group","cursor-pointer","rounded-sm","focus:outline-none","focus:text-gray-900","dark:focus:text-white","focus:bg-gray-300","dark:focus:bg-graydark-300","aria-selected:bg-gray-400","aria-selected:dark:bg-graydark-500","data-[disabled]:pointer-events-none","data-[disabled]:text-gray-700","dark:data-[disabled]:text-graydark-700"])},cj=e=>{let{className:t,font:n,color:r="verySubtle",weight:i="medium",size:o="14",scaleSize:a,noWrap:s,ellipsis:l}=e;return tW({font:n,color:r,weight:i,size:o,scaleSize:a,noWrap:s,ellipsis:l,className:t})},ck=e=>(0,ea.cx)(["h-px","my-2","mx-1.5",e]),cS=b.forwardRef((e,t)=>{let{className:n,color:r,...i}=e;return(0,x.jsx)(cb,{ref:t,className:ck(n),...i})}),c_=b.forwardRef((e,t)=>{let{className:n,font:r,color:i,weight:o,size:a="14",scaleSize:s,noWrap:l,ellipsis:u,...c}=e;return(0,x.jsx)("div",{ref:t,className:(0,ea.cx)(cw({className:n,font:r,color:i,weight:o,size:a,scaleSize:s,noWrap:l,ellipsis:u})),...c})}),cO=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)("div",{ref:t,className:(0,ea.cx)(["ml-auto","pl-5",n]),...r})}),cC=(0,ea.j)(["relative","max-w-sm","z-30","py-1","data-[side=top]:bottom-1","data-[side=top]:origin-bottom","data-[side=bottom]:top-1","data-[side=bottom]:origin-tip","data-[side=left]:right-1","data-[side=left]:origin-right","data-[side=right]:left-1","data-[side=right]:origin-left"]),cM=e=>(0,ea.cx)(tY(),(0,ea.j)(["max-w-xs","shadow-sm","py-1","px-1"])({className:e})),cA={show:{opacity:[0,1],scale:[.95,1],transition:{duration:.1,ease:"easeOut"}},exit:{opacity:[1,0],scale:[1,.95],transition:{duration:.1,ease:"easeIn"}}},cT=b.forwardRef((e,t)=>{let{trigger:n,children:r,rootProps:i,contentProps:o,className:a,open:s,onOpenChange:l}=e,{open:u,onOpenChange:c}=s1({open:s,onOpenChange:l});return(0,x.jsxs)(ch,{open:u,onOpenChange:c,...i,children:[(0,x.jsx)(cu,{asChild:!0,children:n}),(0,x.jsx)(ny,{children:u?(0,x.jsx)(cp,{forceMount:!0,children:(0,x.jsx)(cc,{asChild:!0,forceMount:!0,ref:t,...o,children:(0,x.jsx)(s0.div,{variants:cA,initial:"init",animate:"show",exit:"exit",className:cC(),children:(0,x.jsx)("div",{className:cM(a),children:r})})})}):null})]})}),cP=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)(cf,{ref:t,className:cE({className:n}),...r})}),cN=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)(cd,{ref:t,className:(0,ea.cx)("px-1.5",cj({className:n})),...r})}),cR=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)("div",{ref:t,className:(0,ea.cx)(["pr-2","opacity-70 group-hover:opacity-100",n]),...r})});var cD=n(39097),cL=n.n(cD);let cF={20:"h3",24:"h3",32:"h2",40:"h2",64:"h1"},cV={20:"font-semibold text-base md:text-xl",24:"font-bold text-xl md:text-2xl",32:"font-semibold text-2xl md:text-3xl",40:"font-semibold text-3xl md:text-4xl",64:"font-semibold text-4xl md:text-6xl"},cz=b.forwardRef((e,t)=>{let{size:n="24",className:r,id:i,children:o,anchorLink:a,showAnchor:s,...l}=e,u=cF[n];if(a){let e=i||("string"==typeof o?encodeURI(o.toLowerCase().replace(/ /g,"-")):"");return(0,x.jsxs)("div",{className:(0,ea.cx)("relative flex flex-col gap-6 items-start",r),children:[(0,x.jsx)("div",{id:e,className:"absolute -top-[100px]"}),(0,x.jsxs)(cL(),{href:"#".concat(e),className:"relative group",children:[(0,x.jsx)(tq,{className:"hidden group-hover:block",children:(0,x.jsx)(s6.POp,{className:"absolute top-1 -left-7 hidden md:block"})}),(0,x.jsx)(tq,{as:u,...l,ref:t,weight:"none",className:(0,ea.cx)("proportional-nums inline-block",cV[n]),children:o})]})]})}return(0,x.jsx)("div",{className:(0,ea.cx)("flex flex-col gap-6 items-start",r),children:(0,x.jsx)(tq,{as:u,...l,ref:t,weight:"none",className:(0,ea.cx)("proportional-nums inline-block",cV[n],r),children:o})})});var cI=n(96577),cZ=n.n(cI);let cB=(0,ea.j)(["rounded"]);function cH(e){let{className:t,...n}=e;return(0,x.jsx)(cZ(),{className:cB({className:t}),...n})}let[cU,cW]=(0,j.k)("Label",{id:void 0,controlRef:{current:null}}),cq=(0,b.forwardRef)((e,t)=>{let{htmlFor:n,id:r,...i}=e,o=(0,b.useRef)(null),a=(0,b.useRef)(null),s=(0,k.e)(t,a),l=(0,P.M)(r);return(0,b.useEffect)(()=>{if(n){let e=document.getElementById(n),t=a.current;if(t&&e){let t=()=>e.getAttribute("aria-labelledby"),n=[l,t()].filter(Boolean).join(" ");return e.setAttribute("aria-labelledby",n),o.current=e,()=>{var n;let r=null===(n=t())||void 0===n?void 0:n.replace(l,"");""===r?e.removeAttribute("aria-labelledby"):r&&e.setAttribute("aria-labelledby",r)}}}},[l,n]),(0,b.createElement)(cU,{id:l,controlRef:o},(0,b.createElement)(M.WV.span,(0,E.Z)({role:"label",id:l},i,{ref:s,onMouseDown:t=>{var n;null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()},onClick:t=>{var n;if(null===(n=e.onClick)||void 0===n||n.call(e,t),!o.current||t.defaultPrevented)return;let r=o.current.contains(t.target),i=!0===t.isTrusted;!r&&i&&(o.current.click(),o.current.focus())}})))}),c$=e=>{let t=cW("LabelConsumer"),{controlRef:n}=t;return(0,b.useEffect)(()=>{e&&(n.current=e)},[e,n]),t.id},cY=b.forwardRef((e,t)=>{let{font:n,size:r="14",scaleSize:i,weight:o,color:a="verySubtle",noWrap:s,ellipsis:l,className:u,...c}=e;return(0,x.jsx)(cq,{ref:t,...c,className:cj({font:n,size:r,scaleSize:i,color:a,weight:o,noWrap:s,ellipsis:l,className:u})})}),cG=(0,ea.j)(["cursor-pointer"],{variants:{disabled:{true:"opacity-50 pointer-events-none"},underline:{accent:"underline underline-offset-4 decoration-2 decoration-accentdark-900 dark:decoration-accentdark-900",default:"underline underline-offset-4",hover:"hover:underline underline-offset-4",none:""}},defaultVariants:{disabled:!1,underline:"default"}}),cX=e=>{let{font:t,size:n,scaleSize:r,color:i,weight:o,noWrap:a,ellipsis:s,underline:l,disabled:u,className:c}=e;return(0,ea.cx)(tW({scaleSize:r,size:n,font:t,color:i,weight:o,noWrap:a,ellipsis:s,underline:l}),cG({disabled:u,underline:l}),c)},cK=b.forwardRef((e,t)=>{let{href:n,font:r,size:i,scaleSize:o,color:a,weight:s,noWrap:l,ellipsis:u,underline:c,disabled:d,className:f,rel:h,target:p,onClick:m,...v}=e,g=(0,b.useCallback)(e=>{m&&(n||e.preventDefault(),m(e))},[m,n]);return(0,x.jsx)(cL(),{href:n||"#",ref:t,className:cX({font:r,scaleSize:o,size:i,color:a,weight:s,noWrap:l,ellipsis:u,underline:c,disabled:d,className:f}),...v,onClick:g,rel:h||("_blank"===p?"noopener":void 0),target:p})}),cQ={src:"/_next/static/media/logo.0e2362ab.png"};function cJ(e){let{size:t=30,className:n}=e;return(0,x.jsx)(cH,{priority:!0,src:"/_next/static/media/logo.0e2362ab.png",alt:"Logo",width:t,height:t,className:n})}let c0="Popover",[c1,c2]=(0,j.b)(c0,[ti]),c4=ti(),[c3,c5]=c1(c0),c6=(0,b.forwardRef)((e,t)=>{let{__scopePopover:n,...r}=e,i=c5("PopoverTrigger",n),o=c4(n),a=(0,k.e)(t,i.triggerRef),s=(0,b.createElement)(M.WV.button,(0,E.Z)({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":da(i.open)},r,{ref:a,onClick:(0,O.M)(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?s:(0,b.createElement)(ts,(0,E.Z)({asChild:!0},o),s)}),c8="PopoverPortal",[c7,c9]=c1(c8,{forceMount:void 0}),de="PopoverContent",dt=(0,b.forwardRef)((e,t)=>{let n=c9(de,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=c5(de,e.__scopePopover);return(0,b.createElement)(T.z,{present:r||o.open},o.modal?(0,b.createElement)(dn,(0,E.Z)({},i,{ref:t})):(0,b.createElement)(dr,(0,E.Z)({},i,{ref:t})))}),dn=(0,b.forwardRef)((e,t)=>{let n=c5(de,e.__scopePopover),r=(0,b.useRef)(null),i=(0,k.e)(t,r),o=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let e=r.current;if(e)return(0,uy.R)(e)},[]),(0,b.createElement)(ux.Z,{as:S.g7,allowPinchZoom:!0},(0,b.createElement)(di,(0,E.Z)({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,O.M)(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),o.current||null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:(0,O.M)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,O.M)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})))}),dr=(0,b.forwardRef)((e,t)=>{let n=c5(de,e.__scopePopover),r=(0,b.useRef)(!1);return(0,b.createElement)(di,(0,E.Z)({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var i,o;null===(i=e.onCloseAutoFocus)||void 0===i||i.call(e,t),t.defaultPrevented||(r.current||null===(o=n.triggerRef.current)||void 0===o||o.focus(),t.preventDefault()),r.current=!1},onInteractOutside:t=>{var i,o;null===(i=e.onInteractOutside)||void 0===i||i.call(e,t),t.defaultPrevented||(r.current=!0);let a=t.target,s=null===(o=n.triggerRef.current)||void 0===o?void 0:o.contains(a);s&&t.preventDefault()}}))}),di=(0,b.forwardRef)((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...d}=e,f=c5(de,n),h=c4(n);return(0,ut.EW)(),(0,b.createElement)(un.M,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},(0,b.createElement)(es.XB,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1)},(0,b.createElement)(th,(0,E.Z)({"data-state":da(f.open),role:"dialog",id:f.contentId},h,d,{ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)"}}))))});function da(e){return e?"open":"closed"}let ds=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,s=c4(t),l=(0,b.useRef)(null),[u,c]=(0,b.useState)(!1),[d=!1,f]=(0,C.T)({prop:r,defaultProp:i,onChange:o});return(0,b.createElement)(tb,s,(0,b.createElement)(c3,{scope:t,contentId:(0,P.M)(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:(0,b.useCallback)(()=>f(e=>!e),[f]),hasCustomAnchor:u,onCustomAnchorAdd:(0,b.useCallback)(()=>c(!0),[]),onCustomAnchorRemove:(0,b.useCallback)(()=>c(!1),[]),modal:a},n))},dl=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=c5(c8,t);return(0,b.createElement)(c7,{scope:t,forceMount:n},(0,b.createElement)(T.z,{present:n||o.open},(0,b.createElement)(tw.h,{asChild:!0,container:i},r)))},du=(0,ea.j)(["relative","z-10","outline-none","max-w-sm","data-[side=top]:bottom-1","data-[side=top]:origin-bottom","data-[side=bottom]:top-1","data-[side=bottom]:origin-top","data-[side=left]:right-1","data-[side=left]:origin-right","data-[side=right]:left-1","data-[side=right]:origin-left"]),dc=(0,ea.cx)(tY(),(0,ea.j)(["py-1","px-1"])()),dd={show:{opacity:[0,1],scale:[.95,1],transition:{duration:.1,ease:"easeOut"}},exit:{opacity:[1,0],scale:[1,.95],transition:{duration:.1,ease:"easeIn"}}},df=b.forwardRef((e,t)=>{let{trigger:n,children:r,rootProps:i,contentProps:o}=e,{open:a,onOpenChange:s}=s1({open:null==i?void 0:i.open,onOpenChange:null==i?void 0:i.onOpenChange});return(0,x.jsxs)(ds,{open:a,onOpenChange:s,...i,children:[(0,x.jsx)(c6,{asChild:!0,children:n}),(0,x.jsx)(ny,{children:a?(0,x.jsx)(dl,{forceMount:!0,children:(0,x.jsx)(dt,{asChild:!0,forceMount:!0,ref:t,...o,children:(0,x.jsx)(s0.div,{variants:dd,initial:"init",animate:"show",exit:"exit",className:du(),children:(0,x.jsx)(l1,{className:dc,children:r})})})}):null})]})}),dh="Progress",[dp,dm]=(0,j.b)(dh),[dv,dg]=dp(dh),dy=(0,b.forwardRef)((e,t)=>{let{__scopeProgress:n,value:r,max:i,getValueLabel:o=db,...a}=e,s=dj(i)?i:100,l=dk(r,s)?r:null,u=dE(l)?o(l,s):void 0;return(0,b.createElement)(dv,{scope:n,value:l,max:s},(0,b.createElement)(M.WV.div,(0,E.Z)({"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":dE(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":dw(l,s),"data-value":null!=l?l:void 0,"data-max":s},a,{ref:t})))});dy.propTypes={max(e,t,n){let r=e[t],i=String(r);return r&&!dj(r)?Error(`Invalid prop \`max\` of value \`${i}\` supplied to \`${n}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`):null},value(e,t,n){let r=e[t],i=String(r),o=dj(e.max)?e.max:100;return null==r||dk(r,o)?null:Error(`Invalid prop \`value\` of value \`${i}\` supplied to \`${n}\`. The \`value\` prop must be:
- - a positive number
- - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
- - \`null\` if the progress is indeterminate.
-
-Defaulting to \`null\`.`)}};let dx=(0,b.forwardRef)((e,t)=>{var n;let{__scopeProgress:r,...i}=e,o=dg("ProgressIndicator",r);return(0,b.createElement)(M.WV.div,(0,E.Z)({"data-state":dw(o.value,o.max),"data-value":null!==(n=o.value)&&void 0!==n?n:void 0,"data-max":o.max},i,{ref:t}))});function db(e,t){return`${Math.round(e/t*100)}%`}function dw(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function dE(e){return"number"==typeof e}function dj(e){return dE(e)&&!isNaN(e)&&e>0}function dk(e,t){return dE(e)&&!isNaN(e)&&e<=t&&e>=0}let dS=(0,ea.j)(["relative h-1 w-full overflow-hidden rounded-lg"],{variants:{variant:{gray:"bg-gray-700 dark:bg-graydark-700",accent:"bg-green-600 dark:bg-green-500"}},defaultVariants:{variant:"gray"}}),d_=b.forwardRef((e,t)=>{let{label:n,variant:r,className:i,value:o,max:a=100,...s}=e,l=null!=o?Math.round(o/a*100):null;return(0,x.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,x.jsx)(dy,{...s,ref:t,value:o,max:a,className:dS({variant:r,className:i}),children:(0,x.jsx)(dx,{className:"absolute top-0 right-0 left-0 bottom-0 w-full bg-gray-300 dark:bg-graydark-300 transition-transform",style:{transform:"translateX(".concat(l,"%)")}})}),n&&(0,x.jsx)(tq,{color:"subtle",size:"12",ellipsis:!0,children:n})]})});function dO(e){let t=(0,b.useRef)({value:e,previous:e});return(0,b.useMemo)(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}let dC="Radio",[dM,dA]=(0,j.b)(dC),[dT,dP]=dM(dC),dN=(0,b.forwardRef)((e,t)=>{let{__scopeRadio:n,"aria-labelledby":r,name:i,checked:o=!1,required:a,disabled:s,value:l="on",onCheck:u,...c}=e,[d,f]=(0,b.useState)(null),h=(0,k.e)(t,e=>f(e)),p=c$(d),m=(0,b.useRef)(!1),v=!d||!!d.closest("form");return(0,b.createElement)(dT,{scope:n,checked:o,disabled:s},(0,b.createElement)(M.WV.button,(0,E.Z)({type:"button",role:"radio","aria-checked":o,"aria-labelledby":r||p,"data-state":dL(o),"data-disabled":s?"":void 0,disabled:s,value:l},c,{ref:h,onClick:(0,O.M)(e.onClick,e=>{o||null==u||u(),v&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})),v&&(0,b.createElement)(dD,{control:d,bubbles:!m.current,name:i,value:l,checked:o,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))}),dR=(0,b.forwardRef)((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,o=dP("RadioIndicator",n);return(0,b.createElement)(T.z,{present:r||o.checked},(0,b.createElement)(M.WV.span,(0,E.Z)({"data-state":dL(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),dD=e=>{let{control:t,checked:n,bubbles:r=!0,...i}=e,o=(0,b.useRef)(null),a=dO(n),s=tt(t);return(0,b.useEffect)(()=>{let e=o.current,t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,"checked"),s=i.set;if(a!==n&&s){let t=new Event("click",{bubbles:r});s.call(e,n),e.dispatchEvent(t)}},[a,n,r]),(0,b.createElement)("input",(0,E.Z)({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dL(e){return e?"checked":"unchecked"}let dF=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dV="RadioGroup",[dz,dI]=(0,j.b)(dV,[uc,dA]),dZ=uc(),dB=dA(),[dH,dU]=dz(dV),dW=(0,b.forwardRef)((e,t)=>{let{__scopeRadioGroup:n,name:r,"aria-labelledby":i,defaultValue:o,value:a,required:s=!1,orientation:l,dir:u,loop:c=!0,onValueChange:d,...f}=e,h=c$(),p=dZ(n),m=lE(u),[v,g]=(0,C.T)({prop:a,defaultProp:o,onChange:d});return(0,b.createElement)(dH,{scope:n,name:r,required:s,value:v,onValueChange:g},(0,b.createElement)(uh,(0,E.Z)({asChild:!0},p,{orientation:l,dir:m,loop:c}),(0,b.createElement)(M.WV.div,(0,E.Z)({role:"radiogroup","aria-required":s,"aria-orientation":l,"aria-labelledby":i||h,dir:m},f,{ref:t}))))}),dq=(0,b.forwardRef)((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,o=dU("RadioGroupItem",n),a=dZ(n),s=dB(n),l=(0,b.useRef)(null),u=(0,k.e)(t,l),c=o.value===i.value,d=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let e=e=>{dF.includes(e.key)&&(d.current=!0)},t=()=>d.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,b.createElement)(um,(0,E.Z)({asChild:!0},a,{focusable:!r,active:c}),(0,b.createElement)(dN,(0,E.Z)({disabled:r,required:o.required,checked:c},s,i,{name:o.name,ref:u,onCheck:()=>o.onValueChange(i.value),onKeyDown:(0,O.M)(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:(0,O.M)(i.onFocus,()=>{var e;d.current&&(null===(e=l.current)||void 0===e||e.click())})})))}),d$=(0,b.forwardRef)((e,t)=>{let{__scopeRadioGroup:n,...r}=e,i=dB(n);return(0,b.createElement)(dR,(0,E.Z)({},i,r,{ref:t}))}),dY=(0,ea.j)(["relative flex items-center h-full justify-center w-full",'after:content-[""] after:block after:rounded-full after:bg-green-600 after:dark:bg-green-500'],{variants:{size:{small:"after:w-2 after:h-2 ",medium:"after:w-4 after:h-4"}},defaultVariants:{size:"small"}}),dG=(0,ea.j)(["select-none","inline-flex items-center justify-center","m-0 p-0","outline-none","rounded-full","overflow-hidden","focus:ring ring-blue-500 dark:ring-blue-200","bg-white dark:bg-graydark-200","border border-gray-500 dark:border-graydark-400","enabled:hover:border-gray-700 enabled:hover:dark:border-graydark-600","text-gray-1100 dark:text-white","disabled:text-gray-600 disabled:dark:text-graydark-400","disabled:bg-gray-200 disabled:dark:bg-graydark-200"],{variants:{size:{small:"w-4 h-4",medium:"w-6 h-6"}},defaultVariants:{size:"small"}}),dX=b.forwardRef((e,t)=>{let{size:n,className:r,children:i,...o}=e;return(0,x.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,x.jsx)(dq,{...o,className:dG({size:n,className:r}),ref:t,children:(0,x.jsx)(d$,{className:dY({size:n})})}),(0,x.jsx)(tq,{size:"14",className:"relative top-px flex items-center",color:o.disabled?"verySubtle":"subtle",children:i})]})}),dK=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)(dW,{...r,className:(0,ea.cx)("flex gap-2",n),ref:t})});(0,ea.j)(["relative appearance-none outline-none","p-2 m-0 w-full","min-h-[80px]",tW(),"tabular-nums","resize-y","rounded","focus:ring ring-blue-500 dark:ring-blue-200","text-gray-1100 dark:text-white","placeholder:text-gray-600 placeholder:dark:text-graydark-500","disabled:text-gray-400 disabled:dark:text-graydark-400"],{variants:{size:{small:"h-7 text-sm px-2",medium:"h-10 text-base px-3",large:"h-12 text-lg px-3"},variant:{default:["border","bg-white dark:bg-graydark-50","autofill:bg-blue-100 autofill:dark:bg-blue-800"],ghost:"bg-transparent"},state:{default:["border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500"],invalid:["border-red-500 dark:border-red-400"],valid:["border-green-500 dark:border-green-400"]},cursor:{default:"",text:"cursor-text"}},defaultVariants:{size:"small",variant:"default",cursor:"default",state:"default"}});let dQ=(0,ea.j)(["font-sans [type=number]:font-mono","outline-none m-0 p-0 w-full","disabled:pointer-events-none","tabular-nums","rounded","text-gray-1100 dark:text-white","autofill:text-fill-gray-1100 autofill:dark:text-fill-white","autofill:placeholder:text-fill-gray-700 autofill:placeholder:dark:text-fill-graydark-700","placeholder:text-gray-700 placeholder:dark:text-graydark-700","disabled:text-gray-400 disabled:dark:text-graydark-400"],{variants:{size:{small:"h-7 text-sm px-2",medium:"h-10 text-base px-3",large:"h-12 text-lg px-3"},variant:{default:["border","bg-white dark:bg-graydark-50","autofill:bg-white autofill:dark:bg-graydark-50","autofill:shadow-fill-white autofill:dark:shadow-fill-graydark-50"],ghost:"bg-transparent"},state:{default:["border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500"],invalid:["border-red-500 dark:border-red-400"],valid:["border-green-500 dark:border-green-400"]},focus:{default:["focus:ring ring-blue-500 dark:ring-blue-200","focus:z-10"],none:""},cursor:{default:"",text:"cursor-text"},noSpin:{true:"[&::-webkit-outer-spin-button, &::-webkit-inner-spin-button]:appearance-none"}},defaultVariants:{size:"small",focus:"default",variant:"default",cursor:"default",state:"default"}}),dJ=b.forwardRef((e,t)=>{let{variant:n,size:r,state:i,noSpin:o,cursor:a,focus:s,className:l,...u}=e;return(0,x.jsx)("input",{ref:t,className:dQ({variant:n,size:r,state:i,noSpin:o,cursor:a,focus:s,className:l}),...u})});/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */var d0=function(){return(d0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1){if(e.includes(t)){var r=e.split(t),i=r[0],o=r[1];if(o.length>n)return""+i+t+o.slice(0,n)}var a=e.length>n?RegExp("(\\d+)(\\d{"+n+"})"):RegExp("(\\d)(\\d+)"),s=e.match(a);if(s){var i=s[1],o=s[2];return""+i+t+o}}return e},d9=function(e,t){var n=t.groupSeparator,r=t.decimalSeparator,i=RegExp("\\d([^"+d2(void 0===n?",":n)+d2(void 0===r?".":r)+"0-9]+)"),o=e.match(i);return o?o[1]:void 0},fe=function(e){var t=e.value,n=e.decimalSeparator,r=e.intlConfig,i=e.decimalScale,o=e.prefix,a=void 0===o?"":o,s=e.suffix,l=void 0===s?"":s;if(""===t||void 0===t)return"";if("-"===t)return"-";var u=RegExp("^\\d?-"+(a?d2(a)+"?":"")+"\\d").test(t),c="."!==n?ft(t,n,u):t,d=fn((r?new Intl.NumberFormat(r.locale,r.currency?{style:"currency",currency:r.currency,minimumFractionDigits:i||0,maximumFractionDigits:20}:void 0):new Intl.NumberFormat(void 0,{minimumFractionDigits:i||0,maximumFractionDigits:20})).formatToParts(Number(c)),e),f=d9(d,d0({},e)),h=t.slice(-1)===n?n:"",p=(c.match(RegExp("\\d+\\.(\\d+)"))||[])[1];return(void 0===i&&p&&n&&(d=d.includes(n)?d.replace(RegExp("(\\d+)("+d2(n)+")(\\d+)","g"),"$1$2"+p):f&&!l?d.replace(f,""+n+p+f):""+d+n+p),l&&h)?""+d+h+l:f&&h?d.replace(f,""+h+f):f&&l?d.replace(f,""+h+l):[d,h,l].join("")},ft=function(e,t,n){var r=e;return t&&"."!==t&&(r=r.replace(RegExp(d2(t),"g"),"."),n&&"-"===t&&(r="-"+r.slice(1))),r},fn=function(e,t){var n=t.prefix,r=t.groupSeparator,i=t.decimalSeparator,o=t.decimalScale,a=t.disableGroupSeparators,s=void 0!==a&&a;return e.reduce(function(e,t,a){var l=t.type,u=t.value;return 0===a&&n?"minusSign"===l?[u,n]:"currency"===l?d1(d1([],e),[n]):[n,u]:"currency"===l?n?e:d1(d1([],e),[u]):"group"===l?s?e:d1(d1([],e),[void 0!==r?r:u]):"decimal"===l?void 0!==o&&0===o?e:d1(d1([],e),[void 0!==i?i:u]):"fraction"===l?d1(d1([],e),[void 0!==o?u.slice(0,o):u]):d1(d1([],e),[u])},[""]).join("")},fr={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},fi=function(e){var t=e||{},n=t.locale,r=t.currency;return(n?new Intl.NumberFormat(n,r?{currency:r,style:"currency"}:void 0):new Intl.NumberFormat).formatToParts(1000.1).reduce(function(e,t,n){return"currency"===t.type?0===n?d0(d0({},e),{currencySymbol:t.value,prefix:t.value}):d0(d0({},e),{currencySymbol:t.value,suffix:t.value}):"group"===t.type?d0(d0({},e),{groupSeparator:t.value}):"decimal"===t.type?d0(d0({},e),{decimalSeparator:t.value}):e},fr)},fo=function(e){return RegExp(/\d/,"gi").test(e)},fa=function(e,t,n){if(void 0===t&&(t="."),void 0===n||""===e||void 0===e)return e;if(!e.match(/\d/g))return"";var r=e.split(t),i=r[0],o=r[1];if(0===n)return i;var a=o||"";if(a.lengtht.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}(e,["allowDecimals","allowNegativeValue","id","name","className","customInput","decimalsLimit","defaultValue","disabled","maxLength","value","onValueChange","fixedDecimalLength","placeholder","decimalScale","prefix","suffix","intlConfig","step","min","max","disableGroupSeparators","disableAbbreviations","decimalSeparator","groupSeparator","onChange","onFocus","onBlur","onKeyDown","onKeyUp","transformRawValue"]);if(O&&fo(O))throw Error("decimalSeparator cannot be a number");if(C&&fo(C))throw Error("groupSeparator cannot be a number");var L=(0,b.useMemo)(function(){return fi(x)},[x]),F=O||L.decimalSeparator||"",V=C||L.groupSeparator||"";if(F&&V&&F===V&&!1===S)throw Error("decimalSeparator cannot be the same as groupSeparator");var z={decimalSeparator:F,groupSeparator:V,disableGroupSeparators:S,intlConfig:x,prefix:g||L.prefix,suffix:y},I={decimalSeparator:F,groupSeparator:V,allowDecimals:void 0===n||n,decimalsLimit:l||p||2,allowNegativeValue:void 0===r||r,disableAbbreviations:void 0!==_&&_,prefix:g||L.prefix,transformRawValue:R},Z=null!=u?fe(d0(d0({},z),{decimalScale:v,value:String(u)})):null!=f?fe(d0(d0({},z),{decimalScale:v,value:String(f)})):"",B=(0,b.useState)(Z),H=B[0],U=B[1],W=(0,b.useState)(!1),q=W[0],$=W[1],Y=(0,b.useState)(0),G=Y[0],X=Y[1],K=(0,b.useState)(0),Q=K[0],J=K[1],ee=(0,b.useState)(null),et=ee[0],en=ee[1],er=t||(0,b.useRef)(null),ei=function(e,t){$(!0);var n=fs({selectionStart:t,value:e,lastKeyStroke:et,stateValue:H,groupSeparator:V}),r=n.modifiedValue,i=n.cursorPosition,a=d8(d0({value:r},I));if(!d||!(a.replace(/-/g,"").length>d)){if(""===a||"-"===a||a===F){h&&h(void 0,o,{float:null,formatted:"",value:""}),U(a);return}var s=parseFloat(a.replace(F,".")),l=fe(d0({value:a},z));if(null!=i){var u=i+(l.length-e.length);X(u=u<=0?g?g.length:0:u),J(Q+1)}U(l),h&&h(a,o,{float:s,formatted:l,value:a})}};(0,b.useEffect)(function(){q&&"-"!==H&&er&&"object"==typeof er&&er.current&&er.current.setSelectionRange(G,G)},[H,G,er,q,Q]);var eo=d0({type:"text",inputMode:"decimal",id:i,name:o,className:a,onChange:function(e){var t=e.target;ei(t.value,t.selectionStart),M&&M(e)},onBlur:function(e){var t=e.target.value,n=d8(d0({value:t},I));if("-"===n||!n){U(""),T&&T(e);return}var r=fa(d7(n,F,p),F,void 0!==v?v:p),i=parseFloat(r.replace(F,".")),a=fe(d0(d0({},z),{value:r}));h&&h(r,o,{float:i,formatted:a,value:r}),U(a),T&&T(e)},onFocus:function(e){return A&&A(e),H?H.length:0},onKeyDown:function(e){var t=e.key;if(en(t),w&&("ArrowUp"===t||"ArrowDown"===t)){e.preventDefault(),X(H.length);var n=parseFloat(null!=f?String(f).replace(F,"."):d8(d0({value:H},I)))||0,r="ArrowUp"===t?n+w:n-w;if(void 0!==E&&rj)return;var i=String(w).includes(".")?Number(String(w).split(".")[1].length):void 0;ei(String(i?r.toFixed(i):r).replace(".",F))}P&&P(e)},onKeyUp:function(e){var t=e.key,n=e.currentTarget.selectionStart;if("ArrowUp"!==t&&"ArrowDown"!==t&&"-"!==H){var r=d9(H,{groupSeparator:V,decimalSeparator:F});if(r&&n&&n>H.length-r.length&&er&&"object"==typeof er&&er.current){var i=H.length-r.length;er.current.setSelectionRange(i,i)}}N&&N(e)},placeholder:m,disabled:void 0!==c&&c,value:null==f||"-"===H||F&&H===F?H:fe(d0(d0({},z),{decimalScale:q?void 0:v,value:String(f)})),ref:er},D);return s?b.createElement(s,d0({},eo)):b.createElement("input",d0({},eo))});function fu(e){let{units:t,variant:n,size:r="small",state:i,noSpin:o,focus:a,cursor:s,className:l,decimalsLimit:u,onValueChange:c,...d}=e,[f,h]=(0,b.useState)();return(0,b.useEffect)(()=>{h(navigator.language)},[]),(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)(fl,{...d,decimalsLimit:u,intlConfig:f?{locale:f}:void 0,allowDecimals:!!u,autoComplete:"off",spellCheck:!1,onValueChange:c,transformRawValue:e=>{if(e.length>0){if("."===e[0])return"0."+e.slice(1);if(","===e[0])return"0,"+e.slice(1)}return e},className:(0,ea.cx)(dQ({variant:n,size:r,state:i,focus:a,noSpin:o,cursor:s,className:l}),t?"pr-9":"")}),t&&(0,x.jsx)("div",{className:(0,ea.cx)("flex items-center absolute top-0 h-full","small"===r?"right-2":"","medium"===r?"right-3":"","large"===r?"right-3":""),children:(0,x.jsx)(tq,{size:"12",weight:"medium",color:"subtle",children:t})})]})}fl.displayName="CurrencyInput";var fc=n(6391),fd=n.n(fc);function ff(e,t){return e.decimalPlaces()>t?e.toFixed(t):e.toString()}let fh=(0,b.forwardRef)(function(e,t){let{value:n,placeholder:r=new(fd())(100),decimalsLimit:i=6,onChange:o,size:a="small",units:s,error:l,changed:u,onBlur:c,onFocus:d,...f}=e,h=(0,b.useMemo)(()=>new(fd())(n),[n]),[p,m]=(0,b.useState)(""),v=(0,b.useMemo)(()=>fp(p),[p]),g=(0,b.useCallback)(e=>{o&&o((e=fp(e))&&!isNaN(Number(e))?new(fd())(e):void 0)},[o]),y=(0,b.useCallback)(e=>{m(e),g(e)},[m,g]);return(0,b.useEffect)(()=>{if(!h.isEqualTo(v)){let e=ff(h,i);m(e)}},[h]),(0,x.jsx)(fu,{ref:t,...f,"data-testid":"numberfield",size:a,placeholder:r.isNaN()?"":ff(r,i),units:s,value:"NaN"!==p?p:"",decimalsLimit:i,onBlur:e=>{c&&c(e)},onFocus:e=>{d&&d(e)},onValueChange:e=>y(e||"")})});function fp(e){return(null==e?void 0:e.replace(/,/g,"."))||""}var fm=n(95753),fv=n(47025);let fg=new(fd())(0),fy=(0,b.forwardRef)(function(e,t){let{sc:n,placeholder:r=new(fd())(100),decimalsLimitFiat:i=6,decimalsLimitSc:o=6,onChange:a,size:s="medium",units:l="SC",showFiat:u=!0,error:c,changed:d,prefix:f,onBlur:h,onFocus:p,...m}=e,v=(0,b.useMemo)(()=>new(fd())(void 0===n?NaN:n),[n]),{settings:g}=(0,fm.Hv)(),y=(0,fv.BW)({config:{swr:{revalidateOnFocus:!1}}}),w=(0,b.useMemo)(()=>{var e;return g.siaCentral&&y.data?new(fd())((null===(e=y.data)||void 0===e?void 0:e.rates.sc[g.currency.id])||fg):fg},[y.data,g]),[E,j]=(0,b.useState)(),[k,S]=(0,b.useState)(""),[_,O]=(0,b.useState)(""),C=(0,b.useMemo)(()=>fx(k),[k]),M=(0,b.useMemo)(()=>fx(_),[_]),A=(0,b.useCallback)(e=>{a&&a((e=fx(e))&&!isNaN(Number(e))?new(fd())(e):void 0)},[a]),T=(0,b.useCallback)(e=>{let t=ff(e,i);O(t)},[O,i]),P=(0,b.useCallback)(e=>{let t=ff(e,o);return S(t),A(t),t},[S,o,A]),N=(0,b.useCallback)(e=>{S(e),A(e)},[S,A]),R=(0,b.useCallback)(e=>{let t=new(fd())(e).times(w);T(t)},[T,w]),D=(0,b.useCallback)(e=>{let t=new(fd())(e).dividedBy(w);P(t)},[P,w]),[L,F]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!v.isEqualTo(C)){let e=ff(v,o);S(e),"fiat"!==E&&R(e)}L||F(!0)},[v]),(0,b.useEffect)(()=>{L&&R(C)},[w]),(0,b.useEffect)(()=>{"sc"===E&&R(C)},[C]),(0,b.useEffect)(()=>{"fiat"===E&&D(M)},[M]),(0,x.jsxs)("div",{ref:t,className:(0,ea.cx)("flex flex-col bg-white dark:bg-graydark-50","focus-within:ring ring-blue-500 dark:ring-blue-200","border",c?"border-red-500 dark:border-red-400":d?"border-green-500 dark:border-green-400":"border-gray-200 dark:border-graydark-200","rounded"),children:[(0,x.jsx)(fu,{...m,"data-testid":"scInput",size:s,variant:"ghost",focus:"none",placeholder:ff(r,o),units:l,value:"NaN"!==k?k:"",decimalsLimit:o,allowNegativeValue:!1,onBlur:e=>{j(void 0),h&&h(e)},onFocus:e=>{j("sc"),p&&p(e)},onValueChange:e=>{N(e||"")}}),u&&g.siaCentral&&(0,x.jsx)(fu,{...m,"data-testid":"fiatInput",size:s,variant:"ghost",focus:"none",value:"NaN"!==_?_:"",units:g.currency.label,decimalsLimit:i,allowNegativeValue:!1,placeholder:"".concat(g.currency.prefix).concat(w?w.times(r).toFixed(i):"0.42"),prefix:f||g.currency.prefix,onFocus:e=>{j("fiat"),p&&p(e)},onBlur:e=>{j(void 0),h&&h(e)},onValueChange:e=>{O(e||"")}})]})});function fx(e){return(null==e?void 0:e.replace(/,/g,"."))||""}function fb(e){let{children:t}=e;return(0,x.jsx)(s4,{content:t,children:(0,x.jsx)("div",{className:"relative items-center inline mx-1",children:(0,x.jsx)(tq,{color:"subtle",children:(0,x.jsx)(s6.RdX,{className:"scale-75"})})})})}function fw(e){let{values:t,options:n,onChange:r}=e;return(0,x.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>(0,x.jsx)(s5,{variant:t.includes(e.value)?"active":"inactive",onClick:()=>{r(e.value)},children:e.label},e.value))})}let fE=(0,ea.j)(["font-sans","font-normal","tabular-nums","flex-shrink-0","rounded","flex items-center","bg-white dark:bg-graydark-200","hover:bg-gray-50 dark:hover:bg-graydark-300","disabled:bg-gray-200 disabled:dark:bg-graydark-200","autofill:bg-blue-100 autofill:dark:bg-blue-800","border","focus-within:z-10","focus-within:ring ring-blue-500 dark:ring-blue-200","text-gray-1100 dark:text-white","[&>select:disabled]:text-gray-600 [&>select:disabled]:dark:text-graydark-700"],{variants:{size:{small:"h-7 text-sm px-1",medium:"h-10 text-base px-3",large:"h-12 text-lg px-3"},state:{default:["border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500"],invalid:["border-red-500 dark:border-red-400"],valid:["border-green-500 dark:border-green-400"]}},defaultVariants:{state:"default",size:"small"}}),fj=b.forwardRef((e,t)=>{let{size:n,state:r,icon:i,className:o,...a}=e;return(0,x.jsxs)("div",{className:fE({size:n,state:r,className:o}),children:[i,(0,x.jsx)("select",{ref:t,...a,className:"appearance-none flex-1 bg-transparent outline-none w-full h-full pl-1 pr-1"}),(0,x.jsx)(s6.Cp0,{className:"pointer-events-none scale-75"})]})}),fk=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)("option",{ref:t,...r,className:(0,ea.cx)("bg-white dark:bg-graydark-200","text-gray-1100 dark:text-white",n)})}),fS=(0,ea.j)(["bg-gray-300 dark:bg-graydark-300","relative","overflow-hidden","animate-pulse","rounded"]);function f_(e){let{className:t}=e;return(0,x.jsx)("div",{className:fS({className:t})})}let fO=(0,ea.j)(["rounded-full flex-shrink-0"],{variants:{size:{default:"w-2 h-2"}},defaultVariants:{size:"default"}}),fC=b.forwardRef((e,t)=>{let{size:n,className:r,...i}=e;return(0,x.jsx)("div",{ref:t,className:fO({size:n,className:r}),...i})}),fM="Switch",[fA,fT]=(0,j.b)(fM),[fP,fN]=fA(fM),fR=(0,b.forwardRef)((e,t)=>{let{__scopeSwitch:n,"aria-labelledby":r,name:i,checked:o,defaultChecked:a,required:s,disabled:l,value:u="on",onCheckedChange:c,...d}=e,[f,h]=(0,b.useState)(null),p=(0,k.e)(t,e=>h(e)),m=c$(f),v=(0,b.useRef)(!1),g=!f||!!f.closest("form"),[y=!1,x]=(0,C.T)({prop:o,defaultProp:a,onChange:c});return(0,b.createElement)(fP,{scope:n,checked:y,disabled:l},(0,b.createElement)(M.WV.button,(0,E.Z)({type:"button",role:"switch","aria-checked":y,"aria-labelledby":r||m,"aria-required":s,"data-state":fF(y),"data-disabled":l?"":void 0,disabled:l,value:u},d,{ref:p,onClick:(0,O.M)(e.onClick,e=>{x(e=>!e),g&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})),g&&(0,b.createElement)(fL,{control:f,bubbles:!v.current,name:i,value:u,checked:y,required:s,disabled:l,style:{transform:"translateX(-100%)"}}))}),fD=(0,b.forwardRef)((e,t)=>{let{__scopeSwitch:n,...r}=e,i=fN("SwitchThumb",n);return(0,b.createElement)(M.WV.span,(0,E.Z)({"data-state":fF(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),fL=e=>{let{control:t,checked:n,bubbles:r=!0,...i}=e,o=(0,b.useRef)(null),a=dO(n),s=tt(t);return(0,b.useEffect)(()=>{let e=o.current,t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,"checked"),s=i.set;if(a!==n&&s){let t=new Event("click",{bubbles:r});s.call(e,n),e.dispatchEvent(t)}},[a,n,r]),(0,b.createElement)("input",(0,E.Z)({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function fF(e){return e?"checked":"unchecked"}let fV=(0,ea.j)(["absolute left-0 rounded-full","transition-transform","bg-white dark:bg-graydark-500"],{variants:{size:{small:["w-3 h-3","translate-x-px","data-[state=checked]:translate-x-[9px]"],medium:["w-5 h-5","translate-x-0.5","data-[state=checked]:translate-x-[20px]"]}},defaultVariants:{size:"small"}}),fz=(0,ea.j)(["select-none outline-none","relative inline-flex items-center justify-center","m-0 rounded-full","focus:ring ring-blue-500 dark:ring-blue-200","border","bg-gray-300 dark:bg-graydark-50","autofill:bg-blue-100 autofill:dark:bg-blue-800","border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","disabled:cursor-default","enabled:data-[state=checked]:bg-green-600 dark:enabled:data-[state=checked]:bg-green-500","disabled:data-[state=checked]:bg-green-600/50 dark:disabled:data-[state=checked]:bg-green-500/50"],{variants:{size:{small:"w-6 h-4",medium:"w-11 h-6"},state:{default:["border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500"],invalid:["border-red-500 dark:border-red-400"],valid:["border-green-500 dark:border-green-400"]}},defaultVariants:{size:"small",state:"default"}}),fI=(0,b.forwardRef)((e,t)=>{let{size:n,state:r,className:i,children:o,...a}=e;return(0,x.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,x.jsx)(fR,{className:fz({size:n,state:r,className:i}),...a,ref:t,children:(0,x.jsx)(fD,{className:fV({size:n})})}),o&&(0,x.jsx)(tq,{color:a.disabled?"subtle":"contrast",children:o})]})}),fZ=(0,b.forwardRef)((e,t)=>{let{children:n,...r}=e,i=b.Children.toArray(n),o=i.find(fU);if(o){let e=o.props.children,n=i.map(t=>t!==o?t:b.Children.count(e)>1?b.Children.only(null):(0,b.isValidElement)(e)?e.props.children:null);return(0,b.createElement)(fB,(0,E.Z)({},r,{ref:t}),(0,b.isValidElement)(e)?(0,b.cloneElement)(e,void 0,n):null)}return(0,b.createElement)(fB,(0,E.Z)({},r,{ref:t}),n)});fZ.displayName="Slot";let fB=(0,b.forwardRef)((e,t)=>{let{children:n,...r}=e;return(0,b.isValidElement)(n)?(0,b.cloneElement)(n,{...function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r],a=/^on[A-Z]/.test(r);a?i&&o?n[r]=(...e)=>{o(...e),i(...e)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props),ref:(0,k.F)(t,n.ref)}):b.Children.count(n)>1?b.Children.only(null):null});fB.displayName="SlotClone";let fH=({children:e})=>(0,b.createElement)(b.Fragment,null,e);function fU(e){return(0,b.isValidElement)(e)&&e.type===fH}let fW=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let n=(0,b.forwardRef)((e,n)=>{let{asChild:r,...i}=e,o=r?fZ:t;return(0,b.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,b.createElement)(o,(0,E.Z)({},i,{ref:n}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),fq=(0,b.forwardRef)((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,b.createElement)(fW.svg,(0,E.Z)({},o,{ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,b.createElement)("polygon",{points:"0,0 30,0 15,10"}))}),f$="Popper",[fY,fG]=(0,j.b)(f$),[fX,fK]=fY(f$),fQ=(0,b.forwardRef)((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,o=fK("PopperAnchor",n),a=(0,b.useRef)(null),s=(0,k.e)(t,a);return(0,b.useEffect)(()=>{o.onAnchorChange((null==r?void 0:r.current)||a.current)}),r?null:(0,b.createElement)(fW.div,(0,E.Z)({},i,{ref:s}))}),fJ="PopperContent",[f0,f1]=fY(fJ),[f2,f4]=fY(fJ,{hasParent:!1,positionUpdateFns:new Set}),f3=(0,b.forwardRef)((e,t)=>{var n,r,i,o,a,s,l,u,c;let{__scopePopper:d,side:f="bottom",sideOffset:h=0,align:p="center",alignOffset:m=0,arrowPadding:v=0,collisionBoundary:g=[],collisionPadding:y=0,sticky:x="partial",hideWhenDetached:w=!1,avoidCollisions:E=!0,onPlaced:j,...S}=e,_=fK(fJ,d),[O,C]=(0,b.useState)(null),M=(0,k.e)(t,e=>C(e)),[T,P]=(0,b.useState)(null),N=tt(T),R=null!==(n=null==N?void 0:N.width)&&void 0!==n?n:0,D=null!==(r=null==N?void 0:N.height)&&void 0!==r?r:0,L="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},F=Array.isArray(g)?g:[g],V=F.length>0,z={padding:L,boundary:F.filter(f8),altBoundary:V},{reference:I,floating:Z,strategy:B,x:H,y:U,placement:W,middlewareData:q,update:$}=e7({strategy:"fixed",placement:f+("center"!==p?"-"+p:""),whileElementsMounted:e3,middleware:[f7(),eM({mainAxis:h+D,alignmentAxis:m}),E?eT({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?eP():void 0,...z}):void 0,T?e9({element:T,padding:v}):void 0,E?eS({...z}):void 0,{name:"size",options:c={...z,apply:({elements:e,availableWidth:t,availableHeight:n})=>{e.floating.style.setProperty("--radix-popper-available-width",`${t}px`),e.floating.style.setProperty("--radix-popper-available-height",`${n}px`)}},async fn(e){let t,n;let{placement:r,rects:i,platform:o,elements:a}=e,{apply:s,...l}=c,u=await ev(e,l),d=el(r),f=eu(r);"top"===d||"bottom"===d?(t=d,n=f===(await (null==o.isRTL?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(n=d,t="end"===f?"top":"bottom");let h=ey(u.left,0),p=ey(u.right,0),m=ey(u.top,0),v=ey(u.bottom,0),g={availableHeight:i.floating.height-(["left","right"].includes(r)?2*(0!==m||0!==v?m+v:ey(u.top,u.bottom)):u[t]),availableWidth:i.floating.width-(["top","bottom"].includes(r)?2*(0!==h||0!==p?h+p:ey(u.left,u.right)):u[n])},y=await o.getDimensions(a.floating);null==s||s({...e,...g});let x=await o.getDimensions(a.floating);return y.width!==x.width||y.height!==x.height?{reset:{rects:!0}}:{}}},f9({arrowWidth:R,arrowHeight:D}),w?eC({strategy:"referenceHidden"}):void 0].filter(f6)});(0,A.b)(()=>{I(_.anchor)},[I,_.anchor]);let Y=null!==H&&null!==U,[G,X]=he(W),K=(0,s9.W)(j);(0,A.b)(()=>{Y&&(null==K||K())},[Y,K]);let Q=null===(i=q.arrow)||void 0===i?void 0:i.x,J=null===(o=q.arrow)||void 0===o?void 0:o.y,ee=(null===(a=q.arrow)||void 0===a?void 0:a.centerOffset)!==0,[et,en]=(0,b.useState)();(0,A.b)(()=>{O&&en(window.getComputedStyle(O).zIndex)},[O]);let{hasParent:er,positionUpdateFns:ei}=f4(fJ,d),eo=!er;(0,b.useLayoutEffect)(()=>{if(!eo)return ei.add($),()=>{ei.delete($)}},[eo,ei,$]),(0,A.b)(()=>{eo&&Y&&Array.from(ei).reverse().forEach(e=>requestAnimationFrame(e))},[eo,Y,ei]);let ea={"data-side":G,"data-align":X,...S,ref:M,style:{...S.style,animation:Y?void 0:"none",opacity:null!==(s=q.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return(0,b.createElement)("div",{ref:Z,"data-radix-popper-content-wrapper":"",style:{position:B,left:0,top:0,transform:Y?`translate3d(${Math.round(H)}px, ${Math.round(U)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:et,"--radix-popper-transform-origin":[null===(l=q.transformOrigin)||void 0===l?void 0:l.x,null===(u=q.transformOrigin)||void 0===u?void 0:u.y].join(" ")},dir:e.dir},(0,b.createElement)(f0,{scope:d,placedSide:G,onArrowChange:P,arrowX:Q,arrowY:J,shouldHideArrow:ee},eo?(0,b.createElement)(f2,{scope:d,hasParent:!0,positionUpdateFns:ei},(0,b.createElement)(fW.div,ea)):(0,b.createElement)(fW.div,ea)))}),f5={top:"bottom",right:"left",bottom:"top",left:"right"};function f6(e){return void 0!==e}function f8(e){return null!==e}let f7=()=>({name:"anchorCssProperties",fn(e){let{rects:t,elements:n}=e,{width:r,height:i}=t.reference;return n.floating.style.setProperty("--radix-popper-anchor-width",`${r}px`),n.floating.style.setProperty("--radix-popper-anchor-height",`${i}px`),{}}}),f9=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;let{placement:s,rects:l,middlewareData:u}=t,c=(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,p]=he(s),m={start:"0%",center:"50%",end:"100%"}[p],v=(null!==(r=null===(i=u.arrow)||void 0===i?void 0:i.x)&&void 0!==r?r:0)+d/2,g=(null!==(o=null===(a=u.arrow)||void 0===a?void 0:a.y)&&void 0!==o?o:0)+f/2,y="",x="";return"bottom"===h?(y=c?m:`${v}px`,x=`${-f}px`):"top"===h?(y=c?m:`${v}px`,x=`${l.floating.height+f}px`):"right"===h?(y=`${-f}px`,x=c?m:`${g}px`):"left"===h&&(y=`${l.floating.width+f}px`,x=c?m:`${g}px`),{data:{x:y,y:x}}}});function he(e){let[t,n="center"]=e.split("-");return[t,n]}let ht=e=>{let{__scopePopper:t,children:n}=e,[r,i]=(0,b.useState)(null);return(0,b.createElement)(fX,{scope:t,anchor:r,onAnchorChange:i},n)},hn=(0,b.forwardRef)((e,t)=>{var n;let{container:r=null==globalThis?void 0:null===(n=globalThis.document)||void 0===n?void 0:n.body,...i}=e;return r?e6.createPortal((0,b.createElement)(fW.div,(0,E.Z)({},i,{ref:t})),r):null}),hr="dismissableLayer.update",hi=(0,b.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ho=(0,b.forwardRef)((e,t)=>{var n;let{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...c}=e,d=(0,b.useContext)(hi),[f,h]=(0,b.useState)(null),p=null!==(n=null==f?void 0:f.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=(0,b.useState)({}),v=(0,k.e)(t,e=>h(e)),g=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),w=f?g.indexOf(f):-1,j=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=x,_=function(e,t=null==globalThis?void 0:globalThis.document){let n=(0,s9.W)(e),r=(0,b.useRef)(!1),i=(0,b.useRef)(()=>{});return(0,b.useEffect)(()=>{let e=e=>{if(e.target&&!r.current){let r={originalEvent:e};function o(){hs("dismissableLayer.pointerDownOutside",n,r,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=o,t.addEventListener("click",i.current,{once:!0})):o()}r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{let t=e.target,n=[...d.branches].some(e=>e.contains(t));!S||n||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==u||u())},p),C=function(e,t=null==globalThis?void 0:globalThis.document){let n=(0,s9.W)(e),r=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let e=e=>{e.target&&!r.current&&hs("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{let t=e.target,n=[...d.branches].some(e=>e.contains(t));n||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==u||u())},p);return!function(e,t=null==globalThis?void 0:globalThis.document){let n=(0,s9.W)(e);(0,b.useEffect)(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[n,t])}(e=>{let t=w===d.layers.size-1;t&&(null==o||o(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))},p),(0,b.useEffect)(()=>{if(f)return i&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(r=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ha(),()=>{i&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=r)}},[f,p,i,d]),(0,b.useEffect)(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ha())},[f,d]),(0,b.useEffect)(()=>{let e=()=>m({});return document.addEventListener(hr,e),()=>document.removeEventListener(hr,e)},[]),(0,b.createElement)(fW.div,(0,E.Z)({},c,{ref:v,style:{pointerEvents:j?S?"auto":"none":void 0,...e.style},onFocusCapture:(0,O.M)(e.onFocusCapture,C.onFocusCapture),onBlurCapture:(0,O.M)(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:(0,O.M)(e.onPointerDownCapture,_.onPointerDownCapture)}))});function ha(){let e=new CustomEvent(hr);document.dispatchEvent(e)}function hs(e,t,n,{discrete:r}){let i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});(t&&i.addEventListener(e,t,{once:!0}),r)?i&&(0,e6.flushSync)(()=>i.dispatchEvent(o)):i.dispatchEvent(o)}let hl="HoverCard",[hu,hc]=(0,j.b)(hl,[fG]),hd=fG(),[hf,hh]=hu(hl),hp=(0,b.forwardRef)((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=hh("HoverCardTrigger",n),o=hd(n);return(0,b.createElement)(fQ,(0,E.Z)({asChild:!0},o),(0,b.createElement)(fW.a,(0,E.Z)({"data-state":i.open?"open":"closed"},r,{ref:t,onPointerEnter:(0,O.M)(e.onPointerEnter,hw(i.onOpen)),onPointerLeave:(0,O.M)(e.onPointerLeave,hw(i.onClose)),onFocus:(0,O.M)(e.onFocus,i.onOpen),onBlur:(0,O.M)(e.onBlur,i.onClose),onTouchStart:(0,O.M)(e.onTouchStart,e=>e.preventDefault())})))}),hm="HoverCardPortal",[hv,hg]=hu(hm,{forceMount:void 0}),hy="HoverCardContent",hx=(0,b.forwardRef)((e,t)=>{let n=hg(hy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=hh(hy,e.__scopeHoverCard);return(0,b.createElement)(T.z,{present:r||o.open},(0,b.createElement)(hb,(0,E.Z)({"data-state":o.open?"open":"closed"},i,{onPointerEnter:(0,O.M)(e.onPointerEnter,hw(o.onOpen)),onPointerLeave:(0,O.M)(e.onPointerLeave,hw(o.onClose)),ref:t})))}),hb=(0,b.forwardRef)((e,t)=>{let{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,...l}=e,u=hh(hy,n),c=hd(n),d=(0,b.useRef)(null),f=(0,k.e)(t,d),[h,p]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(h){let e=document.body;return i=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect="none",e.style.webkitUserSelect="none",()=>{e.style.userSelect=i,e.style.webkitUserSelect=i}}},[h]),(0,b.useEffect)(()=>{if(d.current){let e=()=>{p(!1),u.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var e;let t=(null===(e=document.getSelection())||void 0===e?void 0:e.toString())!=="";t&&(u.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!1}}},[u.isPointerDownOnContentRef,u.hasSelectionRef]),(0,b.useEffect)(()=>{if(d.current){let e=function(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}(d.current);e.forEach(e=>e.setAttribute("tabindex","-1"))}}),(0,b.createElement)(ho,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:(0,O.M)(a,e=>{e.preventDefault()}),onDismiss:u.onDismiss},(0,b.createElement)(f3,(0,E.Z)({},c,l,{onPointerDown:(0,O.M)(l.onPointerDown,e=>{e.currentTarget.contains(e.target)&&p(!0),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!0}),ref:f,style:{...l.style,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)",userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0}})))});function hw(e){return t=>"touch"===t.pointerType?void 0:e()}let hE=e=>{let{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:a=700,closeDelay:s=300}=e,l=hd(t),u=(0,b.useRef)(0),c=(0,b.useRef)(0),d=(0,b.useRef)(!1),f=(0,b.useRef)(!1),[h=!1,p]=(0,C.T)({prop:r,defaultProp:i,onChange:o}),m=(0,b.useCallback)(()=>{clearTimeout(c.current),u.current=window.setTimeout(()=>p(!0),a)},[a,p]),v=(0,b.useCallback)(()=>{clearTimeout(u.current),d.current||f.current||(c.current=window.setTimeout(()=>p(!1),s))},[s,p]),g=(0,b.useCallback)(()=>p(!1),[p]);return(0,b.useEffect)(()=>()=>{clearTimeout(u.current),clearTimeout(c.current)},[]),(0,b.createElement)(hf,{scope:t,open:h,onOpenChange:p,onOpen:m,onClose:v,onDismiss:g,hasSelectionRef:d,isPointerDownOnContentRef:f},(0,b.createElement)(ht,l,n))},hj=e=>{let{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,o=hh(hm,t);return(0,b.createElement)(hv,{scope:t,forceMount:n},(0,b.createElement)(T.z,{present:n||o.open},(0,b.createElement)(hn,{asChild:!0,container:i},r)))},hk=(0,ea.j)(["relative","z-10","data-[side=top]:bottom-1","data-[side=top]:origin-bottom","data-[side=bottom]:top-1","data-[side=bottom]:origin-top","data-[side=left]:right-1","data-[side=left]:origin-right","data-[side=right]:left-1","data-[side=right]:origin-left"]),hS=(0,ea.cx)(tY(),"max-w-sm","py-0.5","px-1"),h_={show:{opacity:[0,1],scale:[.95,1],transition:{duration:.1,ease:"easeOut"}},exit:{opacity:[1,0],scale:[1,.95],transition:{duration:.1,ease:"easeIn"}}},hO=b.forwardRef((e,t)=>{let{trigger:n,children:r,rootProps:i,contentProps:o}=e,{className:a,...s}=o||{},{open:l,onOpenChange:u}=s1({open:null==i?void 0:i.open,onOpenChange:null==i?void 0:i.onOpenChange});return(0,x.jsxs)(hE,{open:l,onOpenChange:u,...i,children:[n&&(0,x.jsx)(hp,{asChild:!0,children:n}),(0,x.jsx)(ny,{children:l?(0,x.jsx)(hj,{forceMount:!0,children:(0,x.jsx)(hx,{asChild:!0,forceMount:!0,ref:t,...s,children:(0,x.jsx)(s0.div,{variants:h_,initial:"init",animate:"show",exit:"exit",className:hk(),children:(0,x.jsx)("div",{className:(0,ea.cx)(hS,a),children:r})})})}):null})]})});function hC(e,t=[]){let n=[],r=()=>{let t=n.map(e=>(0,b.createContext)(e));return function(n){let r=(null==n?void 0:n[e])||t;return(0,b.useMemo)(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=(0,b.createContext)(r),o=n.length;function a(t){let{scope:n,children:r,...a}=t,s=(null==n?void 0:n[e][o])||i,l=(0,b.useMemo)(()=>a,Object.values(a));return(0,b.createElement)(s.Provider,{value:l},r)}return n=[...n,r],a.displayName=t+"Provider",[a,function(n,a){let s=(null==a?void 0:a[e][o])||i,l=(0,b.useContext)(s);if(l)return l;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e),o=i[`__scope${r}`];return{...t,...o}},{});return(0,b.useMemo)(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}function hM(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function hA(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}function hT(...e){return(0,b.useCallback)(hA(...e),e)}let hP=(0,b.forwardRef)((e,t)=>{let{children:n,...r}=e,i=b.Children.toArray(n),o=i.find(hD);if(o){let e=o.props.children,n=i.map(t=>t!==o?t:b.Children.count(e)>1?b.Children.only(null):(0,b.isValidElement)(e)?e.props.children:null);return(0,b.createElement)(hN,(0,E.Z)({},r,{ref:t}),(0,b.isValidElement)(e)?(0,b.cloneElement)(e,void 0,n):null)}return(0,b.createElement)(hN,(0,E.Z)({},r,{ref:t}),n)});hP.displayName="Slot";let hN=(0,b.forwardRef)((e,t)=>{let{children:n,...r}=e;return(0,b.isValidElement)(n)?(0,b.cloneElement)(n,{...function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r],a=/^on[A-Z]/.test(r);a?i&&o?n[r]=(...e)=>{o(...e),i(...e)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props),ref:t?hA(t,n.ref):n.ref}):b.Children.count(n)>1?b.Children.only(null):null});hN.displayName="SlotClone";let hR=({children:e})=>(0,b.createElement)(b.Fragment,null,e);function hD(e){return(0,b.isValidElement)(e)&&e.type===hR}let hL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let n=(0,b.forwardRef)((e,n)=>{let{asChild:r,...i}=e,o=r?hP:t;return(0,b.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,b.createElement)(o,(0,E.Z)({},i,{ref:n}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function hF(e){let t=(0,b.useRef)(e);return(0,b.useEffect)(()=>{t.current=e}),(0,b.useMemo)(()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)},[])}let hV=(null==globalThis?void 0:globalThis.document)?b.useLayoutEffect:()=>{},hz=e=>{let{present:t,children:n}=e,r=function(e){var t;let[n,r]=(0,b.useState)(),i=(0,b.useRef)({}),o=(0,b.useRef)(e),a=(0,b.useRef)("none"),s=e?"mounted":"unmounted",[l,u]=(t={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},(0,b.useReducer)((e,n)=>{let r=t[e][n];return null!=r?r:e},s));return(0,b.useEffect)(()=>{let e=hI(i.current);a.current="mounted"===l?e:"none"},[l]),hV(()=>{let t=i.current,n=o.current,r=n!==e;if(r){let r=a.current,i=hI(t);e?u("MOUNT"):"none"===i||(null==t?void 0:t.display)==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),o.current=e}},[e,u]),hV(()=>{if(n){let e=e=>{let t=hI(i.current),r=t.includes(e.animationName);e.target===n&&r&&(0,e6.flushSync)(()=>u("ANIMATION_END"))},t=e=>{e.target===n&&(a.current=hI(i.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:(0,b.useCallback)(e=>{e&&(i.current=getComputedStyle(e)),r(e)},[])}}(t),i="function"==typeof n?n({present:r.isPresent}):b.Children.only(n),o=hT(r.ref,i.ref),a="function"==typeof n;return a||r.isPresent?(0,b.cloneElement)(i,{ref:o}):null};function hI(e){return(null==e?void 0:e.animationName)||"none"}hz.displayName="Presence";let hZ=w["useId".toString()]||(()=>void 0),hB=0;function hH(e){let t=e+"CollectionProvider",[n,r]=hC(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=b.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(a,n),s=hT(t,i.collectionRef);return b.createElement(hP,{ref:s},r)}),l=e+"CollectionItemSlot",u="data-radix-collection-item",c=b.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=b.useRef(null),s=hT(t,a),c=o(l,n);return b.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>void c.itemMap.delete(a))),b.createElement(hP,{[u]:"",ref:s},r)});return[{Provider:e=>{let{scope:t,children:n}=e,r=b.useRef(null),o=b.useRef(new Map).current;return b.createElement(i,{scope:t,itemMap:o,collectionRef:r},n)},Slot:s,ItemSlot:c},function(t){let n=o(e+"CollectionConsumer",t),r=b.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()),i=r.sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current));return i},[n.collectionRef,n.itemMap]);return r},r]}let hU="dismissableLayer.update",hW=(0,b.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hq=(0,b.forwardRef)((e,t)=>{var n;let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...c}=e,d=(0,b.useContext)(hW),[f,h]=(0,b.useState)(null),p=null!==(n=null==f?void 0:f.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=(0,b.useState)({}),v=hT(t,e=>h(e)),g=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),w=f?g.indexOf(f):-1,j=d.layersWithOutsidePointerEventsDisabled.size>0,k=w>=x,S=function(e,t=null==globalThis?void 0:globalThis.document){let n=hF(e),r=(0,b.useRef)(!1),i=(0,b.useRef)(()=>{});return(0,b.useEffect)(()=>{let e=e=>{if(e.target&&!r.current){let r={originalEvent:e};function o(){hY("dismissableLayer.pointerDownOutside",n,r,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=o,t.addEventListener("click",i.current,{once:!0})):o()}r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{let t=e.target,n=[...d.branches].some(e=>e.contains(t));!k||n||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==u||u())},p),_=function(e,t=null==globalThis?void 0:globalThis.document){let n=hF(e),r=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let e=e=>{e.target&&!r.current&&hY("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{let t=e.target,n=[...d.branches].some(e=>e.contains(t));n||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==u||u())},p);return!function(e,t=null==globalThis?void 0:globalThis.document){let n=hF(e);(0,b.useEffect)(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[n,t])}(e=>{let t=w===d.layers.size-1;t&&(null==i||i(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))},p),(0,b.useEffect)(()=>{if(f)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(o=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),h$(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=o)}},[f,p,r,d]),(0,b.useEffect)(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),h$())},[f,d]),(0,b.useEffect)(()=>{let e=()=>m({});return document.addEventListener(hU,e),()=>document.removeEventListener(hU,e)},[]),(0,b.createElement)(hL.div,(0,E.Z)({},c,{ref:v,style:{pointerEvents:j?k?"auto":"none":void 0,...e.style},onFocusCapture:hM(e.onFocusCapture,_.onFocusCapture),onBlurCapture:hM(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:hM(e.onPointerDownCapture,S.onPointerDownCapture)}))});function h$(){let e=new CustomEvent(hU);document.dispatchEvent(e)}function hY(e,t,n,{discrete:r}){var i,o;let a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?(i=a,o=s,i&&(0,e6.flushSync)(()=>i.dispatchEvent(o))):a.dispatchEvent(s)}(e,t)=>(0,b.createElement)(hL.span,(0,E.Z)({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));let hG="NavigationMenu",[hX,hK,hQ]=hH(hG),[hJ,h0,h1]=hH(hG),[h2,h4]=hC(hG,[hQ,h1]),[h3,h5]=h2(hG),[h6,h8]=h2(hG),[h7,h9]=h2("NavigationMenuItem"),pe=((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=h5("NavigationMenuIndicator",n),o=hK(n),[a,s]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),c="horizontal"===i.orientation,d=!!i.value;(0,b.useEffect)(()=>{var e;let t=o(),n=null===(e=t.find(e=>e.value===i.value))||void 0===e?void 0:e.ref.current;n&&s(n)},[o,i.value]);let f=()=>{a&&u({size:c?a.offsetWidth:a.offsetHeight,offset:c?a.offsetLeft:a.offsetTop})};return pa(a,f),pa(i.indicatorTrack,f),l?(0,b.createElement)(hL.div,(0,E.Z)({"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":i.orientation},r,{ref:t,style:{position:"absolute",...c?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}})):null},"NavigationMenuContent"),pt=((e,t)=>{let n=h5(pe,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return hV(()=>{r(e.value,{ref:t,...e})},[e,t,r]),hV(()=>()=>i(e.value),[e.value,i]),null},"navigationMenu.rootContentDismiss"),pn=(0,b.forwardRef)((e,t)=>{let{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...u}=e,c=h5(pe,n),d=(0,b.useRef)(null),f=hT(d,t),h=function(e,t){return`${e}-trigger-${t}`}(c.baseId,r),p=function(e,t){return`${e}-content-${t}`}(c.baseId,r),m=hK(n),v=(0,b.useRef)(null),{onItemDismiss:g}=c;(0,b.useEffect)(()=>{let e=d.current;if(c.isRootMenu&&e){let t=()=>{var t;g(),s(),e.contains(document.activeElement)&&(null===(t=i.current)||void 0===t||t.focus())};return e.addEventListener(pt,t),()=>e.removeEventListener(pt,t)}},[c.isRootMenu,e.value,i,g,s]);let y=(0,b.useMemo)(()=>{let e=m(),t=e.map(e=>e.value);"rtl"===c.dir&&t.reverse();let n=t.indexOf(c.value),i=t.indexOf(c.previousValue),o=r===c.value,a=i===t.indexOf(r);if(!o&&!a)return v.current;let s=(()=>{if(n!==i){if(o&&-1!==i)return n>i?"from-end":"from-start";if(a&&-1!==n)return n>i?"to-start":"to-end"}return null})();return v.current=s,s},[c.previousValue,c.value,c.dir,m,r]);return(0,b.createElement)(pr,{asChild:!0},(0,b.createElement)(hq,(0,E.Z)({id:p,"aria-labelledby":h,"data-motion":y,"data-orientation":c.orientation},u,{ref:f,onDismiss:()=>{var e;let t=new Event(pt,{bubbles:!0,cancelable:!0});null===(e=d.current)||void 0===e||e.dispatchEvent(t)},onFocusOutside:hM(e.onFocusOutside,e=>{var t;l();let n=e.target;null!==(t=c.rootNavigationMenu)&&void 0!==t&&t.contains(n)&&e.preventDefault()}),onPointerDownOutside:hM(e.onPointerDownOutside,e=>{var t;let n=e.target,r=m().some(e=>{var t;return null===(t=e.ref.current)||void 0===t?void 0:t.contains(n)}),i=c.isRootMenu&&(null===(t=c.viewport)||void 0===t?void 0:t.contains(n));(r||i||!c.isRootMenu)&&e.preventDefault()}),onKeyDown:hM(e.onKeyDown,e=>{let t=e.altKey||e.ctrlKey||e.metaKey,n="Tab"===e.key&&!t;if(n){let t=function(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}(e.currentTarget),n=document.activeElement,i=t.findIndex(e=>e===n),a=e.shiftKey,s=a?t.slice(0,i).reverse():t.slice(i+1,t.length);if(po(s))e.preventDefault();else{var r;null===(r=o.current)||void 0===r||r.focus()}}}),onEscapeKeyDown:hM(e.onEscapeKeyDown,e=>{a.current=!0})})))}),pr=((e,t)=>{let{__scopeNavigationMenu:n,children:r,...i}=e,o=h5("NavigationMenuViewport",n),a=hT(t,o.onViewportChange),s=h8(pe,e.__scopeNavigationMenu),[l,u]=(0,b.useState)(null),[c,d]=(0,b.useState)(null),f=l?(null==l?void 0:l.width)+"px":void 0,h=l?(null==l?void 0:l.height)+"px":void 0,p=!!o.value,m=p?o.value:o.previousValue;return pa(c,()=>{c&&u({width:c.offsetWidth,height:c.offsetHeight})}),(0,b.createElement)(hL.div,(0,E.Z)({"data-state":function(e){return e?"open":"closed"}(p),"data-orientation":o.orientation},i,{ref:a,style:{pointerEvents:!p&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":h,...i.style},onPointerEnter:hM(e.onPointerEnter,o.onContentEnter),onPointerLeave:hM(e.onPointerLeave,function(e){return t=>"mouse"===t.pointerType?e(t):void 0}(o.onContentLeave))}),Array.from(s.items).map(([e,{ref:t,forceMount:n,...r}])=>{let i=m===e;return(0,b.createElement)(hz,{key:e,present:n||i},(0,b.createElement)(pn,(0,E.Z)({},r,{ref:hA(t,e=>{i&&e&&d(e)})})))}))},(0,b.forwardRef)((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=h5("FocusGroup",n);return(0,b.createElement)(hJ.Provider,{scope:n},(0,b.createElement)(hJ.Slot,{scope:n},(0,b.createElement)(hL.div,(0,E.Z)({dir:i.dir},r,{ref:t}))))})),pi=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];(e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=h0(n),o=h5("FocusGroupItem",n);return(0,b.createElement)(hJ.ItemSlot,{scope:n},(0,b.createElement)(hL.button,(0,E.Z)({},r,{ref:t,onKeyDown:hM(e.onKeyDown,e=>{let t=["Home","End",...pi].includes(e.key);if(t){let t=i().map(e=>e.ref.current),n="rtl"===o.dir?"ArrowRight":"ArrowLeft";if([n,"ArrowUp","End"].includes(e.key)&&t.reverse(),pi.includes(e.key)){let n=t.indexOf(e.currentTarget);t=t.slice(n+1)}setTimeout(()=>po(t)),e.preventDefault()}})})))};function po(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}function pa(e,t){let n=hF(t);hV(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ps=n(38617);let pl=b.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,x.jsx)(dq,{...r,ref:t,className:(0,ea.cx)("select-none flex items-center rounded cursor-pointer","focus:ring ring-blue-500 dark:ring-blue-200","text-gray-700 dark:text-graydark-700","data-[state=checked]:text-gray-1100 data-[state=checked]:dark:text-white",n)})});function pu(e){let{className:t,tooltipClassName:n,tabIndex:r}=e,{theme:i,setTheme:o}=(0,ps.F)();return(0,x.jsxs)(dW,{value:i,tabIndex:r,className:(0,ea.cx)("flex gap-4",t),onValueChange:e=>o(e),children:[(0,x.jsx)(pl,{value:"system",children:(0,x.jsx)(s4,{className:n,sideOffset:16,content:"System",children:(0,x.jsx)(s6.$Iz,{})})}),(0,x.jsx)(pl,{value:"light",children:(0,x.jsx)(s4,{className:n,sideOffset:16,content:"Light",children:(0,x.jsx)(s6.JaG,{})})}),(0,x.jsx)(pl,{value:"dark",children:(0,x.jsx)(s4,{className:n,sideOffset:16,content:"Dark",children:(0,x.jsx)(s6.osk,{})})})]})}var pc=n(14582),pd=n(63739),pf=n(13980),ph=n.n(pf),pp=n(72779),pm=n.n(pp),pv=n(47440),pg=n(59309),py=n(19067),px=n(71220),pb=n(28142);function pw(e){return"bandwidth"in e?e.bandwidth():0}var pE=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function pj(){return(pj=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,pE),g=null!=m?m:(0,px.Z)(r,void 0===f?10:f),y=(null!=p?p:0)+pw(r)/2,x=g.map(function(e,t){var n,o=(null!=(n=(0,pb.Z)(r(e)))?n:0)+y;return{index:t,from:new py.Z({x:0,y:o}),to:new py.Z({x:i,y:o})}});return b.createElement(pg.Z,{className:pm()("visx-rows",c),top:void 0===t?0:t,left:void 0===n?0:n},d?d({lines:x}):x.map(function(e){var t=e.from,n=e.to,r=e.index;return b.createElement(pv.default,pj({key:"row-line-"+r,from:t,to:n,stroke:a,strokeWidth:l,strokeDasharray:u,style:h},v))}))}pk.propTypes={tickValues:ph().array,width:ph().number.isRequired};var pS=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function p_(){return(p_=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,pS),g=null!=p?p:(0,px.Z)(r,void 0===d?10:d),y=(null!=h?h:0)+pw(r)/2,x=g.map(function(e,t){var n,o=(null!=(n=(0,pb.Z)(r(e)))?n:0)+y;return{index:t,from:new py.Z({x:o,y:0}),to:new py.Z({x:o,y:i})}});return b.createElement(pg.Z,{className:pm()("visx-columns",c),top:void 0===t?0:t,left:void 0===n?0:n},m?m({lines:x}):x.map(function(e){var t=e.from,n=e.to,r=e.index;return b.createElement(pv.default,p_({key:"column-line-"+r,from:t,to:n,stroke:a,strokeWidth:l,strokeDasharray:u,style:f},v))}))}pO.propTypes={tickValues:ph().array,height:ph().number.isRequired};var pC=n(64183),pM=n(8597);function pA(e){var t=e.id,n=e.width,r=e.height,i=e.children;return b.createElement("defs",null,b.createElement("pattern",{id:t,width:n,height:r,patternUnits:"userSpaceOnUse"},i))}pA.propTypes={id:ph().string.isRequired,width:ph().number.isRequired,height:ph().number.isRequired,children:ph().node.isRequired};var pT={horizontal:"horizontal",vertical:"vertical",diagonal:"diagonal",diagonalRightToLeft:"diagonalRightToLeft"};function pP(e){var t=e.id,n=e.width,r=e.height,i=e.stroke,o=e.strokeWidth,a=e.strokeDasharray,s=e.strokeLinecap,l=void 0===s?"square":s,u=e.shapeRendering,c=void 0===u?"auto":u,d=e.orientation,f=void 0===d?["vertical"]:d,h=e.background,p=e.className,m=Array.isArray(f)?f:[f];return b.createElement(pA,{id:t,width:n,height:r},!!h&&b.createElement("rect",{className:pm()("visx-pattern-line-background"),width:n,height:r,fill:h}),m.map(function(e,n){return b.createElement("path",{key:"visx-"+t+"-line-"+e+"-"+n,className:pm()("visx-pattern-line",p),d:function(e){var t=e.height;switch(e.orientation){case pT.horizontal:return"M 0,"+t/2+" l "+t+",0";case pT.diagonal:return"M 0,"+t+" l "+t+","+-t+" M "+-t/4+","+t/4+" l "+t/2+","+-t/2+"\n M "+3/4*t+","+5/4*t+" l "+t/2+","+-t/2;case pT.diagonalRightToLeft:return"M 0,0 l "+t+","+t+"\n M "+-t/4+","+3/4*t+" l "+t/2+","+t/2+"\n M "+3/4*t+","+-t/4+" l "+t/2+","+t/2;case pT.vertical:default:return"M "+t/2+", 0 l 0, "+t}}({orientation:e,height:r}),stroke:i,strokeWidth:o,strokeDasharray:a,strokeLinecap:l,shapeRendering:c})}))}pP.propTypes={id:ph().string.isRequired,width:ph().number.isRequired,height:ph().number.isRequired,className:ph().string,background:ph().string,stroke:ph().string,strokeWidth:ph().oneOfType([ph().number,ph().string]),strokeDasharray:ph().oneOfType([ph().string,ph().number]),strokeLinecap:ph().oneOf(["square","butt","round","inherit"]),shapeRendering:ph().oneOfType([ph().string,ph().number]),orientation:ph().array};var pN=["tooltipOpen"];function pR(){return(pR=Object.assign?Object.assign.bind():function(e){for(var t=1;t