ryco-cli 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/client/assets/{AccountSettings-BUoiS8x1.js → AccountSettings-Be5_48k0.js} +1 -1
- package/dist/client/assets/{AiFocusSettings-Cz1Uqn7a.js → AiFocusSettings-DIpQXLW2.js} +1 -1
- package/dist/client/assets/{BranchToolbar.logic-LIanCEVr.js → BranchToolbar.logic-D7slG_zJ.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-CKEjpQ_x.js → ChatRightPanel-BIS1DPGa.js} +3 -3
- package/dist/client/assets/{ChatThreadRouteView-D50onHY2.js → ChatThreadRouteView-CocRstME.js} +1 -1
- package/dist/client/assets/{CommandPaletteDialog-DdRKgZ8m.js → CommandPaletteDialog-C5xAo65V.js} +1 -1
- package/dist/client/assets/ConnectionsSettings-CXabxSaH.js +7 -0
- package/dist/client/assets/{DiagnosticsSettings-C74u3ce5.js → DiagnosticsSettings-CZ3vY43G.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-RTmLGTl0.js → DraftChatThreadRouteView-D8Bt3Qnq.js} +1 -1
- package/dist/client/assets/{HostedConnectionControls-CKiC01ju.js → HostedConnectionControls-DxAXv0Hd.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-BS3rAYTy.js → HostedHubRoot-Cc8GYcK6.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-BFTDyh4N.js → HostedNativeAuthorizationRoute-CTQe7Vjt.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-eEOPKsBg.js → HostedRelayTrustNotice-BldMySVi.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-Cg4eRHm_.js → IntegrationsSettingsPanel-D6f3KoqM.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-CYj67N2D.js → KeybindingsSettings-D2bNQPI-.js} +1 -1
- package/dist/client/assets/{McpServersSettings-Bc61hRUY.js → McpServersSettings-B7YqVvV4.js} +1 -1
- package/dist/client/assets/{NewWorktreeDialog-CTlFjKa4.js → NewWorktreeDialog-CKr2ioue.js} +1 -1
- package/dist/client/assets/{NoActiveThreadState-Dw9aoU2J.js → NoActiveThreadState-BD-eNmfn.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-DMkkTgfg.js → NodeSecuritySettings-FWM_SeDi.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-CeoSmZ90.js → OpinionatedPluginsSettings-BtZQF4Ze.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-7ZxxVbUB.js → PhoneGetAppInterstitial-CooQgpSw.js} +1 -1
- package/dist/client/assets/{PhoneHome-DRRoCd_y.js → PhoneHome-BtPE7bQn.js} +1 -1
- package/dist/client/assets/{PhoneSettingsSurface-LNEaPHQC.js → PhoneSettingsSurface-tcFCccEL.js} +1 -1
- package/dist/client/assets/{ProjectFavicon-BIMdZxK6.js → ProjectFavicon-qZGdjYCM.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-jd6GjQkO.js → ProviderModelPicker-D0w23uWo.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-v2SvoEGx.js → ProvidersSettingsPanel-B3aBKY--.js} +1 -1
- package/dist/client/assets/{RootAppShell-CFjrYjtn.js → RootAppShell-C-0ChFVJ.js} +2 -2
- package/dist/client/assets/SettingsDialog-Bbuoh793.js +1 -0
- package/dist/client/assets/{SettingsPanels-BmhZ8u4B.js → SettingsPanels-Dr4f2y9l.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-DvPydmxX.js → SourceControlSettings-CkiYR4lR.js} +1 -1
- package/dist/client/assets/{StatisticsPage-Duk2cHVH.js → StatisticsPage-Bjouapmf.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-D-uNJcdj.js → StatisticsPanel-D_khPph6.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-D0xoATCw.js → ThreadStatusIndicators-ZImeLExQ.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-DjX8p7IH.js → ThreadTerminalDrawer-DDHEuRGB.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-DI0GXPBf.js → ThreadWorkspacePanel-QF3KwbGm.js} +1 -1
- package/dist/client/assets/{WorkItemsTab-ow45makA.js → WorkItemsTab-AOVwVvb7.js} +1 -1
- package/dist/client/assets/{branding-C8SLy6Af.js → branding-BDfN6Spd.js} +1 -1
- package/dist/client/assets/{capabilities-BQuqC7jg.js → capabilities-3zgirmmI.js} +1 -1
- package/dist/client/assets/{desktopUpdateAtoms-C82GmR67.js → desktopUpdateAtoms-CyfPW2jg.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-G5Z_JRbm.js → desktopWorkspace-DHUZEpfy.js} +1 -1
- package/dist/client/assets/{device-B56cBWWt.js → device-B_qvyvtW.js} +1 -1
- package/dist/client/assets/{editorPreferences-CTDEj79K.js → editorPreferences-DHIJntKF.js} +1 -1
- package/dist/client/assets/{index-Bbz4fkK_.js → index-CQmEMMQH.js} +1 -1
- package/dist/client/assets/{main-Dwu2cT6v.js → main-BKS5Nf2_.js} +2 -2
- package/dist/client/assets/primary-BzLEg2w1.js +2 -0
- package/dist/client/assets/{projectPaths-lDhAE9o_.js → projectPaths-BAd6NFcE.js} +1 -1
- package/dist/client/assets/{providerIconUtils-DnSYUN9l.js → providerIconUtils-X0Z3EK-Q.js} +1 -1
- package/dist/client/assets/runtime-CXut_g4p.js +1 -0
- package/dist/client/assets/{session-logic-DElAta-Z.js → session-logic-GZix7S2I.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-Cs13ZUN8.js → sidebarProjectFolders-cnmz3B_-.js} +1 -1
- package/dist/client/assets/storeSelectors-DYekgeHu.js +1 -0
- package/dist/client/assets/{threadPriorityRefreshRuntime-DJF5drVD.js → threadPriorityRefreshRuntime-Ct5pnIbX.js} +1 -1
- package/dist/client/assets/types-DYekgeHu.js +1 -0
- package/dist/client/assets/{useAtlassian-Bx2ua3JV.js → useAtlassian-9-hy2f8z.js} +0 -0
- package/dist/client/assets/{useHandleNewThread-DHO0PWGZ.js → useHandleNewThread-DX2FtXcP.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions-OTf7yIbN.js → usePhoneThreadActions-BEa3VzGG.js} +1 -1
- package/dist/client/assets/{useStatistics-DEtKeVPP.js → useStatistics-CtunoTE-.js} +1 -1
- package/dist/client/assets/{useThreadActions-DLxhOMkz.js → useThreadActions-fN-Al13y.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ConnectionsSettings--CbTzkTn.js +0 -7
- package/dist/client/assets/SettingsDialog-CvGTsSV0.js +0 -1
- package/dist/client/assets/primary-OskAInOO.js +0 -2
- package/dist/client/assets/runtime-DKwoXpJv.js +0 -1
- package/dist/client/assets/storeSelectors-Cq_JKyiF.js +0 -1
- package/dist/client/assets/types-Cq_JKyiF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-Bbz4fkK_.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import"./src-Vf4LVnMX.js";import{F as i,Jt as a,M as o,N as s,P as c,Wt as l}from"./runtime-DKwoXpJv.js";import{It as u}from"./composerDraftStore-CdJJZe42.js";import{a as d,i as f,o as p}from"./useHandleNewThread-DHO0PWGZ.js";import{t as m}from"./useNavigate-2tVq4iZ2.js";import{Gt as h,_ as g,o as _}from"./authorization-mIJKV2yp.js";import{t as v}from"./RootAppShell-CFjrYjtn.js";import{f as y}from"./useRenderElement-DchFnsR8.js";import{t as b}from"./arrow-left-Dtj9PfsA.js";import{n as x,t as S}from"./loader-circle-CrtHFAvM.js";import{t as C}from"./chevron-down-B7C6FKzM.js";import{t as w}from"./chevron-right-BWYGybX9.js";import{n as T,o as E,t as D}from"./toast-CcSCAm4B.js";import{t as O}from"./copy-UQjKGt7t.js";import{t as k}from"./key-round-CacMputS.js";import{_ as A,a as j,c as M,d as N,f as P,g as F,h as I,i as L,l as R,m as z,o as B,p as ee,t as te,u as ne}from"./HostedConnectionControls-CKiC01ju.js";import{t as re}from"./log-out-tMJm0Gk6.js";import{t as V}from"./palette-BSD_aJZg.js";import{t as ie}from"./refresh-cw-DopCMrtR.js";import{t as ae}from"./server-JApJpgLa.js";import{t as H}from"./shield-check-dQ-4cMKk.js";import{t as oe}from"./triangle-alert-RL_T3KLo.js";import{t as se}from"./user-round-Cpzx8pSw.js";import{t as U}from"./utils-BofFIn5Y.js";import{n as W,t as G}from"./input-CHEwW3oH.js";import{u as ce}from"./Icons-CT3nd2MA.js";import{t as K}from"./button-BAbJxRzt.js";import{t as q}from"./useCopyToClipboard-BTpWxumf.js";import{a as le,i as J,n as ue,o as de,r as fe,s as pe,t as me}from"./sheet-BO78gIKZ.js";import{t as he}from"./skeleton-CvQSeJbw.js";import{t as ge}from"./usePresentationTier-B_SCFvN7.js";import{i as _e,r as ve,t as ye}from"./alert-LqMhbdE9.js";import{a as be,c as xe,i as Se,o as Ce,r as we,s as Te,t as Ee}from"./dialog-DQsYchqu.js";import{t as Y}from"./label-CVFHsLFO.js";import{t as De}from"./RycoLetterMark-Bk0kvGJ_.js";import{a as Oe,i as ke,n as Ae,o as je,r as Me,t as Ne}from"./MobileSheet-CkeG6_SP.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,t as ze}from"./empty-DwzqNgCP.js";import{c as Be,n as Ve,r as He,t as Ue}from"./ExternalIdentityWeb.logic-D64j70NH.js";import{a as We}from"./settingsLayout-D8glO7f1.js";import{n as Ge,r as Ke,t as qe}from"./phoneAnchoredActions-CtpkI3yG.js";import{t as Je}from"./HostedRelayTrustNotice-eEOPKsBg.js";import{n as X,t as Ye}from"./data-list-CYKBxN62.js";var Xe=y(`life-buoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),Ze=y(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Z=e(t(),1),Q=r(),Qe=/^[A-Za-z0-9_-]{43}$/u,$e=/^signup_[A-Za-z0-9_-]{22,43}$/u;function et(e){if(e.pathname===`/public-signup/verify`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash),n=t.get(`attempt`),r=t.get(`attempt_secret`),i=t.get(`token`);return n!==null&&$e.test(n)&&r!==null&&Qe.test(r)&&i!==null&&Qe.test(i)?{kind:`signup-verification`,attemptId:n,attemptSecret:r,token:i}:{kind:`invalid-signup-verification`}}if(e.pathname===`/password-reset`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&Qe.test(t)?{kind:`password-reset`,token:t}:{kind:`invalid-password-reset`}}if(e.pathname===`/email-verification`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&Qe.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function tt(e){let t=new URL(e.href),n=et(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function nt(){let e=(0,Q.c)(3),t=s(ot),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(t!==`authenticated`)return;let e=it,n=()=>{document.visibilityState===`hidden`?(d(!0),_.suspendBrowser(`hidden`)):e()},r=rt,i=()=>e(),a=()=>e();return document.addEventListener(`visibilitychange`,n),window.addEventListener(`offline`,r),window.addEventListener(`online`,i),window.addEventListener(`pageshow`,a),navigator.onLine||r(),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`offline`,r),window.removeEventListener(`online`,i),window.removeEventListener(`pageshow`,a)}},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function rt(){d(!0),_.suspendBrowser(`offline`)}function it(){document.visibilityState===`visible`&&navigator.onLine&&_.resumeBrowser().then(at)}function at(){return d(!1)}function ot(e){return e.accountStatus}var $=u(),st=100;function ct(e){let t=(0,Q.c)(52),{node:n,open:r,onOpenChange:i,onRename:a}=e,[o,s]=(0,Z.useState)(n.label),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f,p;t[0]!==n.label||t[1]!==r?(f=()=>{r&&(s(n.label),l(!1),d(null))},p=[n.label,r],t[0]=n.label,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Z.useEffect)(f,p);let m;t[4]===o?m=t[5]:(m=o.trim(),t[4]=o,t[5]=m);let h=m,g=h.length===0?`Enter a node name.`:h.length>st?`Use 100 characters or fewer.`:null,_=g===null&&h!==n.label&&!c,v;t[6]!==_||t[7]!==h||t[8]!==i||t[9]!==a?(v=async()=>{if(_){l(!0),d(null);try{await a(h),i(!1)}catch(e){let t=e;d(t instanceof Error?t.message:`Unable to rename this node.`),l(!1)}}},t[6]=_,t[7]=h,t[8]=i,t[9]=a,t[10]=v):v=t[10];let y=v,b=!c,x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(be,{children:[(0,$.jsx)(xe,{children:`Rename node`}),(0,$.jsx)(we,{children:`This is the canonical name shown to everyone authorized to use this node.`})]}),t[11]=x):x=t[11];let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`label`,{htmlFor:`hosted-node-name`,className:`text-sm font-medium`,children:`Node name`}),t[12]=S):S=t[12];let C=g!==null||u!==null,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{s(e.currentTarget.value),d(null)},t[13]=w):w=t[13];let T;t[14]!==_||t[15]!==y?(T=e=>{e.key===`Enter`&&_&&y()},t[14]=_,t[15]=y,t[16]=T):T=t[16];let E;t[17]!==o||t[18]!==c||t[19]!==T||t[20]!==C?(E=(0,$.jsx)(G,{id:`hosted-node-name`,value:o,autoFocus:!0,disabled:c,"aria-invalid":C,onChange:w,onKeyDown:T}),t[17]=o,t[18]=c,t[19]=T,t[20]=C,t[21]=E):E=t[21];let D;t[22]===g?D=t[23]:(D=g?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:g}):null,t[22]=g,t[23]=D);let O;t[24]===u?O=t[25]:(O=u?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u}):null,t[24]=u,t[25]=O);let k;t[26]!==E||t[27]!==D||t[28]!==O?(k=(0,$.jsxs)(Ce,{className:`space-y-2`,children:[S,E,D,O]}),t[26]=E,t[27]=D,t[28]=O,t[29]=k):k=t[29];let A;t[30]===i?A=t[31]:(A=()=>i(!1),t[30]=i,t[31]=A);let j;t[32]!==c||t[33]!==A?(j=(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:A,children:`Cancel`}),t[32]=c,t[33]=A,t[34]=j):j=t[34];let M=!_,N;t[35]===y?N=t[36]:(N=()=>void y(),t[35]=y,t[36]=N);let P=c?`Saving…`:`Save`,F;t[37]!==M||t[38]!==N||t[39]!==P?(F=(0,$.jsx)(K,{disabled:M,onClick:N,children:P}),t[37]=M,t[38]=N,t[39]=P,t[40]=F):F=t[40];let I;t[41]!==j||t[42]!==F?(I=(0,$.jsxs)(Se,{children:[j,F]}),t[41]=j,t[42]=F,t[43]=I):I=t[43];let L;t[44]!==k||t[45]!==I||t[46]!==b?(L=(0,$.jsxs)(Te,{className:`max-w-md`,showCloseButton:b,children:[x,k,I]}),t[44]=k,t[45]=I,t[46]=b,t[47]=L):L=t[47];let R;return t[48]!==i||t[49]!==r||t[50]!==L?(R=(0,$.jsx)(Ee,{open:r,onOpenChange:i,children:L}),t[48]=i,t[49]=r,t[50]=L,t[51]=R):R=t[51],R}var lt=`owner_revoked`,ut=Object.freeze([Object.freeze({id:`access`,text:`Every Hub grant on this node stops working immediately, for everyone authorized through this Hub — not only for you — and any relay channel it has open right now closes.`}),Object.freeze({id:`direct`,text:`Clients paired directly with that machine are separate and keep working. Those are managed on the machine itself, with the ryco auth command.`}),Object.freeze({id:`directory`,text:`It leaves the directory for every account on this Hub, not only yours, and stays gone. There is no undo here and no state it can return to.`}),Object.freeze({id:`return`,text:`Putting that machine back starts on the machine itself: use “Leave this Hub” there, then enroll it again with a new device code and your approval. It is a new enrollment, not a reconnection.`}),Object.freeze({id:`reach`,text:`All of that is recorded here, on the Hub. A node that is offline, unreachable, or long gone is revoked in exactly the same way — which is the point of doing it from here.`})]),dt=`Check the identifier below against the machine you meant. Two nodes can carry the same name, and this is the only value that tells them apart.`;function ft(e){return{title:`Revoke ${e.label}?`,consequences:ut,subjectPrompt:dt,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var pt=`Revoke`;function mt(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function ht(e){return e===null||e.outcome===`unchanged`}var gt=e=>Object.freeze(e),_t=Object.freeze([gt({id:`invalidResponse`,probe:Object.freeze({code:`invalid_response`,status:502}),selects:(e,t)=>t===`invalid_response`,failure:Object.freeze({message:`The Hub accepted the request and its answer could not be read, so whether this node was revoked is not known here. Refresh the list and check before trying again.`,outcome:`unknown`})}),gt({id:`transport`,probe:Object.freeze({code:`unavailable`,status:0}),selects:(e,t)=>e===0||t===`timeout`||t===`unavailable`,failure:Object.freeze({message:`The request left this browser and no answer came back, so whether this node was revoked is not known here. Check your connection, then refresh the list and look before trying again.`,outcome:`unknown`})}),gt({id:`csrf`,probe:Object.freeze({code:`csrf_rejected`,status:403}),selects:(e,t)=>t===`csrf_rejected`,failure:Object.freeze({message:`This request could not be verified, so nothing was changed. Refresh the page and try again.`,outcome:`unchanged`})}),gt({id:`unauthorized`,probe:Object.freeze({code:`session_invalid`,status:401}),selects:(e,t)=>e===401||t===`session_invalid`,failure:Object.freeze({message:`Your Hub session is no longer valid, so nothing was changed. Sign in and try again.`,outcome:`unchanged`})}),gt({id:`forbidden`,probe:Object.freeze({code:`forbidden`,status:403}),selects:e=>e===403,failure:Object.freeze({message:`Only an owner of this Hub can revoke a node. Nothing was changed.`,outcome:`unchanged`})}),gt({id:`notFound`,probe:Object.freeze({code:`not_found`,status:404}),selects:e=>e===404,failure:Object.freeze({message:`The Hub has no active node under this identifier: it was already revoked, or it is not this Hub's. Either way there is nothing here left to revoke.`,outcome:`already-gone`})}),gt({id:`conflict`,probe:Object.freeze({code:`conflict`,status:409}),selects:e=>e===409,failure:Object.freeze({message:`The Hub reported a conflicting change on this node, so nothing was changed. Refresh and look at it again before retrying.`,outcome:`unchanged`})}),gt({id:`rateLimited`,probe:Object.freeze({code:`node_rate_limited`,status:429}),selects:e=>e===429,failure:Object.freeze({message:`The Hub is refusing further owner changes for now, so nothing was changed. Wait a little and try again.`,outcome:`unchanged`})}),gt({id:`badRequest`,probe:Object.freeze({code:`invalid_request`,status:400}),selects:(e,t)=>e===400||t===`invalid_request`,failure:Object.freeze({message:`The Hub refused this request, so nothing was changed.`,outcome:`unchanged`})})]),vt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function yt(e){let t=bt(e),n=xt(e);for(let e of _t)if(e.selects(t,n))return e.failure;return vt}function bt(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function xt(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var St=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Ct(e){return e===null||!Number.isFinite(e)?null:St.format(new Date(e))}function wt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Tt(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Et(e){return Tt(e)}function Dt(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return Ct(e)??`unknown`;let r=Math.floor(n/6e4);if(r<2)return`just now`;if(r<60)return`${String(r)} min ago`;let i=Math.floor(r/60);return i<24?`${String(i)} h ago`:Ct(e)??`unknown`}function Ot(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${Dt(e.lastAuthenticatedAt,t)}`:`Last seen ${Dt(e.presence.lastHeartbeatAt,t)}`}function kt(e){let t=`${wt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${Et(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function At(e){return e.toSorted((e,t)=>{let n=e.revokedAt===null?0:1,r=t.revokedAt===null?0:1;return n===r?e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`}):n-r})}function jt(e){return e.filter(e=>e.revokedAt===null).length}function Mt(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function Nt(e){let t=jt(e),n=Mt(e),r=e.length-t,i=`${String(t)} authorized · ${n===0?`none online`:`${String(n)} online`}`;return r===0?i:`${i} · ${String(r)} revoked`}function Pt(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function Ft(e){return e.node.capabilities?.nativeClientRequired===!0?`Open this node in Desktop/Mobile.`:e.node.revokedAt===null?e.directoryStatus!==`ready`||e.browserStatus!==`current`?`Node switching is unavailable until the directory and this browser are current.`:null:`Access to this node was revoked.`}function It({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=ft(e),l=ht(o);(0,Z.useEffect)(()=>{!t||i||(a(!1),s(null))},[e.id,t]);let u=async()=>{if(!i){a(!0),s(null);try{await r(),n(!1)}catch(e){s(yt(e)),a(!1)}}};return(0,$.jsx)(Ee,{open:t,onOpenChange:e=>{!e&&i||n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(Te,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(be,{children:[(0,$.jsx)(xe,{children:c.title}),(0,$.jsx)(we,{children:c.subjectPrompt})]}),(0,$.jsxs)(Ce,{className:`space-y-4`,children:[(0,$.jsxs)(Ye,{children:[(0,$.jsx)(X,{term:`Node`,children:e.label}),(0,$.jsx)(X,{term:`Node ID`,mono:!0,children:c.subjectId}),(0,$.jsx)(X,{term:`Platform`,children:`${wt(e.platformOs)} · ${e.platformArch}`})]}),(0,$.jsx)(`ul`,{className:`space-y-2 text-xs leading-relaxed text-muted-foreground`,children:c.consequences.map(e=>(0,$.jsx)(`li`,{children:e.text},e.id))}),o?(0,$.jsxs)(`p`,{role:`alert`,className:`flex items-start gap-2 text-xs leading-relaxed text-destructive`,children:[(0,$.jsx)(oe,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),o.message]}):null]}),(0,$.jsxs)(Se,{children:[(0,$.jsx)(K,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(K,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Lt(e){let t=(0,Q.c)(57),{node:n}=e,r=We(6e4),{copyToClipboard:i,isCopied:a}=q(),o;t[0]===n.createdAt?o=t[1]:(o=Ct(n.createdAt),t[0]=n.createdAt,t[1]=o);let s=o,c;t[2]===n.lastAuthenticatedAt?c=t[3]:(c=Ct(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=c);let l=c,u;t[4]===n.revokedAt?u=t[5]:(u=Ct(n.revokedAt),t[4]=n.revokedAt,t[5]=u);let d=u,f=n.grant.role!==n.effectiveRole,p;t[6]===n?p=t[7]:(p=(0,$.jsx)(X,{term:`Status`,children:(0,$.jsx)(L,{node:n})}),t[6]=n,t[7]=p);let m;t[8]!==n.presence.lastHeartbeatAt||t[9]!==r?(m=n.presence.lastHeartbeatAt===null?`Not reported`:(0,$.jsx)(`span`,{title:Ct(n.presence.lastHeartbeatAt)??void 0,children:Dt(n.presence.lastHeartbeatAt,r)}),t[8]=n.presence.lastHeartbeatAt,t[9]=r,t[10]=m):m=t[10];let h;t[11]===m?h=t[12]:(h=(0,$.jsx)(X,{term:`Last heartbeat`,children:m}),t[11]=m,t[12]=h);let g=l??`Never`,_;t[13]===g?_=t[14]:(_=(0,$.jsx)(X,{term:`Last connected`,children:g}),t[13]=g,t[14]=_);let v;t[15]===n.platformOs?v=t[16]:(v=wt(n.platformOs),t[15]=n.platformOs,t[16]=v);let y=`${v} · ${n.platformArch}`,b;t[17]===y?b=t[18]:(b=(0,$.jsx)(X,{term:`Platform`,children:y}),t[17]=y,t[18]=b);let S;t[19]===n.clientVersion?S=t[20]:(S=(0,$.jsx)(X,{term:`Client version`,mono:!0,children:n.clientVersion}),t[19]=n.clientVersion,t[20]=S);let C;t[21]===n.effectiveRole?C=t[22]:(C=Et(n.effectiveRole),t[21]=n.effectiveRole,t[22]=C);let w;t[23]===C?w=t[24]:(w=(0,$.jsx)(X,{term:`Your role`,children:C}),t[23]=C,t[24]=w);let T;t[25]!==f||t[26]!==n.grant.role?(T=f?(0,$.jsxs)(X,{term:`Granted role`,children:[Et(n.grant.role),(0,$.jsx)(`span`,{className:`mt-1 block text-muted-foreground`,children:`The role on your grant differs from the role in effect.`})]}):null,t[25]=f,t[26]=n.grant.role,t[27]=T):T=t[27];let E=s??`Not reported`,D;t[28]===E?D=t[29]:(D=(0,$.jsx)(X,{term:`Enrolled`,children:E}),t[28]=E,t[29]=D);let k;t[30]!==n.revocationReasonCode||t[31]!==n.revokedAt||t[32]!==d?(k=n.revokedAt===null?null:(0,$.jsx)(X,{term:`Revoked`,children:`${d??`Not reported`}${n.revocationReasonCode?` — ${n.revocationReasonCode}`:``}`}),t[30]=n.revocationReasonCode,t[31]=n.revokedAt,t[32]=d,t[33]=k):k=t[33];let A=a?`Copied`:`Copy node ID`,j;t[34]!==i||t[35]!==n.id?(j=()=>i(n.id,void 0),t[34]=i,t[35]=n.id,t[36]=j):j=t[36];let M;t[37]===a?M=t[38]:(M=a?(0,$.jsx)(x,{"aria-hidden":!0}):(0,$.jsx)(O,{"aria-hidden":!0}),t[37]=a,t[38]=M);let N;t[39]!==A||t[40]!==j||t[41]!==M?(N=(0,$.jsx)(K,{size:`icon-xs`,variant:`ghost`,"aria-label":A,onClick:j,children:M}),t[39]=A,t[40]=j,t[41]=M,t[42]=N):N=t[42];let P;t[43]!==n.id||t[44]!==N?(P=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:N,children:n.id}),t[43]=n.id,t[44]=N,t[45]=P):P=t[45];let F;return t[46]!==b||t[47]!==S||t[48]!==w||t[49]!==T||t[50]!==D||t[51]!==k||t[52]!==P||t[53]!==p||t[54]!==h||t[55]!==_?(F=(0,$.jsxs)(Ye,{children:[p,h,_,b,S,w,T,D,k,P]}),t[46]=b,t[47]=S,t[48]=w,t[49]=T,t[50]=D,t[51]=k,t[52]=P,t[53]=p,t[54]=h,t[55]=_,t[56]=F):F=t[56],F}function Rt(e){let t=(0,Q.c)(93),{node:n,directoryStatus:r,browserStatus:i,canRename:a,canRevoke:o,onOpenChange:s,onConnect:c,onRename:l,onRevoke:u}=e,d=ge()===`phone`,[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),g=n!==null;if(!n)return null;let _;t[0]!==i||t[1]!==r||t[2]!==n?(_=Pt({directoryStatus:r,browserStatus:i,node:n}),t[0]=i,t[1]=r,t[2]=n,t[3]=_):_=t[3];let v=_,y;t[4]!==i||t[5]!==r||t[6]!==n?(y=Ft({directoryStatus:r,browserStatus:i,node:n}),t[4]=i,t[5]=r,t[6]=n,t[7]=y):y=t[7];let b=y,x;t[8]!==n||t[9]!==c||t[10]!==s?(x=()=>{s(!1),c(n)},t[8]=n,t[9]=c,t[10]=s,t[11]=x):x=t[11];let S=x,C=v&&b?b:null;if(d){let e=`Node details: ${n.label}`,r;t[12]===n.label?r=t[13]:(r=(0,$.jsx)(je,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=kt(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(Ae,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(ke,{children:[r,a]}),t[18]=r,t[19]=a,t[20]=o):o=t[20];let c;t[21]===n?c=t[22]:(c=(0,$.jsx)(Lt,{node:n}),t[21]=n,t[22]=c);let l;t[23]===C?l=t[24]:(l=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[23]=C,t[24]=l);let u;t[25]!==l||t[26]!==c?(u=(0,$.jsxs)(Oe,{children:[c,l]}),t[25]=l,t[26]=c,t[27]=u):u=t[27];let d;t[28]!==v||t[29]!==S?(d=(0,$.jsx)(Me,{children:(0,$.jsx)(K,{className:`min-h-11`,disabled:v,onClick:S,children:`Connect`})}),t[28]=v,t[29]=S,t[30]=d):d=t[30];let f;return t[31]!==s||t[32]!==g||t[33]!==u||t[34]!==d||t[35]!==e||t[36]!==o?(f=(0,$.jsxs)(Ne,{open:g,onOpenChange:s,label:e,children:[o,u,d]}),t[31]=s,t[32]=g,t[33]=u,t[34]=d,t[35]=e,t[36]=o,t[37]=f):f=t[37],f}let w=o&&n.revokedAt===null,T;t[38]!==s||t[39]!==f||t[40]!==m?(T=e=>{!e&&(m!==null||f!==null)||(e||(p(null),h(null)),s(e))},t[38]=s,t[39]=f,t[40]=m,t[41]=T):T=t[41];let E;t[42]===n.label?E=t[43]:(E=(0,$.jsx)(pe,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=E);let D;t[44]===n?D=t[45]:(D=kt(n),t[44]=n,t[45]=D);let O;t[46]===D?O=t[47]:(O=(0,$.jsx)(ue,{children:D}),t[46]=D,t[47]=O);let k;t[48]!==E||t[49]!==O?(k=(0,$.jsxs)(J,{children:[E,O]}),t[48]=E,t[49]=O,t[50]=k):k=t[50];let A;t[51]===n?A=t[52]:(A=(0,$.jsx)(Lt,{node:n}),t[51]=n,t[52]=A);let j;t[53]===C?j=t[54]:(j=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[53]=C,t[54]=j);let M;t[55]!==j||t[56]!==A?(M=(0,$.jsxs)(le,{children:[A,j]}),t[55]=j,t[56]=A,t[57]=M):M=t[57];let N;t[58]!==n.id||t[59]!==w?(N=w?(0,$.jsx)(K,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>h(n.id),children:pt}):null,t[58]=n.id,t[59]=w,t[60]=N):N=t[60];let P;t[61]!==a||t[62]!==n.id?(P=a?(0,$.jsx)(K,{variant:`outline`,onClick:()=>p(n.id),children:`Rename`}):null,t[61]=a,t[62]=n.id,t[63]=P):P=t[63];let F;t[64]!==v||t[65]!==S?(F=(0,$.jsx)(K,{disabled:v,onClick:S,children:`Connect`}),t[64]=v,t[65]=S,t[66]=F):F=t[66];let I;t[67]!==N||t[68]!==P||t[69]!==F?(I=(0,$.jsxs)(fe,{children:[N,P,F]}),t[67]=N,t[68]=P,t[69]=F,t[70]=I):I=t[70];let L;t[71]!==M||t[72]!==I||t[73]!==k?(L=(0,$.jsxs)(de,{side:`right`,className:`w-full sm:max-w-md`,children:[k,M,I]}),t[71]=M,t[72]=I,t[73]=k,t[74]=L):L=t[74];let R;t[75]!==g||t[76]!==L||t[77]!==T?(R=(0,$.jsx)(me,{open:g,onOpenChange:T,children:L}),t[75]=g,t[76]=L,t[77]=T,t[78]=R):R=t[78];let z;t[79]!==a||t[80]!==n||t[81]!==l||t[82]!==f?(z=a?(0,$.jsx)(ct,{node:n,open:f===n.id,onOpenChange:e=>p(e?n.id:null),onRename:e=>l(n,e)}):null,t[79]=a,t[80]=n,t[81]=l,t[82]=f,t[83]=z):z=t[83];let B;t[84]!==n||t[85]!==u||t[86]!==w||t[87]!==m?(B=w?(0,$.jsx)(It,{node:n,open:m===n.id,onOpenChange:e=>h(e?n.id:null),onRevoke:()=>u(n)}):null,t[84]=n,t[85]=u,t[86]=w,t[87]=m,t[88]=B):B=t[88];let ee;return t[89]!==R||t[90]!==z||t[91]!==B?(ee=(0,$.jsxs)($.Fragment,{children:[R,z,B]}),t[89]=R,t[90]=z,t[91]=B,t[92]=ee):ee=t[92],ee}function zt(e){let t=(0,Q.c)(18),{children:n,title:r,description:i,actions:a,titleRef:o}=e,s;t[0]!==r||t[1]!==o?(s=(0,$.jsx)(`h1`,{ref:o,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[0]=r,t[1]=o,t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=i===void 0?null:(0,$.jsx)(`div`,{className:`mt-1.5 text-muted-foreground text-sm`,children:i}),t[3]=i,t[4]=c);let l;t[5]!==s||t[6]!==c?(l=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=a===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:a}),t[8]=a,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-3`,children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n?f=t[14]:(f=(0,$.jsx)(`div`,{className:`mt-8`,children:n}),t[13]=n,t[14]=f);let p;return t[15]!==d||t[16]!==f?(p=(0,$.jsxs)($.Fragment,{children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function Bt(e){let t=(0,Q.c)(12),{children:n,className:r,title:i,description:a,actions:o}=e,s;t[0]===r?s=t[1]:(s=U(`app-surface relative rounded-2xl border not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,r),t[0]=r,t[1]=s);let c;t[2]!==o||t[3]!==a||t[4]!==i?(c=i===void 0&&o===void 0?null:(0,$.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2 border-border/60 border-b px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i===void 0?null:(0,$.jsx)(`h2`,{className:`font-medium text-base`,children:i}),a===void 0?null:(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-sm leading-relaxed`,children:a})]}),o===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),t[2]=o,t[3]=a,t[4]=i,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=n===void 0?null:(0,$.jsx)(`div`,{className:`px-5 py-4`,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`section`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Vt(e){let t=(0,Q.c)(8),{className:n,size:r}=e,i=r===void 0?`default`:r,a=i===`lg`?`gap-2.5 text-lg`:`gap-2 text-sm`,o;t[0]!==n||t[1]!==a?(o=U(`inline-flex items-center font-semibold text-foreground`,a,n),t[0]=n,t[1]=a,t[2]=o):o=t[2];let s=i===`lg`?`h-6`:`h-4.5`,c;t[3]===s?c=t[4]:(c=(0,$.jsx)(De,{className:s}),t[3]=s,t[4]=c);let l;return t[5]!==o||t[6]!==c?(l=(0,$.jsxs)(`span`,{className:o,children:[c,Ge]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}var Ht=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,Ut=`px-4 sm:px-6 phone:px-[max(1rem,env(safe-area-inset-left),env(safe-area-inset-right))] phone:pt-[max(2.5rem,calc(env(safe-area-inset-top)+1rem))] phone:pb-[max(2.5rem,calc(env(safe-area-inset-bottom)+1rem))]`,Wt=`flex min-h-full flex-col`,Gt={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function Kt(e){let t=(0,Q.c)(13),{nav:n,trailing:r}=e,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=U(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),a=U(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,Gt.page),o=(0,$.jsx)(Vt,{}),t[0]=i,t[1]=a,t[2]=o):(i=t[0],a=t[1],o=t[2]);let s;t[3]===n?s=t[4]:(s=n===void 0?null:(0,$.jsx)(`nav`,{"aria-label":`Hub`,className:`min-w-0 flex-1`,children:n}),t[3]=n,t[4]=s);let c;t[5]===n?c=t[6]:(c=n===void 0?(0,$.jsx)(`div`,{className:`flex-1`}):null,t[5]=n,t[6]=c);let l;t[7]===r?l=t[8]:(l=r===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:r}),t[7]=r,t[8]=l);let u;return t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,$.jsx)(`header`,{className:i,children:(0,$.jsxs)(`div`,{className:a,children:[o,s,c,l]})}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function qt(e){let t=(0,Q.c)(16),{children:n,nav:r,trailing:i,scrollRef:a,measure:o}=e,s=o===void 0?`page`:o,c=ge()===`phone`,l;t[0]!==c||t[1]!==r||t[2]!==i?(l=c?null:(0,$.jsx)(Kt,{nav:r,trailing:i}),t[0]=c,t[1]=r,t[2]=i,t[3]=l):l=t[3];let u=c?`min-h-full py-10`:`pt-8 pb-16`,d=Gt[s],f;t[4]!==u||t[5]!==d?(f=U(`mx-auto flex w-full flex-col`,u,Ut,d),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==f?(p=(0,$.jsx)(`section`,{className:f,children:n}),t[7]=n,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==a||t[11]!==p?(m=(0,$.jsx)(`main`,{ref:a,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:p}),t[10]=a,t[11]=p,t[12]=m):m=t[12];let h;return t[13]!==l||t[14]!==m?(h=(0,$.jsx)(T,{children:(0,$.jsx)(D,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[l,m]})})}),t[13]=l,t[14]=m,t[15]=h):h=t[15],h}var Jt=(0,Z.lazy)(()=>n(()=>import(`./AccountSettings-BUoiS8x1.js`).then(e=>({default:e.AccountSettingsPanel})),[])),Yt=(0,Z.lazy)(()=>n(()=>import(`./AppearanceSettings-CYbSApl4.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),Xt=[{id:`overview`,label:`Overview`,icon:se},{id:`security`,label:`Security`,icon:H},{id:`appearance`,label:`Appearance`,icon:V}];function Zt(e){let t=(0,Q.c)(15),{section:n}=e,r=s($t),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(K,{variant:`ghost`,onClick:Qt,children:[(0,$.jsx)(b,{"aria-hidden":!0}),` Nodes`]}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=r===null?void 0:`${r.displayName} · ${r.role.charAt(0).toUpperCase()}${r.role.slice(1)}`,t[1]=r,t[2]=a);let o;t[3]===n?o=t[4]:(o=Xt.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(K,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>I({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[3]=n,t[4]=o);let c;t[5]===o?c=t[6]:(c=(0,$.jsx)(`nav`,{"aria-label":`Account`,className:`shrink-0 sm:w-48`,children:(0,$.jsx)(`ul`,{className:`flex gap-1 overflow-x-auto sm:flex-col sm:overflow-visible`,children:o})}),t[5]=o,t[6]=c);let l;t[7]===n?l=t[8]:(l=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsx)(en,{}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(Jt,{}):(0,$.jsx)(Yt,{surface:`hub`})})}),t[7]=n,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==a||t[13]!==u?(d=(0,$.jsx)(qt,{measure:`page`,trailing:i,children:(0,$.jsx)(zt,{title:`Account`,description:a,children:u})}),t[12]=a,t[13]=u,t[14]=d):d=t[14],d}function Qt(){return I({kind:`nodes`})}function $t(e){return e.account}function en(){let e=(0,Q.c)(11),t=s(tn),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Display name`}),e[0]=n):n=e[0];let r=t?.displayName??`—`,i;e[1]===r?i=e[2]:(i=(0,$.jsxs)(`div`,{children:[n,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:r})]}),e[1]=r,e[2]=i);let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Role`}),e[3]=a):a=e[3];let o;e[4]===t?o=e[5]:(o=t===null?`—`:`${t.role.charAt(0).toUpperCase()}${t.role.slice(1)}`,e[4]=t,e[5]=o);let c;e[6]===o?c=e[7]:(c=(0,$.jsxs)(`div`,{children:[a,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:o})]}),e[6]=o,e[7]=c);let l;return e[8]!==i||e[9]!==c?(l=(0,$.jsx)(Bt,{title:`Your account`,description:`Identity this Hub knows you by.`,children:(0,$.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-4 sm:grid-cols-2`,children:[i,c]})}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}function tn(e){return e.account}function nn(e){let t=(0,Q.c)(7),{links:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?[]:n,t[0]=n,t[1]=r);let i=r,a=typeof window>`u`?null:window.location.host,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=a===null?null:(0,$.jsxs)(`p`,{children:[`Signing in to `,(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:a})]}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=i.length===0?null:(0,$.jsx)(`ul`,{className:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1`,children:i.map(rn)}),t[3]=i,t[4]=s);let c;return t[5]===s?c=t[6]:(c=(0,$.jsxs)(`footer`,{className:`mt-10 flex flex-col items-center gap-2 text-center text-muted-foreground text-xs`,children:[o,s]}),t[5]=s,t[6]=c),c}function rn(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(`a`,{className:`rounded-sm underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,href:e.href,rel:`noreferrer`,target:`_blank`,children:e.label})},e.href)}function an(e){let t=(0,Q.c)(25),{children:n,title:r,description:i,actions:a,trailing:o,scrollRef:s,titleRef:c,measure:l}=e,u=l===void 0?`form`:l,d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=U(Ht,`hub-ambient`),f=U(Wt,Ut,`py-10`),t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p=Gt[u],m;t[2]===p?m=t[3]:(m=U(`my-auto w-full self-center phone:my-0 phone:flex phone:max-w-none phone:flex-1 phone:flex-col`,p),t[2]=p,t[3]=m);let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(Vt,{size:`lg`})}),t[4]=h):h=t[4];let g;t[5]!==r||t[6]!==c?(g=(0,$.jsx)(`h1`,{ref:c,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[5]=r,t[6]=c,t[7]=g):g=t[7];let _;t[8]===i?_=t[9]:(_=i===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:i}),t[8]=i,t[9]=_);let v;t[10]===n?v=t[11]:(v=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:n}),t[10]=n,t[11]=v);let y;t[12]!==a||t[13]!==g||t[14]!==_||t[15]!==v||t[16]!==o?(y=(0,$.jsxs)(`section`,{className:`hub-gateway-panel app-surface relative rounded-2xl border p-6 not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] sm:p-8 phone:flex phone:flex-1 phone:flex-col phone:rounded-none phone:border-0 phone:p-0 phone:shadow-none phone:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:[g,_,v,a,o]}),t[12]=a,t[13]=g,t[14]=_,t[15]=v,t[16]=o,t[17]=y):y=t[17];let b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(nn,{}),t[18]=b):b=t[18];let x;t[19]!==y||t[20]!==m?(x=(0,$.jsx)(`div`,{className:f,children:(0,$.jsxs)(`div`,{className:m,children:[h,y,b]})}),t[19]=y,t[20]=m,t[21]=x):x=t[21];let S;return t[22]!==s||t[23]!==x?(S=(0,$.jsx)(`main`,{ref:s,className:d,children:x}),t[22]=s,t[23]=x,t[24]=S):S=t[24],S}function on({onClose:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(`input`),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=(0,Z.useRef)(``),p=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{p.current?.abort(),p.current=null,f.current=``},[]);let m=()=>{p.current?.abort();let e=new AbortController;return p.current=e,l(!0),d(null),e},h=e=>{p.current===e&&(p.current=null,l(!1))},v=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof g&&e.status===401){f.current=``,n(``),a(null),await _.expireSession();return}d(t??(e instanceof g?e.message:`Hub is temporarily unavailable.`))}},y=async e=>{e.preventDefault();let r=t.trim();n(``),f.current=``;let o=m();try{let e=await i.lookupNodeEnrollment(r,o.signal);if(o.signal.aborted)return;f.current=r,a(e),s(`review`)}catch(e){await v(e)}finally{h(o)}},b=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await i.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`approved`),await _.refreshDirectory()}catch(e){f.current=``,a(null),s(`input`),await v(e,`The approval result is unknown. Enter the device code again to verify its current state.`)}finally{h(t)}},x=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await i.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`denied`)}catch(e){await v(e)}finally{h(t)}},S=()=>{p.current?.abort(),f.current=``,n(``),a(null),e()};return o===`approved`||o===`denied`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(E,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:o===`approved`?`Node approved`:`Enrollment denied`}),(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-sm text-muted-foreground`,children:o===`approved`?`The node can now finish enrollment and connect. Online presence may take a few seconds.`:`This ceremony cannot be reused. Start a new enrollment on the node if needed.`}),(0,$.jsx)(K,{className:`mt-5`,onClick:S,children:`Back to nodes`})]}):r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Review node enrollment`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Compare every field, especially the fingerprint, with the node or a trusted operator channel before approving.`}),(0,$.jsxs)(Ye,{className:`mt-5 rounded-xl border border-border bg-background p-4`,children:[(0,$.jsx)(X,{term:`Label`,children:(0,$.jsx)(`span`,{className:`font-medium break-words`,children:r.label})}),(0,$.jsx)(X,{term:`Platform`,children:`${r.platformOs} · ${r.platformArch}`}),(0,$.jsx)(X,{term:`Version`,mono:!0,children:r.clientVersion}),(0,$.jsx)(X,{term:`Algorithm`,children:r.algorithm}),(0,$.jsx)(X,{term:`Fingerprint`,mono:!0,children:r.fingerprint}),(0,$.jsx)(X,{term:`Expires`,children:new Date(r.expiresAt).toLocaleString()})]}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,o===`confirm-denial`?(0,$.jsxs)(`div`,{className:`mt-4 rounded-lg border border-destructive/30 bg-destructive/5 p-3`,children:[(0,$.jsxs)(`p`,{className:`flex gap-2 text-sm`,children:[(0,$.jsx)(oe,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),` Denial is permanent for this device code.`]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{variant:`destructive`,disabled:c,onClick:()=>void x(),children:`Confirm denial`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{disabled:c,onClick:()=>void b(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(K,{variant:`ghost`,disabled:c,onClick:S,children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Enroll a Ryco node`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Start enrollment on the node, then enter the short device code shown there. Codes expire after ten minutes.`}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,(0,$.jsxs)(`form`,{className:`mt-5 space-y-4`,autoComplete:`off`,onSubmit:e=>void y(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-node-device-code`,children:`Device code`}),(0,$.jsx)(G,{id:`hub-node-device-code`,required:!0,autoFocus:!0,maxLength:16,value:t,className:`font-mono uppercase ${W}`,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,onClick:S,children:`Cancel`})]})]})]})}function sn(e){let t=(0,Q.c)(14),{step:n,total:r,label:i}=e,a=Math.min(Math.max(n,1),r),o;t[0]===i?o=t[1]:(o=i===void 0?null:(0,$.jsxs)(`span`,{className:`sr-only`,children:[`: `,i]}),t[0]=i,t[1]=o);let s;t[2]!==a||t[3]!==o||t[4]!==r?(s=(0,$.jsxs)(`p`,{className:`font-medium text-muted-foreground text-xs`,children:[`Step `,a,` of `,r,o]}),t[2]=a,t[3]=o,t[4]=r,t[5]=s):s=t[5];let c;if(t[6]!==a||t[7]!==r){let e;t[9]===a?e=t[10]:(e=(e,t)=>(0,$.jsx)(`span`,{className:`h-1 flex-1 rounded-full transition-colors ${t<a?`bg-primary`:`bg-border`}`},t),t[9]=a,t[10]=e),c=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex flex-1 items-center gap-1.5`,children:Array.from({length:r},e)}),t[6]=a,t[7]=r,t[8]=c}else c=t[8];let l;return t[11]!==s||t[12]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}var cn=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,ln=null;function un(){return window.turnstile?Promise.resolve(window.turnstile):ln||(ln=new Promise((e,t)=>{let n=document.querySelector(`script[src="${cn}"]`),r=n??document.createElement(`script`);r.addEventListener(`load`,()=>{window.turnstile?e(window.turnstile):t(Error(`Turnstile did not initialize`))},{once:!0}),r.addEventListener(`error`,()=>t(Error(`Turnstile could not be loaded`)),{once:!0}),n||(r.src=cn,r.async=!0,r.defer=!0,document.head.append(r))}).catch(e=>{throw ln=null,e}),ln)}function dn(e){let t=(0,Q.c)(10),{siteKey:n,action:r,onToken:i}=e,a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(!1),c,l;t[0]!==r||t[1]!==i||t[2]!==n?(c=()=>{let e=!1,t=null;return i(null),s(!1),un().then(o=>{e||a.current===null||(t={api:o,id:o.render(a.current,{sitekey:n,action:r,theme:document.documentElement.classList.contains(`dark`)?`dark`:`light`,callback:t=>{e||i(t)},"expired-callback":()=>{e||i(null)},"error-callback":()=>{e||(i(null),s(!0))}})})}).catch(()=>{e||s(!0)}),()=>{e=!0,i(null),t&&t.api.remove(t.id)}},l=[r,i,n],t[0]=r,t[1]=i,t[2]=n,t[3]=c,t[4]=l):(c=t[3],l=t[4]),(0,Z.useEffect)(c,l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{ref:a,"aria-label":`Anti-bot verification`,className:`min-h-[65px]`}),t[5]=u):u=t[5];let d;t[6]===o?d=t[7]:(d=o?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Verification could not load. Check your connection and try again.`}):null,t[6]=o,t[7]=d);let f;return t[8]===d?f=t[9]:(f=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[u,d]}),t[8]=d,t[9]=f),f}function fn(e,t){return e instanceof g?e.message:t}function pn(){let e=new Uint8Array(32);return crypto.getRandomValues(e),h(e)}function mn(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(null),[r,a]=(0,Z.useState)(!0),o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=new AbortController;return i.getPublicSignupConfiguration(e.signal).then(n).catch(()=>n({status:`disabled`})).finally(()=>{e.signal.aborted||a(!1)}),()=>e.abort()},s=[],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,Z.useEffect)(o,s);let c;return e[2]!==t||e[3]!==r?(c={config:t,loading:r},e[2]=t,e[3]=r,e[4]=c):c=e[4],c}function hn(e){return e!==null&&`activationSecret`in e}function gn({config:e,initialLink:t,onConsumeLink:n,onCancel:r}){let[a,o]=(0,Z.useState)(t?.kind===`signup-verification`||t?.kind===`invalid-signup-verification`?`verifying`:`details`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),T=(0,Z.useRef)(null),E=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(E.current||t===null)return;if(E.current=!0,t.kind!==`signup-verification`){t.kind===`invalid-signup-verification`&&(w(`This verification link is incomplete or expired. Start signup again.`),o(`details`));return}let e=new AbortController;return x(!0),i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`link_token`,token:t.token}},e.signal).then(e=>{T.current=e,o(`credential`)}).catch(e=>w(fn(e,`This verification link could not be confirmed.`))).finally(()=>{n(),e.signal.aborted||x(!1)}),()=>e.abort()},[t,n]);let D=async t=>{if(t.preventDefault(),b||e===null)return;let n=e.antiBot.provider===`bypass`?`development`:v??``;if(!n){w(`Complete the anti-bot check before continuing.`);return}x(!0),w(null);try{let e=await i.startPublicSignup({username:s.trim().toLowerCase(),email:l.trim().toLowerCase(),antiBotAssertion:n});T.current=e,o(`check-email`)}catch(e){w(fn(e,`Account creation is temporarily unavailable.`))}finally{x(!1)}},O=async e=>{e.preventDefault();let t=T.current;if(!(b||t===null||!(`attemptSecret`in t))){x(!0),w(null);try{let e=await i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`email_code`,code:d.trim()}});f(``),T.current=e,o(`credential`)}catch(e){w(fn(e,`That email code could not be verified.`))}finally{x(!1)}}},A=async e=>{let t=T.current;if(b||!hn(t))return;if(e===`password`&&p!==h){w(`The passwords do not match.`);return}x(!0),w(null);let n=p;m(``),g(``);try{let r=e===`passkey`?await i.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:pn()}):await i.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:pn()});T.current=null,await _.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(fn(e,`Account creation did not complete.`))}finally{x(!1)}},j=a===`details`?1:a===`check-email`||a===`verifying`?2:3;return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,$.jsx)(sn,{step:j,total:3,label:j===1?`Your details`:j===2?`Verify your email`:`Choose how you sign in`}),a===`details`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void D(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:s,className:W,onChange:e=>c(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase letters, numbers, and underscores.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-email`,children:`Email`}),(0,$.jsx)(G,{id:`hub-signup-email`,type:`email`,autoCapitalize:`none`,autoComplete:`email`,maxLength:254,required:!0,value:l,className:W,onChange:e=>u(e.currentTarget.value)})]}),e?.antiBot.provider===`turnstile`?(0,$.jsx)(dn,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:y}):null,(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Send verification email`,submitDisabled:e===null})]}):a===`check-email`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void O(e),children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(Ze,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Enter the six-digit code, or open the verification link on this device.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-code`,children:`Verification code`}),(0,$.jsx)(G,{id:`hub-signup-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,pattern:`[0-9]{6}`,required:!0,value:d,className:W,onChange:e=>f(e.currentTarget.value)})]}),(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Verify email`})]}):a===`password`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),A(`password`)},children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-signup-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:p,className:W,onChange:e=>m(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-signup-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:h,className:W,onChange:e=>g(e.currentTarget.value)})]}),(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`At least `,12,` characters. Password sign-in always asks for an email or authenticator code too.`]}),(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:()=>o(`credential`),pending:b,submitLabel:`Create account`})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:a===`verifying`?`Verifying your email…`:`Choose how you sign in`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`A passkey is the strongest and easiest option. A password always requires a second factor on future sign-ins.`})]}),(0,$.jsx)(xn,{value:C}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${qe}`,children:[(0,$.jsxs)(K,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>void A(`passkey`),children:[b?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(k,{"aria-hidden":!0}),b?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>o(`password`),children:`Use a password instead`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function _n({pendingSignup:e,config:t,onCancel:n}){let[r,a]=(0,Z.useState)(e.suggestedUsername??``),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=async e=>{if(e.preventDefault(),c||t===null)return;let n=t.antiBot.provider===`bypass`?`development`:o??``;if(!n){d(`Complete the anti-bot check before continuing.`);return}l(!0),d(null);try{let e=await i.finishExternalIdentitySignup({provider:`github`,username:r.trim().toLowerCase(),antiBotAssertion:n,idempotencyKey:pn()});await _.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(fn(e,`GitHub signup did not complete.`))}finally{l(!1)}};return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void f(e),children:[(0,$.jsx)(sn,{step:1,total:1,label:`Confirm your Ryco username`}),(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`GitHub verified`}),(0,$.jsxs)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:[e.displayName?`${e.displayName} authorized Ryco through GitHub. `:`GitHub authorized this account. `,`Choose the public username Ryco should use. Nothing is created until you confirm.`]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-external-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-external-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:r,className:W,onChange:e=>a(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`GitHub suggested this name. You can change it before creating the account.`})]}),t?.antiBot.provider===`turnstile`?(0,$.jsx)(dn,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(xn,{value:u}),(0,$.jsx)(Sn,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function vn({onCancel:e,onUseRecoveryCode:t,onResetPassword:n}){let[r,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),g=async e=>{if(e.preventDefault(),!f){p(!0),h(null);try{if(u===null){let e=await i.startPasswordLogin({identifier:r.trim().toLowerCase(),password:o});s(``),d(e)}else{let e=await i.finishPasswordLogin({attemptId:u.attemptId,attemptSecret:u.attemptSecret,factor:u.factor,code:c.trim()});l(``),await _.adoptPublicBrowserIdentity(e)}}catch(e){h(fn(e,`Password sign-in did not complete.`))}finally{p(!1)}}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void g(e),children:[u===null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-login-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:r,className:W,onChange:e=>a(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-login-password`,type:`password`,autoComplete:`current-password`,required:!0,maxLength:256,value:o,className:W,onChange:e=>s(e.currentTarget.value)})]})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-second-factor`,children:u.factor===`totp`?`Authenticator code`:`Email code`}),(0,$.jsx)(G,{id:`hub-login-second-factor`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:c,className:W,onChange:e=>l(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u.factor===`totp`?`Enter the current code from your authenticator app.`:`We sent a six-digit code to your verified email address.`})]}),(0,$.jsx)(xn,{value:m}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Sn,{onCancel:u===null?e:()=>d(null),pending:f,submitLabel:u===null?`Continue`:`Sign in`})]})}function yn({initialLink:e,onConsumeLink:t,onCancel:n}){let[r,a]=(0,Z.useState)(e?.kind===`password-reset`||e?.kind===`invalid-password-reset`?`verifying`:`request`),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),x=(0,Z.useRef)(!1),S=async(e,t)=>{let n=await i.verifyPasswordReset({token:e},t);b.current=n,l(``),a(`password`)};(0,Z.useEffect)(()=>{if(x.current||e===null)return;if(x.current=!0,e.kind!==`password-reset`){e.kind===`invalid-password-reset`&&(y(`This reset link is incomplete or expired. Request a new one.`),a(`request`));return}let n=new AbortController;return _(!0),S(e.token,n.signal).catch(e=>y(fn(e,`This reset link could not be verified.`))).finally(()=>{t(),n.signal.aborted||_(!1)}),()=>n.abort()},[e,t]);let C=async e=>{if(e.preventDefault(),!g){_(!0),y(null);try{if(r===`request`)await i.requestPasswordReset({identifier:o.trim().toLowerCase()}),a(`check-email`);else if(r===`check-email`)await S(c.trim());else if(r===`password`){let e=b.current;if(e===null)return;if(u!==f){y(`The passwords do not match.`);return}let t=u;d(``),p(``),await i.finishPasswordReset({attemptId:e.attemptId,attemptSecret:e.attemptSecret,password:t,factor:e.requiresTotp?{kind:`totp`,code:m.trim()}:{kind:`none`}}),h(``),b.current=null,a(`complete`)}}catch(e){y(fn(e,`Password reset did not complete.`))}finally{_(!1)}}},w=r===`request`?1:r===`check-email`||r===`verifying`?2:3;return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void C(e),children:[r===`complete`?null:(0,$.jsx)(sn,{step:w,total:3,label:w===1?`Find your account`:w===2?`Check your email`:`Set a new password`}),r===`request`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-reset-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:o,className:W,onChange:e=>s(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`If the account is eligible, its verified address receives a single-use reset link.`})]}):r===`check-email`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(Ze,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Open the reset link, or paste its token below.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-token`,children:`Reset token`}),(0,$.jsx)(G,{id:`hub-reset-token`,type:`password`,autoComplete:`one-time-code`,maxLength:64,required:!0,value:c,className:W,onChange:e=>l(e.currentTarget.value)})]})]}):r===`password`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password`,children:`New password`}),(0,$.jsx)(G,{id:`hub-reset-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:u,className:W,onChange:e=>d(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-reset-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:f,className:W,onChange:e=>p(e.currentTarget.value)})]}),b.current?.requiresTotp?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-totp`,children:`Authenticator code`}),(0,$.jsx)(G,{id:`hub-reset-totp`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:m,className:W,onChange:e=>h(e.currentTarget.value)})]}):null]}):r===`complete`?(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Password changed`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`Every previous session was revoked. Sign in again with the new password and its normal second factor.`})]}):(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Verifying your reset link…`}),(0,$.jsx)(xn,{value:v}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsx)(K,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Sn,{onCancel:n,pending:g,submitLabel:r===`request`?`Send reset email`:r===`check-email`?`Verify reset token`:r===`password`?`Change password`:`Verifying…`,submitDisabled:r===`verifying`})]})}function bn({onCancel:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=async e=>{if(e.preventDefault(),r)return;a(!0),s(null);let o=t;n(``);try{await i.signInWithRecoveryCode(o),await _.bootstrap()}catch(e){s(fn(e,`That recovery code could not be used.`))}finally{a(!1)}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void c(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-recovery-code`,children:`Recovery code`}),(0,$.jsx)(G,{id:`hub-login-recovery-code`,type:`password`,autoComplete:`one-time-code`,required:!0,maxLength:128,value:t,className:W,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsx)(xn,{value:o}),(0,$.jsx)(Sn,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function xn(e){let t=(0,Q.c)(2),{value:n}=e,r;return t[0]===n?r=t[1]:(r=n?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,t[0]=n,t[1]=r),r}function Sn(e){let t=(0,Q.c)(12),{onCancel:n,pending:r,submitLabel:i,submitDisabled:a}=e,o=r||a!==void 0&&a,s;t[0]===r?s=t[1]:(s=r?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):null,t[0]=r,t[1]=s);let c=r?`Working…`:i,l;t[2]!==o||t[3]!==s||t[4]!==c?(l=(0,$.jsxs)(K,{type:`submit`,size:`lg`,className:`min-h-11 w-full`,disabled:o,children:[s,c]}),t[2]=o,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]!==n||t[7]!==r?(u=(0,$.jsx)(K,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,disabled:r,onClick:n,children:`Back`}),t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${qe}`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}var Cn;function wn(){if(window.location.pathname!==`/email-verification`)return null;if(Cn!==void 0)return Cn;let e=tt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return Cn=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,Cn}function Tn(){let e=(0,Q.c)(3),t=A(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=Ke(t===null?void 0:z(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function En(){let e=(0,Q.c)(30),[t,n]=(0,Z.useState)(wn),r=s(Pn),i=s(Nn),o=s(Mn),u=s(jn),d=s(An),f=s(kn),p=c(On),m=P(),h;e[0]===m.logicalPathname?h=e[1]:(h=M(m.logicalPathname),e[0]=m.logicalPathname,e[1]=h);let g=h,_;e[2]===g?_=e[3]:(_=e=>l(e,g),e[2]=g,e[3]=_);let y=a(_),b=ne();N();let x;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],e[4]=x):x=e[4],(0,Z.useEffect)(Dn,x),nt(),Tn();let S=A(),C;e[5]!==r||e[6]!==S?.kind?(C=()=>{r===`authenticated`&&S?.kind===`sign-up`&&F(`/`,{replace:!0})},e[5]=r,e[6]=S?.kind,e[7]=C):C=e[7];let w;if(e[8]!==r||e[9]!==S?(w=[r,S],e[8]=r,e[9]=S,e[10]=w):w=e[10],(0,Z.useEffect)(C,w),t?.kind===`email-verification`||t?.kind===`invalid-email-verification`){let r;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{window.history.replaceState(window.history.state,``,`/`),n(null)},e[11]=r):r=e[11];let i;return e[12]===t?i=e[13]:(i=(0,$.jsx)(Fn,{link:t,onContinue:r}),e[12]=t,e[13]=i),i}if(r!==`authenticated`){let t;return e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Gn,{}),e[14]=t):t=e[14],t}if(o.length>0&&!p){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Jn,{}),e[15]=t):t=e[15],t}if(S?.kind===`account`){let t;return e[16]===S.section?t=e[17]:(t=(0,$.jsx)(Zt,{section:S.section}),e[16]=S.section,e[17]=t),t}if(S?.kind===`nodes`||S?.kind===`nodes-enroll`){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)($n,{}),e[18]=t):t=e[18],t}if(m.nodeId===null){if(b||m.malformed){let t;return e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)($n,{}),e[19]=t):t=e[19],t}if(i&&d){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{authGateState:{status:`hosted-hub`}}),e[20]=t):t=e[20],t}let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{authGateState:{status:`hosted-cached`}}),e[21]=t):t=e[21],t}if(!i||i.id!==m.nodeId){let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Vn,{}),e[22]=t):t=e[22],t}if(u===`terminal-failure`){let t;return e[23]!==f||e[24]!==i?(t=(0,$.jsx)(Rn,{node:i,message:f}),e[23]=f,e[24]=i,e[25]=t):t=e[25],t}if(!d){if(y){let t;return e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{authGateState:{status:`hosted-cached`}}),e[26]=t):t=e[26],t}let t;return e[27]===i?t=e[28]:(t=(0,$.jsx)(Hn,{node:i}),e[27]=i,e[28]=t),t}let T;return e[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(v,{authGateState:{status:`hosted-hub`}}),e[29]=T):T=e[29],T}function Dn(){return p()}function On(e){return e.leased}function kn(e){return e.errorMessage}function An(e){return e.sessionEstablished}function jn(e){return e.transportStatus}function Mn(e){return e.recoveryCodes}function Nn(e){return e.selectedNode}function Pn(e){return e.accountStatus}function Fn(e){let t=(0,Q.c)(15),{link:n,onContinue:r}=e,[a,o]=(0,Z.useState)(n.kind===`email-verification`?`verifying`:`invalid`),s;t[0]!==n.kind||t[1]!==n.token?(s=()=>{if(n.kind!==`email-verification`)return;let e=new AbortController;return i.confirmEmailVerification(n.token,e.signal).then(()=>o(`verified`)).catch(()=>{e.signal.aborted||o(`invalid`)}).finally(In),()=>e.abort()},t[0]=n.kind,t[1]=n.token,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=[n],t[3]=n,t[4]=c),(0,Z.useEffect)(s,c);let l=a===`verifying`?`Verifying your email`:a===`verified`?`Email verified`:`This verification link is unavailable`,u=a===`verifying`?`This will only take a moment.`:a===`verified`?`Your address is now available for account recovery.`:`The link is incomplete, expired, or has already been used. Request a new one from Account settings.`,d;t[5]!==r||t[6]!==a?(d=a===`verifying`?void 0:(0,$.jsx)(K,{size:`cta`,className:`mt-6 w-full`,onClick:r,children:`Continue`}),t[5]=r,t[6]=a,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=a===`verifying`?(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Confirming the link…`]}):null,t[8]=a,t[9]=f);let p;return t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,$.jsx)(an,{title:l,description:u,actions:d,children:f}),t[10]=l,t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function In(){Cn=void 0}function Ln(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(S,{"aria-hidden":!0,className:`mr-2 inline size-4 animate-spin align-[-0.15em] motion-reduce:animate-none`}),e[0]=t):t=e[0],t}function Rn(e){let t=(0,Q.c)(10),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(te,{}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(oe,{"aria-hidden":!0,className:`size-8 text-destructive`}),t[1]=a):a=t[1];let o=`Unable to connect to ${n.label}`,s=r??`The relay session could not be established. Choose another node or retry.`,c;t[2]===s?c=t[3]:(c=(0,$.jsx)(`p`,{role:`alert`,className:`text-muted-foreground text-sm`,children:s}),t[2]=s,t[3]=c);let l;t[4]===r?l=t[5]:(l=r===`Ryco state could not be synchronized.`?(0,$.jsxs)(K,{className:`mt-5`,onClick:zn,children:[(0,$.jsx)(ie,{"aria-hidden":!0}),` Retry`]}):null,t[4]=r,t[5]=l);let u;return t[6]!==o||t[7]!==c||t[8]!==l?(u=(0,$.jsx)(qt,{measure:`content`,trailing:i,children:(0,$.jsxs)(Bn,{tone:`destructive`,icon:a,title:o,children:[c,l]})}),t[6]=o,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function zn(){_.retrySelectedNode()}function Bn(e){let t=(0,Q.c)(9),{children:n,icon:r,title:i,tone:a}=e,o=`mt-4 font-semibold text-2xl tracking-tight ${(a===void 0?`default`:a)===`destructive`?`text-foreground`:``}`,s;t[0]!==o||t[1]!==i?(s=(0,$.jsx)(`h1`,{className:o,children:i}),t[0]=o,t[1]=i,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,$.jsx)(`div`,{className:`mt-2`,children:n}),t[3]=n,t[4]=c);let l;return t[5]!==r||t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center pt-10 text-center`,children:[r,s,c]}),t[5]=r,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Vn(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(qt,{measure:`content`,children:(0,$.jsx)(Bn,{icon:t,title:`Restoring your node`,children:(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Checking your access before reconnecting…`]})})}),e[1]=n):n=e[1],n}function Hn(e){let t=(0,Q.c)(7),{node:n}=e,{returnToAllNodes:r}=j(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),t[0]=i):i=t[0];let a=`Connecting to ${n.label}`,o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Preparing a private relay session and synchronizing Ryco state…`]}),t[1]=o):o=t[1];let s;t[2]===r?s=t[3]:(s=(0,$.jsx)(K,{variant:`outline`,className:`mt-5 phone:min-h-11`,onClick:()=>void r(),children:`Back to nodes`}),t[2]=r,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,$.jsx)(qt,{measure:`content`,children:(0,$.jsxs)(Bn,{icon:i,title:a,children:[o,s]})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function Un(e){let t=(0,Q.c)(15),{bootstrapAvailable:n,publicSignupEnabled:r}=e,[i,a]=(0,Z.useState)(!1),o=(0,Z.useId)(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>a(Wn),t[0]=s):s=t[0];let c=`transition-transform ${i?`rotate-180`:``}`,l;t[1]===c?l=t[2]:(l=(0,$.jsx)(C,{"aria-hidden":!0,className:c}),t[1]=c,t[2]=l);let u;t[3]!==i||t[4]!==o||t[5]!==l?(u=(0,$.jsxs)(K,{variant:`ghost`,size:`sm`,"aria-expanded":i,"aria-controls":o,className:`-mx-2 h-auto min-h-8 max-w-full whitespace-normal py-1.5 text-left phone:min-h-11`,onClick:s,children:[`New to this Hub?`,l]}),t[3]=i,t[4]=o,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==r?(d=i?(0,$.jsxs)(`div`,{id:o,className:`mt-2 space-y-2 text-xs leading-relaxed text-muted-foreground`,children:[(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`Getting access.`}),` Accounts are`,r?` open to signup on this Hub. Verify your email, then choose a passkey or password.`:` created by invitation. An owner sends you an invitation code; redeem it below to create your account.`]}),(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`What a passkey is here.`}),` The passkey is created by your browser or password manager and never leaves it. It is the only credential this Hub treats as strong.`]}),n?(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`If this Hub is brand new.`}),` No owner exists yet. “Set up first owner” claims this Hub with a bootstrap credential from whoever deployed it.`]}):null]}):null,t[7]=n,t[8]=i,t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;return t[12]!==u||t[13]!==d?(f=(0,$.jsxs)(`div`,{className:`mt-4`,children:[u,d]}),t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function Wn(e){return!e}function Gn({context:e=`hub`,autoExternalProvider:t=null}={}){let n=s(e=>e.accountStatus),r=s(e=>e.errorMessage),a=s(e=>e.bootstrapAvailable),[c,l]=(0,Z.useState)(()=>tt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)})),u=(0,Z.useCallback)(()=>l(null),[]),{config:d}=mn(),f=o(e=>e.externalIdentityConfiguration),p=He(f),[m,h]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(!1),[x,C]=(0,Z.useState)(void 0),w=A(),T=w?.kind===`sign-up`||w?.kind===`sign-up-verify`?`public`:w?.kind===`invitation`?`invitation`:w?.kind===`setup`?`bootstrap`:null,E=w?.kind===`sign-in-password`?`password`:w?.kind===`sign-in-recovery-code`?`recovery-code`:w?.kind===`reset-password`?`password-reset`:null,D=e=>{I(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},O=e=>{I(e===`password`?{kind:`sign-in-password`}:e===`recovery-code`?{kind:`sign-in-recovery-code`}:e===`password-reset`?{kind:`reset-password`}:{kind:`sign-in`})},j=(0,Z.useRef)(null),M=(0,Z.useRef)(null),N=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{_.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(T!==`public`&&e!==`native-authorization`){C(void 0);return}let t=new AbortController;return C(void 0),i.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||C(e)}).catch(()=>{t.signal.aborted||C({status:`none`})}),()=>t.abort()},[e,T]);let P=(0,Z.useCallback)(async()=>{if(!m){h(!0),y(null);try{await Ue({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:ee({kind:`sign-up`}),start:e=>i.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){y(e instanceof g?e.message:`GitHub sign-in is temporarily unavailable.`),h(!1)}}},[e,m]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||p?.login!==!0||x?.status!==`none`||b.current||(b.current=!0,P())},[t,e,x?.status,p?.login,P,n]),(0,Z.useEffect)(()=>{T===`invitation`||T===`bootstrap`?M.current?.focus({preventScroll:!0}):j.current?.focus({preventScroll:!0})},[E,T]),(0,Z.useEffect)(()=>{N.current?.scrollTo({top:0,left:0})},[E,T]);let F=T===`invitation`||T===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${qe}`,children:[(0,$.jsx)(K,{type:`submit`,form:Kn,className:`phone:min-h-11`,disabled:n===`authenticating`,children:T===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>_.cancelAuthentication():()=>D(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,L=T||E?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[p?.login?(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:m||n===`authenticating`||n===`signing-out`,onClick:()=>void P(),children:[m?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(ce,{"aria-hidden":!0}),m?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void _.signIn(),children:[(0,$.jsx)(k,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>_.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[d?.status===`enabled`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`public`),children:`Create account`}):null,(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`bootstrap`),children:`Set up first owner`}):null]})]})}),R=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(K,{className:`mt-3 phone:min-h-11`,variant:`ghost`,onClick:()=>void _.bootstrap(),children:[(0,$.jsx)(ie,{"aria-hidden":!0}),` Retry Hub`]}):null,(0,$.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:n===`authenticating`?`Passkey authentication is in progress.`:``})]}),z=v??r,te=z?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`error`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`Sign-in did not complete`}),(0,$.jsx)(ve,{children:z})]})}):null,ne=x?.status===`signup`?x:null,re=x?.status===`error`?x:null,V=e===`native-authorization`&&T!==`public`;if(T===`public`||V&&(ne!==null||re!==null)){let e=()=>{V?C({status:`none`}):D(null)};return(0,$.jsxs)(an,{title:`Create your account`,description:V?`Choose your Ryco username, then return to approving this device.`:`Pick a username and confirm your email. You choose a passkey or a password at the end.`,trailing:R,scrollRef:N,titleRef:j,children:[te,x===void 0?(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}):ne?(0,$.jsx)(_n,{pendingSignup:ne,config:d?.status===`enabled`?d:null,onCancel:e}):re?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(ye,{variant:`warning`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`GitHub signup did not continue`}),(0,$.jsx)(ve,{children:Ve(re.code)})]}),(0,$.jsx)(K,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(gn,{config:d?.status===`enabled`?d:null,initialLink:c,onConsumeLink:u,onCancel:()=>{u(),D(null)}})]})}if(T===`invitation`||T===`bootstrap`)return(0,$.jsxs)(an,{title:T===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:T===`invitation`?`Enter the invitation code an owner sent you. Your browser creates a passkey at the same time.`:`No owner exists yet. The bootstrap credential from whoever deployed this Hub makes you its first owner.`,actions:F,trailing:R,scrollRef:N,titleRef:j,children:[te,(0,$.jsx)(qn,{mode:T,credentialRef:M})]});if(E!==null){let e={password:{title:`Sign in with a password`,description:`Password sign-in always asks for a second factor — an authenticator code, or a code sent to your verified email.`},"recovery-code":{title:`Use a recovery code`,description:`One of the single-use codes you saved when your account was created. Each code works once.`},"password-reset":{title:`Reset your password`,description:`We email a single-use link. Setting a new password signs out every device, including this one.`}}[E];return(0,$.jsxs)(an,{title:e.title,description:e.description,trailing:R,scrollRef:N,titleRef:j,children:[te,E===`password`?(0,$.jsx)(vn,{onCancel:()=>O(null),onUseRecoveryCode:()=>O(`recovery-code`),onResetPassword:()=>O(`password-reset`)}):E===`recovery-code`?(0,$.jsx)(bn,{onCancel:()=>O(null)}):(0,$.jsx)(yn,{initialLink:c,onConsumeLink:u,onCancel:()=>{u(),O(null)}})]})}return(0,$.jsxs)(an,{title:e===`native-authorization`?`Sign in to continue on your device`:n===`session-expired`?`Your session expired`:`Connect to your Ryco nodes`,description:e===`native-authorization`?`Authenticate in this browser first. Ryco will ask again before it authorizes the mobile app.`:`Ryco Hub reaches the developer machines an owner has authorized for your account. Your session lives in an HttpOnly cookie — nothing about it is readable by this page.`,actions:L,trailing:R,scrollRef:N,titleRef:j,children:[(0,$.jsx)(Je,{}),(0,$.jsx)(Un,{bootstrapAvailable:a,publicSignupEnabled:d?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(K,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>O(`password`),children:[(0,$.jsx)(Xe,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(B,{}),te]})}var Kn=`hub-registration-form`;function qn(e){let t=(0,Q.c)(29),{mode:n,credentialRef:r}=e,[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),u;t[0]!==i||t[1]!==o||t[2]!==n||t[3]!==c?(u=async e=>{e.preventDefault();let t=i;a(``);let r={displayName:o.trim(),passkeyLabel:c.trim()||null};n===`invitation`?await _.redeemInvitation({secret:t,...r}):await _.bootstrapOwner({credential:t,...r})},t[0]=i,t[1]=o,t[2]=n,t[3]=c,t[4]=u):u=t[4];let d=u,f;t[5]===d?f=t[6]:(f=e=>void d(e),t[5]=d,t[6]=f);let p=n===`invitation`?`Invitation code`:`Bootstrap credential`,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(Y,{htmlFor:`hub-registration-credential`,children:p}),t[7]=p,t[8]=m);let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>a(e.currentTarget.value),t[9]=h):h=t[9];let g;t[10]!==i||t[11]!==r?(g=(0,$.jsx)(G,{ref:r,id:`hub-registration-credential`,type:`password`,required:!0,maxLength:128,value:i,className:W,onChange:h}),t[10]=i,t[11]=r,t[12]=g):g=t[12];let v;t[13]!==m||t[14]!==g?(v=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[m,g]}),t[13]=m,t[14]=g,t[15]=v):v=t[15];let y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Y,{htmlFor:`hub-display-name`,children:`Display name`}),t[16]=y):y=t[16];let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>s(e.currentTarget.value),t[17]=b):b=t[17];let x;t[18]===o?x=t[19]:(x=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[y,(0,$.jsx)(G,{id:`hub-display-name`,required:!0,maxLength:200,value:o,className:W,onChange:b})]}),t[18]=o,t[19]=x);let S;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsxs)(Y,{htmlFor:`hub-passkey-label`,children:[`Passkey label `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),t[20]=S):S=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>l(e.currentTarget.value),t[21]=C):C=t[21];let w;t[22]===c?w=t[23]:(w=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[S,(0,$.jsx)(G,{id:`hub-passkey-label`,maxLength:100,value:c,className:W,onChange:C})]}),t[22]=c,t[23]=w);let T;return t[24]!==x||t[25]!==w||t[26]!==f||t[27]!==v?(T=(0,$.jsxs)(`form`,{id:Kn,className:`mt-6 space-y-4`,onSubmit:f,autoComplete:`off`,children:[v,x,w]}),t[24]=x,t[25]=w,t[26]=f,t[27]=v,t[28]=T):T=t[28],T}function Jn(){let e=(0,Q.c)(20),t=s(Zn),{copyToClipboard:n,isCopied:r}=q(),i=`Save all ${String(t.length)} codes — they are shown once and cannot be retrieved later. Ryco does not save them in browser storage.`,a;e[0]!==n||e[1]!==t?(a=()=>n(Be(t),void 0),e[0]=n,e[1]=t,e[2]=a):a=e[2];let o;e[3]===r?o=e[4]:(o=r?(0,$.jsx)(x,{"aria-hidden":!0}):(0,$.jsx)(O,{"aria-hidden":!0}),e[3]=r,e[4]=o);let c=r?`Copied`:`Copy codes`,l;e[5]!==a||e[6]!==o||e[7]!==c?(l=(0,$.jsxs)(K,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:a,children:[o,c]}),e[5]=a,e[6]=o,e[7]=c,e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(K,{size:`cta`,className:`mt-3 w-full`,onClick:Xn,children:`I saved the codes`}),e[9]=u):u=e[9];let d;e[10]===l?d=e[11]:(d=(0,$.jsxs)(`div`,{className:`phone:mt-auto ${qe}`,children:[l,u]}),e[10]=l,e[11]=d);let f;e[12]===t?f=e[13]:(f=t.map(Yn),e[12]=t,e[13]=f);let p;e[14]===f?p=e[15]:(p=(0,$.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:f}),e[14]=f,e[15]=p);let m;return e[16]!==i||e[17]!==d||e[18]!==p?(m=(0,$.jsx)(an,{title:`Save your recovery codes`,description:i,actions:d,children:p}),e[16]=i,e[17]=d,e[18]=p,e[19]=m):m=e[19],m}function Yn(e){return(0,$.jsx)(`li`,{children:e},e)}function Xn(){return _.dismissRecoveryCodes()}function Zn(e){return e.recoveryCodes}function Qn(e){let t=(0,Q.c)(38),{node:n,nowMs:r,disabled:i,onConnect:a,onOpenDetail:o}=e,s;t[0]!==n||t[1]!==r?(s=Ot(n,r),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]===n?l=t[4]:(l=f(n),t[3]=n,t[4]=l);let u=l,d=i||u,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-4`})}),t[5]=p):p=t[5];let m;t[6]===n.label?m=t[7]:(m=(0,$.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),t[6]=n.label,t[7]=m);let h;t[8]===n?h=t[9]:(h=kt(n),t[8]=n,t[9]=h);let g;t[10]===h?g=t[11]:(g=(0,$.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:h}),t[10]=h,t[11]=g);let _;t[12]===u?_=t[13]:(_=u?(0,$.jsx)(`span`,{className:`block truncate text-xs font-medium text-muted-foreground`,children:`Open in Desktop/Mobile`}):null,t[12]=u,t[13]=_);let v;t[14]!==m||t[15]!==g||t[16]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[m,g,_]}),t[14]=m,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]===n?y=t[19]:(y=(0,$.jsx)(L,{node:n}),t[18]=n,t[19]=y);let b;t[20]===c?b=t[21]:(b=c?(0,$.jsx)(`span`,{className:`whitespace-nowrap text-[11px] text-muted-foreground max-sm:hidden phone:hidden`,children:c}):null,t[20]=c,t[21]=b);let x;t[22]!==y||t[23]!==b?(x=(0,$.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[y,b]}),t[22]=y,t[23]=b,t[24]=x):x=t[24];let S;t[25]!==a||t[26]!==x||t[27]!==d||t[28]!==v?(S=(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:a,className:`flex min-h-16 min-w-0 flex-1 flex-wrap items-center gap-3 px-4 py-3 text-left outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:opacity-60 disabled:hover:bg-transparent phone:min-h-18`,children:[p,v,x]}),t[25]=a,t[26]=x,t[27]=d,t[28]=v,t[29]=S):S=t[29];let C;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`w-px shrink-0 bg-border/60`}),t[30]=C):C=t[30];let T=`Node details: ${n.label}`,E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(w,{"aria-hidden":!0,className:`size-4`}),t[31]=E):E=t[31];let D;t[32]!==o||t[33]!==T?(D=(0,$.jsx)(`button`,{type:`button`,"aria-label":T,onClick:o,className:`flex w-[44px] shrink-0 items-center justify-center text-muted-foreground outline-none hover:bg-accent/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:E}),t[32]=o,t[33]=T,t[34]=D):D=t[34];let O;return t[35]!==S||t[36]!==D?(O=(0,$.jsxs)(`li`,{className:`flex items-stretch overflow-hidden rounded-xl border border-border bg-background`,children:[S,C,D]}),t[35]=S,t[36]=D,t[37]=O):O=t[37],O}function $n(){let e=(0,Q.c)(110),t=s(pr),n=s(fr),r=s(dr),a=s(ur),o=s(lr),c=s(cr),l=ne(),u=m(),d=ge()===`phone`,f=A()?.kind===`nodes-enroll`,p=sr,[h,g]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),x=We(6e4),C,w;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{b.current?.focus({preventScroll:!0})},w=[],e[0]=C,e[1]=w):(C=e[0],w=e[1]),(0,Z.useEffect)(C,w);let T;e[2]===u?T=e[3]:(T=async e=>{R(e.id)||(await u({to:`/`,replace:!0}),await _.selectNode(e.id))},e[2]=u,e[3]=T);let E=T;if(f){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(qt,{measure:`content`,children:(0,$.jsx)(on,{onClose:()=>p(!1)})}),e[4]=t):t=e[4],t}let D,O,k,j,M,N,P,F,I,L,z,ee,te,V,H,U,W,G;if(e[5]!==o||e[6]!==r||e[7]!==h||e[8]!==a||e[9]!==d||e[10]!==t||e[11]!==x||e[12]!==v||e[13]!==l||e[14]!==E||e[15]!==c||e[16]!==n){let i=At(t),s;e[35]!==h||e[36]!==t?(s=h===null?null:t.find(e=>e.id===h)??null,e[35]=h,e[36]=t,e[37]=s):s=e[37],j=s,P=o?.role===`owner`;let u=n===`ready`&&t.length===0;N=P&&!u;let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:or,children:[(0,$.jsx)(se,{"aria-hidden":!0}),` Account`]}),e[38]=f):f=e[38],k=f;let m;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:ar,children:[(0,$.jsx)(re,{"aria-hidden":!0}),` Sign out`]}),e[39]=m):m=e[39],I=m;let _=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,y,C;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>p(!0),C=(0,$.jsx)(ae,{"aria-hidden":!0}),e[40]=y,e[41]=C):(y=e[40],C=e[41]);let w;e[42]===_?w=e[43]:(w=(0,$.jsxs)(K,{className:_,onClick:y,children:[C,` Enroll node`]}),e[42]=_,e[43]=w),M=w;let T=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,A=n===`loading`,R;e[44]===n?R=e[45]:(R=n===`loading`?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,$.jsx)(ie,{"aria-hidden":!0}),e[44]=n,e[45]=R);let B;e[46]!==T||e[47]!==A||e[48]!==R?(B=(0,$.jsxs)(K,{className:T,variant:`outline`,disabled:A,onClick:ir,children:[R,`Refresh nodes`]}),e[46]=T,e[47]=A,e[48]=R,e[49]=B):B=e[49],F=B,O=qt;let ne;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:rr,children:(0,$.jsx)(se,{"aria-hidden":!0})}),e[50]=ne):ne=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsxs)($.Fragment,{children:[ne,(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:nr,children:(0,$.jsx)(re,{"aria-hidden":!0})})]}),e[51]=z):z=e[51],D=zt,ee=b,te=t.length===1?`Your node`:`Your nodes`;let ce=o?.displayName??`Hub account`,q;e[52]===o?q=e[53]:(q=o?` · ${o.role.charAt(0).toUpperCase()}${o.role.slice(1)}`:``,e[52]=o,e[53]=q);let le;e[54]!==ce||e[55]!==q?(le=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,ce,q]}),e[54]=ce,e[55]=q,e[56]=le):le=e[56];let J;e[57]===t?J=e[58]:(J=t.length>1?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:Nt(t)}):null,e[57]=t,e[58]=J),e[59]!==le||e[60]!==J?(V=(0,$.jsxs)($.Fragment,{children:[le,J]}),e[59]=le,e[60]=J,e[61]=V):V=e[61],e[62]!==M||e[63]!==N||e[64]!==d||e[65]!==F?(H=d?void 0:(0,$.jsxs)($.Fragment,{children:[F,N?M:null]}),e[62]=M,e[63]=N,e[64]=d,e[65]=F,e[66]=H):H=e[66],e[67]===n?U=e[68]:(U=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=U),e[69]===v?W=e[70]:(W=v?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:v})]})}):null,e[69]=v,e[70]=W);let ue=n===`stale`?null:a;e[71]!==l||e[72]!==c||e[73]!==ue?(G=(0,$.jsx)(mr,{selection:c,routeNotice:l,error:ue}),e[71]=l,e[72]=c,e[73]=ue,e[74]=G):G=e[74],L=u?(0,$.jsx)(hr,{isOwner:P,onEnroll:()=>p(!0)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`ul`,{role:`list`,className:`mt-5 space-y-2`,"aria-busy":n===`loading`,children:[i.map(e=>(0,$.jsx)(Qn,{node:e,nowMs:x,disabled:Pt({directoryStatus:n,browserStatus:r,node:e}),onConnect:()=>void E(e),onOpenDetail:()=>g(e.id)},`${e.id}:${e.environmentId}`)),n===`loading`&&t.length===0?(0,$.jsx)($.Fragment,{children:[0,1,2].map(tr)}):null]}),n===`loading`&&t.length===0?(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:`Loading authorized nodes…`}):null,t.length>0?(0,$.jsx)(`p`,{className:`mt-2 px-1 text-[11px] text-muted-foreground`,children:`Presence refreshes about every 20 seconds.`}):null]}),e[5]=o,e[6]=r,e[7]=h,e[8]=a,e[9]=d,e[10]=t,e[11]=x,e[12]=v,e[13]=l,e[14]=E,e[15]=c,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=j,e[21]=M,e[22]=N,e[23]=P,e[24]=F,e[25]=I,e[26]=L,e[27]=z,e[28]=ee,e[29]=te,e[30]=V,e[31]=H,e[32]=U,e[33]=W,e[34]=G}else D=e[17],O=e[18],k=e[19],j=e[20],M=e[21],N=e[22],P=e[23],F=e[24],I=e[25],L=e[26],z=e[27],ee=e[28],te=e[29],V=e[30],H=e[31],U=e[32],W=e[33],G=e[34];let ce,q;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Je,{})}),q=(0,$.jsx)(B,{}),e[75]=ce,e[76]=q):(ce=e[75],q=e[76]);let le;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{e||g(null)},e[77]=le):le=e[77];let J;e[78]===E?J=e[79]:(J=e=>void E(e),e[78]=E,e[79]=J);let ue;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(ue=async e=>{await i.revokeNode(e.id,lt),y(mt(e.label)),await _.refreshDirectory(),g(null)},e[80]=ue):ue=e[80];let de;e[81]!==r||e[82]!==j||e[83]!==P||e[84]!==n||e[85]!==J?(de=(0,$.jsx)(Rt,{node:j,directoryStatus:n,browserStatus:r,canRename:P,canRevoke:P,onOpenChange:le,onConnect:J,onRename:er,onRevoke:ue}),e[81]=r,e[82]=j,e[83]=P,e[84]=n,e[85]=J,e[86]=de):de=e[86];let fe;e[87]!==D||e[88]!==L||e[89]!==de||e[90]!==ee||e[91]!==te||e[92]!==V||e[93]!==H||e[94]!==U||e[95]!==W||e[96]!==G?(fe=(0,$.jsxs)(D,{titleRef:ee,title:te,description:V,actions:H,children:[U,W,G,L,ce,q,de]}),e[87]=D,e[88]=L,e[89]=de,e[90]=ee,e[91]=te,e[92]=V,e[93]=H,e[94]=U,e[95]=W,e[96]=G,e[97]=fe):fe=e[97];let pe;e[98]!==k||e[99]!==M||e[100]!==N||e[101]!==d||e[102]!==F||e[103]!==I?(pe=d?(0,$.jsxs)(`div`,{className:`mt-auto ${qe}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,I]}),N?M:null,F]}):null,e[98]=k,e[99]=M,e[100]=N,e[101]=d,e[102]=F,e[103]=I,e[104]=pe):pe=e[104];let me;return e[105]!==O||e[106]!==z||e[107]!==fe||e[108]!==pe?(me=(0,$.jsxs)(O,{trailing:z,children:[fe,pe]}),e[105]=O,e[106]=z,e[107]=fe,e[108]=pe,e[109]=me):me=e[109],me}async function er(e,t){await i.renameNode(e.id,t),await _.refreshDirectory()}function tr(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(he,{className:`h-16 w-full rounded-xl`})},e)}function nr(){_.signOut()}function rr(){I({kind:`account`,section:`security`})}function ir(){_.refreshDirectory()}function ar(){_.signOut()}function or(){I({kind:`account`,section:`security`})}function sr(e){return I(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function cr(e){return e.selectionStatus}function lr(e){return e.account}function ur(e){return e.errorMessage}function dr(e){return e.browserStatus}function fr(e){return e.directoryStatus}function pr(e){return e.nodes}function mr(e){let t=(0,Q.c)(3),{selection:n,routeNotice:r,error:i}=e,a=(n===`authorization-removed`?`Authorization for the previous node was removed.`:n===`revoked`?`The previous node or grant was revoked.`:n===`incompatible`?`The previous node uses an incompatible relay version.`:null)??r??i;if(!a)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(oe,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;return t[1]===a?s=t[2]:(s=(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`error`,children:[o,(0,$.jsx)(ve,{children:a})]})}),t[1]=a,t[2]=s),s}function hr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(Pe,{variant:`icon`,children:n?(0,$.jsx)(ae,{"aria-hidden":!0}):(0,$.jsx)(H,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Le,{children:`No nodes yet`}),t[2]=a):a=t[2];let o=n?`A node appears here once the Ryco client on that machine has been enrolled. Start enrollment on the node, then enter the short device code it shows — codes expire after ten minutes.`:`A node appears here once an owner of this Hub authorizes your account for it.`,s;t[3]===o?s=t[4]:(s=(0,$.jsx)(Re,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Fe,{children:[i,a,s]}),t[5]=i,t[6]=s,t[7]=c):c=t[7];let l;t[8]!==n||t[9]!==r?(l=n?(0,$.jsx)(Ie,{children:(0,$.jsxs)(K,{className:`phone:min-h-11`,onClick:r,children:[(0,$.jsx)(ae,{"aria-hidden":!0}),` Enroll node`]})}):null,t[8]=n,t[9]=r,t[10]=l):l=t[10];let u;return t[11]!==c||t[12]!==l?(u=(0,$.jsxs)(ze,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}export{Gn as HostedAuthenticationSurface,En as HostedHubRoot};
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-CQmEMMQH.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import"./src-Vf4LVnMX.js";import{F as i,Jt as a,M as o,N as s,P as c,Wt as l}from"./runtime-CXut_g4p.js";import{It as u}from"./composerDraftStore-CdJJZe42.js";import{a as d,i as f,o as p}from"./useHandleNewThread-DX2FtXcP.js";import{t as m}from"./useNavigate-2tVq4iZ2.js";import{Gt as h,_ as g,o as _}from"./authorization-mIJKV2yp.js";import{t as v}from"./RootAppShell-C-0ChFVJ.js";import{f as y}from"./useRenderElement-DchFnsR8.js";import{t as b}from"./arrow-left-Dtj9PfsA.js";import{n as x,t as S}from"./loader-circle-CrtHFAvM.js";import{t as C}from"./chevron-down-B7C6FKzM.js";import{t as w}from"./chevron-right-BWYGybX9.js";import{n as T,o as E,t as D}from"./toast-CcSCAm4B.js";import{t as O}from"./copy-UQjKGt7t.js";import{t as k}from"./key-round-CacMputS.js";import{_ as A,a as j,c as M,d as N,f as P,g as F,h as I,i as L,l as R,m as z,o as B,p as ee,t as te,u as ne}from"./HostedConnectionControls-DxAXv0Hd.js";import{t as re}from"./log-out-tMJm0Gk6.js";import{t as V}from"./palette-BSD_aJZg.js";import{t as ie}from"./refresh-cw-DopCMrtR.js";import{t as ae}from"./server-JApJpgLa.js";import{t as H}from"./shield-check-dQ-4cMKk.js";import{t as oe}from"./triangle-alert-RL_T3KLo.js";import{t as se}from"./user-round-Cpzx8pSw.js";import{t as U}from"./utils-BofFIn5Y.js";import{n as W,t as G}from"./input-CHEwW3oH.js";import{u as ce}from"./Icons-CT3nd2MA.js";import{t as K}from"./button-BAbJxRzt.js";import{t as q}from"./useCopyToClipboard-BTpWxumf.js";import{a as le,i as J,n as ue,o as de,r as fe,s as pe,t as me}from"./sheet-BO78gIKZ.js";import{t as he}from"./skeleton-CvQSeJbw.js";import{t as ge}from"./usePresentationTier-B_SCFvN7.js";import{i as _e,r as ve,t as ye}from"./alert-LqMhbdE9.js";import{a as be,c as xe,i as Se,o as Ce,r as we,s as Te,t as Ee}from"./dialog-DQsYchqu.js";import{t as Y}from"./label-CVFHsLFO.js";import{t as De}from"./RycoLetterMark-Bk0kvGJ_.js";import{a as Oe,i as ke,n as Ae,o as je,r as Me,t as Ne}from"./MobileSheet-CkeG6_SP.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,t as ze}from"./empty-DwzqNgCP.js";import{c as Be,n as Ve,r as He,t as Ue}from"./ExternalIdentityWeb.logic-D64j70NH.js";import{a as We}from"./settingsLayout-D8glO7f1.js";import{n as Ge,r as Ke,t as qe}from"./phoneAnchoredActions-CtpkI3yG.js";import{t as Je}from"./HostedRelayTrustNotice-BldMySVi.js";import{n as X,t as Ye}from"./data-list-CYKBxN62.js";var Xe=y(`life-buoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),Ze=y(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Z=e(t(),1),Q=r(),Qe=/^[A-Za-z0-9_-]{43}$/u,$e=/^signup_[A-Za-z0-9_-]{22,43}$/u;function et(e){if(e.pathname===`/public-signup/verify`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash),n=t.get(`attempt`),r=t.get(`attempt_secret`),i=t.get(`token`);return n!==null&&$e.test(n)&&r!==null&&Qe.test(r)&&i!==null&&Qe.test(i)?{kind:`signup-verification`,attemptId:n,attemptSecret:r,token:i}:{kind:`invalid-signup-verification`}}if(e.pathname===`/password-reset`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&Qe.test(t)?{kind:`password-reset`,token:t}:{kind:`invalid-password-reset`}}if(e.pathname===`/email-verification`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&Qe.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function tt(e){let t=new URL(e.href),n=et(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function nt(){let e=(0,Q.c)(3),t=s(ot),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(t!==`authenticated`)return;let e=it,n=()=>{document.visibilityState===`hidden`?(d(!0),_.suspendBrowser(`hidden`)):e()},r=rt,i=()=>e(),a=()=>e();return document.addEventListener(`visibilitychange`,n),window.addEventListener(`offline`,r),window.addEventListener(`online`,i),window.addEventListener(`pageshow`,a),navigator.onLine||r(),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`offline`,r),window.removeEventListener(`online`,i),window.removeEventListener(`pageshow`,a)}},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function rt(){d(!0),_.suspendBrowser(`offline`)}function it(){document.visibilityState===`visible`&&navigator.onLine&&_.resumeBrowser().then(at)}function at(){return d(!1)}function ot(e){return e.accountStatus}var $=u(),st=100;function ct(e){let t=(0,Q.c)(52),{node:n,open:r,onOpenChange:i,onRename:a}=e,[o,s]=(0,Z.useState)(n.label),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f,p;t[0]!==n.label||t[1]!==r?(f=()=>{r&&(s(n.label),l(!1),d(null))},p=[n.label,r],t[0]=n.label,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Z.useEffect)(f,p);let m;t[4]===o?m=t[5]:(m=o.trim(),t[4]=o,t[5]=m);let h=m,g=h.length===0?`Enter a node name.`:h.length>st?`Use 100 characters or fewer.`:null,_=g===null&&h!==n.label&&!c,v;t[6]!==_||t[7]!==h||t[8]!==i||t[9]!==a?(v=async()=>{if(_){l(!0),d(null);try{await a(h),i(!1)}catch(e){let t=e;d(t instanceof Error?t.message:`Unable to rename this node.`),l(!1)}}},t[6]=_,t[7]=h,t[8]=i,t[9]=a,t[10]=v):v=t[10];let y=v,b=!c,x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(be,{children:[(0,$.jsx)(xe,{children:`Rename node`}),(0,$.jsx)(we,{children:`This is the canonical name shown to everyone authorized to use this node.`})]}),t[11]=x):x=t[11];let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`label`,{htmlFor:`hosted-node-name`,className:`text-sm font-medium`,children:`Node name`}),t[12]=S):S=t[12];let C=g!==null||u!==null,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{s(e.currentTarget.value),d(null)},t[13]=w):w=t[13];let T;t[14]!==_||t[15]!==y?(T=e=>{e.key===`Enter`&&_&&y()},t[14]=_,t[15]=y,t[16]=T):T=t[16];let E;t[17]!==o||t[18]!==c||t[19]!==T||t[20]!==C?(E=(0,$.jsx)(G,{id:`hosted-node-name`,value:o,autoFocus:!0,disabled:c,"aria-invalid":C,onChange:w,onKeyDown:T}),t[17]=o,t[18]=c,t[19]=T,t[20]=C,t[21]=E):E=t[21];let D;t[22]===g?D=t[23]:(D=g?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:g}):null,t[22]=g,t[23]=D);let O;t[24]===u?O=t[25]:(O=u?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u}):null,t[24]=u,t[25]=O);let k;t[26]!==E||t[27]!==D||t[28]!==O?(k=(0,$.jsxs)(Ce,{className:`space-y-2`,children:[S,E,D,O]}),t[26]=E,t[27]=D,t[28]=O,t[29]=k):k=t[29];let A;t[30]===i?A=t[31]:(A=()=>i(!1),t[30]=i,t[31]=A);let j;t[32]!==c||t[33]!==A?(j=(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:A,children:`Cancel`}),t[32]=c,t[33]=A,t[34]=j):j=t[34];let M=!_,N;t[35]===y?N=t[36]:(N=()=>void y(),t[35]=y,t[36]=N);let P=c?`Saving…`:`Save`,F;t[37]!==M||t[38]!==N||t[39]!==P?(F=(0,$.jsx)(K,{disabled:M,onClick:N,children:P}),t[37]=M,t[38]=N,t[39]=P,t[40]=F):F=t[40];let I;t[41]!==j||t[42]!==F?(I=(0,$.jsxs)(Se,{children:[j,F]}),t[41]=j,t[42]=F,t[43]=I):I=t[43];let L;t[44]!==k||t[45]!==I||t[46]!==b?(L=(0,$.jsxs)(Te,{className:`max-w-md`,showCloseButton:b,children:[x,k,I]}),t[44]=k,t[45]=I,t[46]=b,t[47]=L):L=t[47];let R;return t[48]!==i||t[49]!==r||t[50]!==L?(R=(0,$.jsx)(Ee,{open:r,onOpenChange:i,children:L}),t[48]=i,t[49]=r,t[50]=L,t[51]=R):R=t[51],R}var lt=`owner_revoked`,ut=Object.freeze([Object.freeze({id:`access`,text:`Every Hub grant on this node stops working immediately, for everyone authorized through this Hub — not only for you — and any relay channel it has open right now closes.`}),Object.freeze({id:`direct`,text:`Clients paired directly with that machine are separate and keep working. Those are managed on the machine itself, with the ryco auth command.`}),Object.freeze({id:`directory`,text:`It leaves the directory for every account on this Hub, not only yours, and stays gone. There is no undo here and no state it can return to.`}),Object.freeze({id:`return`,text:`Putting that machine back starts on the machine itself: use “Leave this Hub” there, then enroll it again with a new device code and your approval. It is a new enrollment, not a reconnection.`}),Object.freeze({id:`reach`,text:`All of that is recorded here, on the Hub. A node that is offline, unreachable, or long gone is revoked in exactly the same way — which is the point of doing it from here.`})]),dt=`Check the identifier below against the machine you meant. Two nodes can carry the same name, and this is the only value that tells them apart.`;function ft(e){return{title:`Revoke ${e.label}?`,consequences:ut,subjectPrompt:dt,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var pt=`Revoke`;function mt(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function ht(e){return e===null||e.outcome===`unchanged`}var gt=e=>Object.freeze(e),_t=Object.freeze([gt({id:`invalidResponse`,probe:Object.freeze({code:`invalid_response`,status:502}),selects:(e,t)=>t===`invalid_response`,failure:Object.freeze({message:`The Hub accepted the request and its answer could not be read, so whether this node was revoked is not known here. Refresh the list and check before trying again.`,outcome:`unknown`})}),gt({id:`transport`,probe:Object.freeze({code:`unavailable`,status:0}),selects:(e,t)=>e===0||t===`timeout`||t===`unavailable`,failure:Object.freeze({message:`The request left this browser and no answer came back, so whether this node was revoked is not known here. Check your connection, then refresh the list and look before trying again.`,outcome:`unknown`})}),gt({id:`csrf`,probe:Object.freeze({code:`csrf_rejected`,status:403}),selects:(e,t)=>t===`csrf_rejected`,failure:Object.freeze({message:`This request could not be verified, so nothing was changed. Refresh the page and try again.`,outcome:`unchanged`})}),gt({id:`unauthorized`,probe:Object.freeze({code:`session_invalid`,status:401}),selects:(e,t)=>e===401||t===`session_invalid`,failure:Object.freeze({message:`Your Hub session is no longer valid, so nothing was changed. Sign in and try again.`,outcome:`unchanged`})}),gt({id:`forbidden`,probe:Object.freeze({code:`forbidden`,status:403}),selects:e=>e===403,failure:Object.freeze({message:`Only an owner of this Hub can revoke a node. Nothing was changed.`,outcome:`unchanged`})}),gt({id:`notFound`,probe:Object.freeze({code:`not_found`,status:404}),selects:e=>e===404,failure:Object.freeze({message:`The Hub has no active node under this identifier: it was already revoked, or it is not this Hub's. Either way there is nothing here left to revoke.`,outcome:`already-gone`})}),gt({id:`conflict`,probe:Object.freeze({code:`conflict`,status:409}),selects:e=>e===409,failure:Object.freeze({message:`The Hub reported a conflicting change on this node, so nothing was changed. Refresh and look at it again before retrying.`,outcome:`unchanged`})}),gt({id:`rateLimited`,probe:Object.freeze({code:`node_rate_limited`,status:429}),selects:e=>e===429,failure:Object.freeze({message:`The Hub is refusing further owner changes for now, so nothing was changed. Wait a little and try again.`,outcome:`unchanged`})}),gt({id:`badRequest`,probe:Object.freeze({code:`invalid_request`,status:400}),selects:(e,t)=>e===400||t===`invalid_request`,failure:Object.freeze({message:`The Hub refused this request, so nothing was changed.`,outcome:`unchanged`})})]),vt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function yt(e){let t=bt(e),n=xt(e);for(let e of _t)if(e.selects(t,n))return e.failure;return vt}function bt(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function xt(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var St=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Ct(e){return e===null||!Number.isFinite(e)?null:St.format(new Date(e))}function wt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Tt(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Et(e){return Tt(e)}function Dt(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return Ct(e)??`unknown`;let r=Math.floor(n/6e4);if(r<2)return`just now`;if(r<60)return`${String(r)} min ago`;let i=Math.floor(r/60);return i<24?`${String(i)} h ago`:Ct(e)??`unknown`}function Ot(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${Dt(e.lastAuthenticatedAt,t)}`:`Last seen ${Dt(e.presence.lastHeartbeatAt,t)}`}function kt(e){let t=`${wt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${Et(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function At(e){return e.toSorted((e,t)=>{let n=e.revokedAt===null?0:1,r=t.revokedAt===null?0:1;return n===r?e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`}):n-r})}function jt(e){return e.filter(e=>e.revokedAt===null).length}function Mt(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function Nt(e){let t=jt(e),n=Mt(e),r=e.length-t,i=`${String(t)} authorized · ${n===0?`none online`:`${String(n)} online`}`;return r===0?i:`${i} · ${String(r)} revoked`}function Pt(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function Ft(e){return e.node.capabilities?.nativeClientRequired===!0?`Open this node in Desktop/Mobile.`:e.node.revokedAt===null?e.directoryStatus!==`ready`||e.browserStatus!==`current`?`Node switching is unavailable until the directory and this browser are current.`:null:`Access to this node was revoked.`}function It({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=ft(e),l=ht(o);(0,Z.useEffect)(()=>{!t||i||(a(!1),s(null))},[e.id,t]);let u=async()=>{if(!i){a(!0),s(null);try{await r(),n(!1)}catch(e){s(yt(e)),a(!1)}}};return(0,$.jsx)(Ee,{open:t,onOpenChange:e=>{!e&&i||n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(Te,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(be,{children:[(0,$.jsx)(xe,{children:c.title}),(0,$.jsx)(we,{children:c.subjectPrompt})]}),(0,$.jsxs)(Ce,{className:`space-y-4`,children:[(0,$.jsxs)(Ye,{children:[(0,$.jsx)(X,{term:`Node`,children:e.label}),(0,$.jsx)(X,{term:`Node ID`,mono:!0,children:c.subjectId}),(0,$.jsx)(X,{term:`Platform`,children:`${wt(e.platformOs)} · ${e.platformArch}`})]}),(0,$.jsx)(`ul`,{className:`space-y-2 text-xs leading-relaxed text-muted-foreground`,children:c.consequences.map(e=>(0,$.jsx)(`li`,{children:e.text},e.id))}),o?(0,$.jsxs)(`p`,{role:`alert`,className:`flex items-start gap-2 text-xs leading-relaxed text-destructive`,children:[(0,$.jsx)(oe,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),o.message]}):null]}),(0,$.jsxs)(Se,{children:[(0,$.jsx)(K,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(K,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Lt(e){let t=(0,Q.c)(57),{node:n}=e,r=We(6e4),{copyToClipboard:i,isCopied:a}=q(),o;t[0]===n.createdAt?o=t[1]:(o=Ct(n.createdAt),t[0]=n.createdAt,t[1]=o);let s=o,c;t[2]===n.lastAuthenticatedAt?c=t[3]:(c=Ct(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=c);let l=c,u;t[4]===n.revokedAt?u=t[5]:(u=Ct(n.revokedAt),t[4]=n.revokedAt,t[5]=u);let d=u,f=n.grant.role!==n.effectiveRole,p;t[6]===n?p=t[7]:(p=(0,$.jsx)(X,{term:`Status`,children:(0,$.jsx)(L,{node:n})}),t[6]=n,t[7]=p);let m;t[8]!==n.presence.lastHeartbeatAt||t[9]!==r?(m=n.presence.lastHeartbeatAt===null?`Not reported`:(0,$.jsx)(`span`,{title:Ct(n.presence.lastHeartbeatAt)??void 0,children:Dt(n.presence.lastHeartbeatAt,r)}),t[8]=n.presence.lastHeartbeatAt,t[9]=r,t[10]=m):m=t[10];let h;t[11]===m?h=t[12]:(h=(0,$.jsx)(X,{term:`Last heartbeat`,children:m}),t[11]=m,t[12]=h);let g=l??`Never`,_;t[13]===g?_=t[14]:(_=(0,$.jsx)(X,{term:`Last connected`,children:g}),t[13]=g,t[14]=_);let v;t[15]===n.platformOs?v=t[16]:(v=wt(n.platformOs),t[15]=n.platformOs,t[16]=v);let y=`${v} · ${n.platformArch}`,b;t[17]===y?b=t[18]:(b=(0,$.jsx)(X,{term:`Platform`,children:y}),t[17]=y,t[18]=b);let S;t[19]===n.clientVersion?S=t[20]:(S=(0,$.jsx)(X,{term:`Client version`,mono:!0,children:n.clientVersion}),t[19]=n.clientVersion,t[20]=S);let C;t[21]===n.effectiveRole?C=t[22]:(C=Et(n.effectiveRole),t[21]=n.effectiveRole,t[22]=C);let w;t[23]===C?w=t[24]:(w=(0,$.jsx)(X,{term:`Your role`,children:C}),t[23]=C,t[24]=w);let T;t[25]!==f||t[26]!==n.grant.role?(T=f?(0,$.jsxs)(X,{term:`Granted role`,children:[Et(n.grant.role),(0,$.jsx)(`span`,{className:`mt-1 block text-muted-foreground`,children:`The role on your grant differs from the role in effect.`})]}):null,t[25]=f,t[26]=n.grant.role,t[27]=T):T=t[27];let E=s??`Not reported`,D;t[28]===E?D=t[29]:(D=(0,$.jsx)(X,{term:`Enrolled`,children:E}),t[28]=E,t[29]=D);let k;t[30]!==n.revocationReasonCode||t[31]!==n.revokedAt||t[32]!==d?(k=n.revokedAt===null?null:(0,$.jsx)(X,{term:`Revoked`,children:`${d??`Not reported`}${n.revocationReasonCode?` — ${n.revocationReasonCode}`:``}`}),t[30]=n.revocationReasonCode,t[31]=n.revokedAt,t[32]=d,t[33]=k):k=t[33];let A=a?`Copied`:`Copy node ID`,j;t[34]!==i||t[35]!==n.id?(j=()=>i(n.id,void 0),t[34]=i,t[35]=n.id,t[36]=j):j=t[36];let M;t[37]===a?M=t[38]:(M=a?(0,$.jsx)(x,{"aria-hidden":!0}):(0,$.jsx)(O,{"aria-hidden":!0}),t[37]=a,t[38]=M);let N;t[39]!==A||t[40]!==j||t[41]!==M?(N=(0,$.jsx)(K,{size:`icon-xs`,variant:`ghost`,"aria-label":A,onClick:j,children:M}),t[39]=A,t[40]=j,t[41]=M,t[42]=N):N=t[42];let P;t[43]!==n.id||t[44]!==N?(P=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:N,children:n.id}),t[43]=n.id,t[44]=N,t[45]=P):P=t[45];let F;return t[46]!==b||t[47]!==S||t[48]!==w||t[49]!==T||t[50]!==D||t[51]!==k||t[52]!==P||t[53]!==p||t[54]!==h||t[55]!==_?(F=(0,$.jsxs)(Ye,{children:[p,h,_,b,S,w,T,D,k,P]}),t[46]=b,t[47]=S,t[48]=w,t[49]=T,t[50]=D,t[51]=k,t[52]=P,t[53]=p,t[54]=h,t[55]=_,t[56]=F):F=t[56],F}function Rt(e){let t=(0,Q.c)(93),{node:n,directoryStatus:r,browserStatus:i,canRename:a,canRevoke:o,onOpenChange:s,onConnect:c,onRename:l,onRevoke:u}=e,d=ge()===`phone`,[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),g=n!==null;if(!n)return null;let _;t[0]!==i||t[1]!==r||t[2]!==n?(_=Pt({directoryStatus:r,browserStatus:i,node:n}),t[0]=i,t[1]=r,t[2]=n,t[3]=_):_=t[3];let v=_,y;t[4]!==i||t[5]!==r||t[6]!==n?(y=Ft({directoryStatus:r,browserStatus:i,node:n}),t[4]=i,t[5]=r,t[6]=n,t[7]=y):y=t[7];let b=y,x;t[8]!==n||t[9]!==c||t[10]!==s?(x=()=>{s(!1),c(n)},t[8]=n,t[9]=c,t[10]=s,t[11]=x):x=t[11];let S=x,C=v&&b?b:null;if(d){let e=`Node details: ${n.label}`,r;t[12]===n.label?r=t[13]:(r=(0,$.jsx)(je,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=kt(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(Ae,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(ke,{children:[r,a]}),t[18]=r,t[19]=a,t[20]=o):o=t[20];let c;t[21]===n?c=t[22]:(c=(0,$.jsx)(Lt,{node:n}),t[21]=n,t[22]=c);let l;t[23]===C?l=t[24]:(l=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[23]=C,t[24]=l);let u;t[25]!==l||t[26]!==c?(u=(0,$.jsxs)(Oe,{children:[c,l]}),t[25]=l,t[26]=c,t[27]=u):u=t[27];let d;t[28]!==v||t[29]!==S?(d=(0,$.jsx)(Me,{children:(0,$.jsx)(K,{className:`min-h-11`,disabled:v,onClick:S,children:`Connect`})}),t[28]=v,t[29]=S,t[30]=d):d=t[30];let f;return t[31]!==s||t[32]!==g||t[33]!==u||t[34]!==d||t[35]!==e||t[36]!==o?(f=(0,$.jsxs)(Ne,{open:g,onOpenChange:s,label:e,children:[o,u,d]}),t[31]=s,t[32]=g,t[33]=u,t[34]=d,t[35]=e,t[36]=o,t[37]=f):f=t[37],f}let w=o&&n.revokedAt===null,T;t[38]!==s||t[39]!==f||t[40]!==m?(T=e=>{!e&&(m!==null||f!==null)||(e||(p(null),h(null)),s(e))},t[38]=s,t[39]=f,t[40]=m,t[41]=T):T=t[41];let E;t[42]===n.label?E=t[43]:(E=(0,$.jsx)(pe,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=E);let D;t[44]===n?D=t[45]:(D=kt(n),t[44]=n,t[45]=D);let O;t[46]===D?O=t[47]:(O=(0,$.jsx)(ue,{children:D}),t[46]=D,t[47]=O);let k;t[48]!==E||t[49]!==O?(k=(0,$.jsxs)(J,{children:[E,O]}),t[48]=E,t[49]=O,t[50]=k):k=t[50];let A;t[51]===n?A=t[52]:(A=(0,$.jsx)(Lt,{node:n}),t[51]=n,t[52]=A);let j;t[53]===C?j=t[54]:(j=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[53]=C,t[54]=j);let M;t[55]!==j||t[56]!==A?(M=(0,$.jsxs)(le,{children:[A,j]}),t[55]=j,t[56]=A,t[57]=M):M=t[57];let N;t[58]!==n.id||t[59]!==w?(N=w?(0,$.jsx)(K,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>h(n.id),children:pt}):null,t[58]=n.id,t[59]=w,t[60]=N):N=t[60];let P;t[61]!==a||t[62]!==n.id?(P=a?(0,$.jsx)(K,{variant:`outline`,onClick:()=>p(n.id),children:`Rename`}):null,t[61]=a,t[62]=n.id,t[63]=P):P=t[63];let F;t[64]!==v||t[65]!==S?(F=(0,$.jsx)(K,{disabled:v,onClick:S,children:`Connect`}),t[64]=v,t[65]=S,t[66]=F):F=t[66];let I;t[67]!==N||t[68]!==P||t[69]!==F?(I=(0,$.jsxs)(fe,{children:[N,P,F]}),t[67]=N,t[68]=P,t[69]=F,t[70]=I):I=t[70];let L;t[71]!==M||t[72]!==I||t[73]!==k?(L=(0,$.jsxs)(de,{side:`right`,className:`w-full sm:max-w-md`,children:[k,M,I]}),t[71]=M,t[72]=I,t[73]=k,t[74]=L):L=t[74];let R;t[75]!==g||t[76]!==L||t[77]!==T?(R=(0,$.jsx)(me,{open:g,onOpenChange:T,children:L}),t[75]=g,t[76]=L,t[77]=T,t[78]=R):R=t[78];let z;t[79]!==a||t[80]!==n||t[81]!==l||t[82]!==f?(z=a?(0,$.jsx)(ct,{node:n,open:f===n.id,onOpenChange:e=>p(e?n.id:null),onRename:e=>l(n,e)}):null,t[79]=a,t[80]=n,t[81]=l,t[82]=f,t[83]=z):z=t[83];let B;t[84]!==n||t[85]!==u||t[86]!==w||t[87]!==m?(B=w?(0,$.jsx)(It,{node:n,open:m===n.id,onOpenChange:e=>h(e?n.id:null),onRevoke:()=>u(n)}):null,t[84]=n,t[85]=u,t[86]=w,t[87]=m,t[88]=B):B=t[88];let ee;return t[89]!==R||t[90]!==z||t[91]!==B?(ee=(0,$.jsxs)($.Fragment,{children:[R,z,B]}),t[89]=R,t[90]=z,t[91]=B,t[92]=ee):ee=t[92],ee}function zt(e){let t=(0,Q.c)(18),{children:n,title:r,description:i,actions:a,titleRef:o}=e,s;t[0]!==r||t[1]!==o?(s=(0,$.jsx)(`h1`,{ref:o,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[0]=r,t[1]=o,t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=i===void 0?null:(0,$.jsx)(`div`,{className:`mt-1.5 text-muted-foreground text-sm`,children:i}),t[3]=i,t[4]=c);let l;t[5]!==s||t[6]!==c?(l=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=a===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:a}),t[8]=a,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-3`,children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n?f=t[14]:(f=(0,$.jsx)(`div`,{className:`mt-8`,children:n}),t[13]=n,t[14]=f);let p;return t[15]!==d||t[16]!==f?(p=(0,$.jsxs)($.Fragment,{children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function Bt(e){let t=(0,Q.c)(12),{children:n,className:r,title:i,description:a,actions:o}=e,s;t[0]===r?s=t[1]:(s=U(`app-surface relative rounded-2xl border not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,r),t[0]=r,t[1]=s);let c;t[2]!==o||t[3]!==a||t[4]!==i?(c=i===void 0&&o===void 0?null:(0,$.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2 border-border/60 border-b px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i===void 0?null:(0,$.jsx)(`h2`,{className:`font-medium text-base`,children:i}),a===void 0?null:(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-sm leading-relaxed`,children:a})]}),o===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),t[2]=o,t[3]=a,t[4]=i,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=n===void 0?null:(0,$.jsx)(`div`,{className:`px-5 py-4`,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`section`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Vt(e){let t=(0,Q.c)(8),{className:n,size:r}=e,i=r===void 0?`default`:r,a=i===`lg`?`gap-2.5 text-lg`:`gap-2 text-sm`,o;t[0]!==n||t[1]!==a?(o=U(`inline-flex items-center font-semibold text-foreground`,a,n),t[0]=n,t[1]=a,t[2]=o):o=t[2];let s=i===`lg`?`h-6`:`h-4.5`,c;t[3]===s?c=t[4]:(c=(0,$.jsx)(De,{className:s}),t[3]=s,t[4]=c);let l;return t[5]!==o||t[6]!==c?(l=(0,$.jsxs)(`span`,{className:o,children:[c,Ge]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}var Ht=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,Ut=`px-4 sm:px-6 phone:px-[max(1rem,env(safe-area-inset-left),env(safe-area-inset-right))] phone:pt-[max(2.5rem,calc(env(safe-area-inset-top)+1rem))] phone:pb-[max(2.5rem,calc(env(safe-area-inset-bottom)+1rem))]`,Wt=`flex min-h-full flex-col`,Gt={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function Kt(e){let t=(0,Q.c)(13),{nav:n,trailing:r}=e,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=U(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),a=U(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,Gt.page),o=(0,$.jsx)(Vt,{}),t[0]=i,t[1]=a,t[2]=o):(i=t[0],a=t[1],o=t[2]);let s;t[3]===n?s=t[4]:(s=n===void 0?null:(0,$.jsx)(`nav`,{"aria-label":`Hub`,className:`min-w-0 flex-1`,children:n}),t[3]=n,t[4]=s);let c;t[5]===n?c=t[6]:(c=n===void 0?(0,$.jsx)(`div`,{className:`flex-1`}):null,t[5]=n,t[6]=c);let l;t[7]===r?l=t[8]:(l=r===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:r}),t[7]=r,t[8]=l);let u;return t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,$.jsx)(`header`,{className:i,children:(0,$.jsxs)(`div`,{className:a,children:[o,s,c,l]})}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function qt(e){let t=(0,Q.c)(16),{children:n,nav:r,trailing:i,scrollRef:a,measure:o}=e,s=o===void 0?`page`:o,c=ge()===`phone`,l;t[0]!==c||t[1]!==r||t[2]!==i?(l=c?null:(0,$.jsx)(Kt,{nav:r,trailing:i}),t[0]=c,t[1]=r,t[2]=i,t[3]=l):l=t[3];let u=c?`min-h-full py-10`:`pt-8 pb-16`,d=Gt[s],f;t[4]!==u||t[5]!==d?(f=U(`mx-auto flex w-full flex-col`,u,Ut,d),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==f?(p=(0,$.jsx)(`section`,{className:f,children:n}),t[7]=n,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==a||t[11]!==p?(m=(0,$.jsx)(`main`,{ref:a,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:p}),t[10]=a,t[11]=p,t[12]=m):m=t[12];let h;return t[13]!==l||t[14]!==m?(h=(0,$.jsx)(T,{children:(0,$.jsx)(D,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[l,m]})})}),t[13]=l,t[14]=m,t[15]=h):h=t[15],h}var Jt=(0,Z.lazy)(()=>n(()=>import(`./AccountSettings-Be5_48k0.js`).then(e=>({default:e.AccountSettingsPanel})),[])),Yt=(0,Z.lazy)(()=>n(()=>import(`./AppearanceSettings-CYbSApl4.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),Xt=[{id:`overview`,label:`Overview`,icon:se},{id:`security`,label:`Security`,icon:H},{id:`appearance`,label:`Appearance`,icon:V}];function Zt(e){let t=(0,Q.c)(15),{section:n}=e,r=s($t),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(K,{variant:`ghost`,onClick:Qt,children:[(0,$.jsx)(b,{"aria-hidden":!0}),` Nodes`]}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=r===null?void 0:`${r.displayName} · ${r.role.charAt(0).toUpperCase()}${r.role.slice(1)}`,t[1]=r,t[2]=a);let o;t[3]===n?o=t[4]:(o=Xt.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(K,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>I({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[3]=n,t[4]=o);let c;t[5]===o?c=t[6]:(c=(0,$.jsx)(`nav`,{"aria-label":`Account`,className:`shrink-0 sm:w-48`,children:(0,$.jsx)(`ul`,{className:`flex gap-1 overflow-x-auto sm:flex-col sm:overflow-visible`,children:o})}),t[5]=o,t[6]=c);let l;t[7]===n?l=t[8]:(l=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsx)(en,{}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(Jt,{}):(0,$.jsx)(Yt,{surface:`hub`})})}),t[7]=n,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==a||t[13]!==u?(d=(0,$.jsx)(qt,{measure:`page`,trailing:i,children:(0,$.jsx)(zt,{title:`Account`,description:a,children:u})}),t[12]=a,t[13]=u,t[14]=d):d=t[14],d}function Qt(){return I({kind:`nodes`})}function $t(e){return e.account}function en(){let e=(0,Q.c)(11),t=s(tn),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Display name`}),e[0]=n):n=e[0];let r=t?.displayName??`—`,i;e[1]===r?i=e[2]:(i=(0,$.jsxs)(`div`,{children:[n,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:r})]}),e[1]=r,e[2]=i);let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Role`}),e[3]=a):a=e[3];let o;e[4]===t?o=e[5]:(o=t===null?`—`:`${t.role.charAt(0).toUpperCase()}${t.role.slice(1)}`,e[4]=t,e[5]=o);let c;e[6]===o?c=e[7]:(c=(0,$.jsxs)(`div`,{children:[a,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:o})]}),e[6]=o,e[7]=c);let l;return e[8]!==i||e[9]!==c?(l=(0,$.jsx)(Bt,{title:`Your account`,description:`Identity this Hub knows you by.`,children:(0,$.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-4 sm:grid-cols-2`,children:[i,c]})}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}function tn(e){return e.account}function nn(e){let t=(0,Q.c)(7),{links:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?[]:n,t[0]=n,t[1]=r);let i=r,a=typeof window>`u`?null:window.location.host,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=a===null?null:(0,$.jsxs)(`p`,{children:[`Signing in to `,(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:a})]}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=i.length===0?null:(0,$.jsx)(`ul`,{className:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1`,children:i.map(rn)}),t[3]=i,t[4]=s);let c;return t[5]===s?c=t[6]:(c=(0,$.jsxs)(`footer`,{className:`mt-10 flex flex-col items-center gap-2 text-center text-muted-foreground text-xs`,children:[o,s]}),t[5]=s,t[6]=c),c}function rn(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(`a`,{className:`rounded-sm underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,href:e.href,rel:`noreferrer`,target:`_blank`,children:e.label})},e.href)}function an(e){let t=(0,Q.c)(25),{children:n,title:r,description:i,actions:a,trailing:o,scrollRef:s,titleRef:c,measure:l}=e,u=l===void 0?`form`:l,d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=U(Ht,`hub-ambient`),f=U(Wt,Ut,`py-10`),t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p=Gt[u],m;t[2]===p?m=t[3]:(m=U(`my-auto w-full self-center phone:my-0 phone:flex phone:max-w-none phone:flex-1 phone:flex-col`,p),t[2]=p,t[3]=m);let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(Vt,{size:`lg`})}),t[4]=h):h=t[4];let g;t[5]!==r||t[6]!==c?(g=(0,$.jsx)(`h1`,{ref:c,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[5]=r,t[6]=c,t[7]=g):g=t[7];let _;t[8]===i?_=t[9]:(_=i===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:i}),t[8]=i,t[9]=_);let v;t[10]===n?v=t[11]:(v=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:n}),t[10]=n,t[11]=v);let y;t[12]!==a||t[13]!==g||t[14]!==_||t[15]!==v||t[16]!==o?(y=(0,$.jsxs)(`section`,{className:`hub-gateway-panel app-surface relative rounded-2xl border p-6 not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] sm:p-8 phone:flex phone:flex-1 phone:flex-col phone:rounded-none phone:border-0 phone:p-0 phone:shadow-none phone:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:[g,_,v,a,o]}),t[12]=a,t[13]=g,t[14]=_,t[15]=v,t[16]=o,t[17]=y):y=t[17];let b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(nn,{}),t[18]=b):b=t[18];let x;t[19]!==y||t[20]!==m?(x=(0,$.jsx)(`div`,{className:f,children:(0,$.jsxs)(`div`,{className:m,children:[h,y,b]})}),t[19]=y,t[20]=m,t[21]=x):x=t[21];let S;return t[22]!==s||t[23]!==x?(S=(0,$.jsx)(`main`,{ref:s,className:d,children:x}),t[22]=s,t[23]=x,t[24]=S):S=t[24],S}function on({onClose:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(`input`),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=(0,Z.useRef)(``),p=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{p.current?.abort(),p.current=null,f.current=``},[]);let m=()=>{p.current?.abort();let e=new AbortController;return p.current=e,l(!0),d(null),e},h=e=>{p.current===e&&(p.current=null,l(!1))},v=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof g&&e.status===401){f.current=``,n(``),a(null),await _.expireSession();return}d(t??(e instanceof g?e.message:`Hub is temporarily unavailable.`))}},y=async e=>{e.preventDefault();let r=t.trim();n(``),f.current=``;let o=m();try{let e=await i.lookupNodeEnrollment(r,o.signal);if(o.signal.aborted)return;f.current=r,a(e),s(`review`)}catch(e){await v(e)}finally{h(o)}},b=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await i.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`approved`),await _.refreshDirectory()}catch(e){f.current=``,a(null),s(`input`),await v(e,`The approval result is unknown. Enter the device code again to verify its current state.`)}finally{h(t)}},x=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await i.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`denied`)}catch(e){await v(e)}finally{h(t)}},S=()=>{p.current?.abort(),f.current=``,n(``),a(null),e()};return o===`approved`||o===`denied`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(E,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:o===`approved`?`Node approved`:`Enrollment denied`}),(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-sm text-muted-foreground`,children:o===`approved`?`The node can now finish enrollment and connect. Online presence may take a few seconds.`:`This ceremony cannot be reused. Start a new enrollment on the node if needed.`}),(0,$.jsx)(K,{className:`mt-5`,onClick:S,children:`Back to nodes`})]}):r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Review node enrollment`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Compare every field, especially the fingerprint, with the node or a trusted operator channel before approving.`}),(0,$.jsxs)(Ye,{className:`mt-5 rounded-xl border border-border bg-background p-4`,children:[(0,$.jsx)(X,{term:`Label`,children:(0,$.jsx)(`span`,{className:`font-medium break-words`,children:r.label})}),(0,$.jsx)(X,{term:`Platform`,children:`${r.platformOs} · ${r.platformArch}`}),(0,$.jsx)(X,{term:`Version`,mono:!0,children:r.clientVersion}),(0,$.jsx)(X,{term:`Algorithm`,children:r.algorithm}),(0,$.jsx)(X,{term:`Fingerprint`,mono:!0,children:r.fingerprint}),(0,$.jsx)(X,{term:`Expires`,children:new Date(r.expiresAt).toLocaleString()})]}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,o===`confirm-denial`?(0,$.jsxs)(`div`,{className:`mt-4 rounded-lg border border-destructive/30 bg-destructive/5 p-3`,children:[(0,$.jsxs)(`p`,{className:`flex gap-2 text-sm`,children:[(0,$.jsx)(oe,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),` Denial is permanent for this device code.`]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{variant:`destructive`,disabled:c,onClick:()=>void x(),children:`Confirm denial`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{disabled:c,onClick:()=>void b(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(K,{variant:`ghost`,disabled:c,onClick:S,children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Enroll a Ryco node`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Start enrollment on the node, then enter the short device code shown there. Codes expire after ten minutes.`}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,(0,$.jsxs)(`form`,{className:`mt-5 space-y-4`,autoComplete:`off`,onSubmit:e=>void y(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-node-device-code`,children:`Device code`}),(0,$.jsx)(G,{id:`hub-node-device-code`,required:!0,autoFocus:!0,maxLength:16,value:t,className:`font-mono uppercase ${W}`,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,onClick:S,children:`Cancel`})]})]})]})}function sn(e){let t=(0,Q.c)(14),{step:n,total:r,label:i}=e,a=Math.min(Math.max(n,1),r),o;t[0]===i?o=t[1]:(o=i===void 0?null:(0,$.jsxs)(`span`,{className:`sr-only`,children:[`: `,i]}),t[0]=i,t[1]=o);let s;t[2]!==a||t[3]!==o||t[4]!==r?(s=(0,$.jsxs)(`p`,{className:`font-medium text-muted-foreground text-xs`,children:[`Step `,a,` of `,r,o]}),t[2]=a,t[3]=o,t[4]=r,t[5]=s):s=t[5];let c;if(t[6]!==a||t[7]!==r){let e;t[9]===a?e=t[10]:(e=(e,t)=>(0,$.jsx)(`span`,{className:`h-1 flex-1 rounded-full transition-colors ${t<a?`bg-primary`:`bg-border`}`},t),t[9]=a,t[10]=e),c=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex flex-1 items-center gap-1.5`,children:Array.from({length:r},e)}),t[6]=a,t[7]=r,t[8]=c}else c=t[8];let l;return t[11]!==s||t[12]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}var cn=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,ln=null;function un(){return window.turnstile?Promise.resolve(window.turnstile):ln||(ln=new Promise((e,t)=>{let n=document.querySelector(`script[src="${cn}"]`),r=n??document.createElement(`script`);r.addEventListener(`load`,()=>{window.turnstile?e(window.turnstile):t(Error(`Turnstile did not initialize`))},{once:!0}),r.addEventListener(`error`,()=>t(Error(`Turnstile could not be loaded`)),{once:!0}),n||(r.src=cn,r.async=!0,r.defer=!0,document.head.append(r))}).catch(e=>{throw ln=null,e}),ln)}function dn(e){let t=(0,Q.c)(10),{siteKey:n,action:r,onToken:i}=e,a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(!1),c,l;t[0]!==r||t[1]!==i||t[2]!==n?(c=()=>{let e=!1,t=null;return i(null),s(!1),un().then(o=>{e||a.current===null||(t={api:o,id:o.render(a.current,{sitekey:n,action:r,theme:document.documentElement.classList.contains(`dark`)?`dark`:`light`,callback:t=>{e||i(t)},"expired-callback":()=>{e||i(null)},"error-callback":()=>{e||(i(null),s(!0))}})})}).catch(()=>{e||s(!0)}),()=>{e=!0,i(null),t&&t.api.remove(t.id)}},l=[r,i,n],t[0]=r,t[1]=i,t[2]=n,t[3]=c,t[4]=l):(c=t[3],l=t[4]),(0,Z.useEffect)(c,l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{ref:a,"aria-label":`Anti-bot verification`,className:`min-h-[65px]`}),t[5]=u):u=t[5];let d;t[6]===o?d=t[7]:(d=o?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Verification could not load. Check your connection and try again.`}):null,t[6]=o,t[7]=d);let f;return t[8]===d?f=t[9]:(f=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[u,d]}),t[8]=d,t[9]=f),f}function fn(e,t){return e instanceof g?e.message:t}function pn(){let e=new Uint8Array(32);return crypto.getRandomValues(e),h(e)}function mn(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(null),[r,a]=(0,Z.useState)(!0),o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=new AbortController;return i.getPublicSignupConfiguration(e.signal).then(n).catch(()=>n({status:`disabled`})).finally(()=>{e.signal.aborted||a(!1)}),()=>e.abort()},s=[],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,Z.useEffect)(o,s);let c;return e[2]!==t||e[3]!==r?(c={config:t,loading:r},e[2]=t,e[3]=r,e[4]=c):c=e[4],c}function hn(e){return e!==null&&`activationSecret`in e}function gn({config:e,initialLink:t,onConsumeLink:n,onCancel:r}){let[a,o]=(0,Z.useState)(t?.kind===`signup-verification`||t?.kind===`invalid-signup-verification`?`verifying`:`details`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),T=(0,Z.useRef)(null),E=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(E.current||t===null)return;if(E.current=!0,t.kind!==`signup-verification`){t.kind===`invalid-signup-verification`&&(w(`This verification link is incomplete or expired. Start signup again.`),o(`details`));return}let e=new AbortController;return x(!0),i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`link_token`,token:t.token}},e.signal).then(e=>{T.current=e,o(`credential`)}).catch(e=>w(fn(e,`This verification link could not be confirmed.`))).finally(()=>{n(),e.signal.aborted||x(!1)}),()=>e.abort()},[t,n]);let D=async t=>{if(t.preventDefault(),b||e===null)return;let n=e.antiBot.provider===`bypass`?`development`:v??``;if(!n){w(`Complete the anti-bot check before continuing.`);return}x(!0),w(null);try{let e=await i.startPublicSignup({username:s.trim().toLowerCase(),email:l.trim().toLowerCase(),antiBotAssertion:n});T.current=e,o(`check-email`)}catch(e){w(fn(e,`Account creation is temporarily unavailable.`))}finally{x(!1)}},O=async e=>{e.preventDefault();let t=T.current;if(!(b||t===null||!(`attemptSecret`in t))){x(!0),w(null);try{let e=await i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`email_code`,code:d.trim()}});f(``),T.current=e,o(`credential`)}catch(e){w(fn(e,`That email code could not be verified.`))}finally{x(!1)}}},A=async e=>{let t=T.current;if(b||!hn(t))return;if(e===`password`&&p!==h){w(`The passwords do not match.`);return}x(!0),w(null);let n=p;m(``),g(``);try{let r=e===`passkey`?await i.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:pn()}):await i.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:pn()});T.current=null,await _.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(fn(e,`Account creation did not complete.`))}finally{x(!1)}},j=a===`details`?1:a===`check-email`||a===`verifying`?2:3;return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,$.jsx)(sn,{step:j,total:3,label:j===1?`Your details`:j===2?`Verify your email`:`Choose how you sign in`}),a===`details`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void D(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:s,className:W,onChange:e=>c(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase letters, numbers, and underscores.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-email`,children:`Email`}),(0,$.jsx)(G,{id:`hub-signup-email`,type:`email`,autoCapitalize:`none`,autoComplete:`email`,maxLength:254,required:!0,value:l,className:W,onChange:e=>u(e.currentTarget.value)})]}),e?.antiBot.provider===`turnstile`?(0,$.jsx)(dn,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:y}):null,(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Send verification email`,submitDisabled:e===null})]}):a===`check-email`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void O(e),children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(Ze,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Enter the six-digit code, or open the verification link on this device.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-code`,children:`Verification code`}),(0,$.jsx)(G,{id:`hub-signup-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,pattern:`[0-9]{6}`,required:!0,value:d,className:W,onChange:e=>f(e.currentTarget.value)})]}),(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Verify email`})]}):a===`password`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),A(`password`)},children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-signup-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:p,className:W,onChange:e=>m(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-signup-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:h,className:W,onChange:e=>g(e.currentTarget.value)})]}),(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`At least `,12,` characters. Password sign-in always asks for an email or authenticator code too.`]}),(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:()=>o(`credential`),pending:b,submitLabel:`Create account`})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:a===`verifying`?`Verifying your email…`:`Choose how you sign in`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`A passkey is the strongest and easiest option. A password always requires a second factor on future sign-ins.`})]}),(0,$.jsx)(xn,{value:C}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${qe}`,children:[(0,$.jsxs)(K,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>void A(`passkey`),children:[b?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(k,{"aria-hidden":!0}),b?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>o(`password`),children:`Use a password instead`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function _n({pendingSignup:e,config:t,onCancel:n}){let[r,a]=(0,Z.useState)(e.suggestedUsername??``),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=async e=>{if(e.preventDefault(),c||t===null)return;let n=t.antiBot.provider===`bypass`?`development`:o??``;if(!n){d(`Complete the anti-bot check before continuing.`);return}l(!0),d(null);try{let e=await i.finishExternalIdentitySignup({provider:`github`,username:r.trim().toLowerCase(),antiBotAssertion:n,idempotencyKey:pn()});await _.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(fn(e,`GitHub signup did not complete.`))}finally{l(!1)}};return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void f(e),children:[(0,$.jsx)(sn,{step:1,total:1,label:`Confirm your Ryco username`}),(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`GitHub verified`}),(0,$.jsxs)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:[e.displayName?`${e.displayName} authorized Ryco through GitHub. `:`GitHub authorized this account. `,`Choose the public username Ryco should use. Nothing is created until you confirm.`]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-external-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-external-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:r,className:W,onChange:e=>a(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`GitHub suggested this name. You can change it before creating the account.`})]}),t?.antiBot.provider===`turnstile`?(0,$.jsx)(dn,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(xn,{value:u}),(0,$.jsx)(Sn,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function vn({onCancel:e,onUseRecoveryCode:t,onResetPassword:n}){let[r,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),g=async e=>{if(e.preventDefault(),!f){p(!0),h(null);try{if(u===null){let e=await i.startPasswordLogin({identifier:r.trim().toLowerCase(),password:o});s(``),d(e)}else{let e=await i.finishPasswordLogin({attemptId:u.attemptId,attemptSecret:u.attemptSecret,factor:u.factor,code:c.trim()});l(``),await _.adoptPublicBrowserIdentity(e)}}catch(e){h(fn(e,`Password sign-in did not complete.`))}finally{p(!1)}}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void g(e),children:[u===null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-login-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:r,className:W,onChange:e=>a(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-login-password`,type:`password`,autoComplete:`current-password`,required:!0,maxLength:256,value:o,className:W,onChange:e=>s(e.currentTarget.value)})]})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-second-factor`,children:u.factor===`totp`?`Authenticator code`:`Email code`}),(0,$.jsx)(G,{id:`hub-login-second-factor`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:c,className:W,onChange:e=>l(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u.factor===`totp`?`Enter the current code from your authenticator app.`:`We sent a six-digit code to your verified email address.`})]}),(0,$.jsx)(xn,{value:m}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Sn,{onCancel:u===null?e:()=>d(null),pending:f,submitLabel:u===null?`Continue`:`Sign in`})]})}function yn({initialLink:e,onConsumeLink:t,onCancel:n}){let[r,a]=(0,Z.useState)(e?.kind===`password-reset`||e?.kind===`invalid-password-reset`?`verifying`:`request`),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),x=(0,Z.useRef)(!1),S=async(e,t)=>{let n=await i.verifyPasswordReset({token:e},t);b.current=n,l(``),a(`password`)};(0,Z.useEffect)(()=>{if(x.current||e===null)return;if(x.current=!0,e.kind!==`password-reset`){e.kind===`invalid-password-reset`&&(y(`This reset link is incomplete or expired. Request a new one.`),a(`request`));return}let n=new AbortController;return _(!0),S(e.token,n.signal).catch(e=>y(fn(e,`This reset link could not be verified.`))).finally(()=>{t(),n.signal.aborted||_(!1)}),()=>n.abort()},[e,t]);let C=async e=>{if(e.preventDefault(),!g){_(!0),y(null);try{if(r===`request`)await i.requestPasswordReset({identifier:o.trim().toLowerCase()}),a(`check-email`);else if(r===`check-email`)await S(c.trim());else if(r===`password`){let e=b.current;if(e===null)return;if(u!==f){y(`The passwords do not match.`);return}let t=u;d(``),p(``),await i.finishPasswordReset({attemptId:e.attemptId,attemptSecret:e.attemptSecret,password:t,factor:e.requiresTotp?{kind:`totp`,code:m.trim()}:{kind:`none`}}),h(``),b.current=null,a(`complete`)}}catch(e){y(fn(e,`Password reset did not complete.`))}finally{_(!1)}}},w=r===`request`?1:r===`check-email`||r===`verifying`?2:3;return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void C(e),children:[r===`complete`?null:(0,$.jsx)(sn,{step:w,total:3,label:w===1?`Find your account`:w===2?`Check your email`:`Set a new password`}),r===`request`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-reset-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:o,className:W,onChange:e=>s(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`If the account is eligible, its verified address receives a single-use reset link.`})]}):r===`check-email`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(Ze,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Open the reset link, or paste its token below.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-token`,children:`Reset token`}),(0,$.jsx)(G,{id:`hub-reset-token`,type:`password`,autoComplete:`one-time-code`,maxLength:64,required:!0,value:c,className:W,onChange:e=>l(e.currentTarget.value)})]})]}):r===`password`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password`,children:`New password`}),(0,$.jsx)(G,{id:`hub-reset-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:u,className:W,onChange:e=>d(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-reset-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:f,className:W,onChange:e=>p(e.currentTarget.value)})]}),b.current?.requiresTotp?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-totp`,children:`Authenticator code`}),(0,$.jsx)(G,{id:`hub-reset-totp`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:m,className:W,onChange:e=>h(e.currentTarget.value)})]}):null]}):r===`complete`?(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Password changed`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`Every previous session was revoked. Sign in again with the new password and its normal second factor.`})]}):(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Verifying your reset link…`}),(0,$.jsx)(xn,{value:v}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsx)(K,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Sn,{onCancel:n,pending:g,submitLabel:r===`request`?`Send reset email`:r===`check-email`?`Verify reset token`:r===`password`?`Change password`:`Verifying…`,submitDisabled:r===`verifying`})]})}function bn({onCancel:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=async e=>{if(e.preventDefault(),r)return;a(!0),s(null);let o=t;n(``);try{await i.signInWithRecoveryCode(o),await _.bootstrap()}catch(e){s(fn(e,`That recovery code could not be used.`))}finally{a(!1)}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void c(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-recovery-code`,children:`Recovery code`}),(0,$.jsx)(G,{id:`hub-login-recovery-code`,type:`password`,autoComplete:`one-time-code`,required:!0,maxLength:128,value:t,className:W,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsx)(xn,{value:o}),(0,$.jsx)(Sn,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function xn(e){let t=(0,Q.c)(2),{value:n}=e,r;return t[0]===n?r=t[1]:(r=n?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,t[0]=n,t[1]=r),r}function Sn(e){let t=(0,Q.c)(12),{onCancel:n,pending:r,submitLabel:i,submitDisabled:a}=e,o=r||a!==void 0&&a,s;t[0]===r?s=t[1]:(s=r?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):null,t[0]=r,t[1]=s);let c=r?`Working…`:i,l;t[2]!==o||t[3]!==s||t[4]!==c?(l=(0,$.jsxs)(K,{type:`submit`,size:`lg`,className:`min-h-11 w-full`,disabled:o,children:[s,c]}),t[2]=o,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]!==n||t[7]!==r?(u=(0,$.jsx)(K,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,disabled:r,onClick:n,children:`Back`}),t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${qe}`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}var Cn;function wn(){if(window.location.pathname!==`/email-verification`)return null;if(Cn!==void 0)return Cn;let e=tt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return Cn=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,Cn}function Tn(){let e=(0,Q.c)(3),t=A(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=Ke(t===null?void 0:z(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function En(){let e=(0,Q.c)(30),[t,n]=(0,Z.useState)(wn),r=s(Pn),i=s(Nn),o=s(Mn),u=s(jn),d=s(An),f=s(kn),p=c(On),m=P(),h;e[0]===m.logicalPathname?h=e[1]:(h=M(m.logicalPathname),e[0]=m.logicalPathname,e[1]=h);let g=h,_;e[2]===g?_=e[3]:(_=e=>l(e,g),e[2]=g,e[3]=_);let y=a(_),b=ne();N();let x;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],e[4]=x):x=e[4],(0,Z.useEffect)(Dn,x),nt(),Tn();let S=A(),C;e[5]!==r||e[6]!==S?.kind?(C=()=>{r===`authenticated`&&S?.kind===`sign-up`&&F(`/`,{replace:!0})},e[5]=r,e[6]=S?.kind,e[7]=C):C=e[7];let w;if(e[8]!==r||e[9]!==S?(w=[r,S],e[8]=r,e[9]=S,e[10]=w):w=e[10],(0,Z.useEffect)(C,w),t?.kind===`email-verification`||t?.kind===`invalid-email-verification`){let r;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{window.history.replaceState(window.history.state,``,`/`),n(null)},e[11]=r):r=e[11];let i;return e[12]===t?i=e[13]:(i=(0,$.jsx)(Fn,{link:t,onContinue:r}),e[12]=t,e[13]=i),i}if(r!==`authenticated`){let t;return e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Gn,{}),e[14]=t):t=e[14],t}if(o.length>0&&!p){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Jn,{}),e[15]=t):t=e[15],t}if(S?.kind===`account`){let t;return e[16]===S.section?t=e[17]:(t=(0,$.jsx)(Zt,{section:S.section}),e[16]=S.section,e[17]=t),t}if(S?.kind===`nodes`||S?.kind===`nodes-enroll`){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)($n,{}),e[18]=t):t=e[18],t}if(m.nodeId===null){if(b||m.malformed){let t;return e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)($n,{}),e[19]=t):t=e[19],t}if(i&&d){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{authGateState:{status:`hosted-hub`}}),e[20]=t):t=e[20],t}let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{authGateState:{status:`hosted-cached`}}),e[21]=t):t=e[21],t}if(!i||i.id!==m.nodeId){let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Vn,{}),e[22]=t):t=e[22],t}if(u===`terminal-failure`){let t;return e[23]!==f||e[24]!==i?(t=(0,$.jsx)(Rn,{node:i,message:f}),e[23]=f,e[24]=i,e[25]=t):t=e[25],t}if(!d){if(y){let t;return e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{authGateState:{status:`hosted-cached`}}),e[26]=t):t=e[26],t}let t;return e[27]===i?t=e[28]:(t=(0,$.jsx)(Hn,{node:i}),e[27]=i,e[28]=t),t}let T;return e[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(v,{authGateState:{status:`hosted-hub`}}),e[29]=T):T=e[29],T}function Dn(){return p()}function On(e){return e.leased}function kn(e){return e.errorMessage}function An(e){return e.sessionEstablished}function jn(e){return e.transportStatus}function Mn(e){return e.recoveryCodes}function Nn(e){return e.selectedNode}function Pn(e){return e.accountStatus}function Fn(e){let t=(0,Q.c)(15),{link:n,onContinue:r}=e,[a,o]=(0,Z.useState)(n.kind===`email-verification`?`verifying`:`invalid`),s;t[0]!==n.kind||t[1]!==n.token?(s=()=>{if(n.kind!==`email-verification`)return;let e=new AbortController;return i.confirmEmailVerification(n.token,e.signal).then(()=>o(`verified`)).catch(()=>{e.signal.aborted||o(`invalid`)}).finally(In),()=>e.abort()},t[0]=n.kind,t[1]=n.token,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=[n],t[3]=n,t[4]=c),(0,Z.useEffect)(s,c);let l=a===`verifying`?`Verifying your email`:a===`verified`?`Email verified`:`This verification link is unavailable`,u=a===`verifying`?`This will only take a moment.`:a===`verified`?`Your address is now available for account recovery.`:`The link is incomplete, expired, or has already been used. Request a new one from Account settings.`,d;t[5]!==r||t[6]!==a?(d=a===`verifying`?void 0:(0,$.jsx)(K,{size:`cta`,className:`mt-6 w-full`,onClick:r,children:`Continue`}),t[5]=r,t[6]=a,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=a===`verifying`?(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Confirming the link…`]}):null,t[8]=a,t[9]=f);let p;return t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,$.jsx)(an,{title:l,description:u,actions:d,children:f}),t[10]=l,t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function In(){Cn=void 0}function Ln(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(S,{"aria-hidden":!0,className:`mr-2 inline size-4 animate-spin align-[-0.15em] motion-reduce:animate-none`}),e[0]=t):t=e[0],t}function Rn(e){let t=(0,Q.c)(10),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(te,{}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(oe,{"aria-hidden":!0,className:`size-8 text-destructive`}),t[1]=a):a=t[1];let o=`Unable to connect to ${n.label}`,s=r??`The relay session could not be established. Choose another node or retry.`,c;t[2]===s?c=t[3]:(c=(0,$.jsx)(`p`,{role:`alert`,className:`text-muted-foreground text-sm`,children:s}),t[2]=s,t[3]=c);let l;t[4]===r?l=t[5]:(l=r===`Ryco state could not be synchronized.`?(0,$.jsxs)(K,{className:`mt-5`,onClick:zn,children:[(0,$.jsx)(ie,{"aria-hidden":!0}),` Retry`]}):null,t[4]=r,t[5]=l);let u;return t[6]!==o||t[7]!==c||t[8]!==l?(u=(0,$.jsx)(qt,{measure:`content`,trailing:i,children:(0,$.jsxs)(Bn,{tone:`destructive`,icon:a,title:o,children:[c,l]})}),t[6]=o,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function zn(){_.retrySelectedNode()}function Bn(e){let t=(0,Q.c)(9),{children:n,icon:r,title:i,tone:a}=e,o=`mt-4 font-semibold text-2xl tracking-tight ${(a===void 0?`default`:a)===`destructive`?`text-foreground`:``}`,s;t[0]!==o||t[1]!==i?(s=(0,$.jsx)(`h1`,{className:o,children:i}),t[0]=o,t[1]=i,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,$.jsx)(`div`,{className:`mt-2`,children:n}),t[3]=n,t[4]=c);let l;return t[5]!==r||t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center pt-10 text-center`,children:[r,s,c]}),t[5]=r,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Vn(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(qt,{measure:`content`,children:(0,$.jsx)(Bn,{icon:t,title:`Restoring your node`,children:(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Checking your access before reconnecting…`]})})}),e[1]=n):n=e[1],n}function Hn(e){let t=(0,Q.c)(7),{node:n}=e,{returnToAllNodes:r}=j(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-8 text-primary`}),t[0]=i):i=t[0];let a=`Connecting to ${n.label}`,o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Preparing a private relay session and synchronizing Ryco state…`]}),t[1]=o):o=t[1];let s;t[2]===r?s=t[3]:(s=(0,$.jsx)(K,{variant:`outline`,className:`mt-5 phone:min-h-11`,onClick:()=>void r(),children:`Back to nodes`}),t[2]=r,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,$.jsx)(qt,{measure:`content`,children:(0,$.jsxs)(Bn,{icon:i,title:a,children:[o,s]})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function Un(e){let t=(0,Q.c)(15),{bootstrapAvailable:n,publicSignupEnabled:r}=e,[i,a]=(0,Z.useState)(!1),o=(0,Z.useId)(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>a(Wn),t[0]=s):s=t[0];let c=`transition-transform ${i?`rotate-180`:``}`,l;t[1]===c?l=t[2]:(l=(0,$.jsx)(C,{"aria-hidden":!0,className:c}),t[1]=c,t[2]=l);let u;t[3]!==i||t[4]!==o||t[5]!==l?(u=(0,$.jsxs)(K,{variant:`ghost`,size:`sm`,"aria-expanded":i,"aria-controls":o,className:`-mx-2 h-auto min-h-8 max-w-full whitespace-normal py-1.5 text-left phone:min-h-11`,onClick:s,children:[`New to this Hub?`,l]}),t[3]=i,t[4]=o,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==r?(d=i?(0,$.jsxs)(`div`,{id:o,className:`mt-2 space-y-2 text-xs leading-relaxed text-muted-foreground`,children:[(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`Getting access.`}),` Accounts are`,r?` open to signup on this Hub. Verify your email, then choose a passkey or password.`:` created by invitation. An owner sends you an invitation code; redeem it below to create your account.`]}),(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`What a passkey is here.`}),` The passkey is created by your browser or password manager and never leaves it. It is the only credential this Hub treats as strong.`]}),n?(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`If this Hub is brand new.`}),` No owner exists yet. “Set up first owner” claims this Hub with a bootstrap credential from whoever deployed it.`]}):null]}):null,t[7]=n,t[8]=i,t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;return t[12]!==u||t[13]!==d?(f=(0,$.jsxs)(`div`,{className:`mt-4`,children:[u,d]}),t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function Wn(e){return!e}function Gn({context:e=`hub`,autoExternalProvider:t=null}={}){let n=s(e=>e.accountStatus),r=s(e=>e.errorMessage),a=s(e=>e.bootstrapAvailable),[c,l]=(0,Z.useState)(()=>tt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)})),u=(0,Z.useCallback)(()=>l(null),[]),{config:d}=mn(),f=o(e=>e.externalIdentityConfiguration),p=He(f),[m,h]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(!1),[x,C]=(0,Z.useState)(void 0),w=A(),T=w?.kind===`sign-up`||w?.kind===`sign-up-verify`?`public`:w?.kind===`invitation`?`invitation`:w?.kind===`setup`?`bootstrap`:null,E=w?.kind===`sign-in-password`?`password`:w?.kind===`sign-in-recovery-code`?`recovery-code`:w?.kind===`reset-password`?`password-reset`:null,D=e=>{I(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},O=e=>{I(e===`password`?{kind:`sign-in-password`}:e===`recovery-code`?{kind:`sign-in-recovery-code`}:e===`password-reset`?{kind:`reset-password`}:{kind:`sign-in`})},j=(0,Z.useRef)(null),M=(0,Z.useRef)(null),N=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{_.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(T!==`public`&&e!==`native-authorization`){C(void 0);return}let t=new AbortController;return C(void 0),i.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||C(e)}).catch(()=>{t.signal.aborted||C({status:`none`})}),()=>t.abort()},[e,T]);let P=(0,Z.useCallback)(async()=>{if(!m){h(!0),y(null);try{await Ue({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:ee({kind:`sign-up`}),start:e=>i.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){y(e instanceof g?e.message:`GitHub sign-in is temporarily unavailable.`),h(!1)}}},[e,m]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||p?.login!==!0||x?.status!==`none`||b.current||(b.current=!0,P())},[t,e,x?.status,p?.login,P,n]),(0,Z.useEffect)(()=>{T===`invitation`||T===`bootstrap`?M.current?.focus({preventScroll:!0}):j.current?.focus({preventScroll:!0})},[E,T]),(0,Z.useEffect)(()=>{N.current?.scrollTo({top:0,left:0})},[E,T]);let F=T===`invitation`||T===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${qe}`,children:[(0,$.jsx)(K,{type:`submit`,form:Kn,className:`phone:min-h-11`,disabled:n===`authenticating`,children:T===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>_.cancelAuthentication():()=>D(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,L=T||E?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[p?.login?(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:m||n===`authenticating`||n===`signing-out`,onClick:()=>void P(),children:[m?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(ce,{"aria-hidden":!0}),m?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void _.signIn(),children:[(0,$.jsx)(k,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>_.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[d?.status===`enabled`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`public`),children:`Create account`}):null,(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`bootstrap`),children:`Set up first owner`}):null]})]})}),R=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(K,{className:`mt-3 phone:min-h-11`,variant:`ghost`,onClick:()=>void _.bootstrap(),children:[(0,$.jsx)(ie,{"aria-hidden":!0}),` Retry Hub`]}):null,(0,$.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:n===`authenticating`?`Passkey authentication is in progress.`:``})]}),z=v??r,te=z?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`error`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`Sign-in did not complete`}),(0,$.jsx)(ve,{children:z})]})}):null,ne=x?.status===`signup`?x:null,re=x?.status===`error`?x:null,V=e===`native-authorization`&&T!==`public`;if(T===`public`||V&&(ne!==null||re!==null)){let e=()=>{V?C({status:`none`}):D(null)};return(0,$.jsxs)(an,{title:`Create your account`,description:V?`Choose your Ryco username, then return to approving this device.`:`Pick a username and confirm your email. You choose a passkey or a password at the end.`,trailing:R,scrollRef:N,titleRef:j,children:[te,x===void 0?(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}):ne?(0,$.jsx)(_n,{pendingSignup:ne,config:d?.status===`enabled`?d:null,onCancel:e}):re?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(ye,{variant:`warning`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`GitHub signup did not continue`}),(0,$.jsx)(ve,{children:Ve(re.code)})]}),(0,$.jsx)(K,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(gn,{config:d?.status===`enabled`?d:null,initialLink:c,onConsumeLink:u,onCancel:()=>{u(),D(null)}})]})}if(T===`invitation`||T===`bootstrap`)return(0,$.jsxs)(an,{title:T===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:T===`invitation`?`Enter the invitation code an owner sent you. Your browser creates a passkey at the same time.`:`No owner exists yet. The bootstrap credential from whoever deployed this Hub makes you its first owner.`,actions:F,trailing:R,scrollRef:N,titleRef:j,children:[te,(0,$.jsx)(qn,{mode:T,credentialRef:M})]});if(E!==null){let e={password:{title:`Sign in with a password`,description:`Password sign-in always asks for a second factor — an authenticator code, or a code sent to your verified email.`},"recovery-code":{title:`Use a recovery code`,description:`One of the single-use codes you saved when your account was created. Each code works once.`},"password-reset":{title:`Reset your password`,description:`We email a single-use link. Setting a new password signs out every device, including this one.`}}[E];return(0,$.jsxs)(an,{title:e.title,description:e.description,trailing:R,scrollRef:N,titleRef:j,children:[te,E===`password`?(0,$.jsx)(vn,{onCancel:()=>O(null),onUseRecoveryCode:()=>O(`recovery-code`),onResetPassword:()=>O(`password-reset`)}):E===`recovery-code`?(0,$.jsx)(bn,{onCancel:()=>O(null)}):(0,$.jsx)(yn,{initialLink:c,onConsumeLink:u,onCancel:()=>{u(),O(null)}})]})}return(0,$.jsxs)(an,{title:e===`native-authorization`?`Sign in to continue on your device`:n===`session-expired`?`Your session expired`:`Connect to your Ryco nodes`,description:e===`native-authorization`?`Authenticate in this browser first. Ryco will ask again before it authorizes the mobile app.`:`Ryco Hub reaches the developer machines an owner has authorized for your account. Your session lives in an HttpOnly cookie — nothing about it is readable by this page.`,actions:L,trailing:R,scrollRef:N,titleRef:j,children:[(0,$.jsx)(Je,{}),(0,$.jsx)(Un,{bootstrapAvailable:a,publicSignupEnabled:d?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(K,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>O(`password`),children:[(0,$.jsx)(Xe,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(B,{}),te]})}var Kn=`hub-registration-form`;function qn(e){let t=(0,Q.c)(29),{mode:n,credentialRef:r}=e,[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),u;t[0]!==i||t[1]!==o||t[2]!==n||t[3]!==c?(u=async e=>{e.preventDefault();let t=i;a(``);let r={displayName:o.trim(),passkeyLabel:c.trim()||null};n===`invitation`?await _.redeemInvitation({secret:t,...r}):await _.bootstrapOwner({credential:t,...r})},t[0]=i,t[1]=o,t[2]=n,t[3]=c,t[4]=u):u=t[4];let d=u,f;t[5]===d?f=t[6]:(f=e=>void d(e),t[5]=d,t[6]=f);let p=n===`invitation`?`Invitation code`:`Bootstrap credential`,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(Y,{htmlFor:`hub-registration-credential`,children:p}),t[7]=p,t[8]=m);let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>a(e.currentTarget.value),t[9]=h):h=t[9];let g;t[10]!==i||t[11]!==r?(g=(0,$.jsx)(G,{ref:r,id:`hub-registration-credential`,type:`password`,required:!0,maxLength:128,value:i,className:W,onChange:h}),t[10]=i,t[11]=r,t[12]=g):g=t[12];let v;t[13]!==m||t[14]!==g?(v=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[m,g]}),t[13]=m,t[14]=g,t[15]=v):v=t[15];let y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Y,{htmlFor:`hub-display-name`,children:`Display name`}),t[16]=y):y=t[16];let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>s(e.currentTarget.value),t[17]=b):b=t[17];let x;t[18]===o?x=t[19]:(x=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[y,(0,$.jsx)(G,{id:`hub-display-name`,required:!0,maxLength:200,value:o,className:W,onChange:b})]}),t[18]=o,t[19]=x);let S;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsxs)(Y,{htmlFor:`hub-passkey-label`,children:[`Passkey label `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),t[20]=S):S=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>l(e.currentTarget.value),t[21]=C):C=t[21];let w;t[22]===c?w=t[23]:(w=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[S,(0,$.jsx)(G,{id:`hub-passkey-label`,maxLength:100,value:c,className:W,onChange:C})]}),t[22]=c,t[23]=w);let T;return t[24]!==x||t[25]!==w||t[26]!==f||t[27]!==v?(T=(0,$.jsxs)(`form`,{id:Kn,className:`mt-6 space-y-4`,onSubmit:f,autoComplete:`off`,children:[v,x,w]}),t[24]=x,t[25]=w,t[26]=f,t[27]=v,t[28]=T):T=t[28],T}function Jn(){let e=(0,Q.c)(20),t=s(Zn),{copyToClipboard:n,isCopied:r}=q(),i=`Save all ${String(t.length)} codes — they are shown once and cannot be retrieved later. Ryco does not save them in browser storage.`,a;e[0]!==n||e[1]!==t?(a=()=>n(Be(t),void 0),e[0]=n,e[1]=t,e[2]=a):a=e[2];let o;e[3]===r?o=e[4]:(o=r?(0,$.jsx)(x,{"aria-hidden":!0}):(0,$.jsx)(O,{"aria-hidden":!0}),e[3]=r,e[4]=o);let c=r?`Copied`:`Copy codes`,l;e[5]!==a||e[6]!==o||e[7]!==c?(l=(0,$.jsxs)(K,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:a,children:[o,c]}),e[5]=a,e[6]=o,e[7]=c,e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(K,{size:`cta`,className:`mt-3 w-full`,onClick:Xn,children:`I saved the codes`}),e[9]=u):u=e[9];let d;e[10]===l?d=e[11]:(d=(0,$.jsxs)(`div`,{className:`phone:mt-auto ${qe}`,children:[l,u]}),e[10]=l,e[11]=d);let f;e[12]===t?f=e[13]:(f=t.map(Yn),e[12]=t,e[13]=f);let p;e[14]===f?p=e[15]:(p=(0,$.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:f}),e[14]=f,e[15]=p);let m;return e[16]!==i||e[17]!==d||e[18]!==p?(m=(0,$.jsx)(an,{title:`Save your recovery codes`,description:i,actions:d,children:p}),e[16]=i,e[17]=d,e[18]=p,e[19]=m):m=e[19],m}function Yn(e){return(0,$.jsx)(`li`,{children:e},e)}function Xn(){return _.dismissRecoveryCodes()}function Zn(e){return e.recoveryCodes}function Qn(e){let t=(0,Q.c)(38),{node:n,nowMs:r,disabled:i,onConnect:a,onOpenDetail:o}=e,s;t[0]!==n||t[1]!==r?(s=Ot(n,r),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]===n?l=t[4]:(l=f(n),t[3]=n,t[4]=l);let u=l,d=i||u,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-4`})}),t[5]=p):p=t[5];let m;t[6]===n.label?m=t[7]:(m=(0,$.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),t[6]=n.label,t[7]=m);let h;t[8]===n?h=t[9]:(h=kt(n),t[8]=n,t[9]=h);let g;t[10]===h?g=t[11]:(g=(0,$.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:h}),t[10]=h,t[11]=g);let _;t[12]===u?_=t[13]:(_=u?(0,$.jsx)(`span`,{className:`block truncate text-xs font-medium text-muted-foreground`,children:`Open in Desktop/Mobile`}):null,t[12]=u,t[13]=_);let v;t[14]!==m||t[15]!==g||t[16]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[m,g,_]}),t[14]=m,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]===n?y=t[19]:(y=(0,$.jsx)(L,{node:n}),t[18]=n,t[19]=y);let b;t[20]===c?b=t[21]:(b=c?(0,$.jsx)(`span`,{className:`whitespace-nowrap text-[11px] text-muted-foreground max-sm:hidden phone:hidden`,children:c}):null,t[20]=c,t[21]=b);let x;t[22]!==y||t[23]!==b?(x=(0,$.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[y,b]}),t[22]=y,t[23]=b,t[24]=x):x=t[24];let S;t[25]!==a||t[26]!==x||t[27]!==d||t[28]!==v?(S=(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:a,className:`flex min-h-16 min-w-0 flex-1 flex-wrap items-center gap-3 px-4 py-3 text-left outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:opacity-60 disabled:hover:bg-transparent phone:min-h-18`,children:[p,v,x]}),t[25]=a,t[26]=x,t[27]=d,t[28]=v,t[29]=S):S=t[29];let C;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`w-px shrink-0 bg-border/60`}),t[30]=C):C=t[30];let T=`Node details: ${n.label}`,E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(w,{"aria-hidden":!0,className:`size-4`}),t[31]=E):E=t[31];let D;t[32]!==o||t[33]!==T?(D=(0,$.jsx)(`button`,{type:`button`,"aria-label":T,onClick:o,className:`flex w-[44px] shrink-0 items-center justify-center text-muted-foreground outline-none hover:bg-accent/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:E}),t[32]=o,t[33]=T,t[34]=D):D=t[34];let O;return t[35]!==S||t[36]!==D?(O=(0,$.jsxs)(`li`,{className:`flex items-stretch overflow-hidden rounded-xl border border-border bg-background`,children:[S,C,D]}),t[35]=S,t[36]=D,t[37]=O):O=t[37],O}function $n(){let e=(0,Q.c)(110),t=s(pr),n=s(fr),r=s(dr),a=s(ur),o=s(lr),c=s(cr),l=ne(),u=m(),d=ge()===`phone`,f=A()?.kind===`nodes-enroll`,p=sr,[h,g]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),x=We(6e4),C,w;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{b.current?.focus({preventScroll:!0})},w=[],e[0]=C,e[1]=w):(C=e[0],w=e[1]),(0,Z.useEffect)(C,w);let T;e[2]===u?T=e[3]:(T=async e=>{R(e.id)||(await u({to:`/`,replace:!0}),await _.selectNode(e.id))},e[2]=u,e[3]=T);let E=T;if(f){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(qt,{measure:`content`,children:(0,$.jsx)(on,{onClose:()=>p(!1)})}),e[4]=t):t=e[4],t}let D,O,k,j,M,N,P,F,I,L,z,ee,te,V,H,U,W,G;if(e[5]!==o||e[6]!==r||e[7]!==h||e[8]!==a||e[9]!==d||e[10]!==t||e[11]!==x||e[12]!==v||e[13]!==l||e[14]!==E||e[15]!==c||e[16]!==n){let i=At(t),s;e[35]!==h||e[36]!==t?(s=h===null?null:t.find(e=>e.id===h)??null,e[35]=h,e[36]=t,e[37]=s):s=e[37],j=s,P=o?.role===`owner`;let u=n===`ready`&&t.length===0;N=P&&!u;let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:or,children:[(0,$.jsx)(se,{"aria-hidden":!0}),` Account`]}),e[38]=f):f=e[38],k=f;let m;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:ar,children:[(0,$.jsx)(re,{"aria-hidden":!0}),` Sign out`]}),e[39]=m):m=e[39],I=m;let _=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,y,C;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>p(!0),C=(0,$.jsx)(ae,{"aria-hidden":!0}),e[40]=y,e[41]=C):(y=e[40],C=e[41]);let w;e[42]===_?w=e[43]:(w=(0,$.jsxs)(K,{className:_,onClick:y,children:[C,` Enroll node`]}),e[42]=_,e[43]=w),M=w;let T=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,A=n===`loading`,R;e[44]===n?R=e[45]:(R=n===`loading`?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,$.jsx)(ie,{"aria-hidden":!0}),e[44]=n,e[45]=R);let B;e[46]!==T||e[47]!==A||e[48]!==R?(B=(0,$.jsxs)(K,{className:T,variant:`outline`,disabled:A,onClick:ir,children:[R,`Refresh nodes`]}),e[46]=T,e[47]=A,e[48]=R,e[49]=B):B=e[49],F=B,O=qt;let ne;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:rr,children:(0,$.jsx)(se,{"aria-hidden":!0})}),e[50]=ne):ne=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsxs)($.Fragment,{children:[ne,(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:nr,children:(0,$.jsx)(re,{"aria-hidden":!0})})]}),e[51]=z):z=e[51],D=zt,ee=b,te=t.length===1?`Your node`:`Your nodes`;let ce=o?.displayName??`Hub account`,q;e[52]===o?q=e[53]:(q=o?` · ${o.role.charAt(0).toUpperCase()}${o.role.slice(1)}`:``,e[52]=o,e[53]=q);let le;e[54]!==ce||e[55]!==q?(le=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,ce,q]}),e[54]=ce,e[55]=q,e[56]=le):le=e[56];let J;e[57]===t?J=e[58]:(J=t.length>1?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:Nt(t)}):null,e[57]=t,e[58]=J),e[59]!==le||e[60]!==J?(V=(0,$.jsxs)($.Fragment,{children:[le,J]}),e[59]=le,e[60]=J,e[61]=V):V=e[61],e[62]!==M||e[63]!==N||e[64]!==d||e[65]!==F?(H=d?void 0:(0,$.jsxs)($.Fragment,{children:[F,N?M:null]}),e[62]=M,e[63]=N,e[64]=d,e[65]=F,e[66]=H):H=e[66],e[67]===n?U=e[68]:(U=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=U),e[69]===v?W=e[70]:(W=v?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:v})]})}):null,e[69]=v,e[70]=W);let ue=n===`stale`?null:a;e[71]!==l||e[72]!==c||e[73]!==ue?(G=(0,$.jsx)(mr,{selection:c,routeNotice:l,error:ue}),e[71]=l,e[72]=c,e[73]=ue,e[74]=G):G=e[74],L=u?(0,$.jsx)(hr,{isOwner:P,onEnroll:()=>p(!0)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`ul`,{role:`list`,className:`mt-5 space-y-2`,"aria-busy":n===`loading`,children:[i.map(e=>(0,$.jsx)(Qn,{node:e,nowMs:x,disabled:Pt({directoryStatus:n,browserStatus:r,node:e}),onConnect:()=>void E(e),onOpenDetail:()=>g(e.id)},`${e.id}:${e.environmentId}`)),n===`loading`&&t.length===0?(0,$.jsx)($.Fragment,{children:[0,1,2].map(tr)}):null]}),n===`loading`&&t.length===0?(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:`Loading authorized nodes…`}):null,t.length>0?(0,$.jsx)(`p`,{className:`mt-2 px-1 text-[11px] text-muted-foreground`,children:`Presence refreshes about every 20 seconds.`}):null]}),e[5]=o,e[6]=r,e[7]=h,e[8]=a,e[9]=d,e[10]=t,e[11]=x,e[12]=v,e[13]=l,e[14]=E,e[15]=c,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=j,e[21]=M,e[22]=N,e[23]=P,e[24]=F,e[25]=I,e[26]=L,e[27]=z,e[28]=ee,e[29]=te,e[30]=V,e[31]=H,e[32]=U,e[33]=W,e[34]=G}else D=e[17],O=e[18],k=e[19],j=e[20],M=e[21],N=e[22],P=e[23],F=e[24],I=e[25],L=e[26],z=e[27],ee=e[28],te=e[29],V=e[30],H=e[31],U=e[32],W=e[33],G=e[34];let ce,q;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Je,{})}),q=(0,$.jsx)(B,{}),e[75]=ce,e[76]=q):(ce=e[75],q=e[76]);let le;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{e||g(null)},e[77]=le):le=e[77];let J;e[78]===E?J=e[79]:(J=e=>void E(e),e[78]=E,e[79]=J);let ue;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(ue=async e=>{await i.revokeNode(e.id,lt),y(mt(e.label)),await _.refreshDirectory(),g(null)},e[80]=ue):ue=e[80];let de;e[81]!==r||e[82]!==j||e[83]!==P||e[84]!==n||e[85]!==J?(de=(0,$.jsx)(Rt,{node:j,directoryStatus:n,browserStatus:r,canRename:P,canRevoke:P,onOpenChange:le,onConnect:J,onRename:er,onRevoke:ue}),e[81]=r,e[82]=j,e[83]=P,e[84]=n,e[85]=J,e[86]=de):de=e[86];let fe;e[87]!==D||e[88]!==L||e[89]!==de||e[90]!==ee||e[91]!==te||e[92]!==V||e[93]!==H||e[94]!==U||e[95]!==W||e[96]!==G?(fe=(0,$.jsxs)(D,{titleRef:ee,title:te,description:V,actions:H,children:[U,W,G,L,ce,q,de]}),e[87]=D,e[88]=L,e[89]=de,e[90]=ee,e[91]=te,e[92]=V,e[93]=H,e[94]=U,e[95]=W,e[96]=G,e[97]=fe):fe=e[97];let pe;e[98]!==k||e[99]!==M||e[100]!==N||e[101]!==d||e[102]!==F||e[103]!==I?(pe=d?(0,$.jsxs)(`div`,{className:`mt-auto ${qe}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,I]}),N?M:null,F]}):null,e[98]=k,e[99]=M,e[100]=N,e[101]=d,e[102]=F,e[103]=I,e[104]=pe):pe=e[104];let me;return e[105]!==O||e[106]!==z||e[107]!==fe||e[108]!==pe?(me=(0,$.jsxs)(O,{trailing:z,children:[fe,pe]}),e[105]=O,e[106]=z,e[107]=fe,e[108]=pe,e[109]=me):me=e[109],me}async function er(e,t){await i.renameNode(e.id,t),await _.refreshDirectory()}function tr(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(he,{className:`h-16 w-full rounded-xl`})},e)}function nr(){_.signOut()}function rr(){I({kind:`account`,section:`security`})}function ir(){_.refreshDirectory()}function ar(){_.signOut()}function or(){I({kind:`account`,section:`security`})}function sr(e){return I(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function cr(e){return e.selectionStatus}function lr(e){return e.account}function ur(e){return e.errorMessage}function dr(e){return e.browserStatus}function fr(e){return e.directoryStatus}function pr(e){return e.nodes}function mr(e){let t=(0,Q.c)(3),{selection:n,routeNotice:r,error:i}=e,a=(n===`authorization-removed`?`Authorization for the previous node was removed.`:n===`revoked`?`The previous node or grant was revoked.`:n===`incompatible`?`The previous node uses an incompatible relay version.`:null)??r??i;if(!a)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(oe,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;return t[1]===a?s=t[2]:(s=(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`error`,children:[o,(0,$.jsx)(ve,{children:a})]})}),t[1]=a,t[2]=s),s}function hr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(Pe,{variant:`icon`,children:n?(0,$.jsx)(ae,{"aria-hidden":!0}):(0,$.jsx)(H,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Le,{children:`No nodes yet`}),t[2]=a):a=t[2];let o=n?`A node appears here once the Ryco client on that machine has been enrolled. Start enrollment on the node, then enter the short device code it shows — codes expire after ten minutes.`:`A node appears here once an owner of this Hub authorizes your account for it.`,s;t[3]===o?s=t[4]:(s=(0,$.jsx)(Re,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Fe,{children:[i,a,s]}),t[5]=i,t[6]=s,t[7]=c):c=t[7];let l;t[8]!==n||t[9]!==r?(l=n?(0,$.jsx)(Ie,{children:(0,$.jsxs)(K,{className:`phone:min-h-11`,onClick:r,children:[(0,$.jsx)(ae,{"aria-hidden":!0}),` Enroll node`]})}):null,t[8]=n,t[9]=r,t[10]=l):l=t[10];let u;return t[11]!==c||t[12]!==l?(u=(0,$.jsxs)(ze,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}export{Gn as HostedAuthenticationSurface,En as HostedHubRoot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-CQmEMMQH.js";import{F as r,N as i}from"./runtime-CXut_g4p.js";import{It as a}from"./composerDraftStore-CdJJZe42.js";import{n as o}from"./branding-BDfN6Spd.js";import{_ as s,o as c}from"./authorization-mIJKV2yp.js";import{n as l,t as u}from"./loader-circle-CrtHFAvM.js";import{t as d}from"./log-out-tMJm0Gk6.js";import{t as f}from"./shield-check-dQ-4cMKk.js";import{t as p}from"./smartphone-gNe1ynB8.js";import{t as m}from"./triangle-alert-RL_T3KLo.js";import{t as h}from"./x-C1Cemsov.js";import{t as g}from"./button-BAbJxRzt.js";import{i as _,r as v,t as y}from"./alert-LqMhbdE9.js";var b=e(t(),1),x=a(),S=(0,b.lazy)(()=>n(()=>import(`./HostedHubRoot-Cc8GYcK6.js`).then(e=>({default:e.HostedAuthenticationSurface})),[]));function C(e){window.location.assign(e)}function w({handoffId:e,navigate:t=C}){let n=i(e=>e.accountStatus),a=i(e=>e.account),[w,T]=(0,b.useState)(null),[E,D]=(0,b.useState)(!0),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(null),[M,N]=(0,b.useState)(null),P=(0,b.useRef)(null);if((0,b.useEffect)(()=>{let t=new AbortController;return D(!0),N(null),r.getNativeHandoffPresentation(e,t.signal).then(e=>T(e)).catch(e=>{t.signal.aborted||N(e instanceof s?e.message:`This device authorization is unavailable or has expired.`)}).finally(()=>{t.signal.aborted||D(!1)}),()=>t.abort()},[e]),(0,b.useEffect)(()=>{!E&&n===`authenticated`&&P.current?.focus({preventScroll:!0})},[n,E]),n!==`authenticated`||!a)return(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(S,{context:`native-authorization`,autoExternalProvider:w?.providerHint??null})});let F=async n=>{if(O===null){k(n),N(null);try{if(n===`switch-account`){await c.signOut();return}let i=n===`approve`?await r.approveNativeHandoff(e):await r.cancelNativeHandoff(e);n===`approve`&&(j({redirectUri:i.redirectUri,deviceLabel:w?.deviceLabel??`your device`}),await new Promise(e=>requestAnimationFrame(()=>e()))),t(i.redirectUri)}catch(e){n===`approve`&&j(null),N(e instanceof s?e.message:`The device authorization could not be completed.`)}finally{k(null)}}};return A===null?(0,x.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center overflow-x-hidden bg-background px-4 py-10 text-foreground sm:px-6`,children:(0,x.jsxs)(`section`,{className:`w-full max-w-md rounded-[1.5rem] border border-border bg-card p-5 shadow-2xl shadow-black/10 sm:p-7`,children:[(0,x.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,x.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl border border-border bg-background text-primary`,children:(0,x.jsx)(f,{"aria-hidden":!0,className:`size-5`})}),(0,x.jsxs)(`p`,{className:`pt-1 text-[11px] font-semibold tracking-[0.16em] text-muted-foreground uppercase`,children:[o,` Hub`]})]}),(0,x.jsx)(`h1`,{ref:P,tabIndex:-1,className:`mt-6 text-2xl font-semibold tracking-tight outline-none`,children:`Continue on this device?`}),(0,x.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`Only continue if you started this connection from the Ryco app. The app receives a one-time code, never this browser session.`}),(0,x.jsxs)(`div`,{className:`mt-6 overflow-hidden rounded-2xl border border-border bg-background/65`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3.5`,children:[(0,x.jsx)(p,{"aria-hidden":!0,className:`size-5 text-muted-foreground`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Requesting device`}),(0,x.jsx)(`p`,{className:`truncate text-sm font-medium`,children:E?`Checking request…`:w?.deviceLabel??`Unknown device`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,x.jsx)(`div`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/12 text-xs font-semibold text-primary`,children:a.displayName.trim().slice(0,1).toLocaleUpperCase()||`R`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Signed in as`}),(0,x.jsx)(`p`,{className:`truncate text-sm font-medium`,children:a.displayName})]})]})]}),M?(0,x.jsxs)(y,{variant:`error`,className:`mt-4`,children:[(0,x.jsx)(m,{"aria-hidden":!0}),(0,x.jsx)(_,{children:`Authorization did not complete`}),(0,x.jsx)(v,{children:M})]}):null,(0,x.jsxs)(`div`,{className:`mt-6 space-y-2.5`,children:[(0,x.jsxs)(g,{size:`lg`,className:`min-h-11 w-full`,disabled:E||!w||O!==null,onClick:()=>void F(`approve`),children:[O===`approve`?(0,x.jsx)(u,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(l,{"aria-hidden":!0}),`Continue as `,a.displayName]}),(0,x.jsxs)(g,{size:`lg`,variant:`outline`,className:`min-h-11 w-full`,disabled:O!==null,onClick:()=>void F(`switch-account`),children:[O===`switch-account`?(0,x.jsx)(u,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(d,{"aria-hidden":!0}),`Use another account`]}),(0,x.jsxs)(g,{size:`lg`,variant:`ghost`,className:`min-h-11 w-full`,disabled:E||!w||O!==null,onClick:()=>void F(`cancel`),children:[O===`cancel`?(0,x.jsx)(u,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(h,{"aria-hidden":!0}),`Cancel`]})]}),(0,x.jsx)(`p`,{className:`mt-5 text-center text-xs leading-relaxed text-muted-foreground`,children:`Access remains limited to the nodes and permissions assigned to this Hub account.`})]})}):(0,x.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center overflow-hidden bg-background px-4 py-10 text-foreground sm:px-6`,children:(0,x.jsxs)(`section`,{role:`status`,"aria-live":`polite`,className:`w-full max-w-md rounded-[1.5rem] border border-border bg-card p-6 text-center shadow-2xl shadow-black/10 sm:p-8`,children:[(0,x.jsxs)(`div`,{className:`relative mx-auto flex size-24 items-center justify-center`,children:[(0,x.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-2 rounded-full bg-success/20 motion-safe:animate-ping`}),(0,x.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 rounded-full border border-success/25 motion-safe:animate-pulse`}),(0,x.jsx)(`span`,{className:`relative flex size-16 items-center justify-center rounded-full bg-success text-success-foreground shadow-lg shadow-success/20`,children:(0,x.jsx)(l,{"aria-hidden":!0,className:`size-8`,strokeWidth:2.5})})]}),(0,x.jsx)(`p`,{className:`mt-7 text-[11px] font-semibold tracking-[0.16em] text-success uppercase`,children:`Sign-in approved`}),(0,x.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Ryco is opening`}),(0,x.jsxs)(`p`,{className:`mt-3 text-sm leading-relaxed text-muted-foreground`,children:[`Ryco is securely finishing account and node setup on `,A.deviceLabel,`. This tab can be closed when the app shows setup complete.`]}),(0,x.jsx)(`div`,{className:`mt-7 rounded-2xl border border-border bg-background/65 p-4`,children:(0,x.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-sm font-medium`,children:[(0,x.jsx)(p,{"aria-hidden":!0,className:`size-4 text-primary`}),`Waiting for the Ryco app`,(0,x.jsxs)(`span`,{className:`flex gap-1`,"aria-hidden":!0,children:[(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse`}),(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse [animation-delay:150ms]`}),(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse [animation-delay:300ms]`})]})]})}),(0,x.jsx)(g,{size:`lg`,variant:`outline`,className:`mt-5 min-h-11 w-full`,onClick:()=>t(A.redirectUri),children:`Open Ryco again`})]})})}export{w as HostedNativeAuthorizationRoute};
|
package/dist/client/assets/{HostedRelayTrustNotice-eEOPKsBg.js → HostedRelayTrustNotice-BldMySVi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{ht as r,mt as i}from"./runtime-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{ht as r,mt as i}from"./runtime-CXut_g4p.js";import{It as a}from"./composerDraftStore-CdJJZe42.js";import{jt as o,n as s,r as c,wt as l}from"./authorization-mIJKV2yp.js";import{t as u}from"./shield-alert-DY9uVP5G.js";import{t as d}from"./shield-IZEIJ8r7.js";function f(e){return c(e)}function p(e){return s(e)}var m=n(),h=e(t(),1),g=()=>r().status;function _(){return(0,h.useSyncExternalStore)(i,g,g)}var v=()=>r().verificationCode;function y(){return(0,h.useSyncExternalStore)(i,v,v)}function b(e){let t=e.split(o.separator);if(t.length!==o.groups)return[];for(let e of t){if(e.length!==o.charsPerGroup)return[];for(let t of e)if(!`0123456789ABCDEFGHJKMNPQRSTVWXYZ`.includes(t))return[]}return t}o.chars*Math.log2(l.length);var x=`Compare this code with the one your node's CLI shows for this session. A match catches accidental wrong-node routing and some network interposition while the loaded code is honest; it cannot protect against the Hub operator, who serves this page, and it does not rule out someone sitting in the middle.`,S=`Settings → Security explains what else this tab cannot check.`,C=`Compare this code with the one your node's CLI shows for this session. A match catches accidental wrong-node routing and some network interposition while the loaded code is honest. This tab pins no node identity, so that comparison is the only thing that speaks to whether the far end is your machine or the Hub standing in for it — and it cannot protect against the Hub operator, who serves this page and could serve code that completes the same handshake and displays this same code anyway. A match does not rule out someone sitting in the middle.`,w="Run `ryco e2ee sessions` on the machine running the node to read its end of the comparison.",T=`No session code is available for this channel, so there is nothing here to compare against your node's CLI.`;function E(e){return e?`inline`:`settings`}var D={inline:{advisory:x,more:S},settings:{advisory:C,more:w}};Object.keys(D);function O(e,t){if(e===null)return null;let n=b(e);if(n.length===0)return null;let{advisory:r,more:i}=D[t];return{groups:n,display:n.join(o.separator),advisory:r,more:i}}var k={unavailable:{tone:`caution`,body:`Hosted connections reach your nodes through the Ryco Hub over WSS. No node channel is open in this tab, so the Hub still forwards what you send in a form it can read, and it is expected not to log or keep it.`},negotiating:{tone:`caution`,body:`This tab is still agreeing a channel with your node and has released nothing to it yet. Until that settles, treat this connection as one the Hub can read.`},"web-unsigned":{tone:`advisory`,body:`This tab and the node it was routed to agreed a browser channel, so while the code this page is running is honest the Hub relays ciphertext instead of readable payload. It is weaker than the channel the Ryco mobile app gets, in two ways this tab cannot close. This tab pins no node identity, so it cannot tell whether the far end of that channel is your machine or the Hub standing in for it. And it cannot protect against the Hub operator, who serves every byte of this page's JavaScript and could serve code that completes the same handshake and copies your data anyway. Its downgrade check is held in memory only — empty again in every new tab and after every reload, and worth nothing against that operator. Only your node can close the plaintext path for browsers.`},legacy:{tone:`caution`,body:`This channel fell back to legacy plaintext. This tab cannot tell whether your node offered no encrypted channel or something on the path removed the offer, so treat everything sent over it as readable by the Hub, which is expected not to log or keep it. Only your node can refuse plaintext for browsers.`}};function A(e){return k[e]}Object.keys(k);var j=a();function M(e){let t=(0,m.c)(13),{compact:n}=e,r=n!==void 0&&n,i=_(),a;t[0]===i?a=t[1]:(a=A(i),t[0]=i,t[1]=a);let{tone:o,body:s}=a,c=o===`advisory`?d:u,l=o===`advisory`?`text-sky-600`:`text-amber-600`,f=r?`flex gap-2 text-xs leading-relaxed text-muted-foreground`:`flex gap-2 rounded-lg border px-3 py-2.5 text-xs leading-relaxed text-muted-foreground ${o===`advisory`?`border-sky-500/25 bg-sky-500/5`:`border-amber-500/25 bg-amber-500/5`}`,p=`mt-0.5 size-4 shrink-0 ${l}`,h;t[2]!==c||t[3]!==p?(h=(0,j.jsx)(c,{"aria-hidden":!0,className:p}),t[2]=c,t[3]=p,t[4]=h):h=t[4];let g;t[5]===s?g=t[6]:(g=(0,j.jsx)(`p`,{children:s}),t[5]=s,t[6]=g);let v;return t[7]!==i||t[8]!==f||t[9]!==h||t[10]!==g||t[11]!==o?(v=(0,j.jsxs)(`div`,{className:f,"data-hosted-relay-trust-notice":`true`,"data-e2ee-status":i,"data-tone":o,children:[h,g]}),t[7]=i,t[8]=f,t[9]=h,t[10]=g,t[11]=o,t[12]=v):v=t[12],v}export{_ as a,f as c,O as i,T as n,y as o,E as r,p as s,M as t};
|