0&&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:b})=>{let[x,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()},[]),O=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(l,e)}catch(e){}},[e]),_=(0,r.useCallback)(t=>{let r=v(t);j(r),"system"===x&&n&&!e&&S("system")},[x,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(o);return e.addListener(_),_(e),()=>e.removeListener(_)},[_]),(0,r.useEffect)(()=>{let e=e=>{e.key===l&&O(e.newValue||c)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[O]),(0,r.useEffect)(()=>{S(null!=e?e:x)},[e,x]);let C=(0,r.useMemo)(()=>({theme:x,setTheme:O,forcedTheme:e,resolvedTheme:"system"===x?E:x,themes:n?[...u,"system"]:u,systemTheme:n?E:void 0}),[x,O,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:b}),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(6645),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(30078),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},10842:function(e,t,n){"use strict";n.d(t,{iV:function(){return w},ZR:function(){return x}});var r=n(52322),i=n(2784),o=n(6645),a=n(25205),s=n(94977),l=n(6391),u=n.n(l);let c=[{value:"",label:"Off"},{value:"route53",label:"Route 53"},{value:"noip",label:"No-IP"},{value:"duckdns",label:"Duck DNS"},{value:"cloudflare",label:"Cloudflare"}],d={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:""};function f(e){let{settings:t}=e,n=null;return"duckdns"===t.ddns.provider&&(n={dnsDuckDnsToken:t.ddns.options.token}),"noip"===t.ddns.provider&&(n={dnsNoIpEmail:t.ddns.options.email,dnsNoIpPassword:t.ddns.options.password}),"route53"===t.ddns.provider&&(n={dnsAwsId:t.ddns.options.id,dnsAwsSecret:t.ddns.options.secret,dnsAwsZoneId:t.ddns.options.zoneID}),"cloudflare"===t.ddns.provider&&(n={dnsCloudflareToken:t.ddns.options.token,dnsCloudflareZoneId:t.ddns.options.zoneID}),{acceptingContracts:t.acceptingContracts,netAddress:t.netAddress,maxContractDuration:new(u())(t.maxContractDuration).div((0,a.S5)(1)),contractPrice:(0,a.ll)(t.contractPrice,6),baseRPCPrice:(0,a.ll)((0,s.sS)(t.baseRPCPrice),6),sectorAccessPrice:(0,a.ll)((0,s.nS)(t.sectorAccessPrice),6),collateralMultiplier:new(u())(t.collateralMultiplier),maxCollateral:(0,a.ll)(t.maxCollateral,6),storagePrice:(0,a.ll)((0,s.SY)(t.storagePrice),6),egressPrice:(0,a.ll)((0,s.B1)(t.egressPrice),6),ingressPrice:(0,a.ll)((0,s.dK)(t.ingressPrice),6),priceTableValidity:new(u())(t.priceTableValidity).div(1e9).div(60),maxRegistryEntries:new(u())(t.maxRegistryEntries),accountExpiry:new(u())(t.accountExpiry).div(1e9).div(86400),maxAccountBalance:(0,a.ll)(t.maxAccountBalance,6),ingressLimit:(0,a.BT)(new(u())(t.ingressLimit)),egressLimit:(0,a.BT)(new(u())(t.egressLimit)),dnsProvider:t.ddns.provider,dnsIpv4:t.ddns.ipv4,dnsIpv6:t.ddns.ipv6,...n}}function h(e,t){return new(u())(12960).times(e).div((0,a.S5)(1)).times(t)}var p=n(27444),m=n(63955);function v(e,t){return t?new(u())(new(u())(e).div(t.sc.usd).div(10).toFixed(0)).times(10):void 0}var g=n(92762),y=n(9455);let b=(0,i.createContext)({}),x=()=>(0,i.useContext)(b);function w(e){let{children:t}=e,n=function(){let{settings:e,dynDNSCheck:t}=function(){let e=(0,p.rV)({config:{swr:{refreshInterval:(0,o.sWj)(1)}}}),t=(0,p.uo)({disabled:!e.data||!e.data.ddns.provider,config:{swr:{revalidateOnFocus:!1,errorRetryCount:0}}});return{settings:e,dynDNSCheck:t}}(),{form:n,fields:l,setShowAdvanced:b,showAdvanced:x}=function(){let e=(0,m.cI)({mode:"all",defaultValues:d}),t=e.watch("storagePrice"),n=e.watch("collateralMultiplier"),[o,s]=(0,g.Z)("v0/config/showAdvanced",{defaultValue:!1}),l=(0,y.BW)(),f=(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(u())(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(u())(e).gte((0,a.E6)(4320))||"must be at least 1 month"}}},storagePrice:{title:"Storage price",type:"siacoin",category:"pricing",units:"SC/TB/month",decimalsLimitSc:6,suggestion:o?v(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?v(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?v(.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(u())(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(u())(.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(u())(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(u())(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(u())(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(u())(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(u())(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(u())(e).gte(7)||"must be at least 1 week"}}},maxAccountBalance:{title:"Maximum balance",type:"siacoin",category:"RHP3",suggestion:new(u())(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(u())(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:c,description:(0,r.jsx)(r.Fragment,{children:"Enable dynamic DNS with one of the supported providers."}),validation:{validate:e=>!!c.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:o,storageTBMonth:t,collateralMultiplier:n,rates:null===(e=l.data)||void 0===e?void 0:e.rates})},[o,t,n,l.data]);return{form:e,fields:f,storageTBMonth:t,collateralMultiplier:n,showAdvanced:o,setShowAdvanced:s}}(),w=(0,i.useMemo)(()=>({settings:{data:e.data,error:e.error}}),[e.data,e.error]),E=(0,i.useMemo)(()=>!function(e){let{settings:t}=e;return!!t.data}(w)?null:f({settings:w.settings.data}),[w]),j=(0,i.useMemo)(()=>(function(e){let{settings:t}=e;return!!t.error})(w),[w]),k=(0,i.useCallback)(async()=>{let r=await e.mutate();if(r)return await t.mutate(),n.reset(f({settings:r}));(0,o.OHV)("Error fetching settings.")},[n,e,t]);(0,o.u$d)({form:n,remoteValues:E}),(0,o.Z4p)({form:n,remoteValues:E});let{changeCount:S}=(0,o.mYE)({form:n}),O=function(e){let{resources:t,showAdvanced:n,revalidateAndResetForm:r}=e,l=(0,p.Te)(),u=(0,p.On)({config:{swr:{refreshInterval:(0,o.sWj)(1)}}}),c=(0,i.useCallback)(async e=>{if(t)try{var i,c;let d;let f={};n||(f.maxCollateral=h(e.storagePrice,e.collateralMultiplier));let p={...e,...f},m=await l.patch({payload:(c=t.settings.data,d=null,"duckdns"===p.dnsProvider&&(d={token:p.dnsDuckDnsToken}),"noip"===p.dnsProvider&&(d={email:p.dnsNoIpEmail,password:p.dnsNoIpPassword}),"route53"===p.dnsProvider&&(d={id:p.dnsAwsId,secret:p.dnsAwsSecret,zoneID:p.dnsAwsZoneId}),"cloudflare"===p.dnsProvider&&(d={token:p.dnsCloudflareToken,zoneID:p.dnsCloudflareZoneId}),{...c,acceptingContracts:p.acceptingContracts,netAddress:p.netAddress,maxContractDuration:Number(p.maxContractDuration.times((0,a.S5)(1)).toFixed(0)),contractPrice:(0,a.qN)(p.contractPrice).toString(),baseRPCPrice:p.baseRPCPrice.div((0,a.ll)((0,s.sS)(1))).toFixed(0),sectorAccessPrice:p.sectorAccessPrice.div((0,a.ll)((0,s.nS)(1))).toFixed(0),collateralMultiplier:p.collateralMultiplier.toNumber(),maxCollateral:(0,a.qN)(p.maxCollateral).toString(),storagePrice:p.storagePrice.div((0,a.ll)((0,s.SY)(1))).toFixed(0),egressPrice:p.egressPrice.div((0,a.ll)((0,s.B1)(1))).toFixed(0),ingressPrice:p.ingressPrice.div((0,a.ll)((0,s.dK)(1))).toFixed(0),priceTableValidity:Number(p.priceTableValidity.times(60).times(1e9).toFixed(0)),maxRegistryEntries:Number(p.maxRegistryEntries.toFixed(0)),accountExpiry:Number(p.accountExpiry.times(86400).times(1e9).toFixed(0)),maxAccountBalance:(0,a.qN)(p.maxAccountBalance).toString(),ingressLimit:Number((0,a.Y)(p.ingressLimit).toFixed(0)),egressLimit:Number((0,a.Y)(p.egressLimit).toFixed(0)),ddns:{...null==c?void 0:c.ddns,provider:p.dnsProvider,ipv4:p.dnsIpv4,ipv6:p.dnsIpv6,options:d}})});if(m.error)throw Error(m.error);let v=(null===(i=u.data.lastAnnouncement)||void 0===i?void 0:i.address)!==e.netAddress;v?(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 r()}catch(e){(0,o.OHV)(e.message),console.log(e)}},[n,t,l,r,u]);return c}({resources:w,showAdvanced:x,revalidateAndResetForm:k}),_=(0,o.WsO)(l),C=(0,i.useMemo)(()=>n.handleSubmit(O,_),[n,O,_]),M=(0,i.useRef)(),A=(0,i.useCallback)(async e=>{(0,o.S5N)(M.current,e)},[]);return{fields:l,settings:e,dynDNSCheck:t,changeCount:S,revalidateAndResetForm:k,form:n,onSubmit:C,showAdvanced:x,setShowAdvanced:b,remoteError:j,takeScreenshot:A,configRef:M}}();return(0,r.jsx)(b.Provider,{value:n,children:t})}},92838:function(e,t,n){"use strict";n.d(t,{x:function(){return x},G:function(){return b}});var r=n(52322),i=n(6645),o=n(5632),a=n(27444),s=n(2784),l=n(56860),u=n(89528),c=n(25205),d=n(30078);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)({}),b=()=>(0,s.useContext)(y);function x(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:b,enabledColumns:x,sortableColumns:w,toggleColumnVisibility:E,setColumnsVisible:j,setColumnsHidden:k,toggleSort:S,setSortDirection:O,setSortField:_,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=>x.includes(e.id)),[x]),R=T.isValidating,D=T.error,L=(0,i.c2j)(P,R,D,c),{estimatedBlockHeight:Z,isSynced:F,nodeBlockHeight:V}=(0,v.n)(),z=F?V:Z,{range:I}=(0,s.useMemo)(()=>(0,i.EJC)(z,P||[]),[z,P]),B=(0,g.B)(),H=(0,s.useMemo)(()=>({contractsTimeRange:I,currentHeight:z,siascanUrl:B}),[I,z,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:b,enabledColumns:x,sortableColumns:w,toggleColumnVisibility:E,setColumnsVisible:j,setColumnsHidden:k,toggleSort:S,setSortDirection:O,setSortField:_,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"},30078:function(e,t,n){"use strict";n.d(t,{Tu:function(){return eS},xQ:function(){return eO},Rh:function(){return ek}});var r=n(52322),i=n(2784),o=n(6645),a=n(27444),s=n(25205),l=n(6391),u=n.n(l),c=n(63955);function d(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)},b=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)}},x=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(b,t),p?e(o.current):c.current;if(v)return n(b,t),e(o.current)}return s.current||n(b,t),c.current};return x.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,l.current=o.current=u.current=s.current=null},x.isPending=function(){return!!s.current},x.flush=function(){return s.current?y(Date.now()):c.current},x},[p,v,t,g,m,h])}function f(e,t){return e===t}function h(e){return"function"==typeof e?function(){return e}:e}var p=n(99182),m=n(4941),v=n(89528);function g(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)(v.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 y(){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 b=n(79200),x=n(81441),w=n(81721),E=function(e,t){for(var n=e.length;n--&&(0,w.Z)(t,e[n],0)>-1;);return n},j=n(36202),k=n(25186),S=n(37602),O=function(e,t,n){if((e=(0,k.Z)(e))&&(n||void 0===t))return e.slice(0,(0,S.Z)(e)+1);if(!e||!(t=(0,b.Z)(t)))return e;var r=(0,j.Z)(e),i=E(r,(0,j.Z)(t))+1;return(0,x.Z)(r,0,i).join("")},_=n(78807),C=function(e,t){for(var n=-1,r=e.length;++n-1;);return n},M=function(e,t,n){if((e=(0,k.Z)(e))&&(n||void 0===t))return(0,_.Z)(e);if(!e||!(t=(0,b.Z)(t)))return e;var r=(0,j.Z)(e),i=(0,j.Z)(t),o=C(r,i),a=E(r,i)+1;return(0,x.Z)(r,o,a).join("")};function A(e){let{currentPath:t,childPath:n,separator:r}=e;return"\\"===t&&n.endsWith(":")?n+r:T(t,n,r)}function T(e,t,n){e=e===n?e:O(e,n),t=M(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 P(){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)(v.Qbr,{})}),(0,r.jsx)(o.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:"Error loading directory."})]})}function N(e){let{path:t,onCreate:n}=e,s=y(),l=(0,a.Kw)(),[u,c]=(0,i.useState)(""),d=(0,i.useCallback)(async()=>{let e=await l.put({payload:{path:A({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)(v.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 R(e){let{path:t,setPath:n,commandPage:i,currentPage:a,beforeSelect:s,afterSelect:l}=e,u=y();return(0,r.jsx)(m.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)(v.ROc,{size:16})}),(0,r.jsx)(o.xvT,{ellipsis:!0,children:".."})]})},"..")}let D={namespace:"volumes/directorySelect",label:"Directory select"};function L(e){var t,n,i,a,s,l,u;let{path:c,dir:d,setPath:f,currentPage:h,beforeSelect:b,afterSelect:x}=e,w=y(),E=(null===(t=d.data)||void 0===t?void 0:t.path)===w,j=(null===(n=d.data)||void 0===n?void 0:n.path)==="\\";return(0,r.jsxs)(m.fu,{currentPage:h,commandPage:D,children:[d.isValidating||!d.data||d.error?null:E?null:(0,r.jsx)(R,{path:d.data.path,setPath:f,currentPage:h,commandPage:D,afterSelect:x,beforeSelect:b}),(0,r.jsxs)(p.mY.Empty,{children:[!d.isValidating&&d.error?(0,r.jsx)(P,{}):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)(g,{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)(m.WD,{commandPage:D,currentPage:h,onSelect:()=>{b&&b();let t=A({currentPath:d.data.path,childPath:e,separator:w});f(t),x&&x()},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)(v.ROc,{size:16})}),(0,r.jsx)(o.xvT,{ellipsis:!0,children:e})]})},e)):null,!j&&!d.isValidating&&!d.error&&(0,r.jsx)(m.WD,{commandPage:D,currentPage:h,value:"create new directory",children:(0,r.jsx)(N,{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 Z(e){let{path:t,dir:n,onChange:i}=e;return(0,r.jsx)(p.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)(p.mY.List,{children:(0,r.jsx)(L,{path:t,dir:n,setPath:i,currentPage:D})})})})})}var F=n(82851);function V(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,F.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,F.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 z=new(u())(10),I={size:void 0,name:"",path:"~",immediatePath:"~"};function B(e){let{trigger:t,open:n,onOpenChange:l}=e,{closeDialog:f}=ek(),h=(0,a.HU)(),p=y(),m=(0,c.cI)({mode:"all",defaultValues:I}),v=m.watch("path"),g=m.watch("immediatePath"),b=m.watch("name"),x=m.watch("size"),w=d(()=>{v!==g&&m.setValue("path",g)},500);(0,i.useEffect)(()=>{w()},[g]),(0,i.useEffect)(()=>{v!==g&&m.setValue("immediatePath",v)},[v]);let E=(0,i.useCallback)(async e=>{let t=await h.post({payload:{localPath:T(v,b,p),maxSectors:(0,o.WN2)(e.size).toNumber()}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("New volume created."),m.reset(I),f())},[m,h,f,b,v,p]),j=(0,a.cM)({disabled:!n,params:{path:""===v?p:v},config:{swr:{shouldRetryOnError:!1}}});(0,i.useEffect)(()=>{j.error&&m.setError("immediatePath",{message:"Directory does not exist"})},[j.error]),(0,i.useEffect)(()=>{j.data&&j.data.path!==v&&m.setValue("path",j.data.path)},[j.data]);let k=(0,i.useMemo)(()=>x||new(u())(0),[x]),S=(0,i.useMemo)(()=>j.data?(0,s.Uz)(j.data.freeBytes):new(u())(0),[j.data]),O=(0,i.useMemo)(()=>{var e;return(0,s.Uz)((null===(e=j.data)||void 0===e?void 0:e.freeBytes)||new(u())(0))},[j.data]),_=(0,i.useMemo)(()=>{var e,t;return e=z.toNumber(),t=O.toNumber(),{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:n=>{let r="Must be between ".concat((0,s.vW)((0,s.Hz)(e))," and ").concat((0,s.vW)((0,s.Hz)(t),{fixed:3}));return n<=t&&n>=e||r},nospace:()=>t>e||"not enough space in directory"}}}}},[O]),C=(0,o.WsO)(_);return m.register("path",_.path.validation),(0,r.jsx)(o.VqE,{title:"Create Volume",trigger:t,open:n,onOpenChange:e=>{e||m.reset(I),l(e)},contentVariants:{className:"w-[400px]"},onSubmit:m.handleSubmit(E,C),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:_}),(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:_})}),(0,r.jsx)(Z,{path:v,dir:j,onChange:e=>m.setValue("path",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})})]}),(0,r.jsx)(o.jIp,{name:"size",form:m,fields:_}),(0,r.jsx)(V,{newSizeGB:k.toNumber(),currentSizeGB:0,maxSizeGB:S.toNumber()})]})})}let H=new(u())(10),U={size:void 0};function W(e){var t,n;let{trigger:l,open:d,onOpenChange:f}=e,{id:h,closeDialog:p}=ek(),m=y(),v=(0,a.ST)({disabled:!h,params:{id:h}}),g=(0,a.cM)({disabled:!d||!v.data,params:{path:null===(t=v.data)||void 0===t?void 0:t.localPath.split(m).slice(0,-1).join(m)}}),b=(0,a.G)(),x=(0,c.cI)({mode:"all",defaultValues:U}),w=x.watch("size"),E=(0,i.useCallback)(async e=>{let t=await b.put({params:{id:Number(h)},payload:{maxSectors:(0,o.WN2)(e.size).toNumber()}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("Volume resizing initiated."),x.reset(U),p())},[x,h,b,p]);(0,i.useEffect)(()=>{v.data&&x.reset(U)},[v.data]);let j=(0,i.useMemo)(()=>w||new(u())(0),[w]),k=(0,i.useMemo)(()=>v.data?(0,o.bjP)(v.data.totalSectors):new(u())(0),[v.data]),S=(0,i.useMemo)(()=>g.data?(0,s.Uz)(g.data.freeBytes):new(u())(0),[g.data]),O=(0,i.useMemo)(()=>k.plus(S),[k,S]),_=k.lt(j),C=k.minus(j).abs().gte(1),M=(0,i.useMemo)(()=>{var e,t;return e=H.toNumber(),t=O.toNumber(),{size:{type:"number",title:"New size",decimalsLimit:0,units:"GB",placeholder:"1,000",validation:{required:"required",validate:{between:n=>{let r="Must be between ".concat((0,s.vW)((0,s.Hz)(e))," and ").concat((0,s.vW)((0,s.Hz)(t),{fixed:3}));return n<=t&&n>=e||r}}}}}},[O]),A=(0,o.WsO)(M);return(0,r.jsx)(o.VqE,{title:"Resize Volume",trigger:l,open:d,onOpenChange:e=>{e||x.reset(U),f(e)},contentVariants:{className:"max-w-[400px]"},onSubmit:x.handleSubmit(E,A),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=v.data)||void 0===n?void 0:n.localPath})]}),(0,r.jsx)(o.jIp,{name:"size",form:x,fields:M}),(0,r.jsx)(V,{currentSizeGB:k.toNumber(),newSizeGB:j.toNumber(),maxSizeGB:O.toNumber(),label:C?(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:_?"Increase by ".concat((0,s.vW)((0,s.Hz)(j.minus(k)))):"Decrease by ".concat((0,s.vW)((0,s.Hz)(k.minus(j))))}):(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:"Current size is ".concat((0,s.vW)((0,s.Hz)(k)))})})]})})}let q={path:"",force:!1};function $(e){var t,n,l;let{trigger:u,open:d,onOpenChange:f}=e,{id:h,closeDialog:p}=ek(),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),b=null===(l=v.data)||void 0===l?void 0:l.localPath,x=(0,c.cI)({mode:"all",defaultValues:q}),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."),x.reset(),p())},[x,v.data,m,p]),E=(0,i.useMemo)(()=>({path:{type:"text",title:"Path",placeholder:b,validation:{required:"required",validate:{equals:e=>e===b||"directory path does not match"}}},force:{type:"boolean",title:"Force",validation:{}}}),[b]),j=(0,o.WsO)(E);return(0,r.jsx)(o.VqE,{title:"Delete Volume",trigger:u,open:d,onOpenChange:e=>{e||x.reset(q),f(e)},contentVariants:{className:"w-[400px]"},onSubmit:x.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:x,fields:E}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(o.QBj,{name:"force",size:"medium",form:x,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:x,children:"Delete"})]})})}function Y(){let{dialog:e,openDialog:t,closeDialog:n}=ek(),s=(0,a.Os)(),l=(0,a.cj)(),c=(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(u())(s.data.spendable):void 0,send:c,open:"sendSiacoin"===e,onOpenChange:r=>r?t(e):n()})}var G=n(63171);function K(){let{id:e,dialog:t,openDialog:n,closeDialog:a}=ek(),{dataset:s}=(0,G.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 X=n(734),Q=n(95753),J=n(71930),ee=n(5632);let et={namespace:"wallet",label:"Wallet"};function en(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:s,closeDialog:l}=ek(),u=(0,ee.useRouter)(),c=(0,a.On)({config:{swr:{revalidateOnFocus:!1,keepPreviousData:!0}}});return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:et,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:et,onSelect:()=>{i(et)},children:et.label}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{u.push(J._.wallet.view),l()},children:"View wallet transactions"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{s("sendSiacoin")},children:"Send siacoin"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{s("addressDetails")},children:"Receive siacoin"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{s("addressDetails")},children:"View wallet address"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,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 er=n(38617);let ei={namespace:"settings",label:"Settings"};function eo(e){let{currentPage:t,parentPage:n}=e,{openDialog:i,closeDialog:o}=ek(),{setTheme:a}=(0,er.F)(),{settings:s,setSettings:l,lock:u,currencyOptions:c,setCurrency:d}=(0,Q.Hv)();return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:ei,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:ei,onSelect:()=>{i("settings")},children:"Open settings"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{l({siaCentral:!s.siaCentral}),o()},children:(s.siaCentral?"Disable":"Enable")+" external API - Sia Central exchange rates"}),(0,r.jsx)(m.o4,{currentPage:t,commandPage:ei,onSelect:()=>{u(),o()},children:"Lock hostd"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{i("settings")},children:"Open interface theme menu"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{a("system"),o()},children:"Set theme to system preference"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{a("dark"),o()},children:"Set theme to dark"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{a("light"),o()},children:"Set theme to light"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{i("settings")},children:"Open currency settings menu"}),c.map(e=>{let{id:n,label:i}=e;return(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{d(n),o()},children:"Set currency to ".concat(i)},n)})]})}let ea={namespace:"node",label:"Blockchain node"};function es(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:o,closeDialog:a}=ek(),s=(0,ee.useRouter)();return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:ea,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:ea,onSelect:()=>{i(ea)},children:ea.label}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ea,onSelect:()=>{o("connectPeer")},children:"Connect to a peer"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ea,onSelect:()=>{s.push(J._.node.index),a()},children:"View peers"})]})}var el=n(10842);let eu={namespace:"configuration",label:"Configuration"};function ec(e){let{currentPage:t,parentPage:n,pushPage:i}=e,o=(0,ee.useRouter)(),{showAdvanced:a}=(0,el.ZR)(),{closeDialog:s}=ek();return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:eu,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:eu,onSelect:()=>{i(eu)},children:eu.label}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.index),s()},children:"Open configuration"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.host),s()},children:"Configure host"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.pricing),s()},children:"Configure pricing"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.dns),s()},children:"Configure DNS"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.bandwidth),s()},children:"Configure bandwidth"}),a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.registry),s()},children:"Configure registry"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.accounts),s()},children:"Configure accounts"})]})]})}var ed=n(92838);function ef(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)(v.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 eh=n(3639);let ep={namespace:"contracts",label:"Contracts"};function em(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,s=(0,ee.useRouter)(),{closeDialog:l}=ek();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(ep)},children:ep.label}),(0,r.jsx)(m.fu,{currentPage:t,commandPage:ep,children:(0,r.jsx)(m.WD,{currentPage:t,commandPage:ep,onSelect:()=>{s.push(J._.contracts.index),l()},children:"View contracts"})}),(0,r.jsx)(eh.F,{parentPage:ep,currentPage:t,beforeSelect:o,afterSelect:a,pushPage:i})]})}let ev={namespace:"volumes",label:"Volumes"};function eg(e){let{currentPage:t,parentPage:n,pushPage:i}=e,o=(0,ee.useRouter)(),{openDialog:a,closeDialog:s}=ek();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(ev)},children:ev.label}),(0,r.jsxs)(m.fu,{currentPage:t,commandPage:ev,children:[(0,r.jsx)(m.WD,{currentPage:t,commandPage:ev,onSelect:()=>{o.push(J._.volumes.index),s()},children:"View volumes"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ev,onSelect:()=>{a("volumeCreate")},children:"Create volume"})]})]})}function ey(e){var t,n,a,s,l,u,c,m,v;let{panel:g}=e,y=(0,ee.useRouter)(),{resetFilters:b}=(0,ed.G)(),{closeDialog:x}=ek(),[w,E]=(0,i.useState)(""),[j]=(s=t&&t.equalityFn||f,u=(a=(n=(0,i.useState)(h(w)))[1],l=[n[0],(0,i.useCallback)(function(e){return a(h(e))},[])])[0],c=l[1],m=d((0,i.useCallback)(function(e){return c(e)},[c]),500,t),s((v=(0,i.useRef)(w)).current,w)||(m(w),v.current=w),[u,m]),[k,S]=(0,i.useState)([]),O=k[k.length-1],_=0===k.length,C=(0,i.useCallback)(e=>{S(t=>[...t,e])},[S]),M=(0,i.useCallback)(()=>{x()},[x]),A=(0,i.useCallback)(()=>{E("")},[E]),T=(null==O?void 0:O.empty)||ef;return(0,r.jsxs)(p.mY,{label:"Command Menu",loop:!0,className:(0,F.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:[O&&(0,r.jsx)(o.__J,{className:"px-2",children:O.label}),(0,r.jsx)(p.mY.Input,{value:w,onValueChange:E,className:(0,o.cEb)({variant:"ghost",focus:"none"}),placeholder:(null==O?void 0:O.prompt)||(_?"Search for commands, eg: theme, redundancy":"Search commands")}),(0,r.jsx)(o.Z0O,{className:"my-2"}),(0,r.jsxs)(p.mY.List,{children:[(0,r.jsx)(p.mY.Empty,{children:(0,r.jsx)(T,{search:w,debouncedSearch:j})}),(0,r.jsx)(eo,{currentPage:O,pushPage:C}),(0,r.jsx)(en,{currentPage:O,pushPage:C}),(0,r.jsx)(eg,{currentPage:O,pushPage:C}),(0,r.jsx)(em,{currentPage:O,pushPage:C,beforeSelect:()=>{M(),b()},afterSelect:()=>{y.pathname.startsWith(J._.contracts.index)||y.push(J._.contracts.index),A()}}),(0,r.jsx)(ec,{currentPage:O,pushPage:C}),(0,r.jsx)(es,{currentPage:O,pushPage:C})]})]})}function eb(e){let{open:t,onOpenChange:n,setOpen:a}=e,{isUnlockedAndAuthedRoute:s}=(0,Q.Hv)(),{isConnected:l}=(0,o.Y97)({route:J.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)(ey,{})})})}function ex(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:ew,dataFields:eE,dismissMany:c,dismissOne:u})}let ew=["error","contractID","blockHeight","resolution","volume","volumeID","elapsed","error","checked","missing","corrupt","total","oldSectors","currentSectors","targetSectors","migratedSectors","migrated","target","force"],eE={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"})]})}}},ej=(0,i.createContext)({}),ek=()=>(0,i.useContext)(ej);function eS(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)(ej.Provider,{value:n,children:t})}function eO(){var e;let{dialog:t,openDialog:n,openConfirmDialog:i,onOpenChange:s,closeDialog:l,confirm:u}=ek(),c=(0,a.Wl)(),d=(0,a.Os)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eb,{open:"cmdk"===t,onOpenChange:s,setOpen:()=>n("cmdk")}),(0,r.jsx)(o.DLL,{open:"settings"===t,onOpenChange:s}),(0,r.jsx)(ex,{open:"alerts"===t,onOpenChange:s}),(0,r.jsx)(Y,{}),(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)(K,{}),(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)(B,{open:"volumeCreate"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(W,{open:"volumeResize"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)($,{open:"volumeDelete"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(X.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(6645),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),x=(0,i.createContext)({}),w=()=>(0,i.useContext)(x);function E(e){let{children:t}=e,n=function(){let[e,t]=(0,y.Z)("v0/metrics/dataTimeSpan",{defaultValue:b.value}),[n,d]=(0,y.Z)("v0/metrics/dataInterval",{defaultValue:b.interval}),x=function(e){let[t,n]=(0,i.useState)(new Date().getTime());return(0,i.useEffect)(()=>{n(new Date().getTime());let t=(0,o.ytg)(1),r=Math.min((0,h.uQ)(e),t),i=setInterval(()=>{n(new Date().getTime())},r);return()=>clearInterval(i)},[e]),t}(n),w=(0,i.useMemo)(()=>(0,o.OQF)(e,x),[e,x]),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),b=m(n.getMinutes(),2),x=m(n.getSeconds(),2),w=""===o?"":"T",E=[y,b,x].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]),O=(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]),_=(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:O,contracts:C,storage:M,pricing:_,bandwidth:T}}();return(0,r.jsx)(x.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(6645);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:"weekly",value:"365"},{label:"ALL",interval:"monthly",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(6645),o=n(27444),a=n(2784),s=n(30078),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]),b=r.error,x=(0,i.c2j)(m,r.isValidating,b,f);return{balances:y,metrics:g,dataset:m,error:b,dataState:x,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(6645),o=n(27444),a=n(2784);let s=["actions","path","storage","available","readOnly","successfulReads","successfulWrites","failedReads","failedWrites"];var l=n(89528),u=n(25205),c=n(30078);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)}}}),b=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}),x=(0,a.useMemo)(()=>h.filter(e=>t.includes(e.id)),[t]),w=y.isValidating,E=y.error,j=(0,i.c2j)(b,w,E,[]);return{dataState:j,totalCount:(null==b?void 0:b.length)||0,isLoading:y.isValidating,columns:x,dataset:b,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(6645),o=n(92838),a=n(7114),s=n(24511),l=n(30078);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(6645),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(1e6)}let c="/million";function d(e){return new(o())(e).times(1e6)}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(6645),o=n(92838),a=n(5187),s=n(30078),l=n(78743),u=n(10842),c=n(89528),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 b(){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,b]=(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,O=null===(e=a.data)||void 0===e?void 0:e.acceptingContracts,_=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:()=>b(!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)(x,{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)(x,{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)(x,{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:O?(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)(x,{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:_?(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:()=>b(!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 x(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)(b,{}),t]})})})})})})}var j=n(65466),k=n.n(j),S=n(87492),O=n.n(S),_=n(82851);let C=(0,_.cx)(k().variable,O().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})})})}},6645:function(e,t,n){"use strict";let r,i,o,a;n.d(t,{hcY:function(){return _1},tU3:function(){return _X},zXq:function(){return Ch},juT:function(){return _j},Cts:function(){return lF},Z58:function(){return C$},WVB:function(){return cQ},zxk:function(){return lw},b0u:function(){return kY},EKh:function(){return lI},vRO:function(){return ME},QHy:function(){return Mc},TaT:function(){return C6},eQh:function(){return lH},HfT:function(){return Mh},ncR:function(){return _n},A06:function(){return CQ},Vy9:function(){return CJ},VqE:function(){return ux},h_2:function(){return c4},Xiv:function(){return c3},Juw:function(){return c5},KpP:function(){return c6},XOF:function(){return _t},jIp:function(){return Mj},QBj:function(){return Mk},yEL:function(){return Ci},cB7:function(){return _l},ZqQ:function(){return _s},IKw:function(){return _p},WN2:function(){return MU},X6q:function(){return de},Yqd:function(){return fq},__J:function(){return dl},rUS:function(){return dd},TRl:function(){return dh},kFS:function(){return cJ},FzK:function(){return Ms},Clw:function(){return cX},PD$:function(){return MA},Wxm:function(){return fK},uDJ:function(){return _v},wFK:function(){return _g},s_4:function(){return nd},nvN:function(){return nu},u5Q:function(){return CY},j4H:function(){return f$},J2e:function(){return dD},kod:function(){return dG},xrM:function(){return ug},PhF:function(){return fG},Z0O:function(){return cq},DLL:function(){return CZ},KJW:function(){return _O},rsf:function(){return hn},D_D:function(){return C_},iA_:function(){return _m},t6k:function(){return Mp},xvT:function(){return nl},nvn:function(){return ff},ua7:function(){return lb},mPE:function(){return CC},XxW:function(){return OT},m2c:function(){return OF},ho9:function(){return OZ},QUh:function(){return CV},weF:function(){return Cj},YNn:function(){return CT},DmW:function(){return CP},O9T:function(){return gV},fVJ:function(){return CU},vQq:function(){return Ox},NrH:function(){return kH},Y_Z:function(){return Cz},EJC:function(){return MW},kOJ:function(){return CH},OQF:function(){return CI},leQ:function(){return OS},ytg:function(){return kB},Vkc:function(){return cY},sWj:function(){return kI},S5N:function(){return AA},z$:function(){return nc},XBW:function(){return kU},x9T:function(){return MB},bjP:function(){return MH},I13:function(){return Oj},cEb:function(){return fd},OHV:function(){return Og},OPV:function(){return Ov},$Gg:function(){return OE},Y97:function(){return _K},c2j:function(){return _Q},mYE:function(){return MO},u$d:function(){return M_},Z4p:function(){return MS},WsO:function(){return Cr},Uu5:function(){return MI},oy6:function(){return Mz},nNd:function(){return CN}});var s,l,u,c,d,f,h,p,m,v,g,y,b,x,w,E,j,k,S,O,_,C,M,A,T,P,N,R,D,L,Z,F,V,z,I,B,H,U={};n.r(U),n.d(U,{useDropzone:function(){return mx}});var W=n(52322),q=n(2784),$=n.t(q,2),Y=n(7896),G=n(34540),K=n(26215),X=n(99575);function Q(e){let t=e+"CollectionProvider",[n,r]=(0,G.b)(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=q.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(a,n),s=(0,K.e)(t,i.collectionRef);return q.createElement(X.g7,{ref:s},r)}),l=e+"CollectionItemSlot",u="data-radix-collection-item",c=q.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=q.useRef(null),s=(0,K.e)(t,a),c=o(l,n);return q.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>void c.itemMap.delete(a))),q.createElement(X.g7,{[u]:"",ref:s},r)});return[{Provider:e=>{let{scope:t,children:n}=e,r=q.useRef(null),o=q.useRef(new Map).current;return q.createElement(i,{scope:t,itemMap:o,collectionRef:r},n)},Slot:s,ItemSlot:c},function(t){let n=o(e+"CollectionConsumer",t),r=q.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 J=n(41816),ee=n(73597),et=n(72130),en=n(64680),er=n(28245),ei=n(26074);let eo="Collapsible",[ea,es]=(0,G.b)(eo),[el,eu]=ea(eo),ec=((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l=!1,u]=(0,ee.T)({prop:r,defaultProp:i,onChange:a});return(0,q.createElement)(el,{scope:n,disabled:o,contentId:(0,ei.M)(),open:l,onOpenToggle:(0,q.useCallback)(()=>u(e=>!e),[u])},(0,q.createElement)(et.WV.div,(0,Y.Z)({"data-state":ef(l),"data-disabled":o?"":void 0},s,{ref:t})))},"CollapsibleContent"),ed=((e,t)=>{let{forceMount:n,...r}=e,i=eu(ec,e.__scopeCollapsible);return(0,q.createElement)(er.z,{present:n||i.open},({present:e})=>(0,q.createElement)(ed,(0,Y.Z)({},r,{ref:t,present:e})))},(0,q.forwardRef)((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...o}=e,a=eu(ec,n),[s,l]=(0,q.useState)(r),u=(0,q.useRef)(null),c=(0,K.e)(t,u),d=(0,q.useRef)(0),f=d.current,h=(0,q.useRef)(0),p=h.current,m=a.open||s,v=(0,q.useRef)(m),g=(0,q.useRef)();return(0,q.useEffect)(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,en.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,q.createElement)(et.WV.div,(0,Y.Z)({"data-state":ef(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 ef(e){return e?"open":"closed"}let eh="Accordion",ep=["Home","End","ArrowDown","ArrowUp"],[em,ev,eg]=Q(eh),[ey,eb]=(0,G.b)(eh,[eg,es]),ex=(es(),q.forwardRef((e,t)=>{let{type:n,...r}=e;return q.createElement(em.Provider,{scope:e.__scopeAccordion},"multiple"===n?q.createElement(eO,(0,Y.Z)({},r,{ref:t})):q.createElement(eS,(0,Y.Z)({},r,{ref:t})))}));ex.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[ew,eE]=ey(eh),[ej,ek]=ey(eh,{collapsible:!1}),eS=q.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...a}=e,[s,l]=(0,ee.T)({prop:n,defaultProp:r,onChange:i});return q.createElement(ew,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:q.useCallback(()=>o&&l(""),[o,l])},q.createElement(ej,{scope:e.__scopeAccordion,collapsible:o},q.createElement(eM,(0,Y.Z)({},a,{ref:t}))))}),eO=q.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[a=[],s]=(0,ee.T)({prop:n,defaultProp:r,onChange:i}),l=q.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=q.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return q.createElement(ew,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:u},q.createElement(ej,{scope:e.__scopeAccordion,collapsible:!0},q.createElement(eM,(0,Y.Z)({},o,{ref:t}))))}),[e_,eC]=ey(eh),eM=q.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,...i}=e,o=q.useRef(null),a=(0,K.e)(o,t),s=ev(n),l=(0,J.M)(e.onKeyDown,e=>{var t;if(!ep.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 q.createElement(e_,{scope:n,disabled:r},q.createElement(em.Slot,{scope:n},q.createElement(et.WV.div,(0,Y.Z)({},i,{ref:a,onKeyDown:r?void 0:l}))))}),[eA,eT]=ey("AccordionItem");var eP=n(82851),eN=n(83317);function eR(e){return e.split("-")[0]}function eD(e){return e.split("-")[1]}function eL(e){return["top","bottom"].includes(eR(e))?"x":"y"}function eZ(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=eL(t),u=eZ(l),c=i[u]/2-o[u]/2,d="x"===l;switch(eR(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(eD(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}let eV=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=ez(r),c={x:i,y:o},d=eL(a),f=eD(a),h=eZ(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],b=await (null==l.getOffsetParent?void 0:l.getOffsetParent(n)),x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[h]);let w=u[m],E=x-p[h]-u[v],j=x/2-p[h]/2+(g/2-y/2),k=eU(w,eH(j,E)),S=("start"===f?u[m]:u[v])>0&&j!==k&&s.reference[h]<=s.floating[h];return{[d]:c[d]-(S?jeq[e])}let eY={start:"end",end:"start"};function eG(e){return e.replace(/start|end/g,e=>eY[e])}let eK=["top","right","bottom","left"];eK.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let eX=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=eR(a),b=p||(y!==u&&v?function(e){let t=e$(e);return[eG(e),t,eG(t)]}(u):[e$(u)]),x=[u,...b],w=await eB(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=eD(e),i=eL(e),o=eZ(i),a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=e$(a)),{main:a,cross:e$(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=x[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 eQ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eJ(e){return eK.some(t=>e[t]>=0)}let e0=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=eQ(await eB(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:eJ(t)}}}case"escaped":{let t=eQ(await eB(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:eJ(t)}}}default:return{}}}}},e1=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=eR(n),s=eD(n),l="x"===eL(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 e2(e){return"x"===e?"y":"x"}let e4=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 eB(t,l),d=eL(eR(i)),f=e2(d),h=u[d],p=u[f];if(o){let e="y"===d?"bottom":"right";h=eU(h+c["y"===d?"top":"left"],eH(h,h-c[e]))}a&&(p=eU(p+c["y"===f?"top":"left"],eH(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}}}}},e3=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=eL(i),f=e2(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,b,x;let e="y"===d?"width":"height",t=["top","left"].includes(eR(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!=(b=null==(x=a.offset)?void 0:x[f])?b:0)-(t?v.crossAxis:0);pr&&(p=r)}return{[d]:h,[f]:p}}}};function e5(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function e6(e){if(null==e)return window;if(!e5(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function e8(e){return e6(e).getComputedStyle(e)}function e7(e){return e5(e)?"":e?(e.nodeName||"").toLowerCase():""}function e9(){let e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function te(e){return e instanceof e6(e).HTMLElement}function tt(e){return e instanceof e6(e).Element}function tn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof e6(e).ShadowRoot||e instanceof ShadowRoot)}function tr(e){let{overflow:t,overflowX:n,overflowY:r}=e8(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ti(e){let t=/firefox/i.test(e9()),n=e8(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 to(){return!/^((?!chrome|android).)*safari/i.test(e9())}let ta=Math.min,ts=Math.max,tl=Math.round;function tu(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&&te(e)&&(l=e.offsetWidth>0&&tl(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&tl(s.height)/e.offsetHeight||1);let c=tt(e)?e6(e):window,d=!to()&&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 tc(e){return((e instanceof e6(e).Node?e.ownerDocument:e.document)||window.document).documentElement}function td(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function tf(e){return tu(tc(e)).left+td(e).scrollLeft}function th(e){return"html"===e7(e)?e:e.assignedSlot||e.parentNode||(tn(e)?e.host:null)||tc(e)}function tp(e){return te(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function tm(e){let t=e6(e),n=tp(e);for(;n&&["table","td","th"].includes(e7(n))&&"static"===getComputedStyle(n).position;)n=tp(n);return n&&("html"===e7(n)||"body"===e7(n)&&"static"===getComputedStyle(n).position&&!ti(n))?t:n||function(e){let t=th(e);for(tn(t)&&(t=t.host);te(t)&&!["html","body"].includes(e7(t));){if(ti(t))return t;t=t.parentNode}return null}(e)||t}function tv(e){if(te(e))return{width:e.offsetWidth,height:e.offsetHeight};let t=tu(e);return{width:t.width,height:t.height}}function tg(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=th(t);return["html","body","#document"].includes(e7(n))?t.ownerDocument.body:te(n)&&tr(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=e6(r),a=i?[o].concat(o.visualViewport||[],tr(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(tg(a))}function ty(e,t,n){return"viewport"===t?eI(function(e,t){let n=e6(e),r=tc(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;let e=to();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n)):tt(t)?function(e,t){let n=tu(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):eI(function(e){var t;let n=tc(e),r=td(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ts(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ts(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+tf(e),l=-r.scrollTop;return"rtl"===e8(i||n).direction&&(s+=ts(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(tc(e)))}let tb={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?function(e){let t=tg(e),n=["absolute","fixed"].includes(e8(e).position)&&te(e)?tm(e):e;return tt(n)?t.filter(e=>tt(e)&&function(e,t){let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&tn(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==e7(e)):[]}(t):[].concat(n),r],a=o[0],s=o.reduce((e,n)=>{let r=ty(t,n,i);return e.top=ts(r.top,e.top),e.right=ta(r.right,e.right),e.bottom=ta(r.bottom,e.bottom),e.left=ts(r.left,e.left),e},ty(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=te(n),o=tc(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==e7(n)||tr(o))&&(a=td(n)),te(n))){let e=tu(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:tt,getDimensions:tv,getOffsetParent:tm,getDocumentElement:tc,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:function(e,t,n){let r=te(t),i=tc(t),o=tu(e,r&&function(e){let t=tu(e);return tl(t.width)!==e.offsetWidth||tl(t.height)!==e.offsetHeight}(t),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n){if(("body"!==e7(t)||tr(i))&&(a=td(t)),te(t)){let e=tu(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=tf(i))}return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}(t,tm(n),r),floating:{...tv(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===e8(e).direction};function tx(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?[...tt(e)?tg(e):[],...tg(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}),tt(e)&&!s&&f.observe(e),f.observe(t)}let h=s?tu(e):null;return s&&function t(){let r=tu(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 tw=(e,t,n)=>eV(e,t,{platform:tb,...n});var tE=n(28316),tj="undefined"!=typeof document?q.useLayoutEffect:q.useEffect;function tk(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=void 0===e?{}:e,o=q.useRef(null),a=q.useRef(null),s=function(e){let t=q.useRef(e);return tj(()=>{t.current=e}),t}(i),l=q.useRef(null),[u,c]=q.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[d,f]=q.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=q.useCallback(()=>{o.current&&a.current&&tw(o.current,a.current,{middleware:d,placement:n,strategy:r}).then(e=>{p.current&&tE.flushSync(()=>{c(e)})})},[d,n,r]);tj(()=>{p.current&&h()},[h]);let p=q.useRef(!1);tj(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=q.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=q.useCallback(e=>{o.current=e,m()},[m]),g=q.useCallback(e=>{a.current=e,m()},[m]),y=q.useMemo(()=>({reference:o,floating:a}),[]);return q.useMemo(()=>({...u,update:h,refs:y,reference:v,floating:g}),[u,h,y,v,g])}let tS=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 eW({element:t.current,padding:n}).fn(e)}else if(t)return eW({element:t,padding:n}).fn(e);return{}}}},tO=(0,q.forwardRef)((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,q.createElement)(et.WV.svg,(0,Y.Z)({},o,{ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,q.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function t_(e){let[t,n]=(0,q.useState)(void 0);return(0,en.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 tC="Popper",[tM,tA]=(0,G.b)(tC),[tT,tP]=tM(tC),tN=(0,q.forwardRef)((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,o=tP("PopperAnchor",n),a=(0,q.useRef)(null),s=(0,K.e)(t,a);return(0,q.useEffect)(()=>{o.onAnchorChange((null==r?void 0:r.current)||a.current)}),r?null:(0,q.createElement)(et.WV.div,(0,Y.Z)({},i,{ref:s}))}),tR="PopperContent",[tD,tL]=tM(tR),[tZ,tF]=tM(tR,{hasParent:!1,positionUpdateFns:new Set}),tV=(0,q.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:b=!1,avoidCollisions:x=!0,...w}=e,E=tP(tR,c),[j,k]=(0,q.useState)(null),S=(0,K.e)(t,e=>k(e)),[O,_]=(0,q.useState)(null),C=t_(O),M=null!==(n=null==C?void 0:C.width)&&void 0!==n?n:0,A=null!==(r=null==C?void 0:C.height)&&void 0!==r?r:0,T="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(v)?v:[v],N=P.length>0,R={padding:T,boundary:P.filter(tH),altBoundary:N},{reference:D,floating:L,strategy:Z,x:F,y:V,placement:z,middlewareData:I,update:B}=tk({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:tx,middleware:[e1({mainAxis:f+A,alignmentAxis:p}),x?e4({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?e3():void 0,...R}):void 0,O?tS({element:O,padding:m}):void 0,x?eX({...R}):void 0,tU({arrowWidth:M,arrowHeight:A}),b?e0({strategy:"referenceHidden"}):void 0].filter(tB)});(0,en.b)(()=>{D(E.anchor)},[D,E.anchor]);let H=null!==F&&null!==V,[U,W]=tW(z),$=null===(i=I.arrow)||void 0===i?void 0:i.x,Y=null===(o=I.arrow)||void 0===o?void 0:o.y,G=(null===(a=I.arrow)||void 0===a?void 0:a.centerOffset)!==0,[X,Q]=(0,q.useState)();(0,en.b)(()=>{j&&Q(window.getComputedStyle(j).zIndex)},[j]);let{hasParent:J,positionUpdateFns:ee}=tF(tR,c),er=!J;(0,q.useLayoutEffect)(()=>{if(!er)return ee.add(B),()=>{ee.delete(B)}},[er,ee,B]),(0,q.useLayoutEffect)(()=>{er&&H&&Array.from(ee).reverse().forEach(e=>requestAnimationFrame(e))},[er,H,ee]);let ei={"data-side":U,"data-align":W,...w,ref:S,style:{...w.style,animation:H?void 0:"none",opacity:null!==(s=I.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return(0,q.createElement)("div",{ref:L,"data-radix-popper-content-wrapper":"",style:{position:Z,left:0,top:0,transform:H?`translate3d(${Math.round(F)}px, ${Math.round(V)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[null===(l=I.transformOrigin)||void 0===l?void 0:l.x,null===(u=I.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},(0,q.createElement)(tD,{scope:c,placedSide:U,onArrowChange:_,arrowX:$,arrowY:Y,shouldHideArrow:G},er?(0,q.createElement)(tZ,{scope:c,hasParent:!0,positionUpdateFns:ee},(0,q.createElement)(et.WV.div,ei)):(0,q.createElement)(et.WV.div,ei)))}),tz={top:"bottom",right:"left",bottom:"top",left:"right"},tI=(0,q.forwardRef)(function(e,t){let{__scopePopper:n,...r}=e,i=tL("PopperArrow",n),o=tz[i.placedSide];return(0,q.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,q.createElement)(tO,(0,Y.Z)({},r,{ref:t,style:{...r.style,display:"block"}})))});function tB(e){return void 0!==e}function tH(e){return null!==e}let tU=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]=tW(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="",b="";return"bottom"===h?(y=c?m:`${v}px`,b=`${-f}px`):"top"===h?(y=c?m:`${v}px`,b=`${l.floating.height+f}px`):"right"===h?(y=`${-f}px`,b=c?m:`${g}px`):"left"===h&&(y=`${l.floating.width+f}px`,b=c?m:`${g}px`),{data:{x:y,y:b}}}});function tW(e){let[t,n="center"]=e.split("-");return[t,n]}let tq=e=>{let{__scopePopper:t,children:n}=e,[r,i]=(0,q.useState)(null);return(0,q.createElement)(tT,{scope:t,anchor:r,onAnchorChange:i},n)};var t$=n(6500);let tY=(0,q.forwardRef)((e,t)=>(0,q.createElement)(et.WV.span,(0,Y.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}}))),[tG,tK]=(0,G.b)("Tooltip",[tA]),tX=tA(),tQ="tooltip.open",[tJ,t0]=tG("TooltipProvider"),t1="Tooltip",[t2,t4]=tG(t1),t3="TooltipTrigger",t5=(0,q.forwardRef)((e,t)=>{let{__scopeTooltip:n,...r}=e,i=t4(t3,n),o=t0(t3,n),a=tX(n),s=(0,q.useRef)(null),l=(0,K.e)(t,s,i.onTriggerChange),u=(0,q.useRef)(!1),c=(0,q.useRef)(!1),d=(0,q.useCallback)(()=>u.current=!1,[]);return(0,q.useEffect)(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,q.createElement)(tN,(0,Y.Z)({asChild:!0},a),(0,q.createElement)(et.WV.button,(0,Y.Z)({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:(0,J.M)(e.onPointerMove,e=>{"touch"===e.pointerType||c.current||o.isPointerInTransitRef.current||(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:(0,J.M)(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:(0,J.M)(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:(0,J.M)(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:(0,J.M)(e.onBlur,i.onClose),onClick:(0,J.M)(e.onClick,e=>{let t=0===e.detail;t&&i.onClose()})})))}),t6="TooltipPortal",[t8,t7]=tG(t6,{forceMount:void 0}),t9="TooltipContent",ne=(0,q.forwardRef)((e,t)=>{let n=t7(t9,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=t4(t9,e.__scopeTooltip);return(0,q.createElement)(er.z,{present:r||a.open},a.disableHoverableContent?(0,q.createElement)(ni,(0,Y.Z)({side:i},o,{ref:t})):(0,q.createElement)(nt,(0,Y.Z)({side:i},o,{ref:t})))}),nt=(0,q.forwardRef)((e,t)=>{let n=t4(t9,e.__scopeTooltip),r=t0(t9,e.__scopeTooltip),i=(0,q.useRef)(null),o=(0,K.e)(t,i),[a,s]=(0,q.useState)(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=(0,q.useCallback)(()=>{s(null),d(!1)},[d]),h=(0,q.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,q.useEffect)(()=>()=>f(),[f]),(0,q.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,q.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,q.createElement)(ni,(0,Y.Z)({},e,{ref:o}))}),[nn,nr]=tG(t1,{isInside:!1}),ni=(0,q.forwardRef)((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=t4(t9,n),u=tX(n),{onClose:c}=l;return(0,q.useEffect)(()=>(document.addEventListener(tQ,c),()=>document.removeEventListener(tQ,c)),[c]),(0,q.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,q.createElement)(eN.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:c},(0,q.createElement)(tV,(0,Y.Z)({"data-state":l.stateAttribute},u,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,q.createElement)(X.A4,null,r),(0,q.createElement)(nn,{scope:n,isInside:!0},(0,q.createElement)(tY,{id:l.contentId,role:"tooltip"},i||r))))}),no=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=t0(t1,e.__scopeTooltip),u=tX(t),[c,d]=(0,q.useState)(null),f=(0,ei.M)(),h=(0,q.useRef)(0),p=null!=a?a:l.disableHoverableContent,m=null!=s?s:l.delayDuration,v=(0,q.useRef)(!1),[g=!1,y]=(0,ee.T)({prop:r,defaultProp:i,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(tQ))):l.onClose(),null==o||o(e)}}),b=(0,q.useMemo)(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),x=(0,q.useCallback)(()=>{window.clearTimeout(h.current),v.current=!1,y(!0)},[y]),w=(0,q.useCallback)(()=>{window.clearTimeout(h.current),y(!1)},[y]),E=(0,q.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,y(!0)},m)},[m,y]);return(0,q.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,q.createElement)(tq,u,(0,q.createElement)(t2,{scope:t,contentId:f,open:g,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:(0,q.useCallback)(()=>{l.isOpenDelayed?E():x()},[l.isOpenDelayed,E,x]),onTriggerLeave:(0,q.useCallback)(()=>{p?w():window.clearTimeout(h.current)},[w,p]),onOpen:x,onClose:w,disableHoverableContent:p},n))},na=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=t4(t6,t);return(0,q.createElement)(t8,{scope:t,forceMount:n},(0,q.createElement)(er.z,{present:n||o.open},(0,q.createElement)(t$.h,{asChild:!0,container:i},r)))},ns=(0,eP.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"}}),nl=q.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,W.jsx)(n,{ref:t,className:(0,eP.cx)(r,ns({font:i,color:o,weight:a,size:s,scaleSize:l,underline:c,noWrap:u,ellipsis:d,wrapEllipsis:f})),...h})}),nu=q.forwardRef((e,t)=>{let{size:n="18",...r}=e;return(0,W.jsx)(nl,{tag:"p",...r,ref:t,weight:"regular",scaleSize:n,color:"subtle",className:(0,eP.cx)("leading-relaxed md:leading-relaxed",e.className)})}),nc=(0,eP.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"]),nd=q.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,W.jsx)("div",{ref:t,className:nc({className:n}),...r})});var nf=n(34406);let nh=(void 0===nf||nf.env,"production"),np=1/60*1e3,nm="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),nv="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(nm()),np),ng=!0,ny=!1,nb=!1,nx={delta:0,timestamp:0},nw=["read","update","preRender","render","postRender"],nE=nw.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;nny=!0),e),{}),nj=nw.reduce((e,t)=>{let n=nE[t];return e[t]=(e,t=!1,r=!1)=>(ny||nC(),n.schedule(e,t,r)),e},{}),nk=nw.reduce((e,t)=>(e[t]=nE[t].cancel,e),{}),nS=nw.reduce((e,t)=>(e[t]=()=>nE[t].process(nx),e),{}),nO=e=>nE[e].process(nx),n_=e=>{ny=!1,nx.delta=ng?np:Math.max(Math.min(e-nx.timestamp,40),1),nx.timestamp=e,nb=!0,nw.forEach(nO),nb=!1,ny&&(ng=!1,nv(n_))},nC=()=>{ny=!0,ng=!0,nb||nv(n_)},nM=()=>nx,nA="undefined"!=typeof document,nT=nA?q.useLayoutEffect:q.useEffect;function nP(){let e=(0,q.useRef)(!1);return nT(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let nN=(0,q.createContext)(null);function nR(e){let t=(0,q.useRef)(null);return null===t.current&&(t.current=e()),t.current}class nD extends q.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 nL({children:e,isPresent:t}){let n=(0,q.useId)(),r=(0,q.useRef)(null),i=(0,q.useRef)({width:0,height:0,top:0,left:0});return(0,q.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(`
+ */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case o:case s:case a:case h:return e;default:switch(e=e&&e.$$typeof){case u:case f:case v:case m:case l:return e;default:return t}}case i:return t}}}function E(e){return w(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=h,t.isAsyncMode=function(e){return E(e)||w(e)===c},t.isConcurrentMode=E,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===f},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===v},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===a||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===g)},t.typeOf=w},73887:function(e,t,n){"use strict";e.exports=n(43459)},62333:function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a+=Math.pow(2,r),o-=u}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<>1,f=23===i?5960464477539062e-23:0,h=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*l-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*m}},39515:function(e,t,n){var r=n(38761)(n(37772),"DataView");e.exports=r},89612:function(e,t,n){var r=n(52118),i=n(96909),o=n(98138),a=n(4174),s=n(7942);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ti?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=i?e:r(e,t,n)}},24019:function(e,t,n){var r=n(37772)["__core-js_shared__"];e.exports=r},55463:function(e){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},83126:function(e,t,n){var r=n(23895),i=n(33880),o=n(8435),a=n(66188);e.exports=function(e){return function(t){var n=i(t=a(t))?o(t):void 0,s=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return s[e]()+l}}},34311:function(e,t,n){var r=n(81207),i=n(97329),o=n(11618),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(o(i(t).replace(a,"")),e,"")}}},61655:function(e,t,n){var r=n(6435)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=r},83043:function(e,t,n){var r=n(38761),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},74871:function(e,t,n){var r=n(45386),i=n(87064),o=n(59950);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,m=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p-1&&e%1==0&&e-1}},94769:function(e,t,n){var r=n(22218);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},92411:function(e,t,n){var r=n(89612),i=n(80235),o=n(10326);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},36417:function(e,t,n){var r=n(27937);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},86928:function(e,t,n){var r=n(27937);e.exports=function(e){return r(this,e).get(e)}},18052:function(e,t,n){var r=n(27937);e.exports=function(e){return r(this,e).has(e)}},24150:function(e,t,n){var r=n(27937);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},75179:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},73477:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},77777:function(e,t,n){var r=n(30733);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},99191:function(e,t,n){var r=n(38761)(Object,"create");e.exports=r},54248:function(e,t,n){var r=n(60241)(Object.keys,Object);e.exports=r},4146:function(e,t,n){e=n.nmd(e);var r=n(51242),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},37157:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60241:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},37772:function(e,t,n){var r=n(51242),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},52842:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},52482:function(e){e.exports=function(e){return this.__data__.has(e)}},16909:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},15243:function(e,t,n){var r=n(80235);e.exports=function(){this.__data__=new r,this.size=0}},72858:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4417:function(e){e.exports=function(e){return this.__data__.get(e)}},8605:function(e){e.exports=function(e){return this.__data__.has(e)}},71418:function(e,t,n){var r=n(80235),i=n(10326),o=n(96738);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},8435:function(e,t,n){var r=n(50217),i=n(33880),o=n(63344);e.exports=function(e){return i(e)?o(e):r(e)}},54452:function(e,t,n){var r=n(77777),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)}),t});e.exports=a},33812:function(e,t,n){var r=n(4795),i=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},87035:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},52153:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},63344:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",i="[^"+t+"]",o="(?:\ud83c[\udde6-\uddff]){2}",a="[\ud800-\udbff][\udc00-\udfff]",s="(?:"+n+"|"+r+")?",l="[\\ufe0e\\ufe0f]?",u="(?:\\u200d(?:"+[i,o,a].join("|")+")"+l+s+")*",c=RegExp(r+"(?="+r+")|(?:"+[i+n+"?",n,o,a,"["+t+"]"].join("|")+")"+(l+s+u),"g");e.exports=function(e){return e.match(c)||[]}},75304:function(e){var t="\ud800-\udfff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",i="A-Z\\xc0-\\xd6\\xd8-\\xde",o="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",a="['’]",s="["+o+"]",l="["+r+"]",u="[^"+t+o+"\\d+"+n+r+i+"]",c="(?:\ud83c[\udde6-\uddff]){2}",d="[\ud800-\udbff][\udc00-\udfff]",f="["+i+"]",h="(?:"+l+"|"+u+")",p="(?:"+a+"(?:d|ll|m|re|s|t|ve))?",m="(?:"+a+"(?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",g="[\\ufe0e\\ufe0f]?",y="(?:\\u200d(?:"+["[^"+t+"]",c,d].join("|")+")"+g+v+")*",b="(?:"+["["+n+"]",c,d].join("|")+")"+(g+v+y),x=RegExp([f+"?"+l+"+"+p+"(?="+[s,f,"$"].join("|")+")","(?:"+f+"|"+u+")+"+m+"(?="+[s,f+h,"$"].join("|")+")",f+"?"+h+"+"+p,f+"+"+m,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",b].join("|"),"g");e.exports=function(e){return e.match(x)||[]}},96009:function(e,t,n){var r=n(82108),i=n(34311)(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=i},82108:function(e,t,n){var r=n(66188),i=n(23779);e.exports=function(e){return i(r(e).toLowerCase())}},54073:function(e,t,n){var r=n(29259),i=n(61100),o=n(7642),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,d,f,h,p=0,m=!1,v=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,p=t,d=e.apply(r,n)}function b(e){var n=e-h,r=e-p;return void 0===h||n>=t||n<0||v&&r>=c}function x(){var e,n,r,o=i();if(b(o))return w(o);f=setTimeout(x,(e=o-h,n=o-p,r=t-e,v?s(r,c-n):r))}function w(e){return(f=void 0,g&&l)?y(e):(l=u=void 0,d)}function E(){var e,n=i(),r=b(n);if(l=arguments,u=this,h=n,r){if(void 0===f)return p=e=h,f=setTimeout(x,t),m?y(e):d;if(v)return clearTimeout(f),f=setTimeout(x,t),y(h)}return void 0===f&&(f=setTimeout(x,t)),d}return t=o(t)||0,r(n)&&(m=!!n.leading,c=(v="maxWait"in n)?a(o(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),E.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=h=u=f=void 0},E.flush=function(){return void 0===f?d:w(i())},E}},97329:function(e,t,n){var r=n(61655),i=n(66188),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(a,"")}},41225:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},72579:function(e,t,n){var r=n(13324);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},93352:function(e,t,n){var r=n(32726),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},95041:function(e,t,n){var r=n(20187),i=n(1369);e.exports=function(e,t){return null!=e&&i(e,t,r)}},23059:function(e){e.exports=function(e){return e}},79631:function(e,t,n){var r=n(15183),i=n(15125),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},86152:function(e){var t=Array.isArray;e.exports=t},67878:function(e,t,n){var r=n(61049),i=n(61158);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},73226:function(e,t,n){e=n.nmd(e);var r=n(37772),i=n(36330),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=s?s.isBuffer:void 0;e.exports=l||i},61049:function(e,t,n){var r=n(53366),i=n(29259);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},61158:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},29259:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},15125:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4795:function(e,t,n){var r=n(53366),i=n(15125);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},77598:function(e,t,n){var r=n(35522),i=n(47826),o=n(4146),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},90249:function(e,t,n){var r=n(1634),i=n(86411),o=n(67878);e.exports=function(e){return o(e)?r(e):i(e)}},19950:function(e,t,n){var r=n(13940),i=n(26548),o=n(68286);e.exports=function(e,t){var n={};return t=o(t,3),i(e,function(e,i,o){r(n,t(e,i,o),e)}),n}},34519:function(e,t,n){var r=n(13940),i=n(26548),o=n(68286);e.exports=function(e,t){var n={};return t=o(t,3),i(e,function(e,i,o){r(n,i,t(e,i,o))}),n}},30733:function(e,t,n){var r=n(96738);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},61100:function(e,t,n){var r=n(37772);e.exports=function(){return r.Date.now()}},65798:function(e,t,n){var r=n(20256),i=n(82952),o=n(21401),a=n(33812);e.exports=function(e){return o(e)?r(a(e)):i(e)}},57370:function(e,t,n){var r=n(34311)(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});e.exports=r},30981:function(e){e.exports=function(){return[]}},36330:function(e){e.exports=function(){return!1}},7642:function(e,t,n){var r=n(51704),i=n(29259),o=n(4795),a=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return a;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?a:+e}},66188:function(e,t,n){var r=n(1054);e.exports=function(e){return null==e?"":r(e)}},23779:function(e,t,n){var r=n(83126)("toUpperCase");e.exports=r},11618:function(e,t,n){var r=n(45981),i=n(83559),o=n(66188),a=n(75304);e.exports=function(e,t,n){return(e=o(e),void 0===(t=n?void 0:t))?i(e)?a(e):r(e):e.match(t)||[]}},53207:function(e,t,n){var r=n(96570);r.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,o=0;o"+t.value+""+i[o].show+""+e.value+"",type:10}):r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+""+e.value+"",type:1})):2===i[o].type||9===i[o].type?(e=r.pop(),t=r.pop(),r.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+i[o].show+(1!=e.type?"(":"")+e.value+(1!=e.type?")":""),type:i[o].type})):12===i[o].type&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[o].show+"("+n.value+","+t.value+","+e.value+")",type:12}));return r[0].value},e.exports=r},66655:function(e,t,n){"use strict";var r=n(72346);function i(e,t){for(var n=0;np.length-2?p.length-1:e.length-l;n>0;n--)if(void 0!==p[n])for(i=0;i
0&&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:b})=>{let[x,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()},[]),O=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(l,e)}catch(e){}},[e]),_=(0,r.useCallback)(t=>{let r=v(t);j(r),"system"===x&&n&&!e&&S("system")},[x,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(o);return e.addListener(_),_(e),()=>e.removeListener(_)},[_]),(0,r.useEffect)(()=>{let e=e=>{e.key===l&&O(e.newValue||c)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[O]),(0,r.useEffect)(()=>{S(null!=e?e:x)},[e,x]);let C=(0,r.useMemo)(()=>({theme:x,setTheme:O,forcedTheme:e,resolvedTheme:"system"===x?E:x,themes:n?[...u,"system"]:u,systemTheme:n?E:void 0}),[x,O,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:b}),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(6645),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(30078),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},10842:function(e,t,n){"use strict";n.d(t,{iV:function(){return w},ZR:function(){return x}});var r=n(52322),i=n(2784),o=n(6645),a=n(25205),s=n(94977),l=n(6391),u=n.n(l);let c=[{value:"",label:"Off"},{value:"route53",label:"Route 53"},{value:"noip",label:"No-IP"},{value:"duckdns",label:"Duck DNS"},{value:"cloudflare",label:"Cloudflare"}],d={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:""};function f(e){let{settings:t}=e,n=null;return"duckdns"===t.ddns.provider&&(n={dnsDuckDnsToken:t.ddns.options.token}),"noip"===t.ddns.provider&&(n={dnsNoIpEmail:t.ddns.options.email,dnsNoIpPassword:t.ddns.options.password}),"route53"===t.ddns.provider&&(n={dnsAwsId:t.ddns.options.id,dnsAwsSecret:t.ddns.options.secret,dnsAwsZoneId:t.ddns.options.zoneID}),"cloudflare"===t.ddns.provider&&(n={dnsCloudflareToken:t.ddns.options.token,dnsCloudflareZoneId:t.ddns.options.zoneID}),{acceptingContracts:t.acceptingContracts,netAddress:t.netAddress,maxContractDuration:new(u())(t.maxContractDuration).div((0,a.S5)(1)),contractPrice:(0,a.ll)(t.contractPrice,6),baseRPCPrice:(0,a.ll)((0,s.sS)(t.baseRPCPrice),6),sectorAccessPrice:(0,a.ll)((0,s.nS)(t.sectorAccessPrice),6),collateralMultiplier:new(u())(t.collateralMultiplier),maxCollateral:(0,a.ll)(t.maxCollateral,6),storagePrice:(0,a.ll)((0,s.SY)(t.storagePrice),6),egressPrice:(0,a.ll)((0,s.B1)(t.egressPrice),6),ingressPrice:(0,a.ll)((0,s.dK)(t.ingressPrice),6),priceTableValidity:new(u())(t.priceTableValidity).div(1e9).div(60),maxRegistryEntries:new(u())(t.maxRegistryEntries),accountExpiry:new(u())(t.accountExpiry).div(1e9).div(86400),maxAccountBalance:(0,a.ll)(t.maxAccountBalance,6),ingressLimit:(0,a.BT)(new(u())(t.ingressLimit)),egressLimit:(0,a.BT)(new(u())(t.egressLimit)),dnsProvider:t.ddns.provider,dnsIpv4:t.ddns.ipv4,dnsIpv6:t.ddns.ipv6,...n}}function h(e,t){return new(u())(12960).times(e).div((0,a.S5)(1)).times(t)}var p=n(27444),m=n(63955);function v(e,t){return t?new(u())(new(u())(e).div(t.sc.usd).div(10).toFixed(0)).times(10):void 0}var g=n(92762),y=n(9455);let b=(0,i.createContext)({}),x=()=>(0,i.useContext)(b);function w(e){let{children:t}=e,n=function(){let{settings:e,dynDNSCheck:t}=function(){let e=(0,p.rV)({config:{swr:{refreshInterval:(0,o.sWj)(1)}}}),t=(0,p.uo)({disabled:!e.data||!e.data.ddns.provider,config:{swr:{revalidateOnFocus:!1,errorRetryCount:0}}});return{settings:e,dynDNSCheck:t}}(),{form:n,fields:l,setShowAdvanced:b,showAdvanced:x}=function(){let e=(0,m.cI)({mode:"all",defaultValues:d}),t=e.watch("storagePrice"),n=e.watch("collateralMultiplier"),[o,s]=(0,g.Z)("v0/config/showAdvanced",{defaultValue:!1}),l=(0,y.BW)(),f=(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(u())(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(u())(e).gte((0,a.E6)(4320))||"must be at least 1 month"}}},storagePrice:{title:"Storage price",type:"siacoin",category:"pricing",units:"SC/TB/month",decimalsLimitSc:6,suggestion:o?v(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?v(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?v(.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(u())(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(u())(.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(u())(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(u())(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(u())(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(u())(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(u())(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(u())(e).gte(7)||"must be at least 1 week"}}},maxAccountBalance:{title:"Maximum balance",type:"siacoin",category:"RHP3",suggestion:new(u())(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(u())(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:c,description:(0,r.jsx)(r.Fragment,{children:"Enable dynamic DNS with one of the supported providers."}),validation:{validate:e=>!!c.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:o,storageTBMonth:t,collateralMultiplier:n,rates:null===(e=l.data)||void 0===e?void 0:e.rates})},[o,t,n,l.data]);return{form:e,fields:f,storageTBMonth:t,collateralMultiplier:n,showAdvanced:o,setShowAdvanced:s}}(),w=(0,i.useMemo)(()=>({settings:{data:e.data,error:e.error}}),[e.data,e.error]),E=(0,i.useMemo)(()=>!function(e){let{settings:t}=e;return!!t.data}(w)?null:f({settings:w.settings.data}),[w]),j=(0,i.useMemo)(()=>(function(e){let{settings:t}=e;return!!t.error})(w),[w]),k=(0,i.useCallback)(async()=>{let r=await e.mutate();if(r)return await t.mutate(),n.reset(f({settings:r}));(0,o.OHV)("Error fetching settings.")},[n,e,t]);(0,o.u$d)({form:n,remoteValues:E}),(0,o.Z4p)({form:n,remoteValues:E});let{changeCount:S}=(0,o.mYE)({form:n}),O=function(e){let{resources:t,showAdvanced:n,revalidateAndResetForm:r}=e,l=(0,p.Te)(),u=(0,p.On)({config:{swr:{refreshInterval:(0,o.sWj)(1)}}}),c=(0,i.useCallback)(async e=>{if(t)try{var i,c,d;let f;let p={};n||(p.maxCollateral=h(e.storagePrice,e.collateralMultiplier));let m={...e,...p},v=await l.patch({payload:(d=t.settings.data,f=null,"duckdns"===m.dnsProvider&&(f={token:m.dnsDuckDnsToken}),"noip"===m.dnsProvider&&(f={email:m.dnsNoIpEmail,password:m.dnsNoIpPassword}),"route53"===m.dnsProvider&&(f={id:m.dnsAwsId,secret:m.dnsAwsSecret,zoneID:m.dnsAwsZoneId}),"cloudflare"===m.dnsProvider&&(f={token:m.dnsCloudflareToken,zoneID:m.dnsCloudflareZoneId}),{...d,acceptingContracts:m.acceptingContracts,netAddress:m.netAddress,maxContractDuration:Number(m.maxContractDuration.times((0,a.S5)(1)).toFixed(0)),contractPrice:(0,a.qN)(m.contractPrice).toString(),baseRPCPrice:m.baseRPCPrice.div((0,a.ll)((0,s.sS)(1))).toFixed(0),sectorAccessPrice:m.sectorAccessPrice.div((0,a.ll)((0,s.nS)(1))).toFixed(0),collateralMultiplier:m.collateralMultiplier.toNumber(),maxCollateral:(0,a.qN)(m.maxCollateral).toString(),storagePrice:m.storagePrice.div((0,a.ll)((0,s.SY)(1))).toFixed(0),egressPrice:m.egressPrice.div((0,a.ll)((0,s.B1)(1))).toFixed(0),ingressPrice:m.ingressPrice.div((0,a.ll)((0,s.dK)(1))).toFixed(0),priceTableValidity:Number(m.priceTableValidity.times(60).times(1e9).toFixed(0)),maxRegistryEntries:Number(m.maxRegistryEntries.toFixed(0)),accountExpiry:Number(m.accountExpiry.times(86400).times(1e9).toFixed(0)),maxAccountBalance:(0,a.qN)(m.maxAccountBalance).toString(),ingressLimit:Number((0,a.Y)(m.ingressLimit).toFixed(0)),egressLimit:Number((0,a.Y)(m.egressLimit).toFixed(0)),ddns:{...null==d?void 0:d.ddns,provider:m.dnsProvider,ipv4:m.dnsIpv4,ipv6:m.dnsIpv6,options:f}})});if(v.error)throw Error(v.error);let g=(null===(c=u.data)||void 0===c?void 0:null===(i=c.lastAnnouncement)||void 0===i?void 0:i.address)!==e.netAddress;g?(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 r()}catch(e){(0,o.OHV)(e.message),console.log(e)}},[n,t,l,r,u.data]);return c}({resources:w,showAdvanced:x,revalidateAndResetForm:k}),_=(0,o.WsO)(l),C=(0,i.useMemo)(()=>n.handleSubmit(O,_),[n,O,_]),M=(0,i.useRef)(),A=(0,i.useCallback)(async e=>{(0,o.S5N)(M.current,e)},[]);return{fields:l,settings:e,dynDNSCheck:t,changeCount:S,revalidateAndResetForm:k,form:n,onSubmit:C,showAdvanced:x,setShowAdvanced:b,remoteError:j,takeScreenshot:A,configRef:M}}();return(0,r.jsx)(b.Provider,{value:n,children:t})}},92838:function(e,t,n){"use strict";n.d(t,{x:function(){return x},G:function(){return b}});var r=n(52322),i=n(6645),o=n(5632),a=n(27444),s=n(2784),l=n(56860),u=n(89528),c=n(25205),d=n(30078);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)({}),b=()=>(0,s.useContext)(y);function x(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:b,enabledColumns:x,sortableColumns:w,toggleColumnVisibility:E,setColumnsVisible:j,setColumnsHidden:k,toggleSort:S,setSortDirection:O,setSortField:_,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=>x.includes(e.id)),[x]),R=T.isValidating,D=T.error,L=(0,i.c2j)(P,R,D,c),{estimatedBlockHeight:Z,isSynced:F,nodeBlockHeight:V}=(0,v.n)(),z=F?V:Z,{range:I}=(0,s.useMemo)(()=>(0,i.EJC)(z,P||[]),[z,P]),B=(0,g.B)(),H=(0,s.useMemo)(()=>({contractsTimeRange:I,currentHeight:z,siascanUrl:B}),[I,z,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:b,enabledColumns:x,sortableColumns:w,toggleColumnVisibility:E,setColumnsVisible:j,setColumnsHidden:k,toggleSort:S,setSortDirection:O,setSortField:_,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"},30078:function(e,t,n){"use strict";n.d(t,{Tu:function(){return eS},xQ:function(){return eO},Rh:function(){return ek}});var r=n(52322),i=n(2784),o=n(6645),a=n(27444),s=n(25205),l=n(6391),u=n.n(l),c=n(63955);function d(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)},b=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)}},x=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(b,t),p?e(o.current):c.current;if(v)return n(b,t),e(o.current)}return s.current||n(b,t),c.current};return x.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,l.current=o.current=u.current=s.current=null},x.isPending=function(){return!!s.current},x.flush=function(){return s.current?y(Date.now()):c.current},x},[p,v,t,g,m,h])}function f(e,t){return e===t}function h(e){return"function"==typeof e?function(){return e}:e}var p=n(99182),m=n(4941),v=n(89528);function g(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)(v.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 y(){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 b=n(79200),x=n(81441),w=n(81721),E=function(e,t){for(var n=e.length;n--&&(0,w.Z)(t,e[n],0)>-1;);return n},j=n(36202),k=n(25186),S=n(37602),O=function(e,t,n){if((e=(0,k.Z)(e))&&(n||void 0===t))return e.slice(0,(0,S.Z)(e)+1);if(!e||!(t=(0,b.Z)(t)))return e;var r=(0,j.Z)(e),i=E(r,(0,j.Z)(t))+1;return(0,x.Z)(r,0,i).join("")},_=n(78807),C=function(e,t){for(var n=-1,r=e.length;++n-1;);return n},M=function(e,t,n){if((e=(0,k.Z)(e))&&(n||void 0===t))return(0,_.Z)(e);if(!e||!(t=(0,b.Z)(t)))return e;var r=(0,j.Z)(e),i=(0,j.Z)(t),o=C(r,i),a=E(r,i)+1;return(0,x.Z)(r,o,a).join("")};function A(e){let{currentPath:t,childPath:n,separator:r}=e;return"\\"===t&&n.endsWith(":")?n+r:T(t,n,r)}function T(e,t,n){e=e===n?e:O(e,n),t=M(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 P(){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)(v.Qbr,{})}),(0,r.jsx)(o.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:"Error loading directory."})]})}function N(e){let{path:t,onCreate:n}=e,s=y(),l=(0,a.Kw)(),[u,c]=(0,i.useState)(""),d=(0,i.useCallback)(async()=>{let e=await l.put({payload:{path:A({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)(v.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 R(e){let{path:t,setPath:n,commandPage:i,currentPage:a,beforeSelect:s,afterSelect:l}=e,u=y();return(0,r.jsx)(m.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)(v.ROc,{size:16})}),(0,r.jsx)(o.xvT,{ellipsis:!0,children:".."})]})},"..")}let D={namespace:"volumes/directorySelect",label:"Directory select"};function L(e){var t,n,i,a,s,l,u;let{path:c,dir:d,setPath:f,currentPage:h,beforeSelect:b,afterSelect:x}=e,w=y(),E=(null===(t=d.data)||void 0===t?void 0:t.path)===w,j=(null===(n=d.data)||void 0===n?void 0:n.path)==="\\";return(0,r.jsxs)(m.fu,{currentPage:h,commandPage:D,children:[d.isValidating||!d.data||d.error?null:E?null:(0,r.jsx)(R,{path:d.data.path,setPath:f,currentPage:h,commandPage:D,afterSelect:x,beforeSelect:b}),(0,r.jsxs)(p.mY.Empty,{children:[!d.isValidating&&d.error?(0,r.jsx)(P,{}):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)(g,{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)(m.WD,{commandPage:D,currentPage:h,onSelect:()=>{b&&b();let t=A({currentPath:d.data.path,childPath:e,separator:w});f(t),x&&x()},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)(v.ROc,{size:16})}),(0,r.jsx)(o.xvT,{ellipsis:!0,children:e})]})},e)):null,!j&&!d.isValidating&&!d.error&&(0,r.jsx)(m.WD,{commandPage:D,currentPage:h,value:"create new directory",children:(0,r.jsx)(N,{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 Z(e){let{path:t,dir:n,onChange:i}=e;return(0,r.jsx)(p.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)(p.mY.List,{children:(0,r.jsx)(L,{path:t,dir:n,setPath:i,currentPage:D})})})})})}var F=n(82851);function V(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,F.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,F.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 z=new(u())(10),I={size:void 0,name:"",path:"~",immediatePath:"~"};function B(e){let{trigger:t,open:n,onOpenChange:l}=e,{closeDialog:f}=ek(),h=(0,a.HU)(),p=y(),m=(0,c.cI)({mode:"all",defaultValues:I}),v=m.watch("path"),g=m.watch("immediatePath"),b=m.watch("name"),x=m.watch("size"),w=d(()=>{v!==g&&m.setValue("path",g)},500);(0,i.useEffect)(()=>{w()},[g]),(0,i.useEffect)(()=>{v!==g&&m.setValue("immediatePath",v)},[v]);let E=(0,i.useCallback)(async e=>{let t=await h.post({payload:{localPath:T(v,b,p),maxSectors:(0,o.WN2)(e.size).toNumber()}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("New volume created."),m.reset(I),f())},[m,h,f,b,v,p]),j=(0,a.cM)({disabled:!n,params:{path:""===v?p:v},config:{swr:{shouldRetryOnError:!1}}});(0,i.useEffect)(()=>{j.error&&m.setError("immediatePath",{message:"Directory does not exist"})},[j.error]),(0,i.useEffect)(()=>{j.data&&j.data.path!==v&&m.setValue("path",j.data.path)},[j.data]);let k=(0,i.useMemo)(()=>x||new(u())(0),[x]),S=(0,i.useMemo)(()=>j.data?(0,s.Uz)(j.data.freeBytes):new(u())(0),[j.data]),O=(0,i.useMemo)(()=>{var e;return(0,s.Uz)((null===(e=j.data)||void 0===e?void 0:e.freeBytes)||new(u())(0))},[j.data]),_=(0,i.useMemo)(()=>{var e,t;return e=z.toNumber(),t=O.toNumber(),{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:n=>{let r="Must be between ".concat((0,s.vW)((0,s.Hz)(e))," and ").concat((0,s.vW)((0,s.Hz)(t),{fixed:3}));return n<=t&&n>=e||r},nospace:()=>t>e||"not enough space in directory"}}}}},[O]),C=(0,o.WsO)(_);return m.register("path",_.path.validation),(0,r.jsx)(o.VqE,{title:"Create Volume",trigger:t,open:n,onOpenChange:e=>{e||m.reset(I),l(e)},contentVariants:{className:"w-[400px]"},onSubmit:m.handleSubmit(E,C),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:_}),(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:_})}),(0,r.jsx)(Z,{path:v,dir:j,onChange:e=>m.setValue("path",e,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})})]}),(0,r.jsx)(o.jIp,{name:"size",form:m,fields:_}),(0,r.jsx)(V,{newSizeGB:k.toNumber(),currentSizeGB:0,maxSizeGB:S.toNumber()})]})})}let H=new(u())(10),U={size:void 0};function W(e){var t,n;let{trigger:l,open:d,onOpenChange:f}=e,{id:h,closeDialog:p}=ek(),m=y(),v=(0,a.ST)({disabled:!h,params:{id:h}}),g=(0,a.cM)({disabled:!d||!v.data,params:{path:null===(t=v.data)||void 0===t?void 0:t.localPath.split(m).slice(0,-1).join(m)}}),b=(0,a.G)(),x=(0,c.cI)({mode:"all",defaultValues:U}),w=x.watch("size"),E=(0,i.useCallback)(async e=>{let t=await b.put({params:{id:Number(h)},payload:{maxSectors:(0,o.WN2)(e.size).toNumber()}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("Volume resizing initiated."),x.reset(U),p())},[x,h,b,p]);(0,i.useEffect)(()=>{v.data&&x.reset(U)},[v.data]);let j=(0,i.useMemo)(()=>w||new(u())(0),[w]),k=(0,i.useMemo)(()=>v.data?(0,o.bjP)(v.data.totalSectors):new(u())(0),[v.data]),S=(0,i.useMemo)(()=>g.data?(0,s.Uz)(g.data.freeBytes):new(u())(0),[g.data]),O=(0,i.useMemo)(()=>k.plus(S),[k,S]),_=k.lt(j),C=k.minus(j).abs().gte(1),M=(0,i.useMemo)(()=>{var e,t;return e=H.toNumber(),t=O.toNumber(),{size:{type:"number",title:"New size",decimalsLimit:0,units:"GB",placeholder:"1,000",validation:{required:"required",validate:{between:n=>{let r="Must be between ".concat((0,s.vW)((0,s.Hz)(e))," and ").concat((0,s.vW)((0,s.Hz)(t),{fixed:3}));return n<=t&&n>=e||r}}}}}},[O]),A=(0,o.WsO)(M);return(0,r.jsx)(o.VqE,{title:"Resize Volume",trigger:l,open:d,onOpenChange:e=>{e||x.reset(U),f(e)},contentVariants:{className:"max-w-[400px]"},onSubmit:x.handleSubmit(E,A),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=v.data)||void 0===n?void 0:n.localPath})]}),(0,r.jsx)(o.jIp,{name:"size",form:x,fields:M}),(0,r.jsx)(V,{currentSizeGB:k.toNumber(),newSizeGB:j.toNumber(),maxSizeGB:O.toNumber(),label:C?(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:_?"Increase by ".concat((0,s.vW)((0,s.Hz)(j.minus(k)))):"Decrease by ".concat((0,s.vW)((0,s.Hz)(k.minus(j))))}):(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:"Current size is ".concat((0,s.vW)((0,s.Hz)(k)))})})]})})}let q={path:"",force:!1};function $(e){var t,n,l;let{trigger:u,open:d,onOpenChange:f}=e,{id:h,closeDialog:p}=ek(),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),b=null===(l=v.data)||void 0===l?void 0:l.localPath,x=(0,c.cI)({mode:"all",defaultValues:q}),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."),x.reset(),p())},[x,v.data,m,p]),E=(0,i.useMemo)(()=>({path:{type:"text",title:"Path",placeholder:b,validation:{required:"required",validate:{equals:e=>e===b||"directory path does not match"}}},force:{type:"boolean",title:"Force",validation:{}}}),[b]),j=(0,o.WsO)(E);return(0,r.jsx)(o.VqE,{title:"Delete Volume",trigger:u,open:d,onOpenChange:e=>{e||x.reset(q),f(e)},contentVariants:{className:"w-[400px]"},onSubmit:x.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:x,fields:E}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(o.QBj,{name:"force",size:"medium",form:x,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:x,children:"Delete"})]})})}function Y(){let{dialog:e,openDialog:t,closeDialog:n}=ek(),s=(0,a.Os)(),l=(0,a.cj)(),c=(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(u())(s.data.spendable):void 0,send:c,open:"sendSiacoin"===e,onOpenChange:r=>r?t(e):n()})}var G=n(63171);function K(){let{id:e,dialog:t,openDialog:n,closeDialog:a}=ek(),{dataset:s}=(0,G.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 X=n(734),Q=n(95753),J=n(71930),ee=n(5632);let et={namespace:"wallet",label:"Wallet"};function en(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:s,closeDialog:l}=ek(),u=(0,ee.useRouter)(),c=(0,a.On)({config:{swr:{revalidateOnFocus:!1,keepPreviousData:!0}}});return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:et,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:et,onSelect:()=>{i(et)},children:et.label}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{u.push(J._.wallet.view),l()},children:"View wallet transactions"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{s("sendSiacoin")},children:"Send siacoin"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{s("addressDetails")},children:"Receive siacoin"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,onSelect:()=>{s("addressDetails")},children:"View wallet address"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:et,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 er=n(38617);let ei={namespace:"settings",label:"Settings"};function eo(e){let{currentPage:t,parentPage:n}=e,{openDialog:i,closeDialog:o}=ek(),{setTheme:a}=(0,er.F)(),{settings:s,setSettings:l,lock:u,currencyOptions:c,setCurrency:d}=(0,Q.Hv)();return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:ei,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:ei,onSelect:()=>{i("settings")},children:"Open settings"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{l({siaCentral:!s.siaCentral}),o()},children:(s.siaCentral?"Disable":"Enable")+" external API - Sia Central exchange rates"}),(0,r.jsx)(m.o4,{currentPage:t,commandPage:ei,onSelect:()=>{u(),o()},children:"Lock hostd"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{i("settings")},children:"Open interface theme menu"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{a("system"),o()},children:"Set theme to system preference"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{a("dark"),o()},children:"Set theme to dark"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{a("light"),o()},children:"Set theme to light"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{i("settings")},children:"Open currency settings menu"}),c.map(e=>{let{id:n,label:i}=e;return(0,r.jsx)(m.WD,{currentPage:t,commandPage:ei,onSelect:()=>{d(n),o()},children:"Set currency to ".concat(i)},n)})]})}let ea={namespace:"node",label:"Blockchain node"};function es(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:o,closeDialog:a}=ek(),s=(0,ee.useRouter)();return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:ea,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:ea,onSelect:()=>{i(ea)},children:ea.label}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ea,onSelect:()=>{o("connectPeer")},children:"Connect to a peer"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ea,onSelect:()=>{s.push(J._.node.index),a()},children:"View peers"})]})}var el=n(10842);let eu={namespace:"configuration",label:"Configuration"};function ec(e){let{currentPage:t,parentPage:n,pushPage:i}=e,o=(0,ee.useRouter)(),{showAdvanced:a}=(0,el.ZR)(),{closeDialog:s}=ek();return(0,r.jsxs)(m.fu,{currentPage:t,commandPage:eu,children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:eu,onSelect:()=>{i(eu)},children:eu.label}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.index),s()},children:"Open configuration"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.host),s()},children:"Configure host"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.pricing),s()},children:"Configure pricing"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.dns),s()},children:"Configure DNS"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.bandwidth),s()},children:"Configure bandwidth"}),a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.registry),s()},children:"Configure registry"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:eu,onSelect:()=>{o.push(J._.config.accounts),s()},children:"Configure accounts"})]})]})}var ed=n(92838);function ef(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)(v.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 eh=n(3639);let ep={namespace:"contracts",label:"Contracts"};function em(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,s=(0,ee.useRouter)(),{closeDialog:l}=ek();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(ep)},children:ep.label}),(0,r.jsx)(m.fu,{currentPage:t,commandPage:ep,children:(0,r.jsx)(m.WD,{currentPage:t,commandPage:ep,onSelect:()=>{s.push(J._.contracts.index),l()},children:"View contracts"})}),(0,r.jsx)(eh.F,{parentPage:ep,currentPage:t,beforeSelect:o,afterSelect:a,pushPage:i})]})}let ev={namespace:"volumes",label:"Volumes"};function eg(e){let{currentPage:t,parentPage:n,pushPage:i}=e,o=(0,ee.useRouter)(),{openDialog:a,closeDialog:s}=ek();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(ev)},children:ev.label}),(0,r.jsxs)(m.fu,{currentPage:t,commandPage:ev,children:[(0,r.jsx)(m.WD,{currentPage:t,commandPage:ev,onSelect:()=>{o.push(J._.volumes.index),s()},children:"View volumes"}),(0,r.jsx)(m.WD,{currentPage:t,commandPage:ev,onSelect:()=>{a("volumeCreate")},children:"Create volume"})]})]})}function ey(e){var t,n,a,s,l,u,c,m,v;let{panel:g}=e,y=(0,ee.useRouter)(),{resetFilters:b}=(0,ed.G)(),{closeDialog:x}=ek(),[w,E]=(0,i.useState)(""),[j]=(s=t&&t.equalityFn||f,u=(a=(n=(0,i.useState)(h(w)))[1],l=[n[0],(0,i.useCallback)(function(e){return a(h(e))},[])])[0],c=l[1],m=d((0,i.useCallback)(function(e){return c(e)},[c]),500,t),s((v=(0,i.useRef)(w)).current,w)||(m(w),v.current=w),[u,m]),[k,S]=(0,i.useState)([]),O=k[k.length-1],_=0===k.length,C=(0,i.useCallback)(e=>{S(t=>[...t,e])},[S]),M=(0,i.useCallback)(()=>{x()},[x]),A=(0,i.useCallback)(()=>{E("")},[E]),T=(null==O?void 0:O.empty)||ef;return(0,r.jsxs)(p.mY,{label:"Command Menu",loop:!0,className:(0,F.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:[O&&(0,r.jsx)(o.__J,{className:"px-2",children:O.label}),(0,r.jsx)(p.mY.Input,{value:w,onValueChange:E,className:(0,o.cEb)({variant:"ghost",focus:"none"}),placeholder:(null==O?void 0:O.prompt)||(_?"Search for commands, eg: theme, redundancy":"Search commands")}),(0,r.jsx)(o.Z0O,{className:"my-2"}),(0,r.jsxs)(p.mY.List,{children:[(0,r.jsx)(p.mY.Empty,{children:(0,r.jsx)(T,{search:w,debouncedSearch:j})}),(0,r.jsx)(eo,{currentPage:O,pushPage:C}),(0,r.jsx)(en,{currentPage:O,pushPage:C}),(0,r.jsx)(eg,{currentPage:O,pushPage:C}),(0,r.jsx)(em,{currentPage:O,pushPage:C,beforeSelect:()=>{M(),b()},afterSelect:()=>{y.pathname.startsWith(J._.contracts.index)||y.push(J._.contracts.index),A()}}),(0,r.jsx)(ec,{currentPage:O,pushPage:C}),(0,r.jsx)(es,{currentPage:O,pushPage:C})]})]})}function eb(e){let{open:t,onOpenChange:n,setOpen:a}=e,{isUnlockedAndAuthedRoute:s}=(0,Q.Hv)(),{isConnected:l}=(0,o.Y97)({route:J.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)(ey,{})})})}function ex(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:ew,dataFields:eE,dismissMany:c,dismissOne:u})}let ew=["error","contractID","blockHeight","resolution","volume","volumeID","elapsed","error","checked","missing","corrupt","total","oldSectors","currentSectors","targetSectors","migratedSectors","migrated","target","force"],eE={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"})]})}}},ej=(0,i.createContext)({}),ek=()=>(0,i.useContext)(ej);function eS(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)(ej.Provider,{value:n,children:t})}function eO(){var e;let{dialog:t,openDialog:n,openConfirmDialog:i,onOpenChange:s,closeDialog:l,confirm:u}=ek(),c=(0,a.Wl)(),d=(0,a.Os)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eb,{open:"cmdk"===t,onOpenChange:s,setOpen:()=>n("cmdk")}),(0,r.jsx)(o.DLL,{open:"settings"===t,onOpenChange:s}),(0,r.jsx)(ex,{open:"alerts"===t,onOpenChange:s}),(0,r.jsx)(Y,{}),(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)(K,{}),(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)(B,{open:"volumeCreate"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(W,{open:"volumeResize"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)($,{open:"volumeDelete"===t,onOpenChange:e=>e?n(t):l()}),(0,r.jsx)(X.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(6645),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),x=(0,i.createContext)({}),w=()=>(0,i.useContext)(x);function E(e){let{children:t}=e,n=function(){let[e,t]=(0,y.Z)("v0/metrics/dataTimeSpan",{defaultValue:b.value}),[n,d]=(0,y.Z)("v0/metrics/dataInterval",{defaultValue:b.interval}),x=function(e){let[t,n]=(0,i.useState)(new Date().getTime());return(0,i.useEffect)(()=>{n(new Date().getTime());let t=(0,o.ytg)(1),r=Math.min((0,h.uQ)(e),t),i=setInterval(()=>{n(new Date().getTime())},r);return()=>clearInterval(i)},[e]),t}(n),w=(0,i.useMemo)(()=>(0,o.OQF)(e,x),[e,x]),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),b=m(n.getMinutes(),2),x=m(n.getSeconds(),2),w=""===o?"":"T",E=[y,b,x].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]),O=(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]),_=(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:O,contracts:C,storage:M,pricing:_,bandwidth:T}}();return(0,r.jsx)(x.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(6645);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:"weekly",value:"365"},{label:"ALL",interval:"monthly",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(6645),o=n(27444),a=n(2784),s=n(30078),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]),b=r.error,x=(0,i.c2j)(m,r.isValidating,b,f);return{balances:y,metrics:g,dataset:m,error:b,dataState:x,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(6645),o=n(27444),a=n(2784);let s=["actions","path","storage","available","readOnly","successfulReads","successfulWrites","failedReads","failedWrites"];var l=n(89528),u=n(25205),c=n(30078);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)}}}),b=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}),x=(0,a.useMemo)(()=>h.filter(e=>t.includes(e.id)),[t]),w=y.isValidating,E=y.error,j=(0,i.c2j)(b,w,E,[]);return{dataState:j,totalCount:(null==b?void 0:b.length)||0,isLoading:y.isValidating,columns:x,dataset:b,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(6645),o=n(92838),a=n(7114),s=n(24511),l=n(30078);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(6645),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(1e6)}let c="/million";function d(e){return new(o())(e).times(1e6)}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(6645),o=n(92838),a=n(5187),s=n(30078),l=n(78743),u=n(10842),c=n(89528),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 b(){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,b]=(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,O=null===(e=a.data)||void 0===e?void 0:e.acceptingContracts,_=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:()=>b(!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)(x,{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)(x,{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)(x,{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:O?(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)(x,{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:_?(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:()=>b(!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 x(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)(b,{}),t]})})})})})})}var j=n(65466),k=n.n(j),S=n(87492),O=n.n(S),_=n(82851);let C=(0,_.cx)(k().variable,O().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})})})}},6645:function(e,t,n){"use strict";let r,i,o,a;n.d(t,{hcY:function(){return _1},tU3:function(){return _X},zXq:function(){return Ch},juT:function(){return _j},Cts:function(){return lF},Z58:function(){return C$},WVB:function(){return cQ},zxk:function(){return lw},b0u:function(){return kY},EKh:function(){return lI},vRO:function(){return ME},QHy:function(){return Mc},TaT:function(){return C6},eQh:function(){return lH},HfT:function(){return Mh},ncR:function(){return _n},A06:function(){return CQ},Vy9:function(){return CJ},VqE:function(){return ux},h_2:function(){return c4},Xiv:function(){return c3},Juw:function(){return c5},KpP:function(){return c6},XOF:function(){return _t},jIp:function(){return Mj},QBj:function(){return Mk},yEL:function(){return Ci},cB7:function(){return _l},ZqQ:function(){return _s},IKw:function(){return _p},WN2:function(){return MU},X6q:function(){return de},Yqd:function(){return fq},__J:function(){return dl},rUS:function(){return dd},TRl:function(){return dh},kFS:function(){return cJ},FzK:function(){return Ms},Clw:function(){return cX},PD$:function(){return MA},Wxm:function(){return fK},uDJ:function(){return _v},wFK:function(){return _g},s_4:function(){return nd},nvN:function(){return nu},u5Q:function(){return CY},j4H:function(){return f$},J2e:function(){return dD},kod:function(){return dG},xrM:function(){return ug},PhF:function(){return fG},Z0O:function(){return cq},DLL:function(){return CZ},KJW:function(){return _O},rsf:function(){return hn},D_D:function(){return C_},iA_:function(){return _m},t6k:function(){return Mp},xvT:function(){return nl},nvn:function(){return ff},ua7:function(){return lb},mPE:function(){return CC},XxW:function(){return OT},m2c:function(){return OF},ho9:function(){return OZ},QUh:function(){return CV},weF:function(){return Cj},YNn:function(){return CT},DmW:function(){return CP},O9T:function(){return gV},fVJ:function(){return CU},vQq:function(){return Ox},NrH:function(){return kH},Y_Z:function(){return Cz},EJC:function(){return MW},kOJ:function(){return CH},OQF:function(){return CI},leQ:function(){return OS},ytg:function(){return kB},Vkc:function(){return cY},sWj:function(){return kI},S5N:function(){return AA},z$:function(){return nc},XBW:function(){return kU},x9T:function(){return MB},bjP:function(){return MH},I13:function(){return Oj},cEb:function(){return fd},OHV:function(){return Og},OPV:function(){return Ov},$Gg:function(){return OE},Y97:function(){return _K},c2j:function(){return _Q},mYE:function(){return MO},u$d:function(){return M_},Z4p:function(){return MS},WsO:function(){return Cr},Uu5:function(){return MI},oy6:function(){return Mz},nNd:function(){return CN}});var s,l,u,c,d,f,h,p,m,v,g,y,b,x,w,E,j,k,S,O,_,C,M,A,T,P,N,R,D,L,Z,F,V,z,I,B,H,U={};n.r(U),n.d(U,{useDropzone:function(){return mx}});var W=n(52322),q=n(2784),$=n.t(q,2),Y=n(7896),G=n(34540),K=n(26215),X=n(99575);function Q(e){let t=e+"CollectionProvider",[n,r]=(0,G.b)(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=q.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(a,n),s=(0,K.e)(t,i.collectionRef);return q.createElement(X.g7,{ref:s},r)}),l=e+"CollectionItemSlot",u="data-radix-collection-item",c=q.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=q.useRef(null),s=(0,K.e)(t,a),c=o(l,n);return q.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>void c.itemMap.delete(a))),q.createElement(X.g7,{[u]:"",ref:s},r)});return[{Provider:e=>{let{scope:t,children:n}=e,r=q.useRef(null),o=q.useRef(new Map).current;return q.createElement(i,{scope:t,itemMap:o,collectionRef:r},n)},Slot:s,ItemSlot:c},function(t){let n=o(e+"CollectionConsumer",t),r=q.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 J=n(41816),ee=n(73597),et=n(72130),en=n(64680),er=n(28245),ei=n(26074);let eo="Collapsible",[ea,es]=(0,G.b)(eo),[el,eu]=ea(eo),ec=((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l=!1,u]=(0,ee.T)({prop:r,defaultProp:i,onChange:a});return(0,q.createElement)(el,{scope:n,disabled:o,contentId:(0,ei.M)(),open:l,onOpenToggle:(0,q.useCallback)(()=>u(e=>!e),[u])},(0,q.createElement)(et.WV.div,(0,Y.Z)({"data-state":ef(l),"data-disabled":o?"":void 0},s,{ref:t})))},"CollapsibleContent"),ed=((e,t)=>{let{forceMount:n,...r}=e,i=eu(ec,e.__scopeCollapsible);return(0,q.createElement)(er.z,{present:n||i.open},({present:e})=>(0,q.createElement)(ed,(0,Y.Z)({},r,{ref:t,present:e})))},(0,q.forwardRef)((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...o}=e,a=eu(ec,n),[s,l]=(0,q.useState)(r),u=(0,q.useRef)(null),c=(0,K.e)(t,u),d=(0,q.useRef)(0),f=d.current,h=(0,q.useRef)(0),p=h.current,m=a.open||s,v=(0,q.useRef)(m),g=(0,q.useRef)();return(0,q.useEffect)(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,en.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,q.createElement)(et.WV.div,(0,Y.Z)({"data-state":ef(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 ef(e){return e?"open":"closed"}let eh="Accordion",ep=["Home","End","ArrowDown","ArrowUp"],[em,ev,eg]=Q(eh),[ey,eb]=(0,G.b)(eh,[eg,es]),ex=(es(),q.forwardRef((e,t)=>{let{type:n,...r}=e;return q.createElement(em.Provider,{scope:e.__scopeAccordion},"multiple"===n?q.createElement(eO,(0,Y.Z)({},r,{ref:t})):q.createElement(eS,(0,Y.Z)({},r,{ref:t})))}));ex.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[ew,eE]=ey(eh),[ej,ek]=ey(eh,{collapsible:!1}),eS=q.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...a}=e,[s,l]=(0,ee.T)({prop:n,defaultProp:r,onChange:i});return q.createElement(ew,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:q.useCallback(()=>o&&l(""),[o,l])},q.createElement(ej,{scope:e.__scopeAccordion,collapsible:o},q.createElement(eM,(0,Y.Z)({},a,{ref:t}))))}),eO=q.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[a=[],s]=(0,ee.T)({prop:n,defaultProp:r,onChange:i}),l=q.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=q.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return q.createElement(ew,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:u},q.createElement(ej,{scope:e.__scopeAccordion,collapsible:!0},q.createElement(eM,(0,Y.Z)({},o,{ref:t}))))}),[e_,eC]=ey(eh),eM=q.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,...i}=e,o=q.useRef(null),a=(0,K.e)(o,t),s=ev(n),l=(0,J.M)(e.onKeyDown,e=>{var t;if(!ep.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 q.createElement(e_,{scope:n,disabled:r},q.createElement(em.Slot,{scope:n},q.createElement(et.WV.div,(0,Y.Z)({},i,{ref:a,onKeyDown:r?void 0:l}))))}),[eA,eT]=ey("AccordionItem");var eP=n(82851),eN=n(83317);function eR(e){return e.split("-")[0]}function eD(e){return e.split("-")[1]}function eL(e){return["top","bottom"].includes(eR(e))?"x":"y"}function eZ(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=eL(t),u=eZ(l),c=i[u]/2-o[u]/2,d="x"===l;switch(eR(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(eD(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}let eV=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=ez(r),c={x:i,y:o},d=eL(a),f=eD(a),h=eZ(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],b=await (null==l.getOffsetParent?void 0:l.getOffsetParent(n)),x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[h]);let w=u[m],E=x-p[h]-u[v],j=x/2-p[h]/2+(g/2-y/2),k=eU(w,eH(j,E)),S=("start"===f?u[m]:u[v])>0&&j!==k&&s.reference[h]<=s.floating[h];return{[d]:c[d]-(S?jeq[e])}let eY={start:"end",end:"start"};function eG(e){return e.replace(/start|end/g,e=>eY[e])}let eK=["top","right","bottom","left"];eK.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let eX=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=eR(a),b=p||(y!==u&&v?function(e){let t=e$(e);return[eG(e),t,eG(t)]}(u):[e$(u)]),x=[u,...b],w=await eB(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=eD(e),i=eL(e),o=eZ(i),a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=e$(a)),{main:a,cross:e$(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=x[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 eQ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eJ(e){return eK.some(t=>e[t]>=0)}let e0=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=eQ(await eB(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:eJ(t)}}}case"escaped":{let t=eQ(await eB(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:eJ(t)}}}default:return{}}}}},e1=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=eR(n),s=eD(n),l="x"===eL(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 e2(e){return"x"===e?"y":"x"}let e4=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 eB(t,l),d=eL(eR(i)),f=e2(d),h=u[d],p=u[f];if(o){let e="y"===d?"bottom":"right";h=eU(h+c["y"===d?"top":"left"],eH(h,h-c[e]))}a&&(p=eU(p+c["y"===f?"top":"left"],eH(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}}}}},e3=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=eL(i),f=e2(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,b,x;let e="y"===d?"width":"height",t=["top","left"].includes(eR(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!=(b=null==(x=a.offset)?void 0:x[f])?b:0)-(t?v.crossAxis:0);pr&&(p=r)}return{[d]:h,[f]:p}}}};function e5(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function e6(e){if(null==e)return window;if(!e5(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function e8(e){return e6(e).getComputedStyle(e)}function e7(e){return e5(e)?"":e?(e.nodeName||"").toLowerCase():""}function e9(){let e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function te(e){return e instanceof e6(e).HTMLElement}function tt(e){return e instanceof e6(e).Element}function tn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof e6(e).ShadowRoot||e instanceof ShadowRoot)}function tr(e){let{overflow:t,overflowX:n,overflowY:r}=e8(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ti(e){let t=/firefox/i.test(e9()),n=e8(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 to(){return!/^((?!chrome|android).)*safari/i.test(e9())}let ta=Math.min,ts=Math.max,tl=Math.round;function tu(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&&te(e)&&(l=e.offsetWidth>0&&tl(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&tl(s.height)/e.offsetHeight||1);let c=tt(e)?e6(e):window,d=!to()&&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 tc(e){return((e instanceof e6(e).Node?e.ownerDocument:e.document)||window.document).documentElement}function td(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function tf(e){return tu(tc(e)).left+td(e).scrollLeft}function th(e){return"html"===e7(e)?e:e.assignedSlot||e.parentNode||(tn(e)?e.host:null)||tc(e)}function tp(e){return te(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function tm(e){let t=e6(e),n=tp(e);for(;n&&["table","td","th"].includes(e7(n))&&"static"===getComputedStyle(n).position;)n=tp(n);return n&&("html"===e7(n)||"body"===e7(n)&&"static"===getComputedStyle(n).position&&!ti(n))?t:n||function(e){let t=th(e);for(tn(t)&&(t=t.host);te(t)&&!["html","body"].includes(e7(t));){if(ti(t))return t;t=t.parentNode}return null}(e)||t}function tv(e){if(te(e))return{width:e.offsetWidth,height:e.offsetHeight};let t=tu(e);return{width:t.width,height:t.height}}function tg(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=th(t);return["html","body","#document"].includes(e7(n))?t.ownerDocument.body:te(n)&&tr(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=e6(r),a=i?[o].concat(o.visualViewport||[],tr(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(tg(a))}function ty(e,t,n){return"viewport"===t?eI(function(e,t){let n=e6(e),r=tc(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;let e=to();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n)):tt(t)?function(e,t){let n=tu(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):eI(function(e){var t;let n=tc(e),r=td(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ts(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ts(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+tf(e),l=-r.scrollTop;return"rtl"===e8(i||n).direction&&(s+=ts(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(tc(e)))}let tb={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?function(e){let t=tg(e),n=["absolute","fixed"].includes(e8(e).position)&&te(e)?tm(e):e;return tt(n)?t.filter(e=>tt(e)&&function(e,t){let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&tn(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==e7(e)):[]}(t):[].concat(n),r],a=o[0],s=o.reduce((e,n)=>{let r=ty(t,n,i);return e.top=ts(r.top,e.top),e.right=ta(r.right,e.right),e.bottom=ta(r.bottom,e.bottom),e.left=ts(r.left,e.left),e},ty(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=te(n),o=tc(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==e7(n)||tr(o))&&(a=td(n)),te(n))){let e=tu(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:tt,getDimensions:tv,getOffsetParent:tm,getDocumentElement:tc,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:function(e,t,n){let r=te(t),i=tc(t),o=tu(e,r&&function(e){let t=tu(e);return tl(t.width)!==e.offsetWidth||tl(t.height)!==e.offsetHeight}(t),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n){if(("body"!==e7(t)||tr(i))&&(a=td(t)),te(t)){let e=tu(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=tf(i))}return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}(t,tm(n),r),floating:{...tv(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===e8(e).direction};function tx(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?[...tt(e)?tg(e):[],...tg(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}),tt(e)&&!s&&f.observe(e),f.observe(t)}let h=s?tu(e):null;return s&&function t(){let r=tu(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 tw=(e,t,n)=>eV(e,t,{platform:tb,...n});var tE=n(28316),tj="undefined"!=typeof document?q.useLayoutEffect:q.useEffect;function tk(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=void 0===e?{}:e,o=q.useRef(null),a=q.useRef(null),s=function(e){let t=q.useRef(e);return tj(()=>{t.current=e}),t}(i),l=q.useRef(null),[u,c]=q.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[d,f]=q.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=q.useCallback(()=>{o.current&&a.current&&tw(o.current,a.current,{middleware:d,placement:n,strategy:r}).then(e=>{p.current&&tE.flushSync(()=>{c(e)})})},[d,n,r]);tj(()=>{p.current&&h()},[h]);let p=q.useRef(!1);tj(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=q.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=q.useCallback(e=>{o.current=e,m()},[m]),g=q.useCallback(e=>{a.current=e,m()},[m]),y=q.useMemo(()=>({reference:o,floating:a}),[]);return q.useMemo(()=>({...u,update:h,refs:y,reference:v,floating:g}),[u,h,y,v,g])}let tS=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 eW({element:t.current,padding:n}).fn(e)}else if(t)return eW({element:t,padding:n}).fn(e);return{}}}},tO=(0,q.forwardRef)((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,q.createElement)(et.WV.svg,(0,Y.Z)({},o,{ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,q.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function t_(e){let[t,n]=(0,q.useState)(void 0);return(0,en.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 tC="Popper",[tM,tA]=(0,G.b)(tC),[tT,tP]=tM(tC),tN=(0,q.forwardRef)((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,o=tP("PopperAnchor",n),a=(0,q.useRef)(null),s=(0,K.e)(t,a);return(0,q.useEffect)(()=>{o.onAnchorChange((null==r?void 0:r.current)||a.current)}),r?null:(0,q.createElement)(et.WV.div,(0,Y.Z)({},i,{ref:s}))}),tR="PopperContent",[tD,tL]=tM(tR),[tZ,tF]=tM(tR,{hasParent:!1,positionUpdateFns:new Set}),tV=(0,q.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:b=!1,avoidCollisions:x=!0,...w}=e,E=tP(tR,c),[j,k]=(0,q.useState)(null),S=(0,K.e)(t,e=>k(e)),[O,_]=(0,q.useState)(null),C=t_(O),M=null!==(n=null==C?void 0:C.width)&&void 0!==n?n:0,A=null!==(r=null==C?void 0:C.height)&&void 0!==r?r:0,T="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(v)?v:[v],N=P.length>0,R={padding:T,boundary:P.filter(tH),altBoundary:N},{reference:D,floating:L,strategy:Z,x:F,y:V,placement:z,middlewareData:I,update:B}=tk({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:tx,middleware:[e1({mainAxis:f+A,alignmentAxis:p}),x?e4({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?e3():void 0,...R}):void 0,O?tS({element:O,padding:m}):void 0,x?eX({...R}):void 0,tU({arrowWidth:M,arrowHeight:A}),b?e0({strategy:"referenceHidden"}):void 0].filter(tB)});(0,en.b)(()=>{D(E.anchor)},[D,E.anchor]);let H=null!==F&&null!==V,[U,W]=tW(z),$=null===(i=I.arrow)||void 0===i?void 0:i.x,Y=null===(o=I.arrow)||void 0===o?void 0:o.y,G=(null===(a=I.arrow)||void 0===a?void 0:a.centerOffset)!==0,[X,Q]=(0,q.useState)();(0,en.b)(()=>{j&&Q(window.getComputedStyle(j).zIndex)},[j]);let{hasParent:J,positionUpdateFns:ee}=tF(tR,c),er=!J;(0,q.useLayoutEffect)(()=>{if(!er)return ee.add(B),()=>{ee.delete(B)}},[er,ee,B]),(0,q.useLayoutEffect)(()=>{er&&H&&Array.from(ee).reverse().forEach(e=>requestAnimationFrame(e))},[er,H,ee]);let ei={"data-side":U,"data-align":W,...w,ref:S,style:{...w.style,animation:H?void 0:"none",opacity:null!==(s=I.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return(0,q.createElement)("div",{ref:L,"data-radix-popper-content-wrapper":"",style:{position:Z,left:0,top:0,transform:H?`translate3d(${Math.round(F)}px, ${Math.round(V)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[null===(l=I.transformOrigin)||void 0===l?void 0:l.x,null===(u=I.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},(0,q.createElement)(tD,{scope:c,placedSide:U,onArrowChange:_,arrowX:$,arrowY:Y,shouldHideArrow:G},er?(0,q.createElement)(tZ,{scope:c,hasParent:!0,positionUpdateFns:ee},(0,q.createElement)(et.WV.div,ei)):(0,q.createElement)(et.WV.div,ei)))}),tz={top:"bottom",right:"left",bottom:"top",left:"right"},tI=(0,q.forwardRef)(function(e,t){let{__scopePopper:n,...r}=e,i=tL("PopperArrow",n),o=tz[i.placedSide];return(0,q.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,q.createElement)(tO,(0,Y.Z)({},r,{ref:t,style:{...r.style,display:"block"}})))});function tB(e){return void 0!==e}function tH(e){return null!==e}let tU=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]=tW(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="",b="";return"bottom"===h?(y=c?m:`${v}px`,b=`${-f}px`):"top"===h?(y=c?m:`${v}px`,b=`${l.floating.height+f}px`):"right"===h?(y=`${-f}px`,b=c?m:`${g}px`):"left"===h&&(y=`${l.floating.width+f}px`,b=c?m:`${g}px`),{data:{x:y,y:b}}}});function tW(e){let[t,n="center"]=e.split("-");return[t,n]}let tq=e=>{let{__scopePopper:t,children:n}=e,[r,i]=(0,q.useState)(null);return(0,q.createElement)(tT,{scope:t,anchor:r,onAnchorChange:i},n)};var t$=n(6500);let tY=(0,q.forwardRef)((e,t)=>(0,q.createElement)(et.WV.span,(0,Y.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}}))),[tG,tK]=(0,G.b)("Tooltip",[tA]),tX=tA(),tQ="tooltip.open",[tJ,t0]=tG("TooltipProvider"),t1="Tooltip",[t2,t4]=tG(t1),t3="TooltipTrigger",t5=(0,q.forwardRef)((e,t)=>{let{__scopeTooltip:n,...r}=e,i=t4(t3,n),o=t0(t3,n),a=tX(n),s=(0,q.useRef)(null),l=(0,K.e)(t,s,i.onTriggerChange),u=(0,q.useRef)(!1),c=(0,q.useRef)(!1),d=(0,q.useCallback)(()=>u.current=!1,[]);return(0,q.useEffect)(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,q.createElement)(tN,(0,Y.Z)({asChild:!0},a),(0,q.createElement)(et.WV.button,(0,Y.Z)({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:(0,J.M)(e.onPointerMove,e=>{"touch"===e.pointerType||c.current||o.isPointerInTransitRef.current||(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:(0,J.M)(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:(0,J.M)(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:(0,J.M)(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:(0,J.M)(e.onBlur,i.onClose),onClick:(0,J.M)(e.onClick,e=>{let t=0===e.detail;t&&i.onClose()})})))}),t6="TooltipPortal",[t8,t7]=tG(t6,{forceMount:void 0}),t9="TooltipContent",ne=(0,q.forwardRef)((e,t)=>{let n=t7(t9,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=t4(t9,e.__scopeTooltip);return(0,q.createElement)(er.z,{present:r||a.open},a.disableHoverableContent?(0,q.createElement)(ni,(0,Y.Z)({side:i},o,{ref:t})):(0,q.createElement)(nt,(0,Y.Z)({side:i},o,{ref:t})))}),nt=(0,q.forwardRef)((e,t)=>{let n=t4(t9,e.__scopeTooltip),r=t0(t9,e.__scopeTooltip),i=(0,q.useRef)(null),o=(0,K.e)(t,i),[a,s]=(0,q.useState)(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=(0,q.useCallback)(()=>{s(null),d(!1)},[d]),h=(0,q.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,q.useEffect)(()=>()=>f(),[f]),(0,q.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,q.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,q.createElement)(ni,(0,Y.Z)({},e,{ref:o}))}),[nn,nr]=tG(t1,{isInside:!1}),ni=(0,q.forwardRef)((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=t4(t9,n),u=tX(n),{onClose:c}=l;return(0,q.useEffect)(()=>(document.addEventListener(tQ,c),()=>document.removeEventListener(tQ,c)),[c]),(0,q.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,q.createElement)(eN.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:c},(0,q.createElement)(tV,(0,Y.Z)({"data-state":l.stateAttribute},u,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,q.createElement)(X.A4,null,r),(0,q.createElement)(nn,{scope:n,isInside:!0},(0,q.createElement)(tY,{id:l.contentId,role:"tooltip"},i||r))))}),no=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=t0(t1,e.__scopeTooltip),u=tX(t),[c,d]=(0,q.useState)(null),f=(0,ei.M)(),h=(0,q.useRef)(0),p=null!=a?a:l.disableHoverableContent,m=null!=s?s:l.delayDuration,v=(0,q.useRef)(!1),[g=!1,y]=(0,ee.T)({prop:r,defaultProp:i,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(tQ))):l.onClose(),null==o||o(e)}}),b=(0,q.useMemo)(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),x=(0,q.useCallback)(()=>{window.clearTimeout(h.current),v.current=!1,y(!0)},[y]),w=(0,q.useCallback)(()=>{window.clearTimeout(h.current),y(!1)},[y]),E=(0,q.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,y(!0)},m)},[m,y]);return(0,q.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,q.createElement)(tq,u,(0,q.createElement)(t2,{scope:t,contentId:f,open:g,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:(0,q.useCallback)(()=>{l.isOpenDelayed?E():x()},[l.isOpenDelayed,E,x]),onTriggerLeave:(0,q.useCallback)(()=>{p?w():window.clearTimeout(h.current)},[w,p]),onOpen:x,onClose:w,disableHoverableContent:p},n))},na=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=t4(t6,t);return(0,q.createElement)(t8,{scope:t,forceMount:n},(0,q.createElement)(er.z,{present:n||o.open},(0,q.createElement)(t$.h,{asChild:!0,container:i},r)))},ns=(0,eP.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"}}),nl=q.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,W.jsx)(n,{ref:t,className:(0,eP.cx)(r,ns({font:i,color:o,weight:a,size:s,scaleSize:l,underline:c,noWrap:u,ellipsis:d,wrapEllipsis:f})),...h})}),nu=q.forwardRef((e,t)=>{let{size:n="18",...r}=e;return(0,W.jsx)(nl,{tag:"p",...r,ref:t,weight:"regular",scaleSize:n,color:"subtle",className:(0,eP.cx)("leading-relaxed md:leading-relaxed",e.className)})}),nc=(0,eP.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"]),nd=q.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,W.jsx)("div",{ref:t,className:nc({className:n}),...r})});var nf=n(34406);let nh=(void 0===nf||nf.env,"production"),np=1/60*1e3,nm="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),nv="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(nm()),np),ng=!0,ny=!1,nb=!1,nx={delta:0,timestamp:0},nw=["read","update","preRender","render","postRender"],nE=nw.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;nny=!0),e),{}),nj=nw.reduce((e,t)=>{let n=nE[t];return e[t]=(e,t=!1,r=!1)=>(ny||nC(),n.schedule(e,t,r)),e},{}),nk=nw.reduce((e,t)=>(e[t]=nE[t].cancel,e),{}),nS=nw.reduce((e,t)=>(e[t]=()=>nE[t].process(nx),e),{}),nO=e=>nE[e].process(nx),n_=e=>{ny=!1,nx.delta=ng?np:Math.max(Math.min(e-nx.timestamp,40),1),nx.timestamp=e,nb=!0,nw.forEach(nO),nb=!1,ny&&(ng=!1,nv(n_))},nC=()=>{ny=!0,ng=!0,nb||nv(n_)},nM=()=>nx,nA="undefined"!=typeof document,nT=nA?q.useLayoutEffect:q.useEffect;function nP(){let e=(0,q.useRef)(!1);return nT(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let nN=(0,q.createContext)(null);function nR(e){let t=(0,q.useRef)(null);return null===t.current&&(t.current=e()),t.current}class nD extends q.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 nL({children:e,isPresent:t}){let n=(0,q.useId)(),r=(0,q.useRef)(null),i=(0,q.useRef)({width:0,height:0,top:0,left:0});return(0,q.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;
diff --git a/hostd/assets/_next/static/DUYFhyNmWV1tMWvReA8d4/_buildManifest.js b/hostd/assets/_next/static/nmbA0gdmZPjzJzGOmJ9Jr/_buildManifest.js
similarity index 100%
rename from hostd/assets/_next/static/DUYFhyNmWV1tMWvReA8d4/_buildManifest.js
rename to hostd/assets/_next/static/nmbA0gdmZPjzJzGOmJ9Jr/_buildManifest.js
diff --git a/hostd/assets/_next/static/DUYFhyNmWV1tMWvReA8d4/_ssgManifest.js b/hostd/assets/_next/static/nmbA0gdmZPjzJzGOmJ9Jr/_ssgManifest.js
similarity index 100%
rename from hostd/assets/_next/static/DUYFhyNmWV1tMWvReA8d4/_ssgManifest.js
rename to hostd/assets/_next/static/nmbA0gdmZPjzJzGOmJ9Jr/_ssgManifest.js
diff --git a/hostd/assets/config.html b/hostd/assets/config.html
index fb6c90802..13aadf0c3 100644
--- a/hostd/assets/config.html
+++ b/hostd/assets/config.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/hostd/assets/contracts.html b/hostd/assets/contracts.html
index 55620d366..d56786151 100644
--- a/hostd/assets/contracts.html
+++ b/hostd/assets/contracts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/hostd/assets/index.html b/hostd/assets/index.html
index 8bcd22878..8a8f188e3 100644
--- a/hostd/assets/index.html
+++ b/hostd/assets/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/hostd/assets/login.html b/hostd/assets/login.html
index 304ce52e2..a8e97e177 100644
--- a/hostd/assets/login.html
+++ b/hostd/assets/login.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/hostd/assets/node.html b/hostd/assets/node.html
index 6c204da40..b83afd1fa 100644
--- a/hostd/assets/node.html
+++ b/hostd/assets/node.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/hostd/assets/volumes.html b/hostd/assets/volumes.html
index c6b67ec4d..fda2d3fda 100644
--- a/hostd/assets/volumes.html
+++ b/hostd/assets/volumes.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/hostd/assets/wallet.html b/hostd/assets/wallet.html
index 5e4695967..bc7f72231 100644
--- a/hostd/assets/wallet.html
+++ b/hostd/assets/wallet.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/404.html b/renterd/assets/404.html
index c7cd4319c..0c583154c 100644
--- a/renterd/assets/404.html
+++ b/renterd/assets/404.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/_next/static/uZkHqZSUWTXNrMmopoIyP/_buildManifest.js b/renterd/assets/_next/static/4oGAJKf48gXCx3Co5UJfs/_buildManifest.js
similarity index 85%
rename from renterd/assets/_next/static/uZkHqZSUWTXNrMmopoIyP/_buildManifest.js
rename to renterd/assets/_next/static/4oGAJKf48gXCx3Co5UJfs/_buildManifest.js
index 6b42797e5..0a44686b9 100644
--- a/renterd/assets/_next/static/uZkHqZSUWTXNrMmopoIyP/_buildManifest.js
+++ b/renterd/assets/_next/static/4oGAJKf48gXCx3Co5UJfs/_buildManifest.js
@@ -1 +1 @@
-self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-d4cac1a322cb14ab.js"],"/_error":["static/chunks/pages/_error-bef7735c65ba8b47.js"],"/config":["static/chunks/pages/config-e2e2962ad8da8891.js"],"/contracts":["static/chunks/pages/contracts-996b06e537dec68a.js"],"/files/[[...path]]":["static/chunks/pages/files/[[...path]]-a1160caaddabffa9.js"],"/hosts":["static/chunks/pages/hosts-4d8d7eb7b2c17228.js"],"/keys":["static/chunks/pages/keys-6bb209fba80b5797.js"],"/login":["static/chunks/pages/login-29bc5a385b33fd40.js"],"/node":["static/chunks/pages/node-77a014df2b55c704.js"],"/wallet":["static/chunks/pages/wallet-04517949d1e9436e.js"],sortedPages:["/","/_app","/_error","/config","/contracts","/files/[[...path]]","/hosts","/keys","/login","/node","/wallet"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
\ No newline at end of file
+self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-d4cac1a322cb14ab.js"],"/_error":["static/chunks/pages/_error-bef7735c65ba8b47.js"],"/config":["static/chunks/pages/config-e2e2962ad8da8891.js"],"/contracts":["static/chunks/pages/contracts-996b06e537dec68a.js"],"/files/[[...path]]":["static/chunks/pages/files/[[...path]]-513970b3eba4acb5.js"],"/hosts":["static/chunks/pages/hosts-4d8d7eb7b2c17228.js"],"/keys":["static/chunks/pages/keys-6bb209fba80b5797.js"],"/login":["static/chunks/pages/login-29bc5a385b33fd40.js"],"/node":["static/chunks/pages/node-77a014df2b55c704.js"],"/wallet":["static/chunks/pages/wallet-04517949d1e9436e.js"],sortedPages:["/","/_app","/_error","/config","/contracts","/files/[[...path]]","/hosts","/keys","/login","/node","/wallet"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
\ No newline at end of file
diff --git a/renterd/assets/_next/static/uZkHqZSUWTXNrMmopoIyP/_ssgManifest.js b/renterd/assets/_next/static/4oGAJKf48gXCx3Co5UJfs/_ssgManifest.js
similarity index 100%
rename from renterd/assets/_next/static/uZkHqZSUWTXNrMmopoIyP/_ssgManifest.js
rename to renterd/assets/_next/static/4oGAJKf48gXCx3Co5UJfs/_ssgManifest.js
diff --git a/renterd/assets/_next/static/chunks/pages/files/[[...path]]-513970b3eba4acb5.js b/renterd/assets/_next/static/chunks/pages/files/[[...path]]-513970b3eba4acb5.js
new file mode 100644
index 000000000..3bb200194
--- /dev/null
+++ b/renterd/assets/_next/static/chunks/pages/files/[[...path]]-513970b3eba4acb5.js
@@ -0,0 +1 @@
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{38345:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/files/[[...path]]",function(){return t(8715)}])},89630:function(e,s,t){"use strict";t.d(s,{J:function(){return h}});var l=t(52322),i=t(45898),n=t(9969),a=t(6391),r=t.n(a),c=t(71930),o=t(25573),d=t(88665);function x(){var e,s,t,a,r;let{openDialog:c}=(0,d.Rh)(),x=(0,n.d_)({config:{swr:{revalidateOnFocus:!1}}}),u=(0,n.X2)({config:{swr:{revalidateOnFocus:!1}}}),h=(0,n.cQ)(),f=(0,o.n)(),j=null===(e=x.data)||void 0===e?void 0:e.version,m="?"===j?"https://github.com/SiaFoundation/renterd/commits/":(null==j?void 0:j.match(/^v\d+\.\d+\.\d+/))?"https://github.com/SiaFoundation/renterd/releases/".concat(j):"https://github.com/SiaFoundation/renterd/tree/".concat(j);return(0,l.jsxs)(i.HfT,{name:"renterd",peerCount:null===(s=h.data)||void 0===s?void 0:s.length,connectPeer:()=>c("connectPeer"),isSynced:f.isSynced,syncPercent:f.syncPercent,nodeBlockHeight:f.nodeBlockHeight,estimatedBlockHeight:f.estimatedBlockHeight,firstTimeSyncing:f.firstTimeSyncing,moreThan100BlocksToSync:f.moreThan100BlocksToSync,children:[(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Wallet address"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.XxW,{size:"14",maxLength:50,value:null===(t=u.data)||void 0===t?void 0:t.address,type:"address"})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Network"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(i.xvT,{size:"14",children:null===(a=x.data)||void 0===a?void 0:a.network})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(i.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Version"}),(0,l.jsx)(i.rUS,{size:"14",href:m,underline:"hover",target:"_blank",ellipsis:!0,children:null===(r=x.data)||void 0===r?void 0:r.version})]})]})}function u(){let e=(0,n.d_)({config:{swr:{revalidateOnFocus:!1}}});return e.data&&"Mainnet"!==e.data.network?(0,l.jsx)(i.t6k,{testnetName:e.data.network}):null}function h(e){let s=(0,n.X2)(),{isSynced:t}=(0,o.n)();return(0,l.jsx)(i.tU3,{appName:"renterd",profile:(0,l.jsx)(x,{}),banner:(0,l.jsx)(u,{}),connectivityRoute:c.h,isSynced:t,walletBalanceSc:s.data&&{spendable:new(r())(s.data.spendable),confirmed:new(r())(s.data.confirmed),unconfirmed:new(r())(s.data.unconfirmed)},...e})}},91930:function(e,s,t){"use strict";t.d(s,{e:function(){return d}});var l=t(52322),i=t(45898),n=t(19387),a=t(9969),r=t(82851),c=t(71930),o=t(88665);function d(){var e,s;let t=(0,a.Z7)(),{openDialog:d}=(0,o.Rh)(),x=!(null===(e=t.data)||void 0===e?void 0:e.find(e=>"info"!==e.severity)),u=(null===(s=t.data)||void 0===s?void 0:s.length)||0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.KJW,{title:"Files",route:c._.files.index,children:(0,l.jsx)(n.ROc,{})}),(0,l.jsx)(i.KJW,{title:"Configuration",route:c._.config.index,children:(0,l.jsx)(n.wWN,{})}),(0,l.jsx)(i.KJW,{title:"Contracts",route:c._.contracts.index,children:(0,l.jsx)(n.VBo,{})}),(0,l.jsx)(i.KJW,{title:"Hosts",route:c._.hosts.index,children:(0,l.jsx)(n.VHe,{})}),(0,l.jsx)(i.KJW,{title:"S3 authentication keypairs",route:c._.keys.index,children:(0,l.jsx)(n._m8,{})}),(0,l.jsxs)("div",{className:"relative",children:[!!u&&x&&(0,l.jsx)("div",{className:(0,r.cx)("absolute -right-[2px] top-px w-1 h-1","rounded-full","bg-gray-1000 dark:bg-white","pointer-events-none")}),!!u&&!x&&(0,l.jsx)(i.xvT,{size:"10",className:(0,r.cx)("absolute -right-[9px] -top-1 py-px px-[5px]","text-white","bg-red-500 dark:bg-red-500 rounded","pointer-events-none"),color:"none",children:u.toLocaleString()}),(0,l.jsx)(i.KJW,{title:"Alerts",onClick:()=>d("alerts"),children:(0,l.jsx)(n.Dkj,{})})]})]})}},8715:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return R}});var l=t(52322),i=t(91930),n=t(71930),a=t(88665),r=t(45898),c=t(48528),o=t(19387),d=t(9969),x=t(91641);function u(){let{autopilot:e}=(0,x.q)(),s=(0,d.e$)({config:{swr:{errorRetryCount:0}}});return{active:"on"===e.status&&!!s.error}}var h=t(4370);function f(){return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,l.jsx)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching files."})]})}function j(){let{filters:e,resetFilters:s}=(0,c.Y)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsx)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No files matching filters."}),!!e.length&&(0,l.jsx)(r.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function m(){let{activeBucket:e}=(0,c.Y)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsxs)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,l.jsx)(r.EKh,{children:e})," bucket does not contain any files, drag and drop files or click here to start uploading."]}),(0,l.jsx)(r.Qjf,{href:n._.files.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function v(){let{dataState:e,isViewingRootOfABucket:s}=(0,c.Y)(),t=u(),i=(0,h.F)();return"noneMatchingFilters"===e?(0,l.jsx)(j,{}):"error"===e?(0,l.jsx)(f,{}):s&&"noneYet"===e&&t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-6 justify-center items-center",children:[(0,l.jsxs)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(r.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(r.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]}),(0,l.jsx)(r.Qjf,{variant:"accent",href:n._.config.index,children:"Configure"})]})]}):s&&"noneYet"===e&&i.active?(0,l.jsxs)("div",{className:"flex flex-col gap-12 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center",children:[(0,l.jsxs)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",i.required," shards which means at least that many contracts are required."]}),(0,l.jsxs)(r.xvT,{size:"30",className:"text-center max-w-[500px]",children:[i.count,"/",i.required]})]})]}):"noneYet"===e?(0,l.jsx)(m,{}):null}var g=t(25573);function p(){let{isViewingABucket:e}=(0,c.Y)(),s=(0,g.n)(),t=u(),l=(0,h.F)();return e&&!t.active&&!l.active&&s.isSynced}function b(){let{uploadFiles:e,datasetPage:s,pageCount:t,dataState:i,columns:n,sortField:a,sortDirection:o,sortableColumns:d,toggleSort:x}=(0,c.Y)(),u=p();return(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(r.fhJ,{onDrop:e,noClick:!u||t>0,noDrag:!u,children:(0,l.jsx)(r.iA_,{isLoading:"loading"===i,emptyState:(0,l.jsx)(v,{}),pageSize:10,data:s,columns:n,sortableColumns:d,sortField:a,sortDirection:o,toggleSort:x,rowSize:"dense"})})})}var N=t(2784);function w(){let{activeDirectory:e,setActiveDirectory:s}=(0,c.Y)(),t=(0,N.useRef)(null);return(0,N.useEffect)(()=>{let e=setTimeout(()=>{var e;null===(e=t.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},100);return()=>{clearTimeout(e)}},[e]),(0,l.jsx)(r.xrM,{children:(0,l.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,l.jsx)(r.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Files"}),e.length>0&&(0,l.jsx)(r.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),e.map((e,t)=>(0,l.jsxs)(N.Fragment,{children:[t>0&&(0,l.jsx)(r.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(r.xvT,{onClick:()=>s(e=>e.slice(0,t+1)),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e})]},e+t)),(0,l.jsx)("div",{ref:t})]})})}var y=t(89630),T=t(74424),z=t(81471),k=t(52058);function S(){let{configurableColumns:e,toggleColumnVisibility:s,resetDefaultColumnVisibility:t,sortField:i,setSortField:n,sortDirection:a,setSortDirection:d,enabledColumns:x}=(0,c.Y)();return(0,l.jsxs)(r.J2e,{trigger:(0,l.jsxs)(r.zxk,{size:"small",tip:"Configure view",tipAlign:"end",children:[(0,l.jsx)(o.hiv,{}),"View",(0,l.jsx)(o.EMN,{})]}),contentProps:{align:"end",className:"max-w-[300px]"},children:[(0,l.jsxs)(r.WVB,{children:[(0,l.jsx)(r.__J,{children:"Order by"}),(0,l.jsx)(r.kFS,{children:(0,l.jsx)(r.PhF,{value:i,onChange:e=>{n(e.currentTarget.value)},children:Object.entries((0,k.Z)(z.Fo,"category")).map(e=>{let[s,t]=e;return(0,l.jsx)("optgroup",{label:s,children:t.map(e=>(0,l.jsx)(r.Wxm,{value:e.id,children:e.label},e.id))},s)})})})]}),(0,l.jsxs)(r.WVB,{children:[(0,l.jsx)(r.__J,{children:"Direction"}),(0,l.jsx)(r.kFS,{children:(0,l.jsxs)(r.PhF,{value:a,onClick:e=>{e.stopPropagation()},onChange:e=>{d(e.currentTarget.value)},children:[(0,l.jsx)(r.Wxm,{value:"desc",children:"descending"},"desc"),(0,l.jsx)(r.Wxm,{value:"asc",children:"ascending"},"asc")]})})]}),(0,l.jsx)(r.Clw,{}),(0,l.jsxs)(r.WVB,{children:[(0,l.jsx)(r.__J,{children:"Display properties"}),(0,l.jsx)(r.kFS,{children:(0,l.jsx)(r.zxk,{onClick:e=>{e.stopPropagation(),t()},children:"Reset default"})})]}),(0,l.jsx)(r.WVB,{children:(0,l.jsx)(r.j4H,{options:e.map(e=>({label:e.label,value:e.id})),values:x,onChange:e=>s(e)})})]})}let{useDropzone:F}=T;function _(){let{openDialog:e}=(0,a.Rh)(),{uploadFiles:s,isViewingBuckets:t}=(0,c.Y)(),i=p(),{getRootProps:n,getInputProps:d}=F({noDrag:!0,noClick:!i,onDrop:s});return(0,l.jsxs)("div",{className:"flex gap-2",children:[t?(0,l.jsxs)(r.zxk,{onClick:()=>e("filesCreateBucket"),tip:"Create bucket",children:[(0,l.jsx)(o.aXP,{}),"Create bucket"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.zxk,{onClick:()=>e("filesSearch"),tip:"Search files",children:(0,l.jsx)(o.UBs,{})}),(0,l.jsxs)(r.zxk,{...n(),tip:"Upload files",disabled:!i,children:[(0,l.jsx)("input",{...d()}),(0,l.jsx)(o.bQp,{})]}),(0,l.jsx)(r.zxk,{disabled:!i,onClick:()=>e("filesCreateDirectory"),tip:"Create directory",children:(0,l.jsx)(o.L37,{})})]}),(0,l.jsx)(S,{})]})}var C=t(25205);function O(){let e=(0,d.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}});if(!e.data&&e.isValidating)return(0,l.jsx)(r.xgg,{className:"pr-1"});if(!e.data)return null;let s=e.data.totalObjectsSize+e.data.totalUnfinishedObjectsSize,t=s?e.data.totalSectorsSize/s:0;return(0,l.jsx)(r.ua7,{side:"bottom",content:(0,l.jsxs)(r.xvT,{className:"flex justify-between gap-6",children:[(0,l.jsxs)(r.xvT,{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"size of all files"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"with redundancy"}),!!t&&(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"average redundancy factor"}),(0,l.jsx)(r.Z0O,{className:"w-full my-1"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"reclaimable space"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"total storage utilization"})]}),(0,l.jsxs)(r.xvT,{className:"flex flex-col gap-1 items-end",children:[(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalObjectsSize)}),(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalSectorsSize)}),!!t&&(0,l.jsxs)(r.xvT,{size:"12",font:"mono",children:[t.toFixed(1),"x"]}),(0,l.jsx)(r.Z0O,{className:"w-full my-1"}),(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalUploadedSize-e.data.totalSectorsSize)}),(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalUploadedSize)})]})]}),children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:"".concat((0,C.vW)(e.data.totalObjectsSize)).concat(t?" @ ".concat(t.toFixed(1),"x"):"")})})}var W=t(82439);function P(){var e,s;let t=(0,d.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),{displayHealth:i,label:n}=(0,W.B)({health:null===(e=t.data)||void 0===e?void 0:e.minHealth,size:1,isDirectory:!0}),a=(null===(s=t.data)||void 0===s?void 0:s.totalObjectsSize)===0;return!t.data||a?null:(0,l.jsx)(r.ua7,{align:"end",content:(0,l.jsxs)("div",{className:"flex flex-col overflow-hidden mb-1",children:[(0,l.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,l.jsx)(r.xvT,{size:"12",children:n}),(0,l.jsxs)(r.xvT,{size:"12",children:[(100*i).toFixed(0),"%"]})]}),(0,l.jsx)(r.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"Health is calculated as the minimum health value from across all file slabs. For directories this is across all contained files."}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"Slab health is calculated as the number of shards with active contracts in the autopilot contract set above the minimum required shards and expressed as a percentage."})]}),(0,l.jsx)(r.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex gap-3 justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"excellent health"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"good health"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"poor health"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[(0,l.jsxs)(r.xvT,{size:"12",color:"subtle",children:[100*W.V.excellent,"%"]}),(0,l.jsxs)(r.xvT,{size:"12",color:"subtle",children:[100*W.V.good,"% -"," ",100*W.V.excellent,"%"]}),(0,l.jsxs)(r.xvT,{size:"12",color:"subtle",children:[100*W.V.poor,"% - ",100*W.V.good,"%"]})]})]})]}),children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",className:"flex",children:n})})}var V=t(80489);function B(){let e=(0,g.n)(),s=function(){let{autopilot:e}=(0,x.q)(),s=function(){var e,s;let{autopilot:t}=(0,x.q)(),l=(0,d.e$)({disabled:"on"!==t.status}),i=(0,V.a)();return{isValidating:l.isValidating||i.isValidating,data:(null===(e=l.data)||void 0===e?void 0:e.contracts.set)===(null===(s=i.data)||void 0===s?void 0:s.default)}}(),t="on"===e.status&&!s.isValidating&&!s.data;return{active:t}}(),t=u(),i=(0,h.F)(),n=(0,N.useMemo)(()=>e.isSynced?null:(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until renterd is synced."}),(0,l.jsx)(r.nvN,{size:"12",children:"The blockchain must be fully synced before uploading files. This can take a while depending on your hardware and network connection."})]}),[e.isSynced]),a=(0,N.useMemo)(()=>t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(r.nvN,{size:"12",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(r.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(r.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]})]}):null,[t.active]),c=(0,N.useMemo)(()=>i.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(r.nvN,{size:"12",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",i.required," shards which means at least that many contracts are required."]})]}):null,[i]),f=(0,N.useMemo)(()=>s.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploaded data will not be managed by autopilot."}),(0,l.jsx)(r.nvN,{size:"12",children:"The autopilot contract set does not match the default contract set. This means that by default workers will not upload data to contracts that autopilot manages. Unless these contract are being manually maintained, this will result in data loss. Continue with caution or update the autopilot contract set to match the default contract set."})]}):null,[s.active]),j=(0,N.useMemo)(()=>[n,a,c,f].filter(Boolean),[n,a,c,f]);if(j.length)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.J2e,{trigger:(0,l.jsx)(r.zxk,{variant:"ghost",icon:"contrast",color:"amber",children:(0,l.jsx)(o.qdM,{})}),children:(0,l.jsx)("div",{className:"flex flex-col gap-3 px-1 py-2",children:j})}),(0,l.jsx)(r.Z0O,{variant:"vertical",className:"h-full"})]})}function J(){var e;let{isViewingABucket:s,pageCount:t,uploadsList:i}=(0,c.Y)(),n=(0,d.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),a=(null===(e=n.data)||void 0===e?void 0:e.numObjects)||0,o=i.length,x=a+o;return s?(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)(r.ua7,{side:"bottom",content:"Number of files in page of current directory",children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:t.toLocaleString()})}),(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:"of"}),(0,l.jsx)(r.ua7,{side:"bottom",content:"Number of files across all buckets",children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:n.data?"".concat(x.toLocaleString()," files"):" files"})})]}):(0,l.jsx)(r.ua7,{side:"bottom",content:"Number of files across all buckets",children:n.data?(0,l.jsxs)(r.xvT,{size:"12",font:"mono",children:[x.toLocaleString()," files"]}):(0,l.jsx)(r.xgg,{})})}var Y=t(94225);function E(){let{filters:e,setFilter:s,removeFilter:t}=(0,c.Y)(),[i,n]=(0,N.useState)(""),[a]=(0,Y.Nr)(i,500);return(0,N.useEffect)(()=>{let s=e.find(e=>"fileNamePrefix"===e.id),t=(null==s?void 0:s.value)||"";t!==i&&n(t)},[n,e]),(0,N.useEffect)(()=>{a.length?s({id:"fileNamePrefix",label:"",value:a}):t("fileNamePrefix")},[a]),(0,l.jsxs)("div",{className:"flex gap-1 flex-1",children:[(0,l.jsx)(r.nvn,{variant:"ghost",focus:"none",placeholder:"Filter files in current directory",value:i,onChange:e=>n(e.currentTarget.value),className:"w-full !pl-0"}),!!i.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.zxk,{variant:"ghost",onClick:()=>n(""),children:(0,l.jsx)(o.PcV,{})}),(0,l.jsx)(r.Z0O,{variant:"vertical",className:"h-full"})]})]})}function D(){let{limit:e,offset:s,pageCount:t,dataState:i,isViewingABucket:n,isViewingBuckets:a}=(0,c.Y)();return(0,l.jsxs)("div",{className:"flex gap-3 w-full",children:[a?(0,l.jsx)("div",{className:"flex-1"}):(0,l.jsx)(E,{}),(0,l.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,l.jsx)(B,{}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(r.ua7,{side:"bottom",content:"Filtered statistics",children:(0,l.jsx)(r.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.q0D,{})})}),(0,l.jsx)(J,{})]}),(0,l.jsx)(r.Z0O,{variant:"vertical",className:"h-full"}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(r.ua7,{side:"bottom",content:"Global statistics",children:(0,l.jsx)(r.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.RFr,{})})}),(0,l.jsx)(O,{}),(0,l.jsx)(P,{})]})]}),n&&(0,l.jsx)(r.wFK,{offset:s,limit:e,pageTotal:t,isLoading:"loading"===i})]})}function K(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsx)(y.J,{title:"Files",navTitle:null,routes:n._,sidenav:(0,l.jsx)(i.e,{}),nav:(0,l.jsx)(w,{}),stats:(0,l.jsx)(D,{}),actions:(0,l.jsx)(_,{}),openSettings:()=>e("settings"),children:(0,l.jsx)("div",{className:"p-6 min-w-fit",children:(0,l.jsx)(b,{})})})}function R(){return(0,l.jsx)(K,{})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=38345)}),_N_E=e.O()}]);
\ No newline at end of file
diff --git a/renterd/assets/_next/static/chunks/pages/files/[[...path]]-a1160caaddabffa9.js b/renterd/assets/_next/static/chunks/pages/files/[[...path]]-a1160caaddabffa9.js
deleted file mode 100644
index 4d2af2bec..000000000
--- a/renterd/assets/_next/static/chunks/pages/files/[[...path]]-a1160caaddabffa9.js
+++ /dev/null
@@ -1 +0,0 @@
-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{38345:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/files/[[...path]]",function(){return t(8715)}])},89630:function(e,s,t){"use strict";t.d(s,{J:function(){return h}});var l=t(52322),n=t(45898),i=t(9969),a=t(6391),r=t.n(a),c=t(71930),o=t(25573),d=t(88665);function x(){var e,s,t,a,r;let{openDialog:c}=(0,d.Rh)(),x=(0,i.d_)({config:{swr:{revalidateOnFocus:!1}}}),u=(0,i.X2)({config:{swr:{revalidateOnFocus:!1}}}),h=(0,i.cQ)(),f=(0,o.n)(),j=null===(e=x.data)||void 0===e?void 0:e.version,m="?"===j?"https://github.com/SiaFoundation/renterd/commits/":(null==j?void 0:j.match(/^v\d+\.\d+\.\d+/))?"https://github.com/SiaFoundation/renterd/releases/".concat(j):"https://github.com/SiaFoundation/renterd/tree/".concat(j);return(0,l.jsxs)(n.HfT,{name:"renterd",peerCount:null===(s=h.data)||void 0===s?void 0:s.length,connectPeer:()=>c("connectPeer"),isSynced:f.isSynced,syncPercent:f.syncPercent,nodeBlockHeight:f.nodeBlockHeight,estimatedBlockHeight:f.estimatedBlockHeight,firstTimeSyncing:f.firstTimeSyncing,moreThan100BlocksToSync:f.moreThan100BlocksToSync,children:[(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(n.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Wallet address"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(n.XxW,{size:"14",maxLength:50,value:null===(t=u.data)||void 0===t?void 0:t.address,type:"address"})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(n.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Network"}),(0,l.jsx)("div",{className:"flex-1 flex justify-end overflow-hidden -mr-0.5 pr-0.5",children:(0,l.jsx)(n.xvT,{size:"14",children:null===(a=x.data)||void 0===a?void 0:a.network})})]}),(0,l.jsxs)("div",{className:"flex gap-4 justify-between items-center",children:[(0,l.jsx)(n.__J,{size:"14",color:"subtle",noWrap:!0,className:"w-[100px]",children:"Version"}),(0,l.jsx)(n.rUS,{size:"14",href:m,underline:"hover",target:"_blank",ellipsis:!0,children:null===(r=x.data)||void 0===r?void 0:r.version})]})]})}function u(){let e=(0,i.d_)({config:{swr:{revalidateOnFocus:!1}}});return e.data&&"Mainnet"!==e.data.network?(0,l.jsx)(n.t6k,{testnetName:e.data.network}):null}function h(e){let s=(0,i.X2)(),{isSynced:t}=(0,o.n)();return(0,l.jsx)(n.tU3,{appName:"renterd",profile:(0,l.jsx)(x,{}),banner:(0,l.jsx)(u,{}),connectivityRoute:c.h,isSynced:t,walletBalanceSc:s.data&&{spendable:new(r())(s.data.spendable),confirmed:new(r())(s.data.confirmed),unconfirmed:new(r())(s.data.unconfirmed)},...e})}},91930:function(e,s,t){"use strict";t.d(s,{e:function(){return d}});var l=t(52322),n=t(45898),i=t(19387),a=t(9969),r=t(82851),c=t(71930),o=t(88665);function d(){var e,s;let t=(0,a.Z7)(),{openDialog:d}=(0,o.Rh)(),x=!(null===(e=t.data)||void 0===e?void 0:e.find(e=>"info"!==e.severity)),u=(null===(s=t.data)||void 0===s?void 0:s.length)||0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.KJW,{title:"Files",route:c._.files.index,children:(0,l.jsx)(i.ROc,{})}),(0,l.jsx)(n.KJW,{title:"Configuration",route:c._.config.index,children:(0,l.jsx)(i.wWN,{})}),(0,l.jsx)(n.KJW,{title:"Contracts",route:c._.contracts.index,children:(0,l.jsx)(i.VBo,{})}),(0,l.jsx)(n.KJW,{title:"Hosts",route:c._.hosts.index,children:(0,l.jsx)(i.VHe,{})}),(0,l.jsx)(n.KJW,{title:"S3 authentication keypairs",route:c._.keys.index,children:(0,l.jsx)(i._m8,{})}),(0,l.jsxs)("div",{className:"relative",children:[!!u&&x&&(0,l.jsx)("div",{className:(0,r.cx)("absolute -right-[2px] top-px w-1 h-1","rounded-full","bg-gray-1000 dark:bg-white","pointer-events-none")}),!!u&&!x&&(0,l.jsx)(n.xvT,{size:"10",className:(0,r.cx)("absolute -right-[9px] -top-1 py-px px-[5px]","text-white","bg-red-500 dark:bg-red-500 rounded","pointer-events-none"),color:"none",children:u.toLocaleString()}),(0,l.jsx)(n.KJW,{title:"Alerts",onClick:()=>d("alerts"),children:(0,l.jsx)(i.Dkj,{})})]})]})}},8715:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return R}});var l=t(52322),n=t(91930),i=t(71930),a=t(88665),r=t(45898),c=t(48528),o=t(19387),d=t(9969),x=t(91641);function u(){let{autopilot:e}=(0,x.q)(),s=(0,d.e$)({config:{swr:{errorRetryCount:0}}});return{active:"on"===e.status&&!!s.error}}var h=t(4370);function f(){return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Ckx,{className:"scale-[200%]"})}),(0,l.jsx)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"Error fetching files."})]})}function j(){let{filters:e,resetFilters:s}=(0,c.Y)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px]",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Hb6,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsx)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:"No files matching filters."}),!!e.length&&(0,l.jsx)(r.zxk,{onClick:e=>{e.stopPropagation(),s()},children:"Clear filters"})]})]})}function m(){let{activeBucket:e}=(0,c.Y)();return(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 items-center",children:[(0,l.jsxs)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["The ",(0,l.jsx)(r.EKh,{children:e})," bucket does not contain any files, drag and drop files or click here to start uploading."]}),(0,l.jsx)(r.Qjf,{href:i._.files.index,onClick:e=>{e.stopPropagation()},children:"View buckets list"})]})]})}function v(){let{dataState:e,isViewingRootOfABucket:s}=(0,c.Y)(),t=u(),n=(0,h.F)();return"noneMatchingFilters"===e?(0,l.jsx)(j,{}):"error"===e?(0,l.jsx)(f,{}):s&&"noneYet"===e&&t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-10 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-6 justify-center items-center",children:[(0,l.jsxs)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(r.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(r.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]}),(0,l.jsx)(r.Qjf,{variant:"accent",href:i._.config.index,children:"Configure"})]})]}):s&&"noneYet"===e&&n.active?(0,l.jsxs)("div",{className:"flex flex-col gap-12 justify-center items-center h-[400px] cursor-pointer",children:[(0,l.jsx)(r.xvT,{children:(0,l.jsx)(o.Y9T,{className:"scale-[200%]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center",children:[(0,l.jsxs)(r.xvT,{color:"subtle",className:"text-center max-w-[500px]",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",n.required," shards which means at least that many contracts are required."]}),(0,l.jsxs)(r.xvT,{size:"30",className:"text-center max-w-[500px]",children:[n.count,"/",n.required]})]})]}):"noneYet"===e?(0,l.jsx)(m,{}):null}var g=t(25573);function p(){let{isViewingABucket:e}=(0,c.Y)(),s=(0,g.n)(),t=u(),l=(0,h.F)();return e&&!t.active&&!l.active&&s.isSynced}function b(){let{uploadFiles:e,datasetPage:s,pageCount:t,dataState:n,columns:i,sortField:a,sortDirection:o,sortableColumns:d,toggleSort:x}=(0,c.Y)(),u=p();return(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(r.fhJ,{onDrop:e,noClick:!u||t>0,noDrag:!u,children:(0,l.jsx)(r.iA_,{isLoading:"loading"===n,emptyState:(0,l.jsx)(v,{}),pageSize:10,data:s,columns:i,sortableColumns:d,sortField:a,sortDirection:o,toggleSort:x,rowSize:"dense"})})})}var N=t(2784);function w(){let{activeDirectory:e,setActiveDirectory:s}=(0,c.Y)(),t=(0,N.useRef)(null);return(0,N.useEffect)(()=>{let e=setTimeout(()=>{var e;null===(e=t.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},100);return()=>{clearTimeout(e)}},[e]),(0,l.jsx)(r.xrM,{children:(0,l.jsxs)("div",{className:"flex gap-1 items-center h-full",children:[(0,l.jsx)(r.xvT,{onClick:()=>s(()=>[]),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:"Files"}),e.length>0&&(0,l.jsx)(r.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),e.map((e,t)=>(0,l.jsxs)(N.Fragment,{children:[t>0&&(0,l.jsx)(r.xvT,{size:"16",color:"verySubtle",className:"flex items-center",children:(0,l.jsx)(o.F3j,{})}),(0,l.jsx)(r.xvT,{onClick:()=>s(e=>e.slice(0,t+1)),size:"18",weight:"semibold",className:"flex items-center cursor-pointer",noWrap:!0,children:e})]},e+t)),(0,l.jsx)("div",{ref:t})]})})}var y=t(89630),T=t(74424),z=t(81471),k=t(52058);function S(){let{configurableColumns:e,toggleColumnVisibility:s,resetDefaultColumnVisibility:t,sortField:n,setSortField:i,sortDirection:a,setSortDirection:d,enabledColumns:x}=(0,c.Y)();return(0,l.jsxs)(r.J2e,{trigger:(0,l.jsxs)(r.zxk,{size:"small",tip:"Configure view",tipAlign:"end",children:[(0,l.jsx)(o.hiv,{}),"View",(0,l.jsx)(o.EMN,{})]}),contentProps:{align:"end",className:"max-w-[300px]"},children:[(0,l.jsxs)(r.WVB,{children:[(0,l.jsx)(r.__J,{children:"Order by"}),(0,l.jsx)(r.kFS,{children:(0,l.jsx)(r.PhF,{value:n,onChange:e=>{i(e.currentTarget.value)},children:Object.entries((0,k.Z)(z.Fo,"category")).map(e=>{let[s,t]=e;return(0,l.jsx)("optgroup",{label:s,children:t.map(e=>(0,l.jsx)(r.Wxm,{value:e.id,children:e.label},e.id))},s)})})})]}),(0,l.jsxs)(r.WVB,{children:[(0,l.jsx)(r.__J,{children:"Direction"}),(0,l.jsx)(r.kFS,{children:(0,l.jsxs)(r.PhF,{value:a,onClick:e=>{e.stopPropagation()},onChange:e=>{d(e.currentTarget.value)},children:[(0,l.jsx)(r.Wxm,{value:"desc",children:"descending"},"desc"),(0,l.jsx)(r.Wxm,{value:"asc",children:"ascending"},"asc")]})})]}),(0,l.jsx)(r.Clw,{}),(0,l.jsxs)(r.WVB,{children:[(0,l.jsx)(r.__J,{children:"Display properties"}),(0,l.jsx)(r.kFS,{children:(0,l.jsx)(r.zxk,{onClick:e=>{e.stopPropagation(),t()},children:"Reset default"})})]}),(0,l.jsx)(r.WVB,{children:(0,l.jsx)(r.j4H,{options:e.map(e=>({label:e.label,value:e.id})),values:x,onChange:e=>s(e)})})]})}let{useDropzone:F}=T;function _(){let{openDialog:e}=(0,a.Rh)(),{uploadFiles:s,isViewingBuckets:t}=(0,c.Y)(),n=p(),{getRootProps:i,getInputProps:d}=F({noDrag:!0,noClick:!n,onDrop:s});return(0,l.jsxs)("div",{className:"flex gap-2",children:[t?(0,l.jsxs)(r.zxk,{onClick:()=>e("filesCreateBucket"),tip:"Create bucket",children:[(0,l.jsx)(o.aXP,{}),"Create bucket"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.zxk,{onClick:()=>e("filesSearch"),tip:"Search files",children:(0,l.jsx)(o.UBs,{})}),(0,l.jsxs)(r.zxk,{...i(),tip:"Upload files",disabled:!n,children:[(0,l.jsx)("input",{...d()}),(0,l.jsx)(o.bQp,{})]}),(0,l.jsx)(r.zxk,{disabled:!n,onClick:()=>e("filesCreateDirectory"),tip:"Create directory",children:(0,l.jsx)(o.L37,{})})]}),(0,l.jsx)(S,{})]})}var C=t(25205);function W(){let e=(0,d.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}});if(!e.data&&e.isValidating)return(0,l.jsx)(r.xgg,{className:"pr-1"});if(!e.data)return null;let s=e.data.totalObjectsSize+e.data.totalUnfinishedObjectsSize,t=s?e.data.totalSectorsSize/s:0;return(0,l.jsx)(r.ua7,{side:"bottom",content:(0,l.jsxs)(r.xvT,{className:"flex justify-between gap-6",children:[(0,l.jsxs)(r.xvT,{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"size of all files"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"with redundancy"}),!!t&&(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"average redundancy factor"}),(0,l.jsx)(r.Z0O,{className:"w-full my-1"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"reclaimable space"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"total storage utilization"})]}),(0,l.jsxs)(r.xvT,{className:"flex flex-col gap-1 items-end",children:[(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalObjectsSize)}),(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalSectorsSize)}),!!t&&(0,l.jsxs)(r.xvT,{size:"12",font:"mono",children:[t.toFixed(1),"x"]}),(0,l.jsx)(r.Z0O,{className:"w-full my-1"}),(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalUploadedSize-e.data.totalSectorsSize)}),(0,l.jsx)(r.xvT,{size:"12",children:(0,C.vW)(e.data.totalUploadedSize)})]})]}),children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:"".concat((0,C.vW)(e.data.totalObjectsSize)).concat(t?" @ ".concat(t.toFixed(1),"x"):"")})})}var O=t(82439);function P(){var e;let s=(0,d.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),{displayHealth:t,label:n}=(0,O.B)({health:null===(e=s.data)||void 0===e?void 0:e.minHealth,size:1,isDirectory:!0});return s.data?(0,l.jsx)(r.ua7,{align:"end",content:(0,l.jsxs)("div",{className:"flex flex-col overflow-hidden mb-1",children:[(0,l.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,l.jsx)(r.xvT,{size:"12",children:n}),(0,l.jsxs)(r.xvT,{size:"12",children:[(100*t).toFixed(0),"%"]})]}),(0,l.jsx)(r.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"Health is calculated as the minimum health value from across all file slabs. For directories this is across all contained files."}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"Slab health is calculated as the number of shards with active contracts in the autopilot contract set above the minimum required shards and expressed as a percentage."})]}),(0,l.jsx)(r.Z0O,{className:"w-full my-1.5"}),(0,l.jsxs)("div",{className:"flex gap-3 justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"excellent health"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"good health"}),(0,l.jsx)(r.xvT,{size:"12",color:"subtle",children:"poor health"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[(0,l.jsxs)(r.xvT,{size:"12",color:"subtle",children:[100*O.V.excellent,"%"]}),(0,l.jsxs)(r.xvT,{size:"12",color:"subtle",children:[100*O.V.good,"% -"," ",100*O.V.excellent,"%"]}),(0,l.jsxs)(r.xvT,{size:"12",color:"subtle",children:[100*O.V.poor,"% - ",100*O.V.good,"%"]})]})]})]}),children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",className:"flex",children:n})}):null}var V=t(80489);function B(){let e=(0,g.n)(),s=function(){let{autopilot:e}=(0,x.q)(),s=function(){var e,s;let{autopilot:t}=(0,x.q)(),l=(0,d.e$)({disabled:"on"!==t.status}),n=(0,V.a)();return{isValidating:l.isValidating||n.isValidating,data:(null===(e=l.data)||void 0===e?void 0:e.contracts.set)===(null===(s=n.data)||void 0===s?void 0:s.default)}}(),t="on"===e.status&&!s.isValidating&&!s.data;return{active:t}}(),t=u(),n=(0,h.F)(),i=(0,N.useMemo)(()=>e.isSynced?null:(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until renterd is synced."}),(0,l.jsx)(r.nvN,{size:"12",children:"The blockchain must be fully synced before uploading files. This can take a while depending on your hardware and network connection."})]}),[e.isSynced]),a=(0,N.useMemo)(()=>t.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(r.nvN,{size:"12",children:["Before you can upload files you must configure your settings. Once configured, ",(0,l.jsx)(r.EKh,{children:"renterd"})," will find contracts with hosts based on the settings you choose. ",(0,l.jsx)(r.EKh,{children:"renterd"})," will also repair your data as hosts come and go."]})]}):null,[t.active]),c=(0,N.useMemo)(()=>n.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploads are disabled until settings are configured."}),(0,l.jsxs)(r.nvN,{size:"12",children:["There are not enough contracts to upload data yet. Redundancy is configured to use ",n.required," shards which means at least that many contracts are required."]})]}):null,[n]),f=(0,N.useMemo)(()=>s.active?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.xvT,{size:"12",font:"mono",weight:"medium",color:"amber",children:"Uploaded data will not be managed by autopilot."}),(0,l.jsx)(r.nvN,{size:"12",children:"The autopilot contract set does not match the default contract set. This means that by default workers will not upload data to contracts that autopilot manages. Unless these contract are being manually maintained, this will result in data loss. Continue with caution or update the autopilot contract set to match the default contract set."})]}):null,[s.active]),j=(0,N.useMemo)(()=>[i,a,c,f].filter(Boolean),[i,a,c,f]);if(j.length)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.J2e,{trigger:(0,l.jsx)(r.zxk,{variant:"ghost",icon:"contrast",color:"amber",children:(0,l.jsx)(o.qdM,{})}),children:(0,l.jsx)("div",{className:"flex flex-col gap-3 px-1 py-2",children:j})}),(0,l.jsx)(r.Z0O,{variant:"vertical",className:"h-full"})]})}function J(){var e;let{isViewingABucket:s,pageCount:t,uploadsList:n}=(0,c.Y)(),i=(0,d.Q5)({config:{swr:{refreshInterval:6e4,keepPreviousData:!0,revalidateOnFocus:!1}}}),a=(null===(e=i.data)||void 0===e?void 0:e.numObjects)||0,o=n.length,x=a+o;return s?(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)(r.ua7,{side:"bottom",content:"Number of files in page of current directory",children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:t.toLocaleString()})}),(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:"of"}),(0,l.jsx)(r.ua7,{side:"bottom",content:"Number of files across all buckets",children:(0,l.jsx)(r.xvT,{size:"12",font:"mono",children:i.data?"".concat(x.toLocaleString()," files"):" files"})})]}):(0,l.jsx)(r.ua7,{side:"bottom",content:"Number of files across all buckets",children:i.data?(0,l.jsxs)(r.xvT,{size:"12",font:"mono",children:[x.toLocaleString()," files"]}):(0,l.jsx)(r.xgg,{})})}var Y=t(94225);function E(){let{filters:e,setFilter:s,removeFilter:t}=(0,c.Y)(),[n,i]=(0,N.useState)(""),[a]=(0,Y.Nr)(n,500);return(0,N.useEffect)(()=>{let s=e.find(e=>"fileNamePrefix"===e.id),t=(null==s?void 0:s.value)||"";t!==n&&i(t)},[i,e]),(0,N.useEffect)(()=>{a.length?s({id:"fileNamePrefix",label:"",value:a}):t("fileNamePrefix")},[a]),(0,l.jsxs)("div",{className:"flex gap-1 flex-1",children:[(0,l.jsx)(r.nvn,{variant:"ghost",focus:"none",placeholder:"Filter files in current directory",value:n,onChange:e=>i(e.currentTarget.value),className:"w-full !pl-0"}),!!n.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.zxk,{variant:"ghost",onClick:()=>i(""),children:(0,l.jsx)(o.PcV,{})}),(0,l.jsx)(r.Z0O,{variant:"vertical",className:"h-full"})]})]})}function D(){let{limit:e,offset:s,pageCount:t,dataState:n,isViewingABucket:i,isViewingBuckets:a}=(0,c.Y)();return(0,l.jsxs)("div",{className:"flex gap-3 w-full",children:[a?(0,l.jsx)("div",{className:"flex-1"}):(0,l.jsx)(E,{}),(0,l.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,l.jsx)(B,{}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(r.ua7,{side:"bottom",content:"Filtered statistics",children:(0,l.jsx)(r.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.q0D,{})})}),(0,l.jsx)(J,{})]}),(0,l.jsx)(r.Z0O,{variant:"vertical",className:"h-full"}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(r.ua7,{side:"bottom",content:"Global statistics",children:(0,l.jsx)(r.xvT,{size:"12",color:"verySubtle",children:(0,l.jsx)(o.RFr,{})})}),(0,l.jsx)(W,{}),(0,l.jsx)(P,{})]})]}),i&&(0,l.jsx)(r.wFK,{offset:s,limit:e,pageTotal:t,isLoading:"loading"===n})]})}function K(){let{openDialog:e}=(0,a.Rh)();return(0,l.jsx)(y.J,{title:"Files",navTitle:null,routes:i._,sidenav:(0,l.jsx)(n.e,{}),nav:(0,l.jsx)(w,{}),stats:(0,l.jsx)(D,{}),actions:(0,l.jsx)(_,{}),openSettings:()=>e("settings"),children:(0,l.jsx)("div",{className:"p-6 min-w-fit",children:(0,l.jsx)(b,{})})})}function R(){return(0,l.jsx)(K,{})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=38345)}),_N_E=e.O()}]);
\ No newline at end of file
diff --git a/renterd/assets/config.html b/renterd/assets/config.html
index cf9b047a5..88d07382b 100644
--- a/renterd/assets/config.html
+++ b/renterd/assets/config.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/contracts.html b/renterd/assets/contracts.html
index be50768af..fa3807ce9 100644
--- a/renterd/assets/contracts.html
+++ b/renterd/assets/contracts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/files/[[...path]].html b/renterd/assets/files/[[...path]].html
index 66f164a5d..86d6efa77 100644
--- a/renterd/assets/files/[[...path]].html
+++ b/renterd/assets/files/[[...path]].html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/hosts.html b/renterd/assets/hosts.html
index 69369010b..29634e9bb 100644
--- a/renterd/assets/hosts.html
+++ b/renterd/assets/hosts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/index.html b/renterd/assets/index.html
index 85cf7c5cd..acb3f221f 100644
--- a/renterd/assets/index.html
+++ b/renterd/assets/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/keys.html b/renterd/assets/keys.html
index 729d905e7..c9cec202b 100644
--- a/renterd/assets/keys.html
+++ b/renterd/assets/keys.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/login.html b/renterd/assets/login.html
index 4a2b8d1be..0a791df9b 100644
--- a/renterd/assets/login.html
+++ b/renterd/assets/login.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/node.html b/renterd/assets/node.html
index 762ad9700..764465438 100644
--- a/renterd/assets/node.html
+++ b/renterd/assets/node.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/wallet.html b/renterd/assets/wallet.html
index e19a33746..a2e8a85da 100644
--- a/renterd/assets/wallet.html
+++ b/renterd/assets/wallet.html
@@ -1 +1 @@
-