dorkos 0.133.0 → 0.134.0

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 (324) hide show
  1. package/dist/bin/cli.js +371 -82
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-D-EHHVPa.js → AboutPage-zOZ0j1a0.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-BTHnE1vP.js → ActivityErrorState-BlHkTJeC.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-BfSLPIdR.js → ActivityPage-LCOV7KDT.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-PwUBjQw8.js → ActivityRow-CvDae84E.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-DgkNN6bi.js → AdapterIcon-Dm5QP8_9.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-DX0dzp7q.js → AdapterSetupWizard-CNga-lEN.js} +1 -1
  10. package/dist/client/assets/{AgentOptionRow-ApuDEKqq.js → AgentOptionRow-CHb4ifHN.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-BDci-9aL.js → AgentPicker-B8WFWr7p.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-B2gxCMGi.js → AgentRequestCard-Cnhi_1sr.js} +3 -3
  13. package/dist/client/assets/{AppearancePage-8SVnFe0k.js → AppearancePage-BI5qdQoW.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-CnL1ubxL.js → ApplyToOverridesDialog-gSHV8ggp.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-CCKhUtil.js → AttentionSignalRow-QgzOBKxa.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-B7wFPzG4.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-Ck8dc5X4.js} +3 -3
  17. package/dist/client/assets/{BindingDialog-C4BHVXno.js → BindingDialog-DX1N_tTX.js} +1 -1
  18. package/dist/client/assets/{BlintzCanvas-7E5uwVms.js → BlintzCanvas-FqS5vfnA.js} +3 -3
  19. package/dist/client/assets/{CanvasCsvContent-l7lfyDGn.js → CanvasCsvContent-B9h8JQsV.js} +4 -4
  20. package/dist/client/assets/CanvasFileContent-BXo8hS_n.js +2 -0
  21. package/dist/client/assets/CanvasModel3dContent-BhAho9NF.js +2 -0
  22. package/dist/client/assets/{ChannelComposer-CAYvz_ZB.js → ChannelComposer-DUKyoCYz.js} +5 -5
  23. package/dist/client/assets/{ChatAppsOff-CNeKBVNz.js → ChatAppsOff-hxeSExhA.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorDiff-BZRcNFsS.js → CodeMirrorDiff-BoDEtyYj.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-DD5tArRn.js → CodeMirrorEditor-CU7h0emU.js} +1 -1
  26. package/dist/client/assets/{ComputerResourceView-BUmsVssG.js → ComputerResourceView-Dd4Kedxf.js} +1 -1
  27. package/dist/client/assets/{ComputerViewer-BKMR5LkF.js → ComputerViewer-CssfoCBB.js} +1 -1
  28. package/dist/client/assets/{ConnectionAccessLists-DYUiFmPY.js → ConnectionAccessLists-2qFBRKpv.js} +1 -1
  29. package/dist/client/assets/{ConnectionsPage-DR2Kfm9Q.js → ConnectionsPage-CPyrw58B.js} +1 -1
  30. package/dist/client/assets/{ConventionPage-Do6q8873.js → ConventionPage-B2MERyNx.js} +2 -2
  31. package/dist/client/assets/{ExtensionPageRoute-CP7NM7fw.js → ExtensionPageRoute-7x-7Ad0_.js} +1 -1
  32. package/dist/client/assets/{FeatureDisabledState-Bi23k3rg.js → FeatureDisabledState-DsbRcnZ6.js} +1 -1
  33. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-lRlmDXYz.js → FloatingTanStackRouterDevtools-CqogiFob-BReszru7.js} +1 -1
  34. package/dist/client/assets/{ForwardConsentHost-DSR1pEEK.js → ForwardConsentHost-DOwU-xQ9.js} +1 -1
  35. package/dist/client/assets/HandlePage-B7fNgSTl.js +1 -0
  36. package/dist/client/assets/{HeartbeatPage-BTNVcHOI.js → HeartbeatPage-0qi56iQb.js} +1 -1
  37. package/dist/client/assets/{KeyEntry-67acsEG2.js → KeyEntry-uKZG5d2z.js} +1 -1
  38. package/dist/client/assets/{LexicalField-Cb68LIar.js → LexicalField-CKc8eUK3.js} +2 -2
  39. package/dist/client/assets/{ManagesPage-ChPlBF42.js → ManagesPage-DWVLpjw2.js} +1 -1
  40. package/dist/client/assets/{Marketplace-CzPhJEE1.js → Marketplace-VBnmDEQE.js} +4 -4
  41. package/dist/client/assets/{MarketplaceSourcesView-CmQgxQmU.js → MarketplaceSourcesView-BRuo8wIH.js} +1 -1
  42. package/dist/client/assets/{McpAppFrame-z5JUaCSA.js → McpAppFrame-IfamHBcy.js} +1 -1
  43. package/dist/client/assets/{McpSigninBody-ZrnzwrOH.js → McpSigninBody-VmuxAjoo.js} +1 -1
  44. package/dist/client/assets/{Model3dViewer-HJpWK-JI.js → Model3dViewer-CT4aYUpn.js} +1 -1
  45. package/dist/client/assets/NamePage-CFRvBLJ8.js +1 -0
  46. package/dist/client/assets/NewDirectMessageMenu-BZFyclIS.js +1 -0
  47. package/dist/client/assets/{NotificationsPage-DwNUI0Z3.js → NotificationsPage-DMJf-hq3.js} +1 -1
  48. package/dist/client/assets/{OpenMeshSwitch-RNAZY1vn.js → OpenMeshSwitch-DltP6-54.js} +1 -1
  49. package/dist/client/assets/{OperatorIdentityForm-B7S2C_eT.js → OperatorIdentityForm-C8oS_fQG.js} +1 -1
  50. package/dist/client/assets/PermissionHistory-BAe31Nl3.js +1 -0
  51. package/dist/client/assets/{PermissionsPage-ToK0DZVV.js → PermissionsPage-CqvpcXTJ.js} +1 -1
  52. package/dist/client/assets/{PersonalityPopover-BvMtUQRM.js → PersonalityPopover-D8l_Hfc1.js} +1 -1
  53. package/dist/client/assets/PhotoPage-DTl81tTW.js +1 -0
  54. package/dist/client/assets/{PreviewRefusedNotice-DzbkMrUo.js → PreviewRefusedNotice-DZh7zTEt.js} +1 -1
  55. package/dist/client/assets/{ProfileFields-DU8dTGHT.js → ProfileFields-T1f833SK.js} +1 -1
  56. package/dist/client/assets/{ProfilePanelContainer-BfT-ufV7.js → ProfilePanelContainer-BSbE5rqM.js} +1 -1
  57. package/dist/client/assets/{ProfileRolePicker-DrOtV-0N.js → ProfileRolePicker-CpAhjq-e.js} +1 -1
  58. package/dist/client/assets/{PromptSuggestionChips-CEnhme_V.js → PromptSuggestionChips-BGZ3HP31.js} +1 -1
  59. package/dist/client/assets/{ReportsToPopover-CwjpR1Tw.js → ReportsToPopover-DfmvDL7E.js} +1 -1
  60. package/dist/client/assets/{RoomSurface-CChzNJKw.js → RoomSurface-DCYXQ79N.js} +1 -1
  61. package/dist/client/assets/{RoomsPage-Dbf6ijKr.js → RoomsPage-DTMTTWEf.js} +1 -1
  62. package/dist/client/assets/{RunsOnPopover-Bh5sSsSC.js → RunsOnPopover-CjJiJgly.js} +1 -1
  63. package/dist/client/assets/{RuntimeConnectFlow-BYQnY5vv.js → RuntimeConnectFlow-Dinsb9em.js} +1 -1
  64. package/dist/client/assets/{RuntimeSetupDialog-DTO5v0dP.js → RuntimeSetupDialog-UhsfZRye.js} +1 -1
  65. package/dist/client/assets/{SeenDevices-cuY7ASEy.js → SeenDevices-CuXXI7Jv.js} +3 -3
  66. package/dist/client/assets/{SessionsPage-BrqpVx-t.js → SessionsPage-Cn4rUeyL.js} +1 -1
  67. package/dist/client/assets/{SettingsDialog-DCAZX_1d.js → SettingsDialog-CZrhYejc.js} +3 -3
  68. package/dist/client/assets/{SkillsPage-D5who_ZH.js → SkillsPage-CoanF7Jz.js} +1 -1
  69. package/dist/client/assets/{TaskDialogWrapper-BJ6XtOC5.js → TaskDialogWrapper-CU4PkcGk.js} +1 -1
  70. package/dist/client/assets/{TasksEmptyState-B3SjsxQa.js → TasksEmptyState-lWVZXYPS.js} +2 -2
  71. package/dist/client/assets/{TasksPage-B72w7J87.js → TasksPage-BPmiut-D.js} +1 -1
  72. package/dist/client/assets/{TeamComputerEntry-B9ma5j-X.js → TeamComputerEntry-2RKJhINy.js} +1 -1
  73. package/dist/client/assets/{TodoPromiseList-DDKWAfmv.js → TodoPromiseList-iODTn1_b.js} +1 -1
  74. package/dist/client/assets/{TodoPromisesPage-BNXpvXzS.js → TodoPromisesPage-BCm38YVu.js} +1 -1
  75. package/dist/client/assets/{ToolsPage-DbJykCG3.js → ToolsPage-Bboa9crU.js} +1 -1
  76. package/dist/client/assets/{TopologyGraph-DKZS3nlr.js → TopologyGraph-Dw_sLFBL.js} +1 -1
  77. package/dist/client/assets/{TourHost-Bw3Uoea5.js → TourHost-BUV9rMNn.js} +1 -1
  78. package/dist/client/assets/{UnlinkDialog-B-XCFNSd.js → UnlinkDialog-B7lL7sxN.js} +1 -1
  79. package/dist/client/assets/{UnreadDivider-1aPVzwd7.js → UnreadDivider-DCB47jhk.js} +1 -1
  80. package/dist/client/assets/{WidgetErrorCard-C5ieVv_9.js → WidgetErrorCard-D14BNvfm.js} +2 -2
  81. package/dist/client/assets/{WithheldExtensionsNotice-CCO4ClRZ.js → WithheldExtensionsNotice-I0VwWxDY.js} +1 -1
  82. package/dist/client/assets/{WorkQueuePage-BbPKNwDg.js → WorkQueuePage-wVj3wlat.js} +1 -1
  83. package/dist/client/assets/{WorkView-BRcytACJ.js → WorkView-MSsuFZVO.js} +1 -1
  84. package/dist/client/assets/{_shell-EwFeSIGp.js → _shell-Bp1Mn6YU.js} +4 -4
  85. package/dist/client/assets/{_shell._home-DD2mg-iK.js → _shell._home-CylH7Gjr.js} +1 -1
  86. package/dist/client/assets/{_shell._home.activity-Z1QuU2M4.js → _shell._home.activity-BABzsE_Y.js} +1 -1
  87. package/dist/client/assets/_shell._home.index-BWXNHCGe.js +3 -0
  88. package/dist/client/assets/{_shell._home.tasks-BtC85Iut.js → _shell._home.tasks-BJg6t5SW.js} +1 -1
  89. package/dist/client/assets/{_shell._home.workspaces-qMG5OJYR.js → _shell._home.workspaces-B3LBf9vr.js} +1 -1
  90. package/dist/client/assets/{_shell.channels-BE4EK-iM.js → _shell.channels-C0xYFINv.js} +2 -2
  91. package/dist/client/assets/_shell.connections-73FPamLr.js +6 -0
  92. package/dist/client/assets/{_shell.feedback-requests-CwKSkkuD.js → _shell.feedback-requests-BYYmQE_b.js} +1 -1
  93. package/dist/client/assets/_shell.marketplace-CiBixBHr.js +1 -0
  94. package/dist/client/assets/_shell.marketplace_.sources-DPUWEdt6.js +1 -0
  95. package/dist/client/assets/_shell.session-CJhLuYyA.js +1 -0
  96. package/dist/client/assets/{_shell.team-Dm5a4f8_.js → _shell.team-BbulfYAQ.js} +3 -3
  97. package/dist/client/assets/_shell.threads-CRFlslhF.js +1 -0
  98. package/dist/client/assets/_shell.todos-CmwRh6jX.js +6 -0
  99. package/dist/client/assets/_shell.x._extensionId-DdKU91-V.js +1 -0
  100. package/dist/client/assets/_shell.x._extensionId_._-DdKU91-V.js +1 -0
  101. package/dist/client/assets/{abnfDiagram-WEYOIA3C-Bu2T3jVw.js → abnfDiagram-WEYOIA3C-CF3eRhtw.js} +1 -1
  102. package/dist/client/assets/{access-copy-tkiFMhRf.js → access-copy-EuKlRWLG.js} +1 -1
  103. package/dist/client/assets/{arc-5q4SfXO9.js → arc-BqnZif1q.js} +1 -1
  104. package/dist/client/assets/{architectureDiagram-ZHVYKT53-BnDMOBhV.js → architectureDiagram-ZHVYKT53-CQytXLkh.js} +1 -1
  105. package/dist/client/assets/{banner-CSKUrrI0.js → banner-nfkn2OLZ.js} +1 -1
  106. package/dist/client/assets/{blockDiagram-RJAE7QA3-CtushlEs.js → blockDiagram-RJAE7QA3-CXieJU3q.js} +1 -1
  107. package/dist/client/assets/{c4Diagram-XDPPPE54-7L-qYwKH.js → c4Diagram-XDPPPE54-BPmgfFrI.js} +1 -1
  108. package/dist/client/assets/channel-BOMQJ9aR.js +1 -0
  109. package/dist/client/assets/{chunk-2E7WHVMD-ksBVyqQ3.js → chunk-2E7WHVMD-BtumkVCk.js} +1 -1
  110. package/dist/client/assets/{chunk-2Q5K7J3B-Bfqdkihb.js → chunk-2Q5K7J3B-BUsPKn6-.js} +1 -1
  111. package/dist/client/assets/{chunk-4EMNKR2T-Brf2dH9x.js → chunk-4EMNKR2T-CuRou8Oa.js} +1 -1
  112. package/dist/client/assets/{chunk-55XCU76K-BlE7Cq40.js → chunk-55XCU76K-CafKfo9G.js} +1 -1
  113. package/dist/client/assets/{chunk-5VM5RSS4-Bkgg3j7L.js → chunk-5VM5RSS4-BdemtVRg.js} +1 -1
  114. package/dist/client/assets/{chunk-JWPE2WC7-B9TRpN4O.js → chunk-JWPE2WC7-C1pKIt5Q.js} +1 -1
  115. package/dist/client/assets/{chunk-VQ5W62QI-ZoILnIYi.js → chunk-VQ5W62QI-DPIQcwQZ.js} +1 -1
  116. package/dist/client/assets/{chunk-XXDRQBXY-r2xNhaKz.js → chunk-XXDRQBXY-CDtiCG5n.js} +1 -1
  117. package/dist/client/assets/{chunk-ZCHMQSOR-DfV3cF7d.js → chunk-ZCHMQSOR-DsHVvsHO.js} +2 -2
  118. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-VOVqMNNP.js → classDiagram-v2-4MYWR3UA-CNKi62Mk.js} +1 -1
  119. package/dist/client/assets/{command-CaUEAy3b.js → command-D1cWVheG.js} +1 -1
  120. package/dist/client/assets/{copy-button-BOznikwM.js → copy-button-BHHQAtAH.js} +1 -1
  121. package/dist/client/assets/{cose-bilkent-JH36ORCC-CAdBvyLz.js → cose-bilkent-JH36ORCC-CqK8lNYm.js} +1 -1
  122. package/dist/client/assets/{cpu-j9vX9Wfk.js → cpu-BhPT23rn.js} +1 -1
  123. package/dist/client/assets/{cynefin-EF2NZ3EQ-DcH1A9Oo.js → cynefin-EF2NZ3EQ-DUFv7wAT.js} +1 -1
  124. package/dist/client/assets/{cynefinDiagram-WF24UDRP-DJuKBXHi.js → cynefinDiagram-WF24UDRP-DprACurA.js} +1 -1
  125. package/dist/client/assets/{dagre-NK4GIZVX-D099H_0S.js → dagre-NK4GIZVX-CFCbvrTm.js} +1 -1
  126. package/dist/client/assets/{detail-row-Crl89jnh.js → detail-row-DBa1uo_y.js} +1 -1
  127. package/dist/client/assets/{diagram-CBK3MWTC-Cd_4W9XO.js → diagram-CBK3MWTC-BgRgWBNs.js} +1 -1
  128. package/dist/client/assets/{diagram-I5XIIV2D-Bc7aQKt3.js → diagram-I5XIIV2D-Bvmxrku7.js} +1 -1
  129. package/dist/client/assets/{diagram-ODIL2UCW-awVJZ4Bg.js → diagram-ODIL2UCW-CqzUdcUW.js} +1 -1
  130. package/dist/client/assets/{diagram-PFBEJUXE-dhsj9aeU.js → diagram-PFBEJUXE-DwXryVWl.js} +1 -1
  131. package/dist/client/assets/{diagram-RJA3I4VV-Dm59CbiV.js → diagram-RJA3I4VV-DqGvHPAI.js} +1 -1
  132. package/dist/client/assets/{diagram-TYUNFSNR-BhvcIjA9.js → diagram-TYUNFSNR-GOfZ43Y3.js} +1 -1
  133. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-C4wT_MTC.js → ebnfDiagram-V4P3TTPT-lF7-sW99.js} +1 -1
  134. package/dist/client/assets/{elk-QONTBCTQ-CPI0zjmW.js → elk-QONTBCTQ-Cd5kFMK6.js} +1 -1
  135. package/dist/client/assets/{empty-state-BHcmkSzu.js → empty-state-CHse95jw.js} +1 -1
  136. package/dist/client/assets/{erDiagram-KYQIGQAA-C_vGcbOB.js → erDiagram-KYQIGQAA-BqXJlTJO.js} +1 -1
  137. package/dist/client/assets/{execution-config-BS5rtvTZ.js → execution-config-U_R_H28y.js} +1 -1
  138. package/dist/client/assets/{file-CQGljfDT.js → file-DZ6-r1A3.js} +1 -1
  139. package/dist/client/assets/{file-exclamation-point-B0a55VME.js → file-exclamation-point-CR6qeV6m.js} +1 -1
  140. package/dist/client/assets/{file-text-Cycq_S0e.js → file-text-4-Vc22J-.js} +1 -1
  141. package/dist/client/assets/{find-latest-widget-fence-B6sJdG3Q.js → find-latest-widget-fence-D61kyRv5.js} +2 -2
  142. package/dist/client/assets/{flowDiagram-IUGLLWBU-_VNfmnxx.js → flowDiagram-IUGLLWBU-C18poulN.js} +1 -1
  143. package/dist/client/assets/{form-BL14vwyB.js → form-B51NLChW.js} +1 -1
  144. package/dist/client/assets/{format-cron-meJMgYNe.js → format-cron-CrDI8dcD.js} +1 -1
  145. package/dist/client/assets/{ganttDiagram-R7GPNTJY-o0gGU7X_.js → ganttDiagram-R7GPNTJY-BHa77y_O.js} +1 -1
  146. package/dist/client/assets/{git-branch-CsLE6G0Y.js → git-branch-CzV_Mp0H.js} +1 -1
  147. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DjXjUpJo.js → gitGraphDiagram-PDYL7XHY-DdfDaaK5.js} +1 -1
  148. package/dist/client/assets/{graph-BMYee_VK.js → graph-stVQph_6.js} +1 -1
  149. package/dist/client/assets/{heart-Cn3a-UQI.js → heart-B7rSSNjF.js} +1 -1
  150. package/dist/client/assets/{highlighted-body-KPVGNVTW-DsX5yCC0.js → highlighted-body-KPVGNVTW-BDppiTvx.js} +1 -1
  151. package/dist/client/assets/{image-lightbox-BZ_eBZgA.js → image-lightbox-DwZmxmRU.js} +1 -1
  152. package/dist/client/assets/{image-off-DjR7LI5G.js → image-off-B65OAyEw.js} +1 -1
  153. package/dist/client/assets/{index-BR1m9FON.js → index-B2JoVHek.js} +231 -231
  154. package/dist/client/assets/{index-Cb_p_ynP.js → index-BC7vn8oJ.js} +1 -1
  155. package/dist/client/assets/{index-DARchye_.js → index-BD0bxxdG.js} +1 -1
  156. package/dist/client/assets/{index-BxWr8Mrf.js → index-BJE7FpeW.js} +1 -1
  157. package/dist/client/assets/{index-CczLBUKI.js → index-BLepK8Tm.js} +1 -1
  158. package/dist/client/assets/{index-Z2ApBQt4.js → index-BNMepjWi.js} +1 -1
  159. package/dist/client/assets/{index-H4e5Wpmi.js → index-B_7AgsWu.js} +1 -1
  160. package/dist/client/assets/{index-Cgjq7a-8.js → index-BchQNMCW.js} +1 -1
  161. package/dist/client/assets/{index-DFb4kOjm.js → index-BgKo-iME.js} +2 -2
  162. package/dist/client/assets/{index-Kt6r3DQg.js → index-BncKYCzR.js} +1 -1
  163. package/dist/client/assets/{index-CpWxcN5D.js → index-Bocv39Dy.js} +1 -1
  164. package/dist/client/assets/{index-BcnwvTnt.js → index-Bx9vkvgI.js} +1 -1
  165. package/dist/client/assets/{index-o6kGmVGx.js → index-ByKStnc0.js} +1 -1
  166. package/dist/client/assets/index-C2FXv0W1.js +1 -0
  167. package/dist/client/assets/index-CCRFURxg.js +1 -0
  168. package/dist/client/assets/{index-DLN0kcME.js → index-CNXWcd0h.js} +1 -1
  169. package/dist/client/assets/index-CT9qR-37.js +1 -0
  170. package/dist/client/assets/{index-vHKVYcH7.js → index-CXbvnAWk.js} +1 -1
  171. package/dist/client/assets/{index-Cv67OXfk.js → index-CaWtXSTG.js} +1 -1
  172. package/dist/client/assets/{index-DQ8uADJF.js → index-CayDBSDe.js} +1 -1
  173. package/dist/client/assets/{index-4rSR8lau.js → index-Ci17H_nH.js} +1 -1
  174. package/dist/client/assets/{index-DqZmnJED.js → index-CpCaGGh0.js} +1 -1
  175. package/dist/client/assets/{index-CfKSlYjb.js → index-CvLTkguu.js} +1 -1
  176. package/dist/client/assets/{index-dY7IFpet.js → index-CyTJNCti.js} +1 -1
  177. package/dist/client/assets/{index-Joav7LQU.js → index-CzDpDW1S.js} +1 -1
  178. package/dist/client/assets/{index-B4TxpTKD.js → index-D1FZurLO.js} +1 -1
  179. package/dist/client/assets/{index-BmKHO-FD.js → index-D5HU9MN-.js} +1 -1
  180. package/dist/client/assets/index-DBjkg_lo.css +1 -0
  181. package/dist/client/assets/{index-gmyiXkmr.js → index-DCymAWyX.js} +1 -1
  182. package/dist/client/assets/{index-faSyUc2q.js → index-DDPQZJQz.js} +1 -1
  183. package/dist/client/assets/{index-Cf4Gtxf9.js → index-DK-qQXH4.js} +1 -1
  184. package/dist/client/assets/{index-DrlB9RSk.js → index-DTJV1dBd.js} +1 -1
  185. package/dist/client/assets/{index-DiM3QX-4.js → index-Dhj4iWHB.js} +3 -3
  186. package/dist/client/assets/index-DxqA8BnM.js +1 -0
  187. package/dist/client/assets/{index-DlvUENo4.js → index-DzVJOMZm.js} +1 -1
  188. package/dist/client/assets/{index-47--OGKJ.js → index-FRNKkajP.js} +1 -1
  189. package/dist/client/assets/{index-Dfko0tSp.js → index-L1Tsd-wn.js} +1 -1
  190. package/dist/client/assets/{index-KganLhU1.js → index-QaablvAu.js} +2 -2
  191. package/dist/client/assets/{index-DMSSN08i.js → index-SawUg2NU.js} +1 -1
  192. package/dist/client/assets/{index-B8LqLhq7.js → index-YObNtFmj.js} +1 -1
  193. package/dist/client/assets/{index-1MwES_vb.js → index-iRuOpaV9.js} +1 -1
  194. package/dist/client/assets/{index-BOCclWF3.js → index-ulrRTPa9.js} +1 -1
  195. package/dist/client/assets/{index-BsZkXHsH.js → index-wcSHU-xr.js} +1 -1
  196. package/dist/client/assets/{index-D5Qmx1JR.js → index-yZEr0YWk.js} +3 -3
  197. package/dist/client/assets/{index.esm-CJIDYBqd.js → index.esm-gt8tvZ7J.js} +1 -1
  198. package/dist/client/assets/{infoDiagram-MVDRKAX5-B1mMyUlp.js → infoDiagram-MVDRKAX5-DzhnMotD.js} +1 -1
  199. package/dist/client/assets/{inline-code-mh48Uhbi.js → inline-code-rYW-kJLB.js} +1 -1
  200. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-efEMQ0_X.js → ishikawaDiagram-HPEHV2GE-CfEX5E3R.js} +1 -1
  201. package/dist/client/assets/{journeyDiagram-BOSHW7O7-DSAywiVk.js → journeyDiagram-BOSHW7O7-oPrRia7f.js} +1 -1
  202. package/dist/client/assets/{kanban-definition-FNSA4HC5-B9pbU4zK.js → kanban-definition-FNSA4HC5-c4CFmcMa.js} +1 -1
  203. package/dist/client/assets/{layers-B0Z5Od3N.js → layers-D9XZggr2.js} +1 -1
  204. package/dist/client/assets/{lightbulb-Cfb5ecEd.js → lightbulb-DQBO5jSg.js} +1 -1
  205. package/dist/client/assets/{link-2-Dzy5BUL3.js → link-2-CZiWX9vI.js} +1 -1
  206. package/dist/client/assets/{list-runtime-types-DLmjtBMq.js → list-runtime-types-Dry1muZ1.js} +1 -1
  207. package/dist/client/assets/{markdown-content-DhAtZOfj.js → markdown-content-FcvkqTTS.js} +1 -1
  208. package/dist/client/assets/{mention-pill-DmA8FxL4.js → mention-pill-BxASQ-6w.js} +1 -1
  209. package/dist/client/assets/{mermaid.core-DUIkdbeL.js → mermaid.core-BqACpHu4.js} +4 -4
  210. package/dist/client/assets/{message-square-off-BowIzJUV.js → message-square-off-SMiCYjYr.js} +1 -1
  211. package/dist/client/assets/{mindmap-definition-6OY57UG3-Dz7ZOR4C.js → mindmap-definition-6OY57UG3-BSYcYnyL.js} +1 -1
  212. package/dist/client/assets/{more-details-DV7LmY0E.js → more-details-D9_Bn2GL.js} +1 -1
  213. package/dist/client/assets/{owner-notice-DdFc2P8z.js → owner-notice-DO2xE-1L.js} +1 -1
  214. package/dist/client/assets/{package-BhKXbvU_.js → package-DpqGENzU.js} +1 -1
  215. package/dist/client/assets/{page-container-0sWZ3xh9.js → page-container-Cta3RqHd.js} +1 -1
  216. package/dist/client/assets/{pane-resize-handle-Bjy4udre.js → pane-resize-handle-BJ0XV-Zg.js} +1 -1
  217. package/dist/client/assets/{paperclip-C-7LhBfl.js → paperclip-CItlLyje.js} +1 -1
  218. package/dist/client/assets/{path-input-BPVyI72G.js → path-input-CAkVS5XR.js} +1 -1
  219. package/dist/client/assets/{pegDiagram-ECIUJNBX-C4EOP-Fa.js → pegDiagram-ECIUJNBX-Bnc4eqtF.js} +1 -1
  220. package/dist/client/assets/{pieDiagram-GNMPY74T-CQ1OxRkv.js → pieDiagram-GNMPY74T-7gG33sSR.js} +1 -1
  221. package/dist/client/assets/{plug-CIZ-wWL8.js → plug-Cb8qsOxJ.js} +1 -1
  222. package/dist/client/assets/{primer-trigger-XA5fLzR5.js → primer-trigger-BG3lb31_.js} +2 -2
  223. package/dist/client/assets/{profile-errors-C1XACbc9.js → profile-errors-T-3VgU7E.js} +1 -1
  224. package/dist/client/assets/progress-CwpnobNW.js +1 -0
  225. package/dist/client/assets/{quadrantDiagram-D57K4MC3-Cw4BdkpS.js → quadrantDiagram-D57K4MC3-Dr2Z6GbA.js} +1 -1
  226. package/dist/client/assets/{query-error-state-Cm-Lozlb.js → query-error-state-BV8fyXBe.js} +1 -1
  227. package/dist/client/assets/{radio-DQ29H26H.js → radio-SApjvqfy.js} +1 -1
  228. package/dist/client/assets/{railroadDiagram-Y72NRBL7-CSKtYLmm.js → railroadDiagram-Y72NRBL7-7kfKSzWs.js} +1 -1
  229. package/dist/client/assets/{registry-Tbt9pcZl.js → registry-BcpatPes.js} +4 -4
  230. package/dist/client/assets/registry-BuTvvFn6.js +1 -0
  231. package/dist/client/assets/{relay-trace-schemas-4AAUf-Zl.js → relay-trace-schemas-eOfnfe4X.js} +2 -2
  232. package/dist/client/assets/{repeat-B8g-x-Sc.js → repeat-BB0attnO.js} +1 -1
  233. package/dist/client/assets/{requirementDiagram-EQYSW5RA-BPSBZr7X.js → requirementDiagram-EQYSW5RA-CmOVPT7N.js} +1 -1
  234. package/dist/client/assets/{room-files-source-BkiK4-ZI.js → room-files-source-C32w3dXr.js} +1 -1
  235. package/dist/client/assets/{rotate-ccw-clock-DRtL-2nr.js → rotate-ccw-clock-C1SBdbZP.js} +1 -1
  236. package/dist/client/assets/{rotate-cw-BbHkWN-J.js → rotate-cw-BTqPAMgP.js} +1 -1
  237. package/dist/client/assets/{sankeyDiagram-SY24JHO5-DVlHablQ.js → sankeyDiagram-SY24JHO5-DFcTUSd1.js} +1 -1
  238. package/dist/client/assets/{scroll-area-DAC7NrVU.js → scroll-area-rEyYMbHG.js} +1 -1
  239. package/dist/client/assets/{sequenceDiagram-BLEHNHQU--wZkN8xk.js → sequenceDiagram-BLEHNHQU-BNY4ALqc.js} +1 -1
  240. package/dist/client/assets/server-BCFl_ur3.js +6 -0
  241. package/dist/client/assets/{shield-x-CEWfkzDN.js → shield-x-B2nLbkhR.js} +1 -1
  242. package/dist/client/assets/{signed-in-CMhCR-m8.js → signed-in-BcxH99a5.js} +1 -1
  243. package/dist/client/assets/{sizeCapture-INFHLROL-CLXc7d3S.js → sizeCapture-INFHLROL-CuNPY5HV.js} +1 -1
  244. package/dist/client/assets/{soul-file-CbX7rNqz.js → soul-file-ITCKiDY9.js} +1 -1
  245. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-5xa1FM_X.js → stateDiagram-v2-A6IESKWZ-CmUdZZJs.js} +1 -1
  246. package/dist/client/assets/{swimlanes-B3ENRKFQ-DKgxJxjE.js → swimlanes-B3ENRKFQ-BmNmFgsZ.js} +1 -1
  247. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Cd_Magxj.js +8 -0
  248. package/dist/client/assets/{table-D0EJT0uP.js → table-COZ3E1UU.js} +1 -1
  249. package/dist/client/assets/{tabs-Ctjzrm8t.js → tabs-CDr3zS_2.js} +1 -1
  250. package/dist/client/assets/{timeline-definition-JXYKGLGB-B9P7ituI.js → timeline-definition-JXYKGLGB-Cq7UTNkh.js} +1 -1
  251. package/dist/client/assets/{trust-dial-D__tIhzt.js → trust-dial-BsEooNiu.js} +2 -2
  252. package/dist/client/assets/{trust-posture-DaHHtOZn.js → trust-posture-Dk5ctS0Q.js} +1 -1
  253. package/dist/client/assets/{unplug-B-ipHefz.js → unplug-DB0xx2bf.js} +1 -1
  254. package/dist/client/assets/{unverified-catalog-notice-C8swqaTn.js → unverified-catalog-notice-CQoKhOjQ.js} +1 -1
  255. package/dist/client/assets/{use-bindings-gLHRNAFU.js → use-bindings-CEhDyZoj.js} +1 -1
  256. package/dist/client/assets/{use-composer-prefs-CjpxcBIe.js → use-composer-prefs-uC9mUd0f.js} +1 -1
  257. package/dist/client/assets/{use-connector-management-BLiCJMgU.js → use-connector-management-54m5ZcyP.js} +1 -1
  258. package/dist/client/assets/{use-deep-link-scroll-r2nKjzA-.js → use-deep-link-scroll-C4DQRnGX.js} +1 -1
  259. package/dist/client/assets/{use-delete-binding-BSiOik_K.js → use-delete-binding-Cr9soEn-.js} +1 -1
  260. package/dist/client/assets/{use-dev-links-DXcIlMf-.js → use-dev-links-CXGFC-N0.js} +1 -1
  261. package/dist/client/assets/{use-direct-message-panel-BbH8N4mE.js → use-direct-message-panel-BxwiNzks.js} +1 -1
  262. package/dist/client/assets/{use-external-adapter-catalog-mmKni5ui.js → use-external-adapter-catalog-D3xkw3mY.js} +1 -1
  263. package/dist/client/assets/{use-filter-state-CiPZ0AIH.js → use-filter-state-N0pdU49v.js} +1 -1
  264. package/dist/client/assets/{use-full-activity-feed-DXroUzfN.js → use-full-activity-feed-COuRZq_w.js} +1 -1
  265. package/dist/client/assets/use-is-below-desktop-CgAcZ8iA.js +1 -0
  266. package/dist/client/assets/{use-mesh-topology-upehQ5Cv.js → use-mesh-topology-BSRzCO1U.js} +1 -1
  267. package/dist/client/assets/{use-mounted-ref-IHwyriaF.js → use-mounted-ref-pxDiCOyS.js} +1 -1
  268. package/dist/client/assets/{use-notification-prefs-BHOK2P2l.js → use-notification-prefs-6N6Y4rqG.js} +1 -1
  269. package/dist/client/assets/use-pending-read-HbJdwxw1.js +1 -0
  270. package/dist/client/assets/{use-personality-commit-Chf3UX8P.js → use-personality-commit-Dl3YK7Qd.js} +1 -1
  271. package/dist/client/assets/{use-promo-activation-Dlw6bg7G.js → use-promo-activation-DXRrwLes.js} +2 -2
  272. package/dist/client/assets/{use-promo-dismissals-Dx_fli7I.js → use-promo-dismissals-DnqiKhqW.js} +1 -1
  273. package/dist/client/assets/{use-pulse-freshness-CG_I6a-O.js → use-pulse-freshness-D9uzSgz_.js} +1 -1
  274. package/dist/client/assets/{use-room-follow-claim-Bgrpr3bO.js → use-room-follow-claim-Ch6ZoOAv.js} +1 -1
  275. package/dist/client/assets/{use-room-sessions-DecGrP3E.js → use-room-sessions-C3NpXFWY.js} +1 -1
  276. package/dist/client/assets/{use-roving-tab-list-CDkh-Ujm.js → use-roving-tab-list-LZku4K5R.js} +1 -1
  277. package/dist/client/assets/{use-session-canvas-tvLLPQcm.js → use-session-canvas-Bub7vCaj.js} +6 -6
  278. package/dist/client/assets/{use-status-budget-BBl2yxLR.js → use-status-budget-DrAROrOw.js} +2 -2
  279. package/dist/client/assets/{use-todos-BzRauzdQ.js → use-todos-COW66MhB.js} +1 -1
  280. package/dist/client/assets/{use-transform-DzJeHpxm.js → use-transform-CXFCVk8z.js} +1 -1
  281. package/dist/client/assets/{use-unclaimed-chats--HZdmq4F.js → use-unclaimed-chats-T3kskM3T.js} +1 -1
  282. package/dist/client/assets/use-update-config-BhLEnZe5.js +1 -0
  283. package/dist/client/assets/{useMutationState-DIywUTDG.js → useMutationState-6Zu1xBsZ.js} +1 -1
  284. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-C9aLJ03F.js → usecaseDiagram-WPOLBNNX-CUu-YUIY.js} +1 -1
  285. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-ChBIWbL0.js → vennDiagram-Q3Y3IDCW-CfA29THe.js} +1 -1
  286. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-DvQDOaTm.js → wardleyDiagram-IVAIDKWA-CrARcH-W.js} +1 -1
  287. package/dist/client/assets/{xychartDiagram-4URNHDU4-8FxLPP2c.js → xychartDiagram-4URNHDU4-BCVaXTG3.js} +1 -1
  288. package/dist/client/assets/{zap-DSllMMHe.js → zap-C-pr1sst.js} +1 -1
  289. package/dist/client/index.html +2 -2
  290. package/dist/drizzle/20261108035027_dor3547_extension_grant_subject.sql +30 -0
  291. package/dist/drizzle/meta/20261108035027_snapshot.json +15121 -0
  292. package/dist/drizzle/meta/_journal.json +7 -0
  293. package/dist/server/extension-child.cjs +19 -3
  294. package/dist/server/index.js +13162 -12123
  295. package/dist/server/index.js.map +2 -2
  296. package/package.json +2 -2
  297. package/dist/client/assets/CanvasFileContent-Bqd0IEfK.js +0 -2
  298. package/dist/client/assets/CanvasModel3dContent-DqL0Sy4r.js +0 -2
  299. package/dist/client/assets/HandlePage-aHId3bYX.js +0 -1
  300. package/dist/client/assets/NamePage-C7F-SotG.js +0 -1
  301. package/dist/client/assets/NewDirectMessageMenu-CjBjzsDe.js +0 -1
  302. package/dist/client/assets/PermissionHistory-D0chstxf.js +0 -1
  303. package/dist/client/assets/PhotoPage-Cqo3PNO_.js +0 -1
  304. package/dist/client/assets/_shell._home.index-BzTYr8Bw.js +0 -3
  305. package/dist/client/assets/_shell.connections-CBx0ogzx.js +0 -1
  306. package/dist/client/assets/_shell.marketplace-CgWBUKSA.js +0 -1
  307. package/dist/client/assets/_shell.marketplace_.sources-8HZpKFDI.js +0 -1
  308. package/dist/client/assets/_shell.session-D6HcVbnm.js +0 -1
  309. package/dist/client/assets/_shell.threads-BavVtQOE.js +0 -1
  310. package/dist/client/assets/_shell.todos-B6uWr0zA.js +0 -6
  311. package/dist/client/assets/_shell.x._extensionId-DaELdkCH.js +0 -1
  312. package/dist/client/assets/_shell.x._extensionId_._-DaELdkCH.js +0 -1
  313. package/dist/client/assets/channel-A3XT7_2L.js +0 -1
  314. package/dist/client/assets/index-BJRgbiEd.js +0 -1
  315. package/dist/client/assets/index-BcFn_S6b.js +0 -1
  316. package/dist/client/assets/index-BdVQOlVQ.css +0 -1
  317. package/dist/client/assets/index-C5EvpXcq.js +0 -1
  318. package/dist/client/assets/index-DZhMvc9m.js +0 -1
  319. package/dist/client/assets/progress-BA2JPtb6.js +0 -6
  320. package/dist/client/assets/registry-jD9zw538.js +0 -1
  321. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-f6MOc3pl.js +0 -8
  322. package/dist/client/assets/use-is-below-desktop-LUZL5z5t.js +0 -1
  323. package/dist/client/assets/use-pending-read-mVsOBTzn.js +0 -1
  324. package/dist/client/assets/use-update-config-DjL7-nUR.js +0 -1
@@ -1 +1 @@
1
- import{a5 as u,dZ as h,a8 as p,d_ as k,j as r,d2 as D,d3 as j,d5 as x,d6 as R,d7 as L,d$ as $,B as f,dR as l}from"./index-BR1m9FON.js";import{u as m}from"./use-dev-links-DXcIlMf-.js";function y(){const e=u();return p({mutationFn:t=>e.previewDevLink(t),meta:{suppressErrorToast:!0}})}function A(){const e=u(),t=m(),o=h(n=>n.forget);return p({mutationFn:n=>e.linkDevLink(n),meta:{suppressErrorToast:!0},onSuccess:n=>{n.status==="linked"&&(o(n.link),t())}})}function P(){const e=u(),t=m(),o=h(n=>n.forget);return p({mutationFn:({name:n,...s})=>e.unlinkDevLink(n,s),meta:{suppressErrorToast:!0},onSuccess:(n,s)=>{o(s),t()}})}const w=/^(\S+) didn't build:/;function g(e){const t=e.length===1?w.exec(e[0]):null;return t?`Couldn’t reload: ${t[1]} has a build error.`:"Couldn’t reload your last edit."}function C(e,t,o){if(e.state!=="active")return{kind:e.state};const n=o==null?void 0:o.lastReloadAt,s=t!==void 0&&(o===void 0||t.at>=o.linkedAt)?t:void 0,i=s!==void 0&&(n===void 0||s.at>=n);if(i&&s.errors&&s.errors.length>0)return{kind:"reload-failed",at:s.at,headline:g(s.errors),details:s.errors};const d=i?s.at:n;return d?{kind:"reloaded",at:d}:{kind:"watching"}}function F(e,t){const o=Math.max(0,Math.floor((t-new Date(e).getTime())/1e3));if(o<2)return"Reloaded just now";if(o<60)return`Reloaded ${o}s ago`;const n=Math.floor(o/60);if(n<60)return`Reloaded ${n}m ago`;const s=Math.floor(n/60);return s<24?`Reloaded ${s}h ago`:`Reloaded ${new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function v(e){return e.agentPath?{scope:"project",projectPath:e.agentPath}:{scope:"global"}}function N(e,t){var s;const{scope:o}=v(t),n=(s=t.devLink)==null?void 0:s.path;return e==null?void 0:e.find(i=>i.name===t.name&&i.scope===o&&i.path===n)}function T(e,t){return t?{name:t.name,scope:t.scope,...t.projectPath!==void 0&&{projectPath:t.projectPath}}:{name:e.name,...v(e)}}function I(e,t){return t.restored==="installed"?{title:`${e} runs from the installed copy.`}:t.parkedLeftAt?{title:`${e} unlinked. Its installed copy couldn’t come back.`,description:`It’s still set aside at ${t.parkedLeftAt}.`}:t.leftInPlace?{title:`${e} unlinked.`,description:"Something else was in its place. It was left as it is."}:{title:`${e} removed.`}}function E({target:e,onClose:t,onUnlinked:o}){const n=P(),s=e?k(e.name):"",i=(e==null?void 0:e.then)==="install";async function d(){if(e)try{const a=await n.mutateAsync({name:e.name,scope:e.scope,...e.projectPath!==void 0&&{projectPath:e.projectPath}});if(i&&a.restored==="removed"&&!a.parkedLeftAt)l.success(`${s} unlinked.`,{description:a.leftInPlace?"Something else was in its place. It was left as it is.":"It’s not installed until you finish the install."});else{const c=I(s,a);l.success(c.title,c.description?{description:c.description}:void 0)}o==null||o(e,a),t()}catch(a){l.error(`Couldn’t unlink ${s}`,{description:a instanceof Error?a.message:void 0})}}return r.jsx(D,{open:e!==null,onOpenChange:a=>!a&&t(),children:r.jsx(j,{className:"!min-h-0 sm:max-w-md",children:e&&r.jsxs(r.Fragment,{children:[r.jsxs(x,{className:"text-left",children:[r.jsx(R,{className:"text-left",children:i?`Install the published ${s}?`:`Unlink ${s}?`}),r.jsx(L,{className:"text-left",children:i?`${s} is unlinked first. Your folder is not touched.`:e.parked?"Your installed copy comes back.":`${s} is removed. Your folder is not touched.`})]}),r.jsxs($,{children:[r.jsx(f,{variant:"ghost",onClick:t,disabled:n.isPending,children:"Cancel"}),r.jsx(f,{onClick:()=>void d(),disabled:n.isPending,children:n.isPending?"Unlinking…":i?"Unlink and install":"Unlink"})]})]})})})}export{E as U,T as a,C as b,F as c,v as d,A as e,N as f,y as u};
1
+ import{a5 as u,dZ as h,a8 as p,d_ as k,j as r,d2 as D,d3 as j,d5 as x,d6 as R,d7 as L,d$ as $,B as f,dR as l}from"./index-B2JoVHek.js";import{u as m}from"./use-dev-links-CXGFC-N0.js";function y(){const e=u();return p({mutationFn:t=>e.previewDevLink(t),meta:{suppressErrorToast:!0}})}function A(){const e=u(),t=m(),o=h(n=>n.forget);return p({mutationFn:n=>e.linkDevLink(n),meta:{suppressErrorToast:!0},onSuccess:n=>{n.status==="linked"&&(o(n.link),t())}})}function P(){const e=u(),t=m(),o=h(n=>n.forget);return p({mutationFn:({name:n,...s})=>e.unlinkDevLink(n,s),meta:{suppressErrorToast:!0},onSuccess:(n,s)=>{o(s),t()}})}const w=/^(\S+) didn't build:/;function g(e){const t=e.length===1?w.exec(e[0]):null;return t?`Couldn’t reload: ${t[1]} has a build error.`:"Couldn’t reload your last edit."}function C(e,t,o){if(e.state!=="active")return{kind:e.state};const n=o==null?void 0:o.lastReloadAt,s=t!==void 0&&(o===void 0||t.at>=o.linkedAt)?t:void 0,i=s!==void 0&&(n===void 0||s.at>=n);if(i&&s.errors&&s.errors.length>0)return{kind:"reload-failed",at:s.at,headline:g(s.errors),details:s.errors};const d=i?s.at:n;return d?{kind:"reloaded",at:d}:{kind:"watching"}}function F(e,t){const o=Math.max(0,Math.floor((t-new Date(e).getTime())/1e3));if(o<2)return"Reloaded just now";if(o<60)return`Reloaded ${o}s ago`;const n=Math.floor(o/60);if(n<60)return`Reloaded ${n}m ago`;const s=Math.floor(n/60);return s<24?`Reloaded ${s}h ago`:`Reloaded ${new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function v(e){return e.agentPath?{scope:"project",projectPath:e.agentPath}:{scope:"global"}}function N(e,t){var s;const{scope:o}=v(t),n=(s=t.devLink)==null?void 0:s.path;return e==null?void 0:e.find(i=>i.name===t.name&&i.scope===o&&i.path===n)}function T(e,t){return t?{name:t.name,scope:t.scope,...t.projectPath!==void 0&&{projectPath:t.projectPath}}:{name:e.name,...v(e)}}function I(e,t){return t.restored==="installed"?{title:`${e} runs from the installed copy.`}:t.parkedLeftAt?{title:`${e} unlinked. Its installed copy couldn’t come back.`,description:`It’s still set aside at ${t.parkedLeftAt}.`}:t.leftInPlace?{title:`${e} unlinked.`,description:"Something else was in its place. It was left as it is."}:{title:`${e} removed.`}}function E({target:e,onClose:t,onUnlinked:o}){const n=P(),s=e?k(e.name):"",i=(e==null?void 0:e.then)==="install";async function d(){if(e)try{const a=await n.mutateAsync({name:e.name,scope:e.scope,...e.projectPath!==void 0&&{projectPath:e.projectPath}});if(i&&a.restored==="removed"&&!a.parkedLeftAt)l.success(`${s} unlinked.`,{description:a.leftInPlace?"Something else was in its place. It was left as it is.":"It’s not installed until you finish the install."});else{const c=I(s,a);l.success(c.title,c.description?{description:c.description}:void 0)}o==null||o(e,a),t()}catch(a){l.error(`Couldn’t unlink ${s}`,{description:a instanceof Error?a.message:void 0})}}return r.jsx(D,{open:e!==null,onOpenChange:a=>!a&&t(),children:r.jsx(j,{className:"!min-h-0 sm:max-w-md",children:e&&r.jsxs(r.Fragment,{children:[r.jsxs(x,{className:"text-left",children:[r.jsx(R,{className:"text-left",children:i?`Install the published ${s}?`:`Unlink ${s}?`}),r.jsx(L,{className:"text-left",children:i?`${s} is unlinked first. Your folder is not touched.`:e.parked?"Your installed copy comes back.":`${s} is removed. Your folder is not touched.`})]}),r.jsxs($,{children:[r.jsx(f,{variant:"ghost",onClick:t,disabled:n.isPending,children:"Cancel"}),r.jsx(f,{onClick:()=>void d(),disabled:n.isPending,children:n.isPending?"Unlinking…":i?"Unlink and install":"Unlink"})]})]})})})}export{E as U,T as a,C as b,F as c,v as d,A as e,N as f,y as u};
@@ -1 +1 @@
1
- import{a5 as M,a7 as k,r as o,e9 as T,aZ as m,ea as b,eb as q,ec as B,aL as j,ed as C,aQ as E,ee as Q,ef as J,j as _}from"./index-BR1m9FON.js";import{m as P}from"./registry-Tbt9pcZl.js";function U(e,t){const n=e??[];return n.some(a=>a.seq===t.seq)?n:n.length===0||n[n.length-1].seq<t.seq?[...n,t]:[...n,t].sort((a,s)=>a.seq-s.seq)}function W(e,t){const n=e??[],a=n.findIndex(w=>w.id===t.id);if(a===-1)return n;const s=n[a];if(s.seq!==t.seq||s.roomId!==t.roomId||JSON.stringify(s.body)===JSON.stringify(t.body)&&JSON.stringify(s.mentions)===JSON.stringify(t.mentions)&&JSON.stringify(s.mentionSpans)===JSON.stringify(t.mentionSpans))return n;const p=[...n];return p[a]={...s,body:t.body,mentions:t.mentions,mentionSpans:t.mentionSpans},p}function K(e,t){if(t.kind!=="notice"||t.body.notice!=="turn_failed")return;const n=t.body.subjectAuthorId;n!==void 0&&C.getState().clearAuthor(e,n)}function Y(e,t){const n=e.getQueryData(E.entries(t));return n&&n.length>0?n[n.length-1].seq:0}function H(e,t){var n;return((n=e.getQueryData(E.detail(t)))==null?void 0:n.viewerAuthorId)??null}const G=2e3;function V(){const e=o.useRef(null),t=o.useCallback(()=>{e.current!==null&&(clearTimeout(e.current),e.current=null)},[]),n=o.useCallback(s=>{t(),m.getState().endRoomCanvasCycle(s)},[t]),a=o.useCallback(s=>{t(),e.current=setTimeout(()=>{e.current=null,m.getState().endRoomCanvasCycle(s)},G)},[t]);return o.useEffect(()=>t,[t]),{arm:a,now:n}}function Z(e){const t=Math.min(b.BACKOFF_CAP_MS,b.BACKOFF_BASE_MS*2**e);return Math.random()*t}const z=50;function X(e,t){return new Promise(n=>{if(t.aborted)return n();const a=()=>{clearTimeout(s),t.removeEventListener("abort",a),n()},s=setTimeout(a,e);t.addEventListener("abort",a,{once:!0})})}function ee(e,t){const n=M(),a=k(),[s,y]=o.useState(null),[p,w]=o.useState(null),[O,D]=o.useState(0),R=o.useRef(!1),A=V(),F=o.useCallback(()=>D(i=>i+1),[]),S=o.useRef(null),x=o.useCallback(()=>{S.current===null&&(S.current=setTimeout(()=>{S.current=null,D(i=>i+1)},z))},[]);return o.useEffect(()=>{if(e===null)return;const i=()=>x();let l=null;const f=()=>{if(document.visibilityState!=="visible"){l=Date.now();return}const d=l===null?0:Date.now()-l;l=null,(R.current||d>=b.VISIBILITY_GRACE_MS)&&x()};let c=T.getListConnectionState();const g=T.subscribeListConnectionState(d=>{const v=d==="connected"&&(c==="reconnecting"||c==="disconnected");c=d,v&&x()});return window.addEventListener("online",i),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("online",i),document.removeEventListener("visibilitychange",f),g(),S.current!==null&&(clearTimeout(S.current),S.current=null)}},[e,x]),o.useEffect(()=>(m.getState().setRoomCanvasLiveRoom(e),()=>m.getState().setRoomCanvasLiveRoom(null)),[e]),o.useEffect(()=>{if(e===null||!t)return;const i=new AbortController;let l=!0,f;return(async()=>{y(null),w(null),R.current=!1;let c=0,g=!1;const d=()=>{c=0,R.current=!1,g&&(g=!1,y(v=>v===e?null:v))};for(;l&&!i.signal.aborted;){const v=Date.now();R.current=!1,m.getState().beginRoomCanvasCycle(e),A.arm(e);const L=setTimeout(d,b.STABILITY_WINDOW_MS);let u;try{if(u=q(n,e,Y(a,e),i.signal),f=u,!l||i.signal.aborted){u.retire();return}for await(const r of u.stream){if(!l||i.signal.aborted||(d(),!u.current()))return;if(r.type==="canvas_event"||r.type==="canvas_channel_snapshot"){if(u.publish(r),!u.current())return;continue}if(r.type==="signal"){B(r)?j.getState().observe(e,r):(C.getState().observe(e,r),m.getState().applyRoomCanvasPresence(e,r));continue}if(r.type==="reaction"){a.setQueryData(E.entries(e),h=>P(h,r.entryId,r.reactions));continue}if(r.type==="revision"){if(r.entry.roomId!==e)continue;a.setQueryData(E.entries(e),h=>W(h,r.entry));continue}if(r.type==="canvas"){m.getState().applyRoomCanvasFrame(e,r,H(a,e)),r.change!==void 0?A.now(e):A.arm(e);continue}C.getState().clearAuthor(e,r.entry.authorId),K(e,r.entry),Q.getState().settle(e,r.entry.id),a.setQueryData(E.entries(e),h=>U(h,r.entry))}}catch(r){if(i.signal.aborted)return;if(console.warn("[rooms] live stream dropped",{roomId:e,err:r}),J(r)){C.getState().clearRoom(e),w(e),y(e),clearTimeout(L);return}}finally{try{u==null||u.retire()}finally{clearTimeout(L)}}if(i.signal.aborted)return;Date.now()-v>=b.STABILITY_WINDOW_MS&&(c=0),c+=1,R.current=!0,c>=b.DISCONNECTED_THRESHOLD&&!g&&(C.getState().clearRoom(e),y(e),g=!0),await X(Z(c),i.signal)}})(),()=>{l=!1;try{f==null||f.retire()}finally{i.abort()}}},[e,t,n,a,O]),{stalled:s!==null&&s===e,unavailable:p!==null&&p===e,retry:F}}function te({label:e}){return _.jsx("div",{"data-slot":"day-divider","data-testid":"day-divider",role:"separator","aria-label":e,className:"text-muted-foreground text-2xs py-4 text-center font-medium",children:e})}const N="New messages";function ne(){return _.jsxs("div",{"data-slot":"unread-divider","data-testid":"unread-divider",role:"separator","aria-label":N,className:"flex items-center gap-2 px-[var(--msg-padding-x)] py-2",children:[_.jsx("span",{"aria-hidden":"true",className:"bg-brand/60 h-px flex-1"}),_.jsx("span",{className:"text-brand-text text-2xs font-medium tracking-wide",children:N})]})}export{te as D,ne as U,ee as u};
1
+ import{a5 as M,a7 as k,r as o,e9 as T,a_ as m,ea as b,eb as q,ec as B,aL as j,ed as C,aR as E,ee as Q,ef as J,j as _}from"./index-B2JoVHek.js";import{m as P}from"./registry-BcpatPes.js";function U(e,t){const n=e??[];return n.some(a=>a.seq===t.seq)?n:n.length===0||n[n.length-1].seq<t.seq?[...n,t]:[...n,t].sort((a,s)=>a.seq-s.seq)}function W(e,t){const n=e??[],a=n.findIndex(w=>w.id===t.id);if(a===-1)return n;const s=n[a];if(s.seq!==t.seq||s.roomId!==t.roomId||JSON.stringify(s.body)===JSON.stringify(t.body)&&JSON.stringify(s.mentions)===JSON.stringify(t.mentions)&&JSON.stringify(s.mentionSpans)===JSON.stringify(t.mentionSpans))return n;const p=[...n];return p[a]={...s,body:t.body,mentions:t.mentions,mentionSpans:t.mentionSpans},p}function K(e,t){if(t.kind!=="notice"||t.body.notice!=="turn_failed")return;const n=t.body.subjectAuthorId;n!==void 0&&C.getState().clearAuthor(e,n)}function Y(e,t){const n=e.getQueryData(E.entries(t));return n&&n.length>0?n[n.length-1].seq:0}function H(e,t){var n;return((n=e.getQueryData(E.detail(t)))==null?void 0:n.viewerAuthorId)??null}const G=2e3;function V(){const e=o.useRef(null),t=o.useCallback(()=>{e.current!==null&&(clearTimeout(e.current),e.current=null)},[]),n=o.useCallback(s=>{t(),m.getState().endRoomCanvasCycle(s)},[t]),a=o.useCallback(s=>{t(),e.current=setTimeout(()=>{e.current=null,m.getState().endRoomCanvasCycle(s)},G)},[t]);return o.useEffect(()=>t,[t]),{arm:a,now:n}}function z(e){const t=Math.min(b.BACKOFF_CAP_MS,b.BACKOFF_BASE_MS*2**e);return Math.random()*t}const X=50;function Z(e,t){return new Promise(n=>{if(t.aborted)return n();const a=()=>{clearTimeout(s),t.removeEventListener("abort",a),n()},s=setTimeout(a,e);t.addEventListener("abort",a,{once:!0})})}function ee(e,t){const n=M(),a=k(),[s,y]=o.useState(null),[p,w]=o.useState(null),[O,D]=o.useState(0),R=o.useRef(!1),A=V(),F=o.useCallback(()=>D(i=>i+1),[]),S=o.useRef(null),x=o.useCallback(()=>{S.current===null&&(S.current=setTimeout(()=>{S.current=null,D(i=>i+1)},X))},[]);return o.useEffect(()=>{if(e===null)return;const i=()=>x();let l=null;const f=()=>{if(document.visibilityState!=="visible"){l=Date.now();return}const d=l===null?0:Date.now()-l;l=null,(R.current||d>=b.VISIBILITY_GRACE_MS)&&x()};let c=T.getListConnectionState();const g=T.subscribeListConnectionState(d=>{const v=d==="connected"&&(c==="reconnecting"||c==="disconnected");c=d,v&&x()});return window.addEventListener("online",i),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("online",i),document.removeEventListener("visibilitychange",f),g(),S.current!==null&&(clearTimeout(S.current),S.current=null)}},[e,x]),o.useEffect(()=>(m.getState().setRoomCanvasLiveRoom(e),()=>m.getState().setRoomCanvasLiveRoom(null)),[e]),o.useEffect(()=>{if(e===null||!t)return;const i=new AbortController;let l=!0,f;return(async()=>{y(null),w(null),R.current=!1;let c=0,g=!1;const d=()=>{c=0,R.current=!1,g&&(g=!1,y(v=>v===e?null:v))};for(;l&&!i.signal.aborted;){const v=Date.now();R.current=!1,m.getState().beginRoomCanvasCycle(e),A.arm(e);const L=setTimeout(d,b.STABILITY_WINDOW_MS);let u;try{if(u=q(n,e,Y(a,e),i.signal),f=u,!l||i.signal.aborted){u.retire();return}for await(const r of u.stream){if(!l||i.signal.aborted||(d(),!u.current()))return;if(r.type==="canvas_event"||r.type==="canvas_channel_snapshot"){if(u.publish(r),!u.current())return;continue}if(r.type==="signal"){B(r)?j.getState().observe(e,r):(C.getState().observe(e,r),m.getState().applyRoomCanvasPresence(e,r));continue}if(r.type==="reaction"){a.setQueryData(E.entries(e),h=>P(h,r.entryId,r.reactions));continue}if(r.type==="revision"){if(r.entry.roomId!==e)continue;a.setQueryData(E.entries(e),h=>W(h,r.entry));continue}if(r.type==="canvas"){m.getState().applyRoomCanvasFrame(e,r,H(a,e)),r.change!==void 0?A.now(e):A.arm(e);continue}C.getState().clearAuthor(e,r.entry.authorId),K(e,r.entry),Q.getState().settle(e,r.entry.id),a.setQueryData(E.entries(e),h=>U(h,r.entry))}}catch(r){if(i.signal.aborted)return;if(console.warn("[rooms] live stream dropped",{roomId:e,err:r}),J(r)){C.getState().clearRoom(e),w(e),y(e),clearTimeout(L);return}}finally{try{u==null||u.retire()}finally{clearTimeout(L)}}if(i.signal.aborted)return;Date.now()-v>=b.STABILITY_WINDOW_MS&&(c=0),c+=1,R.current=!0,c>=b.DISCONNECTED_THRESHOLD&&!g&&(C.getState().clearRoom(e),y(e),g=!0),await Z(z(c),i.signal)}})(),()=>{l=!1;try{f==null||f.retire()}finally{i.abort()}}},[e,t,n,a,O]),{stalled:s!==null&&s===e,unavailable:p!==null&&p===e,retry:F}}function te({label:e}){return _.jsx("div",{"data-slot":"day-divider","data-testid":"day-divider",role:"separator","aria-label":e,className:"text-muted-foreground text-2xs py-4 text-center font-medium",children:e})}const N="New messages";function ne(){return _.jsxs("div",{"data-slot":"unread-divider","data-testid":"unread-divider",role:"separator","aria-label":N,className:"flex items-center gap-2 px-[var(--msg-padding-x)] py-2",children:[_.jsx("span",{"aria-hidden":"true",className:"bg-brand/60 h-px flex-1"}),_.jsx("span",{className:"text-brand-text text-2xs font-medium tracking-wide",children:N})]})}export{te as D,ne as U,ee as u};
@@ -1,4 +1,4 @@
1
- import{O as I,r as x,dv as g,dw as f,g4 as k,du as F,g1 as st,g3 as ln,ov as dn,lO as Te,g2 as ye,ow as E,ox as Z,oy as un,oz as pn,oA as mn,dx as Ee,dy as he,oB as fn,dz as M,oC as ee,oD as hn,oE as xn,oF as gn,k6 as yn,a5 as bn,oG as Ne,oH as vn,oI as at,aZ as jn,ka as kn,j as t,fW as Nn,fX as wn,dm as Sn,ej as Cn,oJ as _n,dW as An,ij as rt,dB as In,dA as Mn,_ as y,G as N,cC as $n,fK as Se,cF as Tn,b$ as En,fL as Ln,oK as Dn,ku as On,kX as it,dS as Rn,e8 as zn,gl as Wn,f_ as Pn,oL as Bn,bb as Fn,oM as Un,bx as Gn,ir as Hn,eB as Kn,ba as Yn,J as Le,oN as Vn,ip as qn,nG as Qn,a4 as ot,c0 as Xn,B as ct,eL as De,ew as Jn,ex as Zn,ey as es,ez as ts,eA as ns,I as ss,x as as,hi as lt,dn as dt,dp as ut,dq as pt,oO as mt,dR as ft,h0 as rs,X as is,oP as os,fY as ht,oQ as cs,oR as ls,oS as ds,oT as us,oU as ps,C as ms}from"./index-BR1m9FON.js";import{a as fs}from"./index-CpWxcN5D.js";import{P as hs,S as xs}from"./progress-BA2JPtb6.js";import{M as gs}from"./markdown-content-DhAtZOfj.js";import{T as xt,d as gt,b as be,e as Ce,c as _e,a as yt}from"./table-D0EJT0uP.js";import{Z as ys}from"./zap-DSllMMHe.js";import{P as bs}from"./package-BhKXbvU_.js";import{H as vs}from"./heart-Cn3a-UQI.js";import{G as js}from"./git-branch-CsLE6G0Y.js";import{F as ks}from"./file-text-Cycq_S0e.js";import{F as Ns}from"./file-CQGljfDT.js";/**
1
+ import{O as I,r as x,dv as g,dw as f,g4 as k,du as F,g1 as st,g3 as ln,oy as dn,lN as Te,g2 as ye,oz as E,oA as Z,oB as un,oC as pn,oD as mn,dx as Ee,dy as he,oE as fn,dz as M,oF as ee,oG as hn,oH as xn,oI as gn,k5 as yn,a5 as bn,oJ as Ne,oK as vn,oL as at,a_ as jn,k9 as kn,j as t,fW as Nn,fX as wn,dm as Sn,ej as Cn,oM as _n,dW as An,ij as rt,dB as In,dA as Mn,_ as y,G as N,cC as $n,fK as Se,cF as Tn,b$ as En,fL as Ln,oN as Dn,kt as On,kW as it,dS as Rn,e8 as zn,gl as Wn,f_ as Pn,oO as Bn,bc as Fn,oP as Un,bx as Gn,ir as Hn,eB as Kn,bb as Yn,J as Le,oQ as Vn,ip as qn,nn as Qn,a4 as ot,c0 as Xn,B as ct,eL as De,ew as Jn,ex as Zn,ey as es,ez as ts,eA as ns,I as ss,x as as,hf as lt,dn as dt,dp as ut,dq as pt,oR as mt,dR as ft,h0 as rs,X as is,oS as os,fY as ht,oT as cs,oU as ls,oV as ds,oW as us,oX as ps,C as ms}from"./index-B2JoVHek.js";import{a as fs}from"./index-Bocv39Dy.js";import{P as hs}from"./progress-CwpnobNW.js";import{M as xs}from"./markdown-content-FcvkqTTS.js";import{T as xt,d as gt,b as be,e as Ce,c as _e,a as yt}from"./table-COZ3E1UU.js";import{Z as gs}from"./zap-C-pr1sst.js";import{S as ys}from"./server-BCFl_ur3.js";import{P as bs}from"./package-DpqGENzU.js";import{H as vs}from"./heart-B7rSSNjF.js";import{G as js}from"./git-branch-CzV_Mp0H.js";import{F as ks}from"./file-text-4-Vc22J-.js";import{F as Ns}from"./file-DZ6-r1A3.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -105,4 +105,4 @@ import{O as I,r as x,dv as g,dw as f,g4 as k,du as F,g1 as st,g3 as ln,ov as dn,
105
105
  * See the LICENSE file in the root directory of this source tree.
106
106
  */const Wt={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};Wt.node;const Gs=I(Wt),Pt=x.createContext(void 0),Hs=Pt.Provider;function Ks(){return x.useContext(Pt)}const Ys=/[\u0000-\u001f\u007f-\u009f]+/g;function Bt(e,n){const s=new RegExp(`<\\s*/\\s*${n}`,"gi");return e.replace(s,`<\\/${n}`)}function we(e,n){return Bt(e.replace(Ys," ").trim(),n)}const te="ui_action";function Vs(e){const n=e.widgetTitle?we(e.widgetTitle,te):"",s=[`<${te}>`,"The user interacted with a widget you rendered.",`Widget: ${n||"(untitled)"}`,`Action: ${we(e.actionId,te)}`];e.widgetId&&s.push(`Widget ID: ${we(e.widgetId,te)}`);const a=e.payload&&Object.keys(e.payload).length>0;return s.push(a?`Payload:
107
107
  ${Bt(JSON.stringify(e.payload,null,2),te)}`:"Payload: (none)"),s.push("Respond to this interaction now. If the widget represents ongoing state (a game, a checklist), re-emit exactly ONE updated widget reflecting it — trust this payload over your memory of prior turns."),s.push(`</${te}>`),s.join(`
108
- `)}const qs=F(["default","success","warning","error","info"]),Ft=g({kind:k("agent"),id:f().min(1),label:f().optional(),payload:st(f(),ln()).optional()}),Ut=g({kind:k("emit"),type:pn,payload:dn.optional(),coalesceKey:f().min(1).max(128).optional()}).strict(),Be=Te("kind",[Ft,Ut]),Ae=Te("kind",[Ft,Ut,g({kind:k("ui"),command:mn}),g({kind:k("url"),href:f().url().refine(e=>e.startsWith("https://"),{message:"Widget URLs must be https"})})]),Fe=ye([f(),Ee(),he(),fn()]),Qs=["sm","md","lg"],Ue={sm:4,md:12};function Xs(e){const n=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null;if(n!==null)return n<=Ue.sm?"sm":n<=Ue.md?"md":"lg";if(typeof e=="string"){const s=e.trim().toLowerCase();if(s==="none"||s==="xs"||s==="small"||s==="sm")return"sm";if(s==="medium"||s==="normal"||s==="md")return"md";if(s==="large"||s==="xl"||s==="xxl"||s==="lg")return"lg"}return e}const Js=E(Xs,F(Qs));function q(e){return n=>{if(typeof n!="string")return n;const s=n.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(e,s)?e[s]:n}}const Oe=E(q({default:"default",neutral:"default",muted:"default",normal:"default",gray:"default",grey:"default",success:"success",ok:"success",okay:"success",good:"success",positive:"success",done:"success",complete:"success",completed:"success",green:"success",warning:"warning",warn:"warning",caution:"warning",pending:"warning",yellow:"warning",orange:"warning",error:"error",danger:"error",critical:"error",fail:"error",failed:"error",failure:"error",negative:"error",blocked:"error",red:"error",info:"info",information:"info",note:"info",blue:"info"}),qs),Zs=E(q({vertical:"vertical",vert:"vertical",column:"vertical",col:"vertical",stack:"vertical",horizontal:"horizontal",horiz:"horizontal",row:"horizontal",inline:"horizontal"}),F(["vertical","horizontal"])),ea=E(q({default:"default",primary:"default",secondary:"secondary",destructive:"destructive",danger:"destructive",delete:"destructive",outline:"outline",ghost:"outline",link:"outline"}),F(["default","secondary","destructive","outline"])),ta=E(q({bar:"bar",bars:"bar",column:"bar",columns:"bar",histogram:"bar",line:"line",lines:"line",area:"area",pie:"pie",donut:"pie",doughnut:"pie"}),F(["bar","line","area","pie"])),na=E(q({up:"up",increase:"up",increased:"up",positive:"up",rise:"up",rising:"up",gain:"up",down:"down",decrease:"down",decreased:"down",negative:"down",fall:"down",falling:"down",drop:"down",loss:"down",flat:"flat",none:"flat",neutral:"flat",same:"flat",unchanged:"flat",steady:"flat"}),F(["up","down","flat"])),sa=E(e=>{const n=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null;return n===null?e:Math.min(3,Math.max(1,Math.round(n)))},ye([k(1),k(2),k(3)])),aa=E(e=>typeof e=="string"?{value:e,direction:"flat"}:typeof e=="number"?{value:e,direction:e>0?"up":e<0?"down":"flat"}:e,g({value:ye([f(),Ee()]),direction:na.default("flat")})),ra=E(e=>typeof e=="string"?{text:e}:e,g({text:f(),tone:Oe.optional()})),ia=E(q({done:"done",complete:"done",completed:"done",finished:"done",past:"done",active:"active",current:"active",now:"active","in-progress":"active",in_progress:"active",inprogress:"active",ongoing:"active",upcoming:"upcoming",pending:"upcoming",next:"upcoming",todo:"upcoming",future:"upcoming",planned:"upcoming"}),F(["done","active","upcoming"])),Ge=E(e=>{if(typeof e=="number")return e===1?!0:e===0?!1:e;if(typeof e=="string"){const n=e.trim().toLowerCase();if(n==="true"||n==="yes"||n==="checked")return!0;if(n==="false"||n==="no"||n==="unchecked")return!1}return e},he()),oa=E(q({happy:"happy",proud:"happy",joy:"happy",joyful:"happy",glad:"happy",thinking:"thinking",confused:"thinking",pondering:"thinking",curious:"thinking",hmm:"thinking",celebrating:"celebrating",excited:"celebrating",party:"celebrating",hyped:"celebrating",sheepish:"sheepish",embarrassed:"sheepish",oops:"sheepish",awkward:"sheepish",shy:"sheepish",determined:"determined",focused:"determined",serious:"determined",resolute:"determined",surprised:"surprised",shocked:"surprised",wow:"surprised",amazed:"surprised","mind-blown":"surprised",sad:"sad",unhappy:"sad",disappointed:"sad",down:"sad",love:"love",heart:"love",hearts:"love",adore:"love"}),F(["happy","thinking","celebrating","sheepish","determined","surprised","sad","love"])),ca=E(q({coin:"coin",flip:"coin",coinflip:"coin",d6:"d6",dice:"d6",die:"d6",d20:"d20","8ball":"8ball",magic8ball:"8ball","8-ball":"8ball",eightball:"8ball","magic-8-ball":"8ball"}),F(["coin","d6","d20","8ball"])),la=E(e=>typeof e=="number"?String(e):e,f()),He=12;function da(e){return typeof e!="string"?e:e.trim()===""?{}:{glyph:e}}const ua=f().max(8).optional().transform(e=>{const n=e==null?void 0:e.trim();return n||void 0}),pa=E(da,g({glyph:ua,icon:f().optional(),tone:Oe.optional(),action:Ae.optional()})),ma=E(e=>Array.isArray(e)?e.slice(0,He).map(n=>Array.isArray(n)?n.slice(0,He):n):e,M(M(pa))),X={text:g({text:Z.optional()}).strict(),stat:g({value:Z.optional()}).strict(),progress:g({value:Z.optional(),label:Z.optional()}).strict(),table:g({rows:Z.optional()}).strict(),chart:g({data:Z.optional()}).strict()},ie=un(()=>E((e,n)=>{if(typeof e=="object"&&e!==null&&Object.hasOwn(e,"bind")){const s=e,a=typeof s.type=="string"&&Object.hasOwn(X,s.type)?X[s.type]:void 0;if(!a||!a.safeParse(s.bind).success)return n.addIssue({code:"custom",path:["bind"],message:"This element needs a supported display field and a safe state path."}),hn}return e},Te("type",[g({type:k("stack"),direction:Zs,gap:Js.optional(),children:M(ie)}),g({type:k("card"),title:f().optional(),description:f().optional(),children:M(ie),footer:M(ie).optional()}),g({type:k("divider")}),g({type:k("heading"),text:f(),level:sa.optional()}),g({type:k("text"),text:f(),bind:X.text.optional()}),g({type:k("badge"),text:f(),tone:Oe.optional()}),g({type:k("stat"),bind:X.stat.optional(),label:f(),value:ye([f(),Ee()]),delta:aa.optional(),hint:f().optional(),trend:M(ee().finite()).max(50).optional()}),g({type:k("keyValue"),items:M(g({key:f(),value:f()}))}),g({type:k("image"),src:f().refine(e=>e.startsWith("https://")||e.startsWith("data:"),{message:"Widget image sources must be https or data URIs"}),alt:f(),caption:f().optional()}),g({type:k("progress"),bind:X.progress.optional(),value:ee().finite().transform(e=>Math.min(100,Math.max(0,e))),label:f().optional()}),g({type:k("table"),bind:X.table.optional(),columns:M(g({key:f(),label:f(),align:F(["left","center","right"]).optional()})),rows:M(st(f(),Fe))}),g({type:k("list"),items:M(g({title:f(),subtitle:f().optional(),icon:f().optional(),image:f().refine(e=>e.startsWith("https://")||e.startsWith("data:"),{message:"Widget image sources must be https or data URIs"}).optional(),meta:f().optional(),badge:ra.optional(),actions:M(Ae).optional()}))}),g({type:k("chart"),bind:X.chart.optional(),kind:ta,data:M(g({label:f(),value:ee().finite().min(0)})),height:ee().finite().positive().optional()}),g({type:k("button"),label:f(),variant:ea.optional(),action:Ae}),g({type:k("input"),name:f().min(1),label:f().optional(),placeholder:f().optional(),kind:F(["text","number"]).optional(),required:he().optional()}),g({type:k("select"),required:he().optional(),name:f().min(1),label:f().optional(),options:M(g({label:f(),value:f()}))}),g({type:k("form"),children:M(ie),submit:g({label:f(),action:Be})}),g({type:k("timeline"),items:M(g({time:f().optional(),title:f(),subtitle:f().optional(),icon:f().optional(),status:ia.optional()})).min(1)}),g({type:k("checklist"),items:M(g({label:f(),checked:Ge.optional(),note:f().optional()})),action:Be.optional(),submitLabel:f().optional()}),g({type:k("compare"),options:M(g({name:f(),recommended:Ge.optional()})).min(1),rows:M(g({label:f(),values:M(Fe)}))}),g({type:k("rating"),value:ee().finite().transform(e=>Math.min(5,Math.max(0,e))),count:ee().int().nonnegative().optional(),label:f().optional()}),g({type:k("mood"),emotion:oa,message:f().optional()}),g({type:k("board"),rows:ma,label:f().optional()}),g({type:k("reveal"),kind:ca,result:la,label:f().optional()})]))),fa=g({version:k(1),title:f().optional(),root:ie});function Ie(e){return e.some(n=>gn(n,"widget.action"))}const ha=100,xa=3e4;function Gt(e){if(e!==null&&typeof e=="object"){for(const n of Object.values(e))Gt(n);Object.freeze(e)}return e}function ga(e,n){var S;const[s,a]=x.useState([]),r=x.useRef(new Map),i=x.useRef(e),o=x.useRef({documentId:e==null?void 0:e.documentId,owner:e==null?void 0:e.submissionOwner}),c=x.useRef(!0),p=x.useRef(0),u=x.useCallback(()=>{const l=++p.current,d=[...r.current.values()].map(v=>v.value);a(v=>p.current===l?d:v)},[]),m=x.useCallback(l=>{const d=l.operation;l.operation=void 0,d&&(d.active=!1,clearTimeout(d.timer),d.controller.abort())},[]),h=x.useCallback(l=>{l.retired=!0,l.start=void 0,++p.current,m(l)},[m]),j=x.useCallback(l=>c.current&&!l.retired&&r.current.get(l.value.event.id)===l,[]),w=x.useCallback(l=>{const d=i.current;return o.current.documentId===l.value.documentId&&o.current.owner===l.owner&&(d==null?void 0:d.documentId)===l.value.documentId&&(d==null?void 0:d.submissionOwner)===l.owner},[]),_=x.useCallback((l,d)=>{if(!j(l)||!w(l))return!1;const v=i.current;return!(l.host.current?l.host.current(d):v.enabled)||!j(l)||!w(l)?!1:l.original.current(d)&&j(l)&&w(l)},[j,w]);x.useLayoutEffect(()=>{const l={documentId:e==null?void 0:e.documentId,owner:e==null?void 0:e.submissionOwner};i.current=e,o.current=l;for(const d of r.current.values())w(d)||h(d)},[e,e==null?void 0:e.documentId,e==null?void 0:e.submissionOwner,w,h]),x.useEffect(()=>{c.current=!0;const l=r.current;return()=>{c.current=!1;for(const d of l.values())h(d)}},[h]);const b=x.useCallback((l,d)=>{l.value={...l.value,...d},u()},[u]);x.useEffect(()=>{var l;for(const d of r.current.values()){if(!j(d)||!w(d)||d.value.phase==="refused")continue;const v=d.start,T=d.operation;if(!_(d,"read")||d.start!==v||d.operation!==T)continue;const W=(l=e==null?void 0:e.snapshot)==null?void 0:l.receipts.find(R=>R.receipt.id===d.value.event.id);!_(d,"read")||d.start!==v||d.operation!==T||W&&W!==d.value.receipt&&(d.start=void 0,d.value={...d.value,phase:"accepted",receipt:W},m(d),u())}},[(S=e==null?void 0:e.snapshot)==null?void 0:S.receipts,e==null?void 0:e.submissionOwner,j,w,_,m,u]);const A=l=>[...r.current.values()].some(d=>d.value.controlId===l&&!d.retired&&["sending","retry","review"].includes(d.value.phase)),$=async(l,d=!1)=>{var ue;if(!j(l)||!w(l))return;const v=Object.freeze({});l.start=v,++p.current,m(l);const T=()=>j(l)&&w(l)&&l.start===v&&l.operation===void 0;if(!T())return;const W=_(l,d?"read":"submit");if(!T())return;if(!W){b(l,{phase:d?"retry":"refused",message:d?"Save not confirmed. Review the document before trying again.":"Document actions are unavailable. Review this action before trying again."});return}const R=new AbortController;if(!T()){R.abort();return}const z={token:Object.freeze({}),controller:R,active:!0};l.operation=z,l.start=void 0;const D=()=>j(l)&&w(l)&&l.operation===z&&z.active&&!R.signal.aborted,P=K=>D()?_(l,K)&&D():!1;if(z.timer=setTimeout(()=>{D()&&(z.active=!1,l.operation=void 0,l.uncertain=!0,b(l,{phase:"retry",message:"Save not confirmed. Check your network and try again."}),R.abort())},xa),!D()){clearTimeout(z.timer),R.abort();return}b(l,{phase:"sending",message:void 0});try{if(d)try{if(!P("read")){D()&&b(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}const B=await l.original.inspect(R.signal);if(!P("read")){D()&&b(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}b(l,{phase:"accepted",receipt:B});return}catch(B){if(!D()||!D())return;throw B}if(!P("submit")){D()&&b(l,{phase:"review",message:"Document approval changed. Review this action before trying again."});return}const K=[...((ue=i.current)==null?void 0:ue.approvedEventTypes)??[]],Y=!l.value.normalized||Ie(K);if(!D())return;if(!Y){b(l,{phase:"review",message:"Document approval changed. Review this action before trying again."});return}if(!P("submit"))return;l.uncertain=!0;const H=await l.original.submit(R.signal);if(!P("read")){D()&&b(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}b(l,{phase:"accepted",receipt:H})}catch(K){if(!D())return;const Y=K.status;if(!D())return;const H=Y!==void 0&&[400,401,403,404,409,413,422].includes(Y),B=!d&&H;l.uncertain=d||!B,b(l,{phase:B?"refused":H?"review":"retry",message:B?"This action could not be saved. Review the document before trying again.":H?"Save not confirmed. Review this action before trying again.":"Save not confirmed. Check your network and try again."})}finally{l.operation===z&&(l.operation=void 0,z.active=!1,clearTimeout(z.timer),R.abort())}};return{dispatch:async(l,d)=>{var Y;const v=i.current;if(!(v!=null&&v.enabled)||A(d))return;const T=l.kind==="agent";if(T&&!Ie(v.approvedEventTypes)||l.kind!=="emit"&&!T)return;const W=xn.parse({v:1,id:crypto.randomUUID(),type:T?"widget.action":l.type,payload:T?{actionId:l.id,payload:l.payload??{},widget:{documentId:v.documentId,nodeId:d,...n?{title:n}:{}}}:{...l.payload??{},widget:{documentId:v.documentId,nodeId:d,...n?{title:n}:{}}},...!T&&l.coalesceKey?{coalesceKey:l.coalesceKey}:{}}),R=JSON.stringify(W),z=v.documentId,D=v.submissionOwner,P=(Y=v.captureOriginal)==null?void 0:Y.call(v,W);if(!P||P.id!==W.id||P.bytes!==R||!c.current||i.current!==v||v.documentId!==z||v.submissionOwner!==D||!P.current("submit")||!c.current||i.current!==v||v.documentId!==z||v.submissionOwner!==D)return;const ue={...v.current?{current:v.current.bind(v)}:{}};if(!c.current||i.current!==v||A(d))return;if(r.current.size>=ha){const H=[...r.current.values()].find(B=>{var Pe;return B.value.phase==="refused"||B.value.phase==="accepted"&&((Pe=B.value.receipt)==null?void 0:Pe.deliveries.every(cn=>["handled","rejected","turn_done","expired","failed","cancelled","superseded","unavailable"].includes(cn.status)))});if(!H)throw new Error("Too many actions are waiting. Try again after they finish.");if(r.current.delete(H.value.event.id),h(H),!c.current||i.current!==v||A(d))return}const K={host:ue,owner:v.submissionOwner,original:P,retired:!1,uncertain:!1,value:{controlId:d,documentId:v.documentId,normalized:T,event:Gt(JSON.parse(R)),phase:"sending"}};r.current.set(W.id,K),u(),await $(K)},pending:A,records:s,retry:l=>{const d=r.current.get(l);return d&&d.uncertain&&(d.value.phase==="retry"||d.value.phase==="sending")?$(d,!0):Promise.resolve()}}}const Ht=x.createContext("root"),ya=Ht.Provider;function Q(){return x.useContext(Ht)}function Kt(e){return e.id+":"+JSON.stringify(e.payload??null)}const Ke=()=>Promise.resolve(),Yt=x.createContext({onAction:Ke,hasSession:!1,channelRecords:[],channelPending:()=>!1,retryChannel:Ke,superseded:!1,latched:!1,dispatchedActionKey:null,dispatchStatus:"idle"});function ba({children:e,channel:n,sessionId:s,widgetTitle:a,isLatestMessage:r=!0}){const{setTheme:i}=yn(),o=bn(),c=ga(n,a),[p,u]=x.useState(null),[m,h]=x.useState(null),j=x.useRef(!1),w=x.useCallback(async(b,A)=>{if(b.kind==="emit"||n&&b.kind==="agent"){await c.dispatch(b,(A==null?void 0:A.controlId)??"root");return}switch(b.kind){case"ui":{if(!s&&!at(b.command))return;const $={getStore:jn.getState,setTheme:i,supportsTerminal:o.supportsTerminal,celebrationOrigin:A==null?void 0:A.origin,sessionId:s};kn($,b.command,"user");return}case"url":u(b.href);return;case"agent":{if(!s||j.current)return;j.current=!0;const $={actionId:b.id,payload:b.payload,widgetTitle:a},C=Ne.getState();C.setOptimisticUserMessage(s,{id:crypto.randomUUID(),content:Vs($)}),C.setTriggerPending(s,!0);const S=Kt(b);h({key:S,status:"pending"});try{await o.sendUiAction(s,$),h({key:S,status:"sent"}),setTimeout(()=>{var d;const l=Ne.getState().getSession(s);l.triggerPending&&((d=l.status)==null?void 0:d.lifecycle)!=="streaming"&&Ne.getState().setTriggerPending(s,!1)},vn.TRIGGER_PENDING_TIMEOUT_MS)}catch(l){throw j.current=!1,C.setOptimisticUserMessage(s,null),C.setTriggerPending(s,!1),h(null),l}return}}},[i,o,s,a,n,c]),_=x.useMemo(()=>({onAction:w,channel:n,channelRecords:c.records,channelPending:c.pending,retryChannel:c.retry,hasSession:!!s,superseded:!r,latched:m!==null,dispatchedActionKey:(m==null?void 0:m.key)??null,dispatchStatus:(m==null?void 0:m.status)??"idle"}),[w,s,r,m,n,c]);return t.jsxs(Yt.Provider,{value:_,children:[e,t.jsx(Nn,{url:p??"",isOpen:p!==null,onClose:()=>u(null),onConfirm:()=>{p&&wn(p),u(null)}})]})}function le(){return x.useContext(Yt)}function Vt(e,n){var C;const s=Q(),a=le();if(e.kind==="emit"||e.kind==="agent"&&a.channel!==void 0){const S=!((C=a.channel)!=null&&C.enabled)||e.kind==="agent"&&!Ie(a.channel.approvedEventTypes),l=a.channelPending(n??s);return{isAgent:!1,unavailable:S,superseded:!1,latched:!1,isDispatched:l,dispatchStatus:l?"pending":"idle",interactive:!S&&!l}}const{hasSession:i,superseded:o,latched:c,dispatchedActionKey:p,dispatchStatus:u}=a,m=e.kind==="agent",h=e.kind==="agent"?Kt(e):null,j=h!==null&&h===p,_=(m||e.kind==="ui"&&!at(e.command))&&!i,b=m&&o;return{isAgent:m,unavailable:_,superseded:b,latched:m&&c&&!j,isDispatched:j,dispatchStatus:j?u:"idle",interactive:m?!_&&!b&&!c:!_}}const U=Sn.snap,ae=[.22,1,.36,1],Re=.05,ze=.9,de={hidden:{opacity:0,y:6,scale:.985},visible:{opacity:1,y:0,scale:1,transition:U}},ve={hidden:{},visible:{transition:{staggerChildren:Re}}};function L(){return!Cn()}function qt(e,n,s=ze*1e3){const[a,r]=x.useState(()=>n?0:e),i=x.useRef(n?0:e);return x.useEffect(()=>{if(!n){i.current=e;return}const o=fs(i.current,e,{duration:s/1e3,ease:ae,onUpdate:c=>{i.current=c,r(c)}});return()=>o.stop()},[e,n,s]),n?a:e}const Qt=new Set(["__proto__","prototype","constructor"]),va={text:["text"],stat:["value"],progress:["value","label"],table:["rows"],chart:["data"]},ja=100,Ye=50,ka=16384;function ne(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function V(e,n){const s=Object.getOwnPropertyDescriptor(e,n);if(!s||!("value"in s))throw new Error("missing");return s.value}function Na(e,n){if(!ne(e)||!_n.safeParse(n).success)throw new Error("path");let s=e;if(n==="")return s;for(const a of n.slice(1).split("/")){const r=a.replaceAll("~1","/").replaceAll("~0","~");if(Qt.has(r))throw new Error("path");if(Array.isArray(s)){if(!/^(0|[1-9]\d*)$/u.test(r)||Number(r)>=s.length)throw new Error("index")}else if(!ne(s))throw new Error("object");s=V(s,r)}return s}function oe(e,n=ka){return typeof e=="string"&&e.length<=n}function fe(e){return typeof e=="number"&&Number.isFinite(e)}function wa(e){return e===null||typeof e=="boolean"||fe(e)||oe(e)}function Sa(e,n,s){if(e.type==="text"&&n==="text"&&oe(s)||e.type==="stat"&&n==="value"&&(oe(s,1024)||fe(s))||e.type==="progress"&&(n==="label"&&oe(s,1024)||n==="value"&&fe(s)&&s>=0&&s<=100))return s;if(!Array.isArray(s)||s.length>ja)throw new Error("type");if(e.type==="table"&&n==="rows"){if(e.columns.length>Ye)throw new Error("columns");const a=new Set(e.columns.map(r=>r.key));return Array.from({length:s.length},(r,i)=>{const o=V(s,String(i));if(!ne(o))throw new Error("row");const c=Object.keys(o);if(c.length>Ye)throw new Error("columns");const p=Object.create(null);for(const u of c){if(Qt.has(u)||!a.has(u))throw new Error("column");const m=V(o,u);if(!wa(m))throw new Error("cell");p[u]=m}return p})}if(e.type==="chart"&&n==="data")return Array.from({length:s.length},(a,r)=>{const i=V(s,String(r));if(!ne(i)||Object.keys(i).some(p=>p!=="label"&&p!=="value"))throw new Error("point");const o=V(i,"label"),c=V(i,"value");if(!oe(o,1024)||!fe(c)||c<0)throw new Error("point");return{label:o,value:c}});throw new Error("type")}function Ca(e,n){if(!("bind"in e)||e.bind===void 0)return{node:e};const s=va[e.type],a=e.bind;if(!s||!ne(a))return{error:"This element has an unsupported state binding."};const r=Object.keys(a);if(r.length===0)return{node:e};const i={};for(const o of r)try{if(!s.includes(o))throw new Error("field");const c=V(a,o);if(!ne(c)||Object.keys(c).length!==1||!Object.hasOwn(c,"path"))throw new Error("binding");const p=V(c,"path");if(typeof p!="string")throw new Error("path");const u=Sa(e,o,Na(n,p));if(new TextEncoder().encode(JSON.stringify(u)).byteLength>65536)throw new Error("size");i[o]=u}catch{return{error:`Cannot show ${o}: its state value is missing or has the wrong type.`}}return{node:{...e,...i}}}const Xt=x.createContext(null),_a=Xt.Provider;function Jt(){return x.useContext(Xt)}const Aa={default:"bg-secondary text-secondary-foreground border-transparent",success:"bg-status-success-bg text-status-success-fg border-status-success-border",warning:"bg-status-warning-bg text-status-warning-fg border-status-warning-border",error:"bg-status-error-bg text-status-error-fg border-status-error-border",info:"bg-status-info-bg text-status-info-fg border-status-info-border"};function je(e){return Aa[e??"default"]}function Ia(e){var c;if(typeof e=="number")return Number.isFinite(e)?{prefix:"",suffix:"",decimals:0,grouped:!1,value:e}:null;const n=e.match(/^(.*?)(-?\d[\d,]*(?:\.\d+)?)(.*)$/s);if(!n)return null;const[,s,a,r]=n,i=Number(a.replace(/,/g,""));if(!Number.isFinite(i))return null;const o=a.includes(".")?((c=a.split(".")[1])==null?void 0:c.length)??0:0;return{prefix:s,suffix:r,decimals:o,grouped:a.includes(","),value:i}}function Ma(e,n){const s=n.toFixed(e.decimals),a=e.grouped?Number(s).toLocaleString("en-US",{minimumFractionDigits:e.decimals,maximumFractionDigits:e.decimals}):s;return`${e.prefix}${a}${e.suffix}`}const $a={1:"text-lg font-semibold",2:"text-base font-semibold",3:"text-sm font-semibold"};function Ta({node:e}){const n=e.level??3,s=N($a[n],"text-foreground");return n===1?t.jsx("h1",{className:s,children:e.text}):n===2?t.jsx("h2",{className:s,children:e.text}):t.jsx("h3",{className:s,children:e.text})}function Ea({node:e}){return t.jsx(gs,{content:e.text,className:"text-sm"})}function La({node:e}){const n=L();return t.jsx(y.span,{className:N("inline-flex w-fit items-center rounded-md border px-2 py-0.5 text-xs font-medium",je(e.tone)),initial:n?{opacity:0,scale:.8}:!1,animate:n?{opacity:1,scale:1}:!1,transition:U,children:e.text})}function Da(){return t.jsx($n,{})}const Oa={up:Mn,down:In,flat:rt},Ra={up:"text-status-success",down:"text-status-error",flat:"text-muted-foreground"};function za({node:e}){const n=L(),s=Ia(e.value),a=qt((s==null?void 0:s.value)??0,n&&s!==null),r=s?Ma(s,a):String(e.value),i=e.delta?Oa[e.delta.direction]:null;return t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:e.label}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"text-foreground text-2xl font-semibold tabular-nums",children:r}),e.delta&&i&&t.jsxs(y.span,{className:N("inline-flex items-center gap-0.5 text-xs font-medium",Ra[e.delta.direction]),initial:n?{opacity:0,x:-4}:!1,animate:n?{opacity:1,x:0}:!1,transition:{...U,delay:.25},children:[t.jsx(i,{className:"size-3","aria-hidden":!0}),e.delta.value]})]}),e.trend&&e.trend.length>=2&&t.jsx(Wa,{values:e.trend})]}),e.hint&&t.jsx("span",{className:"text-muted-foreground text-xs",children:e.hint})]})}function Wa({values:e}){const n=L(),s=`spark-wipe-${x.useId().replace(/:/g,"")}`,a=Math.min(...e),r=Math.max(...e),i=r-a||1,o=e.map((c,p)=>{const u=p/(e.length-1)*100,m=r===a?50:100-(c-a)/i*100;return`${u},${m}`}).join(" ");return t.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"h-5 w-16 shrink-0 overflow-visible","aria-hidden":!0,children:[n&&t.jsx("defs",{children:t.jsx("clipPath",{id:s,children:t.jsx(y.rect,{x:-4,y:-12,height:124,initial:{width:0},animate:{width:108},transition:{duration:ze,ease:ae}})})}),t.jsx("g",{clipPath:n?`url(#${s})`:void 0,children:t.jsx("polyline",{points:o,fill:"none",stroke:"hsl(var(--chart-1))",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})})]})}function Pa({node:e}){return t.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm",children:e.items.map((n,s)=>t.jsxs("div",{className:"contents",children:[t.jsx("dt",{className:"text-muted-foreground",children:n.key}),t.jsx("dd",{className:"text-foreground text-right break-words",children:n.value})]},`${n.key}-${s}`))})}function Ba({node:e}){const n=L(),s=qt(e.value,n);return t.jsxs("div",{className:"flex flex-col gap-1",children:[(e.label||e.label==="")&&t.jsxs("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[t.jsx("span",{children:e.label}),t.jsxs("span",{className:"tabular-nums",children:[Math.round(s),"%"]})]}),t.jsx(hs,{value:s})]})}function Fa({node:e}){return t.jsxs("figure",{className:"flex flex-col gap-1",children:[t.jsx(An,{image:{src:e.src,alt:e.alt},className:"block w-full",children:t.jsx("img",{src:e.src,alt:e.alt,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"})}),e.caption&&t.jsx("figcaption",{className:"text-muted-foreground text-xs",children:e.caption})]})}const Ua=y.create(yt),Ga=y.create(be),Ve={left:"text-left",center:"text-center",right:"text-right"};function Ha(e){return e===null?"—":typeof e=="boolean"?e?"Yes":"No":String(e)}function Ka({node:e}){const n=L();return t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(xt,{children:[t.jsx(gt,{children:t.jsx(be,{children:e.columns.map(s=>t.jsx(Ce,{className:N(s.align&&Ve[s.align]),children:s.label},s.key))})}),t.jsx(Ua,{variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.rows.map((s,a)=>t.jsx(Ga,{variants:n?de:void 0,children:e.columns.map(r=>t.jsx(_e,{className:N("tabular-nums",r.align&&Ve[r.align]),children:Ha(s[r.key]??null)},r.key))},a))})]})})}const Ya={"alert-circle":Xn,"alert-triangle":ot,archive:Qn,"arrow-right":rt,bell:qn,bookmark:ws,calendar:Vn,check:Le,"check-circle":Ss,circle:Se,clock:Yn,cloud:Cs,code:_s,cog:As,database:Ms,file:Ns,"file-text":ks,flag:zs,folder:Kn,"git-branch":js,globe:Hn,heart:vs,home:Ws,info:Gn,link:Un,lock:Fn,mail:Bn,"map-pin":Ps,"message-square":Pn,package:bs,play:Wn,rocket:Bs,search:zn,server:xs,settings:Rn,star:it,tag:Fs,terminal:On,"thumbs-up":Dn,trash:Ln,"trending-down":Us,"trending-up":Gs,user:En,users:Tn,zap:ys};function We(e){if(!e)return Se;const n=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();return Ya[n]??Se}function Va(e,n){var a;if(e.phase==="sending")return"Saving…";if(e.phase!=="accepted")return e.message??"This action could not be saved.";const s=((a=e.receipt)==null?void 0:a.deliveries)??[];return s.length?s.map(r=>{if(r.ackOutcome==="handled"||r.status==="handled")return`${n} reported that it handled this action.`;if(r.ackOutcome==="rejected"||r.status==="rejected")return`${n} could not handle this action.`;switch(r.status){case"turn_started":return`${n} started working.`;case"turn_done":return`${n} finished. Handling is not confirmed yet.`;case"in_doubt":return"Saved; outcome unknown. Review before replaying.";case"failed":return"Saved; the agent request failed.";case"expired":return"Saved; expired before the agent started.";case"superseded":return"Saved; replaced by a newer change.";case"cancelled":return"Saved; the agent request was cancelled.";case"unavailable":return"Saved; the destination is not available.";default:return`Saved; waiting for ${n}.`}}).join(" "):"Saved to the document."}function Zt({controlId:e,descendants:n=!1}){const{channel:s,channelRecords:a,retryChannel:r}=le();if(!s)return null;const i=a.filter(o=>o.controlId===e||n&&o.controlId.startsWith(`${e}.`));return i.length?t.jsx("ul",{className:"text-muted-foreground mt-2 flex max-h-32 flex-col gap-1.5 overflow-y-auto text-xs","aria-live":"polite","aria-relevant":"additions text","data-testid":"widget-action-statuses",children:i.map((o,c)=>t.jsxs("li",{"data-testid":"widget-action-status","data-event-id":o.event.id,className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{children:[i.length>1?`Action ${c+1}: `:"",Va(o,s.destinationLabel)]}),o.phase==="retry"&&t.jsx(ct,{size:"sm",variant:"ghost",onClick:()=>void r(o.event.id),"data-testid":"widget-action-retry",children:"Try again"})]},o.event.id))}):null}function ke({action:e,label:n,variant:s,fullWidth:a,controlId:r,submit:i}){const{onAction:o,channel:c}=le(),p=Q(),u=r??p,m=e.kind==="emit"||e.kind==="agent"&&c!==void 0,h=Vt(e,u),j=L(),w=h.isDispatched&&h.dispatchStatus==="pending",_=h.isDispatched&&h.dispatchStatus==="sent",b=!h.interactive,A=j&&h.interactive,$=l=>{var T;if(b){l.preventDefault();return}if(i&&!((T=l.currentTarget.form)!=null&&T.reportValidity())){l.preventDefault();return}const d=mt(l.currentTarget.getBoundingClientRect()),v=o(e,{origin:d,controlId:u});e.kind!=="agent"&&e.kind!=="emit"||v.catch(()=>{ft.error(m?"This action could not be saved.":"Couldn’t send the action",{description:m?"Check the action size and document permissions, then try again.":"Your agent may be busy. Try again."})})};let C=null;h.superseded?C="This one’s from an earlier message.":h.unavailable?C=m?e.kind==="agent"&&(c!=null&&c.enabled)?"This action needs an approved document route.":"Document actions are not available here.":"Interactions aren’t available here":h.latched&&(C="Sent. Waiting for the agent’s reply");const S=t.jsxs(ct,{type:i?"submit":"button","data-testid":m?"widget-channel-action":void 0,size:"sm",variant:s??"default","aria-disabled":b||void 0,disabled:w,onClick:b?void 0:$,className:N(a&&"w-full",b&&"cursor-default",(h.unavailable||h.superseded)&&"opacity-50",_&&"opacity-70"),children:[w&&t.jsx(as,{size:"xs"}),_&&t.jsx(Le,{className:"size-(--size-icon-xs)","aria-hidden":!0}),n]});return m?t.jsxs("div",{className:N(a&&"w-full"),children:[t.jsx("div",{className:"text-muted-foreground mb-1 text-xs",children:c!=null&&c.destinationLabel?`To ${c.destinationLabel}`:"Document action"}),S,C&&t.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:C}),t.jsx(Zt,{controlId:u})]}):C?t.jsx(lt,{children:t.jsxs(dt,{children:[t.jsx(ut,{asChild:!0,children:S}),t.jsx(pt,{children:C})]})}):!A&&!m?S:t.jsx(y.div,{className:N("inline-flex",a&&"w-full"),whileHover:{scale:1.02},transition:U,children:S})}function qa({node:e}){return t.jsx(ke,{action:e.action,label:e.label,variant:e.variant})}function Qa({node:e}){const n=Jt(),s=x.useId(),[a,r]=x.useState(!1),[i,o]=x.useState(""),c=n?n.values[e.name]??"":i,p=u=>n?n.setValue(e.name,u):o(u);return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.label&&t.jsx(De,{htmlFor:s,children:e.label}),t.jsx(ss,{id:s,name:e.name,type:e.kind==="number"?"number":"text",required:e.required,"aria-label":e.label??e.name,placeholder:e.placeholder,value:c,"aria-invalid":a||void 0,"aria-describedby":a?`${s}-error`:void 0,onInvalid:u=>{u.preventDefault(),r(!0),u.currentTarget.focus()},onChange:u=>{r(!1),p(u.target.value)}}),a&&t.jsxs("p",{id:`${s}-error`,className:"text-destructive text-xs",role:"alert",children:["Enter ",e.label??e.name,"."]})]})}function Xa({node:e}){const n=x.useRef(null),s=Jt(),a=x.useId(),[r,i]=x.useState(!1),[o,c]=x.useState(""),p=s?s.values[e.name]??"":o,u=m=>s?s.setValue(e.name,m):c(m);return t.jsxs("div",{className:"flex flex-col gap-1.5",onInvalidCapture:m=>{var h;m.preventDefault(),i(!0),(h=n.current)==null||h.focus()},children:[e.label&&t.jsx(De,{htmlFor:a,children:e.label}),t.jsxs(Jn,{name:e.name,required:e.required,value:p||void 0,onValueChange:m=>{i(!1),u(m)},children:[t.jsx(Zn,{ref:n,"aria-invalid":r||void 0,"aria-describedby":r?`${a}-error`:void 0,id:a,"aria-label":e.label??e.name,children:t.jsx(es,{placeholder:"Select…"})}),t.jsx(ts,{children:e.options.map(m=>t.jsx(ns,{value:m.value,children:m.label},m.value))})]}),r&&t.jsxs("p",{id:`${a}-error`,className:"text-destructive text-xs",role:"alert",children:["Choose ",e.label??e.name,"."]})]})}function Ja({node:e}){const n=L(),s=Q();return t.jsx(y.ul,{className:"divide-border divide-y",variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.items.map((a,r)=>{const i=We(a.icon);return t.jsxs(y.li,{className:"hover:bg-muted/40 -mx-2 flex items-center gap-3 rounded-md px-2 py-2 transition-colors first:pt-0 last:pb-0",variants:n?de:void 0,children:[a.image&&t.jsx("img",{src:a.image,alt:"",className:"size-10 shrink-0 rounded-md border object-cover",loading:"lazy"}),a.icon&&t.jsx(i,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-foreground truncate text-sm font-medium",children:a.title}),a.subtitle&&t.jsx("p",{className:"text-muted-foreground truncate text-xs",children:a.subtitle})]}),a.meta&&t.jsx("span",{className:"text-muted-foreground shrink-0 text-sm tabular-nums",children:a.meta}),a.badge&&t.jsx("span",{className:N("inline-flex shrink-0 items-center rounded-md border px-2 py-0.5 text-xs font-medium",je(a.badge.tone)),children:a.badge.text}),a.actions&&a.actions.length>0&&t.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:a.actions.map((o,c)=>t.jsx(ke,{action:o,controlId:`${s}.items.${r}.actions.${c}`,label:o.kind==="agent"?o.label??"Action":o.kind==="emit"?"Send":Za(o)},c))})]},r)})})}function Za(e){return e.kind==="url"?"Open":"Run"}const J=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],er=180,tr=.15;function nr({node:e}){const n=e.height??er,s=`${e.kind} chart`;return e.data.length===0?t.jsx("p",{className:"text-muted-foreground text-xs",children:"No data to chart."}):e.kind==="bar"?t.jsx(ar,{data:e.data,height:n,label:s}):e.kind==="pie"?t.jsx(or,{data:e.data,height:n,label:s}):t.jsx(rr,{data:e.data,height:n,area:e.kind==="area",label:s})}const sr=18;function ar({data:e,height:n,label:s}){const a=L(),r=Math.max(...e.map(o=>o.value),0)||1,i=Math.max(0,n-sr);return t.jsxs("div",{role:"img","aria-label":s,className:"flex flex-col gap-1",children:[t.jsx("div",{className:"flex items-end gap-2",style:{height:n},children:e.map((o,c)=>t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-center justify-end gap-1",children:[t.jsx("span",{className:"text-muted-foreground text-2xs tabular-nums",children:o.value}),t.jsx(y.div,{className:"w-full origin-bottom rounded-t-sm",style:{height:o.value/r*i,backgroundColor:J[c%J.length]},initial:a?{scaleY:0}:!1,animate:a?{scaleY:1}:!1,transition:{...U,delay:c*Re}})]},c))}),t.jsx(en,{data:e})]})}function rr({data:e,height:n,area:s,label:a}){const r=Math.max(...e.map(j=>j.value),0)||1,i=e.length,c=e.map((j,w)=>{const _=i===1?50:w/(i-1)*100,b=100-j.value/r*100;return{x:_,y:b}}).map(j=>`${j.x},${j.y}`).join(" "),p=`0,100 ${c} 100,100`,u=J[0],m=L(),h=`chart-wipe-${x.useId().replace(/:/g,"")}`;return t.jsxs("div",{role:"img","aria-label":a,className:"flex flex-col gap-1",children:[t.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",style:{height:n},className:"w-full overflow-visible",children:[m&&t.jsx("defs",{children:t.jsx("clipPath",{id:h,children:t.jsx(y.rect,{x:-4,y:-12,height:124,initial:{width:0},animate:{width:108},transition:{duration:ze,ease:ae}})})}),t.jsxs("g",{clipPath:m?`url(#${h})`:void 0,children:[s&&t.jsx("polygon",{points:p,fill:u,opacity:tr}),t.jsx("polyline",{points:c,fill:"none",stroke:u,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})]})]}),t.jsx(en,{data:e})]})}const ir=359.99;function or({data:e,height:n,label:s}){const a=L(),r=e.reduce((o,c)=>o+c.value,0)||1,i=e.map((o,c)=>{const u=-90+e.slice(0,c).reduce((j,w)=>j+w.value,0)/r*360,m=o.value/r*360,h=m>=ir;return{d:o,full:h,path:h?"":cr(u,u+m)}});return t.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[t.jsx("svg",{viewBox:"0 0 100 100",role:"img","aria-label":s,style:{height:n,width:n},children:i.map((o,c)=>{const p=J[c%J.length],u={initial:a?{opacity:0,scale:.6}:!1,animate:a?{opacity:1,scale:1}:!1,transition:{...U,delay:c*Re},style:{transformOrigin:"50px 50px"}};return o.full?t.jsx(y.circle,{cx:50,cy:50,r:50,fill:p,...u},c):t.jsx(y.path,{d:o.path,fill:p,...u},c)})}),t.jsx("ul",{className:"flex flex-col gap-1 text-xs",children:e.map((o,c)=>t.jsxs("li",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"size-2.5 shrink-0 rounded-sm",style:{backgroundColor:J[c%J.length]},"aria-hidden":!0}),t.jsx("span",{className:"text-foreground",children:o.label}),t.jsx("span",{className:"text-muted-foreground tabular-nums",children:o.value})]},c))})]})}function en({data:e}){return t.jsx("div",{className:"flex gap-2",children:e.map((n,s)=>t.jsx("span",{className:N("text-muted-foreground text-2xs min-w-0 flex-1 truncate text-center"),title:n.label,children:n.label},s))})}function cr(e,n){const i=qe(50,50,50,e),o=qe(50,50,50,n),c=n-e>180?1:0;return`M 50 50 L ${i.x} ${i.y} A 50 50 0 ${c} 1 ${o.x} ${o.y} Z`}function qe(e,n,s,a){const r=a*Math.PI/180;return{x:e+s*Math.cos(r),y:n+s*Math.sin(r)}}const lr={done:"border-status-success bg-status-success text-white dark:text-status-success-bg",active:"border-primary bg-primary text-primary-foreground",upcoming:"border-border bg-background text-muted-foreground"};function dr({node:e}){const n=L();return t.jsx(y.ol,{className:"flex flex-col",variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.items.map((s,a)=>{const r=s.status??"upcoming",i=a===e.items.length-1,o=s.icon?We(s.icon):null;return t.jsxs(y.li,{className:"flex gap-3",variants:n?de:void 0,children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsxs("span",{className:"relative flex size-5 shrink-0 items-center justify-center",children:[r==="active"&&n&&t.jsx(y.span,{className:"border-primary absolute inset-0 rounded-full border",initial:{opacity:.6,scale:1},animate:{opacity:0,scale:1.8},transition:{duration:1.6,repeat:1/0,ease:"easeOut"},"aria-hidden":!0}),t.jsx("span",{className:N("flex size-3 items-center justify-center rounded-full border",lr[r],r==="active"&&"ring-primary/30 ring-2"),children:o&&t.jsx(o,{className:"size-2.5","aria-hidden":!0})})]}),!i&&t.jsx("span",{className:"bg-border w-px flex-1","aria-hidden":!0})]}),t.jsxs("div",{className:N("min-w-0 flex-1",!i&&"pb-4"),children:[s.time&&t.jsx("p",{className:"text-muted-foreground text-xs tabular-nums",children:s.time}),t.jsx("p",{className:N("text-foreground text-sm",r==="active"?"font-semibold":"font-medium"),children:s.title}),s.subtitle&&t.jsx("p",{className:"text-muted-foreground text-xs",children:s.subtitle})]})]},a)})})}function ur({node:e}){const n=x.useId(),[s,a]=x.useState(()=>e.items.map(i=>i.checked??!1)),r=x.useMemo(()=>{if(!e.action)return null;const i=e.items.filter((p,u)=>s[u]).map(p=>p.label),o=e.items.filter((p,u)=>!s[u]).map(p=>p.label),c={checked:i,unchecked:o};return e.action.kind==="emit"?{...e.action,payload:{...e.action.payload??{},...c}}:{...e.action,payload:{...e.action.payload??{},...c}}},[e.action,e.items,s]);return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("ul",{className:"flex flex-col gap-2",children:e.items.map((i,o)=>{const c=`${n}-${o}`;return t.jsxs("li",{className:"flex items-start gap-2.5",children:[t.jsx(rs,{id:c,checked:s[o],onCheckedChange:p=>a(u=>u.map((m,h)=>h===o?p===!0:m)),className:"mt-0.5"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx(De,{htmlFor:c,className:N("text-sm font-normal transition-colors",s[o]&&"text-muted-foreground line-through"),children:i.label}),i.note&&t.jsx("p",{className:"text-muted-foreground text-xs",children:i.note})]})]},o)})}),r&&t.jsx(ke,{action:r,label:e.submitLabel??"Send",fullWidth:!0})]})}const pr=y.create(yt),mr=y.create(be);function fr({value:e}){return e==null?t.jsx("span",{className:"text-muted-foreground",children:"—"}):typeof e=="boolean"?e?t.jsx(Le,{className:"text-status-success mx-auto size-4","aria-label":"Yes"}):t.jsx(is,{className:"text-muted-foreground mx-auto size-4","aria-label":"No"}):t.jsx("span",{className:"tabular-nums",children:String(e)})}function hr({node:e}){const n=L();return t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(xt,{children:[t.jsx(gt,{children:t.jsxs(be,{children:[t.jsx(Ce,{}),e.options.map((s,a)=>t.jsxs(Ce,{className:N("text-center",s.recommended&&"bg-primary/5"),children:[t.jsx("span",{className:"text-foreground font-medium",children:s.name}),s.recommended&&t.jsx("span",{className:N("text-2xs mt-1 flex w-fit items-center justify-center rounded-md border px-1.5 py-0.5 font-medium","mx-auto",je("success")),children:"Recommended"})]},a))]})}),t.jsx(pr,{variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.rows.map((s,a)=>t.jsxs(mr,{variants:n?de:void 0,children:[t.jsx(_e,{className:"text-muted-foreground font-medium",children:s.label}),e.options.map((r,i)=>t.jsx(_e,{className:N("text-center",r.recommended&&"bg-primary/5"),children:t.jsx(fr,{value:s.values[i]??null})},i))]},a))})]})})}const Me=5,xr=Array.from({length:Me});function Qe({className:e}){return t.jsx("div",{className:"flex","aria-hidden":!0,children:xr.map((n,s)=>t.jsx(it,{className:N("size-4",e)},s))})}function gr({node:e}){const n=L(),s=e.value/Me*100;return t.jsxs(y.div,{className:"flex items-center gap-2",initial:n?{opacity:0,y:4}:!1,animate:n?{opacity:1,y:0}:!1,transition:U,children:[t.jsxs("div",{className:"relative w-fit",role:"img","aria-label":`Rated ${e.value.toFixed(1)} out of ${Me}`,children:[t.jsx(Qe,{className:"text-muted-foreground"}),t.jsx("div",{className:"absolute inset-y-0 left-0 overflow-hidden",style:{width:`${s}%`},children:t.jsx(Qe,{className:"fill-status-warning text-status-warning"})})]}),t.jsx("span",{className:"text-foreground text-sm font-medium tabular-nums",children:e.value.toFixed(1)}),e.count!==void 0&&t.jsxs("span",{className:"text-muted-foreground text-sm tabular-nums",children:["(",e.count.toLocaleString(),")"]}),e.label&&t.jsx("span",{className:"text-muted-foreground text-sm",children:e.label})]})}const yr=7.4,br=[1,.1,1,1,.1,1,.1,1,1],vr=[0,.02,.045,.52,.54,.565,.585,.61,1];function G({cx:e,cy:n,r:s=3,openness:a=1,active:r=!0,popIn:i=!1,motionOn:o}){const c=o&&r,p=a;return t.jsx(y.circle,{cx:e,cy:n,r:s,fill:"currentColor",style:{transformOrigin:`${e}px ${n}px`,scaleY:o?void 0:p},initial:o&&i?{scale:.2}:void 0,animate:o?{scale:1,...c?{scaleY:br.map(u=>u*p)}:{scaleY:p}}:void 0,transition:o?{scale:{type:"spring",stiffness:500,damping:15},...c?{scaleY:{duration:yr,times:vr,repeat:1/0,ease:"easeInOut"}}:{}}:void 0})}function Xe({cx:e,cy:n}){return t.jsx("path",{d:`M ${e-4.5} ${n+1.5} Q ${e} ${n-4.5} ${e+4.5} ${n+1.5}`,fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})}function Je({cx:e,cy:n,motionOn:s,pulseDuration:a,delay:r=0,wobble:i=3}){const o=`M ${e} ${n+4} C ${e-8} ${n-2}, ${e-4} ${n-8}, ${e} ${n-4} C ${e+4} ${n-8}, ${e+8} ${n-2}, ${e} ${n+4} Z`;return t.jsx(y.path,{d:o,fill:"currentColor",className:"text-status-error",style:{transformOrigin:`${e}px ${n}px`},animate:s?{scale:[1,1.16,1],rotate:[-i,i,-i]}:void 0,transition:s?{scale:{duration:a,repeat:1/0,ease:"easeInOut",delay:r},rotate:{duration:a*2.1,repeat:1/0,ease:"easeInOut",delay:r}}:void 0})}function O({d:e}){return t.jsx("path",{d:e,fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})}function se({cx:e,cy:n,opacity:s=.3}){return t.jsx("ellipse",{cx:e,cy:n,rx:3.6,ry:2.1,className:"text-status-error",fill:"currentColor",fillOpacity:s})}const Ze="M 0 -3.2 C 2.2 -0.6, 2.6 1.4, 0 3.2 C -2.6 1.4, -2.2 -0.6, 0 -3.2 Z";function tn({x:e,y:n,motionOn:s,duration:a,repeatDelay:r}){return s?t.jsx(y.g,{style:{x:e,y:n},animate:{y:[n,n+2,n+9,n+11],opacity:[0,.85,.85,0],scale:[.5,1,1,.85]},transition:{duration:a,times:[0,.3,.85,1],repeat:1/0,repeatDelay:r,ease:"easeIn"},children:t.jsx("path",{d:Ze,className:"text-status-info",fill:"currentColor"})}):t.jsx("g",{transform:`translate(${e} ${n+4})`,opacity:.5,children:t.jsx("path",{d:Ze,className:"text-status-info",fill:"currentColor"})})}function jr({motionOn:e}){return t.jsx(tn,{x:47,y:13,motionOn:e,duration:3.4,repeatDelay:2.6})}function kr({motionOn:e}){return t.jsx(tn,{x:24,y:30,motionOn:e,duration:3.6,repeatDelay:3.2})}function Nr({motionOn:e}){return e?t.jsx(t.Fragment,{children:[{x:49,y:15,delay:0},{x:53.5,y:19,delay:.9}].map((n,s)=>t.jsx(y.circle,{cx:n.x,cy:n.y,r:2,fill:"currentColor",style:{transformOrigin:`${n.x}px ${n.y}px`},animate:{opacity:[0,.45,0],y:[0,-3,-6],scale:[.6,1,1.4]},transition:{duration:2,repeat:1/0,repeatDelay:1.4,delay:n.delay,ease:"easeOut"}},s))}):null}const re={fill:"none",stroke:"currentColor",strokeLinecap:"round"};function wr({motionOn:e}){const n={scaleY:[1,.1,1,1,.15,.15,1],times:[0,.03,.06,.84,.87,.96,1]},s={opacity:[0,0,.4,.4,0],times:[0,.84,.88,.96,1]},a={duration:8,repeat:1/0,ease:"easeInOut"};return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M18 18 Q24 14.5 30 18"}),t.jsx(O,{d:"M34 18 Q40 14.5 46 18"}),[24,40].map(r=>t.jsx(y.circle,{cx:r,cy:26,r:3,fill:"currentColor",style:{transformOrigin:`${r}px 26px`},animate:e?{scaleY:n.scaleY}:void 0,transition:e?{...a,times:n.times}:void 0},r)),e&&t.jsxs(y.g,{animate:{opacity:s.opacity},transition:{...a,times:s.times},children:[t.jsx(se,{cx:16.5,cy:33,opacity:1}),t.jsx(se,{cx:47.5,cy:33,opacity:1})]}),t.jsx("path",{d:"M19 38 Q32 51 45 38",...re,strokeWidth:3})]})}function Sr({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M20 20 L29 20"}),t.jsx(y.g,{animate:e?{y:[0,-1.2,0]}:void 0,transition:e?{duration:3.4,repeat:1/0,ease:"easeInOut"}:void 0,children:t.jsx(O,{d:"M36 16 Q41 13 46 16"})}),t.jsxs(y.g,{animate:e?{x:[0,0,-3.5,-3.5,0,0,2,0]}:void 0,transition:e?{duration:7,times:[0,.3,.36,.52,.58,.78,.84,1],repeat:1/0,ease:"easeInOut"}:void 0,children:[t.jsx(G,{cx:27,cy:23,motionOn:e}),t.jsx(G,{cx:43,cy:23,motionOn:e})]}),t.jsx("path",{d:"M27 43 L37 41.5",...re,strokeWidth:2.5})]})}function Cr(){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M18 16 Q24 12.5 30 16"}),t.jsx(O,{d:"M34 16 Q40 12.5 46 16"}),t.jsx(Xe,{cx:24,cy:26}),t.jsx(Xe,{cx:40,cy:26}),t.jsx("path",{d:"M19 37 Q32 54 45 37 Q32 44 19 37 Z",fill:"currentColor",stroke:"currentColor",strokeWidth:1,strokeLinejoin:"round"})]})}function _r({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M17 20 L27 17"}),t.jsx(O,{d:"M33 17 L43 20"}),t.jsx(G,{cx:21,cy:30,motionOn:e}),t.jsx(G,{cx:37,cy:30,motionOn:e}),t.jsx(se,{cx:14.5,cy:36}),t.jsx(se,{cx:44.5,cy:36}),t.jsx(jr,{motionOn:e}),t.jsx("path",{d:"M23 42 Q27.5 39.5 32 42 T41 42",...re,strokeWidth:2.5})]})}function Ar({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsxs(y.g,{animate:e?{y:[0,1.4,1.4,0]}:void 0,transition:e?{duration:5,times:[0,.12,.5,.62],repeat:1/0,ease:"easeInOut"}:void 0,children:[t.jsx(O,{d:"M18 15 L29 19.5"}),t.jsx(O,{d:"M35 19.5 L46 15"})]}),t.jsx(G,{cx:24,cy:27,openness:.8,motionOn:e}),t.jsx(G,{cx:40,cy:27,openness:.8,motionOn:e}),t.jsx(Nr,{motionOn:e}),t.jsx("path",{d:"M23 42 L41 42",...re,strokeWidth:3})]})}function Ir({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsxs(y.g,{initial:e?{y:7}:void 0,animate:e?{y:0}:void 0,transition:e?{type:"spring",stiffness:420,damping:11,delay:.08}:void 0,children:[t.jsx(O,{d:"M18 14 Q24 10.5 30 14"}),t.jsx(O,{d:"M34 14 Q40 10.5 46 14"})]}),t.jsx(G,{cx:24,cy:26,r:4.5,popIn:!0,motionOn:e}),t.jsx(G,{cx:40,cy:26,r:4.5,popIn:!0,motionOn:e}),t.jsx(y.circle,{cx:32,cy:44,r:4,fill:"none",stroke:"currentColor",strokeWidth:2.5,style:{transformOrigin:"32px 44px"},initial:e?{scale:.2}:void 0,animate:e?{scale:1}:void 0,transition:e?{type:"spring",stiffness:500,damping:12,delay:.14}:void 0})]})}function Mr({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M19 20.5 L29 16.5"}),t.jsx(O,{d:"M35 16.5 L45 20.5"}),t.jsx(G,{cx:24,cy:26,motionOn:e}),t.jsx(G,{cx:40,cy:26,motionOn:e}),t.jsx(kr,{motionOn:e}),t.jsx("path",{d:"M20 47 Q32 37.5 44 47",...re,strokeWidth:3})]})}function $r({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M18 17.5 Q24 15 30 17.5"}),t.jsx(O,{d:"M34 17.5 Q40 15 46 17.5"}),t.jsx(Je,{cx:24,cy:27,motionOn:e,pulseDuration:1.5,wobble:3}),t.jsx(Je,{cx:40,cy:27,motionOn:e,pulseDuration:1.9,delay:.35,wobble:-3}),t.jsx(se,{cx:15,cy:35,opacity:.25}),t.jsx(se,{cx:49,cy:35,opacity:.25}),t.jsx("path",{d:"M21 40 Q32 48 43 40",...re,strokeWidth:2.5})]})}function Tr({emotion:e,motionOn:n}){switch(e){case"happy":return t.jsx(wr,{motionOn:n});case"thinking":return t.jsx(Sr,{motionOn:n});case"celebrating":return t.jsx(Cr,{});case"sheepish":return t.jsx(_r,{motionOn:n});case"determined":return t.jsx(Ar,{motionOn:n});case"surprised":return t.jsx(Ir,{motionOn:n});case"sad":return t.jsx(Mr,{motionOn:n});case"love":return t.jsx($r,{motionOn:n})}}const Er={initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:380,damping:16,mass:.9}},Lr={surprised:{initial:{opacity:0,scale:.4},animate:{opacity:1,scale:[.4,1.14,.94,1.03,1]},transition:{duration:.65,times:[0,.4,.62,.82,1],ease:"easeOut"}},sad:{initial:{opacity:0,scale:.92,y:-3},animate:{opacity:1,scale:1,y:0},transition:{duration:.7,ease:"easeOut"}}},Dr={happy:{animate:{y:[0,-1.5,0]},transition:{duration:2.8,repeat:1/0,ease:"easeInOut"}},thinking:{animate:{rotate:[0,-1.2,0,1.2,0]},transition:{duration:6,repeat:1/0,ease:"easeInOut"}},celebrating:{animate:{y:[0,-4,0,0],scaleY:[1,1.06,.9,1],scaleX:[1,.96,1.08,1]},transition:{duration:1.3,times:[0,.35,.7,1],repeat:1/0,ease:"easeInOut"}},sheepish:{animate:{rotate:[0,-2.5,-2.5,0]},transition:{duration:5,times:[0,.2,.7,1],repeat:1/0,ease:"easeInOut"}},determined:{animate:{scale:[1,1.02,1]},transition:{duration:2.4,repeat:1/0,ease:"easeInOut"}},sad:{animate:{y:[0,2,0],rotate:[0,-1.5,0]},transition:{duration:5,repeat:1/0,ease:"easeInOut"}},love:{animate:{rotate:[0,2.5,0,-2.5,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"}}};function Or({node:e}){const n=L(),s=x.useRef(!1),a=x.useRef(null);x.useEffect(()=>{var c;if(e.emotion!=="celebrating"||!n||s.current)return;s.current=!0;const o=(c=a.current)==null?void 0:c.getBoundingClientRect();os({origin:o?mt(o):void 0})},[e.emotion,n]);const r=Lr[e.emotion]??Er,i=Dr[e.emotion];return t.jsxs("div",{className:"flex items-center gap-3",role:"img","aria-label":`Mood: ${e.emotion}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(y.div,{initial:n?r.initial:!1,animate:n?r.animate:!1,transition:n?r.transition:void 0,children:t.jsx(y.div,{ref:a,className:"bg-muted text-foreground relative flex size-14 shrink-0 items-center justify-center overflow-hidden rounded-full",animate:n&&i?i.animate:void 0,transition:n&&i?i.transition:void 0,children:t.jsx("svg",{viewBox:"0 0 64 64",className:"size-full","aria-hidden":!0,children:t.jsx(Tr,{emotion:e.emotion,motionOn:n})})})}),e.emotion==="thinking"&&t.jsx(Rr,{motionOn:n})]}),e.message&&t.jsx(y.div,{className:"bg-muted/40 rounded-lg border px-3 py-2 text-sm",initial:n?{opacity:0,x:-4}:!1,animate:n?{opacity:1,x:0}:!1,transition:n?{duration:.3,delay:.15,ease:"easeOut"}:void 0,children:e.message})]})}function Rr({motionOn:e}){return t.jsx("div",{className:"flex items-end gap-1","aria-hidden":!0,children:[0,1,2].map(n=>t.jsx(y.span,{className:"bg-muted-foreground/60 size-1.5 rounded-full",animate:e?{y:[0,-3.5,0],opacity:[.3,1,.3]}:void 0,transition:e?{duration:1.3,repeat:1/0,repeatDelay:.4,delay:n*.16,ease:"easeInOut"}:void 0},n))})}const zr=2,Wr=5;function et(e){var s;const n=(s=e==null?void 0:e.glyph)==null?void 0:s.trim();return n||null}function Pr(e,n){var a,r;const s=et((a=e[n[0].row])==null?void 0:a[n[0].col]);if(!s)return null;for(const{row:i,col:o}of n)if(et((r=e[i])==null?void 0:r[o])!==s)return null;return s}function Br(e){const n=e.length;if(n<zr||n>Wr||e.some(a=>a.length!==n))return null;const s=[];for(let a=0;a<n;a++)s.push(Array.from({length:n},(r,i)=>({row:a,col:i}))),s.push(Array.from({length:n},(r,i)=>({row:i,col:a})));s.push(Array.from({length:n},(a,r)=>({row:r,col:r}))),s.push(Array.from({length:n},(a,r)=>({row:r,col:n-1-r})));for(const a of s){const r=Pr(e,a);if(r)return{glyph:r,cells:a}}return null}function Fr(e,n,s){return e!==null&&e.cells.some(a=>a.row===n&&a.col===s)}const Ur=new Set(["."," ","-","_"]),nn=".";function Gr(e,n){const s=i=>i.map(o=>Ur.has(o)?nn:o),a=[...e];if(a.length===n)return s(a);const r=[...e.trim()];return r.length===n?s(r):null}function Hr(e,n){const s=e.split("/");if(s.length!==n.length)return null;const a=[];for(let r=0;r<s.length;r++){const i=Gr(s[r],n[r].length);if(!i)return null;a.push(i)}return a}function Kr(e){var s,a;const n=[];for(const r of e)for(const i of r){if(((s=i.action)==null?void 0:s.kind)!=="agent")continue;const o=(a=i.action.payload)==null?void 0:a.state;typeof o=="string"&&o.trim()!==""&&n.push(o)}return n}function Yr(e,n){const s=new Map;for(const r of e){const i=Hr(r,n);if(!i)continue;const o=i.map(p=>p.join("")).join("/"),c=s.get(o);c?c.count+=1:s.set(o,{parsed:i,count:1})}if(s.size===0)return null;const a=[...s.values()].sort((r,i)=>i.count-r.count);return a.length>1&&a[0].count===a[1].count?null:a[0].parsed}function Vr(e){const n=Kr(e);if(n.length===0)return e;const s=Yr(n,e);if(!s)return e;let a=!1;const r=e.map((i,o)=>i.map((c,p)=>{const u=s[o][p];if(c.glyph||c.icon||u===nn)return c;a=!0;const{action:m,...h}=c;return{...h,glyph:u}}));return a?r:e}const tt=.12,qr=.2,sn="0 0 24 24";function an(e){const n=e.trim().toLowerCase();return n==="x"?"x":n==="o"||n==="0"||n==="⭕"||n==="◯"?"o":"glyph"}function Qr(e){const n=an(e);return n==="x"?"text-status-info":n==="o"?"text-status-warning":null}const $e={className:"stroke-current",fill:"none",strokeWidth:2.75,strokeLinecap:"round"};function Xr({motionOn:e,colorClass:n}){const s=a=>({duration:tt,ease:ae,delay:a});return t.jsxs("svg",{viewBox:sn,className:N("size-[1.15em]",n),"aria-hidden":!0,focusable:"false",children:[t.jsx(y.path,{...$e,d:"M7 7 L17 17",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?s(0):void 0}),t.jsx(y.path,{...$e,d:"M17 7 L7 17",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?s(tt):void 0})]})}function Jr({motionOn:e,colorClass:n}){return t.jsx("svg",{viewBox:sn,className:N("size-[1.15em]",n),"aria-hidden":!0,focusable:"false",children:t.jsx(y.circle,{...$e,cx:12,cy:12,r:6.5,transform:"rotate(-90 12 12)",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?{duration:qr,ease:ae}:void 0})})}function Zr({motionOn:e}){return t.jsx(y.span,{"aria-hidden":!0,className:"bg-foreground/70 block size-[0.5em] rounded-full",initial:e?{scale:0,opacity:0}:!1,animate:e?{scale:1,opacity:1}:!1,transition:e?U:void 0})}function xe({mark:e,motionOn:n,colorClass:s}){if(!e.trim())return t.jsx(Zr,{motionOn:n});const a=an(e);return a==="x"?t.jsx(Xr,{motionOn:n,colorClass:s}):a==="o"?t.jsx(Jr,{motionOn:n,colorClass:s}):t.jsx(y.span,{"aria-hidden":!0,className:N("block leading-none",s),initial:n?{scale:.4,opacity:0}:!1,animate:n?{scale:1,opacity:1}:!1,transition:n?U:void 0,children:e})}function pe(e){if(!e||e.kind!=="agent")return"";const n=e.payload,s=(n==null?void 0:n.glyph)??(n==null?void 0:n.mark);return typeof s=="string"?s:""}function rn(e){return e.glyph?e.glyph:e.icon?e.icon:"filled"}function on(e){return N("relative flex aspect-square items-center justify-center rounded-md border text-2xl leading-none",e.tone&&je(e.tone))}function ge(e,n){if(!n.tone)return Qr(e)??void 0}function ei({cell:e,icon:n,motionOn:s,row:a,col:r,winRole:i}){const o=!!(e.glyph||e.icon);return t.jsxs(y.div,{role:"gridcell","aria-label":o?`Row ${a+1}, column ${r+1}: ${rn(e)}`:void 0,className:N(on(e),i==="loser"&&"opacity-60"),animate:s&&i==="winner"?{scale:[1,1.08,1]}:void 0,transition:s&&i==="winner"?{duration:1.4,repeat:1/0,ease:"easeInOut",delay:.6}:void 0,children:[e.glyph&&t.jsx(xe,{mark:e.glyph,motionOn:s,colorClass:ge(e.glyph,e)}),!e.glyph&&n&&t.jsx(n,{className:"size-6","aria-hidden":!0})]})}function ti({cell:e,icon:n,motionOn:s,row:a,col:r,winRole:i}){const{onAction:o,channel:c}=le(),u=`${Q()}.rows.${a}.${r}`,m=e.action.kind==="emit"||e.action.kind==="agent"&&c!==void 0,h=Vt(e.action,u),j=h.isDispatched?pe(e.action):null,w=h.interactive&&e.action.kind==="agent"&&!!pe(e.action),_=!h.interactive,b=()=>{if(!h.interactive)return;const S=o(e.action,{controlId:u});e.action.kind!=="agent"&&e.action.kind!=="emit"||S.catch(()=>{ft.error("Couldn’t send the move",{description:m?"Check the action size and document permissions, then try again.":"Your agent may be busy. Try again."})})},A=(()=>{const S=`Row ${a+1}, column ${r+1}`;return h.isDispatched?`${S}: ${j||"played"}`:e.glyph||e.icon?`${S}: ${rn(e)}`:h.interactive?`${S}: empty, play here`:`${S}: empty`})();let $=null;h.superseded?$="This board is from an earlier turn. Play on the newest one.":h.unavailable?$=m?"This document action is not available or needs approval.":"Interactions aren’t available here":h.latched&&($="Move sent. Waiting for the agent’s reply");const C=t.jsxs(y.button,{type:"button","aria-label":A,"aria-disabled":_||void 0,onClick:_?void 0:b,className:N(on(e),"group focus-ring w-full transition-colors",h.interactive&&"hover:bg-muted/60 cursor-pointer",_&&"cursor-default",i==="loser"&&"opacity-60"),whileHover:h.interactive?{scale:1.05}:void 0,whileTap:h.interactive?{scale:.95}:void 0,transition:U,children:[w&&t.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center text-2xl opacity-0 transition-opacity duration-150 group-hover:opacity-20",children:t.jsx(xe,{mark:pe(e.action),motionOn:!1,colorClass:ge(pe(e.action),e)})}),t.jsx(ni,{cell:e,optimisticMark:j,icon:n,motionOn:s})]});return t.jsx(y.div,{role:"gridcell",animate:s&&i==="winner"?{scale:[1,1.08,1]}:void 0,transition:s&&i==="winner"?{duration:1.4,repeat:1/0,ease:"easeInOut",delay:.6}:void 0,children:$?t.jsx(lt,{children:t.jsxs(dt,{children:[t.jsx(ut,{asChild:!0,children:C}),t.jsx(pt,{children:$})]})}):C})}function ni({cell:e,optimisticMark:n,icon:s,motionOn:a}){return n!==null?t.jsx(xe,{mark:n,motionOn:a,colorClass:ge(n,e)}):e.glyph?t.jsx(xe,{mark:e.glyph,motionOn:a,colorClass:ge(e.glyph,e)}):s?t.jsx(s,{className:"size-6","aria-hidden":!0}):null}function si(e){return e.cell.action?t.jsx(ti,{...e,cell:e.cell}):t.jsx(ei,{...e})}const nt=.28,ai=.3,ri=.12,ii=.8;function me(e,n,s){return e*(n+s)+n/2}function oi({win:e,size:n,cellUnit:s,gapUnit:a,colorClass:r,motionOn:i}){const o=n*s+(n-1)*a,c=e.cells[0],p=e.cells[e.cells.length-1],u=me(c.col,s,a),m=me(c.row,s,a),h=me(p.col,s,a),j=me(p.row,s,a);return t.jsx("svg",{viewBox:`0 0 ${o} ${o}`,className:N("pointer-events-none absolute inset-0 h-full w-full",r),"aria-hidden":!0,focusable:"false",children:t.jsx(y.line,{x1:u,y1:m,x2:h,y2:j,className:"stroke-current",strokeWidth:s*ri,strokeOpacity:ii,strokeLinecap:"round",initial:i?{pathLength:0,opacity:0}:!1,animate:i?{pathLength:1,opacity:1}:!1,transition:i?{pathLength:{duration:ai,ease:ae,delay:nt},opacity:{duration:.12,delay:nt}}:void 0})})}const ci={},li=.02,di={hidden:{},visible:{transition:{staggerChildren:li}}};function ui(e,n,s,a){return e?Fr(e,n,s)?"winner":a.glyph?"loser":"none":"none"}const pi=4,mi=3.25,fi=2.5,hi=.25,xi={default:"text-status-success",success:"text-status-success",warning:"text-status-warning",error:"text-status-error",info:"text-status-info"};function gi({node:e}){var w,_;const n=L(),{latched:s,superseded:a,channel:r}=le(),i=Q(),o=Vr(e.rows),c=Math.max(1,...o.map(b=>b.length)),p=c<=pi?mi:fi,u=Br(o),m=u?((_=(w=o[u.cells[0].row])==null?void 0:w[u.cells[0].col])==null?void 0:_.tone)??"default":"default",h=xi[m],j=s&&!a;return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&t.jsxs("p",{className:"text-muted-foreground text-xs",children:["To ",r.destinationLabel]}),e.label&&t.jsx("p",{className:"text-muted-foreground text-xs",children:e.label}),t.jsxs("div",{className:N("relative w-fit",a&&"saturate-[0.9]"),children:[j&&t.jsx(y.div,{"aria-hidden":!0,className:"ring-primary/40 pointer-events-none absolute -inset-1 rounded-lg ring-2",initial:n?{opacity:.25}:!1,animate:n?{opacity:[.25,.6,.25]}:{opacity:.4},transition:n?{duration:2,repeat:1/0,ease:"easeInOut"}:void 0}),t.jsx(y.div,{role:"grid","aria-label":e.label??"Board",className:"grid w-fit gap-1",style:{gridTemplateColumns:`repeat(${c}, minmax(0, ${p}rem))`},variants:n?di:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:o.map((b,A)=>t.jsx("div",{role:"row",className:"contents",children:Array.from({length:c},($,C)=>{const S=b[C]??ci,l=!S.glyph&&S.icon?We(S.icon):null,d=ui(u,A,C,S);return t.jsx(si,{cell:S,icon:l,motionOn:n,row:A,col:C,winRole:d},`${A}-${C}`)})},A))}),u&&t.jsx(oi,{win:u,size:c,cellUnit:p,gapUnit:hi,colorClass:h,motionOn:n})]}),t.jsx(Zt,{controlId:i,descendants:!0})]})}const yi=1.2,bi={coin:"rounded-full bg-status-warning-bg border-status-warning-border text-status-warning-fg",d6:"rounded-xl bg-muted border-border text-foreground",d20:"rounded-xl bg-muted border-border text-foreground","8ball":"rounded-full bg-foreground border-foreground text-background"},vi=[$s,Ts,Es,Ls,Ds,Os];function ji(e){const n={duration:yi,ease:"easeOut"};switch(e){case"coin":return{animate:{rotateY:[0,360,720,1080]},transition:n};case"d6":case"d20":return{animate:{rotate:[0,-15,15,-10,10,0],x:[0,-2,2,-2,2,0]},transition:n};case"8ball":return{animate:{x:[0,-6,6,-4,4,-2,2,0]},transition:n}}}function ki({kind:e,result:n}){switch(e){case"coin":return t.jsx(Is,{className:"size-7","aria-hidden":!0});case"8ball":return t.jsx("span",{"aria-hidden":!0,children:"8"});case"d20":return t.jsx("svg",{viewBox:"0 0 24 24",className:"size-7","aria-hidden":!0,children:t.jsx("polygon",{points:"12,2 21,8 21,16 12,22 3,16 3,8",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"})});case"d6":{const s=Number(n),a=Number.isInteger(s)&&s>=1&&s<=6?vi[s-1]:Rs;return t.jsx(a,{className:"size-7","aria-hidden":!0})}}}function Ni({node:e}){const n=L(),[s,a]=x.useState(0),[r,i]=x.useState(!n),{animate:o,transition:c}=ji(e.kind);return t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{type:"button","aria-label":`Replay the ${e.kind} reveal`,onClick:()=>{n&&(i(!1),a(p=>p+1))},className:N("focus-ring flex size-16 shrink-0 items-center justify-center border-2 text-lg font-bold",bi[e.kind]),children:t.jsx(y.span,{className:"flex items-center justify-center",initial:n?{rotate:0,x:0,rotateY:0}:!1,animate:n?o:!1,transition:n?c:void 0,onAnimationComplete:()=>i(!0),children:t.jsx(ki,{kind:e.kind,result:e.result})},s)}),t.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.label&&t.jsx("span",{className:"text-muted-foreground text-xs",children:e.label}),t.jsx(y.span,{"aria-live":"polite",className:"text-foreground text-lg font-semibold tabular-nums",initial:n?{opacity:0,scale:1.3}:!1,animate:r?{opacity:1,scale:1}:{opacity:0,scale:1.3},transition:U,children:r?e.result:""})]})]})}const wi={sm:"gap-2",md:"gap-3",lg:"gap-5"};function ce({node:e,path:n="root"}){return t.jsx(ya,{value:n,children:t.jsx(Si,{node:e})})}function Si({node:e}){const n=Ks();if(n===void 0&&"bind"in e&&e.bind!==void 0&&Object.keys(e.bind).length>0)return t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:"Waiting for document state."});const s=Ca(e,n==null?void 0:n.state);if(s.error!==void 0)return t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:s.error});const a=s.node;switch(a.type){case"stack":return t.jsx(Ci,{node:a});case"card":return t.jsx(_i,{node:a});case"form":return t.jsx(Ai,{node:a});case"divider":return t.jsx(Da,{});case"heading":return t.jsx(Ta,{node:a});case"text":return t.jsx(Ea,{node:a});case"badge":return t.jsx(La,{node:a});case"stat":return t.jsx(za,{node:a});case"keyValue":return t.jsx(Pa,{node:a});case"progress":return t.jsx(Ba,{node:a});case"image":return t.jsx(Fa,{node:a});case"table":return t.jsx(Ka,{node:a});case"list":return t.jsx(Ja,{node:a});case"chart":return t.jsx(nr,{node:a});case"timeline":return t.jsx(dr,{node:a});case"checklist":return t.jsx(ur,{node:a});case"compare":return t.jsx(hr,{node:a});case"rating":return t.jsx(gr,{node:a});case"mood":return t.jsx(Or,{node:a});case"board":return t.jsx(gi,{node:a});case"reveal":return t.jsx(Ni,{node:a});case"button":return t.jsx(qa,{node:a});case"input":return t.jsx(Qa,{node:a});case"select":return t.jsx(Xa,{node:a});default:return t.jsx(Ii,{nodeType:a.type})}}function Ci({node:e}){const n=Q();return t.jsx("div",{className:N("flex",e.direction==="horizontal"?"flex-row flex-wrap items-start":"flex-col",wi[e.gap??"md"]),children:e.children.map((s,a)=>t.jsx(ce,{path:`${n}.children.${a}`,node:s},a))})}function _i({node:e}){const n=Q(),s=!!(e.title||e.description);return t.jsxs(ht,{className:"shadow-soft",children:[s&&t.jsxs(cs,{children:[e.title&&t.jsx(ls,{children:e.title}),e.description&&t.jsx(ds,{children:e.description})]}),t.jsx(us,{children:e.children.map((a,r)=>t.jsx(ce,{path:`${n}.children.${r}`,node:a},r))}),e.footer&&e.footer.length>0&&t.jsx(ps,{children:e.footer.map((a,r)=>t.jsx(ce,{path:`${n}.footer.${r}`,node:a},r))})]})}function Ai({node:e}){const n=Q(),[s,a]=x.useState({}),r=x.useCallback((c,p)=>{a(u=>({...u,[c]:p}))},[]),i=x.useMemo(()=>({values:s,setValue:r}),[s,r]),o=x.useMemo(()=>e.submit.action.kind==="emit"?{...e.submit.action,payload:{...e.submit.action.payload??{},...s}}:{...e.submit.action,payload:{...e.submit.action.payload??{},...s}},[e.submit.action,s]);return t.jsxs("form",{onSubmit:c=>c.preventDefault(),className:"flex flex-col gap-3",children:[t.jsx(_a,{value:i,children:e.children.map((c,p)=>t.jsx(ce,{path:`${n}.children.${p}`,node:c},p))}),t.jsx(ke,{action:o,label:e.submit.label,controlId:`${n}.submit`,submit:!0,fullWidth:!0})]})}function Ii({nodeType:e}){return t.jsxs("div",{className:"text-muted-foreground rounded-md border border-dashed p-2 text-xs",children:["Unsupported widget element",e?`: ${e}`:""]})}function Ui({document:e,sessionId:n,isLatestMessage:s,channel:a}){const r=L();return t.jsx(ba,{channel:a,sessionId:n,widgetTitle:e.title,isLatestMessage:s,children:t.jsx(Hs,{value:a==null?void 0:a.snapshot,children:t.jsx(y.section,{"aria-label":e.title??"Widget",className:"text-sm",variants:r?de:void 0,initial:r?"hidden":!1,animate:r?"visible":!1,children:t.jsx(ce,{node:e.root})})})})}function Mi(e,n){const s=fa.safeParse(e);if(!s.success){const a=s.error.issues[0],r=(a==null?void 0:a.path.join("."))??"";return{ok:!1,error:a?`${r?`${r}: `:""}${a.message}`:"The widget isn’t in a shape DorkOS knows",raw:n??$i(e)}}return{ok:!0,document:s.data}}function Gi(e){let n;try{n=JSON.parse(e)}catch(s){return{ok:!1,error:s instanceof Error?s.message:"The widget isn’t readable JSON",raw:e}}return Mi(n,e)}function $i(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function Hi({error:e,raw:n}){const[s,a]=x.useState(!1);return t.jsx(ht,{gap:"none",className:"p-3 text-sm",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"text-muted-foreground mt-0.5 size-4 shrink-0","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium",children:"Couldn’t show this widget"}),t.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs break-words",children:e}),t.jsxs("button",{type:"button",onClick:()=>a(r=>!r),"aria-expanded":s,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring mt-2 inline-flex items-center gap-1 rounded text-xs focus-visible:ring-2 focus-visible:outline-none",children:[t.jsx(ms,{className:N("size-3 transition-transform",s&&"rotate-90")}),s?"Hide":"Show"," raw JSON"]}),s&&t.jsx("pre",{className:"bg-muted text-muted-foreground mt-2 max-h-64 overflow-auto rounded-md p-2 text-xs",children:t.jsx("code",{children:n})})]})]})})}export{Hi as W,Ui as a,U as b,Gi as p,L as u,Mi as v};
108
+ `)}const qs=F(["default","success","warning","error","info"]),Ft=g({kind:k("agent"),id:f().min(1),label:f().optional(),payload:st(f(),ln()).optional()}),Ut=g({kind:k("emit"),type:pn,payload:dn.optional(),coalesceKey:f().min(1).max(128).optional()}).strict(),Be=Te("kind",[Ft,Ut]),Ae=Te("kind",[Ft,Ut,g({kind:k("ui"),command:mn}),g({kind:k("url"),href:f().url().refine(e=>e.startsWith("https://"),{message:"Widget URLs must be https"})})]),Fe=ye([f(),Ee(),he(),fn()]),Qs=["sm","md","lg"],Ue={sm:4,md:12};function Xs(e){const n=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null;if(n!==null)return n<=Ue.sm?"sm":n<=Ue.md?"md":"lg";if(typeof e=="string"){const s=e.trim().toLowerCase();if(s==="none"||s==="xs"||s==="small"||s==="sm")return"sm";if(s==="medium"||s==="normal"||s==="md")return"md";if(s==="large"||s==="xl"||s==="xxl"||s==="lg")return"lg"}return e}const Js=E(Xs,F(Qs));function q(e){return n=>{if(typeof n!="string")return n;const s=n.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(e,s)?e[s]:n}}const Oe=E(q({default:"default",neutral:"default",muted:"default",normal:"default",gray:"default",grey:"default",success:"success",ok:"success",okay:"success",good:"success",positive:"success",done:"success",complete:"success",completed:"success",green:"success",warning:"warning",warn:"warning",caution:"warning",pending:"warning",yellow:"warning",orange:"warning",error:"error",danger:"error",critical:"error",fail:"error",failed:"error",failure:"error",negative:"error",blocked:"error",red:"error",info:"info",information:"info",note:"info",blue:"info"}),qs),Zs=E(q({vertical:"vertical",vert:"vertical",column:"vertical",col:"vertical",stack:"vertical",horizontal:"horizontal",horiz:"horizontal",row:"horizontal",inline:"horizontal"}),F(["vertical","horizontal"])),ea=E(q({default:"default",primary:"default",secondary:"secondary",destructive:"destructive",danger:"destructive",delete:"destructive",outline:"outline",ghost:"outline",link:"outline"}),F(["default","secondary","destructive","outline"])),ta=E(q({bar:"bar",bars:"bar",column:"bar",columns:"bar",histogram:"bar",line:"line",lines:"line",area:"area",pie:"pie",donut:"pie",doughnut:"pie"}),F(["bar","line","area","pie"])),na=E(q({up:"up",increase:"up",increased:"up",positive:"up",rise:"up",rising:"up",gain:"up",down:"down",decrease:"down",decreased:"down",negative:"down",fall:"down",falling:"down",drop:"down",loss:"down",flat:"flat",none:"flat",neutral:"flat",same:"flat",unchanged:"flat",steady:"flat"}),F(["up","down","flat"])),sa=E(e=>{const n=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""&&!Number.isNaN(Number(e))?Number(e):null;return n===null?e:Math.min(3,Math.max(1,Math.round(n)))},ye([k(1),k(2),k(3)])),aa=E(e=>typeof e=="string"?{value:e,direction:"flat"}:typeof e=="number"?{value:e,direction:e>0?"up":e<0?"down":"flat"}:e,g({value:ye([f(),Ee()]),direction:na.default("flat")})),ra=E(e=>typeof e=="string"?{text:e}:e,g({text:f(),tone:Oe.optional()})),ia=E(q({done:"done",complete:"done",completed:"done",finished:"done",past:"done",active:"active",current:"active",now:"active","in-progress":"active",in_progress:"active",inprogress:"active",ongoing:"active",upcoming:"upcoming",pending:"upcoming",next:"upcoming",todo:"upcoming",future:"upcoming",planned:"upcoming"}),F(["done","active","upcoming"])),Ge=E(e=>{if(typeof e=="number")return e===1?!0:e===0?!1:e;if(typeof e=="string"){const n=e.trim().toLowerCase();if(n==="true"||n==="yes"||n==="checked")return!0;if(n==="false"||n==="no"||n==="unchecked")return!1}return e},he()),oa=E(q({happy:"happy",proud:"happy",joy:"happy",joyful:"happy",glad:"happy",thinking:"thinking",confused:"thinking",pondering:"thinking",curious:"thinking",hmm:"thinking",celebrating:"celebrating",excited:"celebrating",party:"celebrating",hyped:"celebrating",sheepish:"sheepish",embarrassed:"sheepish",oops:"sheepish",awkward:"sheepish",shy:"sheepish",determined:"determined",focused:"determined",serious:"determined",resolute:"determined",surprised:"surprised",shocked:"surprised",wow:"surprised",amazed:"surprised","mind-blown":"surprised",sad:"sad",unhappy:"sad",disappointed:"sad",down:"sad",love:"love",heart:"love",hearts:"love",adore:"love"}),F(["happy","thinking","celebrating","sheepish","determined","surprised","sad","love"])),ca=E(q({coin:"coin",flip:"coin",coinflip:"coin",d6:"d6",dice:"d6",die:"d6",d20:"d20","8ball":"8ball",magic8ball:"8ball","8-ball":"8ball",eightball:"8ball","magic-8-ball":"8ball"}),F(["coin","d6","d20","8ball"])),la=E(e=>typeof e=="number"?String(e):e,f()),He=12;function da(e){return typeof e!="string"?e:e.trim()===""?{}:{glyph:e}}const ua=f().max(8).optional().transform(e=>{const n=e==null?void 0:e.trim();return n||void 0}),pa=E(da,g({glyph:ua,icon:f().optional(),tone:Oe.optional(),action:Ae.optional()})),ma=E(e=>Array.isArray(e)?e.slice(0,He).map(n=>Array.isArray(n)?n.slice(0,He):n):e,M(M(pa))),X={text:g({text:Z.optional()}).strict(),stat:g({value:Z.optional()}).strict(),progress:g({value:Z.optional(),label:Z.optional()}).strict(),table:g({rows:Z.optional()}).strict(),chart:g({data:Z.optional()}).strict()},ie=un(()=>E((e,n)=>{if(typeof e=="object"&&e!==null&&Object.hasOwn(e,"bind")){const s=e,a=typeof s.type=="string"&&Object.hasOwn(X,s.type)?X[s.type]:void 0;if(!a||!a.safeParse(s.bind).success)return n.addIssue({code:"custom",path:["bind"],message:"This element needs a supported display field and a safe state path."}),hn}return e},Te("type",[g({type:k("stack"),direction:Zs,gap:Js.optional(),children:M(ie)}),g({type:k("card"),title:f().optional(),description:f().optional(),children:M(ie),footer:M(ie).optional()}),g({type:k("divider")}),g({type:k("heading"),text:f(),level:sa.optional()}),g({type:k("text"),text:f(),bind:X.text.optional()}),g({type:k("badge"),text:f(),tone:Oe.optional()}),g({type:k("stat"),bind:X.stat.optional(),label:f(),value:ye([f(),Ee()]),delta:aa.optional(),hint:f().optional(),trend:M(ee().finite()).max(50).optional()}),g({type:k("keyValue"),items:M(g({key:f(),value:f()}))}),g({type:k("image"),src:f().refine(e=>e.startsWith("https://")||e.startsWith("data:"),{message:"Widget image sources must be https or data URIs"}),alt:f(),caption:f().optional()}),g({type:k("progress"),bind:X.progress.optional(),value:ee().finite().transform(e=>Math.min(100,Math.max(0,e))),label:f().optional()}),g({type:k("table"),bind:X.table.optional(),columns:M(g({key:f(),label:f(),align:F(["left","center","right"]).optional()})),rows:M(st(f(),Fe))}),g({type:k("list"),items:M(g({title:f(),subtitle:f().optional(),icon:f().optional(),image:f().refine(e=>e.startsWith("https://")||e.startsWith("data:"),{message:"Widget image sources must be https or data URIs"}).optional(),meta:f().optional(),badge:ra.optional(),actions:M(Ae).optional()}))}),g({type:k("chart"),bind:X.chart.optional(),kind:ta,data:M(g({label:f(),value:ee().finite().min(0)})),height:ee().finite().positive().optional()}),g({type:k("button"),label:f(),variant:ea.optional(),action:Ae}),g({type:k("input"),name:f().min(1),label:f().optional(),placeholder:f().optional(),kind:F(["text","number"]).optional(),required:he().optional()}),g({type:k("select"),required:he().optional(),name:f().min(1),label:f().optional(),options:M(g({label:f(),value:f()}))}),g({type:k("form"),children:M(ie),submit:g({label:f(),action:Be})}),g({type:k("timeline"),items:M(g({time:f().optional(),title:f(),subtitle:f().optional(),icon:f().optional(),status:ia.optional()})).min(1)}),g({type:k("checklist"),items:M(g({label:f(),checked:Ge.optional(),note:f().optional()})),action:Be.optional(),submitLabel:f().optional()}),g({type:k("compare"),options:M(g({name:f(),recommended:Ge.optional()})).min(1),rows:M(g({label:f(),values:M(Fe)}))}),g({type:k("rating"),value:ee().finite().transform(e=>Math.min(5,Math.max(0,e))),count:ee().int().nonnegative().optional(),label:f().optional()}),g({type:k("mood"),emotion:oa,message:f().optional()}),g({type:k("board"),rows:ma,label:f().optional()}),g({type:k("reveal"),kind:ca,result:la,label:f().optional()})]))),fa=g({version:k(1),title:f().optional(),root:ie});function Ie(e){return e.some(n=>gn(n,"widget.action"))}const ha=100,xa=3e4;function Gt(e){if(e!==null&&typeof e=="object"){for(const n of Object.values(e))Gt(n);Object.freeze(e)}return e}function ga(e,n){var S;const[s,a]=x.useState([]),r=x.useRef(new Map),i=x.useRef(e),o=x.useRef({documentId:e==null?void 0:e.documentId,owner:e==null?void 0:e.submissionOwner}),c=x.useRef(!0),p=x.useRef(0),u=x.useCallback(()=>{const l=++p.current,d=[...r.current.values()].map(v=>v.value);a(v=>p.current===l?d:v)},[]),m=x.useCallback(l=>{const d=l.operation;l.operation=void 0,d&&(d.active=!1,clearTimeout(d.timer),d.controller.abort())},[]),h=x.useCallback(l=>{l.retired=!0,l.start=void 0,++p.current,m(l)},[m]),j=x.useCallback(l=>c.current&&!l.retired&&r.current.get(l.value.event.id)===l,[]),w=x.useCallback(l=>{const d=i.current;return o.current.documentId===l.value.documentId&&o.current.owner===l.owner&&(d==null?void 0:d.documentId)===l.value.documentId&&(d==null?void 0:d.submissionOwner)===l.owner},[]),_=x.useCallback((l,d)=>{if(!j(l)||!w(l))return!1;const v=i.current;return!(l.host.current?l.host.current(d):v.enabled)||!j(l)||!w(l)?!1:l.original.current(d)&&j(l)&&w(l)},[j,w]);x.useLayoutEffect(()=>{const l={documentId:e==null?void 0:e.documentId,owner:e==null?void 0:e.submissionOwner};i.current=e,o.current=l;for(const d of r.current.values())w(d)||h(d)},[e,e==null?void 0:e.documentId,e==null?void 0:e.submissionOwner,w,h]),x.useEffect(()=>{c.current=!0;const l=r.current;return()=>{c.current=!1;for(const d of l.values())h(d)}},[h]);const b=x.useCallback((l,d)=>{l.value={...l.value,...d},u()},[u]);x.useEffect(()=>{var l;for(const d of r.current.values()){if(!j(d)||!w(d)||d.value.phase==="refused")continue;const v=d.start,T=d.operation;if(!_(d,"read")||d.start!==v||d.operation!==T)continue;const W=(l=e==null?void 0:e.snapshot)==null?void 0:l.receipts.find(R=>R.receipt.id===d.value.event.id);!_(d,"read")||d.start!==v||d.operation!==T||W&&W!==d.value.receipt&&(d.start=void 0,d.value={...d.value,phase:"accepted",receipt:W},m(d),u())}},[(S=e==null?void 0:e.snapshot)==null?void 0:S.receipts,e==null?void 0:e.submissionOwner,j,w,_,m,u]);const A=l=>[...r.current.values()].some(d=>d.value.controlId===l&&!d.retired&&["sending","retry","review"].includes(d.value.phase)),$=async(l,d=!1)=>{var ue;if(!j(l)||!w(l))return;const v=Object.freeze({});l.start=v,++p.current,m(l);const T=()=>j(l)&&w(l)&&l.start===v&&l.operation===void 0;if(!T())return;const W=_(l,d?"read":"submit");if(!T())return;if(!W){b(l,{phase:d?"retry":"refused",message:d?"Save not confirmed. Review the document before trying again.":"Document actions are unavailable. Review this action before trying again."});return}const R=new AbortController;if(!T()){R.abort();return}const z={token:Object.freeze({}),controller:R,active:!0};l.operation=z,l.start=void 0;const D=()=>j(l)&&w(l)&&l.operation===z&&z.active&&!R.signal.aborted,P=K=>D()?_(l,K)&&D():!1;if(z.timer=setTimeout(()=>{D()&&(z.active=!1,l.operation=void 0,l.uncertain=!0,b(l,{phase:"retry",message:"Save not confirmed. Check your network and try again."}),R.abort())},xa),!D()){clearTimeout(z.timer),R.abort();return}b(l,{phase:"sending",message:void 0});try{if(d)try{if(!P("read")){D()&&b(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}const B=await l.original.inspect(R.signal);if(!P("read")){D()&&b(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}b(l,{phase:"accepted",receipt:B});return}catch(B){if(!D()||!D())return;throw B}if(!P("submit")){D()&&b(l,{phase:"review",message:"Document approval changed. Review this action before trying again."});return}const K=[...((ue=i.current)==null?void 0:ue.approvedEventTypes)??[]],Y=!l.value.normalized||Ie(K);if(!D())return;if(!Y){b(l,{phase:"review",message:"Document approval changed. Review this action before trying again."});return}if(!P("submit"))return;l.uncertain=!0;const H=await l.original.submit(R.signal);if(!P("read")){D()&&b(l,{phase:"retry",message:"Save not confirmed. Review the document before trying again."});return}b(l,{phase:"accepted",receipt:H})}catch(K){if(!D())return;const Y=K.status;if(!D())return;const H=Y!==void 0&&[400,401,403,404,409,413,422].includes(Y),B=!d&&H;l.uncertain=d||!B,b(l,{phase:B?"refused":H?"review":"retry",message:B?"This action could not be saved. Review the document before trying again.":H?"Save not confirmed. Review this action before trying again.":"Save not confirmed. Check your network and try again."})}finally{l.operation===z&&(l.operation=void 0,z.active=!1,clearTimeout(z.timer),R.abort())}};return{dispatch:async(l,d)=>{var Y;const v=i.current;if(!(v!=null&&v.enabled)||A(d))return;const T=l.kind==="agent";if(T&&!Ie(v.approvedEventTypes)||l.kind!=="emit"&&!T)return;const W=xn.parse({v:1,id:crypto.randomUUID(),type:T?"widget.action":l.type,payload:T?{actionId:l.id,payload:l.payload??{},widget:{documentId:v.documentId,nodeId:d,...n?{title:n}:{}}}:{...l.payload??{},widget:{documentId:v.documentId,nodeId:d,...n?{title:n}:{}}},...!T&&l.coalesceKey?{coalesceKey:l.coalesceKey}:{}}),R=JSON.stringify(W),z=v.documentId,D=v.submissionOwner,P=(Y=v.captureOriginal)==null?void 0:Y.call(v,W);if(!P||P.id!==W.id||P.bytes!==R||!c.current||i.current!==v||v.documentId!==z||v.submissionOwner!==D||!P.current("submit")||!c.current||i.current!==v||v.documentId!==z||v.submissionOwner!==D)return;const ue={...v.current?{current:v.current.bind(v)}:{}};if(!c.current||i.current!==v||A(d))return;if(r.current.size>=ha){const H=[...r.current.values()].find(B=>{var Pe;return B.value.phase==="refused"||B.value.phase==="accepted"&&((Pe=B.value.receipt)==null?void 0:Pe.deliveries.every(cn=>["handled","rejected","turn_done","expired","failed","cancelled","superseded","unavailable"].includes(cn.status)))});if(!H)throw new Error("Too many actions are waiting. Try again after they finish.");if(r.current.delete(H.value.event.id),h(H),!c.current||i.current!==v||A(d))return}const K={host:ue,owner:v.submissionOwner,original:P,retired:!1,uncertain:!1,value:{controlId:d,documentId:v.documentId,normalized:T,event:Gt(JSON.parse(R)),phase:"sending"}};r.current.set(W.id,K),u(),await $(K)},pending:A,records:s,retry:l=>{const d=r.current.get(l);return d&&d.uncertain&&(d.value.phase==="retry"||d.value.phase==="sending")?$(d,!0):Promise.resolve()}}}const Ht=x.createContext("root"),ya=Ht.Provider;function Q(){return x.useContext(Ht)}function Kt(e){return e.id+":"+JSON.stringify(e.payload??null)}const Ke=()=>Promise.resolve(),Yt=x.createContext({onAction:Ke,hasSession:!1,channelRecords:[],channelPending:()=>!1,retryChannel:Ke,superseded:!1,latched:!1,dispatchedActionKey:null,dispatchStatus:"idle"});function ba({children:e,channel:n,sessionId:s,widgetTitle:a,isLatestMessage:r=!0}){const{setTheme:i}=yn(),o=bn(),c=ga(n,a),[p,u]=x.useState(null),[m,h]=x.useState(null),j=x.useRef(!1),w=x.useCallback(async(b,A)=>{if(b.kind==="emit"||n&&b.kind==="agent"){await c.dispatch(b,(A==null?void 0:A.controlId)??"root");return}switch(b.kind){case"ui":{if(!s&&!at(b.command))return;const $={getStore:jn.getState,setTheme:i,supportsTerminal:o.supportsTerminal,celebrationOrigin:A==null?void 0:A.origin,sessionId:s};kn($,b.command,"user");return}case"url":u(b.href);return;case"agent":{if(!s||j.current)return;j.current=!0;const $={actionId:b.id,payload:b.payload,widgetTitle:a},C=Ne.getState();C.setOptimisticUserMessage(s,{id:crypto.randomUUID(),content:Vs($)}),C.setTriggerPending(s,!0);const S=Kt(b);h({key:S,status:"pending"});try{await o.sendUiAction(s,$),h({key:S,status:"sent"}),setTimeout(()=>{var d;const l=Ne.getState().getSession(s);l.triggerPending&&((d=l.status)==null?void 0:d.lifecycle)!=="streaming"&&Ne.getState().setTriggerPending(s,!1)},vn.TRIGGER_PENDING_TIMEOUT_MS)}catch(l){throw j.current=!1,C.setOptimisticUserMessage(s,null),C.setTriggerPending(s,!1),h(null),l}return}}},[i,o,s,a,n,c]),_=x.useMemo(()=>({onAction:w,channel:n,channelRecords:c.records,channelPending:c.pending,retryChannel:c.retry,hasSession:!!s,superseded:!r,latched:m!==null,dispatchedActionKey:(m==null?void 0:m.key)??null,dispatchStatus:(m==null?void 0:m.status)??"idle"}),[w,s,r,m,n,c]);return t.jsxs(Yt.Provider,{value:_,children:[e,t.jsx(Nn,{url:p??"",isOpen:p!==null,onClose:()=>u(null),onConfirm:()=>{p&&wn(p),u(null)}})]})}function le(){return x.useContext(Yt)}function Vt(e,n){var C;const s=Q(),a=le();if(e.kind==="emit"||e.kind==="agent"&&a.channel!==void 0){const S=!((C=a.channel)!=null&&C.enabled)||e.kind==="agent"&&!Ie(a.channel.approvedEventTypes),l=a.channelPending(n??s);return{isAgent:!1,unavailable:S,superseded:!1,latched:!1,isDispatched:l,dispatchStatus:l?"pending":"idle",interactive:!S&&!l}}const{hasSession:i,superseded:o,latched:c,dispatchedActionKey:p,dispatchStatus:u}=a,m=e.kind==="agent",h=e.kind==="agent"?Kt(e):null,j=h!==null&&h===p,_=(m||e.kind==="ui"&&!at(e.command))&&!i,b=m&&o;return{isAgent:m,unavailable:_,superseded:b,latched:m&&c&&!j,isDispatched:j,dispatchStatus:j?u:"idle",interactive:m?!_&&!b&&!c:!_}}const U=Sn.snap,ae=[.22,1,.36,1],Re=.05,ze=.9,de={hidden:{opacity:0,y:6,scale:.985},visible:{opacity:1,y:0,scale:1,transition:U}},ve={hidden:{},visible:{transition:{staggerChildren:Re}}};function L(){return!Cn()}function qt(e,n,s=ze*1e3){const[a,r]=x.useState(()=>n?0:e),i=x.useRef(n?0:e);return x.useEffect(()=>{if(!n){i.current=e;return}const o=fs(i.current,e,{duration:s/1e3,ease:ae,onUpdate:c=>{i.current=c,r(c)}});return()=>o.stop()},[e,n,s]),n?a:e}const Qt=new Set(["__proto__","prototype","constructor"]),va={text:["text"],stat:["value"],progress:["value","label"],table:["rows"],chart:["data"]},ja=100,Ye=50,ka=16384;function ne(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function V(e,n){const s=Object.getOwnPropertyDescriptor(e,n);if(!s||!("value"in s))throw new Error("missing");return s.value}function Na(e,n){if(!ne(e)||!_n.safeParse(n).success)throw new Error("path");let s=e;if(n==="")return s;for(const a of n.slice(1).split("/")){const r=a.replaceAll("~1","/").replaceAll("~0","~");if(Qt.has(r))throw new Error("path");if(Array.isArray(s)){if(!/^(0|[1-9]\d*)$/u.test(r)||Number(r)>=s.length)throw new Error("index")}else if(!ne(s))throw new Error("object");s=V(s,r)}return s}function oe(e,n=ka){return typeof e=="string"&&e.length<=n}function fe(e){return typeof e=="number"&&Number.isFinite(e)}function wa(e){return e===null||typeof e=="boolean"||fe(e)||oe(e)}function Sa(e,n,s){if(e.type==="text"&&n==="text"&&oe(s)||e.type==="stat"&&n==="value"&&(oe(s,1024)||fe(s))||e.type==="progress"&&(n==="label"&&oe(s,1024)||n==="value"&&fe(s)&&s>=0&&s<=100))return s;if(!Array.isArray(s)||s.length>ja)throw new Error("type");if(e.type==="table"&&n==="rows"){if(e.columns.length>Ye)throw new Error("columns");const a=new Set(e.columns.map(r=>r.key));return Array.from({length:s.length},(r,i)=>{const o=V(s,String(i));if(!ne(o))throw new Error("row");const c=Object.keys(o);if(c.length>Ye)throw new Error("columns");const p=Object.create(null);for(const u of c){if(Qt.has(u)||!a.has(u))throw new Error("column");const m=V(o,u);if(!wa(m))throw new Error("cell");p[u]=m}return p})}if(e.type==="chart"&&n==="data")return Array.from({length:s.length},(a,r)=>{const i=V(s,String(r));if(!ne(i)||Object.keys(i).some(p=>p!=="label"&&p!=="value"))throw new Error("point");const o=V(i,"label"),c=V(i,"value");if(!oe(o,1024)||!fe(c)||c<0)throw new Error("point");return{label:o,value:c}});throw new Error("type")}function Ca(e,n){if(!("bind"in e)||e.bind===void 0)return{node:e};const s=va[e.type],a=e.bind;if(!s||!ne(a))return{error:"This element has an unsupported state binding."};const r=Object.keys(a);if(r.length===0)return{node:e};const i={};for(const o of r)try{if(!s.includes(o))throw new Error("field");const c=V(a,o);if(!ne(c)||Object.keys(c).length!==1||!Object.hasOwn(c,"path"))throw new Error("binding");const p=V(c,"path");if(typeof p!="string")throw new Error("path");const u=Sa(e,o,Na(n,p));if(new TextEncoder().encode(JSON.stringify(u)).byteLength>65536)throw new Error("size");i[o]=u}catch{return{error:`Cannot show ${o}: its state value is missing or has the wrong type.`}}return{node:{...e,...i}}}const Xt=x.createContext(null),_a=Xt.Provider;function Jt(){return x.useContext(Xt)}const Aa={default:"bg-secondary text-secondary-foreground border-transparent",success:"bg-status-success-bg text-status-success-fg border-status-success-border",warning:"bg-status-warning-bg text-status-warning-fg border-status-warning-border",error:"bg-status-error-bg text-status-error-fg border-status-error-border",info:"bg-status-info-bg text-status-info-fg border-status-info-border"};function je(e){return Aa[e??"default"]}function Ia(e){var c;if(typeof e=="number")return Number.isFinite(e)?{prefix:"",suffix:"",decimals:0,grouped:!1,value:e}:null;const n=e.match(/^(.*?)(-?\d[\d,]*(?:\.\d+)?)(.*)$/s);if(!n)return null;const[,s,a,r]=n,i=Number(a.replace(/,/g,""));if(!Number.isFinite(i))return null;const o=a.includes(".")?((c=a.split(".")[1])==null?void 0:c.length)??0:0;return{prefix:s,suffix:r,decimals:o,grouped:a.includes(","),value:i}}function Ma(e,n){const s=n.toFixed(e.decimals),a=e.grouped?Number(s).toLocaleString("en-US",{minimumFractionDigits:e.decimals,maximumFractionDigits:e.decimals}):s;return`${e.prefix}${a}${e.suffix}`}const $a={1:"text-lg font-semibold",2:"text-base font-semibold",3:"text-sm font-semibold"};function Ta({node:e}){const n=e.level??3,s=N($a[n],"text-foreground");return n===1?t.jsx("h1",{className:s,children:e.text}):n===2?t.jsx("h2",{className:s,children:e.text}):t.jsx("h3",{className:s,children:e.text})}function Ea({node:e}){return t.jsx(xs,{content:e.text,className:"text-sm"})}function La({node:e}){const n=L();return t.jsx(y.span,{className:N("inline-flex w-fit items-center rounded-md border px-2 py-0.5 text-xs font-medium",je(e.tone)),initial:n?{opacity:0,scale:.8}:!1,animate:n?{opacity:1,scale:1}:!1,transition:U,children:e.text})}function Da(){return t.jsx($n,{})}const Oa={up:Mn,down:In,flat:rt},Ra={up:"text-status-success",down:"text-status-error",flat:"text-muted-foreground"};function za({node:e}){const n=L(),s=Ia(e.value),a=qt((s==null?void 0:s.value)??0,n&&s!==null),r=s?Ma(s,a):String(e.value),i=e.delta?Oa[e.delta.direction]:null;return t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:e.label}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("span",{className:"text-foreground text-2xl font-semibold tabular-nums",children:r}),e.delta&&i&&t.jsxs(y.span,{className:N("inline-flex items-center gap-0.5 text-xs font-medium",Ra[e.delta.direction]),initial:n?{opacity:0,x:-4}:!1,animate:n?{opacity:1,x:0}:!1,transition:{...U,delay:.25},children:[t.jsx(i,{className:"size-3","aria-hidden":!0}),e.delta.value]})]}),e.trend&&e.trend.length>=2&&t.jsx(Wa,{values:e.trend})]}),e.hint&&t.jsx("span",{className:"text-muted-foreground text-xs",children:e.hint})]})}function Wa({values:e}){const n=L(),s=`spark-wipe-${x.useId().replace(/:/g,"")}`,a=Math.min(...e),r=Math.max(...e),i=r-a||1,o=e.map((c,p)=>{const u=p/(e.length-1)*100,m=r===a?50:100-(c-a)/i*100;return`${u},${m}`}).join(" ");return t.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"h-5 w-16 shrink-0 overflow-visible","aria-hidden":!0,children:[n&&t.jsx("defs",{children:t.jsx("clipPath",{id:s,children:t.jsx(y.rect,{x:-4,y:-12,height:124,initial:{width:0},animate:{width:108},transition:{duration:ze,ease:ae}})})}),t.jsx("g",{clipPath:n?`url(#${s})`:void 0,children:t.jsx("polyline",{points:o,fill:"none",stroke:"hsl(var(--chart-1))",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})})]})}function Pa({node:e}){return t.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm",children:e.items.map((n,s)=>t.jsxs("div",{className:"contents",children:[t.jsx("dt",{className:"text-muted-foreground",children:n.key}),t.jsx("dd",{className:"text-foreground text-right break-words",children:n.value})]},`${n.key}-${s}`))})}function Ba({node:e}){const n=L(),s=qt(e.value,n);return t.jsxs("div",{className:"flex flex-col gap-1",children:[(e.label||e.label==="")&&t.jsxs("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[t.jsx("span",{children:e.label}),t.jsxs("span",{className:"tabular-nums",children:[Math.round(s),"%"]})]}),t.jsx(hs,{value:s})]})}function Fa({node:e}){return t.jsxs("figure",{className:"flex flex-col gap-1",children:[t.jsx(An,{image:{src:e.src,alt:e.alt},className:"block w-full",children:t.jsx("img",{src:e.src,alt:e.alt,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"})}),e.caption&&t.jsx("figcaption",{className:"text-muted-foreground text-xs",children:e.caption})]})}const Ua=y.create(yt),Ga=y.create(be),Ve={left:"text-left",center:"text-center",right:"text-right"};function Ha(e){return e===null?"—":typeof e=="boolean"?e?"Yes":"No":String(e)}function Ka({node:e}){const n=L();return t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(xt,{children:[t.jsx(gt,{children:t.jsx(be,{children:e.columns.map(s=>t.jsx(Ce,{className:N(s.align&&Ve[s.align]),children:s.label},s.key))})}),t.jsx(Ua,{variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.rows.map((s,a)=>t.jsx(Ga,{variants:n?de:void 0,children:e.columns.map(r=>t.jsx(_e,{className:N("tabular-nums",r.align&&Ve[r.align]),children:Ha(s[r.key]??null)},r.key))},a))})]})})}const Ya={"alert-circle":Xn,"alert-triangle":ot,archive:Qn,"arrow-right":rt,bell:qn,bookmark:ws,calendar:Vn,check:Le,"check-circle":Ss,circle:Se,clock:Yn,cloud:Cs,code:_s,cog:As,database:Ms,file:Ns,"file-text":ks,flag:zs,folder:Kn,"git-branch":js,globe:Hn,heart:vs,home:Ws,info:Gn,link:Un,lock:Fn,mail:Bn,"map-pin":Ps,"message-square":Pn,package:bs,play:Wn,rocket:Bs,search:zn,server:ys,settings:Rn,star:it,tag:Fs,terminal:On,"thumbs-up":Dn,trash:Ln,"trending-down":Us,"trending-up":Gs,user:En,users:Tn,zap:gs};function We(e){if(!e)return Se;const n=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();return Ya[n]??Se}function Va(e,n){var a;if(e.phase==="sending")return"Saving…";if(e.phase!=="accepted")return e.message??"This action could not be saved.";const s=((a=e.receipt)==null?void 0:a.deliveries)??[];return s.length?s.map(r=>{if(r.ackOutcome==="handled"||r.status==="handled")return`${n} reported that it handled this action.`;if(r.ackOutcome==="rejected"||r.status==="rejected")return`${n} could not handle this action.`;switch(r.status){case"turn_started":return`${n} started working.`;case"turn_done":return`${n} finished. Handling is not confirmed yet.`;case"in_doubt":return"Saved; outcome unknown. Review before replaying.";case"failed":return"Saved; the agent request failed.";case"expired":return"Saved; expired before the agent started.";case"superseded":return"Saved; replaced by a newer change.";case"cancelled":return"Saved; the agent request was cancelled.";case"unavailable":return"Saved; the destination is not available.";default:return`Saved; waiting for ${n}.`}}).join(" "):"Saved to the document."}function Zt({controlId:e,descendants:n=!1}){const{channel:s,channelRecords:a,retryChannel:r}=le();if(!s)return null;const i=a.filter(o=>o.controlId===e||n&&o.controlId.startsWith(`${e}.`));return i.length?t.jsx("ul",{className:"text-muted-foreground mt-2 flex max-h-32 flex-col gap-1.5 overflow-y-auto text-xs","aria-live":"polite","aria-relevant":"additions text","data-testid":"widget-action-statuses",children:i.map((o,c)=>t.jsxs("li",{"data-testid":"widget-action-status","data-event-id":o.event.id,className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{children:[i.length>1?`Action ${c+1}: `:"",Va(o,s.destinationLabel)]}),o.phase==="retry"&&t.jsx(ct,{size:"sm",variant:"ghost",onClick:()=>void r(o.event.id),"data-testid":"widget-action-retry",children:"Try again"})]},o.event.id))}):null}function ke({action:e,label:n,variant:s,fullWidth:a,controlId:r,submit:i}){const{onAction:o,channel:c}=le(),p=Q(),u=r??p,m=e.kind==="emit"||e.kind==="agent"&&c!==void 0,h=Vt(e,u),j=L(),w=h.isDispatched&&h.dispatchStatus==="pending",_=h.isDispatched&&h.dispatchStatus==="sent",b=!h.interactive,A=j&&h.interactive,$=l=>{var T;if(b){l.preventDefault();return}if(i&&!((T=l.currentTarget.form)!=null&&T.reportValidity())){l.preventDefault();return}const d=mt(l.currentTarget.getBoundingClientRect()),v=o(e,{origin:d,controlId:u});e.kind!=="agent"&&e.kind!=="emit"||v.catch(()=>{ft.error(m?"This action could not be saved.":"Couldn’t send the action",{description:m?"Check the action size and document permissions, then try again.":"Your agent may be busy. Try again."})})};let C=null;h.superseded?C="This one’s from an earlier message.":h.unavailable?C=m?e.kind==="agent"&&(c!=null&&c.enabled)?"This action needs an approved document route.":"Document actions are not available here.":"Interactions aren’t available here":h.latched&&(C="Sent. Waiting for the agent’s reply");const S=t.jsxs(ct,{type:i?"submit":"button","data-testid":m?"widget-channel-action":void 0,size:"sm",variant:s??"default","aria-disabled":b||void 0,disabled:w,onClick:b?void 0:$,className:N(a&&"w-full",b&&"cursor-default",(h.unavailable||h.superseded)&&"opacity-50",_&&"opacity-70"),children:[w&&t.jsx(as,{size:"xs"}),_&&t.jsx(Le,{className:"size-(--size-icon-xs)","aria-hidden":!0}),n]});return m?t.jsxs("div",{className:N(a&&"w-full"),children:[t.jsx("div",{className:"text-muted-foreground mb-1 text-xs",children:c!=null&&c.destinationLabel?`To ${c.destinationLabel}`:"Document action"}),S,C&&t.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:C}),t.jsx(Zt,{controlId:u})]}):C?t.jsx(lt,{children:t.jsxs(dt,{children:[t.jsx(ut,{asChild:!0,children:S}),t.jsx(pt,{children:C})]})}):!A&&!m?S:t.jsx(y.div,{className:N("inline-flex",a&&"w-full"),whileHover:{scale:1.02},transition:U,children:S})}function qa({node:e}){return t.jsx(ke,{action:e.action,label:e.label,variant:e.variant})}function Qa({node:e}){const n=Jt(),s=x.useId(),[a,r]=x.useState(!1),[i,o]=x.useState(""),c=n?n.values[e.name]??"":i,p=u=>n?n.setValue(e.name,u):o(u);return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.label&&t.jsx(De,{htmlFor:s,children:e.label}),t.jsx(ss,{id:s,name:e.name,type:e.kind==="number"?"number":"text",required:e.required,"aria-label":e.label??e.name,placeholder:e.placeholder,value:c,"aria-invalid":a||void 0,"aria-describedby":a?`${s}-error`:void 0,onInvalid:u=>{u.preventDefault(),r(!0),u.currentTarget.focus()},onChange:u=>{r(!1),p(u.target.value)}}),a&&t.jsxs("p",{id:`${s}-error`,className:"text-destructive text-xs",role:"alert",children:["Enter ",e.label??e.name,"."]})]})}function Xa({node:e}){const n=x.useRef(null),s=Jt(),a=x.useId(),[r,i]=x.useState(!1),[o,c]=x.useState(""),p=s?s.values[e.name]??"":o,u=m=>s?s.setValue(e.name,m):c(m);return t.jsxs("div",{className:"flex flex-col gap-1.5",onInvalidCapture:m=>{var h;m.preventDefault(),i(!0),(h=n.current)==null||h.focus()},children:[e.label&&t.jsx(De,{htmlFor:a,children:e.label}),t.jsxs(Jn,{name:e.name,required:e.required,value:p||void 0,onValueChange:m=>{i(!1),u(m)},children:[t.jsx(Zn,{ref:n,"aria-invalid":r||void 0,"aria-describedby":r?`${a}-error`:void 0,id:a,"aria-label":e.label??e.name,children:t.jsx(es,{placeholder:"Select…"})}),t.jsx(ts,{children:e.options.map(m=>t.jsx(ns,{value:m.value,children:m.label},m.value))})]}),r&&t.jsxs("p",{id:`${a}-error`,className:"text-destructive text-xs",role:"alert",children:["Choose ",e.label??e.name,"."]})]})}function Ja({node:e}){const n=L(),s=Q();return t.jsx(y.ul,{className:"divide-border divide-y",variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.items.map((a,r)=>{const i=We(a.icon);return t.jsxs(y.li,{className:"hover:bg-muted/40 -mx-2 flex items-center gap-3 rounded-md px-2 py-2 transition-colors first:pt-0 last:pb-0",variants:n?de:void 0,children:[a.image&&t.jsx("img",{src:a.image,alt:"",className:"size-10 shrink-0 rounded-md border object-cover",loading:"lazy"}),a.icon&&t.jsx(i,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-foreground truncate text-sm font-medium",children:a.title}),a.subtitle&&t.jsx("p",{className:"text-muted-foreground truncate text-xs",children:a.subtitle})]}),a.meta&&t.jsx("span",{className:"text-muted-foreground shrink-0 text-sm tabular-nums",children:a.meta}),a.badge&&t.jsx("span",{className:N("inline-flex shrink-0 items-center rounded-md border px-2 py-0.5 text-xs font-medium",je(a.badge.tone)),children:a.badge.text}),a.actions&&a.actions.length>0&&t.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:a.actions.map((o,c)=>t.jsx(ke,{action:o,controlId:`${s}.items.${r}.actions.${c}`,label:o.kind==="agent"?o.label??"Action":o.kind==="emit"?"Send":Za(o)},c))})]},r)})})}function Za(e){return e.kind==="url"?"Open":"Run"}const J=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],er=180,tr=.15;function nr({node:e}){const n=e.height??er,s=`${e.kind} chart`;return e.data.length===0?t.jsx("p",{className:"text-muted-foreground text-xs",children:"No data to chart."}):e.kind==="bar"?t.jsx(ar,{data:e.data,height:n,label:s}):e.kind==="pie"?t.jsx(or,{data:e.data,height:n,label:s}):t.jsx(rr,{data:e.data,height:n,area:e.kind==="area",label:s})}const sr=18;function ar({data:e,height:n,label:s}){const a=L(),r=Math.max(...e.map(o=>o.value),0)||1,i=Math.max(0,n-sr);return t.jsxs("div",{role:"img","aria-label":s,className:"flex flex-col gap-1",children:[t.jsx("div",{className:"flex items-end gap-2",style:{height:n},children:e.map((o,c)=>t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-center justify-end gap-1",children:[t.jsx("span",{className:"text-muted-foreground text-2xs tabular-nums",children:o.value}),t.jsx(y.div,{className:"w-full origin-bottom rounded-t-sm",style:{height:o.value/r*i,backgroundColor:J[c%J.length]},initial:a?{scaleY:0}:!1,animate:a?{scaleY:1}:!1,transition:{...U,delay:c*Re}})]},c))}),t.jsx(en,{data:e})]})}function rr({data:e,height:n,area:s,label:a}){const r=Math.max(...e.map(j=>j.value),0)||1,i=e.length,c=e.map((j,w)=>{const _=i===1?50:w/(i-1)*100,b=100-j.value/r*100;return{x:_,y:b}}).map(j=>`${j.x},${j.y}`).join(" "),p=`0,100 ${c} 100,100`,u=J[0],m=L(),h=`chart-wipe-${x.useId().replace(/:/g,"")}`;return t.jsxs("div",{role:"img","aria-label":a,className:"flex flex-col gap-1",children:[t.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",style:{height:n},className:"w-full overflow-visible",children:[m&&t.jsx("defs",{children:t.jsx("clipPath",{id:h,children:t.jsx(y.rect,{x:-4,y:-12,height:124,initial:{width:0},animate:{width:108},transition:{duration:ze,ease:ae}})})}),t.jsxs("g",{clipPath:m?`url(#${h})`:void 0,children:[s&&t.jsx("polygon",{points:p,fill:u,opacity:tr}),t.jsx("polyline",{points:c,fill:"none",stroke:u,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})]})]}),t.jsx(en,{data:e})]})}const ir=359.99;function or({data:e,height:n,label:s}){const a=L(),r=e.reduce((o,c)=>o+c.value,0)||1,i=e.map((o,c)=>{const u=-90+e.slice(0,c).reduce((j,w)=>j+w.value,0)/r*360,m=o.value/r*360,h=m>=ir;return{d:o,full:h,path:h?"":cr(u,u+m)}});return t.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[t.jsx("svg",{viewBox:"0 0 100 100",role:"img","aria-label":s,style:{height:n,width:n},children:i.map((o,c)=>{const p=J[c%J.length],u={initial:a?{opacity:0,scale:.6}:!1,animate:a?{opacity:1,scale:1}:!1,transition:{...U,delay:c*Re},style:{transformOrigin:"50px 50px"}};return o.full?t.jsx(y.circle,{cx:50,cy:50,r:50,fill:p,...u},c):t.jsx(y.path,{d:o.path,fill:p,...u},c)})}),t.jsx("ul",{className:"flex flex-col gap-1 text-xs",children:e.map((o,c)=>t.jsxs("li",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"size-2.5 shrink-0 rounded-sm",style:{backgroundColor:J[c%J.length]},"aria-hidden":!0}),t.jsx("span",{className:"text-foreground",children:o.label}),t.jsx("span",{className:"text-muted-foreground tabular-nums",children:o.value})]},c))})]})}function en({data:e}){return t.jsx("div",{className:"flex gap-2",children:e.map((n,s)=>t.jsx("span",{className:N("text-muted-foreground text-2xs min-w-0 flex-1 truncate text-center"),title:n.label,children:n.label},s))})}function cr(e,n){const i=qe(50,50,50,e),o=qe(50,50,50,n),c=n-e>180?1:0;return`M 50 50 L ${i.x} ${i.y} A 50 50 0 ${c} 1 ${o.x} ${o.y} Z`}function qe(e,n,s,a){const r=a*Math.PI/180;return{x:e+s*Math.cos(r),y:n+s*Math.sin(r)}}const lr={done:"border-status-success bg-status-success text-white dark:text-status-success-bg",active:"border-primary bg-primary text-primary-foreground",upcoming:"border-border bg-background text-muted-foreground"};function dr({node:e}){const n=L();return t.jsx(y.ol,{className:"flex flex-col",variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.items.map((s,a)=>{const r=s.status??"upcoming",i=a===e.items.length-1,o=s.icon?We(s.icon):null;return t.jsxs(y.li,{className:"flex gap-3",variants:n?de:void 0,children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsxs("span",{className:"relative flex size-5 shrink-0 items-center justify-center",children:[r==="active"&&n&&t.jsx(y.span,{className:"border-primary absolute inset-0 rounded-full border",initial:{opacity:.6,scale:1},animate:{opacity:0,scale:1.8},transition:{duration:1.6,repeat:1/0,ease:"easeOut"},"aria-hidden":!0}),t.jsx("span",{className:N("flex size-3 items-center justify-center rounded-full border",lr[r],r==="active"&&"ring-primary/30 ring-2"),children:o&&t.jsx(o,{className:"size-2.5","aria-hidden":!0})})]}),!i&&t.jsx("span",{className:"bg-border w-px flex-1","aria-hidden":!0})]}),t.jsxs("div",{className:N("min-w-0 flex-1",!i&&"pb-4"),children:[s.time&&t.jsx("p",{className:"text-muted-foreground text-xs tabular-nums",children:s.time}),t.jsx("p",{className:N("text-foreground text-sm",r==="active"?"font-semibold":"font-medium"),children:s.title}),s.subtitle&&t.jsx("p",{className:"text-muted-foreground text-xs",children:s.subtitle})]})]},a)})})}function ur({node:e}){const n=x.useId(),[s,a]=x.useState(()=>e.items.map(i=>i.checked??!1)),r=x.useMemo(()=>{if(!e.action)return null;const i=e.items.filter((p,u)=>s[u]).map(p=>p.label),o=e.items.filter((p,u)=>!s[u]).map(p=>p.label),c={checked:i,unchecked:o};return e.action.kind==="emit"?{...e.action,payload:{...e.action.payload??{},...c}}:{...e.action,payload:{...e.action.payload??{},...c}}},[e.action,e.items,s]);return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("ul",{className:"flex flex-col gap-2",children:e.items.map((i,o)=>{const c=`${n}-${o}`;return t.jsxs("li",{className:"flex items-start gap-2.5",children:[t.jsx(rs,{id:c,checked:s[o],onCheckedChange:p=>a(u=>u.map((m,h)=>h===o?p===!0:m)),className:"mt-0.5"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx(De,{htmlFor:c,className:N("text-sm font-normal transition-colors",s[o]&&"text-muted-foreground line-through"),children:i.label}),i.note&&t.jsx("p",{className:"text-muted-foreground text-xs",children:i.note})]})]},o)})}),r&&t.jsx(ke,{action:r,label:e.submitLabel??"Send",fullWidth:!0})]})}const pr=y.create(yt),mr=y.create(be);function fr({value:e}){return e==null?t.jsx("span",{className:"text-muted-foreground",children:"—"}):typeof e=="boolean"?e?t.jsx(Le,{className:"text-status-success mx-auto size-4","aria-label":"Yes"}):t.jsx(is,{className:"text-muted-foreground mx-auto size-4","aria-label":"No"}):t.jsx("span",{className:"tabular-nums",children:String(e)})}function hr({node:e}){const n=L();return t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(xt,{children:[t.jsx(gt,{children:t.jsxs(be,{children:[t.jsx(Ce,{}),e.options.map((s,a)=>t.jsxs(Ce,{className:N("text-center",s.recommended&&"bg-primary/5"),children:[t.jsx("span",{className:"text-foreground font-medium",children:s.name}),s.recommended&&t.jsx("span",{className:N("text-2xs mt-1 flex w-fit items-center justify-center rounded-md border px-1.5 py-0.5 font-medium","mx-auto",je("success")),children:"Recommended"})]},a))]})}),t.jsx(pr,{variants:n?ve:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:e.rows.map((s,a)=>t.jsxs(mr,{variants:n?de:void 0,children:[t.jsx(_e,{className:"text-muted-foreground font-medium",children:s.label}),e.options.map((r,i)=>t.jsx(_e,{className:N("text-center",r.recommended&&"bg-primary/5"),children:t.jsx(fr,{value:s.values[i]??null})},i))]},a))})]})})}const Me=5,xr=Array.from({length:Me});function Qe({className:e}){return t.jsx("div",{className:"flex","aria-hidden":!0,children:xr.map((n,s)=>t.jsx(it,{className:N("size-4",e)},s))})}function gr({node:e}){const n=L(),s=e.value/Me*100;return t.jsxs(y.div,{className:"flex items-center gap-2",initial:n?{opacity:0,y:4}:!1,animate:n?{opacity:1,y:0}:!1,transition:U,children:[t.jsxs("div",{className:"relative w-fit",role:"img","aria-label":`Rated ${e.value.toFixed(1)} out of ${Me}`,children:[t.jsx(Qe,{className:"text-muted-foreground"}),t.jsx("div",{className:"absolute inset-y-0 left-0 overflow-hidden",style:{width:`${s}%`},children:t.jsx(Qe,{className:"fill-status-warning text-status-warning"})})]}),t.jsx("span",{className:"text-foreground text-sm font-medium tabular-nums",children:e.value.toFixed(1)}),e.count!==void 0&&t.jsxs("span",{className:"text-muted-foreground text-sm tabular-nums",children:["(",e.count.toLocaleString(),")"]}),e.label&&t.jsx("span",{className:"text-muted-foreground text-sm",children:e.label})]})}const yr=7.4,br=[1,.1,1,1,.1,1,.1,1,1],vr=[0,.02,.045,.52,.54,.565,.585,.61,1];function G({cx:e,cy:n,r:s=3,openness:a=1,active:r=!0,popIn:i=!1,motionOn:o}){const c=o&&r,p=a;return t.jsx(y.circle,{cx:e,cy:n,r:s,fill:"currentColor",style:{transformOrigin:`${e}px ${n}px`,scaleY:o?void 0:p},initial:o&&i?{scale:.2}:void 0,animate:o?{scale:1,...c?{scaleY:br.map(u=>u*p)}:{scaleY:p}}:void 0,transition:o?{scale:{type:"spring",stiffness:500,damping:15},...c?{scaleY:{duration:yr,times:vr,repeat:1/0,ease:"easeInOut"}}:{}}:void 0})}function Xe({cx:e,cy:n}){return t.jsx("path",{d:`M ${e-4.5} ${n+1.5} Q ${e} ${n-4.5} ${e+4.5} ${n+1.5}`,fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})}function Je({cx:e,cy:n,motionOn:s,pulseDuration:a,delay:r=0,wobble:i=3}){const o=`M ${e} ${n+4} C ${e-8} ${n-2}, ${e-4} ${n-8}, ${e} ${n-4} C ${e+4} ${n-8}, ${e+8} ${n-2}, ${e} ${n+4} Z`;return t.jsx(y.path,{d:o,fill:"currentColor",className:"text-status-error",style:{transformOrigin:`${e}px ${n}px`},animate:s?{scale:[1,1.16,1],rotate:[-i,i,-i]}:void 0,transition:s?{scale:{duration:a,repeat:1/0,ease:"easeInOut",delay:r},rotate:{duration:a*2.1,repeat:1/0,ease:"easeInOut",delay:r}}:void 0})}function O({d:e}){return t.jsx("path",{d:e,fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})}function se({cx:e,cy:n,opacity:s=.3}){return t.jsx("ellipse",{cx:e,cy:n,rx:3.6,ry:2.1,className:"text-status-error",fill:"currentColor",fillOpacity:s})}const Ze="M 0 -3.2 C 2.2 -0.6, 2.6 1.4, 0 3.2 C -2.6 1.4, -2.2 -0.6, 0 -3.2 Z";function tn({x:e,y:n,motionOn:s,duration:a,repeatDelay:r}){return s?t.jsx(y.g,{style:{x:e,y:n},animate:{y:[n,n+2,n+9,n+11],opacity:[0,.85,.85,0],scale:[.5,1,1,.85]},transition:{duration:a,times:[0,.3,.85,1],repeat:1/0,repeatDelay:r,ease:"easeIn"},children:t.jsx("path",{d:Ze,className:"text-status-info",fill:"currentColor"})}):t.jsx("g",{transform:`translate(${e} ${n+4})`,opacity:.5,children:t.jsx("path",{d:Ze,className:"text-status-info",fill:"currentColor"})})}function jr({motionOn:e}){return t.jsx(tn,{x:47,y:13,motionOn:e,duration:3.4,repeatDelay:2.6})}function kr({motionOn:e}){return t.jsx(tn,{x:24,y:30,motionOn:e,duration:3.6,repeatDelay:3.2})}function Nr({motionOn:e}){return e?t.jsx(t.Fragment,{children:[{x:49,y:15,delay:0},{x:53.5,y:19,delay:.9}].map((n,s)=>t.jsx(y.circle,{cx:n.x,cy:n.y,r:2,fill:"currentColor",style:{transformOrigin:`${n.x}px ${n.y}px`},animate:{opacity:[0,.45,0],y:[0,-3,-6],scale:[.6,1,1.4]},transition:{duration:2,repeat:1/0,repeatDelay:1.4,delay:n.delay,ease:"easeOut"}},s))}):null}const re={fill:"none",stroke:"currentColor",strokeLinecap:"round"};function wr({motionOn:e}){const n={scaleY:[1,.1,1,1,.15,.15,1],times:[0,.03,.06,.84,.87,.96,1]},s={opacity:[0,0,.4,.4,0],times:[0,.84,.88,.96,1]},a={duration:8,repeat:1/0,ease:"easeInOut"};return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M18 18 Q24 14.5 30 18"}),t.jsx(O,{d:"M34 18 Q40 14.5 46 18"}),[24,40].map(r=>t.jsx(y.circle,{cx:r,cy:26,r:3,fill:"currentColor",style:{transformOrigin:`${r}px 26px`},animate:e?{scaleY:n.scaleY}:void 0,transition:e?{...a,times:n.times}:void 0},r)),e&&t.jsxs(y.g,{animate:{opacity:s.opacity},transition:{...a,times:s.times},children:[t.jsx(se,{cx:16.5,cy:33,opacity:1}),t.jsx(se,{cx:47.5,cy:33,opacity:1})]}),t.jsx("path",{d:"M19 38 Q32 51 45 38",...re,strokeWidth:3})]})}function Sr({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M20 20 L29 20"}),t.jsx(y.g,{animate:e?{y:[0,-1.2,0]}:void 0,transition:e?{duration:3.4,repeat:1/0,ease:"easeInOut"}:void 0,children:t.jsx(O,{d:"M36 16 Q41 13 46 16"})}),t.jsxs(y.g,{animate:e?{x:[0,0,-3.5,-3.5,0,0,2,0]}:void 0,transition:e?{duration:7,times:[0,.3,.36,.52,.58,.78,.84,1],repeat:1/0,ease:"easeInOut"}:void 0,children:[t.jsx(G,{cx:27,cy:23,motionOn:e}),t.jsx(G,{cx:43,cy:23,motionOn:e})]}),t.jsx("path",{d:"M27 43 L37 41.5",...re,strokeWidth:2.5})]})}function Cr(){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M18 16 Q24 12.5 30 16"}),t.jsx(O,{d:"M34 16 Q40 12.5 46 16"}),t.jsx(Xe,{cx:24,cy:26}),t.jsx(Xe,{cx:40,cy:26}),t.jsx("path",{d:"M19 37 Q32 54 45 37 Q32 44 19 37 Z",fill:"currentColor",stroke:"currentColor",strokeWidth:1,strokeLinejoin:"round"})]})}function _r({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M17 20 L27 17"}),t.jsx(O,{d:"M33 17 L43 20"}),t.jsx(G,{cx:21,cy:30,motionOn:e}),t.jsx(G,{cx:37,cy:30,motionOn:e}),t.jsx(se,{cx:14.5,cy:36}),t.jsx(se,{cx:44.5,cy:36}),t.jsx(jr,{motionOn:e}),t.jsx("path",{d:"M23 42 Q27.5 39.5 32 42 T41 42",...re,strokeWidth:2.5})]})}function Ar({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsxs(y.g,{animate:e?{y:[0,1.4,1.4,0]}:void 0,transition:e?{duration:5,times:[0,.12,.5,.62],repeat:1/0,ease:"easeInOut"}:void 0,children:[t.jsx(O,{d:"M18 15 L29 19.5"}),t.jsx(O,{d:"M35 19.5 L46 15"})]}),t.jsx(G,{cx:24,cy:27,openness:.8,motionOn:e}),t.jsx(G,{cx:40,cy:27,openness:.8,motionOn:e}),t.jsx(Nr,{motionOn:e}),t.jsx("path",{d:"M23 42 L41 42",...re,strokeWidth:3})]})}function Ir({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsxs(y.g,{initial:e?{y:7}:void 0,animate:e?{y:0}:void 0,transition:e?{type:"spring",stiffness:420,damping:11,delay:.08}:void 0,children:[t.jsx(O,{d:"M18 14 Q24 10.5 30 14"}),t.jsx(O,{d:"M34 14 Q40 10.5 46 14"})]}),t.jsx(G,{cx:24,cy:26,r:4.5,popIn:!0,motionOn:e}),t.jsx(G,{cx:40,cy:26,r:4.5,popIn:!0,motionOn:e}),t.jsx(y.circle,{cx:32,cy:44,r:4,fill:"none",stroke:"currentColor",strokeWidth:2.5,style:{transformOrigin:"32px 44px"},initial:e?{scale:.2}:void 0,animate:e?{scale:1}:void 0,transition:e?{type:"spring",stiffness:500,damping:12,delay:.14}:void 0})]})}function Mr({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M19 20.5 L29 16.5"}),t.jsx(O,{d:"M35 16.5 L45 20.5"}),t.jsx(G,{cx:24,cy:26,motionOn:e}),t.jsx(G,{cx:40,cy:26,motionOn:e}),t.jsx(kr,{motionOn:e}),t.jsx("path",{d:"M20 47 Q32 37.5 44 47",...re,strokeWidth:3})]})}function $r({motionOn:e}){return t.jsxs(t.Fragment,{children:[t.jsx(O,{d:"M18 17.5 Q24 15 30 17.5"}),t.jsx(O,{d:"M34 17.5 Q40 15 46 17.5"}),t.jsx(Je,{cx:24,cy:27,motionOn:e,pulseDuration:1.5,wobble:3}),t.jsx(Je,{cx:40,cy:27,motionOn:e,pulseDuration:1.9,delay:.35,wobble:-3}),t.jsx(se,{cx:15,cy:35,opacity:.25}),t.jsx(se,{cx:49,cy:35,opacity:.25}),t.jsx("path",{d:"M21 40 Q32 48 43 40",...re,strokeWidth:2.5})]})}function Tr({emotion:e,motionOn:n}){switch(e){case"happy":return t.jsx(wr,{motionOn:n});case"thinking":return t.jsx(Sr,{motionOn:n});case"celebrating":return t.jsx(Cr,{});case"sheepish":return t.jsx(_r,{motionOn:n});case"determined":return t.jsx(Ar,{motionOn:n});case"surprised":return t.jsx(Ir,{motionOn:n});case"sad":return t.jsx(Mr,{motionOn:n});case"love":return t.jsx($r,{motionOn:n})}}const Er={initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:380,damping:16,mass:.9}},Lr={surprised:{initial:{opacity:0,scale:.4},animate:{opacity:1,scale:[.4,1.14,.94,1.03,1]},transition:{duration:.65,times:[0,.4,.62,.82,1],ease:"easeOut"}},sad:{initial:{opacity:0,scale:.92,y:-3},animate:{opacity:1,scale:1,y:0},transition:{duration:.7,ease:"easeOut"}}},Dr={happy:{animate:{y:[0,-1.5,0]},transition:{duration:2.8,repeat:1/0,ease:"easeInOut"}},thinking:{animate:{rotate:[0,-1.2,0,1.2,0]},transition:{duration:6,repeat:1/0,ease:"easeInOut"}},celebrating:{animate:{y:[0,-4,0,0],scaleY:[1,1.06,.9,1],scaleX:[1,.96,1.08,1]},transition:{duration:1.3,times:[0,.35,.7,1],repeat:1/0,ease:"easeInOut"}},sheepish:{animate:{rotate:[0,-2.5,-2.5,0]},transition:{duration:5,times:[0,.2,.7,1],repeat:1/0,ease:"easeInOut"}},determined:{animate:{scale:[1,1.02,1]},transition:{duration:2.4,repeat:1/0,ease:"easeInOut"}},sad:{animate:{y:[0,2,0],rotate:[0,-1.5,0]},transition:{duration:5,repeat:1/0,ease:"easeInOut"}},love:{animate:{rotate:[0,2.5,0,-2.5,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"}}};function Or({node:e}){const n=L(),s=x.useRef(!1),a=x.useRef(null);x.useEffect(()=>{var c;if(e.emotion!=="celebrating"||!n||s.current)return;s.current=!0;const o=(c=a.current)==null?void 0:c.getBoundingClientRect();os({origin:o?mt(o):void 0})},[e.emotion,n]);const r=Lr[e.emotion]??Er,i=Dr[e.emotion];return t.jsxs("div",{className:"flex items-center gap-3",role:"img","aria-label":`Mood: ${e.emotion}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(y.div,{initial:n?r.initial:!1,animate:n?r.animate:!1,transition:n?r.transition:void 0,children:t.jsx(y.div,{ref:a,className:"bg-muted text-foreground relative flex size-14 shrink-0 items-center justify-center overflow-hidden rounded-full",animate:n&&i?i.animate:void 0,transition:n&&i?i.transition:void 0,children:t.jsx("svg",{viewBox:"0 0 64 64",className:"size-full","aria-hidden":!0,children:t.jsx(Tr,{emotion:e.emotion,motionOn:n})})})}),e.emotion==="thinking"&&t.jsx(Rr,{motionOn:n})]}),e.message&&t.jsx(y.div,{className:"bg-muted/40 rounded-lg border px-3 py-2 text-sm",initial:n?{opacity:0,x:-4}:!1,animate:n?{opacity:1,x:0}:!1,transition:n?{duration:.3,delay:.15,ease:"easeOut"}:void 0,children:e.message})]})}function Rr({motionOn:e}){return t.jsx("div",{className:"flex items-end gap-1","aria-hidden":!0,children:[0,1,2].map(n=>t.jsx(y.span,{className:"bg-muted-foreground/60 size-1.5 rounded-full",animate:e?{y:[0,-3.5,0],opacity:[.3,1,.3]}:void 0,transition:e?{duration:1.3,repeat:1/0,repeatDelay:.4,delay:n*.16,ease:"easeInOut"}:void 0},n))})}const zr=2,Wr=5;function et(e){var s;const n=(s=e==null?void 0:e.glyph)==null?void 0:s.trim();return n||null}function Pr(e,n){var a,r;const s=et((a=e[n[0].row])==null?void 0:a[n[0].col]);if(!s)return null;for(const{row:i,col:o}of n)if(et((r=e[i])==null?void 0:r[o])!==s)return null;return s}function Br(e){const n=e.length;if(n<zr||n>Wr||e.some(a=>a.length!==n))return null;const s=[];for(let a=0;a<n;a++)s.push(Array.from({length:n},(r,i)=>({row:a,col:i}))),s.push(Array.from({length:n},(r,i)=>({row:i,col:a})));s.push(Array.from({length:n},(a,r)=>({row:r,col:r}))),s.push(Array.from({length:n},(a,r)=>({row:r,col:n-1-r})));for(const a of s){const r=Pr(e,a);if(r)return{glyph:r,cells:a}}return null}function Fr(e,n,s){return e!==null&&e.cells.some(a=>a.row===n&&a.col===s)}const Ur=new Set(["."," ","-","_"]),nn=".";function Gr(e,n){const s=i=>i.map(o=>Ur.has(o)?nn:o),a=[...e];if(a.length===n)return s(a);const r=[...e.trim()];return r.length===n?s(r):null}function Hr(e,n){const s=e.split("/");if(s.length!==n.length)return null;const a=[];for(let r=0;r<s.length;r++){const i=Gr(s[r],n[r].length);if(!i)return null;a.push(i)}return a}function Kr(e){var s,a;const n=[];for(const r of e)for(const i of r){if(((s=i.action)==null?void 0:s.kind)!=="agent")continue;const o=(a=i.action.payload)==null?void 0:a.state;typeof o=="string"&&o.trim()!==""&&n.push(o)}return n}function Yr(e,n){const s=new Map;for(const r of e){const i=Hr(r,n);if(!i)continue;const o=i.map(p=>p.join("")).join("/"),c=s.get(o);c?c.count+=1:s.set(o,{parsed:i,count:1})}if(s.size===0)return null;const a=[...s.values()].sort((r,i)=>i.count-r.count);return a.length>1&&a[0].count===a[1].count?null:a[0].parsed}function Vr(e){const n=Kr(e);if(n.length===0)return e;const s=Yr(n,e);if(!s)return e;let a=!1;const r=e.map((i,o)=>i.map((c,p)=>{const u=s[o][p];if(c.glyph||c.icon||u===nn)return c;a=!0;const{action:m,...h}=c;return{...h,glyph:u}}));return a?r:e}const tt=.12,qr=.2,sn="0 0 24 24";function an(e){const n=e.trim().toLowerCase();return n==="x"?"x":n==="o"||n==="0"||n==="⭕"||n==="◯"?"o":"glyph"}function Qr(e){const n=an(e);return n==="x"?"text-status-info":n==="o"?"text-status-warning":null}const $e={className:"stroke-current",fill:"none",strokeWidth:2.75,strokeLinecap:"round"};function Xr({motionOn:e,colorClass:n}){const s=a=>({duration:tt,ease:ae,delay:a});return t.jsxs("svg",{viewBox:sn,className:N("size-[1.15em]",n),"aria-hidden":!0,focusable:"false",children:[t.jsx(y.path,{...$e,d:"M7 7 L17 17",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?s(0):void 0}),t.jsx(y.path,{...$e,d:"M17 7 L7 17",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?s(tt):void 0})]})}function Jr({motionOn:e,colorClass:n}){return t.jsx("svg",{viewBox:sn,className:N("size-[1.15em]",n),"aria-hidden":!0,focusable:"false",children:t.jsx(y.circle,{...$e,cx:12,cy:12,r:6.5,transform:"rotate(-90 12 12)",initial:e?{pathLength:0}:!1,animate:e?{pathLength:1}:!1,transition:e?{duration:qr,ease:ae}:void 0})})}function Zr({motionOn:e}){return t.jsx(y.span,{"aria-hidden":!0,className:"bg-foreground/70 block size-[0.5em] rounded-full",initial:e?{scale:0,opacity:0}:!1,animate:e?{scale:1,opacity:1}:!1,transition:e?U:void 0})}function xe({mark:e,motionOn:n,colorClass:s}){if(!e.trim())return t.jsx(Zr,{motionOn:n});const a=an(e);return a==="x"?t.jsx(Xr,{motionOn:n,colorClass:s}):a==="o"?t.jsx(Jr,{motionOn:n,colorClass:s}):t.jsx(y.span,{"aria-hidden":!0,className:N("block leading-none",s),initial:n?{scale:.4,opacity:0}:!1,animate:n?{scale:1,opacity:1}:!1,transition:n?U:void 0,children:e})}function pe(e){if(!e||e.kind!=="agent")return"";const n=e.payload,s=(n==null?void 0:n.glyph)??(n==null?void 0:n.mark);return typeof s=="string"?s:""}function rn(e){return e.glyph?e.glyph:e.icon?e.icon:"filled"}function on(e){return N("relative flex aspect-square items-center justify-center rounded-md border text-2xl leading-none",e.tone&&je(e.tone))}function ge(e,n){if(!n.tone)return Qr(e)??void 0}function ei({cell:e,icon:n,motionOn:s,row:a,col:r,winRole:i}){const o=!!(e.glyph||e.icon);return t.jsxs(y.div,{role:"gridcell","aria-label":o?`Row ${a+1}, column ${r+1}: ${rn(e)}`:void 0,className:N(on(e),i==="loser"&&"opacity-60"),animate:s&&i==="winner"?{scale:[1,1.08,1]}:void 0,transition:s&&i==="winner"?{duration:1.4,repeat:1/0,ease:"easeInOut",delay:.6}:void 0,children:[e.glyph&&t.jsx(xe,{mark:e.glyph,motionOn:s,colorClass:ge(e.glyph,e)}),!e.glyph&&n&&t.jsx(n,{className:"size-6","aria-hidden":!0})]})}function ti({cell:e,icon:n,motionOn:s,row:a,col:r,winRole:i}){const{onAction:o,channel:c}=le(),u=`${Q()}.rows.${a}.${r}`,m=e.action.kind==="emit"||e.action.kind==="agent"&&c!==void 0,h=Vt(e.action,u),j=h.isDispatched?pe(e.action):null,w=h.interactive&&e.action.kind==="agent"&&!!pe(e.action),_=!h.interactive,b=()=>{if(!h.interactive)return;const S=o(e.action,{controlId:u});e.action.kind!=="agent"&&e.action.kind!=="emit"||S.catch(()=>{ft.error("Couldn’t send the move",{description:m?"Check the action size and document permissions, then try again.":"Your agent may be busy. Try again."})})},A=(()=>{const S=`Row ${a+1}, column ${r+1}`;return h.isDispatched?`${S}: ${j||"played"}`:e.glyph||e.icon?`${S}: ${rn(e)}`:h.interactive?`${S}: empty, play here`:`${S}: empty`})();let $=null;h.superseded?$="This board is from an earlier turn. Play on the newest one.":h.unavailable?$=m?"This document action is not available or needs approval.":"Interactions aren’t available here":h.latched&&($="Move sent. Waiting for the agent’s reply");const C=t.jsxs(y.button,{type:"button","aria-label":A,"aria-disabled":_||void 0,onClick:_?void 0:b,className:N(on(e),"group focus-ring w-full transition-colors",h.interactive&&"hover:bg-muted/60 cursor-pointer",_&&"cursor-default",i==="loser"&&"opacity-60"),whileHover:h.interactive?{scale:1.05}:void 0,whileTap:h.interactive?{scale:.95}:void 0,transition:U,children:[w&&t.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center text-2xl opacity-0 transition-opacity duration-150 group-hover:opacity-20",children:t.jsx(xe,{mark:pe(e.action),motionOn:!1,colorClass:ge(pe(e.action),e)})}),t.jsx(ni,{cell:e,optimisticMark:j,icon:n,motionOn:s})]});return t.jsx(y.div,{role:"gridcell",animate:s&&i==="winner"?{scale:[1,1.08,1]}:void 0,transition:s&&i==="winner"?{duration:1.4,repeat:1/0,ease:"easeInOut",delay:.6}:void 0,children:$?t.jsx(lt,{children:t.jsxs(dt,{children:[t.jsx(ut,{asChild:!0,children:C}),t.jsx(pt,{children:$})]})}):C})}function ni({cell:e,optimisticMark:n,icon:s,motionOn:a}){return n!==null?t.jsx(xe,{mark:n,motionOn:a,colorClass:ge(n,e)}):e.glyph?t.jsx(xe,{mark:e.glyph,motionOn:a,colorClass:ge(e.glyph,e)}):s?t.jsx(s,{className:"size-6","aria-hidden":!0}):null}function si(e){return e.cell.action?t.jsx(ti,{...e,cell:e.cell}):t.jsx(ei,{...e})}const nt=.28,ai=.3,ri=.12,ii=.8;function me(e,n,s){return e*(n+s)+n/2}function oi({win:e,size:n,cellUnit:s,gapUnit:a,colorClass:r,motionOn:i}){const o=n*s+(n-1)*a,c=e.cells[0],p=e.cells[e.cells.length-1],u=me(c.col,s,a),m=me(c.row,s,a),h=me(p.col,s,a),j=me(p.row,s,a);return t.jsx("svg",{viewBox:`0 0 ${o} ${o}`,className:N("pointer-events-none absolute inset-0 h-full w-full",r),"aria-hidden":!0,focusable:"false",children:t.jsx(y.line,{x1:u,y1:m,x2:h,y2:j,className:"stroke-current",strokeWidth:s*ri,strokeOpacity:ii,strokeLinecap:"round",initial:i?{pathLength:0,opacity:0}:!1,animate:i?{pathLength:1,opacity:1}:!1,transition:i?{pathLength:{duration:ai,ease:ae,delay:nt},opacity:{duration:.12,delay:nt}}:void 0})})}const ci={},li=.02,di={hidden:{},visible:{transition:{staggerChildren:li}}};function ui(e,n,s,a){return e?Fr(e,n,s)?"winner":a.glyph?"loser":"none":"none"}const pi=4,mi=3.25,fi=2.5,hi=.25,xi={default:"text-status-success",success:"text-status-success",warning:"text-status-warning",error:"text-status-error",info:"text-status-info"};function gi({node:e}){var w,_;const n=L(),{latched:s,superseded:a,channel:r}=le(),i=Q(),o=Vr(e.rows),c=Math.max(1,...o.map(b=>b.length)),p=c<=pi?mi:fi,u=Br(o),m=u?((_=(w=o[u.cells[0].row])==null?void 0:w[u.cells[0].col])==null?void 0:_.tone)??"default":"default",h=xi[m],j=s&&!a;return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&t.jsxs("p",{className:"text-muted-foreground text-xs",children:["To ",r.destinationLabel]}),e.label&&t.jsx("p",{className:"text-muted-foreground text-xs",children:e.label}),t.jsxs("div",{className:N("relative w-fit",a&&"saturate-[0.9]"),children:[j&&t.jsx(y.div,{"aria-hidden":!0,className:"ring-primary/40 pointer-events-none absolute -inset-1 rounded-lg ring-2",initial:n?{opacity:.25}:!1,animate:n?{opacity:[.25,.6,.25]}:{opacity:.4},transition:n?{duration:2,repeat:1/0,ease:"easeInOut"}:void 0}),t.jsx(y.div,{role:"grid","aria-label":e.label??"Board",className:"grid w-fit gap-1",style:{gridTemplateColumns:`repeat(${c}, minmax(0, ${p}rem))`},variants:n?di:void 0,initial:n?"hidden":!1,animate:n?"visible":!1,children:o.map((b,A)=>t.jsx("div",{role:"row",className:"contents",children:Array.from({length:c},($,C)=>{const S=b[C]??ci,l=!S.glyph&&S.icon?We(S.icon):null,d=ui(u,A,C,S);return t.jsx(si,{cell:S,icon:l,motionOn:n,row:A,col:C,winRole:d},`${A}-${C}`)})},A))}),u&&t.jsx(oi,{win:u,size:c,cellUnit:p,gapUnit:hi,colorClass:h,motionOn:n})]}),t.jsx(Zt,{controlId:i,descendants:!0})]})}const yi=1.2,bi={coin:"rounded-full bg-status-warning-bg border-status-warning-border text-status-warning-fg",d6:"rounded-xl bg-muted border-border text-foreground",d20:"rounded-xl bg-muted border-border text-foreground","8ball":"rounded-full bg-foreground border-foreground text-background"},vi=[$s,Ts,Es,Ls,Ds,Os];function ji(e){const n={duration:yi,ease:"easeOut"};switch(e){case"coin":return{animate:{rotateY:[0,360,720,1080]},transition:n};case"d6":case"d20":return{animate:{rotate:[0,-15,15,-10,10,0],x:[0,-2,2,-2,2,0]},transition:n};case"8ball":return{animate:{x:[0,-6,6,-4,4,-2,2,0]},transition:n}}}function ki({kind:e,result:n}){switch(e){case"coin":return t.jsx(Is,{className:"size-7","aria-hidden":!0});case"8ball":return t.jsx("span",{"aria-hidden":!0,children:"8"});case"d20":return t.jsx("svg",{viewBox:"0 0 24 24",className:"size-7","aria-hidden":!0,children:t.jsx("polygon",{points:"12,2 21,8 21,16 12,22 3,16 3,8",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"})});case"d6":{const s=Number(n),a=Number.isInteger(s)&&s>=1&&s<=6?vi[s-1]:Rs;return t.jsx(a,{className:"size-7","aria-hidden":!0})}}}function Ni({node:e}){const n=L(),[s,a]=x.useState(0),[r,i]=x.useState(!n),{animate:o,transition:c}=ji(e.kind);return t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{type:"button","aria-label":`Replay the ${e.kind} reveal`,onClick:()=>{n&&(i(!1),a(p=>p+1))},className:N("focus-ring flex size-16 shrink-0 items-center justify-center border-2 text-lg font-bold",bi[e.kind]),children:t.jsx(y.span,{className:"flex items-center justify-center",initial:n?{rotate:0,x:0,rotateY:0}:!1,animate:n?o:!1,transition:n?c:void 0,onAnimationComplete:()=>i(!0),children:t.jsx(ki,{kind:e.kind,result:e.result})},s)}),t.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.label&&t.jsx("span",{className:"text-muted-foreground text-xs",children:e.label}),t.jsx(y.span,{"aria-live":"polite",className:"text-foreground text-lg font-semibold tabular-nums",initial:n?{opacity:0,scale:1.3}:!1,animate:r?{opacity:1,scale:1}:{opacity:0,scale:1.3},transition:U,children:r?e.result:""})]})]})}const wi={sm:"gap-2",md:"gap-3",lg:"gap-5"};function ce({node:e,path:n="root"}){return t.jsx(ya,{value:n,children:t.jsx(Si,{node:e})})}function Si({node:e}){const n=Ks();if(n===void 0&&"bind"in e&&e.bind!==void 0&&Object.keys(e.bind).length>0)return t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:"Waiting for document state."});const s=Ca(e,n==null?void 0:n.state);if(s.error!==void 0)return t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:s.error});const a=s.node;switch(a.type){case"stack":return t.jsx(Ci,{node:a});case"card":return t.jsx(_i,{node:a});case"form":return t.jsx(Ai,{node:a});case"divider":return t.jsx(Da,{});case"heading":return t.jsx(Ta,{node:a});case"text":return t.jsx(Ea,{node:a});case"badge":return t.jsx(La,{node:a});case"stat":return t.jsx(za,{node:a});case"keyValue":return t.jsx(Pa,{node:a});case"progress":return t.jsx(Ba,{node:a});case"image":return t.jsx(Fa,{node:a});case"table":return t.jsx(Ka,{node:a});case"list":return t.jsx(Ja,{node:a});case"chart":return t.jsx(nr,{node:a});case"timeline":return t.jsx(dr,{node:a});case"checklist":return t.jsx(ur,{node:a});case"compare":return t.jsx(hr,{node:a});case"rating":return t.jsx(gr,{node:a});case"mood":return t.jsx(Or,{node:a});case"board":return t.jsx(gi,{node:a});case"reveal":return t.jsx(Ni,{node:a});case"button":return t.jsx(qa,{node:a});case"input":return t.jsx(Qa,{node:a});case"select":return t.jsx(Xa,{node:a});default:return t.jsx(Ii,{nodeType:a.type})}}function Ci({node:e}){const n=Q();return t.jsx("div",{className:N("flex",e.direction==="horizontal"?"flex-row flex-wrap items-start":"flex-col",wi[e.gap??"md"]),children:e.children.map((s,a)=>t.jsx(ce,{path:`${n}.children.${a}`,node:s},a))})}function _i({node:e}){const n=Q(),s=!!(e.title||e.description);return t.jsxs(ht,{className:"shadow-soft",children:[s&&t.jsxs(cs,{children:[e.title&&t.jsx(ls,{children:e.title}),e.description&&t.jsx(ds,{children:e.description})]}),t.jsx(us,{children:e.children.map((a,r)=>t.jsx(ce,{path:`${n}.children.${r}`,node:a},r))}),e.footer&&e.footer.length>0&&t.jsx(ps,{children:e.footer.map((a,r)=>t.jsx(ce,{path:`${n}.footer.${r}`,node:a},r))})]})}function Ai({node:e}){const n=Q(),[s,a]=x.useState({}),r=x.useCallback((c,p)=>{a(u=>({...u,[c]:p}))},[]),i=x.useMemo(()=>({values:s,setValue:r}),[s,r]),o=x.useMemo(()=>e.submit.action.kind==="emit"?{...e.submit.action,payload:{...e.submit.action.payload??{},...s}}:{...e.submit.action,payload:{...e.submit.action.payload??{},...s}},[e.submit.action,s]);return t.jsxs("form",{onSubmit:c=>c.preventDefault(),className:"flex flex-col gap-3",children:[t.jsx(_a,{value:i,children:e.children.map((c,p)=>t.jsx(ce,{path:`${n}.children.${p}`,node:c},p))}),t.jsx(ke,{action:o,label:e.submit.label,controlId:`${n}.submit`,submit:!0,fullWidth:!0})]})}function Ii({nodeType:e}){return t.jsxs("div",{className:"text-muted-foreground rounded-md border border-dashed p-2 text-xs",children:["Unsupported widget element",e?`: ${e}`:""]})}function Gi({document:e,sessionId:n,isLatestMessage:s,channel:a}){const r=L();return t.jsx(ba,{channel:a,sessionId:n,widgetTitle:e.title,isLatestMessage:s,children:t.jsx(Hs,{value:a==null?void 0:a.snapshot,children:t.jsx(y.section,{"aria-label":e.title??"Widget",className:"text-sm",variants:r?de:void 0,initial:r?"hidden":!1,animate:r?"visible":!1,children:t.jsx(ce,{node:e.root})})})})}function Mi(e,n){const s=fa.safeParse(e);if(!s.success){const a=s.error.issues[0],r=(a==null?void 0:a.path.join("."))??"";return{ok:!1,error:a?`${r?`${r}: `:""}${a.message}`:"The widget isn’t in a shape DorkOS knows",raw:n??$i(e)}}return{ok:!0,document:s.data}}function Hi(e){let n;try{n=JSON.parse(e)}catch(s){return{ok:!1,error:s instanceof Error?s.message:"The widget isn’t readable JSON",raw:e}}return Mi(n,e)}function $i(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function Ki({error:e,raw:n}){const[s,a]=x.useState(!1);return t.jsx(ht,{gap:"none",className:"p-3 text-sm",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ot,{className:"text-muted-foreground mt-0.5 size-4 shrink-0","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium",children:"Couldn’t show this widget"}),t.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs break-words",children:e}),t.jsxs("button",{type:"button",onClick:()=>a(r=>!r),"aria-expanded":s,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring mt-2 inline-flex items-center gap-1 rounded text-xs focus-visible:ring-2 focus-visible:outline-none",children:[t.jsx(ms,{className:N("size-3 transition-transform",s&&"rotate-90")}),s?"Hide":"Show"," raw JSON"]}),s&&t.jsx("pre",{className:"bg-muted text-muted-foreground mt-2 max-h-64 overflow-auto rounded-md p-2 text-xs",children:t.jsx("code",{children:n})})]})]})})}export{Ki as W,Gi as a,U as b,Hi as p,L as u,Mi as v};
@@ -1 +1 @@
1
- import{d9 as c,da as l,r as u,j as r,B as h,G as m}from"./index-BR1m9FON.js";const d=[];function x(i){const{approvals:s}=c(),{data:t}=l();return u.useMemo(()=>{if(!t||s.length===0)return d;const a=new Set(t.filter(e=>{var o;return(o=e.manifest.contributions)==null?void 0:o[i]}).map(e=>e.id)),n=s.filter(e=>(e.changedFiles||e.updatedFrom)&&a.has(e.id)).map(e=>({id:e.id,name:e.name}));return n.length===0?d:n},[s,t,i])}function f({slot:i,onReview:s,className:t}){const a=x(i);return a.length===0?null:r.jsx("ul",{className:m("space-y-1",t),"aria-label":"Mini apps waiting for your OK",children:a.map(n=>r.jsxs("li",{"data-testid":`withheld-extension-${n.id}`,className:"bg-status-warning-bg text-status-warning-fg flex items-center justify-between gap-2 rounded-md px-3 py-1.5 text-xs",children:[r.jsxs("span",{className:"min-w-0 truncate",children:[n.name," changed and is waiting for your OK"]}),r.jsx(h,{variant:"ghost",size:"xs",className:"text-status-warning-fg shrink-0 pointer-coarse:min-h-11",onClick:s,children:"Review"})]},n.id))})}export{f as W,x as u};
1
+ import{d9 as c,da as l,r as u,j as r,B as h,G as m}from"./index-B2JoVHek.js";const d=[];function x(i){const{approvals:s}=c(),{data:t}=l();return u.useMemo(()=>{if(!t||s.length===0)return d;const a=new Set(t.filter(e=>{var o;return(o=e.manifest.contributions)==null?void 0:o[i]}).map(e=>e.id)),n=s.filter(e=>(e.changedFiles||e.updatedFrom)&&a.has(e.id)).map(e=>({id:e.id,name:e.name}));return n.length===0?d:n},[s,t,i])}function f({slot:i,onReview:s,className:t}){const a=x(i);return a.length===0?null:r.jsx("ul",{className:m("space-y-1",t),"aria-label":"Mini apps waiting for your OK",children:a.map(n=>r.jsxs("li",{"data-testid":`withheld-extension-${n.id}`,className:"bg-status-warning-bg text-status-warning-fg flex items-center justify-between gap-2 rounded-md px-3 py-1.5 text-xs",children:[r.jsxs("span",{className:"min-w-0 truncate",children:[n.name," changed and is waiting for your OK"]}),r.jsx(h,{variant:"ghost",size:"xs",className:"text-status-warning-fg shrink-0 pointer-coarse:min-h-11",onClick:s,children:"Review"})]},n.id))})}export{f as W,x as u};
@@ -1 +1 @@
1
- import{dt as H,du as v,dv as h,dw as i,dx as j,dy as S,dz as R,a5 as d,a6 as L,a7 as f,a8 as g,j as e,B as y,r as x,a3 as $,I as U,dA as G,dB as V,X as Y,dC as Z}from"./index-BR1m9FON.js";H();const M=80,z=2e4,D=64,K=500,J=200,ee=v(["queued","starting","running","ended"]).openapi("WorkItemState"),te=v(["finished","failed","stopped","limit","interrupted"]).openapi("WorkItemOutcome"),F=h({id:i(),agentId:i(),title:i(),prompt:i(),cwd:i().nullable(),state:ee,outcome:te.nullable(),note:i().nullable(),sessionId:i().nullable(),accountId:i().nullable(),addedBy:v(["person","agent"]),createdAt:i(),startedAt:i().nullable(),endedAt:i().nullable()}).openapi("WorkItem"),ne=v(["stopped","daily-cap","disk","load","accounts","chat-cap","permission","agent-paused","agent-missing"]).openapi("WorkQueueHold");h({agentId:i(),enabled:S(),target:j().int(),dailyStartCap:j().int(),startsToday:j().int(),allStopped:S(),hold:ne.nullable(),items:R(F),recent:R(F)}).openapi("WorkQueue");h({title:i().trim().min(1).max(M),prompt:i().trim().min(1).max(z),cwd:i().min(1).optional()}).openapi("AddWorkItemRequest");h({enabled:S().optional(),target:j().int().min(1).max(D).optional(),dailyStartCap:j().int().min(1).max(K).optional()}).refine(t=>t.enabled!==void 0||t.target!==void 0||t.dailyStartCap!==void 0,{message:"Send enabled, target or dailyStartCap."}).openapi("UpdateWorkQueueRequest");h({stopped:S()}).openapi("SetWorkQueuesStoppedRequest");h({itemIds:R(i().min(1)).min(1).max(J)}).openapi("ReorderWorkQueueRequest");const se=1e4,B=t=>["work-queue",t],W=(t,n)=>t.invalidateQueries({queryKey:B(n)});function ae(t){const n=d();return L({queryKey:B(t),queryFn:()=>n.getWorkQueue(t),refetchInterval:se})}function oe(t){const n=d(),s=f();return g({mutationFn:o=>n.updateWorkQueue(t,o),onSettled:()=>W(s,t)})}function ie(){const t=d(),n=f();return g({mutationFn:s=>t.setWorkQueuesStopped(s),onSettled:()=>n.invalidateQueries({queryKey:["work-queue"]})})}function re(t){const n=d(),s=f();return g({mutationFn:o=>n.reorderWorkQueue(t,o),onSettled:()=>W(s,t)})}function le(t){const n=d(),s=f();return g({mutationFn:o=>n.addWorkItem(t,o),onSettled:()=>W(s,t)})}function ue(t){const n=d(),s=f();return g({mutationFn:o=>n.removeWorkItem(t,o),onSettled:()=>W(s,t)})}function ce(t){const n=d(),s=f();return g({mutationFn:o=>n.requeueWorkItem(t,o),onSettled:()=>W(s,t)})}const de={stopped:"Waiting: every queue is stopped.","daily-cap":"Waiting: this queue reached its limit for today.",disk:"Waiting: under 20 GB of disk free.",load:"Waiting: this computer is too busy.",accounts:"Waiting: every account is near its limit.","chat-cap":"Waiting: too many chats are running.",permission:"Waiting: this agent must ask before starting chats.","agent-paused":"Waiting: this agent is paused.","agent-missing":"Waiting: this agent is not registered."},me={finished:"Finished",failed:"Failed",stopped:"Stopped",limit:"Hit an account limit",interrupted:"Interrupted by a restart"};function pe(t){const{item:n,onUp:s,onDown:o,onRemove:r}=t;return e.jsxs("li",{className:"flex items-center gap-1 rounded-md border px-3 py-2 text-sm",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.title}),e.jsx(y,{size:"icon-sm",variant:"ghost","aria-label":`Move up: ${n.title}`,disabled:!s,onClick:s,children:e.jsx(G,{className:"size-4"})}),e.jsx(y,{size:"icon-sm",variant:"ghost","aria-label":`Move down: ${n.title}`,disabled:!o,onClick:o,children:e.jsx(V,{className:"size-4"})}),e.jsx(y,{size:"icon-sm",variant:"ghost","aria-label":`Remove: ${n.title}`,onClick:r,children:e.jsx(Y,{className:"size-4"})})]})}function O(t){const{label:n,value:s,max:o,onSave:r}=t,u=x.useId();return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("label",{htmlFor:u,className:"text-sm",children:n}),e.jsx(U,{id:u,type:"number",className:"w-20",min:1,max:o,defaultValue:s,onBlur:m=>{const l=Number(m.target.value);Number.isInteger(l)&&l>=1&&l<=o&&l!==s&&r(l)}},s)]})}function T(t){const{label:n,checked:s,onChange:o}=t,r=x.useId();return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("label",{htmlFor:r,className:"text-sm",children:n}),e.jsx($,{id:r,checked:s,onCheckedChange:o})]})}function xe({agentId:t}){const n=le(t),[s,o]=x.useState(""),[r,u]=x.useState(""),m=x.useId(),l=x.useId(),b=s.trim()!==""&&r.trim()!=="";function N(c){c.preventDefault(),b&&n.mutate({title:s.trim(),prompt:r.trim()},{onSuccess:()=>{o(""),u("")}})}return e.jsxs("form",{onSubmit:N,className:"flex flex-col gap-2 rounded-md border p-3",children:[e.jsx("label",{htmlFor:m,className:"text-xs font-medium",children:"Title"}),e.jsx(U,{id:m,value:s,maxLength:M,onChange:c=>o(c.target.value)}),e.jsx("label",{htmlFor:l,className:"text-xs font-medium",children:"First message"}),e.jsx(Z,{id:l,value:r,rows:3,maxLength:z,onChange:c=>u(c.target.value)}),n.isError&&e.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t add it. Try again."}),e.jsx("div",{className:"flex justify-end",children:e.jsx(y,{type:"submit",size:"sm",disabled:!b||n.isPending,children:"Add to queue"})})]})}function ge({member:t}){var s;const n=(s=t.agent)==null?void 0:s.manifestId;return n?e.jsx(he,{agentId:n}):null}function he({agentId:t}){const n=ae(t),s=oe(t),o=ie(),r=re(t),u=ue(t),m=ce(t);if(!n.data)return null;const{enabled:l,target:b,dailyStartCap:N,startsToday:c,allStopped:P,hold:w,items:I,recent:Q}=n.data,k=I.filter(a=>a.state==="queued"),_=I.filter(a=>a.state!=="queued"),q=a=>s.mutate(a),A=(a,p)=>{const C=k.map(X=>X.id),[E]=C.splice(a,1);E!==void 0&&(C.splice(a+p,0,E),r.mutate(C))};return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto","data-slot":"profile-work-queue",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(T,{label:"Start the next item on its own",checked:l,onChange:a=>q({enabled:a})}),e.jsx(O,{label:"Chats at once",value:b,max:D,onSave:a=>q({target:a})}),e.jsx(O,{label:`Starts per day (${c} today)`,value:N,max:K,onSave:a=>q({dailyStartCap:a})}),e.jsx(T,{label:"Stop every agent's queue",checked:P,onChange:a=>o.mutate(a)}),l&&w&&e.jsx("p",{className:"text-muted-foreground text-xs",children:de[w]})]}),_.length>0&&e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-xs font-medium",children:"Running"}),e.jsx("ul",{className:"flex flex-col gap-1",children:_.map(a=>e.jsx("li",{className:"truncate rounded-md border px-3 py-2 text-sm",children:a.title},a.id))})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-xs font-medium",children:"Up next"}),k.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing is waiting."}):e.jsx("ol",{className:"flex flex-col gap-1",children:k.map((a,p)=>e.jsx(pe,{item:a,...p>0?{onUp:()=>A(p,-1)}:{},...p<k.length-1?{onDown:()=>A(p,1)}:{},onRemove:()=>u.mutate(a.id)},a.id))})]}),e.jsx(xe,{agentId:t}),Q.length>0&&e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-xs font-medium",children:"Recent"}),e.jsx("ul",{className:"flex flex-col gap-1",children:Q.map(a=>e.jsxs("li",{className:"flex items-center gap-2 px-3 py-1 text-sm",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.title}),e.jsx("span",{className:"text-muted-foreground text-xs",children:a.outcome?me[a.outcome]:null}),e.jsx(y,{size:"sm",variant:"ghost",onClick:()=>m.mutate(a.id),children:"Queue again"})]},a.id))})]})]})}export{ge as WorkQueuePage};
1
+ import{dt as H,du as v,dv as h,dw as i,dx as j,dy as S,dz as R,a5 as d,a6 as L,a7 as f,a8 as g,j as e,B as y,r as x,a3 as $,I as U,dA as G,dB as V,X as Y,dC as Z}from"./index-B2JoVHek.js";H();const M=80,z=2e4,D=64,K=500,J=200,ee=v(["queued","starting","running","ended"]).openapi("WorkItemState"),te=v(["finished","failed","stopped","limit","interrupted"]).openapi("WorkItemOutcome"),F=h({id:i(),agentId:i(),title:i(),prompt:i(),cwd:i().nullable(),state:ee,outcome:te.nullable(),note:i().nullable(),sessionId:i().nullable(),accountId:i().nullable(),addedBy:v(["person","agent"]),createdAt:i(),startedAt:i().nullable(),endedAt:i().nullable()}).openapi("WorkItem"),ne=v(["stopped","daily-cap","disk","load","accounts","chat-cap","permission","agent-paused","agent-missing"]).openapi("WorkQueueHold");h({agentId:i(),enabled:S(),target:j().int(),dailyStartCap:j().int(),startsToday:j().int(),allStopped:S(),hold:ne.nullable(),items:R(F),recent:R(F)}).openapi("WorkQueue");h({title:i().trim().min(1).max(M),prompt:i().trim().min(1).max(z),cwd:i().min(1).optional()}).openapi("AddWorkItemRequest");h({enabled:S().optional(),target:j().int().min(1).max(D).optional(),dailyStartCap:j().int().min(1).max(K).optional()}).refine(t=>t.enabled!==void 0||t.target!==void 0||t.dailyStartCap!==void 0,{message:"Send enabled, target or dailyStartCap."}).openapi("UpdateWorkQueueRequest");h({stopped:S()}).openapi("SetWorkQueuesStoppedRequest");h({itemIds:R(i().min(1)).min(1).max(J)}).openapi("ReorderWorkQueueRequest");const se=1e4,B=t=>["work-queue",t],W=(t,n)=>t.invalidateQueries({queryKey:B(n)});function ae(t){const n=d();return L({queryKey:B(t),queryFn:()=>n.getWorkQueue(t),refetchInterval:se})}function oe(t){const n=d(),s=f();return g({mutationFn:o=>n.updateWorkQueue(t,o),onSettled:()=>W(s,t)})}function ie(){const t=d(),n=f();return g({mutationFn:s=>t.setWorkQueuesStopped(s),onSettled:()=>n.invalidateQueries({queryKey:["work-queue"]})})}function re(t){const n=d(),s=f();return g({mutationFn:o=>n.reorderWorkQueue(t,o),onSettled:()=>W(s,t)})}function le(t){const n=d(),s=f();return g({mutationFn:o=>n.addWorkItem(t,o),onSettled:()=>W(s,t)})}function ue(t){const n=d(),s=f();return g({mutationFn:o=>n.removeWorkItem(t,o),onSettled:()=>W(s,t)})}function ce(t){const n=d(),s=f();return g({mutationFn:o=>n.requeueWorkItem(t,o),onSettled:()=>W(s,t)})}const de={stopped:"Waiting: every queue is stopped.","daily-cap":"Waiting: this queue reached its limit for today.",disk:"Waiting: under 20 GB of disk free.",load:"Waiting: this computer is too busy.",accounts:"Waiting: every account is near its limit.","chat-cap":"Waiting: too many chats are running.",permission:"Waiting: this agent must ask before starting chats.","agent-paused":"Waiting: this agent is paused.","agent-missing":"Waiting: this agent is not registered."},me={finished:"Finished",failed:"Failed",stopped:"Stopped",limit:"Hit an account limit",interrupted:"Interrupted by a restart"};function pe(t){const{item:n,onUp:s,onDown:o,onRemove:r}=t;return e.jsxs("li",{className:"flex items-center gap-1 rounded-md border px-3 py-2 text-sm",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.title}),e.jsx(y,{size:"icon-sm",variant:"ghost","aria-label":`Move up: ${n.title}`,disabled:!s,onClick:s,children:e.jsx(G,{className:"size-4"})}),e.jsx(y,{size:"icon-sm",variant:"ghost","aria-label":`Move down: ${n.title}`,disabled:!o,onClick:o,children:e.jsx(V,{className:"size-4"})}),e.jsx(y,{size:"icon-sm",variant:"ghost","aria-label":`Remove: ${n.title}`,onClick:r,children:e.jsx(Y,{className:"size-4"})})]})}function O(t){const{label:n,value:s,max:o,onSave:r}=t,u=x.useId();return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("label",{htmlFor:u,className:"text-sm",children:n}),e.jsx(U,{id:u,type:"number",className:"w-20",min:1,max:o,defaultValue:s,onBlur:m=>{const l=Number(m.target.value);Number.isInteger(l)&&l>=1&&l<=o&&l!==s&&r(l)}},s)]})}function T(t){const{label:n,checked:s,onChange:o}=t,r=x.useId();return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("label",{htmlFor:r,className:"text-sm",children:n}),e.jsx($,{id:r,checked:s,onCheckedChange:o})]})}function xe({agentId:t}){const n=le(t),[s,o]=x.useState(""),[r,u]=x.useState(""),m=x.useId(),l=x.useId(),b=s.trim()!==""&&r.trim()!=="";function N(c){c.preventDefault(),b&&n.mutate({title:s.trim(),prompt:r.trim()},{onSuccess:()=>{o(""),u("")}})}return e.jsxs("form",{onSubmit:N,className:"flex flex-col gap-2 rounded-md border p-3",children:[e.jsx("label",{htmlFor:m,className:"text-xs font-medium",children:"Title"}),e.jsx(U,{id:m,value:s,maxLength:M,onChange:c=>o(c.target.value)}),e.jsx("label",{htmlFor:l,className:"text-xs font-medium",children:"First message"}),e.jsx(Z,{id:l,value:r,rows:3,maxLength:z,onChange:c=>u(c.target.value)}),n.isError&&e.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t add it. Try again."}),e.jsx("div",{className:"flex justify-end",children:e.jsx(y,{type:"submit",size:"sm",disabled:!b||n.isPending,children:"Add to queue"})})]})}function ge({member:t}){var s;const n=(s=t.agent)==null?void 0:s.manifestId;return n?e.jsx(he,{agentId:n}):null}function he({agentId:t}){const n=ae(t),s=oe(t),o=ie(),r=re(t),u=ue(t),m=ce(t);if(!n.data)return null;const{enabled:l,target:b,dailyStartCap:N,startsToday:c,allStopped:P,hold:w,items:I,recent:Q}=n.data,k=I.filter(a=>a.state==="queued"),_=I.filter(a=>a.state!=="queued"),q=a=>s.mutate(a),A=(a,p)=>{const C=k.map(X=>X.id),[E]=C.splice(a,1);E!==void 0&&(C.splice(a+p,0,E),r.mutate(C))};return e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto","data-slot":"profile-work-queue",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(T,{label:"Start the next item on its own",checked:l,onChange:a=>q({enabled:a})}),e.jsx(O,{label:"Chats at once",value:b,max:D,onSave:a=>q({target:a})}),e.jsx(O,{label:`Starts per day (${c} today)`,value:N,max:K,onSave:a=>q({dailyStartCap:a})}),e.jsx(T,{label:"Stop every agent's queue",checked:P,onChange:a=>o.mutate(a)}),l&&w&&e.jsx("p",{className:"text-muted-foreground text-xs",children:de[w]})]}),_.length>0&&e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-xs font-medium",children:"Running"}),e.jsx("ul",{className:"flex flex-col gap-1",children:_.map(a=>e.jsx("li",{className:"truncate rounded-md border px-3 py-2 text-sm",children:a.title},a.id))})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-xs font-medium",children:"Up next"}),k.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing is waiting."}):e.jsx("ol",{className:"flex flex-col gap-1",children:k.map((a,p)=>e.jsx(pe,{item:a,...p>0?{onUp:()=>A(p,-1)}:{},...p<k.length-1?{onDown:()=>A(p,1)}:{},onRemove:()=>u.mutate(a.id)},a.id))})]}),e.jsx(xe,{agentId:t}),Q.length>0&&e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-xs font-medium",children:"Recent"}),e.jsx("ul",{className:"flex flex-col gap-1",children:Q.map(a=>e.jsxs("li",{className:"flex items-center gap-2 px-3 py-1 text-sm",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.title}),e.jsx("span",{className:"text-muted-foreground text-xs",children:a.outcome?me[a.outcome]:null}),e.jsx(y,{size:"sm",variant:"ghost",onClick:()=>m.mutate(a.id),children:"Queue again"})]},a.id))})]})]})}export{ge as WorkQueuePage};
@@ -1,4 +1,4 @@
1
- var Oa=Object.defineProperty;var Da=(e,t,n)=>t in e?Oa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var at=(e,t,n)=>Da(e,typeof t!="symbol"?t+"":t,n);import{O as xt,r as l,ej as Pe,j as r,_ as Q,Z as fe,is as Yn,a5 as be,rp as Fr,q as pt,l2 as Pa,cx as $a,rq as Lr,rr as Fa,rs as La,gm as Ua,B as me,dR as _e,fX as qa,G as W,J as on,X as ht,ba as wt,rt as _t,ru as Ur,rv as za,rw as Ba,aZ as ie,rx as Wa,ry as $n,fY as Ha,ip as Ga,aO as Xn,dU as Ka,ar as Qa,jI as Va,ak as yt,ab as Jn,rz as Ya,jJ as Xa,rA as Ja,bd as Za,x as ze,dm as Zn,U as Mt,iV as Ke,iW as Qe,al as es,rB as an,eu as ln,kX as ei,cz as Ze,s as bt,eC as ti,j0 as qr,eJ as ni,C as en,rC as si,l as ri,nE as zr,aX as oi,rD as ai,rE as qe,oG as Te,oP as ii,oH as cn,aR as li,i8 as ci,cF as ui,b$ as di,Y as mi,rF as dt,a4 as ts,ff as Es,dW as Br,f as Wr,rG as As,et as _s,aa as gt,qj as fi,rH as pi,qq as Tt,rI as tn,a6 as kt,kt as ns,a8 as Rt,hr as It,es as ss,cr as Ot,d2 as hi,d3 as gi,d5 as xi,d6 as yi,d7 as bi,e_ as ki,e as Ms,l$ as vi,d$ as Si,m0 as ji,ql as rs,im as wi,rJ as Ni,rK as Ci,mb as os,rL as Hr,rM as Gr,rN as Ti,rO as Ri,a7 as as,cU as Dt,er as un,ep as is,eq as Ei,rP as Ai,kB as Kr,rQ as _i,qn as Mi,ij as Ii,hS as Qr,j7 as Vr,i2 as Et,kC as Yr,fc as Oi,rR as Di,rS as Pi,o as Xr,y as dn,aW as Jr,rT as Zr,rU as $i,od as xn,rV as nn,ki as Fi,m4 as Li,bf as eo,rW as ls,rX as Ui,rY as qi,rZ as zi,ot as Bi,r_ as to,r$ as Wi,s0 as Hi,s1 as no,s2 as so,fK as Gi,s3 as Ki,f_ as Qi,fI as Vi,dA as Yi,bO as Xi,bP as Ji,bQ as Zi,bR as el,bS as tl,bT as nl,bU as sl,bW as rl,s4 as ol,pF as ro,s5 as al,s6 as il,n3 as ll,kc as cl,kd as ul,ke as dl,kf as yn,ny as ml,kg as Is,kW as fl,c4 as pl,kY as hl,c6 as gl,s7 as Os,cI as xl,gc as oo,cM as ao,cD as yl,j5 as bl,cT as io,s8 as lo,cB as co,cQ as kl,s9 as cs,cR as vl,sa as Sl,au as jl,cE as wl,sb as Nl,mP as ae,sc as Cl,sd as Tl,cP as Rl,a2 as El,aV as Xe,nU as Ds,se as Al,jx as Ye,sf as bn,e9 as Nt,sg as Ps,sh as $s,si as Fs,cA as kn,sj as ut,fg as Ct,sk as _l,cW as uo,sl as mo,sm as Ml,sn as Il,so as Ol,cX as fo,sp as Dl,sq as Pl,sr as it,ss as po,st as $l,c3 as Fl,su as Ll,sv as Ul,fZ as ho,sw as Ls,sx as ql,cb as Fn,jZ as go,eB as zl,c_ as Bl,sy as Wl,gH as Hl,gG as Gl,j$ as Kl,cs as Ql,cZ as Vl,cp as Yl,sz as Xl,am as mn,sA as Jl,sB as Zl,sC as ec,sD as xo,sE as yo,gA as bo,gB as us,ln as tc,sF as nc,sG as sc,sH as rc,jA as oc,sI as ko,pe as ac,kh as ic,sJ as jt,sK as lc,sL as cc,cV as uc,hv as dc,sM as mc,fU as fc,sN as pc,eh as hc,ku as gc,a0 as xc}from"./index-BR1m9FON.js";import{P as yc}from"./PromptSuggestionChips-CEnhme_V.js";import{u as bc,a as kc,L as vc,f as Sc,b as jc,c as wc,B as Nc,d as Cc}from"./primer-trigger-XA5fLzR5.js";import{a as Tc,u as Rc,i as Ec}from"./use-notification-prefs-BHOK2P2l.js";import{e as Ac,h as _c,q as vo,f as Mc,P as Ic,g as Oc,d as Dc,r as Pc,l as $c,j as Fc,b as Lc,G as Uc,W as So,B as qc,z as zc,D as Bc,v as Wc,w as Hc,y as Gc,p as Kc,m as Qc,t as Vc,M as Yc,i as Xc,S as Jc,k as Zc,A as eu,x as tu,R as nu,u as su}from"./use-status-budget-BBl2yxLR.js";import{B as ru}from"./banner-CSKUrrI0.js";import{t as qt,S as ds,f as sn,n as jo,O as wo,o as ou,p as au,V as No,q as iu,s as lu,v as cu,w as uu,x as Us,y as qs,z as du,A as mu,L as zs,B as Co,D as fu,G as To,H as pu,I as Ro,J as Ln,N as Bs,d as hu,K as Eo,Q as gu,u as xu,C as At,R as Ao,c as lt,k as yu,h as bu,T as ku,F as vu}from"./registry-Tbt9pcZl.js";import{s as Ws}from"./trust-dial-D__tIhzt.js";import{u as Su,b as ju}from"./WidgetErrorCard-C5ieVv_9.js";import{u as wu,D as Nu,U as Cu}from"./UnreadDivider-1aPVzwd7.js";import{a as Tu,c as Ru}from"./composer-insert-BpyATrmR.js";import{u as Eu}from"./use-composer-prefs-CjpxcBIe.js";import{A as Un,M as Au}from"./McpAppFrame-z5JUaCSA.js";import{P as _u,C as Mu,b as Iu}from"./find-latest-widget-fence-B6sJdG3Q.js";import{F as _o}from"./file-CQGljfDT.js";import{F as Ou,j as Du}from"./use-session-canvas-tvLLPQcm.js";import{F as Pu}from"./file-text-Cycq_S0e.js";import{b as Mo,e as $u,R as Fu,K as Lu,a as Uu,g as qu}from"./RuntimeConnectFlow-BYQnY5vv.js";import{S as zu}from"./shield-x-CEWfkzDN.js";import{u as Bu,M as Wu}from"./McpSigninBody-ZrnzwrOH.js";import{I as Hu}from"./image-off-DjR7LI5G.js";import{f as Gu}from"./format-duration-BCr6uzby.js";import{l as Ku}from"./use-connector-management-BLiCJMgU.js";import{A as Qu}from"./AgentRequestCard-B2gxCMGi.js";/**
1
+ var Oa=Object.defineProperty;var Da=(e,t,n)=>t in e?Oa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var at=(e,t,n)=>Da(e,typeof t!="symbol"?t+"":t,n);import{O as xt,r as l,ej as Pe,j as r,_ as Q,Z as fe,is as Yn,a5 as be,rs as Fr,q as pt,l1 as Pa,cx as $a,rt as Lr,ru as Fa,rv as La,gm as Ua,B as me,dR as _e,fX as qa,G as W,J as on,X as ht,bb as wt,rw as _t,rx as Ur,ry as za,rz as Ba,a_ as ie,rA as Wa,rB as $n,fY as Ha,ip as Ga,aP as Xn,dU as Ka,ar as Qa,jH as Va,ak as yt,ab as Jn,rC as Ya,jI as Xa,rD as Ja,be as Za,x as ze,dm as Zn,U as Mt,iu as Ke,iv as Qe,al as es,rE as an,eu as ln,kW as ei,cz as Ze,s as bt,eC as ti,iB as qr,eJ as ni,C as en,rF as si,l as ri,nl as zr,aY as oi,rG as ai,rH as qe,oJ as Te,oS as ii,oK as cn,aS as li,i8 as ci,cF as ui,b$ as di,Y as mi,rI as dt,a4 as ts,ff as Es,dW as Br,f as Wr,rJ as As,et as _s,aa as gt,qm as fi,rK as pi,qt as Tt,rL as tn,a6 as kt,ks as ns,a8 as Rt,ho as It,es as ss,cr as Ot,d2 as hi,d3 as gi,d5 as xi,d6 as yi,d7 as bi,e_ as ki,e as Ms,l_ as vi,d$ as Si,l$ as ji,qo as rs,im as wi,rM as Ni,rN as Ci,ma as os,rO as Hr,rP as Gr,rQ as Ti,rR as Ri,a7 as as,cU as Dt,er as un,ep as is,eq as Ei,rS as Ai,kA as Kr,rT as _i,qq as Mi,ij as Ii,hP as Qr,j6 as Vr,i2 as Et,kB as Yr,fc as Oi,rU as Di,rV as Pi,o as Xr,y as dn,aX as Jr,rW as Zr,rX as $i,nW as xn,rY as nn,kh as Fi,m3 as Li,bg as eo,rZ as ls,r_ as Ui,r$ as qi,s0 as zi,oa as Bi,s1 as to,s2 as Wi,s3 as Hi,s4 as no,s5 as so,fK as Gi,s6 as Ki,f_ as Qi,fI as Vi,dA as Yi,bO as Xi,bP as Ji,bQ as Zi,bR as el,bS as tl,bT as nl,bU as sl,bW as rl,s7 as ol,pI as ro,s8 as al,s9 as il,n2 as ll,kb as cl,kc as ul,kd as dl,ke as yn,nf as ml,kf as Is,kV as fl,c4 as pl,kX as hl,c6 as gl,sa as Os,cI as xl,gc as oo,cM as ao,cD as yl,j4 as bl,cT as io,sb as lo,cB as co,cQ as kl,sc as cs,cR as vl,sd as Sl,au as jl,cE as wl,se as Nl,mO as ae,sf as Cl,sg as Tl,cP as Rl,a2 as El,aW as Xe,nB as Ds,sh as Al,jw as Ye,si as bn,e9 as Nt,sj as Ps,sk as $s,sl as Fs,cA as kn,sm as ut,fg as Ct,sn as _l,cW as uo,so as mo,sp as Ml,sq as Il,sr as Ol,cX as fo,ss as Dl,st as Pl,su as it,sv as po,sw as $l,c3 as Fl,sx as Ll,sy as Ul,fZ as ho,sz as Ls,sA as ql,cb as Fn,jY as go,eB as zl,c_ as Bl,sB as Wl,gH as Hl,gG as Gl,j_ as Kl,cs as Ql,cZ as Vl,cp as Yl,sC as Xl,am as mn,sD as Jl,sE as Zl,sF as ec,sG as xo,sH as yo,gA as bo,gB as us,lm as tc,sI as nc,sJ as sc,sK as rc,jz as oc,sL as ko,ph as ac,kg as ic,sM as jt,sN as lc,sO as cc,cV as uc,hs as dc,sP as mc,fU as fc,sQ as pc,eh as hc,kt as gc,a0 as xc}from"./index-B2JoVHek.js";import{P as yc}from"./PromptSuggestionChips-BGZ3HP31.js";import{u as bc,a as kc,L as vc,f as Sc,b as jc,c as wc,B as Nc,d as Cc}from"./primer-trigger-BG3lb31_.js";import{a as Tc,u as Rc,i as Ec}from"./use-notification-prefs-6N6Y4rqG.js";import{e as Ac,h as _c,q as vo,f as Mc,P as Ic,g as Oc,d as Dc,r as Pc,l as $c,j as Fc,b as Lc,G as Uc,W as So,B as qc,z as zc,D as Bc,v as Wc,w as Hc,y as Gc,p as Kc,m as Qc,t as Vc,M as Yc,i as Xc,S as Jc,k as Zc,A as eu,x as tu,R as nu,u as su}from"./use-status-budget-DrAROrOw.js";import{B as ru}from"./banner-nfkn2OLZ.js";import{t as qt,S as ds,f as sn,n as jo,O as wo,o as ou,p as au,V as No,q as iu,s as lu,v as cu,w as uu,x as Us,y as qs,z as du,A as mu,L as zs,B as Co,D as fu,G as To,H as pu,I as Ro,J as Ln,N as Bs,d as hu,K as Eo,Q as gu,u as xu,C as At,R as Ao,c as lt,k as yu,h as bu,T as ku,F as vu}from"./registry-BcpatPes.js";import{s as Ws}from"./trust-dial-BsEooNiu.js";import{u as Su,b as ju}from"./WidgetErrorCard-D14BNvfm.js";import{u as wu,D as Nu,U as Cu}from"./UnreadDivider-DCB47jhk.js";import{a as Tu,c as Ru}from"./composer-insert-BpyATrmR.js";import{u as Eu}from"./use-composer-prefs-uC9mUd0f.js";import{A as Un,M as Au}from"./McpAppFrame-IfamHBcy.js";import{P as _u,C as Mu,b as Iu}from"./find-latest-widget-fence-D61kyRv5.js";import{F as _o}from"./file-DZ6-r1A3.js";import{F as Ou,j as Du}from"./use-session-canvas-Bub7vCaj.js";import{F as Pu}from"./file-text-4-Vc22J-.js";import{b as Mo,e as $u,R as Fu,K as Lu,a as Uu,g as qu}from"./RuntimeConnectFlow-Dinsb9em.js";import{S as zu}from"./shield-x-B2nLbkhR.js";import{u as Bu,M as Wu}from"./McpSigninBody-VmuxAjoo.js";import{I as Hu}from"./image-off-B65OAyEw.js";import{f as Gu}from"./format-duration-BCr6uzby.js";import{l as Ku}from"./use-connector-management-54m5ZcyP.js";import{A as Qu}from"./AgentRequestCard-Cnhi_1sr.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.