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.
Files changed (68) hide show
  1. package/dist/bin.cjs +1 -1
  2. package/dist/bin.mjs +1 -1
  3. package/dist/client/assets/{AccountSettings-BUoiS8x1.js → AccountSettings-Be5_48k0.js} +1 -1
  4. package/dist/client/assets/{AiFocusSettings-Cz1Uqn7a.js → AiFocusSettings-DIpQXLW2.js} +1 -1
  5. package/dist/client/assets/{BranchToolbar.logic-LIanCEVr.js → BranchToolbar.logic-D7slG_zJ.js} +1 -1
  6. package/dist/client/assets/{ChatRightPanel-CKEjpQ_x.js → ChatRightPanel-BIS1DPGa.js} +3 -3
  7. package/dist/client/assets/{ChatThreadRouteView-D50onHY2.js → ChatThreadRouteView-CocRstME.js} +1 -1
  8. package/dist/client/assets/{CommandPaletteDialog-DdRKgZ8m.js → CommandPaletteDialog-C5xAo65V.js} +1 -1
  9. package/dist/client/assets/ConnectionsSettings-CXabxSaH.js +7 -0
  10. package/dist/client/assets/{DiagnosticsSettings-C74u3ce5.js → DiagnosticsSettings-CZ3vY43G.js} +1 -1
  11. package/dist/client/assets/{DraftChatThreadRouteView-RTmLGTl0.js → DraftChatThreadRouteView-D8Bt3Qnq.js} +1 -1
  12. package/dist/client/assets/{HostedConnectionControls-CKiC01ju.js → HostedConnectionControls-DxAXv0Hd.js} +1 -1
  13. package/dist/client/assets/{HostedHubRoot-BS3rAYTy.js → HostedHubRoot-Cc8GYcK6.js} +1 -1
  14. package/dist/client/assets/{HostedNativeAuthorizationRoute-BFTDyh4N.js → HostedNativeAuthorizationRoute-CTQe7Vjt.js} +1 -1
  15. package/dist/client/assets/{HostedRelayTrustNotice-eEOPKsBg.js → HostedRelayTrustNotice-BldMySVi.js} +1 -1
  16. package/dist/client/assets/{IntegrationsSettingsPanel-Cg4eRHm_.js → IntegrationsSettingsPanel-D6f3KoqM.js} +1 -1
  17. package/dist/client/assets/{KeybindingsSettings-CYj67N2D.js → KeybindingsSettings-D2bNQPI-.js} +1 -1
  18. package/dist/client/assets/{McpServersSettings-Bc61hRUY.js → McpServersSettings-B7YqVvV4.js} +1 -1
  19. package/dist/client/assets/{NewWorktreeDialog-CTlFjKa4.js → NewWorktreeDialog-CKr2ioue.js} +1 -1
  20. package/dist/client/assets/{NoActiveThreadState-Dw9aoU2J.js → NoActiveThreadState-BD-eNmfn.js} +1 -1
  21. package/dist/client/assets/{NodeSecuritySettings-DMkkTgfg.js → NodeSecuritySettings-FWM_SeDi.js} +1 -1
  22. package/dist/client/assets/{OpinionatedPluginsSettings-CeoSmZ90.js → OpinionatedPluginsSettings-BtZQF4Ze.js} +1 -1
  23. package/dist/client/assets/{PhoneGetAppInterstitial-7ZxxVbUB.js → PhoneGetAppInterstitial-CooQgpSw.js} +1 -1
  24. package/dist/client/assets/{PhoneHome-DRRoCd_y.js → PhoneHome-BtPE7bQn.js} +1 -1
  25. package/dist/client/assets/{PhoneSettingsSurface-LNEaPHQC.js → PhoneSettingsSurface-tcFCccEL.js} +1 -1
  26. package/dist/client/assets/{ProjectFavicon-BIMdZxK6.js → ProjectFavicon-qZGdjYCM.js} +1 -1
  27. package/dist/client/assets/{ProviderModelPicker-jd6GjQkO.js → ProviderModelPicker-D0w23uWo.js} +1 -1
  28. package/dist/client/assets/{ProvidersSettingsPanel-v2SvoEGx.js → ProvidersSettingsPanel-B3aBKY--.js} +1 -1
  29. package/dist/client/assets/{RootAppShell-CFjrYjtn.js → RootAppShell-C-0ChFVJ.js} +2 -2
  30. package/dist/client/assets/SettingsDialog-Bbuoh793.js +1 -0
  31. package/dist/client/assets/{SettingsPanels-BmhZ8u4B.js → SettingsPanels-Dr4f2y9l.js} +1 -1
  32. package/dist/client/assets/{SourceControlSettings-DvPydmxX.js → SourceControlSettings-CkiYR4lR.js} +1 -1
  33. package/dist/client/assets/{StatisticsPage-Duk2cHVH.js → StatisticsPage-Bjouapmf.js} +1 -1
  34. package/dist/client/assets/{StatisticsPanel-D-uNJcdj.js → StatisticsPanel-D_khPph6.js} +1 -1
  35. package/dist/client/assets/{ThreadStatusIndicators-D0xoATCw.js → ThreadStatusIndicators-ZImeLExQ.js} +0 -0
  36. package/dist/client/assets/{ThreadTerminalDrawer-DjX8p7IH.js → ThreadTerminalDrawer-DDHEuRGB.js} +1 -1
  37. package/dist/client/assets/{ThreadWorkspacePanel-DI0GXPBf.js → ThreadWorkspacePanel-QF3KwbGm.js} +1 -1
  38. package/dist/client/assets/{WorkItemsTab-ow45makA.js → WorkItemsTab-AOVwVvb7.js} +1 -1
  39. package/dist/client/assets/{branding-C8SLy6Af.js → branding-BDfN6Spd.js} +1 -1
  40. package/dist/client/assets/{capabilities-BQuqC7jg.js → capabilities-3zgirmmI.js} +1 -1
  41. package/dist/client/assets/{desktopUpdateAtoms-C82GmR67.js → desktopUpdateAtoms-CyfPW2jg.js} +1 -1
  42. package/dist/client/assets/{desktopWorkspace-G5Z_JRbm.js → desktopWorkspace-DHUZEpfy.js} +1 -1
  43. package/dist/client/assets/{device-B56cBWWt.js → device-B_qvyvtW.js} +1 -1
  44. package/dist/client/assets/{editorPreferences-CTDEj79K.js → editorPreferences-DHIJntKF.js} +1 -1
  45. package/dist/client/assets/{index-Bbz4fkK_.js → index-CQmEMMQH.js} +1 -1
  46. package/dist/client/assets/{main-Dwu2cT6v.js → main-BKS5Nf2_.js} +2 -2
  47. package/dist/client/assets/primary-BzLEg2w1.js +2 -0
  48. package/dist/client/assets/{projectPaths-lDhAE9o_.js → projectPaths-BAd6NFcE.js} +1 -1
  49. package/dist/client/assets/{providerIconUtils-DnSYUN9l.js → providerIconUtils-X0Z3EK-Q.js} +1 -1
  50. package/dist/client/assets/runtime-CXut_g4p.js +1 -0
  51. package/dist/client/assets/{session-logic-DElAta-Z.js → session-logic-GZix7S2I.js} +1 -1
  52. package/dist/client/assets/{sidebarProjectFolders-Cs13ZUN8.js → sidebarProjectFolders-cnmz3B_-.js} +1 -1
  53. package/dist/client/assets/storeSelectors-DYekgeHu.js +1 -0
  54. package/dist/client/assets/{threadPriorityRefreshRuntime-DJF5drVD.js → threadPriorityRefreshRuntime-Ct5pnIbX.js} +1 -1
  55. package/dist/client/assets/types-DYekgeHu.js +1 -0
  56. package/dist/client/assets/{useAtlassian-Bx2ua3JV.js → useAtlassian-9-hy2f8z.js} +0 -0
  57. package/dist/client/assets/{useHandleNewThread-DHO0PWGZ.js → useHandleNewThread-DX2FtXcP.js} +1 -1
  58. package/dist/client/assets/{usePhoneThreadActions-OTf7yIbN.js → usePhoneThreadActions-BEa3VzGG.js} +1 -1
  59. package/dist/client/assets/{useStatistics-DEtKeVPP.js → useStatistics-CtunoTE-.js} +1 -1
  60. package/dist/client/assets/{useThreadActions-DLxhOMkz.js → useThreadActions-fN-Al13y.js} +1 -1
  61. package/dist/client/index.html +1 -1
  62. package/package.json +1 -1
  63. package/dist/client/assets/ConnectionsSettings--CbTzkTn.js +0 -7
  64. package/dist/client/assets/SettingsDialog-CvGTsSV0.js +0 -1
  65. package/dist/client/assets/primary-OskAInOO.js +0 -2
  66. package/dist/client/assets/runtime-DKwoXpJv.js +0 -1
  67. package/dist/client/assets/storeSelectors-Cq_JKyiF.js +0 -1
  68. package/dist/client/assets/types-Cq_JKyiF.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{n as t,t as n}from"./env-B4arEvJg.js";import{It as r}from"./composerDraftStore-CdJJZe42.js";import{g as i,h as a}from"./rightPanelRouteSearch-DB5gQGHK.js";import{t as o}from"./useNavigate-2tVq4iZ2.js";import{t as s}from"./arrow-left-Dtj9PfsA.js";import{h as c,t as l}from"./HostedConnectionControls-CKiC01ju.js";import{t as u}from"./utils-BofFIn5Y.js";import{t as d}from"./button-BAbJxRzt.js";import{t as f}from"./usePresentationTier-B_SCFvN7.js";import{g as p,o as m}from"./sidebar-Dm6l2GA6.js";import{i as h,o as g,r as _,t as v}from"./empty-DwzqNgCP.js";import{t as y}from"./HostedRelayTrustNotice-eEOPKsBg.js";var b=e();function x(){let{state:e}=p(),t=f();return e===`collapsed`&&t===`desktop`}var S=r();function C(){let e=(0,b.c)(10),r=o(),c=x()?i:`pl-3 sm:pl-5`,f;e[0]===c?f=e[1]:(f=u(`border-b border-border pr-3 sm:pr-5`,a,c,n?`drag-region flex h-[52px] items-center wco:h-[env(titlebar-area-height)]`:`py-2 sm:py-3`),e[0]=c,e[1]=f);let p;e[2]===r?p=e[3]:(p=n?(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground/50 wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]`,children:`No active thread`}):(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(d,{size:`icon-sm`,variant:`ghost`,"aria-label":`Back to threads`,className:`shrink-0 not-phone:hidden`,onClick:()=>void r({to:`/`}),children:(0,S.jsx)(s,{})}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground md:text-muted-foreground/60`,children:`No active thread`}),(0,S.jsx)(l,{})]}),e[2]=r,e[3]=p);let C;e[4]!==f||e[5]!==p?(C=(0,S.jsx)(`header`,{className:f,children:p}),e[4]=f,e[5]=p,e[6]=C):C=e[6];let T;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,S.jsx)(v,{className:`flex-1`,children:(0,S.jsx)(`div`,{className:`w-full max-w-lg rounded-3xl border border-border/55 bg-card/20 px-8 py-12 shadow-sm/5`,children:(0,S.jsxs)(h,{className:`max-w-none`,children:[(0,S.jsx)(g,{className:`text-foreground text-xl`,children:`Pick a thread to continue`}),(0,S.jsx)(_,{className:`mt-2 text-sm text-muted-foreground/78`,children:`Select an existing thread or create a new one to get started.`}),t()?(0,S.jsxs)(`div`,{className:`mt-5 space-y-3 text-left`,children:[(0,S.jsx)(d,{variant:`outline`,onClick:w,children:`Manage nodes`}),(0,S.jsx)(y,{compact:!0})]}):null]})})}),e[7]=T):T=e[7];let E;return e[8]===C?E=e[9]:(E=(0,S.jsx)(m,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,S.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[C,T]})}),e[8]=C,e[9]=E),E}function w(){return c({kind:`nodes`})}export{x as n,C as t};
1
+ import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{n as t,t as n}from"./env-B4arEvJg.js";import{It as r}from"./composerDraftStore-CdJJZe42.js";import{g as i,h as a}from"./rightPanelRouteSearch-DB5gQGHK.js";import{t as o}from"./useNavigate-2tVq4iZ2.js";import{t as s}from"./arrow-left-Dtj9PfsA.js";import{h as c,t as l}from"./HostedConnectionControls-DxAXv0Hd.js";import{t as u}from"./utils-BofFIn5Y.js";import{t as d}from"./button-BAbJxRzt.js";import{t as f}from"./usePresentationTier-B_SCFvN7.js";import{g as p,o as m}from"./sidebar-Dm6l2GA6.js";import{i as h,o as g,r as _,t as v}from"./empty-DwzqNgCP.js";import{t as y}from"./HostedRelayTrustNotice-BldMySVi.js";var b=e();function x(){let{state:e}=p(),t=f();return e===`collapsed`&&t===`desktop`}var S=r();function C(){let e=(0,b.c)(10),r=o(),c=x()?i:`pl-3 sm:pl-5`,f;e[0]===c?f=e[1]:(f=u(`border-b border-border pr-3 sm:pr-5`,a,c,n?`drag-region flex h-[52px] items-center wco:h-[env(titlebar-area-height)]`:`py-2 sm:py-3`),e[0]=c,e[1]=f);let p;e[2]===r?p=e[3]:(p=n?(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground/50 wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]`,children:`No active thread`}):(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(d,{size:`icon-sm`,variant:`ghost`,"aria-label":`Back to threads`,className:`shrink-0 not-phone:hidden`,onClick:()=>void r({to:`/`}),children:(0,S.jsx)(s,{})}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground md:text-muted-foreground/60`,children:`No active thread`}),(0,S.jsx)(l,{})]}),e[2]=r,e[3]=p);let C;e[4]!==f||e[5]!==p?(C=(0,S.jsx)(`header`,{className:f,children:p}),e[4]=f,e[5]=p,e[6]=C):C=e[6];let T;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,S.jsx)(v,{className:`flex-1`,children:(0,S.jsx)(`div`,{className:`w-full max-w-lg rounded-3xl border border-border/55 bg-card/20 px-8 py-12 shadow-sm/5`,children:(0,S.jsxs)(h,{className:`max-w-none`,children:[(0,S.jsx)(g,{className:`text-foreground text-xl`,children:`Pick a thread to continue`}),(0,S.jsx)(_,{className:`mt-2 text-sm text-muted-foreground/78`,children:`Select an existing thread or create a new one to get started.`}),t()?(0,S.jsxs)(`div`,{className:`mt-5 space-y-3 text-left`,children:[(0,S.jsx)(d,{variant:`outline`,onClick:w,children:`Manage nodes`}),(0,S.jsx)(y,{compact:!0})]}):null]})})}),e[7]=T):T=e[7];let E;return e[8]===C?E=e[9]:(E=(0,S.jsx)(m,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,S.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[C,T]})}),e[8]=C,e[9]=E),E}function w(){return c({kind:`nodes`})}export{x as n,C as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{n as r}from"./env-B4arEvJg.js";import{N as i,Xn as a}from"./runtime-DKwoXpJv.js";import{D as o,E as s,N as c,O as l,P as u,S as d,_ as f,b as p,c as m,d as h,f as g,l as _,m as v,s as y,v as b,x,y as S}from"./primary-OskAInOO.js";import{It as C}from"./composerDraftStore-CdJJZe42.js";import{n as ee,t as te}from"./visibilityPolling-BwzZdaSN.js";import{At as w}from"./authorization-mIJKV2yp.js";import{t as ne}from"./copy-UQjKGt7t.js";import{t as T}from"./qr-code-ScYULAuR.js";import{t as re}from"./refresh-cw-DopCMrtR.js";import{t as ie}from"./triangle-alert-RL_T3KLo.js";import{t as ae}from"./switch-BTGo9Yip.js";import{t as oe}from"./input-CHEwW3oH.js";import{t as E}from"./button-BAbJxRzt.js";import{t as se}from"./useCopyToClipboard-BTpWxumf.js";import{i as ce,r as le,t as ue}from"./alert-LqMhbdE9.js";import{a as de,c as fe,i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./dialog-DQsYchqu.js";import{a as ye,i as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./alert-dialog-DxoA6ky8.js";import{t as D}from"./badge-CXw6fWrB.js";import{i as O,n as Ee,r as k}from"./settingsLayout-D8glO7f1.js";import{a as A,i as j,n as M,o as N,s as P,t as F}from"./HostedRelayTrustNotice-eEOPKsBg.js";import{t as De}from"./qr-code-Bddq6K7S.js";var I=e(t(),1),L=n();function Oe(e){return e?`hosted`:`local`}function ke(e,t){return e===`local`?{headline:`Direct to a node on this machine`,body:`This window talks to a Ryco node running here, on this machine. No Ryco Hub sits between them and nothing you send leaves this machine on its way to the node.`}:{headline:t===null?`Through the Ryco Hub`:t.shortLabel,body:`This browser reaches a node through the Ryco Hub relay. What that channel is worth is stated with the channel itself, below.`}}function Ae(e){return e===`local`?{available:!0,unavailableBody:``}:{available:!1,unavailableBody:"Your node's client list, live sessions, admission policy, prekey and fallback counters are held on the node and read over its own local interface, which the relay does not carry. Open Ryco on that machine to see them, or run `ryco e2ee` there."}}function je(e){return e===`local`?{kind:`available`}:{kind:`blocked`,reason:"This one can only be changed from the node itself. It admits approved native client keys and closes browser and legacy access — including this browser, which is how you are reading this — so turning it on from here would end this session and leave no way back in through it. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node, where you can still reach it if the result is not what you wanted."}}var Me="This build cannot change whether the node admits only approved native client keys. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node.";function Ne(e,t){if(e===`hosted`&&t.requireApprovedClientE2EE!==void 0){let t=je(e);return{allowed:!1,refusal:t.kind===`blocked`?t.reason:Me}}return{allowed:!0,proposal:t}}function R(e){let t=e.split(w.separator);if(t.length!==w.groups)return[];for(let e of t){if(e.length!==w.digitsPerGroup)return[];for(let t of e)if(t<`0`||t>`9`)return[]}return t}var z=`${w.digits} digits, in ${w.groups} groups of ${w.digitsPerGroup}. The length and the grouping are the only check there is, so read all ${w.digits} in order.`,B=`Compare this with the number the device itself shows, on the device, before approving it. They match only for this key pair under this Hub account — the same device under a different account reads differently. Approve nothing whose number you have not read off the other screen yourself.`;function Pe(e){let t=R(e);return t.length===0?null:{groups:t,display:t.join(w.separator),caption:z,advisory:B}}var V=`No comparison number is readable for this record, so there is nothing here to check against the device.`;function Fe(e){return e===null?{available:!1,fingerprint:null,caption:"This node's identity fingerprint is shown here only while an enrollment is waiting for approval. At other times, read it from the node with `ryco hub status` on the machine running it."}:{available:!0,fingerprint:e,caption:`This node's identity fingerprint, from the enrollment now waiting for approval. Compare it character for character wherever you are asked to confirm this machine.`}}var H=`unknown`;function U(e){if(e===void 0)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?H:t.toLocaleString()}function Ie(e){return e===null?[{label:`Agreement prekey`,value:H}]:e.present?[{label:`Prekey`,value:e.prekeyId??H,mono:!0},{label:`Fingerprint`,value:e.fingerprint??H,mono:!0},{label:`Validity`,value:e.validity??H},{label:`Created`,value:U(e.createdAt)},{label:`Expires`,value:U(e.expiresAt)}]:[{label:`Agreement prekey`,value:`none held`}]}function Le(e){return e===null?null:e.present?e.remedy??null:`This node holds no agreement prekey for its Hub origin. It re-signs one at startup; rotate to issue one now.`}function Re(e){return e===null?[{label:`Continuity`,value:H}]:e.status===`unavailable`?[{label:`Continuity`,value:`unresolvable`},{label:`Reason`,value:e.reason??H}]:[{label:`Continuity`,value:`advertisable`},{label:`Lineage`,value:e.continuityId??H,mono:!0},{label:`Rotation generation`,value:String(e.generation??0)},{label:`Retained chain length`,value:String(e.chainLength??0)},...e.repair===void 0?[]:[{label:`Startup repair`,value:e.repair}],...e.lastBreakReason===void 0?[]:[{label:`Last break`,value:`${e.lastBreakReason} at ${U(e.lastBreakAt)}`}]]}function ze(e){return e?.remedy??null}function W(e){switch(e){case`pending`:return`warning`;case`approved`:return`success`;case`revoked`:return`error`}}function G(e){let t=e.displayLabel?.trim()??``;return t===``?`Client key …${e.fingerprint.slice(-8)}`:t}function K(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Hub origin`,value:e.hubOrigin},{label:`Account`,value:e.accountId},{label:`Maximum role`,value:e.maxRole===``?`none granted`:e.maxRole},{label:`Capabilities`,value:e.capabilitySet.length===0?`none`:e.capabilitySet.join(`, `)},{label:`Created`,value:U(e.createdAt)},...e.approvedAt===void 0?[]:[{label:`Approved`,value:U(e.approvedAt)}],...e.revokedAt===void 0?[]:[{label:`Revoked`,value:U(e.revokedAt)}],{label:`Last seen`,value:U(e.lastSeenAt)},...e.pairingReserved?[{label:`Pairing reservation`,value:`held`}]:[]]}function Be(e){if(e===null)return[];let t=[];return(e.pendingGlobalSaturated||e.saturatedAccounts.length>0)&&t.push(`Pending pairing is saturated, so a new device may not be able to introduce itself. Purge a pending record, or read the fingerprint off the device and open a pairing window naming it.`),e.refusedPairingAttempts>0&&t.push(`${e.refusedPairingAttempts} pairing attempt(s) were refused because the pending list was full. Clear the count once you have dealt with them, or later readings will be dominated by history.`),t}function Ve(e){if(e===null)return[{label:`Pairing window`,value:H}];let t=e.pairingWindow;return t===void 0?[{label:`Pairing window`,value:`closed`}]:[{label:`Pairing window`,value:`open`},{label:`Only this fingerprint`,value:t.fingerprint,mono:!0},{label:`Expires`,value:U(t.expiresAt)},{label:`Reservation`,value:t.spent?`spent`:`unspent`}]}function He(e){return e===null?`How many pairing attempts this node refused because the pending list was full has not been read here.`:`${e.refusedPairingAttempts} attempt(s) refused because the pending list was full.`}var Ue=`A window lets exactly one device introduce itself, and only the one whose fingerprint you name.`;function We(e){return[{label:`Tier`,value:e.tier===`native`?`native (IK)`:`browser (NX)`},{label:`Suite`,value:String(e.suite)},{label:`Established`,value:U(e.establishedAt)}]}var Ge=`Native sessions have no per-session code. Compare this device's long-term number on its record above instead.`,Ke=`Compare this code with the one that browser is showing for this session, on that screen. A match catches accidental wrong-node routing and some network interposition — anyone standing in for this node who is not also serving that browser its page — while the code that browser loaded is honest; it cannot protect against whoever served that page, and a match does not rule out someone sitting in the middle.`,qe=`No session code reached this listing for that channel, so there is nothing here to compare against the browser holding it.`;function Je(e){let t=j(e,`inline`);return t===null?null:{groups:t.groups,display:t.display,advisory:Ke,more:null}}var Ye=`A browser channel this node has open. Its per-session code is below.`;function Xe(e){return e===null?[{label:`Admission policy`,value:H}]:[{label:`requireE2EE`,value:String(e.requireE2EE),mono:!0},{label:`requireApprovedClientE2EE`,value:String(e.requireApprovedClientE2EE),mono:!0},{label:`Effective requireE2EE`,value:String(e.effectiveRequireE2EE),mono:!0},{label:`Admitted patterns`,value:e.admittedPatterns.join(`, `)||`none`},{label:`Suite registry`,value:e.suiteRegistry.join(`, `)||`none`},{label:`Policy generation`,value:String(e.generation)}]}function Ze(e,t,n){let r=[];t.requireApprovedClientE2EE===!0&&r.push(`requireApprovedClientE2EE closes browser and legacy access entirely. Only approved native client keys reach application payload after this, and losing every approved key strands remote access to this node until someone recovers it at the machine — which never relaxes admission policy.`);for(let e of Qe(t,n))r.push(e);return e.withdrawal&&r.push(`This narrows what the node admits, so it closes live channels. Roughly matching now: ${e.counts.legacy} legacy, ${e.counts.nxE2ee} browser, ${e.counts.suiteWithdrawn} on a withdrawn suite, and ${e.counts.abortedHandshakes} handshake(s) in flight. These move while you read them.`),e.changed||r.push(`This changes nothing: the node already admits exactly this.`),r.length===0&&r.push(q),r}function Qe(e,t){let n=[];return e.requireE2EE===!1&&t?.requireE2EE!==!1&&n.push(`Turning this off re-admits plaintext. The node goes back to accepting relay payload it has not encrypted, for browsers and for legacy clients, and the Hub carries that in a form it can read. It closes nothing now — what changes is what the node accepts next.`),e.requireApprovedClientE2EE===!1&&t?.requireApprovedClientE2EE!==!1&&n.push(`Clearing this re-admits the browser and legacy tiers. Client keys this node has not approved reach it again on their next connection, under whatever the remaining policy allows.`),n}var q=`The node reports that this closes no channel it has open now. That is a statement about the live channels and not about what the node will admit afterwards.`;function $e(e,t,n){return e.withdrawal||Qe(t,n).length>0}function et(e){return[e.changed?`Policy committed.`:`Policy unchanged.`,`Closed ${e.counts.legacy} legacy channel(s), ${e.counts.nxE2ee} browser channel(s), ${e.counts.suiteWithdrawn} suite-withdrawn channel(s); aborted ${e.counts.abortedHandshakes} handshake(s) in flight.`].join(` `)}var J=`This advances the policy generation past every value this node may already have advertised, and the jump is deliberate. Clients accept only a higher generation than the one they remember, so nothing below the new value can be advertised again. If a restore rolled the record back, recovery does not restore the old values: it commits the fail-closed policy, which admits only approved native client keys and so closes browser and legacy access entirely, including every remote browser session open now. There is no way to tell from here which of the two this will be. Widening it back is a separate, explicit policy change, and if this node's only remaining access was a browser it has to be made at the machine.`;function tt(e){if(e===null)return null;let t=e.peerLegacy.ringOverflows>0||e.advertisementUnavailable.ringOverflows>0;return{windowStarted:U(e.windowStartedAt),classes:[{label:`Peer spoke legacy`,meaning:`The other end did not take the encrypted channel, so this one carried readable payload.`,occurrences:e.peerLegacy.occurrences,lastOccurrence:U(e.peerLegacy.lastOccurrenceAt),ringOverflows:e.peerLegacy.ringOverflows},{label:`No advertisement`,meaning:`This node could not offer an encrypted channel, or the offer did not survive the path. It cannot tell which.`,occurrences:e.advertisementUnavailable.occurrences,lastOccurrence:U(e.advertisementUnavailable.lastOccurrenceAt),ringOverflows:e.advertisementUnavailable.ringOverflows}],entries:[...e.ring].toSorted((e,t)=>e.occurredAt-t.occurredAt).map((e,t)=>({ordinal:t,at:U(e.occurredAt),reason:e.reason})),overflowNotice:t?`The retained list overflowed, so it is an incomplete account of this window. The shape of what is left is not evidence in either direction.`:null,undersizedNotice:e.undersizedConnection===void 0?null:`This connection asserts a maximum chunk of ${e.undersizedConnection.assertedMaxDataChunkBytes} bytes, below the ${e.undersizedConnection.advertisementMinChunkBytes} bytes an offer needs. Nothing that fits can carry one, so this node offers nothing on this connection.`,quiet:e.peerLegacy.occurrences===0&&e.advertisementUnavailable.occurrences===0&&e.ring.length===0}}var nt=`Nothing has fallen back in this window. This counts what happened, not what could — a quiet window is not a statement about the next one.`,Y={approve:{title:`Approve this client key?`,body:`The device holding this key may then reach this node, up to the role and capabilities you grant here. Compare its number against the device first. It takes effect on its next connection, not on anything open now.`,confirmLabel:`Approve key`,destructive:!1},narrow:{title:`Reduce what this client may do?`,body:`Anything this device has open under the wider authority closes immediately — the node will not confirm the change until those channels are shut. The device reconnects with the smaller role ceiling. Its capability grant is left exactly as it is; only the ceiling drops, and changing the capabilities is a separate command on the node.`,confirmLabel:`Reduce authority`,destructive:!0},revoke:{title:`Revoke this client key?`,body:`The device loses access now: every channel it has open closes before this is confirmed, and it cannot reconnect until you approve it again. The record stays, so you can see it was revoked.`,confirmLabel:`Revoke key`,destructive:!0},purge:{title:`Delete this client record?`,body:`The same immediate disconnection as revoking, and the record goes with it — there will be nothing left showing this device was ever here. If it connects again it arrives as a stranger and pairs from scratch.`,confirmLabel:`Delete record`,destructive:!0},"open-window":{title:`Open a pairing window for this fingerprint?`,body:`For a short time this node will accept one introduction, and only from the key whose fingerprint you name. Read that fingerprint off the device itself — a window naming the wrong one lets the wrong device in.`,confirmLabel:`Open window`,destructive:!1},"close-window":{title:`Close the pairing window?`,body:`No new device can introduce itself until you open another. Anything already introduced keeps its record.`,confirmLabel:`Close window`,destructive:!1},"clear-refusals":{title:`Clear the refused-attempt count?`,body:`The count goes back to zero. Do this once you have dealt with what caused it, so the next reading is about the next thing rather than about history.`,confirmLabel:`Clear count`,destructive:!1},"rotate-prekey":{title:`Issue a new agreement prekey?`,body:`The node makes a fresh key pair and certificate immediately. Clients pick the new one up on their next connection; nothing already open is disturbed.`,confirmLabel:`Rotate prekey`,destructive:!1},"recover-policy":{title:`Advance the policy generation?`,body:J,confirmLabel:`Advance generation`,destructive:!0},"reset-fallback":{title:`Reset the fallback counters?`,body:`Both counts and the retained list go back to empty and a new observation window starts. What was recorded is gone; nothing else changes.`,confirmLabel:`Reset counters`,destructive:!1},"remint-continuity":{title:`Break continuity and mint a fresh lineage?`,body:`Every device that has paired with this node has to go through the whole pairing ceremony again, in person, before it can reconnect. Do this when you believe the lineage is wrong, not to tidy it up.`,confirmLabel:`Mint fresh lineage`,destructive:!0},"break-continuity":{title:`Break the continuity chain?`,body:`The lineage keeps its name, but every device that pinned this node has to go through the pairing ceremony again before it can reconnect.`,confirmLabel:`Break chain`,destructive:!0}};function rt(e){return Y[e]}var it=`It applies to the key below and to no other. Check the fingerprint against the device you meant: two devices paired under one account are told apart by nothing else here.`;function X(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Account`,value:e.accountId},{label:`Hub origin`,value:e.hubOrigin}]}function at(e,t){let n=Y[e];return{...n,body:`${n.body} ${it}`,facts:X(t)}}function ot(e){let t=Y[`open-window`];return{...t,body:`${t.body} Read the value below off the device now, before confirming.`,facts:[{label:`Only this fingerprint`,value:e,mono:!0}]}}var Z=[`viewer`,`operator`,`owner`],st={viewer:`read what is there`,operator:`edit files and run terminals`,owner:`also change credentials and server policy`},ct=[`ryco.rpc`];function lt(e,t){let n=Y.approve,r=ct.join(`, `);return{title:`Approve this client key as ${e}?`,body:`${n.body} At most it will be able to ${st[e]}. It is granted the one capability a relay channel carries, ${r} — a key approved with none is admitted by nothing and could not connect at all. `+`${t===void 0?``:it}`.trimEnd(),confirmLabel:`Approve as ${e}`,destructive:!1,...t===void 0?{}:{facts:X(t)}}}Object.keys(Y);var ut=`What this node will admit, and which client keys it has on file.`,dt=`Require an encrypted channel`,ft=`Refuse plaintext, including for browsers.`,pt=`Only approved native client keys`,mt=`Closes browser and legacy access entirely. Only approved native client keys reach application payload.`,ht=`Recover a generation that a restore rolled back.`,gt=`Its current value on the node has not been read here, so nothing on this row states what it is.`,_t=`No device has introduced itself to this node yet.`,vt=`Nothing is connected right now.`,Q=C(),yt=5e3,bt=6e4,xt={clients:null,sessions:null,policy:null,prekey:null,continuity:null,fallback:null,enrollmentFingerprint:null};function $(e){let t=(0,L.c)(4),{rows:n}=e,r;t[0]===n?r=t[1]:(r=n.map(St),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1.5 sm:grid-cols-[12rem_minmax(0,1fr)]`,children:r}),t[2]=r,t[3]=i),i}function St(e){return(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:e.mono?`min-w-0 font-mono text-[12px] break-all text-foreground`:`min-w-0 text-[12px] text-foreground`,children:e.value})]},e.label)}function Ct(e){let t=(0,L.c)(14),{value:n}=e,r;t[0]===n?r=t[1]:(r=Pe(n),t[0]=n,t[1]=r);let i=r;if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number`,"data-value":`absent`,className:`text-[11px] text-muted-foreground`,children:V}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Comparison number`}),t[3]=a):a=t[3];let o;t[4]===i.display?o=t[5]:(o=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number-value`,className:`font-mono text-[13px] leading-relaxed font-semibold tracking-[0.08em] select-all`,children:i.display}),t[4]=i.display,t[5]=o);let s;t[6]===i.caption?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.caption}),t[6]=i.caption,t[7]=s);let c;t[8]===i.advisory?c=t[9]:(c=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.advisory}),t[8]=i.advisory,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c?(l=(0,Q.jsxs)(`div`,{"data-testid":`node-safety-number`,"data-value":`present`,className:`space-y-1.5`,children:[a,o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function wt(e){let t=(0,L.c)(15),{view:n,unavailable:r,testId:i}=e;if(!n){let e;return t[0]!==i||t[1]!==r?(e=(0,Q.jsx)(`p`,{"data-testid":i,"data-code":`absent`,className:`text-[11px] text-muted-foreground`,children:r}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let a=`${i}-value`,o;t[3]!==a||t[4]!==n.display?(o=(0,Q.jsx)(`p`,{"data-testid":a,className:`font-mono text-sm leading-none font-semibold tracking-[0.2em] whitespace-nowrap select-all`,children:n.display}),t[3]=a,t[4]=n.display,t[5]=o):o=t[5];let s;t[6]===n.advisory?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.advisory}),t[6]=n.advisory,t[7]=s);let c;t[8]===n.more?c=t[9]:(c=n.more===null?null:(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.more}),t[8]=n.more,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==i?(l=(0,Q.jsxs)(`div`,{"data-testid":i,"data-code":`present`,className:`space-y-1.5`,children:[o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=i,t[14]=l):l=t[14],l}function Tt(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=j(n,`settings`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(wt,{view:r,unavailable:M,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Et(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=Je(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(wt,{view:r,unavailable:qe,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Dt(){let e=(0,L.c)(21),t=A(),n=N(),r=i(jt),a=i(At),o=i(kt),s=i(Ot),c,l;e[0]!==r||e[1]!==t||e[2]!==o||e[3]!==a||e[4]!==s?(c=P({browserStatus:r,sessionStatus:a,selectionStatus:o,transportStatus:s,e2eeStatus:t}),l=ke(`hosted`,c),e[0]=r,e[1]=t,e[2]=o,e[3]=a,e[4]=s,e[5]=c,e[6]=l):(c=e[5],l=e[6]);let u=l,d=c.guarantee===`e2ee`?`success`:c.guarantee===`web`?`info`:c.guarantee===`legacy`?`warning`:`outline`,f;e[7]!==c.shortLabel||e[8]!==d?(f=(0,Q.jsx)(D,{size:`sm`,variant:d,"data-testid":`node-connection-claim`,children:c.shortLabel}),e[7]=c.shortLabel,e[8]=d,e[9]=f):f=e[9];let p;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(F,{}),e[10]=p):p=e[10];let m;e[11]!==t||e[12]!==n?(m=t===`web-unsigned`?(0,Q.jsx)(Tt,{code:n}):null,e[11]=t,e[12]=n,e[13]=m):m=e[13];let h;e[14]===m?h=e[15]:(h=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[p,m]}),e[14]=m,e[15]=h);let g;return e[16]!==u.body||e[17]!==u.headline||e[18]!==f||e[19]!==h?(g=(0,Q.jsx)(O,{title:`This connection`,children:(0,Q.jsx)(k,{title:u.headline,description:u.body,status:f,children:h})}),e[16]=u.body,e[17]=u.headline,e[18]=f,e[19]=h,e[20]=g):g=e[20],g}function Ot(e){return e.transportStatus}function kt(e){return e.selectionStatus}function At(e){return e.sessionStatus}function jt(e){return e.browserStatus}function Mt(){let e=Oe(r()),t=Ae(e),n=je(e),[i,a]=(0,I.useState)(xt),[l,C]=(0,I.useState)(null),[w,T]=(0,I.useState)(!1),[ae,D]=(0,I.useState)(null),[A,j]=(0,I.useState)(null),[M,N]=(0,I.useState)(null),[P,F]=(0,I.useState)(null),[L,Me]=(0,I.useState)(``),R=(0,I.useRef)(!0),z=(0,I.useRef)(0),B=(0,I.useRef)(null),{copyToClipboard:Pe}=se();(0,I.useEffect)(()=>(R.current=!0,()=>{R.current=!1}),[]);let V=(0,I.useCallback)(async()=>{if(t.available)try{let[e,t,n,r,i,o]=await Promise.all([f(),d(),p(),x(),b(),S()]),s=await v().catch(()=>null);if(!R.current)return;z.current=0,a({clients:e,sessions:t,policy:n,prekey:r,continuity:i,fallback:o,enrollmentFingerprint:s?.fingerprint??null}),C(null)}catch(e){if(!R.current)return;z.current+=1,C(e instanceof Error?e.message:`Unable to read the node's security state.`)}},[t.available]);(0,I.useEffect)(()=>{if(!t.available)return;let e=te({lifecycle:ee,run:V,resolveDelayMs:()=>Math.min(yt*2**Math.max(0,z.current-1),bt),jitterRatio:.1});return B.current=e,()=>{B.current===e&&(B.current=null),e.stop()}},[t.available,V]);let H=(0,I.useCallback)(()=>B.current?.refresh()??V(),[V]),U=(0,I.useCallback)(async(e,t)=>{T(!0),C(null),D(null);try{let n=await e();R.current&&D(typeof n==`string`?n:t),await H()}catch(e){if(!R.current)return;C(e instanceof Error?e.message:`That didn't work.`)}finally{R.current&&T(!1)}},[H]),W=(0,I.useCallback)((e,t,n)=>{N({copy:rt(e),run:()=>U(t,n)})},[U]),G=(0,I.useCallback)((e,t,n)=>{N({copy:e,run:()=>U(t,n)})},[U]),K=(0,I.useCallback)(async t=>{let n=Ne(e,t);if(!n.allowed){C(n.refusal);return}T(!0),C(null),D(null);try{let e=await s(n.proposal);if(!R.current)return;j({proposal:n.proposal,warnings:Ze(e,n.proposal,i.policy),destructive:$e(e,n.proposal,i.policy)})}catch(e){if(!R.current)return;C(e instanceof Error?e.message:`Unable to preview that change.`)}finally{R.current&&T(!1)}},[e,i.policy]),Ke=(0,I.useCallback)(async()=>{if(A===null)return;let t=Ne(e,A.proposal);if(!t.allowed){C(t.refusal),j(null);return}let n=t.proposal;j(null),await U(async()=>et(await _(n)),`Policy applied.`)},[e,A,U]),qe=(0,I.useCallback)((e,t,n)=>{let r={fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin};G(at(t,r),()=>y(e),n)},[G]),Je=(0,I.useCallback)((e,t)=>{N({copy:lt(t,{fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin}),run:()=>U(async()=>{await y(e);try{let n=await g({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});return R.current&&F({approval:n,label:e.fingerprint}),`Client approved as ${t}. Scan the code on the new device.`}catch{return`Client approved as ${t}. The QR code was not created; use Show phone QR to retry.`}},`Client approved as ${t}.`)})},[U]),Qe=(0,I.useCallback)(async e=>{T(!0),C(null);try{let t=await g({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});R.current&&F({approval:t,label:e.displayLabel??e.fingerprint})}catch(e){R.current&&C(e instanceof Error?e.message:`Unable to create the phone QR code.`)}finally{R.current&&T(!1)}},[]),q=Fe(i.enrollmentFingerprint),J=(0,I.useMemo)(()=>tt(i.fallback),[i.fallback]),Y=Be(i.clients),it=Le(i.prekey),X=ze(i.continuity),Z=M?.copy??null,st=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;return(0,Q.jsxs)(Ee,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Security`}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:ut})]}),t.available?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:w,onClick:()=>void H(),children:[(0,Q.jsx)(re,{className:`size-3.5`}),`Refresh`]}):null]}),l===null?null:(0,Q.jsxs)(ue,{variant:`error`,children:[(0,Q.jsx)(ie,{}),(0,Q.jsx)(ce,{children:`That didn't work`}),(0,Q.jsx)(le,{children:l})]}),ae?(0,Q.jsxs)(ue,{variant:`info`,children:[(0,Q.jsx)(ce,{children:`Done`}),(0,Q.jsx)(le,{children:ae})]}):null,e===`hosted`?(0,Q.jsx)(Dt,{}):null,t.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(O,{title:`This node's identity`,children:[(0,Q.jsx)(k,{title:`Enrollment fingerprint`,description:q.caption,control:q.fingerprint!==null&&st?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,onClick:()=>Pe(q.fingerprint),children:[(0,Q.jsx)(ne,{className:`size-3.5`}),`Copy`]}):null,children:q.fingerprint===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-enrollment-fingerprint`,className:`pb-3.5 font-mono text-[13px] break-all select-all`,children:q.fingerprint})}),(0,Q.jsx)(k,{title:`Agreement prekey`,description:it??`The key this node offers for new channels.`,control:(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w,onClick:()=>W(`rotate-prekey`,c,`Prekey rotated.`),children:`Rotate`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Ie(i.prekey)})})}),(0,Q.jsx)(k,{title:`Continuity`,description:X??`The lineage paired clients remember this node by.`,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`break-continuity`,()=>m({action:`break`}),`Continuity chain broken.`),children:`Break chain`}),(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`remint-continuity`,()=>m({action:`remint`}),`Fresh lineage minted.`),children:`Mint fresh`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Re(i.continuity)})})})]}),(0,Q.jsxs)(O,{title:`Authorized clients`,children:[Y.map(e=>(0,Q.jsx)(k,{title:`Pairing`,description:e},e)),(0,Q.jsx)(k,{title:`Pairing window`,description:Ue,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(oe,{value:L,disabled:w,placeholder:`SHA256:…`,"aria-label":`Pairing window fingerprint`,className:`w-56 font-mono text-xs`,onChange:e=>Me(e.currentTarget.value)}),(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||L.trim()===``,onClick:()=>G(ot(L.trim()),()=>u({action:`open`,fingerprint:L.trim()}),`Pairing window opened.`),children:`Open`}),(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||i.clients?.pairingWindow===void 0,onClick:()=>W(`close-window`,()=>u({action:`close`}),`Pairing window closed.`),children:`Close`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Ve(i.clients)})})}),(0,Q.jsx)(k,{title:`Refused attempts`,description:He(i.clients),control:(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||(i.clients?.refusedPairingAttempts??0)===0,onClick:()=>W(`clear-refusals`,h,`Refusal count cleared.`),children:`Clear`})}),(i.clients?.records??[]).map(e=>(0,Q.jsx)(Lt,{record:e,busy:w,onAuthorize:qe,onApprove:Je,onShowApprovalQr:Qe},`${e.hubOrigin}\u0000${e.accountId}\u0000${e.fingerprint}`)),i.clients!==null&&i.clients.records.length===0?(0,Q.jsx)(k,{title:`No client keys on file`,description:_t}):null]}),(0,Q.jsxs)(O,{title:`Live sessions`,children:[(i.sessions?.sessions??[]).map(e=>(0,Q.jsx)(k,{title:`Session ${e.sessionIndex}`,description:e.tier===`native`?Ge:Ye,children:(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[(0,Q.jsx)($,{rows:We(e)}),e.tier===`web`?(0,Q.jsx)(Et,{code:e.verificationCode??null}):null]})},e.sessionIndex)),i.sessions!==null&&i.sessions.sessions.length===0?(0,Q.jsx)(k,{title:`No sessions`,description:vt}):null]}),(0,Q.jsxs)(O,{title:`Admission policy`,children:[(0,Q.jsx)(Ft,{title:dt,description:ft,checked:i.policy===null?null:i.policy.requireE2EE,busy:w,ariaLabel:`Require E2EE`,testId:`require-e2ee`,onChange:e=>void K({requireE2EE:e})}),(0,Q.jsx)(Pt,{disposition:n,checked:i.policy===null?null:i.policy.requireApprovedClientE2EE,busy:w,onChange:e=>void K({requireApprovedClientE2EE:e})}),(0,Q.jsx)(k,{title:`Policy generation`,description:ht,control:(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`recover-policy`,o,`Policy generation advanced.`),children:`Advance`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Xe(i.policy)})})})]}),(0,Q.jsx)(O,{title:`Fallback`,children:J===null?(0,Q.jsx)(k,{title:`Fallback`,description:`Waiting for the node.`}):J.quiet?(0,Q.jsx)(k,{title:`Nothing has fallen back`,description:nt,control:(0,Q.jsx)(It,{busy:w,onConfirm:W})}):(0,Q.jsxs)(Q.Fragment,{children:[J.classes.map(e=>(0,Q.jsx)(k,{title:e.label,description:e.meaning,status:`Last ${e.lastOccurrence}${e.ringOverflows>0?` · ${e.ringOverflows} overflow(s)`:``}`,control:(0,Q.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.occurrences})},e.label)),(0,Q.jsx)(k,{title:`Retained occurrences`,description:J.overflowNotice??`Observation window started ${J.windowStarted}.`,control:(0,Q.jsx)(It,{busy:w,onConfirm:W}),children:(0,Q.jsx)(`ul`,{className:`space-y-1 pb-3.5`,children:J.entries.map(e=>(0,Q.jsxs)(`li`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.at,` · `,e.reason]},e.ordinal))})}),J.undersizedNotice?(0,Q.jsx)(k,{title:`Undersized connection`,description:J.undersizedNotice}):null]})})]}):(0,Q.jsxs)(O,{title:`This node`,children:[(0,Q.jsx)(k,{title:ke(e,null).headline,description:t.unavailableBody}),(0,Q.jsx)(Pt,{disposition:n,checked:null,busy:w,onChange:e=>void K({requireApprovedClientE2EE:e})})]}),(0,Q.jsx)(Te,{open:A!==null,onOpenChange:e=>!e&&j(null),children:(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(we,{children:`Apply this policy change?`}),(0,Q.jsx)(Ce,{children:A?.warnings.map(e=>(0,Q.jsx)(`span`,{className:`block pb-2`,children:e},e))})]}),(0,Q.jsxs)(be,{children:[(0,Q.jsx)(xe,{children:`Leave it`}),(0,Q.jsx)(E,{variant:A?.destructive?`destructive`:`default`,"data-testid":`policy-apply`,disabled:w,onClick:()=>void Ke(),children:`Apply`})]})]})}),(0,Q.jsx)(Te,{open:M!==null,onOpenChange:e=>!e&&N(null),children:(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(we,{children:Z?.title}),(0,Q.jsx)(Ce,{children:Z?.body})]}),Z?.facts?(0,Q.jsx)(`div`,{"data-testid":`node-confirmation-facts`,className:`pb-1`,children:(0,Q.jsx)($,{rows:Z.facts})}):null,(0,Q.jsxs)(be,{children:[(0,Q.jsx)(xe,{children:`Cancel`}),(0,Q.jsx)(E,{variant:Z?.destructive?`destructive`:`default`,"data-testid":`node-confirmation-confirm`,disabled:w,onClick:()=>{let e=M;N(null),e&&e.run()},children:Z?.confirmLabel})]})]})}),(0,Q.jsx)(ve,{open:P!==null,onOpenChange:e=>!e&&F(null),children:(0,Q.jsxs)(_e,{className:`max-w-sm`,children:[(0,Q.jsxs)(de,{children:[(0,Q.jsx)(fe,{children:`Verify this phone`}),(0,Q.jsx)(ge,{children:`On the new phone, open node verification and scan this code. It is bound to that phone's key and expires after five minutes.`})]}),(0,Q.jsxs)(he,{className:`space-y-4`,children:[P?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`rounded-2xl bg-white p-3`,children:(0,Q.jsx)(De,{value:P.approval.payload,size:240,level:`M`,marginSize:2,title:`Node approval — scan with Ryco on the new phone`})}),(0,Q.jsx)(`p`,{className:`max-w-full break-all text-center font-mono text-[11px] text-muted-foreground`,children:P.label})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`The code contains no secret and grants no access by itself. Ryco will reconnect and prove both device keys after the scan.`})]}),(0,Q.jsx)(pe,{variant:`bare`,children:(0,Q.jsx)(me,{render:(0,Q.jsx)(E,{variant:`outline`}),children:`Done`})})]})})]})}function Nt(){let e=(0,L.c)(7),t=a();if(t&&!t.primary){let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(ie,{}),e[0]=n):n=e[0];let r;e[1]===t.nodeLabel?r=e[2]:(r=(0,Q.jsxs)(ce,{children:[`Open Security on `,t.nodeLabel]}),e[1]=t.nodeLabel,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(le,{children:`Security administration requires that node's direct local operator channel. Ryco has disabled these controls here so an action can never be applied to this Mac by mistake.`}),e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a=(0,Q.jsx)(Ee,{children:(0,Q.jsxs)(ue,{variant:`warning`,children:[n,r,i]})}),e[4]=r,e[5]=a),a}let n;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Mt,{}),e[6]=n):n=e[6],n}function Pt(e){let t=(0,L.c)(6),{disposition:n,checked:r,busy:i,onChange:a}=e,o=n.kind===`blocked`,s=n.kind===`blocked`?n.reason:mt,c;return t[0]!==o||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==s?(c=(0,Q.jsx)(Ft,{title:pt,description:s,checked:r,busy:i,blocked:o,ariaLabel:`Require approved client E2EE`,testId:`require-approved-client-e2ee`,onChange:a}),t[0]=o,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c):c=t[5],c}function Ft(e){let t=(0,L.c)(11),{title:n,description:r,checked:i,busy:a,blocked:o,ariaLabel:s,testId:c,onChange:l}=e,u=o!==void 0&&o,d=i===null?`${r} ${gt}`:r,f;t[0]!==s||t[1]!==u||t[2]!==a||t[3]!==i||t[4]!==l||t[5]!==c?(f=i===null?(0,Q.jsx)(`span`,{"data-testid":c,"data-policy":`unknown`,"data-blocked":u?`hosted`:void 0,className:`text-[11px] text-muted-foreground`,children:`unknown`}):(0,Q.jsx)(ae,{checked:i,disabled:u||a,"aria-label":s,"data-testid":c,"data-policy":String(i),"data-blocked":u?`hosted`:void 0,onCheckedChange:l}),t[0]=s,t[1]=u,t[2]=a,t[3]=i,t[4]=l,t[5]=c,t[6]=f):f=t[6];let p;return t[7]!==d||t[8]!==f||t[9]!==n?(p=(0,Q.jsx)(k,{title:n,description:d,control:f}),t[7]=d,t[8]=f,t[9]=n,t[10]=p):p=t[10],p}function It(e){let t=(0,L.c)(5),{busy:n,onConfirm:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`reset-fallback`,l,`Fallback counters reset.`),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:n,onClick:i,children:`Reset`}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function Lt(e){let t=(0,L.c)(60),{record:n,busy:r,onAuthorize:i,onApprove:a,onShowApprovalQr:o}=e,s,c,l,u,d;if(t[0]!==r||t[1]!==a||t[2]!==n){c={hubOrigin:n.hubOrigin,accountId:n.accountId,fingerprint:n.fingerprint};let e;t[8]===n.status?e=t[9]:(e=W(n.status),t[8]=n.status,t[9]=e);let i=e;s=k;let o;t[10]===n?o=t[11]:(o=G(n),t[10]=n,t[11]=o);let f=i===`success`?`success`:i,p;t[12]!==n.status||t[13]!==f?(p=(0,Q.jsx)(D,{size:`sm`,variant:f,children:n.status}),t[12]=n.status,t[13]=f,t[14]=p):p=t[14],t[15]!==o||t[16]!==p?(u=(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o,p]}),t[15]=o,t[16]=p,t[17]=u):u=t[17],d=`${n.accountId} at ${n.hubOrigin}`,l=n.status===`approved`?null:Z.map(e=>(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>a({...c,action:`approve`,maxRole:e,capabilitySet:ct},e),children:[`Approve as `,e]},e)),t[0]=r,t[1]=a,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7];let f;t[18]!==r||t[19]!==c||t[20]!==i||t[21]!==n.maxRole||t[22]!==n.status?(f=n.status===`approved`&&n.maxRole!==`viewer`?(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`narrow`,maxRole:`viewer`},`narrow`,`Authority reduced.`),children:`Reduce to viewer`}):null,t[18]=r,t[19]=c,t[20]=i,t[21]=n.maxRole,t[22]=n.status,t[23]=f):f=t[23];let p;t[24]!==r||t[25]!==o||t[26]!==n?(p=n.status===`approved`?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(n),children:[(0,Q.jsx)(T,{className:`size-3.5`}),`Show phone QR`]}):null,t[24]=r,t[25]=o,t[26]=n,t[27]=p):p=t[27];let m;t[28]!==r||t[29]!==c||t[30]!==i||t[31]!==n.status?(m=n.status===`revoked`?null:(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`revoke`},`revoke`,`Client revoked.`),children:`Revoke`}),t[28]=r,t[29]=c,t[30]=i,t[31]=n.status,t[32]=m):m=t[32];let h;t[33]!==c||t[34]!==i?(h=()=>i({...c,action:`purge`},`purge`,`Record deleted.`),t[33]=c,t[34]=i,t[35]=h):h=t[35];let g;t[36]!==r||t[37]!==h?(g=(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:h,children:`Delete`}),t[36]=r,t[37]=h,t[38]=g):g=t[38];let _;t[39]!==l||t[40]!==f||t[41]!==p||t[42]!==m||t[43]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[l,f,p,m,g]}),t[39]=l,t[40]=f,t[41]=p,t[42]=m,t[43]=g,t[44]=_):_=t[44];let v;t[45]===n?v=t[46]:(v=K(n),t[45]=n,t[46]=v);let y;t[47]===v?y=t[48]:(y=(0,Q.jsx)($,{rows:v}),t[47]=v,t[48]=y);let b;t[49]===n.safetyNumber?b=t[50]:(b=(0,Q.jsx)(Ct,{value:n.safetyNumber}),t[49]=n.safetyNumber,t[50]=b);let x;t[51]!==y||t[52]!==b?(x=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[y,b]}),t[51]=y,t[52]=b,t[53]=x):x=t[53];let S;return t[54]!==s||t[55]!==x||t[56]!==u||t[57]!==d||t[58]!==_?(S=(0,Q.jsx)(s,{title:u,description:d,control:_,children:x}),t[54]=s,t[55]=x,t[56]=u,t[57]=d,t[58]=_,t[59]=S):S=t[59],S}export{Nt as NodeSecuritySettings};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{n as r}from"./env-B4arEvJg.js";import{N as i,Xn as a}from"./runtime-CXut_g4p.js";import{D as o,E as s,N as c,O as l,P as u,S as d,_ as f,b as p,c as m,d as h,f as g,l as _,m as v,s as y,v as b,x,y as S}from"./primary-BzLEg2w1.js";import{It as C}from"./composerDraftStore-CdJJZe42.js";import{n as ee,t as te}from"./visibilityPolling-BwzZdaSN.js";import{At as w}from"./authorization-mIJKV2yp.js";import{t as ne}from"./copy-UQjKGt7t.js";import{t as T}from"./qr-code-ScYULAuR.js";import{t as re}from"./refresh-cw-DopCMrtR.js";import{t as ie}from"./triangle-alert-RL_T3KLo.js";import{t as ae}from"./switch-BTGo9Yip.js";import{t as oe}from"./input-CHEwW3oH.js";import{t as E}from"./button-BAbJxRzt.js";import{t as se}from"./useCopyToClipboard-BTpWxumf.js";import{i as ce,r as le,t as ue}from"./alert-LqMhbdE9.js";import{a as de,c as fe,i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./dialog-DQsYchqu.js";import{a as ye,i as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./alert-dialog-DxoA6ky8.js";import{t as D}from"./badge-CXw6fWrB.js";import{i as O,n as Ee,r as k}from"./settingsLayout-D8glO7f1.js";import{a as A,i as j,n as M,o as N,s as P,t as F}from"./HostedRelayTrustNotice-BldMySVi.js";import{t as De}from"./qr-code-Bddq6K7S.js";var I=e(t(),1),L=n();function Oe(e){return e?`hosted`:`local`}function ke(e,t){return e===`local`?{headline:`Direct to a node on this machine`,body:`This window talks to a Ryco node running here, on this machine. No Ryco Hub sits between them and nothing you send leaves this machine on its way to the node.`}:{headline:t===null?`Through the Ryco Hub`:t.shortLabel,body:`This browser reaches a node through the Ryco Hub relay. What that channel is worth is stated with the channel itself, below.`}}function Ae(e){return e===`local`?{available:!0,unavailableBody:``}:{available:!1,unavailableBody:"Your node's client list, live sessions, admission policy, prekey and fallback counters are held on the node and read over its own local interface, which the relay does not carry. Open Ryco on that machine to see them, or run `ryco e2ee` there."}}function je(e){return e===`local`?{kind:`available`}:{kind:`blocked`,reason:"This one can only be changed from the node itself. It admits approved native client keys and closes browser and legacy access — including this browser, which is how you are reading this — so turning it on from here would end this session and leave no way back in through it. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node, where you can still reach it if the result is not what you wanted."}}var Me="This build cannot change whether the node admits only approved native client keys. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node.";function Ne(e,t){if(e===`hosted`&&t.requireApprovedClientE2EE!==void 0){let t=je(e);return{allowed:!1,refusal:t.kind===`blocked`?t.reason:Me}}return{allowed:!0,proposal:t}}function R(e){let t=e.split(w.separator);if(t.length!==w.groups)return[];for(let e of t){if(e.length!==w.digitsPerGroup)return[];for(let t of e)if(t<`0`||t>`9`)return[]}return t}var z=`${w.digits} digits, in ${w.groups} groups of ${w.digitsPerGroup}. The length and the grouping are the only check there is, so read all ${w.digits} in order.`,B=`Compare this with the number the device itself shows, on the device, before approving it. They match only for this key pair under this Hub account — the same device under a different account reads differently. Approve nothing whose number you have not read off the other screen yourself.`;function Pe(e){let t=R(e);return t.length===0?null:{groups:t,display:t.join(w.separator),caption:z,advisory:B}}var V=`No comparison number is readable for this record, so there is nothing here to check against the device.`;function Fe(e){return e===null?{available:!1,fingerprint:null,caption:"This node's identity fingerprint is shown here only while an enrollment is waiting for approval. At other times, read it from the node with `ryco hub status` on the machine running it."}:{available:!0,fingerprint:e,caption:`This node's identity fingerprint, from the enrollment now waiting for approval. Compare it character for character wherever you are asked to confirm this machine.`}}var H=`unknown`;function U(e){if(e===void 0)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?H:t.toLocaleString()}function Ie(e){return e===null?[{label:`Agreement prekey`,value:H}]:e.present?[{label:`Prekey`,value:e.prekeyId??H,mono:!0},{label:`Fingerprint`,value:e.fingerprint??H,mono:!0},{label:`Validity`,value:e.validity??H},{label:`Created`,value:U(e.createdAt)},{label:`Expires`,value:U(e.expiresAt)}]:[{label:`Agreement prekey`,value:`none held`}]}function Le(e){return e===null?null:e.present?e.remedy??null:`This node holds no agreement prekey for its Hub origin. It re-signs one at startup; rotate to issue one now.`}function Re(e){return e===null?[{label:`Continuity`,value:H}]:e.status===`unavailable`?[{label:`Continuity`,value:`unresolvable`},{label:`Reason`,value:e.reason??H}]:[{label:`Continuity`,value:`advertisable`},{label:`Lineage`,value:e.continuityId??H,mono:!0},{label:`Rotation generation`,value:String(e.generation??0)},{label:`Retained chain length`,value:String(e.chainLength??0)},...e.repair===void 0?[]:[{label:`Startup repair`,value:e.repair}],...e.lastBreakReason===void 0?[]:[{label:`Last break`,value:`${e.lastBreakReason} at ${U(e.lastBreakAt)}`}]]}function ze(e){return e?.remedy??null}function W(e){switch(e){case`pending`:return`warning`;case`approved`:return`success`;case`revoked`:return`error`}}function G(e){let t=e.displayLabel?.trim()??``;return t===``?`Client key …${e.fingerprint.slice(-8)}`:t}function K(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Hub origin`,value:e.hubOrigin},{label:`Account`,value:e.accountId},{label:`Maximum role`,value:e.maxRole===``?`none granted`:e.maxRole},{label:`Capabilities`,value:e.capabilitySet.length===0?`none`:e.capabilitySet.join(`, `)},{label:`Created`,value:U(e.createdAt)},...e.approvedAt===void 0?[]:[{label:`Approved`,value:U(e.approvedAt)}],...e.revokedAt===void 0?[]:[{label:`Revoked`,value:U(e.revokedAt)}],{label:`Last seen`,value:U(e.lastSeenAt)},...e.pairingReserved?[{label:`Pairing reservation`,value:`held`}]:[]]}function Be(e){if(e===null)return[];let t=[];return(e.pendingGlobalSaturated||e.saturatedAccounts.length>0)&&t.push(`Pending pairing is saturated, so a new device may not be able to introduce itself. Purge a pending record, or read the fingerprint off the device and open a pairing window naming it.`),e.refusedPairingAttempts>0&&t.push(`${e.refusedPairingAttempts} pairing attempt(s) were refused because the pending list was full. Clear the count once you have dealt with them, or later readings will be dominated by history.`),t}function Ve(e){if(e===null)return[{label:`Pairing window`,value:H}];let t=e.pairingWindow;return t===void 0?[{label:`Pairing window`,value:`closed`}]:[{label:`Pairing window`,value:`open`},{label:`Only this fingerprint`,value:t.fingerprint,mono:!0},{label:`Expires`,value:U(t.expiresAt)},{label:`Reservation`,value:t.spent?`spent`:`unspent`}]}function He(e){return e===null?`How many pairing attempts this node refused because the pending list was full has not been read here.`:`${e.refusedPairingAttempts} attempt(s) refused because the pending list was full.`}var Ue=`A window lets exactly one device introduce itself, and only the one whose fingerprint you name.`;function We(e){return[{label:`Tier`,value:e.tier===`native`?`native (IK)`:`browser (NX)`},{label:`Suite`,value:String(e.suite)},{label:`Established`,value:U(e.establishedAt)}]}var Ge=`Native sessions have no per-session code. Compare this device's long-term number on its record above instead.`,Ke=`Compare this code with the one that browser is showing for this session, on that screen. A match catches accidental wrong-node routing and some network interposition — anyone standing in for this node who is not also serving that browser its page — while the code that browser loaded is honest; it cannot protect against whoever served that page, and a match does not rule out someone sitting in the middle.`,qe=`No session code reached this listing for that channel, so there is nothing here to compare against the browser holding it.`;function Je(e){let t=j(e,`inline`);return t===null?null:{groups:t.groups,display:t.display,advisory:Ke,more:null}}var Ye=`A browser channel this node has open. Its per-session code is below.`;function Xe(e){return e===null?[{label:`Admission policy`,value:H}]:[{label:`requireE2EE`,value:String(e.requireE2EE),mono:!0},{label:`requireApprovedClientE2EE`,value:String(e.requireApprovedClientE2EE),mono:!0},{label:`Effective requireE2EE`,value:String(e.effectiveRequireE2EE),mono:!0},{label:`Admitted patterns`,value:e.admittedPatterns.join(`, `)||`none`},{label:`Suite registry`,value:e.suiteRegistry.join(`, `)||`none`},{label:`Policy generation`,value:String(e.generation)}]}function Ze(e,t,n){let r=[];t.requireApprovedClientE2EE===!0&&r.push(`requireApprovedClientE2EE closes browser and legacy access entirely. Only approved native client keys reach application payload after this, and losing every approved key strands remote access to this node until someone recovers it at the machine — which never relaxes admission policy.`);for(let e of Qe(t,n))r.push(e);return e.withdrawal&&r.push(`This narrows what the node admits, so it closes live channels. Roughly matching now: ${e.counts.legacy} legacy, ${e.counts.nxE2ee} browser, ${e.counts.suiteWithdrawn} on a withdrawn suite, and ${e.counts.abortedHandshakes} handshake(s) in flight. These move while you read them.`),e.changed||r.push(`This changes nothing: the node already admits exactly this.`),r.length===0&&r.push(q),r}function Qe(e,t){let n=[];return e.requireE2EE===!1&&t?.requireE2EE!==!1&&n.push(`Turning this off re-admits plaintext. The node goes back to accepting relay payload it has not encrypted, for browsers and for legacy clients, and the Hub carries that in a form it can read. It closes nothing now — what changes is what the node accepts next.`),e.requireApprovedClientE2EE===!1&&t?.requireApprovedClientE2EE!==!1&&n.push(`Clearing this re-admits the browser and legacy tiers. Client keys this node has not approved reach it again on their next connection, under whatever the remaining policy allows.`),n}var q=`The node reports that this closes no channel it has open now. That is a statement about the live channels and not about what the node will admit afterwards.`;function $e(e,t,n){return e.withdrawal||Qe(t,n).length>0}function et(e){return[e.changed?`Policy committed.`:`Policy unchanged.`,`Closed ${e.counts.legacy} legacy channel(s), ${e.counts.nxE2ee} browser channel(s), ${e.counts.suiteWithdrawn} suite-withdrawn channel(s); aborted ${e.counts.abortedHandshakes} handshake(s) in flight.`].join(` `)}var J=`This advances the policy generation past every value this node may already have advertised, and the jump is deliberate. Clients accept only a higher generation than the one they remember, so nothing below the new value can be advertised again. If a restore rolled the record back, recovery does not restore the old values: it commits the fail-closed policy, which admits only approved native client keys and so closes browser and legacy access entirely, including every remote browser session open now. There is no way to tell from here which of the two this will be. Widening it back is a separate, explicit policy change, and if this node's only remaining access was a browser it has to be made at the machine.`;function tt(e){if(e===null)return null;let t=e.peerLegacy.ringOverflows>0||e.advertisementUnavailable.ringOverflows>0;return{windowStarted:U(e.windowStartedAt),classes:[{label:`Peer spoke legacy`,meaning:`The other end did not take the encrypted channel, so this one carried readable payload.`,occurrences:e.peerLegacy.occurrences,lastOccurrence:U(e.peerLegacy.lastOccurrenceAt),ringOverflows:e.peerLegacy.ringOverflows},{label:`No advertisement`,meaning:`This node could not offer an encrypted channel, or the offer did not survive the path. It cannot tell which.`,occurrences:e.advertisementUnavailable.occurrences,lastOccurrence:U(e.advertisementUnavailable.lastOccurrenceAt),ringOverflows:e.advertisementUnavailable.ringOverflows}],entries:[...e.ring].toSorted((e,t)=>e.occurredAt-t.occurredAt).map((e,t)=>({ordinal:t,at:U(e.occurredAt),reason:e.reason})),overflowNotice:t?`The retained list overflowed, so it is an incomplete account of this window. The shape of what is left is not evidence in either direction.`:null,undersizedNotice:e.undersizedConnection===void 0?null:`This connection asserts a maximum chunk of ${e.undersizedConnection.assertedMaxDataChunkBytes} bytes, below the ${e.undersizedConnection.advertisementMinChunkBytes} bytes an offer needs. Nothing that fits can carry one, so this node offers nothing on this connection.`,quiet:e.peerLegacy.occurrences===0&&e.advertisementUnavailable.occurrences===0&&e.ring.length===0}}var nt=`Nothing has fallen back in this window. This counts what happened, not what could — a quiet window is not a statement about the next one.`,Y={approve:{title:`Approve this client key?`,body:`The device holding this key may then reach this node, up to the role and capabilities you grant here. Compare its number against the device first. It takes effect on its next connection, not on anything open now.`,confirmLabel:`Approve key`,destructive:!1},narrow:{title:`Reduce what this client may do?`,body:`Anything this device has open under the wider authority closes immediately — the node will not confirm the change until those channels are shut. The device reconnects with the smaller role ceiling. Its capability grant is left exactly as it is; only the ceiling drops, and changing the capabilities is a separate command on the node.`,confirmLabel:`Reduce authority`,destructive:!0},revoke:{title:`Revoke this client key?`,body:`The device loses access now: every channel it has open closes before this is confirmed, and it cannot reconnect until you approve it again. The record stays, so you can see it was revoked.`,confirmLabel:`Revoke key`,destructive:!0},purge:{title:`Delete this client record?`,body:`The same immediate disconnection as revoking, and the record goes with it — there will be nothing left showing this device was ever here. If it connects again it arrives as a stranger and pairs from scratch.`,confirmLabel:`Delete record`,destructive:!0},"open-window":{title:`Open a pairing window for this fingerprint?`,body:`For a short time this node will accept one introduction, and only from the key whose fingerprint you name. Read that fingerprint off the device itself — a window naming the wrong one lets the wrong device in.`,confirmLabel:`Open window`,destructive:!1},"close-window":{title:`Close the pairing window?`,body:`No new device can introduce itself until you open another. Anything already introduced keeps its record.`,confirmLabel:`Close window`,destructive:!1},"clear-refusals":{title:`Clear the refused-attempt count?`,body:`The count goes back to zero. Do this once you have dealt with what caused it, so the next reading is about the next thing rather than about history.`,confirmLabel:`Clear count`,destructive:!1},"rotate-prekey":{title:`Issue a new agreement prekey?`,body:`The node makes a fresh key pair and certificate immediately. Clients pick the new one up on their next connection; nothing already open is disturbed.`,confirmLabel:`Rotate prekey`,destructive:!1},"recover-policy":{title:`Advance the policy generation?`,body:J,confirmLabel:`Advance generation`,destructive:!0},"reset-fallback":{title:`Reset the fallback counters?`,body:`Both counts and the retained list go back to empty and a new observation window starts. What was recorded is gone; nothing else changes.`,confirmLabel:`Reset counters`,destructive:!1},"remint-continuity":{title:`Break continuity and mint a fresh lineage?`,body:`Every device that has paired with this node has to go through the whole pairing ceremony again, in person, before it can reconnect. Do this when you believe the lineage is wrong, not to tidy it up.`,confirmLabel:`Mint fresh lineage`,destructive:!0},"break-continuity":{title:`Break the continuity chain?`,body:`The lineage keeps its name, but every device that pinned this node has to go through the pairing ceremony again before it can reconnect.`,confirmLabel:`Break chain`,destructive:!0}};function rt(e){return Y[e]}var it=`It applies to the key below and to no other. Check the fingerprint against the device you meant: two devices paired under one account are told apart by nothing else here.`;function X(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Account`,value:e.accountId},{label:`Hub origin`,value:e.hubOrigin}]}function at(e,t){let n=Y[e];return{...n,body:`${n.body} ${it}`,facts:X(t)}}function ot(e){let t=Y[`open-window`];return{...t,body:`${t.body} Read the value below off the device now, before confirming.`,facts:[{label:`Only this fingerprint`,value:e,mono:!0}]}}var Z=[`viewer`,`operator`,`owner`],st={viewer:`read what is there`,operator:`edit files and run terminals`,owner:`also change credentials and server policy`},ct=[`ryco.rpc`];function lt(e,t){let n=Y.approve,r=ct.join(`, `);return{title:`Approve this client key as ${e}?`,body:`${n.body} At most it will be able to ${st[e]}. It is granted the one capability a relay channel carries, ${r} — a key approved with none is admitted by nothing and could not connect at all. `+`${t===void 0?``:it}`.trimEnd(),confirmLabel:`Approve as ${e}`,destructive:!1,...t===void 0?{}:{facts:X(t)}}}Object.keys(Y);var ut=`What this node will admit, and which client keys it has on file.`,dt=`Require an encrypted channel`,ft=`Refuse plaintext, including for browsers.`,pt=`Only approved native client keys`,mt=`Closes browser and legacy access entirely. Only approved native client keys reach application payload.`,ht=`Recover a generation that a restore rolled back.`,gt=`Its current value on the node has not been read here, so nothing on this row states what it is.`,_t=`No device has introduced itself to this node yet.`,vt=`Nothing is connected right now.`,Q=C(),yt=5e3,bt=6e4,xt={clients:null,sessions:null,policy:null,prekey:null,continuity:null,fallback:null,enrollmentFingerprint:null};function $(e){let t=(0,L.c)(4),{rows:n}=e,r;t[0]===n?r=t[1]:(r=n.map(St),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1.5 sm:grid-cols-[12rem_minmax(0,1fr)]`,children:r}),t[2]=r,t[3]=i),i}function St(e){return(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:e.mono?`min-w-0 font-mono text-[12px] break-all text-foreground`:`min-w-0 text-[12px] text-foreground`,children:e.value})]},e.label)}function Ct(e){let t=(0,L.c)(14),{value:n}=e,r;t[0]===n?r=t[1]:(r=Pe(n),t[0]=n,t[1]=r);let i=r;if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number`,"data-value":`absent`,className:`text-[11px] text-muted-foreground`,children:V}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Comparison number`}),t[3]=a):a=t[3];let o;t[4]===i.display?o=t[5]:(o=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number-value`,className:`font-mono text-[13px] leading-relaxed font-semibold tracking-[0.08em] select-all`,children:i.display}),t[4]=i.display,t[5]=o);let s;t[6]===i.caption?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.caption}),t[6]=i.caption,t[7]=s);let c;t[8]===i.advisory?c=t[9]:(c=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.advisory}),t[8]=i.advisory,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c?(l=(0,Q.jsxs)(`div`,{"data-testid":`node-safety-number`,"data-value":`present`,className:`space-y-1.5`,children:[a,o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function wt(e){let t=(0,L.c)(15),{view:n,unavailable:r,testId:i}=e;if(!n){let e;return t[0]!==i||t[1]!==r?(e=(0,Q.jsx)(`p`,{"data-testid":i,"data-code":`absent`,className:`text-[11px] text-muted-foreground`,children:r}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let a=`${i}-value`,o;t[3]!==a||t[4]!==n.display?(o=(0,Q.jsx)(`p`,{"data-testid":a,className:`font-mono text-sm leading-none font-semibold tracking-[0.2em] whitespace-nowrap select-all`,children:n.display}),t[3]=a,t[4]=n.display,t[5]=o):o=t[5];let s;t[6]===n.advisory?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.advisory}),t[6]=n.advisory,t[7]=s);let c;t[8]===n.more?c=t[9]:(c=n.more===null?null:(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.more}),t[8]=n.more,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==i?(l=(0,Q.jsxs)(`div`,{"data-testid":i,"data-code":`present`,className:`space-y-1.5`,children:[o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=i,t[14]=l):l=t[14],l}function Tt(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=j(n,`settings`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(wt,{view:r,unavailable:M,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Et(e){let t=(0,L.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=Je(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(wt,{view:r,unavailable:qe,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Dt(){let e=(0,L.c)(21),t=A(),n=N(),r=i(jt),a=i(At),o=i(kt),s=i(Ot),c,l;e[0]!==r||e[1]!==t||e[2]!==o||e[3]!==a||e[4]!==s?(c=P({browserStatus:r,sessionStatus:a,selectionStatus:o,transportStatus:s,e2eeStatus:t}),l=ke(`hosted`,c),e[0]=r,e[1]=t,e[2]=o,e[3]=a,e[4]=s,e[5]=c,e[6]=l):(c=e[5],l=e[6]);let u=l,d=c.guarantee===`e2ee`?`success`:c.guarantee===`web`?`info`:c.guarantee===`legacy`?`warning`:`outline`,f;e[7]!==c.shortLabel||e[8]!==d?(f=(0,Q.jsx)(D,{size:`sm`,variant:d,"data-testid":`node-connection-claim`,children:c.shortLabel}),e[7]=c.shortLabel,e[8]=d,e[9]=f):f=e[9];let p;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(F,{}),e[10]=p):p=e[10];let m;e[11]!==t||e[12]!==n?(m=t===`web-unsigned`?(0,Q.jsx)(Tt,{code:n}):null,e[11]=t,e[12]=n,e[13]=m):m=e[13];let h;e[14]===m?h=e[15]:(h=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[p,m]}),e[14]=m,e[15]=h);let g;return e[16]!==u.body||e[17]!==u.headline||e[18]!==f||e[19]!==h?(g=(0,Q.jsx)(O,{title:`This connection`,children:(0,Q.jsx)(k,{title:u.headline,description:u.body,status:f,children:h})}),e[16]=u.body,e[17]=u.headline,e[18]=f,e[19]=h,e[20]=g):g=e[20],g}function Ot(e){return e.transportStatus}function kt(e){return e.selectionStatus}function At(e){return e.sessionStatus}function jt(e){return e.browserStatus}function Mt(){let e=Oe(r()),t=Ae(e),n=je(e),[i,a]=(0,I.useState)(xt),[l,C]=(0,I.useState)(null),[w,T]=(0,I.useState)(!1),[ae,D]=(0,I.useState)(null),[A,j]=(0,I.useState)(null),[M,N]=(0,I.useState)(null),[P,F]=(0,I.useState)(null),[L,Me]=(0,I.useState)(``),R=(0,I.useRef)(!0),z=(0,I.useRef)(0),B=(0,I.useRef)(null),{copyToClipboard:Pe}=se();(0,I.useEffect)(()=>(R.current=!0,()=>{R.current=!1}),[]);let V=(0,I.useCallback)(async()=>{if(t.available)try{let[e,t,n,r,i,o]=await Promise.all([f(),d(),p(),x(),b(),S()]),s=await v().catch(()=>null);if(!R.current)return;z.current=0,a({clients:e,sessions:t,policy:n,prekey:r,continuity:i,fallback:o,enrollmentFingerprint:s?.fingerprint??null}),C(null)}catch(e){if(!R.current)return;z.current+=1,C(e instanceof Error?e.message:`Unable to read the node's security state.`)}},[t.available]);(0,I.useEffect)(()=>{if(!t.available)return;let e=te({lifecycle:ee,run:V,resolveDelayMs:()=>Math.min(yt*2**Math.max(0,z.current-1),bt),jitterRatio:.1});return B.current=e,()=>{B.current===e&&(B.current=null),e.stop()}},[t.available,V]);let H=(0,I.useCallback)(()=>B.current?.refresh()??V(),[V]),U=(0,I.useCallback)(async(e,t)=>{T(!0),C(null),D(null);try{let n=await e();R.current&&D(typeof n==`string`?n:t),await H()}catch(e){if(!R.current)return;C(e instanceof Error?e.message:`That didn't work.`)}finally{R.current&&T(!1)}},[H]),W=(0,I.useCallback)((e,t,n)=>{N({copy:rt(e),run:()=>U(t,n)})},[U]),G=(0,I.useCallback)((e,t,n)=>{N({copy:e,run:()=>U(t,n)})},[U]),K=(0,I.useCallback)(async t=>{let n=Ne(e,t);if(!n.allowed){C(n.refusal);return}T(!0),C(null),D(null);try{let e=await s(n.proposal);if(!R.current)return;j({proposal:n.proposal,warnings:Ze(e,n.proposal,i.policy),destructive:$e(e,n.proposal,i.policy)})}catch(e){if(!R.current)return;C(e instanceof Error?e.message:`Unable to preview that change.`)}finally{R.current&&T(!1)}},[e,i.policy]),Ke=(0,I.useCallback)(async()=>{if(A===null)return;let t=Ne(e,A.proposal);if(!t.allowed){C(t.refusal),j(null);return}let n=t.proposal;j(null),await U(async()=>et(await _(n)),`Policy applied.`)},[e,A,U]),qe=(0,I.useCallback)((e,t,n)=>{let r={fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin};G(at(t,r),()=>y(e),n)},[G]),Je=(0,I.useCallback)((e,t)=>{N({copy:lt(t,{fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin}),run:()=>U(async()=>{await y(e);try{let n=await g({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});return R.current&&F({approval:n,label:e.fingerprint}),`Client approved as ${t}. Scan the code on the new device.`}catch{return`Client approved as ${t}. The QR code was not created; use Show phone QR to retry.`}},`Client approved as ${t}.`)})},[U]),Qe=(0,I.useCallback)(async e=>{T(!0),C(null);try{let t=await g({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});R.current&&F({approval:t,label:e.displayLabel??e.fingerprint})}catch(e){R.current&&C(e instanceof Error?e.message:`Unable to create the phone QR code.`)}finally{R.current&&T(!1)}},[]),q=Fe(i.enrollmentFingerprint),J=(0,I.useMemo)(()=>tt(i.fallback),[i.fallback]),Y=Be(i.clients),it=Le(i.prekey),X=ze(i.continuity),Z=M?.copy??null,st=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;return(0,Q.jsxs)(Ee,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Security`}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:ut})]}),t.available?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:w,onClick:()=>void H(),children:[(0,Q.jsx)(re,{className:`size-3.5`}),`Refresh`]}):null]}),l===null?null:(0,Q.jsxs)(ue,{variant:`error`,children:[(0,Q.jsx)(ie,{}),(0,Q.jsx)(ce,{children:`That didn't work`}),(0,Q.jsx)(le,{children:l})]}),ae?(0,Q.jsxs)(ue,{variant:`info`,children:[(0,Q.jsx)(ce,{children:`Done`}),(0,Q.jsx)(le,{children:ae})]}):null,e===`hosted`?(0,Q.jsx)(Dt,{}):null,t.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(O,{title:`This node's identity`,children:[(0,Q.jsx)(k,{title:`Enrollment fingerprint`,description:q.caption,control:q.fingerprint!==null&&st?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,onClick:()=>Pe(q.fingerprint),children:[(0,Q.jsx)(ne,{className:`size-3.5`}),`Copy`]}):null,children:q.fingerprint===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-enrollment-fingerprint`,className:`pb-3.5 font-mono text-[13px] break-all select-all`,children:q.fingerprint})}),(0,Q.jsx)(k,{title:`Agreement prekey`,description:it??`The key this node offers for new channels.`,control:(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w,onClick:()=>W(`rotate-prekey`,c,`Prekey rotated.`),children:`Rotate`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Ie(i.prekey)})})}),(0,Q.jsx)(k,{title:`Continuity`,description:X??`The lineage paired clients remember this node by.`,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`break-continuity`,()=>m({action:`break`}),`Continuity chain broken.`),children:`Break chain`}),(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`remint-continuity`,()=>m({action:`remint`}),`Fresh lineage minted.`),children:`Mint fresh`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Re(i.continuity)})})})]}),(0,Q.jsxs)(O,{title:`Authorized clients`,children:[Y.map(e=>(0,Q.jsx)(k,{title:`Pairing`,description:e},e)),(0,Q.jsx)(k,{title:`Pairing window`,description:Ue,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(oe,{value:L,disabled:w,placeholder:`SHA256:…`,"aria-label":`Pairing window fingerprint`,className:`w-56 font-mono text-xs`,onChange:e=>Me(e.currentTarget.value)}),(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||L.trim()===``,onClick:()=>G(ot(L.trim()),()=>u({action:`open`,fingerprint:L.trim()}),`Pairing window opened.`),children:`Open`}),(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||i.clients?.pairingWindow===void 0,onClick:()=>W(`close-window`,()=>u({action:`close`}),`Pairing window closed.`),children:`Close`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Ve(i.clients)})})}),(0,Q.jsx)(k,{title:`Refused attempts`,description:He(i.clients),control:(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:w||(i.clients?.refusedPairingAttempts??0)===0,onClick:()=>W(`clear-refusals`,h,`Refusal count cleared.`),children:`Clear`})}),(i.clients?.records??[]).map(e=>(0,Q.jsx)(Lt,{record:e,busy:w,onAuthorize:qe,onApprove:Je,onShowApprovalQr:Qe},`${e.hubOrigin}\u0000${e.accountId}\u0000${e.fingerprint}`)),i.clients!==null&&i.clients.records.length===0?(0,Q.jsx)(k,{title:`No client keys on file`,description:_t}):null]}),(0,Q.jsxs)(O,{title:`Live sessions`,children:[(i.sessions?.sessions??[]).map(e=>(0,Q.jsx)(k,{title:`Session ${e.sessionIndex}`,description:e.tier===`native`?Ge:Ye,children:(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[(0,Q.jsx)($,{rows:We(e)}),e.tier===`web`?(0,Q.jsx)(Et,{code:e.verificationCode??null}):null]})},e.sessionIndex)),i.sessions!==null&&i.sessions.sessions.length===0?(0,Q.jsx)(k,{title:`No sessions`,description:vt}):null]}),(0,Q.jsxs)(O,{title:`Admission policy`,children:[(0,Q.jsx)(Ft,{title:dt,description:ft,checked:i.policy===null?null:i.policy.requireE2EE,busy:w,ariaLabel:`Require E2EE`,testId:`require-e2ee`,onChange:e=>void K({requireE2EE:e})}),(0,Q.jsx)(Pt,{disposition:n,checked:i.policy===null?null:i.policy.requireApprovedClientE2EE,busy:w,onChange:e=>void K({requireApprovedClientE2EE:e})}),(0,Q.jsx)(k,{title:`Policy generation`,description:ht,control:(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:w,onClick:()=>W(`recover-policy`,o,`Policy generation advanced.`),children:`Advance`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Xe(i.policy)})})})]}),(0,Q.jsx)(O,{title:`Fallback`,children:J===null?(0,Q.jsx)(k,{title:`Fallback`,description:`Waiting for the node.`}):J.quiet?(0,Q.jsx)(k,{title:`Nothing has fallen back`,description:nt,control:(0,Q.jsx)(It,{busy:w,onConfirm:W})}):(0,Q.jsxs)(Q.Fragment,{children:[J.classes.map(e=>(0,Q.jsx)(k,{title:e.label,description:e.meaning,status:`Last ${e.lastOccurrence}${e.ringOverflows>0?` · ${e.ringOverflows} overflow(s)`:``}`,control:(0,Q.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.occurrences})},e.label)),(0,Q.jsx)(k,{title:`Retained occurrences`,description:J.overflowNotice??`Observation window started ${J.windowStarted}.`,control:(0,Q.jsx)(It,{busy:w,onConfirm:W}),children:(0,Q.jsx)(`ul`,{className:`space-y-1 pb-3.5`,children:J.entries.map(e=>(0,Q.jsxs)(`li`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.at,` · `,e.reason]},e.ordinal))})}),J.undersizedNotice?(0,Q.jsx)(k,{title:`Undersized connection`,description:J.undersizedNotice}):null]})})]}):(0,Q.jsxs)(O,{title:`This node`,children:[(0,Q.jsx)(k,{title:ke(e,null).headline,description:t.unavailableBody}),(0,Q.jsx)(Pt,{disposition:n,checked:null,busy:w,onChange:e=>void K({requireApprovedClientE2EE:e})})]}),(0,Q.jsx)(Te,{open:A!==null,onOpenChange:e=>!e&&j(null),children:(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(we,{children:`Apply this policy change?`}),(0,Q.jsx)(Ce,{children:A?.warnings.map(e=>(0,Q.jsx)(`span`,{className:`block pb-2`,children:e},e))})]}),(0,Q.jsxs)(be,{children:[(0,Q.jsx)(xe,{children:`Leave it`}),(0,Q.jsx)(E,{variant:A?.destructive?`destructive`:`default`,"data-testid":`policy-apply`,disabled:w,onClick:()=>void Ke(),children:`Apply`})]})]})}),(0,Q.jsx)(Te,{open:M!==null,onOpenChange:e=>!e&&N(null),children:(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(we,{children:Z?.title}),(0,Q.jsx)(Ce,{children:Z?.body})]}),Z?.facts?(0,Q.jsx)(`div`,{"data-testid":`node-confirmation-facts`,className:`pb-1`,children:(0,Q.jsx)($,{rows:Z.facts})}):null,(0,Q.jsxs)(be,{children:[(0,Q.jsx)(xe,{children:`Cancel`}),(0,Q.jsx)(E,{variant:Z?.destructive?`destructive`:`default`,"data-testid":`node-confirmation-confirm`,disabled:w,onClick:()=>{let e=M;N(null),e&&e.run()},children:Z?.confirmLabel})]})]})}),(0,Q.jsx)(ve,{open:P!==null,onOpenChange:e=>!e&&F(null),children:(0,Q.jsxs)(_e,{className:`max-w-sm`,children:[(0,Q.jsxs)(de,{children:[(0,Q.jsx)(fe,{children:`Verify this phone`}),(0,Q.jsx)(ge,{children:`On the new phone, open node verification and scan this code. It is bound to that phone's key and expires after five minutes.`})]}),(0,Q.jsxs)(he,{className:`space-y-4`,children:[P?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`rounded-2xl bg-white p-3`,children:(0,Q.jsx)(De,{value:P.approval.payload,size:240,level:`M`,marginSize:2,title:`Node approval — scan with Ryco on the new phone`})}),(0,Q.jsx)(`p`,{className:`max-w-full break-all text-center font-mono text-[11px] text-muted-foreground`,children:P.label})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`The code contains no secret and grants no access by itself. Ryco will reconnect and prove both device keys after the scan.`})]}),(0,Q.jsx)(pe,{variant:`bare`,children:(0,Q.jsx)(me,{render:(0,Q.jsx)(E,{variant:`outline`}),children:`Done`})})]})})]})}function Nt(){let e=(0,L.c)(7),t=a();if(t&&!t.primary){let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(ie,{}),e[0]=n):n=e[0];let r;e[1]===t.nodeLabel?r=e[2]:(r=(0,Q.jsxs)(ce,{children:[`Open Security on `,t.nodeLabel]}),e[1]=t.nodeLabel,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(le,{children:`Security administration requires that node's direct local operator channel. Ryco has disabled these controls here so an action can never be applied to this Mac by mistake.`}),e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a=(0,Q.jsx)(Ee,{children:(0,Q.jsxs)(ue,{variant:`warning`,children:[n,r,i]})}),e[4]=r,e[5]=a),a}let n;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Mt,{}),e[6]=n):n=e[6],n}function Pt(e){let t=(0,L.c)(6),{disposition:n,checked:r,busy:i,onChange:a}=e,o=n.kind===`blocked`,s=n.kind===`blocked`?n.reason:mt,c;return t[0]!==o||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==s?(c=(0,Q.jsx)(Ft,{title:pt,description:s,checked:r,busy:i,blocked:o,ariaLabel:`Require approved client E2EE`,testId:`require-approved-client-e2ee`,onChange:a}),t[0]=o,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c):c=t[5],c}function Ft(e){let t=(0,L.c)(11),{title:n,description:r,checked:i,busy:a,blocked:o,ariaLabel:s,testId:c,onChange:l}=e,u=o!==void 0&&o,d=i===null?`${r} ${gt}`:r,f;t[0]!==s||t[1]!==u||t[2]!==a||t[3]!==i||t[4]!==l||t[5]!==c?(f=i===null?(0,Q.jsx)(`span`,{"data-testid":c,"data-policy":`unknown`,"data-blocked":u?`hosted`:void 0,className:`text-[11px] text-muted-foreground`,children:`unknown`}):(0,Q.jsx)(ae,{checked:i,disabled:u||a,"aria-label":s,"data-testid":c,"data-policy":String(i),"data-blocked":u?`hosted`:void 0,onCheckedChange:l}),t[0]=s,t[1]=u,t[2]=a,t[3]=i,t[4]=l,t[5]=c,t[6]=f):f=t[6];let p;return t[7]!==d||t[8]!==f||t[9]!==n?(p=(0,Q.jsx)(k,{title:n,description:d,control:f}),t[7]=d,t[8]=f,t[9]=n,t[10]=p):p=t[10],p}function It(e){let t=(0,L.c)(5),{busy:n,onConfirm:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`reset-fallback`,l,`Fallback counters reset.`),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,Q.jsx)(E,{size:`xs`,variant:`outline`,disabled:n,onClick:i,children:`Reset`}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function Lt(e){let t=(0,L.c)(60),{record:n,busy:r,onAuthorize:i,onApprove:a,onShowApprovalQr:o}=e,s,c,l,u,d;if(t[0]!==r||t[1]!==a||t[2]!==n){c={hubOrigin:n.hubOrigin,accountId:n.accountId,fingerprint:n.fingerprint};let e;t[8]===n.status?e=t[9]:(e=W(n.status),t[8]=n.status,t[9]=e);let i=e;s=k;let o;t[10]===n?o=t[11]:(o=G(n),t[10]=n,t[11]=o);let f=i===`success`?`success`:i,p;t[12]!==n.status||t[13]!==f?(p=(0,Q.jsx)(D,{size:`sm`,variant:f,children:n.status}),t[12]=n.status,t[13]=f,t[14]=p):p=t[14],t[15]!==o||t[16]!==p?(u=(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o,p]}),t[15]=o,t[16]=p,t[17]=u):u=t[17],d=`${n.accountId} at ${n.hubOrigin}`,l=n.status===`approved`?null:Z.map(e=>(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>a({...c,action:`approve`,maxRole:e,capabilitySet:ct},e),children:[`Approve as `,e]},e)),t[0]=r,t[1]=a,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7];let f;t[18]!==r||t[19]!==c||t[20]!==i||t[21]!==n.maxRole||t[22]!==n.status?(f=n.status===`approved`&&n.maxRole!==`viewer`?(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`narrow`,maxRole:`viewer`},`narrow`,`Authority reduced.`),children:`Reduce to viewer`}):null,t[18]=r,t[19]=c,t[20]=i,t[21]=n.maxRole,t[22]=n.status,t[23]=f):f=t[23];let p;t[24]!==r||t[25]!==o||t[26]!==n?(p=n.status===`approved`?(0,Q.jsxs)(E,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(n),children:[(0,Q.jsx)(T,{className:`size-3.5`}),`Show phone QR`]}):null,t[24]=r,t[25]=o,t[26]=n,t[27]=p):p=t[27];let m;t[28]!==r||t[29]!==c||t[30]!==i||t[31]!==n.status?(m=n.status===`revoked`?null:(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:()=>i({...c,action:`revoke`},`revoke`,`Client revoked.`),children:`Revoke`}),t[28]=r,t[29]=c,t[30]=i,t[31]=n.status,t[32]=m):m=t[32];let h;t[33]!==c||t[34]!==i?(h=()=>i({...c,action:`purge`},`purge`,`Record deleted.`),t[33]=c,t[34]=i,t[35]=h):h=t[35];let g;t[36]!==r||t[37]!==h?(g=(0,Q.jsx)(E,{size:`xs`,variant:`destructive-outline`,disabled:r,onClick:h,children:`Delete`}),t[36]=r,t[37]=h,t[38]=g):g=t[38];let _;t[39]!==l||t[40]!==f||t[41]!==p||t[42]!==m||t[43]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[l,f,p,m,g]}),t[39]=l,t[40]=f,t[41]=p,t[42]=m,t[43]=g,t[44]=_):_=t[44];let v;t[45]===n?v=t[46]:(v=K(n),t[45]=n,t[46]=v);let y;t[47]===v?y=t[48]:(y=(0,Q.jsx)($,{rows:v}),t[47]=v,t[48]=y);let b;t[49]===n.safetyNumber?b=t[50]:(b=(0,Q.jsx)(Ct,{value:n.safetyNumber}),t[49]=n.safetyNumber,t[50]=b);let x;t[51]!==y||t[52]!==b?(x=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[y,b]}),t[51]=y,t[52]=b,t[53]=x):x=t[53];let S;return t[54]!==s||t[55]!==x||t[56]!==u||t[57]!==d||t[58]!==_?(S=(0,Q.jsx)(s,{title:u,description:d,control:_,children:x}),t[54]=s,t[55]=x,t[56]=u,t[57]=d,t[58]=_,t[59]=S):S=t[59],S}export{Nt as NodeSecuritySettings};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import"./src-Vf4LVnMX.js";import{Rn as r,Xn as i,hn as a,xn as o,zn as s}from"./runtime-DKwoXpJv.js";import{It as c}from"./composerDraftStore-CdJJZe42.js";import{t as l}from"./circle-alert-BWvs6IOn.js";import{i as u,o as d}from"./toast-CcSCAm4B.js";import{n as f,t as p}from"./external-link-fbvzDWM7.js";import{n as m,t as h}from"./tokenModePresentation-lVM0-Wi3.js";import{t as g}from"./download-CQZ-m4zW.js";import{t as ee}from"./loader-zHASMrUy.js";import{t as _}from"./refresh-cw-DopCMrtR.js";import{t as v}from"./utils-BofFIn5Y.js";import{i as y,n as te,t as ne}from"./tooltip-C8sAONBj.js";import{t as re}from"./button-BAbJxRzt.js";import{t as b}from"./toastHelpers-CSQRKo4F.js";import{a as ie,i as x,o as ae,s as oe,t as se}from"./select-BYbVr-yg.js";import{t as ce}from"./badge-CXw6fWrB.js";import{i as le,n as ue,r as de}from"./settingsLayout-D8glO7f1.js";var fe=n(),S=e(t(),1),C=c();function w(e){return`${e.pluginId}:${e.targetKind}:${e.providerInstanceId??`global`}`}function pe(e){switch(e.state){case`installed`:return`Installed`;case`not-installed`:return`Not installed`;case`unsupported`:return`Unsupported`;case`error`:return`Error`}}function T(e){switch(e.state){case`installed`:return`success`;case`not-installed`:return`outline`;case`unsupported`:return`warning`;case`error`:return`error`}}function E(e){switch(e.state){case`installed`:return(0,C.jsx)(d,{className:`size-3.5 text-success-foreground`});case`not-installed`:return(0,C.jsx)(f,{className:`size-3.5 text-muted-foreground`});case`unsupported`:case`error`:return(0,C.jsx)(l,{className:`size-3.5 text-warning-foreground`})}}function me(e){return e.targetKind===`global`?`System`:e.providerDisplayName??String(e.providerInstanceId??`Provider`)}function he(e){return e.impact===`tool-output`?`Tool output`:`Assistant output`}function ge(e){return e.scope===`global`?`Global`:`Provider`}function D(e){switch(e){case`rtk`:return 0;case`caveman`:return 1;case`token-optimizer`:return 2;case`token-savior`:return 3;case`lean-ctx`:return 4}}function O(e){return`${e.targetKind===`global`?`0`:`1`}:${me(e).toLowerCase()}`}function _e(e){let t=(0,fe.c)(36),{status:n,isInstalling:r,onInstall:i}=e,a=n.canInstall&&n.state!==`installed`,o;t[0]===n?o=t[1]:(o=E(n),t[0]=n,t[1]=o);let s;t[2]===n?s=t[3]:(s=me(n),t[2]=n,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,C.jsx)(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:s}),t[4]=s,t[5]=c);let l;t[6]===n?l=t[7]:(l=T(n),t[6]=n,t[7]=l);let u;t[8]===n?u=t[9]:(u=pe(n),t[8]=n,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,C.jsx)(ce,{variant:l,size:`sm`,children:u}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n.version?f=t[14]:(f=n.version?(0,C.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:n.version}):null,t[13]=n.version,t[14]=f);let p;t[15]!==o||t[16]!==c||t[17]!==d||t[18]!==f?(p=(0,C.jsxs)(`div`,{className:`flex min-h-5 flex-wrap items-center gap-2`,children:[o,c,d,f]}),t[15]=o,t[16]=c,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m;t[20]===n.detail?m=t[21]:(m=n.detail?(0,C.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground/80`,children:n.detail}):null,t[20]=n.detail,t[21]=m);let h;t[22]===n.manualSteps?h=t[23]:(h=n.manualSteps.length>0?(0,C.jsx)(`div`,{className:`space-y-1 pt-1`,children:n.manualSteps.map(k)}):null,t[22]=n.manualSteps,t[23]=h);let _;t[24]!==h||t[25]!==p||t[26]!==m?(_=(0,C.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[p,m,h]}),t[24]=h,t[25]=p,t[26]=m,t[27]=_):_=t[27];let v;t[28]!==a||t[29]!==r||t[30]!==i||t[31]!==n?(v=a?(0,C.jsxs)(re,{size:`xs`,variant:`outline`,disabled:r,className:`self-start sm:self-auto`,onClick:()=>i(n),children:[r?(0,C.jsx)(ee,{className:`size-3.5 animate-spin`}):(0,C.jsx)(g,{className:`size-3.5`}),`Install`]}):null,t[28]=a,t[29]=r,t[30]=i,t[31]=n,t[32]=v):v=t[32];let y;return t[33]!==_||t[34]!==v?(y=(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-border/50 px-4 py-3 first:border-t-0 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[_,v]}),t[33]=_,t[34]=v,t[35]=y):y=t[35],y}function k(e){return(0,C.jsx)(`p`,{className:`font-mono text-[11px] leading-relaxed text-muted-foreground`,children:e},e)}function A(){let e=(0,fe.c)(56),t=r(),{updateSettings:n}=s(),c=i(),l=t.defaultAgentTokenMode??`balanced`,d=m[l],f=d.icon,g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],e[0]=g):g=e[0];let[x,pe]=(0,S.useState)(g),T;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],e[1]=T):T=e[1];let[E,D]=(0,S.useState)(T),[O,k]=(0,S.useState)(!1),[A,Ce]=(0,S.useState)(null),j=(0,S.useRef)(!1),M;e[2]===c?M=e[3]:(M=()=>{if(j.current)return;j.current=!0,k(!0);let e=c?a(c.environmentId)?.server:o().server;if(!e){k(!1),j.current=!1;return}Promise.all([e.listOpinionatedPlugins(),e.checkOpinionatedPlugins()]).then(e=>{let[t,n]=e;pe(t.plugins.toSorted(Ee)),D(n.statuses)}).catch(Te).finally(()=>{j.current=!1,k(!1)})},e[2]=c,e[3]=M);let N=M,De,P;e[4]===N?(De=e[5],P=e[6]):(De=()=>{N()},P=[N],e[4]=N,e[5]=De,e[6]=P),(0,S.useEffect)(De,P);let F;if(e[7]!==E){let t=new Map;for(let e of E){let n=t.get(e.pluginId)??[];n.push(e),t.set(e.pluginId,n)}F=new Map;for(let[e,n]of t)F.set(e,n.toSorted(we));e[7]=E,e[8]=F}else F=e[8];let I=F,Oe=Se,L;e[9]!==N||e[10]!==c?(L=e=>{let t=o(),n=c?a(c.environmentId)?.server:t.server;if(!n){u.add(b({type:`error`,title:`Plugin install unavailable`,description:`Node ${c?.nodeLabel??`server`} is not connected.`}));return}let r=me(e);t.dialogs.confirm(`Install ${e.pluginId===`rtk`?`RTK`:`Caveman`} for ${r}?\n\nThis may run networked CLI installation commands on this machine.`).then(t=>{if(!t)return;let i=w(e);return Ce(i),n.installOpinionatedPlugin({pluginId:e.pluginId,...e.providerInstanceId?{providerInstanceId:e.providerInstanceId}:{}}).then(t=>{D(e=>[...e.filter(e=>w(e)!==i),t.status]),u.add({type:`success`,title:`${e.pluginId===`rtk`?`RTK`:`Caveman`} installed`,description:t.commands.length>0?t.commands[t.commands.length-1]:r}),N()}).catch(xe).finally(()=>Ce(null))}).catch(be)},e[9]=N,e[10]=c,e[11]=L):L=e[11];let R=L,z;e[12]===n?z=e[13]:(z=e=>n({defaultAgentTokenMode:e}),e[12]=n,e[13]=z);let B;e[14]===f?B=e[15]:(B=(0,C.jsx)(f,{className:`size-4 shrink-0 text-muted-foreground`}),e[14]=f,e[15]=B);let V;e[16]===d.triggerLabel?V=e[17]:(V=(0,C.jsx)(oe,{children:d.triggerLabel}),e[16]=d.triggerLabel,e[17]=V);let H;e[18]!==B||e[19]!==V?(H=(0,C.jsx)(ae,{className:`w-full sm:w-52`,"aria-label":`Default token mode`,children:(0,C.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[B,V]})}),e[18]=B,e[19]=V,e[20]=H):H=e[20];let U;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,C.jsx)(ie,{align:`end`,alignItemWithTrigger:!1,className:`w-60`,children:h.map(ye)}),e[21]=U):U=e[21];let W;e[22]!==l||e[23]!==z||e[24]!==H?(W=(0,C.jsx)(le,{title:`Token mode`,children:(0,C.jsx)(de,{title:`Default token mode`,description:`Applied to new threads and draft sessions. Existing threads keep their own mode.`,control:(0,C.jsxs)(se,{value:l,onValueChange:z,children:[H,U]})})}),e[22]=l,e[23]=z,e[24]=H,e[25]=W):W=e[25];let G;e[26]===N?G=e[27]:(G=()=>N(),e[26]=N,e[27]=G);let K;e[28]===O?K=e[29]:(K=O?(0,C.jsx)(ee,{className:`size-3 animate-spin`}):(0,C.jsx)(_,{className:`size-3`}),e[28]=O,e[29]=K);let q;e[30]!==O||e[31]!==G||e[32]!==K?(q=(0,C.jsx)(y,{render:(0,C.jsx)(re,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:O,onClick:G,"aria-label":`Refresh plugin status`,children:K})}),e[30]=O,e[31]=G,e[32]=K,e[33]=q):q=e[33];let J;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,C.jsx)(te,{side:`top`,children:`Refresh plugin status`}),e[34]=J):J=e[34];let Y;e[35]===q?Y=e[36]:(Y=(0,C.jsxs)(ne,{children:[q,J]}),e[35]=q,e[36]=Y);let X;e[37]!==O||e[38]!==x.length?(X=x.length===0&&O?(0,C.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-4 text-xs text-muted-foreground`,children:[(0,C.jsx)(ee,{className:`size-3.5 animate-spin`}),`Loading plugin status`]}):null,e[37]=O,e[38]=x.length,e[39]=X):X=e[39];let Z;if(e[40]!==R||e[41]!==A||e[42]!==x||e[43]!==I){let t;e[45]!==R||e[46]!==A||e[47]!==I?(t=e=>{let t=I.get(e.id)??[],n=t.filter(ve).length;return(0,C.jsx)(de,{title:(0,C.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:e.name}),(0,C.jsx)(ce,{variant:n>0?`success`:`outline`,size:`sm`,children:n>0?`${n} installed`:`Available`})]}),description:e.summary,status:(0,C.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,children:[(0,C.jsx)(ce,{variant:`info`,size:`sm`,children:he(e)}),(0,C.jsx)(ce,{variant:`outline`,size:`sm`,children:ge(e)})]}),control:(0,C.jsxs)(re,{size:`xs`,variant:`ghost`,onClick:()=>Oe(e),children:[(0,C.jsx)(p,{className:`size-3.5`}),`Docs`]}),children:(0,C.jsx)(`div`,{className:v(`mt-4 border-t border-border/60`,t.length===0?`px-5 py-4`:``),children:t.length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`No compatible provider instances detected.`}):t.map(e=>(0,C.jsx)(_e,{status:e,isInstalling:A===w(e),onInstall:R},w(e)))})},e.id)},e[45]=R,e[46]=A,e[47]=I,e[48]=t):t=e[48],Z=x.map(t),e[40]=R,e[41]=A,e[42]=x,e[43]=I,e[44]=Z}else Z=e[44];let Q;e[49]!==Y||e[50]!==X||e[51]!==Z?(Q=(0,C.jsxs)(le,{title:`Opinionated plugins`,headerAction:Y,children:[X,Z]}),e[49]=Y,e[50]=X,e[51]=Z,e[52]=Q):Q=e[52];let $;return e[53]!==W||e[54]!==Q?($=(0,C.jsxs)(ue,{children:[W,Q]}),e[53]=W,e[54]=Q,e[55]=$):$=e[55],$}function ve(e){return e.state===`installed`}function ye(e){let t=m[e],n=t.icon;return(0,C.jsx)(x,{hideIndicator:!0,value:e,children:(0,C.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,children:[(0,C.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,C.jsx)(`span`,{className:`text-muted-foreground text-xs leading-4`,children:t.description})]})},e)}function be(e){u.add(b({type:`error`,title:`Install confirmation failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function xe(e){u.add(b({type:`error`,title:`Plugin install failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function Se(e){let t=e.docsUrl??e.homepageUrl;o().shell.openExternal(t).catch(Ce)}function Ce(e){u.add(b({type:`error`,title:`Failed to open plugin docs`,description:e instanceof Error?e.message:`An error occurred.`}))}function we(e,t){return O(e).localeCompare(O(t))}function Te(e){u.add(b({type:`error`,title:`Failed to load plugins`,description:e instanceof Error?e.message:`An error occurred.`}))}function Ee(e,t){return D(e.id)-D(t.id)}export{A as OpinionatedPluginsSettingsPanel};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import"./src-Vf4LVnMX.js";import{Rn as r,Xn as i,hn as a,xn as o,zn as s}from"./runtime-CXut_g4p.js";import{It as c}from"./composerDraftStore-CdJJZe42.js";import{t as l}from"./circle-alert-BWvs6IOn.js";import{i as u,o as d}from"./toast-CcSCAm4B.js";import{n as f,t as p}from"./external-link-fbvzDWM7.js";import{n as m,t as h}from"./tokenModePresentation-lVM0-Wi3.js";import{t as g}from"./download-CQZ-m4zW.js";import{t as ee}from"./loader-zHASMrUy.js";import{t as _}from"./refresh-cw-DopCMrtR.js";import{t as v}from"./utils-BofFIn5Y.js";import{i as y,n as te,t as ne}from"./tooltip-C8sAONBj.js";import{t as re}from"./button-BAbJxRzt.js";import{t as b}from"./toastHelpers-CSQRKo4F.js";import{a as ie,i as x,o as ae,s as oe,t as se}from"./select-BYbVr-yg.js";import{t as ce}from"./badge-CXw6fWrB.js";import{i as le,n as ue,r as de}from"./settingsLayout-D8glO7f1.js";var fe=n(),S=e(t(),1),C=c();function w(e){return`${e.pluginId}:${e.targetKind}:${e.providerInstanceId??`global`}`}function pe(e){switch(e.state){case`installed`:return`Installed`;case`not-installed`:return`Not installed`;case`unsupported`:return`Unsupported`;case`error`:return`Error`}}function T(e){switch(e.state){case`installed`:return`success`;case`not-installed`:return`outline`;case`unsupported`:return`warning`;case`error`:return`error`}}function E(e){switch(e.state){case`installed`:return(0,C.jsx)(d,{className:`size-3.5 text-success-foreground`});case`not-installed`:return(0,C.jsx)(f,{className:`size-3.5 text-muted-foreground`});case`unsupported`:case`error`:return(0,C.jsx)(l,{className:`size-3.5 text-warning-foreground`})}}function me(e){return e.targetKind===`global`?`System`:e.providerDisplayName??String(e.providerInstanceId??`Provider`)}function he(e){return e.impact===`tool-output`?`Tool output`:`Assistant output`}function ge(e){return e.scope===`global`?`Global`:`Provider`}function D(e){switch(e){case`rtk`:return 0;case`caveman`:return 1;case`token-optimizer`:return 2;case`token-savior`:return 3;case`lean-ctx`:return 4}}function O(e){return`${e.targetKind===`global`?`0`:`1`}:${me(e).toLowerCase()}`}function _e(e){let t=(0,fe.c)(36),{status:n,isInstalling:r,onInstall:i}=e,a=n.canInstall&&n.state!==`installed`,o;t[0]===n?o=t[1]:(o=E(n),t[0]=n,t[1]=o);let s;t[2]===n?s=t[3]:(s=me(n),t[2]=n,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,C.jsx)(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:s}),t[4]=s,t[5]=c);let l;t[6]===n?l=t[7]:(l=T(n),t[6]=n,t[7]=l);let u;t[8]===n?u=t[9]:(u=pe(n),t[8]=n,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,C.jsx)(ce,{variant:l,size:`sm`,children:u}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n.version?f=t[14]:(f=n.version?(0,C.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:n.version}):null,t[13]=n.version,t[14]=f);let p;t[15]!==o||t[16]!==c||t[17]!==d||t[18]!==f?(p=(0,C.jsxs)(`div`,{className:`flex min-h-5 flex-wrap items-center gap-2`,children:[o,c,d,f]}),t[15]=o,t[16]=c,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m;t[20]===n.detail?m=t[21]:(m=n.detail?(0,C.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground/80`,children:n.detail}):null,t[20]=n.detail,t[21]=m);let h;t[22]===n.manualSteps?h=t[23]:(h=n.manualSteps.length>0?(0,C.jsx)(`div`,{className:`space-y-1 pt-1`,children:n.manualSteps.map(k)}):null,t[22]=n.manualSteps,t[23]=h);let _;t[24]!==h||t[25]!==p||t[26]!==m?(_=(0,C.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[p,m,h]}),t[24]=h,t[25]=p,t[26]=m,t[27]=_):_=t[27];let v;t[28]!==a||t[29]!==r||t[30]!==i||t[31]!==n?(v=a?(0,C.jsxs)(re,{size:`xs`,variant:`outline`,disabled:r,className:`self-start sm:self-auto`,onClick:()=>i(n),children:[r?(0,C.jsx)(ee,{className:`size-3.5 animate-spin`}):(0,C.jsx)(g,{className:`size-3.5`}),`Install`]}):null,t[28]=a,t[29]=r,t[30]=i,t[31]=n,t[32]=v):v=t[32];let y;return t[33]!==_||t[34]!==v?(y=(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-border/50 px-4 py-3 first:border-t-0 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[_,v]}),t[33]=_,t[34]=v,t[35]=y):y=t[35],y}function k(e){return(0,C.jsx)(`p`,{className:`font-mono text-[11px] leading-relaxed text-muted-foreground`,children:e},e)}function A(){let e=(0,fe.c)(56),t=r(),{updateSettings:n}=s(),c=i(),l=t.defaultAgentTokenMode??`balanced`,d=m[l],f=d.icon,g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],e[0]=g):g=e[0];let[x,pe]=(0,S.useState)(g),T;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],e[1]=T):T=e[1];let[E,D]=(0,S.useState)(T),[O,k]=(0,S.useState)(!1),[A,Ce]=(0,S.useState)(null),j=(0,S.useRef)(!1),M;e[2]===c?M=e[3]:(M=()=>{if(j.current)return;j.current=!0,k(!0);let e=c?a(c.environmentId)?.server:o().server;if(!e){k(!1),j.current=!1;return}Promise.all([e.listOpinionatedPlugins(),e.checkOpinionatedPlugins()]).then(e=>{let[t,n]=e;pe(t.plugins.toSorted(Ee)),D(n.statuses)}).catch(Te).finally(()=>{j.current=!1,k(!1)})},e[2]=c,e[3]=M);let N=M,De,P;e[4]===N?(De=e[5],P=e[6]):(De=()=>{N()},P=[N],e[4]=N,e[5]=De,e[6]=P),(0,S.useEffect)(De,P);let F;if(e[7]!==E){let t=new Map;for(let e of E){let n=t.get(e.pluginId)??[];n.push(e),t.set(e.pluginId,n)}F=new Map;for(let[e,n]of t)F.set(e,n.toSorted(we));e[7]=E,e[8]=F}else F=e[8];let I=F,Oe=Se,L;e[9]!==N||e[10]!==c?(L=e=>{let t=o(),n=c?a(c.environmentId)?.server:t.server;if(!n){u.add(b({type:`error`,title:`Plugin install unavailable`,description:`Node ${c?.nodeLabel??`server`} is not connected.`}));return}let r=me(e);t.dialogs.confirm(`Install ${e.pluginId===`rtk`?`RTK`:`Caveman`} for ${r}?\n\nThis may run networked CLI installation commands on this machine.`).then(t=>{if(!t)return;let i=w(e);return Ce(i),n.installOpinionatedPlugin({pluginId:e.pluginId,...e.providerInstanceId?{providerInstanceId:e.providerInstanceId}:{}}).then(t=>{D(e=>[...e.filter(e=>w(e)!==i),t.status]),u.add({type:`success`,title:`${e.pluginId===`rtk`?`RTK`:`Caveman`} installed`,description:t.commands.length>0?t.commands[t.commands.length-1]:r}),N()}).catch(xe).finally(()=>Ce(null))}).catch(be)},e[9]=N,e[10]=c,e[11]=L):L=e[11];let R=L,z;e[12]===n?z=e[13]:(z=e=>n({defaultAgentTokenMode:e}),e[12]=n,e[13]=z);let B;e[14]===f?B=e[15]:(B=(0,C.jsx)(f,{className:`size-4 shrink-0 text-muted-foreground`}),e[14]=f,e[15]=B);let V;e[16]===d.triggerLabel?V=e[17]:(V=(0,C.jsx)(oe,{children:d.triggerLabel}),e[16]=d.triggerLabel,e[17]=V);let H;e[18]!==B||e[19]!==V?(H=(0,C.jsx)(ae,{className:`w-full sm:w-52`,"aria-label":`Default token mode`,children:(0,C.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[B,V]})}),e[18]=B,e[19]=V,e[20]=H):H=e[20];let U;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,C.jsx)(ie,{align:`end`,alignItemWithTrigger:!1,className:`w-60`,children:h.map(ye)}),e[21]=U):U=e[21];let W;e[22]!==l||e[23]!==z||e[24]!==H?(W=(0,C.jsx)(le,{title:`Token mode`,children:(0,C.jsx)(de,{title:`Default token mode`,description:`Applied to new threads and draft sessions. Existing threads keep their own mode.`,control:(0,C.jsxs)(se,{value:l,onValueChange:z,children:[H,U]})})}),e[22]=l,e[23]=z,e[24]=H,e[25]=W):W=e[25];let G;e[26]===N?G=e[27]:(G=()=>N(),e[26]=N,e[27]=G);let K;e[28]===O?K=e[29]:(K=O?(0,C.jsx)(ee,{className:`size-3 animate-spin`}):(0,C.jsx)(_,{className:`size-3`}),e[28]=O,e[29]=K);let q;e[30]!==O||e[31]!==G||e[32]!==K?(q=(0,C.jsx)(y,{render:(0,C.jsx)(re,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:O,onClick:G,"aria-label":`Refresh plugin status`,children:K})}),e[30]=O,e[31]=G,e[32]=K,e[33]=q):q=e[33];let J;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,C.jsx)(te,{side:`top`,children:`Refresh plugin status`}),e[34]=J):J=e[34];let Y;e[35]===q?Y=e[36]:(Y=(0,C.jsxs)(ne,{children:[q,J]}),e[35]=q,e[36]=Y);let X;e[37]!==O||e[38]!==x.length?(X=x.length===0&&O?(0,C.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-4 text-xs text-muted-foreground`,children:[(0,C.jsx)(ee,{className:`size-3.5 animate-spin`}),`Loading plugin status`]}):null,e[37]=O,e[38]=x.length,e[39]=X):X=e[39];let Z;if(e[40]!==R||e[41]!==A||e[42]!==x||e[43]!==I){let t;e[45]!==R||e[46]!==A||e[47]!==I?(t=e=>{let t=I.get(e.id)??[],n=t.filter(ve).length;return(0,C.jsx)(de,{title:(0,C.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:e.name}),(0,C.jsx)(ce,{variant:n>0?`success`:`outline`,size:`sm`,children:n>0?`${n} installed`:`Available`})]}),description:e.summary,status:(0,C.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,children:[(0,C.jsx)(ce,{variant:`info`,size:`sm`,children:he(e)}),(0,C.jsx)(ce,{variant:`outline`,size:`sm`,children:ge(e)})]}),control:(0,C.jsxs)(re,{size:`xs`,variant:`ghost`,onClick:()=>Oe(e),children:[(0,C.jsx)(p,{className:`size-3.5`}),`Docs`]}),children:(0,C.jsx)(`div`,{className:v(`mt-4 border-t border-border/60`,t.length===0?`px-5 py-4`:``),children:t.length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`No compatible provider instances detected.`}):t.map(e=>(0,C.jsx)(_e,{status:e,isInstalling:A===w(e),onInstall:R},w(e)))})},e.id)},e[45]=R,e[46]=A,e[47]=I,e[48]=t):t=e[48],Z=x.map(t),e[40]=R,e[41]=A,e[42]=x,e[43]=I,e[44]=Z}else Z=e[44];let Q;e[49]!==Y||e[50]!==X||e[51]!==Z?(Q=(0,C.jsxs)(le,{title:`Opinionated plugins`,headerAction:Y,children:[X,Z]}),e[49]=Y,e[50]=X,e[51]=Z,e[52]=Q):Q=e[52];let $;return e[53]!==W||e[54]!==Q?($=(0,C.jsxs)(ue,{children:[W,Q]}),e[53]=W,e[54]=Q,e[55]=$):$=e[55],$}function ve(e){return e.state===`installed`}function ye(e){let t=m[e],n=t.icon;return(0,C.jsx)(x,{hideIndicator:!0,value:e,children:(0,C.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,children:[(0,C.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,C.jsx)(`span`,{className:`text-muted-foreground text-xs leading-4`,children:t.description})]})},e)}function be(e){u.add(b({type:`error`,title:`Install confirmation failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function xe(e){u.add(b({type:`error`,title:`Plugin install failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function Se(e){let t=e.docsUrl??e.homepageUrl;o().shell.openExternal(t).catch(Ce)}function Ce(e){u.add(b({type:`error`,title:`Failed to open plugin docs`,description:e instanceof Error?e.message:`An error occurred.`}))}function we(e,t){return O(e).localeCompare(O(t))}function Te(e){u.add(b({type:`error`,title:`Failed to load plugins`,description:e instanceof Error?e.message:`An error occurred.`}))}function Ee(e,t){return D(e.id)-D(t.id)}export{A as OpinionatedPluginsSettingsPanel};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-CdJJZe42.js";import{r as i}from"./branding-C8SLy6Af.js";import{t as a}from"./react-dom-x9LNwWQc.js";import{t as o}from"./GlassSurface-C3IIWMu9.js";import{n as s}from"./PhoneGetAppInterstitialBackdrop-B8vfJdZd.js";var c=e(t(),1),l=n(),u=e(a(),1),d={Beta:`/assets/apple-touch-icon-y36StfcK.png`,Dev:`/assets/apple-touch-icon-BXS8KnIR.png`,Nightly:`/assets/apple-touch-icon-CYqxlbbg.png`}[i]??`/assets/apple-touch-icon-y36StfcK.png`,f=r();function p(e){let t=(0,l.c)(18),{appUrl:n,onDismiss:r}=e,i=(0,c.useRef)(null),a=(0,c.useRef)(null);s();let p,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{i.current?.focus()},m=[],t[0]=p,t[1]=m):(p=t[0],m=t[1]),(0,c.useEffect)(p,m);let h;t[2]===r?h=t[3]:(h=e=>{if(e.key===`Escape`){e.preventDefault(),r();return}if(e.key!==`Tab`)return;let t=i.current,n=a.current;!t||!n||(e.shiftKey&&document.activeElement===t?(e.preventDefault(),n.focus()):!e.shiftKey&&document.activeElement===n&&(e.preventDefault(),t.focus()))},t[2]=r,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=o(`sheet`),t[4]=g):g=t[4];let _,v,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,f.jsx)(`img`,{alt:``,className:`size-14 object-contain`,draggable:!1,src:d}),v=(0,f.jsx)(`h1`,{id:`phone-get-app-interstitial-heading`,className:`mt-6 font-heading text-3xl font-semibold tracking-tight`,children:`Ryco is better as an app`}),y=(0,f.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-muted-foreground`,children:`Pick up where you left off with a native experience built for your phone.`}),t[5]=_,t[6]=v,t[7]=y):(_=t[5],v=t[6],y=t[7]);let b;t[8]===n?b=t[9]:(b=(0,f.jsx)(`a`,{ref:i,className:`inline-flex min-h-11 w-full items-center justify-center rounded-xl bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 motion-reduce:transition-none`,href:n,rel:`noreferrer`,target:`_blank`,children:`Get the app`}),t[8]=n,t[9]=b);let x;t[10]===r?x=t[11]:(x=(0,f.jsx)(`button`,{ref:a,className:`inline-flex min-h-11 w-full items-center justify-center rounded-xl px-4 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none`,type:`button`,onClick:r,children:`Continue in browser`}),t[10]=r,t[11]=x);let S;t[12]!==b||t[13]!==x?(S=(0,f.jsxs)(`section`,{className:`${g} w-full max-w-sm rounded-3xl border border-border/70 p-6 shadow-xl shadow-black/15`,children:[_,v,y,(0,f.jsxs)(`div`,{className:`mt-8 grid gap-3`,children:[b,x]})]}),t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;return t[15]!==S||t[16]!==h?(C=(0,u.createPortal)((0,f.jsx)(`div`,{"aria-labelledby":`phone-get-app-interstitial-heading`,"aria-modal":`true`,className:`fixed inset-0 z-[120] flex items-center justify-center overflow-y-auto bg-background/72 px-[max(1rem,env(safe-area-inset-left),env(safe-area-inset-right))] pt-[max(1.5rem,calc(env(safe-area-inset-top)+1rem))] pb-[max(1.5rem,calc(env(safe-area-inset-bottom)+1rem))] text-popover-foreground backdrop-blur-sm transition-opacity duration-[var(--app-motion-duration-sheet)] motion-reduce:transition-none`,role:`dialog`,onKeyDown:h,children:S}),document.body),t[15]=S,t[16]=h,t[17]=C):C=t[17],C}export{p as PhoneGetAppInterstitial};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-CdJJZe42.js";import{r as i}from"./branding-BDfN6Spd.js";import{t as a}from"./react-dom-x9LNwWQc.js";import{t as o}from"./GlassSurface-C3IIWMu9.js";import{n as s}from"./PhoneGetAppInterstitialBackdrop-B8vfJdZd.js";var c=e(t(),1),l=n(),u=e(a(),1),d={Beta:`/assets/apple-touch-icon-y36StfcK.png`,Dev:`/assets/apple-touch-icon-BXS8KnIR.png`,Nightly:`/assets/apple-touch-icon-CYqxlbbg.png`}[i]??`/assets/apple-touch-icon-y36StfcK.png`,f=r();function p(e){let t=(0,l.c)(18),{appUrl:n,onDismiss:r}=e,i=(0,c.useRef)(null),a=(0,c.useRef)(null);s();let p,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{i.current?.focus()},m=[],t[0]=p,t[1]=m):(p=t[0],m=t[1]),(0,c.useEffect)(p,m);let h;t[2]===r?h=t[3]:(h=e=>{if(e.key===`Escape`){e.preventDefault(),r();return}if(e.key!==`Tab`)return;let t=i.current,n=a.current;!t||!n||(e.shiftKey&&document.activeElement===t?(e.preventDefault(),n.focus()):!e.shiftKey&&document.activeElement===n&&(e.preventDefault(),t.focus()))},t[2]=r,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=o(`sheet`),t[4]=g):g=t[4];let _,v,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,f.jsx)(`img`,{alt:``,className:`size-14 object-contain`,draggable:!1,src:d}),v=(0,f.jsx)(`h1`,{id:`phone-get-app-interstitial-heading`,className:`mt-6 font-heading text-3xl font-semibold tracking-tight`,children:`Ryco is better as an app`}),y=(0,f.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-muted-foreground`,children:`Pick up where you left off with a native experience built for your phone.`}),t[5]=_,t[6]=v,t[7]=y):(_=t[5],v=t[6],y=t[7]);let b;t[8]===n?b=t[9]:(b=(0,f.jsx)(`a`,{ref:i,className:`inline-flex min-h-11 w-full items-center justify-center rounded-xl bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 motion-reduce:transition-none`,href:n,rel:`noreferrer`,target:`_blank`,children:`Get the app`}),t[8]=n,t[9]=b);let x;t[10]===r?x=t[11]:(x=(0,f.jsx)(`button`,{ref:a,className:`inline-flex min-h-11 w-full items-center justify-center rounded-xl px-4 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none`,type:`button`,onClick:r,children:`Continue in browser`}),t[10]=r,t[11]=x);let S;t[12]!==b||t[13]!==x?(S=(0,f.jsxs)(`section`,{className:`${g} w-full max-w-sm rounded-3xl border border-border/70 p-6 shadow-xl shadow-black/15`,children:[_,v,y,(0,f.jsxs)(`div`,{className:`mt-8 grid gap-3`,children:[b,x]})]}),t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;return t[15]!==S||t[16]!==h?(C=(0,u.createPortal)((0,f.jsx)(`div`,{"aria-labelledby":`phone-get-app-interstitial-heading`,"aria-modal":`true`,className:`fixed inset-0 z-[120] flex items-center justify-center overflow-y-auto bg-background/72 px-[max(1rem,env(safe-area-inset-left),env(safe-area-inset-right))] pt-[max(1.5rem,calc(env(safe-area-inset-top)+1rem))] pb-[max(1.5rem,calc(env(safe-area-inset-bottom)+1rem))] text-popover-foreground backdrop-blur-sm transition-opacity duration-[var(--app-motion-duration-sheet)] motion-reduce:transition-none`,role:`dialog`,onKeyDown:h,children:S}),document.body),t[15]=S,t[16]=h,t[17]=C):C=t[17],C}export{p as PhoneGetAppInterstitial};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,h as a,v as o,y as s}from"./env-B4arEvJg.js";import{Ft as c,Ht as l,Jt as u,Lt as d,Rn as f,S as p,bn as m,pt as h,yn as g,zn as _,zt as v}from"./runtime-DKwoXpJv.js";import{a as y}from"./primary-OskAInOO.js";import{It as b,i as x}from"./composerDraftStore-CdJJZe42.js";import{G as ee,M as te,O as ne,W as re,n as S}from"./useHandleNewThread-DHO0PWGZ.js";import{m as C,n as w,r as ie,t as T}from"./ThreadStatusIndicators-D0xoATCw.js";import{t as ae}from"./settingsDialogStore-ygYoScKe.js";import{i as E}from"./uiStateStore-B6pjzSjj.js";import{f as D}from"./useRenderElement-DchFnsR8.js";import{t as oe}from"./chevron-down-B7C6FKzM.js";import{t as se}from"./chevron-right-BWYGybX9.js";import{l as ce}from"./WorkItemsTab-ow45makA.js";import{t as le}from"./folder-DtsQoI9_.js";import{t as O}from"./git-branch-BKr-Ij4u.js";import{n as ue}from"./HostedConnectionControls-CKiC01ju.js";import{C as de,S as fe,a as k,b as pe,c as A,d as j,f as me,i as M,l as he,n as ge,o as N,r as _e,s as P,t as ve,u as F,x as ye,y as be}from"./sidebarProjectFolders-Cs13ZUN8.js";import{t as xe}from"./plus-B2h-VEqh.js";import{t as I}from"./search-BGQsenCM.js";import{t as Se}from"./shallow-DWZCFNun.js";import{t as L}from"./utils-BofFIn5Y.js";import{i as R}from"./timestampFormat-8uPXS812.js";import{o as z}from"./sidebar-Dm6l2GA6.js";import{a as Ce,i as we,n as Te,o as Ee,s as De,t as Oe}from"./MobileSheet-CkeG6_SP.js";import{t as B}from"./GlassSurface-C3IIWMu9.js";import{t as V}from"./useLongPress-OGlhYKlH.js";import{i as ke,o as Ae,r as je,t as Me}from"./empty-DwzqNgCP.js";import{n as H,r as Ne,t as U}from"./usePhoneThreadActions-OTf7yIbN.js";var W=D(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),G=e(t(),1),Pe=n(),K=b();function Fe(e){let t=(0,Pe.c)(14),{label:n,actions:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=L(`pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center px-3 pb-[var(--app-dock-inset)] pl-safe pr-safe`,a),t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=L(B(`dock`),`pointer-events-auto flex min-w-0 max-w-full flex-col gap-2 rounded-[22px] border border-border/60 p-[var(--app-dock-padding)] text-foreground shadow-lg/10`),t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=r.map(Ie),t[3]=r,t[4]=c);let l;t[5]!==n||t[6]!==c?(l=(0,K.jsx)(`div`,{role:`group`,"aria-label":n,className:`flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,"data-slot":`mobile-dock-actions`,children:c}),t[5]=n,t[6]=c,t[7]=l):l=t[7];let u;t[8]!==i||t[9]!==l?(u=(0,K.jsxs)(`div`,{className:s,"data-slot":`mobile-dock`,children:[i,l]}),t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==o||t[12]!==u?(d=(0,K.jsx)(`div`,{className:o,"data-slot":`mobile-dock-layer`,children:u}),t[11]=o,t[12]=u,t[13]=d):d=t[13],d}function Ie(e){return(0,K.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled??!1,className:L(`flex min-h-[var(--app-dock-control-size)] min-w-[var(--app-dock-control-size)] shrink-0 items-center justify-center gap-1 rounded-full px-2 text-[11px] font-medium`,`transition-colors duration-[var(--app-motion-duration-chip)] ease-[var(--app-motion-ease)] motion-reduce:transition-none`,`hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:text-muted-foreground/60`,e.pressed===!0&&`bg-accent`),"data-slot":`mobile-dock-action`,onClick:e.onSelect,children:[e.icon,(0,K.jsx)(`span`,{className:`truncate`,children:e.shortLabel??e.label})]},e.id)}var q=new Map;function J(){let e=(0,Pe.c)(74),t=u(Se(c)),n=u(Se(d)),r=E(Qe),a=E(Ze),s=E(Xe),l=E(Ye),_=E(Je),v=f(qe),b=f(Ke),x=f(Ge),ee=y(),w=g(We),ie=m(Ue),T=ae(He),D=h(Ve),{handleNewThread:ce}=S(),[O,de]=(0,G.useState)(!1),fe;e[0]!==r||e[1]!==t?(fe=ne({items:t,preferredIds:r,getId:p}),e[0]=r,e[1]=t,e[2]=fe):fe=e[2];let k=fe,pe;e[3]!==k||e[4]!==x?(pe=ge({projects:k,settings:x}),e[3]=k,e[4]=x,e[5]=pe):pe=e[5];let A=pe,j;e[6]!==w||e[7]!==ie?(j=e=>{let t=ie[e],n=w[e];return t?.descriptor?.label??n?.label??null},e[6]=w,e[7]=ie,e[8]=j):j=e[8];let me;e[9]!==k||e[10]!==ee||e[11]!==x||e[12]!==j?(me=_e({projects:k,settings:x,primaryEnvironmentId:ee,resolveEnvironmentLabel:j}),e[9]=k,e[10]=ee,e[11]=x,e[12]=j,e[13]=me):me=e[13];let M=me,he;e[14]===M?he=e[15]:(he=new Map(M.map(Be)),e[14]=M,e[15]=he);let N=he,P;if(e[16]!==A||e[17]!==N||e[18]!==v||e[19]!==M||e[20]!==n){let t=M.map(ze),r;e[22]===A?r=e[23]:(r=e=>{let t=o(i(e.environmentId,e.projectId));return Object.assign({},e,{projectId:A.get(t)??t})},e[22]=A,e[23]=r);let a=n.filter(Re).map(r),s;e[24]===N?s=e[25]:(s=e=>{let t=N.get(e.id);return t?[t]:[]},e[24]=N,e[25]=s),P=re(t,a,v).flatMap(s),e[16]=A,e[17]=N,e[18]=v,e[19]=M,e[20]=n,e[21]=P}else P=e[21];let F=P,ye;e[26]!==s||e[27]!==a||e[28]!==l||e[29]!==v||e[30]!==F?(ye=ve({projects:F,projectFoldersById:a,projectFolderOrder:s,projectTreeOrder:l,projectSortOrder:v}),e[26]=s,e[27]=a,e[28]=l,e[29]=v,e[30]=F,e[31]=ye):ye=e[31];let be=ye,L;e[32]!==b||e[33]!==ce?(L=e=>{let t=e.memberProjects[0];t&&(de(!1),ce(i(t.environmentId,t.id),{envMode:te({defaultEnvMode:b})}))},e[32]=b,e[33]=ce,e[34]=L):L=e[34];let R=L,B;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsxs)(`header`,{className:`flex items-center gap-1.5 border-b border-border pr-[calc(env(safe-area-inset-right)+0.5rem)] pb-2 pl-[calc(env(safe-area-inset-left)+0.75rem)] pt-[calc(env(safe-area-inset-top)+0.5rem)]`,children:[(0,K.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold`,children:`Threads`}),(0,K.jsx)(ue,{})]}),e[35]=B):B=e[35];let V;e[36]!==be||e[37]!==_?(V=be.length===0?(0,K.jsx)(Me,{className:`flex-1`,children:(0,K.jsxs)(ke,{children:[(0,K.jsx)(Ae,{className:`text-base`,children:`No projects yet`}),(0,K.jsx)(je,{className:`mt-1 text-sm`,children:`Projects opened on this node appear here with their threads.`})]})}):be.map(e=>e.kind===`project`?(0,K.jsx)($e,{project:e.project},e.itemId):(0,K.jsxs)(`section`,{"aria-label":e.folder.name,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm font-medium text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-expanded":e.folder.expanded,onClick:()=>_(e.folder.id,!e.folder.expanded),children:[e.folder.expanded?(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.folder.name})]}),e.folder.expanded?e.projects.map(Le):null]},e.itemId)),e[36]=be,e[37]=_,e[38]=V):V=e[38];let H;e[39]===V?H=e[40]:(H=(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[B,(0,K.jsx)(`div`,{"data-testid":`phone-home-list`,className:`app-dock-scroll-clearance flex min-h-0 flex-1 flex-col overflow-y-auto`,children:V})]}),e[39]=V,e[40]=H);let Ne;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,K.jsx)(I,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[41]=Ne):Ne=e[41];let U;e[42]===D?U=e[43]:(U={id:`search`,label:`Search threads`,shortLabel:`Search`,icon:Ne,onSelect:()=>D(!0)},e[42]=D,e[43]=U);let W;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,K.jsx)(xe,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[44]=W):W=e[44];let Ie=F.length===0,q;e[45]!==F[0]||e[46]!==F.length||e[47]!==R?(q=()=>{if(F.length===1&&F[0]){R(F[0]);return}de(!0)},e[45]=F[0],e[46]=F.length,e[47]=R,e[48]=q):q=e[48];let J;e[49]!==Ie||e[50]!==q?(J={id:`new-thread`,label:`New thread`,icon:W,disabled:Ie,onSelect:q},e[49]=Ie,e[50]=q,e[51]=J):J=e[51];let et;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,K.jsx)(C,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[52]=et):et=e[52];let Y;e[53]===T?Y=e[54]:(Y={id:`settings`,label:`Open settings`,shortLabel:`Settings`,icon:et,onSelect:()=>T()},e[53]=T,e[54]=Y);let X;e[55]!==U||e[56]!==J||e[57]!==Y?(X=(0,K.jsx)(Fe,{label:`Home actions`,actions:[U,J,Y]}),e[55]=U,e[56]=J,e[57]=Y,e[58]=X):X=e[58];let tt;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,K.jsxs)(we,{children:[(0,K.jsx)(Ee,{children:`New thread`}),(0,K.jsx)(Te,{children:`Choose a project for the new thread.`})]}),e[59]=tt):tt=e[59];let Z;if(e[60]!==F||e[61]!==R){let t;e[63]===R?t=e[64]:(t=e=>(0,K.jsx)(De,{label:e.displayName,onClick:()=>R(e)},e.projectKey),e[63]=R,e[64]=t),Z=F.map(t),e[60]=F,e[61]=R,e[62]=Z}else Z=e[62];let Q;e[65]===Z?Q=e[66]:(Q=(0,K.jsx)(Ce,{children:(0,K.jsx)(`div`,{role:`group`,"aria-label":`Projects`,className:`space-y-0.5`,children:Z})}),e[65]=Z,e[66]=Q);let $;e[67]!==O||e[68]!==Q?($=(0,K.jsxs)(Oe,{open:O,onOpenChange:de,label:`New thread`,children:[tt,Q]}),e[67]=O,e[68]=Q,e[69]=$):$=e[69];let nt;return e[70]!==H||e[71]!==X||e[72]!==$?(nt=(0,K.jsxs)(z,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:[H,X,$]}),e[70]=H,e[71]=X,e[72]=$,e[73]=nt):nt=e[73],nt}function Le(e){return(0,K.jsx)($e,{project:e,nested:!0},e.projectKey)}function Re(e){return e.archivedAt===null}function ze(e){return Object.assign({},e,{id:e.projectKey})}function Be(e){return[e.projectKey,e]}function Ve(e){return e.setOpen}function He(e){return e.openSettings}function Ue(e){return e.byId}function We(e){return e.byId}function Ge(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function Ke(e){return e.defaultThreadEnvMode}function qe(e){return e.sidebarProjectSortOrder}function Je(e){return e.setProjectFolderExpanded}function Ye(e){return e.projectTreeOrder}function Xe(e){return e.projectFolderOrder}function Ze(e){return e.projectFoldersById}function Qe(e){return e.projectOrder}function $e({project:e,nested:t=!1}){let n=u(Se((0,G.useMemo)(()=>t=>v(t,e.memberProjectRefs),[e.memberProjectRefs]))),c=x((0,G.useMemo)(()=>ye(e),[e])),d=f(e=>e.sidebarThreadSortOrder),p=E(e=>e.pinnedThreadKeys),m=E(t=>t.projectExpandedById[e.projectKey]??!0),h=E(e=>e.toggleProject),g=(0,G.useMemo)(()=>new Set(Object.entries(p).flatMap(([e,t])=>t?[e]:[])),[p]),y=(0,G.useMemo)(()=>fe(n,c).filter(e=>e.archivedAt===null),[c,n]),b=(0,G.useMemo)(()=>ee({threads:y,sortOrder:d,pinnedThreadKeys:g,getThreadKey:e=>s(r(e.environmentId,e.id))}),[g,d,y]),te=(0,G.useMemo)(()=>new Map(b.map(e=>[s(r(e.environmentId,e.id)),e])),[b]),ne=(0,G.useRef)(te);ne.current=te;let re=(0,G.useMemo)(()=>new Map(e.memberProjects.map(e=>[o(i(e.environmentId,e.id)),e])),[e.memberProjects]),S=U({sidebarThreadByKeyRef:ne,memberProjectByScopedKey:re,projectCwd:e.cwd??null}),[C,w]=(0,G.useState)(null),T=C?te.get(C)??null:null,ae=S.renamingThreadKey?te.get(S.renamingThreadKey)??null:null,D=u(Se((0,G.useMemo)(()=>t=>l(t,e.memberProjectRefs),[e.memberProjectRefs]))),le=(0,G.useMemo)(()=>pe({project:e,threads:b,worktrees:D}),[e,b,D]),O=be({projects:[le.project],threads:le.threads,worktrees:le.worktrees}).projects[0]??null,ue=O&&O.isGitRepo&&O.worktrees.length>1?O.worktrees:null,{updateSettings:de}=_(),ge=f(e=>({sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides})),{copyPathToClipboard:_e}=ce(),[ve,xe]=(0,G.useState)(!1),I=M(),R=k(),z=N({projectGroupingSettings:ge,updateSettings:de}),Ce=(0,G.useMemo)(()=>{let t=new Map(e.memberProjects.map(e=>[e.physicalProjectKey,0]));for(let e of n){let n=re.get(o(i(e.environmentId,e.projectId)));n&&t.set(n.physicalProjectKey,(t.get(n.physicalProjectKey)??0)+1)}return t},[re,e.memberProjects,n]),{openProjectRemoteLink:we,openProjectJiraLink:Te,handleRemoveProject:Ee}=me({memberThreadCountByPhysicalKey:Ce,jiraProjectOpenUrlByProjectKey:q}),De=(0,G.useRef)(!1),Oe=(0,G.useCallback)(()=>{xe(!0)},[]),{openProjectMenu:B}=j({project:e,jiraProjectOpenUrlByProjectKey:q,suppressProjectClickForContextMenuRef:De,onOpenOverview:Oe,openProjectSettingsDialog:I.openProjectSettingsDialog,openProjectRemoteLink:we,openProjectJiraLink:Te,openProjectRenameDialog:R.openProjectRenameDialog,openProjectGroupingDialog:z.openProjectGroupingDialog,copyPathToClipboard:_e,handleRemoveProject:Ee}),ke=V(e=>B(e)),Ae=e=>{let t=s(r(e.environmentId,e.id));return(0,K.jsx)(X,{thread:e,pinned:g.has(t),onOpen:()=>{let t=r(e.environmentId,e.id);if(e.draftId){S.navigateToDraft(e.draftId,t);return}S.navigateToThread(t)},onMenu:()=>w(t)},t)};return(0,K.jsxs)(`section`,{"aria-label":e.displayName,className:L(t&&`pl-3`),children:[(0,K.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 px-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring hover:bg-accent/40`,"aria-expanded":m,onClick:()=>h(e.projectKey),...ke,children:[m?(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}):(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.displayName}),(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:b.length})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Project actions for ${e.displayName}`,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:e=>B({x:e.clientX,y:e.clientY}),children:(0,K.jsx)(W,{"aria-hidden":!0,className:`size-4`})})]}),m?ue?(0,K.jsx)(`div`,{className:`pl-3`,children:ue.map(e=>(0,K.jsx)(et,{worktreeNode:e,renderThreadRow:Ae},e.worktree.worktreeId))}):(0,K.jsx)(`div`,{role:`list`,"aria-label":`Threads in ${e.displayName}`,children:b.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No threads yet.`}):b.map(e=>Ae(e))}):null,(0,K.jsx)(H,{open:T!==null,onOpenChange:e=>{e||w(null)},title:T?.title??`Thread`,items:C?S.listThreadMenuActions(C):[],leadingSections:T?(0,K.jsx)(ie,{thread:T}):void 0,onAction:e=>{let t=C?a(C):null;w(null),t&&S.performThreadMenuAction(t,e)}}),(0,K.jsx)(Ne,{renamingThreadKey:S.renamingThreadKey,originalTitle:ae?.title??``,renamingTitle:S.renamingTitle,setRenamingTitle:S.setRenamingTitle,commitRename:S.commitRename,cancelRename:S.cancelRename}),(0,K.jsx)(F,{open:ve,projectName:e.displayName,memberProjects:e.memberProjects,initialTab:`overview`,onOpenChange:xe}),(0,K.jsx)(he,{open:I.projectSettingsOpen,target:I.projectSettingsTarget,title:I.projectSettingsTitle,customAvatarContentHash:I.projectSettingsCustomAvatarContentHash,projectAvatarUploadUnavailableReason:I.projectAvatarUploadUnavailableReason,preferredRemoteName:I.projectSettingsPreferredRemoteName,workspaceRoot:I.projectSettingsWorkspaceRoot,customSystemPrompt:I.projectSettingsCustomSystemPrompt,defaultModelSelection:I.projectSettingsDefaultModelSelection,saving:I.projectSettingsSaving,onClose:I.closeProjectSettingsDialog,onSave:()=>void I.submitProjectSettings(),onTitleChange:I.setProjectSettingsTitle,onWorkspaceRootChange:I.setProjectSettingsWorkspaceRoot,onCustomSystemPromptChange:I.setProjectSettingsCustomSystemPrompt,onDefaultModelSelectionChange:I.setProjectSettingsDefaultModelSelection,onPreferredRemoteChange:I.setProjectSettingsPreferredRemoteName,onPickWorkspaceRoot:()=>void I.pickProjectSettingsWorkspaceRoot(),onOpenRemote:I.openProjectRemoteByName,onUploadAvatar:I.uploadProjectAvatar,onRemoveAvatar:I.removeProjectAvatar}),(0,K.jsx)(P,{target:R.projectRenameTarget,title:R.projectRenameTitle,onTitleChange:R.setProjectRenameTitle,onClose:R.closeProjectRenameDialog,onSubmit:()=>void R.submitProjectRename()}),(0,K.jsx)(A,{target:z.projectGroupingTarget,selection:z.projectGroupingSelection,globalGroupingMode:ge.sidebarProjectGroupingMode,onSelectionChange:z.setProjectGroupingSelection,onClose:z.closeProjectGroupingDialog,onSave:z.saveProjectGroupingPreference})]})}function et(e){let t=(0,Pe.c)(23),{worktreeNode:n,renderThreadRow:r}=e,[i,a]=(0,G.useState)(!0),o=n.worktree.title??n.worktree.branch,s=!i,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(Y),l=e=>{if(e.key===`ArrowLeft`){e.preventDefault(),a(!0);return}e.key===`ArrowRight`&&(e.preventDefault(),a(!1))},t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=i?(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[2]=i,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(O,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),t[4]=d):d=t[4];let f;t[5]===o?f=t[6]:(f=(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),t[5]=o,t[6]=f);let p;t[7]===n.sessions.length?p=t[8]:(p=(0,K.jsx)(`span`,{className:`shrink-0 text-xs`,children:n.sessions.length}),t[7]=n.sessions.length,t[8]=p);let m;t[9]!==s||t[10]!==u||t[11]!==f||t[12]!==p?(m=(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":s,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:c,onKeyDown:l,children:[u,d,f,p]}),t[9]=s,t[10]=u,t[11]=f,t[12]=p,t[13]=m):m=t[13];let h;t[14]!==i||t[15]!==r||t[16]!==o||t[17]!==n.sessions?(h=i?null:(0,K.jsx)(`div`,{role:`list`,"aria-label":`Sessions in ${o}`,children:n.sessions.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No sessions yet.`}):n.sessions.map(e=>r(e))}),t[14]=i,t[15]=r,t[16]=o,t[17]=n.sessions,t[18]=h):h=t[18];let g;return t[19]!==m||t[20]!==h||t[21]!==o?(g=(0,K.jsxs)(`section`,{"aria-label":o,children:[m,h]}),t[19]=m,t[20]=h,t[21]=o,t[22]=g):g=t[22],g}function Y(e){return!e}function X(e){let t=(0,Pe.c)(28),{thread:n,pinned:r,onOpen:i,onMenu:a}=e,o=n.latestTurn?.completedAt??n.latestUserMessageAt??n.createdAt,s;t[0]===a?s=t[1]:(s=()=>a(),t[0]=a,t[1]=s);let c=V(s),l;t[2]===r?l=t[3]:(l=r?(0,K.jsx)(de,{"aria-label":`Pinned`,role:`img`,className:`size-3 shrink-0 text-muted-foreground`}):null,t[2]=r,t[3]=l);let u;t[4]===n.title?u=t[5]:(u=(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:n.title}),t[4]=n.title,t[5]=u);let d;t[6]!==l||t[7]!==u?(d=(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[l,u]}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]===n?f=t[10]:(f=(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(T,{thread:n,alwaysShowStatusLabel:!0}),(0,K.jsx)(w,{thread:n})]}),t[9]=n,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]===o?m=t[15]:(m=o?(0,K.jsx)(`span`,{className:`shrink-0 pr-1 text-[10px] text-muted-foreground`,children:R(o)}):null,t[14]=o,t[15]=m);let h;t[16]!==c||t[17]!==i||t[18]!==p||t[19]!==m?(h=(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-1 pl-3 text-left hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:i,...c,children:[p,m]}),t[16]=c,t[17]=i,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g=`Thread actions for ${n.title}`,_;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(W,{"aria-hidden":!0,className:`size-4`}),t[21]=_):_=t[21];let v;t[22]!==a||t[23]!==g?(v=(0,K.jsx)(`button`,{type:`button`,"aria-label":g,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:a,children:_}),t[22]=a,t[23]=g,t[24]=v):v=t[24];let y;return t[25]!==v||t[26]!==h?(y=(0,K.jsxs)(`div`,{role:`listitem`,className:`flex items-stretch`,children:[h,v]}),t[25]=v,t[26]=h,t[27]=y):y=t[27],y}export{J as PhoneHome};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,h as a,v as o,y as s}from"./env-B4arEvJg.js";import{Ft as c,Ht as l,Jt as u,Lt as d,Rn as f,S as p,bn as m,pt as h,yn as g,zn as _,zt as v}from"./runtime-CXut_g4p.js";import{a as y}from"./primary-BzLEg2w1.js";import{It as b,i as x}from"./composerDraftStore-CdJJZe42.js";import{G as ee,M as te,O as ne,W as re,n as S}from"./useHandleNewThread-DX2FtXcP.js";import{m as C,n as w,r as ie,t as T}from"./ThreadStatusIndicators-ZImeLExQ.js";import{t as ae}from"./settingsDialogStore-ygYoScKe.js";import{i as E}from"./uiStateStore-B6pjzSjj.js";import{f as D}from"./useRenderElement-DchFnsR8.js";import{t as oe}from"./chevron-down-B7C6FKzM.js";import{t as se}from"./chevron-right-BWYGybX9.js";import{l as ce}from"./WorkItemsTab-AOVwVvb7.js";import{t as le}from"./folder-DtsQoI9_.js";import{t as O}from"./git-branch-BKr-Ij4u.js";import{n as ue}from"./HostedConnectionControls-DxAXv0Hd.js";import{C as de,S as fe,a as k,b as pe,c as A,d as j,f as me,i as M,l as he,n as ge,o as N,r as _e,s as P,t as ve,u as F,x as ye,y as be}from"./sidebarProjectFolders-cnmz3B_-.js";import{t as xe}from"./plus-B2h-VEqh.js";import{t as I}from"./search-BGQsenCM.js";import{t as Se}from"./shallow-DWZCFNun.js";import{t as L}from"./utils-BofFIn5Y.js";import{i as R}from"./timestampFormat-8uPXS812.js";import{o as z}from"./sidebar-Dm6l2GA6.js";import{a as Ce,i as we,n as Te,o as Ee,s as De,t as Oe}from"./MobileSheet-CkeG6_SP.js";import{t as B}from"./GlassSurface-C3IIWMu9.js";import{t as V}from"./useLongPress-OGlhYKlH.js";import{i as ke,o as Ae,r as je,t as Me}from"./empty-DwzqNgCP.js";import{n as H,r as Ne,t as U}from"./usePhoneThreadActions-BEa3VzGG.js";var W=D(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),G=e(t(),1),Pe=n(),K=b();function Fe(e){let t=(0,Pe.c)(14),{label:n,actions:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=L(`pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center px-3 pb-[var(--app-dock-inset)] pl-safe pr-safe`,a),t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=L(B(`dock`),`pointer-events-auto flex min-w-0 max-w-full flex-col gap-2 rounded-[22px] border border-border/60 p-[var(--app-dock-padding)] text-foreground shadow-lg/10`),t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=r.map(Ie),t[3]=r,t[4]=c);let l;t[5]!==n||t[6]!==c?(l=(0,K.jsx)(`div`,{role:`group`,"aria-label":n,className:`flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,"data-slot":`mobile-dock-actions`,children:c}),t[5]=n,t[6]=c,t[7]=l):l=t[7];let u;t[8]!==i||t[9]!==l?(u=(0,K.jsxs)(`div`,{className:s,"data-slot":`mobile-dock`,children:[i,l]}),t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==o||t[12]!==u?(d=(0,K.jsx)(`div`,{className:o,"data-slot":`mobile-dock-layer`,children:u}),t[11]=o,t[12]=u,t[13]=d):d=t[13],d}function Ie(e){return(0,K.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled??!1,className:L(`flex min-h-[var(--app-dock-control-size)] min-w-[var(--app-dock-control-size)] shrink-0 items-center justify-center gap-1 rounded-full px-2 text-[11px] font-medium`,`transition-colors duration-[var(--app-motion-duration-chip)] ease-[var(--app-motion-ease)] motion-reduce:transition-none`,`hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:text-muted-foreground/60`,e.pressed===!0&&`bg-accent`),"data-slot":`mobile-dock-action`,onClick:e.onSelect,children:[e.icon,(0,K.jsx)(`span`,{className:`truncate`,children:e.shortLabel??e.label})]},e.id)}var q=new Map;function J(){let e=(0,Pe.c)(74),t=u(Se(c)),n=u(Se(d)),r=E(Qe),a=E(Ze),s=E(Xe),l=E(Ye),_=E(Je),v=f(qe),b=f(Ke),x=f(Ge),ee=y(),w=g(We),ie=m(Ue),T=ae(He),D=h(Ve),{handleNewThread:ce}=S(),[O,de]=(0,G.useState)(!1),fe;e[0]!==r||e[1]!==t?(fe=ne({items:t,preferredIds:r,getId:p}),e[0]=r,e[1]=t,e[2]=fe):fe=e[2];let k=fe,pe;e[3]!==k||e[4]!==x?(pe=ge({projects:k,settings:x}),e[3]=k,e[4]=x,e[5]=pe):pe=e[5];let A=pe,j;e[6]!==w||e[7]!==ie?(j=e=>{let t=ie[e],n=w[e];return t?.descriptor?.label??n?.label??null},e[6]=w,e[7]=ie,e[8]=j):j=e[8];let me;e[9]!==k||e[10]!==ee||e[11]!==x||e[12]!==j?(me=_e({projects:k,settings:x,primaryEnvironmentId:ee,resolveEnvironmentLabel:j}),e[9]=k,e[10]=ee,e[11]=x,e[12]=j,e[13]=me):me=e[13];let M=me,he;e[14]===M?he=e[15]:(he=new Map(M.map(Be)),e[14]=M,e[15]=he);let N=he,P;if(e[16]!==A||e[17]!==N||e[18]!==v||e[19]!==M||e[20]!==n){let t=M.map(ze),r;e[22]===A?r=e[23]:(r=e=>{let t=o(i(e.environmentId,e.projectId));return Object.assign({},e,{projectId:A.get(t)??t})},e[22]=A,e[23]=r);let a=n.filter(Re).map(r),s;e[24]===N?s=e[25]:(s=e=>{let t=N.get(e.id);return t?[t]:[]},e[24]=N,e[25]=s),P=re(t,a,v).flatMap(s),e[16]=A,e[17]=N,e[18]=v,e[19]=M,e[20]=n,e[21]=P}else P=e[21];let F=P,ye;e[26]!==s||e[27]!==a||e[28]!==l||e[29]!==v||e[30]!==F?(ye=ve({projects:F,projectFoldersById:a,projectFolderOrder:s,projectTreeOrder:l,projectSortOrder:v}),e[26]=s,e[27]=a,e[28]=l,e[29]=v,e[30]=F,e[31]=ye):ye=e[31];let be=ye,L;e[32]!==b||e[33]!==ce?(L=e=>{let t=e.memberProjects[0];t&&(de(!1),ce(i(t.environmentId,t.id),{envMode:te({defaultEnvMode:b})}))},e[32]=b,e[33]=ce,e[34]=L):L=e[34];let R=L,B;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsxs)(`header`,{className:`flex items-center gap-1.5 border-b border-border pr-[calc(env(safe-area-inset-right)+0.5rem)] pb-2 pl-[calc(env(safe-area-inset-left)+0.75rem)] pt-[calc(env(safe-area-inset-top)+0.5rem)]`,children:[(0,K.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold`,children:`Threads`}),(0,K.jsx)(ue,{})]}),e[35]=B):B=e[35];let V;e[36]!==be||e[37]!==_?(V=be.length===0?(0,K.jsx)(Me,{className:`flex-1`,children:(0,K.jsxs)(ke,{children:[(0,K.jsx)(Ae,{className:`text-base`,children:`No projects yet`}),(0,K.jsx)(je,{className:`mt-1 text-sm`,children:`Projects opened on this node appear here with their threads.`})]})}):be.map(e=>e.kind===`project`?(0,K.jsx)($e,{project:e.project},e.itemId):(0,K.jsxs)(`section`,{"aria-label":e.folder.name,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm font-medium text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-expanded":e.folder.expanded,onClick:()=>_(e.folder.id,!e.folder.expanded),children:[e.folder.expanded?(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.folder.name})]}),e.folder.expanded?e.projects.map(Le):null]},e.itemId)),e[36]=be,e[37]=_,e[38]=V):V=e[38];let H;e[39]===V?H=e[40]:(H=(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[B,(0,K.jsx)(`div`,{"data-testid":`phone-home-list`,className:`app-dock-scroll-clearance flex min-h-0 flex-1 flex-col overflow-y-auto`,children:V})]}),e[39]=V,e[40]=H);let Ne;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,K.jsx)(I,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[41]=Ne):Ne=e[41];let U;e[42]===D?U=e[43]:(U={id:`search`,label:`Search threads`,shortLabel:`Search`,icon:Ne,onSelect:()=>D(!0)},e[42]=D,e[43]=U);let W;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,K.jsx)(xe,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[44]=W):W=e[44];let Ie=F.length===0,q;e[45]!==F[0]||e[46]!==F.length||e[47]!==R?(q=()=>{if(F.length===1&&F[0]){R(F[0]);return}de(!0)},e[45]=F[0],e[46]=F.length,e[47]=R,e[48]=q):q=e[48];let J;e[49]!==Ie||e[50]!==q?(J={id:`new-thread`,label:`New thread`,icon:W,disabled:Ie,onSelect:q},e[49]=Ie,e[50]=q,e[51]=J):J=e[51];let et;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,K.jsx)(C,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[52]=et):et=e[52];let Y;e[53]===T?Y=e[54]:(Y={id:`settings`,label:`Open settings`,shortLabel:`Settings`,icon:et,onSelect:()=>T()},e[53]=T,e[54]=Y);let X;e[55]!==U||e[56]!==J||e[57]!==Y?(X=(0,K.jsx)(Fe,{label:`Home actions`,actions:[U,J,Y]}),e[55]=U,e[56]=J,e[57]=Y,e[58]=X):X=e[58];let tt;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,K.jsxs)(we,{children:[(0,K.jsx)(Ee,{children:`New thread`}),(0,K.jsx)(Te,{children:`Choose a project for the new thread.`})]}),e[59]=tt):tt=e[59];let Z;if(e[60]!==F||e[61]!==R){let t;e[63]===R?t=e[64]:(t=e=>(0,K.jsx)(De,{label:e.displayName,onClick:()=>R(e)},e.projectKey),e[63]=R,e[64]=t),Z=F.map(t),e[60]=F,e[61]=R,e[62]=Z}else Z=e[62];let Q;e[65]===Z?Q=e[66]:(Q=(0,K.jsx)(Ce,{children:(0,K.jsx)(`div`,{role:`group`,"aria-label":`Projects`,className:`space-y-0.5`,children:Z})}),e[65]=Z,e[66]=Q);let $;e[67]!==O||e[68]!==Q?($=(0,K.jsxs)(Oe,{open:O,onOpenChange:de,label:`New thread`,children:[tt,Q]}),e[67]=O,e[68]=Q,e[69]=$):$=e[69];let nt;return e[70]!==H||e[71]!==X||e[72]!==$?(nt=(0,K.jsxs)(z,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:[H,X,$]}),e[70]=H,e[71]=X,e[72]=$,e[73]=nt):nt=e[73],nt}function Le(e){return(0,K.jsx)($e,{project:e,nested:!0},e.projectKey)}function Re(e){return e.archivedAt===null}function ze(e){return Object.assign({},e,{id:e.projectKey})}function Be(e){return[e.projectKey,e]}function Ve(e){return e.setOpen}function He(e){return e.openSettings}function Ue(e){return e.byId}function We(e){return e.byId}function Ge(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function Ke(e){return e.defaultThreadEnvMode}function qe(e){return e.sidebarProjectSortOrder}function Je(e){return e.setProjectFolderExpanded}function Ye(e){return e.projectTreeOrder}function Xe(e){return e.projectFolderOrder}function Ze(e){return e.projectFoldersById}function Qe(e){return e.projectOrder}function $e({project:e,nested:t=!1}){let n=u(Se((0,G.useMemo)(()=>t=>v(t,e.memberProjectRefs),[e.memberProjectRefs]))),c=x((0,G.useMemo)(()=>ye(e),[e])),d=f(e=>e.sidebarThreadSortOrder),p=E(e=>e.pinnedThreadKeys),m=E(t=>t.projectExpandedById[e.projectKey]??!0),h=E(e=>e.toggleProject),g=(0,G.useMemo)(()=>new Set(Object.entries(p).flatMap(([e,t])=>t?[e]:[])),[p]),y=(0,G.useMemo)(()=>fe(n,c).filter(e=>e.archivedAt===null),[c,n]),b=(0,G.useMemo)(()=>ee({threads:y,sortOrder:d,pinnedThreadKeys:g,getThreadKey:e=>s(r(e.environmentId,e.id))}),[g,d,y]),te=(0,G.useMemo)(()=>new Map(b.map(e=>[s(r(e.environmentId,e.id)),e])),[b]),ne=(0,G.useRef)(te);ne.current=te;let re=(0,G.useMemo)(()=>new Map(e.memberProjects.map(e=>[o(i(e.environmentId,e.id)),e])),[e.memberProjects]),S=U({sidebarThreadByKeyRef:ne,memberProjectByScopedKey:re,projectCwd:e.cwd??null}),[C,w]=(0,G.useState)(null),T=C?te.get(C)??null:null,ae=S.renamingThreadKey?te.get(S.renamingThreadKey)??null:null,D=u(Se((0,G.useMemo)(()=>t=>l(t,e.memberProjectRefs),[e.memberProjectRefs]))),le=(0,G.useMemo)(()=>pe({project:e,threads:b,worktrees:D}),[e,b,D]),O=be({projects:[le.project],threads:le.threads,worktrees:le.worktrees}).projects[0]??null,ue=O&&O.isGitRepo&&O.worktrees.length>1?O.worktrees:null,{updateSettings:de}=_(),ge=f(e=>({sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides})),{copyPathToClipboard:_e}=ce(),[ve,xe]=(0,G.useState)(!1),I=M(),R=k(),z=N({projectGroupingSettings:ge,updateSettings:de}),Ce=(0,G.useMemo)(()=>{let t=new Map(e.memberProjects.map(e=>[e.physicalProjectKey,0]));for(let e of n){let n=re.get(o(i(e.environmentId,e.projectId)));n&&t.set(n.physicalProjectKey,(t.get(n.physicalProjectKey)??0)+1)}return t},[re,e.memberProjects,n]),{openProjectRemoteLink:we,openProjectJiraLink:Te,handleRemoveProject:Ee}=me({memberThreadCountByPhysicalKey:Ce,jiraProjectOpenUrlByProjectKey:q}),De=(0,G.useRef)(!1),Oe=(0,G.useCallback)(()=>{xe(!0)},[]),{openProjectMenu:B}=j({project:e,jiraProjectOpenUrlByProjectKey:q,suppressProjectClickForContextMenuRef:De,onOpenOverview:Oe,openProjectSettingsDialog:I.openProjectSettingsDialog,openProjectRemoteLink:we,openProjectJiraLink:Te,openProjectRenameDialog:R.openProjectRenameDialog,openProjectGroupingDialog:z.openProjectGroupingDialog,copyPathToClipboard:_e,handleRemoveProject:Ee}),ke=V(e=>B(e)),Ae=e=>{let t=s(r(e.environmentId,e.id));return(0,K.jsx)(X,{thread:e,pinned:g.has(t),onOpen:()=>{let t=r(e.environmentId,e.id);if(e.draftId){S.navigateToDraft(e.draftId,t);return}S.navigateToThread(t)},onMenu:()=>w(t)},t)};return(0,K.jsxs)(`section`,{"aria-label":e.displayName,className:L(t&&`pl-3`),children:[(0,K.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 px-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring hover:bg-accent/40`,"aria-expanded":m,onClick:()=>h(e.projectKey),...ke,children:[m?(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}):(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.displayName}),(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:b.length})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Project actions for ${e.displayName}`,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:e=>B({x:e.clientX,y:e.clientY}),children:(0,K.jsx)(W,{"aria-hidden":!0,className:`size-4`})})]}),m?ue?(0,K.jsx)(`div`,{className:`pl-3`,children:ue.map(e=>(0,K.jsx)(et,{worktreeNode:e,renderThreadRow:Ae},e.worktree.worktreeId))}):(0,K.jsx)(`div`,{role:`list`,"aria-label":`Threads in ${e.displayName}`,children:b.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No threads yet.`}):b.map(e=>Ae(e))}):null,(0,K.jsx)(H,{open:T!==null,onOpenChange:e=>{e||w(null)},title:T?.title??`Thread`,items:C?S.listThreadMenuActions(C):[],leadingSections:T?(0,K.jsx)(ie,{thread:T}):void 0,onAction:e=>{let t=C?a(C):null;w(null),t&&S.performThreadMenuAction(t,e)}}),(0,K.jsx)(Ne,{renamingThreadKey:S.renamingThreadKey,originalTitle:ae?.title??``,renamingTitle:S.renamingTitle,setRenamingTitle:S.setRenamingTitle,commitRename:S.commitRename,cancelRename:S.cancelRename}),(0,K.jsx)(F,{open:ve,projectName:e.displayName,memberProjects:e.memberProjects,initialTab:`overview`,onOpenChange:xe}),(0,K.jsx)(he,{open:I.projectSettingsOpen,target:I.projectSettingsTarget,title:I.projectSettingsTitle,customAvatarContentHash:I.projectSettingsCustomAvatarContentHash,projectAvatarUploadUnavailableReason:I.projectAvatarUploadUnavailableReason,preferredRemoteName:I.projectSettingsPreferredRemoteName,workspaceRoot:I.projectSettingsWorkspaceRoot,customSystemPrompt:I.projectSettingsCustomSystemPrompt,defaultModelSelection:I.projectSettingsDefaultModelSelection,saving:I.projectSettingsSaving,onClose:I.closeProjectSettingsDialog,onSave:()=>void I.submitProjectSettings(),onTitleChange:I.setProjectSettingsTitle,onWorkspaceRootChange:I.setProjectSettingsWorkspaceRoot,onCustomSystemPromptChange:I.setProjectSettingsCustomSystemPrompt,onDefaultModelSelectionChange:I.setProjectSettingsDefaultModelSelection,onPreferredRemoteChange:I.setProjectSettingsPreferredRemoteName,onPickWorkspaceRoot:()=>void I.pickProjectSettingsWorkspaceRoot(),onOpenRemote:I.openProjectRemoteByName,onUploadAvatar:I.uploadProjectAvatar,onRemoveAvatar:I.removeProjectAvatar}),(0,K.jsx)(P,{target:R.projectRenameTarget,title:R.projectRenameTitle,onTitleChange:R.setProjectRenameTitle,onClose:R.closeProjectRenameDialog,onSubmit:()=>void R.submitProjectRename()}),(0,K.jsx)(A,{target:z.projectGroupingTarget,selection:z.projectGroupingSelection,globalGroupingMode:ge.sidebarProjectGroupingMode,onSelectionChange:z.setProjectGroupingSelection,onClose:z.closeProjectGroupingDialog,onSave:z.saveProjectGroupingPreference})]})}function et(e){let t=(0,Pe.c)(23),{worktreeNode:n,renderThreadRow:r}=e,[i,a]=(0,G.useState)(!0),o=n.worktree.title??n.worktree.branch,s=!i,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(Y),l=e=>{if(e.key===`ArrowLeft`){e.preventDefault(),a(!0);return}e.key===`ArrowRight`&&(e.preventDefault(),a(!1))},t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=i?(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[2]=i,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(O,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),t[4]=d):d=t[4];let f;t[5]===o?f=t[6]:(f=(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),t[5]=o,t[6]=f);let p;t[7]===n.sessions.length?p=t[8]:(p=(0,K.jsx)(`span`,{className:`shrink-0 text-xs`,children:n.sessions.length}),t[7]=n.sessions.length,t[8]=p);let m;t[9]!==s||t[10]!==u||t[11]!==f||t[12]!==p?(m=(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":s,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:c,onKeyDown:l,children:[u,d,f,p]}),t[9]=s,t[10]=u,t[11]=f,t[12]=p,t[13]=m):m=t[13];let h;t[14]!==i||t[15]!==r||t[16]!==o||t[17]!==n.sessions?(h=i?null:(0,K.jsx)(`div`,{role:`list`,"aria-label":`Sessions in ${o}`,children:n.sessions.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No sessions yet.`}):n.sessions.map(e=>r(e))}),t[14]=i,t[15]=r,t[16]=o,t[17]=n.sessions,t[18]=h):h=t[18];let g;return t[19]!==m||t[20]!==h||t[21]!==o?(g=(0,K.jsxs)(`section`,{"aria-label":o,children:[m,h]}),t[19]=m,t[20]=h,t[21]=o,t[22]=g):g=t[22],g}function Y(e){return!e}function X(e){let t=(0,Pe.c)(28),{thread:n,pinned:r,onOpen:i,onMenu:a}=e,o=n.latestTurn?.completedAt??n.latestUserMessageAt??n.createdAt,s;t[0]===a?s=t[1]:(s=()=>a(),t[0]=a,t[1]=s);let c=V(s),l;t[2]===r?l=t[3]:(l=r?(0,K.jsx)(de,{"aria-label":`Pinned`,role:`img`,className:`size-3 shrink-0 text-muted-foreground`}):null,t[2]=r,t[3]=l);let u;t[4]===n.title?u=t[5]:(u=(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:n.title}),t[4]=n.title,t[5]=u);let d;t[6]!==l||t[7]!==u?(d=(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[l,u]}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]===n?f=t[10]:(f=(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(T,{thread:n,alwaysShowStatusLabel:!0}),(0,K.jsx)(w,{thread:n})]}),t[9]=n,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]===o?m=t[15]:(m=o?(0,K.jsx)(`span`,{className:`shrink-0 pr-1 text-[10px] text-muted-foreground`,children:R(o)}):null,t[14]=o,t[15]=m);let h;t[16]!==c||t[17]!==i||t[18]!==p||t[19]!==m?(h=(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-1 pl-3 text-left hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:i,...c,children:[p,m]}),t[16]=c,t[17]=i,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g=`Thread actions for ${n.title}`,_;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(W,{"aria-hidden":!0,className:`size-4`}),t[21]=_):_=t[21];let v;t[22]!==a||t[23]!==g?(v=(0,K.jsx)(`button`,{type:`button`,"aria-label":g,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:a,children:_}),t[22]=a,t[23]=g,t[24]=v):v=t[24];let y;return t[25]!==v||t[26]!==h?(y=(0,K.jsxs)(`div`,{role:`listitem`,className:`flex items-stretch`,children:[h,v]}),t[25]=v,t[26]=h,t[27]=y):y=t[27],y}export{J as PhoneHome};
@@ -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{n as i}from"./env-B4arEvJg.js";import{N as a}from"./runtime-DKwoXpJv.js";import{It as o}from"./composerDraftStore-CdJJZe42.js";import{t as s}from"./settingsDialogStore-ygYoScKe.js";import{t as c}from"./activity-1CkdQG5u.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./SettingsPanels-BmhZ8u4B.js";import{m as h,p as g}from"./desktopUpdateAtoms-C82GmR67.js";import{t as _}from"./arrow-left-Dtj9PfsA.js";import{t as v}from"./chart-column-Dw6ACmXM.js";import{n as y}from"./loader-circle-CrtHFAvM.js";import{t as b}from"./chevron-down-B7C6FKzM.js";import{t as ee}from"./chevron-right-BWYGybX9.js";import{t as x}from"./git-branch-BKr-Ij4u.js";import{t as S}from"./keyboard-BqeRMHfL.js";import{t as C}from"./palette-BSD_aJZg.js";import{t as w}from"./settings-2-CZQg_KUQ.js";import{t as T}from"./server-JApJpgLa.js";import{t as E}from"./shield-IZEIJ8r7.js";import{t as te}from"./sparkles-CAf3oJ5S.js";import{t as D}from"./user-round-Cpzx8pSw.js";import{t as O}from"./x-C1Cemsov.js";import{t as k}from"./scroll-area-Drsa8bNB.js";import{t as A}from"./button-BAbJxRzt.js";import{o as ne,t as re}from"./sheet-BO78gIKZ.js";import{a as j,i as M,n as N,o as P,s as F,t as I}from"./MobileSheet-CkeG6_SP.js";import{l as L,m as ie,o as R,p as z,r as B,s as V,x as H}from"./appearancePreferences-COvj0WMT.js";import{n as ae,o as oe}from"./settingsSections.logic-F8RXVmAq.js";import{n as se,t as ce}from"./useAppearancePreference-BlLlxQl7.js";var U=r(),W=e(t(),1),G=o(),K=`System reduce transparency is on, showing ${z.find(e=>e.value==="default")?.label??`Solid`}`,q=[{key:`surfaceTransparency`,label:`Material`,description:`How much of the content behind a surface shows through.`,options:L,scale:z},{key:`fontSizeBase`,label:`Text size`,description:`The base type size for the whole interface.`,options:R,scale:R},{key:`dockDensity`,label:`Dock density`,description:`How much padding the dock capsule carries around its controls.`,options:B,scale:B},{key:`motion`,label:`Motion`,description:`Reduce sheet and stack animation beyond the system setting.`,options:V,scale:V}];function le(e){let t=(0,U.c)(42),{control:n}=e,[r,i]=(0,W.useState)(!1),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={effective:!0},t[0]=a):a=t[0];let o=ce(n.key,a),s=se(),c=n.key===`surfaceTransparency`&&s?K:null,l;t[1]!==n.options||t[2]!==o?(l=n.options.find(e=>e.value===o)??null,t[1]=n.options,t[2]=o,t[3]=l):l=t[3];let u=l,d;t[4]!==n.scale||t[5]!==u||t[6]!==o?(d=u??n.scale.find(e=>e.value===o)??null,t[4]=n.scale,t[5]=u,t[6]=o,t[7]=d):d=t[7];let f=d,p=u!==null,m;t[8]===n.key?m=t[9]:(m=e=>{H(n.key,e),ie(),i(!1)},t[8]=n.key,t[9]=m);let h=m,g=c&&f?`${f.label} · ${c}`:f?.label??null,_,v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground/60`}),v=()=>i(!0),t[10]=_,t[11]=v):(_=t[10],v=t[11]);let b;t[12]!==n.label||t[13]!==g?(b=(0,G.jsx)(F,{label:n.label,secondaryText:g,trailing:_,onClick:v}),t[12]=n.label,t[13]=g,t[14]=b):b=t[14];let x=n.label,S;t[15]===n.label?S=t[16]:(S=(0,G.jsx)(P,{children:n.label}),t[15]=n.label,t[16]=S);let C=!p&&f?` Currently ${f.label}.`:null,w=c?` ${c}.`:null,T;t[17]!==n.description||t[18]!==C||t[19]!==w?(T=(0,G.jsxs)(N,{children:[n.description,C,w]}),t[17]=n.description,t[18]=C,t[19]=w,t[20]=T):T=t[20];let E;t[21]!==S||t[22]!==T?(E=(0,G.jsxs)(M,{children:[S,T]}),t[21]=S,t[22]=T,t[23]=E):E=t[23];let te=n.label,D;if(t[24]!==n.options||t[25]!==h||t[26]!==o){let e;t[28]!==h||t[29]!==o?(e=e=>(0,G.jsx)(F,{label:e.label,secondaryText:e.description,selected:e.value===o,trailing:e.value===o?(0,G.jsx)(y,{"aria-hidden":!0,className:`size-4`}):null,onClick:()=>h(e.value)},e.value),t[28]=h,t[29]=o,t[30]=e):e=t[30],D=n.options.map(e),t[24]=n.options,t[25]=h,t[26]=o,t[27]=D}else D=t[27];let O;t[31]!==n.label||t[32]!==D?(O=(0,G.jsx)(j,{children:(0,G.jsx)(`div`,{role:`group`,"aria-label":te,className:`flex flex-col`,children:D})}),t[31]=n.label,t[32]=D,t[33]=O):O=t[33];let k;t[34]!==n.label||t[35]!==r||t[36]!==E||t[37]!==O?(k=(0,G.jsxs)(I,{open:r,onOpenChange:i,label:x,detent:`medium`,children:[E,O]}),t[34]=n.label,t[35]=r,t[36]=E,t[37]=O,t[38]=k):k=t[38];let A;return t[39]!==k||t[40]!==b?(A=(0,G.jsxs)(G.Fragment,{children:[b,k]}),t[39]=k,t[40]=b,t[41]=A):A=t[41],A}function ue(){let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(`div`,{role:`group`,"aria-label":`Phone appearance`,className:`flex flex-col`,children:q.map(de)}),e[0]=t):t=e[0],t}function de(e){return(0,G.jsx)(le,{control:e},e.key)}var fe=[{id:`account`,label:`Account`,icon:D},{id:`general`,label:`General`,icon:w},{id:`inbox`,label:`Inbox`,icon:te},{id:`providers`,label:`Providers`,icon:f},{id:`opinionated-plugins`,label:`Plugins`,icon:u},{id:`mcp-servers`,label:`MCP Servers`,icon:T},{id:`appearance`,label:`Appearance`,icon:C},{id:`keybindings`,label:`Keybindings`,icon:S},{id:`source-control`,label:`Source Control`,icon:x},{id:`connections`,label:`Connections`,icon:l},{id:`security`,label:`Security`,icon:E},{id:`statistics`,label:`Statistics`,icon:v},{id:`archived`,label:`Archive`,icon:h}],pe=[{id:`diagnostics`,label:`Diagnostics`,icon:c}],me=[...fe,...pe];me.map(e=>e.id),fe.map(e=>e.label);var he=new Set([`general`,`providers`,`appearance`]),J=`general`,Y=(0,W.lazy)(()=>n(()=>import(`./AccountSettings-BUoiS8x1.js`).then(e=>({default:e.AccountSettingsPanel})),[])),ge=(0,W.lazy)(()=>n(()=>import(`./ProvidersSettingsPanel-v2SvoEGx.js`).then(e=>({default:e.ProvidersSettingsPanel})),[])),X=(0,W.lazy)(()=>n(()=>import(`./AiFocusSettings-Cz1Uqn7a.js`).then(e=>({default:e.AiFocusSettings})),[])),_e=(0,W.lazy)(()=>n(()=>import(`./OpinionatedPluginsSettings-CeoSmZ90.js`).then(e=>({default:e.OpinionatedPluginsSettingsPanel})),[])),ve=(0,W.lazy)(()=>n(()=>import(`./McpServersSettings-Bc61hRUY.js`).then(e=>({default:e.McpServersSettings})),[])),Z=(0,W.lazy)(()=>n(()=>import(`./AppearanceSettings-CYbSApl4.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),ye=(0,W.lazy)(()=>n(()=>import(`./KeybindingsSettings-CYj67N2D.js`).then(e=>({default:e.KeybindingsSettingsPanel})),[])),be=(0,W.lazy)(()=>n(()=>import(`./SourceControlSettings-DvPydmxX.js`).then(e=>({default:e.SourceControlSettingsPanel})),[])),xe=(0,W.lazy)(()=>n(()=>import(`./ConnectionsSettings--CbTzkTn.js`).then(e=>({default:e.ConnectionsSettings})),[])),Q=(0,W.lazy)(()=>n(()=>import(`./NodeSecuritySettings-DMkkTgfg.js`).then(e=>({default:e.NodeSecuritySettings})),[])),$=(0,W.lazy)(()=>n(()=>import(`./DiagnosticsSettings-C74u3ce5.js`).then(e=>({default:e.DiagnosticsSettings})),[])),Se=(0,W.lazy)(()=>n(()=>import(`./StatisticsPanel-D-uNJcdj.js`).then(e=>({default:e.StatisticsPanel})),[]));function Ce(e){let t=(0,U.c)(44),{section:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`div`,{className:`flex min-h-80 items-center justify-center text-muted-foreground text-sm`,children:`Loading settings...`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n===`account`?(0,G.jsx)(Y,{}):null,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=n===`general`?(0,G.jsx)(d,{}):null,t[3]=n,t[4]=a);let o;t[5]===n?o=t[6]:(o=n===`inbox`?(0,G.jsx)(X,{}):null,t[5]=n,t[6]=o);let s;t[7]===n?s=t[8]:(s=n===`providers`?(0,G.jsx)(ge,{}):null,t[7]=n,t[8]=s);let c;t[9]===n?c=t[10]:(c=n===`opinionated-plugins`?(0,G.jsx)(_e,{}):null,t[9]=n,t[10]=c);let l;t[11]===n?l=t[12]:(l=n===`mcp-servers`?(0,G.jsx)(ve,{}):null,t[11]=n,t[12]=l);let u;t[13]===n?u=t[14]:(u=n===`appearance`?(0,G.jsx)(Z,{}):null,t[13]=n,t[14]=u);let f;t[15]===n?f=t[16]:(f=n===`keybindings`?(0,G.jsx)(ye,{}):null,t[15]=n,t[16]=f);let p;t[17]===n?p=t[18]:(p=n===`source-control`?(0,G.jsx)(be,{}):null,t[17]=n,t[18]=p);let h;t[19]===n?h=t[20]:(h=n===`connections`?(0,G.jsx)(xe,{}):null,t[19]=n,t[20]=h);let g;t[21]===n?g=t[22]:(g=n===`security`?(0,G.jsx)(Q,{}):null,t[21]=n,t[22]=g);let _;t[23]===n?_=t[24]:(_=n===`diagnostics`?(0,G.jsx)($,{presentation:`phone-legacy`}):null,t[23]=n,t[24]=_);let v;t[25]===n?v=t[26]:(v=n===`statistics`?(0,G.jsx)(Se,{}):null,t[25]=n,t[26]=v);let y;t[27]===n?y=t[28]:(y=n===`archived`?(0,G.jsx)(m,{}):null,t[27]=n,t[28]=y);let b;return t[29]!==p||t[30]!==h||t[31]!==g||t[32]!==_||t[33]!==v||t[34]!==y||t[35]!==i||t[36]!==a||t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==l||t[41]!==u||t[42]!==f?(b=(0,G.jsxs)(W.Suspense,{fallback:r,children:[i,a,o,s,c,l,u,f,p,h,g,_,v,y]}),t[29]=p,t[30]=h,t[31]=g,t[32]=_,t[33]=v,t[34]=y,t[35]=i,t[36]=a,t[37]=o,t[38]=s,t[39]=c,t[40]=l,t[41]=u,t[42]=f,t[43]=b):b=t[43],b}function we(e){let t=(0,U.c)(6),{onRestored:n}=e,{changedSettingLabels:r,restoreDefaults:i}=p(n),a=r.length===0,o;t[0]===i?o=t[1]:(o=()=>void i(),t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(g,{className:`size-3.5`}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,G.jsxs)(A,{size:`sm`,variant:`outline`,className:`min-h-11 shrink-0`,disabled:a,onClick:o,children:[s,`Restore defaults`]}),t[3]=a,t[4]=o,t[5]=c):c=t[5],c}var Te=`w-full min-w-0 max-w-none border-s-0 p-0 pt-safe pl-safe pr-safe pb-[max(env(safe-area-inset-bottom),var(--app-keyboard-inset,0px))] wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]`;function Ee(){let e=(0,U.c)(39),t=s(Fe),n=s(Pe),r=s(Ne),o=s(Me),c=a(je),l=a(Ae),u=a(ke),d;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=i(),e[0]=d):d=e[0];let f=d,p;e[1]!==l||e[2]!==c||e[3]!==u?(p=ae(c,l,u),e[1]=l,e[2]=c,e[3]=u,e[4]=p):p=e[4];let m=p,h;e[5]===m?h=e[6]:(h=e=>oe(e,{hosted:f,role:m}),e[5]=m,e[6]=h);let g=h,v;e[7]===g?v=e[8]:(v=e=>g(e.id),e[7]=g,e[8]=v);let y=fe.filter(v),x;e[9]===g?x=e[10]:(x=e=>g(e.id),e[9]=g,e[10]=x);let S=pe.filter(x),[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(!1),[te,D]=(0,W.useState)(!1);t!==te&&(D(t),t&&(w(n===J?null:n),E(!1)));let j=(0,W.useRef)(n),M,N;e[11]!==t||e[12]!==n?(M=()=>{let e=j.current;j.current=n,t&&n!==e&&w(n)},N=[t,n],e[11]=t,e[12]=n,e[13]=M,e[14]=N):(M=e[13],N=e[14]),(0,W.useEffect)(M,N);let P,F;e[15]!==t||e[16]!==o?(P=()=>{t||s.getState().section!==J&&(o(J),j.current=J)},F=[t,o],e[15]=t,e[16]=o,e[17]=P,e[18]=F):(P=e[17],F=e[18]),(0,W.useEffect)(P,F);let I=(0,W.useRef)(null),L=(0,W.useRef)(new Map),ie=(0,W.useRef)(null),R=(0,W.useRef)(null),z;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{R.current!==null&&window.cancelAnimationFrame(R.current);let t=0,n=0,r=()=>{R.current=null;let i=e();if(!(!i||!i.isConnected)){if(document.activeElement===i){if(n+=1,n>=2)return}else if(n=0,i.focus(),t+=1,t>=6)return;R.current=window.requestAnimationFrame(r)}};R.current=window.requestAnimationFrame(r)},e[19]=z):z=e[19];let B=z,V,H;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>()=>{R.current!==null&&window.cancelAnimationFrame(R.current)},H=[],e[20]=V,e[21]=H):(V=e[20],H=e[21]),(0,W.useEffect)(V,H);let se=e=>{o(e),w(e),B(()=>I.current)},ce=()=>{let e=ie.current;w(null),j.current=J,o(J),B(()=>e?L.current.get(e)??null:null)},K;e[22]===C?K=e[23]:(K=[C],e[22]=C,e[23]=K),(0,W.useEffect)(()=>{C!==null&&(ie.current=C)},K);let q;e[24]!==t||e[25]!==C?(q=[t,C,B],e[24]=t,e[25]=C,e[26]=q):q=e[26],(0,W.useEffect)(()=>{t&&C!==null&&B(()=>I.current)},q);let[le,de]=(0,W.useState)(0),Y;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>{de(Oe)},e[27]=Y):Y=e[27];let ge=Y,X=C!==null&&g(C)?me.find(e=>e.id===C)??null:null,_e=e=>{let t=e.icon;return(0,G.jsxs)(`button`,{type:`button`,ref:t=>{t?L.current.set(e.id,t):L.current.delete(e.id)},className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>se(e.id),children:[(0,G.jsx)(t,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground/60`})]},e.id)},ve=re,Z;e[28]===r?Z=e[29]:(Z=e=>{e||r()},e[28]=r,e[29]=Z);let ye=ne,be=Te,xe=X?(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(A,{size:`icon`,variant:`ghost`,"aria-label":`Back to settings`,className:`shrink-0`,onClick:ce,children:(0,G.jsx)(_,{})}),(0,G.jsx)(`h1`,{ref:I,tabIndex:-1,className:`min-w-0 flex-1 truncate text-sm font-medium outline-none`,children:X.label}),he.has(X.id)?(0,G.jsx)(we,{onRestored:ge}):null]}),(0,G.jsx)(k,{className:`min-h-0 min-w-0 flex-1`,children:(0,G.jsx)(`div`,{className:`flex flex-col`,children:(0,G.jsx)(Ce,{section:X.id})},le)})]}):(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(`h1`,{className:`min-w-0 flex-1 truncate px-2 text-base font-semibold`,children:`Settings`}),(0,G.jsx)(A,{size:`icon`,variant:`ghost`,"aria-label":`Close settings`,className:`shrink-0`,onClick:r,children:(0,G.jsx)(O,{})})]}),(0,G.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`min-h-0 flex-1 overflow-y-auto p-2`,children:[(0,G.jsx)(`div`,{role:`group`,"aria-label":`Settings sections`,className:`space-y-0.5`,children:y.map(e=>_e(e))}),S.length>0?(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":T,className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm font-medium text-muted-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>E(De),children:[T?(0,G.jsx)(b,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Advanced`})]}),T?(0,G.jsx)(`div`,{role:`group`,"aria-label":`Advanced sections`,className:`space-y-0.5`,children:S.map(e=>_e(e))}):null]}):null,(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsx)(`h2`,{className:`px-2 py-1 font-medium text-muted-foreground text-xs`,children:`Phone appearance`}),(0,G.jsx)(ue,{})]})]})]}),Q;e[30]!==ye||e[31]!==be||e[32]!==xe?(Q=(0,G.jsx)(ye,{side:`right`,showCloseButton:!1,"aria-label":`Settings`,"data-testid":`phone-settings-surface`,className:be,children:xe}),e[30]=ye,e[31]=be,e[32]=xe,e[33]=Q):Q=e[33];let $;return e[34]!==ve||e[35]!==t||e[36]!==Z||e[37]!==Q?($=(0,G.jsx)(ve,{open:t,onOpenChange:Z,children:Q}),e[34]=ve,e[35]=t,e[36]=Z,e[37]=Q,e[38]=$):$=e[38],$}function De(e){return!e}function Oe(e){return e+1}function ke(e){return e.transportStatus}function Ae(e){return e.directoryStatus}function je(e){return e.effectiveRole}function Me(e){return e.setSection}function Ne(e){return e.closeSettings}function Pe(e){return e.section}function Fe(e){return e.open}export{Ee as PhoneSettingsSurface};
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{n as i}from"./env-B4arEvJg.js";import{N as a}from"./runtime-CXut_g4p.js";import{It as o}from"./composerDraftStore-CdJJZe42.js";import{t as s}from"./settingsDialogStore-ygYoScKe.js";import{t as c}from"./activity-1CkdQG5u.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./SettingsPanels-Dr4f2y9l.js";import{m as h,p as g}from"./desktopUpdateAtoms-CyfPW2jg.js";import{t as _}from"./arrow-left-Dtj9PfsA.js";import{t as v}from"./chart-column-Dw6ACmXM.js";import{n as y}from"./loader-circle-CrtHFAvM.js";import{t as b}from"./chevron-down-B7C6FKzM.js";import{t as ee}from"./chevron-right-BWYGybX9.js";import{t as x}from"./git-branch-BKr-Ij4u.js";import{t as S}from"./keyboard-BqeRMHfL.js";import{t as C}from"./palette-BSD_aJZg.js";import{t as w}from"./settings-2-CZQg_KUQ.js";import{t as T}from"./server-JApJpgLa.js";import{t as E}from"./shield-IZEIJ8r7.js";import{t as te}from"./sparkles-CAf3oJ5S.js";import{t as D}from"./user-round-Cpzx8pSw.js";import{t as O}from"./x-C1Cemsov.js";import{t as k}from"./scroll-area-Drsa8bNB.js";import{t as A}from"./button-BAbJxRzt.js";import{o as ne,t as re}from"./sheet-BO78gIKZ.js";import{a as j,i as M,n as N,o as P,s as F,t as I}from"./MobileSheet-CkeG6_SP.js";import{l as L,m as ie,o as R,p as z,r as B,s as V,x as H}from"./appearancePreferences-COvj0WMT.js";import{n as ae,o as oe}from"./settingsSections.logic-F8RXVmAq.js";import{n as se,t as ce}from"./useAppearancePreference-BlLlxQl7.js";var U=r(),W=e(t(),1),G=o(),K=`System reduce transparency is on, showing ${z.find(e=>e.value==="default")?.label??`Solid`}`,q=[{key:`surfaceTransparency`,label:`Material`,description:`How much of the content behind a surface shows through.`,options:L,scale:z},{key:`fontSizeBase`,label:`Text size`,description:`The base type size for the whole interface.`,options:R,scale:R},{key:`dockDensity`,label:`Dock density`,description:`How much padding the dock capsule carries around its controls.`,options:B,scale:B},{key:`motion`,label:`Motion`,description:`Reduce sheet and stack animation beyond the system setting.`,options:V,scale:V}];function le(e){let t=(0,U.c)(42),{control:n}=e,[r,i]=(0,W.useState)(!1),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={effective:!0},t[0]=a):a=t[0];let o=ce(n.key,a),s=se(),c=n.key===`surfaceTransparency`&&s?K:null,l;t[1]!==n.options||t[2]!==o?(l=n.options.find(e=>e.value===o)??null,t[1]=n.options,t[2]=o,t[3]=l):l=t[3];let u=l,d;t[4]!==n.scale||t[5]!==u||t[6]!==o?(d=u??n.scale.find(e=>e.value===o)??null,t[4]=n.scale,t[5]=u,t[6]=o,t[7]=d):d=t[7];let f=d,p=u!==null,m;t[8]===n.key?m=t[9]:(m=e=>{H(n.key,e),ie(),i(!1)},t[8]=n.key,t[9]=m);let h=m,g=c&&f?`${f.label} · ${c}`:f?.label??null,_,v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground/60`}),v=()=>i(!0),t[10]=_,t[11]=v):(_=t[10],v=t[11]);let b;t[12]!==n.label||t[13]!==g?(b=(0,G.jsx)(F,{label:n.label,secondaryText:g,trailing:_,onClick:v}),t[12]=n.label,t[13]=g,t[14]=b):b=t[14];let x=n.label,S;t[15]===n.label?S=t[16]:(S=(0,G.jsx)(P,{children:n.label}),t[15]=n.label,t[16]=S);let C=!p&&f?` Currently ${f.label}.`:null,w=c?` ${c}.`:null,T;t[17]!==n.description||t[18]!==C||t[19]!==w?(T=(0,G.jsxs)(N,{children:[n.description,C,w]}),t[17]=n.description,t[18]=C,t[19]=w,t[20]=T):T=t[20];let E;t[21]!==S||t[22]!==T?(E=(0,G.jsxs)(M,{children:[S,T]}),t[21]=S,t[22]=T,t[23]=E):E=t[23];let te=n.label,D;if(t[24]!==n.options||t[25]!==h||t[26]!==o){let e;t[28]!==h||t[29]!==o?(e=e=>(0,G.jsx)(F,{label:e.label,secondaryText:e.description,selected:e.value===o,trailing:e.value===o?(0,G.jsx)(y,{"aria-hidden":!0,className:`size-4`}):null,onClick:()=>h(e.value)},e.value),t[28]=h,t[29]=o,t[30]=e):e=t[30],D=n.options.map(e),t[24]=n.options,t[25]=h,t[26]=o,t[27]=D}else D=t[27];let O;t[31]!==n.label||t[32]!==D?(O=(0,G.jsx)(j,{children:(0,G.jsx)(`div`,{role:`group`,"aria-label":te,className:`flex flex-col`,children:D})}),t[31]=n.label,t[32]=D,t[33]=O):O=t[33];let k;t[34]!==n.label||t[35]!==r||t[36]!==E||t[37]!==O?(k=(0,G.jsxs)(I,{open:r,onOpenChange:i,label:x,detent:`medium`,children:[E,O]}),t[34]=n.label,t[35]=r,t[36]=E,t[37]=O,t[38]=k):k=t[38];let A;return t[39]!==k||t[40]!==b?(A=(0,G.jsxs)(G.Fragment,{children:[b,k]}),t[39]=k,t[40]=b,t[41]=A):A=t[41],A}function ue(){let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(`div`,{role:`group`,"aria-label":`Phone appearance`,className:`flex flex-col`,children:q.map(de)}),e[0]=t):t=e[0],t}function de(e){return(0,G.jsx)(le,{control:e},e.key)}var fe=[{id:`account`,label:`Account`,icon:D},{id:`general`,label:`General`,icon:w},{id:`inbox`,label:`Inbox`,icon:te},{id:`providers`,label:`Providers`,icon:f},{id:`opinionated-plugins`,label:`Plugins`,icon:u},{id:`mcp-servers`,label:`MCP Servers`,icon:T},{id:`appearance`,label:`Appearance`,icon:C},{id:`keybindings`,label:`Keybindings`,icon:S},{id:`source-control`,label:`Source Control`,icon:x},{id:`connections`,label:`Connections`,icon:l},{id:`security`,label:`Security`,icon:E},{id:`statistics`,label:`Statistics`,icon:v},{id:`archived`,label:`Archive`,icon:h}],pe=[{id:`diagnostics`,label:`Diagnostics`,icon:c}],me=[...fe,...pe];me.map(e=>e.id),fe.map(e=>e.label);var he=new Set([`general`,`providers`,`appearance`]),J=`general`,Y=(0,W.lazy)(()=>n(()=>import(`./AccountSettings-Be5_48k0.js`).then(e=>({default:e.AccountSettingsPanel})),[])),ge=(0,W.lazy)(()=>n(()=>import(`./ProvidersSettingsPanel-B3aBKY--.js`).then(e=>({default:e.ProvidersSettingsPanel})),[])),X=(0,W.lazy)(()=>n(()=>import(`./AiFocusSettings-DIpQXLW2.js`).then(e=>({default:e.AiFocusSettings})),[])),_e=(0,W.lazy)(()=>n(()=>import(`./OpinionatedPluginsSettings-BtZQF4Ze.js`).then(e=>({default:e.OpinionatedPluginsSettingsPanel})),[])),ve=(0,W.lazy)(()=>n(()=>import(`./McpServersSettings-B7YqVvV4.js`).then(e=>({default:e.McpServersSettings})),[])),Z=(0,W.lazy)(()=>n(()=>import(`./AppearanceSettings-CYbSApl4.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),ye=(0,W.lazy)(()=>n(()=>import(`./KeybindingsSettings-D2bNQPI-.js`).then(e=>({default:e.KeybindingsSettingsPanel})),[])),be=(0,W.lazy)(()=>n(()=>import(`./SourceControlSettings-CkiYR4lR.js`).then(e=>({default:e.SourceControlSettingsPanel})),[])),xe=(0,W.lazy)(()=>n(()=>import(`./ConnectionsSettings-CXabxSaH.js`).then(e=>({default:e.ConnectionsSettings})),[])),Q=(0,W.lazy)(()=>n(()=>import(`./NodeSecuritySettings-FWM_SeDi.js`).then(e=>({default:e.NodeSecuritySettings})),[])),$=(0,W.lazy)(()=>n(()=>import(`./DiagnosticsSettings-CZ3vY43G.js`).then(e=>({default:e.DiagnosticsSettings})),[])),Se=(0,W.lazy)(()=>n(()=>import(`./StatisticsPanel-D_khPph6.js`).then(e=>({default:e.StatisticsPanel})),[]));function Ce(e){let t=(0,U.c)(44),{section:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`div`,{className:`flex min-h-80 items-center justify-center text-muted-foreground text-sm`,children:`Loading settings...`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n===`account`?(0,G.jsx)(Y,{}):null,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=n===`general`?(0,G.jsx)(d,{}):null,t[3]=n,t[4]=a);let o;t[5]===n?o=t[6]:(o=n===`inbox`?(0,G.jsx)(X,{}):null,t[5]=n,t[6]=o);let s;t[7]===n?s=t[8]:(s=n===`providers`?(0,G.jsx)(ge,{}):null,t[7]=n,t[8]=s);let c;t[9]===n?c=t[10]:(c=n===`opinionated-plugins`?(0,G.jsx)(_e,{}):null,t[9]=n,t[10]=c);let l;t[11]===n?l=t[12]:(l=n===`mcp-servers`?(0,G.jsx)(ve,{}):null,t[11]=n,t[12]=l);let u;t[13]===n?u=t[14]:(u=n===`appearance`?(0,G.jsx)(Z,{}):null,t[13]=n,t[14]=u);let f;t[15]===n?f=t[16]:(f=n===`keybindings`?(0,G.jsx)(ye,{}):null,t[15]=n,t[16]=f);let p;t[17]===n?p=t[18]:(p=n===`source-control`?(0,G.jsx)(be,{}):null,t[17]=n,t[18]=p);let h;t[19]===n?h=t[20]:(h=n===`connections`?(0,G.jsx)(xe,{}):null,t[19]=n,t[20]=h);let g;t[21]===n?g=t[22]:(g=n===`security`?(0,G.jsx)(Q,{}):null,t[21]=n,t[22]=g);let _;t[23]===n?_=t[24]:(_=n===`diagnostics`?(0,G.jsx)($,{presentation:`phone-legacy`}):null,t[23]=n,t[24]=_);let v;t[25]===n?v=t[26]:(v=n===`statistics`?(0,G.jsx)(Se,{}):null,t[25]=n,t[26]=v);let y;t[27]===n?y=t[28]:(y=n===`archived`?(0,G.jsx)(m,{}):null,t[27]=n,t[28]=y);let b;return t[29]!==p||t[30]!==h||t[31]!==g||t[32]!==_||t[33]!==v||t[34]!==y||t[35]!==i||t[36]!==a||t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==l||t[41]!==u||t[42]!==f?(b=(0,G.jsxs)(W.Suspense,{fallback:r,children:[i,a,o,s,c,l,u,f,p,h,g,_,v,y]}),t[29]=p,t[30]=h,t[31]=g,t[32]=_,t[33]=v,t[34]=y,t[35]=i,t[36]=a,t[37]=o,t[38]=s,t[39]=c,t[40]=l,t[41]=u,t[42]=f,t[43]=b):b=t[43],b}function we(e){let t=(0,U.c)(6),{onRestored:n}=e,{changedSettingLabels:r,restoreDefaults:i}=p(n),a=r.length===0,o;t[0]===i?o=t[1]:(o=()=>void i(),t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(g,{className:`size-3.5`}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,G.jsxs)(A,{size:`sm`,variant:`outline`,className:`min-h-11 shrink-0`,disabled:a,onClick:o,children:[s,`Restore defaults`]}),t[3]=a,t[4]=o,t[5]=c):c=t[5],c}var Te=`w-full min-w-0 max-w-none border-s-0 p-0 pt-safe pl-safe pr-safe pb-[max(env(safe-area-inset-bottom),var(--app-keyboard-inset,0px))] wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]`;function Ee(){let e=(0,U.c)(39),t=s(Fe),n=s(Pe),r=s(Ne),o=s(Me),c=a(je),l=a(Ae),u=a(ke),d;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=i(),e[0]=d):d=e[0];let f=d,p;e[1]!==l||e[2]!==c||e[3]!==u?(p=ae(c,l,u),e[1]=l,e[2]=c,e[3]=u,e[4]=p):p=e[4];let m=p,h;e[5]===m?h=e[6]:(h=e=>oe(e,{hosted:f,role:m}),e[5]=m,e[6]=h);let g=h,v;e[7]===g?v=e[8]:(v=e=>g(e.id),e[7]=g,e[8]=v);let y=fe.filter(v),x;e[9]===g?x=e[10]:(x=e=>g(e.id),e[9]=g,e[10]=x);let S=pe.filter(x),[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(!1),[te,D]=(0,W.useState)(!1);t!==te&&(D(t),t&&(w(n===J?null:n),E(!1)));let j=(0,W.useRef)(n),M,N;e[11]!==t||e[12]!==n?(M=()=>{let e=j.current;j.current=n,t&&n!==e&&w(n)},N=[t,n],e[11]=t,e[12]=n,e[13]=M,e[14]=N):(M=e[13],N=e[14]),(0,W.useEffect)(M,N);let P,F;e[15]!==t||e[16]!==o?(P=()=>{t||s.getState().section!==J&&(o(J),j.current=J)},F=[t,o],e[15]=t,e[16]=o,e[17]=P,e[18]=F):(P=e[17],F=e[18]),(0,W.useEffect)(P,F);let I=(0,W.useRef)(null),L=(0,W.useRef)(new Map),ie=(0,W.useRef)(null),R=(0,W.useRef)(null),z;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{R.current!==null&&window.cancelAnimationFrame(R.current);let t=0,n=0,r=()=>{R.current=null;let i=e();if(!(!i||!i.isConnected)){if(document.activeElement===i){if(n+=1,n>=2)return}else if(n=0,i.focus(),t+=1,t>=6)return;R.current=window.requestAnimationFrame(r)}};R.current=window.requestAnimationFrame(r)},e[19]=z):z=e[19];let B=z,V,H;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>()=>{R.current!==null&&window.cancelAnimationFrame(R.current)},H=[],e[20]=V,e[21]=H):(V=e[20],H=e[21]),(0,W.useEffect)(V,H);let se=e=>{o(e),w(e),B(()=>I.current)},ce=()=>{let e=ie.current;w(null),j.current=J,o(J),B(()=>e?L.current.get(e)??null:null)},K;e[22]===C?K=e[23]:(K=[C],e[22]=C,e[23]=K),(0,W.useEffect)(()=>{C!==null&&(ie.current=C)},K);let q;e[24]!==t||e[25]!==C?(q=[t,C,B],e[24]=t,e[25]=C,e[26]=q):q=e[26],(0,W.useEffect)(()=>{t&&C!==null&&B(()=>I.current)},q);let[le,de]=(0,W.useState)(0),Y;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>{de(Oe)},e[27]=Y):Y=e[27];let ge=Y,X=C!==null&&g(C)?me.find(e=>e.id===C)??null:null,_e=e=>{let t=e.icon;return(0,G.jsxs)(`button`,{type:`button`,ref:t=>{t?L.current.set(e.id,t):L.current.delete(e.id)},className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>se(e.id),children:[(0,G.jsx)(t,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground/60`})]},e.id)},ve=re,Z;e[28]===r?Z=e[29]:(Z=e=>{e||r()},e[28]=r,e[29]=Z);let ye=ne,be=Te,xe=X?(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(A,{size:`icon`,variant:`ghost`,"aria-label":`Back to settings`,className:`shrink-0`,onClick:ce,children:(0,G.jsx)(_,{})}),(0,G.jsx)(`h1`,{ref:I,tabIndex:-1,className:`min-w-0 flex-1 truncate text-sm font-medium outline-none`,children:X.label}),he.has(X.id)?(0,G.jsx)(we,{onRestored:ge}):null]}),(0,G.jsx)(k,{className:`min-h-0 min-w-0 flex-1`,children:(0,G.jsx)(`div`,{className:`flex flex-col`,children:(0,G.jsx)(Ce,{section:X.id})},le)})]}):(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(`h1`,{className:`min-w-0 flex-1 truncate px-2 text-base font-semibold`,children:`Settings`}),(0,G.jsx)(A,{size:`icon`,variant:`ghost`,"aria-label":`Close settings`,className:`shrink-0`,onClick:r,children:(0,G.jsx)(O,{})})]}),(0,G.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`min-h-0 flex-1 overflow-y-auto p-2`,children:[(0,G.jsx)(`div`,{role:`group`,"aria-label":`Settings sections`,className:`space-y-0.5`,children:y.map(e=>_e(e))}),S.length>0?(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":T,className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm font-medium text-muted-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>E(De),children:[T?(0,G.jsx)(b,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Advanced`})]}),T?(0,G.jsx)(`div`,{role:`group`,"aria-label":`Advanced sections`,className:`space-y-0.5`,children:S.map(e=>_e(e))}):null]}):null,(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsx)(`h2`,{className:`px-2 py-1 font-medium text-muted-foreground text-xs`,children:`Phone appearance`}),(0,G.jsx)(ue,{})]})]})]}),Q;e[30]!==ye||e[31]!==be||e[32]!==xe?(Q=(0,G.jsx)(ye,{side:`right`,showCloseButton:!1,"aria-label":`Settings`,"data-testid":`phone-settings-surface`,className:be,children:xe}),e[30]=ye,e[31]=be,e[32]=xe,e[33]=Q):Q=e[33];let $;return e[34]!==ve||e[35]!==t||e[36]!==Z||e[37]!==Q?($=(0,G.jsx)(ve,{open:t,onOpenChange:Z,children:Q}),e[34]=ve,e[35]=t,e[36]=Z,e[37]=Q,e[38]=$):$=e[38],$}function De(e){return!e}function Oe(e){return e+1}function ke(e){return e.transportStatus}function Ae(e){return e.directoryStatus}function je(e){return e.effectiveRole}function Me(e){return e.setSection}function Ne(e){return e.closeSettings}function Pe(e){return e.section}function Fe(e){return e.open}export{Ee as PhoneSettingsSurface};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{n}from"./env-B4arEvJg.js";import{vn as r}from"./runtime-DKwoXpJv.js";import{It as i}from"./composerDraftStore-CdJJZe42.js";import{t as a}from"./folder-DtsQoI9_.js";import{t as o}from"./utils-BofFIn5Y.js";var s=e(t(),1),c=i(),l=new Set;function u(e){let t=(()=>{if(n())return null;try{return e.customAvatarContentHash&&e.projectId?r({environmentId:e.environmentId,pathname:`/api/project-avatar`,searchParams:{projectId:e.projectId,v:e.customAvatarContentHash}}):r({environmentId:e.environmentId,pathname:`/api/project-favicon`,searchParams:{cwd:e.cwd}})}catch{return null}})(),[i,u]=(0,s.useState)(()=>t&&l.has(t)?`loaded`:`loading`),d=e.fillContainer?o(`size-full text-muted-foreground/50`,e.className):o(`size-3.5 shrink-0 text-muted-foreground/50`,e.className);if(!t||i===`error`)return(0,c.jsx)(a,{className:d});let f=e.fillContainer?o(`size-full object-cover`,i===`loaded`?``:`hidden`,e.className):o(`size-3.5 shrink-0 rounded-sm object-contain`,i===`loaded`?``:`hidden`,e.className);return(0,c.jsxs)(c.Fragment,{children:[i===`loaded`?null:(0,c.jsx)(a,{className:d}),(0,c.jsx)(`img`,{src:t,alt:``,className:f,onLoad:()=>{l.add(t),u(`loaded`)},onError:()=>u(`error`)})]})}export{u as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{n}from"./env-B4arEvJg.js";import{vn as r}from"./runtime-CXut_g4p.js";import{It as i}from"./composerDraftStore-CdJJZe42.js";import{t as a}from"./folder-DtsQoI9_.js";import{t as o}from"./utils-BofFIn5Y.js";var s=e(t(),1),c=i(),l=new Set;function u(e){let t=(()=>{if(n())return null;try{return e.customAvatarContentHash&&e.projectId?r({environmentId:e.environmentId,pathname:`/api/project-avatar`,searchParams:{projectId:e.projectId,v:e.customAvatarContentHash}}):r({environmentId:e.environmentId,pathname:`/api/project-favicon`,searchParams:{cwd:e.cwd}})}catch{return null}})(),[i,u]=(0,s.useState)(()=>t&&l.has(t)?`loaded`:`loading`),d=e.fillContainer?o(`size-full text-muted-foreground/50`,e.className):o(`size-3.5 shrink-0 text-muted-foreground/50`,e.className);if(!t||i===`error`)return(0,c.jsx)(a,{className:d});let f=e.fillContainer?o(`size-full object-cover`,i===`loaded`?``:`hidden`,e.className):o(`size-3.5 shrink-0 rounded-sm object-contain`,i===`loaded`?``:`hidden`,e.className);return(0,c.jsxs)(c.Fragment,{children:[i===`loaded`?null:(0,c.jsx)(a,{className:d}),(0,c.jsx)(`img`,{src:t,alt:``,className:f,onLoad:()=>{l.add(t),u(`loaded`)},onError:()=>u(`error`)})]})}export{u as t};