@vellumai/web 0.10.6-staging.1 → 0.10.6

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 (252) hide show
  1. package/dist/assets/{AnimatePresence-uY0BR2n2.js → AnimatePresence-VF_hIZFD.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-BehDAEHu.js → BundleConfirmPage-DOUpVq0Q.js} +1 -1
  3. package/dist/assets/a2a-invite-Bv0xGbPM.js +1 -0
  4. package/dist/assets/{about-page-Ck4iLq7E.js → about-page-ci8HgT8u.js} +1 -1
  5. package/dist/assets/{account-page-TeIlHDQk.js → account-page-BiUlH7g9.js} +1 -1
  6. package/dist/assets/acp-run-detail-panel-B2ycT_78.js +5 -0
  7. package/dist/assets/{add-credits-modal-FyFjNQKM.js → add-credits-modal-BpZFOp84.js} +1 -1
  8. package/dist/assets/advanced-page-BClLCzBA.js +1 -0
  9. package/dist/assets/{ai-page-DpaOJJxh.js → ai-page-DnocNQmY.js} +1 -1
  10. package/dist/assets/{animated-avatar-CEC1DGcI.js → animated-avatar-FIuLddxJ.js} +1 -1
  11. package/dist/assets/{api-5fuWyrd5.js → api-DvthVfI2.js} +1 -1
  12. package/dist/assets/{api-key-screen-DP7UJY7P.js → api-key-screen-BMj30LHe.js} +1 -1
  13. package/dist/assets/{archive-page-nIOXwfyT.js → archive-page-aRD_FLfQ.js} +1 -1
  14. package/dist/assets/{assistant-feature-flag-store-D80P_lXI.js → assistant-feature-flag-store-B440uAh9.js} +1 -1
  15. package/dist/assets/{assistant-identity-store-cODRsfVo.js → assistant-identity-store-DP4B8mmA.js} +1 -1
  16. package/dist/assets/{assistant-status-panel-qHMHJPNI.js → assistant-status-panel-8WiPtFrO.js} +1 -1
  17. package/dist/assets/{auth-store-DGyzz5Ha.js → auth-store-B8KDWYi4.js} +2 -2
  18. package/dist/assets/{background-task-detail-panel-BBC1IgTy.js → background-task-detail-panel-IILCVufr.js} +1 -1
  19. package/dist/assets/{billing-page-f9MFi6zD.js → billing-page-q1D1xspC.js} +3 -3
  20. package/dist/assets/{bookmarks-page-C-gfC6Gu.js → bookmarks-page-D5XLE9A7.js} +1 -1
  21. package/dist/assets/{browser-DM38C5zq.js → browser-DdI2GrPw.js} +2 -2
  22. package/dist/assets/{build-state-CMTAZxqg.js → build-state-DAcnY2g_.js} +1 -1
  23. package/dist/assets/{capture-error-BG-GkiMq.js → capture-error-8raDoxFL.js} +1 -1
  24. package/dist/assets/channels-page-route-m_HALkI5.js +1 -0
  25. package/dist/assets/{client-feature-flag-store-CWOJ-CVU.js → client-feature-flag-store-D3f7L4rr.js} +1 -1
  26. package/dist/assets/clipboard-copy-cZENPJ25.js +1 -0
  27. package/dist/assets/{command-palette-BAhczobN.js → command-palette-BHVjkDPP.js} +1 -1
  28. package/dist/assets/{command-palette-window-page-BjRshjsQ.js → command-palette-window-page-C8htNOF6.js} +1 -1
  29. package/dist/assets/{community-page-BrzFK4eo.js → community-page-BvBiiBNT.js} +1 -1
  30. package/dist/assets/connect-page-65umesqK.js +1 -0
  31. package/dist/assets/consent-controls-CoeCtvwh.js +1 -0
  32. package/dist/assets/contacts-gateway-_mvlDweU.js +1 -0
  33. package/dist/assets/contacts-page-route-CQXKgYfo.js +1 -0
  34. package/dist/assets/{conversation-list-fetchers-COStMaVO.js → conversation-list-fetchers-D5PpdmFr.js} +1 -1
  35. package/dist/assets/{danger-zone-redirect-page-DFSAHVUO.js → danger-zone-redirect-page-BLyU56iI.js} +1 -1
  36. package/dist/assets/debug-page-BfYzZTih.js +4 -0
  37. package/dist/assets/{deploy-dialogs-BGPr7tRt.js → deploy-dialogs-DyZ__q_z.js} +1 -1
  38. package/dist/assets/{detail-panel-stop-button-CcFyjiHA.js → detail-panel-stop-button-DXQQXCtp.js} +1 -1
  39. package/dist/assets/{detail-shell-DAQXFf5u.js → detail-shell-C--69S4R.js} +2 -2
  40. package/dist/assets/{developer-page-DKbPtnYa.js → developer-page-LlFmliRP.js} +1 -1
  41. package/dist/assets/devices-page-C65LYzPc.js +1 -0
  42. package/dist/assets/{diagnostics-BAjanSbk.js → diagnostics-BQUtALh-.js} +1 -1
  43. package/dist/assets/{dictation-overlay-page-Ma56ZEas.js → dictation-overlay-page-D5pUTXA9.js} +1 -1
  44. package/dist/assets/{document-viewer-page-CDdKsz0G.js → document-viewer-page-mRBDn4Gc.js} +1 -1
  45. package/dist/assets/{earn-credits-modal-DrXTt13d.js → earn-credits-modal-DVUdlw2V.js} +1 -1
  46. package/dist/assets/{emails-page-JJZnddma.js → emails-page--1HEyMqD.js} +1 -1
  47. package/dist/assets/esm-BKCTntwk.js +2 -0
  48. package/dist/assets/esm-CNMouzMT.js +2 -0
  49. package/dist/assets/{esm-O9mDOR47.js → esm-CSgBiYzF.js} +2 -2
  50. package/dist/assets/esm-CccIkVyz.js +2 -0
  51. package/dist/assets/esm-CpbLh3YJ.js +2 -0
  52. package/dist/assets/esm-DlsDcixX.js +1 -0
  53. package/dist/assets/{feature-flag-catalog-C8w5_UfU.js → feature-flag-catalog-CRFA909Q.js} +1 -1
  54. package/dist/assets/{file-editor-BCSV9IJF.js → file-editor-PNZ9cTI-.js} +1 -1
  55. package/dist/assets/{general-page-BQw5GWs9.js → general-page-DL3fu61f.js} +1 -1
  56. package/dist/assets/{hatching-screen-Bn68JemT.js → hatching-screen-Bc0QiEVj.js} +1 -1
  57. package/dist/assets/{home-page-route-DMa33Zrx.js → home-page-route-CR3ajpvl.js} +1 -1
  58. package/dist/assets/{hosting-screen-DQ2oChnD.js → hosting-screen--GdpAsIo.js} +1 -1
  59. package/dist/assets/identity-page-route-z0mc5jGO.js +1 -0
  60. package/dist/assets/{index-CQhaX_6y.js → index-CWzNQ8A_.js} +31 -31
  61. package/dist/assets/{inspect-page-DY4rwOh6.js → inspect-page-C-fq5PsM.js} +4 -4
  62. package/dist/assets/{install-BrkjCsCo.js → install-DKnSvyt9.js} +1 -1
  63. package/dist/assets/integrations-page-BeTfBE7R.js +1 -0
  64. package/dist/assets/intelligence-layout-ShKSJFRX.js +1 -0
  65. package/dist/assets/{keyboard-shortcuts-page-D0RdK4J1.js → keyboard-shortcuts-page-DiFBwxwl.js} +1 -1
  66. package/dist/assets/{library-detail-page-aRT1yf6F.js → library-detail-page-BE-B5vd3.js} +1 -1
  67. package/dist/assets/{library-page-B7t6lth_.js → library-page-COsPjT0P.js} +1 -1
  68. package/dist/assets/{login-flow-l71HNHLV.js → login-flow-COr5zRoB.js} +1 -1
  69. package/dist/assets/{login-page-Bp6w7NSU.js → login-page-B_AWg_-m.js} +1 -1
  70. package/dist/assets/logout-page-B-vCELzg.js +1 -0
  71. package/dist/assets/logs-layout-Bb2Ki85T.js +1 -0
  72. package/dist/assets/{memory-router-playground-page-D_meczLa.js → memory-router-playground-page-rPz9hfL9.js} +1 -1
  73. package/dist/assets/{messages-ChEiS3wF.js → messages-Doco46Z6.js} +1 -1
  74. package/dist/assets/{metric-card-FIohvQ13.js → metric-card-DejhOUyM.js} +1 -1
  75. package/dist/assets/{mobile-sidebar-drawer-DzYe9XUj.js → mobile-sidebar-drawer-DwE65WjT.js} +1 -1
  76. package/dist/assets/{native-biometric-BK6_QtW5.js → native-biometric-C5AdTx4r.js} +1 -1
  77. package/dist/assets/{native-file-DIJL6af-.js → native-file-swemzdL9.js} +2 -2
  78. package/dist/assets/{notifications-page-C2lwkT1N.js → notifications-page-D3Gip5vS.js} +1 -1
  79. package/dist/assets/{oauth-complete-page-CHOh6OEp.js → oauth-complete-page-DAuZqgBq.js} +1 -1
  80. package/dist/assets/{oauth-popup-complete-page-BE3T_diS.js → oauth-popup-complete-page-CvOB8DyR.js} +1 -1
  81. package/dist/assets/{pairing-page-CxHUjMx8.js → pairing-page-CSXR4O5_.js} +1 -1
  82. package/dist/assets/{password-reset-page-T_0pamrF.js → password-reset-page-BCyMJkWQ.js} +1 -1
  83. package/dist/assets/{platform-detection-Ceodt3Hu.js → platform-detection-B1WOWEur.js} +1 -1
  84. package/dist/assets/{platform-loopback-page-D9aM6fRr.js → platform-loopback-page-DViSSCNq.js} +1 -1
  85. package/dist/assets/{plugin-detail-page-3mf9oR80.js → plugin-detail-page-D_0rFOJ7.js} +1 -1
  86. package/dist/assets/plugins-page-DnsCa0ka.js +1 -0
  87. package/dist/assets/plugins-surface-CAUFbZFj.js +1 -0
  88. package/dist/assets/plus-CzwTg9D8.js +1 -0
  89. package/dist/assets/prechat-route-BRLg12I0.js +1 -0
  90. package/dist/assets/{prefs-vU63K0uX.js → prefs-BK4ReLBx.js} +1 -1
  91. package/dist/assets/{privacy-page-B70Xm8aR.js → privacy-page-DK_E5UDG.js} +1 -1
  92. package/dist/assets/{privacy-screen-ByIZxuz7.js → privacy-screen-VCEt0iH8.js} +1 -1
  93. package/dist/assets/{provider-callback-page-BWlbojMH.js → provider-callback-page-DSqK6K5B.js} +1 -1
  94. package/dist/assets/{provider-key-Bf5qJwbE.js → provider-key-DSBs9REL.js} +1 -1
  95. package/dist/assets/{provider-signup-page-DKWEdYx6.js → provider-signup-page-CuLVID0r.js} +1 -1
  96. package/dist/assets/{quick-input-page-CyO-UVOQ.js → quick-input-page-DITr3SKX.js} +1 -1
  97. package/dist/assets/{react-query.gen-BwkZCSTW.js → react-query.gen-Bxy9zjSn.js} +1 -1
  98. package/dist/assets/{react-query.gen-BpYo64Cd.js → react-query.gen-DQUX56Gs.js} +1 -1
  99. package/dist/assets/research-mock-page-D0KTjYOI.js +1 -0
  100. package/dist/assets/research-onboarding-route-CoGKBjAq.js +61 -0
  101. package/dist/assets/{resize-errors-D1myE8D_.js → resize-errors-CN02qg8O.js} +1 -1
  102. package/dist/assets/{review-terms-screen-1hI3KOuo.js → review-terms-screen-C2mUaOA6.js} +1 -1
  103. package/dist/assets/{routes-C6gxiCrz.js → routes-CCywyokq.js} +1 -1
  104. package/dist/assets/{schedules-D_sclJNA.js → schedules-CQOSfZg8.js} +1 -1
  105. package/dist/assets/{sdk.gen-zA5ns5LT.js → sdk.gen-B3Z8klU-.js} +1 -1
  106. package/dist/assets/{sdk.gen-pUYA4291.js → sdk.gen-Ec1nF7iZ.js} +1 -1
  107. package/dist/assets/select-assistant-screen-DkgCyv2V.js +1 -0
  108. package/dist/assets/{settings-layout-B257Z9LB.js → settings-layout-BLjA2_fl.js} +1 -1
  109. package/dist/assets/{share-feedback-modal-BfJQ9SbJ.js → share-feedback-modal-34O8UomD.js} +1 -1
  110. package/dist/assets/{sidebar-tree-BrIPzTJO.js → sidebar-tree-DJnIQnXc.js} +1 -1
  111. package/dist/assets/{signup-page-DfU1fVg6.js → signup-page-CJeIDhFC.js} +1 -1
  112. package/dist/assets/{signup-shell-DMX1tgqB.js → signup-shell-Bw9OFI-z.js} +1 -1
  113. package/dist/assets/skills-page-CcrxOAfG.js +1 -0
  114. package/dist/assets/{sound-manager-45n1b-Bl.js → sound-manager-DtzFjWmP.js} +1 -1
  115. package/dist/assets/{sounds-page-7_3U-dlg.js → sounds-page-BHhIVuV0.js} +1 -1
  116. package/dist/assets/subagent-detail-panel-Cj7wlfR3.js +4 -0
  117. package/dist/assets/{subagent-store-CN-NNj3H.js → subagent-store-BmGtlv6O.js} +1 -1
  118. package/dist/assets/{system-events-page-CPI3qkPm.js → system-events-page-B9LdpkBg.js} +1 -1
  119. package/dist/assets/{system-events-redirect-page-BuXE12UE.js → system-events-redirect-page-Dnoz3v9J.js} +1 -1
  120. package/dist/assets/{tiptap-document-editor-OSLOFGRH.js → tiptap-document-editor-jcHGSIJg.js} +1 -1
  121. package/dist/assets/{tool-detail-panel-CS3NNWPR.js → tool-detail-panel-B3u6-K3R.js} +1 -1
  122. package/dist/assets/{trace-page-BGoPPByx.js → trace-page-D-2QJklH.js} +1 -1
  123. package/dist/assets/{upgrade-cancel-page-eP-xr_rP.js → upgrade-cancel-page-CgX8IYAL.js} +1 -1
  124. package/dist/assets/{upgrade-success-page-BQuUJsbC.js → upgrade-success-page-DKKw3H1x.js} +1 -1
  125. package/dist/assets/{usage-page-9F1P16Dv.js → usage-page-obI_HCGk.js} +1 -1
  126. package/dist/assets/{use-bus-subscription-BNaztnO7.js → use-bus-subscription-Cv9Js5_J.js} +1 -1
  127. package/dist/assets/use-is-org-ready-CXt7jaER.js +1 -0
  128. package/dist/assets/use-onboarding-login-DgxS4dsO.js +1 -0
  129. package/dist/assets/{use-reduced-motion-BG6r0Z46.js → use-reduced-motion-BlCAREB8.js} +1 -1
  130. package/dist/assets/use-setup-channel-param-CNNd-gJV.js +9 -0
  131. package/dist/assets/{use-skill-categories-D2tZfqBc.js → use-skill-categories-CRMzRD6m.js} +1 -1
  132. package/dist/assets/{utils-P-AuKiE9.js → utils-ChLzMd8R.js} +1 -1
  133. package/dist/assets/{viewer-store-BR99G-Ii.js → viewer-store-D7cH9LQF.js} +1 -1
  134. package/dist/assets/{voice-page-LgaYUztu.js → voice-page-BT_3N22n.js} +1 -1
  135. package/dist/assets/{weather-forecast-display-CfCoDHyw.js → weather-forecast-display-C0Zvm9vl.js} +1 -1
  136. package/dist/assets/{web-DGDlV45i.js → web-60vPNzAv.js} +1 -1
  137. package/dist/assets/{web-DFw1Yfb1.js → web-BZF5Krzc.js} +1 -1
  138. package/dist/assets/{web-CxyEb7Lp.js → web-BfGgEMt3.js} +1 -1
  139. package/dist/assets/{web-GWxiW7or.js → web-Bqls6sCO.js} +1 -1
  140. package/dist/assets/{web-YggPvEM4.js → web-DF-93Ff2.js} +1 -1
  141. package/dist/assets/{web-b9SjJqdc.js → web-Dw05M3EW.js} +1 -1
  142. package/dist/assets/{web-lNls6p99.js → web-IVArvzQ-.js} +1 -1
  143. package/dist/assets/{welcome-screen-BNZvYh2g.js → welcome-screen-Dx4jNLFF.js} +1 -1
  144. package/dist/assets/{workflow-detail-panel-CP2JbBXr.js → workflow-detail-panel-CvbzHGzG.js} +1 -1
  145. package/dist/assets/workspace-page-DDNf-ykG.js +1 -0
  146. package/dist/index.html +84 -82
  147. package/package.json +1 -1
  148. package/dist/assets/acp-run-detail-panel-zJfy8qiw.js +0 -5
  149. package/dist/assets/advanced-page-Cpo1TLOb.js +0 -1
  150. package/dist/assets/connect-page-NvjuA4Dj.js +0 -1
  151. package/dist/assets/consent-controls-DRPdeZXw.js +0 -1
  152. package/dist/assets/contacts-gateway-BDJYh797.js +0 -1
  153. package/dist/assets/contacts-page-route-DpCrCofB.js +0 -9
  154. package/dist/assets/debug-page-lUWhh0uD.js +0 -4
  155. package/dist/assets/devices-page-ClysCgSb.js +0 -1
  156. package/dist/assets/esm--RA963YO.js +0 -2
  157. package/dist/assets/esm-BSRBg0oR.js +0 -2
  158. package/dist/assets/esm-CJ8uY1wn.js +0 -2
  159. package/dist/assets/esm-DTj81fJQ.js +0 -1
  160. package/dist/assets/esm-cB02a8J9.js +0 -2
  161. package/dist/assets/identity-page-route-DBYOwn0S.js +0 -1
  162. package/dist/assets/integrations-page-CcdA6N2s.js +0 -1
  163. package/dist/assets/intelligence-layout-VkKSilP1.js +0 -1
  164. package/dist/assets/logout-page-CaaPZSIH.js +0 -1
  165. package/dist/assets/logs-layout-CaUiCN-a.js +0 -1
  166. package/dist/assets/plugins-page-CeBV1IVq.js +0 -1
  167. package/dist/assets/plugins-surface-gCrqfOas.js +0 -1
  168. package/dist/assets/prechat-route-C8zgjI3Q.js +0 -1
  169. package/dist/assets/research-mock-page-DaY250XG.js +0 -1
  170. package/dist/assets/research-onboarding-route-BX-HEXnC.js +0 -61
  171. package/dist/assets/select-assistant-screen-nRxexeHI.js +0 -1
  172. package/dist/assets/skills-page-Bx5LerU3.js +0 -1
  173. package/dist/assets/subagent-detail-panel-Pn3ub3nM.js +0 -4
  174. package/dist/assets/use-is-org-ready-f4GMUYIe.js +0 -1
  175. package/dist/assets/use-onboarding-login-NYeSGUNo.js +0 -1
  176. package/dist/assets/workspace-page-u1KJogzb.js +0 -1
  177. /package/dist/assets/{account-shell-CyP9etTv.js → account-shell-D0ubbqxG.js} +0 -0
  178. /package/dist/assets/{api-errors-DPruG7q9.js → api-errors-CPc5p2r9.js} +0 -0
  179. /package/dist/assets/{app-info-DJQFoVxX.js → app-info-Dtc98M-e.js} +0 -0
  180. /package/dist/assets/{avatar-bundled-components-DVlFbr6O.js → avatar-bundled-components-DMC1S-8P.js} +0 -0
  181. /package/dist/assets/{avatar-svg-compositor-CNy1XmWD.js → avatar-svg-compositor-D6G3Y6hA.js} +0 -0
  182. /package/dist/assets/{build.umd-4R02MPXx.js → build.umd-gY3Uzz96.js} +0 -0
  183. /package/dist/assets/{by-tool-use-id-index-Dbdu-8Kf.js → by-tool-use-id-index-KHuXlFNc.js} +0 -0
  184. /package/dist/assets/{chat-rA5AbKPD.js → chat-C19ZjAL3.js} +0 -0
  185. /package/dist/assets/{client-identity-KGlckm6M.js → client-identity-DiDHLoNp.js} +0 -0
  186. /package/dist/assets/{client.gen-DU1JkKSB.js → client.gen-CbVuiseX.js} +0 -0
  187. /package/dist/assets/{client.gen-BHupOCJH.js → client.gen-nWvCdeJb.js} +0 -0
  188. /package/dist/assets/{cloud-off-rAv4OHmv.js → cloud-off-fMC5iwVY.js} +0 -0
  189. /package/dist/assets/{code-aMX9iMYa.js → code-BhoMjTYO.js} +0 -0
  190. /package/dist/assets/{composer-focus-n921WsjZ.js → composer-focus-Clt7vN-2.js} +0 -0
  191. /package/dist/assets/{conversation-selection-CNssqGbG.js → conversation-selection-jLLIV1vI.js} +0 -0
  192. /package/dist/assets/{conversation-store-B8D6wE18.js → conversation-store-BheNrWpL.js} +0 -0
  193. /package/dist/assets/{cpu-CiHv3fhs.js → cpu-D1r7PLan.js} +0 -0
  194. /package/dist/assets/{credit-card-BKRB1ZIi.js → credit-card-BwN95biV.js} +0 -0
  195. /package/dist/assets/{definitions-BughTGuV.js → definitions-DeG2sRFv.js} +0 -0
  196. /package/dist/assets/{detail-card-DRXR3fb7.js → detail-card-DXLMG-Zw.js} +0 -0
  197. /package/dist/assets/{dist-Ztj3rqLK.js → dist-CNEsSZUe.js} +0 -0
  198. /package/dist/assets/{domain-field-DYwuCpup.js → domain-field-CNW1t3OC.js} +0 -0
  199. /package/dist/assets/{edit-chat-session-DcCgw5Qy.js → edit-chat-session-RMvGKcHJ.js} +0 -0
  200. /package/dist/assets/{effective-timezone-B99h9zr7.js → effective-timezone-DrYGH2Lb.js} +0 -0
  201. /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-ClLxfwNZ.js} +0 -0
  202. /package/dist/assets/{environment-store-B83Xai7l.js → environment-store-CN3UaYQg.js} +0 -0
  203. /package/dist/assets/{event-bus-B3E3w-q2.js → event-bus-ULoEgfFr.js} +0 -0
  204. /package/dist/assets/{external-link-RJkZLlff.js → external-link-BgOnp59e.js} +0 -0
  205. /package/dist/assets/{file-text-ClqzuFsu.js → file-text-D4wmdFsJ.js} +0 -0
  206. /package/dist/assets/{format-BDkwdD2m.js → format-DuvgAcxs.js} +0 -0
  207. /package/dist/assets/{format-date-D4tzd1DT.js → format-date-CmX7EYBN.js} +0 -0
  208. /package/dist/assets/{format-file-size-CBQjPwkk.js → format-file-size-D7iZejgy.js} +0 -0
  209. /package/dist/assets/{globe-D3P5sSKJ.js → globe-CRuerXYx.js} +0 -0
  210. /package/dist/assets/{haptics-BE_0g4mc.js → haptics-DUNUKgg4.js} +0 -0
  211. /package/dist/assets/{hard-drive-CZEg1Cqc.js → hard-drive-DsJ64Fuu.js} +0 -0
  212. /package/dist/assets/{impersonate-version-flag-DyVWQf97.js → impersonate-version-flag-BpzPjXeb.js} +0 -0
  213. /package/dist/assets/{info-ciQS_i3y.js → info-C9uyv2bI.js} +0 -0
  214. /package/dist/assets/{lib-BNGjysgr.js → lib-DWRDi23Z.js} +0 -0
  215. /package/dist/assets/{link-2-r_QPxX18.js → link-2-BIp7l4R9.js} +0 -0
  216. /package/dist/assets/{llm-dimension-8g-Go8uq.js → llm-dimension-DyYwG3mU.js} +0 -0
  217. /package/dist/assets/{loader-circle-BFRVtR3K.js → loader-circle-BITX1qOw.js} +0 -0
  218. /package/dist/assets/{log-in-CEw63CGU.js → log-in-BCOweEUO.js} +0 -0
  219. /package/dist/assets/{minimize-2-dKm10qRD.js → minimize-2-BQKYHW0m.js} +0 -0
  220. /package/dist/assets/{misc-CFzLzLPH.js → misc-GIyc06fS.js} +0 -0
  221. /package/dist/assets/{monitor-CXU19mVX.js → monitor-xGqXetuk.js} +0 -0
  222. /package/dist/assets/{moon-CKINz50a.js → moon-rIyEhhAK.js} +0 -0
  223. /package/dist/assets/{mutation-error-CAO3gDr-.js → mutation-error-BN5zz5X4.js} +0 -0
  224. /package/dist/assets/{native-deep-link-C2-dXaz_.js → native-deep-link-CkFNpKqQ.js} +0 -0
  225. /package/dist/assets/{onboarding-step-layout-B65Rny5V.js → onboarding-step-layout-2XcmxqFN.js} +0 -0
  226. /package/dist/assets/{page-shell-sPPJY6qa.js → page-shell-C3-rU99a.js} +0 -0
  227. /package/dist/assets/{pdf-B-YWzK66.js → pdf-Cuv7mg8b.js} +0 -0
  228. /package/dist/assets/{pencil-B90pDI55.js → pencil-CtYlsDsm.js} +0 -0
  229. /package/dist/assets/{prechat-RG0Q0UrS.js → prechat-BzdosDIx.js} +0 -0
  230. /package/dist/assets/{prechat-names-Bmsq0aXB.js → prechat-names-DPum8sFP.js} +0 -0
  231. /package/dist/assets/{proxy-BgtfAoJj.js → proxy-BzcB2wP4.js} +0 -0
  232. /package/dist/assets/{public-asset-C2P77n3W.js → public-asset-DYtCQInw.js} +0 -0
  233. /package/dist/assets/{refresh-cw-Dui3Ymsb.js → refresh-cw-Dlu2vgR6.js} +0 -0
  234. /package/dist/assets/{remote-gateway-session-BigLiDPm.js → remote-gateway-session-C2xcV9Z_.js} +0 -0
  235. /package/dist/assets/{repeat-nCGBxntG.js → repeat-MDHTMmlC.js} +0 -0
  236. /package/dist/assets/{return-to-yMLvlnXN.js → return-to-DnS1UWHr.js} +0 -0
  237. /package/dist/assets/{save-BpAesNEP.js → save-C03NWAqR.js} +0 -0
  238. /package/dist/assets/{semver-0cyB3qXO.js → semver-DMpUdXpu.js} +0 -0
  239. /package/dist/assets/{setting-row-7y2HT-DP.js → setting-row-Ci9YIJwu.js} +0 -0
  240. /package/dist/assets/{sparkles-Bla177ar.js → sparkles-Bkcjn8HQ.js} +0 -0
  241. /package/dist/assets/{status-badge-pill-j3ke1d9o.js → status-badge-pill-CXey_r2B.js} +0 -0
  242. /package/dist/assets/{step-indicator-dots-WlYRNQOd.js → step-indicator-dots-CvPP_zNN.js} +0 -0
  243. /package/dist/assets/{triangle-alert-C3aHZq1F.js → triangle-alert-BcZY_IvR.js} +0 -0
  244. /package/dist/assets/{typed-storage-DjORmu8t.js → typed-storage-BGMPjrzL.js} +0 -0
  245. /package/dist/assets/{usage-window-B-YOzKJi.js → usage-window-C6gWu5Qu.js} +0 -0
  246. /package/dist/assets/{use-active-assistant-id-BVzVN4_g.js → use-active-assistant-id-iCLBbJXU.js} +0 -0
  247. /package/dist/assets/{use-is-mobile-jACt_z2d.js → use-is-mobile-Cqknxs2C.js} +0 -0
  248. /package/dist/assets/{user-plus-COoYKnWs.js → user-plus-D30zPuGV.js} +0 -0
  249. /package/dist/assets/{workflow-status-ByHycBJ_.js → workflow-status-BF9EOzZI.js} +0 -0
  250. /package/dist/assets/{x-DxL-bCuT.js → x-B0gfyRAR.js} +0 -0
  251. /package/dist/assets/{xterm-B8LaLTHh.js → xterm-BPl0dA68.js} +0 -0
  252. /package/dist/assets/{xterm-addon-fit--RE59D-m.js → xterm-addon-fit-BCzoNVYn.js} +0 -0
@@ -0,0 +1,9 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-BscuIPxA.js";import{t as l}from"./card-BibIM9x3.js";import{t as u}from"./dropdown-ChWAdhLG.js";import{t as d}from"./confirm-dialog-bfBx6UYv.js";import{t as f}from"./notice-CqRgVmeL.js";import{t as p}from"./input-D4W4p0pZ.js";import{t as m}from"./modal-BNAVT2FK.js";import{t as h}from"./check-D6WkI0gF.js";import{t as g}from"./chevron-right-B6vEpVY0.js";import{t as _}from"./link-2-BIp7l4R9.js";import{t as v}from"./loader-circle-BITX1qOw.js";import{Bt as y,Kt as b,Wt as x}from"./sdk.gen-B3Z8klU-.js";import{B as S,H as C,U as w,V as T,o as E,s as D,v as O}from"./react-query.gen-Bxy9zjSn.js";import{n as k,r as A,t as j}from"./api-errors-CPc5p2r9.js";import{t as M}from"./client.gen-nWvCdeJb.js";import{t as N}from"./assistant-feature-flag-store-B440uAh9.js";import{t as P}from"./public-asset-DYtCQInw.js";import{Ea as F,It as I,Lt as L,Oa as R,a as z,fa as B,i as V,o as ee,s as te}from"./index-CWzNQ8A_.js";import{t as ne}from"./a2a-invite-Bv0xGbPM.js";import{t as re}from"./mutation-error-BN5zz5X4.js";var H=e(t(),1);function U(e){return e?.trim()||`your assistant`}var W=s();function G({assistantName:e,connected:t=!1,children:n}){return(0,W.jsx)(`div`,{className:`pl-7`,children:(0,W.jsxs)(l.Root,{children:[(0,W.jsx)(l.Header,{children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`img`,{src:P(`/images/integrations/slack.svg`),alt:``,className:`size-8 rounded-lg bg-[var(--surface-sunken)] p-1`}),(0,W.jsxs)(`div`,{className:`flex flex-col`,children:[(0,W.jsx)(c,{as:`span`,variant:`body-medium-default`,children:t?`Slack settings`:`Slack setup`}),t?(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-[var(--system-positive-strong)]`}),`Connected as `,e]}):null]})]})}),(0,W.jsx)(l.Body,{children:n})]})})}var K=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],q=new Set([`platform`,`a2a`]),J=new Set([`vellum`,`whatsapp`]);function Y(e){return J.has(e)}var ie={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function ae(e){return{no_one:`No one can message ${e} on this channel — every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}var X={no_one:{title:`Block all messages?`,message:`Setting this channel to “No one” hard-denies every inbound message — including messages from you.
2
+
3
+ You can reverse this at any time.`,confirmLabel:`Block all`,destructive:!0},any_contact:{title:`Allow any contact?`,message:`“Any contact” admits every matched contact in this channel — including pending, unverified ones — not just your verified contacts.
4
+
5
+ Best for channels consisting of only people you already trust.`,confirmLabel:`Allow any contact`},strangers:{title:`Allow strangers?`,message:`Are you sure you want to allow strangers to contact your assistant through this channel?
6
+
7
+ Doing so could cost you money and open you up to security and privacy vulnerabilities.
8
+
9
+ Enable with extreme caution.`,confirmLabel:`Allow strangers`,destructive:!0}},Z={slack:{label:`Slack`,disconnectMessage:`This clears the stored Slack bot and app tokens for this assistant. You can reconnect later.`},telegram:{label:`Telegram`,disconnectMessage:`This clears the stored Telegram bot token for this assistant. You can reconnect later.`},phone:{label:`Phone Calling`,disconnectMessage:`This clears the stored Twilio credentials for this assistant. You can reconnect later.`}};function oe({assistantName:e,channels:t,pendingChannelKey:n=null,slackThreadMode:r,slackThreadModePending:i=!1,channelPolicies:a,policySavingKey:o=null,policiesLoading:s=!1,policiesError:c=!1,onChannelPolicyChange:l,onSetup:u,onDisconnect:f,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,initialExpandedChannel:y=null}){let[b,x]=(0,H.useState)(null),[S,C]=(0,H.useState)(()=>y?new Set([y]):new Set),[w,T]=(0,H.useState)(null),E=U(e),D=b?Z[b]:null,O=w?X[w.policy]:null,k=(e,t)=>{if(X[t]){T({channelKey:e,policy:t});return}l?.(e,t)},A=e=>{C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,W.jsxs)(`div`,{className:`flex flex-col`,children:[t.map((t,d)=>(0,W.jsxs)(`div`,{children:[d>0?(0,W.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}):null,(0,W.jsx)(se,{channel:t,assistantName:e,assistantDisplayName:E,pending:n===t.key,expanded:S.has(t.key),onToggleExpand:()=>A(t.key),onSetup:t.key===`slack`?()=>{C(e=>{let n=new Set(e);return n.add(t.key),n})}:u?()=>u(t.key):void 0,onDisconnect:f?()=>x(t.key):void 0,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,slackThreadMode:r,slackThreadModePending:i,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,policy:a?.[t.key],policySaving:o===t.key,policyLoading:s,policyError:c,onPolicyChange:l?e=>k(t.key,e):void 0})]},t.key)),(0,W.jsx)(d,{open:b!==null,title:`Disconnect ${D?.label??``}?`,message:D?.disconnectMessage??``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{b&&f&&f(b),x(null)},onCancel:()=>x(null)}),(0,W.jsx)(d,{open:w!==null,title:O?.title??``,message:O?.message??``,confirmLabel:O?.confirmLabel??`Confirm`,destructive:O?.destructive??!1,onConfirm:()=>{w&&l?.(w.channelKey,w.policy),T(null)},onCancel:()=>T(null)})]})}function se({channel:e,assistantName:t,assistantDisplayName:r,pending:i,expanded:a,onToggleExpand:o,onSetup:s,onDisconnect:c,onSaveTelegramToken:l,onSaveSlackConfig:u,slackSaveStatus:d,slackSaveError:f,slackThreadMode:p,slackThreadModePending:m=!1,onSlackThreadModeChange:h,onSaveTwilioCredentials:_,policy:v,policySaving:y=!1,policyLoading:b=!1,policyError:x=!1,onPolicyChange:S}){let C=Z[e.key],w=e.status===`ready`;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 py-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`button`,{type:`button`,className:`flex shrink-0 items-center justify-center`,onClick:o,style:{color:`var(--content-secondary)`},children:a?(0,W.jsx)(R,{className:`h-4 w-4`}):(0,W.jsx)(g,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:C.label}),e.address?(0,W.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.address}):null,(0,W.jsx)(`div`,{className:`ml-auto flex items-center gap-2`,children:w?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 h-8 px-2.5 rounded-md whitespace-nowrap select-none text-body-small-emphasised leading-none bg-[var(--content-default)] text-[var(--surface-base)]`,children:[(0,W.jsx)(F,{className:`h-3 w-3`}),`Connected`]}),(0,W.jsx)(n,{type:`button`,variant:`danger`,onClick:c,disabled:!c||i,children:i?`Disconnecting…`:`Disconnect`})]}):(0,W.jsx)(n,{type:`button`,variant:`outlined`,onClick:s,disabled:!s||i,children:i?`Opening…`:`Set up`})})]}),a?(0,W.jsxs)(`div`,{className:w?`flex flex-col gap-4`:void 0,children:[w&&S?(0,W.jsx)(ce,{assistantDisplayName:r,policy:v,saving:y,loading:b,error:x,onChange:S}):null,e.key===`telegram`?(0,W.jsx)(le,{onSave:l}):null,e.key===`slack`?(0,W.jsx)(G,{assistantName:t,connected:w,children:(0,W.jsx)(te,{assistantName:t,connected:w,onSave:u,saveStatus:d,saveError:f,threadMode:p,threadModePending:m,onThreadModeChange:h})}):null,e.key===`phone`?(0,W.jsx)(ue,{onSave:_}):null]}):null]})}function ce({assistantDisplayName:e,policy:t,saving:n=!1,loading:r=!1,error:i=!1,onChange:a}){let o=t??`trusted_contacts`,s=ae(e),l=K.map(e=>({value:e,label:ie[e],tooltip:s[e]}));return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 pl-7`,children:[(0,W.jsxs)(c,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:[`Who can message `,e]}),r?(0,W.jsx)(c,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):i?(0,W.jsx)(c,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load this setting. Try reopening this page.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{style:{maxWidth:280},children:(0,W.jsx)(u,{value:o,onChange:a,options:l,disabled:n,"aria-label":`Who can message ${e}`})}),(0,W.jsx)(c,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:s[o]}),o===`trusted_contacts`?(0,W.jsxs)(f,{tone:`info`,className:`max-w-lg`,children:[`People you haven’t verified yet — even teammates in the same channel — can’t get through: `,e,` lets them know they need to be verified and notifies you. You can verify people ahead of time in Contacts.`]}):null]})]})}function le({onSave:e}){let[t,r]=(0,H.useState)(``),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(null),c=t.trim().length>0&&!i;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 pl-7`,children:[(0,W.jsx)(p,{label:`Bot Token`,type:`password`,value:t,onChange:e=>r(e.target.value),placeholder:`Paste your Telegram bot token`,disabled:i,fullWidth:!0}),o?(0,W.jsx)(`p`,{className:`text-label-small`,style:{color:`var(--content-negative)`},children:o}):null,(0,W.jsx)(`div`,{children:(0,W.jsx)(n,{type:`button`,onClick:async()=>{if(!(!e||!c)){a(!0),s(null);try{await e(t.trim()),r(``)}catch(e){s(e instanceof Error?e.message:`Failed to save`)}finally{a(!1)}}},disabled:!c,children:i?`Saving…`:`Save`})})]})}function ue({onSave:e}){let[t,r]=(0,H.useState)(``),[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null),u=t.trim().length>0&&i.trim().length>0&&!o;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 pl-7`,children:[(0,W.jsx)(p,{label:`Account SID`,type:`text`,value:t,onChange:e=>r(e.target.value),placeholder:`ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,disabled:o,fullWidth:!0}),(0,W.jsx)(p,{label:`Auth Token`,type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:`Twilio auth token`,disabled:o,fullWidth:!0}),c?(0,W.jsx)(`p`,{className:`text-label-small`,style:{color:`var(--content-negative)`},children:c}):null,(0,W.jsx)(`div`,{children:(0,W.jsx)(n,{type:`button`,onClick:async()=>{if(!(!e||!u)){s(!0),l(null);try{await e(t.trim(),i.trim()),r(``),a(``)}catch(e){l(e instanceof Error?e.message:`Failed to save`)}finally{s(!1)}}},disabled:!u,children:o?`Saving…`:`Save`})})]})}function de(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function fe({open:e,assistantId:t,onClose:r}){let[i,a]=(0,H.useState)(!1),s=(0,H.useRef)(null),l=(0,H.useRef)(!1),u=o({...S({path:{assistant_id:t}})}),d=(0,H.useRef)(u.mutate);(0,H.useLayoutEffect)(()=>{d.current=u.mutate});let f=(0,H.useRef)(u.reset);(0,H.useLayoutEffect)(()=>{f.current=u.reset}),(0,H.useEffect)(()=>{e&&!l.current&&d.current({path:{assistant_id:t}}),l.current=e},[e,t]),(0,H.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]);let g=(0,H.useCallback)(()=>{f.current(),a(!1),s.current&&=(clearTimeout(s.current),null),r()},[r]),_=(0,H.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{a(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>a(!1),2e3)})},[]),y=u.isSuccess&&u.data.token?ne({senderAssistantId:t,token:u.data.token}):``;return(0,W.jsx)(m.Root,{open:e,onOpenChange:e=>{e||g()},children:(0,W.jsxs)(m.Content,{size:`sm`,children:[(0,W.jsx)(m.Header,{children:(0,W.jsx)(m.Title,{children:`Share Connection Link`})}),(0,W.jsx)(m.Body,{children:u.isPending?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,W.jsx)(v,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):u.isError?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,W.jsx)(n,{variant:`outlined`,onClick:()=>u.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):u.isSuccess?(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(c,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(p,{type:`text`,readOnly:!0,value:y,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>_(y),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,W.jsx)(h,{className:`h-4 w-4`}):(0,W.jsx)(B,{className:`h-4 w-4`})})]}),u.data.expiresAt!=null&&(0,W.jsx)(c,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:de(u.data.expiresAt)})]}):null}),(0,W.jsx)(m.Footer,{children:(0,W.jsx)(n,{variant:`outlined`,onClick:g,children:`Done`})})]})})}function pe({onClick:e}){return(0,W.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,W.jsx)(_,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function me(e){return typeof e==`string`&&K.includes(e)}function Q(e){return q.has(e)}async function he(e){let{data:t,error:n,response:r}=await M.get({url:`/v1/assistants/{assistant_id}/channel-admission-policy/`,path:{assistant_id:e},throwOnError:!1});if(k(r,n,`Failed to load channel policies.`),!r.ok)throw new j(r.status,A(n,r,`Failed to load channel policies.`));return(t?.policies??[]).filter(e=>!Q(e.channelType)&&!Y(e.channelType)).map(e=>({...e,policy:me(e.policy)?e.policy:`trusted_contacts`}))}async function ge(e,t,n,r){if(Q(t))throw new j(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await M.put({url:`/v1/assistants/{assistant_id}/channel-admission-policy/{channel_type}`,path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},headers:{"Content-Type":`application/json`},throwOnError:!1});if(k(o,a,`Failed to save channel policy.`),!o.ok)throw new j(o.status,A(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new j(500,`Gateway returned no policy in response.`);return i.policy}function $(e){let t=i(),n=N.use.channelTrustFloors(),r=(0,H.useMemo)(()=>[`channel-admission-policy`,e],[e]),s=a({queryKey:r,queryFn:()=>he(e),enabled:n}),c=(0,H.useMemo)(()=>{let e={};for(let t of s.data??[])L(t.channelType)&&(e[t.channelType]=t.policy);return e},[s.data]),l=o({mutationFn:({channelKey:t,policy:n})=>ge(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:r}),onError:re(`Failed to save channel policy`)}),u=(0,H.useCallback)((e,t)=>{l.mutate({channelKey:e,policy:t})},[l]);return n?{policies:c,savingKey:l.isPending?l.variables?.channelKey??null:null,isLoading:s.isPending,isError:s.isError,onChange:u}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var _e={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},ve=15e3;function ye({assistantId:e,onStartSetupConversation:t}){let n=i(),r=(0,H.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,H.useMemo)(()=>D(r),[r]),c=a({...E(r),enabled:!!e,refetchInterval:ve,select:e=>e.snapshots}),l=(0,H.useMemo)(()=>be(c.data??[]),[c.data]),u=l.some(e=>e.key===`slack`&&e.status===`ready`),d=a({...T(r),enabled:u,select:e=>e.threadMode}),f=$(e),p=(0,H.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),m=o({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await y(n):t===`telegram`?await x(n):t===`phone`&&await b(n)},onSettled:()=>p()}),h=z({assistantId:e}),g=ee({assistantId:e}),_=V({assistantId:e}),v=o({...w(),onSuccess:()=>{n.invalidateQueries({queryKey:C(r)})}}),S=h.mutateAsync,O=(0,H.useCallback)(async e=>{await S(e)},[S]),k=g.mutate,A=(0,H.useCallback)((e,t)=>{k({botToken:e,appToken:t})},[k]),j=v.mutate,M=(0,H.useCallback)(t=>{j({path:{assistant_id:e},body:{threadMode:t}})},[j,e]),N=_.mutateAsync,P=(0,H.useCallback)(async(e,t)=>{await N({accountSid:e,authToken:t})},[N]),F=(0,H.useCallback)(e=>{t&&t(_e[e])},[t]),I=m.mutate,L=(0,H.useCallback)(e=>{I(e)},[I]);return{channels:l,pendingChannelKey:m.isPending?m.variables??null:null,slackThreadMode:d.data,slackThreadModePending:v.isPending,channelPolicies:f.policies,policySavingKey:f.savingKey,policiesLoading:f.isLoading,policiesError:f.isError,onChannelPolicyChange:f.onChange,onSetup:t?F:void 0,onDisconnect:L,onSaveTelegramToken:O,onSaveSlackConfig:A,slackSaveStatus:g.status,slackSaveError:g.error?.message??null,onSlackThreadModeChange:M,onSaveTwilioCredentials:P}}function be(e){let t=new Map;for(let n of e)t.set(n.channel,n);return I.map(e=>{let n=t.get(e);return{key:e,status:xe(n),address:n?.channelHandle??void 0}})}function xe(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function Se(e){let t=i(),[n,r]=(0,H.useState)(!1);return{isOpen:n,open:(0,H.useCallback)(()=>{r(!0)},[]),close:(0,H.useCallback)(()=>{r(!1),t.invalidateQueries({queryKey:O({path:{assistant_id:e}})})},[t,e])}}function Ce(){let[e,t]=r(),n=e.get(`setup`),i=n&&L(n)?n:null;return(0,H.useEffect)(()=>{i&&t(e=>(e.delete(`setup`),e),{replace:!0})},[i,t]),i}export{fe as a,pe as i,Se as n,oe as o,ye as r,U as s,Ce as t};
@@ -1 +1 @@
1
- import{t as e}from"./button-D-AX8Voo.js";import{t}from"./useQuery-B45lW1Kk.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import"./src-CUycEQpW.js";import{t as r}from"./createLucideIcon-BlMXrA59.js";import{t as i}from"./calendar-CpgH8CqM.js";import{t as a}from"./code-aMX9iMYa.js";import{t as o}from"./globe-D3P5sSKJ.js";import{t as s}from"./link-2-r_QPxX18.js";import{_t as c}from"./react-query.gen-BwkZCSTW.js";import{$i as l,Ii as u,Ji as d,Vi as f,_i as p,bi as m,ni as h,zi as g}from"./index-CQhaX_6y.js";var _=r(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),v={mail:f,calendar:i,"message-circle":g,globe:o,zap:h,code:a,mic:u,"shopping-cart":p,palette:r(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),heart:l,settings:m,"link-2":s};function y(e){return v[e]}var b=n();function x({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o=`Skill categories`}){let s=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,b.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o,children:[(0,b.jsx)(S,{icon:d,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),s.map(r=>(0,b.jsx)(S,{icon:y(r.icon)??d,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function S({icon:t,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,b.jsxs)(e,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(t,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,b.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function C(e){return t({...c({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}export{_ as i,x as n,y as r,C as t};
1
+ import{t as e}from"./button-D-AX8Voo.js";import{t}from"./useQuery-B45lW1Kk.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import"./src-CUycEQpW.js";import{t as r}from"./createLucideIcon-BlMXrA59.js";import{t as i}from"./calendar-CpgH8CqM.js";import{t as a}from"./code-BhoMjTYO.js";import{t as o}from"./globe-CRuerXYx.js";import{t as s}from"./link-2-BIp7l4R9.js";import{_t as c}from"./react-query.gen-Bxy9zjSn.js";import{Bi as l,Hi as u,Li as d,Si as f,Yi as p,ea as m,ii as h,yi as g}from"./index-CWzNQ8A_.js";var _=r(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),v={mail:u,calendar:i,"message-circle":l,globe:o,zap:h,code:a,mic:d,"shopping-cart":g,palette:r(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),heart:m,settings:f,"link-2":s};function y(e){return v[e]}var b=n();function x({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o=`Skill categories`}){let s=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,b.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o,children:[(0,b.jsx)(S,{icon:p,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),s.map(r=>(0,b.jsx)(S,{icon:y(r.icon)??p,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function S({icon:t,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,b.jsxs)(e,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(t,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,b.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function C(e){return t({...c({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}export{_ as i,x as n,y as r,C as t};
@@ -1 +1 @@
1
- import{t as e}from"./assistant-identity-store-cODRsfVo.js";import{n as t,r as n,t as r}from"./semver-0cyB3qXO.js";function i(e,t,n={}){return t(e.getState())?Promise.resolve():new Promise(r=>{let i,a=()=>{i!==void 0&&clearTimeout(i),o(),r()},o=e.subscribe(e=>{t(e)&&a()});n.timeoutMs!==void 0&&(i=setTimeout(a,n.timeoutMs))})}function a(t){return s(e.use.version(),t)}function o(t){let n=e.getState().version;return s(n,t)}function s(e,i){if(!e)return!1;let a=n(e),o=n(i);if(!a||!o)return!1;let s=r({...a,pre:null},{...o,pre:null});if(s!==0)return s>0;let c=a.pre!==null&&a.pre.startsWith(`dev`),l=o.pre!==null&&o.pre.startsWith(`dev`);return c&&l?t(a.pre,o.pre)>=0:c===l?!0:c}var c=5e3;function l(t=c){return i(e,e=>!!e.version,{timeoutMs:t})}export{i,a as n,l as r,o as t};
1
+ import{t as e}from"./assistant-identity-store-DP4B8mmA.js";import{n as t,r as n,t as r}from"./semver-DMpUdXpu.js";function i(e,t,n={}){return t(e.getState())?Promise.resolve():new Promise(r=>{let i,a=()=>{i!==void 0&&clearTimeout(i),o(),r()},o=e.subscribe(e=>{t(e)&&a()});n.timeoutMs!==void 0&&(i=setTimeout(a,n.timeoutMs))})}function a(t){return s(e.use.version(),t)}function o(t){let n=e.getState().version;return s(n,t)}function s(e,i){if(!e)return!1;let a=n(e),o=n(i);if(!a||!o)return!1;let s=r({...a,pre:null},{...o,pre:null});if(s!==0)return s>0;let c=a.pre!==null&&a.pre.startsWith(`dev`),l=o.pre!==null&&o.pre.startsWith(`dev`);return c&&l?t(a.pre,o.pre)>=0:c===l?!0:c}var c=5e3;function l(t=c){return i(e,e=>!!e.version,{timeoutMs:t})}export{i,a as n,l as r,o as t};
@@ -1 +1 @@
1
- import{t as e}from"./capture-error-BG-GkiMq.js";import{n as t,t as n}from"./create-selectors-BE0_e_Ed.js";import{mt as r,n as i}from"./sdk.gen-zA5ns5LT.js";var a=new Map;function o(e,t){return`${e}::${t}`}function s(e,t){let n=o(e,t),r=a.get(n);return r??(r=i({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw a.delete(n),e}),a.set(n,r)),r}function c(e,t,n){a.set(o(e,t),Promise.resolve(n))}function l(e,t){a.delete(o(e,t))}function u(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function d(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`workflow-detail`||n===`acp-run-detail`||n===`background-task-detail`||n===`channel-setup`?e[t]:n}function f(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var p={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentSurfaceId:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeBackgroundTaskId:null,viewBeforeBackgroundTaskDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`chat`,ruleEditorRequestSeq:0},m=n(t()((t,n)=>({...p,setMainView:e=>{n().mainView!==e&&t({mainView:e})},setIntelligenceTab:e=>{n().intelligenceTab!==e&&t({intelligenceTab:e})},openApp:e=>{t({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(r,a)=>{t({mainView:`app`,activeAppId:a,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await i({path:{assistant_id:r,id:a},throwOnError:!0});if(n().activeAppId!==a)return;t({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),c(r,e.appId,e.html)}catch(r){if(n().activeAppId!==a)return;u(r)||e(r,{context:`openApp`}),t({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{t({openedAppState:e})},handleAppLoadFailed:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{t({isAppMinimized:!n().isAppMinimized})},handleAppUnpinned:e=>{let t=n();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(n().closeApp(),!0)},enterAppEditing:()=>{t({mainView:`app-editing`})},exitAppEditing:()=>{t({mainView:`app`})},openSubagentDetail:e=>{t({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:d(n(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{t({mainView:n().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{t({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:d(n(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{t({mainView:n().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openAcpRunDetail:e=>{t({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:d(n(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{t({mainView:n().viewBeforeAcpRunDetail,activeAcpRunId:null})},openBackgroundTaskDetail:e=>{t({mainView:`background-task-detail`,activeBackgroundTaskId:e,viewBeforeBackgroundTaskDetail:d(n(),`viewBeforeBackgroundTaskDetail`)})},closeBackgroundTaskDetail:()=>{t({mainView:n().viewBeforeBackgroundTaskDetail,activeBackgroundTaskId:null})},openProcessDetail:({kind:e,id:t})=>{switch(e){case`subagent`:n().openSubagentDetail(t);return;case`workflow`:n().openWorkflowDetail(t);return;case`acp-run`:n().openAcpRunDetail(t);return;case`background-task`:n().openBackgroundTaskDetail(t);return;default:}},closeActiveDetail:()=>{switch(n().mainView){case`subagent-detail`:n().closeSubagentDetail();return;case`workflow-detail`:n().closeWorkflowDetail();return;case`acp-run-detail`:n().closeAcpRunDetail();return;case`background-task-detail`:n().closeBackgroundTaskDetail();return;default:return}},openChannelSetup:e=>{t({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:d(n(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{t({mainView:n().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{t({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:d(n(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=n(),r=t.activeToolDetail;t.mainView===`tool-detail`&&r!=null&&(e.kind===`thinking`?r.kind===`thinking`&&f(r,e):r.kind!==`thinking`&&r.toolCallId===e.toolCallId)?n().closeToolDetail():n().openToolDetail(e)},closeToolDetail:()=>{t({mainView:n().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditorForActiveTool:()=>{n().activeToolDetail&&t(e=>({ruleEditorRequestSeq:e.ruleEditorRequestSeq+1}))},openDocument:()=>{t({mainView:`document`,openedDocumentState:null,viewBeforeDocument:d(n(),`viewBeforeDocument`)})},loadDocument:async(e,i)=>{let a=d(n(),`viewBeforeDocument`);t({mainView:`document`,activeDocumentSurfaceId:i,openedDocumentState:null,viewBeforeDocument:a});try{let{data:o}=await r({path:{assistant_id:e,id:i},throwOnError:!0});if(n().activeDocumentSurfaceId!==i)return;if(!o){t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null});return}t({openedDocumentState:{surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``}})}catch{if(n().activeDocumentSurfaceId!==i)return;t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null})}},setLoadedDocument:e=>{t({openedDocumentState:e})},updateDocumentContent:(e,r,i)=>{let a=n();if(!a.openedDocumentState||a.openedDocumentState.surfaceId!==e)return;let o=a.openedDocumentState,s=i===`append`?o.content+r:r;t({openedDocumentState:{...o,content:s}})},handleDocumentLoadFailed:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},closeDocument:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},refreshAssets:()=>{t({assetsRefreshKey:n().assetsRefreshKey+1})},reset:()=>t({...p})})));export{c as a,s as i,m as n,l as r,f as t};
1
+ import{t as e}from"./capture-error-8raDoxFL.js";import{n as t,t as n}from"./create-selectors-BE0_e_Ed.js";import{mt as r,n as i}from"./sdk.gen-B3Z8klU-.js";var a=new Map;function o(e,t){return`${e}::${t}`}function s(e,t){let n=o(e,t),r=a.get(n);return r??(r=i({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw a.delete(n),e}),a.set(n,r)),r}function c(e,t,n){a.set(o(e,t),Promise.resolve(n))}function l(e,t){a.delete(o(e,t))}function u(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function d(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`workflow-detail`||n===`acp-run-detail`||n===`background-task-detail`||n===`channel-setup`?e[t]:n}function f(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var p={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentSurfaceId:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeBackgroundTaskId:null,viewBeforeBackgroundTaskDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`chat`,ruleEditorRequestSeq:0},m=n(t()((t,n)=>({...p,setMainView:e=>{n().mainView!==e&&t({mainView:e})},setIntelligenceTab:e=>{n().intelligenceTab!==e&&t({intelligenceTab:e})},openApp:e=>{t({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(r,a)=>{t({mainView:`app`,activeAppId:a,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await i({path:{assistant_id:r,id:a},throwOnError:!0});if(n().activeAppId!==a)return;t({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),c(r,e.appId,e.html)}catch(r){if(n().activeAppId!==a)return;u(r)||e(r,{context:`openApp`}),t({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{t({openedAppState:e})},handleAppLoadFailed:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{t({isAppMinimized:!n().isAppMinimized})},handleAppUnpinned:e=>{let t=n();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(n().closeApp(),!0)},enterAppEditing:()=>{t({mainView:`app-editing`})},exitAppEditing:()=>{t({mainView:`app`})},openSubagentDetail:e=>{t({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:d(n(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{t({mainView:n().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{t({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:d(n(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{t({mainView:n().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openAcpRunDetail:e=>{t({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:d(n(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{t({mainView:n().viewBeforeAcpRunDetail,activeAcpRunId:null})},openBackgroundTaskDetail:e=>{t({mainView:`background-task-detail`,activeBackgroundTaskId:e,viewBeforeBackgroundTaskDetail:d(n(),`viewBeforeBackgroundTaskDetail`)})},closeBackgroundTaskDetail:()=>{t({mainView:n().viewBeforeBackgroundTaskDetail,activeBackgroundTaskId:null})},openProcessDetail:({kind:e,id:t})=>{switch(e){case`subagent`:n().openSubagentDetail(t);return;case`workflow`:n().openWorkflowDetail(t);return;case`acp-run`:n().openAcpRunDetail(t);return;case`background-task`:n().openBackgroundTaskDetail(t);return;default:}},closeActiveDetail:()=>{switch(n().mainView){case`subagent-detail`:n().closeSubagentDetail();return;case`workflow-detail`:n().closeWorkflowDetail();return;case`acp-run-detail`:n().closeAcpRunDetail();return;case`background-task-detail`:n().closeBackgroundTaskDetail();return;default:return}},openChannelSetup:e=>{t({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:d(n(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{t({mainView:n().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{t({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:d(n(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=n(),r=t.activeToolDetail;t.mainView===`tool-detail`&&r!=null&&(e.kind===`thinking`?r.kind===`thinking`&&f(r,e):r.kind!==`thinking`&&r.toolCallId===e.toolCallId)?n().closeToolDetail():n().openToolDetail(e)},closeToolDetail:()=>{t({mainView:n().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditorForActiveTool:()=>{n().activeToolDetail&&t(e=>({ruleEditorRequestSeq:e.ruleEditorRequestSeq+1}))},openDocument:()=>{t({mainView:`document`,openedDocumentState:null,viewBeforeDocument:d(n(),`viewBeforeDocument`)})},loadDocument:async(e,i)=>{let a=d(n(),`viewBeforeDocument`);t({mainView:`document`,activeDocumentSurfaceId:i,openedDocumentState:null,viewBeforeDocument:a});try{let{data:o}=await r({path:{assistant_id:e,id:i},throwOnError:!0});if(n().activeDocumentSurfaceId!==i)return;if(!o){t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null});return}t({openedDocumentState:{surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``}})}catch{if(n().activeDocumentSurfaceId!==i)return;t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null})}},setLoadedDocument:e=>{t({openedDocumentState:e})},updateDocumentContent:(e,r,i)=>{let a=n();if(!a.openedDocumentState||a.openedDocumentState.surfaceId!==e)return;let o=a.openedDocumentState,s=i===`append`?o.content+r:r;t({openedDocumentState:{...o,content:s}})},handleDocumentLoadFailed:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},closeDocument:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},refreshAssets:()=>{t({assetsRefreshKey:n().assetsRefreshKey+1})},reset:()=>t({...p})})));export{c as a,s as i,m as n,l as r,f as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D-AX8Voo.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-ChWAdhLG.js";import{t as l}from"./toggle-X_kQW5my.js";import{t as u}from"./info-ciQS_i3y.js";import{a as d}from"./routes-C6gxiCrz.js";import{Bn as f,Fn as p,Hn as m,In as h,Ln as g,Pn as _,Rn as v,Un as y,Vn as b,Xn as x,Zn as S,ja as C,zn as w}from"./index-CQhaX_6y.js";import{t as T}from"./detail-card-DRXR3fb7.js";var E=e(i(),1),D=s(),O=`vellum:voice:conversationTimeoutSeconds`,k=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],A={label:`Fn`,activator:h},j=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],M=`30`,N=`text-body-small-default text-[var(--content-tertiary)]`;function P(){return(0,D.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,D.jsx)(F,{}),(0,D.jsx)(L,{}),(0,D.jsx)(R,{}),(0,D.jsx)(B,{})]})}function F(){return(0,D.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--field-bg)] px-3 py-2`,children:[(0,D.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 text-[var(--primary-base)]`}),(0,D.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Looking to configure Speech-to-Text or Text-to-Speech models?`}),(0,D.jsxs)(o,{to:d.settings.ai,className:`inline-flex items-center gap-1 text-body-medium-lighter text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Go to Models & Services`,(0,D.jsx)(C,{className:`h-3 w-3`})]})]})}var I=``;function L(){let[e,n]=(0,E.useState)([]),[i,o]=(0,E.useState)(!1),[s,l]=(0,E.useState)(()=>S()),u=(0,E.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),n(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{n([]),o(!1)}},[]),d=(0,E.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}u()},[u]);(0,E.useEffect)(()=>{u();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void u();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[u]);let f=(0,E.useMemo)(()=>[{value:I,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),p=(0,E.useCallback)(e=>{l(e),e===I?t(x):r(x,e)},[]);return(0,D.jsx)(T,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:f,value:f.some(e=>e.value===s)?s:I,onChange:p,"aria-label":`Microphone`})}),i&&(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(a,{variant:`outlined`,onClick:d,children:`Allow Microphone Access`}),(0,D.jsx)(`span`,{className:N,children:`Grant microphone access to list your available input devices.`})]})]})})}function R(){let e=_(),[t,i]=(0,E.useState)(()=>{let t=n(g,``);return t?b(t,{preserveFunction:e}):e?A.activator:{kind:`off`}}),[a,o]=(0,E.useState)(!1),[s,c]=(0,E.useState)([]),d=(0,E.useRef)(null),x=(0,E.useRef)(!1),S=(0,E.useMemo)(()=>e?[A,...k]:k,[e]),C=t.kind!==`off`,O=C&&!e,j=(0,E.useCallback)(e=>{i(e),r(g,m(e)),o(!1),c([])},[]),M=(0,E.useCallback)(()=>{o(!0),c([]),x.current=!1,requestAnimationFrame(()=>{d.current?.focus()})},[]),P=(0,E.useCallback)(()=>{o(!1),c([]),x.current=!1},[]),F=(0,E.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),I=(0,E.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){P();return}let t=F(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?h.modifiers:y(t));return}if(t.includes(`function`)){j(h);return}x.current=!0,j({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[P,F,j]),L=(0,E.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(x.current){x.current=!1,c([]);return}F(e).length===0&&s.length>0&&j({kind:`modifierOnly`,modifiers:s})}},[F,a,s,j]);(0,E.useEffect)(()=>{if(!a)return;let e=e=>{d.current&&!d.current.contains(e.target)&&P()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[P,a]);let R=C&&!S.some(e=>w(e.activator,t));return(0,D.jsx)(T,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsx)(l,{checked:C,onChange:n=>{n?t.kind===`off`&&j(e?A.activator:p):j({kind:`off`})},label:`Enable Push to Talk`}),C&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(`span`,{className:N,children:`Activation Key:`}),(0,D.jsxs)(`div`,{ref:d,tabIndex:a?0:-1,onKeyDown:a?I:void 0,onKeyUp:a?L:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[S.map(e=>{let n=w(e.activator,t);return(0,D.jsx)(z,{label:e.label,selected:n,onClick:()=>j(e.activator)},e.label)}),a?(0,D.jsx)(z,{label:s.length>0?f(s):`Press any key…`,selected:!0,recording:!0,onClick:P}):(0,D.jsx)(z,{label:R?v(t):`Custom`,selected:R,onClick:M})]}),O&&(0,D.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,D.jsx)(u,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,D.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function z({label:e,selected:t,recording:n=!1,onClick:r}){return(0,D.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,D.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,D.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function B(){let[e,t]=(0,E.useState)(()=>{let e=n(O,M);return j.find(t=>t.value===e)?.value??M});return(0,D.jsx)(T,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:j,value:e,onChange:(0,E.useCallback)(e=>{t(e),r(O,e)},[]),"aria-label":`Conversation timeout`})})})}export{P as VoicePage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D-AX8Voo.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-ChWAdhLG.js";import{t as l}from"./toggle-X_kQW5my.js";import{t as u}from"./info-C9uyv2bI.js";import{o as d}from"./routes-CCywyokq.js";import{$n as f,Bn as p,Gn as m,Hn as h,In as g,Ln as _,Qn as v,Rn as y,Un as b,Vn as x,Wn as S,ja as C,zn as w}from"./index-CWzNQ8A_.js";import{t as T}from"./detail-card-DXLMG-Zw.js";var E=e(i(),1),D=s(),O=`vellum:voice:conversationTimeoutSeconds`,k=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],A={label:`Fn`,activator:y},j=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],M=`30`,N=`text-body-small-default text-[var(--content-tertiary)]`;function P(){return(0,D.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,D.jsx)(F,{}),(0,D.jsx)(L,{}),(0,D.jsx)(R,{}),(0,D.jsx)(B,{})]})}function F(){return(0,D.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--field-bg)] px-3 py-2`,children:[(0,D.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 text-[var(--primary-base)]`}),(0,D.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Looking to configure Speech-to-Text or Text-to-Speech models?`}),(0,D.jsxs)(o,{to:d.settings.ai,className:`inline-flex items-center gap-1 text-body-medium-lighter text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Go to Models & Services`,(0,D.jsx)(C,{className:`h-3 w-3`})]})]})}var I=``;function L(){let[e,n]=(0,E.useState)([]),[i,o]=(0,E.useState)(!1),[s,l]=(0,E.useState)(()=>f()),u=(0,E.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),n(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{n([]),o(!1)}},[]),d=(0,E.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}u()},[u]);(0,E.useEffect)(()=>{u();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void u();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[u]);let p=(0,E.useMemo)(()=>[{value:I,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),m=(0,E.useCallback)(e=>{l(e),e===I?t(v):r(v,e)},[]);return(0,D.jsx)(T,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:p,value:p.some(e=>e.value===s)?s:I,onChange:m,"aria-label":`Microphone`})}),i&&(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(a,{variant:`outlined`,onClick:d,children:`Allow Microphone Access`}),(0,D.jsx)(`span`,{className:N,children:`Grant microphone access to list your available input devices.`})]})]})})}function R(){let e=g(),[t,i]=(0,E.useState)(()=>{let t=n(w,``);return t?b(t,{preserveFunction:e}):e?A.activator:{kind:`off`}}),[a,o]=(0,E.useState)(!1),[s,c]=(0,E.useState)([]),d=(0,E.useRef)(null),f=(0,E.useRef)(!1),v=(0,E.useMemo)(()=>e?[A,...k]:k,[e]),C=t.kind!==`off`,O=C&&!e,j=(0,E.useCallback)(e=>{i(e),r(w,S(e)),o(!1),c([])},[]),M=(0,E.useCallback)(()=>{o(!0),c([]),f.current=!1,requestAnimationFrame(()=>{d.current?.focus()})},[]),P=(0,E.useCallback)(()=>{o(!1),c([]),f.current=!1},[]),F=(0,E.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),I=(0,E.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){P();return}let t=F(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?y.modifiers:m(t));return}if(t.includes(`function`)){j(y);return}f.current=!0,j({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[P,F,j]),L=(0,E.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(f.current){f.current=!1,c([]);return}F(e).length===0&&s.length>0&&j({kind:`modifierOnly`,modifiers:s})}},[F,a,s,j]);(0,E.useEffect)(()=>{if(!a)return;let e=e=>{d.current&&!d.current.contains(e.target)&&P()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[P,a]);let R=C&&!v.some(e=>x(e.activator,t));return(0,D.jsx)(T,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsx)(l,{checked:C,onChange:n=>{n?t.kind===`off`&&j(e?A.activator:_):j({kind:`off`})},label:`Enable Push to Talk`}),C&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(`span`,{className:N,children:`Activation Key:`}),(0,D.jsxs)(`div`,{ref:d,tabIndex:a?0:-1,onKeyDown:a?I:void 0,onKeyUp:a?L:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[v.map(e=>{let n=x(e.activator,t);return(0,D.jsx)(z,{label:e.label,selected:n,onClick:()=>j(e.activator)},e.label)}),a?(0,D.jsx)(z,{label:s.length>0?h(s):`Press any key…`,selected:!0,recording:!0,onClick:P}):(0,D.jsx)(z,{label:R?p(t):`Custom`,selected:R,onClick:M})]}),O&&(0,D.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,D.jsx)(u,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,D.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function z({label:e,selected:t,recording:n=!1,onClick:r}){return(0,D.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,D.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,D.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function B(){let[e,t]=(0,E.useState)(()=>{let e=n(O,M);return j.find(t=>t.value===e)?.value??M});return(0,D.jsx)(T,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:j,value:e,onChange:(0,E.useCallback)(e=>{t(e),r(O,e)},[]),"aria-label":`Conversation timeout`})})})}export{P as VoicePage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./moon-CKINz50a.js";import{t as i}from"./misc-CFzLzLPH.js";import{G as a,K as o,U as s,W as c,_a as l,ai as u,fi as d,ga as f,ha as p,hi as m,la as h,ma as g,pa as _,va as v}from"./index-CQhaX_6y.js";var y=e(t(),1),b={"sun.max.fill":{icon:d,className:`text-orange-500`},"cloud.sun.fill":{icon:g,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:f,className:`text-blue-400`},"cloud.fill":{icon:_,className:`text-stone-400`},"cloud.rain.fill":{icon:p,className:`text-blue-400`},snowflake:{icon:m,className:`text-blue-300`},"cloud.bolt.fill":{icon:l,className:`text-orange-500`},"cloud.fog.fill":{icon:v,className:`text-stone-400`}},x={sunny:{icon:d,className:`text-orange-500`},clear:{icon:d,className:`text-orange-500`},"partly cloudy":{icon:g,className:`text-amber-400`},"mostly sunny":{icon:g,className:`text-amber-400`},cloudy:{icon:_,className:`text-stone-400`},overcast:{icon:_,className:`text-stone-400`},rainy:{icon:p,className:`text-blue-400`},rain:{icon:p,className:`text-blue-400`},drizzle:{icon:p,className:`text-blue-400`},snow:{icon:m,className:`text-blue-300`},snowy:{icon:m,className:`text-blue-300`},thunderstorm:{icon:l,className:`text-orange-500`},thunder:{icon:l,className:`text-orange-500`},foggy:{icon:v,className:`text-stone-400`},fog:{icon:v,className:`text-stone-400`},mist:{icon:v,className:`text-stone-400`},hazy:{icon:v,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:d,className:`text-orange-500`},"mostly cloudy":{icon:_,className:`text-stone-400`},breezy:{icon:u,className:`text-stone-400`},windy:{icon:u,className:`text-stone-400`},cool:{icon:_,className:`text-stone-400`},warm:{icon:d,className:`text-orange-500`},hot:{icon:d,className:`text-orange-500`},cold:{icon:m,className:`text-blue-300`},"cold snap":{icon:m,className:`text-blue-300`},"warm, mostly sunny":{icon:g,className:`text-amber-400`},"cooler, breezy":{icon:u,className:`text-stone-400`}},S={icon:_,className:`text-stone-400`};function C(e){let t=b[e];if(t)return t;let n=e.toLowerCase(),r=x[n];if(r)return r;for(let[e,t]of Object.entries(x))if(n.includes(e))return t;return S}function w(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function T(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=a(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=a(e.current),r=c(n?.temp)??c(e.currentTemp)??c(e.temperature)??c(e.temp),i=c(n?.feelsLike)??c(n?.feels_like)??c(n?.apparentTemperature)??c(e.feelsLike)??c(e.feels_like)??c(e.apparentTemperature),l=o(n?.condition)??o(e.condition),u=c(n?.humidity)??c(e.humidity),d=w(n?.wind??e.wind),f=c(n?.windSpeed)??c(n?.wind_speed)??c(e.windSpeed)??c(e.wind_speed)??d.speed,p=o(n?.windDirection)??o(n?.wind_direction)??o(e.windDirection)??o(e.wind_direction)??d.direction,m=a(e.units),h=o(m?.temperature)??o(n?.unit)??o(e.unit)??`F`,g=o(m?.speed)??o(e.windUnit)??o(e.wind_unit),_=s(e.hourly).map((e,t)=>({id:o(e.id)??String(t),time:o(e.time)??``,icon:o(e.icon)??o(e.condition)??`cloud.fill`,temp:c(e.tempC)??c(e.temp)??c(e.temperature),tempC:c(e.tempC)})),v=s([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:o(e.id)??String(t),day:o(e.day)??o(e.date),dayLabel:o(e.dayLabel)??o(e.date),icon:o(e.icon)??o(e.condition)??`cloud.fill`,low:c(e.low),high:c(e.high),lowC:c(e.lowC),highC:c(e.highC),precip:c(e.precip)??c(e.precipitation)??c(e.precipitationProbability),condition:o(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:l,humidity:u,windSpeed:f,windDirection:p,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function E(e){return e*9/5+32}function D(e){return(e-32)*5/9}function O(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=D(e)),!t&&n&&(r=E(e)),`${Math.round(r)}`}function k(e,t,n){return e.tempC===void 0?e.temp===void 0?null:O(e.temp,t,n):O(e.tempC,!1,n)}function A(e,t,n){return e.lowC===void 0?O(e.low,t,n):O(e.lowC,!1,n)}function j(e,t,n){return e.highC===void 0?O(e.high,t,n):O(e.highC,!1,n)}var M=n();function N({icon:e,size:t=20}){let{icon:n,className:r}=C(e);return(0,M.jsx)(n,{width:t,height:t,className:r})}function P({useFahrenheit:e,onToggle:t}){return(0,M.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:`°F`}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:`°C`})]})}function F({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,a=O(e.currentTemp,t,n),o=O(e.feelsLike,t,n),s=n?`F`:`C`,c=e.forecast?.[0],l=c?j(c,t,n):null,d=c?A(c,t,n):null,f=null;return e.windSpeed!==void 0&&(f=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(f=`${e.windDirection} ${f}`)),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),a!==null&&(0,M.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[a,`°`,s]}),e.condition&&(0,M.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,M.jsx)(P,{useFahrenheit:n,onToggle:r})]}),(0,M.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[o!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,o,`°`]}),l!==null&&d!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,l,`° L:`,d,`°`]}),f&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(u,{width:12,height:12}),f]}),e.humidity!==void 0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(h,{width:12,height:12}),e.humidity,`%`]})]})]})}function I({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=k(e,t,n);return(0,M.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,M.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,M.jsx)(N,{icon:e.icon,size:18}),a!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function L({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:a,globalMax:o}=(0,y.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=A(e,n,r),f=j(e,n,r),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;y=h===m?50:(Math.max(m,Math.min(h,r))-m)/(h-m)*100}return(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`span`,{className:i(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,M.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,M.jsx)(N,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,M.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,M.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,M.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,M.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function R({templateData:e,fallback:t}){let n=(0,y.useMemo)(()=>T(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,y.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(F,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,M.jsx)(I,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,M.jsx)(L,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{R as WeatherForecastDisplay};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./moon-rIyEhhAK.js";import{t as i}from"./misc-GIyc06fS.js";import{G as a,J as o,K as s,_a as c,_i as l,ga as u,ha as d,ma as f,mi as p,q as m,si as h,ua as g,va as _,ya as v}from"./index-CWzNQ8A_.js";var y=e(t(),1),b={"sun.max.fill":{icon:p,className:`text-orange-500`},"cloud.sun.fill":{icon:d,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:c,className:`text-blue-400`},"cloud.fill":{icon:f,className:`text-stone-400`},"cloud.rain.fill":{icon:u,className:`text-blue-400`},snowflake:{icon:l,className:`text-blue-300`},"cloud.bolt.fill":{icon:_,className:`text-orange-500`},"cloud.fog.fill":{icon:v,className:`text-stone-400`}},x={sunny:{icon:p,className:`text-orange-500`},clear:{icon:p,className:`text-orange-500`},"partly cloudy":{icon:d,className:`text-amber-400`},"mostly sunny":{icon:d,className:`text-amber-400`},cloudy:{icon:f,className:`text-stone-400`},overcast:{icon:f,className:`text-stone-400`},rainy:{icon:u,className:`text-blue-400`},rain:{icon:u,className:`text-blue-400`},drizzle:{icon:u,className:`text-blue-400`},snow:{icon:l,className:`text-blue-300`},snowy:{icon:l,className:`text-blue-300`},thunderstorm:{icon:_,className:`text-orange-500`},thunder:{icon:_,className:`text-orange-500`},foggy:{icon:v,className:`text-stone-400`},fog:{icon:v,className:`text-stone-400`},mist:{icon:v,className:`text-stone-400`},hazy:{icon:v,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:p,className:`text-orange-500`},"mostly cloudy":{icon:f,className:`text-stone-400`},breezy:{icon:h,className:`text-stone-400`},windy:{icon:h,className:`text-stone-400`},cool:{icon:f,className:`text-stone-400`},warm:{icon:p,className:`text-orange-500`},hot:{icon:p,className:`text-orange-500`},cold:{icon:l,className:`text-blue-300`},"cold snap":{icon:l,className:`text-blue-300`},"warm, mostly sunny":{icon:d,className:`text-amber-400`},"cooler, breezy":{icon:h,className:`text-stone-400`}},S={icon:f,className:`text-stone-400`};function C(e){let t=b[e];if(t)return t;let n=e.toLowerCase(),r=x[n];if(r)return r;for(let[e,t]of Object.entries(x))if(n.includes(e))return t;return S}function w(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function T(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=m(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=m(e.current),r=s(n?.temp)??s(e.currentTemp)??s(e.temperature)??s(e.temp),i=s(n?.feelsLike)??s(n?.feels_like)??s(n?.apparentTemperature)??s(e.feelsLike)??s(e.feels_like)??s(e.apparentTemperature),c=o(n?.condition)??o(e.condition),l=s(n?.humidity)??s(e.humidity),u=w(n?.wind??e.wind),d=s(n?.windSpeed)??s(n?.wind_speed)??s(e.windSpeed)??s(e.wind_speed)??u.speed,f=o(n?.windDirection)??o(n?.wind_direction)??o(e.windDirection)??o(e.wind_direction)??u.direction,p=m(e.units),h=o(p?.temperature)??o(n?.unit)??o(e.unit)??`F`,g=o(p?.speed)??o(e.windUnit)??o(e.wind_unit),_=a(e.hourly).map((e,t)=>({id:o(e.id)??String(t),time:o(e.time)??``,icon:o(e.icon)??o(e.condition)??`cloud.fill`,temp:s(e.tempC)??s(e.temp)??s(e.temperature),tempC:s(e.tempC)})),v=a([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:o(e.id)??String(t),day:o(e.day)??o(e.date),dayLabel:o(e.dayLabel)??o(e.date),icon:o(e.icon)??o(e.condition)??`cloud.fill`,low:s(e.low),high:s(e.high),lowC:s(e.lowC),highC:s(e.highC),precip:s(e.precip)??s(e.precipitation)??s(e.precipitationProbability),condition:o(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:c,humidity:l,windSpeed:d,windDirection:f,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function E(e){return e*9/5+32}function D(e){return(e-32)*5/9}function O(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=D(e)),!t&&n&&(r=E(e)),`${Math.round(r)}`}function k(e,t,n){return e.tempC===void 0?e.temp===void 0?null:O(e.temp,t,n):O(e.tempC,!1,n)}function A(e,t,n){return e.lowC===void 0?O(e.low,t,n):O(e.lowC,!1,n)}function j(e,t,n){return e.highC===void 0?O(e.high,t,n):O(e.highC,!1,n)}var M=n();function N({icon:e,size:t=20}){let{icon:n,className:r}=C(e);return(0,M.jsx)(n,{width:t,height:t,className:r})}function P({useFahrenheit:e,onToggle:t}){return(0,M.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:`°F`}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:`°C`})]})}function F({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,a=O(e.currentTemp,t,n),o=O(e.feelsLike,t,n),s=n?`F`:`C`,c=e.forecast?.[0],l=c?j(c,t,n):null,u=c?A(c,t,n):null,d=null;return e.windSpeed!==void 0&&(d=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(d=`${e.windDirection} ${d}`)),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),a!==null&&(0,M.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[a,`°`,s]}),e.condition&&(0,M.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,M.jsx)(P,{useFahrenheit:n,onToggle:r})]}),(0,M.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[o!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,o,`°`]}),l!==null&&u!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,l,`° L:`,u,`°`]}),d&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(h,{width:12,height:12}),d]}),e.humidity!==void 0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(g,{width:12,height:12}),e.humidity,`%`]})]})]})}function I({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=k(e,t,n);return(0,M.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,M.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,M.jsx)(N,{icon:e.icon,size:18}),a!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function L({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:a,globalMax:o}=(0,y.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=A(e,n,r),f=j(e,n,r),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;y=h===m?50:(Math.max(m,Math.min(h,r))-m)/(h-m)*100}return(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`span`,{className:i(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,M.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,M.jsx)(N,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,M.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,M.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,M.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,M.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function R({templateData:e,fallback:t}){let n=(0,y.useMemo)(()=>T(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,y.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(F,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,M.jsx)(I,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,M.jsx)(L,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{R as WeatherForecastDisplay};
@@ -1 +1 @@
1
- import{n as e}from"./dist-Ztj3rqLK.js";var t=class extends e{async canShare(){return typeof navigator>`u`||!navigator.share?{value:!1}:{value:!0}}async share(e){if(typeof navigator>`u`||!navigator.share)throw this.unavailable(`Share API not available in this browser`);return await navigator.share({title:e.title,text:e.text,url:e.url}),{}}};export{t as ShareWeb};
1
+ import{n as e}from"./dist-CNEsSZUe.js";var t=class extends e{async canShare(){return typeof navigator>`u`||!navigator.share?{value:!1}:{value:!0}}async share(e){if(typeof navigator>`u`||!navigator.share)throw this.unavailable(`Share API not available in this browser`);return await navigator.share({title:e.title,text:e.text,url:e.url}),{}}};export{t as ShareWeb};
@@ -1 +1 @@
1
- import{n as e}from"./dist-Ztj3rqLK.js";function t(){let e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t=`unknown`,n=e?e.type||e.effectiveType:null;if(n&&typeof n==`string`)switch(n){case`bluetooth`:case`cellular`:t=`cellular`;break;case`none`:t=`none`;break;case`ethernet`:case`wifi`:case`wimax`:t=`wifi`;break;case`other`:case`unknown`:t=`unknown`;break;case`slow-2g`:case`2g`:case`3g`:t=`cellular`;break;case`4g`:t=`wifi`;break;default:break}return t}var n=class extends e{constructor(){super(),this.handleOnline=()=>{let e={connected:!0,connectionType:t()};this.notifyListeners(`networkStatusChange`,e)},this.handleOffline=()=>{this.notifyListeners(`networkStatusChange`,{connected:!1,connectionType:`none`})},typeof window<`u`&&(window.addEventListener(`online`,this.handleOnline),window.addEventListener(`offline`,this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable(`Browser does not support the Network Information API`);let e=window.navigator.onLine,n=t();return{connected:e,connectionType:e?n:`none`}}};new n;export{n as NetworkWeb};
1
+ import{n as e}from"./dist-CNEsSZUe.js";function t(){let e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t=`unknown`,n=e?e.type||e.effectiveType:null;if(n&&typeof n==`string`)switch(n){case`bluetooth`:case`cellular`:t=`cellular`;break;case`none`:t=`none`;break;case`ethernet`:case`wifi`:case`wimax`:t=`wifi`;break;case`other`:case`unknown`:t=`unknown`;break;case`slow-2g`:case`2g`:case`3g`:t=`cellular`;break;case`4g`:t=`wifi`;break;default:break}return t}var n=class extends e{constructor(){super(),this.handleOnline=()=>{let e={connected:!0,connectionType:t()};this.notifyListeners(`networkStatusChange`,e)},this.handleOffline=()=>{this.notifyListeners(`networkStatusChange`,{connected:!1,connectionType:`none`})},typeof window<`u`&&(window.addEventListener(`online`,this.handleOnline),window.addEventListener(`offline`,this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable(`Browser does not support the Network Information API`);let e=window.navigator.onLine,n=t();return{connected:e,connectionType:e?n:`none`}}};new n;export{n as NetworkWeb};
@@ -1 +1 @@
1
- import{n as e}from"./dist-Ztj3rqLK.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
1
+ import{n as e}from"./dist-CNEsSZUe.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./dist-Ztj3rqLK.js";import{n}from"./definitions-BughTGuV.js";function r(e){let t=e.split(`/`).filter(e=>e!==`.`),n=[];return t.forEach(e=>{e===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():n.push(e)}),n.join(`/`)}function i(e,t){e=r(e),t=r(t);let n=e.split(`/`),i=t.split(`/`);return e!==t&&n.every((e,t)=>e===i[t])}var a=class r extends e{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME=`Disc`,this._writeCmds=[`add`,`put`,`delete`],this.downloadFile=async e=>{let n=t(e,e.webFetchExtra),r=await fetch(e.url,n),i;if(!e.progress)i=await r.blob();else if(!r?.body)i=new Blob;else{let t=r.body.getReader(),n=0,a=[],o=r.headers.get(`content-type`),s=parseInt(r.headers.get(`content-length`)||`0`,10);for(;;){let{done:r,value:i}=await t.read();if(r)break;a.push(i),n+=i?.length||0;let o={url:e.url,bytes:n,contentLength:s};this.notifyListeners(`progress`,o)}let c=new Uint8Array(n),l=0;for(let e of a)e!==void 0&&(c.set(e,l),l+=e.length);i=new Blob([c.buffer],{type:o||void 0})}return{path:(await this.writeFile({path:e.path,directory:e.directory??void 0,recursive:e.recursive??!1,data:i})).uri,blob:i}}}readFileInChunks(e,t){throw this.unavailable(`Method not implemented.`)}async initDb(){if(this._db!==void 0)return this._db;if(!(`indexedDB`in window))throw this.unavailable(`This browser doesn't support IndexedDB`);return new Promise((e,t)=>{let n=indexedDB.open(this.DB_NAME,this.DB_VERSION);n.onupgradeneeded=r.doUpgrade,n.onsuccess=()=>{this._db=n.result,e(n.result)},n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`db blocked`)}})}static doUpgrade(e){let t=e.target.result;switch(e.oldVersion){default:t.objectStoreNames.contains(`FileStorage`)&&t.deleteObjectStore(`FileStorage`),t.createObjectStore(`FileStorage`,{keyPath:`path`}).createIndex(`by_folder`,`folder`)}}async dbRequest(e,t){let n=this._writeCmds.indexOf(e)===-1?`readonly`:`readwrite`;return this.initDb().then(r=>new Promise((i,a)=>{let o=r.transaction([`FileStorage`],n).objectStore(`FileStorage`)[e](...t);o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)}))}async dbIndexRequest(e,t,n){let r=this._writeCmds.indexOf(t)===-1?`readonly`:`readwrite`;return this.initDb().then(i=>new Promise((a,o)=>{let s=i.transaction([`FileStorage`],r).objectStore(`FileStorage`).index(e)[t](...n);s.onsuccess=()=>a(s.result),s.onerror=()=>o(s.error)}))}getPath(e,t){let n=t===void 0?``:t.replace(/^[/]+|[/]+$/g,``),r=``;return e!==void 0&&(r+=`/`+e),t!==``&&(r+=`/`+n),r}async clear(){(await this.initDb()).transaction([`FileStorage`],`readwrite`).objectStore(`FileStorage`).clear()}async readFile(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0)throw Error(`File does not exist.`);return{data:n.content?n.content:``}}async writeFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=e.recursive,a=await this.dbRequest(`get`,[t]);if(a&&a.type===`directory`)throw Error(`The supplied path is a directory.`);let o=t.substr(0,t.lastIndexOf(`/`));if(await this.dbRequest(`get`,[o])===void 0){let t=o.indexOf(`/`,1);if(t!==-1){let n=o.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:i})}}if(!r&&!(n instanceof Blob)&&(n=n.indexOf(`,`)>=0?n.split(`,`)[1]:n,!this.isBase64String(n)))throw Error(`The supplied data is not valid base64 content.`);let s=Date.now(),c={path:t,folder:o,type:`file`,size:n instanceof Blob?n.size:n.length,ctime:s,mtime:s,content:n};return await this.dbRequest(`put`,[c]),{uri:c.path}}async appendFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=t.substr(0,t.lastIndexOf(`/`)),a=Date.now(),o=a,s=await this.dbRequest(`get`,[t]);if(s&&s.type===`directory`)throw Error(`The supplied path is a directory.`);if(await this.dbRequest(`get`,[i])===void 0){let t=i.indexOf(`/`,1);if(t!==-1){let n=i.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:!0})}}if(!r&&!this.isBase64String(n))throw Error(`The supplied data is not valid base64 content.`);if(s!==void 0){if(s.content instanceof Blob)throw Error(`The occupied entry contains a Blob object which cannot be appended to.`);n=s.content!==void 0&&!r?btoa(atob(s.content)+atob(n)):s.content+n,o=s.ctime}let c={path:t,folder:i,type:`file`,size:n.length,ctime:o,mtime:a,content:n};await this.dbRequest(`put`,[c])}async deleteFile(e){let t=this.getPath(e.directory,e.path);if(await this.dbRequest(`get`,[t])===void 0)throw Error(`File does not exist.`);if((await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)])).length!==0)throw Error(`Folder is not empty.`);await this.dbRequest(`delete`,[t])}async mkdir(e){let t=this.getPath(e.directory,e.path),n=e.recursive,r=t.substr(0,t.lastIndexOf(`/`)),i=(t.match(/\//g)||[]).length,a=await this.dbRequest(`get`,[r]),o=await this.dbRequest(`get`,[t]);if(i===1)throw Error(`Cannot create Root directory`);if(o!==void 0)throw Error(`Current directory does already exist.`);if(!n&&i!==2&&a===void 0)throw Error(`Parent directory must exist`);if(n&&i!==2&&a===void 0){let t=r.substr(r.indexOf(`/`,1));await this.mkdir({path:t,directory:e.directory,recursive:n})}let s=Date.now(),c={path:t,folder:r,type:`directory`,size:0,ctime:s,mtime:s};await this.dbRequest(`put`,[c])}async rmdir(e){let{path:t,directory:n,recursive:r}=e,i=this.getPath(n,t),a=await this.dbRequest(`get`,[i]);if(a===void 0)throw Error(`Folder does not exist.`);if(a.type!==`directory`)throw Error(`Requested path is not a directory`);let o=await this.readdir({path:t,directory:n});if(o.files.length!==0&&!r)throw Error(`Folder is not empty`);for(let e of o.files){let i=`${t}/${e.name}`;(await this.stat({path:i,directory:n})).type===`file`?await this.deleteFile({path:i,directory:n}):await this.rmdir({path:i,directory:n,recursive:r})}await this.dbRequest(`delete`,[i])}async readdir(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(e.path!==``&&n===void 0)throw Error(`Folder does not exist.`);let r=await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)]);return{files:await Promise.all(r.map(async e=>{let n=await this.dbRequest(`get`,[e]);return n===void 0&&(n=await this.dbRequest(`get`,[e+`/`])),{name:e.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}))}}async getUri(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);return n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),{uri:n?.path||t}}async stat(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),n===void 0)throw Error(`Entry does not exist.`);return{name:n.path.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:`granted`}}async checkPermissions(){return{publicStorage:`granted`}}async _copy(e,t=!1){let{toDirectory:r}=e,{to:a,from:o,directory:s}=e;if(!a||!o)throw Error(`Both to and from must be provided`);r||=s;let c=this.getPath(s,o),l=this.getPath(r,a);if(c===l)return{uri:l};if(i(c,l))throw Error(`To path cannot contain the from path`);let u;try{u=await this.stat({path:a,directory:r})}catch{let e=a.split(`/`);e.pop();let t=e.join(`/`);if(e.length>0&&(await this.stat({path:t,directory:r})).type!==`directory`)throw Error(`Parent directory of the to path is a file`)}if(u&&u.type===`directory`)throw Error(`Cannot overwrite a directory with a file`);let d=await this.stat({path:o,directory:s}),f=async(e,t,n)=>{let i=this.getPath(r,e),a=await this.dbRequest(`get`,[i]);a.ctime=t,a.mtime=n,await this.dbRequest(`put`,[a])},p=d.ctime?d.ctime:Date.now();switch(d.type){case`file`:{let e=await this.readFile({path:o,directory:s});t&&await this.deleteFile({path:o,directory:s});let i;!(e.data instanceof Blob)&&!this.isBase64String(e.data)&&(i=n.UTF8);let c=await this.writeFile({path:a,directory:r,data:e.data,encoding:i});return t&&await f(a,p,d.mtime),c}case`directory`:{if(u)throw Error(`Cannot move a directory over an existing object`);try{await this.mkdir({path:a,directory:r,recursive:!1}),t&&await f(a,p,d.mtime)}catch{}let e=(await this.readdir({path:o,directory:s})).files;for(let n of e)await this._copy({from:`${o}/${n.name}`,to:`${a}/${n.name}`,directory:s,toDirectory:r},t);t&&await this.rmdir({path:o,directory:s})}}return{uri:l}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}};a._debug=!0;export{a as FilesystemWeb};
1
+ import{n as e,r as t}from"./dist-CNEsSZUe.js";import{n}from"./definitions-DeG2sRFv.js";function r(e){let t=e.split(`/`).filter(e=>e!==`.`),n=[];return t.forEach(e=>{e===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():n.push(e)}),n.join(`/`)}function i(e,t){e=r(e),t=r(t);let n=e.split(`/`),i=t.split(`/`);return e!==t&&n.every((e,t)=>e===i[t])}var a=class r extends e{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME=`Disc`,this._writeCmds=[`add`,`put`,`delete`],this.downloadFile=async e=>{let n=t(e,e.webFetchExtra),r=await fetch(e.url,n),i;if(!e.progress)i=await r.blob();else if(!r?.body)i=new Blob;else{let t=r.body.getReader(),n=0,a=[],o=r.headers.get(`content-type`),s=parseInt(r.headers.get(`content-length`)||`0`,10);for(;;){let{done:r,value:i}=await t.read();if(r)break;a.push(i),n+=i?.length||0;let o={url:e.url,bytes:n,contentLength:s};this.notifyListeners(`progress`,o)}let c=new Uint8Array(n),l=0;for(let e of a)e!==void 0&&(c.set(e,l),l+=e.length);i=new Blob([c.buffer],{type:o||void 0})}return{path:(await this.writeFile({path:e.path,directory:e.directory??void 0,recursive:e.recursive??!1,data:i})).uri,blob:i}}}readFileInChunks(e,t){throw this.unavailable(`Method not implemented.`)}async initDb(){if(this._db!==void 0)return this._db;if(!(`indexedDB`in window))throw this.unavailable(`This browser doesn't support IndexedDB`);return new Promise((e,t)=>{let n=indexedDB.open(this.DB_NAME,this.DB_VERSION);n.onupgradeneeded=r.doUpgrade,n.onsuccess=()=>{this._db=n.result,e(n.result)},n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`db blocked`)}})}static doUpgrade(e){let t=e.target.result;switch(e.oldVersion){default:t.objectStoreNames.contains(`FileStorage`)&&t.deleteObjectStore(`FileStorage`),t.createObjectStore(`FileStorage`,{keyPath:`path`}).createIndex(`by_folder`,`folder`)}}async dbRequest(e,t){let n=this._writeCmds.indexOf(e)===-1?`readonly`:`readwrite`;return this.initDb().then(r=>new Promise((i,a)=>{let o=r.transaction([`FileStorage`],n).objectStore(`FileStorage`)[e](...t);o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)}))}async dbIndexRequest(e,t,n){let r=this._writeCmds.indexOf(t)===-1?`readonly`:`readwrite`;return this.initDb().then(i=>new Promise((a,o)=>{let s=i.transaction([`FileStorage`],r).objectStore(`FileStorage`).index(e)[t](...n);s.onsuccess=()=>a(s.result),s.onerror=()=>o(s.error)}))}getPath(e,t){let n=t===void 0?``:t.replace(/^[/]+|[/]+$/g,``),r=``;return e!==void 0&&(r+=`/`+e),t!==``&&(r+=`/`+n),r}async clear(){(await this.initDb()).transaction([`FileStorage`],`readwrite`).objectStore(`FileStorage`).clear()}async readFile(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0)throw Error(`File does not exist.`);return{data:n.content?n.content:``}}async writeFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=e.recursive,a=await this.dbRequest(`get`,[t]);if(a&&a.type===`directory`)throw Error(`The supplied path is a directory.`);let o=t.substr(0,t.lastIndexOf(`/`));if(await this.dbRequest(`get`,[o])===void 0){let t=o.indexOf(`/`,1);if(t!==-1){let n=o.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:i})}}if(!r&&!(n instanceof Blob)&&(n=n.indexOf(`,`)>=0?n.split(`,`)[1]:n,!this.isBase64String(n)))throw Error(`The supplied data is not valid base64 content.`);let s=Date.now(),c={path:t,folder:o,type:`file`,size:n instanceof Blob?n.size:n.length,ctime:s,mtime:s,content:n};return await this.dbRequest(`put`,[c]),{uri:c.path}}async appendFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=t.substr(0,t.lastIndexOf(`/`)),a=Date.now(),o=a,s=await this.dbRequest(`get`,[t]);if(s&&s.type===`directory`)throw Error(`The supplied path is a directory.`);if(await this.dbRequest(`get`,[i])===void 0){let t=i.indexOf(`/`,1);if(t!==-1){let n=i.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:!0})}}if(!r&&!this.isBase64String(n))throw Error(`The supplied data is not valid base64 content.`);if(s!==void 0){if(s.content instanceof Blob)throw Error(`The occupied entry contains a Blob object which cannot be appended to.`);n=s.content!==void 0&&!r?btoa(atob(s.content)+atob(n)):s.content+n,o=s.ctime}let c={path:t,folder:i,type:`file`,size:n.length,ctime:o,mtime:a,content:n};await this.dbRequest(`put`,[c])}async deleteFile(e){let t=this.getPath(e.directory,e.path);if(await this.dbRequest(`get`,[t])===void 0)throw Error(`File does not exist.`);if((await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)])).length!==0)throw Error(`Folder is not empty.`);await this.dbRequest(`delete`,[t])}async mkdir(e){let t=this.getPath(e.directory,e.path),n=e.recursive,r=t.substr(0,t.lastIndexOf(`/`)),i=(t.match(/\//g)||[]).length,a=await this.dbRequest(`get`,[r]),o=await this.dbRequest(`get`,[t]);if(i===1)throw Error(`Cannot create Root directory`);if(o!==void 0)throw Error(`Current directory does already exist.`);if(!n&&i!==2&&a===void 0)throw Error(`Parent directory must exist`);if(n&&i!==2&&a===void 0){let t=r.substr(r.indexOf(`/`,1));await this.mkdir({path:t,directory:e.directory,recursive:n})}let s=Date.now(),c={path:t,folder:r,type:`directory`,size:0,ctime:s,mtime:s};await this.dbRequest(`put`,[c])}async rmdir(e){let{path:t,directory:n,recursive:r}=e,i=this.getPath(n,t),a=await this.dbRequest(`get`,[i]);if(a===void 0)throw Error(`Folder does not exist.`);if(a.type!==`directory`)throw Error(`Requested path is not a directory`);let o=await this.readdir({path:t,directory:n});if(o.files.length!==0&&!r)throw Error(`Folder is not empty`);for(let e of o.files){let i=`${t}/${e.name}`;(await this.stat({path:i,directory:n})).type===`file`?await this.deleteFile({path:i,directory:n}):await this.rmdir({path:i,directory:n,recursive:r})}await this.dbRequest(`delete`,[i])}async readdir(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(e.path!==``&&n===void 0)throw Error(`Folder does not exist.`);let r=await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)]);return{files:await Promise.all(r.map(async e=>{let n=await this.dbRequest(`get`,[e]);return n===void 0&&(n=await this.dbRequest(`get`,[e+`/`])),{name:e.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}))}}async getUri(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);return n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),{uri:n?.path||t}}async stat(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),n===void 0)throw Error(`Entry does not exist.`);return{name:n.path.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:`granted`}}async checkPermissions(){return{publicStorage:`granted`}}async _copy(e,t=!1){let{toDirectory:r}=e,{to:a,from:o,directory:s}=e;if(!a||!o)throw Error(`Both to and from must be provided`);r||=s;let c=this.getPath(s,o),l=this.getPath(r,a);if(c===l)return{uri:l};if(i(c,l))throw Error(`To path cannot contain the from path`);let u;try{u=await this.stat({path:a,directory:r})}catch{let e=a.split(`/`);e.pop();let t=e.join(`/`);if(e.length>0&&(await this.stat({path:t,directory:r})).type!==`directory`)throw Error(`Parent directory of the to path is a file`)}if(u&&u.type===`directory`)throw Error(`Cannot overwrite a directory with a file`);let d=await this.stat({path:o,directory:s}),f=async(e,t,n)=>{let i=this.getPath(r,e),a=await this.dbRequest(`get`,[i]);a.ctime=t,a.mtime=n,await this.dbRequest(`put`,[a])},p=d.ctime?d.ctime:Date.now();switch(d.type){case`file`:{let e=await this.readFile({path:o,directory:s});t&&await this.deleteFile({path:o,directory:s});let i;!(e.data instanceof Blob)&&!this.isBase64String(e.data)&&(i=n.UTF8);let c=await this.writeFile({path:a,directory:r,data:e.data,encoding:i});return t&&await f(a,p,d.mtime),c}case`directory`:{if(u)throw Error(`Cannot move a directory over an existing object`);try{await this.mkdir({path:a,directory:r,recursive:!1}),t&&await f(a,p,d.mtime)}catch{}let e=(await this.readdir({path:o,directory:s})).files;for(let n of e)await this._copy({from:`${o}/${n.name}`,to:`${a}/${n.name}`,directory:s,toDirectory:r},t);t&&await this.rmdir({path:o,directory:s})}}return{uri:l}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}};a._debug=!0;export{a as FilesystemWeb};
@@ -1 +1 @@
1
- import{n as e}from"./dist-Ztj3rqLK.js";var t=class extends e{constructor(){super(),this._lastWindow=null}async open(e){this._lastWindow=window.open(e.url,e.windowName||`_blank`)}async close(){return new Promise((e,t)=>{this._lastWindow==null?t(`No active window to close!`):(this._lastWindow.close(),this._lastWindow=null,e())})}};new t;export{t as BrowserWeb};
1
+ import{n as e}from"./dist-CNEsSZUe.js";var t=class extends e{constructor(){super(),this._lastWindow=null}async open(e){this._lastWindow=window.open(e.url,e.windowName||`_blank`)}async close(){return new Promise((e,t)=>{this._lastWindow==null?t(`No active window to close!`):(this._lastWindow.close(),this._lastWindow=null,e())})}};new t;export{t as BrowserWeb};
@@ -1 +1 @@
1
- import{n as e}from"./dist-Ztj3rqLK.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
1
+ import{n as e}from"./dist-CNEsSZUe.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
@@ -1 +1 @@
1
- import{n as e}from"./dist-Ztj3rqLK.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
1
+ import{n as e}from"./dist-CNEsSZUe.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
@@ -1 +1 @@
1
- import{t as e}from"./button-D-AX8Voo.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{l as r}from"./local-mode-CgrENuVf.js";import{a as i}from"./routes-C6gxiCrz.js";import{t as a}from"./use-onboarding-login-NYeSGUNo.js";import{rn as o}from"./index-CQhaX_6y.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
1
+ import{t as e}from"./button-D-AX8Voo.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{l as r}from"./local-mode-CgrENuVf.js";import{o as i}from"./routes-CCywyokq.js";import{t as a}from"./use-onboarding-login-DgxS4dsO.js";import{an as o}from"./index-CWzNQ8A_.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-BscuIPxA.js";import"./src-CUycEQpW.js";import{t as a}from"./arrow-left-CP-EhDNF.js";import{n as o,r as s,t as c}from"./metric-card-FIohvQ13.js";import{t as l}from"./ban-BpBuRCKI.js";import{t as u}from"./chevron-right-B6vEpVY0.js";import{t as d}from"./circle-check-DzlJxj_M.js";import{t as f}from"./triangle-alert-C3aHZq1F.js";import{t as p}from"./x-DxL-bCuT.js";import{n as m,r as h,t as g}from"./workflow-status-ByHycBJ_.js";import{t as _}from"./proxy-BgtfAoJj.js";import{t as v}from"./AnimatePresence-uY0BR2n2.js";import{t as y}from"./use-reduced-motion-BG6r0Z46.js";import{Pa as b,at as x,dt as S,ii as C,it as w,mi as T,nt as E,si as D}from"./index-CQhaX_6y.js";import{t as O}from"./status-badge-pill-j3ke1d9o.js";var k=e(t(),1),A=r();function j({onClick:e,ariaLabel:t}){return(0,A.jsxs)(`button`,{type:`button`,"aria-label":t,onClick:e,className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:[(0,A.jsx)(T,{className:`h-3 w-3`,fill:`currentColor`}),(0,A.jsx)(i,{variant:`label-small-default`,children:`Stop`})]})}function M({title:e,body:t,emptyText:n}){return(0,A.jsxs)(`div`,{className:`mb-5`,children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:e}),t?(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:t}):(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]})}function N({leaf:e}){let t=e.status===`running`?`Running…`:`No result summary`;return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(b,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens??0,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens??0,format:e=>o(Math.round(e)),label:`Output`})]}),(0,A.jsx)(M,{title:`Prompt`,body:e.promptSummary,emptyText:`No prompt summary`}),(0,A.jsx)(M,{title:`Result`,body:e.resultSummary,emptyText:t})]})}function P({status:e}){return(0,A.jsx)(O,{color:m(e),label:h(e)})}function F(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:return`var(--system-negative-strong)`;case`cancelled`:return`var(--content-secondary)`;default:return`var(--primary-base)`}}function I(e){switch(e){case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Running`}}function L({status:e}){return(0,A.jsx)(O,{color:F(e),label:I(e)})}function R({status:e}){let t=y(),n=`h-3.5 w-3.5 shrink-0`,r;return r=e===`running`?(0,A.jsx)(S,{className:`shrink-0`,dotSize:4,gap:2}):e===`completed`?(0,A.jsx)(d,{className:n,style:{color:`var(--system-positive-strong)`}}):e===`failed`?(0,A.jsx)(f,{className:n,style:{color:`var(--system-negative-strong)`}}):(0,A.jsx)(l,{className:n,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`}),(0,A.jsx)(v,{mode:`wait`,initial:!1,children:(0,A.jsx)(_.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t?{duration:0}:{duration:.15,ease:[.16,1,.3,1]},className:`flex shrink-0 items-center`,children:r},e)})}function z({runId:e,leaf:t,components:n,onSelect:r}){let a=t.label??`Subagent ${t.seq}`,o=t.promptSummary,s=E(`${e}:${t.seq}`);return(0,A.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Open ${a} details`,className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] px-2 py-1.5 text-left transition-colors hover:bg-[var(--surface-overlay)]`,children:(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(R,{status:t.status}),n?(0,A.jsx)(x,{components:n,bodyShapeId:s.bodyShape,eyeStyleId:s.eyeStyle,colorId:s.color,size:16}):(0,A.jsx)(`div`,{style:{width:16,height:16,flexShrink:0},"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-medium-default`,title:a,className:`max-w-[60%] shrink-0 truncate text-[var(--content-default)]`,children:a}),o&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)] opacity-10`,children:`|`}),(0,A.jsx)(i,{variant:`body-medium-lighter`,title:o,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:o})]})]})})}function B({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let d=g(e.status),f=y(),m=e.label??e.runId,h=e.agentsSpawned||e.leaves.size,v=w(),S=[...e.leaves.values()].sort((e,t)=>e.seq-t.seq),[T,O]=(0,k.useState)(null),[M,F]=(0,k.useState)(e.runId);M!==e.runId&&(F(e.runId),O(null));let I=T==null?void 0:e.leaves.get(T),R=I?E(`${e.runId}:${I.seq}`):void 0,B=(0,k.useCallback)(()=>O(null),[]),V=I?I.label??`Subagent ${I.seq}`:``,H=I?V:m,U=d?`live`:`final`;return(0,k.useEffect)(()=>{l?.(e.runId)},[e.runId,U,l]),(0,A.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[I&&(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:B,title:m,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,children:m})}),(0,A.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,title:V,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:V})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[I&&(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(a,{}),onClick:B,"aria-label":`Back to subagents`,tooltip:`Back`,className:`shrink-0 rounded-lg`}),I?v&&R?(0,A.jsx)(x,{components:v,bodyShapeId:R.bodyShape,eyeStyleId:R.eyeStyle,colorId:R.color,size:32}):(0,A.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}):(0,A.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-[6px] bg-[var(--surface-overlay)]`,children:(0,A.jsx)(C,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,A.jsx)(i,{variant:`title-medium`,title:H,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:H}),I?(0,A.jsx)(L,{status:I.status}):(0,A.jsx)(P,{status:e.status}),(0,A.jsx)(`span`,{className:`flex-1`}),d&&r&&(0,A.jsx)(j,{onClick:()=>r(e.runId),ariaLabel:`Stop workflow`}),(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]}),(0,A.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:(0,A.jsx)(_.div,{initial:{opacity:0},animate:{opacity:1},transition:f?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:I?(0,A.jsx)(N,{leaf:I}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(b,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`}),(0,A.jsx)(c,{icon:(0,A.jsx)(D,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:h,format:e=>o(Math.round(e)),label:`Agents`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Subagents`}),S.length===0?(0,A.jsx)(i,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No subagents yet`}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1`,children:S.map(t=>(0,A.jsx)(z,{runId:e.runId,leaf:t,components:v,onSelect:()=>O(t.seq)},t.seq))})]})]})},I?String(I.seq):`list`)})]})}export{B as WorkflowDetailPanel};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-BscuIPxA.js";import"./src-CUycEQpW.js";import{t as a}from"./arrow-left-CP-EhDNF.js";import{n as o,r as s,t as c}from"./metric-card-DejhOUyM.js";import{t as l}from"./ban-BpBuRCKI.js";import{t as u}from"./chevron-right-B6vEpVY0.js";import{t as d}from"./circle-check-DzlJxj_M.js";import{t as f}from"./triangle-alert-BcZY_IvR.js";import{t as p}from"./x-B0gfyRAR.js";import{n as m,r as h,t as g}from"./workflow-status-BF9EOzZI.js";import{t as _}from"./proxy-BzcB2wP4.js";import{t as v}from"./AnimatePresence-VF_hIZFD.js";import{t as y}from"./use-reduced-motion-BlCAREB8.js";import{Pa as b,gi as x,it as S,li as C,oi as w,ot as T,pt as E,st as D}from"./index-CWzNQ8A_.js";import{t as O}from"./status-badge-pill-CXey_r2B.js";var k=e(t(),1),A=r();function j({onClick:e,ariaLabel:t}){return(0,A.jsxs)(`button`,{type:`button`,"aria-label":t,onClick:e,className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:[(0,A.jsx)(x,{className:`h-3 w-3`,fill:`currentColor`}),(0,A.jsx)(i,{variant:`label-small-default`,children:`Stop`})]})}function M({title:e,body:t,emptyText:n}){return(0,A.jsxs)(`div`,{className:`mb-5`,children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:e}),t?(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:t}):(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]})}function N({leaf:e}){let t=e.status===`running`?`Running…`:`No result summary`;return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(b,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens??0,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens??0,format:e=>o(Math.round(e)),label:`Output`})]}),(0,A.jsx)(M,{title:`Prompt`,body:e.promptSummary,emptyText:`No prompt summary`}),(0,A.jsx)(M,{title:`Result`,body:e.resultSummary,emptyText:t})]})}function P({status:e}){return(0,A.jsx)(O,{color:m(e),label:h(e)})}function F(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:return`var(--system-negative-strong)`;case`cancelled`:return`var(--content-secondary)`;default:return`var(--primary-base)`}}function I(e){switch(e){case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Running`}}function L({status:e}){return(0,A.jsx)(O,{color:F(e),label:I(e)})}function R({status:e}){let t=y(),n=`h-3.5 w-3.5 shrink-0`,r;return r=e===`running`?(0,A.jsx)(E,{className:`shrink-0`,dotSize:4,gap:2}):e===`completed`?(0,A.jsx)(d,{className:n,style:{color:`var(--system-positive-strong)`}}):e===`failed`?(0,A.jsx)(f,{className:n,style:{color:`var(--system-negative-strong)`}}):(0,A.jsx)(l,{className:n,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`}),(0,A.jsx)(v,{mode:`wait`,initial:!1,children:(0,A.jsx)(_.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t?{duration:0}:{duration:.15,ease:[.16,1,.3,1]},className:`flex shrink-0 items-center`,children:r},e)})}function z({runId:e,leaf:t,components:n,onSelect:r}){let a=t.label??`Subagent ${t.seq}`,o=t.promptSummary,s=S(`${e}:${t.seq}`);return(0,A.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Open ${a} details`,className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] px-2 py-1.5 text-left transition-colors hover:bg-[var(--surface-overlay)]`,children:(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(R,{status:t.status}),n?(0,A.jsx)(D,{components:n,bodyShapeId:s.bodyShape,eyeStyleId:s.eyeStyle,colorId:s.color,size:16}):(0,A.jsx)(`div`,{style:{width:16,height:16,flexShrink:0},"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-medium-default`,title:a,className:`max-w-[60%] shrink-0 truncate text-[var(--content-default)]`,children:a}),o&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)] opacity-10`,children:`|`}),(0,A.jsx)(i,{variant:`body-medium-lighter`,title:o,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:o})]})]})})}function B({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let d=g(e.status),f=y(),m=e.label??e.runId,h=e.agentsSpawned||e.leaves.size,v=T(),x=[...e.leaves.values()].sort((e,t)=>e.seq-t.seq),[E,O]=(0,k.useState)(null),[M,F]=(0,k.useState)(e.runId);M!==e.runId&&(F(e.runId),O(null));let I=E==null?void 0:e.leaves.get(E),R=I?S(`${e.runId}:${I.seq}`):void 0,B=(0,k.useCallback)(()=>O(null),[]),V=I?I.label??`Subagent ${I.seq}`:``,H=I?V:m,U=d?`live`:`final`;return(0,k.useEffect)(()=>{l?.(e.runId)},[e.runId,U,l]),(0,A.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[I&&(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:B,title:m,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,children:m})}),(0,A.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,title:V,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:V})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[I&&(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(a,{}),onClick:B,"aria-label":`Back to subagents`,tooltip:`Back`,className:`shrink-0 rounded-lg`}),I?v&&R?(0,A.jsx)(D,{components:v,bodyShapeId:R.bodyShape,eyeStyleId:R.eyeStyle,colorId:R.color,size:32}):(0,A.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}):(0,A.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-[6px] bg-[var(--surface-overlay)]`,children:(0,A.jsx)(w,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,A.jsx)(i,{variant:`title-medium`,title:H,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:H}),I?(0,A.jsx)(L,{status:I.status}):(0,A.jsx)(P,{status:e.status}),(0,A.jsx)(`span`,{className:`flex-1`}),d&&r&&(0,A.jsx)(j,{onClick:()=>r(e.runId),ariaLabel:`Stop workflow`}),(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]}),(0,A.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:(0,A.jsx)(_.div,{initial:{opacity:0},animate:{opacity:1},transition:f?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:I?(0,A.jsx)(N,{leaf:I}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(b,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`}),(0,A.jsx)(c,{icon:(0,A.jsx)(C,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:h,format:e=>o(Math.round(e)),label:`Agents`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Subagents`}),x.length===0?(0,A.jsx)(i,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No subagents yet`}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1`,children:x.map(t=>(0,A.jsx)(z,{runId:e.runId,leaf:t,components:v,onSelect:()=>O(t.seq)},t.seq))})]})]})},I?String(I.seq):`list`)})]})}export{B as WorkflowDetailPanel};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./queryOptions-BtNi-_9H.js";import{n as l,t as u}from"./panel-item-Q1g7DFJw.js";import{t as d}from"./menu-BLJEjTFD.js";import{c as f}from"./src-CUycEQpW.js";import{t as p}from"./confirm-dialog-bfBx6UYv.js";import{t as m}from"./input-D4W4p0pZ.js";import{t as h}from"./modal-BNAVT2FK.js";import{t as g}from"./createLucideIcon-BlMXrA59.js";import{t as _}from"./chevron-right-B6vEpVY0.js";import{t as v}from"./file-text-D4wmdFsJ.js";import{t as y}from"./loader-circle-BITX1qOw.js";import{t as b}from"./pencil-CtYlsDsm.js";import{t as x}from"./plus-CzwTg9D8.js";import{t as S}from"./x-B0gfyRAR.js";import{Cr as C,Sr as w,_r as T,br as E,vr as D,xr as O,yr as k}from"./sdk.gen-B3Z8klU-.js";import{n as A}from"./use-is-mobile-Cqknxs2C.js";import{n as j}from"./native-file-swemzdL9.js";import{$i as M,B as N,Oa as P,aa as F,ca as ee,ci as I,da as L,fi as R,ia as z,ra as B,sa as te,wi as ne,z as V}from"./index-CWzNQ8A_.js";import{t as H}from"./use-active-assistant-id-iCLBbJXU.js";import{n as U,t as W}from"./mobile-sidebar-drawer-DwE65WjT.js";import{i as G,n as re,r as K,t as q}from"./file-editor-PNZ9cTI-.js";import{t as J}from"./format-file-size-D7iZejgy.js";var ie=g(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),ae=g(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),oe=g(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Y=g(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),X=e(t(),1);async function se(e){let{data:t,error:n}=await D({path:{assistant_id:e.assistantId},query:{path:e.path,...e.showHidden?{showHidden:`true`}:{}},parseAs:`blob`,throwOnError:!1});if(n||!(t instanceof Blob))throw Error(`Failed to download file`);await j(t,e.filename)}function ce(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function le(e,t){return ce(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function ue(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function Z(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Q=s();function de(e){return c({queryFn:async()=>{let{data:t,error:n}=await k({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function fe({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=v;return n.startsWith(`image/`)?r=M:n.startsWith(`video/`)?r=I:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=z),(0,Q.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Q.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function pe({viewMode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Q.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function $({name:e,mimeType:t,size:n,rightContent:r}){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(fe,{mimeType:t}),(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:J(n)})]}),r]})}function me({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await D({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,X.useState)(null);return(0,X.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function he({assistantId:e,path:t,name:r,mimeType:i,size:a,modifiedAt:o,showHidden:s}){let[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(!1),f=(0,X.useCallback)(async()=>{d(!1),l(!0);try{await se({assistantId:e,path:t,filename:r,showHidden:s})}catch{d(!0)}finally{l(!1)}},[e,t,r,s]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:r,mimeType:i,size:a}),(0,Q.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Q.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Q.jsx)(z,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Q.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:r}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:i}),(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:J(a,`Unknown size`)}),o&&(0,Q.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(o).toLocaleString()]})]}),(0,Q.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:c?(0,Q.jsx)(y,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(L,{"aria-hidden":!0}),onClick:f,disabled:c,"aria-label":`Download ${r}`,className:`mt-4`,children:c?`Downloading…`:`Download`}),u&&(0,Q.jsx)(`p`,{className:`mt-2 text-body-small-default`,style:{color:`var(--system-error)`},children:`Download failed. Try again.`})]})})]})}function ge({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...de({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(null);(0,X.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),v(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,X.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),v(e=>e!=null&&t(e.path)?null:e)},[d]);let b=h!=null&&h===t,x=p?.content??``,S=_?.path===t?_.content:x,w=()=>{g(null),v(null)},T=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await C({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),v(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=S!==x,D=(0,X.useCallback)(()=>{t&&E&&!T.isPending&&T.mutate({path:t,content:S})},[t,E,T,S]);if(!t)return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Q.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Q.jsx)(oe,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,k=p.name??t.split(`/`).pop()??t,A=N(k,O),j=le(k,O),M=p.content!=null&&!A&&!j,P=t?Z(t):!0,F=b&&(0,Q.jsx)(re,{isDirty:E,isSaving:T.isPending,error:T.isError?`Save failed`:null,onSave:D,onDiscard:w});if(A&&p.content!=null){let e=b?S:p.content;return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,rightContent:(0,Q.jsx)(pe,{viewMode:s,onChange:e=>{b&&w(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(q,{content:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?w():g(t)}),s===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Q.jsx)(V,{content:e})}):b?(0,Q.jsx)(K,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(G,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}if(j&&p.content!=null){let e=b?S:p.content,n=ue(e);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,rightContent:(0,Q.jsx)(pe,{viewMode:s,onChange:e=>{b&&w(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(q,{content:s===`preview`?n:e,downloadContent:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?w():g(t)}),s===`preview`?(0,Q.jsx)(G,{content:n,readOnly:!0,whiteSpace:`pre`}):b?(0,Q.jsx)(K,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(G,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}return M?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,size:p.size}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(q,{content:b?S:p.content??``,fileName:k,mimeType:O,showEdit:!P,isEditing:b,onToggleEdit:()=>b?w():g(t)}),b?(0,Q.jsx)(K,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(G,{content:p.content??``,readOnly:P,onStartEdit:()=>g(t)})]}),F]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,size:p.size}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Q.jsx)(me,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Q.jsx)(he,{assistantId:e,path:t,name:k,mimeType:O,size:p.size,modifiedAt:p.modifiedAt,showHidden:r})}function _e(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function ve(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await w({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function ye(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await w({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function be({entry:e}){return e.type===`directory`?(0,Q.jsx)(B,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Q.jsx)(M,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Q.jsx)(I,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(v,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function xe({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:u,onRequestRename:d,onRequestCreate:p,depth:m}){let h=e.path??``,g=e.name??``,v=e.type===`directory`,y=n.has(h),x=r===h,S=g.startsWith(`.`),C=!Z(h),w=v&&(y||s.length>0),{data:T}=a({...ve({path:{assistant_id:t},query:{path:h,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&w}),E=(0,X.useMemo)(()=>_e(T?.entries??[],o),[T?.entries,o]),D=s===``||g.toLowerCase().includes(s);if(s!==``&&!v&&!D)return null;let O=(0,Q.jsxs)(`button`,{onClick:()=>{v?c(h):l(h)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${m*14+8}px`,paddingRight:`8px`,color:x?`var(--content-default)`:S?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:x?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:S&&!x?.7:1},children:[v?w?(0,Q.jsx)(P,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(_,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Q.jsx)(be,{entry:e}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g}),e.size!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:J(e.size)})]});return(0,Q.jsxs)(`div`,{children:[C?(0,Q.jsxs)(f.Root,{children:[(0,Q.jsx)(f.Trigger,{children:O}),(0,Q.jsxs)(f.Content,{children:[v&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(F,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`file`,parentPath:h}),children:`New File`}),(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(Y,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`folder`,parentPath:h}),children:`New Folder`}),(0,Q.jsx)(f.Separator,{})]}),(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(R,{className:`h-3.5 w-3.5`}),onSelect:()=>u({path:h,name:g,isDirectory:v}),children:`Delete`}),(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(b,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:h,name:g,isDirectory:v}),children:`Rename`})]})]}):O,v&&w&&E.length>0&&(0,Q.jsx)(`div`,{children:E.map(e=>(0,Q.jsx)(xe,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:u,onRequestRename:d,onRequestCreate:p,depth:m+1},e.path))})]})}function Se({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,X.useRef)(null),[d,f]=(0,X.useState)(a??``),p=d.trim(),g=p.length>0&&(/[/\\]/.test(p)||p===`.`||p===`..`),_=p.length>0&&!g&&!c;return(0,Q.jsx)(h.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Q.jsx)(h.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_&&s(p)},children:[(0,Q.jsx)(h.Header,{children:(0,Q.jsx)(h.Title,{children:e})}),(0,Q.jsx)(h.Body,{children:(0,Q.jsx)(m,{ref:u,label:`Name`,value:d,onChange:e=>f(e.target.value),placeholder:t,errorText:l??(g?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Q.jsxs)(h.Footer,{children:[(0,Q.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Q.jsx)(n,{type:`submit`,variant:`primary`,disabled:!_,children:c?i:r})]})]})})})}function Ce({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:d,onToggleShowHidden:f,onChangeSortMode:h,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,b]=(0,X.useState)(``),x=y.trim().toLowerCase(),[w,D]=(0,X.useState)(!1),[k,A]=(0,X.useState)(null),[j,M]=(0,X.useState)(null),N=(0,X.useCallback)(()=>{A(null),M(null)},[]),{data:P,isLoading:F}=a(ve({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),I=(0,X.useMemo)(()=>_e(P?.entries??[],c),[P?.entries,c]),L=(0,X.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),R=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await ye(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await C({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await E({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw Error(typeof r==`string`?r:`Failed to create — check the name and try again.`);return{...t,path:n}},onSuccess:e=>{N(),L(),e.parentPath&&u(e.parentPath),e.kind===`file`?d(e.path):u(e.path)},onError:e=>{M(e instanceof Error?e.message:`Failed to create.`)}}),z=o({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await ye(e,r,t.newName,i);let{error:o,response:s}=await O({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!s?.ok)throw Error(typeof o==`string`?o:`Failed to rename — check the name and try again.`);return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{N(),L(),_(e,t)},onError:e=>{M(e instanceof Error?e.message:`Failed to rename.`)}}),B=(0,X.useCallback)(e=>{M(null),A({type:`create`,...e})},[]),V=(0,X.useCallback)(e=>{M(null),A({type:`rename`,path:e.path,name:e.name})},[]),[H,U]=(0,X.useState)(null),W=o({mutationFn:async t=>{let{error:n,response:r}=await T({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{U(null),L(),g(e.path)}}),G=(0,X.useCallback)(e=>{W.reset(),U(e)},[W]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Q.jsx)(ae,{"aria-hidden":!0}):(0,Q.jsx)(ie,{"aria-hidden":!0}),onClick:()=>h(c===`size`?`name`:`size`),"aria-label":c===`size`?`Sort by name`:`Sort by size`,title:c===`size`?`Sorted by size — switch to name`:`Sorted by name — switch to size`,tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Q.jsx)(te,{"aria-hidden":!0}):(0,Q.jsx)(ee,{"aria-hidden":!0}),onClick:f,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(we,{open:w,onOpenChange:D,onSelectKind:e=>{D(!1),B({kind:e,parentPath:``})}})]})]}),(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(m,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`Search files`,leftIcon:(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(S,{"aria-hidden":!0}),onClick:()=>b(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:F?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):I.length?I.map(n=>(0,Q.jsx)(xe,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:x,onToggleExpand:l,onSelectPath:d,onRequestDelete:G,onRequestRename:V,onRequestCreate:B,depth:0},n.path)):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),k?.type===`create`&&(0,Q.jsx)(Se,{title:k.kind===`file`?`New File`:`New Folder`,placeholder:k.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:N,onConfirm:e=>{M(null),R.mutate({kind:k.kind,parentPath:k.parentPath,name:e})},pending:R.isPending,error:j},`create-${k.kind}-${k.parentPath}`),k?.type===`rename`&&(0,Q.jsx)(Se,{title:`Rename`,placeholder:k.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:k.name,onCancel:N,onConfirm:e=>{if(e===k.name){N();return}M(null),z.mutate({oldPath:k.path,newName:e})},pending:z.isPending,error:j},`rename-${k.path}`),(0,Q.jsx)(p,{open:H!==null,title:H?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Q.jsx)(`span`,{style:{color:`var(--content-default)`},children:H?.name}),H?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,W.error&&(0,Q.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:W.error.message})]}),confirmLabel:W.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:W.isPending,onConfirm:()=>{H&&W.mutate(H)},onCancel:()=>U(null)})]})}function we({open:e,onOpenChange:t,onSelectKind:r}){return A()?(0,Q.jsxs)(l.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(l.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(x,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(l.Content,{children:[(0,Q.jsx)(l.Header,{className:`sr-only`,children:(0,Q.jsx)(l.Title,{children:`Create new`})}),(0,Q.jsxs)(l.Body,{className:`pt-0`,children:[(0,Q.jsx)(u,{icon:F,label:`New File`,onSelect:()=>r(`file`)}),(0,Q.jsx)(u,{icon:Y,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Q.jsxs)(d.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(d.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(x,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(d.Content,{align:`end`,sideOffset:4,children:[(0,Q.jsx)(d.Item,{leftIcon:(0,Q.jsx)(F,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Q.jsx)(d.Item,{leftIcon:(0,Q.jsx)(Y,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function Te(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Ee({assistantId:e}){let[t,n]=r(),[i,a]=(0,X.useState)(()=>{let e=t.get(`file`);return e?Te(e):new Set}),[o,s]=(0,X.useState)(()=>t.get(`file`)),[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,X.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,X.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,X.useState)(!1),v=(0,X.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,X.useState)(null),x=(0,X.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,X.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,X.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Q.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Q.jsx)(U,{onClick:()=>_(!0)})}),(0,Q.jsx)(W,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Q.jsx)(Ce,{...w})}),(0,Q.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Q.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(Ce,{...w})}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(ge,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function De(){return(0,Q.jsx)(Ee,{assistantId:H()})}export{De as WorkspacePage};