conductor-oss 0.60.13 → 0.60.15

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 (115) hide show
  1. package/package.json +6 -6
  2. package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
  3. package/web/.next/standalone/packages/web/.next/app-path-routes-manifest.json +5 -5
  4. package/web/.next/standalone/packages/web/.next/build-manifest.json +3 -3
  5. package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
  6. package/web/.next/standalone/packages/web/.next/react-loadable-manifest.json +5 -5
  7. package/web/.next/standalone/packages/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +1 -1
  9. package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
  10. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js +1 -1
  17. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/web/.next/standalone/packages/web/.next/server/app/api/auth/profile/route.js +3 -1
  20. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js +1 -1
  21. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js.nft.json +1 -1
  22. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page_client-reference-manifest.js +1 -1
  23. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js +1 -1
  24. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js.nft.json +1 -1
  25. package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page_client-reference-manifest.js +1 -1
  26. package/web/.next/standalone/packages/web/.next/server/app/page.js +1 -1
  27. package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
  28. package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
  29. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js +1 -1
  30. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  31. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  32. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js +1 -1
  33. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js.nft.json +1 -1
  34. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page_client-reference-manifest.js +1 -1
  35. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js +1 -1
  36. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
  37. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
  38. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js +1 -1
  39. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js.nft.json +1 -1
  40. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page_client-reference-manifest.js +1 -1
  41. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js +1 -1
  42. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js.nft.json +1 -1
  43. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page_client-reference-manifest.js +1 -1
  44. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js +1 -1
  45. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js.nft.json +1 -1
  46. package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page_client-reference-manifest.js +1 -1
  47. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js +1 -1
  48. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
  49. package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
  50. package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +5 -5
  51. package/web/.next/standalone/packages/web/.next/server/chunks/1669.js +1 -1
  52. package/web/.next/standalone/packages/web/.next/server/chunks/3160.js +3 -1
  53. package/web/.next/standalone/packages/web/.next/server/chunks/3523.js +1 -1
  54. package/web/.next/standalone/packages/web/.next/server/chunks/4790.js +1 -1
  55. package/web/.next/standalone/packages/web/.next/server/chunks/6213.js +46 -0
  56. package/web/.next/standalone/packages/web/.next/server/chunks/6549.js +1 -0
  57. package/web/.next/standalone/packages/web/.next/server/chunks/6746.js +1 -0
  58. package/web/.next/standalone/packages/web/.next/server/chunks/7776.js +35 -15
  59. package/web/.next/standalone/packages/web/.next/server/chunks/8586.js +1 -9
  60. package/web/.next/standalone/packages/web/.next/server/chunks/9455.js +1 -1
  61. package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +1 -1
  62. package/web/.next/standalone/packages/web/.next/server/middleware-react-loadable-manifest.js +1 -1
  63. package/web/.next/standalone/packages/web/.next/server/middleware.js +29 -11
  64. package/web/.next/standalone/packages/web/.next/server/next-font-manifest.js +1 -1
  65. package/web/.next/standalone/packages/web/.next/server/next-font-manifest.json +1 -1
  66. package/web/.next/standalone/packages/web/.next/server/pages/500.html +1 -1
  67. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
  68. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
  69. package/web/.next/standalone/packages/web/.next/static/chunks/14331.4508f1f44c9a8900.js +1 -0
  70. package/web/.next/standalone/packages/web/.next/static/chunks/20217-bca061c69c3542cc.js +19 -0
  71. package/web/.next/standalone/packages/web/.next/static/chunks/{34443.23ce5c5785b85c1b.js → 34443.40fc664b4a726726.js} +1 -1
  72. package/web/.next/standalone/packages/web/.next/static/chunks/{56817.b52ffdd6a5e8e679.js → 56817.1c65f2bde16312cb.js} +1 -1
  73. package/web/.next/standalone/packages/web/.next/static/chunks/74419-a3d603e00fbdbece.js +9 -0
  74. package/web/.next/standalone/packages/web/.next/static/chunks/app/layout-a900ff8d59fa0931.js +1 -0
  75. package/web/.next/{static/chunks/app/page-7f7018b76590bea6.js → standalone/packages/web/.next/static/chunks/app/page-6f5c5a7ea3604adc.js} +1 -1
  76. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-4213b7d86313ac85.js +9 -0
  77. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-in/sso-callback/{page-edda7f869ece0541.js → page-b2582a5bdfd92a02.js} +1 -1
  78. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-83c0752161f259ce.js +9 -0
  79. package/web/.next/standalone/packages/web/.next/static/chunks/webpack-697fa222ad10db5b.js +1 -0
  80. package/web/.next/standalone/packages/web/package.json +1 -1
  81. package/web/.next/static/chunks/14331.4508f1f44c9a8900.js +1 -0
  82. package/web/.next/static/chunks/20217-bca061c69c3542cc.js +19 -0
  83. package/web/.next/static/chunks/{34443.23ce5c5785b85c1b.js → 34443.40fc664b4a726726.js} +1 -1
  84. package/web/.next/static/chunks/{56817.b52ffdd6a5e8e679.js → 56817.1c65f2bde16312cb.js} +1 -1
  85. package/web/.next/static/chunks/74419-a3d603e00fbdbece.js +9 -0
  86. package/web/.next/static/chunks/app/layout-a900ff8d59fa0931.js +1 -0
  87. package/web/.next/{standalone/packages/web/.next/static/chunks/app/page-7f7018b76590bea6.js → static/chunks/app/page-6f5c5a7ea3604adc.js} +1 -1
  88. package/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-4213b7d86313ac85.js +9 -0
  89. package/web/.next/static/chunks/app/sign-in/sso-callback/{page-edda7f869ece0541.js → page-b2582a5bdfd92a02.js} +1 -1
  90. package/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-83c0752161f259ce.js +9 -0
  91. package/web/.next/static/chunks/webpack-697fa222ad10db5b.js +1 -0
  92. package/web/.next/standalone/packages/web/.next/server/chunks/2089.js +0 -37
  93. package/web/.next/standalone/packages/web/.next/server/chunks/3620.js +0 -1
  94. package/web/.next/standalone/packages/web/.next/server/chunks/4159.js +0 -4
  95. package/web/.next/standalone/packages/web/.next/server/chunks/6540.js +0 -4
  96. package/web/.next/standalone/packages/web/.next/server/chunks/6682.js +0 -1
  97. package/web/.next/standalone/packages/web/.next/server/chunks/8217.js +0 -1
  98. package/web/.next/standalone/packages/web/.next/static/chunks/28510-95d599223c3564f6.js +0 -14
  99. package/web/.next/standalone/packages/web/.next/static/chunks/30524-9eeaedf66a1f71f9.js +0 -19
  100. package/web/.next/standalone/packages/web/.next/static/chunks/70243.7a3f08037ea71282.js +0 -1
  101. package/web/.next/standalone/packages/web/.next/static/chunks/app/layout-f3f6ec5f989c0e09.js +0 -1
  102. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-e9e829c908c93c16.js +0 -9
  103. package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-99ffb78b88f6c7fc.js +0 -9
  104. package/web/.next/standalone/packages/web/.next/static/chunks/webpack-b5f213a11c4ea316.js +0 -1
  105. package/web/.next/static/chunks/28510-95d599223c3564f6.js +0 -14
  106. package/web/.next/static/chunks/30524-9eeaedf66a1f71f9.js +0 -19
  107. package/web/.next/static/chunks/70243.7a3f08037ea71282.js +0 -1
  108. package/web/.next/static/chunks/app/layout-f3f6ec5f989c0e09.js +0 -1
  109. package/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-e9e829c908c93c16.js +0 -9
  110. package/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-99ffb78b88f6c7fc.js +0 -9
  111. package/web/.next/static/chunks/webpack-b5f213a11c4ea316.js +0 -1
  112. /package/web/.next/standalone/packages/web/.next/static/{REGmvP1SBVAt7wmv4Qj8k → CVyrIbJevHb5X2vVa7K6l}/_buildManifest.js +0 -0
  113. /package/web/.next/standalone/packages/web/.next/static/{REGmvP1SBVAt7wmv4Qj8k → CVyrIbJevHb5X2vVa7K6l}/_ssgManifest.js +0 -0
  114. /package/web/.next/static/{REGmvP1SBVAt7wmv4Qj8k → CVyrIbJevHb5X2vVa7K6l}/_buildManifest.js +0 -0
  115. /package/web/.next/static/{REGmvP1SBVAt7wmv4Qj8k → CVyrIbJevHb5X2vVa7K6l}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56817],{21094:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(13454).A)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]])},23555:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(13454).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},56817:(e,t,r)=>{r.r(t),r.d(t,{NewWorkspaceDialog:()=>ei,SettingsDialog:()=>ex});var a=r(54568),s=r(71708),l=r(76196),n=r(7620),o=r(52353),i=r(20487),d=r(13454);let c=(0,d.A)("circle-user",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);var x=r(50549),p=r(57917),v=r(21048),m=r(55341),u=r(30824),h=r(34737),b=r(20670),g=r(21094),k=r(34309),f=r(36645),j=r(45894),N=r(58299),y=r(62868),w=r(34041),C=r(23555),S=r(59706);let A=(0,d.A)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),H=(0,d.A)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var R=r(5739),E=r(33866),P=r(72410),U=r(31404),$=r(85626);r(51164);var M=r(30524);let D=(0,d.A)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);function B(e){switch(e){case"clerk":return"Clerk";case"cloudflare-access":return"Cloudflare Access";case"trusted-header":return"Verified Header";case"local":return"Local";default:return"Unknown"}}function L(e){return e?e.split("-").map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" "):"No access"}function F({label:e,value:t,href:r}){return(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:e}),r?(0,a.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",className:"mt-2 block break-all text-[14px] text-[var(--vk-orange)] hover:underline",children:t}):(0,a.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:t})]})}function _({profile:e}){let t=(e?.displayName??e?.email??"User").split(/[\s@._-]+/g).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("").slice(0,2);return e?.avatarUrl?(0,a.jsx)("img",{src:e.avatarUrl,alt:e.displayName??e.email??"Profile avatar",className:"h-20 w-20 rounded-full border border-[var(--vk-border)] object-cover shadow-[0_10px_30px_rgba(0,0,0,0.28)]"}):(0,a.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_14%,transparent)] text-[26px] font-semibold text-[var(--vk-accent)]",children:t||"U"})}function T({profile:e,loading:t,error:r,onRefresh:l}){if(t)return(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading profile details..."]});if(r&&!e)return(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Profile Unavailable"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor could not load the active user profile for this session."})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Retry"]})]});let n=e?.displayName??"Unknown user",o=e?.email??"Not available",i=e?.githubUsername?`@${e.githubUsername}`:"Not linked";return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] px-5 py-5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(_,{profile:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"truncate text-[24px] leading-[26px] text-[var(--vk-text-strong)]",children:n}),(0,a.jsx)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-muted)]",children:o}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:L(e?.role??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:B(e?.provider??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:e?"local"===e.provider?"Local admin session":e.authenticated?"Authenticated":"Anonymous":"Unknown"})]})]})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 self-start rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Refresh"]})]})}),(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsx)(F,{label:"Display Name",value:n}),(0,a.jsx)(F,{label:"Email",value:o}),(0,a.jsx)(F,{label:"GitHub Username",value:i,href:e?.githubProfileUrl??null}),(0,a.jsx)(F,{label:"Username",value:e?.username??"Not available"}),(0,a.jsx)(F,{label:"Auth Provider",value:B(e?.provider??null)}),(0,a.jsx)(F,{label:"Access Role",value:L(e?.role??null)})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Session Actions"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Review how this browser session is authenticated and sign out when Conductor owns the session lifecycle."})]}),e?.canLogout&&"clerk"===e.logoutMode?(0,a.jsx)(M.ct,{redirectUrl:"/sign-in",children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-9 items-center gap-2 rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(D,{className:"h-3.5 w-3.5"}),"Log Out"]})}):(0,a.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:e?.provider==="local"?"This is a local recovery session on the current machine, so there is nothing to sign out of.":`This session is managed by ${B(e?.provider??null)}. Sign out from that provider if you need to end access.`}),e?.githubProfileUrl&&(0,a.jsxs)("a",{href:e.githubProfileUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-[13px] text-[var(--vk-orange)] hover:underline",children:[(0,a.jsx)(s.uj0,{size:14}),"Open GitHub Profile"]})]})]})}var O=r(88272);let q="claude-code";function I(e){let t=(0,E.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function z(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function G(e){let t=e.trim();return t?t.split(/[\\/]+/).filter(Boolean).at(-1)??null:null}function W(e){let t=e.trim();if(!t)return null;let r=t.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(r)return r[2]??null;try{let e=new URL(t).pathname.split("/").filter(Boolean).at(-1);return e?e.replace(/\.git$/i,""):null}catch{return null}}function Z(e,t,r){let a=t?.trim();if(a)return a;let s=W(e);if(s)return s;let l=r?.trim();return l||"workspace"}function V(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:`Updated ${new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(t))}`}let Y=[{id:"profile",label:"Profile",icon:c,implemented:!0},{id:"general",label:"General",icon:x.A,implemented:!0},{id:"repositories",label:"Repositories",icon:p.A,implemented:!0},{id:"organization",label:"Organization Settings",icon:v.A,implemented:!0},{id:"projects",label:"Projects",icon:m.A,implemented:!1},{id:"agents",label:"Agents",icon:u.A,implemented:!0},{id:"mcp",label:"MCP Servers",icon:h.A,implemented:!1},{id:"preferences",label:"Preferences",icon:b.A,implemented:!1}],J=[{id:"preferences",label:"Preferences",icon:b.A,implemented:!0},{id:"repositories",label:"Repository",icon:p.A,implemented:!0}],X=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],K=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function Q(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function ee(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).join("\n"):"string"!=typeof e?"":e.split(/[\n,]+/g).map(e=>e.trim()).filter(Boolean).join("\n")}function et(e,t){let r=Q(e),a=Q(r.trustedHeaders),s=Q(r.roles),l=Q(t),n=r.defaultRole,o=l.role;return{requireAuth:!0===r.requireAuth||!0===a.enabled,defaultRole:"viewer"===n||"admin"===n||"operator"===n?n:"operator",trustedHeaders:{enabled:!0===a.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof a.emailHeader&&a.emailHeader.trim().length>0?a.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof a.jwtHeader&&a.jwtHeader.trim().length>0?a.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof a.teamDomain&&a.teamDomain.trim().length>0?a.teamDomain.trim():"",audience:"string"==typeof a.audience&&a.audience.trim().length>0?a.audience.trim():""},roles:{viewers:ee(s.viewers),operators:ee(s.operators),admins:ee(s.admins),viewerDomains:ee(s.viewerDomains),operatorDomains:ee(s.operatorDomains),adminDomains:ee(s.adminDomains)},current:{authenticated:!0===l.authenticated,role:"viewer"===o||"operator"===o||"admin"===o?o:null,email:"string"==typeof l.email&&l.email.trim().length>0?l.email.trim():null,provider:"string"==typeof l.provider&&l.provider.trim().length>0?l.provider.trim():null}}}function er(e,t){let r=(0,l.yM)(e);if(!r||r.accessOptions.length<=1)return null;let a=(0,l.Tk)(e,t);return a?r.accessOptions.find(e=>e.id===a)?.label??null:null}let ea="block h-4 w-4 shrink-0";function es(e){return JSON.stringify(e)}let el={obsidian:{kind:"icon",icon:o.mWn,className:`${ea} text-[#8b5cf6]`},vscode:{kind:"icon",icon:i.$$9,className:`${ea} text-[#22a3f5]`},notion:{kind:"icon",icon:o.i4$,className:`${ea} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ea} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ea} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:x.A,className:`${ea} text-[var(--vk-text-muted)]`}};function en({editorId:e}){let t=el[e];if(!t)return(0,a.jsx)(g.A,{className:`${ea} text-[var(--vk-text-muted)]`});if("image"===t.kind)return(0,a.jsx)("img",{src:t.imageSrc,alt:"",className:t.className});let r=t.icon;return(0,a.jsx)(r,{className:t.className})}function eo({agent:e,modelAccess:t,runtimeModelCatalogs:r,selection:s,onChange:n,compact:o=!1}){if(!(0,l.Zz)(e))return null;let i=(0,l.yM)(e),d=(0,O.Ik)(e,t,r),c=(0,O.xb)(s)??s.catalogModel,x=(0,O.iL)(e,t,r,c),p=er(e,t);return i?(0,a.jsxs)("div",{className:o?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,a.jsxs)("select",{value:s.catalogModel,disabled:0===d.length,onChange:a=>{let l=a.target.value,o=(0,O.iL)(e,t,r,l);n({...s,catalogModel:l,reasoningEffort:o.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,O.YS)(e,t,r,l)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===d.length&&(0,a.jsx)("option",{value:"",children:"No runtime models detected"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[p?`Filtered for ${p}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),x.length>0&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,a.jsx)("select",{value:s.reasoningEffort,onChange:e=>{n({...s,reasoningEffort:e.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:x.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,a.jsx)("input",{value:s.customModel,onChange:a=>{let l=a.target.value,o=l.trim()||s.catalogModel,i=(0,O.iL)(e,t,r,o);n({...s,customModel:l,reasoningEffort:i.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,O.YS)(e,t,r,o)})},placeholder:(0,O.ZA)(e,r),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function ei({open:e,onClose:t,onCreate:r,creating:o,error:i,defaultAgent:d,agentOptions:c,modelAccess:x,runtimeModelCatalogs:p,bridgeId:v}){let[m,u]=(0,n.useState)("git"),[h,b]=(0,n.useState)("source"),[g,C]=(0,n.useState)(""),[S,A]=(0,n.useState)(!1),[H,P]=(0,n.useState)(""),[$,M]=(0,n.useState)(""),[D,B]=(0,n.useState)(""),[L,F]=(0,n.useState)("main"),[_,T]=(0,n.useState)(d),[Y,J]=(0,n.useState)((0,O.Z3)()),[X,K]=(0,n.useState)(!0),[Q,ee]=(0,n.useState)(!0),[et,er]=(0,n.useState)([]),[ea,es]=(0,n.useState)(!1),[el,en]=(0,n.useState)(!1),[ec,ex]=(0,n.useState)(null),[ep,ev]=(0,n.useState)(""),[em,eu]=(0,n.useState)(""),[eh,eb]=(0,n.useState)(!1),[eg,ek]=(0,n.useState)("local"),[ef,ej]=(0,n.useState)([]),[eN,ey]=(0,n.useState)(!1),[ew,eC]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(u("git"),b("source"),C(""),A(!1),P(""),M(""),B(""),F("main"),ee(!0),K(!0),T(d),J((0,O.Z3)()),er([]),en(!1),ex(null),ev(""),eu(""),ej([]),eC(null),ey(!1),eb(!1),ek("local"))},[d,e]),(0,n.useEffect)(()=>{e&&J(e=>{let t=(0,O.c0)(_,x,p,(0,O.xb)(e)??null,(0,O.aB)(e)??null);return e.catalogModel===t.catalogModel&&e.customModel===t.customModel&&e.reasoningEffort===t.reasoningEffort?e:t})},[_,x,e,p]),(0,n.useEffect)(()=>{if(!e)return;let t="git"===m?H.trim().length>0:$.trim().length>0;"source"===h||t||b("source")},[H,$,m,e,h]);let eS=(0,n.useMemo)(()=>{let e;return 0===(e=ep.trim().toLowerCase()).length?et:et.filter(t=>t.fullName.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||(t.ownerLogin??"").toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)||t.defaultBranch.toLowerCase().includes(e))},[ep,et]),eA=(0,n.useMemo)(()=>{let e=et.find(e=>e.httpsUrl===em);return e||(H.trim()?et.find(e=>e.httpsUrl===H.trim())??null:null)},[H,et,em]),eH=(0,n.useMemo)(()=>(function(e){let t=e.trim();if(!t)return null;let r=t.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(r)return`https://github.com/${r[1]}/${r[2]}.git`;let a=t.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return a?`https://github.com/${a[1]}/${a[2]}.git`:null})(ep),[ep]),eR=(0,n.useMemo)(()=>{let e;return(e=ep.trim())&&/^(https?:\/\/|git@)/i.test(e)?e:null},[ep]),eE=(0,n.useMemo)(()=>V(eA?.updatedAt),[eA]),eP=(0,n.useMemo)(()=>{let e=eH??eR;return!!e&&e.toLowerCase()!==H.trim().toLowerCase()},[H,eH,eR]),eU="git"===m?H.trim().length>0:$.trim().length>0,e$=(0,n.useMemo)(()=>{let e=z(g);return e||("git"===m?z(Z(H,eA?.name)):z(G($)??"workspace"))},[H,$,m,g,eA?.name]),eM=(0,n.useMemo)(()=>Z(H,eA?.name,e$),[e$,H,eA?.name]),eD=(0,n.useMemo)(()=>{if(0===D.trim().length)return"";let e=D.trim().replace(/[\\/]+$/,""),t=eM.trim().replace(/^[\\/]+/,"");if(!e)return t;if(!t)return e;let r=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e}${r}${t}`},[eM,D]),eB=(0,n.useMemo)(()=>"git"===m?eA?.fullName??H.trim():G($)??$.trim(),[H,$,m,eA]),eL=(0,n.useMemo)(()=>"git"===m?eA?.description?.trim()||H.trim():$.trim(),[H,$,m,eA]),eF=(0,n.useMemo)(()=>{let e=[...new Set(c)];0===e.length&&e.push(d||q);let t=new Map(E.BO.map((e,t)=>[e,t]));return e.sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:I(e).localeCompare(I(r))})},[c,d]);(0,n.useEffect)(()=>{eF.includes(_)||T(eF[0]??q)},[_,eF]);let e_=async(e=!1)=>{es(!0),ex(null);try{let t=await fetch((0,U.S)(`/api/github/repos${e?"?refresh=true":""}`,v)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load GitHub repositories (${t.status})`);er(Array.isArray(r?.repos)?r.repos:[])}catch(e){er([]),ex(e instanceof Error?e.message:"Failed to load GitHub repositories")}finally{en(!0),es(!1)}};(0,n.useEffect)(()=>{!e||"git"!==m||ea||el||e_()},[el,ea,m,e]);let eT=async e=>{let t=e?.gitUrl??("git"===m?H.trim():""),r=e?.path??("local"===m?$.trim():"");if(0===t.length&&0===r.length)return void eC("git"===m?"Choose or paste a repository first.":"Select a local repository path first.");ey(!0),eC(null);try{let e=new URLSearchParams;t.length>0&&e.set("gitUrl",t),r.length>0&&e.set("path",r);let a=await fetch((0,U.S)(`/api/workspaces/branches?${e.toString()}`,v)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];ej(l);let n="string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??null;n&&(0===L.trim().length||!l.includes(L))&&F(n)}catch(e){ej([]),eC(e instanceof Error?e.message:"Failed to load branches")}finally{ey(!1)}},eO=async e=>{eu(e);let t=et.find(t=>t.httpsUrl===e);t&&(P(t.httpsUrl),ev(t.fullName),F(t.defaultBranch||"main"),S||C(z(t.name)||g),await eT({gitUrl:t.httpsUrl}),b("details"))},eq=async()=>{let e=eH??eR;if(!e)return;let t=et.find(t=>t.httpsUrl.toLowerCase()===e.toLowerCase())??null;if(t)return void await eO(t.httpsUrl);if(eu(""),P(e),F("main"),ej([]),eC(null),!S){let t=W(e);t&&C(z(t))}await eT({gitUrl:e}),b("details")},eI=e=>{ek(e),eb(!0)},ez=e=>{u(e),b("source"),ej([]),eC(null)};if(!e)return null;let eG=eU&&L.trim().length>0;async function eW(e){if(e.preventDefault(),"review"!==h||!eG||o)return;let t="git"===m?{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,O.xb)(Y)??"",agentReasoningEffort:(0,O.aB)(Y)??"",defaultBranch:L.trim(),useWorktree:X,gitUrl:H.trim(),path:eD||void 0}:{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,O.xb)(Y)??"",agentReasoningEffort:(0,O.aB)(Y)??"",defaultBranch:L.trim(),useWorktree:X,path:$.trim(),initializeGit:Q};await r(t)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[80] flex items-end justify-center overflow-y-auto bg-black/65 px-0 py-0 sm:items-center sm:px-3 sm:py-3",onClick:()=>{o||eh||t()},role:"presentation",children:(0,a.jsxs)("form",{onSubmit:eW,onClick:e=>e.stopPropagation(),className:"flex h-dvh w-full max-w-none flex-col overflow-hidden rounded-none border-x-0 border-b-0 border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-auto sm:max-h-[calc(100dvh-3rem)] sm:max-w-[860px] sm:rounded-[10px] sm:border",children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 backdrop-blur",children:[(0,a.jsx)("div",{className:"mb-3 flex justify-center sm:hidden",children:(0,a.jsx)("span",{className:"h-1 w-10 rounded-full bg-[color:color-mix(in_srgb,var(--vk-text-muted)_36%,transparent)]"})}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"source"===h?"Step 1 of 3":"details"===h?"Step 2 of 3":"Step 3 of 3"})]}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"source"===h?"Start with the repository or folder you want Conductor to manage.":"details"===h?"Confirm the project defaults Conductor should use when this workspace is created.":"Review the project and destination details before Conductor adds it."}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[{id:"source",label:"git"===m?"Repository":"Folder"},{id:"details",label:"Project"},{id:"review",label:"Review"}].map(e=>{let t=h===e.id,r="source"===e.id?"source"!==h&&eU:"details"===e.id&&"review"===h;return(0,a.jsxs)("div",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] ${t?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] ${r?"border-[var(--vk-orange)] bg-[var(--vk-orange)] text-black":t?"border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)]"}`,children:r?(0,a.jsx)(k.A,{className:"h-3 w-3"}):"source"===e.id?"1":"details"===e.id?"2":"3"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,"aria-label":"Close dialog",className:"inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 sm:py-5",children:"source"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ez("git"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"git"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.uj0,{className:"h-[18px] w-[18px]"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"GitHub repository"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Search repos you already have access to, or paste a GitHub URL directly."})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>ez("local"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"local"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Local folder"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Point Conductor at a repository already on this machine."})]})]}),"git"===m?(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose repository"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Select a repo first. Branch, workspace name, and runtime defaults come next."})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{en(!1),e_(!0)},disabled:ea,className:"inline-flex h-9 items-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ea?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.uj0,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:ep,onChange:e=>ev(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eP&&(e.preventDefault(),eq())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-11 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent pl-10 pr-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),eP?(0,a.jsxs)("button",{type:"button",onClick:()=>{eq()},className:"inline-flex w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2.5 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(s.SYR,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,a.jsxs)("span",{className:"truncate",children:["Use ",eH?"this GitHub repository":"pasted repository URL"]})]}):null,ea&&0===et.length?(0,a.jsx)("div",{className:"rounded-[8px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,ec?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,a.jsx)("p",{children:ec}),(0,a.jsx)("button",{type:"button",onClick:()=>{en(!1),e_(!0)},className:"mt-2 inline-flex items-center rounded-[6px] border border-[var(--vk-border)] px-2 py-1 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Retry"})]}):null,!ec&&eS.length>0?(0,a.jsx)("div",{className:"max-h-[min(42dvh,340px)] space-y-2 overflow-y-auto pr-1",children:eS.map(e=>{let t=V(e.updatedAt),r=eA?.httpsUrl===e.httpsUrl;return(0,a.jsxs)("button",{type:"button",onClick:()=>{eO(e.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition ${r?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.fullName}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[e.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),e.private?"Private":"Public"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(s.C3c,{className:"h-3 w-3"}),e.defaultBranch]})]}),e.description?(0,a.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:e.description}):null,(0,a.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[e.ownerLogin?(0,a.jsx)("span",{children:e.ownerLogin}):null,t?(0,a.jsx)("span",{children:t}):null,e.permission?(0,a.jsx)("span",{children:e.permission.toLowerCase()}):null]})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:r?(0,a.jsx)(k.A,{className:"h-4 w-4"}):null})]},e.httpsUrl)})}):null,ea||ec||0!==eS.length?null:(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:ep.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}):(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose folder"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Pick the repository folder already on disk. You can adjust branch and runtime defaults next."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eI("local"),className:"inline-flex h-11 w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),$.trim().length>0?"Choose another folder":"Choose folder"]}),$.trim().length>0?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:[(0,a.jsx)("p",{className:"text-[12px] font-medium text-[var(--vk-text-strong)]",children:"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:$})]}):(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"The folder picker stays separate so you do not lose your place in this setup flow on mobile."})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]}):"details"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"git"===m?"Selected repository":"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eB}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eL}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:"git"===m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[eA?.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),eA?eA.private?"Private":"Public":"Manual URL"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(s.C3c,{className:"h-3 w-3"}),L||"main"]}),eA?.ownerLogin?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eA.ownerLogin}):null,eE?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eE}):null]}):(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"Local repository"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),className:"inline-flex h-9 items-center justify-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Change"})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,a.jsx)("input",{value:g,onChange:e=>{C(e.target.value),A(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:L,onChange:e=>F(e.target.value),placeholder:"Uses the repository default branch",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eT()},disabled:eN,className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:eN?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),ef.length>0?(0,a.jsx)("select",{value:L,onChange:e=>F(e.target.value),className:"mt-2 h-9 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ef.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}):null,ew?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:ew}):null]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:["Agent: ",I(_)]}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:X?"Worktree isolation on":"Runs on selected branch"}),"local"===m?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:Q?"Auto-init git if needed":"Do not init git"}):null]}),(0,l.Zz)(_)?(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Agent defaults"}),(0,a.jsx)("p",{className:"mt-0.5 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Choose the model and reasoning this workspace should inherit when sessions launch."})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(eo,{compact:!0,agent:_,modelAccess:x,runtimeModelCatalogs:p,selection:Y,onChange:J})})]}):null,(0,a.jsxs)("details",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-3 py-3 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)(w.A,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Runtime and repository options"]})}),(0,a.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,a.jsx)("select",{value:_,onChange:e=>T(e.target.value),className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eF.map(e=>(0,a.jsx)("option",{value:e,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:I(e)},e))})]}),(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:X,onChange:e=>K(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Recommended. Turn this off only if sessions should run directly on the selected branch."})]})]})}),"local"===m?(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:Q,onChange:e=>ee(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Initialize git if this folder is not already a repository",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Leave this on unless you know the folder should stay non-git."})]})]})}):(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Clone into parent folder"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:D,readOnly:!0,onClick:()=>eI("clone"),placeholder:"Leave empty to use Conductor's default repo location",className:"h-10 w-full cursor-pointer rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eI("clone"),className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:eD?`Conductor will create ${eD}.`:"Conductor will create the cloned repository inside the selected parent folder."})]})]})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Review project"}),(0,a.jsxs)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:["Conductor will add ",(0,a.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:e$||"workspace"})," ","and sync the board plus support files for this project."]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Project"}),(0,a.jsx)("p",{className:"mt-2 text-[15px] font-medium text-[var(--vk-text-strong)]",children:e$||"workspace"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:g.trim().length>0?"Uses the custom workspace name you entered.":"Auto-derived from the selected repository or folder."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Source"}),(0,a.jsx)("p",{className:"mt-2 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eB}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eL})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Destination"}),(0,a.jsx)("p",{className:"mt-2 break-all text-[15px] font-medium text-[var(--vk-text-strong)]",children:"git"===m?eD||"Conductor default repo location":$}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"git"===m?eD?`The repository will be cloned into ${eD}.`:"Conductor will choose the default clone location for this repository.":"Conductor will link the selected folder directly."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Runtime Defaults"}),(0,a.jsxs)("div",{className:"mt-2 space-y-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsxs)("p",{children:["Branch: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:L.trim()||"main"})]}),(0,a.jsxs)("p",{children:["Agent: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:I(_)})]}),(0,a.jsxs)("p",{children:["Isolation: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:X?"Worktree enabled":"Runs on selected branch"})]}),(0,O.xb)(Y)?(0,a.jsxs)("p",{children:["Model: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,O.xb)(Y)})]}):null,(0,O.aB)(Y)?(0,a.jsxs)("p",{children:["Reasoning: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,O.aB)(Y)})]}):null,"local"===m?(0,a.jsxs)("p",{children:["Git init: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:Q?"Enabled if needed":"Disabled"})]}):null]})]})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]})}),(0,a.jsx)("footer",{className:"border-t border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur",children:"source"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{"local"!==m||eU?eU&&!o&&b("details"):eI("local")},disabled:"git"===m&&!eU||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"local"!==m||eU?"Continue":"Choose folder"})]}):"details"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eU&&0!==L.trim().length&&!o&&b("review")},disabled:!eG||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Review"})]}):(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("details"),disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"submit",disabled:!eG||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})})]})}),(0,a.jsx)(ed,{open:eh,bridgeId:v,initialPath:"clone"===eg?D:$,title:"local"===eg?"Select Local Repository":"Select Clone Parent Folder",description:"local"===eg?"Choose the local repository folder.":"Choose the parent folder where Conductor should create the cloned repository.",onClose:()=>eb(!1),onSelect:e=>{if(eb(!1),e){if("clone"===eg)return void B(e);if(M(e),!S){let t=G(e);t&&C(z(t))}eT({path:e}),b("details")}}})]})}function ed({open:e,bridgeId:t,initialPath:r,title:s,description:l,onClose:o,onSelect:i}){let[d,c]=(0,n.useState)(""),[x,p]=(0,n.useState)(r??""),[v,m]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[b,g]=(0,n.useState)(!1),[k,f]=(0,n.useState)(null),[y,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!e)return;h(""),p(r??"");let a=r&&r.trim().length>0?r.trim():void 0,s=a?`?path=${encodeURIComponent(a)}`:"";g(!0),f(null),fetch((0,U.S)(`/api/filesystem/directory${s}`,t)).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load directory (${e.status})`);c("string"==typeof t?.currentPath?t.currentPath:""),m(Array.isArray(t?.entries)?t.entries:[])}).catch(e=>{f(e instanceof Error?e.message:"Failed to load directory"),m([])}).finally(()=>{g(!1)})},[r,e]);let S=(0,n.useMemo)(()=>{if(0===u.trim().length)return v;let e=u.trim().toLowerCase();return v.filter(t=>t.name.toLowerCase().includes(e))},[v,u]),A=async e=>{g(!0),f(null);try{let r=e&&e.trim().length>0?`?path=${encodeURIComponent(e.trim())}`:"",a=await fetch((0,U.S)(`/api/filesystem/directory${r}`,t)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load directory (${a.status})`);let l="string"==typeof s?.currentPath?s.currentPath:"";c(l),m(Array.isArray(s?.entries)?s.entries:[]),p(l)}catch(e){f(e instanceof Error?e.message:"Failed to load directory"),m([])}finally{g(!1)}},H=async()=>{w(!0);try{let e=await fetch((0,U.S)("/api/filesystem/pick-directory",t),{method:"POST"}),r=await e.json().catch(()=>null);if(!r||r.cancelled||!r.path)return;p(r.path),A(r.path)}catch{}finally{w(!1)}};return e?(0,a.jsx)("div",{className:"fixed inset-0 z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{o(),i(null)},role:"presentation",children:(0,a.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:s}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:l})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{value:x,onChange:e=>p(e.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{A(x)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{A()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,a.jsx)("button",{type:"button",onClick:()=>{if(!d)return;let e=d.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(d)||"/"===e)return;let t=e.split("/").filter(Boolean),r=d.match(/^([A-Za-z]):[/\\]/);A(r?t.length>1?`${r[1]}:/${t.slice(1,-1).join("/")}`:`${r[1]}:/`:t.length>1?`/${t.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,a.jsxs)("button",{type:"button",disabled:y,onClick:()=>{H()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[y?(0,a.jsx)(N.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(j.A,{className:"h-3 w-3"}),y?"Opening...":"Browse"]}),(0,a.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:d||"Home"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(C.A,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:u,onChange:e=>h(e.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:b?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):k?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:k}):0===S.length?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,a.jsx)("div",{className:"p-1",children:S.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{e.isDirectory&&A(e.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${e.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)(j.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,a.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},e.path))})})]}),(0,a.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{o(),i(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{let e=x.trim().length>0?x.trim():d;o(),i(e||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}function ec({value:e,idleLabel:t="Copy",copiedLabel:r="Copied"}){let[s,l]=(0,n.useState)(!1);async function o(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1400)}return(0,a.jsxs)("button",{type:"button",onClick:()=>void o(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[s?(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:s?r:t})]})}function ex({open:e,mode:t,creating:r,error:s,current:o,projectCount:i,agentOptions:d,agentStates:c,runtimeModelCatalogs:x,onRepositoriesChanged:p,onOnboardingComplete:v,onOpenAgentSetup:m,onClose:u,onSave:h,bridgeId:b}){var g,w;let C,[S,M]=(0,n.useState)("preferences"),[D,B]=(0,n.useState)(o.codingAgent),[L,F]=(0,n.useState)(o.ide),[_,z]=(0,n.useState)(o.markdownEditor),[G,W]=(0,n.useState)(o.markdownEditorPath??""),[Z,V]=(0,n.useState)(()=>o.filesystemBrowseRoots.join("\n")),[Q,ee]=(0,n.useState)(o.modelAccess),[ea,el]=(0,n.useState)(o.notifications.soundEnabled),[ei,ep]=(0,n.useState)(o.notifications.soundFile),[ev,em]=(0,n.useState)([]),[eu,eh]=(0,n.useState)(!1),[eb,eg]=(0,n.useState)(!1),[ek,ef]=(0,n.useState)(null),[ej,eN]=(0,n.useState)(""),[ey,ew]=(0,n.useState)(null),[eC,eS]=(0,n.useState)((0,O.Z3)()),[eA,eH]=(0,n.useState)([]),[eR,eE]=(0,n.useState)(!1),[eP,eU]=(0,n.useState)(null),[e$,eM]=(0,n.useState)(!1),[eD,eB]=(0,n.useState)(!1),[eL,eF]=(0,n.useState)(!1),[e_,eT]=(0,n.useState)(()=>et(null)),[eO,eq]=(0,n.useState)(!1),[eI,ez]=(0,n.useState)(!1),[eG,eW]=(0,n.useState)(null),[eZ,eV]=(0,n.useState)(null),[eY,eJ]=(0,n.useState)(!1),[eX,eK]=(0,n.useState)(null),eQ=r||eb||eI;function e0(e){return{...e,agentPermissions:"default"===e.agentPermissions?"default":"skip",devServerScript:e.devServerScript??"",devServerCwd:e.devServerCwd??"",devServerUrl:e.devServerUrl??"",devServerPort:e.devServerPort??"",devServerHost:e.devServerHost??"",devServerPath:e.devServerPath??"",devServerHttps:!0===e.devServerHttps,pathHealth:{exists:e.pathHealth.exists,isGitRepository:e.pathHealth.isGitRepository,suggestedPath:e.pathHealth.suggestedPath}}}function e1(e){return e.split(/\n+/g).map(e=>e.trim()).filter(Boolean)}async function e2(e){eh(!0),ef(null);try{let t=await fetch((0,U.S)("/api/repositories",b)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load repositories (${t.status})`);let a=Array.isArray(r?.repositories)?r.repositories:[];em(a);let s=a[0]?.id??"",l=e&&a.some(t=>t.id===e)?e:ej&&a.some(e=>e.id===ej)?ej:s;eN(l)}catch(e){em([]),eN(""),ew(null),eS((0,O.Z3)()),ef(e instanceof Error?e.message:"Failed to load repositories")}finally{eh(!1)}}async function e3(e,t){let r=(e??ey?.path??"").trim();if(0===r.length){eU("Select a repository path first."),eH([]);return}eE(!0),eU(null);try{let e=new URLSearchParams({path:r}),a=await fetch((0,U.S)(`/api/workspaces/branches?${e.toString()}`,b)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to detect branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eH(l);let n=t?.trim()||("string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??"");if(!n)return;ew(e=>!e||e.defaultBranch.trim().length>0&&l.includes(e.defaultBranch)?e:{...e,defaultBranch:n})}catch(e){eH([]),eU(e instanceof Error?e.message:"Failed to detect branches")}finally{eE(!1)}}async function e4(){if(!ey||eb||0===ey.repo.trim().length||0===ey.path.trim().length)return!1;eg(!0),ef(null);try{let e=await fetch((0,U.S)("/api/repositories",b),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:ey.id,displayName:ey.displayName,repo:ey.repo,path:ey.path,agent:ey.agent,agentPermissions:ey.agentPermissions,agentModel:(0,O.xb)(eC)??"",agentReasoningEffort:(0,O.aB)(eC)??"",defaultWorkingDirectory:ey.defaultWorkingDirectory,defaultBranch:ey.defaultBranch,devServerScript:ey.devServerScript,devServerCwd:ey.devServerCwd,devServerUrl:ey.devServerUrl,devServerPort:ey.devServerPort,devServerHost:ey.devServerHost,devServerPath:ey.devServerPath,devServerHttps:ey.devServerHttps,setupScript:ey.setupScript,runSetupInParallel:ey.runSetupInParallel,cleanupScript:ey.cleanupScript,archiveScript:ey.archiveScript,copyFiles:ey.copyFiles})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save repository settings (${e.status})`);let r=t?.repository;if(!r)throw Error("Repository saved but response is missing repository data");return em(e=>e.map(e=>e.id===r.id?r:e)),ew(e0(r)),eN(r.id),eU(null),await e3(r.path,r.defaultBranch),p&&await p(),!0}catch(e){return ef(e instanceof Error?e.message:"Failed to save repository settings"),!1}finally{eg(!1)}}async function e5(){eq(!0),eW(null);try{let e=await fetch("/api/access"),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load organization settings (${e.status})`);eT(et(t?.access,t?.current))}catch(e){eT(et(null)),eW(e instanceof Error?e.message:"Failed to load organization settings")}finally{eq(!1)}}async function e9(){eJ(!0),eK(null);try{let e=await fetch("/api/auth/profile",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){let r=t&&"object"==typeof t&&"error"in t&&"string"==typeof t.error?t.error:`Failed to load profile (${e.status})`;throw Error(r)}eV(t)}catch(e){eV(null),eK(e instanceof Error?e.message:"Failed to load profile")}finally{eJ(!1)}}async function e8(){if(eI)return!1;ez(!0),eW(null);try{let e=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:e_.requireAuth||e_.trustedHeaders.enabled,defaultRole:e_.defaultRole,trustedHeaders:{enabled:e_.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:e_.trustedHeaders.emailHeader,jwtHeader:e_.trustedHeaders.jwtHeader,teamDomain:e_.trustedHeaders.teamDomain,audience:e_.trustedHeaders.audience},roles:{viewers:e1(e_.roles.viewers),operators:e1(e_.roles.operators),admins:e1(e_.roles.admins),viewerDomains:e1(e_.roles.viewerDomains),operatorDomains:e1(e_.roles.operatorDomains),adminDomains:e1(e_.roles.adminDomains)}})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save organization settings (${e.status})`);return eT(et(t?.access,t?.current)),!0}catch(e){return eW(e instanceof Error?e.message:"Failed to save organization settings"),!1}finally{ez(!1)}}(0,n.useEffect)(()=>{e&&(M("onboarding"===t?"preferences":"general"),B(o.codingAgent),F(o.ide),z(o.markdownEditor),W(o.markdownEditorPath??""),V(o.filesystemBrowseRoots.join("\n")),ee(o.modelAccess),el(o.notifications.soundEnabled),ep(o.notifications.soundFile),eH([]),eU(null),ef(null),eS((0,O.Z3)()),eW(null),eV(null),eK(null))},[t,e]),(0,n.useEffect)(()=>{e&&("settings"===t||"repositories"===S)&&e2()},[S,t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&e5()},[t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&"profile"===S&&e9()},[S,t,e]),(0,n.useEffect)(()=>{if(!e)return;if(!ej){ew(null),eS((0,O.Z3)());return}let t=ev.find(e=>e.id===ej);if(!t)return;let r=(0,E.a6)(t.agent,D||q);ew(e0({...t,agent:r})),eS((0,O.c0)(r,Q,x,t.agentModel,t.agentReasoningEffort)),eH([]),eU(null),t.path.trim().length>0&&e3(t.path,t.defaultBranch)},[D,Q,e,ev,x,ej]);let e6="onboarding"===t&&i>0,e7=(0,n.useMemo)(()=>"onboarding"===t?e6?J:J.filter(e=>"preferences"===e.id):Y.filter(e=>e.implemented),[t,e6]),te=e7.find(e=>e.id===S)??e7[0]??Y[0],tt="onboarding"===t,tr="preferences"===te.id,ta="profile"===te.id,ts="general"===te.id,tl="agents"===te.id,tn=tr||ts||tl,to="repositories"===te.id,ti="organization"===te.id,td=e7.findIndex(e=>e.id===te.id)+1,tc=e7.some(e=>"repositories"===e.id),tx="admin"===e_.current.role,tp=(0,n.useMemo)(()=>{let e=new Set((0,E.Ge)(d));D.trim().length>0&&(0,E.iQ)(D)&&e.add(D),0===e.size&&e.add(q);let t=new Map(E.BO.map((e,t)=>[e,t]));return[...e].sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:I(e).localeCompare(I(r))})},[d,D]);(0,n.useEffect)(()=>{0!==tp.length&&(D&&tp.includes(D)||B((0,E.a6)(D,tp[0]??q)))},[D,tp]);let tv=c[(0,R.q)(D)]??null;if(!e)return null;let tm=D.trim().length>0&&L.trim().length>0&&_.trim().length>0,tu=!!ey&&ey.displayName.trim().length>0&&ey.repo.trim().length>0&&ey.path.trim().length>0&&ey.defaultBranch.trim().length>0,th=tx&&!eO&&(!e_.trustedHeaders.enabled||e_.trustedHeaders.teamDomain.trim().length>0&&e_.trustedHeaders.audience.trim().length>0),tb=to?ek:ti?eG:ta?eX:s,tg=ey?(g={...ey,agentModel:(0,O.xb)(eC)??"",agentReasoningEffort:(0,O.aB)(eC)??""},w={ide:L,markdownEditor:_},C=["npx --yes --registry=https://registry.npmjs.org conductor-oss@latest setup","--yes",`--path ${es(g.path)}`,`--project-id ${es(g.id)}`,`--display-name ${es(g.displayName)}`,`--agent ${es(g.agent||"claude-code")}`,`--ide ${es(w.ide)}`,`--markdown-editor ${es(w.markdownEditor)}`],g.repo.trim().length>0&&C.push(`--repo ${es(g.repo.trim())}`),g.defaultBranch.trim().length>0&&C.push(`--default-branch ${es(g.defaultBranch.trim())}`),g.agentModel.trim().length>0&&C.push(`--model ${es(g.agentModel.trim())}`),g.agentReasoningEffort.trim().length>0&&C.push(`--reasoning-effort ${es(g.agentReasoningEffort.trim())}`),g.defaultWorkingDirectory.trim().length>0&&C.push(`--default-working-directory ${es(g.defaultWorkingDirectory.trim())}`),C.join(" ")):"";async function tk(e,t){let a,s;if(!tm||r)return!1;let l=await h((a=ea?ei??K[0]?.id??"abstract-sound-4":null,s=Z.split(/\n+/g).map(e=>e.trim()).filter(Boolean),{onboardingAcknowledged:!!e||o.onboardingAcknowledged,codingAgent:D.trim(),ide:L.trim(),markdownEditor:_.trim(),markdownEditorPath:(G??"").trim(),filesystemBrowseRoots:s,modelAccess:Q,notifications:{soundEnabled:ea,soundFile:a}}),t);return l&&tv&&!tv.ready&&m(D),l}async function tf(){if(!eu){if(!tc){if(!await tk(!0,{closeDialog:!0}))return;v?.({needsProject:0===i});return}await tk(!1,{closeDialog:!1})&&M("repositories")}}async function tj(){(!to||await e4())&&await tk(!0,{closeDialog:!0})&&v?.({needsProject:!1})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center",onClick:()=>{eQ||"onboarding"===t||e$||eD||eL||u()},role:"presentation",children:(0,a.jsxs)("div",{className:"flex h-[100dvh] w-full flex-col overflow-hidden border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(92vh,760px)] sm:max-h-[calc(100dvh-1.5rem)] sm:max-w-[1120px] sm:rounded-[6px] sm:border sm:flex-row",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,a.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,a.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tt?"Setup":"Settings"})}),(0,a.jsx)("nav",{className:"-mx-0.5 flex gap-1 overflow-x-auto px-2 py-2 sm:mx-0 sm:block sm:space-y-1 sm:overflow-auto sm:px-2",children:e7.map(e=>{let t=e.icon,r=te.id===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>M(e.id),disabled:eQ,className:`flex min-h-[44px] shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:min-h-0 sm:w-full ${r?"bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,a.jsx)(t,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tt?tr?"Choose your preferences":"Review repository defaults":te.label}),tt&&(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",td," of ",e7.length]})]}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:eQ||"onboarding"===t,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 sm:px-6 sm:py-4",children:tn?(0,a.jsxs)("div",{className:"space-y-5",children:[tt&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_10%,transparent)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using terminals and boards immediately."})}),(tr||tl)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent, review its setup state, and confirm which models Conductor can offer for it."}),(0,a.jsx)("div",{className:"grid gap-3",children:tp.map(e=>{let t=D===e,r=c[(0,R.q)(e)]??null,s=er(e,Q),n=(0,O.Ik)(e,Q,x),o=n.slice(0,3),i=n.length-o.length,d=r?.installed?r.ready?"Ready":"Setup required":"Not installed";return(0,a.jsxs)("div",{className:`flex flex-col gap-3 rounded-[4px] border px-3 py-3 text-left sm:flex-row sm:items-start ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,a.jsx)(P.N,{seed:{label:e},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:I(e)}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:d}),s?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:s}):null]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:r?.description??(0,E.h7)(e)?.description??"Agent metadata not available."}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[o.map(t=>(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:t.label},`${e}-${t.id}`)),i>0?(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:["+",i," more"]}):null,0===o.length?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:(0,l.Zz)(e)?"Models appear after setup":"Uses the agent default model"}):null]}),!r?.installed&&r?.installHint?(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,a.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:r.installHint})]}):null]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 self-start sm:ml-auto",children:[r?.ready?null:(0,a.jsx)("button",{type:"button",onClick:()=>{B(e),m(e)},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-panel)]",children:r?.installed?"Authenticate":"Install"}),(0,a.jsx)("button",{type:"button",onClick:()=>B(e),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${t?"border-[var(--vk-orange)] bg-[var(--vk-orange)]/12 text-[var(--vk-orange)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-panel)]"}`,children:t?"Selected":"Use this agent"}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,a.jsx)("div",{className:"grid gap-3",children:tp.filter(e=>{let t=(0,l.yM)(e);return(0,l.Zz)(e)&&(t?.accessOptions.length??0)>1}).map(e=>{let t=(0,l.yM)(e);if(!t)return null;let r=(0,l.Tk)(e,Q)??t.defaultAccess;return(0,a.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:t.label}),(0,a.jsx)("select",{value:r,onChange:t=>{var r;let a;return r=t.target.value,void((a=(0,l.yM)(e))&&ee(e=>({...e,[a.accessKey]:r})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:t.accessOptions.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:t.accessOptions.find(e=>e.id===r)?.description})]},e)})})]})]}),(tr||ts)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:X.map(e=>{let t=_===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>z(e.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(en,{editorId:e.id}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)})}),"notion"!==_&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:G??"",readOnly:!0,onClick:()=>eB(!0),placeholder:"Select your Obsidian vault, Logseq graph, or notes folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eB(!0),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Browse folders",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})}),(G??"").trim().length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>W(""),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Context attachments are discovered from this folder first. Leave it blank to fall back to the current workspace."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Extra Filesystem Roots"}),(0,a.jsx)("textarea",{value:Z,onChange:e=>V(e.target.value),placeholder:"One absolute path per line\n/Applications\n/Users/Shared\n/mnt/projects",rows:5,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eF(!0),disabled:eQ,className:"inline-flex h-9 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),"Add folder"]}),(0,a.jsx)("button",{type:"button",onClick:()=>V(""),disabled:eQ||0===Z.trim().length,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear list"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor already includes sensible defaults for each OS. Add extra roots here when you want the folder picker to expose more locations on macOS, Linux, or Windows."})]})})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[K.map(e=>{let t=ea&&ei===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>{el(!0),ep(e.id),(0,$.$E)(e.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)}),(0,a.jsxs)("button",{type:"button",onClick:()=>el(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!ea?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(H,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!ea&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]})]}):ta?(0,a.jsx)(T,{profile:eZ,loading:eY,error:eX,onRefresh:()=>{e9()}}):to?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:tt?"Repository Defaults":"Repository Configuration"}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:tt?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===t||ev.length>1)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,a.jsxs)("select",{value:ej,onChange:e=>eN(e.target.value),disabled:eu||0===ev.length||eQ,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===ev.length&&(0,a.jsx)("option",{value:"",children:"No repositories configured"}),ev.map(e=>(0,a.jsx)("option",{value:e.id,children:e.displayName},e.id))]})]}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),eu&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),tt&&1===ev.length&&ey&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,a.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[ey.displayName,(0,a.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:ey.path})]})]}),ey&&(0,a.jsxs)(a.Fragment,{children:["settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx --yes --registry=https://registry.npmjs.org conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",ey.workspaceMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",ey.runtimeMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",ey.scmMode]})]}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:tg})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,a.jsx)(ec,{value:tg,idleLabel:"Copy Setup Command"})]})]}),(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,a.jsx)("input",{value:ey.displayName,onChange:e=>ew(t=>t?{...t,displayName:e.target.value}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,a.jsx)("input",{value:ey.repo,onChange:e=>ew(t=>t?{...t,repo:e.target.value}:t),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,a.jsx)("select",{value:ey.agent,onChange:e=>{let t=e.target.value;ew(e=>e?{...e,agent:t}:e),eS((0,O.c0)(t,Q,x,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:tp.map(e=>(0,a.jsx)("option",{value:e,children:I(e)},e))}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,l.Zz)(ey.agent)&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsx)(eo,{agent:ey.agent,modelAccess:Q,runtimeModelCatalogs:x,selection:eC,onChange:eS})}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,a.jsxs)("select",{value:ey.agentPermissions,onChange:e=>ew(t=>t?{...t,agentPermissions:"default"===e.target.value?"default":"skip"}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:[(0,a.jsx)("option",{value:"skip",children:"Auto approve and allow local dev servers"}),(0,a.jsx)("option",{value:"default",children:"Sandboxed default mode"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Applies to new sessions for this repository across all agents unless you override the launch mode."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:ey.path,readOnly:!0,onClick:()=>eM(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eM(!0),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})})]}),!ey.pathHealth.exists&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),ey.pathHealth.exists&&!ey.pathHealth.isGitRepository&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),ey.pathHealth.suggestedPath&&(0,a.jsx)("button",{type:"button",onClick:()=>{let e=ey.pathHealth.suggestedPath??"";e&&(ew(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e3(e))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,a.jsx)("input",{value:ey.defaultWorkingDirectory,onChange:e=>ew(t=>t?{...t,defaultWorkingDirectory:e.target.value}:t),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:ey.defaultBranch,onChange:e=>ew(t=>t?{...t,defaultBranch:e.target.value}:t),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{e3()},disabled:eR,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:eR?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),eA.length>0&&(0,a.jsx)("select",{value:ey.defaultBranch,onChange:e=>ew(t=>t?{...t,defaultBranch:e.target.value}:t),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eA.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),eP&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:eP})]})]}),"settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,a.jsx)("textarea",{rows:3,value:ey.devServerScript,onChange:e=>ew(t=>t?{...t,devServerScript:e.target.value}:t),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Optional. Leave this blank if you run the local app yourself and only want Conductor to auto-connect the preview."})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,a.jsx)("input",{value:ey.devServerCwd,onChange:e=>ew(t=>t?{...t,devServerCwd:e.target.value}:t),placeholder:"e.g., apps/web",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,a.jsx)("input",{value:ey.devServerUrl,onChange:e=>ew(t=>t?{...t,devServerUrl:e.target.value}:t),placeholder:"e.g., https://preview.example.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"If set, preview connects here first instead of inferring from logs."})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,a.jsx)("input",{value:ey.devServerPort,onChange:e=>ew(t=>t?{...t,devServerPort:e.target.value}:t),inputMode:"numeric",placeholder:"3000",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,a.jsx)("input",{value:ey.devServerHost,onChange:e=>ew(t=>t?{...t,devServerHost:e.target.value}:t),placeholder:"127.0.0.1",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,a.jsx)("input",{value:ey.devServerPath,onChange:e=>ew(t=>t?{...t,devServerPath:e.target.value}:t),placeholder:"/",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:ey.devServerHttps,onChange:e=>ew(t=>t?{...t,devServerHttps:e.target.checked}:t),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Use HTTPS"})]})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,a.jsx)("textarea",{rows:4,value:ey.setupScript,onChange:e=>ew(t=>t?{...t,setupScript:e.target.value}:t),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:ey.runSetupInParallel,onChange:e=>ew(t=>t?{...t,runSetupInParallel:e.target.checked}:t),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,a.jsx)("textarea",{rows:4,value:ey.cleanupScript,onChange:e=>ew(t=>t?{...t,cleanupScript:e.target.value}:t),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,a.jsx)("textarea",{rows:4,value:ey.archiveScript,onChange:e=>ew(t=>t?{...t,archiveScript:e.target.value}:t),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,a.jsx)("input",{value:ey.copyFiles,onChange:e=>ew(t=>t?{...t,copyFiles:e.target.value}:t),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):ti?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_8%,transparent)] px-4 py-3",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Access Control"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost by default. If you need access beyond the local machine, put a verified identity layer like Cloudflare Access or Clerk in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),eO?(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.email??"Anonymous local session"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.role??"No access"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.provider??"Local only"})]})]}),!tx&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use a local admin session or an admin identity from your edge auth provider to modify access rules."})}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for remote dashboard requests and decide what authenticated users get by default before explicit role bindings are applied. Localhost on this machine stays in a local admin recovery mode so setup and break-glass access keep working."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:e_.requireAuth,onChange:e=>eT(t=>({...t,requireAuth:e.target.checked})),disabled:!tx||eI||e_.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Unauthenticated public dashboard access is not supported. Use a verified identity provider such as Cloudflare Access or Clerk before exposing the dashboard beyond localhost."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,a.jsxs)("select",{value:e_.defaultRole,onChange:e=>eT(t=>({...t,defaultRole:e.target.value})),disabled:!tx||eI,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,a.jsx)("option",{value:"viewer",children:"Viewer"}),(0,a.jsx)("option",{value:"operator",children:"Operator"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches. Cloudflare Access enterprise mode forces full authentication automatically."})]})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:e_.trustedHeaders.enabled,onChange:e=>eT(t=>({...t,requireAuth:!!e.target.checked||t.requireAuth,trustedHeaders:{...t.trustedHeaders,enabled:e.target.checked}})),disabled:!tx||eI,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,a.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,a.jsx)("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)]",children:"Cloudflare Access (verified JWT)"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,a.jsx)("input",{value:e_.trustedHeaders.emailHeader,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,emailHeader:e.target.value}})),disabled:!tx||eI,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,a.jsx)("input",{value:e_.trustedHeaders.jwtHeader,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,jwtHeader:e.target.value}})),disabled:!tx||eI,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,a.jsx)("input",{value:e_.trustedHeaders.teamDomain,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,teamDomain:e.target.value}})),disabled:!tx||eI,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block lg:col-span-2",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,a.jsx)("input",{value:e_.trustedHeaders.audience,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,audience:e.target.value}})),disabled:!tx||eI,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Verified public dashboard access requires a Cloudflare Access application that injects a signed JWT and identity email header. Conductor will not trust a public request path when that verification layer is missing."})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,a.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:e,key:t,placeholder:r})=>(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:e}),(0,a.jsx)("textarea",{rows:4,value:e_.roles[t],onChange:e=>eT(r=>({...r,roles:{...r.roles,[t]:e.target.value}})),disabled:!tx||eI,placeholder:r,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},t))})]})]})]}):(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:te.label}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, and repository settings are available now."}),(0,a.jsx)("button",{type:"button",onClick:()=>M("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,a.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[tb&&(0,a.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:tb}),!tb&&tn&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tt?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!tb&&to&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tt?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!tb&&ti&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."}),!tb&&ta&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Profile details reflect the current dashboard identity. GitHub avatar and logout controls appear when this session is authenticated through Clerk."})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!tt&&(0,a.jsx)("button",{type:"button",onClick:u,disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),tt&&to&&(0,a.jsx)("button",{type:"button",onClick:()=>M("preferences"),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),tn&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{tk(o.onboardingAcknowledged,{closeDialog:!0})},disabled:!tm||r,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),to&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{e4()},disabled:!tu||eb||eu,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eb?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),ti&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{e8()},disabled:!th||eI,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eI?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{tr?tf():tj()},disabled:tr?!tm||r||eu:!tu||eQ,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eQ||tr&&eu?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),tr&&eu?"Loading...":"Saving..."]}):tr&&tc?"Continue":"Finish Setup"})]})]})]})]})}),(0,a.jsx)(ed,{open:e$,bridgeId:b,initialPath:ey?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>eM(!1),onSelect:e=>{eM(!1),e&&(ew(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e3(e))}}),(0,a.jsx)(ed,{open:eD,bridgeId:b,initialPath:G??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>eB(!1),onSelect:e=>{eB(!1),null!==e&&W(e)}}),(0,a.jsx)(ed,{open:eL,bridgeId:b,title:"Add Filesystem Root",description:"Choose an extra folder root that should stay visible in the filesystem browser on this machine.",onClose:()=>eF(!1),onSelect:e=>{eF(!1),null!==e&&V(t=>{let r=t.split(/\n+/g).map(e=>e.trim()).filter(Boolean);return r.includes(e)?r.join("\n"):[...r,e].join("\n")})}})]})}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56817],{21094:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(13454).A)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]])},23555:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(13454).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},56817:(e,t,r)=>{r.r(t),r.d(t,{NewWorkspaceDialog:()=>ei,SettingsDialog:()=>ex});var a=r(54568),s=r(71708),l=r(76196),n=r(7620),o=r(52353),i=r(20487),d=r(13454);let c=(0,d.A)("circle-user",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);var x=r(50549),p=r(57917),v=r(21048),m=r(55341),u=r(30824),h=r(34737),b=r(20670),g=r(21094),k=r(34309),f=r(36645),j=r(45894),N=r(58299),y=r(62868),w=r(34041),C=r(23555),S=r(59706);let A=(0,d.A)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),H=(0,d.A)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var R=r(5739),E=r(33866),P=r(72410),U=r(31404),$=r(85626);r(51164);var M=r(20217);let D=(0,d.A)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);function B(e){switch(e){case"clerk":return"Clerk";case"cloudflare-access":return"Cloudflare Access";case"trusted-header":return"Verified Header";case"local":return"Local";default:return"Unknown"}}function L(e){return e?e.split("-").map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" "):"No access"}function F({label:e,value:t,href:r}){return(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:e}),r?(0,a.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",className:"mt-2 block break-all text-[14px] text-[var(--vk-orange)] hover:underline",children:t}):(0,a.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:t})]})}function _({profile:e}){let t=(e?.displayName??e?.email??"User").split(/[\s@._-]+/g).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("").slice(0,2);return e?.avatarUrl?(0,a.jsx)("img",{src:e.avatarUrl,alt:e.displayName??e.email??"Profile avatar",className:"h-20 w-20 rounded-full border border-[var(--vk-border)] object-cover shadow-[0_10px_30px_rgba(0,0,0,0.28)]"}):(0,a.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_14%,transparent)] text-[26px] font-semibold text-[var(--vk-accent)]",children:t||"U"})}function T({profile:e,loading:t,error:r,onRefresh:l}){if(t)return(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading profile details..."]});if(r&&!e)return(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Profile Unavailable"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor could not load the active user profile for this session."})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Retry"]})]});let n=e?.displayName??"Unknown user",o=e?.email??"Not available",i=e?.githubUsername?`@${e.githubUsername}`:"Not linked";return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] px-5 py-5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(_,{profile:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"truncate text-[24px] leading-[26px] text-[var(--vk-text-strong)]",children:n}),(0,a.jsx)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-muted)]",children:o}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:L(e?.role??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:B(e?.provider??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:e?"local"===e.provider?"Local admin session":e.authenticated?"Authenticated":"Anonymous":"Unknown"})]})]})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 self-start rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Refresh"]})]})}),(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsx)(F,{label:"Display Name",value:n}),(0,a.jsx)(F,{label:"Email",value:o}),(0,a.jsx)(F,{label:"GitHub Username",value:i,href:e?.githubProfileUrl??null}),(0,a.jsx)(F,{label:"Username",value:e?.username??"Not available"}),(0,a.jsx)(F,{label:"Auth Provider",value:B(e?.provider??null)}),(0,a.jsx)(F,{label:"Access Role",value:L(e?.role??null)})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Session Actions"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Review how this browser session is authenticated and sign out when Conductor owns the session lifecycle."})]}),e?.canLogout&&"clerk"===e.logoutMode?(0,a.jsx)(M.ct,{redirectUrl:"/sign-in",children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-9 items-center gap-2 rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(D,{className:"h-3.5 w-3.5"}),"Log Out"]})}):(0,a.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:e?.provider==="local"?"This is a local recovery session on the current machine, so there is nothing to sign out of.":`This session is managed by ${B(e?.provider??null)}. Sign out from that provider if you need to end access.`}),e?.githubProfileUrl&&(0,a.jsxs)("a",{href:e.githubProfileUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-[13px] text-[var(--vk-orange)] hover:underline",children:[(0,a.jsx)(s.uj0,{size:14}),"Open GitHub Profile"]})]})]})}var O=r(88272);let q="claude-code";function I(e){let t=(0,E.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function z(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function G(e){let t=e.trim();return t?t.split(/[\\/]+/).filter(Boolean).at(-1)??null:null}function W(e){let t=e.trim();if(!t)return null;let r=t.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(r)return r[2]??null;try{let e=new URL(t).pathname.split("/").filter(Boolean).at(-1);return e?e.replace(/\.git$/i,""):null}catch{return null}}function Z(e,t,r){let a=t?.trim();if(a)return a;let s=W(e);if(s)return s;let l=r?.trim();return l||"workspace"}function V(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:`Updated ${new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(t))}`}let Y=[{id:"profile",label:"Profile",icon:c,implemented:!0},{id:"general",label:"General",icon:x.A,implemented:!0},{id:"repositories",label:"Repositories",icon:p.A,implemented:!0},{id:"organization",label:"Organization Settings",icon:v.A,implemented:!0},{id:"projects",label:"Projects",icon:m.A,implemented:!1},{id:"agents",label:"Agents",icon:u.A,implemented:!0},{id:"mcp",label:"MCP Servers",icon:h.A,implemented:!1},{id:"preferences",label:"Preferences",icon:b.A,implemented:!1}],J=[{id:"preferences",label:"Preferences",icon:b.A,implemented:!0},{id:"repositories",label:"Repository",icon:p.A,implemented:!0}],X=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],K=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function Q(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function ee(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).join("\n"):"string"!=typeof e?"":e.split(/[\n,]+/g).map(e=>e.trim()).filter(Boolean).join("\n")}function et(e,t){let r=Q(e),a=Q(r.trustedHeaders),s=Q(r.roles),l=Q(t),n=r.defaultRole,o=l.role;return{requireAuth:!0===r.requireAuth||!0===a.enabled,defaultRole:"viewer"===n||"admin"===n||"operator"===n?n:"operator",trustedHeaders:{enabled:!0===a.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof a.emailHeader&&a.emailHeader.trim().length>0?a.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof a.jwtHeader&&a.jwtHeader.trim().length>0?a.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof a.teamDomain&&a.teamDomain.trim().length>0?a.teamDomain.trim():"",audience:"string"==typeof a.audience&&a.audience.trim().length>0?a.audience.trim():""},roles:{viewers:ee(s.viewers),operators:ee(s.operators),admins:ee(s.admins),viewerDomains:ee(s.viewerDomains),operatorDomains:ee(s.operatorDomains),adminDomains:ee(s.adminDomains)},current:{authenticated:!0===l.authenticated,role:"viewer"===o||"operator"===o||"admin"===o?o:null,email:"string"==typeof l.email&&l.email.trim().length>0?l.email.trim():null,provider:"string"==typeof l.provider&&l.provider.trim().length>0?l.provider.trim():null}}}function er(e,t){let r=(0,l.yM)(e);if(!r||r.accessOptions.length<=1)return null;let a=(0,l.Tk)(e,t);return a?r.accessOptions.find(e=>e.id===a)?.label??null:null}let ea="block h-4 w-4 shrink-0";function es(e){return JSON.stringify(e)}let el={obsidian:{kind:"icon",icon:o.mWn,className:`${ea} text-[#8b5cf6]`},vscode:{kind:"icon",icon:i.$$9,className:`${ea} text-[#22a3f5]`},notion:{kind:"icon",icon:o.i4$,className:`${ea} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ea} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ea} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:x.A,className:`${ea} text-[var(--vk-text-muted)]`}};function en({editorId:e}){let t=el[e];if(!t)return(0,a.jsx)(g.A,{className:`${ea} text-[var(--vk-text-muted)]`});if("image"===t.kind)return(0,a.jsx)("img",{src:t.imageSrc,alt:"",className:t.className});let r=t.icon;return(0,a.jsx)(r,{className:t.className})}function eo({agent:e,modelAccess:t,runtimeModelCatalogs:r,selection:s,onChange:n,compact:o=!1}){if(!(0,l.Zz)(e))return null;let i=(0,l.yM)(e),d=(0,O.Ik)(e,t,r),c=(0,O.xb)(s)??s.catalogModel,x=(0,O.iL)(e,t,r,c),p=er(e,t);return i?(0,a.jsxs)("div",{className:o?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,a.jsxs)("select",{value:s.catalogModel,disabled:0===d.length,onChange:a=>{let l=a.target.value,o=(0,O.iL)(e,t,r,l);n({...s,catalogModel:l,reasoningEffort:o.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,O.YS)(e,t,r,l)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===d.length&&(0,a.jsx)("option",{value:"",children:"No runtime models detected"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[p?`Filtered for ${p}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),x.length>0&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,a.jsx)("select",{value:s.reasoningEffort,onChange:e=>{n({...s,reasoningEffort:e.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:x.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,a.jsx)("input",{value:s.customModel,onChange:a=>{let l=a.target.value,o=l.trim()||s.catalogModel,i=(0,O.iL)(e,t,r,o);n({...s,customModel:l,reasoningEffort:i.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,O.YS)(e,t,r,o)})},placeholder:(0,O.ZA)(e,r),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function ei({open:e,onClose:t,onCreate:r,creating:o,error:i,defaultAgent:d,agentOptions:c,modelAccess:x,runtimeModelCatalogs:p,bridgeId:v}){let[m,u]=(0,n.useState)("git"),[h,b]=(0,n.useState)("source"),[g,C]=(0,n.useState)(""),[S,A]=(0,n.useState)(!1),[H,P]=(0,n.useState)(""),[$,M]=(0,n.useState)(""),[D,B]=(0,n.useState)(""),[L,F]=(0,n.useState)("main"),[_,T]=(0,n.useState)(d),[Y,J]=(0,n.useState)((0,O.Z3)()),[X,K]=(0,n.useState)(!0),[Q,ee]=(0,n.useState)(!0),[et,er]=(0,n.useState)([]),[ea,es]=(0,n.useState)(!1),[el,en]=(0,n.useState)(!1),[ec,ex]=(0,n.useState)(null),[ep,ev]=(0,n.useState)(""),[em,eu]=(0,n.useState)(""),[eh,eb]=(0,n.useState)(!1),[eg,ek]=(0,n.useState)("local"),[ef,ej]=(0,n.useState)([]),[eN,ey]=(0,n.useState)(!1),[ew,eC]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(u("git"),b("source"),C(""),A(!1),P(""),M(""),B(""),F("main"),ee(!0),K(!0),T(d),J((0,O.Z3)()),er([]),en(!1),ex(null),ev(""),eu(""),ej([]),eC(null),ey(!1),eb(!1),ek("local"))},[d,e]),(0,n.useEffect)(()=>{e&&J(e=>{let t=(0,O.c0)(_,x,p,(0,O.xb)(e)??null,(0,O.aB)(e)??null);return e.catalogModel===t.catalogModel&&e.customModel===t.customModel&&e.reasoningEffort===t.reasoningEffort?e:t})},[_,x,e,p]),(0,n.useEffect)(()=>{if(!e)return;let t="git"===m?H.trim().length>0:$.trim().length>0;"source"===h||t||b("source")},[H,$,m,e,h]);let eS=(0,n.useMemo)(()=>{let e;return 0===(e=ep.trim().toLowerCase()).length?et:et.filter(t=>t.fullName.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||(t.ownerLogin??"").toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)||t.defaultBranch.toLowerCase().includes(e))},[ep,et]),eA=(0,n.useMemo)(()=>{let e=et.find(e=>e.httpsUrl===em);return e||(H.trim()?et.find(e=>e.httpsUrl===H.trim())??null:null)},[H,et,em]),eH=(0,n.useMemo)(()=>(function(e){let t=e.trim();if(!t)return null;let r=t.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(r)return`https://github.com/${r[1]}/${r[2]}.git`;let a=t.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return a?`https://github.com/${a[1]}/${a[2]}.git`:null})(ep),[ep]),eR=(0,n.useMemo)(()=>{let e;return(e=ep.trim())&&/^(https?:\/\/|git@)/i.test(e)?e:null},[ep]),eE=(0,n.useMemo)(()=>V(eA?.updatedAt),[eA]),eP=(0,n.useMemo)(()=>{let e=eH??eR;return!!e&&e.toLowerCase()!==H.trim().toLowerCase()},[H,eH,eR]),eU="git"===m?H.trim().length>0:$.trim().length>0,e$=(0,n.useMemo)(()=>{let e=z(g);return e||("git"===m?z(Z(H,eA?.name)):z(G($)??"workspace"))},[H,$,m,g,eA?.name]),eM=(0,n.useMemo)(()=>Z(H,eA?.name,e$),[e$,H,eA?.name]),eD=(0,n.useMemo)(()=>{if(0===D.trim().length)return"";let e=D.trim().replace(/[\\/]+$/,""),t=eM.trim().replace(/^[\\/]+/,"");if(!e)return t;if(!t)return e;let r=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e}${r}${t}`},[eM,D]),eB=(0,n.useMemo)(()=>"git"===m?eA?.fullName??H.trim():G($)??$.trim(),[H,$,m,eA]),eL=(0,n.useMemo)(()=>"git"===m?eA?.description?.trim()||H.trim():$.trim(),[H,$,m,eA]),eF=(0,n.useMemo)(()=>{let e=[...new Set(c)];0===e.length&&e.push(d||q);let t=new Map(E.BO.map((e,t)=>[e,t]));return e.sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:I(e).localeCompare(I(r))})},[c,d]);(0,n.useEffect)(()=>{eF.includes(_)||T(eF[0]??q)},[_,eF]);let e_=async(e=!1)=>{es(!0),ex(null);try{let t=await fetch((0,U.S)(`/api/github/repos${e?"?refresh=true":""}`,v)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load GitHub repositories (${t.status})`);er(Array.isArray(r?.repos)?r.repos:[])}catch(e){er([]),ex(e instanceof Error?e.message:"Failed to load GitHub repositories")}finally{en(!0),es(!1)}};(0,n.useEffect)(()=>{!e||"git"!==m||ea||el||e_()},[el,ea,m,e]);let eT=async e=>{let t=e?.gitUrl??("git"===m?H.trim():""),r=e?.path??("local"===m?$.trim():"");if(0===t.length&&0===r.length)return void eC("git"===m?"Choose or paste a repository first.":"Select a local repository path first.");ey(!0),eC(null);try{let e=new URLSearchParams;t.length>0&&e.set("gitUrl",t),r.length>0&&e.set("path",r);let a=await fetch((0,U.S)(`/api/workspaces/branches?${e.toString()}`,v)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];ej(l);let n="string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??null;n&&(0===L.trim().length||!l.includes(L))&&F(n)}catch(e){ej([]),eC(e instanceof Error?e.message:"Failed to load branches")}finally{ey(!1)}},eO=async e=>{eu(e);let t=et.find(t=>t.httpsUrl===e);t&&(P(t.httpsUrl),ev(t.fullName),F(t.defaultBranch||"main"),S||C(z(t.name)||g),await eT({gitUrl:t.httpsUrl}),b("details"))},eq=async()=>{let e=eH??eR;if(!e)return;let t=et.find(t=>t.httpsUrl.toLowerCase()===e.toLowerCase())??null;if(t)return void await eO(t.httpsUrl);if(eu(""),P(e),F("main"),ej([]),eC(null),!S){let t=W(e);t&&C(z(t))}await eT({gitUrl:e}),b("details")},eI=e=>{ek(e),eb(!0)},ez=e=>{u(e),b("source"),ej([]),eC(null)};if(!e)return null;let eG=eU&&L.trim().length>0;async function eW(e){if(e.preventDefault(),"review"!==h||!eG||o)return;let t="git"===m?{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,O.xb)(Y)??"",agentReasoningEffort:(0,O.aB)(Y)??"",defaultBranch:L.trim(),useWorktree:X,gitUrl:H.trim(),path:eD||void 0}:{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,O.xb)(Y)??"",agentReasoningEffort:(0,O.aB)(Y)??"",defaultBranch:L.trim(),useWorktree:X,path:$.trim(),initializeGit:Q};await r(t)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[80] flex items-end justify-center overflow-y-auto bg-black/65 px-0 py-0 sm:items-center sm:px-3 sm:py-3",onClick:()=>{o||eh||t()},role:"presentation",children:(0,a.jsxs)("form",{onSubmit:eW,onClick:e=>e.stopPropagation(),className:"flex h-dvh w-full max-w-none flex-col overflow-hidden rounded-none border-x-0 border-b-0 border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-auto sm:max-h-[calc(100dvh-3rem)] sm:max-w-[860px] sm:rounded-[10px] sm:border",children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 backdrop-blur",children:[(0,a.jsx)("div",{className:"mb-3 flex justify-center sm:hidden",children:(0,a.jsx)("span",{className:"h-1 w-10 rounded-full bg-[color:color-mix(in_srgb,var(--vk-text-muted)_36%,transparent)]"})}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"source"===h?"Step 1 of 3":"details"===h?"Step 2 of 3":"Step 3 of 3"})]}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"source"===h?"Start with the repository or folder you want Conductor to manage.":"details"===h?"Confirm the project defaults Conductor should use when this workspace is created.":"Review the project and destination details before Conductor adds it."}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[{id:"source",label:"git"===m?"Repository":"Folder"},{id:"details",label:"Project"},{id:"review",label:"Review"}].map(e=>{let t=h===e.id,r="source"===e.id?"source"!==h&&eU:"details"===e.id&&"review"===h;return(0,a.jsxs)("div",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] ${t?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] ${r?"border-[var(--vk-orange)] bg-[var(--vk-orange)] text-black":t?"border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)]"}`,children:r?(0,a.jsx)(k.A,{className:"h-3 w-3"}):"source"===e.id?"1":"details"===e.id?"2":"3"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,"aria-label":"Close dialog",className:"inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 sm:py-5",children:"source"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ez("git"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"git"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.uj0,{className:"h-[18px] w-[18px]"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"GitHub repository"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Search repos you already have access to, or paste a GitHub URL directly."})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>ez("local"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"local"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Local folder"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Point Conductor at a repository already on this machine."})]})]}),"git"===m?(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose repository"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Select a repo first. Branch, workspace name, and runtime defaults come next."})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{en(!1),e_(!0)},disabled:ea,className:"inline-flex h-9 items-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ea?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.uj0,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:ep,onChange:e=>ev(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eP&&(e.preventDefault(),eq())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-11 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent pl-10 pr-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),eP?(0,a.jsxs)("button",{type:"button",onClick:()=>{eq()},className:"inline-flex w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2.5 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(s.SYR,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,a.jsxs)("span",{className:"truncate",children:["Use ",eH?"this GitHub repository":"pasted repository URL"]})]}):null,ea&&0===et.length?(0,a.jsx)("div",{className:"rounded-[8px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,ec?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,a.jsx)("p",{children:ec}),(0,a.jsx)("button",{type:"button",onClick:()=>{en(!1),e_(!0)},className:"mt-2 inline-flex items-center rounded-[6px] border border-[var(--vk-border)] px-2 py-1 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Retry"})]}):null,!ec&&eS.length>0?(0,a.jsx)("div",{className:"max-h-[min(42dvh,340px)] space-y-2 overflow-y-auto pr-1",children:eS.map(e=>{let t=V(e.updatedAt),r=eA?.httpsUrl===e.httpsUrl;return(0,a.jsxs)("button",{type:"button",onClick:()=>{eO(e.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition ${r?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.fullName}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[e.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),e.private?"Private":"Public"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(s.C3c,{className:"h-3 w-3"}),e.defaultBranch]})]}),e.description?(0,a.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:e.description}):null,(0,a.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[e.ownerLogin?(0,a.jsx)("span",{children:e.ownerLogin}):null,t?(0,a.jsx)("span",{children:t}):null,e.permission?(0,a.jsx)("span",{children:e.permission.toLowerCase()}):null]})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:r?(0,a.jsx)(k.A,{className:"h-4 w-4"}):null})]},e.httpsUrl)})}):null,ea||ec||0!==eS.length?null:(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:ep.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}):(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose folder"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Pick the repository folder already on disk. You can adjust branch and runtime defaults next."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eI("local"),className:"inline-flex h-11 w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),$.trim().length>0?"Choose another folder":"Choose folder"]}),$.trim().length>0?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:[(0,a.jsx)("p",{className:"text-[12px] font-medium text-[var(--vk-text-strong)]",children:"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:$})]}):(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"The folder picker stays separate so you do not lose your place in this setup flow on mobile."})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]}):"details"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"git"===m?"Selected repository":"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eB}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eL}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:"git"===m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[eA?.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),eA?eA.private?"Private":"Public":"Manual URL"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(s.C3c,{className:"h-3 w-3"}),L||"main"]}),eA?.ownerLogin?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eA.ownerLogin}):null,eE?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eE}):null]}):(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"Local repository"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),className:"inline-flex h-9 items-center justify-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Change"})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,a.jsx)("input",{value:g,onChange:e=>{C(e.target.value),A(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:L,onChange:e=>F(e.target.value),placeholder:"Uses the repository default branch",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eT()},disabled:eN,className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:eN?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),ef.length>0?(0,a.jsx)("select",{value:L,onChange:e=>F(e.target.value),className:"mt-2 h-9 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ef.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}):null,ew?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:ew}):null]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:["Agent: ",I(_)]}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:X?"Worktree isolation on":"Runs on selected branch"}),"local"===m?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:Q?"Auto-init git if needed":"Do not init git"}):null]}),(0,l.Zz)(_)?(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Agent defaults"}),(0,a.jsx)("p",{className:"mt-0.5 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Choose the model and reasoning this workspace should inherit when sessions launch."})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(eo,{compact:!0,agent:_,modelAccess:x,runtimeModelCatalogs:p,selection:Y,onChange:J})})]}):null,(0,a.jsxs)("details",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-3 py-3 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)(w.A,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Runtime and repository options"]})}),(0,a.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,a.jsx)("select",{value:_,onChange:e=>T(e.target.value),className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eF.map(e=>(0,a.jsx)("option",{value:e,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:I(e)},e))})]}),(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:X,onChange:e=>K(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Recommended. Turn this off only if sessions should run directly on the selected branch."})]})]})}),"local"===m?(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:Q,onChange:e=>ee(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Initialize git if this folder is not already a repository",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Leave this on unless you know the folder should stay non-git."})]})]})}):(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Clone into parent folder"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:D,readOnly:!0,onClick:()=>eI("clone"),placeholder:"Leave empty to use Conductor's default repo location",className:"h-10 w-full cursor-pointer rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eI("clone"),className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:eD?`Conductor will create ${eD}.`:"Conductor will create the cloned repository inside the selected parent folder."})]})]})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Review project"}),(0,a.jsxs)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:["Conductor will add ",(0,a.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:e$||"workspace"})," ","and sync the board plus support files for this project."]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Project"}),(0,a.jsx)("p",{className:"mt-2 text-[15px] font-medium text-[var(--vk-text-strong)]",children:e$||"workspace"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:g.trim().length>0?"Uses the custom workspace name you entered.":"Auto-derived from the selected repository or folder."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Source"}),(0,a.jsx)("p",{className:"mt-2 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eB}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eL})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Destination"}),(0,a.jsx)("p",{className:"mt-2 break-all text-[15px] font-medium text-[var(--vk-text-strong)]",children:"git"===m?eD||"Conductor default repo location":$}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"git"===m?eD?`The repository will be cloned into ${eD}.`:"Conductor will choose the default clone location for this repository.":"Conductor will link the selected folder directly."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Runtime Defaults"}),(0,a.jsxs)("div",{className:"mt-2 space-y-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsxs)("p",{children:["Branch: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:L.trim()||"main"})]}),(0,a.jsxs)("p",{children:["Agent: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:I(_)})]}),(0,a.jsxs)("p",{children:["Isolation: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:X?"Worktree enabled":"Runs on selected branch"})]}),(0,O.xb)(Y)?(0,a.jsxs)("p",{children:["Model: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,O.xb)(Y)})]}):null,(0,O.aB)(Y)?(0,a.jsxs)("p",{children:["Reasoning: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,O.aB)(Y)})]}):null,"local"===m?(0,a.jsxs)("p",{children:["Git init: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:Q?"Enabled if needed":"Disabled"})]}):null]})]})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]})}),(0,a.jsx)("footer",{className:"border-t border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur",children:"source"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{"local"!==m||eU?eU&&!o&&b("details"):eI("local")},disabled:"git"===m&&!eU||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"local"!==m||eU?"Continue":"Choose folder"})]}):"details"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eU&&0!==L.trim().length&&!o&&b("review")},disabled:!eG||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Review"})]}):(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("details"),disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"submit",disabled:!eG||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})})]})}),(0,a.jsx)(ed,{open:eh,bridgeId:v,initialPath:"clone"===eg?D:$,title:"local"===eg?"Select Local Repository":"Select Clone Parent Folder",description:"local"===eg?"Choose the local repository folder.":"Choose the parent folder where Conductor should create the cloned repository.",onClose:()=>eb(!1),onSelect:e=>{if(eb(!1),e){if("clone"===eg)return void B(e);if(M(e),!S){let t=G(e);t&&C(z(t))}eT({path:e}),b("details")}}})]})}function ed({open:e,bridgeId:t,initialPath:r,title:s,description:l,onClose:o,onSelect:i}){let[d,c]=(0,n.useState)(""),[x,p]=(0,n.useState)(r??""),[v,m]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[b,g]=(0,n.useState)(!1),[k,f]=(0,n.useState)(null),[y,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!e)return;h(""),p(r??"");let a=r&&r.trim().length>0?r.trim():void 0,s=a?`?path=${encodeURIComponent(a)}`:"";g(!0),f(null),fetch((0,U.S)(`/api/filesystem/directory${s}`,t)).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load directory (${e.status})`);c("string"==typeof t?.currentPath?t.currentPath:""),m(Array.isArray(t?.entries)?t.entries:[])}).catch(e=>{f(e instanceof Error?e.message:"Failed to load directory"),m([])}).finally(()=>{g(!1)})},[r,e]);let S=(0,n.useMemo)(()=>{if(0===u.trim().length)return v;let e=u.trim().toLowerCase();return v.filter(t=>t.name.toLowerCase().includes(e))},[v,u]),A=async e=>{g(!0),f(null);try{let r=e&&e.trim().length>0?`?path=${encodeURIComponent(e.trim())}`:"",a=await fetch((0,U.S)(`/api/filesystem/directory${r}`,t)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load directory (${a.status})`);let l="string"==typeof s?.currentPath?s.currentPath:"";c(l),m(Array.isArray(s?.entries)?s.entries:[]),p(l)}catch(e){f(e instanceof Error?e.message:"Failed to load directory"),m([])}finally{g(!1)}},H=async()=>{w(!0);try{let e=await fetch((0,U.S)("/api/filesystem/pick-directory",t),{method:"POST"}),r=await e.json().catch(()=>null);if(!r||r.cancelled||!r.path)return;p(r.path),A(r.path)}catch{}finally{w(!1)}};return e?(0,a.jsx)("div",{className:"fixed inset-0 z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{o(),i(null)},role:"presentation",children:(0,a.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:s}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:l})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{value:x,onChange:e=>p(e.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{A(x)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{A()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,a.jsx)("button",{type:"button",onClick:()=>{if(!d)return;let e=d.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(d)||"/"===e)return;let t=e.split("/").filter(Boolean),r=d.match(/^([A-Za-z]):[/\\]/);A(r?t.length>1?`${r[1]}:/${t.slice(1,-1).join("/")}`:`${r[1]}:/`:t.length>1?`/${t.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,a.jsxs)("button",{type:"button",disabled:y,onClick:()=>{H()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[y?(0,a.jsx)(N.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(j.A,{className:"h-3 w-3"}),y?"Opening...":"Browse"]}),(0,a.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:d||"Home"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(C.A,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:u,onChange:e=>h(e.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:b?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):k?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:k}):0===S.length?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,a.jsx)("div",{className:"p-1",children:S.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{e.isDirectory&&A(e.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${e.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)(j.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,a.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},e.path))})})]}),(0,a.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{o(),i(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{let e=x.trim().length>0?x.trim():d;o(),i(e||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}function ec({value:e,idleLabel:t="Copy",copiedLabel:r="Copied"}){let[s,l]=(0,n.useState)(!1);async function o(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1400)}return(0,a.jsxs)("button",{type:"button",onClick:()=>void o(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[s?(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:s?r:t})]})}function ex({open:e,mode:t,creating:r,error:s,current:o,projectCount:i,agentOptions:d,agentStates:c,runtimeModelCatalogs:x,onRepositoriesChanged:p,onOnboardingComplete:v,onOpenAgentSetup:m,onClose:u,onSave:h,bridgeId:b}){var g,w;let C,[S,M]=(0,n.useState)("preferences"),[D,B]=(0,n.useState)(o.codingAgent),[L,F]=(0,n.useState)(o.ide),[_,z]=(0,n.useState)(o.markdownEditor),[G,W]=(0,n.useState)(o.markdownEditorPath??""),[Z,V]=(0,n.useState)(()=>o.filesystemBrowseRoots.join("\n")),[Q,ee]=(0,n.useState)(o.modelAccess),[ea,el]=(0,n.useState)(o.notifications.soundEnabled),[ei,ep]=(0,n.useState)(o.notifications.soundFile),[ev,em]=(0,n.useState)([]),[eu,eh]=(0,n.useState)(!1),[eb,eg]=(0,n.useState)(!1),[ek,ef]=(0,n.useState)(null),[ej,eN]=(0,n.useState)(""),[ey,ew]=(0,n.useState)(null),[eC,eS]=(0,n.useState)((0,O.Z3)()),[eA,eH]=(0,n.useState)([]),[eR,eE]=(0,n.useState)(!1),[eP,eU]=(0,n.useState)(null),[e$,eM]=(0,n.useState)(!1),[eD,eB]=(0,n.useState)(!1),[eL,eF]=(0,n.useState)(!1),[e_,eT]=(0,n.useState)(()=>et(null)),[eO,eq]=(0,n.useState)(!1),[eI,ez]=(0,n.useState)(!1),[eG,eW]=(0,n.useState)(null),[eZ,eV]=(0,n.useState)(null),[eY,eJ]=(0,n.useState)(!1),[eX,eK]=(0,n.useState)(null),eQ=r||eb||eI;function e0(e){return{...e,agentPermissions:"default"===e.agentPermissions?"default":"skip",devServerScript:e.devServerScript??"",devServerCwd:e.devServerCwd??"",devServerUrl:e.devServerUrl??"",devServerPort:e.devServerPort??"",devServerHost:e.devServerHost??"",devServerPath:e.devServerPath??"",devServerHttps:!0===e.devServerHttps,pathHealth:{exists:e.pathHealth.exists,isGitRepository:e.pathHealth.isGitRepository,suggestedPath:e.pathHealth.suggestedPath}}}function e1(e){return e.split(/\n+/g).map(e=>e.trim()).filter(Boolean)}async function e2(e){eh(!0),ef(null);try{let t=await fetch((0,U.S)("/api/repositories",b)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load repositories (${t.status})`);let a=Array.isArray(r?.repositories)?r.repositories:[];em(a);let s=a[0]?.id??"",l=e&&a.some(t=>t.id===e)?e:ej&&a.some(e=>e.id===ej)?ej:s;eN(l)}catch(e){em([]),eN(""),ew(null),eS((0,O.Z3)()),ef(e instanceof Error?e.message:"Failed to load repositories")}finally{eh(!1)}}async function e3(e,t){let r=(e??ey?.path??"").trim();if(0===r.length){eU("Select a repository path first."),eH([]);return}eE(!0),eU(null);try{let e=new URLSearchParams({path:r}),a=await fetch((0,U.S)(`/api/workspaces/branches?${e.toString()}`,b)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to detect branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eH(l);let n=t?.trim()||("string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??"");if(!n)return;ew(e=>!e||e.defaultBranch.trim().length>0&&l.includes(e.defaultBranch)?e:{...e,defaultBranch:n})}catch(e){eH([]),eU(e instanceof Error?e.message:"Failed to detect branches")}finally{eE(!1)}}async function e4(){if(!ey||eb||0===ey.repo.trim().length||0===ey.path.trim().length)return!1;eg(!0),ef(null);try{let e=await fetch((0,U.S)("/api/repositories",b),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:ey.id,displayName:ey.displayName,repo:ey.repo,path:ey.path,agent:ey.agent,agentPermissions:ey.agentPermissions,agentModel:(0,O.xb)(eC)??"",agentReasoningEffort:(0,O.aB)(eC)??"",defaultWorkingDirectory:ey.defaultWorkingDirectory,defaultBranch:ey.defaultBranch,devServerScript:ey.devServerScript,devServerCwd:ey.devServerCwd,devServerUrl:ey.devServerUrl,devServerPort:ey.devServerPort,devServerHost:ey.devServerHost,devServerPath:ey.devServerPath,devServerHttps:ey.devServerHttps,setupScript:ey.setupScript,runSetupInParallel:ey.runSetupInParallel,cleanupScript:ey.cleanupScript,archiveScript:ey.archiveScript,copyFiles:ey.copyFiles})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save repository settings (${e.status})`);let r=t?.repository;if(!r)throw Error("Repository saved but response is missing repository data");return em(e=>e.map(e=>e.id===r.id?r:e)),ew(e0(r)),eN(r.id),eU(null),await e3(r.path,r.defaultBranch),p&&await p(),!0}catch(e){return ef(e instanceof Error?e.message:"Failed to save repository settings"),!1}finally{eg(!1)}}async function e5(){eq(!0),eW(null);try{let e=await fetch("/api/access"),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load organization settings (${e.status})`);eT(et(t?.access,t?.current))}catch(e){eT(et(null)),eW(e instanceof Error?e.message:"Failed to load organization settings")}finally{eq(!1)}}async function e9(){eJ(!0),eK(null);try{let e=await fetch("/api/auth/profile",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){let r=t&&"object"==typeof t&&"error"in t&&"string"==typeof t.error?t.error:`Failed to load profile (${e.status})`;throw Error(r)}eV(t)}catch(e){eV(null),eK(e instanceof Error?e.message:"Failed to load profile")}finally{eJ(!1)}}async function e8(){if(eI)return!1;ez(!0),eW(null);try{let e=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:e_.requireAuth||e_.trustedHeaders.enabled,defaultRole:e_.defaultRole,trustedHeaders:{enabled:e_.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:e_.trustedHeaders.emailHeader,jwtHeader:e_.trustedHeaders.jwtHeader,teamDomain:e_.trustedHeaders.teamDomain,audience:e_.trustedHeaders.audience},roles:{viewers:e1(e_.roles.viewers),operators:e1(e_.roles.operators),admins:e1(e_.roles.admins),viewerDomains:e1(e_.roles.viewerDomains),operatorDomains:e1(e_.roles.operatorDomains),adminDomains:e1(e_.roles.adminDomains)}})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save organization settings (${e.status})`);return eT(et(t?.access,t?.current)),!0}catch(e){return eW(e instanceof Error?e.message:"Failed to save organization settings"),!1}finally{ez(!1)}}(0,n.useEffect)(()=>{e&&(M("onboarding"===t?"preferences":"general"),B(o.codingAgent),F(o.ide),z(o.markdownEditor),W(o.markdownEditorPath??""),V(o.filesystemBrowseRoots.join("\n")),ee(o.modelAccess),el(o.notifications.soundEnabled),ep(o.notifications.soundFile),eH([]),eU(null),ef(null),eS((0,O.Z3)()),eW(null),eV(null),eK(null))},[t,e]),(0,n.useEffect)(()=>{e&&("settings"===t||"repositories"===S)&&e2()},[S,t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&e5()},[t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&"profile"===S&&e9()},[S,t,e]),(0,n.useEffect)(()=>{if(!e)return;if(!ej){ew(null),eS((0,O.Z3)());return}let t=ev.find(e=>e.id===ej);if(!t)return;let r=(0,E.a6)(t.agent,D||q);ew(e0({...t,agent:r})),eS((0,O.c0)(r,Q,x,t.agentModel,t.agentReasoningEffort)),eH([]),eU(null),t.path.trim().length>0&&e3(t.path,t.defaultBranch)},[D,Q,e,ev,x,ej]);let e6="onboarding"===t&&i>0,e7=(0,n.useMemo)(()=>"onboarding"===t?e6?J:J.filter(e=>"preferences"===e.id):Y.filter(e=>e.implemented),[t,e6]),te=e7.find(e=>e.id===S)??e7[0]??Y[0],tt="onboarding"===t,tr="preferences"===te.id,ta="profile"===te.id,ts="general"===te.id,tl="agents"===te.id,tn=tr||ts||tl,to="repositories"===te.id,ti="organization"===te.id,td=e7.findIndex(e=>e.id===te.id)+1,tc=e7.some(e=>"repositories"===e.id),tx="admin"===e_.current.role,tp=(0,n.useMemo)(()=>{let e=new Set((0,E.Ge)(d));D.trim().length>0&&(0,E.iQ)(D)&&e.add(D),0===e.size&&e.add(q);let t=new Map(E.BO.map((e,t)=>[e,t]));return[...e].sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:I(e).localeCompare(I(r))})},[d,D]);(0,n.useEffect)(()=>{0!==tp.length&&(D&&tp.includes(D)||B((0,E.a6)(D,tp[0]??q)))},[D,tp]);let tv=c[(0,R.q)(D)]??null;if(!e)return null;let tm=D.trim().length>0&&L.trim().length>0&&_.trim().length>0,tu=!!ey&&ey.displayName.trim().length>0&&ey.repo.trim().length>0&&ey.path.trim().length>0&&ey.defaultBranch.trim().length>0,th=tx&&!eO&&(!e_.trustedHeaders.enabled||e_.trustedHeaders.teamDomain.trim().length>0&&e_.trustedHeaders.audience.trim().length>0),tb=to?ek:ti?eG:ta?eX:s,tg=ey?(g={...ey,agentModel:(0,O.xb)(eC)??"",agentReasoningEffort:(0,O.aB)(eC)??""},w={ide:L,markdownEditor:_},C=["npx --yes --registry=https://registry.npmjs.org conductor-oss@latest setup","--yes",`--path ${es(g.path)}`,`--project-id ${es(g.id)}`,`--display-name ${es(g.displayName)}`,`--agent ${es(g.agent||"claude-code")}`,`--ide ${es(w.ide)}`,`--markdown-editor ${es(w.markdownEditor)}`],g.repo.trim().length>0&&C.push(`--repo ${es(g.repo.trim())}`),g.defaultBranch.trim().length>0&&C.push(`--default-branch ${es(g.defaultBranch.trim())}`),g.agentModel.trim().length>0&&C.push(`--model ${es(g.agentModel.trim())}`),g.agentReasoningEffort.trim().length>0&&C.push(`--reasoning-effort ${es(g.agentReasoningEffort.trim())}`),g.defaultWorkingDirectory.trim().length>0&&C.push(`--default-working-directory ${es(g.defaultWorkingDirectory.trim())}`),C.join(" ")):"";async function tk(e,t){let a,s;if(!tm||r)return!1;let l=await h((a=ea?ei??K[0]?.id??"abstract-sound-4":null,s=Z.split(/\n+/g).map(e=>e.trim()).filter(Boolean),{onboardingAcknowledged:!!e||o.onboardingAcknowledged,codingAgent:D.trim(),ide:L.trim(),markdownEditor:_.trim(),markdownEditorPath:(G??"").trim(),filesystemBrowseRoots:s,modelAccess:Q,notifications:{soundEnabled:ea,soundFile:a}}),t);return l&&tv&&!tv.ready&&m(D),l}async function tf(){if(!eu){if(!tc){if(!await tk(!0,{closeDialog:!0}))return;v?.({needsProject:0===i});return}await tk(!1,{closeDialog:!1})&&M("repositories")}}async function tj(){(!to||await e4())&&await tk(!0,{closeDialog:!0})&&v?.({needsProject:!1})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center",onClick:()=>{eQ||"onboarding"===t||e$||eD||eL||u()},role:"presentation",children:(0,a.jsxs)("div",{className:"flex h-[100dvh] w-full flex-col overflow-hidden border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(92vh,760px)] sm:max-h-[calc(100dvh-1.5rem)] sm:max-w-[1120px] sm:rounded-[6px] sm:border sm:flex-row",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,a.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,a.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tt?"Setup":"Settings"})}),(0,a.jsx)("nav",{className:"-mx-0.5 flex gap-1 overflow-x-auto px-2 py-2 sm:mx-0 sm:block sm:space-y-1 sm:overflow-auto sm:px-2",children:e7.map(e=>{let t=e.icon,r=te.id===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>M(e.id),disabled:eQ,className:`flex min-h-[44px] shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:min-h-0 sm:w-full ${r?"bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,a.jsx)(t,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tt?tr?"Choose your preferences":"Review repository defaults":te.label}),tt&&(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",td," of ",e7.length]})]}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:eQ||"onboarding"===t,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 sm:px-6 sm:py-4",children:tn?(0,a.jsxs)("div",{className:"space-y-5",children:[tt&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_10%,transparent)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using terminals and boards immediately."})}),(tr||tl)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent, review its setup state, and confirm which models Conductor can offer for it."}),(0,a.jsx)("div",{className:"grid gap-3",children:tp.map(e=>{let t=D===e,r=c[(0,R.q)(e)]??null,s=er(e,Q),n=(0,O.Ik)(e,Q,x),o=n.slice(0,3),i=n.length-o.length,d=r?.installed?r.ready?"Ready":"Setup required":"Not installed";return(0,a.jsxs)("div",{className:`flex flex-col gap-3 rounded-[4px] border px-3 py-3 text-left sm:flex-row sm:items-start ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,a.jsx)(P.N,{seed:{label:e},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:I(e)}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:d}),s?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:s}):null]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:r?.description??(0,E.h7)(e)?.description??"Agent metadata not available."}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[o.map(t=>(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:t.label},`${e}-${t.id}`)),i>0?(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:["+",i," more"]}):null,0===o.length?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:(0,l.Zz)(e)?"Models appear after setup":"Uses the agent default model"}):null]}),!r?.installed&&r?.installHint?(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,a.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:r.installHint})]}):null]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 self-start sm:ml-auto",children:[r?.ready?null:(0,a.jsx)("button",{type:"button",onClick:()=>{B(e),m(e)},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-panel)]",children:r?.installed?"Authenticate":"Install"}),(0,a.jsx)("button",{type:"button",onClick:()=>B(e),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${t?"border-[var(--vk-orange)] bg-[var(--vk-orange)]/12 text-[var(--vk-orange)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-panel)]"}`,children:t?"Selected":"Use this agent"}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,a.jsx)("div",{className:"grid gap-3",children:tp.filter(e=>{let t=(0,l.yM)(e);return(0,l.Zz)(e)&&(t?.accessOptions.length??0)>1}).map(e=>{let t=(0,l.yM)(e);if(!t)return null;let r=(0,l.Tk)(e,Q)??t.defaultAccess;return(0,a.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:t.label}),(0,a.jsx)("select",{value:r,onChange:t=>{var r;let a;return r=t.target.value,void((a=(0,l.yM)(e))&&ee(e=>({...e,[a.accessKey]:r})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:t.accessOptions.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:t.accessOptions.find(e=>e.id===r)?.description})]},e)})})]})]}),(tr||ts)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:X.map(e=>{let t=_===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>z(e.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(en,{editorId:e.id}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)})}),"notion"!==_&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:G??"",readOnly:!0,onClick:()=>eB(!0),placeholder:"Select your Obsidian vault, Logseq graph, or notes folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eB(!0),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Browse folders",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})}),(G??"").trim().length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>W(""),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Context attachments are discovered from this folder first. Leave it blank to fall back to the current workspace."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Extra Filesystem Roots"}),(0,a.jsx)("textarea",{value:Z,onChange:e=>V(e.target.value),placeholder:"One absolute path per line\n/Applications\n/Users/Shared\n/mnt/projects",rows:5,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eF(!0),disabled:eQ,className:"inline-flex h-9 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),"Add folder"]}),(0,a.jsx)("button",{type:"button",onClick:()=>V(""),disabled:eQ||0===Z.trim().length,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear list"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor already includes sensible defaults for each OS. Add extra roots here when you want the folder picker to expose more locations on macOS, Linux, or Windows."})]})})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[K.map(e=>{let t=ea&&ei===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>{el(!0),ep(e.id),(0,$.$E)(e.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)}),(0,a.jsxs)("button",{type:"button",onClick:()=>el(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!ea?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(H,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!ea&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]})]}):ta?(0,a.jsx)(T,{profile:eZ,loading:eY,error:eX,onRefresh:()=>{e9()}}):to?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:tt?"Repository Defaults":"Repository Configuration"}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:tt?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===t||ev.length>1)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,a.jsxs)("select",{value:ej,onChange:e=>eN(e.target.value),disabled:eu||0===ev.length||eQ,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===ev.length&&(0,a.jsx)("option",{value:"",children:"No repositories configured"}),ev.map(e=>(0,a.jsx)("option",{value:e.id,children:e.displayName},e.id))]})]}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),eu&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),tt&&1===ev.length&&ey&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,a.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[ey.displayName,(0,a.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:ey.path})]})]}),ey&&(0,a.jsxs)(a.Fragment,{children:["settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx --yes --registry=https://registry.npmjs.org conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",ey.workspaceMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",ey.runtimeMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",ey.scmMode]})]}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:tg})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,a.jsx)(ec,{value:tg,idleLabel:"Copy Setup Command"})]})]}),(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,a.jsx)("input",{value:ey.displayName,onChange:e=>ew(t=>t?{...t,displayName:e.target.value}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,a.jsx)("input",{value:ey.repo,onChange:e=>ew(t=>t?{...t,repo:e.target.value}:t),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,a.jsx)("select",{value:ey.agent,onChange:e=>{let t=e.target.value;ew(e=>e?{...e,agent:t}:e),eS((0,O.c0)(t,Q,x,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:tp.map(e=>(0,a.jsx)("option",{value:e,children:I(e)},e))}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,l.Zz)(ey.agent)&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsx)(eo,{agent:ey.agent,modelAccess:Q,runtimeModelCatalogs:x,selection:eC,onChange:eS})}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,a.jsxs)("select",{value:ey.agentPermissions,onChange:e=>ew(t=>t?{...t,agentPermissions:"default"===e.target.value?"default":"skip"}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:[(0,a.jsx)("option",{value:"skip",children:"Auto approve and allow local dev servers"}),(0,a.jsx)("option",{value:"default",children:"Sandboxed default mode"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Applies to new sessions for this repository across all agents unless you override the launch mode."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:ey.path,readOnly:!0,onClick:()=>eM(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eM(!0),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})})]}),!ey.pathHealth.exists&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),ey.pathHealth.exists&&!ey.pathHealth.isGitRepository&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),ey.pathHealth.suggestedPath&&(0,a.jsx)("button",{type:"button",onClick:()=>{let e=ey.pathHealth.suggestedPath??"";e&&(ew(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e3(e))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,a.jsx)("input",{value:ey.defaultWorkingDirectory,onChange:e=>ew(t=>t?{...t,defaultWorkingDirectory:e.target.value}:t),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:ey.defaultBranch,onChange:e=>ew(t=>t?{...t,defaultBranch:e.target.value}:t),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{e3()},disabled:eR,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:eR?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),eA.length>0&&(0,a.jsx)("select",{value:ey.defaultBranch,onChange:e=>ew(t=>t?{...t,defaultBranch:e.target.value}:t),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eA.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),eP&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:eP})]})]}),"settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,a.jsx)("textarea",{rows:3,value:ey.devServerScript,onChange:e=>ew(t=>t?{...t,devServerScript:e.target.value}:t),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Optional. Leave this blank if you run the local app yourself and only want Conductor to auto-connect the preview."})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,a.jsx)("input",{value:ey.devServerCwd,onChange:e=>ew(t=>t?{...t,devServerCwd:e.target.value}:t),placeholder:"e.g., apps/web",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,a.jsx)("input",{value:ey.devServerUrl,onChange:e=>ew(t=>t?{...t,devServerUrl:e.target.value}:t),placeholder:"e.g., https://preview.example.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"If set, preview connects here first instead of inferring from logs."})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,a.jsx)("input",{value:ey.devServerPort,onChange:e=>ew(t=>t?{...t,devServerPort:e.target.value}:t),inputMode:"numeric",placeholder:"3000",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,a.jsx)("input",{value:ey.devServerHost,onChange:e=>ew(t=>t?{...t,devServerHost:e.target.value}:t),placeholder:"127.0.0.1",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,a.jsx)("input",{value:ey.devServerPath,onChange:e=>ew(t=>t?{...t,devServerPath:e.target.value}:t),placeholder:"/",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:ey.devServerHttps,onChange:e=>ew(t=>t?{...t,devServerHttps:e.target.checked}:t),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Use HTTPS"})]})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,a.jsx)("textarea",{rows:4,value:ey.setupScript,onChange:e=>ew(t=>t?{...t,setupScript:e.target.value}:t),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:ey.runSetupInParallel,onChange:e=>ew(t=>t?{...t,runSetupInParallel:e.target.checked}:t),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,a.jsx)("textarea",{rows:4,value:ey.cleanupScript,onChange:e=>ew(t=>t?{...t,cleanupScript:e.target.value}:t),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,a.jsx)("textarea",{rows:4,value:ey.archiveScript,onChange:e=>ew(t=>t?{...t,archiveScript:e.target.value}:t),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,a.jsx)("input",{value:ey.copyFiles,onChange:e=>ew(t=>t?{...t,copyFiles:e.target.value}:t),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):ti?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_8%,transparent)] px-4 py-3",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Access Control"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost by default. If you need access beyond the local machine, put a verified identity layer like Cloudflare Access or Clerk in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),eO?(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.email??"Anonymous local session"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.role??"No access"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.provider??"Local only"})]})]}),!tx&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use a local admin session or an admin identity from your edge auth provider to modify access rules."})}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for remote dashboard requests and decide what authenticated users get by default before explicit role bindings are applied. Localhost on this machine stays in a local admin recovery mode so setup and break-glass access keep working."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:e_.requireAuth,onChange:e=>eT(t=>({...t,requireAuth:e.target.checked})),disabled:!tx||eI||e_.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Unauthenticated public dashboard access is not supported. Use a verified identity provider such as Cloudflare Access or Clerk before exposing the dashboard beyond localhost."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,a.jsxs)("select",{value:e_.defaultRole,onChange:e=>eT(t=>({...t,defaultRole:e.target.value})),disabled:!tx||eI,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,a.jsx)("option",{value:"viewer",children:"Viewer"}),(0,a.jsx)("option",{value:"operator",children:"Operator"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches. Cloudflare Access enterprise mode forces full authentication automatically."})]})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:e_.trustedHeaders.enabled,onChange:e=>eT(t=>({...t,requireAuth:!!e.target.checked||t.requireAuth,trustedHeaders:{...t.trustedHeaders,enabled:e.target.checked}})),disabled:!tx||eI,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,a.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,a.jsx)("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)]",children:"Cloudflare Access (verified JWT)"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,a.jsx)("input",{value:e_.trustedHeaders.emailHeader,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,emailHeader:e.target.value}})),disabled:!tx||eI,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,a.jsx)("input",{value:e_.trustedHeaders.jwtHeader,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,jwtHeader:e.target.value}})),disabled:!tx||eI,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,a.jsx)("input",{value:e_.trustedHeaders.teamDomain,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,teamDomain:e.target.value}})),disabled:!tx||eI,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block lg:col-span-2",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,a.jsx)("input",{value:e_.trustedHeaders.audience,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,audience:e.target.value}})),disabled:!tx||eI,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Verified public dashboard access requires a Cloudflare Access application that injects a signed JWT and identity email header. Conductor will not trust a public request path when that verification layer is missing."})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,a.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:e,key:t,placeholder:r})=>(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:e}),(0,a.jsx)("textarea",{rows:4,value:e_.roles[t],onChange:e=>eT(r=>({...r,roles:{...r.roles,[t]:e.target.value}})),disabled:!tx||eI,placeholder:r,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},t))})]})]})]}):(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:te.label}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, and repository settings are available now."}),(0,a.jsx)("button",{type:"button",onClick:()=>M("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,a.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[tb&&(0,a.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:tb}),!tb&&tn&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tt?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!tb&&to&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tt?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!tb&&ti&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."}),!tb&&ta&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Profile details reflect the current dashboard identity. GitHub avatar and logout controls appear when this session is authenticated through Clerk."})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!tt&&(0,a.jsx)("button",{type:"button",onClick:u,disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),tt&&to&&(0,a.jsx)("button",{type:"button",onClick:()=>M("preferences"),disabled:eQ,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),tn&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{tk(o.onboardingAcknowledged,{closeDialog:!0})},disabled:!tm||r,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),to&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{e4()},disabled:!tu||eb||eu,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eb?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),ti&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{e8()},disabled:!th||eI,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eI?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{tr?tf():tj()},disabled:tr?!tm||r||eu:!tu||eQ,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eQ||tr&&eu?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),tr&&eu?"Loading...":"Saving..."]}):tr&&tc?"Continue":"Finish Setup"})]})]})]})]})}),(0,a.jsx)(ed,{open:e$,bridgeId:b,initialPath:ey?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>eM(!1),onSelect:e=>{eM(!1),e&&(ew(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e3(e))}}),(0,a.jsx)(ed,{open:eD,bridgeId:b,initialPath:G??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>eB(!1),onSelect:e=>{eB(!1),null!==e&&W(e)}}),(0,a.jsx)(ed,{open:eL,bridgeId:b,title:"Add Filesystem Root",description:"Choose an extra folder root that should stay visible in the filesystem browser on this machine.",onClose:()=>eF(!1),onSelect:e=>{eF(!1),null!==e&&V(t=>{let r=t.split(/\n+/g).map(e=>e.trim()).filter(Boolean);return r.includes(e)?r.join("\n"):[...r,e].join("\n")})}})]})}}}]);