@vellumai/web 0.12.6-staging.1 → 0.12.6-staging.3

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 (217) hide show
  1. package/dist/assets/{a2a-invite-DvNtJAR3.js → a2a-invite-BfDyIsBX.js} +1 -1
  2. package/dist/assets/{about-page-C1cvW4yO.js → about-page-BigOjgfp.js} +1 -1
  3. package/dist/assets/{account-page-Bgjf5RI6.js → account-page-DbP0iNWg.js} +1 -1
  4. package/dist/assets/{account-shell-DRn4zar4.js → account-shell-CkJWoTHP.js} +1 -1
  5. package/dist/assets/{acp-run-detail-panel-BrqZK5yq.js → acp-run-detail-panel-DNMcOAkY.js} +1 -1
  6. package/dist/assets/{activation-list-route-BSzFk01N.js → activation-list-route-BbPqJODX.js} +1 -1
  7. package/dist/assets/{activity-redirect-page-C9vyj4s3.js → activity-redirect-page-CTGWJZqK.js} +1 -1
  8. package/dist/assets/{activity-steps-panel-UE22AUHt.js → activity-steps-panel-Dz34WmYH.js} +1 -1
  9. package/dist/assets/add-credits-modal-BtnHnN8V.js +1 -0
  10. package/dist/assets/{add-credits-modal-BJdNKyZn.js → add-credits-modal-DRBFth5G.js} +1 -1
  11. package/dist/assets/{ai-page-BRcEoO4h.js → ai-page-beQly0My.js} +1 -1
  12. package/dist/assets/{all-chats-page-route-Cdywc2Lw.js → all-chats-page-route-DlZUO9J_.js} +1 -1
  13. package/dist/assets/{android-billing-handoff-DHmIdr3k.js → android-billing-handoff-CRfjXp7l.js} +1 -1
  14. package/dist/assets/{animated-stat-square-De3doWUf.js → animated-stat-square-B-JargN6.js} +1 -1
  15. package/dist/assets/{api-key-screen-D46IlNCg.js → api-key-screen-jvDwbC50.js} +1 -1
  16. package/dist/assets/{app-CnOToYzw.css → app-CgzFhQCl.css} +1 -1
  17. package/dist/assets/{app-4aEhon_S.js → app-DbJUeBix.js} +17 -17
  18. package/dist/assets/{app-info-BEZIXj2r.js → app-info-VAqkCXW3.js} +1 -1
  19. package/dist/assets/{archive-redirect-page-f-tQTBcO.js → archive-redirect-page-DZMdx89H.js} +1 -1
  20. package/dist/assets/{assistant-handle-modal-D2Fs4sCC.js → assistant-handle-modal-C2RftL0v.js} +1 -1
  21. package/dist/assets/assistant-inbox-page-route-DLSz1vYi.js +8 -0
  22. package/dist/assets/{assistant-status-panel-DHEoS1o_.js → assistant-status-panel-BJpCnYoq.js} +1 -1
  23. package/dist/assets/auth-store-Cd-d1a4K.js +1 -0
  24. package/dist/assets/{auth-welcome-screen-BGeyvWeV.js → auth-welcome-screen-Bng5AnvV.js} +1 -1
  25. package/dist/assets/avatar-bundled-components-DqGPWIMe.js +1 -0
  26. package/dist/assets/{avatar-random-D2smfcQG.js → avatar-random-CVuabfEZ.js} +2 -2
  27. package/dist/assets/{await-org-header-settled-DLSu8FLl.js → await-org-header-settled-P4ncwaMI.js} +1 -1
  28. package/dist/assets/{background-task-detail-panel-BZGjlvvR.js → background-task-detail-panel-BcllAg3N.js} +1 -1
  29. package/dist/assets/{billing-page-CEL1j7Pd.js → billing-page-D54LLGz1.js} +3 -3
  30. package/dist/assets/{billing-redirect-page-D0rxZiKb.js → billing-redirect-page-DBSdrzJ7.js} +1 -1
  31. package/dist/assets/{bookmarks-page-3DBCCW9Z.js → bookmarks-page-BQyOw7IR.js} +1 -1
  32. package/dist/assets/{bundle-confirm-page-DqZwqwSV.js → bundle-confirm-page-BE0p_xZi.js} +1 -1
  33. package/dist/assets/{channel-transcript-panel-CFWSmMFa.js → channel-transcript-panel-BdL4iejZ.js} +1 -1
  34. package/dist/assets/{channels-Bj0jbmsg.js → channels--GWixc4A.js} +3 -3
  35. package/dist/assets/{channels-CrHSbYG5.js → channels-BJA5o10X.js} +3 -3
  36. package/dist/assets/{channels-B-C6ns2I.js → channels-BWlMRtuu.js} +3 -3
  37. package/dist/assets/{channels-DS5qwHtC.js → channels-BchiOW8d.js} +3 -3
  38. package/dist/assets/{channels-page-route-nwdK8POV.js → channels-page-route-BseMMdHV.js} +1 -1
  39. package/dist/assets/{chat-info-panel-4xiBaedR.js → chat-info-panel-C6px8Mlo.js} +1 -1
  40. package/dist/assets/{checkout-continuation-DiZjXso_.js → checkout-continuation-BniC3jRe.js} +1 -1
  41. package/dist/assets/{checkout-page-CpXe7B0Y.js → checkout-page-_P1Km-Pk.js} +1 -1
  42. package/dist/assets/checkout-return-target-B3XAFuN6.js +1 -0
  43. package/dist/assets/{command-palette-BwJ1qkwj.js → command-palette-BMTSC06x.js} +1 -1
  44. package/dist/assets/command-palette-BgqisOfz.js +1 -0
  45. package/dist/assets/{command-palette-window-page-s0d4qct2.js → command-palette-window-page-BlD7b2cA.js} +1 -1
  46. package/dist/assets/{community-page-BxJhxO_B.js → community-page-dezChmB7.js} +1 -1
  47. package/dist/assets/{companion-accent-IfLn8Bat.js → companion-accent-C8bpme2H.js} +1 -1
  48. package/dist/assets/{companion-dock-zones-page-BZ_Xjx9t.js → companion-dock-zones-page-B4iVErZw.js} +1 -1
  49. package/dist/assets/{companion-layout-B32ZeRsg.js → companion-layout-DdDcoKuc.js} +1 -1
  50. package/dist/assets/{companion-popover-DJZq3u_E.js → companion-popover-BYFhyUGI.js} +1 -1
  51. package/dist/assets/{companion-popover-page-BUuymP2G.js → companion-popover-page-CvizjjZk.js} +1 -1
  52. package/dist/assets/{companion-surface-BiEC15j-.js → companion-surface-CjiszIMu.js} +1 -1
  53. package/dist/assets/{companion-surface-page-1aPG3-pV.js → companion-surface-page-BIpW__dy.js} +1 -1
  54. package/dist/assets/{companion-tour-entry-CT1inXph.js → companion-tour-entry-2hR1vArn.js} +1 -1
  55. package/dist/assets/{companion-watch-frame-page-CccglwW8.js → companion-watch-frame-page-LUmlRewI.js} +1 -1
  56. package/dist/assets/{connect-page-CU5kFWwu.js → connect-page-uRvPpjMP.js} +1 -1
  57. package/dist/assets/{consent-controls-BU14rUBI.js → consent-controls-DZEtlgAi.js} +1 -1
  58. package/dist/assets/{contacts-gateway-lKGtK3Rt.js → contacts-gateway-DI64mVLV.js} +1 -1
  59. package/dist/assets/{contacts-page-route-Dsl49Gyj.js → contacts-page-route-C_UApZGi.js} +1 -1
  60. package/dist/assets/{copy-button-DTTBuV2S.js → copy-button-ZsDy0Kvk.js} +1 -1
  61. package/dist/assets/{credential-entry-page-Bcru96sp.js → credential-entry-page-BeKm3_yM.js} +1 -1
  62. package/dist/assets/{credentials-page-vIwKR2Br.js → credentials-page-CLjmeZw3.js} +1 -1
  63. package/dist/assets/{csv-preview-DC4egHwn.js → csv-preview-C2fmutVQ.js} +1 -1
  64. package/dist/assets/{danger-zone-redirect-page-R5BXWtEi.js → danger-zone-redirect-page-D5Xk_8UY.js} +1 -1
  65. package/dist/assets/{debug-page-BZtacr2-.js → debug-page-tQ4hqmdO.js} +1 -1
  66. package/dist/assets/deploy-dialogs-BW3wFOZ-.js +1 -0
  67. package/dist/assets/{deploy-dialogs-B3_x3fxQ.js → deploy-dialogs-Hu5UmFuB.js} +1 -1
  68. package/dist/assets/{desktop-preview-content-CKM5RXGD.js → desktop-preview-content-CoZvaRAg.js} +2 -2
  69. package/dist/assets/{desktop-status-DvjcbwTJ.js → desktop-status-ZiDkY3z1.js} +1 -1
  70. package/dist/assets/{desktop-viewer-BMPa6Aex.js → desktop-viewer-zD3tun-C.js} +1 -1
  71. package/dist/assets/{detail-card-Dmas0G3E.js → detail-card-WMdjzPA_.js} +1 -1
  72. package/dist/assets/{detail-panel-stop-button-DkHGogvW.js → detail-panel-stop-button-CPVsXUuy.js} +1 -1
  73. package/dist/assets/{detail-primitives-DMIwvBhc.js → detail-primitives-CAZf545a.js} +1 -1
  74. package/dist/assets/{developer-page-B6e5nSkG.js → developer-page-DpSngWHa.js} +1 -1
  75. package/dist/assets/{devices-redirect-page-mofL9eFw.js → devices-redirect-page-BUydOv62.js} +1 -1
  76. package/dist/assets/{dictation-overlay-page-CwDjZbE1.js → dictation-overlay-page-Cs5bufLA.js} +1 -1
  77. package/dist/assets/{document-load-DoRmIVja.js → document-load-CXdi-UrD.js} +1 -1
  78. package/dist/assets/document-load-Dyyzd-te.js +1 -0
  79. package/dist/assets/{document-viewer-page-CQUX0aEC.js → document-viewer-page-R3nFa-RR.js} +1 -1
  80. package/dist/assets/{emails-page-DwAhlaQg.js → emails-page-BUZyXttB.js} +1 -1
  81. package/dist/assets/{file-diff-view-BezobneE.js → file-diff-view-5WOLjbDI.js} +1 -1
  82. package/dist/assets/{file-view-mode-jU2cqUIy.js → file-view-mode-D6Wxo-FH.js} +1 -1
  83. package/dist/assets/{general-page-doMlZdWO.js → general-page-BgczK5kM.js} +1 -1
  84. package/dist/assets/{hatching-screen-D5uYMUSk.js → hatching-screen-DUME_h4W.js} +1 -1
  85. package/dist/assets/{hosting-screen-N04Vxm7m.js → hosting-screen-CQosTH53.js} +1 -1
  86. package/dist/assets/{identity-page-route-DYaWHWV4.js → identity-page-route-CnUbEnOj.js} +1 -1
  87. package/dist/assets/{inspect-page-Day-dKxu.js → inspect-page-B4pwuqL9.js} +3 -3
  88. package/dist/assets/{integrations-page-BepnHU85.js → integrations-page-DfV4AIUY.js} +1 -1
  89. package/dist/assets/{intelligence-layout-8z9eS22i.js → intelligence-layout-CAtJ8qJB.js} +1 -1
  90. package/dist/assets/{intelligence-layout-slots-store-J-MoKCmF.js → intelligence-layout-slots-store-DSIw2NvD.js} +1 -1
  91. package/dist/assets/{keyboard-shortcuts-redirect-page-CtGxfm3n.js → keyboard-shortcuts-redirect-page-eiKQBBin.js} +1 -1
  92. package/dist/assets/{latest-assistant-text-Chtu1E3p.js → latest-assistant-text-CU1nEv57.js} +1 -1
  93. package/dist/assets/{library-detail-page-BU3HVzyr.js → library-detail-page-D5TQdRPW.js} +1 -1
  94. package/dist/assets/{library-page-Co-CAon1.js → library-page-CQHRf1us.js} +1 -1
  95. package/dist/assets/local-mode-glOMwWKw.js +1 -0
  96. package/dist/assets/{login-page-bUkrHHVA.js → login-page-nEJ8VtCM.js} +1 -1
  97. package/dist/assets/{logout-page-D2ibyaux.js → logout-page-CRexidth.js} +1 -1
  98. package/dist/assets/{logs-layout-DpQF78Kt.js → logs-layout-C1WQAyKd.js} +1 -1
  99. package/dist/assets/{markdown-preview-CId4qJWy.js → markdown-preview-FMAKqNG5.js} +1 -1
  100. package/dist/assets/{media-preview-C1XFdtRz.js → media-preview-DxyJX5PI.js} +1 -1
  101. package/dist/assets/{memory-page-route--WvX90Lh.js → memory-page-route-Bt8cmhxi.js} +1 -1
  102. package/dist/assets/{memory-router-playground-page-BX6jtqI2.js → memory-router-playground-page-B5SPYr3X.js} +1 -1
  103. package/dist/assets/{message-files-panel-BWQX_2Z_.js → message-files-panel-DM2OHYKS.js} +1 -1
  104. package/dist/assets/mutation-error-DsmwzTdH.js +1 -0
  105. package/dist/assets/native-attachment-pickers-Caaw_YOU.js +1 -0
  106. package/dist/assets/native-file-DICtaDdr.js +1 -0
  107. package/dist/assets/{notifications-page-CgWLXf5V.js → notifications-page-DRBXLm8k.js} +1 -1
  108. package/dist/assets/{oauth-complete-page-DZlImmvw.js → oauth-complete-page-DgpDdc3q.js} +1 -1
  109. package/dist/assets/{oauth-popup-complete-page-C1Dc5fk0.js → oauth-popup-complete-page-v6Kq8SKs.js} +1 -1
  110. package/dist/assets/paired-platform-identity-u4Q-YPGw.js +1 -0
  111. package/dist/assets/{pairing-page-Dhcr9SjD.js → pairing-page-Oj52Prdb.js} +1 -1
  112. package/dist/assets/password-reset-page-D3ksp7Ej.js +1 -0
  113. package/dist/assets/{pdf-file-preview-D_ClglAA.js → pdf-file-preview-BhDsUdwQ.js} +1 -1
  114. package/dist/assets/{permission-guide-page-DHZIzkOy.js → permission-guide-page-C72w2Kmj.js} +1 -1
  115. package/dist/assets/{permission-setup-Dmd2zFPe.js → permission-setup-CJJV_COn.js} +1 -1
  116. package/dist/assets/{personality-page-BhAHEnK3.js → personality-page-CvTaj6nv.js} +1 -1
  117. package/dist/assets/{personality-page-CE8DlY9y.js → personality-page-smzeVdLh.js} +1 -1
  118. package/dist/assets/{personality-sliders-pVdEr3Fn.js → personality-sliders-B9dseUZv.js} +1 -1
  119. package/dist/assets/{plans-page-CkIK_N4U.js → plans-page-CdJnxa9Q.js} +1 -1
  120. package/dist/assets/{platform-loopback-page-C0s9CAsp.js → platform-loopback-page-BmFqgelr.js} +1 -1
  121. package/dist/assets/{plugin-detail-page-C9zJ32IV.js → plugin-detail-page-CFGniBM4.js} +1 -1
  122. package/dist/assets/{plugins-page-Cf_vJwd8.js → plugins-page-BuHZ0XlZ.js} +1 -1
  123. package/dist/assets/plugins-surface-CYlZGgus.js +1 -0
  124. package/dist/assets/{preview-error-Cxcn_uOl.js → preview-error-DycCFOOO.js} +1 -1
  125. package/dist/assets/{privacy-page-v0Bl1gUD.js → privacy-page-BTNM3CXN.js} +1 -1
  126. package/dist/assets/{privacy-screen-DZWucyGJ.js → privacy-screen-BNyV1Jpv.js} +1 -1
  127. package/dist/assets/{profile-card-jvtX_IRJ.js → profile-card-CCv7LkYu.js} +1 -1
  128. package/dist/assets/{provider-callback-page-DadzY3GT.js → provider-callback-page-BiI5YuU7.js} +1 -1
  129. package/dist/assets/{provider-key-DUY2mZm5.js → provider-key-mKVB6Qhq.js} +1 -1
  130. package/dist/assets/{provider-signup-page-BMjPqmWY.js → provider-signup-page-Dj_CGQAF.js} +1 -1
  131. package/dist/assets/{quick-input-page-CSBA98SR.js → quick-input-page-jYydiJfm.js} +1 -1
  132. package/dist/assets/referral-modal-CfWPpnvV.js +1 -0
  133. package/dist/assets/{referral-modal-0EhqMTDP.js → referral-modal-DgZAlouF.js} +1 -1
  134. package/dist/assets/{research-mock-page-pdYsSAXo.js → research-mock-page-CDpXk7ca.js} +1 -1
  135. package/dist/assets/{research-onboarding-route-DQDC7A-X.js → research-onboarding-route-Se5ksePw.js} +1 -1
  136. package/dist/assets/{review-terms-screen-D9ZsDaFc.js → review-terms-screen-Cy9FX3yC.js} +1 -1
  137. package/dist/assets/routes-Df2libs9.js +1 -0
  138. package/dist/assets/{schedules-page-DzosmuUG.js → schedules-page-O2ueZz6n.js} +1 -1
  139. package/dist/assets/{schedules-BZK7XLW4.js → schedules-rvMiqGp0.js} +1 -1
  140. package/dist/assets/{security-redirect-page-BfEf2yb3.js → security-redirect-page-B00kAvrV.js} +1 -1
  141. package/dist/assets/{select-assistant-screen-ByEWxket.js → select-assistant-screen-GuXyFlAh.js} +1 -1
  142. package/dist/assets/{self-hosted-servers-BnexEHid.js → self-hosted-servers-B-57ZNA3.js} +1 -1
  143. package/dist/assets/{service-form-controls-L7ipWS7W.js → service-form-controls-DZJcQaNO.js} +1 -1
  144. package/dist/assets/{setting-row-CqsRGW0M.js → setting-row-BuBlxds2.js} +1 -1
  145. package/dist/assets/{settings-layout-dtUgeZGT.js → settings-layout-B_sC3oOX.js} +1 -1
  146. package/dist/assets/{share-feedback-modal-CICNVpZG.js → share-feedback-modal-Dg6x94HR.js} +1 -1
  147. package/dist/assets/share-feedback-modal-n7ZgtNxB.js +1 -0
  148. package/dist/assets/{sidebar-tree-CVlGLFk1.js → sidebar-tree-BLMAqL8a.js} +1 -1
  149. package/dist/assets/{signup-page-BawjjAk9.js → signup-page-CF6CvKYm.js} +1 -1
  150. package/dist/assets/{signup-shell-C4zWZKlP.js → signup-shell-BUn2lHTO.js} +1 -1
  151. package/dist/assets/{skill-detail-page-BR1VzP5J.js → skill-detail-page-B7oLoGRE.js} +1 -1
  152. package/dist/assets/{skill-detail-panel-Ch4YwxDI.js → skill-detail-panel-BgTf3-Jj.js} +1 -1
  153. package/dist/assets/{skill-removal-dialog-ph42N7Fl.js → skill-removal-dialog-DwT8ZoB9.js} +1 -1
  154. package/dist/assets/{skills-page-B54_bM3G.js → skills-page-hxGLH0Yi.js} +1 -1
  155. package/dist/assets/{sounds-page-B5dZjlPM.js → sounds-page-C1u9YUVJ.js} +1 -1
  156. package/dist/assets/{start-screen-c_PymAl2.js → start-screen-DfzPyvUq.js} +1 -1
  157. package/dist/assets/{step-detail-header-ygmZC0KS.js → step-detail-header-CdUCWAlu.js} +1 -1
  158. package/dist/assets/{stt-language-picker-modal-CMFxMa9N.js → stt-language-picker-modal-0IKnLGpu.js} +1 -1
  159. package/dist/assets/{subagent-detail-panel-BS4IYvJn.js → subagent-detail-panel-CtkJH9-r.js} +1 -1
  160. package/dist/assets/{superpowers-page-DKB6-Ybz.js → superpowers-page-C0V-BVj9.js} +1 -1
  161. package/dist/assets/{system-events-page-B44LpDTv.js → system-events-page-B13dkMsH.js} +1 -1
  162. package/dist/assets/{system-events-redirect-page-C62wCy1z.js → system-events-redirect-page-ayoYsUNU.js} +1 -1
  163. package/dist/assets/{tabular-grid-D5w2zPZ2.js → tabular-grid-DkyI1XY2.js} +1 -1
  164. package/dist/assets/{teleport-gateway-client-B8BG_rTx.js → teleport-gateway-client-C3wmILxC.js} +1 -1
  165. package/dist/assets/{text-preview-Ofuqm3k1.js → text-preview-BGQO4VRv.js} +1 -1
  166. package/dist/assets/{theme-stage-page--f110ocQ.js → theme-stage-page-9l6G0GQD.js} +1 -1
  167. package/dist/assets/{tiptap-document-editor-hK0z9JkB.js → tiptap-document-editor-6J6u0gMB.js} +1 -1
  168. package/dist/assets/tool-detail-panel-B267q93W.js +1 -0
  169. package/dist/assets/{tool-detail-panel-B58LHS7C.js → tool-detail-panel-D29OCtjo.js} +1 -1
  170. package/dist/assets/{trait-cycle-row-Bn8sB1ll.js → trait-cycle-row-C76P92r3.js} +1 -1
  171. package/dist/assets/{upgrade-cancel-page-YlN6tF2j.js → upgrade-cancel-page-CsIYnmSq.js} +1 -1
  172. package/dist/assets/{upgrade-success-page-B1qO-4bt.js → upgrade-success-page-Ba_xpT9b.js} +1 -1
  173. package/dist/assets/{usage-redirect-page-B_r-Rjza.js → usage-redirect-page-C7pPUdxP.js} +1 -1
  174. package/dist/assets/{use-app-delete-C3OP3RL_.js → use-app-delete-2je5dBpX.js} +1 -1
  175. package/dist/assets/{use-assistant-identity-details-CgpWYPrD.js → use-assistant-identity-details-S74x7sbE.js} +1 -1
  176. package/dist/assets/use-channel-trust-floors-fBDQnvgz.js +1 -0
  177. package/dist/assets/{use-checkout-dismiss-refresh-CxHKmnto.js → use-checkout-dismiss-refresh-DB31reZx.js} +1 -1
  178. package/dist/assets/{use-edge-swipe-back-D0Hv2Vbo.js → use-edge-swipe-back-DeHKMrh8.js} +1 -1
  179. package/dist/assets/{use-hotkey-recorder-CPwPHbVu.js → use-hotkey-recorder-BKycBMhe.js} +1 -1
  180. package/dist/assets/{use-invite-link-dialog-YrW4BryT.js → use-invite-link-dialog-BdHG4b3u.js} +1 -1
  181. package/dist/assets/{use-plugins-list-DbtoYlBb.js → use-plugins-list-B9d39t5k.js} +1 -1
  182. package/dist/assets/{use-return-to-short-circuit-DIiSf2mw.js → use-return-to-short-circuit-D82kSfEB.js} +1 -1
  183. package/dist/assets/{use-side-list-room-DF3yxstr.js → use-side-list-room-CMVDwjej.js} +1 -1
  184. package/dist/assets/{use-skill-actions-C-MM5fH5.js → use-skill-actions-BkSsu_a-.js} +1 -1
  185. package/dist/assets/{use-skill-detail-files-BC8o1y4B.js → use-skill-detail-files-DRDxliP2.js} +1 -1
  186. package/dist/assets/use-supports-credentials-settings-DXa8eid1.js +1 -0
  187. package/dist/assets/{use-transcript-message-by-id-yY3_Y5YT.js → use-transcript-message-by-id-DVnOyFfP.js} +1 -1
  188. package/dist/assets/{voice-page-C6plqSbB.js → voice-page-DoYjxDlf.js} +1 -1
  189. package/dist/assets/{wake-detail-panel-ByOMpvzL.js → wake-detail-panel-PQ5V9JtN.js} +1 -1
  190. package/dist/assets/{weather-forecast-display-wWI7BbOq.js → weather-forecast-display-BWS4MRRa.js} +1 -1
  191. package/dist/assets/{welcome-screen-BrWlqKCU.js → welcome-screen-BKY6SHne.js} +1 -1
  192. package/dist/assets/{workflow-detail-panel-Tur0cTTa.js → workflow-detail-panel-N8CV0RrQ.js} +1 -1
  193. package/dist/assets/{workspace-page-BC6DuJ6j.js → workspace-page-B7cCk3SZ.js} +1 -1
  194. package/dist/assets/{xlsx-preview-QwpwZ8Ls.js → xlsx-preview-DaCmEr4c.js} +1 -1
  195. package/dist/index.html +2 -2
  196. package/package.json +1 -1
  197. package/dist/assets/add-credits-modal-CTwFNbFw.js +0 -1
  198. package/dist/assets/assistant-inbox-page-route-BNxtQgVH.js +0 -8
  199. package/dist/assets/auth-store-Ck9VwH27.js +0 -1
  200. package/dist/assets/avatar-bundled-components-BvhWO4x6.js +0 -1
  201. package/dist/assets/checkout-return-target-BMk9sOs5.js +0 -1
  202. package/dist/assets/command-palette-vN1QduVf.js +0 -1
  203. package/dist/assets/deploy-dialogs-gl-8Gfwg.js +0 -1
  204. package/dist/assets/document-load-vorRpGY8.js +0 -1
  205. package/dist/assets/local-mode-BDAFwrps.js +0 -1
  206. package/dist/assets/mutation-error-1lzyVoa-.js +0 -1
  207. package/dist/assets/native-attachment-pickers-C9F0ZR30.js +0 -1
  208. package/dist/assets/native-file-_gmszDPP.js +0 -1
  209. package/dist/assets/paired-platform-identity-CLNgDq2A.js +0 -1
  210. package/dist/assets/password-reset-page-DwD-Tr9u.js +0 -1
  211. package/dist/assets/plugins-surface-tkjP75qI.js +0 -1
  212. package/dist/assets/referral-modal-DpPM4ySm.js +0 -1
  213. package/dist/assets/routes--G7bm1Kz.js +0 -1
  214. package/dist/assets/share-feedback-modal-CVfT5Isv.js +0 -1
  215. package/dist/assets/tool-detail-panel-hGcjKO-7.js +0 -1
  216. package/dist/assets/use-channel-trust-floors-oeRMVBZa.js +0 -1
  217. package/dist/assets/use-supports-credentials-settings-C5z3u-mM.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{GC as t,HC as n,Io as r,It as i,JC as a,Jf as o,La as s,Qi as c,Rn as l,Wn as u,XC as d,Xh as f,Yh as p,ar as m,au as h,aw as g,cx as _,eg as v,er as y,io as b,ir as ee,ln as x,nr as te,qt as S,ro as ne,rr as C,sr as re,uw as w,vr as T,xC as E,zt as D}from"./app-4aEhon_S.js";import{E as O,j as k}from"./vendor-CtXGFqsu.js";import{t as A,x as ie}from"./react-B9IgSVeK.js";import{$r as ae,A as j,Ht as M,Ia as N,Ki as oe,Vt as P,Yn as F,Zr as I,ar as se,ri as L}from"./icons-C0wyat6T.js";import{n as R,r as ce,t as le}from"./use-app-delete-C3OP3RL_.js";var z=e(ie(),1),B=A();function V({children:e}){return(0,B.jsx)(`span`,{"data-reveal":``,className:`absolute right-1 top-1 rounded-md bg-[var(--surface-lift)]`,children:e})}function H({title:e,children:t}){return(0,B.jsxs)(d.Root,{children:[(0,B.jsx)(d.Trigger,{asChild:!0,children:(0,B.jsx)(g,{variant:`ghost`,size:`compact`,expandOnMobile:!1,iconOnly:(0,B.jsx)(ae,{}),"aria-label":e})}),(0,B.jsx)(d.Content,{title:e,children:t})]})}var U=({assistantId:e,app:t,onRequestDelete:n})=>{let{togglePin:r,pinnedAppIds:i}=c(e),a=i.has(t.id),o=R(e,t,{exported:k(`chat:appAssetActions.appExported`),failed:k(`chat:appAssetActions.shareFailed`)});return(0,B.jsxs)(H,{title:k(`chat:conversationAssetActions.optionsFor`,{name:t.name}),children:[(0,B.jsx)(d.Item,{icon:a?M:P,label:k(a?`chat:conversationAssetActions.unpin`:`chat:conversationAssetActions.pin`),onSelect:()=>r(t.id)}),(0,B.jsx)(d.Item,{icon:N,label:k(`chat:conversationAssetActions.share`),description:k(`chat:conversationAssetActions.exportAsVellum`),onSelect:()=>void o()}),(0,B.jsx)(d.Item,{icon:j,label:k(`chat:conversationAssetActions.delete`),tone:`destructive`,onSelect:()=>n(t)})]})},W=({assistantId:e,doc:t,onOpen:n})=>{let i=(0,z.useCallback)(async()=>{try{await r(e,t.surfaceId,t.title)}catch{E.error(k(`chat:documentAssetActions.pdfDownloadFailed`))}},[e,t.surfaceId,t.title]);return(0,B.jsxs)(H,{title:k(`chat:conversationAssetActions.optionsFor`,{name:t.title}),children:[(0,B.jsx)(d.Item,{icon:I,label:k(`chat:conversationAssetActions.open`),onSelect:n}),(0,B.jsx)(d.Item,{icon:L,label:k(`chat:conversationAssetActions.downloadPdf`),onSelect:()=>void i()})]})},G={width:184};function K({app:e,assistantId:t,onOpen:n,onRequestDelete:r,stretch:i=!1}){let{t:o}=O(`chat`),s=(0,z.useCallback)(()=>v(t,e.id,e.updatedAt),[t,e.id,e.updatedAt]);return(0,B.jsxs)(`div`,{"data-slot":`chat-info-app-tile`,"data-reveal-row":``,className:w(`relative flex flex-col gap-1`,i?`min-w-0 flex-1`:`shrink-0`),style:i?void 0:G,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":o(`chatInfoPanel.openAppAria`,{name:e.name}),onClick:()=>n(e.id),className:`block w-full cursor-pointer rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:(0,B.jsx)(x,{name:e.name,icon:e.icon,loadHtml:s})}),(0,B.jsx)(V,{children:(0,B.jsx)(U,{assistantId:t,app:e,onRequestDelete:r})}),(0,B.jsx)(a,{variant:`body-small-default`,title:e.name,className:`truncate leading-normal text-[var(--content-tertiary)]`,children:e.name})]})}var q={width:135};function J({file:e,assistantId:t,onOpen:n}){let{t:r}=O(`chat`),o=(0,z.useRef)(null),s=i(o)||typeof IntersectionObserver>`u`,c=e.kind===`document`?null:e.attachment,l=c?T(c.mimeType,c.filename):`document`,[d,f]=(0,z.useState)(!1),{url:p,isError:m}=u(t,c,s&&l===`image`),h=l===`video`&&c?.thumbnailUrl!=null?c.thumbnailUrl:null,g;g=e.kind===`document`?r(`chatInfoPanel.openDocumentAria`,{name:e.title}):e.kind===`frame`?r(`chatInfoPanel.previewFrameAria`):r(`chatInfoPanel.previewAttachmentAria`,{filename:e.attachment.filename});let _=e.kind===`frame`&&e.capturedAt!==null?D(e.capturedAt):e.title,v=l===`image`&&!d;return(0,B.jsxs)(`div`,{"data-slot":`chat-info-file-tile`,"data-reveal-row":``,className:`relative flex shrink-0 flex-col gap-1`,style:q,children:[(0,B.jsx)(`button`,{ref:o,type:`button`,"aria-label":g,onClick:()=>n(e),className:`block h-[84px] w-full cursor-pointer overflow-hidden rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:(0,B.jsx)(S,{className:`h-full w-full rounded-lg bg-[var(--surface-base)]`,kind:l,imageUrl:v?p:null,posterUrl:h,onImageError:()=>f(!0),glyphClassName:`size-8`,placeholder:v&&!m?(0,B.jsx)(F,{className:`size-8 animate-spin text-[var(--content-tertiary)]`}):null})}),e.kind===`document`?(0,B.jsx)(V,{children:(0,B.jsx)(W,{assistantId:t,doc:e.doc,onOpen:()=>n(e)})}):null,(0,B.jsx)(a,{variant:`body-small-default`,title:_,className:`truncate leading-normal text-[var(--content-tertiary)]`,children:_})]})}function ue({items:e,assistantId:t,hasMore:n,loading:r,onLoadMore:i,onOpen:a}){let{t:o}=O(`chat`);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,B.jsx)(J,{file:e,assistantId:t,onOpen:a},e.id))}),n&&(0,B.jsx)(g,{variant:`outlined`,disabled:r,onClick:i,className:`self-start`,children:o(`chatInfoPanel.loadMore`)})]})}var Y=8,X={"--chat-info-strip-bleed":`20px`},Z={gap:Y};function Q(e,t){if(!(e>0))return 1;let n=Y;return Math.max(1,Math.floor((e+n)/(t+n)))}function de({title:e,count:t,notice:r,items:i,tileWidth:o,renderTile:c,seeAllAriaLabel:l,onSeeAll:u}){let{t:d}=O(`chat`),f=(0,z.useId)(),{ref:p,size:_}=s(),v=h(),y=Q(_.w,o),b=(t??i.length)>y;return(0,B.jsxs)(`section`,{"aria-labelledby":f,className:`flex flex-col gap-3`,style:X,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,B.jsx)(a,{id:f,variant:`title-small`,className:`truncate text-[var(--content-emphasised)]`,children:e}),t!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(m,{className:`bg-[var(--content-disabled)]`}),(0,B.jsx)(a,{variant:`title-small`,className:`shrink-0 text-[var(--content-disabled)]`,children:t})]})]}),b&&(0,B.jsx)(g,{variant:`ghost`,size:`compact`,"aria-label":l,onClick:u,className:`h-auto shrink-0 px-0 text-title-small hover:bg-transparent [--vbtn-fg:var(--content-emphasised)]`,children:d(`chatInfoPanel.seeAll`)})]}),r,(0,B.jsx)(`div`,{ref:p,className:`w-full`,children:v?(0,B.jsx)(n,{orientation:`horizontal`,hideScrollBar:!0,className:`-mx-[var(--chat-info-strip-bleed)] px-[var(--chat-info-strip-bleed)]`,children:(0,B.jsx)(`div`,{className:`flex w-max`,style:Z,children:i.map(e=>c(e,`strip`))})}):(0,B.jsx)(`div`,{className:`flex w-full`,style:Z,children:i.slice(0,y).map(e=>c(e,`fitted`))})})]})}function fe({category:e,title:t,count:n,notice:r,items:i,seeAllAriaLabel:a,onSeeAll:o,onOpen:s,assistantId:c}){return(0,B.jsx)(de,{title:t,count:n,notice:r,items:i,tileWidth:135,seeAllAriaLabel:a,onSeeAll:()=>o(e),renderTile:e=>(0,B.jsx)(J,{file:e,assistantId:c,onOpen:s},e.id)})}function $({payload:e,onClose:n,onSelectCategory:r}){let{t:i}=O(`chat`),{assistantId:a,conversationId:s}=e,c=_.use.activeAssistantId(),u=b(a,p.getState().closeChatInfo),d=ne(),{apps:m,files:h,frames:v,counts:x,count:S,status:w,allFailed:T,countsExact:E,sources:D,retrySource:k,retryFailedSources:A,hasMoreFiles:ie,hasMoreFrames:ae,loadMoreFiles:j,loadMoreFrames:M}=re({assistantId:a,conversationId:s}),{previewable:N,previewIndexById:P}=(0,z.useMemo)(()=>{let e=[],t=new Map;for(let n of[...h,...v])n.kind!==`document`&&(t.set(n.id,e.length),e.push(n.attachment));return{previewable:e,previewIndexById:t}},[h,v]),{openPreview:F,previewModal:I}=l(a,N),L=le(a),R=f.use.changedDocuments()[s],V=f.use.clearConversation();(0,z.useEffect)(()=>{R!==void 0&&V(s)},[V,s,R]),(0,z.useEffect)(()=>{c!==null&&c!==a&&p.getState().closeChatInfo()},[c,a]);let H=(0,z.useCallback)(e=>{a===c&&(p.getState().closeChatInfo(),d(e,{conversationId:s}))},[c,a,s,d]),U=(0,z.useCallback)(e=>{if(e.kind===`document`){u(e.doc.surfaceId);return}F(e.attachment,P.get(e.id))},[u,F,P]),W={apps:i(`chatInfoPanel.appsTitle`),files:i(`chatInfoPanel.filesTitle`),frames:i(`chatInfoPanel.framesTitle`)},G={apps:m,files:h,frames:v},q={apps:[`apps`],files:[`documents`,`attachments`],frames:[`frames`]},J={apps:i(`chatInfoPanel.appsTitle`),documents:i(`chatInfoPanel.documentsSource`),attachments:i(`chatInfoPanel.attachmentsSource`),frames:i(`chatInfoPanel.framesTitle`)},Y=e=>q[e].map(e=>{let n=D[e],r=J[e];if(!n.supported)return(0,B.jsx)(C,{placement:`section`,children:i(`chatInfoPanel.framesUnsupported`)},e);if(n.failure){let a=n.failure===`page`?`chatInfoPanel.sourcePageFailed`:n.failure===`refresh`?`chatInfoPanel.sourceRefreshFailed`:`chatInfoPanel.sourceLoadFailed`;return(0,B.jsx)(t,{tone:n.hasData?`warning`:`error`,actions:(!T||Z!==null)&&(0,B.jsx)(g,{variant:`outlined`,size:`compact`,disabled:n.fetching,onClick:()=>k(e),"aria-label":i(`chatInfoPanel.retrySourceAria`,{source:r}),children:i(`chatInfoPanel.retry`)}),children:i(a,{source:r})},e)}return n.pending?(0,B.jsx)(te,{placement:`section`,label:i(`chatInfoPanel.sourceLoading`,{source:r})},e):n.scope===`loaded-history`?(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(C,{placement:`section`,children:i(`chatInfoPanel.loadedHistory`)}),(0,B.jsx)(C,{placement:`section`,children:i(`chatInfoPanel.framesUnsupported`)})]},e):null}),X=e.category!==null&&o(q[e.category].map(e=>D[e])).status===`ready`&&G[e.category].length===0,Z=X?null:e.category;(0,z.useEffect)(()=>{X&&r(null)},[X,r]);let Q=e=>{let t=G[e];return t.length===0&&q[e].every(e=>!D[e].pending&&!D[e].failure)?null:(0,B.jsx)(fe,{category:e,title:W[e],count:E[e]?x[e]:null,notice:Y(e),items:t,seeAllAriaLabel:i(e===`files`?`chatInfoPanel.seeAllFilesAria`:`chatInfoPanel.seeAllFramesAria`),onSeeAll:r,onOpen:U,assistantId:a})},$;return $=Z===`apps`?(0,B.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(184px, 1fr))`},children:m.map(e=>(0,B.jsx)(K,{app:e,assistantId:a,stretch:!0,onOpen:H,onRequestDelete:L.requestDelete},e.id))}):Z===null?(0,B.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[w===`ready`&&S===0&&(0,B.jsx)(C,{placement:`panel`,children:i(`chatInfoPanel.empty`)}),(m.length>0||D.apps.pending||D.apps.failure)&&(0,B.jsx)(de,{title:W.apps,count:E.apps?x.apps:null,notice:Y(`apps`),items:m,tileWidth:184,seeAllAriaLabel:i(`chatInfoPanel.seeAllAppsAria`),onSeeAll:()=>r(`apps`),renderTile:(e,t)=>(0,B.jsx)(K,{app:e,assistantId:a,stretch:t===`fitted`,onOpen:H,onRequestDelete:L.requestDelete},e.id)}),Q(`files`),Q(`frames`)]}):(0,B.jsx)(ue,{items:G[Z],assistantId:a,hasMore:(Z===`files`?ie:ae)&&!D[Z===`files`?`attachments`:`frames`].failure,loading:D[Z===`files`?`attachments`:`frames`].fetching,onLoadMore:Z===`files`?j:M,onOpen:U}),(0,B.jsxs)(y,{...Z===null?{Glyph:se,title:i(`chatInfoPanel.title`)}:{icon:(0,B.jsx)(g,{variant:`outlined`,iconOnly:(0,B.jsx)(oe,{}),"aria-label":i(`chatInfoPanel.backAria`),tooltip:i(`chatInfoPanel.backTooltip`),onClick:()=>r(null),className:`shrink-0`}),title:E[Z]?void 0:W[Z],titleNode:E[Z]?(0,B.jsx)(ee,{title:W[Z],count:x[Z]}):void 0},closeLabel:i(`chatInfoPanel.closeAria`),closeTooltip:i(`chatInfoPanel.closeAria`),onClose:n,children:[Z===null&&T&&(0,B.jsx)(t,{tone:`error`,actions:(0,B.jsx)(g,{variant:`outlined`,size:`compact`,disabled:Object.values(D).some(e=>e.fetching),onClick:A,children:i(`chatInfoPanel.retry`)}),children:i(`chatInfoPanel.loadFailed`)}),Z!==null&&Y(Z),$,I,(0,B.jsx)(ce,{app:L.pendingDelete,isDeleting:L.isDeleting,onConfirm:L.confirmDelete,onCancel:L.cancelDelete})]})}export{$ as ChatInfoPanel};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{GC as t,HC as n,Io as r,It as i,JC as a,Jf as o,La as s,Qi as c,Rn as l,Wn as u,XC as d,Xh as f,Yh as p,ar as m,au as h,aw as g,cx as _,eg as v,er as y,io as b,ir as ee,ln as x,nr as te,qt as S,ro as ne,rr as C,sr as re,uw as w,vr as T,xC as E,zt as D}from"./app-DbJUeBix.js";import{E as O,j as k}from"./vendor-CtXGFqsu.js";import{t as A,x as ie}from"./react-B9IgSVeK.js";import{$r as ae,A as j,Ht as M,Ia as N,Ki as oe,Vt as P,Yn as F,Zr as I,ar as se,ri as L}from"./icons-C0wyat6T.js";import{n as R,r as ce,t as le}from"./use-app-delete-2je5dBpX.js";var z=e(ie(),1),B=A();function V({children:e}){return(0,B.jsx)(`span`,{"data-reveal":``,className:`absolute right-1 top-1 rounded-md bg-[var(--surface-lift)]`,children:e})}function H({title:e,children:t}){return(0,B.jsxs)(d.Root,{children:[(0,B.jsx)(d.Trigger,{asChild:!0,children:(0,B.jsx)(g,{variant:`ghost`,size:`compact`,expandOnMobile:!1,iconOnly:(0,B.jsx)(ae,{}),"aria-label":e})}),(0,B.jsx)(d.Content,{title:e,children:t})]})}var U=({assistantId:e,app:t,onRequestDelete:n})=>{let{togglePin:r,pinnedAppIds:i}=c(e),a=i.has(t.id),o=R(e,t,{exported:k(`chat:appAssetActions.appExported`),failed:k(`chat:appAssetActions.shareFailed`)});return(0,B.jsxs)(H,{title:k(`chat:conversationAssetActions.optionsFor`,{name:t.name}),children:[(0,B.jsx)(d.Item,{icon:a?M:P,label:k(a?`chat:conversationAssetActions.unpin`:`chat:conversationAssetActions.pin`),onSelect:()=>r(t.id)}),(0,B.jsx)(d.Item,{icon:N,label:k(`chat:conversationAssetActions.share`),description:k(`chat:conversationAssetActions.exportAsVellum`),onSelect:()=>void o()}),(0,B.jsx)(d.Item,{icon:j,label:k(`chat:conversationAssetActions.delete`),tone:`destructive`,onSelect:()=>n(t)})]})},W=({assistantId:e,doc:t,onOpen:n})=>{let i=(0,z.useCallback)(async()=>{try{await r(e,t.surfaceId,t.title)}catch{E.error(k(`chat:documentAssetActions.pdfDownloadFailed`))}},[e,t.surfaceId,t.title]);return(0,B.jsxs)(H,{title:k(`chat:conversationAssetActions.optionsFor`,{name:t.title}),children:[(0,B.jsx)(d.Item,{icon:I,label:k(`chat:conversationAssetActions.open`),onSelect:n}),(0,B.jsx)(d.Item,{icon:L,label:k(`chat:conversationAssetActions.downloadPdf`),onSelect:()=>void i()})]})},G={width:184};function K({app:e,assistantId:t,onOpen:n,onRequestDelete:r,stretch:i=!1}){let{t:o}=O(`chat`),s=(0,z.useCallback)(()=>v(t,e.id,e.updatedAt),[t,e.id,e.updatedAt]);return(0,B.jsxs)(`div`,{"data-slot":`chat-info-app-tile`,"data-reveal-row":``,className:w(`relative flex flex-col gap-1`,i?`min-w-0 flex-1`:`shrink-0`),style:i?void 0:G,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":o(`chatInfoPanel.openAppAria`,{name:e.name}),onClick:()=>n(e.id),className:`block w-full cursor-pointer rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:(0,B.jsx)(x,{name:e.name,icon:e.icon,loadHtml:s})}),(0,B.jsx)(V,{children:(0,B.jsx)(U,{assistantId:t,app:e,onRequestDelete:r})}),(0,B.jsx)(a,{variant:`body-small-default`,title:e.name,className:`truncate leading-normal text-[var(--content-tertiary)]`,children:e.name})]})}var q={width:135};function J({file:e,assistantId:t,onOpen:n}){let{t:r}=O(`chat`),o=(0,z.useRef)(null),s=i(o)||typeof IntersectionObserver>`u`,c=e.kind===`document`?null:e.attachment,l=c?T(c.mimeType,c.filename):`document`,[d,f]=(0,z.useState)(!1),{url:p,isError:m}=u(t,c,s&&l===`image`),h=l===`video`&&c?.thumbnailUrl!=null?c.thumbnailUrl:null,g;g=e.kind===`document`?r(`chatInfoPanel.openDocumentAria`,{name:e.title}):e.kind===`frame`?r(`chatInfoPanel.previewFrameAria`):r(`chatInfoPanel.previewAttachmentAria`,{filename:e.attachment.filename});let _=e.kind===`frame`&&e.capturedAt!==null?D(e.capturedAt):e.title,v=l===`image`&&!d;return(0,B.jsxs)(`div`,{"data-slot":`chat-info-file-tile`,"data-reveal-row":``,className:`relative flex shrink-0 flex-col gap-1`,style:q,children:[(0,B.jsx)(`button`,{ref:o,type:`button`,"aria-label":g,onClick:()=>n(e),className:`block h-[84px] w-full cursor-pointer overflow-hidden rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:(0,B.jsx)(S,{className:`h-full w-full rounded-lg bg-[var(--surface-base)]`,kind:l,imageUrl:v?p:null,posterUrl:h,onImageError:()=>f(!0),glyphClassName:`size-8`,placeholder:v&&!m?(0,B.jsx)(F,{className:`size-8 animate-spin text-[var(--content-tertiary)]`}):null})}),e.kind===`document`?(0,B.jsx)(V,{children:(0,B.jsx)(W,{assistantId:t,doc:e.doc,onOpen:()=>n(e)})}):null,(0,B.jsx)(a,{variant:`body-small-default`,title:_,className:`truncate leading-normal text-[var(--content-tertiary)]`,children:_})]})}function ue({items:e,assistantId:t,hasMore:n,loading:r,onLoadMore:i,onOpen:a}){let{t:o}=O(`chat`);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.length>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,B.jsx)(J,{file:e,assistantId:t,onOpen:a},e.id))}),n&&(0,B.jsx)(g,{variant:`outlined`,disabled:r,onClick:i,className:`self-start`,children:o(`chatInfoPanel.loadMore`)})]})}var Y=8,X={"--chat-info-strip-bleed":`20px`},Z={gap:Y};function Q(e,t){if(!(e>0))return 1;let n=Y;return Math.max(1,Math.floor((e+n)/(t+n)))}function de({title:e,count:t,notice:r,items:i,tileWidth:o,renderTile:c,seeAllAriaLabel:l,onSeeAll:u}){let{t:d}=O(`chat`),f=(0,z.useId)(),{ref:p,size:_}=s(),v=h(),y=Q(_.w,o),b=(t??i.length)>y;return(0,B.jsxs)(`section`,{"aria-labelledby":f,className:`flex flex-col gap-3`,style:X,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,B.jsx)(a,{id:f,variant:`title-small`,className:`truncate text-[var(--content-emphasised)]`,children:e}),t!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(m,{className:`bg-[var(--content-disabled)]`}),(0,B.jsx)(a,{variant:`title-small`,className:`shrink-0 text-[var(--content-disabled)]`,children:t})]})]}),b&&(0,B.jsx)(g,{variant:`ghost`,size:`compact`,"aria-label":l,onClick:u,className:`h-auto shrink-0 px-0 text-title-small hover:bg-transparent [--vbtn-fg:var(--content-emphasised)]`,children:d(`chatInfoPanel.seeAll`)})]}),r,(0,B.jsx)(`div`,{ref:p,className:`w-full`,children:v?(0,B.jsx)(n,{orientation:`horizontal`,hideScrollBar:!0,className:`-mx-[var(--chat-info-strip-bleed)] px-[var(--chat-info-strip-bleed)]`,children:(0,B.jsx)(`div`,{className:`flex w-max`,style:Z,children:i.map(e=>c(e,`strip`))})}):(0,B.jsx)(`div`,{className:`flex w-full`,style:Z,children:i.slice(0,y).map(e=>c(e,`fitted`))})})]})}function fe({category:e,title:t,count:n,notice:r,items:i,seeAllAriaLabel:a,onSeeAll:o,onOpen:s,assistantId:c}){return(0,B.jsx)(de,{title:t,count:n,notice:r,items:i,tileWidth:135,seeAllAriaLabel:a,onSeeAll:()=>o(e),renderTile:e=>(0,B.jsx)(J,{file:e,assistantId:c,onOpen:s},e.id)})}function $({payload:e,onClose:n,onSelectCategory:r}){let{t:i}=O(`chat`),{assistantId:a,conversationId:s}=e,c=_.use.activeAssistantId(),u=b(a,p.getState().closeChatInfo),d=ne(),{apps:m,files:h,frames:v,counts:x,count:S,status:w,allFailed:T,countsExact:E,sources:D,retrySource:k,retryFailedSources:A,hasMoreFiles:ie,hasMoreFrames:ae,loadMoreFiles:j,loadMoreFrames:M}=re({assistantId:a,conversationId:s}),{previewable:N,previewIndexById:P}=(0,z.useMemo)(()=>{let e=[],t=new Map;for(let n of[...h,...v])n.kind!==`document`&&(t.set(n.id,e.length),e.push(n.attachment));return{previewable:e,previewIndexById:t}},[h,v]),{openPreview:F,previewModal:I}=l(a,N),L=le(a),R=f.use.changedDocuments()[s],V=f.use.clearConversation();(0,z.useEffect)(()=>{R!==void 0&&V(s)},[V,s,R]),(0,z.useEffect)(()=>{c!==null&&c!==a&&p.getState().closeChatInfo()},[c,a]);let H=(0,z.useCallback)(e=>{a===c&&(p.getState().closeChatInfo(),d(e,{conversationId:s}))},[c,a,s,d]),U=(0,z.useCallback)(e=>{if(e.kind===`document`){u(e.doc.surfaceId);return}F(e.attachment,P.get(e.id))},[u,F,P]),W={apps:i(`chatInfoPanel.appsTitle`),files:i(`chatInfoPanel.filesTitle`),frames:i(`chatInfoPanel.framesTitle`)},G={apps:m,files:h,frames:v},q={apps:[`apps`],files:[`documents`,`attachments`],frames:[`frames`]},J={apps:i(`chatInfoPanel.appsTitle`),documents:i(`chatInfoPanel.documentsSource`),attachments:i(`chatInfoPanel.attachmentsSource`),frames:i(`chatInfoPanel.framesTitle`)},Y=e=>q[e].map(e=>{let n=D[e],r=J[e];if(!n.supported)return(0,B.jsx)(C,{placement:`section`,children:i(`chatInfoPanel.framesUnsupported`)},e);if(n.failure){let a=n.failure===`page`?`chatInfoPanel.sourcePageFailed`:n.failure===`refresh`?`chatInfoPanel.sourceRefreshFailed`:`chatInfoPanel.sourceLoadFailed`;return(0,B.jsx)(t,{tone:n.hasData?`warning`:`error`,actions:(!T||Z!==null)&&(0,B.jsx)(g,{variant:`outlined`,size:`compact`,disabled:n.fetching,onClick:()=>k(e),"aria-label":i(`chatInfoPanel.retrySourceAria`,{source:r}),children:i(`chatInfoPanel.retry`)}),children:i(a,{source:r})},e)}return n.pending?(0,B.jsx)(te,{placement:`section`,label:i(`chatInfoPanel.sourceLoading`,{source:r})},e):n.scope===`loaded-history`?(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(C,{placement:`section`,children:i(`chatInfoPanel.loadedHistory`)}),(0,B.jsx)(C,{placement:`section`,children:i(`chatInfoPanel.framesUnsupported`)})]},e):null}),X=e.category!==null&&o(q[e.category].map(e=>D[e])).status===`ready`&&G[e.category].length===0,Z=X?null:e.category;(0,z.useEffect)(()=>{X&&r(null)},[X,r]);let Q=e=>{let t=G[e];return t.length===0&&q[e].every(e=>!D[e].pending&&!D[e].failure)?null:(0,B.jsx)(fe,{category:e,title:W[e],count:E[e]?x[e]:null,notice:Y(e),items:t,seeAllAriaLabel:i(e===`files`?`chatInfoPanel.seeAllFilesAria`:`chatInfoPanel.seeAllFramesAria`),onSeeAll:r,onOpen:U,assistantId:a})},$;return $=Z===`apps`?(0,B.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(184px, 1fr))`},children:m.map(e=>(0,B.jsx)(K,{app:e,assistantId:a,stretch:!0,onOpen:H,onRequestDelete:L.requestDelete},e.id))}):Z===null?(0,B.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[w===`ready`&&S===0&&(0,B.jsx)(C,{placement:`panel`,children:i(`chatInfoPanel.empty`)}),(m.length>0||D.apps.pending||D.apps.failure)&&(0,B.jsx)(de,{title:W.apps,count:E.apps?x.apps:null,notice:Y(`apps`),items:m,tileWidth:184,seeAllAriaLabel:i(`chatInfoPanel.seeAllAppsAria`),onSeeAll:()=>r(`apps`),renderTile:(e,t)=>(0,B.jsx)(K,{app:e,assistantId:a,stretch:t===`fitted`,onOpen:H,onRequestDelete:L.requestDelete},e.id)}),Q(`files`),Q(`frames`)]}):(0,B.jsx)(ue,{items:G[Z],assistantId:a,hasMore:(Z===`files`?ie:ae)&&!D[Z===`files`?`attachments`:`frames`].failure,loading:D[Z===`files`?`attachments`:`frames`].fetching,onLoadMore:Z===`files`?j:M,onOpen:U}),(0,B.jsxs)(y,{...Z===null?{Glyph:se,title:i(`chatInfoPanel.title`)}:{icon:(0,B.jsx)(g,{variant:`outlined`,iconOnly:(0,B.jsx)(oe,{}),"aria-label":i(`chatInfoPanel.backAria`),tooltip:i(`chatInfoPanel.backTooltip`),onClick:()=>r(null),className:`shrink-0`}),title:E[Z]?void 0:W[Z],titleNode:E[Z]?(0,B.jsx)(ee,{title:W[Z],count:x[Z]}):void 0},closeLabel:i(`chatInfoPanel.closeAria`),closeTooltip:i(`chatInfoPanel.closeAria`),onClose:n,children:[Z===null&&T&&(0,B.jsx)(t,{tone:`error`,actions:(0,B.jsx)(g,{variant:`outlined`,size:`compact`,disabled:Object.values(D).some(e=>e.fetching),onClick:A,children:i(`chatInfoPanel.retry`)}),children:i(`chatInfoPanel.loadFailed`)}),Z!==null&&Y(Z),$,I,(0,B.jsx)(ce,{app:L.pendingDelete,isDeleting:L.isDeleting,onConfirm:L.confirmDelete,onCancel:L.cancelDelete})]})}export{$ as ChatInfoPanel};
@@ -1 +1 @@
1
- import{Dv as e,kb as t}from"./app-4aEhon_S.js";function n(){let t=e.use.marketingPricingTakeover(),n=e.use.hydrated();return t?`enabled`:n?`disabled`:`pending`}var r=`continue`;function i(e,n){return t(e.get(r),n)}export{i as n,n as r,r as t};
1
+ import{Dv as e,kb as t}from"./app-DbJUeBix.js";function n(){let t=e.use.marketingPricingTakeover(),n=e.use.hydrated();return t?`enabled`:n?`disabled`:`pending`}var r=`continue`;function i(e,n){return t(e.get(r),n)}export{i as n,n as r,r as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{DS as t,Eh as n,Hd as r,RC as i,Yy as a,aw as o,b_ as s,db as c,dh as l,fb as u,hb as d,uw as f,zg as p}from"./app-4aEhon_S.js";import{E as m,Xn as h}from"./vendor-CtXGFqsu.js";import{_ as g,f as _,n as v,t as y,x as b}from"./react-B9IgSVeK.js";import{Yn as x}from"./icons-C0wyat6T.js";import{t as S}from"./checkout-return-target-BMk9sOs5.js";import{n as C,r as w}from"./checkout-continuation-DiZjXso_.js";var T=e(b(),1),E=y();function D(){u()}function O(){let{t:e}=m(`settings`),u=_(),[p]=g(),y=p.get(`package`)??``,b=(0,T.useMemo)(()=>y?null:c(p),[y,p]),O=n(),k=l(),A=w(),j=C(p,t.plans),M=j===t.plans?e(`checkoutPage.viewPlans`):e(`checkoutPage.continueSetup`),{mutateAsync:N}=h(r()),[P,F]=(0,T.useState)(!1),[I,L]=(0,T.useState)(!1),R=(0,T.useRef)(`idle`),z=(0,T.useCallback)(async()=>{R.current=`running`,F(!1),L(!1);let e=S();try{let n=await N({body:b?{target_plan_id:`pro`,confirm:!0,machine_tier:b.machineTier,storage_tier:b.storageTier,credit_tier:b.creditTier,return_target:e}:{target_plan_id:`pro`,package:y,confirm:!0,return_target:e}});if(R.current!==`running`)return;if(n.status===`redirect`&&n.checkout_url){R.current=`handed_off`,d(b?{kind:`custom`,machineTier:b.machineTier,storageTier:b.storageTier,creditTier:b.creditTier}:{kind:`package`,packageKey:y}),L(e===`native`),a(n.checkout_url);return}R.current=`settled`,D(),u(j===t.plans&&y?t.plansForPackage(y):j,{replace:!0})}catch{if(R.current!==`running`)return;R.current=`settled`,F(!0)}},[j,b,N,u,y]),B=(0,T.useCallback)(()=>{if(k===`ready`){z();return}R.current=`idle`,F(!1),L(!1),k===`unavailable`&&s.getState().fetchOrganizations()},[k,z]);return(0,T.useEffect)(()=>{if(!y&&!b||O===`disabled`||O===`gated`||A===`disabled`){if(R.current===`handed_off`)return;R.current=`settled`,D(),u(j,{replace:!0});return}if(!(A!==`enabled`||O!==`full`||R.current!==`idle`)&&k!==`resolving`){if(k===`unavailable`){R.current=`settled`,F(!0);return}z()}},[j,b,O,u,k,y,z,A]),P?(0,E.jsxs)(`div`,{className:`flex h-full w-full flex-col items-center justify-center gap-4 px-6 text-center`,children:[(0,E.jsx)(`p`,{className:`text-[var(--content-default)]`,children:e(`checkoutPage.checkoutFailedMessage`)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,E.jsx)(o,{onClick:B,children:e(`checkoutPage.tryAgain`)}),(0,E.jsx)(v,{to:j,onClick:D,className:f(i({tone:`quiet`}),`text-sm text-[var(--content-tertiary)]`),children:M})]})]}):I?(0,E.jsxs)(`div`,{className:`flex h-full w-full flex-col items-center justify-center gap-4 px-6 text-center`,children:[(0,E.jsx)(`p`,{className:`text-[var(--content-default)]`,children:e(`checkoutPage.awaitingReturnMessage`)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,E.jsx)(o,{onClick:B,children:e(`checkoutPage.reopenCheckout`)}),(0,E.jsx)(v,{to:j,className:f(i({tone:`quiet`}),`text-sm text-[var(--content-tertiary)]`),children:M})]})]}):(0,E.jsxs)(`div`,{className:`flex h-full w-full flex-col items-center justify-center gap-3`,children:[(0,E.jsx)(x,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":e(`checkoutPage.preparingCheckoutAriaLabel`)}),(0,E.jsx)(`p`,{className:`text-sm text-[var(--content-tertiary)]`,children:e(`checkoutPage.preparingCheckout`)})]})}function k(){let e=_(),[n]=g(),r=C(n,t.settings.usageBilling);return(0,T.useEffect)(()=>{D(),e(r,{replace:!0})},[e,r]),null}function A(){return p()?(0,E.jsx)(k,{}):(0,E.jsx)(O,{})}export{A as CheckoutPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{DS as t,Eh as n,Hd as r,RC as i,Yy as a,aw as o,b_ as s,db as c,dh as l,fb as u,hb as d,uw as f,zg as p}from"./app-DbJUeBix.js";import{E as m,Xn as h}from"./vendor-CtXGFqsu.js";import{_ as g,f as _,n as v,t as y,x as b}from"./react-B9IgSVeK.js";import{Yn as x}from"./icons-C0wyat6T.js";import{t as S}from"./checkout-return-target-B3XAFuN6.js";import{n as C,r as w}from"./checkout-continuation-BniC3jRe.js";var T=e(b(),1),E=y();function D(){u()}function O(){let{t:e}=m(`settings`),u=_(),[p]=g(),y=p.get(`package`)??``,b=(0,T.useMemo)(()=>y?null:c(p),[y,p]),O=n(),k=l(),A=w(),j=C(p,t.plans),M=j===t.plans?e(`checkoutPage.viewPlans`):e(`checkoutPage.continueSetup`),{mutateAsync:N}=h(r()),[P,F]=(0,T.useState)(!1),[I,L]=(0,T.useState)(!1),R=(0,T.useRef)(`idle`),z=(0,T.useCallback)(async()=>{R.current=`running`,F(!1),L(!1);let e=S();try{let n=await N({body:b?{target_plan_id:`pro`,confirm:!0,machine_tier:b.machineTier,storage_tier:b.storageTier,credit_tier:b.creditTier,return_target:e}:{target_plan_id:`pro`,package:y,confirm:!0,return_target:e}});if(R.current!==`running`)return;if(n.status===`redirect`&&n.checkout_url){R.current=`handed_off`,d(b?{kind:`custom`,machineTier:b.machineTier,storageTier:b.storageTier,creditTier:b.creditTier}:{kind:`package`,packageKey:y}),L(e===`native`),a(n.checkout_url);return}R.current=`settled`,D(),u(j===t.plans&&y?t.plansForPackage(y):j,{replace:!0})}catch{if(R.current!==`running`)return;R.current=`settled`,F(!0)}},[j,b,N,u,y]),B=(0,T.useCallback)(()=>{if(k===`ready`){z();return}R.current=`idle`,F(!1),L(!1),k===`unavailable`&&s.getState().fetchOrganizations()},[k,z]);return(0,T.useEffect)(()=>{if(!y&&!b||O===`disabled`||O===`gated`||A===`disabled`){if(R.current===`handed_off`)return;R.current=`settled`,D(),u(j,{replace:!0});return}if(!(A!==`enabled`||O!==`full`||R.current!==`idle`)&&k!==`resolving`){if(k===`unavailable`){R.current=`settled`,F(!0);return}z()}},[j,b,O,u,k,y,z,A]),P?(0,E.jsxs)(`div`,{className:`flex h-full w-full flex-col items-center justify-center gap-4 px-6 text-center`,children:[(0,E.jsx)(`p`,{className:`text-[var(--content-default)]`,children:e(`checkoutPage.checkoutFailedMessage`)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,E.jsx)(o,{onClick:B,children:e(`checkoutPage.tryAgain`)}),(0,E.jsx)(v,{to:j,onClick:D,className:f(i({tone:`quiet`}),`text-sm text-[var(--content-tertiary)]`),children:M})]})]}):I?(0,E.jsxs)(`div`,{className:`flex h-full w-full flex-col items-center justify-center gap-4 px-6 text-center`,children:[(0,E.jsx)(`p`,{className:`text-[var(--content-default)]`,children:e(`checkoutPage.awaitingReturnMessage`)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,E.jsx)(o,{onClick:B,children:e(`checkoutPage.reopenCheckout`)}),(0,E.jsx)(v,{to:j,className:f(i({tone:`quiet`}),`text-sm text-[var(--content-tertiary)]`),children:M})]})]}):(0,E.jsxs)(`div`,{className:`flex h-full w-full flex-col items-center justify-center gap-3`,children:[(0,E.jsx)(x,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":e(`checkoutPage.preparingCheckoutAriaLabel`)}),(0,E.jsx)(`p`,{className:`text-sm text-[var(--content-tertiary)]`,children:e(`checkoutPage.preparingCheckout`)})]})}function k(){let e=_(),[n]=g(),r=C(n,t.settings.usageBilling);return(0,T.useEffect)(()=>{D(),e(r,{replace:!0})},[e,r]),null}function A(){return p()?(0,E.jsx)(k,{}):(0,E.jsx)(O,{})}export{A as CheckoutPage};
@@ -0,0 +1 @@
1
+ import{Og as e}from"./app-DbJUeBix.js";import{x as t}from"./vendor-CtXGFqsu.js";function n(){return e()!==null||t.isNativePlatform()?`native`:`web`}export{n as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{JC as t,QC as n,Vg as r,au as i,aw as a,cs as o,nw as s,rw as c,tw as l,ya as u}from"./app-4aEhon_S.js";import{E as d,d as f,f as p,p as m,s as h}from"./vendor-CtXGFqsu.js";import{b as g,t as _,x as v}from"./react-B9IgSVeK.js";import{Yn as y,i as b,vt as x}from"./icons-C0wyat6T.js";var S=e(v(),1),C=e(g(),1),w=_();function T(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t){let n=[...new Set(t??[])].filter(e=>e.length>0).sort((e,t)=>t.length-e.length);if(n.length===0)return e;let r=n.map(T).join(`|`),i=RegExp(`(?<![\\p{L}\\p{N}])(?:${r})(?![\\p{L}\\p{N}])`,`giu`),a=[],o=0;for(let t of e.matchAll(i))a.push(e.slice(o,t.index)),a.push((0,w.jsx)(`span`,{className:`font-medium text-[var(--content-default)]`,children:t[0]},t.index)),o=t.index+t[0].length;return a.length===0?e:(a.push(e.slice(o)),(0,w.jsx)(w.Fragment,{children:a}))}function D({icon:e,title:t,subtitle:r,snippet:i,highlightTokens:a,shortcut:o,isSelected:c,onClick:u,surface:d=`overlay`}){let f=e;return d===`window`?(0,w.jsxs)(`button`,{type:`button`,role:`option`,"aria-current":c?`page`:void 0,"aria-selected":c,"aria-keyshortcuts":o?s(o):void 0,onClick:u,className:[`flex w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium outline-none transition-colors keyboard-focus:ring-2 keyboard-focus:ring-inset keyboard-focus:ring-[var(--ring)]`,i?`py-1.5`:`h-10`,c?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-secondary)] hover:bg-[var(--surface-overlay)] hover:text-[var(--content-default)]`].join(` `),children:[f?(0,w.jsx)(f,{size:16,"aria-hidden":!0,className:c?`shrink-0 text-[var(--content-default)]`:`shrink-0 text-[var(--content-tertiary)]`}):null,(0,w.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,w.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:t}),r?(0,w.jsx)(`span`,{className:`min-w-0 truncate text-xs text-[var(--content-tertiary)]`,children:r}):null,o?(0,w.jsx)(l,{accelerator:o,variant:`inline`,"aria-hidden":!0,className:`ml-auto shrink-0`}):null]}),i?(0,w.jsx)(`span`,{className:`truncate text-xs font-normal text-[var(--content-tertiary)]`,children:E(i,a)}):null]})]}):(0,w.jsx)(n,{icon:e,"aria-keyshortcuts":o?s(o):void 0,label:(0,w.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,w.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:t}),r?(0,w.jsx)(`span`,{className:`min-w-0 truncate text-[var(--content-tertiary)] text-body-small-default`,children:r}):null,o?(0,w.jsx)(l,{accelerator:o,variant:`inline`,"aria-hidden":!0,className:`ml-auto shrink-0`}):null]}),i?(0,w.jsx)(`span`,{className:`truncate text-[var(--content-tertiary)] text-body-small-default`,children:E(i,a)}):null]}),active:c,onSelect:u,className:i?`h-auto px-3 py-2`:`px-3 py-2`})}var O=`fixed inset-0 z-50 flex flex-col bg-[var(--surface-lift)]`,k={paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},A={...k,pointerEvents:`none`},j=({onKeyDown:e,children:t})=>{let{t:n}=d(),r=m(),i=h(),a=(0,S.useRef)(null);return(0,S.useLayoutEffect)(()=>{if(r)return;let e=document.activeElement;e instanceof HTMLElement&&a.current?.contains(e)&&e.blur()},[r]),(0,w.jsx)(f.div,{ref:a,className:O,style:r?k:A,role:`dialog`,"aria-modal":r?!0:void 0,"aria-hidden":r?void 0:!0,"aria-label":n(`commandPalette.searchAriaLabel`),onKeyDown:e,initial:{y:`100%`,opacity:0},animate:{y:0,opacity:1},exit:{y:`100%`,opacity:0},transition:i?{duration:0}:{duration:.28,ease:[.16,1,.3,1]},children:t})},M=({isOpen:e,onClose:n,query:s,onQueryChange:l,highlightTokens:f,selectedIndex:m,sections:h,isSearching:g=!1,onItemSelect:_,onKeyDown:v,surface:T=`overlay`})=>{let{t:E}=d(),A=i(),M=r(),N=o(),P=u(`commandPalette`),F=P?c(P):null,I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(e){let e=requestAnimationFrame(()=>{L.current?.focus()});return()=>cancelAnimationFrame(e)}},[e]),(0,S.useEffect)(()=>{if(!e||!R.current)return;let t=R.current.querySelector(`[aria-current='page']`);t&&t.scrollIntoView({block:`nearest`})},[e,m]);let z=(0,S.useCallback)(e=>{e.target===I.current&&n()},[n]),B=T===`window`,V=A&&!B,H=!N,U=M&&V;if(!e&&!U)return null;let W=0,G=(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-base)] px-4 py-3`,children:[g?(0,w.jsx)(y,{size:16,"aria-hidden":!0,className:`shrink-0 animate-spin text-[var(--content-tertiary)]`}):(0,w.jsx)(x,{size:16,"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,w.jsx)(`input`,{ref:L,type:`text`,value:s,onChange:e=>l(e.target.value),placeholder:E(`commandPalette.placeholder`),className:B?`min-w-0 flex-1 bg-transparent text-sm font-medium text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`:`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`,"aria-label":E(`commandPalette.searchAriaLabel`)}),s?V?(0,w.jsx)(`button`,{type:`button`,className:`shrink-0 text-body-medium-lighter text-[var(--content-tertiary)]`,onClick:()=>l(``),"aria-label":E(`commandPalette.clearSearch`),children:E(`commandPalette.clear`)}):B?(0,w.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,w.jsx)(b,{"aria-hidden":!0}),iconOnlyGlyphClassName:`[&_svg]:size-4`,className:`h-7 w-7 shrink-0`,"aria-label":E(`commandPalette.clearSearch`),onClick:()=>l(``)}):(0,w.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,w.jsx)(b,{}),"aria-label":E(`commandPalette.clearSearch`),onClick:()=>l(``),tintColor:`var(--content-tertiary)`}):H&&F?(0,w.jsx)(`kbd`,{className:B?`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-xs font-medium text-[var(--content-secondary)]`:`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-label-small-default text-[var(--content-tertiary)]`,children:F}):null,V?(0,w.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,w.jsx)(b,{}),expandOnMobile:!1,"aria-label":E(`commandPalette.closeSearch`),onClick:n,tintColor:`var(--content-tertiary)`}):null]}),K=(0,w.jsx)(`div`,{ref:R,className:V?`flex-1 overflow-y-auto overscroll-contain p-2`:`max-h-[360px] overflow-y-auto overscroll-contain p-2`,role:`listbox`,children:h.length===0?(0,w.jsx)(`div`,{className:`px-3 py-6 text-center`,children:(0,w.jsx)(t,{variant:`body-medium-lighter`,className:`text-[var(--content-tertiary)]`,children:E(g?`commandPalette.searching`:`commandPalette.noResults`)})}):h.map(e=>(0,w.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[(0,w.jsx)(t,{variant:`label-small-default`,as:`div`,className:B?`px-3 pb-1 pt-2 text-xs font-semibold text-[var(--content-tertiary)]`:`px-3 pb-1 pt-2 text-[var(--content-tertiary)] max-md:text-body-small-default`,children:e.label}),e.items.map(e=>{let t=W++;return(0,w.jsx)(D,{icon:e.icon,title:e.title,subtitle:e.subtitle,snippet:e.snippet,highlightTokens:f,shortcut:H?e.shortcut:void 0,isSelected:t===m,onClick:()=>_?.(e,t),surface:T},e.id)})]},e.id))});if(U)return(0,w.jsx)(p,{children:e?(0,w.jsxs)(j,{onKeyDown:v,children:[G,K]},`command-palette-sheet`):null});if(V)return(0,w.jsxs)(`div`,{className:O,role:`dialog`,"aria-modal":`true`,"aria-label":E(`commandPalette.searchAriaLabel`),onKeyDown:v,style:k,children:[G,K]});let q=(0,w.jsx)(`div`,{ref:I,role:`dialog`,"aria-modal":`true`,"aria-label":E(`commandPalette.ariaLabel`),className:T===`window`?`flex h-full w-full items-start justify-center bg-transparent p-3`:`fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-[15vh]`,onClick:z,onKeyDown:v,children:(0,w.jsxs)(`div`,{className:`flex w-full max-w-[560px] flex-col overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)] shadow-xl`,children:[G,K]})});return T===`window`?q:(0,C.createPortal)(q,document.body)};export{M as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{JC as t,QC as n,Vg as r,au as i,aw as a,cs as o,nw as s,rw as c,tw as l,ya as u}from"./app-DbJUeBix.js";import{E as d,d as f,f as p,p as m,s as h}from"./vendor-CtXGFqsu.js";import{b as g,t as _,x as v}from"./react-B9IgSVeK.js";import{Yn as y,i as b,vt as x}from"./icons-C0wyat6T.js";var S=e(v(),1),C=e(g(),1),w=_();function T(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t){let n=[...new Set(t??[])].filter(e=>e.length>0).sort((e,t)=>t.length-e.length);if(n.length===0)return e;let r=n.map(T).join(`|`),i=RegExp(`(?<![\\p{L}\\p{N}])(?:${r})(?![\\p{L}\\p{N}])`,`giu`),a=[],o=0;for(let t of e.matchAll(i))a.push(e.slice(o,t.index)),a.push((0,w.jsx)(`span`,{className:`font-medium text-[var(--content-default)]`,children:t[0]},t.index)),o=t.index+t[0].length;return a.length===0?e:(a.push(e.slice(o)),(0,w.jsx)(w.Fragment,{children:a}))}function D({icon:e,title:t,subtitle:r,snippet:i,highlightTokens:a,shortcut:o,isSelected:c,onClick:u,surface:d=`overlay`}){let f=e;return d===`window`?(0,w.jsxs)(`button`,{type:`button`,role:`option`,"aria-current":c?`page`:void 0,"aria-selected":c,"aria-keyshortcuts":o?s(o):void 0,onClick:u,className:[`flex w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium outline-none transition-colors keyboard-focus:ring-2 keyboard-focus:ring-inset keyboard-focus:ring-[var(--ring)]`,i?`py-1.5`:`h-10`,c?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-secondary)] hover:bg-[var(--surface-overlay)] hover:text-[var(--content-default)]`].join(` `),children:[f?(0,w.jsx)(f,{size:16,"aria-hidden":!0,className:c?`shrink-0 text-[var(--content-default)]`:`shrink-0 text-[var(--content-tertiary)]`}):null,(0,w.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,w.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:t}),r?(0,w.jsx)(`span`,{className:`min-w-0 truncate text-xs text-[var(--content-tertiary)]`,children:r}):null,o?(0,w.jsx)(l,{accelerator:o,variant:`inline`,"aria-hidden":!0,className:`ml-auto shrink-0`}):null]}),i?(0,w.jsx)(`span`,{className:`truncate text-xs font-normal text-[var(--content-tertiary)]`,children:E(i,a)}):null]})]}):(0,w.jsx)(n,{icon:e,"aria-keyshortcuts":o?s(o):void 0,label:(0,w.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,w.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:t}),r?(0,w.jsx)(`span`,{className:`min-w-0 truncate text-[var(--content-tertiary)] text-body-small-default`,children:r}):null,o?(0,w.jsx)(l,{accelerator:o,variant:`inline`,"aria-hidden":!0,className:`ml-auto shrink-0`}):null]}),i?(0,w.jsx)(`span`,{className:`truncate text-[var(--content-tertiary)] text-body-small-default`,children:E(i,a)}):null]}),active:c,onSelect:u,className:i?`h-auto px-3 py-2`:`px-3 py-2`})}var O=`fixed inset-0 z-50 flex flex-col bg-[var(--surface-lift)]`,k={paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},A={...k,pointerEvents:`none`},j=({onKeyDown:e,children:t})=>{let{t:n}=d(),r=m(),i=h(),a=(0,S.useRef)(null);return(0,S.useLayoutEffect)(()=>{if(r)return;let e=document.activeElement;e instanceof HTMLElement&&a.current?.contains(e)&&e.blur()},[r]),(0,w.jsx)(f.div,{ref:a,className:O,style:r?k:A,role:`dialog`,"aria-modal":r?!0:void 0,"aria-hidden":r?void 0:!0,"aria-label":n(`commandPalette.searchAriaLabel`),onKeyDown:e,initial:{y:`100%`,opacity:0},animate:{y:0,opacity:1},exit:{y:`100%`,opacity:0},transition:i?{duration:0}:{duration:.28,ease:[.16,1,.3,1]},children:t})},M=({isOpen:e,onClose:n,query:s,onQueryChange:l,highlightTokens:f,selectedIndex:m,sections:h,isSearching:g=!1,onItemSelect:_,onKeyDown:v,surface:T=`overlay`})=>{let{t:E}=d(),A=i(),M=r(),N=o(),P=u(`commandPalette`),F=P?c(P):null,I=(0,S.useRef)(null),L=(0,S.useRef)(null),R=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(e){let e=requestAnimationFrame(()=>{L.current?.focus()});return()=>cancelAnimationFrame(e)}},[e]),(0,S.useEffect)(()=>{if(!e||!R.current)return;let t=R.current.querySelector(`[aria-current='page']`);t&&t.scrollIntoView({block:`nearest`})},[e,m]);let z=(0,S.useCallback)(e=>{e.target===I.current&&n()},[n]),B=T===`window`,V=A&&!B,H=!N,U=M&&V;if(!e&&!U)return null;let W=0,G=(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-base)] px-4 py-3`,children:[g?(0,w.jsx)(y,{size:16,"aria-hidden":!0,className:`shrink-0 animate-spin text-[var(--content-tertiary)]`}):(0,w.jsx)(x,{size:16,"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,w.jsx)(`input`,{ref:L,type:`text`,value:s,onChange:e=>l(e.target.value),placeholder:E(`commandPalette.placeholder`),className:B?`min-w-0 flex-1 bg-transparent text-sm font-medium text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`:`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`,"aria-label":E(`commandPalette.searchAriaLabel`)}),s?V?(0,w.jsx)(`button`,{type:`button`,className:`shrink-0 text-body-medium-lighter text-[var(--content-tertiary)]`,onClick:()=>l(``),"aria-label":E(`commandPalette.clearSearch`),children:E(`commandPalette.clear`)}):B?(0,w.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,w.jsx)(b,{"aria-hidden":!0}),iconOnlyGlyphClassName:`[&_svg]:size-4`,className:`h-7 w-7 shrink-0`,"aria-label":E(`commandPalette.clearSearch`),onClick:()=>l(``)}):(0,w.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,w.jsx)(b,{}),"aria-label":E(`commandPalette.clearSearch`),onClick:()=>l(``),tintColor:`var(--content-tertiary)`}):H&&F?(0,w.jsx)(`kbd`,{className:B?`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-xs font-medium text-[var(--content-secondary)]`:`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-label-small-default text-[var(--content-tertiary)]`,children:F}):null,V?(0,w.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,w.jsx)(b,{}),expandOnMobile:!1,"aria-label":E(`commandPalette.closeSearch`),onClick:n,tintColor:`var(--content-tertiary)`}):null]}),K=(0,w.jsx)(`div`,{ref:R,className:V?`flex-1 overflow-y-auto overscroll-contain p-2`:`max-h-[360px] overflow-y-auto overscroll-contain p-2`,role:`listbox`,children:h.length===0?(0,w.jsx)(`div`,{className:`px-3 py-6 text-center`,children:(0,w.jsx)(t,{variant:`body-medium-lighter`,className:`text-[var(--content-tertiary)]`,children:E(g?`commandPalette.searching`:`commandPalette.noResults`)})}):h.map(e=>(0,w.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[(0,w.jsx)(t,{variant:`label-small-default`,as:`div`,className:B?`px-3 pb-1 pt-2 text-xs font-semibold text-[var(--content-tertiary)]`:`px-3 pb-1 pt-2 text-[var(--content-tertiary)] max-md:text-body-small-default`,children:e.label}),e.items.map(e=>{let t=W++;return(0,w.jsx)(D,{icon:e.icon,title:e.title,subtitle:e.subtitle,snippet:e.snippet,highlightTokens:f,shortcut:H?e.shortcut:void 0,isSelected:t===m,onClick:()=>_?.(e,t),surface:T},e.id)})]},e.id))});if(U)return(0,w.jsx)(p,{children:e?(0,w.jsxs)(j,{onKeyDown:v,children:[G,K]},`command-palette-sheet`):null});if(V)return(0,w.jsxs)(`div`,{className:O,role:`dialog`,"aria-modal":`true`,"aria-label":E(`commandPalette.searchAriaLabel`),onKeyDown:v,style:k,children:[G,K]});let q=(0,w.jsx)(`div`,{ref:I,role:`dialog`,"aria-modal":`true`,"aria-label":E(`commandPalette.ariaLabel`),className:T===`window`?`flex h-full w-full items-start justify-center bg-transparent p-3`:`fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-[15vh]`,onClick:z,onKeyDown:v,children:(0,w.jsxs)(`div`,{className:`flex w-full max-w-[560px] flex-col overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)] shadow-xl`,children:[G,K]})});return T===`window`?q:(0,C.createPortal)(q,document.body)};export{M as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./command-palette-BMTSC06x.js";export{e as CommandPalette};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$l as t,Ah as n,Cf as r,Do as i,Ja as a,Nh as o,Oh as s,cc as c,cx as l,qa as u,v_ as d,zi as f}from"./app-4aEhon_S.js";import{t as p,x as m}from"./react-B9IgSVeK.js";import{t as h}from"./command-palette-BwJ1qkwj.js";var g=e(m(),1),_=p(),v=()=>void 0,y=e=>void 0,b=e=>{switch(e.id){case`action-new-conversation`:return{kind:`newConversation`};case`action-current-conversation`:return{kind:`currentConversation`};case`action-settings`:return{kind:`openSettings`};case`action-library`:return{kind:`openLibrary`};case`action-intelligence`:return{kind:`openIdentity`};default:return e.id.startsWith(`conv-`)?{kind:`openConversation`,conversationId:e.id.slice(5)}:e.id.startsWith(`search-conv-`)?{kind:`openConversation`,conversationId:e.id.slice(12)}:e.id.startsWith(`search-schedule-`)||e.id.startsWith(`search-contact-`)?{kind:`openIdentity`}:null}};function x(){let e=s.use.sessionStatus(),p=o(),m=n();r(),c(!p),t({sessionStatus:e,hasPlatformSession:m});let x=l.use.assistants(),S=l.use.activeAssistantId(),C=d(),w=(0,g.useMemo)(()=>{let e=C??S;if(!e)return null;let t=x.find(t=>t.id===e);return t?{id:t.id,name:t.name}:null},[C,S,x]),T=w?.id??null,{conversations:E}=i(T,!0),D=(0,g.useCallback)(e=>{let t=b(e);t&&a(t)},[]),{commandPalette:O,mergedSections:k,handleItemSelect:A}=f({assistantId:T,assistantName:w?.name,conversations:E,activeConversationId:void 0,startNewConversation:v,switchConversation:v,navigate:y,navigateToSettings:v,isOpen:!0,onClose:()=>{u()},onItemSelect:D});return(0,_.jsx)(`div`,{className:`h-screen w-screen bg-transparent`,children:(0,_.jsx)(h,{isOpen:!0,surface:`window`,onClose:O.close,query:O.query,onQueryChange:O.setQuery,highlightTokens:O.searchTokens,selectedIndex:O.selectedIndex,sections:k,isSearching:O.isSearching,onItemSelect:A,onKeyDown:O.handleKeyDown})})}export{x as CommandPaletteWindowPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$l as t,Ah as n,Cf as r,Do as i,Ja as a,Nh as o,Oh as s,cc as c,cx as l,qa as u,v_ as d,zi as f}from"./app-DbJUeBix.js";import{t as p,x as m}from"./react-B9IgSVeK.js";import{t as h}from"./command-palette-BMTSC06x.js";var g=e(m(),1),_=p(),v=()=>void 0,y=e=>void 0,b=e=>{switch(e.id){case`action-new-conversation`:return{kind:`newConversation`};case`action-current-conversation`:return{kind:`currentConversation`};case`action-settings`:return{kind:`openSettings`};case`action-library`:return{kind:`openLibrary`};case`action-intelligence`:return{kind:`openIdentity`};default:return e.id.startsWith(`conv-`)?{kind:`openConversation`,conversationId:e.id.slice(5)}:e.id.startsWith(`search-conv-`)?{kind:`openConversation`,conversationId:e.id.slice(12)}:e.id.startsWith(`search-schedule-`)||e.id.startsWith(`search-contact-`)?{kind:`openIdentity`}:null}};function x(){let e=s.use.sessionStatus(),p=o(),m=n();r(),c(!p),t({sessionStatus:e,hasPlatformSession:m});let x=l.use.assistants(),S=l.use.activeAssistantId(),C=d(),w=(0,g.useMemo)(()=>{let e=C??S;if(!e)return null;let t=x.find(t=>t.id===e);return t?{id:t.id,name:t.name}:null},[C,S,x]),T=w?.id??null,{conversations:E}=i(T,!0),D=(0,g.useCallback)(e=>{let t=b(e);t&&a(t)},[]),{commandPalette:O,mergedSections:k,handleItemSelect:A}=f({assistantId:T,assistantName:w?.name,conversations:E,activeConversationId:void 0,startNewConversation:v,switchConversation:v,navigate:y,navigateToSettings:v,isOpen:!0,onClose:()=>{u()},onItemSelect:D});return(0,_.jsx)(`div`,{className:`h-screen w-screen bg-transparent`,children:(0,_.jsx)(h,{isOpen:!0,surface:`window`,onClose:O.close,query:O.query,onQueryChange:O.setQuery,highlightTokens:O.searchTokens,selectedIndex:O.selectedIndex,sections:k,isSearching:O.isSearching,onItemSelect:A,onKeyDown:O.handleKeyDown})})}export{x as CommandPaletteWindowPage};
@@ -1 +1 @@
1
- import{A as e,BC as t,Gy as n,KC as r,al as i,aw as a,j as o,k as s,ma as c}from"./app-4aEhon_S.js";import{E as l}from"./vendor-CtXGFqsu.js";import{t as u}from"./react-B9IgSVeK.js";import{$ as d,Cr as f,La as p,U as m,Ya as h,Zr as g,_r as _,pa as v,y,zt as b}from"./icons-C0wyat6T.js";var x=h(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),S=u();function C({size:e=24,className:t,style:n}){return(0,S.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,S.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}function w({size:e=24,className:t,style:n}){return(0,S.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,S.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})})}function T({size:e=24,className:t,style:n}){return(0,S.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,S.jsx)(`path`,{d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814ZM9.545 15.568V8.432L15.818 12l-6.273 3.568Z`})})}function E({t:e}){return(0,S.jsx)(r,{padding:`lg`,className:`bg-[var(--surface-lift)]`,children:(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(`div`,{className:`pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full opacity-30 blur-3xl`,style:{background:`radial-gradient(circle, var(--system-mid-weak) 0%, transparent 70%)`},"aria-hidden":!0}),(0,S.jsxs)(`div`,{className:`relative flex flex-col items-start gap-3`,children:[(0,S.jsxs)(t,{tone:`neutral`,children:[(0,S.jsx)(b,{className:`h-3.5 w-3.5`}),e(`communityPage.heroTag`)]}),(0,S.jsx)(`h1`,{className:`text-[28px] font-semibold leading-tight tracking-tight text-[var(--content-emphasised)]`,children:e(`communityPage.heroTitle`)}),(0,S.jsx)(`p`,{className:`max-w-xl text-body-medium-default text-[color:var(--content-tertiary)]`,children:e(`communityPage.heroDescription`)})]})]})})}function D({icon:e,text:t}){return(0,S.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,S.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,children:(0,S.jsx)(e,{size:14,className:`text-[var(--content-secondary)]`,"aria-hidden":!0})}),(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]})}function O({accentColor:e,iconColor:t=`var(--aux-white)`,label:n,icon:i,title:o,subtitle:s,benefits:c,primaryAction:l,secondaryAction:u}){return(0,S.jsx)(r,{padding:`lg`,className:`flex-1`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,S.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-lg`,style:{backgroundColor:e,color:t},children:i}),(0,S.jsx)(`span`,{className:`text-label-medium-default uppercase tracking-wider text-[color:var(--content-tertiary)]`,children:n})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`h2`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:o}),(0,S.jsx)(`p`,{className:`text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:s})]}),(0,S.jsx)(`ul`,{className:`flex flex-col gap-3`,children:c.map(({icon:e,text:t})=>(0,S.jsx)(D,{icon:e,text:t},t))}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(a,{onClick:l.onClick,children:[l.icon,l.label]}),u&&(0,S.jsxs)(a,{variant:`ghost`,onClick:()=>window.open(u.href,`_blank`,`noopener,noreferrer`),children:[u.label,(0,S.jsx)(p,{className:`h-3.5 w-3.5`})]})]})]})})}function k({icon:e,iconBg:t,iconColor:i=`white`,title:a,description:o,href:s}){return(0,S.jsx)(n,{href:s,className:`flex flex-1 cursor-pointer`,glyph:!1,children:(0,S.jsx)(r,{className:`flex-1 transition-shadow hover:shadow-md`,padding:`lg`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,S.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-lg`,style:{backgroundColor:t,color:i},children:e}),(0,S.jsx)(g,{size:14,className:`text-[var(--content-tertiary)]`,"aria-hidden":!0})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,S.jsx)(`span`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:a}),(0,S.jsx)(`p`,{className:`text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:o})]})]})})})}function A(){let{t}=l(`settings`),{handleStar:n}=o();return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsx)(E,{t}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,S.jsx)(O,{accentColor:`var(--content-emphasised)`,iconColor:`var(--surface-base)`,label:t(`communityPage.openSourceLabel`),icon:(0,S.jsx)(C,{size:20}),title:t(`communityPage.openSourceTitle`),subtitle:t(`communityPage.openSourceSubtitle`),benefits:[{icon:m,text:t(`communityPage.openSourceBenefitStar`)},{icon:v,text:t(`communityPage.openSourceBenefitIssues`)},{icon:x,text:t(`communityPage.openSourceBenefitContribute`)}],primaryAction:{label:t(`communityPage.starOnGitHub`),icon:(0,S.jsx)(m,{size:16}),onClick:n},secondaryAction:{label:t(`communityPage.viewSource`),href:e}}),(0,S.jsx)(O,{accentColor:`#5865F2`,label:t(`communityPage.discordLabel`),icon:(0,S.jsx)(c,{size:20}),title:t(`communityPage.discordTitle`),subtitle:t(`communityPage.discordSubtitle`),benefits:[{icon:_,text:t(`communityPage.discordBenefitTeam`)},{icon:d,text:t(`communityPage.discordBenefitFeedback`)},{icon:y,text:t(`communityPage.discordBenefitAnswers`)}],primaryAction:{label:t(`communityPage.joinDiscord`),icon:(0,S.jsx)(c,{size:16,style:{color:`currentColor`}}),onClick:s}})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wider text-[color:var(--content-tertiary)]`,children:t(`communityPage.moreFromVellum`)}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,S.jsx)(k,{icon:(0,S.jsx)(f,{size:20}),iconBg:`#22c55e`,title:t(`communityPage.communityHubTitle`),description:t(`communityPage.communityHubDescription`),href:i}),(0,S.jsx)(k,{icon:(0,S.jsx)(w,{size:20}),iconBg:`var(--content-default)`,iconColor:`var(--surface-base)`,title:t(`communityPage.followOnXTitle`),description:t(`communityPage.followOnXDescription`),href:`https://x.com/vellum_ai`}),(0,S.jsx)(k,{icon:(0,S.jsx)(T,{size:20}),iconBg:`#ef4444`,title:t(`communityPage.youtubeChannelTitle`),description:t(`communityPage.youtubeChannelDescription`),href:`https://www.youtube.com/@Vellum_AI`})]})]})]})}export{A as CommunityPage};
1
+ import{A as e,BC as t,Gy as n,KC as r,al as i,aw as a,j as o,k as s,ma as c}from"./app-DbJUeBix.js";import{E as l}from"./vendor-CtXGFqsu.js";import{t as u}from"./react-B9IgSVeK.js";import{$ as d,Cr as f,La as p,U as m,Ya as h,Zr as g,_r as _,pa as v,y,zt as b}from"./icons-C0wyat6T.js";var x=h(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),S=u();function C({size:e=24,className:t,style:n}){return(0,S.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,S.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}function w({size:e=24,className:t,style:n}){return(0,S.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,S.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})})}function T({size:e=24,className:t,style:n}){return(0,S.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,S.jsx)(`path`,{d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814ZM9.545 15.568V8.432L15.818 12l-6.273 3.568Z`})})}function E({t:e}){return(0,S.jsx)(r,{padding:`lg`,className:`bg-[var(--surface-lift)]`,children:(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(`div`,{className:`pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full opacity-30 blur-3xl`,style:{background:`radial-gradient(circle, var(--system-mid-weak) 0%, transparent 70%)`},"aria-hidden":!0}),(0,S.jsxs)(`div`,{className:`relative flex flex-col items-start gap-3`,children:[(0,S.jsxs)(t,{tone:`neutral`,children:[(0,S.jsx)(b,{className:`h-3.5 w-3.5`}),e(`communityPage.heroTag`)]}),(0,S.jsx)(`h1`,{className:`text-[28px] font-semibold leading-tight tracking-tight text-[var(--content-emphasised)]`,children:e(`communityPage.heroTitle`)}),(0,S.jsx)(`p`,{className:`max-w-xl text-body-medium-default text-[color:var(--content-tertiary)]`,children:e(`communityPage.heroDescription`)})]})]})})}function D({icon:e,text:t}){return(0,S.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,S.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,children:(0,S.jsx)(e,{size:14,className:`text-[var(--content-secondary)]`,"aria-hidden":!0})}),(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]})}function O({accentColor:e,iconColor:t=`var(--aux-white)`,label:n,icon:i,title:o,subtitle:s,benefits:c,primaryAction:l,secondaryAction:u}){return(0,S.jsx)(r,{padding:`lg`,className:`flex-1`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,S.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-lg`,style:{backgroundColor:e,color:t},children:i}),(0,S.jsx)(`span`,{className:`text-label-medium-default uppercase tracking-wider text-[color:var(--content-tertiary)]`,children:n})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`h2`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:o}),(0,S.jsx)(`p`,{className:`text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:s})]}),(0,S.jsx)(`ul`,{className:`flex flex-col gap-3`,children:c.map(({icon:e,text:t})=>(0,S.jsx)(D,{icon:e,text:t},t))}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(a,{onClick:l.onClick,children:[l.icon,l.label]}),u&&(0,S.jsxs)(a,{variant:`ghost`,onClick:()=>window.open(u.href,`_blank`,`noopener,noreferrer`),children:[u.label,(0,S.jsx)(p,{className:`h-3.5 w-3.5`})]})]})]})})}function k({icon:e,iconBg:t,iconColor:i=`white`,title:a,description:o,href:s}){return(0,S.jsx)(n,{href:s,className:`flex flex-1 cursor-pointer`,glyph:!1,children:(0,S.jsx)(r,{className:`flex-1 transition-shadow hover:shadow-md`,padding:`lg`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,S.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-lg`,style:{backgroundColor:t,color:i},children:e}),(0,S.jsx)(g,{size:14,className:`text-[var(--content-tertiary)]`,"aria-hidden":!0})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,S.jsx)(`span`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:a}),(0,S.jsx)(`p`,{className:`text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:o})]})]})})})}function A(){let{t}=l(`settings`),{handleStar:n}=o();return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsx)(E,{t}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,S.jsx)(O,{accentColor:`var(--content-emphasised)`,iconColor:`var(--surface-base)`,label:t(`communityPage.openSourceLabel`),icon:(0,S.jsx)(C,{size:20}),title:t(`communityPage.openSourceTitle`),subtitle:t(`communityPage.openSourceSubtitle`),benefits:[{icon:m,text:t(`communityPage.openSourceBenefitStar`)},{icon:v,text:t(`communityPage.openSourceBenefitIssues`)},{icon:x,text:t(`communityPage.openSourceBenefitContribute`)}],primaryAction:{label:t(`communityPage.starOnGitHub`),icon:(0,S.jsx)(m,{size:16}),onClick:n},secondaryAction:{label:t(`communityPage.viewSource`),href:e}}),(0,S.jsx)(O,{accentColor:`#5865F2`,label:t(`communityPage.discordLabel`),icon:(0,S.jsx)(c,{size:20}),title:t(`communityPage.discordTitle`),subtitle:t(`communityPage.discordSubtitle`),benefits:[{icon:_,text:t(`communityPage.discordBenefitTeam`)},{icon:d,text:t(`communityPage.discordBenefitFeedback`)},{icon:y,text:t(`communityPage.discordBenefitAnswers`)}],primaryAction:{label:t(`communityPage.joinDiscord`),icon:(0,S.jsx)(c,{size:16,style:{color:`currentColor`}}),onClick:s}})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wider text-[color:var(--content-tertiary)]`,children:t(`communityPage.moreFromVellum`)}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,S.jsx)(k,{icon:(0,S.jsx)(f,{size:20}),iconBg:`#22c55e`,title:t(`communityPage.communityHubTitle`),description:t(`communityPage.communityHubDescription`),href:i}),(0,S.jsx)(k,{icon:(0,S.jsx)(w,{size:20}),iconBg:`var(--content-default)`,iconColor:`var(--surface-base)`,title:t(`communityPage.followOnXTitle`),description:t(`communityPage.followOnXDescription`),href:`https://x.com/vellum_ai`}),(0,S.jsx)(k,{icon:(0,S.jsx)(T,{size:20}),iconBg:`#ef4444`,title:t(`communityPage.youtubeChannelTitle`),description:t(`communityPage.youtubeChannelDescription`),href:`https://www.youtube.com/@Vellum_AI`})]})]})]})}export{A as CommunityPage};
@@ -1 +1 @@
1
- import{Vc as e}from"./app-4aEhon_S.js";var t=`#5eead4`,n=/^#[0-9a-f]{6}$/i;function r(e){return e!==void 0&&n.test(e)?e:void 0}function i(t,n,i){return(t===null?void 0:r(t.accentHex))??r(n)??e(i?.color)??void 0}export{i as n,t};
1
+ import{Vc as e}from"./app-DbJUeBix.js";var t=`#5eead4`,n=/^#[0-9a-f]{6}$/i;function r(e){return e!==void 0&&n.test(e)?e:void 0}function i(t,n,i){return(t===null?void 0:r(t.accentHex))??r(n)??e(i?.color)??void 0}export{i as n,t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Nl as t,Yl as n,n_ as r}from"./app-4aEhon_S.js";import{t as i,x as a}from"./react-B9IgSVeK.js";import{n as o}from"./companion-accent-IfLn8Bat.js";var s=e(a(),1),c=i(),l=10,u=e=>{let t=l;switch(e){case`top`:return{top:t,left:`50%`,translate:`-50% 0`,width:360,height:44};case`bottom`:return{bottom:t,left:`50%`,translate:`-50% 0`,width:360,height:44};case`left`:return{left:t,top:`50%`,translate:`0 -50%`,height:360,width:44};case`right`:return{right:t,top:`50%`,translate:`0 -50%`,height:360,width:44}}};function d(){let[e,i]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=n(i);return t().then(e=>{e&&i(e)}),e},[]);let a=e?.docking;if(a===void 0)return null;let l=o(e?.call??null,e?.accentHex,e?.character)??`#5eead4`;return(0,c.jsx)(`div`,{className:`pointer-events-none relative h-screen w-screen bg-transparent select-none`,"data-testid":`companion-dock-zones`,style:{"--companion-ring-accent":l},"aria-hidden":!0,children:r.map(e=>{let t=e===a;return(0,c.jsx)(`div`,{className:`absolute rounded-2xl transition-[background-color,border-color,box-shadow] duration-150`,"data-testid":`companion-dock-zone`,"data-dock":e,"data-armed":t?`true`:`false`,style:{...u(e),backgroundColor:`color-mix(in srgb, var(--companion-ring-accent) ${t?26:9}%, transparent)`,border:`1.5px ${t?`solid`:`dashed`} color-mix(in srgb, var(--companion-ring-accent) ${t?90:45}%, transparent)`,boxShadow:t?`0 0 24px color-mix(in srgb, var(--companion-ring-accent) 45%, transparent), inset 0 0 24px color-mix(in srgb, var(--companion-ring-accent) 25%, transparent)`:void 0}},e)})})}export{d as CompanionDockZonesPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Nl as t,Yl as n,n_ as r}from"./app-DbJUeBix.js";import{t as i,x as a}from"./react-B9IgSVeK.js";import{n as o}from"./companion-accent-C8bpme2H.js";var s=e(a(),1),c=i(),l=10,u=e=>{let t=l;switch(e){case`top`:return{top:t,left:`50%`,translate:`-50% 0`,width:360,height:44};case`bottom`:return{bottom:t,left:`50%`,translate:`-50% 0`,width:360,height:44};case`left`:return{left:t,top:`50%`,translate:`0 -50%`,height:360,width:44};case`right`:return{right:t,top:`50%`,translate:`0 -50%`,height:360,width:44}}};function d(){let[e,i]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=n(i);return t().then(e=>{e&&i(e)}),e},[]);let a=e?.docking;if(a===void 0)return null;let l=o(e?.call??null,e?.accentHex,e?.character)??`#5eead4`;return(0,c.jsx)(`div`,{className:`pointer-events-none relative h-screen w-screen bg-transparent select-none`,"data-testid":`companion-dock-zones`,style:{"--companion-ring-accent":l},"aria-hidden":!0,children:r.map(e=>{let t=e===a;return(0,c.jsx)(`div`,{className:`absolute rounded-2xl transition-[background-color,border-color,box-shadow] duration-150`,"data-testid":`companion-dock-zone`,"data-dock":e,"data-armed":t?`true`:`false`,style:{...u(e),backgroundColor:`color-mix(in srgb, var(--companion-ring-accent) ${t?26:9}%, transparent)`,border:`1.5px ${t?`solid`:`dashed`} color-mix(in srgb, var(--companion-ring-accent) ${t?90:45}%, transparent)`,boxShadow:t?`0 0 24px color-mix(in srgb, var(--companion-ring-accent) 45%, transparent), inset 0 0 24px color-mix(in srgb, var(--companion-ring-accent) 25%, transparent)`:void 0}},e)})})}export{d as CompanionDockZonesPage};
@@ -1 +1 @@
1
- import{f_ as e,l_ as t,p_ as n,s_ as r}from"./app-4aEhon_S.js";var i=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,a=(e,t)=>{if(t.top>=e.bottom)return{left:t.left,right:t.right,top:e.bottom,bottom:t.top};let n={top:t.top,bottom:t.bottom};return t.left>=e.right?{left:e.right,right:t.left,...n}:{left:t.right,right:e.left,...n}},o=(e,{avatar:t,pill:n})=>{let r=t=>i(t,e.x,e.y);return r(t)?!0:n===null?!1:r(n)||r(a(t,n))};function s(i,a){let o=n(a),s=i/2,c=r(i),l=t(i,a),u=e(i,a),d=e=>e/o,f=Math.max(s,a/2);return{scale:o,avatarRel:i/a,avatarHalf:s,baseline:c,gap:l,inUnits:d,lineAt:(e,t)=>e===`up`?`calc(100% - ${d(u-t)}px)`:`${d(u+t)}px`,edgeAt:(e,t)=>{let n=d(t),r=n<0?`calc(50% - ${-n}px)`:`calc(50% + ${n}px)`;return e===`left`?{right:r}:{left:r}},introStepOff:()=>f+l}}export{i as n,o as r,s as t};
1
+ import{f_ as e,l_ as t,p_ as n,s_ as r}from"./app-DbJUeBix.js";var i=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,a=(e,t)=>{if(t.top>=e.bottom)return{left:t.left,right:t.right,top:e.bottom,bottom:t.top};let n={top:t.top,bottom:t.bottom};return t.left>=e.right?{left:e.right,right:t.left,...n}:{left:t.right,right:e.left,...n}},o=(e,{avatar:t,pill:n})=>{let r=t=>i(t,e.x,e.y);return r(t)?!0:n===null?!1:r(n)||r(a(t,n))};function s(i,a){let o=n(a),s=i/2,c=r(i),l=t(i,a),u=e(i,a),d=e=>e/o,f=Math.max(s,a/2);return{scale:o,avatarRel:i/a,avatarHalf:s,baseline:c,gap:l,inUnits:d,lineAt:(e,t)=>e===`up`?`calc(100% - ${d(u-t)}px)`:`${d(u+t)}px`,edgeAt:(e,t)=>{let n=d(t),r=n<0?`calc(50% - ${-n}px)`:`calc(50% + ${n}px)`;return e===`left`?{right:r}:{left:r}},introStepOff:()=>f+l}}export{i as n,o as r,s as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Gr as t,HC as n,Kr as r,PC as i,Qo as a,aw as o,mC as s,o_ as c}from"./app-4aEhon_S.js";import{E as l,dt as u}from"./vendor-CtXGFqsu.js";import{t as d,x as f}from"./react-B9IgSVeK.js";import{G as p,Ji as m,dr as h,h as g,i as _}from"./icons-C0wyat6T.js";var v=e(f(),1),y=d();function b({label:e,selected:t,onPick:n,trailing:r}){return(0,y.jsxs)(`div`,{role:`option`,"aria-selected":t,className:a(`flex min-h-9 items-center gap-2 rounded-lg px-3 py-1.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),onClick:n,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:e}),r,t?(0,y.jsx)(m,{"aria-hidden":!0,className:`size-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`})]})}function x({label:e,children:t}){return(0,y.jsx)(n,{className:`-mx-2 min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`flex flex-col`,children:t})})}function S({popover:e,onAnswer:t}){let{t:n}=l();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(x,{label:n(`companionPopover.microphoneTitle`),children:[(0,y.jsx)(b,{label:n(`companionPopover.systemDefault`),selected:e.selected===``,onPick:()=>t?.({kind:`pick`,optionId:``})}),e.options.map(n=>(0,y.jsx)(b,{label:n.label,selected:e.selected===n.id,onPick:()=>t?.({kind:`pick`,optionId:n.id})},n.id))]}),e.needsPermission?(0,y.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`companionPopover.microphonePermissionHint`)}):null]})}function C(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{n.current?.pause(),n.current=null},[]),{playing:e,play:(e,r)=>{n.current?.pause();let i=new Audio(r);n.current=i,t(e);let a=()=>{n.current===i&&(n.current=null,t(null))};i.onended=a,i.onerror=a,i.play().catch(a)},stop:()=>{n.current?.pause(),n.current=null,t(null)}}}function w({popover:e,onAnswer:t}){let{t:n}=l(),{playing:r,play:i,stop:a}=C();return(0,y.jsx)(x,{label:n(`companionPopover.voiceTitle`),children:e.groups.map(s=>(0,y.jsxs)(`div`,{role:`group`,"aria-label":s.accent,children:[(0,y.jsx)(`div`,{className:`px-3 pt-3 pb-1 text-label-small-default text-[var(--content-tertiary)]`,children:s.accent}),s.voices.map(s=>{let c=r===s.id;return(0,y.jsx)(b,{label:s.isDefault?(0,y.jsxs)(y.Fragment,{children:[s.label,(0,y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` ${n(`companionPopover.defaultSuffix`)}`})]}):s.label,selected:e.selected===s.id,onPick:()=>t?.({kind:`pick`,optionId:s.id}),trailing:s.sampleUrl===``?void 0:(0,y.jsx)(o,{variant:`ghost`,size:`compact`,className:`size-7 shrink-0`,iconOnly:c?(0,y.jsx)(p,{}):(0,y.jsx)(g,{}),"aria-label":c?n(`companionPopover.stopPreview`):n(`companionPopover.previewVoice`,{voice:s.label}),onClick:e=>{e.stopPropagation(),c?a():i(s.id,s.sampleUrl)}})},s.id)})]},s.accent))})}var T=e=>/^https?:\/\//i.test(e)||/^data:image\//i.test(e),E=`border border-white/5 bg-[var(--surface-base)] text-[var(--content-default)] shadow-lg shadow-black/40`;function D({popover:e,view:t,cardRef:n,onAnswer:r,onView:i,onOpenLink:o,attached:s=!1,className:c,style:u}){let{t:d}=l();return(e.kind===`approvals`||e.kind===`secret`)&&t!==`expanded`?(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:a(`w-max max-w-[640px] rounded-[22px]`,E,c),style:u,children:(0,y.jsx)(O,{popover:e,onAnswer:r,onView:i})}):(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:a(`flex min-h-0 flex-col gap-3 p-4 text-[var(--content-default)]`,!s&&`rounded-[20px] border border-white/10 bg-[#17181b] shadow-2xl shadow-black/50`,e.kind===`approvals`?`w-max max-w-[640px]`:`w-[360px]`,(e.kind===`microphones`||e.kind===`voices`)&&`gap-2 px-4 pb-3`,c),style:u,children:e.kind===`approvals`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:d(`companionPopover.needsOkCount`,{count:e.items.length}),onClose:()=>i?.(`deferred`)}),(0,y.jsx)(I,{items:e.items,onAnswer:r})]}):e.kind===`secret`?(0,y.jsx)(L,{popover:e,onAnswer:r,onView:i}):e.kind===`microphones`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:d(`companionPopover.microphoneTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(S,{popover:e,onAnswer:r})]}):e.kind===`voices`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:d(`companionPopover.voiceTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(w,{popover:e,onAnswer:r})]}):(0,y.jsx)(R,{popover:e,onAnswer:r,onOpenLink:o})})}function O({popover:e,onAnswer:t,onView:n,className:r}){let{t:i}=l(),o=e.kind===`approvals`?e.items[0]:void 0,s=e.kind===`approvals`&&e.items.length===1;return(0,y.jsxs)(`div`,{"data-companion-prompt-row":e.kind,className:a(`flex min-h-11 min-w-0 items-center gap-1.5 py-1.5 pr-1.5 text-[var(--content-default)]`,e.kind===`secret`?`pl-2`:`pl-4`,r),children:[e.kind===`secret`?(0,y.jsx)(H,{providerKey:e.providerKey}):null,(0,y.jsx)(N,{className:`min-w-0 flex-1 text-body-medium-default`,maxWidth:k,text:e.kind===`secret`?e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}):s&&o!==void 0?o.title:i(`companionPopover.needsOkCount`,{count:e.items.length})}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-1`,children:s&&o!==void 0?(0,y.jsx)(P,{item:o,pill:!0,onAnswer:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`secondary`,onClick:()=>n?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(G,{tone:`primary`,onClick:()=>n?.(`expanded`),children:e.kind===`secret`?i(`companionPopover.enter`):i(`companionPopover.review`)})]})})]})}var k=440,A=400;function j(e,t,n){let r=e.trim().split(/\s+/).filter(e=>e!==``),i=r.length;if(i<2||n(r.join(` `))<=t)return[r.join(` `)];let a=r.map(()=>[]);for(let e=0;e<i;e+=1)for(let t=e+1;t<=i;t+=1)a[e][t]=n(r.slice(e,t).join(` `));let o=(e,t)=>r.slice(e,t).join(` `),s=[];for(let e=0;e<i;){let n=e+1;for(;n<i&&a[e][n+1]<=t;)n+=1;s.push(o(e,n)),e=n}if(s.length<2||i>M)return s;let c=e=>{let n=null;for(let r=i-1;r>=e-1;--r){let o=a[r][i];if(o>t&&r!==i-1)continue;let s=new Map;for(let e=1;e<=r;e+=1)a[0][e]<=o&&s.set(`${e}:0`,{cost:(o-a[0][e])**2,breaks:[0]});for(let t=2;t<=e-1;t+=1){let e=new Map;for(let[t,n]of s){let[i,s]=t.split(`:`).map(Number),c=a[s][i];for(let t=i+1;t<=r;t+=1){let r=a[i][t];if(r<c||r>o)continue;let s=n.cost+(o-r)**2,l=`${t}:${i}`,u=e.get(l);(u===void 0||s<u.cost)&&e.set(l,{cost:s,breaks:[...n.breaks,i]})}}s=e}for(let[e,t]of s){let[i,s]=e.split(`:`).map(Number);i!==r||a[s][i]>o||(n===null||t.cost<n.cost)&&(n={cost:t.cost,breaks:[...t.breaks,r]})}}if(n===null)return null;let r=[...n.breaks,i];return n.breaks.map((e,t)=>o(e,r[t+1]))};for(let e=s.length;e<=i;e+=1){let t=c(e);if(t!==null)return t}return s}var M=48;function N({text:e,maxWidth:t,className:n,title:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let n=i.current;if(n===null)return;let r=!1,a=()=>{if(r)return;let i=document.createElement(`span`);i.style.cssText=`position:absolute;visibility:hidden;white-space:pre;left:0;top:0`,n.appendChild(i);let a=new Map,s=j(e,t,e=>{let t=a.get(e);if(t!==void 0)return t;i.textContent=e;let n=i.getBoundingClientRect().width;return a.set(e,n),n});i.remove(),o(s.length>1?s:null)};return a(),document.fonts?.addEventListener(`loadingdone`,a),document.fonts?.ready.then(a),()=>{r=!0,document.fonts?.removeEventListener(`loadingdone`,a)}},[e,t]),(0,y.jsx)(`span`,{ref:i,dir:`auto`,className:n,title:r,children:a===null?e:a.map((e,t)=>(0,y.jsxs)(`span`,{className:`block whitespace-nowrap`,children:[e,t<a.length-1?` `:null]},t))})}function P({item:e,pill:t,onAnswer:n}){let{t:r}=l(),i=()=>n?.({kind:`deny`,itemId:e.id}),a=()=>n?.({kind:e.permission===void 0?`allow`:`settings`,itemId:e.id});return t?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`negative`,onClick:i,children:r(`companionPopover.deny`)}),(0,y.jsx)(G,{tone:`primary`,onClick:a,children:r(`companionPopover.allow`)})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{variant:`dangerOutline`,onClick:i,children:r(`companionPopover.deny`)}),(0,y.jsx)(o,{variant:`primary`,onClick:a,children:r(`companionPopover.allow`)})]})}function F({title:e,icon:t,emphasis:n=!1,onClose:r}){let{t:i}=l();return(0,y.jsxs)(`div`,{className:`-mt-0.5 -mr-1.5 flex min-h-7 items-center gap-2`,children:[t,(0,y.jsx)(`p`,{dir:`auto`,className:a(`min-w-0 flex-1`,n?`text-title-small leading-snug`:`text-body-small-default text-[var(--content-tertiary)] select-none`),children:e}),(0,y.jsx)(o,{variant:`ghost`,className:`size-7 rounded-lg px-0`,"aria-label":i(`companionPopover.dismiss`),iconOnly:(0,y.jsx)(_,{className:`size-4`,strokeWidth:2}),onClick:r})]})}function I({items:e,onAnswer:t}){return(0,y.jsx)(n,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,n)=>(0,y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-lift)] text-body-medium-default text-[var(--content-tertiary)]`,children:n+1}),(0,y.jsx)(N,{className:`min-w-0 flex-1 pl-1 text-body-medium-default`,maxWidth:A,title:e.detail===``?void 0:e.detail,text:e.title}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-2`,children:(0,y.jsx)(P,{item:e,pill:!1,onAnswer:t})})]},e.id))})})}function L({popover:e,onAnswer:t,onView:r}){let{t:a}=l(),[s,u]=(0,v.useState)(``),d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=()=>{d.current?.focus()};return e(),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[]),(0,y.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s!==``&&t?.({kind:`secret`,value:s})},children:[(0,y.jsx)(F,{icon:(0,y.jsx)(H,{providerKey:e.providerKey}),title:e.service===``?a(`companionPopover.needsCredentials`):a(`companionPopover.needsCredentialsFor`,{service:e.service}),onClose:()=>r?.(`deferred`)}),(0,y.jsx)(n,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.detail===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.detail}),(0,y.jsx)(i,{ref:d,type:`password`,fullWidth:!0,autoComplete:`off`,className:`select-text`,maxLength:c,label:e.label===``?a(`companionPopover.credentialLabel`):e.label,placeholder:e.placeholder,value:s,onChange:e=>{u(e.target.value)}})]})}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,y.jsx)(o,{variant:`outlined`,onClick:()=>r?.(`deferred`),children:a(`companionPopover.notNow`)}),(0,y.jsx)(o,{variant:`primary`,type:`submit`,disabled:s===``,children:a(`companionPopover.confirm`)})]})]})}function R({popover:e,onAnswer:t,onOpenLink:r}){let{t:i}=l(),[a,s]=(0,v.useState)(!1);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{emphasis:!0,title:e.title===``?e.kind===`surface`?i(`companionPopover.surfaceFallback`):``:e.title,onClose:()=>t?.({kind:`dismiss`})}),e.kind===`card`?(0,y.jsxs)(y.Fragment,{children:[e.subtitle===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`-mt-2.5 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e.subtitle}),(0,y.jsx)(n,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.body===``?null:(0,y.jsx)(z,{body:e.body,onOpenLink:r})})}),e.actions.length>0?(0,y.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:U(e.actions).map(e=>(0,y.jsx)(o,{variant:W(e),disabled:a,onClick:()=>{s(!0),t?.({kind:`action`,actionId:e.id})},children:e.label},e.id))}):null]}):(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,y.jsx)(o,{variant:`primary`,onClick:()=>t?.({kind:`open`}),children:i(`companionPopover.openApp`)})})})]})}function z({body:e,onOpenLink:t}){return(0,y.jsx)(s,{content:e,className:`text-body-medium-lighter text-[var(--content-secondary)] [&_li]:mb-1 [&_ol]:mb-2 [&_ol]:pl-4 [&_p]:mb-2 [&_ul]:mb-2 [&_ul]:pl-4`,linkComponent:(0,v.useCallback)(({href:e,children:n})=>(0,y.jsx)(`a`,{href:e,className:`text-[var(--content-default)] underline decoration-[var(--content-tertiary)] underline-offset-2 hover:decoration-[var(--content-default)]`,onClick:n=>{n.preventDefault(),e!==void 0&&t?.(e)},children:n}),[t]),imageComponent:V,urlTransform:B})}var B=e=>/^data:image\//i.test(e)?e:u(e),V=({src:e,alt:t})=>T(e)?(0,y.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`my-1 max-h-60 w-full rounded-xl object-contain`}):null;function H({providerKey:e}){return e!==void 0&&r(e)?(0,y.jsx)(t,{providerKey:e,displayName:null,logoUrl:null,size:24}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 shrink-0 items-center justify-center text-[var(--content-tertiary)]`,children:(0,y.jsx)(h,{className:`size-4`,strokeWidth:2})})}var U=e=>[...e.filter(e=>e.style!==`primary`),...e.filter(e=>e.style===`primary`)],W=e=>{switch(e.style){case`primary`:return`primary`;case`destructive`:return`danger`;case`secondary`:return`outlined`;case`tertiary`:return`ghost`}};function G({tone:e,onClick:t,type:n=`button`,disabled:r,children:i}){return(0,y.jsx)(o,{shape:`pill`,type:n,disabled:r,variant:e===`primary`?`primary`:e===`negative`?`dangerGhost`:`ghost`,className:a(`h-8 px-3`,e===`secondary`&&`bg-[var(--surface-lift)] hover:bg-[var(--surface-active)]`,e===`negative`&&`bg-[var(--system-negative-weak)]`),onClick:t,children:i})}export{O as n,D as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Gr as t,HC as n,Kr as r,PC as i,Qo as a,aw as o,mC as s,o_ as c}from"./app-DbJUeBix.js";import{E as l,dt as u}from"./vendor-CtXGFqsu.js";import{t as d,x as f}from"./react-B9IgSVeK.js";import{G as p,Ji as m,dr as h,h as g,i as _}from"./icons-C0wyat6T.js";var v=e(f(),1),y=d();function b({label:e,selected:t,onPick:n,trailing:r}){return(0,y.jsxs)(`div`,{role:`option`,"aria-selected":t,className:a(`flex min-h-9 items-center gap-2 rounded-lg px-3 py-1.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),onClick:n,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:e}),r,t?(0,y.jsx)(m,{"aria-hidden":!0,className:`size-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`})]})}function x({label:e,children:t}){return(0,y.jsx)(n,{className:`-mx-2 min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`flex flex-col`,children:t})})}function S({popover:e,onAnswer:t}){let{t:n}=l();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(x,{label:n(`companionPopover.microphoneTitle`),children:[(0,y.jsx)(b,{label:n(`companionPopover.systemDefault`),selected:e.selected===``,onPick:()=>t?.({kind:`pick`,optionId:``})}),e.options.map(n=>(0,y.jsx)(b,{label:n.label,selected:e.selected===n.id,onPick:()=>t?.({kind:`pick`,optionId:n.id})},n.id))]}),e.needsPermission?(0,y.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`companionPopover.microphonePermissionHint`)}):null]})}function C(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{n.current?.pause(),n.current=null},[]),{playing:e,play:(e,r)=>{n.current?.pause();let i=new Audio(r);n.current=i,t(e);let a=()=>{n.current===i&&(n.current=null,t(null))};i.onended=a,i.onerror=a,i.play().catch(a)},stop:()=>{n.current?.pause(),n.current=null,t(null)}}}function w({popover:e,onAnswer:t}){let{t:n}=l(),{playing:r,play:i,stop:a}=C();return(0,y.jsx)(x,{label:n(`companionPopover.voiceTitle`),children:e.groups.map(s=>(0,y.jsxs)(`div`,{role:`group`,"aria-label":s.accent,children:[(0,y.jsx)(`div`,{className:`px-3 pt-3 pb-1 text-label-small-default text-[var(--content-tertiary)]`,children:s.accent}),s.voices.map(s=>{let c=r===s.id;return(0,y.jsx)(b,{label:s.isDefault?(0,y.jsxs)(y.Fragment,{children:[s.label,(0,y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` ${n(`companionPopover.defaultSuffix`)}`})]}):s.label,selected:e.selected===s.id,onPick:()=>t?.({kind:`pick`,optionId:s.id}),trailing:s.sampleUrl===``?void 0:(0,y.jsx)(o,{variant:`ghost`,size:`compact`,className:`size-7 shrink-0`,iconOnly:c?(0,y.jsx)(p,{}):(0,y.jsx)(g,{}),"aria-label":c?n(`companionPopover.stopPreview`):n(`companionPopover.previewVoice`,{voice:s.label}),onClick:e=>{e.stopPropagation(),c?a():i(s.id,s.sampleUrl)}})},s.id)})]},s.accent))})}var T=e=>/^https?:\/\//i.test(e)||/^data:image\//i.test(e),E=`border border-white/5 bg-[var(--surface-base)] text-[var(--content-default)] shadow-lg shadow-black/40`;function D({popover:e,view:t,cardRef:n,onAnswer:r,onView:i,onOpenLink:o,attached:s=!1,className:c,style:u}){let{t:d}=l();return(e.kind===`approvals`||e.kind===`secret`)&&t!==`expanded`?(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:a(`w-max max-w-[640px] rounded-[22px]`,E,c),style:u,children:(0,y.jsx)(O,{popover:e,onAnswer:r,onView:i})}):(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:a(`flex min-h-0 flex-col gap-3 p-4 text-[var(--content-default)]`,!s&&`rounded-[20px] border border-white/10 bg-[#17181b] shadow-2xl shadow-black/50`,e.kind===`approvals`?`w-max max-w-[640px]`:`w-[360px]`,(e.kind===`microphones`||e.kind===`voices`)&&`gap-2 px-4 pb-3`,c),style:u,children:e.kind===`approvals`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:d(`companionPopover.needsOkCount`,{count:e.items.length}),onClose:()=>i?.(`deferred`)}),(0,y.jsx)(I,{items:e.items,onAnswer:r})]}):e.kind===`secret`?(0,y.jsx)(L,{popover:e,onAnswer:r,onView:i}):e.kind===`microphones`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:d(`companionPopover.microphoneTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(S,{popover:e,onAnswer:r})]}):e.kind===`voices`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:d(`companionPopover.voiceTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(w,{popover:e,onAnswer:r})]}):(0,y.jsx)(R,{popover:e,onAnswer:r,onOpenLink:o})})}function O({popover:e,onAnswer:t,onView:n,className:r}){let{t:i}=l(),o=e.kind===`approvals`?e.items[0]:void 0,s=e.kind===`approvals`&&e.items.length===1;return(0,y.jsxs)(`div`,{"data-companion-prompt-row":e.kind,className:a(`flex min-h-11 min-w-0 items-center gap-1.5 py-1.5 pr-1.5 text-[var(--content-default)]`,e.kind===`secret`?`pl-2`:`pl-4`,r),children:[e.kind===`secret`?(0,y.jsx)(H,{providerKey:e.providerKey}):null,(0,y.jsx)(N,{className:`min-w-0 flex-1 text-body-medium-default`,maxWidth:k,text:e.kind===`secret`?e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}):s&&o!==void 0?o.title:i(`companionPopover.needsOkCount`,{count:e.items.length})}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-1`,children:s&&o!==void 0?(0,y.jsx)(P,{item:o,pill:!0,onAnswer:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`secondary`,onClick:()=>n?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(G,{tone:`primary`,onClick:()=>n?.(`expanded`),children:e.kind===`secret`?i(`companionPopover.enter`):i(`companionPopover.review`)})]})})]})}var k=440,A=400;function j(e,t,n){let r=e.trim().split(/\s+/).filter(e=>e!==``),i=r.length;if(i<2||n(r.join(` `))<=t)return[r.join(` `)];let a=r.map(()=>[]);for(let e=0;e<i;e+=1)for(let t=e+1;t<=i;t+=1)a[e][t]=n(r.slice(e,t).join(` `));let o=(e,t)=>r.slice(e,t).join(` `),s=[];for(let e=0;e<i;){let n=e+1;for(;n<i&&a[e][n+1]<=t;)n+=1;s.push(o(e,n)),e=n}if(s.length<2||i>M)return s;let c=e=>{let n=null;for(let r=i-1;r>=e-1;--r){let o=a[r][i];if(o>t&&r!==i-1)continue;let s=new Map;for(let e=1;e<=r;e+=1)a[0][e]<=o&&s.set(`${e}:0`,{cost:(o-a[0][e])**2,breaks:[0]});for(let t=2;t<=e-1;t+=1){let e=new Map;for(let[t,n]of s){let[i,s]=t.split(`:`).map(Number),c=a[s][i];for(let t=i+1;t<=r;t+=1){let r=a[i][t];if(r<c||r>o)continue;let s=n.cost+(o-r)**2,l=`${t}:${i}`,u=e.get(l);(u===void 0||s<u.cost)&&e.set(l,{cost:s,breaks:[...n.breaks,i]})}}s=e}for(let[e,t]of s){let[i,s]=e.split(`:`).map(Number);i!==r||a[s][i]>o||(n===null||t.cost<n.cost)&&(n={cost:t.cost,breaks:[...t.breaks,r]})}}if(n===null)return null;let r=[...n.breaks,i];return n.breaks.map((e,t)=>o(e,r[t+1]))};for(let e=s.length;e<=i;e+=1){let t=c(e);if(t!==null)return t}return s}var M=48;function N({text:e,maxWidth:t,className:n,title:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let n=i.current;if(n===null)return;let r=!1,a=()=>{if(r)return;let i=document.createElement(`span`);i.style.cssText=`position:absolute;visibility:hidden;white-space:pre;left:0;top:0`,n.appendChild(i);let a=new Map,s=j(e,t,e=>{let t=a.get(e);if(t!==void 0)return t;i.textContent=e;let n=i.getBoundingClientRect().width;return a.set(e,n),n});i.remove(),o(s.length>1?s:null)};return a(),document.fonts?.addEventListener(`loadingdone`,a),document.fonts?.ready.then(a),()=>{r=!0,document.fonts?.removeEventListener(`loadingdone`,a)}},[e,t]),(0,y.jsx)(`span`,{ref:i,dir:`auto`,className:n,title:r,children:a===null?e:a.map((e,t)=>(0,y.jsxs)(`span`,{className:`block whitespace-nowrap`,children:[e,t<a.length-1?` `:null]},t))})}function P({item:e,pill:t,onAnswer:n}){let{t:r}=l(),i=()=>n?.({kind:`deny`,itemId:e.id}),a=()=>n?.({kind:e.permission===void 0?`allow`:`settings`,itemId:e.id});return t?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`negative`,onClick:i,children:r(`companionPopover.deny`)}),(0,y.jsx)(G,{tone:`primary`,onClick:a,children:r(`companionPopover.allow`)})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{variant:`dangerOutline`,onClick:i,children:r(`companionPopover.deny`)}),(0,y.jsx)(o,{variant:`primary`,onClick:a,children:r(`companionPopover.allow`)})]})}function F({title:e,icon:t,emphasis:n=!1,onClose:r}){let{t:i}=l();return(0,y.jsxs)(`div`,{className:`-mt-0.5 -mr-1.5 flex min-h-7 items-center gap-2`,children:[t,(0,y.jsx)(`p`,{dir:`auto`,className:a(`min-w-0 flex-1`,n?`text-title-small leading-snug`:`text-body-small-default text-[var(--content-tertiary)] select-none`),children:e}),(0,y.jsx)(o,{variant:`ghost`,className:`size-7 rounded-lg px-0`,"aria-label":i(`companionPopover.dismiss`),iconOnly:(0,y.jsx)(_,{className:`size-4`,strokeWidth:2}),onClick:r})]})}function I({items:e,onAnswer:t}){return(0,y.jsx)(n,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,n)=>(0,y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-lift)] text-body-medium-default text-[var(--content-tertiary)]`,children:n+1}),(0,y.jsx)(N,{className:`min-w-0 flex-1 pl-1 text-body-medium-default`,maxWidth:A,title:e.detail===``?void 0:e.detail,text:e.title}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-2`,children:(0,y.jsx)(P,{item:e,pill:!1,onAnswer:t})})]},e.id))})})}function L({popover:e,onAnswer:t,onView:r}){let{t:a}=l(),[s,u]=(0,v.useState)(``),d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=()=>{d.current?.focus()};return e(),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[]),(0,y.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s!==``&&t?.({kind:`secret`,value:s})},children:[(0,y.jsx)(F,{icon:(0,y.jsx)(H,{providerKey:e.providerKey}),title:e.service===``?a(`companionPopover.needsCredentials`):a(`companionPopover.needsCredentialsFor`,{service:e.service}),onClose:()=>r?.(`deferred`)}),(0,y.jsx)(n,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.detail===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.detail}),(0,y.jsx)(i,{ref:d,type:`password`,fullWidth:!0,autoComplete:`off`,className:`select-text`,maxLength:c,label:e.label===``?a(`companionPopover.credentialLabel`):e.label,placeholder:e.placeholder,value:s,onChange:e=>{u(e.target.value)}})]})}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,y.jsx)(o,{variant:`outlined`,onClick:()=>r?.(`deferred`),children:a(`companionPopover.notNow`)}),(0,y.jsx)(o,{variant:`primary`,type:`submit`,disabled:s===``,children:a(`companionPopover.confirm`)})]})]})}function R({popover:e,onAnswer:t,onOpenLink:r}){let{t:i}=l(),[a,s]=(0,v.useState)(!1);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{emphasis:!0,title:e.title===``?e.kind===`surface`?i(`companionPopover.surfaceFallback`):``:e.title,onClose:()=>t?.({kind:`dismiss`})}),e.kind===`card`?(0,y.jsxs)(y.Fragment,{children:[e.subtitle===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`-mt-2.5 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e.subtitle}),(0,y.jsx)(n,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.body===``?null:(0,y.jsx)(z,{body:e.body,onOpenLink:r})})}),e.actions.length>0?(0,y.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:U(e.actions).map(e=>(0,y.jsx)(o,{variant:W(e),disabled:a,onClick:()=>{s(!0),t?.({kind:`action`,actionId:e.id})},children:e.label},e.id))}):null]}):(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,y.jsx)(o,{variant:`primary`,onClick:()=>t?.({kind:`open`}),children:i(`companionPopover.openApp`)})})})]})}function z({body:e,onOpenLink:t}){return(0,y.jsx)(s,{content:e,className:`text-body-medium-lighter text-[var(--content-secondary)] [&_li]:mb-1 [&_ol]:mb-2 [&_ol]:pl-4 [&_p]:mb-2 [&_ul]:mb-2 [&_ul]:pl-4`,linkComponent:(0,v.useCallback)(({href:e,children:n})=>(0,y.jsx)(`a`,{href:e,className:`text-[var(--content-default)] underline decoration-[var(--content-tertiary)] underline-offset-2 hover:decoration-[var(--content-default)]`,onClick:n=>{n.preventDefault(),e!==void 0&&t?.(e)},children:n}),[t]),imageComponent:V,urlTransform:B})}var B=e=>/^data:image\//i.test(e)?e:u(e),V=({src:e,alt:t})=>T(e)?(0,y.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`my-1 max-h-60 w-full rounded-xl object-contain`}):null;function H({providerKey:e}){return e!==void 0&&r(e)?(0,y.jsx)(t,{providerKey:e,displayName:null,logoUrl:null,size:24}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 shrink-0 items-center justify-center text-[var(--content-tertiary)]`,children:(0,y.jsx)(h,{className:`size-4`,strokeWidth:2})})}var U=e=>[...e.filter(e=>e.style!==`primary`),...e.filter(e=>e.style===`primary`)],W=e=>{switch(e.style){case`primary`:return`primary`;case`destructive`:return`danger`;case`secondary`:return`outlined`;case`tertiary`:return`ghost`}};function G({tone:e,onClick:t,type:n=`button`,disabled:r,children:i}){return(0,y.jsx)(o,{shape:`pill`,type:n,disabled:r,variant:e===`primary`?`primary`:e===`negative`?`dangerGhost`:`ghost`,className:a(`h-8 px-3`,e===`secondary`&&`bg-[var(--surface-lift)] hover:bg-[var(--surface-active)]`,e===`negative`&&`bg-[var(--system-negative-weak)]`),onClick:t,children:i})}export{O as n,D as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Gl as t,Il as n,Nl as r,Ol as i,Wl as a,Yl as o}from"./app-4aEhon_S.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{t as l}from"./companion-popover-DJZq3u_E.js";var u=e(c(),1),d=s();function f(){let[e,s]=(0,u.useState)(null),c=(0,u.useRef)(null);(0,u.useEffect)(()=>{let e=o(s);return r().then(e=>{e&&s(e)}),e},[]);let f=e?.popover,p=f?.id,m=e?.popoverView??`row`;return(0,u.useLayoutEffect)(()=>{let e=c.current;if(p===void 0||e===null)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();a(p,Math.ceil(t)+24,Math.ceil(n)+24)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[p,m]),f===void 0?null:(0,d.jsx)(`div`,{"data-theme":`dark`,className:`h-screen w-screen bg-transparent select-none`,style:{padding:12},children:(0,d.jsx)(l,{popover:f,view:m,cardRef:c,style:{maxHeight:536},onAnswer:e=>{i(e,f.id)},onView:e=>{t(f.id,e)},onOpenLink:e=>{n(e)}},f.id)})}export{f as CompanionPopoverPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Gl as t,Il as n,Nl as r,Ol as i,Wl as a,Yl as o}from"./app-DbJUeBix.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{t as l}from"./companion-popover-BYFhyUGI.js";var u=e(c(),1),d=s();function f(){let[e,s]=(0,u.useState)(null),c=(0,u.useRef)(null);(0,u.useEffect)(()=>{let e=o(s);return r().then(e=>{e&&s(e)}),e},[]);let f=e?.popover,p=f?.id,m=e?.popoverView??`row`;return(0,u.useLayoutEffect)(()=>{let e=c.current;if(p===void 0||e===null)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();a(p,Math.ceil(t)+24,Math.ceil(n)+24)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[p,m]),f===void 0?null:(0,d.jsx)(`div`,{"data-theme":`dark`,className:`h-screen w-screen bg-transparent select-none`,style:{padding:12},children:(0,d.jsx)(l,{popover:f,view:m,cardRef:c,style:{maxHeight:536},onAnswer:e=>{i(e,f.id)},onView:e=>{t(f.id,e)},onOpenLink:e=>{n(e)}},f.id)})}export{f as CompanionPopoverPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{HC as t,IS as n,Na as r,a_ as i,aw as a,df as o,ff as s,i_ as c,mf as l,os as u,pf as d,r_ as f,t_ as p,ta as m,tu as h,u_ as g,wn as _}from"./app-4aEhon_S.js";import{E as v,d as y,s as b}from"./vendor-CtXGFqsu.js";import{t as x,x as S}from"./react-B9IgSVeK.js";import{Ai as C,Cr as w,Fa as T,G as ee,Gi as E,Ji as D,Ki as O,Tn as k,Wi as A,Xr as te,Ya as j,Yr as ne,Zt as M,bt as re,h as ie,i as N,m as ae,qi as oe,wn as P}from"./icons-C0wyat6T.js";import{l as F,n as I,t as se}from"./permission-setup-Dmd2zFPe.js";import{t as ce}from"./companion-layout-B32ZeRsg.js";var le=j(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ue=j(`screen-share`,[[`path`,{d:`M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3`,key:`i8wdob`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m17 8 5-5`,key:`fqif7o`}],[`path`,{d:`M17 3h5v5`,key:`1o3tu8`}]]),de=j(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),L=e(S(),1);function fe(e,t){return e===`inputMonitoring`||t?.canRequest===!1||e!==`screen`&&t?.status===`denied`}var pe={try:`microphone`,key:`inputMonitoring`,share:`screen`};function R(e){return e!==null&&(e.state.phase!==`known`||e.state.item.status!==`granted`)}function me(e){let t=e===null?null:pe[e]??null,r=e!==null,[i,a]=(0,L.useState)(void 0),[c,f]=(0,L.useState)(null),p=(0,L.useRef)(()=>{});return(0,L.useEffect)(()=>{if(f(null),!r)return;let e=!0,i=!1,c=0,m=!1,g=!1,_=null,v=async()=>{if(!(!e||i||g||_!==`ready`)){g=!0;try{let t=await u();if(!e||i||_!==`ready`||t===null||t===`com.apple.systempreferences`||t===`com.apple.SecurityAgent`)return;_=null,I(),await h()}catch(e){n(e,{context:`companionIntro.resumeAfterPermission`})}finally{g=!1}}},y=(n,r=!1)=>{e&&(a(e=>JSON.stringify(e)===JSON.stringify(n)?e:n),r||f(null),_!==null&&t!==null&&(_=n?n[t].status===`granted`?`ready`:`waiting`:null,v()))},b=r=>{e&&(t!==null&&f({kind:t,phase:`error`}),n(r,{context:`companionIntro.permission`,tags:{kind:t??`tour`}}))},x=async()=>{if(m||i)return;m=!0;let t=c;try{let n=await o();e&&t===c&&!i&&y(n),n===null&&clearInterval(S)}catch(e){t===c&&!i&&b(e)}finally{m=!1}},S=setInterval(()=>{x()},2e3),C=l(e=>{c+=1,y(e,i)});return x(),p.current=n=>{!e||i||t===null||(i=!0,c+=1,f({kind:t,phase:`requesting`}),(async()=>{try{let r=await o();if(!e)return;if(!r){y(null);return}let i=r[t];if(i.status===`granted`||i.status===`restricted`){y(r);return}let a=c;_=`waiting`;let l=t!==`microphone`&&F()?await se(t,n):fe(t,i)?await s(t):await d(t);e&&(a===c?y(l?{...r,[t]:l}:null):f(null))}catch(e){_=null,b(e)}finally{i=!1,v()}})())},()=>{e=!1,I(),clearInterval(S),C()}},[t,r]),t===null||i===null?null:{kind:t,state:c?.kind===t?{phase:c.phase}:i?{phase:`known`,item:i[t]}:{phase:`checking`},enable:e=>p.current(e)}}var z=x();function he(e){return e===`paste-failed`?`companionSurface.offerPasteFailed`:`companionSurface.offerNowhere`}var ge=260;function _e({offer:e,growth:n=`right`,cardGrowth:r=`up`,avatarBox:i=p,optionsBox:a=p,cardRef:o,onAnswer:s}){let{t:c}=v(),l=e.reason===`claimed`?c(`companionSurface.offerVersion`):c(he(e.reason)),{inUnits:u,avatarHalf:d,lineAt:f,edgeAt:m,introStepOff:h}=ce(i,a),g=u(h(r)),_=m(n,-d),y={top:f(r,0),transform:r===`up`?`translateY(calc(-100% - ${g}px))`:`translateY(${g}px)`};return(0,z.jsxs)(`div`,{ref:o,role:`group`,"aria-label":l,"data-companion-dictation-offer":!0,className:`absolute flex flex-col gap-2 rounded-2xl border border-white/10 bg-[#17181b]/95 px-3.5 py-3 shadow-lg shadow-black/40`,style:{width:ge,..._,...y},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`p`,{className:`text-[11px] font-medium tracking-wide text-white/45 uppercase select-none`,children:l}),(0,z.jsx)(t,{className:`max-h-40 flex-col`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,z.jsx)(`p`,{dir:`auto`,className:`text-[13px] leading-[1.45] text-white/90`,children:e.text})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 pt-0.5`,children:[(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/55 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>s?.(`dismiss`),children:e.reason===`claimed`?c(`companionSurface.notNow`):c(`companionSurface.offerDiscard`)}),e.reason===`claimed`?(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/70 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>s?.(`quit`),children:c(`companionSurface.offerQuit`,{app:e.app})}):null,(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full bg-white/15 px-3 text-[12px] text-white transition-colors hover:bg-white/25`,onClick:()=>s?.(e.reason===`claimed`?`use`:`copy`),children:e.reason===`claimed`?c(`companionSurface.offerUse`):c(`companionSurface.offerCopy`)})]})]})}var ve={microphone:{action:`companionIntro.permission.microphoneAction`,body:`companionIntro.permission.microphoneBody`},inputMonitoring:{action:`companionIntro.permission.openSettings`,body:`companionIntro.permission.shortcutBody`},screen:{action:`companionIntro.permission.screenAction`,body:`companionIntro.permission.screenBody`}};function ye({permission:e}){let{t}=v(),n=(0,L.useRef)(null),{state:r}=e,i=r.phase===`known`?r.item:null,o=r.phase===`checking`||r.phase===`requesting`,s=fe(e.kind,i),c=i?.status===`restricted`,l=r.phase===`error`||i?.error!==void 0,u=ve[e.kind];return(0,z.jsxs)(`div`,{ref:n,className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:t(u.body)}),(0,z.jsx)(a,{size:`compact`,shape:`pill`,className:`self-start bg-white/15 text-white hover:bg-white/25`,loading:o,disabled:c||r.phase===`checking`,onClick:()=>{let t=n.current?.getBoundingClientRect();e.enable(t?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0)},children:t(s?`companionIntro.permission.openSettings`:u.action)}),(0,z.jsx)(`p`,{role:`status`,className:`text-[12px] leading-tight text-white/60`,children:c?t(`companionIntro.permission.restricted`):l?t(`companionIntro.permission.error`):s?t(e.kind===`microphone`?`companionIntro.permission.microphoneSettingsHint`:`companionIntro.permission.settingsHint`):o?t(`companionIntro.permission.waiting`):e.kind===`microphone`?t(`companionIntro.permission.microphonePromptHint`):null})]})}var be=3e3,xe={idle:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.idle.body`},meet:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.meet.body`},talk:{title:`companionIntro.talk.title`,body:`companionIntro.talk.body`},key:{title:`companionIntro.key.title`},share:{title:`companionIntro.share.title`,body:`companionIntro.share.body`},draw:{title:`companionIntro.draw.title`,body:`companionIntro.draw.body`},mute:{title:`companionIntro.mute.title`,body:`companionIntro.mute.body`},try:{title:`companionIntro.try.title`,body:`companionIntro.try.body`}},B=e=>g(e),V=e=>({phase:`listening`,label:e,accentHex:``,muted:!1,outputMuted:!1,detail:``,approvalRequestId:``,assistantName:``}),H={share:`⌥S`,draw:`⌥D`,muteMicrophone:`⌥M`,muteAssistant:`⌥A`},Se={share:{icon:(0,z.jsx)(ue,{className:`size-5`}),shortcut:H.share},draw:{icon:(0,z.jsx)(M,{className:`size-5`}),shortcut:H.draw},mute:{icon:(0,z.jsx)(P,{className:`size-5`}),shortcut:H.muteMicrophone}},Ce=e=>B(e)===void 0?null:`call`,we=(e,t)=>B(e)===void 0?null:{call:V(t),sharing:e!==`share`};function Te({beat:e,growth:t=`right`,cardGrowth:n=`up`,avatarBox:r=p,optionsBox:a=p,accentHex:o,assistantName:s,cardRef:l,onAdvance:u,permission:d=null,greeted:m=!1,voiceKeyTaps:h=0,chordPresses:_=0,chordControl:y}){let{t:b}=v(),x=f.indexOf(e),S=x===f.length-1,C=x<=0,w=xe[e],T=R(d),ee=d?.state.phase===`checking`,E=c[e],D=g(e),O=D===void 0?void 0:Se[D],[k,A]=(0,L.useState)(!1);(0,L.useEffect)(()=>{A(!1)},[e]),(0,L.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>{A(!1)},be);return()=>{clearTimeout(e)}},[k]),(0,L.useEffect)(()=>{A(!1)},[h]);let[te,j]=(0,L.useState)(h),[ne,M]=(0,L.useState)(_),[re,ie]=(0,L.useState)(e);re===e?h<te&&j(h):(ie(e),j(h),M(_));let ae=Math.min(Math.max(h-te,0),2);_<ne&&M(_);let oe=D!==void 0&&y===D&&_>ne,{inUnits:P,avatarHalf:F,gap:I,lineAt:se,edgeAt:le,introStepOff:ue}=ce(r,a),de=n===`down`||B(e)===void 0?P(ue(n)):P(F+I)+22+P(F)+6,fe=le(t,-F),pe={top:se(n,0),transform:n===`up`?`translateY(calc(-100% - ${de}px))`:`translateY(${de}px)`};return(0,z.jsxs)(`div`,{ref:l,role:`group`,"aria-label":b(`companionIntro.ariaLabel`),className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-5 shadow-lg shadow-black/40`,style:{width:320,height:224,...fe,...pe},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":b(`companionIntro.close`),className:`absolute top-2 right-2 flex size-6 items-center justify-center rounded-full text-white/45 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>u?.(`dismiss`),children:(0,z.jsx)(N,{className:`size-3.5`})}),(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`pr-6 text-[16px] leading-tight font-medium text-white`,children:(0,z.jsx)(`span`,{className:`line-clamp-2`,children:`titleNamed`in w&&s!==void 0?b(w.titleNamed,{name:s}):b(w.title)})}),ee?null:T&&d!==null?(0,z.jsx)(ye,{permission:d}):(0,z.jsxs)(z.Fragment,{children:[`body`in w?(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(e===`talk`&&m?`companionIntro.talk.greeted`:w.body)}):null,e===`talk`&&(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0})}),e===`key`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(k?`companionIntro.key.scolded`:`companionIntro.talk.gesture`)}),(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})})]}),e===`try`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-3`,children:[(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0}),(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})]}),(0,z.jsx)(`p`,{className:`text-center text-[11px] leading-tight text-white/45`,children:b(k?`companionIntro.key.scolded`:`companionIntro.try.how`)})]}),O!==void 0&&(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-white/10 text-white/85`,children:O.icon}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.click`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex h-10 items-center rounded-xl border px-3 text-[13px] font-medium transition-colors ${oe?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:`border-white/15 bg-white/10 text-white/85`}`,children:O.shortcut}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.shortcut`)})]})]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pt-2`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1`,"aria-hidden":!0,children:i.map(e=>(0,z.jsx)(`span`,{className:`size-1.5 rounded-full transition-colors`,style:{backgroundColor:e===E?o??`#5eead4`:`rgba(255,255,255,.2)`}},e))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C?null:(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full px-3 text-[14px] text-white/60 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>u?.(`back`),children:b(`companionIntro.back`)}),(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full bg-white/15 px-3 text-[14px] text-white transition-colors hover:bg-white/25`,onClick:()=>u?.(`next`),children:b(S?`companionIntro.done`:T&&!ee?`companionIntro.permission.skip`:`companionIntro.next`)})]})]})]})}function U({label:e,taps:t=0,scolded:n=!1,take:r}){let i=t>=2?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:t===1?`border-emerald-400/70 bg-emerald-400/20 text-emerald-100`:`border-white/20 bg-white/10 text-white/85`,a=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(w,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`absolute bottom-1 left-1.5 text-[9px] leading-none opacity-70`,"aria-hidden":!0,children:e})]}),o=`relative inline-flex size-11 items-center justify-center rounded-lg border font-medium shadow-[inset_0_-2px_0_rgba(0,0,0,.4)] transition-[color,background-color,border-color,transform] ${i} ${n?`scale-90 opacity-70`:``}`;return r===void 0?(0,z.jsx)(`span`,{className:o,"aria-label":e,children:a}):(0,z.jsx)(`button`,{type:`button`,className:`${o}${t===0?`hover:border-white/40 hover:bg-white/20`:``}`,"aria-label":e,onClick:r,children:a})}var Ee=e=>e.filter(e=>e.state===`running`),W=e=>e.filter(e=>e.state===`waiting`),De=e=>({"--companion-ring-accent":e});function Oe({size:e,still:t=!1}){return(0,z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,className:`shrink-0 ${t?``:`companion-work-spin`}`,"aria-hidden":!0,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeOpacity:`0.2`,strokeWidth:`2`}),(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:t?void 0:`10 28`,strokeOpacity:t?.6:void 0})]})}function ke({state:e}){return e===`done`?(0,z.jsx)(D,{className:`companion-work-pop size-3.5 shrink-0 text-[var(--companion-ring-accent)]`,"aria-hidden":!0}):(0,z.jsx)(N,{className:`companion-work-pop size-3.5 shrink-0 text-white/50`,"aria-hidden":!0})}function Ae(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function G(){let[e,t]=(0,L.useState)(()=>Date.now());return(0,L.useEffect)(()=>{let e=window.setInterval(()=>{t(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]),e}function je({work:e,accentHex:t}){let{t:n}=v(),r=G(),i=e.slice(0,5),a=e.length-i.length;return(0,z.jsxs)(`div`,{className:`flex w-full min-w-[300px] flex-col gap-1.5 px-4 py-3 text-[12px] text-white/85`,style:De(t),"data-companion-work-shelf":!0,children:[i.map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.state===`running`||e.state===`waiting`?(0,z.jsx)(Oe,{size:14,still:e.state===`waiting`}):(0,z.jsx)(ke,{state:e.state}),(0,z.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-medium ${e.state===`done`||e.state===`failed`?`text-white/55`:``}`,children:e.title}),(0,z.jsx)(`span`,{className:`companion-work-fade min-w-0 flex-1 truncate text-white/50`,children:e.state===`running`?e.step:e.state===`waiting`?n(`companionSurface.workWaitingStep`):e.state===`done`?n(`companionSurface.workDone`):n(`companionSurface.workStopped`)},e.state===`running`?e.step:e.state),e.kind===`subagent`?(0,z.jsx)(`span`,{className:`shrink-0 text-[11px] text-white/40 tabular-nums`,children:Ae(r-e.startedAt)}):null]},e.id)),a>0?(0,z.jsx)(`div`,{className:`pl-[22px] text-[11px] text-white/40`,children:n(`companionSurface.workMore`,{count:a})}):null]})}var Me={min:3,max:10},Ne=(e=Math.random)=>{let t=e();return t<1/3?`top`:t<2/3?`topLeft`:`topRight`},Pe=1600,Fe=.22,Ie=.04,Le=4,Re=(e,t)=>{let n=Math.min(.95,Math.max(.25,e.eyeCenterFrac+e.eyeHalfFrac+Ie)),r=Math.min(t,24,14/n),i=r*n;return{size:r,exposed:i,clip:{width:r+2*Le,height:i+Le},rest:i+2}},ze=(e,t=Math.random)=>(e.min+t()*(e.max-e.min))*1e3;function Be(e,t=Me){let[n,r]=(0,L.useState)(0),{min:i,max:a}=t;return(0,L.useEffect)(()=>{if(!e)return;let t,n=()=>{t=setTimeout(()=>{r(e=>e+1),n()},ze({min:i,max:a}))};return n(),()=>{clearTimeout(t)}},[e,i,a]),n}var Ve=(e,t,n={width:0,height:0})=>{let r=e===`topLeft`?n.width/4:e===`topRight`?n.width*3/4:n.width/2;return{slot:{width:t.width,height:t.height,bottom:`100%`,left:r-t.width/2}}};function He({character:e,capsule:t,enabled:n,held:i=!1,edge:a,interval:o=Me,className:s,style:c}){let l=b(),u=(0,L.useMemo)(()=>_(r,e),[e]),d=Be(n&&!i&&!l&&u!==null,o),[f,p]=(0,L.useState)(!1),[h,g]=(0,L.useState)(`top`);if((0,L.useEffect)(()=>{if(d===0)return;g(Ne()),p(!0);let e=setTimeout(()=>{p(!1)},Pe);return()=>{clearTimeout(e)}},[d]),u===null||l)return null;let v=Re(u,t.width),x=i||f,S=a??h,C=Ve(S,v.clip,t);return(0,z.jsx)(`div`,{className:`companion-peek ${s??``}`,style:{width:t.width,height:t.height,...c},"data-risen":x,"data-edge":S,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute`,style:C.slot,children:(0,z.jsx)(`div`,{className:`absolute inset-0 overflow-hidden`,children:(0,z.jsx)(y.div,{className:`absolute left-1/2`,style:{width:v.size,height:v.size,marginLeft:-v.size/2,top:v.clip.height-v.exposed},initial:{y:v.rest},animate:{y:x?0:v.rest},transition:i?{duration:0}:x?{type:`spring`,stiffness:280,damping:14}:{duration:Fe,ease:`easeIn`},children:(0,z.jsx)(m,{components:r,traits:e,size:v.size})})})})})}var Ue=(0,L.createContext)(`above`),We=`#5eead4`,Ge=new Set([`transcribing`,`thinking`,`speaking`]),K=28,q={idle:{width:64,height:14},closing:K,rim:2,bloom:4},Ke=q.idle,qe=(e,t,n)=>[`inset 0 0 0 ${t}px color-mix(in srgb, ${e} 78%, transparent)`,`0 0 ${n}px color-mix(in srgb, ${e} 85%, transparent)`,`0 0 ${n*4}px color-mix(in srgb, ${e} 42%, transparent)`,`0 8px 24px rgba(0, 0, 0, 0.45)`].join(`, `),Je=244,Ye=200,J=120,Xe=32,Ze={watching:40,summary:220,dictating:Je+32,offer:Ye+32,call:4+J+180},Qe=84,$e={width:28,height:Qe+140+20};function et({phase:e,assistantName:t=``,accentHex:n=We,avatarSrc:r,character:i,hovered:a=!1,growth:o=`right`,avatarBox:s=p,optionsBox:c=p,cardGrowth:l=`up`,dock:u=`bottom`,rootRef:d,restingPillRef:f,avatarRef:m,onSurfacePointerDown:h,onSurfaceContextMenu:g,spotlight:_,avatarStaged:y=!1,avatarTucked:x=!1,onWatch:S,onTeach:C,picking:w=!1,sharing:T=!1,shareEnabled:ee=!1,sharePicking:E=!1,onShare:D,onStopShare:O,annotating:k=!1,annotationTool:A,onAnnotationTool:te,drawToolsRef:j,onAnnotate:ne,marked:M=!1,onClearMarks:re,openPicker:ie,onPicker:N,shortcuts:ae,onAvatarClick:oe,working:P=!1,watching:F=!1,watchRetro:I,onWatchRetro:se,dictationOffer:le,offer:ue,watchEnabled:de=!1,dictating:fe,dictationText:pe=``,call:R,onControl:me,intro:he,picker:ge,prompt:_e,promptRef:ve,promptsDeferred:ye=0,onReviewPrompts:be,onWorkShelfChange:xe}){let{t:B}=v(),V=e===`call`?R?.work:void 0,H=V!==void 0&&V.length>0,[Se,Ce]=(0,L.useState)(!1);(0,L.useEffect)(()=>{H||Ce(!1)},[H]);let we=u===`left`||u===`right`?void 0:_e,Te=we==null?Se&&H:!1;(0,L.useEffect)(()=>{xe?.(Te)},[xe,Te]);let U=(0,L.useMemo)(()=>we??(Se&&H?(0,z.jsx)(je,{work:V,accentHex:n}):void 0),[we,Se,H,V,n]),Ee=e!==`resting`,W=e===`call`||e===`dictating`||e===`offer`||e===`summary`||e===`watching`,De=(0,L.useRef)(null),[Oe,ke]=(0,L.useState)(null),Ae=_===`talk`?void 0:_;(0,L.useEffect)(()=>{if(Ae===void 0){ke(null);return}return nt(De,`[data-control="${Ae}"]`,e=>{ke(e.x)})},[Ae,e,T]);let[G,Me]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(!y){Me(null);return}return nt(De,`[data-avatar-stage]`,Me)},[y,e]);let[Ne,Pe]=(0,L.useState)(!1);(0,L.useEffect)(()=>{if(e!==`hover`){Pe(!1);return}let t=setTimeout(()=>{Pe(!0)},500);return()=>{clearTimeout(t)}},[e]);let Fe=he==null?_===`talk`||e===`hover`&&Ne:!1,Ie=I===`pending`,Le=P||R!==void 0&&Ge.has(R.phase),Re=b(),ze=(0,L.useRef)(null),[Be,Ve]=(0,L.useState)(null),He=(0,L.useRef)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=()=>{Ve({width:e.scrollWidth-He.current.width,height:e.scrollHeight-He.current.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[e]);let{scale:K,avatarRel:Ke,avatarHalf:Je,gap:Ye,inUnits:J,lineAt:Xe,edgeAt:Qe}=ce(s,c),et=e===`call`,Y=et&&(u===`left`||u===`right`),tt=Y?u===`left`?`right`:`left`:`above`,X=W?Y?(Be?.width??$e.width)+16:p+(Be?.width??Ze[e])+8:0,dt=W?p+(Be?.height??$e.height)+8:0,Z=et&&U!=null,pt=(0,L.useRef)(null),[mt,ht]=(0,L.useState)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=pt.current;if(!Z||e===null)return;let t=()=>{let t=e.getBoundingClientRect();ht({width:Math.ceil(t.width/K),height:Math.ceil(t.height/K)})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Z,U,K]);let gt=Z&&!Y?Math.max(X,mt.width):X,_t=Z&&Y?Math.max(dt,mt.height):dt,vt=Y?_t-dt:gt-X;(0,L.useLayoutEffect)(()=>{He.current=Y?{width:0,height:vt}:{width:vt,height:0}},[vt,Y]);let Q=Y?`50%`:Xe(l,0),yt=Qe(o,o===`left`?c/2:-(c/2)),bt=s/p,xt=Ee?{width:q.closing*bt,height:q.closing*bt}:q.idle,St=he!=null,Ct=et?{width:gt,...Y?{height:_t}:{},left:`50%`,top:Q,transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`}:{width:X,...yt,top:Q,transform:`translateY(-50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`},$=G===null?Oe!==null&&!Y?`${Oe}px`:et&&!Y?`calc(50% - ${gt/2-p/2}px)`:`50%`:`${G.x}px`,wt=G===null?Oe!==null&&!Y?`calc(${Q} - ${J(Je+Ye)+22}px)`:Y?`calc(50% - ${_t/2-p/2}px)`:Q:`${G.y}px`;return(0,z.jsxs)(`div`,{ref:De,className:`absolute top-0 left-0 origin-top-left`,style:{width:`${100/K}%`,height:`${100/K}%`,transform:`scale(${K})`},children:[Z?(0,z.jsx)(ut,{dock:u,top:Q,width:Y?mt.width:gt,height:_t,barThickness:Y?X:44,promptRef:ve,children:U}):null,Z?(0,z.jsx)(`div`,{ref:pt,inert:!0,"aria-hidden":!0,"data-theme":`dark`,className:`pointer-events-none invisible absolute top-0 left-0 w-max ${Y?`max-w-[400px]`:`max-w-[640px]`}`,children:U}):null,(0,z.jsxs)(`div`,{className:`absolute flex cursor-grab items-center rounded-full duration-300 select-none active:cursor-grabbing ${Y?`flex-col transition-[width,height] will-change-[width,height]`:`h-11 transition-[width] will-change-[width]`} ${!et&&o===`left`?`justify-end`:``}`,style:Ct,onPointerDown:h,onContextMenu:g,ref:d,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 rounded-full transition-opacity duration-200 ${Z?`bg-[#17181b]`:`border border-white/10 bg-[#17181b]/95 shadow-lg shadow-black/40`}`,style:{opacity:+!!W},"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`relative flex shrink-0 items-center ${Y?`flex-col`:`h-11`}`,style:Y?{paddingTop:p,paddingBottom:8,paddingInline:8}:o===`left`?{paddingLeft:8,paddingRight:p}:{paddingLeft:p,paddingRight:8},children:(0,z.jsx)(`div`,{className:`flex items-center gap-1 overflow-hidden transition-opacity duration-200 ${Y?`min-h-0 flex-col`:`min-w-0`}`,ref:ze,inert:!W,style:{opacity:+!!W,transitionDelay:W?`120ms`:`0ms`},children:e===`call`?(0,z.jsx)(Ue.Provider,{value:tt,children:(0,z.jsx)(ft,{call:R,assistantName:t,spotlight:_,watching:F,watchEnabled:de,picking:w,sharing:T,shareEnabled:ee,sharePicking:E,annotating:k,marked:M,annotationTool:A,vertical:Y,drawToolsPlacement:Y?u===`left`?`right`:`left`:l===`up`?`above`:`below`,drawToolsRef:j,onAnnotationTool:te,onControl:me,onWatch:S,onTeach:C,onShare:D,onStopShare:O,onAnnotate:ne,onClearMarks:re,openPicker:ie,onPicker:N,pickerSide:Y?u===`left`?`right`:`left`:u===`top`?`below`:`above`,shortcuts:ae,promptsDeferred:ye,lineExtra:vt,onReviewPrompts:be,accentHex:n,workShelfOpen:Te,onToggleWorkShelf:()=>{Ce(e=>!e)}})}):e===`dictating`&&fe!==void 0?(0,z.jsx)(ot,{dictating:fe,dictationText:pe}):e===`summary`&&I!==void 0?(0,z.jsx)(lt,{retro:I,onWatchRetro:se}):e===`offer`&&le!==void 0?(0,z.jsx)(st,{offer:le}):(0,z.jsx)(ct,{watching:F,onWatch:S})})})]}),(0,z.jsx)(`div`,{className:`absolute cursor-grab active:cursor-grabbing`,style:{width:J(q.idle.width),height:J(q.idle.height),pointerEvents:Ee?`none`:void 0,left:`50%`,top:Q,transform:`translate(-50%, -50%)`},onPointerDown:h,onContextMenu:g,ref:f,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute top-1/2 left-1/2 rounded-full transition-[width,height,opacity] duration-300`,style:{width:J(xt.width),height:J(xt.height),transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:Re?`opacity`:void 0,boxShadow:qe(n,J(q.rim),J(q.bloom)),opacity:Ee||G!==null||St&&!x?0:1}})}),(0,z.jsx)(it,{className:Fe?`opacity-100`:`opacity-0`,"data-companion-name":Fe?`shown`:`hidden`,style:{left:`50%`,top:Q,transform:`translate(-50%, calc(-100% - ${J(Je)}px - ${rt}px))`},label:B(`companionSurface.talk`)}),(0,z.jsx)(at,{label:B(e===`call`?`companionSurface.openVellum`:`companionSurface.talk`),accentHex:n,avatarSrc:r,character:i,attentive:a,busy:Le||F||Ie,collapsed:!Ee&&(!St||x),restingScale:p/s,style:{left:$,top:wt,zIndex:G===null?void 0:2,transform:`translate(-50%, -50%)${Ke===1?``:` scale(${Ke})`}`,transition:Re?void 0:Oe===null&&G===null?`left 300ms cubic-bezier(.2,.8,.2,1), top 300ms cubic-bezier(.2,.8,.2,1)`:`left 420ms cubic-bezier(.34,1.56,.64,1), top 420ms cubic-bezier(.34,1.56,.64,1)`},elementRef:m,onPointerDown:h,onContextMenu:g,onClick:oe}),he,ge,ue]})}var Y=`rgba(28, 28, 30, 0.55)`,tt=`backdrop-blur-md backdrop-saturate-150`,nt=(e,t,n)=>{let r=0,i=performance.now(),a=()=>{let o=e.current,s=o?.querySelector(t);if(o&&s){let e=o.getBoundingClientRect(),t=s.getBoundingClientRect(),r=e.width===0?1:o.offsetWidth/e.width;n({x:(t.left+t.width/2-e.left)*r,y:(t.top+t.height/2-e.top)*r})}performance.now()-i<500&&(r=requestAnimationFrame(a))};return a(),()=>{cancelAnimationFrame(r)}},rt=4;function it({className:e,style:t,label:n,shortcut:r,beak:i=`down`,...a}){return(0,z.jsxs)(`span`,{className:`pointer-events-none absolute rounded-md px-2 py-1 text-[11px] leading-4 font-medium whitespace-nowrap text-white/90 shadow-md shadow-black/30 transition-opacity duration-200 ${tt} ${e}`,style:{...t,backgroundColor:Y},"aria-hidden":!0,...a,children:[n,r===void 0?null:(0,z.jsx)(`span`,{className:`ml-1.5 font-normal text-white/60`,"data-shortcut":!0,children:r}),(0,z.jsx)(`span`,{className:`absolute ${i===`down`?`top-full left-1/2 h-1.5 w-2.5 -translate-x-1/2`:i===`left`?`top-1/2 right-full h-2.5 w-1.5 -translate-y-1/2`:`top-1/2 left-full h-2.5 w-1.5 -translate-y-1/2`} ${tt}`,style:{backgroundColor:Y,clipPath:i===`down`?`polygon(0 0, 100% 0, 50% 100%)`:i===`left`?`polygon(100% 0, 100% 100%, 0 50%)`:`polygon(0 0, 0 100%, 100% 50%)`},"aria-hidden":!0})]})}function at({accentHex:e,avatarSrc:t,character:n,busy:i=!1,attentive:a=!1,collapsed:o=!1,restingScale:s=1,label:c,style:l,elementRef:u,onPointerDown:d,onContextMenu:f,onClick:p}){let h=b();return(0,z.jsxs)(`div`,{role:`button`,"aria-label":c,className:`absolute grid size-11 cursor-grab place-items-center active:cursor-grabbing`,style:l,ref:u,onPointerDown:d,onContextMenu:f,onClick:p,children:[n===void 0?null:(0,z.jsx)(He,{character:n,capsule:Ke,enabled:o&&!i,className:`absolute top-1/2 left-1/2 transition-opacity duration-200`,style:{transform:`translate(-50%, -50%) scale(${s})`,opacity:+!!o}}),(0,z.jsx)(`div`,{className:`transition-[opacity,transform] duration-300`,style:{opacity:+!o,transform:o?`scale(0.35)`:`scale(1)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:h?`opacity`:void 0},children:(0,z.jsx)(`div`,{className:`companion-avatar-bob relative grid place-items-center`,style:{animation:h?`none`:void 0},children:n===void 0?t===void 0?(0,z.jsx)(`span`,{className:`relative size-7 rounded-full drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,style:{background:e},"aria-hidden":!0}):(0,z.jsx)(`img`,{src:t,alt:``,draggable:!1,className:`relative size-7 rounded-full object-contain drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)] [-webkit-user-drag:none]`}):(0,z.jsx)(`div`,{className:`relative drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,children:(0,z.jsx)(m,{components:r,traits:n,size:K,isAssistantBusy:i,attentive:a})})})})]})}function ot({dictating:e,dictationText:t}){let{t:n}=v(),r=t.trim();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),r?(0,z.jsx)(`span`,{dir:`auto`,className:`flex justify-end overflow-hidden text-[12px] whitespace-nowrap text-white/85`,style:{width:Je},children:(0,z.jsx)(`span`,{className:`shrink-0`,children:r})}):(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Je},children:n(e===`listening`?`companionSurface.dictating`:`companionSurface.dictatingTranscribing`)})]})}function st({offer:e}){let{t}=v();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Ye},children:e.reason===`claimed`?t(`companionSurface.offerHeard`,{app:e.app}):t(he(e.reason))})]})}function ct({watching:e=!1,onWatch:t}){return(0,z.jsx)(z.Fragment,{children:e&&(0,z.jsx)(vt,{onWatch:t})})}function X({watching:e,watchEnabled:t,picking:n,dimmed:r,onWatch:i,onTeach:a}){let{t:o}=v();return t?(0,z.jsx)($,{icon:(0,z.jsx)(ne,{className:`size-4`}),label:o(`companionSurface.teach`),dimmed:r,pressed:e||n,onClick:e?i:a??i}):e?(0,z.jsx)(vt,{onWatch:i}):null}function lt({retro:e,onWatchRetro:t}){let{t:n}=v();return e===`pending`?(0,z.jsx)(`span`,{className:`ml-1 shrink-0 text-[12px] text-white/85`,children:n(`companionSurface.summarizing`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(re,{className:`size-4`}),label:n(`companionSurface.showSummary`),showLabel:!0,onClick:()=>{t?.(!0)}}),(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`}),label:n(`companionSurface.notNow`),showLabel:!0,onClick:()=>{t?.(!1)}})]})}function ut({dock:e,top:t,width:n,height:r,barThickness:i,promptRef:a,children:o}){let s=i/2,c=e===`top`?`below`:e===`left`?`right`:e===`right`?`left`:`above`,l=c===`left`||c===`right`,u=l?{left:`50%`,top:t,width:n+s,height:r,transform:c===`right`?`translate(0, -50%)`:`translate(-100%, -50%)`,[c===`right`?`paddingLeft`:`paddingRight`]:s}:{left:`50%`,top:t,width:n,transform:c===`below`?`translate(-50%, 0)`:`translate(-50%, -100%)`,[c===`below`?`paddingTop`:`paddingBottom`]:s},d={above:`rounded-t-[22px]`,below:`rounded-b-[22px]`,left:`rounded-l-[22px]`,right:`rounded-r-[22px]`}[c];return(0,z.jsxs)(`div`,{ref:a,"data-theme":`dark`,"data-shelf-side":c,className:`absolute`,style:u,onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 bg-[#17181b] shadow-lg shadow-black/40 ${d}`}),(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute bg-white/10 ${l?`top-4 bottom-4 w-px`:`right-4 left-4 h-px`}`,style:{[dt[c]]:s}}),(0,z.jsx)(`div`,{className:`relative`,children:o})]})}var dt={above:`bottom`,below:`top`,left:`right`,right:`left`};function ft({call:e,assistantName:t,spotlight:n,watching:r,watchEnabled:i,picking:a,sharing:o,shareEnabled:s,sharePicking:c,annotating:l,marked:u,annotationTool:d,vertical:f,drawToolsPlacement:p,drawToolsRef:m,onAnnotationTool:h,onControl:g,onWatch:_,onTeach:y,onShare:b,onStopShare:x,onAnnotate:S,onClearMarks:C,openPicker:w,onPicker:T,pickerSide:ee,shortcuts:E,promptsDeferred:D=0,onReviewPrompts:O,lineExtra:A=0,accentHex:te,workShelfOpen:j,onToggleWorkShelf:ne}){let{t:M}=v();if(e===void 0)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{vertical:f,extra:A,text:t===``?M(`companionSurface.calling`):M(`companionSurface.callingNamed`,{name:t})}),(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,onWatch:_,onTeach:y}),(0,z.jsx)(_t,{onControl:g})]});let re=e.work===void 0&&e.detail||e.label,N=e.work??[],oe=N.length>0,{muted:F,outputMuted:I}=e,se=e.assistantName;return(0,z.jsxs)(z.Fragment,{children:[oe?(0,z.jsx)(xt,{work:N,accentHex:te,open:j,onToggle:ne}):null,(0,z.jsx)(Z,{vertical:f,extra:A-(!f&&oe?Xe:0),text:re}),D>0?(0,z.jsx)(`button`,{type:`button`,"data-theme":`dark`,"aria-label":M(`companionPopover.pendingBadge`,{count:D}),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--system-negative-weak)] text-[13px] text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-hover)] hover:text-white`,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{O?.()},children:D}):null,(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,dimmed:n!==void 0,onWatch:_,onTeach:y}),(0,z.jsx)(pt,{sharing:o,shareEnabled:s,sharePicking:c,shortcut:s?E?.share:void 0,spotlit:n===`share`,dimmed:n!==void 0&&n!==`share`,onShare:b,onStopShare:x}),(0,z.jsx)(mt,{sharing:o,annotating:l,spotlit:n===`draw`,dimmed:n!==void 0&&n!==`draw`,shortcut:s?E?.draw:void 0,tool:d,placement:p,toolsRef:m,onAnnotate:S,onTool:h}),(0,z.jsx)(gt,{sharing:o,marked:u,dimmed:n!==void 0,onClearMarks:C}),(0,z.jsx)($,{icon:I?(0,z.jsx)(ae,{className:`size-4`}):(0,z.jsx)(ie,{className:`size-4`}),label:se===``?M(I?`companionSurface.unmuteAssistant`:`companionSurface.muteAssistant`):M(I?`companionSurface.unmuteAssistantNamed`:`companionSurface.muteAssistantNamed`,{name:se}),shortcut:E?.muteAssistant,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(I?`unmuteAssistantAudio`:`muteAssistantAudio`)}}),(0,z.jsx)($,{icon:F?(0,z.jsx)(k,{className:`size-4`}):(0,z.jsx)(P,{className:`size-4`}),label:M(F?`companionSurface.unmuteMicrophone`:`companionSurface.muteMicrophone`),shortcut:E?.muteMicrophone,control:`mute`,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(F?`unmuteMicrophone`:`muteMicrophone`)}}),(0,z.jsx)(Ct,{picker:`microphones`,label:M(`companionSurface.chooseMicrophone`),side:ee,open:w===`microphones`,onPicker:T}),(0,z.jsx)(_t,{dimmed:n!==void 0,onControl:g})]})}function Z({vertical:e,text:t,extra:n=0}){return e?(0,z.jsx)(`span`,{className:`mt-1 shrink-0 truncate text-[12px] text-white/85`,style:{height:Qe+n,writingMode:`vertical-rl`},"data-label":`line`,children:t}):(0,z.jsx)(`span`,{className:`ml-1 shrink-0 truncate text-[12px] text-white/85`,style:{width:J+n},"data-label":`line`,children:t})}function pt({sharing:e,shareEnabled:t,sharePicking:n,shortcut:r,spotlit:i,dimmed:a,onShare:o,onStopShare:s}){let{t:c}=v();return!t&&!e?null:(0,z.jsx)($,{icon:(0,z.jsx)(ue,{className:`size-4`}),label:c(`companionSurface.share`),shortcut:r,control:`share`,spotlit:i,dimmed:a,pressed:e||n,onClick:e?s:o})}function mt({sharing:e,annotating:t,shortcut:n,spotlit:r,dimmed:i,tool:a,placement:o,toolsRef:s,onAnnotate:c,onTool:l}){let{t:u}=v();return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(M,{className:`size-4`}),label:u(`companionSurface.draw`),shortcut:n,control:`draw`,spotlit:r,dimmed:i,pressed:t,className:`companion-draw-anchor`,onClick:()=>{c?.(!t)}}),t&&a!==void 0&&(0,z.jsx)(ht,{tool:a,placement:o,toolsRef:s,onTool:l})]}):null}function ht({tool:e,placement:t,toolsRef:n,onTool:r}){let{t:i}=v(),a=[{tool:`freehand`,icon:(0,z.jsx)(M,{className:`size-4`}),label:i(`companionSurface.drawFreehand`)},{tool:`line`,icon:(0,z.jsx)(de,{className:`size-4`}),label:i(`companionSurface.drawLine`)},{tool:`box`,icon:(0,z.jsx)(ee,{className:`size-4`}),label:i(`companionSurface.drawBox`)},{tool:`circle`,icon:(0,z.jsx)(C,{className:`size-4`}),label:i(`companionSurface.drawCircle`)}];return(0,z.jsx)(`div`,{className:`companion-draw-tools absolute flex items-center gap-0.5 rounded-full border border-white/10 bg-[#17181b]/95 p-0.5 shadow-lg shadow-black/40 companion-draw-tools-${t} ${t===`left`||t===`right`?`flex-col`:``}`,role:`group`,"aria-label":i(`companionSurface.drawTools`),"data-testid":`companion-draw-tools`,ref:n,onPointerDown:e=>{e.stopPropagation()},children:a.map(t=>(0,z.jsx)($,{icon:t.icon,label:t.label,pressed:e===t.tool,onClick:()=>{r?.(t.tool)}},t.tool))})}function gt({sharing:e,marked:t,dimmed:n,onClearMarks:r}){let{t:i}=v();return!e||!t?null:(0,z.jsx)($,{icon:(0,z.jsx)(le,{className:`size-4`}),label:i(`companionSurface.clearMarks`),dimmed:n,onClick:()=>{r?.()}})}function _t({dimmed:e,onControl:t}){let{t:n}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`,strokeWidth:2.5}),label:n(`companionSurface.endSession`),tone:`negative`,dimmed:e,onClick:()=>{t?.(`endSession`)}})}function vt({onWatch:e}){let{t}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(te,{className:`size-4`}),label:t(`companionSurface.stopTeaching`),onClick:e})}var Q=`-translate-y-[calc(50%+22px)]`,yt={right:`translate-x-[calc(50%+22px)]`,left:`-translate-x-[calc(50%+22px)]`},bt=e=>e===`above`?{className:Q,beak:`down`}:{className:yt[e],beak:e===`right`?`left`:`right`};function xt({work:e,accentHex:t,open:n,onToggle:r}){let{t:i}=v(),a=bt((0,L.useContext)(Ue)),o=Ee(e),s=W(e),c=o.length>0?o:s,l=e.at(-1),u=(c.length>0?c:e).map(e=>e.title).join(` · `);return(0,z.jsxs)(`button`,{type:`button`,"aria-label":o.length===0&&s.length>0?i(`companionSurface.workWaiting`,{count:s.length}):i(`companionSurface.workCount`,{count:o.length}),"aria-expanded":r===void 0?void 0:n,"data-control":`work`,disabled:r===void 0,className:`group flex h-7 shrink-0 items-center justify-center rounded-full px-1.5 transition-colors enabled:hover:bg-white/15 ${n?`bg-white/15`:``}`,style:{...De(t),width:Xe},onPointerDown:e=>{e.stopPropagation()},onClick:r,children:[(0,z.jsx)(`span`,{className:`relative grid size-5 place-items-center`,children:c.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`absolute inset-0 grid place-items-center`,children:(0,z.jsx)(Oe,{size:20,still:o.length===0})}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none font-semibold text-white/90 tabular-nums`,children:c.length})]}):(0,z.jsx)(ke,{state:l?.state===`failed`?`failed`:`done`})}),n?null:(0,z.jsx)(it,{label:u,className:`opacity-0 group-hover:opacity-100 ${a.className}`,beak:a.beak,"data-label":`hover`})]})}var St={above:A,below:oe,left:O,right:E};function Ct({picker:e,label:t,side:n,open:r,onPicker:i}){if(i===void 0)return null;let a=St[n];return(0,z.jsx)($,{icon:(0,z.jsx)(a,{className:`size-3.5`,strokeWidth:2.25}),label:t,pressed:r,narrow:!0,onClick:()=>{i(e)}})}function $({icon:e,label:t,shortcut:n,tone:r,showLabel:i=!1,pressed:a,spotlit:o=!1,dimmed:s=!1,control:c,narrow:l=!1,className:u=``,onClick:d}){let f=bt((0,L.useContext)(Ue));return(0,z.jsxs)(`button`,{type:`button`,"aria-label":t,"aria-pressed":a,"data-control":c,onClick:d,onPointerDown:e=>{e.stopPropagation()},className:`group flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-full text-[12px] transition-[background-color,opacity] duration-200 hover:bg-white/15 ${l?`-mx-1 px-0.5`:`px-2`} ${u} ${a===!0||o?`bg-white/15`:``} ${s?`opacity-35`:``} ${r===`negative`?`text-[#ff6b6b]`:r===`positive`?`text-[#5ee08a]`:`text-white/85`}`,children:[e,i?(0,z.jsx)(`span`,{children:t}):(0,z.jsx)(it,{label:t,shortcut:n,className:`opacity-0 group-hover:opacity-100 ${f.className}`,beak:f.beak,"data-label":`hover`})]})}export{we as a,_e as c,V as i,R as l,Te as n,Ce as o,H as r,B as s,et as t,me as u};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{HC as t,IS as n,Na as r,a_ as i,aw as a,df as o,ff as s,i_ as c,mf as l,os as u,pf as d,r_ as f,t_ as p,ta as m,tu as h,u_ as g,wn as _}from"./app-DbJUeBix.js";import{E as v,d as y,s as b}from"./vendor-CtXGFqsu.js";import{t as x,x as S}from"./react-B9IgSVeK.js";import{Ai as C,Cr as w,Fa as T,G as ee,Gi as E,Ji as D,Ki as O,Tn as k,Wi as A,Xr as te,Ya as j,Yr as ne,Zt as M,bt as re,h as ie,i as N,m as ae,qi as oe,wn as P}from"./icons-C0wyat6T.js";import{l as F,n as I,t as se}from"./permission-setup-CJJV_COn.js";import{t as ce}from"./companion-layout-DdDcoKuc.js";var le=j(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ue=j(`screen-share`,[[`path`,{d:`M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3`,key:`i8wdob`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m17 8 5-5`,key:`fqif7o`}],[`path`,{d:`M17 3h5v5`,key:`1o3tu8`}]]),de=j(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),L=e(S(),1);function fe(e,t){return e===`inputMonitoring`||t?.canRequest===!1||e!==`screen`&&t?.status===`denied`}var pe={try:`microphone`,key:`inputMonitoring`,share:`screen`};function R(e){return e!==null&&(e.state.phase!==`known`||e.state.item.status!==`granted`)}function me(e){let t=e===null?null:pe[e]??null,r=e!==null,[i,a]=(0,L.useState)(void 0),[c,f]=(0,L.useState)(null),p=(0,L.useRef)(()=>{});return(0,L.useEffect)(()=>{if(f(null),!r)return;let e=!0,i=!1,c=0,m=!1,g=!1,_=null,v=async()=>{if(!(!e||i||g||_!==`ready`)){g=!0;try{let t=await u();if(!e||i||_!==`ready`||t===null||t===`com.apple.systempreferences`||t===`com.apple.SecurityAgent`)return;_=null,I(),await h()}catch(e){n(e,{context:`companionIntro.resumeAfterPermission`})}finally{g=!1}}},y=(n,r=!1)=>{e&&(a(e=>JSON.stringify(e)===JSON.stringify(n)?e:n),r||f(null),_!==null&&t!==null&&(_=n?n[t].status===`granted`?`ready`:`waiting`:null,v()))},b=r=>{e&&(t!==null&&f({kind:t,phase:`error`}),n(r,{context:`companionIntro.permission`,tags:{kind:t??`tour`}}))},x=async()=>{if(m||i)return;m=!0;let t=c;try{let n=await o();e&&t===c&&!i&&y(n),n===null&&clearInterval(S)}catch(e){t===c&&!i&&b(e)}finally{m=!1}},S=setInterval(()=>{x()},2e3),C=l(e=>{c+=1,y(e,i)});return x(),p.current=n=>{!e||i||t===null||(i=!0,c+=1,f({kind:t,phase:`requesting`}),(async()=>{try{let r=await o();if(!e)return;if(!r){y(null);return}let i=r[t];if(i.status===`granted`||i.status===`restricted`){y(r);return}let a=c;_=`waiting`;let l=t!==`microphone`&&F()?await se(t,n):fe(t,i)?await s(t):await d(t);e&&(a===c?y(l?{...r,[t]:l}:null):f(null))}catch(e){_=null,b(e)}finally{i=!1,v()}})())},()=>{e=!1,I(),clearInterval(S),C()}},[t,r]),t===null||i===null?null:{kind:t,state:c?.kind===t?{phase:c.phase}:i?{phase:`known`,item:i[t]}:{phase:`checking`},enable:e=>p.current(e)}}var z=x();function he(e){return e===`paste-failed`?`companionSurface.offerPasteFailed`:`companionSurface.offerNowhere`}var ge=260;function _e({offer:e,growth:n=`right`,cardGrowth:r=`up`,avatarBox:i=p,optionsBox:a=p,cardRef:o,onAnswer:s}){let{t:c}=v(),l=e.reason===`claimed`?c(`companionSurface.offerVersion`):c(he(e.reason)),{inUnits:u,avatarHalf:d,lineAt:f,edgeAt:m,introStepOff:h}=ce(i,a),g=u(h(r)),_=m(n,-d),y={top:f(r,0),transform:r===`up`?`translateY(calc(-100% - ${g}px))`:`translateY(${g}px)`};return(0,z.jsxs)(`div`,{ref:o,role:`group`,"aria-label":l,"data-companion-dictation-offer":!0,className:`absolute flex flex-col gap-2 rounded-2xl border border-white/10 bg-[#17181b]/95 px-3.5 py-3 shadow-lg shadow-black/40`,style:{width:ge,..._,...y},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`p`,{className:`text-[11px] font-medium tracking-wide text-white/45 uppercase select-none`,children:l}),(0,z.jsx)(t,{className:`max-h-40 flex-col`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,z.jsx)(`p`,{dir:`auto`,className:`text-[13px] leading-[1.45] text-white/90`,children:e.text})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 pt-0.5`,children:[(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/55 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>s?.(`dismiss`),children:e.reason===`claimed`?c(`companionSurface.notNow`):c(`companionSurface.offerDiscard`)}),e.reason===`claimed`?(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/70 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>s?.(`quit`),children:c(`companionSurface.offerQuit`,{app:e.app})}):null,(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full bg-white/15 px-3 text-[12px] text-white transition-colors hover:bg-white/25`,onClick:()=>s?.(e.reason===`claimed`?`use`:`copy`),children:e.reason===`claimed`?c(`companionSurface.offerUse`):c(`companionSurface.offerCopy`)})]})]})}var ve={microphone:{action:`companionIntro.permission.microphoneAction`,body:`companionIntro.permission.microphoneBody`},inputMonitoring:{action:`companionIntro.permission.openSettings`,body:`companionIntro.permission.shortcutBody`},screen:{action:`companionIntro.permission.screenAction`,body:`companionIntro.permission.screenBody`}};function ye({permission:e}){let{t}=v(),n=(0,L.useRef)(null),{state:r}=e,i=r.phase===`known`?r.item:null,o=r.phase===`checking`||r.phase===`requesting`,s=fe(e.kind,i),c=i?.status===`restricted`,l=r.phase===`error`||i?.error!==void 0,u=ve[e.kind];return(0,z.jsxs)(`div`,{ref:n,className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:t(u.body)}),(0,z.jsx)(a,{size:`compact`,shape:`pill`,className:`self-start bg-white/15 text-white hover:bg-white/25`,loading:o,disabled:c||r.phase===`checking`,onClick:()=>{let t=n.current?.getBoundingClientRect();e.enable(t?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0)},children:t(s?`companionIntro.permission.openSettings`:u.action)}),(0,z.jsx)(`p`,{role:`status`,className:`text-[12px] leading-tight text-white/60`,children:c?t(`companionIntro.permission.restricted`):l?t(`companionIntro.permission.error`):s?t(e.kind===`microphone`?`companionIntro.permission.microphoneSettingsHint`:`companionIntro.permission.settingsHint`):o?t(`companionIntro.permission.waiting`):e.kind===`microphone`?t(`companionIntro.permission.microphonePromptHint`):null})]})}var be=3e3,xe={idle:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.idle.body`},meet:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.meet.body`},talk:{title:`companionIntro.talk.title`,body:`companionIntro.talk.body`},key:{title:`companionIntro.key.title`},share:{title:`companionIntro.share.title`,body:`companionIntro.share.body`},draw:{title:`companionIntro.draw.title`,body:`companionIntro.draw.body`},mute:{title:`companionIntro.mute.title`,body:`companionIntro.mute.body`},try:{title:`companionIntro.try.title`,body:`companionIntro.try.body`}},B=e=>g(e),V=e=>({phase:`listening`,label:e,accentHex:``,muted:!1,outputMuted:!1,detail:``,approvalRequestId:``,assistantName:``}),H={share:`⌥S`,draw:`⌥D`,muteMicrophone:`⌥M`,muteAssistant:`⌥A`},Se={share:{icon:(0,z.jsx)(ue,{className:`size-5`}),shortcut:H.share},draw:{icon:(0,z.jsx)(M,{className:`size-5`}),shortcut:H.draw},mute:{icon:(0,z.jsx)(P,{className:`size-5`}),shortcut:H.muteMicrophone}},Ce=e=>B(e)===void 0?null:`call`,we=(e,t)=>B(e)===void 0?null:{call:V(t),sharing:e!==`share`};function Te({beat:e,growth:t=`right`,cardGrowth:n=`up`,avatarBox:r=p,optionsBox:a=p,accentHex:o,assistantName:s,cardRef:l,onAdvance:u,permission:d=null,greeted:m=!1,voiceKeyTaps:h=0,chordPresses:_=0,chordControl:y}){let{t:b}=v(),x=f.indexOf(e),S=x===f.length-1,C=x<=0,w=xe[e],T=R(d),ee=d?.state.phase===`checking`,E=c[e],D=g(e),O=D===void 0?void 0:Se[D],[k,A]=(0,L.useState)(!1);(0,L.useEffect)(()=>{A(!1)},[e]),(0,L.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>{A(!1)},be);return()=>{clearTimeout(e)}},[k]),(0,L.useEffect)(()=>{A(!1)},[h]);let[te,j]=(0,L.useState)(h),[ne,M]=(0,L.useState)(_),[re,ie]=(0,L.useState)(e);re===e?h<te&&j(h):(ie(e),j(h),M(_));let ae=Math.min(Math.max(h-te,0),2);_<ne&&M(_);let oe=D!==void 0&&y===D&&_>ne,{inUnits:P,avatarHalf:F,gap:I,lineAt:se,edgeAt:le,introStepOff:ue}=ce(r,a),de=n===`down`||B(e)===void 0?P(ue(n)):P(F+I)+22+P(F)+6,fe=le(t,-F),pe={top:se(n,0),transform:n===`up`?`translateY(calc(-100% - ${de}px))`:`translateY(${de}px)`};return(0,z.jsxs)(`div`,{ref:l,role:`group`,"aria-label":b(`companionIntro.ariaLabel`),className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-5 shadow-lg shadow-black/40`,style:{width:320,height:224,...fe,...pe},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":b(`companionIntro.close`),className:`absolute top-2 right-2 flex size-6 items-center justify-center rounded-full text-white/45 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>u?.(`dismiss`),children:(0,z.jsx)(N,{className:`size-3.5`})}),(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`pr-6 text-[16px] leading-tight font-medium text-white`,children:(0,z.jsx)(`span`,{className:`line-clamp-2`,children:`titleNamed`in w&&s!==void 0?b(w.titleNamed,{name:s}):b(w.title)})}),ee?null:T&&d!==null?(0,z.jsx)(ye,{permission:d}):(0,z.jsxs)(z.Fragment,{children:[`body`in w?(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(e===`talk`&&m?`companionIntro.talk.greeted`:w.body)}):null,e===`talk`&&(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0})}),e===`key`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(k?`companionIntro.key.scolded`:`companionIntro.talk.gesture`)}),(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})})]}),e===`try`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-3`,children:[(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0}),(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})]}),(0,z.jsx)(`p`,{className:`text-center text-[11px] leading-tight text-white/45`,children:b(k?`companionIntro.key.scolded`:`companionIntro.try.how`)})]}),O!==void 0&&(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-white/10 text-white/85`,children:O.icon}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.click`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex h-10 items-center rounded-xl border px-3 text-[13px] font-medium transition-colors ${oe?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:`border-white/15 bg-white/10 text-white/85`}`,children:O.shortcut}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.shortcut`)})]})]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pt-2`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1`,"aria-hidden":!0,children:i.map(e=>(0,z.jsx)(`span`,{className:`size-1.5 rounded-full transition-colors`,style:{backgroundColor:e===E?o??`#5eead4`:`rgba(255,255,255,.2)`}},e))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C?null:(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full px-3 text-[14px] text-white/60 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>u?.(`back`),children:b(`companionIntro.back`)}),(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full bg-white/15 px-3 text-[14px] text-white transition-colors hover:bg-white/25`,onClick:()=>u?.(`next`),children:b(S?`companionIntro.done`:T&&!ee?`companionIntro.permission.skip`:`companionIntro.next`)})]})]})]})}function U({label:e,taps:t=0,scolded:n=!1,take:r}){let i=t>=2?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:t===1?`border-emerald-400/70 bg-emerald-400/20 text-emerald-100`:`border-white/20 bg-white/10 text-white/85`,a=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(w,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`absolute bottom-1 left-1.5 text-[9px] leading-none opacity-70`,"aria-hidden":!0,children:e})]}),o=`relative inline-flex size-11 items-center justify-center rounded-lg border font-medium shadow-[inset_0_-2px_0_rgba(0,0,0,.4)] transition-[color,background-color,border-color,transform] ${i} ${n?`scale-90 opacity-70`:``}`;return r===void 0?(0,z.jsx)(`span`,{className:o,"aria-label":e,children:a}):(0,z.jsx)(`button`,{type:`button`,className:`${o}${t===0?`hover:border-white/40 hover:bg-white/20`:``}`,"aria-label":e,onClick:r,children:a})}var Ee=e=>e.filter(e=>e.state===`running`),W=e=>e.filter(e=>e.state===`waiting`),De=e=>({"--companion-ring-accent":e});function Oe({size:e,still:t=!1}){return(0,z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,className:`shrink-0 ${t?``:`companion-work-spin`}`,"aria-hidden":!0,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeOpacity:`0.2`,strokeWidth:`2`}),(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:t?void 0:`10 28`,strokeOpacity:t?.6:void 0})]})}function ke({state:e}){return e===`done`?(0,z.jsx)(D,{className:`companion-work-pop size-3.5 shrink-0 text-[var(--companion-ring-accent)]`,"aria-hidden":!0}):(0,z.jsx)(N,{className:`companion-work-pop size-3.5 shrink-0 text-white/50`,"aria-hidden":!0})}function Ae(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function G(){let[e,t]=(0,L.useState)(()=>Date.now());return(0,L.useEffect)(()=>{let e=window.setInterval(()=>{t(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]),e}function je({work:e,accentHex:t}){let{t:n}=v(),r=G(),i=e.slice(0,5),a=e.length-i.length;return(0,z.jsxs)(`div`,{className:`flex w-full min-w-[300px] flex-col gap-1.5 px-4 py-3 text-[12px] text-white/85`,style:De(t),"data-companion-work-shelf":!0,children:[i.map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.state===`running`||e.state===`waiting`?(0,z.jsx)(Oe,{size:14,still:e.state===`waiting`}):(0,z.jsx)(ke,{state:e.state}),(0,z.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-medium ${e.state===`done`||e.state===`failed`?`text-white/55`:``}`,children:e.title}),(0,z.jsx)(`span`,{className:`companion-work-fade min-w-0 flex-1 truncate text-white/50`,children:e.state===`running`?e.step:e.state===`waiting`?n(`companionSurface.workWaitingStep`):e.state===`done`?n(`companionSurface.workDone`):n(`companionSurface.workStopped`)},e.state===`running`?e.step:e.state),e.kind===`subagent`?(0,z.jsx)(`span`,{className:`shrink-0 text-[11px] text-white/40 tabular-nums`,children:Ae(r-e.startedAt)}):null]},e.id)),a>0?(0,z.jsx)(`div`,{className:`pl-[22px] text-[11px] text-white/40`,children:n(`companionSurface.workMore`,{count:a})}):null]})}var Me={min:3,max:10},Ne=(e=Math.random)=>{let t=e();return t<1/3?`top`:t<2/3?`topLeft`:`topRight`},Pe=1600,Fe=.22,Ie=.04,Le=4,Re=(e,t)=>{let n=Math.min(.95,Math.max(.25,e.eyeCenterFrac+e.eyeHalfFrac+Ie)),r=Math.min(t,24,14/n),i=r*n;return{size:r,exposed:i,clip:{width:r+2*Le,height:i+Le},rest:i+2}},ze=(e,t=Math.random)=>(e.min+t()*(e.max-e.min))*1e3;function Be(e,t=Me){let[n,r]=(0,L.useState)(0),{min:i,max:a}=t;return(0,L.useEffect)(()=>{if(!e)return;let t,n=()=>{t=setTimeout(()=>{r(e=>e+1),n()},ze({min:i,max:a}))};return n(),()=>{clearTimeout(t)}},[e,i,a]),n}var Ve=(e,t,n={width:0,height:0})=>{let r=e===`topLeft`?n.width/4:e===`topRight`?n.width*3/4:n.width/2;return{slot:{width:t.width,height:t.height,bottom:`100%`,left:r-t.width/2}}};function He({character:e,capsule:t,enabled:n,held:i=!1,edge:a,interval:o=Me,className:s,style:c}){let l=b(),u=(0,L.useMemo)(()=>_(r,e),[e]),d=Be(n&&!i&&!l&&u!==null,o),[f,p]=(0,L.useState)(!1),[h,g]=(0,L.useState)(`top`);if((0,L.useEffect)(()=>{if(d===0)return;g(Ne()),p(!0);let e=setTimeout(()=>{p(!1)},Pe);return()=>{clearTimeout(e)}},[d]),u===null||l)return null;let v=Re(u,t.width),x=i||f,S=a??h,C=Ve(S,v.clip,t);return(0,z.jsx)(`div`,{className:`companion-peek ${s??``}`,style:{width:t.width,height:t.height,...c},"data-risen":x,"data-edge":S,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute`,style:C.slot,children:(0,z.jsx)(`div`,{className:`absolute inset-0 overflow-hidden`,children:(0,z.jsx)(y.div,{className:`absolute left-1/2`,style:{width:v.size,height:v.size,marginLeft:-v.size/2,top:v.clip.height-v.exposed},initial:{y:v.rest},animate:{y:x?0:v.rest},transition:i?{duration:0}:x?{type:`spring`,stiffness:280,damping:14}:{duration:Fe,ease:`easeIn`},children:(0,z.jsx)(m,{components:r,traits:e,size:v.size})})})})})}var Ue=(0,L.createContext)(`above`),We=`#5eead4`,Ge=new Set([`transcribing`,`thinking`,`speaking`]),K=28,q={idle:{width:64,height:14},closing:K,rim:2,bloom:4},Ke=q.idle,qe=(e,t,n)=>[`inset 0 0 0 ${t}px color-mix(in srgb, ${e} 78%, transparent)`,`0 0 ${n}px color-mix(in srgb, ${e} 85%, transparent)`,`0 0 ${n*4}px color-mix(in srgb, ${e} 42%, transparent)`,`0 8px 24px rgba(0, 0, 0, 0.45)`].join(`, `),Je=244,Ye=200,J=120,Xe=32,Ze={watching:40,summary:220,dictating:Je+32,offer:Ye+32,call:4+J+180},Qe=84,$e={width:28,height:Qe+140+20};function et({phase:e,assistantName:t=``,accentHex:n=We,avatarSrc:r,character:i,hovered:a=!1,growth:o=`right`,avatarBox:s=p,optionsBox:c=p,cardGrowth:l=`up`,dock:u=`bottom`,rootRef:d,restingPillRef:f,avatarRef:m,onSurfacePointerDown:h,onSurfaceContextMenu:g,spotlight:_,avatarStaged:y=!1,avatarTucked:x=!1,onWatch:S,onTeach:C,picking:w=!1,sharing:T=!1,shareEnabled:ee=!1,sharePicking:E=!1,onShare:D,onStopShare:O,annotating:k=!1,annotationTool:A,onAnnotationTool:te,drawToolsRef:j,onAnnotate:ne,marked:M=!1,onClearMarks:re,openPicker:ie,onPicker:N,shortcuts:ae,onAvatarClick:oe,working:P=!1,watching:F=!1,watchRetro:I,onWatchRetro:se,dictationOffer:le,offer:ue,watchEnabled:de=!1,dictating:fe,dictationText:pe=``,call:R,onControl:me,intro:he,picker:ge,prompt:_e,promptRef:ve,promptsDeferred:ye=0,onReviewPrompts:be,onWorkShelfChange:xe}){let{t:B}=v(),V=e===`call`?R?.work:void 0,H=V!==void 0&&V.length>0,[Se,Ce]=(0,L.useState)(!1);(0,L.useEffect)(()=>{H||Ce(!1)},[H]);let we=u===`left`||u===`right`?void 0:_e,Te=we==null?Se&&H:!1;(0,L.useEffect)(()=>{xe?.(Te)},[xe,Te]);let U=(0,L.useMemo)(()=>we??(Se&&H?(0,z.jsx)(je,{work:V,accentHex:n}):void 0),[we,Se,H,V,n]),Ee=e!==`resting`,W=e===`call`||e===`dictating`||e===`offer`||e===`summary`||e===`watching`,De=(0,L.useRef)(null),[Oe,ke]=(0,L.useState)(null),Ae=_===`talk`?void 0:_;(0,L.useEffect)(()=>{if(Ae===void 0){ke(null);return}return nt(De,`[data-control="${Ae}"]`,e=>{ke(e.x)})},[Ae,e,T]);let[G,Me]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(!y){Me(null);return}return nt(De,`[data-avatar-stage]`,Me)},[y,e]);let[Ne,Pe]=(0,L.useState)(!1);(0,L.useEffect)(()=>{if(e!==`hover`){Pe(!1);return}let t=setTimeout(()=>{Pe(!0)},500);return()=>{clearTimeout(t)}},[e]);let Fe=he==null?_===`talk`||e===`hover`&&Ne:!1,Ie=I===`pending`,Le=P||R!==void 0&&Ge.has(R.phase),Re=b(),ze=(0,L.useRef)(null),[Be,Ve]=(0,L.useState)(null),He=(0,L.useRef)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=()=>{Ve({width:e.scrollWidth-He.current.width,height:e.scrollHeight-He.current.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[e]);let{scale:K,avatarRel:Ke,avatarHalf:Je,gap:Ye,inUnits:J,lineAt:Xe,edgeAt:Qe}=ce(s,c),et=e===`call`,Y=et&&(u===`left`||u===`right`),tt=Y?u===`left`?`right`:`left`:`above`,X=W?Y?(Be?.width??$e.width)+16:p+(Be?.width??Ze[e])+8:0,dt=W?p+(Be?.height??$e.height)+8:0,Z=et&&U!=null,pt=(0,L.useRef)(null),[mt,ht]=(0,L.useState)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=pt.current;if(!Z||e===null)return;let t=()=>{let t=e.getBoundingClientRect();ht({width:Math.ceil(t.width/K),height:Math.ceil(t.height/K)})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Z,U,K]);let gt=Z&&!Y?Math.max(X,mt.width):X,_t=Z&&Y?Math.max(dt,mt.height):dt,vt=Y?_t-dt:gt-X;(0,L.useLayoutEffect)(()=>{He.current=Y?{width:0,height:vt}:{width:vt,height:0}},[vt,Y]);let Q=Y?`50%`:Xe(l,0),yt=Qe(o,o===`left`?c/2:-(c/2)),bt=s/p,xt=Ee?{width:q.closing*bt,height:q.closing*bt}:q.idle,St=he!=null,Ct=et?{width:gt,...Y?{height:_t}:{},left:`50%`,top:Q,transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`}:{width:X,...yt,top:Q,transform:`translateY(-50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`},$=G===null?Oe!==null&&!Y?`${Oe}px`:et&&!Y?`calc(50% - ${gt/2-p/2}px)`:`50%`:`${G.x}px`,wt=G===null?Oe!==null&&!Y?`calc(${Q} - ${J(Je+Ye)+22}px)`:Y?`calc(50% - ${_t/2-p/2}px)`:Q:`${G.y}px`;return(0,z.jsxs)(`div`,{ref:De,className:`absolute top-0 left-0 origin-top-left`,style:{width:`${100/K}%`,height:`${100/K}%`,transform:`scale(${K})`},children:[Z?(0,z.jsx)(ut,{dock:u,top:Q,width:Y?mt.width:gt,height:_t,barThickness:Y?X:44,promptRef:ve,children:U}):null,Z?(0,z.jsx)(`div`,{ref:pt,inert:!0,"aria-hidden":!0,"data-theme":`dark`,className:`pointer-events-none invisible absolute top-0 left-0 w-max ${Y?`max-w-[400px]`:`max-w-[640px]`}`,children:U}):null,(0,z.jsxs)(`div`,{className:`absolute flex cursor-grab items-center rounded-full duration-300 select-none active:cursor-grabbing ${Y?`flex-col transition-[width,height] will-change-[width,height]`:`h-11 transition-[width] will-change-[width]`} ${!et&&o===`left`?`justify-end`:``}`,style:Ct,onPointerDown:h,onContextMenu:g,ref:d,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 rounded-full transition-opacity duration-200 ${Z?`bg-[#17181b]`:`border border-white/10 bg-[#17181b]/95 shadow-lg shadow-black/40`}`,style:{opacity:+!!W},"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`relative flex shrink-0 items-center ${Y?`flex-col`:`h-11`}`,style:Y?{paddingTop:p,paddingBottom:8,paddingInline:8}:o===`left`?{paddingLeft:8,paddingRight:p}:{paddingLeft:p,paddingRight:8},children:(0,z.jsx)(`div`,{className:`flex items-center gap-1 overflow-hidden transition-opacity duration-200 ${Y?`min-h-0 flex-col`:`min-w-0`}`,ref:ze,inert:!W,style:{opacity:+!!W,transitionDelay:W?`120ms`:`0ms`},children:e===`call`?(0,z.jsx)(Ue.Provider,{value:tt,children:(0,z.jsx)(ft,{call:R,assistantName:t,spotlight:_,watching:F,watchEnabled:de,picking:w,sharing:T,shareEnabled:ee,sharePicking:E,annotating:k,marked:M,annotationTool:A,vertical:Y,drawToolsPlacement:Y?u===`left`?`right`:`left`:l===`up`?`above`:`below`,drawToolsRef:j,onAnnotationTool:te,onControl:me,onWatch:S,onTeach:C,onShare:D,onStopShare:O,onAnnotate:ne,onClearMarks:re,openPicker:ie,onPicker:N,pickerSide:Y?u===`left`?`right`:`left`:u===`top`?`below`:`above`,shortcuts:ae,promptsDeferred:ye,lineExtra:vt,onReviewPrompts:be,accentHex:n,workShelfOpen:Te,onToggleWorkShelf:()=>{Ce(e=>!e)}})}):e===`dictating`&&fe!==void 0?(0,z.jsx)(ot,{dictating:fe,dictationText:pe}):e===`summary`&&I!==void 0?(0,z.jsx)(lt,{retro:I,onWatchRetro:se}):e===`offer`&&le!==void 0?(0,z.jsx)(st,{offer:le}):(0,z.jsx)(ct,{watching:F,onWatch:S})})})]}),(0,z.jsx)(`div`,{className:`absolute cursor-grab active:cursor-grabbing`,style:{width:J(q.idle.width),height:J(q.idle.height),pointerEvents:Ee?`none`:void 0,left:`50%`,top:Q,transform:`translate(-50%, -50%)`},onPointerDown:h,onContextMenu:g,ref:f,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute top-1/2 left-1/2 rounded-full transition-[width,height,opacity] duration-300`,style:{width:J(xt.width),height:J(xt.height),transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:Re?`opacity`:void 0,boxShadow:qe(n,J(q.rim),J(q.bloom)),opacity:Ee||G!==null||St&&!x?0:1}})}),(0,z.jsx)(it,{className:Fe?`opacity-100`:`opacity-0`,"data-companion-name":Fe?`shown`:`hidden`,style:{left:`50%`,top:Q,transform:`translate(-50%, calc(-100% - ${J(Je)}px - ${rt}px))`},label:B(`companionSurface.talk`)}),(0,z.jsx)(at,{label:B(e===`call`?`companionSurface.openVellum`:`companionSurface.talk`),accentHex:n,avatarSrc:r,character:i,attentive:a,busy:Le||F||Ie,collapsed:!Ee&&(!St||x),restingScale:p/s,style:{left:$,top:wt,zIndex:G===null?void 0:2,transform:`translate(-50%, -50%)${Ke===1?``:` scale(${Ke})`}`,transition:Re?void 0:Oe===null&&G===null?`left 300ms cubic-bezier(.2,.8,.2,1), top 300ms cubic-bezier(.2,.8,.2,1)`:`left 420ms cubic-bezier(.34,1.56,.64,1), top 420ms cubic-bezier(.34,1.56,.64,1)`},elementRef:m,onPointerDown:h,onContextMenu:g,onClick:oe}),he,ge,ue]})}var Y=`rgba(28, 28, 30, 0.55)`,tt=`backdrop-blur-md backdrop-saturate-150`,nt=(e,t,n)=>{let r=0,i=performance.now(),a=()=>{let o=e.current,s=o?.querySelector(t);if(o&&s){let e=o.getBoundingClientRect(),t=s.getBoundingClientRect(),r=e.width===0?1:o.offsetWidth/e.width;n({x:(t.left+t.width/2-e.left)*r,y:(t.top+t.height/2-e.top)*r})}performance.now()-i<500&&(r=requestAnimationFrame(a))};return a(),()=>{cancelAnimationFrame(r)}},rt=4;function it({className:e,style:t,label:n,shortcut:r,beak:i=`down`,...a}){return(0,z.jsxs)(`span`,{className:`pointer-events-none absolute rounded-md px-2 py-1 text-[11px] leading-4 font-medium whitespace-nowrap text-white/90 shadow-md shadow-black/30 transition-opacity duration-200 ${tt} ${e}`,style:{...t,backgroundColor:Y},"aria-hidden":!0,...a,children:[n,r===void 0?null:(0,z.jsx)(`span`,{className:`ml-1.5 font-normal text-white/60`,"data-shortcut":!0,children:r}),(0,z.jsx)(`span`,{className:`absolute ${i===`down`?`top-full left-1/2 h-1.5 w-2.5 -translate-x-1/2`:i===`left`?`top-1/2 right-full h-2.5 w-1.5 -translate-y-1/2`:`top-1/2 left-full h-2.5 w-1.5 -translate-y-1/2`} ${tt}`,style:{backgroundColor:Y,clipPath:i===`down`?`polygon(0 0, 100% 0, 50% 100%)`:i===`left`?`polygon(100% 0, 100% 100%, 0 50%)`:`polygon(0 0, 0 100%, 100% 50%)`},"aria-hidden":!0})]})}function at({accentHex:e,avatarSrc:t,character:n,busy:i=!1,attentive:a=!1,collapsed:o=!1,restingScale:s=1,label:c,style:l,elementRef:u,onPointerDown:d,onContextMenu:f,onClick:p}){let h=b();return(0,z.jsxs)(`div`,{role:`button`,"aria-label":c,className:`absolute grid size-11 cursor-grab place-items-center active:cursor-grabbing`,style:l,ref:u,onPointerDown:d,onContextMenu:f,onClick:p,children:[n===void 0?null:(0,z.jsx)(He,{character:n,capsule:Ke,enabled:o&&!i,className:`absolute top-1/2 left-1/2 transition-opacity duration-200`,style:{transform:`translate(-50%, -50%) scale(${s})`,opacity:+!!o}}),(0,z.jsx)(`div`,{className:`transition-[opacity,transform] duration-300`,style:{opacity:+!o,transform:o?`scale(0.35)`:`scale(1)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:h?`opacity`:void 0},children:(0,z.jsx)(`div`,{className:`companion-avatar-bob relative grid place-items-center`,style:{animation:h?`none`:void 0},children:n===void 0?t===void 0?(0,z.jsx)(`span`,{className:`relative size-7 rounded-full drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,style:{background:e},"aria-hidden":!0}):(0,z.jsx)(`img`,{src:t,alt:``,draggable:!1,className:`relative size-7 rounded-full object-contain drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)] [-webkit-user-drag:none]`}):(0,z.jsx)(`div`,{className:`relative drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,children:(0,z.jsx)(m,{components:r,traits:n,size:K,isAssistantBusy:i,attentive:a})})})})]})}function ot({dictating:e,dictationText:t}){let{t:n}=v(),r=t.trim();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),r?(0,z.jsx)(`span`,{dir:`auto`,className:`flex justify-end overflow-hidden text-[12px] whitespace-nowrap text-white/85`,style:{width:Je},children:(0,z.jsx)(`span`,{className:`shrink-0`,children:r})}):(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Je},children:n(e===`listening`?`companionSurface.dictating`:`companionSurface.dictatingTranscribing`)})]})}function st({offer:e}){let{t}=v();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Ye},children:e.reason===`claimed`?t(`companionSurface.offerHeard`,{app:e.app}):t(he(e.reason))})]})}function ct({watching:e=!1,onWatch:t}){return(0,z.jsx)(z.Fragment,{children:e&&(0,z.jsx)(vt,{onWatch:t})})}function X({watching:e,watchEnabled:t,picking:n,dimmed:r,onWatch:i,onTeach:a}){let{t:o}=v();return t?(0,z.jsx)($,{icon:(0,z.jsx)(ne,{className:`size-4`}),label:o(`companionSurface.teach`),dimmed:r,pressed:e||n,onClick:e?i:a??i}):e?(0,z.jsx)(vt,{onWatch:i}):null}function lt({retro:e,onWatchRetro:t}){let{t:n}=v();return e===`pending`?(0,z.jsx)(`span`,{className:`ml-1 shrink-0 text-[12px] text-white/85`,children:n(`companionSurface.summarizing`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(re,{className:`size-4`}),label:n(`companionSurface.showSummary`),showLabel:!0,onClick:()=>{t?.(!0)}}),(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`}),label:n(`companionSurface.notNow`),showLabel:!0,onClick:()=>{t?.(!1)}})]})}function ut({dock:e,top:t,width:n,height:r,barThickness:i,promptRef:a,children:o}){let s=i/2,c=e===`top`?`below`:e===`left`?`right`:e===`right`?`left`:`above`,l=c===`left`||c===`right`,u=l?{left:`50%`,top:t,width:n+s,height:r,transform:c===`right`?`translate(0, -50%)`:`translate(-100%, -50%)`,[c===`right`?`paddingLeft`:`paddingRight`]:s}:{left:`50%`,top:t,width:n,transform:c===`below`?`translate(-50%, 0)`:`translate(-50%, -100%)`,[c===`below`?`paddingTop`:`paddingBottom`]:s},d={above:`rounded-t-[22px]`,below:`rounded-b-[22px]`,left:`rounded-l-[22px]`,right:`rounded-r-[22px]`}[c];return(0,z.jsxs)(`div`,{ref:a,"data-theme":`dark`,"data-shelf-side":c,className:`absolute`,style:u,onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 bg-[#17181b] shadow-lg shadow-black/40 ${d}`}),(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute bg-white/10 ${l?`top-4 bottom-4 w-px`:`right-4 left-4 h-px`}`,style:{[dt[c]]:s}}),(0,z.jsx)(`div`,{className:`relative`,children:o})]})}var dt={above:`bottom`,below:`top`,left:`right`,right:`left`};function ft({call:e,assistantName:t,spotlight:n,watching:r,watchEnabled:i,picking:a,sharing:o,shareEnabled:s,sharePicking:c,annotating:l,marked:u,annotationTool:d,vertical:f,drawToolsPlacement:p,drawToolsRef:m,onAnnotationTool:h,onControl:g,onWatch:_,onTeach:y,onShare:b,onStopShare:x,onAnnotate:S,onClearMarks:C,openPicker:w,onPicker:T,pickerSide:ee,shortcuts:E,promptsDeferred:D=0,onReviewPrompts:O,lineExtra:A=0,accentHex:te,workShelfOpen:j,onToggleWorkShelf:ne}){let{t:M}=v();if(e===void 0)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{vertical:f,extra:A,text:t===``?M(`companionSurface.calling`):M(`companionSurface.callingNamed`,{name:t})}),(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,onWatch:_,onTeach:y}),(0,z.jsx)(_t,{onControl:g})]});let re=e.work===void 0&&e.detail||e.label,N=e.work??[],oe=N.length>0,{muted:F,outputMuted:I}=e,se=e.assistantName;return(0,z.jsxs)(z.Fragment,{children:[oe?(0,z.jsx)(xt,{work:N,accentHex:te,open:j,onToggle:ne}):null,(0,z.jsx)(Z,{vertical:f,extra:A-(!f&&oe?Xe:0),text:re}),D>0?(0,z.jsx)(`button`,{type:`button`,"data-theme":`dark`,"aria-label":M(`companionPopover.pendingBadge`,{count:D}),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--system-negative-weak)] text-[13px] text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-hover)] hover:text-white`,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{O?.()},children:D}):null,(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,dimmed:n!==void 0,onWatch:_,onTeach:y}),(0,z.jsx)(pt,{sharing:o,shareEnabled:s,sharePicking:c,shortcut:s?E?.share:void 0,spotlit:n===`share`,dimmed:n!==void 0&&n!==`share`,onShare:b,onStopShare:x}),(0,z.jsx)(mt,{sharing:o,annotating:l,spotlit:n===`draw`,dimmed:n!==void 0&&n!==`draw`,shortcut:s?E?.draw:void 0,tool:d,placement:p,toolsRef:m,onAnnotate:S,onTool:h}),(0,z.jsx)(gt,{sharing:o,marked:u,dimmed:n!==void 0,onClearMarks:C}),(0,z.jsx)($,{icon:I?(0,z.jsx)(ae,{className:`size-4`}):(0,z.jsx)(ie,{className:`size-4`}),label:se===``?M(I?`companionSurface.unmuteAssistant`:`companionSurface.muteAssistant`):M(I?`companionSurface.unmuteAssistantNamed`:`companionSurface.muteAssistantNamed`,{name:se}),shortcut:E?.muteAssistant,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(I?`unmuteAssistantAudio`:`muteAssistantAudio`)}}),(0,z.jsx)($,{icon:F?(0,z.jsx)(k,{className:`size-4`}):(0,z.jsx)(P,{className:`size-4`}),label:M(F?`companionSurface.unmuteMicrophone`:`companionSurface.muteMicrophone`),shortcut:E?.muteMicrophone,control:`mute`,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(F?`unmuteMicrophone`:`muteMicrophone`)}}),(0,z.jsx)(Ct,{picker:`microphones`,label:M(`companionSurface.chooseMicrophone`),side:ee,open:w===`microphones`,onPicker:T}),(0,z.jsx)(_t,{dimmed:n!==void 0,onControl:g})]})}function Z({vertical:e,text:t,extra:n=0}){return e?(0,z.jsx)(`span`,{className:`mt-1 shrink-0 truncate text-[12px] text-white/85`,style:{height:Qe+n,writingMode:`vertical-rl`},"data-label":`line`,children:t}):(0,z.jsx)(`span`,{className:`ml-1 shrink-0 truncate text-[12px] text-white/85`,style:{width:J+n},"data-label":`line`,children:t})}function pt({sharing:e,shareEnabled:t,sharePicking:n,shortcut:r,spotlit:i,dimmed:a,onShare:o,onStopShare:s}){let{t:c}=v();return!t&&!e?null:(0,z.jsx)($,{icon:(0,z.jsx)(ue,{className:`size-4`}),label:c(`companionSurface.share`),shortcut:r,control:`share`,spotlit:i,dimmed:a,pressed:e||n,onClick:e?s:o})}function mt({sharing:e,annotating:t,shortcut:n,spotlit:r,dimmed:i,tool:a,placement:o,toolsRef:s,onAnnotate:c,onTool:l}){let{t:u}=v();return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(M,{className:`size-4`}),label:u(`companionSurface.draw`),shortcut:n,control:`draw`,spotlit:r,dimmed:i,pressed:t,className:`companion-draw-anchor`,onClick:()=>{c?.(!t)}}),t&&a!==void 0&&(0,z.jsx)(ht,{tool:a,placement:o,toolsRef:s,onTool:l})]}):null}function ht({tool:e,placement:t,toolsRef:n,onTool:r}){let{t:i}=v(),a=[{tool:`freehand`,icon:(0,z.jsx)(M,{className:`size-4`}),label:i(`companionSurface.drawFreehand`)},{tool:`line`,icon:(0,z.jsx)(de,{className:`size-4`}),label:i(`companionSurface.drawLine`)},{tool:`box`,icon:(0,z.jsx)(ee,{className:`size-4`}),label:i(`companionSurface.drawBox`)},{tool:`circle`,icon:(0,z.jsx)(C,{className:`size-4`}),label:i(`companionSurface.drawCircle`)}];return(0,z.jsx)(`div`,{className:`companion-draw-tools absolute flex items-center gap-0.5 rounded-full border border-white/10 bg-[#17181b]/95 p-0.5 shadow-lg shadow-black/40 companion-draw-tools-${t} ${t===`left`||t===`right`?`flex-col`:``}`,role:`group`,"aria-label":i(`companionSurface.drawTools`),"data-testid":`companion-draw-tools`,ref:n,onPointerDown:e=>{e.stopPropagation()},children:a.map(t=>(0,z.jsx)($,{icon:t.icon,label:t.label,pressed:e===t.tool,onClick:()=>{r?.(t.tool)}},t.tool))})}function gt({sharing:e,marked:t,dimmed:n,onClearMarks:r}){let{t:i}=v();return!e||!t?null:(0,z.jsx)($,{icon:(0,z.jsx)(le,{className:`size-4`}),label:i(`companionSurface.clearMarks`),dimmed:n,onClick:()=>{r?.()}})}function _t({dimmed:e,onControl:t}){let{t:n}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`,strokeWidth:2.5}),label:n(`companionSurface.endSession`),tone:`negative`,dimmed:e,onClick:()=>{t?.(`endSession`)}})}function vt({onWatch:e}){let{t}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(te,{className:`size-4`}),label:t(`companionSurface.stopTeaching`),onClick:e})}var Q=`-translate-y-[calc(50%+22px)]`,yt={right:`translate-x-[calc(50%+22px)]`,left:`-translate-x-[calc(50%+22px)]`},bt=e=>e===`above`?{className:Q,beak:`down`}:{className:yt[e],beak:e===`right`?`left`:`right`};function xt({work:e,accentHex:t,open:n,onToggle:r}){let{t:i}=v(),a=bt((0,L.useContext)(Ue)),o=Ee(e),s=W(e),c=o.length>0?o:s,l=e.at(-1),u=(c.length>0?c:e).map(e=>e.title).join(` · `);return(0,z.jsxs)(`button`,{type:`button`,"aria-label":o.length===0&&s.length>0?i(`companionSurface.workWaiting`,{count:s.length}):i(`companionSurface.workCount`,{count:o.length}),"aria-expanded":r===void 0?void 0:n,"data-control":`work`,disabled:r===void 0,className:`group flex h-7 shrink-0 items-center justify-center rounded-full px-1.5 transition-colors enabled:hover:bg-white/15 ${n?`bg-white/15`:``}`,style:{...De(t),width:Xe},onPointerDown:e=>{e.stopPropagation()},onClick:r,children:[(0,z.jsx)(`span`,{className:`relative grid size-5 place-items-center`,children:c.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`absolute inset-0 grid place-items-center`,children:(0,z.jsx)(Oe,{size:20,still:o.length===0})}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none font-semibold text-white/90 tabular-nums`,children:c.length})]}):(0,z.jsx)(ke,{state:l?.state===`failed`?`failed`:`done`})}),n?null:(0,z.jsx)(it,{label:u,className:`opacity-0 group-hover:opacity-100 ${a.className}`,beak:a.beak,"data-label":`hover`})]})}var St={above:A,below:oe,left:O,right:E};function Ct({picker:e,label:t,side:n,open:r,onPicker:i}){if(i===void 0)return null;let a=St[n];return(0,z.jsx)($,{icon:(0,z.jsx)(a,{className:`size-3.5`,strokeWidth:2.25}),label:t,pressed:r,narrow:!0,onClick:()=>{i(e)}})}function $({icon:e,label:t,shortcut:n,tone:r,showLabel:i=!1,pressed:a,spotlit:o=!1,dimmed:s=!1,control:c,narrow:l=!1,className:u=``,onClick:d}){let f=bt((0,L.useContext)(Ue));return(0,z.jsxs)(`button`,{type:`button`,"aria-label":t,"aria-pressed":a,"data-control":c,onClick:d,onPointerDown:e=>{e.stopPropagation()},className:`group flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-full text-[12px] transition-[background-color,opacity] duration-200 hover:bg-white/15 ${l?`-mx-1 px-0.5`:`px-2`} ${u} ${a===!0||o?`bg-white/15`:``} ${s?`opacity-35`:``} ${r===`negative`?`text-[#ff6b6b]`:r===`positive`?`text-[#5ee08a]`:`text-white/85`}`,children:[e,i?(0,z.jsx)(`span`,{children:t}):(0,z.jsx)(it,{label:t,shortcut:n,className:`opacity-0 group-hover:opacity-100 ${f.className}`,beak:f.beak,"data-label":`hover`})]})}export{we as a,_e as c,V as i,R as l,Te as n,Ce as o,H as r,B as s,et as t,me as u};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Al as t,Bl as n,Dl as r,Fl as i,Gl as a,HC as o,Il as s,Jl as ee,Kl as c,Ll as l,Ml as u,Nl as d,Ol as f,Pl as p,Ql as m,Sl as h,Tl as g,Ul as _,Vl as te,Xl as v,Yl as y,Zl as b,aw as ne,d_ as x,ff as S,jl as re,kl as C,mf as ie,nu as ae,ql as oe,t_ as w,wC as se,wl as T,zl as E}from"./app-4aEhon_S.js";import{E as ce}from"./vendor-CtXGFqsu.js";import{t as D,x as O}from"./react-B9IgSVeK.js";import{Ka as k,yn as le}from"./icons-C0wyat6T.js";import{a as ue,c as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e,u as ve}from"./companion-surface-BiEC15j-.js";import{n as ye}from"./companion-accent-IfLn8Bat.js";import{n as be,t as xe}from"./companion-popover-DJZq3u_E.js";import{n as A,r as Se,t as j}from"./companion-layout-B32ZeRsg.js";var M=e(O(),1),N=D(),Ce=460,we=3,Te=88,Ee=3,De=[`screens`,`tabs`,`windows`],Oe=(e,t)=>t===`screens`?e.displays.length:t===`tabs`?e.tabs.length:e.windows.length,ke=e=>De.find(t=>Oe(e,t)>0)??`screens`,P=e=>e.kind===`display`?`display-${e.displayId}`:`window-${e.windowId}`;function Ae({sources:e,captureThumbnail:t,cardGrowth:n=`up`,side:r,avatarBox:i=w,optionsBox:a=w,cardRef:s,label:ee,onPick:c,onAllowScreenRecording:l}){let{t:u}=ce(),{inUnits:d,lineAt:f,edgeAt:p,introStepOff:m,gap:h}=j(i,a),g=d(m(n)),_=r===void 0?{left:`50%`,top:f(n,0),transform:n===`up`?`translate(-50%, calc(-100% - ${g}px))`:`translate(-50%, ${g}px)`}:{...p(r,x(i,a)+h),top:`50%`,transform:`translateY(-50%)`},te=e!==null&&e.screenRecordingGranted===!1,v=te?null:e,y=v===null?[]:De.filter(e=>Oe(v,e)>0),b=v!==null&&y.length===0,[S,re]=(0,M.useState)(null),C=v===null?`screens`:S!==null&&y.includes(S)?S:ke(v),ie=(0,M.useMemo)(()=>v===null?[]:C===`screens`?v.displays.map(e=>{let t={kind:`display`,displayId:e.displayId};return{key:P(t),target:t}}):C===`windows`?v.windows.map(e=>{let t={kind:`window`,windowId:e.windowId};return{key:P(t),target:t}}):[],[C,v]),[ae,oe]=(0,M.useState)(new Map),T=(0,M.useRef)(new Set),E=(0,M.useRef)(0),D=(0,M.useRef)(!1);(0,M.useEffect)(()=>(D.current=!0,()=>{D.current=!1}),[]),(0,M.useEffect)(()=>{T.current=new Set,E.current+=1,oe(new Map),re(null)},[e]);let O=(0,M.useRef)(null);(0,M.useEffect)(()=>{O.current!==null&&(O.current.scrollTop=0)},[C]),(0,M.useEffect)(()=>{if(t!==void 0)for(let{key:e,target:n}of ie){if(T.current.has(e))continue;T.current.add(e);let r=E.current,i=t=>{!D.current||r!==E.current||oe(n=>new Map(n).set(e,t))};t(n).then(i,()=>{i(null)})}},[t,ie]);let k=e=>t===void 0?null:ae.get(e),ue=e=>u(e===`screens`?`companionSurface.captureScreens`:e===`tabs`?`companionSurface.captureTabs`:`companionSurface.captureWindows`);return(0,N.jsxs)(`div`,{ref:s,role:`group`,"aria-label":ee??u(`companionSurface.capturePicker`),"data-companion-capture-picker":!0,"data-theme":`dark`,className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-1.5 shadow-lg shadow-black/40`,style:{width:Ce,..._},onPointerDown:e=>{e.stopPropagation()},children:[y.length>1&&(0,N.jsx)(se,{className:`mx-auto mb-1.5 w-auto shrink-0`,items:y.map(e=>({value:e,label:ue(e)})),value:C,ariaLabel:u(`companionSurface.captureKind`),onChange:re}),(0,N.jsx)(o,{ref:O,className:`max-h-48 flex-col px-0.5`,size:24,fadeEdges:`end`,hideScrollBar:!0,children:(0,N.jsxs)(`div`,{className:`flex flex-col`,"data-slot":`capture-sources`,children:[e===null&&(0,N.jsx)(Me,{}),te&&(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 py-2`,"data-slot":`capture-needs-grant`,children:[(0,N.jsx)(`span`,{className:`text-[12px] text-white/70`,children:u(`companionSurface.captureScreenRecordingOff`)}),(0,N.jsx)(ne,{variant:`primary`,size:`compact`,className:`shrink-0`,onClick:l,children:u(`companionSurface.captureTurnOnScreenRecording`)})]}),v!==null&&C===`screens`&&(0,N.jsx)(F,{children:v.displays.map(e=>{let t=u(`companionSurface.captureScreen`,{n:e.index+1}),n=P({kind:`display`,displayId:e.displayId});return(0,N.jsx)(I,{title:t,ariaLabel:t,answer:k(n),fallback:(0,N.jsx)(le,{className:`size-5 text-white/40`,"aria-hidden":!0}),onClick:()=>{c?.({kind:`display`,displayId:e.displayId})}},n)})}),v!==null&&C===`windows`&&(0,N.jsx)(F,{children:v.windows.map(e=>{let t=P({kind:`window`,windowId:e.windowId}),n=e.title===``?e.app:e.title;return(0,N.jsx)(I,{title:n,ariaLabel:e.title===``?n:`${n} (${e.app})`,answer:k(t),fallback:(0,N.jsx)(L,{icon:e.icon,large:!0}),icon:(0,N.jsx)(L,{icon:e.icon}),onClick:()=>{c?.({kind:`window`,windowId:e.windowId})}},t)})}),v!==null&&C===`tabs`&&(0,N.jsx)(`div`,{className:`flex flex-col`,children:v.tabs.map(e=>(0,N.jsx)(je,{icon:(0,N.jsx)(L,{icon:e.icon}),title:e.title,onClick:()=>{c?.({kind:`tab`,chromeWindowId:e.chromeWindowId,tabIndex:e.tabIndex})}},`tab-${e.chromeWindowId}-${e.tabIndex}`))}),b&&(0,N.jsx)(`span`,{className:`px-2 py-3 text-[12px] text-white/50`,children:u(`companionSurface.captureNothing`)})]})})]})}function F({children:e}){return(0,N.jsx)(`div`,{className:`grid gap-1.5 py-0.5`,style:{gridTemplateColumns:`repeat(${we}, minmax(0, 1fr))`},children:e})}function I({title:e,ariaLabel:t,answer:n,fallback:r,icon:i,onClick:a}){return(0,N.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`group flex min-w-0 flex-col gap-1 rounded-lg p-1 text-left transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:a,children:[(0,N.jsx)(`span`,{"data-slot":`capture-preview`,className:`flex items-center justify-center overflow-hidden rounded-md bg-black/40 ring-1 ring-white/10 ${n===void 0?`animate-pulse`:``}`,style:{height:Te},children:n==null?r:(0,N.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`max-h-full max-w-full object-contain`})}),(0,N.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[i,(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-white/75 group-hover:text-white/90`,children:e})]})]})}function je({icon:e,title:t,onClick:n}){return(0,N.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`flex h-8 w-full shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[12px] text-white/85 transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:n,children:[e,(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function L({icon:e,large:t=!1}){return(0,N.jsx)(`span`,{className:`flex shrink-0 items-center justify-center overflow-hidden ring-1 ring-white/10 ${t?`size-7 rounded-lg`:`size-3.5 rounded-[4px]`}`,children:e===void 0?(0,N.jsx)(k,{className:t?`size-5 text-white/40`:`size-3 text-white/70`,"aria-hidden":!0}):(0,N.jsx)(`img`,{src:e,alt:``,className:`size-full`,draggable:!1})})}function Me(){return(0,N.jsx)(F,{children:Array.from({length:Ee},(e,t)=>(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 p-1`,"aria-hidden":!0,children:[(0,N.jsx)(`span`,{className:`animate-pulse rounded-md bg-white/10`,style:{height:Te}}),(0,N.jsx)(`span`,{className:`h-2 animate-pulse rounded-full bg-white/10`,style:{width:t===0?`70%`:`45%`}})]},t))})}var Ne=3,Pe=440;function Fe(){let{t:e}=ce(),[o,ne]=(0,M.useState)(`right`),[x,se]=(0,M.useState)(`up`),[D,O]=(0,M.useState)(`bottom`),[k,le]=(0,M.useState)(w),[j,Ce]=(0,M.useState)(w),[we,Te]=(0,M.useState)(),[Ee,De]=(0,M.useState)(),[Oe,ke]=(0,M.useState)(),[P,F]=(0,M.useState)(null),[I,je]=(0,M.useState)(!1),[L,Me]=(0,M.useState)(void 0),[Fe,Ie]=(0,M.useState)(``),[Le,Re]=(0,M.useState)(``),[ze,Be]=(0,M.useState)(!1),[R,Ve]=(0,M.useState)(!1),[He,Ue]=(0,M.useState)(void 0),[z,We]=(0,M.useState)(void 0),[B,Ge]=(0,M.useState)(void 0),[V,Ke]=(0,M.useState)(void 0),[qe,Je]=(0,M.useState)(!1),[Ye,Xe]=(0,M.useState)(!1),[Ze,Qe]=(0,M.useState)(void 0),[$e,et]=(0,M.useState)(!1),[tt,nt]=(0,M.useState)(!1),[rt,it]=(0,M.useState)(!1),[at,ot]=(0,M.useState)(!1),[st,ct]=(0,M.useState)(void 0),[H,U]=(0,M.useState)(!1),[W,lt]=(0,M.useState)(`teach`),[ut,dt]=(0,M.useState)(null),G=(0,M.useRef)(0),[K,q]=(0,M.useState)(!1),[J,ft]=(0,M.useState)(null),[pt,mt]=(0,M.useState)(0),[ht,gt]=(0,M.useState)(0),[_t,vt]=(0,M.useState)(void 0),Y=(0,M.useRef)(!1),yt=(0,M.useRef)(null),bt=(0,M.useRef)(null),xt=(0,M.useRef)(null),St=(0,M.useRef)(null),Ct=(0,M.useRef)(null),wt=(0,M.useRef)(null),Tt=(0,M.useRef)(null),Et=(0,M.useRef)(null),Dt=(0,M.useRef)(!1),Ot=(0,M.useCallback)(e=>{Et.current=e,e===null&&Dt.current&&(Dt.current=!1,Y.current=!1,_(!1))},[]),X=(0,M.useRef)(null),kt=(0,M.useRef)(null),At=(0,M.useRef)(!1);(0,M.useEffect)(()=>{let e=e=>{ne(e.growth),se(e.cardGrowth),O(e.dock??`bottom`),le(e.avatarBox),Ce(e.optionsBox??e.avatarBox),Te(e.avatarBase64===void 0?void 0:`data:image/png;base64,${e.avatarBase64}`),De(e.character),ke(e.accentHex),F(e.call),je(e.dialing===!0),Re(e.assistantName),Be(e.working),Ve(e.watching===!0),Me(e.dictating),Ie(e.dictationText??``),Ue(e.watchRetro),We(e.dictationOffer),Ge(e.popover),Ke(e.popoverView),Je(e.watchEnabled===!0),Xe(e.watchTargets===!0),Qe(e.screenShare),et(e.screenShareEnabled===!0),nt(e.annotating===!0),it((e.coachmarks?.length??0)>0),ot(e.marksCleared!==void 0),ct(e.annotationTool),ft(e.intro),mt(e.voiceKeyTaps??0),gt(e.introChordPresses??0),vt(e.introChordControl)},t=y(e);return d().then(t=>{t&&e(t)}),t},[]),(0,M.useEffect)(()=>()=>{_(!1)},[]);let jt=P!==null||I,Mt=Ze!==void 0,Nt=(0,M.useMemo)(()=>h()?m():void 0,[]);(0,M.useEffect)(()=>{jt||(G.current+=1,U(!1))},[jt]),(0,M.useEffect)(()=>{R&&W===`teach`&&(G.current+=1,U(!1))},[R,W]),(0,M.useEffect)(()=>{Mt&&W===`share`&&(G.current+=1,U(!1))},[Mt,W]);let Pt=(e,t)=>{dt(null),lt(e),U(!0);let n=++G.current;p().then(e=>{if(n===G.current){if(e!==null){dt(e);return}U(!1),t()}})},Ft=H&&ut?.screenRecordingGranted===!1;(0,M.useEffect)(()=>{if(Ft)return ie(e=>{if(e.screen?.status!==`granted`)return;let t=++G.current;p().then(e=>{t!==G.current||e===null||dt(e)})})},[Ft]);let It=()=>{if(!Ye){b();return}if(H&&W===`teach`){G.current+=1,U(!1);return}Pt(`teach`,b)},Lt=()=>{if(H&&W===`share`){G.current+=1,U(!1);return}Pt(`share`,()=>void 0)};(0,M.useEffect)(()=>{!H&&Y.current&&(Y.current=!1,_(!1))},[H]),(0,M.useEffect)(()=>{z===void 0&&Y.current&&(Y.current=!1,_(!1))},[z]);let Rt=(0,M.useRef)(!1),zt=B!==void 0&&V!==void 0&&V!==`deferred`&&(P!==null||I)&&D!==`left`&&D!==`right`,Bt=zt?B?.id:void 0;(0,M.useLayoutEffect)(()=>{let e=Tt.current;if(Bt===void 0||e===null)return;let t=()=>{te(Bt,e.getBoundingClientRect().height)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Bt,V]);let[Vt,Ht]=(0,M.useState)(!1),Ut=zt||Vt;(0,M.useEffect)(()=>{!Ut&&Rt.current&&(Rt.current=!1,Y.current=!1,_(!1))},[Ut]);let Wt=e=>{if(G.current+=1,U(!1),W===`share`){c(e);return}b(e)},Z=e=>{Y.current!==e&&(Y.current=e,_(e))},Q=J!==null&&P===null&&!I,Gt=(0,M.useRef)(Q);(0,M.useEffect)(()=>{Gt.current&&!Q&&(q(!1),Z(!1)),Gt.current=Q},[Q]);let Kt=me(J),qt=Q?ue(J,e(`companionIntro.call.line`)):null,Jt=ve(Q?J:null),Yt=fe(Jt),Xt=Q&&!Yt&&(J===`talk`||J===`try`),Zt=Q&&J===`idle`&&K;(0,M.useEffect)(()=>{Zt&&g(`next`)},[Zt]);let[Qt,$t]=(0,M.useState)(!1);(0,M.useEffect)(()=>{$t(!1)},[J]);let en=()=>{J===`try`&&!Yt&&g(`try`)},$=qt!==null,tn=P!==null||I?`call`:L===void 0?z===void 0?R?`watching`:He===void 0?Kt??(K?`hover`:`resting`):`summary`:`offer`:`dictating`,nn=e=>{if(X.current!==null&&e.buttons===0&&(X.current=null,l()),X.current!==null){let{x:t,y:n}=X.current;i(e.screenX-t,e.screenY-n),X.current={x:e.screenX,y:e.screenY};let r=kt.current;r!==null&&Math.abs(e.screenX-r.x)+Math.abs(e.screenY-r.y)>Ne&&(At.current=!0);return}let t=xt.current;if(!t)return;let n=yt.current?.getBoundingClientRect()??null,r=bt.current?.getBoundingClientRect()??null,a=n!==null&&n.width>0?n:r!==null&&r.width>0?r:null,o=Se({x:e.clientX,y:e.clientY},{avatar:t.getBoundingClientRect(),pill:a}),s=St.current,ee=s!==null&&A(s.getBoundingClientRect(),e.clientX,e.clientY),c=wt.current,u=c!==null&&A(c.getBoundingClientRect(),e.clientX,e.clientY),d=Ct.current,f=d!==null&&A(d.getBoundingClientRect(),e.clientX,e.clientY),p=Tt.current,m=p!==null&&A(p.getBoundingClientRect(),e.clientX,e.clientY),h=Et.current,g=h!==null&&A(h.getBoundingClientRect(),e.clientX,e.clientY);q(o),Dt.current=g,Rt.current=m,Z(o||ee||f||u||g||m)},rn=ye(P,Oe,Ee),an=B===void 0||V!==`deferred`?0:B.kind===`approvals`?B.items.length:1;return(0,N.jsx)(`div`,{className:`relative h-screen w-screen bg-transparent`,onMouseMove:nn,onMouseUp:()=>{X.current!==null&&(X.current=null,l())},onPointerCancel:()=>{X.current!==null&&(X.current=null,l()),q(!1),Z(!1)},onMouseLeave:()=>{X.current===null&&(q(!1),Z(!1))},children:(0,N.jsx)(_e,{phase:tn,growth:o,cardGrowth:x,dock:D,avatarBox:k,optionsBox:j,avatarSrc:we,character:Ee,hovered:K,accentHex:rn,call:P??qt?.call??void 0,assistantName:Le,dictating:L,dictationText:Fe,working:ze,watching:R,watchRetro:He,onWatchRetro:C,dictationOffer:z,offer:z===void 0?null:(0,N.jsx)(de,{offer:z,growth:o,cardGrowth:x,avatarBox:k,optionsBox:j,cardRef:wt,onAnswer:e=>{r(e,z.id)}}),watchEnabled:qe,spotlight:ge(J),avatarStaged:Xt,avatarTucked:Q&&J===`idle`,intro:!Q||J===null?null:(0,N.jsx)(pe,{beat:J,growth:o,cardGrowth:x,avatarBox:k,optionsBox:j,accentHex:rn,assistantName:Le===``?void 0:Le,cardRef:St,permission:Jt,greeted:Qt,voiceKeyTaps:pt,chordPresses:ht,chordControl:_t,onAdvance:e=>{if(e===`try`){en();return}g(e)}}),rootRef:yt,restingPillRef:bt,avatarRef:xt,onSurfacePointerDown:e=>{e.button===0&&e.target.closest(`button, a`)===null&&(e.currentTarget.setPointerCapture(e.pointerId),X.current={x:e.screenX,y:e.screenY},kt.current={x:e.screenX,y:e.screenY},At.current=!1)},onSurfaceContextMenu:e=>{(window.getSelection()?.toString().trim().length??0)>0||(e.preventDefault(),oe())},onAvatarClick:()=>{if(!(At.current||$)){if(J!==null){Q&&!Yt&&(J===`talk`?$t(!0):J===`try`&&en());return}if(P!==null||I){T();return}ee()}},onWatch:()=>{$||b()},onTeach:$?void 0:It,picking:H&&W===`teach`,sharing:qt?.sharing??Mt,shareEnabled:$||$e,sharePicking:H&&W===`share`,onShare:$?void 0:Lt,onStopShare:$?void 0:()=>{c()},annotating:tt,onAnnotate:$?void 0:e=>{E(e)},marked:at&&(rt||tt),onClearMarks:$?void 0:()=>{re()},openPicker:B?.kind===`microphones`?B.kind:void 0,onPicker:!$&&u()?e=>{v(e)}:void 0,annotationTool:st,onAnnotationTool:$?void 0:e=>{n(e)},drawToolsRef:Ot,shortcuts:$?he:Nt,picker:H?(0,N.jsx)(Ae,{sources:ut,captureThumbnail:t,cardGrowth:x,side:(P!==null||I)&&(D===`left`||D===`right`)?D===`left`?`right`:`left`:void 0,avatarBox:k,optionsBox:j,cardRef:Ct,label:W===`share`?e(`companionSurface.sharePicker`):void 0,onPick:Wt,onAllowScreenRecording:()=>{S(`screen`).catch(()=>void 0)}}):null,prompt:!zt||B===void 0?null:V===`row`&&(B.kind===`approvals`||B.kind===`secret`)?(0,N.jsx)(be,{popover:B,onAnswer:e=>{f(e,B.id)},onView:e=>{a(B.id,e)}}):(0,N.jsx)(xe,{attached:!0,popover:B,view:V??`expanded`,style:{maxHeight:Pe},onAnswer:e=>{f(e,B.id)},onView:e=>{a(B.id,e)},onOpenLink:e=>{s(e)}},B.id),promptRef:Tt,onWorkShelfChange:Ht,promptsDeferred:an,onReviewPrompts:()=>{B!==void 0&&a(B.id,`expanded`)},onControl:$?void 0:(e,t)=>{ae(t===void 0?{action:e}:{action:e,requestId:t})}})})}export{Fe as CompanionSurfacePage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Al as t,Bl as n,Dl as r,Fl as i,Gl as a,HC as o,Il as s,Jl as ee,Kl as c,Ll as l,Ml as u,Nl as d,Ol as f,Pl as p,Ql as m,Sl as h,Tl as g,Ul as _,Vl as te,Xl as v,Yl as y,Zl as b,aw as ne,d_ as x,ff as S,jl as re,kl as C,mf as ie,nu as ae,ql as oe,t_ as w,wC as se,wl as T,zl as E}from"./app-DbJUeBix.js";import{E as ce}from"./vendor-CtXGFqsu.js";import{t as D,x as O}from"./react-B9IgSVeK.js";import{Ka as k,yn as le}from"./icons-C0wyat6T.js";import{a as ue,c as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e,u as ve}from"./companion-surface-CjiszIMu.js";import{n as ye}from"./companion-accent-C8bpme2H.js";import{n as be,t as xe}from"./companion-popover-BYFhyUGI.js";import{n as A,r as Se,t as j}from"./companion-layout-DdDcoKuc.js";var M=e(O(),1),N=D(),Ce=460,we=3,Te=88,Ee=3,De=[`screens`,`tabs`,`windows`],Oe=(e,t)=>t===`screens`?e.displays.length:t===`tabs`?e.tabs.length:e.windows.length,ke=e=>De.find(t=>Oe(e,t)>0)??`screens`,P=e=>e.kind===`display`?`display-${e.displayId}`:`window-${e.windowId}`;function Ae({sources:e,captureThumbnail:t,cardGrowth:n=`up`,side:r,avatarBox:i=w,optionsBox:a=w,cardRef:s,label:ee,onPick:c,onAllowScreenRecording:l}){let{t:u}=ce(),{inUnits:d,lineAt:f,edgeAt:p,introStepOff:m,gap:h}=j(i,a),g=d(m(n)),_=r===void 0?{left:`50%`,top:f(n,0),transform:n===`up`?`translate(-50%, calc(-100% - ${g}px))`:`translate(-50%, ${g}px)`}:{...p(r,x(i,a)+h),top:`50%`,transform:`translateY(-50%)`},te=e!==null&&e.screenRecordingGranted===!1,v=te?null:e,y=v===null?[]:De.filter(e=>Oe(v,e)>0),b=v!==null&&y.length===0,[S,re]=(0,M.useState)(null),C=v===null?`screens`:S!==null&&y.includes(S)?S:ke(v),ie=(0,M.useMemo)(()=>v===null?[]:C===`screens`?v.displays.map(e=>{let t={kind:`display`,displayId:e.displayId};return{key:P(t),target:t}}):C===`windows`?v.windows.map(e=>{let t={kind:`window`,windowId:e.windowId};return{key:P(t),target:t}}):[],[C,v]),[ae,oe]=(0,M.useState)(new Map),T=(0,M.useRef)(new Set),E=(0,M.useRef)(0),D=(0,M.useRef)(!1);(0,M.useEffect)(()=>(D.current=!0,()=>{D.current=!1}),[]),(0,M.useEffect)(()=>{T.current=new Set,E.current+=1,oe(new Map),re(null)},[e]);let O=(0,M.useRef)(null);(0,M.useEffect)(()=>{O.current!==null&&(O.current.scrollTop=0)},[C]),(0,M.useEffect)(()=>{if(t!==void 0)for(let{key:e,target:n}of ie){if(T.current.has(e))continue;T.current.add(e);let r=E.current,i=t=>{!D.current||r!==E.current||oe(n=>new Map(n).set(e,t))};t(n).then(i,()=>{i(null)})}},[t,ie]);let k=e=>t===void 0?null:ae.get(e),ue=e=>u(e===`screens`?`companionSurface.captureScreens`:e===`tabs`?`companionSurface.captureTabs`:`companionSurface.captureWindows`);return(0,N.jsxs)(`div`,{ref:s,role:`group`,"aria-label":ee??u(`companionSurface.capturePicker`),"data-companion-capture-picker":!0,"data-theme":`dark`,className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-1.5 shadow-lg shadow-black/40`,style:{width:Ce,..._},onPointerDown:e=>{e.stopPropagation()},children:[y.length>1&&(0,N.jsx)(se,{className:`mx-auto mb-1.5 w-auto shrink-0`,items:y.map(e=>({value:e,label:ue(e)})),value:C,ariaLabel:u(`companionSurface.captureKind`),onChange:re}),(0,N.jsx)(o,{ref:O,className:`max-h-48 flex-col px-0.5`,size:24,fadeEdges:`end`,hideScrollBar:!0,children:(0,N.jsxs)(`div`,{className:`flex flex-col`,"data-slot":`capture-sources`,children:[e===null&&(0,N.jsx)(Me,{}),te&&(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 py-2`,"data-slot":`capture-needs-grant`,children:[(0,N.jsx)(`span`,{className:`text-[12px] text-white/70`,children:u(`companionSurface.captureScreenRecordingOff`)}),(0,N.jsx)(ne,{variant:`primary`,size:`compact`,className:`shrink-0`,onClick:l,children:u(`companionSurface.captureTurnOnScreenRecording`)})]}),v!==null&&C===`screens`&&(0,N.jsx)(F,{children:v.displays.map(e=>{let t=u(`companionSurface.captureScreen`,{n:e.index+1}),n=P({kind:`display`,displayId:e.displayId});return(0,N.jsx)(I,{title:t,ariaLabel:t,answer:k(n),fallback:(0,N.jsx)(le,{className:`size-5 text-white/40`,"aria-hidden":!0}),onClick:()=>{c?.({kind:`display`,displayId:e.displayId})}},n)})}),v!==null&&C===`windows`&&(0,N.jsx)(F,{children:v.windows.map(e=>{let t=P({kind:`window`,windowId:e.windowId}),n=e.title===``?e.app:e.title;return(0,N.jsx)(I,{title:n,ariaLabel:e.title===``?n:`${n} (${e.app})`,answer:k(t),fallback:(0,N.jsx)(L,{icon:e.icon,large:!0}),icon:(0,N.jsx)(L,{icon:e.icon}),onClick:()=>{c?.({kind:`window`,windowId:e.windowId})}},t)})}),v!==null&&C===`tabs`&&(0,N.jsx)(`div`,{className:`flex flex-col`,children:v.tabs.map(e=>(0,N.jsx)(je,{icon:(0,N.jsx)(L,{icon:e.icon}),title:e.title,onClick:()=>{c?.({kind:`tab`,chromeWindowId:e.chromeWindowId,tabIndex:e.tabIndex})}},`tab-${e.chromeWindowId}-${e.tabIndex}`))}),b&&(0,N.jsx)(`span`,{className:`px-2 py-3 text-[12px] text-white/50`,children:u(`companionSurface.captureNothing`)})]})})]})}function F({children:e}){return(0,N.jsx)(`div`,{className:`grid gap-1.5 py-0.5`,style:{gridTemplateColumns:`repeat(${we}, minmax(0, 1fr))`},children:e})}function I({title:e,ariaLabel:t,answer:n,fallback:r,icon:i,onClick:a}){return(0,N.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`group flex min-w-0 flex-col gap-1 rounded-lg p-1 text-left transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:a,children:[(0,N.jsx)(`span`,{"data-slot":`capture-preview`,className:`flex items-center justify-center overflow-hidden rounded-md bg-black/40 ring-1 ring-white/10 ${n===void 0?`animate-pulse`:``}`,style:{height:Te},children:n==null?r:(0,N.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`max-h-full max-w-full object-contain`})}),(0,N.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[i,(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-white/75 group-hover:text-white/90`,children:e})]})]})}function je({icon:e,title:t,onClick:n}){return(0,N.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`flex h-8 w-full shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[12px] text-white/85 transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:n,children:[e,(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function L({icon:e,large:t=!1}){return(0,N.jsx)(`span`,{className:`flex shrink-0 items-center justify-center overflow-hidden ring-1 ring-white/10 ${t?`size-7 rounded-lg`:`size-3.5 rounded-[4px]`}`,children:e===void 0?(0,N.jsx)(k,{className:t?`size-5 text-white/40`:`size-3 text-white/70`,"aria-hidden":!0}):(0,N.jsx)(`img`,{src:e,alt:``,className:`size-full`,draggable:!1})})}function Me(){return(0,N.jsx)(F,{children:Array.from({length:Ee},(e,t)=>(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 p-1`,"aria-hidden":!0,children:[(0,N.jsx)(`span`,{className:`animate-pulse rounded-md bg-white/10`,style:{height:Te}}),(0,N.jsx)(`span`,{className:`h-2 animate-pulse rounded-full bg-white/10`,style:{width:t===0?`70%`:`45%`}})]},t))})}var Ne=3,Pe=440;function Fe(){let{t:e}=ce(),[o,ne]=(0,M.useState)(`right`),[x,se]=(0,M.useState)(`up`),[D,O]=(0,M.useState)(`bottom`),[k,le]=(0,M.useState)(w),[j,Ce]=(0,M.useState)(w),[we,Te]=(0,M.useState)(),[Ee,De]=(0,M.useState)(),[Oe,ke]=(0,M.useState)(),[P,F]=(0,M.useState)(null),[I,je]=(0,M.useState)(!1),[L,Me]=(0,M.useState)(void 0),[Fe,Ie]=(0,M.useState)(``),[Le,Re]=(0,M.useState)(``),[ze,Be]=(0,M.useState)(!1),[R,Ve]=(0,M.useState)(!1),[He,Ue]=(0,M.useState)(void 0),[z,We]=(0,M.useState)(void 0),[B,Ge]=(0,M.useState)(void 0),[V,Ke]=(0,M.useState)(void 0),[qe,Je]=(0,M.useState)(!1),[Ye,Xe]=(0,M.useState)(!1),[Ze,Qe]=(0,M.useState)(void 0),[$e,et]=(0,M.useState)(!1),[tt,nt]=(0,M.useState)(!1),[rt,it]=(0,M.useState)(!1),[at,ot]=(0,M.useState)(!1),[st,ct]=(0,M.useState)(void 0),[H,U]=(0,M.useState)(!1),[W,lt]=(0,M.useState)(`teach`),[ut,dt]=(0,M.useState)(null),G=(0,M.useRef)(0),[K,q]=(0,M.useState)(!1),[J,ft]=(0,M.useState)(null),[pt,mt]=(0,M.useState)(0),[ht,gt]=(0,M.useState)(0),[_t,vt]=(0,M.useState)(void 0),Y=(0,M.useRef)(!1),yt=(0,M.useRef)(null),bt=(0,M.useRef)(null),xt=(0,M.useRef)(null),St=(0,M.useRef)(null),Ct=(0,M.useRef)(null),wt=(0,M.useRef)(null),Tt=(0,M.useRef)(null),Et=(0,M.useRef)(null),Dt=(0,M.useRef)(!1),Ot=(0,M.useCallback)(e=>{Et.current=e,e===null&&Dt.current&&(Dt.current=!1,Y.current=!1,_(!1))},[]),X=(0,M.useRef)(null),kt=(0,M.useRef)(null),At=(0,M.useRef)(!1);(0,M.useEffect)(()=>{let e=e=>{ne(e.growth),se(e.cardGrowth),O(e.dock??`bottom`),le(e.avatarBox),Ce(e.optionsBox??e.avatarBox),Te(e.avatarBase64===void 0?void 0:`data:image/png;base64,${e.avatarBase64}`),De(e.character),ke(e.accentHex),F(e.call),je(e.dialing===!0),Re(e.assistantName),Be(e.working),Ve(e.watching===!0),Me(e.dictating),Ie(e.dictationText??``),Ue(e.watchRetro),We(e.dictationOffer),Ge(e.popover),Ke(e.popoverView),Je(e.watchEnabled===!0),Xe(e.watchTargets===!0),Qe(e.screenShare),et(e.screenShareEnabled===!0),nt(e.annotating===!0),it((e.coachmarks?.length??0)>0),ot(e.marksCleared!==void 0),ct(e.annotationTool),ft(e.intro),mt(e.voiceKeyTaps??0),gt(e.introChordPresses??0),vt(e.introChordControl)},t=y(e);return d().then(t=>{t&&e(t)}),t},[]),(0,M.useEffect)(()=>()=>{_(!1)},[]);let jt=P!==null||I,Mt=Ze!==void 0,Nt=(0,M.useMemo)(()=>h()?m():void 0,[]);(0,M.useEffect)(()=>{jt||(G.current+=1,U(!1))},[jt]),(0,M.useEffect)(()=>{R&&W===`teach`&&(G.current+=1,U(!1))},[R,W]),(0,M.useEffect)(()=>{Mt&&W===`share`&&(G.current+=1,U(!1))},[Mt,W]);let Pt=(e,t)=>{dt(null),lt(e),U(!0);let n=++G.current;p().then(e=>{if(n===G.current){if(e!==null){dt(e);return}U(!1),t()}})},Ft=H&&ut?.screenRecordingGranted===!1;(0,M.useEffect)(()=>{if(Ft)return ie(e=>{if(e.screen?.status!==`granted`)return;let t=++G.current;p().then(e=>{t!==G.current||e===null||dt(e)})})},[Ft]);let It=()=>{if(!Ye){b();return}if(H&&W===`teach`){G.current+=1,U(!1);return}Pt(`teach`,b)},Lt=()=>{if(H&&W===`share`){G.current+=1,U(!1);return}Pt(`share`,()=>void 0)};(0,M.useEffect)(()=>{!H&&Y.current&&(Y.current=!1,_(!1))},[H]),(0,M.useEffect)(()=>{z===void 0&&Y.current&&(Y.current=!1,_(!1))},[z]);let Rt=(0,M.useRef)(!1),zt=B!==void 0&&V!==void 0&&V!==`deferred`&&(P!==null||I)&&D!==`left`&&D!==`right`,Bt=zt?B?.id:void 0;(0,M.useLayoutEffect)(()=>{let e=Tt.current;if(Bt===void 0||e===null)return;let t=()=>{te(Bt,e.getBoundingClientRect().height)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Bt,V]);let[Vt,Ht]=(0,M.useState)(!1),Ut=zt||Vt;(0,M.useEffect)(()=>{!Ut&&Rt.current&&(Rt.current=!1,Y.current=!1,_(!1))},[Ut]);let Wt=e=>{if(G.current+=1,U(!1),W===`share`){c(e);return}b(e)},Z=e=>{Y.current!==e&&(Y.current=e,_(e))},Q=J!==null&&P===null&&!I,Gt=(0,M.useRef)(Q);(0,M.useEffect)(()=>{Gt.current&&!Q&&(q(!1),Z(!1)),Gt.current=Q},[Q]);let Kt=me(J),qt=Q?ue(J,e(`companionIntro.call.line`)):null,Jt=ve(Q?J:null),Yt=fe(Jt),Xt=Q&&!Yt&&(J===`talk`||J===`try`),Zt=Q&&J===`idle`&&K;(0,M.useEffect)(()=>{Zt&&g(`next`)},[Zt]);let[Qt,$t]=(0,M.useState)(!1);(0,M.useEffect)(()=>{$t(!1)},[J]);let en=()=>{J===`try`&&!Yt&&g(`try`)},$=qt!==null,tn=P!==null||I?`call`:L===void 0?z===void 0?R?`watching`:He===void 0?Kt??(K?`hover`:`resting`):`summary`:`offer`:`dictating`,nn=e=>{if(X.current!==null&&e.buttons===0&&(X.current=null,l()),X.current!==null){let{x:t,y:n}=X.current;i(e.screenX-t,e.screenY-n),X.current={x:e.screenX,y:e.screenY};let r=kt.current;r!==null&&Math.abs(e.screenX-r.x)+Math.abs(e.screenY-r.y)>Ne&&(At.current=!0);return}let t=xt.current;if(!t)return;let n=yt.current?.getBoundingClientRect()??null,r=bt.current?.getBoundingClientRect()??null,a=n!==null&&n.width>0?n:r!==null&&r.width>0?r:null,o=Se({x:e.clientX,y:e.clientY},{avatar:t.getBoundingClientRect(),pill:a}),s=St.current,ee=s!==null&&A(s.getBoundingClientRect(),e.clientX,e.clientY),c=wt.current,u=c!==null&&A(c.getBoundingClientRect(),e.clientX,e.clientY),d=Ct.current,f=d!==null&&A(d.getBoundingClientRect(),e.clientX,e.clientY),p=Tt.current,m=p!==null&&A(p.getBoundingClientRect(),e.clientX,e.clientY),h=Et.current,g=h!==null&&A(h.getBoundingClientRect(),e.clientX,e.clientY);q(o),Dt.current=g,Rt.current=m,Z(o||ee||f||u||g||m)},rn=ye(P,Oe,Ee),an=B===void 0||V!==`deferred`?0:B.kind===`approvals`?B.items.length:1;return(0,N.jsx)(`div`,{className:`relative h-screen w-screen bg-transparent`,onMouseMove:nn,onMouseUp:()=>{X.current!==null&&(X.current=null,l())},onPointerCancel:()=>{X.current!==null&&(X.current=null,l()),q(!1),Z(!1)},onMouseLeave:()=>{X.current===null&&(q(!1),Z(!1))},children:(0,N.jsx)(_e,{phase:tn,growth:o,cardGrowth:x,dock:D,avatarBox:k,optionsBox:j,avatarSrc:we,character:Ee,hovered:K,accentHex:rn,call:P??qt?.call??void 0,assistantName:Le,dictating:L,dictationText:Fe,working:ze,watching:R,watchRetro:He,onWatchRetro:C,dictationOffer:z,offer:z===void 0?null:(0,N.jsx)(de,{offer:z,growth:o,cardGrowth:x,avatarBox:k,optionsBox:j,cardRef:wt,onAnswer:e=>{r(e,z.id)}}),watchEnabled:qe,spotlight:ge(J),avatarStaged:Xt,avatarTucked:Q&&J===`idle`,intro:!Q||J===null?null:(0,N.jsx)(pe,{beat:J,growth:o,cardGrowth:x,avatarBox:k,optionsBox:j,accentHex:rn,assistantName:Le===``?void 0:Le,cardRef:St,permission:Jt,greeted:Qt,voiceKeyTaps:pt,chordPresses:ht,chordControl:_t,onAdvance:e=>{if(e===`try`){en();return}g(e)}}),rootRef:yt,restingPillRef:bt,avatarRef:xt,onSurfacePointerDown:e=>{e.button===0&&e.target.closest(`button, a`)===null&&(e.currentTarget.setPointerCapture(e.pointerId),X.current={x:e.screenX,y:e.screenY},kt.current={x:e.screenX,y:e.screenY},At.current=!1)},onSurfaceContextMenu:e=>{(window.getSelection()?.toString().trim().length??0)>0||(e.preventDefault(),oe())},onAvatarClick:()=>{if(!(At.current||$)){if(J!==null){Q&&!Yt&&(J===`talk`?$t(!0):J===`try`&&en());return}if(P!==null||I){T();return}ee()}},onWatch:()=>{$||b()},onTeach:$?void 0:It,picking:H&&W===`teach`,sharing:qt?.sharing??Mt,shareEnabled:$||$e,sharePicking:H&&W===`share`,onShare:$?void 0:Lt,onStopShare:$?void 0:()=>{c()},annotating:tt,onAnnotate:$?void 0:e=>{E(e)},marked:at&&(rt||tt),onClearMarks:$?void 0:()=>{re()},openPicker:B?.kind===`microphones`?B.kind:void 0,onPicker:!$&&u()?e=>{v(e)}:void 0,annotationTool:st,onAnnotationTool:$?void 0:e=>{n(e)},drawToolsRef:Ot,shortcuts:$?he:Nt,picker:H?(0,N.jsx)(Ae,{sources:ut,captureThumbnail:t,cardGrowth:x,side:(P!==null||I)&&(D===`left`||D===`right`)?D===`left`?`right`:`left`:void 0,avatarBox:k,optionsBox:j,cardRef:Ct,label:W===`share`?e(`companionSurface.sharePicker`):void 0,onPick:Wt,onAllowScreenRecording:()=>{S(`screen`).catch(()=>void 0)}}):null,prompt:!zt||B===void 0?null:V===`row`&&(B.kind===`approvals`||B.kind===`secret`)?(0,N.jsx)(be,{popover:B,onAnswer:e=>{f(e,B.id)},onView:e=>{a(B.id,e)}}):(0,N.jsx)(xe,{attached:!0,popover:B,view:V??`expanded`,style:{maxHeight:Pe},onAnswer:e=>{f(e,B.id)},onView:e=>{a(B.id,e)},onOpenLink:e=>{s(e)}},B.id),promptRef:Tt,onWorkShelfChange:Ht,promptsDeferred:an,onReviewPrompts:()=>{B!==void 0&&a(B.id,`expanded`)},onControl:$?void 0:(e,t)=>{ae(t===void 0?{action:e}:{action:e,requestId:t})}})})}export{Fe as CompanionSurfacePage};